libtool-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Libtool branch, master, updated. release-2-2-2-24-g4d777f8


From: Gary V. Vaughan
Subject: [SCM] GNU Libtool branch, master, updated. release-2-2-2-24-g4d777f8
Date: Wed, 23 Apr 2008 03:22:04 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  4d777f8223aabcd4ff95aefe8fd3fb86f5e6d7ae (commit)
       via  8e72f358d8049a0e1a64b99ef6716601ef18fec0 (commit)
      from  9c3ae35db6bbd9ce82bc5479354d99f53c46e888 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4d777f8223aabcd4ff95aefe8fd3fb86f5e6d7ae
Author: Gary V. Vaughan <address@hidden>
Date:   Tue Apr 22 23:18:56 2008 -0400

    Libtoolize now advises AC_CONFIG_MACRO_DIR use where appropriate.
    
    * libtoolize.at (func_check_macros): Always advise use of
    AC_CONFIG_MACRO_DIR when not able to copy libtool macros into
    the project tree.
    * tests/libtoolize.at: New test for correct diagnosis of mismatch
    between AC_CONFIG_MACRO_DIR and ACLOCAL_AMFLAGS.
    Update expected output of other tests.
    * NEWS: Updated.

commit 8e72f358d8049a0e1a64b99ef6716601ef18fec0
Author: Gary V. Vaughan <address@hidden>
Date:   Tue Apr 22 18:55:20 2008 -0400

    Only complain that files are up-to-date with --force.
    
    As a side effect, this also means that when `aclocal' copies the
    libtool macros into `aclocal.m4' libtoolize complains only about
    the macro files that are missing or not up-to-date.
    * libtoolize.m4sh (func_echo_once): New function that prints
    the contents of a named variable only on the first call.
    (func_aclocal_update_check): New function that compares serial
    numbers of libtool macros in aclocal.m4 and only diagnoses the
    missing files.
    (func_copy, func_copy_cb, func_copy_some_files, func_serial_update)
    (func_keyword_update, func_ltmain_update, func_config_update)
    (func_install_update): Accept a new argument naming a variable
    containing a header string to print with func_echo_once iff any
    body text is output by this function.
    (func_install_pkgmacro_subproject, func_install_pkgmacro_parent)
    (func_install_pkgltdl_files, func_install_pkgconfig_subproject)
    (func_install_pkgconfig_parent: Set and pass a suitable
    header string variable for the above functions.
    (func_serial_update_check): Don't advise rerunning `libtoolize
    --force' when aclocal.m4 is not m4_including libtoolize installed
    macro files.
    * tests/testsuite.at (_LIBTOOLIZE_TRANSFORM): Transform generic
    /usr/local/share/aclocal paths to point into the uninstalled
    libtool macro directory.
    * tests/libtoolize.at: Update tests that were checking for old
    behaviour of outputing `file is already up to date' even when
    --force was not passed.
    * tests/libtoolize.at: New tests to prevent regressions of these
    smarter messages.
    * NEWS: Updated.
    Reported by Olly Betts <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |   43 ++++++++
 NEWS                |   11 ++
 libtoolize.m4sh     |  257 ++++++++++++++++++++++++++++++++++--------------
 tests/libtoolize.at |  270 +++++++++++++++++++++++++++++++++++++--------------
 tests/testsuite.at  |    5 +-
 5 files changed, 438 insertions(+), 148 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d5d41b8..ebf9ba9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-04-22  Gary V. Vaughan  <address@hidden>
+
+       Libtoolize now advises AC_CONFIG_MACRO_DIR use where appropriate.
+       * libtoolize.m4sh (func_check_macros): Always advise use of
+       AC_CONFIG_MACRO_DIR when not able to copy libtool macros into
+       the project tree.
+       * tests/libtoolize.at: New test for correct diagnosis of mismatch
+       between AC_CONFIG_MACRO_DIR and ACLOCAL_AMFLAGS.
+       Update expected output of other tests.
+       * NEWS: Updated.
+
 2008-04-22  Ralf Wildenhues  <address@hidden>
 
        Fix regression over 1.5.26 with ccache $CC -all-static.
@@ -19,6 +30,38 @@
 
 2008-04-21  Gary V. Vaughan  <address@hidden>
 
+       Only complain that files are up-to-date with --force.
+       As a side effect, this also means that when `aclocal' copies the
+       libtool macros into `aclocal.m4' libtoolize complains only about
+       the macro files that are missing or not up-to-date.
+       * libtoolize.m4sh (func_echo_once): New function that prints
+       the contents of a named variable only on the first call.
+       (func_aclocal_update_check): New function that compares serial
+       numbers of libtool macros in aclocal.m4 and only diagnoses the
+       missing files.
+       (func_copy, func_copy_cb, func_copy_some_files, func_serial_update)
+       (func_keyword_update, func_ltmain_update, func_config_update)
+       (func_install_update): Accept a new argument naming a variable
+       containing a header string to print with func_echo_once iff any
+       body text is output by this function.
+       (func_install_pkgmacro_subproject, func_install_pkgmacro_parent)
+       (func_install_pkgltdl_files, func_install_pkgconfig_subproject)
+       (func_install_pkgconfig_parent: Set and pass a suitable
+       header string variable for the above functions.
+       (func_serial_update_check): Don't advise rerunning `libtoolize
+       --force' when aclocal.m4 is not m4_including libtoolize installed
+       macro files.
+       * tests/testsuite.at (_LIBTOOLIZE_TRANSFORM): Transform generic
+       /usr/local/share/aclocal paths to point into the uninstalled
+       libtool macro directory.
+       * tests/libtoolize.at: Update tests that were checking for old
+       behaviour of outputing `file is already up to date' even when
+       --force was not passed.
+       * tests/libtoolize.at: New tests to prevent regressions of these
+       smarter messages.
+       * NEWS: Updated.
+       Reported by Olly Betts <address@hidden>
+
        Capture lt~obsolete.m4 serial number correctly in libtoolize.
        * libltdl/m4/lt~obsolete.m4: Add the filename to the #serial
        marker so that libtoolize's serial number checks can find it
diff --git a/NEWS b/NEWS
index a9b3b23..d7579e9 100644
--- a/NEWS
+++ b/NEWS
@@ -10,8 +10,19 @@ New in 2.2.4: 2008-??-??: CVS version 2.2.3a, Libtool team:
     incomplete struct types rather than void*, which means that nearly
     all casting is eliminated allowing the compiler to provide more
     type checking.
+  - libtoolize no longer reports up-to-date files that it would have
+    copied, unless --force is passed.
   - No longer reports that lt~obsolete.m4 needs to be added to aclocal.m4
     when it is already there.
+  - When `aclocal' copied the libtool macros directly into `aclocal.m4'
+    (i.e. AC_CONFIG_MACRO_DIR is not being used), libtoolize no longer
+    reports that all macros need to be added to `aclocal.m4', and
+    diagnoses only the macro files that are missing or not up-to-date.
+  - libtoolize now advises use of AC_CONFIG_MACRO_DIR to keep matching
+    libtool macros in-tree where appropriate.
+  - libtoolize now advises use of `ACLOCAL_AMFLAGS = -I m4' (or
+    equivalent) where appropriate, and errors out when ACLOCAL_AMFLAGS
+    names a different directory to AC_CONFIG_MACRO_DIR.
 
 New in 2.2.2: 2008-04-01: CVS version 2.2.1a, Libtool team:
 
diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index 3bab145..5748e23 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -202,7 +202,24 @@ configure_ac=configure.in
 }
 
 
-# func_copy srcfile destfile
+# func_echo_once msg_var
+# Calls func_echo with the value of MSG_VAR, and then sets MSG_VAR="" so
+# that subsequent calls have no effect.
+func_echo_once ()
+{
+    $opt_debug
+    if test -n "$1"; then
+      eval my_msg=\$$1
+
+      if test -n "$my_msg"; then
+        func_echo "$my_msg"
+        eval $1=""
+      fi
+    fi
+}
+
+
+# func_copy srcfile destfile [msg_var]
 # A wrapper for func_copy_cb that accepts arguments in the same order
 # as the cp(1) shell command.
 func_copy ()
@@ -217,7 +234,7 @@ func_copy ()
     if test -d "$2"; then
 
       func_copy_cb "$my_f1" \
-       `$ECHO "X$1" | $Xsed -e "$dirname"` "$2"
+       `$ECHO "X$1" | $Xsed -e "$dirname"` "$2" "$3"
 
     else
 
@@ -227,7 +244,8 @@ func_copy ()
 
       func_copy_cb "$my_f1" \
         `$ECHO "X$1" | $Xsed -e "$dirname"` \
-        `$ECHO "X$2" | $Xsed -e "$dirname"`
+        `$ECHO "X$2" | $Xsed -e "$dirname"` \
+       "$3"
 
     fi
 
@@ -235,7 +253,7 @@ func_copy ()
 }
 
 
-# func_copy_cb filename srcdir destdir
+# func_copy_cb filename srcdir destdir [msg_var]
 # If option `--copy' was specified, or soft-linking SRCFILE to DESTFILE fails,
 # then try to copy SRCFILE to DESTFILE (without changing the timestamp if
 # possible).
@@ -245,6 +263,7 @@ func_copy_cb ()
     my_file="$1"
     my_srcdir="$2"
     my_destdir="$3"
+    my_msg_var="$4"
     copy_return_status=1
 
     # Libtool is probably misinstalled if this happens:
@@ -263,11 +282,13 @@ func_copy_cb ()
        if { ( cd "$my_srcdir" && $TAR chf - "$my_file" ) 2>/dev/null \
             | ( umask 0 && cd "$my_destdir" && $TAR xf - ) >/dev/null 2>&1 ; }
        then
+         $opt_quiet || func_echo_once "$my_msg_var"
          $opt_quiet || func_echo "copying $my_copy_msg"
          copy_return_status=0
        fi
       else
        if $LN_S "$my_srcdir/$my_file" "$my_destdir/$my_file"; then
+         $opt_quiet || func_echo_once "$my_msg_var"
          $opt_quiet || func_echo "linking $my_copy_msg"
          copy_return_status=0
        fi
@@ -276,18 +297,20 @@ func_copy_cb ()
       if { ( cd "$my_srcdir" && $TAR chf - "$my_file" ) 2>/dev/null \
            | ( umask 0 && cd "$my_destdir" && $TAR xf - ) >/dev/null 2>&1; } \
         && touch "$my_destdir/$my_file"; then
+       $opt_quiet || func_echo_once "$my_msg_var"
        $opt_quiet || func_echo "copying $my_copy_msg"
        copy_return_status=0
       fi
     fi
     if test "$copy_return_status" != 0; then
+      $opt_quiet || func_echo_once "$my_msg_var"
       func_error "can not copy \`$my_srcdir/$my_file' to \`$my_destdir/'"
       exit_status=$EXIT_FAILURE
     fi
 }
 
 
-# func_copy_some_files srcfile_spec srcdir destdir [copy_cb=func_copy_cb]
+# func_copy_some_files srcfile_spec srcdir destdir [msg_var] [cb=func_copy_cb]
 # Call COPY_CB for each regular file in SRCDIR named by the ':' delimited
 # names in SRCFILE_SPEC.  The odd calling convention is needed to allow
 # spaces in file and directory names.
@@ -297,7 +320,8 @@ func_copy_some_files ()
     my_srcfile_spec="$1"
     my_srcdir="$2"
     my_destdir="$3"
-    my_copy_cb="${4-func_copy_cb}"
+    my_msg_var="$4"
+    my_copy_cb="${5-func_copy_cb}"
 
     my_save_IFS="$IFS"
     IFS=:
@@ -306,16 +330,18 @@ func_copy_some_files ()
       if test -f "$my_srcdir/$my_filename"; then
         if test "X$my_copy_cb" = Xfunc_copy_cb; then
          $opt_force || if test -f "$my_destdir/$my_filename"; then
+           $opt_quiet || func_echo_once "$my_msg_var"
            $opt_quiet \
              || func_error "\`$my_destdir/$my_filename' exists: use \`--force' 
to overwrite"
            continue
          fi
         fi
       else
+       func_echo_once "$my_msg_var"
        func_fatal_error "\`$my_filename' not found in \`$my_srcdir'"
       fi
 
-      $my_copy_cb "$my_filename" "$my_srcdir" "$my_destdir"
+      $my_copy_cb "$my_filename" "$my_srcdir" "$my_destdir" "$my_msg_var"
     done
     IFS="$my_save_IFS"
 }
@@ -560,8 +586,7 @@ func_scan_files ()
     # Find local m4 macro directory. #
     # ------------------------------ #
 
-    # If AC_CONFIG_MACRO_DIR turned nothing up, we hunt for ACLOCAL_AMFLAGS
-    # in `Makefile.am' for a `-I' argument.
+    # Hunt for ACLOCAL_AMFLAGS in `Makefile.am' for a `-I' argument.
 
     my_sed_aclocal_flags='
         /^[    ]*ACLOCAL_[A-Z_]*FLAGS[         ]*=/ {
@@ -569,12 +594,11 @@ func_scan_files ()
            q
        }
        d'
-    macrodir="$ac_macrodir"
-    if test ! -n "$macrodir" && test -f Makefile.am; then
+    if test -f Makefile.am; then
       my_macrodir_is_next=false
       for arg in `$SED "$my_sed_aclocal_flags" Makefile.am`; do
         if $my_macrodir_is_next; then
-          macrodir="$arg"
+          am_macrodir="$arg"
           break
         else
           if test "X$arg" = "X-I"; then
@@ -585,6 +609,14 @@ func_scan_files ()
         fi
       done
     fi
+
+    macrodir="$ac_macrodir"
+    test -z "$macrodir" && macrodir="$am_macrodir"
+
+    if test -n "$am_macrodir" && test -n "$ac_macrodir"; then
+      test "$am_macrodir" = "$ac_macrodir" \
+        || func_fatal_error "AC_CONFIG_MACRO_DIR([$ac_macrodir]) conflicts 
with ACLOCAL_AMFLAGS=-I $am_macrodir."
+    fi
 }
 
 # func_included_files searchfile
@@ -724,8 +756,9 @@ func_serial_update_check ()
 
       if test "X$my_dest_serial" = "X$func_serial_max_result"; then
         func_verbose "\`$my_srcfile' is serial $my_src_serial, less than 
$my_dest_serial in \`$my_destfile'"
-       $opt_force \
-         || func_error "\`$my_destfile' is newer: use \`--force' to overwrite"
+       $opt_force || if test -n "$ac_macrodir$ac_ltdldir"; then
+           func_error "\`$my_destfile' is newer: use \`--force' to overwrite"
+        fi
       fi
     fi
 
@@ -733,7 +766,45 @@ func_serial_update_check ()
 }
 
 
-# func_serial_update filename srcdir destdir [macro_regex] [old_macro_regex]
+# func_aclocal_update_check filename
+# Unless serial number of FILENAME is newer than the matching serial number
+# in aclocal.m4, set $func_aclocal_update_check to 'false'.
+func_aclocal_update_check ()
+{
+    $opt_debug
+    my_srcfile="$aclocaldir/$1"
+    my_destfile="aclocal.m4"
+
+    case $need in
+      libtool.m4)
+       my_src_serial=`func_serial "$my_srcfile" LT_INIT`
+       my_dest_serial=`func_serial "$my_destfile" LT_INIT`
+
+       # Strictly, this libtoolize ought not to have to deal with ancient
+       # serial formats, but we accept them here to be complete:
+       test "X$my_src_serial" = "X0" &&
+         my_src_serial=`func_serial "$my_srcfile" 'A[CM]_PROG_LIBTOOL'`
+       test "X$my_dest_serial" = "X0" &&
+         my_dest_serial=`func_serial "$my_destfile" 'A[CM]_PROG_LIBTOOL'`
+       ;;
+      ltdl.m4)
+       my_src_serial=`func_serial "$my_srcfile" LTDL_INIT`
+       my_dest_serial=`func_serial "$my_destfile" LTDL_INIT`
+       ;;
+      *)
+       my_src_serial=`func_serial "$my_srcfile" "$need"`
+       my_dest_serial=`func_serial "$my_destfile" "$need"`
+       ;;
+    esac
+
+    func_serial_update_check \
+      "$my_srcfile" "$my_src_serial" "$my_destfile" "$my_dest_serial"
+
+    func_aclocal_update_check_result="$func_serial_update_check_result"
+}
+
+
+# func_serial_update filename srcdir destdir [msg_var] [macro_re] 
[old_macro_re]
 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
 # has a newer serial number, or DESTFILE does not yet exist, or the user
 # specified `--force' at the command line.  If given, MACRO_REGEX or
@@ -744,8 +815,9 @@ func_serial_update ()
     my_filename="$1"
     my_srcdir="$2"
     my_destdir="$3"
-    my_macro_regex="$4"
-    my_old_macro_regex="$5"
+    my_msg_var="$4"
+    my_macro_regex="$5"
+    my_old_macro_regex="$6"
 
     my_serial_update_p=:
     my_return_status=1
@@ -772,9 +844,10 @@ func_serial_update ()
     fi
 
     if $my_serial_update_p || $opt_force; then
-      func_copy "$my_srcfile" "$my_destfile"
+      func_copy "$my_srcfile" "$my_destfile" "$my_msg_var"
       my_return_status=$?
-    elif test "X$my_dest_serial" = "X$my_src_serial"; then
+    elif $opt_force && test "X$my_dest_serial" = "X$my_src_serial"; then
+      $opt_quiet || func_echo_once "$my_msg_var"
       $opt_quiet \
         || func_echo "\`$my_destfile' is already up to date."
     fi
@@ -796,8 +869,10 @@ func_serial_update ()
         if test -f aclocal.m4; then
           func_serial_max \
               "$my_src_serial" `func_serial aclocal.m4 "$my_macro_regex"`
-          test "X$my_src_serial" = "X$func_serial_max_result" \
-             && func_echo "You should add the contents of \`$my_destfile' to 
\`aclocal.m4'."
+          if test "X$my_src_serial" = "X$func_serial_max_result"; then
+              func_echo_once "$my_msg_var"
+             func_echo "You should add the contents of \`$my_destfile' to 
\`aclocal.m4'."
+          fi
         fi
         ;;
     esac
@@ -805,7 +880,7 @@ func_serial_update ()
 }
 
 
-# func_keyword_update filename srcdir destdir sed_script
+# func_keyword_update filename srcdir destdir sed_script [msg_var]
 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
 # has a newer revision according to the serial number extracted by
 # SED_SCRIPT, or DESTFILE does not yet exist, or the user specified
@@ -817,6 +892,7 @@ func_keyword_update ()
     my_srcdir="$2"
     my_destdir="$3"
     my_sed_script="$4"
+    my_msg_var="$5"
 
     my_srcfile="$my_srcdir/$my_filename"
     my_destfile="$my_destdir/$my_filename"
@@ -841,15 +917,15 @@ func_keyword_update ()
     fi
 
     if $my_keyword_update_p || $opt_force; then
-      func_copy "$my_srcfile" "$my_destfile"
-    elif test "X$my_dest_serial" = "X$my_src_serial"; then
-      $opt_quiet \
-        || func_echo "\`$my_destfile' is already up to date."
+      func_copy "$my_srcfile" "$my_destfile" "$my_msg_var"
+    elif $opt_verbose || $opt_force && test "X$my_dest_serial" = 
"X$my_src_serial"; then
+      func_echo_once "$my_msg_var"
+      func_echo "\`$my_destfile' is already up to date."
     fi
 }
 
 
-# func_ltmain_update filename srcdir destdir
+# func_ltmain_update filename srcdir destdir [msg_var]
 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
 # has a newer revision, or DESTFILE does not yet exist, or the user
 # specified `--force' at the command line.
@@ -863,13 +939,13 @@ func_ltmain_update ()
        }
        d'
 
-    func_keyword_update "$1" "$2" "$3" "$my_sed_ltmain"
+    func_keyword_update "$1" "$2" "$3" "$my_sed_ltmain" "$4"
 
     return $my_return_status
 }
 
 
-# func_config_update filename srcdir destdir
+# func_config_update filename srcdir destdir [msg_var]
 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
 # has a newer timestamp, or DESTFILE does not yet exist, or the user
 # specified `--force' at the command line.
@@ -884,13 +960,13 @@ func_config_update ()
        }
        d'
 
-    func_keyword_update "$1" "$2" "$3" "$my_sed_config"
+    func_keyword_update "$1" "$2" "$3" "$my_sed_config" "$4"
 
     return $my_return_status
 }
 
 
-# func_install_update filename srcdir destdir
+# func_install_update filename srcdir destdir [msg_var]
 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
 # has a newer timestamp, or DESTFILE does not yet exist, or the user
 # specified `--force' at the command line.
@@ -905,7 +981,7 @@ func_install_update ()
        }
        d'
 
-    func_keyword_update "$1" "$2" "$3" "$my_sed_install"
+    func_keyword_update "$1" "$2" "$3" "$my_sed_install" "$4"
 
     return $my_return_status
 }
@@ -950,13 +1026,13 @@ func_install_pkgmacro_subproject ()
     # Copy all the files from installed libltdl to this project, if the
     # user specified a macrodir.
     $opt_quiet || if test "x$macrodir" != "x$subproject_macrodir"; then
-      func_echo "putting macros in \`$subproject_macrodir'."
+      pkgmacro_header="putting macros in \`$subproject_macrodir'."
     elif test -n "$subproject_macrodir"; then
-      func_echo "putting macros in AC_CONFIG_MACRO_DIR, 
\`$subproject_macrodir'."
+      pkgmacro_header="putting macros in AC_CONFIG_MACRO_DIR, 
\`$subproject_macrodir'."
     fi
 
     func_copy_some_files "argz.m4:libtool.m4:ltdl.m4:$pkgmacro_files" \
-      "$aclocaldir" "$subproject_macrodir"
+      "$aclocaldir" "$subproject_macrodir" pkgmacro_header
 }
 
 
@@ -971,22 +1047,24 @@ func_install_pkgmacro_parent ()
     # Copy all the files from installed libltdl to this project, if the
     # user specified a macrodir.
     $opt_quiet || if test -n "$ac_macrodir"; then
-      func_echo "putting macros in AC_CONFIG_MACRO_DIR, \`$ac_macrodir'."
+      my_pkgmacro_header="putting macros in AC_CONFIG_MACRO_DIR, 
\`$ac_macrodir'."
     elif test -n "$macrodir"; then
-      func_echo "putting macros in \`$macrodir'."
+      my_pkgmacro_header="putting macros in \`$macrodir'."
     fi
 
     if $opt_ltdl; then
-      func_serial_update argz.m4 "$aclocaldir" "$macrodir" argz.m4
+      func_serial_update argz.m4 "$aclocaldir" "$macrodir" \
+        my_pkgmacro_header argz.m4
     else
       func_verbose "Not copying \`$macrodir/argz.m4', libltdl not used."
     fi
 
     func_serial_update  libtool.m4 "$aclocaldir" "$macrodir" \
-      LT_INIT 'A[CM]_PROG_LIBTOOL'
+      my_pkgmacro_header LT_INIT 'A[CM]_PROG_LIBTOOL'
 
     if $opt_ltdl; then
-      func_serial_update ltdl.m4 "$aclocaldir" "$macrodir" 'LTDL_INIT'
+      func_serial_update ltdl.m4 "$aclocaldir" "$macrodir" \
+        my_pkgmacro_header 'LTDL_INIT'
     else
       func_verbose "Not copying \`$macrodir/ltdl.m4', libltdl not used."
     fi
@@ -995,7 +1073,8 @@ func_install_pkgmacro_parent ()
     IFS=:
     for file in $pkgmacro_files; do
       IFS="$my_save_IFS"
-      func_serial_update $file "$aclocaldir" "$macrodir" "$file"
+      func_serial_update "$file" "$aclocaldir" "$macrodir" \
+        my_pkgmacro_header "$file"
     done
     IFS="$my_save_IFS"
 }
@@ -1081,9 +1160,9 @@ func_install_pkgltdl_files ()
     # Copy all the files from installed libltdl to this project, if the
     # user specified `--ltdl'.
     $opt_quiet || if test -n "$ac_ltdldir"; then
-      func_echo "putting libltdl files in LT_CONFIG_LTDL_DIR, \`$ac_ltdldir'."
+      pkgltdl_header="putting libltdl files in LT_CONFIG_LTDL_DIR, 
\`$ac_ltdldir'."
     elif test -n "$ltdldir"; then
-      func_echo "putting libltdl files in \`$ltdldir'."
+      pkgltdl_header="putting libltdl files in \`$ltdldir'."
     fi
 
     # These files are handled specially, depending on ltdl_mode:
@@ -1093,7 +1172,8 @@ func_install_pkgltdl_files ()
       func_massage_pkgltdl_files 'Makefile.am|Makefile.in*|aclocal.m4|config*'
     fi
 
-    func_copy_some_files "$pkgltdl_files" "$pkgltdldir/libltdl" "$ltdldir"
+    func_copy_some_files "$pkgltdl_files" \
+      "$pkgltdldir/libltdl" "$ltdldir" pkgltdl_header
 
     # For recursive ltdl modes, copy a suitable Makefile.{am,inc}:
     case $ltdl_mode in
@@ -1149,12 +1229,13 @@ func_install_pkgconfig_subproject ()
     # Copy all the files from installed libltdl to this project, if the
     # user specified an auxdir.
     $opt_quiet || if test "x$ac_auxdir" = "x$subproject_auxdir"; then
-      func_echo "putting auxiliary files in AC_CONFIG_AUX_DIR, 
\`$subproject_auxdir'."
+      pkgconfig_header="putting auxiliary files in AC_CONFIG_AUX_DIR, 
\`$subproject_auxdir'."
     elif test -n "$auxdir"; then
-      func_echo "putting auxiliary files in \`$auxdir'."
+      pkgconfig_header="putting auxiliary files in \`$auxdir'."
     fi
 
-    func_copy_some_files "$pkgconfig_files" "$pkgdatadir" "$ltdldir"
+    func_copy_some_files "$pkgconfig_files" \
+      "$pkgdatadir" "$ltdldir" pkgconfig_header
 }
 
 
@@ -1166,20 +1247,22 @@ func_install_pkgconfig_parent ()
 {
     $opt_debug
 
-    # Copy all the files from installed libltdl to this project, if the
-    # user specified an auxdir.
-    $opt_quiet || if test -n "$ac_auxdir"; then
-      func_echo "putting auxiliary files in AC_CONFIG_AUX_DIR, \`$ac_auxdir'."
+    if test -n "$ac_auxdir"; then
+      pkgconfig_header="putting auxiliary files in AC_CONFIG_AUX_DIR, 
\`$ac_auxdir'."
     elif test -n "$auxdir" || test "x$ltdldir" = "x."; then
-      func_echo "putting auxiliary files in \`$auxdir'."
+      pkgconfig_header="putting auxiliary files in \`$auxdir'."
     fi
 
     if $opt_install; then
-      func_config_update config.guess "$pkgdatadir/config" "$auxdir"
-      func_config_update config.sub   "$pkgdatadir/config" "$auxdir"
-      func_install_update install-sh  "$pkgdatadir/config" "$auxdir"
+      func_config_update config.guess \
+        "$pkgdatadir/config" "$auxdir" pkgconfig_header
+      func_config_update config.sub \
+        "$pkgdatadir/config" "$auxdir" pkgconfig_header
+      func_install_update install-sh \
+        "$pkgdatadir/config" "$auxdir" pkgconfig_header
     fi
-    func_ltmain_update ltmain.sh "$pkgdatadir/config" "$auxdir"
+    func_ltmain_update ltmain.sh \
+      "$pkgdatadir/config" "$auxdir" pkgconfig_header
 }
 
 
@@ -1247,18 +1330,7 @@ func_check_macros ()
 
     ac_config_macro_dir_advised=false
 
-
-    # Suggest modern idioms for storing autoconf macros:
-    if test -z "$ac_macrodir$ltdldir"; then
-      if test x"$macrodir" = x.; then
-       func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([m4])' to 
$configure_ac and rerunning"
-       func_echo " libtoolize, to keep the correct libtool macros in-tree."
-      else
-       func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([$macrodir])'to 
$configure.ac,"
-       func_echo "and rerunning libtoolize."
-      fi
-
-    elif test -z "$macrodir"; then
+    if test -n "$ac_macrodir$ltdldir" && test -z "$macrodir"; then
       my_ac_config_macro_srcdir="$aclocaldir"
       if $opt_ltdl && test "$macrodir" != "$subproject_macrodir"; then
        my_ac_config_macro_srcdir="$subproject_macrodir"
@@ -1267,14 +1339,25 @@ func_check_macros ()
       my_needed="libtool.m4 ltoptions.m4 ltversion.m4 ltsugar.m4 
lt~obsolete.m4"
       $opt_ltdl && my_needed="$my_needed argz.m4 ltdl.m4"
 
-      func_echo "You should add the contents of the following files to 
\`aclocal.m4':"
-      for need in $my_needed; do
-       func_echo "  \`$my_ac_config_macro_srcdir/$need'"
-      done
+      if test -f "aclocal.m4"; then
+       for need in $my_needed; do
+         func_aclocal_update_check $need
+         $func_aclocal_update_check_result && my_missing="$my_missing $need"
+       done
+      else
+        my_missing="$my_needed"
+      fi
 
-      if test "$my_ac_config_macro_srcdir" != "$aclocaldir"; then
-        func_echo "or else add \`AC_CONFIG_MACRO_DIR([$subproject_macrodir])' 
to $configure_ac."
-       ac_config_macro_dir_advised=:
+      if test -n "$my_missing"; then
+        func_echo "You should add the contents of the following files to 
\`aclocal.m4':"
+        for need in $my_missing; do
+         func_echo "  \`$my_ac_config_macro_srcdir/$need'"
+        done
+
+        if test "$my_ac_config_macro_srcdir" != "$aclocaldir"; then
+          func_echo "or else add 
\`AC_CONFIG_MACRO_DIR([$subproject_macrodir])' to $configure_ac."
+         ac_config_macro_dir_advised=:
+        fi
       fi
     fi
 
@@ -1302,9 +1385,33 @@ func_check_macros ()
           func_echo "Consider using \`AC_CONFIG_AUX_DIR([$subproject_auxdir])' 
in $configure_ac."
         $ac_config_macro_dir_advised || test "$subproject_macrodir" = 
"$macrodir" ||
           func_echo "Consider using 
\`AC_CONFIG_MACRO_DIR([$subproject_macrodir])' in $configure_ac."
+       ac_config_macro_dir_advised=:
       fi
     fi
 
+    # Suggest modern idioms for storing autoconf macros:
+    $ac_config_macro_dir_advised || if test -z "$ac_macrodir" || test 
x"$macrodir" = x.; then
+      func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([m4])' to $configure_ac 
and"
+      func_echo "rerunning libtoolize, to keep the correct libtool macros 
in-tree."
+      ac_config_macro_dir_advised=:
+
+    elif test -z "$ac_macrodir$ltdldir"; then
+      func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([$macrodir])' to 
$configure_ac,"
+      func_echo "and rerunning libtoolize and aclocal."
+      ac_config_macro_dir_advised=:
+    fi
+
+    if test -z "$am_macrodir$macrodir"; then
+      func_echo "Consider adding \`-I m4' to ACLOCAL_AMFLAGS in Makefile.am."
+
+    elif test -z "$am_macrodir"; then
+      if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" && test 
"$subproject_macrodir" != "$macrodir"; then
+       func_echo "Consider adding \`-I $subproject_macrodir' to 
ACLOCAL_AMFLAGS in Makefile.am."
+      else
+        func_echo "Consider adding \`-I $macrodir' to ACLOCAL_AMFLAGS in 
Makefile.am."
+      fi
+    fi 
+
     # 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 
>/dev/null &&
diff --git a/tests/libtoolize.at b/tests/libtoolize.at
index 948e219..25d6647 100644
--- a/tests/libtoolize.at
+++ b/tests/libtoolize.at
@@ -1,6 +1,6 @@
 # libtoolize.at -- test libtoolize operation                  -*- Autotest -*-
 #
-#   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+#   Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
 #   Written by Gary V. Vaughan, 2005
 #
 #   This file is part of GNU Libtool.
@@ -46,6 +46,10 @@ test -d m4 || { rm -f m4 && mkdir m4; }
 
 rm -f m4/libtool.m4 m4/ltoptions.m4 build-aux/ltmain.sh
 
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I m4
+]])
+
 # This file should be upgraded.
 AT_DATA([m4/libtool.m4], [[
 # serial 25 LT_INIT
@@ -89,6 +93,7 @@ libtoolize: copying file `m4/ltoptions.m4'
 libtoolize: copying file `m4/ltsugar.m4'
 libtoolize: copying file `m4/ltversion.m4'
 libtoolize: copying file `m4/lt~obsolete.m4'
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
@@ -96,6 +101,26 @@ LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
 AT_CLEANUP
 
 
+## ------------------------- ##
+## ACLOCAL_AMFLAGS mismatch. ##
+## ------------------------- ##
+
+AT_SETUP([libtoolize macro directory mismatch error])
+
+_LT_CONFIGURE_AC
+
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I me2
+]])
+
+AT_DATA(experr,
+[[libtoolize: AC_CONFIG_MACRO_DIR([m4]) conflicts with ACLOCAL_AMFLAGS=-I me2.
+]])
+
+LT_AT_CHECK_LIBTOOLIZE([--copy], 1, [ignore], experr)
+
+AT_CLEANUP
+
 ## -------------- ##
 ## Serial update. ##
 ## -------------- ##
@@ -111,8 +136,7 @@ _LT_LIBTOOLIZE_SETUP
 ## -------------------------------------------------------------------- ##
 
 AT_DATA(expout,
-[[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
-libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
+[[libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
 libtoolize: copying file `m4/libtool.m4'
 libtoolize: copying file `m4/ltsugar.m4'
 libtoolize: copying file `m4/ltversion.m4'
@@ -131,14 +155,7 @@ LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout, experr)
 ## Next, a second update attempt with everything now updated. ##
 ## ---------------------------------------------------------- ##
 
-AT_DATA(expout,
-[[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
-libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
-libtoolize: `m4/libtool.m4' is already up to date.
-libtoolize: `m4/ltsugar.m4' is already up to date.
-libtoolize: `m4/ltversion.m4' is already up to date.
-libtoolize: `m4/lt~obsolete.m4' is already up to date.
-]])
+AT_DATA(expout, [[]])
 
 AT_DATA(experr,
 [[libtoolize: `build-aux/ltmain.sh' is newer: use `--force' to overwrite
@@ -166,24 +183,14 @@ libtoolize: copying file `m4/lt~obsolete.m4'
 LT_AT_CHECK_LIBTOOLIZE([--copy --force], 0, expout)
 
 
-## --------------------------------------------------------- ##
-## A final update attempt with everything now force updated. ##
-## --------------------------------------------------------- ##
+## ---------------------------------------------------------------- ##
+## A final update attempt with everything previously force updated. ##
+## ---------------------------------------------------------------- ##
 
-AT_DATA(expout,
-[[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
-libtoolize: `build-aux/ltmain.sh' is already up to date.
-libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
-libtoolize: `m4/libtool.m4' is already up to date.
-libtoolize: `m4/ltoptions.m4' is already up to date.
-libtoolize: `m4/ltsugar.m4' is already up to date.
-libtoolize: `m4/ltversion.m4' is already up to date.
-libtoolize: `m4/lt~obsolete.m4' is already up to date.
-]])
+AT_DATA(expout, [[]])
 
 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
 
-
 AT_CLEANUP
 
 
@@ -225,17 +232,7 @@ LT_AT_CHECK_LIBTOOLIZE([--copy --install], 0, expout, 
experr)
 ## Next, a second update attempt with everything now updated. ##
 ## ---------------------------------------------------------- ##
 
-AT_DATA(expout,
-[[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
-libtoolize: `build-aux/config.guess' is already up to date.
-libtoolize: `build-aux/config.sub' is already up to date.
-libtoolize: `build-aux/install-sh' is already up to date.
-libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
-libtoolize: `m4/libtool.m4' is already up to date.
-libtoolize: `m4/ltsugar.m4' is already up to date.
-libtoolize: `m4/ltversion.m4' is already up to date.
-libtoolize: `m4/lt~obsolete.m4' is already up to date.
-]])
+AT_DATA(expout, [[]])
 
 AT_DATA(experr,
 [[libtoolize: `build-aux/ltmain.sh' is newer: use `--force' to overwrite
@@ -266,23 +263,11 @@ libtoolize: copying file `m4/lt~obsolete.m4'
 LT_AT_CHECK_LIBTOOLIZE([--copy --force --install], 0, expout)
 
 
-## --------------------------------------------------------- ##
-## A final update attempt with everything now force updated. ##
-## --------------------------------------------------------- ##
+## ---------------------------------------------------------------- ##
+## A final update attempt with everything previously force updated. ##
+## ---------------------------------------------------------------- ##
 
-AT_DATA(expout,
-[[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
-libtoolize: `build-aux/config.guess' is already up to date.
-libtoolize: `build-aux/config.sub' is already up to date.
-libtoolize: `build-aux/install-sh' is already up to date.
-libtoolize: `build-aux/ltmain.sh' is already up to date.
-libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
-libtoolize: `m4/libtool.m4' is already up to date.
-libtoolize: `m4/ltoptions.m4' is already up to date.
-libtoolize: `m4/ltsugar.m4' is already up to date.
-libtoolize: `m4/ltversion.m4' is already up to date.
-libtoolize: `m4/lt~obsolete.m4' is already up to date.
-]])
+AT_DATA(expout, [[]])
 
 LT_AT_CHECK_LIBTOOLIZE([--copy --install], 0, expout)
 
@@ -340,6 +325,7 @@ libtoolize: copying file `ltdl/ltdl.h'
 libtoolize: copying file `ltdl/slist.c'
 libtoolize: creating file `ltdl/Makefile.inc'
 libtoolize: Remember to add `LT_CONFIG_LTDL_DIR([ltdl])' to `configure.ac'.
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 AT_DATA([configure.ac],
@@ -427,6 +413,10 @@ LT_INIT
 LTDL_INIT
 AC_OUTPUT
 ]])
+
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I ltdl/m4
+]])
 ])# _LT_AT_LTDL_SETUP
 
 ## ------------------------------------------------ ##
@@ -512,6 +502,7 @@ libtoolize: copying file `ltdl/ltdl.c'
 libtoolize: copying file `ltdl/ltdl.h'
 libtoolize: copying file `ltdl/slist.c'
 libtoolize: Remember to add `LTDL_INIT' to configure.ac.
+libtoolize: Consider adding `-I ltdl/m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 AT_DATA([configure.ac],
@@ -542,16 +533,19 @@ LT_INIT
 AC_OUTPUT
 ]])
 
-[cat >expout <<EOF
-libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, \`build-aux'.
-libtoolize: copying file \`build-aux/ltmain.sh'
-libtoolize: You should add the contents of the following files to 
\`aclocal.m4':
-libtoolize:   \`$tst_aclocaldir/libtool.m4'
-libtoolize:   \`$tst_aclocaldir/ltoptions.m4'
-libtoolize:   \`$tst_aclocaldir/ltversion.m4'
-libtoolize:   \`$tst_aclocaldir/ltsugar.m4'
-libtoolize:   \`$tst_aclocaldir/lt~obsolete.m4'
-EOF]
+AT_DATA([expout],
+[[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
+libtoolize: copying file `build-aux/ltmain.sh'
+libtoolize: You should add the contents of the following files to `aclocal.m4':
+libtoolize:   `/usr/local/share/aclocal/libtool.m4'
+libtoolize:   `/usr/local/share/aclocal/ltoptions.m4'
+libtoolize:   `/usr/local/share/aclocal/ltversion.m4'
+libtoolize:   `/usr/local/share/aclocal/ltsugar.m4'
+libtoolize:   `/usr/local/share/aclocal/lt~obsolete.m4'
+libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
+libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
+]])
 
 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
 
@@ -568,6 +562,10 @@ LT_INIT
 AC_OUTPUT
 ]])
 
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I m4
+]])
+
 AT_DATA([aclocal.m4],
 [[# This should need upgrading:
 # serial 25 LT_INIT
@@ -582,9 +580,7 @@ AC_DEFUN([LT_INIT],
 ]])
 
 AT_DATA([expout],
-[[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
-libtoolize: `build-aux/ltmain.sh' is already up to date.
-libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
+[[libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
 libtoolize: copying file `m4/libtool.m4'
 libtoolize: copying file `m4/ltoptions.m4'
 libtoolize: copying file `m4/ltsugar.m4'
@@ -618,13 +614,8 @@ AT_DATA([m4/ltoptions.m4], [[
 ]])
 
 AT_DATA([expout],
-[[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
-libtoolize: `build-aux/ltmain.sh' is already up to date.
-libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
+[[libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
 libtoolize: copying file `m4/libtool.m4'
-libtoolize: `m4/ltsugar.m4' is already up to date.
-libtoolize: `m4/ltversion.m4' is already up to date.
-libtoolize: `m4/lt~obsolete.m4' is already up to date.
 ]])
 
 AT_DATA([experr],
@@ -653,6 +644,138 @@ LT_AT_CHECK_LIBTOOLIZE([--copy --force], 0, expout)
 AT_CLEANUP
 
 
+## ------------------------------------------------------------------ ##
+## Ensure libtoolize works when AC_CONFIG_MACRO_DIR is not specified. ##
+## ------------------------------------------------------------------ ##
+
+AT_SETUP([verbatim aclocal.m4 w/o AC_CONFIG_MACRO_DIR])
+
+AT_DATA([configure.ac],
+[[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
+LT_INIT
+AC_OUTPUT
+]])
+
+AT_DATA([aclocal.m4],
+[[# This should need upgrading:
+# serial 25 LT_INIT
+AC_DEFUN([LT_INIT],
+[blah])
+
+# This is newer than the upgrade version:
+# serial 99999 ltoptions.m4
+
+# This is older than the upgrade version:
+# serial 1 ltversion.m4
+]])
+
+AT_DATA([expout],
+[[libtoolize: putting auxiliary files in `.'.
+libtoolize: copying file `./ltmain.sh'
+libtoolize: You should add the contents of the following files to `aclocal.m4':
+libtoolize:   `/usr/local/share/aclocal/libtool.m4'
+libtoolize:   `/usr/local/share/aclocal/ltversion.m4'
+libtoolize:   `/usr/local/share/aclocal/ltsugar.m4'
+libtoolize:   `/usr/local/share/aclocal/lt~obsolete.m4'
+libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
+libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
+]])
+
+LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
+
+
+## ----------------------------------------------------------------------- ##
+## Upgrading an aclocal maintained aclocal.m4 without AC_CONFIG_MACRO_DIR. ##
+## ----------------------------------------------------------------------- ##
+
+LT_AT_ACLOCAL()
+
+## The following code is adapted (and simplified) from libtoolize.m4sh
+####
+: ${GREP="grep"}
+: ${SED="sed"}
+
+basename="s,^.*/,,"
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+# func_serial filename [macro_regex]
+# Output the value of the serial number comment in FILENAME, where the
+# comment line must also match MACRO_REGEX, if given.
+func_serial ()
+{
+    my_filename="$1"
+    my_macro_regex="$2"
+    my_sed_serial='
+       /^# serial [1-9][0-9.]*[        ]*'"$my_macro_regex"'[  ]*$/ {
+           s,^# serial \([1-9][0-9.]*\).*$,\1,
+           q
+       }
+       d'
+
+    # Search FILENAME and all the files it m4_includes for a serial number
+    # in the file that AC_DEFUNs MACRO_REGEX.
+    my_serial=
+    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_filename"
+    then
+      my_serial=`$SED -e "$my_sed_serial" "$my_filename"`
+    fi
+
+    # If the file has no serial number, something is badly wrong!
+    test -n "$my_serial" || exit 1
+
+    echo $my_serial
+}
+
+# Make the serial number in aclocal.m4 higher than installed ltoptions.m4,
+# and the others match the macro files that libtoolize will compare against.
+libtool_serial=`func_serial "$tst_aclocaldir/libtool.m4" LT_INIT`
+ltversion_serial=`func_serial "$tst_aclocaldir/ltversion.m4" ltversion.m4`
+ltsugar_serial=`func_serial "$tst_aclocaldir/ltsugar.m4" ltsugar.m4`
+lt_obsolete_serial=`func_serial "$tst_aclocaldir/lt~obsolete.m4" 
lt~obsolete.m4`
+$SED -e 's,^#.*serial.*ltoptions.m4$,# serial 99999 ltoptions.m4,' \
+  -e "s,^#.*serial.*libtool.m4\$,# serial $libtool_serial libtool.m4," \
+  -e "s,^#.*serial.*ltversion.m4\$,# serial $ltversion_serial ltversion.m4," \
+  -e "s,^#.*serial.*ltsugar.m4\$,# serial $ltsugar_serial ltsugar.m4," \
+  -e "s,^#.*serial.*lt~obsolete.m4\$,# serial $lt_obsolete_serial 
lt~obsolete.m4," \
+ < aclocal.m4 > aclocal.m4t
+mv -f aclocal.m4t aclocal.m4
+
+AT_DATA([expout],
+[[libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
+libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
+]])
+
+LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
+
+
+## --------------------- ##
+## Now, a forced update. ##
+## --------------------- ##
+
+AT_DATA(expout,
+[[libtoolize: putting auxiliary files in `.'.
+libtoolize: copying file `./ltmain.sh'
+libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
+libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
+libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
+]])
+
+LT_AT_CHECK_LIBTOOLIZE([--copy --force], 0, expout)
+
+AT_CLEANUP
+
+
 ## ------------------------------------------------------------- ##
 ## Check nonrecursive ltdl puts m4 files in AC_CONFIG_MACRO_DIR. ##
 ## ------------------------------------------------------------- ##
@@ -715,6 +838,10 @@ LTDL_INIT([nonrecursive])
 AC_OUTPUT
 ]])
 
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I m4
+]])
+
 LT_AT_CHECK_LIBTOOLIZE([--copy --install --ltdl=ltdl], 0, expout)
 
 AT_CLEANUP
@@ -793,6 +920,7 @@ libtoolize: copying file `ltdl/ltdl.h'
 libtoolize: copying file `ltdl/slist.c'
 libtoolize: Consider using `AC_CONFIG_AUX_DIR([ltdl/config])' in configure.ac.
 libtoolize: Consider using `AC_CONFIG_MACRO_DIR([ltdl/m4])' in configure.ac.
+libtoolize: Consider adding `-I ltdl/m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
 
 AT_DATA([configure.ac],
diff --git a/tests/testsuite.at b/tests/testsuite.at
index beca766..e4cea78 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -73,8 +73,9 @@ AT_KEYWORDS([libtoolize])
 # ---------------------------
 # Fix the expected output of installed libtoolize in presence of --program-*.
 m4_define([_LIBTOOLIZE_TRANSFORM],
-[lt_name=`$ECHO "$LIBTOOLIZE" | sed 's,^.*/,,'` # restore font-lock: ''
-sed "s/^libtoolize/$lt_name/" < $1 > $1.t
+[lt_name=`$ECHO "$LIBTOOLIZE" | sed "s,^.*/,,"`
+sed "s/^libtoolize/$lt_name/
+s|/usr/local/share/aclocal/|$abs_top_srcdir/libltdl/m4/|" < $1 > $1.t
 mv -f $1.t $1
 ])dnl
 


hooks/post-receive
--
GNU Libtool




reply via email to

[Prev in Thread] Current Thread [Next in Thread]