diff --git a/configure.ac b/configure.ac index 63035c8c22034a17be03d4da2b2028ffdc43bb25..a7962f99471a2dfafd6edc2684ff27bf1d846e1e 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,40 @@ AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_MACRO_DIR([m4]) AC_USE_SYSTEM_EXTENSIONS([_GNU_SOURCE]) AC_CANONICAL_HOST -AX_SET_VERSION_INFO + +# Here are a set of rules to help you update your library version +# information: +# +# 1. Start with version information of â€0:0:0’ for each libtool library. +# +# 2. Update the version information only immediately before a public +# release of your software. More frequent updates are unnecessary, +# and only guarantee that the current interface number gets larger +# faster. +# +# 3. If the library source code has changed at all since the last +# update, then increment revision (â€c:r:a’ becomes â€c:r+1:a’). +# +# 4. If any interfaces have been added, removed, or changed since the +# last update, increment current, and set revision to 0. +# +# 5. If any interfaces have been added since the last public release, +# then increment age. +# +# 6. If any interfaces have been removed or changed since the last +# public release, then set age to 0. + +libknot_VERSION_INFO = -version-info 1:0:1 +libdnssec_VERSION_INFO = -version-info 0:0:0 +libknot_int_VERSION_INFO = -version-info 0:0:0 +libzscanner_VERSION_INFO = -version-info 0:1:0 +libknot_yparser_VERSION_INFO = -version-info 0:0:0 + +AC_SUBST(libknot_VERSION_INFO) +AC_SUBST(libdnssec_VERSION_INFO) +AC_SUBST(libknot_int_VERSION_INFO) +AC_SUBST(libzscanner_VERSION_INFO) +AC_SUBST(libknot_yparser_VERSION_INFO) # Automatically update release date based on configure.ac date release_date=$(sed -n 's/^Knot DNS .* (\(.*\))/\1/p;q;' ${srcdir}/NEWS) diff --git a/m4/ax_set_version_info.m4 b/m4/ax_set_version_info.m4 deleted file mode 100644 index b2cb6e2498df2fffb11e031c89ffa36aef7a6730..0000000000000000000000000000000000000000 --- a/m4/ax_set_version_info.m4 +++ /dev/null @@ -1,178 +0,0 @@ -dnl @synopsis AX_SET_VERSION_INFO [(VERSION [,PREFIX])] -dnl @synopsis default $1 = $PACKAGE_VERSION -dnl @synopsis default $2 = <none> -dnl -dnl This macro is the successor of AC_SET_RELEASEINFO_VERSIONINFO but -dnl it can be used in parallel because it uses all different variables. -dnl -dnl check the $VERSION number and cut the two last digit-sequences off -dnl which will form a -version-info in a @VERSION_INFO@ ac_subst while -dnl the rest is going to the -release name in a @RELEASE_INFO@ -dnl ac_subst. -dnl -dnl you should keep these two seperate - the release-name may contain -dnl alpha-characters and can be modified later with extra release-hints -dnl e.g. RELEASE_INFO="$RELEASE_INFO-debug" for a debug version of your -dnl lib. The $VERSION_INFO however should not be touched. -dnl -dnl example: a VERSION="2.4.18" will be transformed into -dnl -dnl RELEASE_INFO = -release 2 -dnl VERSION_INFO = -versioninfo 4:18 -dnl -dnl then use these two variables and push them to your libtool linker -dnl -dnl libtest_la_LIBADD = @RELEASE_INFO@ @VERSION_INFO@ -dnl -dnl and for a linux-target this will tell libtool to install the lib as -dnl -dnl libmy.so libmy.la libmy.a libmy-2.so.4 libmy-2.so.4.0.18 -dnl -dnl and executables will get link-resolve-infos for libmy-2.so.4 - -dnl therefore the patch-level is ignored during ldso linking, and ldso -dnl will use the one with the highest patchlevel. Using just "-release -dnl $(VERSION)" during libtool-linking would not do that - omitting the -dnl -version-info will libtool install libmy.so libmy.la libmy.a -dnl libmy-2.4.18.so and executables would get hardlinked with the -dnl 2.4.18 version of your lib. -dnl -dnl This background does also explain the default dll name for a win32 -dnl target : libtool will choose to make up libmy-2-4.dll for this -dnl version spec. -dnl -dnl this macro does also set the usual three parts of a version spec -dnl $MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION but does not ac_subst -dnl for the plain AX_SET_VERSION_INFO macro. Use instead one of the -dnl numbered macros AX_SET_VERSION_INFO1 (use first number for release -dnl part) or that AX_SET_VERSION_INFO2 (use the first two numbers for -dnl release part). -dnl -dnl You may add sublevel parts like "1.4.2-ac5" where the sublevel is -dnl just killed from these version/release substvars. That allows to -dnl grab the version off a .spec file like with AX_SPEC_PACKAGE_VERSION -dnl where the $VERSION is used to name a tarball or distpack like -dnl mylib-2.2.9pre4 -dnl -dnl Unlike earlier macros, you can use this one to break up different -dnl VERSIONs and put them into different variables, just hint with -dnl PREFIX-setting - i.e. _VERSION(2.4.5,TEST) will set variables named -dnl TEST_MAJOR_VERSION=2... and of course $TEST_RELEASE_INFO etc. (for -dnl the moment, it needs to be a literal prefix *sigh*) -dnl -dnl @category Misc -dnl @author Guido U. Draheim <guidod@gmx.de> -dnl @version 2006-10-13 -dnl @license GPLWithACException - -AC_DEFUN([AX_SET_VERSION_INFO1],[dnl -AS_VAR_PUSHDEF([MAJOR],ifelse($2,,[MAJOR_VERSION],[$2_MAJOR_VERSION]))dnl -AS_VAR_PUSHDEF([MINOR],ifelse($2,,[MINOR_VERSION],[$2_MINOR_VERSION]))dnl -AS_VAR_PUSHDEF([MICRO],ifelse($2,,[MICRO_VERSION],[$2_MICRO_VERSION]))dnl -AS_VAR_PUSHDEF([PATCH],ifelse($2,,[PATCH_VERSION],[$2_PATCH_VERSION]))dnl -AS_VAR_PUSHDEF([LTREL],ifelse($2,,[RELEASE_INFO],[$2_RELEASE_INFO]))dnl -AS_VAR_PUSHDEF([LTVER],ifelse($2,,[VERSION_INFO],[$2_VERSION_INFO]))dnl -test ".$PACKAGE_VERSION" = "." && PACKAGE_VERSION="$VERSION" -AC_MSG_CHECKING(ifelse($2,,,[$2 ])out linker version info dnl -ifelse($1,,$PACKAGE_VERSION,$1) ) - MINOR=`echo ifelse( $1, , $PACKAGE_VERSION, $1 )` - MAJOR=`echo "$MINOR" | sed -e 's/[[.]].*//'` - MINOR=`echo "$MINOR" | sed -e "s/^$MAJOR//" -e 's/^.//'` - MICRO="$MINOR" - MINOR=`echo "$MICRO" | sed -e 's/[[.]].*//'` - MICRO=`echo "$MICRO" | sed -e "s/^$MINOR//" -e 's/^.//'` - PATCH="$MICRO" - MICRO=`echo "$PATCH" | sed -e 's/[[^0-9]].*//'` - PATCH=`echo "$PATCH" | sed -e "s/^$MICRO//" -e 's/^[[-.]]//'` - if test "_$MICRO" = "_" ; then MICRO="0" ; fi - if test "_$MINOR" = "_" ; then MINOR="$MAJOR" ; MAJOR="0" ; fi - MINOR=`echo "$MINOR" | sed -e 's/[[^0-9]].*//'` - LTREL="-release $MAJOR" - LTVER="-version-info $MINOR:$MICRO" -AC_MSG_RESULT([/$MAJOR/$MINOR:$MICRO (-$MAJOR.so.$MINOR.0.$MICRO)]) -AC_SUBST(MAJOR) -AC_SUBST(MINOR) -AC_SUBST(MICRO) -AC_SUBST(PATCH) -AC_SUBST(LTREL) -AC_SUBST(LTVER) -AS_VAR_POPDEF([LTVER])dnl -AS_VAR_POPDEF([LTREL])dnl -AS_VAR_POPDEF([PATCH])dnl -AS_VAR_POPDEF([MICRO])dnl -AS_VAR_POPDEF([MINOR])dnl -AS_VAR_POPDEF([MAJOR])dnl -]) - -AC_DEFUN([AX_SET_VERSION_INFO2],[dnl -AS_VAR_PUSHDEF([MAJOR],ifelse($2,,[MAJOR_VERSION],[$2_MAJOR_VERSION]))dnl -AS_VAR_PUSHDEF([MINOR],ifelse($2,,[MINOR_VERSION],[$2_MINOR_VERSION]))dnl -AS_VAR_PUSHDEF([MICRO],ifelse($2,,[MICRO_VERSION],[$2_MICRO_VERSION]))dnl -AS_VAR_PUSHDEF([PATCH],ifelse($2,,[PATCH_VERSION],[$2_PATCH_VERSION]))dnl -AS_VAR_PUSHDEF([LTREL],ifelse($2,,[RELEASE_INFO],[$2_RELEASE_INFO]))dnl -AS_VAR_PUSHDEF([LTVER],ifelse($2,,[VERSION_INFO],[$2_VERSION_INFO]))dnl -test ".$PACKAGE_VERSION" = "." && PACKAGE_VERSION="$VERSION" -AC_MSG_CHECKING(ifelse($2,,,[$2 ])out linker version info dnl -ifelse($1,,$PACKAGE_VERSION,$1) ) - MINOR=`echo ifelse( $1, , $PACKAGE_VERSION, $1 )` - MAJOR=`echo "$MINOR" | sed -e 's/[[.]].*//'` - MINOR=`echo "$MINOR" | sed -e "s/^$MAJOR//" -e 's/^.//'` - MICRO="$MINOR" - MINOR=`echo "$MICRO" | sed -e 's/[[.]].*//'` - MICRO=`echo "$MICRO" | sed -e "s/^$MINOR//" -e 's/^.//'` - PATCH="$MICRO" - MICRO=`echo "$PATCH" | sed -e 's/[[^0-9]].*//'` - PATCH=`echo "$PATCH" | sed -e "s/^$MICRO//" -e 's/^[[-.]]//'` - test "_$MICRO" != "_" || MICRO="0" - if test "_$MINOR" != "_" ; then MINOR="$MAJOR" ; MAJOR="0" ; fi - MINOR=`echo "$MINOR" | sed -e 's/[[^0-9]].*//'` - LTREL="-release $MAJOR.$MINOR" - LTVER="-version-info 0:$MICRO" -AC_MSG_RESULT([/$MAJOR/$MINOR:$MICRO (-$MAJOR.so.$MINOR.0.$MICRO)]) -AC_SUBST(MAJOR) -AC_SUBST(MINOR) -AC_SUBST(MICRO) -AC_SUBST(PATCH) -AC_SUBST(LTREL) -AC_SUBST(LTVER) -AS_VAR_POPDEF([LTVER])dnl -AS_VAR_POPDEF([LTREL])dnl -AS_VAR_POPDEF([PATCH])dnl -AS_VAR_POPDEF([MICRO])dnl -AS_VAR_POPDEF([MINOR])dnl -AS_VAR_POPDEF([MAJOR])dnl -]) - -AC_DEFUN([AX_SET_VERSION_INFO],[dnl -AS_VAR_PUSHDEF([MAJOR],ifelse($2,,[MAJOR_VERSION],[$2_MAJOR_VERSION]))dnl -AS_VAR_PUSHDEF([MINOR],ifelse($2,,[MINOR_VERSION],[$2_MINOR_VERSION]))dnl -AS_VAR_PUSHDEF([MICRO],ifelse($2,,[MICRO_VERSION],[$2_MICRO_VERSION]))dnl -AS_VAR_PUSHDEF([PATCH],ifelse($2,,[PATCH_VERSION],[$2_PATCH_VERSION]))dnl -AS_VAR_PUSHDEF([LTREL],ifelse($2,,[RELEASE_INFO],[$2_RELEASE_INFO]))dnl -AS_VAR_PUSHDEF([LTVER],ifelse($2,,[VERSION_INFO],[$2_VERSION_INFO]))dnl -test ".$PACKAGE_VERSION" = "." && PACKAGE_VERSION="$VERSION" -AC_MSG_CHECKING(ifelse($2,,,[$2 ])out linker version info dnl -ifelse($1,,$PACKAGE_VERSION,$1) ) - MINOR=`echo ifelse( $1, , $PACKAGE_VERSION, $1 )` - MAJOR=`echo "$MINOR" | sed -e 's/[[.]].*//'` - MINOR=`echo "$MINOR" | sed -e "s/^$MAJOR//" -e 's/^.//'` - MICRO="$MINOR" - MINOR=`echo "$MICRO" | sed -e 's/[[.]].*//'` - MICRO=`echo "$MICRO" | sed -e "s/^$MINOR//" -e 's/^.//'` - PATCH="$MICRO" - MICRO=`echo "$PATCH" | sed -e 's/[[^0-9]].*//'` - PATCH=`echo "$PATCH" | sed -e "s/^$MICRO//" -e 's/[[-.]]//'` - if test "_$MICRO" = "_" ; then MICRO="0" ; fi - if test "_$MINOR" = "_" ; then MINOR="$MAJOR" ; MAJOR="0" ; fi - MINOR=`echo "$MINOR" | sed -e 's/[[^0-9]].*//'` - LTREL="-release $MAJOR" - LTVER="-version-info $MINOR:$MICRO" -AC_MSG_RESULT([/$MAJOR/$MINOR:$MICRO (-$MAJOR.so.$MINOR.0.$MICRO)]) -AC_SUBST(LTREL) -AC_SUBST(LTVER) -AS_VAR_POPDEF([LTVER])dnl -AS_VAR_POPDEF([LTREL])dnl -AS_VAR_POPDEF([PATCH])dnl -AS_VAR_POPDEF([MICRO])dnl -AS_VAR_POPDEF([MINOR])dnl -AS_VAR_POPDEF([MAJOR])dnl -]) diff --git a/src/Makefile.am b/src/Makefile.am index b28bacaa1b473d7b7d523b60bab6100b226690ea..e8802e7283890585f3ec5e6fbe041af4cba4fa93 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -153,15 +153,15 @@ libknot_la_SOURCES = \ libknot_int_la_CPPFLAGS = $(AM_CPPFLAGS) $(lmdb_CFLAGS) libknot_int_la_CFLAGS = $(AM_CFLAGS) -fvisibility=default -libknot_int_la_LDFLAGS = $(AM_LDFLAGS) $(RELEASE_INFO) $(VERSION_INFO) $(lmdb_LIBS) +libknot_int_la_LDFLAGS = $(AM_LDFLAGS) $(libknot_int_VERSION_INFO) $(lmdb_LIBS) libknot_yparser_la_CPPFLAGS = $(AM_CPPFLAGS) $(lmdb_CFLAGS) libknot_yparser_la_CFLAGS = $(AM_CFLAGS) -libknot_yparser_la_LDFLAGS = $(AM_LDFLAGS) $(RELEASE_INFO) $(VERSION_INFO) +libknot_yparser_la_LDFLAGS = $(AM_LDFLAGS) $(libknot_yparser_VERSION_INFO) libknot_yparser_la_LIBADD = libknot-int.la libknot.la libknot_la_CPPFLAGS = $(AM_CPPFLAGS) -libknot_la_LDFLAGS = $(AM_LDFLAGS) $(RELEASE_INFO) $(VERSION_INFO) +libknot_la_LDFLAGS = $(AM_LDFLAGS) $(libknot_VERSION_INFO) libknot_la_LIBADD = libknot-int.la dnssec/libdnssec.la zscanner/libzscanner.la # pkg-config diff --git a/src/dnssec/Makefile.am b/src/dnssec/Makefile.am index ba64ad9054c382782b1f715ebefab2fcf44445ec..a3b8fad293ed4075c704210cc7b8ee4f38fbbadc 100644 --- a/src/dnssec/Makefile.am +++ b/src/dnssec/Makefile.am @@ -47,7 +47,7 @@ libdnssec_la_CPPFLAGS = \ libdnssec_la_LDFLAGS = \ $(gnutls_LIBS) \ $(jansson_LIBS) \ - $(VERSION_INFO) + $(libdnssec_VERSION_INFO) libdnssec_la_LIBADD = \ libshared.la diff --git a/src/zscanner/Makefile.am b/src/zscanner/Makefile.am index 43000435862c6553238ec54a0a060cdb5b5dd6bf..ae8b507c317304ec802f16f34bea1d868e498251 100644 --- a/src/zscanner/Makefile.am +++ b/src/zscanner/Makefile.am @@ -36,6 +36,6 @@ nodist_libzscanner_la_SOURCES = \ libzscanner_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) libzscanner_la_LDFLAGS = \ $(CODE_COVERAGE_LDFLAGS) \ - $(VERSION_INFO) + $(libzscanner_VERSION_INFO) include $(srcdir)/tests/Makefile.inc