From: Gary V. Vaughan Date: Wed, 28 Jul 2004 16:14:01 +0000 (+0000) Subject: Fix a long-standing bug where macro_version was always empty in X-Git-Tag: release-1-9b~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88c81d7d58241b7f50304c8692147ab5e2976d15;p=thirdparty%2Flibtool.git Fix a long-standing bug where macro_version was always empty in the generated m4/ltversion.m4. Except for CVS revisions: * ltmain.in (package_revision): Don't try to deduce it from TIMESTAMP, since that is empty for release versions; simply substitute it... * configure.ac (package_revision): ...from here, having precalculated it before resetting TIMESTAMP for release versions. * bootstrap: Force regeneration of m4/ltversion.m4, but retain timestamps if there is no change to the content. --- diff --git a/ChangeLog b/ChangeLog index 6eb4a7501..789460667 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2004-07-28 Gary V. Vaughan + + Fix a long-standing bug where macro_version was always empty in + the generated m4/ltversion.m4. Except for CVS revisions: + + * ltmain.in (package_revision): Don't try to deduce it from + TIMESTAMP, since that is empty for release versions; simply + substitute it... + * configure.ac (package_revision): ...from here, having + precalculated it before resetting TIMESTAMP for release versions. + * bootstrap: Force regeneration of m4/ltversion.m4, but retain + timestamps if there is no change to the content. + 2004-07-28 Gary V. Vaughan To take full advantage of this, libtool must be bootstrapped with diff --git a/bootstrap b/bootstrap index e3fea810a..3b3fecbb7 100755 --- a/bootstrap +++ b/bootstrap @@ -44,7 +44,18 @@ if test -z "$reconfdirs"; then reconfdirs=". `ls -1d tests/*demo tests/*demo[0-9]`" fi -make top_srcdir=. -f Makefile.am ./m4/ltversion.m4 +# Extract the version number from the configure.ac file, and make +# sure that ltversion.m4 is up to date (preserving the timestamp +# if possible). +mv ./m4/ltversion.m4 .ltversion.m4T +set -- `sed '/AC_INIT/{s/[][,]//g; p;};d' configure.ac` +make top_srcdir=. VERSION="$2" -f Makefile.am ./m4/ltversion.m4 +if cmp -s ./m4/ltversion.m4 .ltversion.m4T; then + rm -f ./m4/ltversion.m4 + mv .ltversion.m4T ./m4/ltversion.m4 +else + rm -f .ltversion.m4T +fi for file in $fakes; do cat > $file <<'EOF' diff --git a/configure.ac b/configure.ac index 73a1b6848..50c85b631 100644 --- a/configure.ac +++ b/configure.ac @@ -93,15 +93,17 @@ AC_SUBST([LASTRELEASE]) # This is a sanity check so we can see which version is used in bug reports. # It is assumed that we only want to see the date extension for cvs libtool # versions (i.e. "odd" letters) and not actual alpha releases. -TIMESTAMP= +TIMESTAMP=`${CONFIG_SHELL} ${ac_aux_dir}/mkstamp < ${srcdir}/ChangeLog` +package_revision=`( set $TIMESTAMP; echo $1; )` case $lt_alpha in - [[acegikmoqsuwy]]) - TIMESTAMP=`${CONFIG_SHELL} ${ac_aux_dir}/mkstamp < ${srcdir}/ChangeLog` - AS_BOX([Configuring AC_PACKAGE_TARNAME (Build:$TIMESTAMP) AC_PACKAGE_VERSION]) - echo + [[bdfhjlnprtvxz]]) + TIMESTAMP= ;; esac +AS_BOX([Configuring AC_PACKAGE_TARNAME${TIMESTAMP:+" (Build:$TIMESTAMP)"} AC_PACKAGE_VERSION]) +echo AC_SUBST([TIMESTAMP]) +AC_SUBST([package_revision]) ## ------------------------ ## @@ -200,6 +202,6 @@ AM_CONDITIONAL(HAVE_RC, [test -n "[$]_LT_AC_TAGVAR(compiler, RC)"]) ## -------- ## ## Outputs. ## ## -------- ## -AC_CONFIG_FILES([Makefile libltdl/Makefile libltdl/loaders/Makefile +AC_CONFIG_FILES([Makefile libltdl/Makefile libltdl/loaders/Makefile doc/Makefile tests/Makefile]) AC_OUTPUT diff --git a/ltmain.in b/ltmain.in index 085a255e4..6afe1175d 100644 --- a/ltmain.in +++ b/ltmain.in @@ -59,6 +59,7 @@ PROGRAM=ltmain.sh PACKAGE=@PACKAGE@ VERSION=@VERSION@ TIMESTAMP="@TIMESTAMP@" +package_revision=@package_revision@ # Check that we have a working $echo. if test "X$1" = X--no-reexec; then @@ -93,20 +94,19 @@ rm="rm -f" # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. -package_revision=`( set $TIMESTAMP; echo $1; )` if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this AC_PROG_LIBTOOL comes from an older release. +$progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this AC_PROG_LIBTOOL comes from $PACKAGE $macro_version. +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF @@ -114,8 +114,7 @@ _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition used by this AC_PROG_LIBTOOL comes from revision -$progname: $macro_revision. +$progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF