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 <schwab@suse.de>.
This commit is contained in:
Gary V. Vaughan 2008-05-02 16:12:38 -04:00
parent fe06ce018f
commit 505274fd58
3 changed files with 86 additions and 0 deletions

View File

@ -1,3 +1,16 @@
2008-05-03 Gary V. Vaughan <gary@gnu.org>
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 <schwab@suse.de>.
2008-05-02 Peter O'Gorman <peter@pogma.com>
It helps to close quotes.

View File

@ -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

View File

@ -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