From: Gary V. Vaughan Date: Mon, 29 Mar 2004 12:43:37 +0000 (+0000) Subject: * m4/libtool.m4: Use LT_INIT as #serial tag. X-Git-Tag: release-1-9b~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c301628d88deb78ca2c3015e4e0f73d455a9382;p=thirdparty%2Flibtool.git * m4/libtool.m4: Use LT_INIT as #serial tag. * libtoolize.in: Grok LT_INIT! Pass A[CM]_PROG_LIBTOOL to... (func_serial_update): ...here, we now take an additional parameter containing another regex to match ancient serialed files. (func_serial): Accept AC_DEFUN_ONCE of the #serial tag... (func_grep): ...which requires egrep... (EGREP): ...substituted by config.status. (func_scan_files): Set seen_libtool if LT_INIT goes by. --- diff --git a/ChangeLog b/ChangeLog index 57af47489..363f8afe6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2004-03-30 Gary V. Vaughan + * m4/libtool.m4: Use LT_INIT as #serial tag. + * libtoolize.in: Grok LT_INIT! Pass A[CM]_PROG_LIBTOOL to... + (func_serial_update): ...here, we now take an additional parameter + containing another regex to match ancient serialed files. + (func_serial): Accept AC_DEFUN_ONCE of the #serial tag... + (func_grep): ...which requires egrep... + (EGREP): ...substituted by config.status. + (func_scan_files): Set seen_libtool if LT_INIT goes by. + * Makefile.am (pkgmacro_DATA): Install ltoptions.m4. * libltdl/Makefile.am (AM_CPPFLAGS): Also check $top_builddir for diff --git a/libtoolize.in b/libtoolize.in index 5956c417a..66f3d91dd 100644 --- a/libtoolize.in +++ b/libtoolize.in @@ -49,6 +49,7 @@ : ${CP="cp -f"} : ${LN_S="@LN_S@"} +: ${EGREP="@EGREP@"} : ${MKDIR="mkdir"} : ${RM="rm -f"} : ${SED="@SED@"} @@ -314,7 +315,7 @@ func_copy_all_files () # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { - grep "$1" "$2" >/dev/null 2>&1 + $EGREP "$1" "$2" >/dev/null 2>&1 } # func_scan_files @@ -355,9 +356,11 @@ func_scan_files () s,^.*AC_CONFIG_AUX_DIR([[ ]*\([^])]*\).*$,auxdir=\1,; p; }; /AC_CONFIG_MACRO_DIR/ { - s,^.*AC_CONFIG_MACRO_DIR([[ ]*\([^])]*\).*$,m4dir=\1,; p; + s,^.*AC_CONFIG_MACRO_DIR([[ ]*\([^])]*\).*$,m4dir=\1,; p; }; - /A[CM]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; }; + /\(LT_INIT\|A[CM]_PROG_LIBTOOL\)/ { + s,^.*$,seen_libtool=:,; p; + }; /AC_LIB_LTDL/ { s,^.*$,seen_ltdl=:,; p; }; d;' eval `cat aclocal.m4 "$configure_ac" | $SED "$my_sed_traces" 2>/dev/null` @@ -458,7 +461,7 @@ func_serial () # in the file that AC_DEFUNs MACRO_REGEX. my_serial= for my_file in `func_included_files "$my_filename"`; do - if func_grep '^AC_DEFUN(\['"$my_macro_regex" "$my_file"; then + if func_grep '^AC_DEFUN(_ONCE)?\(\['"$my_macro_regex" "$my_file"; then my_serial=`$SED -e "$my_sed_serial" "$my_file"` break fi @@ -470,22 +473,31 @@ func_serial () echo $my_serial } -# func_serial_update srcfile destfile [macro_regex] +# func_serial_update srcfile destfile [macro_regex] [old_macro_regex] # Copy SRCFILE to DESTFILE provided SRCFILE has a newer serial number, or # DESTFILE does not yet exist, or the user specified `--force'. If given, -# MACRO_REGEX must match any text after "# serial N" in the both files. +# MACRO_REGEX or OLD_MACRO_REGEX must match any text after "# serial N" in +# both files. func_serial_update () { my_srcfile="$1" my_destfile="$2" my_macro_regex="$3" + my_old_macro_regex="$4" my_return_status=1 my_update_p=: if test -f "$my_destfile"; then my_src_serial=`func_serial "$my_srcfile" "$my_macro_regex"` + # Strictly, this libtoolize ought not to have to deal with ancient + # serial formats, but we accept them here to be complete: + test "$my_src_serial" -eq 0 && + my_src_serial=`func_serial "$my_srcfile" "$my_old_macro_regex"` + my_dest_serial=`func_serial "$my_destfile" "$my_macro_regex"` + test "$my_dest_serial" -eq 0 && + my_dest_serial=`func_serial "$my_destfile" "$my_old_macro_regex"` test "$my_src_serial" -eq 0 && { func_error "warning: no serial number on \`$my_srcfile', not copying." @@ -531,10 +543,10 @@ func_check_macros () # Don't trace for this, we're just checking the user didn't invoke it # directly from configure.ac. $SED 's,dnl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB \ - && func_echo "\`AC_PROG_RANLIB' is rendered obsolete by \`AC_PROG_LIBTOOL'" + && func_echo "\`AC_PROG_RANLIB' is rendered obsolete by \`LT_INIT'" $seen_libtool \ - || func_echo "Remember to add \`AC_PROG_LIBTOOL' to \`$configure_ac'." + || func_echo "Remember to add \`LT_INIT' to \`$configure_ac'." # FIXME: Ensure ltmain.sh, libtool.m4 and ltdl.m4 are from the same release } @@ -634,7 +646,7 @@ func_config_update () func_copy_all_files "$pkgmacrodir" "$m4dir" \ "$re_pkgmacro_files" func_serial_update - func_serial_update "$libtool_m4" "$m4dir/libtool.m4" 'A[CM]_PROG_LIBTOOL' + func_serial_update "$libtool_m4" "$m4dir/libtool.m4" LT_INIT 'A[CM]_PROG_LIBTOOL' if $seen_ltdl; then func_serial_update "$ltdl_m4" "$m4dir/ltdl.m4" 'AC_LIB_LTDL' diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 76fd1b8a2..4c8a7d5f0 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -27,7 +27,7 @@ m4_define([_LT_COPYING], [dnl # the same distribution terms that you use for the rest of that program. ]) -# serial 49 AC_PROG_LIBTOOL +# serial 49 LT_INIT # LT_PREREQ(VERSION)