[beast/temp-rc1] BUILD: simplify version handling, use just BST_VERSION and variants
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast/temp-rc1] BUILD: simplify version handling, use just BST_VERSION and variants
- Date: Tue, 28 Oct 2014 12:57:49 +0000 (UTC)
commit 01d730991f7b69ed11c0fcdc1b5251ab2abf581f
Author: Tim Janik <timj gnu org>
Date: Fri Oct 24 21:00:28 2014 +0200
BUILD: simplify version handling, use just BST_VERSION and variants
Makefile.am | 2 +-
bse/bse.hh | 2 -
bse/bseconfig.h.in | 16 +++----
bse/bseexports.hh | 11 ++---
bse/bsemain.cc | 24 +++++------
bse/bseplugin.cc | 12 +++---
bse/bseserver.proc | 4 +-
bse/bsestorage.cc | 16 ++++----
configure.ac | 94 +++++++++++++-----------------------------
tests/bse/filtertest.cc | 2 +-
tests/filecheck/Makefile.am | 2 +-
tests/testresampler.cc | 2 +-
12 files changed, 71 insertions(+), 116 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 7e0165e..ba90a99 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -63,5 +63,5 @@ release-check:
@echo "Checking for unlisted contributors..."
@$(srcdir)/mkrelease.sh contributors -X -B timj,stw -C $(srcdir)/beast-gtk/bstmain.c
release-upload: ChangeLog
- $(srcdir)/mkrelease.sh upload -U testbit:pub/dists/beast/v0.8/ -E configure.ac:BSE_MICRO_VERSION
+ $(srcdir)/mkrelease.sh upload -U testbit:pub/dists/beast/v0.8/ -E configure.ac:BST_MICRO_VERSION
.PHONY: release-news release-check release-upload
diff --git a/bse/bse.hh b/bse/bse.hh
index 6cbb0ad..6107de6 100644
--- a/bse/bse.hh
+++ b/bse/bse.hh
@@ -12,8 +12,6 @@ G_BEGIN_DECLS
extern const guint bse_major_version;
extern const guint bse_minor_version;
extern const guint bse_micro_version;
-extern const guint bse_interface_age;
-extern const guint bse_binary_age;
extern const gchar *bse_version;
const char* bse_check_version (guint required_major,
guint required_minor,
diff --git a/bse/bseconfig.h.in b/bse/bseconfig.h.in
index 629a16c..08f9021 100644
--- a/bse/bseconfig.h.in
+++ b/bse/bseconfig.h.in
@@ -10,20 +10,18 @@ extern "C" {
/* BSE version
*/
-#define BSE_MAJOR_VERSION (@BSE_MAJOR_VERSION@)
-#define BSE_MINOR_VERSION (@BSE_MINOR_VERSION@)
-#define BSE_MICRO_VERSION (@BSE_MICRO_VERSION@)
-#define BSE_BINARY_AGE (@BSE_BINARY_AGE@)
-#define BSE_INTERFACE_AGE (@BSE_INTERFACE_AGE@)
+#define BST_MAJOR_VERSION (@BST_MAJOR_VERSION@)
+#define BST_MINOR_VERSION (@BST_MINOR_VERSION@)
+#define BST_MICRO_VERSION (@BST_MICRO_VERSION@)
#define BSE_GETTEXT_DOMAIN ("@BST_GETTEXT_DOMAIN@")
/* check for header versions
*/
#define BSE_CHECK_VERSION(major,minor,micro) \
- (BSE_MAJOR_VERSION > (major) || \
- (BSE_MAJOR_VERSION == (major) && BSE_MINOR_VERSION > (minor)) || \
- (BSE_MAJOR_VERSION == (major) && BSE_MINOR_VERSION == (minor) && \
- BSE_MICRO_VERSION >= (micro)))
+ (BST_MAJOR_VERSION > (major) || \
+ (BST_MAJOR_VERSION == (major) && BST_MINOR_VERSION > (minor)) || \
+ (BST_MAJOR_VERSION == (major) && BST_MINOR_VERSION == (minor) && \
+ BST_MICRO_VERSION >= (micro)))
#ifdef __cplusplus
diff --git a/bse/bseexports.hh b/bse/bseexports.hh
index 23db382..3037de9 100644
--- a/bse/bseexports.hh
+++ b/bse/bseexports.hh
@@ -103,15 +103,14 @@ typedef struct {
#define BSE_EXPORT_IDENTITY_SYMBOL bse_export__identity
#define BSE_EXPORT_IDENTITY_STRING "bse_export__identity"
typedef struct {
- guint major, minor, micro;
- guint binary_age, interface_age;
- guint dummy1, dummy2, dummy3;
- guint64 export_flags;
+ uint major, minor, micro;
+ uint dummy1, dummy2, dummy3, dummy4, dummy5;
+ uint64 export_flags;
BseExportNode *export_chain;
} BseExportIdentity;
#define BSE_EXPORT_IDENTITY(HEAD) \
- { BSE_MAJOR_VERSION, BSE_MINOR_VERSION, BSE_MICRO_VERSION, \
- BSE_BINARY_AGE, BSE_INTERFACE_AGE, 0, 0, 0, \
+ { BST_MAJOR_VERSION, BST_MINOR_VERSION, BST_MICRO_VERSION, \
+ 0, 0, 0, 0, 0, \
BSE_EXPORT_CONFIG, &HEAD }
#define BSE_EXPORT_FLAG_MMX (0x1ull << 0)
diff --git a/bse/bsemain.cc b/bse/bsemain.cc
index 07192b3..b77ffd5 100644
--- a/bse/bsemain.cc
+++ b/bse/bsemain.cc
@@ -30,12 +30,10 @@ static void init_aida_idl ();
/* --- variables --- */
/* from bse.hh */
-const guint bse_major_version = BSE_MAJOR_VERSION;
-const guint bse_minor_version = BSE_MINOR_VERSION;
-const guint bse_micro_version = BSE_MICRO_VERSION;
-const guint bse_interface_age = BSE_INTERFACE_AGE;
-const guint bse_binary_age = BSE_BINARY_AGE;
-const gchar *bse_version = BSE_VERSION;
+const uint bse_major_version = BST_MAJOR_VERSION;
+const uint bse_minor_version = BST_MINOR_VERSION;
+const uint bse_micro_version = BST_MICRO_VERSION;
+const char *bse_version = BST_VERSION;
GMainContext *bse_main_context = NULL;
static volatile gboolean bse_initialization_stage = 0;
static gboolean textdomain_setup = FALSE;
@@ -112,19 +110,17 @@ _bse_init_async (int *argc, char **argv, const char *app_name, const Bse::String
const char*
bse_check_version (uint required_major, uint required_minor, uint required_micro)
{
- if (required_major > BSE_MAJOR_VERSION)
+ if (required_major > BST_MAJOR_VERSION)
return "BSE version too old (major mismatch)";
- if (required_major < BSE_MAJOR_VERSION)
+ if (required_major < BST_MAJOR_VERSION)
return "BSE version too new (major mismatch)";
- if (required_minor > BSE_MINOR_VERSION)
+ if (required_minor > BST_MINOR_VERSION)
return "BSE version too old (minor mismatch)";
- if (required_minor < BSE_MINOR_VERSION)
+ if (required_minor < BST_MINOR_VERSION)
return "BSE version too new (minor mismatch)";
- if (required_micro < BSE_MICRO_VERSION - BSE_BINARY_AGE)
- return "BSE version too new (micro mismatch)";
- if (required_micro > BSE_MICRO_VERSION)
+ if (required_micro > BST_MICRO_VERSION)
return "BSE version too old (micro mismatch)";
- return NULL;
+ return NULL; // required_micro <= BST_MICRO_VERSION
}
struct AsyncData {
diff --git a/bse/bseplugin.cc b/bse/bseplugin.cc
index 4c6584a..7166ecf 100644
--- a/bse/bseplugin.cc
+++ b/bse/bseplugin.cc
@@ -205,9 +205,9 @@ bse_exports__add_node (const BseExportIdentity *identity,
g_error ("%s: plugin startup called without plugin", G_STRFUNC);
if (!enode || enode->next)
return NULL;
- if (identity->major != BSE_MAJOR_VERSION ||
- identity->minor != BSE_MINOR_VERSION ||
- identity->micro != BSE_MICRO_VERSION)
+ if (identity->major != BST_MAJOR_VERSION ||
+ identity->minor != BST_MINOR_VERSION ||
+ identity->micro != BST_MICRO_VERSION)
startup_plugin->version_match = false;
startup_plugin->missing_export_flags = identity->export_flags & ~runtime_export_config();
if (startup_plugin->version_match && !startup_plugin->missing_export_flags)
@@ -228,9 +228,9 @@ plugin_check_identity (BsePlugin *plugin, GModule *gmodule)
if (g_module_symbol (gmodule, BSE_EXPORT_IDENTITY_STRING, (void**) &symbol_p) && *symbol_p)
{
BseExportIdentity *identity = *symbol_p;
- if (identity->major != BSE_MAJOR_VERSION ||
- identity->minor != BSE_MINOR_VERSION ||
- identity->micro != BSE_MICRO_VERSION)
+ if (identity->major != BST_MAJOR_VERSION ||
+ identity->minor != BST_MINOR_VERSION ||
+ identity->micro != BST_MICRO_VERSION)
plugin->version_match = false;
plugin->missing_export_flags = identity->export_flags & ~runtime_export_config();
plugin->chain = identity->export_chain;
diff --git a/bse/bseserver.proc b/bse/bseserver.proc
index 6e67a63..b41498d 100644
--- a/bse/bseserver.proc
+++ b/bse/bseserver.proc
@@ -388,7 +388,7 @@ BODY (BseProcedureClass *proc,
return BSE_ERROR_NONE;
wstore = sfi_wstore_new ();
- sfi_wstore_printf (wstore, "; rc-file for BSE v%s\n", BSE_VERSION);
+ sfi_wstore_printf (wstore, "; rc-file for BSE v%s\n", BST_VERSION);
/* store BseGConfig */
sfi_wstore_puts (wstore, "\n; BseGConfig Dump\n");
@@ -442,7 +442,7 @@ BODY (BseProcedureClass *proc,
const GValue *in_values,
GValue *out_values)
{
- sfi_value_set_string (out_values++, BSE_VERSION);
+ sfi_value_set_string (out_values++, BST_VERSION);
return BSE_ERROR_NONE;
}
diff --git a/bse/bsestorage.cc b/bse/bsestorage.cc
index 80cb945..22438e2 100644
--- a/bse/bsestorage.cc
+++ b/bse/bsestorage.cc
@@ -205,9 +205,9 @@ bse_storage_reset (BseStorage *self)
sfi_ppool_destroy (self->referenced_items);
self->referenced_items = NULL;
- self->major_version = BSE_MAJOR_VERSION;
- self->minor_version = BSE_MINOR_VERSION;
- self->micro_version = BSE_MICRO_VERSION;
+ self->major_version = BST_MAJOR_VERSION;
+ self->minor_version = BST_MINOR_VERSION;
+ self->micro_version = BST_MICRO_VERSION;
for (i = 0; i < self->n_dblocks; i++)
{
@@ -274,7 +274,7 @@ bse_storage_prepare_write (BseStorage *self,
mode = BseStorageMode (mode | BSE_STORAGE_SELF_CONTAINED);
BSE_OBJECT_SET_FLAGS (self, mode);
bse_storage_break (self);
- bse_storage_printf (self, "(bse-version \"%u.%u.%u\")\n\n", BSE_MAJOR_VERSION, BSE_MINOR_VERSION,
BSE_MICRO_VERSION);
+ bse_storage_printf (self, "(bse-version \"%u.%u.%u\")\n\n", BST_MAJOR_VERSION, BST_MINOR_VERSION,
BST_MICRO_VERSION);
}
void
@@ -353,11 +353,11 @@ storage_parse_bse_version (BseStorage *self)
parse_or_return (scanner, ')'); /* eat closing paren */
if (0)
g_printerr ("bse-version: code: %u.%u.%u file: %u.%u.%u feature(current):%d compat(current):%d
compat(-1):%d\n",
- BSE_MAJOR_VERSION, BSE_MINOR_VERSION, BSE_MICRO_VERSION,
+ BST_MAJOR_VERSION, BST_MINOR_VERSION, BST_MICRO_VERSION,
self->major_version, self->minor_version, self->micro_version,
- BSE_STORAGE_VERSION (self, BSE_MAJOR_VERSION, BSE_MINOR_VERSION, BSE_MICRO_VERSION),
- BSE_STORAGE_COMPAT (self, BSE_MAJOR_VERSION, BSE_MINOR_VERSION, BSE_MICRO_VERSION),
- BSE_STORAGE_COMPAT (self, BSE_MAJOR_VERSION, BSE_MINOR_VERSION, BSE_MICRO_VERSION - 1));
+ BSE_STORAGE_VERSION (self, BST_MAJOR_VERSION, BST_MINOR_VERSION, BST_MICRO_VERSION),
+ BSE_STORAGE_COMPAT (self, BST_MAJOR_VERSION, BST_MINOR_VERSION, BST_MICRO_VERSION),
+ BSE_STORAGE_COMPAT (self, BST_MAJOR_VERSION, BST_MINOR_VERSION, BST_MICRO_VERSION - 1));
return G_TOKEN_NONE;
}
diff --git a/configure.ac b/configure.ac
index 7ca323e..5a0cb8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,57 +10,48 @@ m4_include(autotools/glib-gettext.m4)
# Configure script for BEAST/BSE
#
AC_PREREQ(2.57)
-AC_INIT(beast, m4_esyscmd(./mkrelease.sh shellvar configure.ac:BST_VERSION))
+# VERSION: MAJOR.MINOR.MICRO-RC:
+# * MAJOR, MINOR: increment on ABI/API changes
+# * MICRO: increment when ABI compatible, development versions are odd
+# * RC: release candidate, may be rc[0-9]+ or empty
+AC_INIT([beast], [0.8.3]) # defines PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_STRING
AC_CONFIG_SRCDIR([bse/bseconfig.h.in])
AC_CONFIG_AUX_DIR([autotools])
AC_CONFIG_MACRO_DIR([autotools])
AC_CANONICAL_TARGET # architecture information
AM_INIT_AUTOMAKE(tar-pax no-define -Wno-portability) # don't define PACKAGE and VERSION
AM_CONFIG_HEADER(configure.h)
-
-#
-# BSE version numbers
-#
-BSE_MAJOR_VERSION=0
-BSE_MINOR_VERSION=8
-BSE_MICRO_VERSION=3
-BSE_INTERFACE_AGE=0
-BSE_BINARY_AGE=0
-dnl#
-dnl# Making releases:
-dnl# BSE_MICRO_VERSION += 1;
-dnl# BSE_INTERFACE_AGE += 1;
-dnl# BSE_BINARY_AGE += 1;
-dnl# if any functions have been added, set BSE_INTERFACE_AGE to 0.
-dnl# if backwards compatibility has been broken,
-dnl# set BSE_BINARY_AGE _and_ BSE_INTERFACE_AGE to 0.
-dnl# BST_RELEASE_CANDIDATE may contain rc[0-9]+ or nothing
-BST_RELEASE_CANDIDATE= #rc1
-
-# version number setup
-BSE_VERSION=$BSE_MAJOR_VERSION.$BSE_MINOR_VERSION.$BSE_MICRO_VERSION
-BST_VERSION=$BSE_VERSION${BST_RELEASE_CANDIDATE:+-}$BST_RELEASE_CANDIDATE # M.M.M-rcZ
-BIN_VERSION=$BSE_VERSION # binary version, used for binaries and paths
-AC_SUBST(BSE_MAJOR_VERSION)
-AC_SUBST(BSE_MINOR_VERSION)
-AC_SUBST(BSE_MICRO_VERSION)
-AC_SUBST(BSE_INTERFACE_AGE)
-AC_SUBST(BSE_BINARY_AGE)
-AC_SUBST(BSE_VERSION)
+# version handling
+BST_VERSION="$PACKAGE_VERSION"
+[BST_MAJOR_VERSION=`echo $PACKAGE_VERSION | sed 's/\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\(.*\)/\1/'`]
+[BST_MINOR_VERSION=`echo $PACKAGE_VERSION | sed 's/\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\(.*\)/\2/'`]
+[BST_MICRO_VERSION=`echo $PACKAGE_VERSION | sed 's/\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\(.*\)/\3/'`]
+[BIN_VERSION=`echo $PACKAGE_VERSION | sed 's/\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\(.*\)/\1.\2.\3/'`]
+case "$BST_VERSION" in
+0.99.*) BST_VERSION_HINT=BETA ;;
+0.*) BST_VERSION_HINT="ALPHA" ;;
+*) BST_VERSION_HINT="Stable Release"
+ test `expr $BST_MICRO_VERSION \% 2` = 1 && BST_VERSION_HINT="Development Build" ;;
+esac
+AC_DEFINE_UNQUOTED(BST_VERSION, "$BST_VERSION", [BEAST Version])
+AC_DEFINE_UNQUOTED(BIN_VERSION, "$BIN_VERSION", [Binary Version])
+AC_DEFINE_UNQUOTED(BST_VERSION_HINT, "$BST_VERSION_HINT", [Version classification])
AC_SUBST(BST_VERSION)
+AC_SUBST(BST_MAJOR_VERSION)
+AC_SUBST(BST_MINOR_VERSION)
+AC_SUBST(BST_MICRO_VERSION)
AC_SUBST(BIN_VERSION)
-AC_DEFINE_UNQUOTED(BIN_VERSION, "$BIN_VERSION", [Binary Version])
# compute libtool versions
-LT_RELEASE=$BSE_MAJOR_VERSION.$BSE_MINOR_VERSION
-LT_CURRENT=`expr $BSE_MICRO_VERSION - $BSE_INTERFACE_AGE`
-LT_REVISION=$BSE_INTERFACE_AGE
-LT_AGE=`expr $BSE_BINARY_AGE - $BSE_INTERFACE_AGE`
+LT_RELEASE=$BST_MAJOR_VERSION.$BST_MINOR_VERSION
+LT_CURRENT=$BST_MICRO_VERSION
+LT_REVISION=0
+LT_AGE=$BST_MICRO_VERSION
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
-if test 1 = $(($BSE_MICRO_VERSION & 1)) ; then
+if test 1 = $(($BST_MICRO_VERSION & 1)) ; then
DEFINE__FILE_DIR__='-D__FILE_DIR__=\"${abs_srcdir}\"'
else
DEFINE__FILE_DIR__='-D__FILE_DIR__=\"beast/${subdir}\"'
@@ -74,14 +65,6 @@ AC_SUBST(INGIT)
result=$(test -z "$INGIT" && echo yes || echo no)
AC_MSG_RESULT($result)
-dnl # figure debugging default, prior to $ac_help setup
-dnl
-if test `expr $BSE_MINOR_VERSION \% 2 \| $BSE_MAJOR_VERSION \< 1` = 1 ; then
- debug_default=yes
-else
- debug_default=minimum
-fi
-
dnl # AC_CANONICAL_HOST is provided by AC_CANONICAL_TARGET
AC_DEFINE_UNQUOTED(BST_ARCH_NAME, "$target", [Architecture Description])
@@ -90,7 +73,7 @@ AC_PROG_MAKE_SET
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# declare --enable-* args and collect ac_help strings
-AC_ARG_ENABLE(debug, [ --enable-debug=no/minimum/yes turn on debugging],,enable_debug=$debug_default)
+AC_ARG_ENABLE(debug, [ --enable-debug=no/minimum/yes turn on debugging,
default=yes],,enable_debug=yes)
AC_ARG_ENABLE(devel-mode, [ --enable-devel-mode=[no/yes] turn on development mode,
default=no],,enable_devel_mode=no)
AC_ARG_ENABLE(distcheck-tests, [ --enable-distcheck-tests turn on resource and time consuming
distcheck tests],,enable_distcheck_tests=no)
@@ -336,9 +319,6 @@ AC_DEFUN([AC_SFI_REQUIREMENTS],
])
AC_DEFUN([AC_BSE_REQUIREMENTS],
[
- dnl # --- BSE version ---
- AC_DEFINE_UNQUOTED(BSE_VERSION, "$BSE_VERSION", [BSE Version])
-
dnl # require Rapicorn
PKG_CHECK_MODULES(RAPICORN, rapicorn1410 >= 14.10.0)
MC_ASSERT_PROG(AIDACC, aidacc-1410, [aidacc gets shipped with Rapicorn])
@@ -578,22 +558,6 @@ AC_DEFUN([AC_BEAST_REQUIREMENTS],
CFLAGS=$cflags
LDFLAGS=$ldflags
- # BEAST version
- AC_DEFINE_UNQUOTED(BST_VERSION, "$BST_VERSION", [BEAST Version])
- BST_VERSION_STABLE=0
- case "$BST_VERSION" in
- 0.99.*) BST_VERSION_HINT=BETA ;;
- 0.*) BST_VERSION_HINT="ALPHA" ;;
- *) if test `expr $BSE_MINOR_VERSION \% 2` = 1 ; then
- BST_VERSION_HINT="Development Branch"
- else
- BST_VERSION_STABLE=1
- BST_VERSION_HINT="Stable Branch"
- fi ;;
- esac
- AC_DEFINE_UNQUOTED(BST_VERSION_HINT, "$BST_VERSION_HINT", [Version classification])
- AC_DEFINE_UNQUOTED(BST_VERSION_STABLE, $BST_VERSION_STABLE, [On stable branch?])
-
# --- BEAST paths ---
beastbasedir=\${datadir}/beast
beastimagesdir=$beastbasedir/v$BIN_VERSION/images
diff --git a/tests/bse/filtertest.cc b/tests/bse/filtertest.cc
index a5662cb..e881da4 100644
--- a/tests/bse/filtertest.cc
+++ b/tests/bse/filtertest.cc
@@ -122,7 +122,7 @@ Options::parse (int *argc_p,
else if (strcmp (argv[i], "--version") == 0 ||
strcmp (argv[i], "-v") == 0)
{
- printf ("%s %s\n", program_name.c_str(), BSE_VERSION);
+ printf ("%s %s\n", program_name.c_str(), BST_VERSION);
exit (0);
}
else if (check_arg (argc, argv, &i, "--dump-gnuplot-data"))
diff --git a/tests/filecheck/Makefile.am b/tests/filecheck/Makefile.am
index 4fb30a1..b377027 100644
--- a/tests/filecheck/Makefile.am
+++ b/tests/filecheck/Makefile.am
@@ -27,7 +27,7 @@ distfiles.list: Makefile
.PHONY: bse-version-check
bse-version-check: distfiles.list
- TESTVERSION="$(BSE_MAJOR_VERSION).$(BSE_MINOR_VERSION)." ; \
+ TESTVERSION="$(BST_MAJOR_VERSION).$(BST_MINOR_VERSION)." ; \
for tfile in `grep '\.bse$$' distfiles.list` ; do \
file="$(top_srcdir)/$$tfile" ; \
echo "Check project version: $$file" ; \
diff --git a/tests/testresampler.cc b/tests/testresampler.cc
index a4e893c..acb0390 100644
--- a/tests/testresampler.cc
+++ b/tests/testresampler.cc
@@ -205,7 +205,7 @@ Options::parse (int *argc_p,
else if (strcmp (argv[i], "--version") == 0 ||
strcmp (argv[i], "-v") == 0)
{
- printf ("%s %s\n", program_name.c_str(), BSE_VERSION);
+ printf ("%s %s\n", program_name.c_str(), BST_VERSION);
exit (0);
}
else if (check_arg (argc, argv, &i, "--block-size", &opt_arg))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]