libtool-patches
[Top][All Lists]
Advanced

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

[PATCH 369] Dont trip over outdated acinclude.m4.


From: Gary V. Vaughan
Subject: [PATCH 369] Dont trip over outdated acinclude.m4.
Date: Fri, 2 May 2008 16:27:17 -0400 (EDT)
User-agent: mailnotify/0.9

* libtoolize.m4sh (all_pkgconfig_files, all_pkgmacro_files)
(all_pkgltdl_files): New variables listing all files ever
maintained by any release of libtoolize.
(func_install_pkgconfig_parent, func_install_pkgltdl_files)
(func_install_pkgconfig_subproject, func_install_pkgmacro_parent)
(func_install_pkgmacro_subproject): Carefully clean up any files
that may have been installed by previous libtoolize releases.
* tests/libtoolize.at: New test for libltdl/acinclude.m4 removal.
Reported by Andreas Schwab <address@hidden>.
---

Okay to push?

 ChangeLog           |   13 +++++++++++++
 libtoolize.m4sh     |   41 +++++++++++++++++++++++++++++++++++++++++
 tests/libtoolize.at |   32 ++++++++++++++++++++++++++++++++
 3 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b9a695c..3188e66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-05-03  Gary V. Vaughan  <address@hidden>
+
+       Don't trip over outdated acinclude.m4.
+       * libtoolize.m4sh (all_pkgconfig_files, all_pkgmacro_files)
+       (all_pkgltdl_files): New variables listing all files ever
+       maintained by any release of libtoolize.
+       (func_install_pkgconfig_parent, func_install_pkgltdl_files)
+       (func_install_pkgconfig_subproject, func_install_pkgmacro_parent)
+       (func_install_pkgmacro_subproject): Carefully clean up any files
+       that may have been installed by previous libtoolize releases.
+       * tests/libtoolize.at: New test for libltdl/acinclude.m4 removal.
+       Reported by Andreas Schwab <address@hidden>.
+
 2008-05-02  Peter O'Gorman  <address@hidden>
 
        It helps to close quotes.
diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index 41b7eae..0c7cf02 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -117,6 +117,12 @@ macrodir=
 ltdldir=
 configure_ac=configure.in
 
+# Lists of all files libtoolize has ever installed.  These are removed
+# before installing the latest files when --force was passed to help
+# ensure a clean upgrade.
+all_pkgconfig_files="config.guess config.sub ltmain.sh"
+all_pkgmacro_files="argz.m4 libtool.m4 ltdl.m4 ltoptions.m4 ltsugar.m4 
ltversion.in ltversion.m4 lt~obsolete.m4"
+all_pkgltdl_files="COPYING.LIB Makefile Makefile.in Makefile.inc Makefile.am 
README acinclude.m4 aclocal.m4 argz_.h argz.c config.h.in config-h.in configure 
configure.ac configure.in libltdl/lt__alloc.h libltdl/lt__dirent.h 
libltdl/lt__glibc.h libltdl/lt__private.h libltdl/lt__strl.h 
libltdl/lt_dlloader.h libltdl/lt_error.h libltdl/lt_system.h libltdl/slist.h 
loaders/dld_link.c loaders/dlopen.c loaders/dyld.c loaders/load_add_on.c 
loaders/loadlibrary.c loaders/preopen.c loaders/shl_load.c lt__alloc.c 
lt__dirent.c lt__strl.c lt_dlloader.c lt_error.c ltdl.c ltdl.h slist.c"
 
 # Parse environment options
 {
@@ -1057,6 +1063,13 @@ func_install_pkgmacro_subproject ()
 {
     $opt_debug
 
+    # Remove any lingering files that my have been installed by some
+    # previous libtoolize release:
+    $opt_force && for file in $all_pkgmacro_files; do
+      test -f "$subproject_macrodir/$file" && func_verbose "rm -f 
'$subproject_macrodir/$file'"
+      rm -f "$subproject_macrodir/$file"
+    done
+
     # 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
@@ -1078,6 +1091,13 @@ func_install_pkgmacro_parent ()
 {
     $opt_debug
 
+    # Remove any lingering files that my have been installed by some
+    # previous libtoolize release:
+    $opt_force && for file in $all_pkgmacro_files; do
+      test -f "$macrodir/$file" && func_verbose "rm -f '$macrodir/$file'"
+      rm -f "$macrodir/$file"
+    done
+
     # Copy all the files from installed libltdl to this project, if the
     # user specified a macrodir.
     $opt_quiet || if test -n "$ac_macrodir"; then
@@ -1191,6 +1211,13 @@ func_install_pkgltdl_files ()
     $opt_debug
     $opt_ltdl || return
 
+    # Remove any lingering files that my have been installed by some
+    # previous libtoolize release:
+    $opt_force && for file in $all_pkgltdl_files; do
+      test -f "$ltdldir/$file" && func_verbose "rm -f '$ltdldir/$file'"
+      rm -f "$ltdldir/$file"
+    done
+
     # Copy all the files from installed libltdl to this project, if the
     # user specified `--ltdl'.
     $opt_quiet || if test -n "$ac_ltdldir"; then
@@ -1260,6 +1287,13 @@ func_install_pkgconfig_subproject ()
 {
     $opt_debug
 
+    # Remove any lingering files that my have been installed by some
+    # previous libtoolize release:
+    $opt_force && for file in $all_pkgconfig_files; do
+      test -f "$subproject_auxdir/$file" && func_verbose "rm -f 
'$subproject_auxdir/$file'"
+      rm -f "$subproject_auxdir/$file"
+    done
+
     # 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
@@ -1281,6 +1315,13 @@ func_install_pkgconfig_parent ()
 {
     $opt_debug
 
+    # Remove any lingering files that my have been installed by some
+    # previous libtoolize release:
+    $opt_force && for file in $all_pkgconfig_files; do
+      test -f "$auxdir/$file" && func_verbose "rm -f '$auxdir/$file'"
+      rm -f "$auxdir/$file"
+    done
+
     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
diff --git a/tests/libtoolize.at b/tests/libtoolize.at
index d500db6..3de37c8 100644
--- a/tests/libtoolize.at
+++ b/tests/libtoolize.at
@@ -983,3 +983,35 @@ AT_DATA(experr, [[]])
 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, [ignore], experr)
 
 AT_CLEANUP
+
+
+## ------------------------------------------------------ ##
+## Remove file droppings from old libtoolize invocations. ##
+## ------------------------------------------------------ ##
+
+AT_SETUP([cleanup old installation])
+
+_LT_CONFIGURE_AC
+
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I m4
+]])
+
+AT_DATA([acinclude.m4],
+[[AC_DEFUN([LT_INIT],
+[: keep me, I might be hand maintained!]) # LT_INIT
+]])
+
+AT_DATA([libltdl/acinclude.m4],
+[[AC_DEFUN([LT_INIT],
+[: delete me, I was left here by on old libltdl build]) # LT_INIT
+]])
+
+LT_AT_CHECK_LIBTOOLIZE([--copy --force --ltdl], 0, [ignore])
+
+# check files are left as expected
+AT_CHECK([grep 'keep me' acinclude.m4], 0, [ignore])
+AT_CHECK([test -f libltdl/acinclude.m4], 1, [ignore], [ignore])
+
+AT_CLEANUP
+
-- 
1.5.4.3

Attachment: pgphfHUqq6sNP.pgp
Description: PGP signature


reply via email to

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