This is a rewrite of the rename series I revoked a week or two ago, but with the added feature of fully supporting packages that wish to continue with their legacy libltdl layout. For this first patch only, there's some cruft necessary to probe the parent Makefile.am for `include libltdl/Makefile.inc' and some associated deprecation warnings, all of which I've flagged for eventual removal sometime in 2013 unless there is a mass outcry for its continued support.
The other renames don't carry any cruft, and by the end of this series our distributed tree is normalized to the layout most other GNU developers are used to seeing, as well as adding that same flexibility to libltdl clients who can either similarly move to the more normal layout, or continue with the legacy layout required for directory sharing libltdl installations, or indeed choose another layout entirely. Along the way, libtoolize itself has received a good helping of polish too, and I hope is considerably easier to read and understand for future potential contributors. As usual, subject to feedback, I plan to push this series in around 72 hours. * libltdl/Makefile.inc: Moved from here... * libltdl/ltdl.mk: ...to here. * Makefile.am, bootstrap.conf, tests/libtoolize.at, tests/nonrecursive.at: Adjust. * libtoolize.m4sh (func_install_pkgltdl_files): Set the destination file to `Makefile.inc' if grep finds an include for that name in a top-level Makefile.am. (func_check_macros): Print a deprecation warning if use of the old `Makefile.inc' convention is found. * tests/old-ltdl-iface.at: New test for renaming and warning correctly when `Makefile.inc' convention is still in use. * NEWS: Updated. Signed-off-by: Gary V. Vaughan <g...@gnu.org> --- Makefile.am | 13 ++-- NEWS | 6 ++ bootstrap.conf | 2 +- doc/libtool.texi | 8 +- libltdl/{Makefile.inc => ltdl.mk} | 2 +- libtoolize.m4sh | 22 +++++- tests/libtoolize.at | 4 +- tests/nonrecursive.at | 2 +- tests/old-ltdl-iface.at | 138 +++++++++++++++++++++++++++++++++++++ 9 files changed, 180 insertions(+), 17 deletions(-) rename libltdl/{Makefile.inc => ltdl.mk} (99%) create mode 100644 tests/old-ltdl-iface.at diff --git a/Makefile.am b/Makefile.am index 21b546d..56f492a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -189,12 +189,12 @@ $(libtoolize_in): $(libtoolize_m4sh) $(sh_files) Makefile.am lt_Makefile_am = $(srcdir)/$(ltdl_dir)/Makefile.am lt_Makefile_in = $(srcdir)/$(ltdl_dir)/Makefile.in -lt_Makefile_inc = $(srcdir)/$(ltdl_dir)/Makefile.inc +ltdl_mk = $(srcdir)/$(ltdl_dir)/ltdl.mk -$(lt_Makefile_am): $(lt_Makefile_inc) +$(lt_Makefile_am): $(ltdl_mk) $(AM_V_at)rm -f '$@' $(AM_V_GEN)( '$(SED)' -n '1,/^.. DO NOT REMOVE THIS LINE -- /p' \ - '$(lt_Makefile_inc)'; \ + '$(ltdl_mk)'; \ { echo 'ACLOCAL_AMFLAGS = -I m4'; \ echo 'AUTOMAKE_OPTIONS = foreign'; \ echo 'AM_CPPFLAGS ='; \ @@ -209,7 +209,7 @@ $(lt_Makefile_am): $(lt_Makefile_inc) echo 'MOSTLYCLEANFILES ='; \ }; \ '$(SED)' -n '/^.. DO NOT REMOVE THIS LINE -- /,$$p' \ - '$(lt_Makefile_inc)' \ + '$(ltdl_mk)' \ |'$(SED)' -e 's,libltdl_,,; s,libltdl/,,; s,: libltdl/,: ,' \ -e 's,\$$(libltdl_,$$(,' \ ) |'$(SED)' -e '/^.. DO NOT REMOVE THIS LINE -- /d' \ @@ -332,7 +332,7 @@ configure-subdirs distdir: $(DIST_MAKEFILE_LIST) ## Libltdl. ## ## -------- ## -include libltdl/Makefile.inc +include libltdl/ltdl.mk lt_aclocal_m4 = $(srcdir)/$(ltdl_dir)/aclocal.m4 lt_config_h_in = $(srcdir)/$(ltdl_dir)/config-h.in @@ -466,7 +466,6 @@ pkgmacro_files = argz.m4 libtool.m4 ltdl.m4 ltoptions.m4 ltsugar.m4 \ pkgltdl_files = COPYING.LIB \ Makefile.am \ Makefile.in \ - Makefile.inc \ README \ configure.ac \ aclocal.m4 \ @@ -497,6 +496,7 @@ pkgltdl_files = COPYING.LIB \ lt_error.c \ ltdl.c \ ltdl.h \ + ltdl.mk \ slist.c install-data-local: $(lt_Makefile_in) @@ -650,6 +650,7 @@ TESTSUITE_AT = tests/testsuite.at \ tests/versioning.at \ tests/destdir.at \ tests/old-m4-iface.at \ + tests/old-ltdl-iface.at \ tests/am-subdir.at \ tests/lt_dlexit.at \ tests/lt_dladvise.at \ diff --git a/NEWS b/NEWS index 9ecb6cd..2e6879c 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,12 @@ NEWS - list of user-visible changes between releases of GNU Libtool `configure.ac' (or `configure.in') that needs tracing to determine what modes and directories have been specified. + - The use of the idiosyncratically named `Makefile.inc' in nonrecursive + libltdl builds is deprecated, although it will be supported for one + more year or until the next release, whichever takes longer. Please + upgrade to the more standard naming of `ltdl.mk' in keeping with other + GNU projects. + New in 2.4.2 2011-10-17: git version 2.4.1a, Libtool team: * New features: diff --git a/bootstrap.conf b/bootstrap.conf index 0f89559..60cfe96 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -316,7 +316,7 @@ libtool_build_prerequisites () func_verbose "ltdl_dir='$ltdl_dir'" # Whip up a dirty Makefile: - makes='Makefile.am libltdl/Makefile.inc' + makes='Makefile.am libltdl/ltdl.mk' rm -f Makefile { echo "aux_dir = $build_aux" diff --git a/doc/libtool.texi b/doc/libtool.texi index 462efa5..20292ab 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -2558,7 +2558,7 @@ you will need to add the following to the @file{Makefile.am} of the parent project: @example -## libltdl/Makefile.inc @r{appends to the following variables} +## libltdl/ltdl.mk @r{appends to the following variables} ## @r{so we set them here before including it:} BUILT_SOURCES = @@ -2575,7 +2575,7 @@ EXTRA_DIST = CLEANFILES = MOSTLYCLEANFILES = -include libltdl/Makefile.inc +include libltdl/ltdl.mk @end example @noindent @@ -4816,14 +4816,14 @@ noinst_LTLIBRARIES = lib_LTLIBRARIES = EXTRA_LTLIBRARIES = -include libltdl/Makefile.inc +include libltdl/ltdl.mk @end example @noindent Unless you build no other libraries from this @file{Makefile.am}, you will also need to change @code{lib_LTLIBRARIES} to assign with @samp{+=} so that the @code{libltdl} targets declared in -@file{Makefile.inc} are not overwritten. +@file{ltdl.mk} are not overwritten. @item recursive This build mode still requires that you use Automake, but (in contrast diff --git a/libltdl/Makefile.inc b/libltdl/ltdl.mk similarity index 99% rename from libltdl/Makefile.inc rename to libltdl/ltdl.mk index 0e53848..f75d6fd 100644 --- a/libltdl/Makefile.inc +++ b/libltdl/ltdl.mk @@ -1,4 +1,4 @@ -## Makefile.inc -- includable Makefile.am snippet +## ltdl.mk -- includable Makefile snippet ## ## Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. ## Written by Gary V. Vaughan, 2003 diff --git a/libtoolize.m4sh b/libtoolize.m4sh index 89fea11..becdcf7 100644 --- a/libtoolize.m4sh +++ b/libtoolize.m4sh @@ -865,7 +865,7 @@ func_install_pkgltdl_files () esac ;; - Makefile.inc) + ltdl.mk) test nonrecursive = "$ltdl_mode" || continue my_copy_filter=$Makefile_inc_filter ;; @@ -889,6 +889,13 @@ func_install_pkgltdl_files () # Still here? Copy the file then, with selected filters. func_copy "$file" "$pkgltdldir" "$ltdl_dir" \ pkgltdl_header "$my_copy_filter" + + # FIXME: Remove in 2013 + # (along with deprecation warning in func_check_macros) + test ltdl.mk = "$file" \ + && func_grep "^-\?include $ltdl_dir/Makefile.inc\$" Makefile.am \ + && mv "$ltdl_dir/$file" "$ltdl_dir/Makefile.inc" \ + && func_whisper "renaming file \`$ltdl_dir/Makefile.inc'" done } @@ -1099,6 +1106,17 @@ func_check_macros () test -n "$ac_ltdl_dir" || func_echo "Remember to add \`LT_CONFIG_LTDL_DIR([$ltdl_dir])' to \`$configure_ac'." + # For nonrecursive mode, warn about continued use of Makefile.inc: + # FIXME: Remove in 2013 + # (along with last minute rename in func_install_pkgltdl_files) + if test "x$ltdl_mode" = "xnonrecursive"; then + if func_grep "^-\?include $ltdl_dir/Makefile.inc\$" Makefile.am; + then + func_error "Use of \`include $ltdl_dir/Makefile.inc' is deprecated!" + func_echo "Consider updating to use of \`include $ltdl_dir/ltdl.mk' in Makefile.am." + fi + fi + # For subproject mode, offer some suggestions for avoiding duplicate # files in a project that uses libltdl: if test "x$ltdl_mode" = "xsubproject"; then @@ -1646,7 +1664,7 @@ func_require_seen_libtool () # without --install, and the project may not be using Automake. all_pkgaux_files="compile install-sh depcomp missing ltmain.sh snippet/_Noreturn.h snippet/arg-nonnull.h snippet/c++defs.h snippet/warn-on-use.h" 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" + 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 ltdl.mk slist.c" # Files installed by func_install_*, some files are missing from these # lists deliberately because their respective func_install has to handle diff --git a/tests/libtoolize.at b/tests/libtoolize.at index fdd76fb..e7fe60c 100644 --- a/tests/libtoolize.at +++ b/tests/libtoolize.at @@ -296,7 +296,6 @@ libtoolize: copying file `m4/ltversion.m4' libtoolize: copying file `m4/lt~obsolete.m4' libtoolize: putting libltdl files in `ltdl'. libtoolize: copying file `ltdl/COPYING.LIB' -libtoolize: creating file `ltdl/Makefile.inc' libtoolize: copying file `ltdl/README' libtoolize: copying file `ltdl/argz_.h' libtoolize: copying file `ltdl/argz.c' @@ -323,6 +322,7 @@ libtoolize: copying file `ltdl/lt_dlloader.c' libtoolize: copying file `ltdl/lt_error.c' libtoolize: copying file `ltdl/ltdl.c' libtoolize: copying file `ltdl/ltdl.h' +libtoolize: creating file `ltdl/ltdl.mk' libtoolize: copying file `ltdl/slist.c' libtoolize: Remember to add `LT_CONFIG_LTDL_DIR([ltdl])' to `configure.ac'. libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am. @@ -798,7 +798,6 @@ libtoolize: copying file `m4/ltversion.m4' libtoolize: copying file `m4/lt~obsolete.m4' libtoolize: putting libltdl files in LT_CONFIG_LTDL_DIR, `ltdl'. libtoolize: copying file `ltdl/COPYING.LIB' -libtoolize: creating file `ltdl/Makefile.inc' libtoolize: copying file `ltdl/README' libtoolize: copying file `ltdl/argz_.h' libtoolize: copying file `ltdl/argz.c' @@ -825,6 +824,7 @@ libtoolize: copying file `ltdl/lt_dlloader.c' libtoolize: copying file `ltdl/lt_error.c' libtoolize: copying file `ltdl/ltdl.c' libtoolize: copying file `ltdl/ltdl.h' +libtoolize: creating file `ltdl/ltdl.mk' libtoolize: copying file `ltdl/slist.c' ]]) diff --git a/tests/nonrecursive.at b/tests/nonrecursive.at index d37ec05..fa8cfb6 100644 --- a/tests/nonrecursive.at +++ b/tests/nonrecursive.at @@ -62,7 +62,7 @@ EXTRA_DIST = CLEANFILES = MOSTLYCLEANFILES = -include ltdl/Makefile.inc +include ltdl/ltdl.mk foo_la_LDFLAGS = -module -avoid-version -no-undefined foo_la_SOURCES = foo.c diff --git a/tests/old-ltdl-iface.at b/tests/old-ltdl-iface.at new file mode 100644 index 0000000..deb9dcd --- /dev/null +++ b/tests/old-ltdl-iface.at @@ -0,0 +1,138 @@ +# old-ltdl-iface.at -- exercise old libtoolize interface to libltdl +# +# Copyright (C) 2011 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2011 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#### + +# FIXME: Remove this test in 2013, along with support for Makefile.inc + + +AT_BANNER([Support for older libltdl interfaces.]) + + +## ------------------------- ## +## Support for Makefile.inc. ## +## ------------------------- ## + +AT_SETUP([Makefile.inc]) + +AT_DATA([configure.in], +[[AC_INIT([old-ltdl-iface-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_LIBOBJ_DIR([ltdl]) +LT_CONFIG_LTDL_DIR([ltdl]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE([foreign subdir-objects]) +LT_INIT +LTDL_INIT([nonrecursive]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT +]]) + +AT_DATA([Makefile.am], +[[ACLOCAL_AMFLAGS = -I m4 +BUILT_SOURCES = +AM_CPPFLAGS = +AM_LDFLAGS = +include_HEADERS = +noinst_LTLIBRARIES = +lib_LTLIBRARIES = +EXTRA_LTLIBRARIES = +EXTRA_DIST = +CLEANFILES = +MOSTLYCLEANFILES = +include ltdl/Makefile.inc +bin_PROGRAMS = old +old_LDADD = -Lltdl $(LIBLTDL) +]]) + +AT_DATA([old.c], +[[#include <stdio.h> +#include "ltdl.h" +int main (int argc, const void *argv[]) { + putchar ('.'); + putchar (lt_dlinit () ? 'E' : '.'); + putchar (lt_dlexit () ? 'E' : '.'); + return 0; +} +]]) + +AT_DATA([expout], +[[libtoolize: putting auxiliary files in `.'. +libtoolize: linking file `./config.guess' +libtoolize: linking file `./config.sub' +libtoolize: linking file `./install-sh' +libtoolize: linking file `./ltmain.sh' +libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'. +libtoolize: linking file `m4/argz.m4' +libtoolize: linking file `m4/libtool.m4' +libtoolize: linking file `m4/ltdl.m4' +libtoolize: linking file `m4/ltoptions.m4' +libtoolize: linking file `m4/ltsugar.m4' +libtoolize: linking file `m4/ltversion.m4' +libtoolize: linking file `m4/lt~obsolete.m4' +libtoolize: putting libltdl files in LT_CONFIG_LTDL_DIR, `ltdl'. +libtoolize: linking file `ltdl/COPYING.LIB' +libtoolize: linking file `ltdl/README' +libtoolize: linking file `ltdl/argz_.h' +libtoolize: linking file `ltdl/argz.c' +libtoolize: linking file `ltdl/libltdl/lt__alloc.h' +libtoolize: linking file `ltdl/libltdl/lt__dirent.h' +libtoolize: linking file `ltdl/libltdl/lt__glibc.h' +libtoolize: linking file `ltdl/libltdl/lt__private.h' +libtoolize: linking file `ltdl/libltdl/lt__strl.h' +libtoolize: linking file `ltdl/libltdl/lt_dlloader.h' +libtoolize: linking file `ltdl/libltdl/lt_error.h' +libtoolize: linking file `ltdl/libltdl/lt_system.h' +libtoolize: linking file `ltdl/libltdl/slist.h' +libtoolize: linking file `ltdl/loaders/dld_link.c' +libtoolize: linking file `ltdl/loaders/dlopen.c' +libtoolize: linking file `ltdl/loaders/dyld.c' +libtoolize: linking file `ltdl/loaders/load_add_on.c' +libtoolize: linking file `ltdl/loaders/loadlibrary.c' +libtoolize: linking file `ltdl/loaders/preopen.c' +libtoolize: linking file `ltdl/loaders/shl_load.c' +libtoolize: linking file `ltdl/lt__alloc.c' +libtoolize: linking file `ltdl/lt__dirent.c' +libtoolize: linking file `ltdl/lt__strl.c' +libtoolize: linking file `ltdl/lt_dlloader.c' +libtoolize: linking file `ltdl/lt_error.c' +libtoolize: linking file `ltdl/ltdl.c' +libtoolize: linking file `ltdl/ltdl.h' +libtoolize: creating file `ltdl/ltdl.mk' +libtoolize: renaming file `ltdl/Makefile.inc' +libtoolize: linking file `ltdl/slist.c' +libtoolize: Consider updating to use of `include ltdl/ltdl.mk' in Makefile.am. +]]) + +AT_DATA([experr], +[[libtoolize: Use of `include ltdl/Makefile.inc' is deprecated! +]]) + +LT_AT_CHECK_LIBTOOLIZE([--ltdl=ltdl --nonrecursive --install], 0, [expout], [experr]) + +AT_CHECK([test -f ltdl/Makefile.inc]) + +LT_AT_BOOTSTRAP([ignore], [-I m4], [], [--add-missing], [--force]) + +LT_AT_EXEC_CHECK([./old], 0, [[...]]) + +AT_CLEANUP -- 1.7.7.3 Cheers, -- Gary V. Vaughan (gary AT gnu DOT org)