From: Gary V. Vaughan Date: Tue, 1 Nov 2005 14:28:20 +0000 (+0000) Subject: * libtoolize.m4sh: Use serial tags to locate the correct serial X-Git-Tag: release-2-1b~438 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c215fede13e2eda941a3607424e4f3cb34012064;p=thirdparty%2Flibtool.git * libtoolize.m4sh: Use serial tags to locate the correct serial numbers when deciding whether to update. (func_serial): Allow for macro_regex argument to be originating file name. (func_serial_update): Use NL2SP to flatten list of extracted m4_include files. * tests/libtoolize.at: More tests for old-style verbatim copying of macros into aclocal.m4. --- diff --git a/ChangeLog b/ChangeLog index 746e613a0..999721f9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2005-11-01 Gary V. Vaughan + * libtoolize.m4sh: Use serial tags to locate the correct serial + numbers when deciding whether to update. + (func_serial): Allow for macro_regex argument to be originating + file name. + (func_serial_update): Use NL2SP to flatten list of extracted + m4_include files. + * tests/libtoolize.at: More tests for old-style verbatim copying + of macros into aclocal.m4. + * libltdl/m4/argz.m4, libltdl/m4/ltoptions.m4, libltdl/ltsugar.m4, libltdl/m4/ltversion.in: Add serial number tags, and bump serial number. diff --git a/libtoolize.m4sh b/libtoolize.m4sh index d8405ee45..fd0d7682c 100644 --- a/libtoolize.m4sh +++ b/libtoolize.m4sh @@ -566,6 +566,8 @@ func_serial () my_serial= for my_file in `func_included_files "$my_filename"`; do if test -z "$my_macro_regex" || + test "$my_filename" = aclocal.m4 || + test "$my_macro_regex" = `echo "$my_filename" | $SED "$basename"` || func_grep '^AC_DEFUN(\@<:@'"$my_macro_regex" "$my_file" then my_serial=`$SED -e "$my_sed_serial" "$my_file"` @@ -716,8 +718,15 @@ func_serial_update () # it has `m4_include([DESTFILE])', so the copy effectively already # updated `aclocal.m4'. my_included_files=`func_included_files aclocal.m4` - case `echo " "$my_included_files" "` in + case `echo " $my_included_files " | $NL2SP` in + + # Skip included files: *" $my_destfile "*) ;; + + # Otherwise compare to aclocal.m4 serial number (func_serial + # returns 0 for older macro serial numbers before we provided + # serial tags, so the update message will be correctly given + # if aclocal.m4 contains an untagged --i.e older-- macro file): *) if test -f aclocal.m4; then func_serial_max \ @@ -851,7 +860,7 @@ func_check_macros () func_echo "and rerunning libtoolize." fi elif test -z "$m4dir"; then - if test "$ltdldir/m4" != "$m4dir"; then + if $opt_ltdl && test "$ltdldir/m4" != "$m4dir"; then acmacrodir="$ltdldir/m4" else acmacrodir="$aclocaldir" @@ -1101,8 +1110,13 @@ func_nonemptydir_p () func_verbose "Not copying \`$m4dir/ltdl.m4', libltdl not used." fi - func_copy_some_files "$pkgmacro_files" "$aclocaldir" \ - "$m4dir" func_serial_update + my_save_IFS="$IFS" + IFS=: + for file in $pkgmacro_files; do + IFS="$my_save_IFS" + func_serial_update $file "$aclocaldir" "$m4dir" "$file" + done + IFS="$my_save_IFS" fi $opt_quiet || func_check_macros diff --git a/tests/libtoolize.at b/tests/libtoolize.at index 9969c1256..db0c3df79 100644 --- a/tests/libtoolize.at +++ b/tests/libtoolize.at @@ -46,7 +46,7 @@ AT_DATA([m4/libtool.m4], [[ # This file has a very high serial number, and should be left unchanged # until --force is passed. AT_DATA([m4/ltoptions.m4], [[ -# serial 99999 +# serial 99999 ltoptions.m4 ]]) test -d config || { rm -f config && mkdir config; } @@ -350,3 +350,126 @@ libtoolize: linking file `ltdl/m4/ltversion.m4' LT_AT_CHECK_LIBTOOLIZE([--ltdl], 0, expout) AT_CLEANUP + + +## ------------------------------------------------------ ## +## Creating an aclocal.m4 without in-tree libtool macros. ## +## ------------------------------------------------------ ## + +AT_SETUP([upgrading verbatim style aclocal.m4]) + +AT_DATA([configure.ac], +[[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[) +AC_CONFIG_AUX_DIR([config]) +LT_INIT +AC_OUTPUT +]]) + +[cat >expout <