libtool-patches
[Top][All Lists]
Advanced

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

[PATCH 3/3] libtoolize: rename `Makefile.inc' to standard `ltdl.mk'.


From: Gary V. Vaughan
Subject: [PATCH 3/3] libtoolize: rename `Makefile.inc' to standard `ltdl.mk'.
Date: Tue, 1 Nov 2011 21:30:06 +0700

No directories to move this time, so the full patch is inline.  I'll push along
with the other two when the time comes.

The thing I'd most like feedback on is agreement or otherwise that deprecating
old crufty features, with plenty of warning, is a good way to keep the codebase
lean and manageable.  Obviously this doesn't mean we can be less careful about
designing features or interfaces because we have license to remove them in 
future,
but I think following gnulib's lead in this regard (marking obviously crufty old
features, or support for museum pieces as due for removal with a year of more of
notice) is a good thing overall.

First up is sticking with our idiosyncratic Makefile.inc includable makefile
naming, when everyone else is using foo.mk.  This patch retains support for the
incumbent Makefile.inc convention, but will complain about it in the next
release, and be removed in the release after that if there are not outcries that
the world will end.  There's also a test to ensure it keeps working until such
times as we decide to remove support.

* 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_fixup_makefile): 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 <address@hidden>
---
 Makefile.am             |   13 ++--
 NEWS                    |    8 +++
 bootstrap.conf          |    2 +-
 doc/libtool.texi        |    8 +-
 libltdl/Makefile.inc    |  153 -----------------------------------------------
 libltdl/ltdl.mk         |  153 +++++++++++++++++++++++++++++++++++++++++++++++
 libtoolize.m4sh         |   36 ++++++++---
 tests/libtoolize.at     |    4 +-
 tests/nonrecursive.at   |    2 +-
 tests/old-ltdl-iface.at |  135 +++++++++++++++++++++++++++++++++++++++++
 10 files changed, 338 insertions(+), 176 deletions(-)
 delete mode 100644 libltdl/Makefile.inc
 create mode 100644 libltdl/ltdl.mk
 create mode 100644 tests/old-ltdl-iface.at

diff --git a/Makefile.am b/Makefile.am
index 890e4ae..81301ea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -184,12 +184,12 @@ $(libtoolize_in): $(libtoolize_m4sh) $(sh_files) 
Makefile.am
 
 lt_Makefile_am = $(ltdl_dir)/Makefile.am
 lt_Makefile_in = $(ltdl_dir)/Makefile.in
-lt_Makefile_inc        = $(ltdl_dir)/Makefile.inc
+ltdl_mk                = $(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 ='; \
@@ -204,7 +204,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' \
@@ -326,7 +326,7 @@ configure-subdirs distdir: $(DIST_MAKEFILE_LIST)
 ## Libltdl. ##
 ## -------- ##
 
-include libltdl/Makefile.inc
+include libltdl/ltdl.mk
 
 lt_aclocal_m4  = $(ltdl_dir)/aclocal.m4
 lt_config_h_in = $(ltdl_dir)/config-h.in
@@ -454,7 +454,7 @@ aclocalfiles        = $(macrodest)/argz.m4 \
 ltdldest       = libltdl
 ltdldatafiles  = $(ltdldest)/COPYING.LIB \
                  $(ltdldest)/README \
-                 $(ltdldest)/Makefile.inc \
+                 $(ltdldest)/ltdl.mk \
                  $(ltdldest)/Makefile.am \
                  $(ltdldest)/configure.ac \
                  $(ltdldest)/aclocal.m4 \
@@ -615,6 +615,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 3672ff8..f0f3e92 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,14 @@ NEWS - list of user-visible changes between releases of GNU 
Libtool
     from libltdl/Makefile.am in recursive mode due to underquoting in a
     sed script.
 
+** Important incompatible changes:
+
+  - 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 ebdb293..46d9079 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
address@hidden are not overwritten.
address@hidden 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/Makefile.inc
deleted file mode 100644
index 931b68d..0000000
--- a/libltdl/Makefile.inc
+++ /dev/null
@@ -1,153 +0,0 @@
-## Makefile.inc -- includable Makefile.am snippet
-##
-##   Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
-##   Written by Gary V. Vaughan, 2003
-##
-##   NOTE: The canonical source of this file is maintained with the
-##   GNU Libtool package.  Report bugs to address@hidden
-##
-## GNU Libltdl is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2 of the License, or (at your option) any later version.
-##
-## As a special exception to the GNU Lesser General Public License,
-## if you distribute this file as part of a program or library that
-## is built using GNU libtool, you may include this file under the
-## same distribution terms that you use for the rest of that program.
-##
-## GNU Libltdl 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 Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU LesserGeneral Public
-## License along with GNU Libltdl; see the file COPYING.LIB.  If not, a
-## copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
-## or obtained by writing to the Free Software Foundation, Inc.,
-## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#####
-
-## DO NOT REMOVE THIS LINE -- make depends on it
-
-# -I$(srcdir) is needed for user that built libltdl with a sub-Automake
-# (not as a sub-package!) using 'nostdinc':
-AM_CPPFLAGS           += -DLT_CONFIG_H='<$(LT_CONFIG_H)>' \
-                         -DLTDL -I. -I$(srcdir) -Ilibltdl \
-                         -I$(srcdir)/libltdl -I$(srcdir)/libltdl/libltdl
-AM_LDFLAGS            += -no-undefined
-LTDL_VERSION_INFO      = -version-info 10:0:3
-
-noinst_LTLIBRARIES     += $(LT_DLLOADERS)
-
-if INSTALL_LTDL
-ltdlincludedir         = $(includedir)/libltdl
-ltdlinclude_HEADERS    = libltdl/libltdl/lt_system.h \
-                         libltdl/libltdl/lt_error.h \
-                         libltdl/libltdl/lt_dlloader.h
-include_HEADERS               += libltdl/ltdl.h
-lib_LTLIBRARIES               += libltdl/libltdl.la
-endif
-
-if CONVENIENCE_LTDL
-noinst_LTLIBRARIES     += libltdl/libltdlc.la
-endif
-
-libltdl_libltdl_la_SOURCES = libltdl/libltdl/lt__alloc.h \
-                         libltdl/libltdl/lt__dirent.h \
-                         libltdl/libltdl/lt__glibc.h \
-                         libltdl/libltdl/lt__private.h \
-                         libltdl/libltdl/lt__strl.h \
-                         libltdl/libltdl/lt_dlloader.h \
-                         libltdl/libltdl/lt_error.h \
-                         libltdl/libltdl/lt_system.h \
-                         libltdl/libltdl/slist.h \
-                         libltdl/loaders/preopen.c \
-                         libltdl/lt__alloc.c \
-                         libltdl/lt_dlloader.c \
-                         libltdl/lt_error.c \
-                         libltdl/ltdl.c \
-                         libltdl/ltdl.h \
-                         libltdl/slist.c
-
-EXTRA_DIST            += libltdl/lt__dirent.c \
-                         libltdl/lt__strl.c
-
-libltdl_libltdl_la_CPPFLAGS    = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS)
-libltdl_libltdl_la_LDFLAGS     = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) 
$(LT_DLPREOPEN)
-libltdl_libltdl_la_LIBADD      = $(LTLIBOBJS)
-libltdl_libltdl_la_DEPENDENCIES        = $(LT_DLLOADERS) $(LTLIBOBJS)
-
-libltdl_libltdlc_la_SOURCES    = $(libltdl_libltdl_la_SOURCES)
-libltdl_libltdlc_la_CPPFLAGS   = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS)
-libltdl_libltdlc_la_LDFLAGS    = $(AM_LDFLAGS) $(LT_DLPREOPEN)
-libltdl_libltdlc_la_LIBADD     = $(libltdl_libltdl_la_LIBADD)
-libltdl_libltdlc_la_DEPENDENCIES= $(libltdl_libltdl_la_DEPENDENCIES)
-
-## The loaders are preopened by libltdl, itself always built from
-## pic-objects (either as a shared library, or a convenience library),
-## so the loaders themselves must be made from pic-objects too.  We
-## use convenience libraries for that purpose:
-EXTRA_LTLIBRARIES             += libltdl/dlopen.la \
-                                 libltdl/dld_link.la \
-                                 libltdl/dyld.la \
-                                 libltdl/load_add_on.la \
-                                 libltdl/loadlibrary.la \
-                                 libltdl/shl_load.la
-
-libltdl_dlopen_la_SOURCES      = libltdl/loaders/dlopen.c
-libltdl_dlopen_la_LDFLAGS      = -module -avoid-version
-libltdl_dlopen_la_LIBADD       = $(LIBADD_DLOPEN)
-
-libltdl_dld_link_la_SOURCES    = libltdl/loaders/dld_link.c
-libltdl_dld_link_la_LDFLAGS    = -module -avoid-version
-libltdl_dld_link_la_LIBADD     = -ldld
-
-libltdl_dyld_la_SOURCES                = libltdl/loaders/dyld.c
-libltdl_dyld_la_LDFLAGS                = -module -avoid-version
-
-libltdl_load_add_on_la_SOURCES = libltdl/loaders/load_add_on.c
-libltdl_load_add_on_la_LDFLAGS = -module -avoid-version
-
-libltdl_loadlibrary_la_SOURCES = libltdl/loaders/loadlibrary.c
-libltdl_loadlibrary_la_LDFLAGS = -module -avoid-version
-
-libltdl_shl_load_la_SOURCES    = libltdl/loaders/shl_load.c
-libltdl_shl_load_la_LDFLAGS    = -module -avoid-version
-libltdl_shl_load_la_LIBADD     = $(LIBADD_SHL_LOAD)
-
-## Make sure these will be cleaned even when they're not built by default:
-CLEANFILES                    += libltdl/libltdl.la \
-                                 libltdl/libltdlc.la \
-                                 libltdl/libdlloader.la
-
-## Automake-1.9.6 doesn't clean subdir AC_LIBOBJ compiled objects
-## automatically:
-CLEANFILES            += $(LIBOBJS) $(LTLIBOBJS)
-
-EXTRA_DIST            += libltdl/COPYING.LIB \
-                         libltdl/configure.ac \
-                         libltdl/Makefile.am \
-                         libltdl/aclocal.m4 \
-                         libltdl/Makefile.in \
-                         libltdl/configure \
-                         libltdl/config-h.in \
-                         libltdl/README
-
-## --------------------------- ##
-## Gnulib Makefile.am snippets ##
-## --------------------------- ##
-
-BUILT_SOURCES  += libltdl/$(ARGZ_H)
-EXTRA_DIST     += libltdl/argz_.h \
-                  libltdl/argz.c
-
-# We need the following in order to create an <argz.h> when the system
-# doesn't have one that works with the given compiler.
-all-local $(lib_OBJECTS): libltdl/$(ARGZ_H)
-libltdl/argz.h: libltdl/argz_.h
-       $(AM_V_at)$(mkinstalldirs) . libltdl/
-       $(AM_V_GEN)cp $(srcdir)/libltdl/argz_.h address@hidden
-       $(AM_V_at)mv address@hidden $@
-MOSTLYCLEANFILES += libltdl/argz.h \
-                   libltdl/argz.h-t
diff --git a/libltdl/ltdl.mk b/libltdl/ltdl.mk
new file mode 100644
index 0000000..13ef947
--- /dev/null
+++ b/libltdl/ltdl.mk
@@ -0,0 +1,153 @@
+## ltdl.mk -- includable Makefile snippet
+##
+##   Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+##   Written by Gary V. Vaughan, 2003
+##
+##   NOTE: The canonical source of this file is maintained with the
+##   GNU Libtool package.  Report bugs to address@hidden
+##
+## GNU Libltdl is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2 of the License, or (at your option) any later version.
+##
+## As a special exception to the GNU Lesser General Public License,
+## if you distribute this file as part of a program or library that
+## is built using GNU libtool, you may include this file under the
+## same distribution terms that you use for the rest of that program.
+##
+## GNU Libltdl 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 Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU LesserGeneral Public
+## License along with GNU Libltdl; see the file COPYING.LIB.  If not, a
+## copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
+## or obtained by writing to the Free Software Foundation, Inc.,
+## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#####
+
+## DO NOT REMOVE THIS LINE -- make depends on it
+
+# -I$(srcdir) is needed for user that built libltdl with a sub-Automake
+# (not as a sub-package!) using 'nostdinc':
+AM_CPPFLAGS           += -DLT_CONFIG_H='<$(LT_CONFIG_H)>' \
+                         -DLTDL -I. -I$(srcdir) -Ilibltdl \
+                         -I$(srcdir)/libltdl -I$(srcdir)/libltdl/libltdl
+AM_LDFLAGS            += -no-undefined
+LTDL_VERSION_INFO      = -version-info 10:0:3
+
+noinst_LTLIBRARIES     += $(LT_DLLOADERS)
+
+if INSTALL_LTDL
+ltdlincludedir         = $(includedir)/libltdl
+ltdlinclude_HEADERS    = libltdl/libltdl/lt_system.h \
+                         libltdl/libltdl/lt_error.h \
+                         libltdl/libltdl/lt_dlloader.h
+include_HEADERS               += libltdl/ltdl.h
+lib_LTLIBRARIES               += libltdl/libltdl.la
+endif
+
+if CONVENIENCE_LTDL
+noinst_LTLIBRARIES     += libltdl/libltdlc.la
+endif
+
+libltdl_libltdl_la_SOURCES = libltdl/libltdl/lt__alloc.h \
+                         libltdl/libltdl/lt__dirent.h \
+                         libltdl/libltdl/lt__glibc.h \
+                         libltdl/libltdl/lt__private.h \
+                         libltdl/libltdl/lt__strl.h \
+                         libltdl/libltdl/lt_dlloader.h \
+                         libltdl/libltdl/lt_error.h \
+                         libltdl/libltdl/lt_system.h \
+                         libltdl/libltdl/slist.h \
+                         libltdl/loaders/preopen.c \
+                         libltdl/lt__alloc.c \
+                         libltdl/lt_dlloader.c \
+                         libltdl/lt_error.c \
+                         libltdl/ltdl.c \
+                         libltdl/ltdl.h \
+                         libltdl/slist.c
+
+EXTRA_DIST            += libltdl/lt__dirent.c \
+                         libltdl/lt__strl.c
+
+libltdl_libltdl_la_CPPFLAGS    = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS)
+libltdl_libltdl_la_LDFLAGS     = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) 
$(LT_DLPREOPEN)
+libltdl_libltdl_la_LIBADD      = $(LTLIBOBJS)
+libltdl_libltdl_la_DEPENDENCIES        = $(LT_DLLOADERS) $(LTLIBOBJS)
+
+libltdl_libltdlc_la_SOURCES    = $(libltdl_libltdl_la_SOURCES)
+libltdl_libltdlc_la_CPPFLAGS   = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS)
+libltdl_libltdlc_la_LDFLAGS    = $(AM_LDFLAGS) $(LT_DLPREOPEN)
+libltdl_libltdlc_la_LIBADD     = $(libltdl_libltdl_la_LIBADD)
+libltdl_libltdlc_la_DEPENDENCIES= $(libltdl_libltdl_la_DEPENDENCIES)
+
+## The loaders are preopened by libltdl, itself always built from
+## pic-objects (either as a shared library, or a convenience library),
+## so the loaders themselves must be made from pic-objects too.  We
+## use convenience libraries for that purpose:
+EXTRA_LTLIBRARIES             += libltdl/dlopen.la \
+                                 libltdl/dld_link.la \
+                                 libltdl/dyld.la \
+                                 libltdl/load_add_on.la \
+                                 libltdl/loadlibrary.la \
+                                 libltdl/shl_load.la
+
+libltdl_dlopen_la_SOURCES      = libltdl/loaders/dlopen.c
+libltdl_dlopen_la_LDFLAGS      = -module -avoid-version
+libltdl_dlopen_la_LIBADD       = $(LIBADD_DLOPEN)
+
+libltdl_dld_link_la_SOURCES    = libltdl/loaders/dld_link.c
+libltdl_dld_link_la_LDFLAGS    = -module -avoid-version
+libltdl_dld_link_la_LIBADD     = -ldld
+
+libltdl_dyld_la_SOURCES                = libltdl/loaders/dyld.c
+libltdl_dyld_la_LDFLAGS                = -module -avoid-version
+
+libltdl_load_add_on_la_SOURCES = libltdl/loaders/load_add_on.c
+libltdl_load_add_on_la_LDFLAGS = -module -avoid-version
+
+libltdl_loadlibrary_la_SOURCES = libltdl/loaders/loadlibrary.c
+libltdl_loadlibrary_la_LDFLAGS = -module -avoid-version
+
+libltdl_shl_load_la_SOURCES    = libltdl/loaders/shl_load.c
+libltdl_shl_load_la_LDFLAGS    = -module -avoid-version
+libltdl_shl_load_la_LIBADD     = $(LIBADD_SHL_LOAD)
+
+## Make sure these will be cleaned even when they're not built by default:
+CLEANFILES                    += libltdl/libltdl.la \
+                                 libltdl/libltdlc.la \
+                                 libltdl/libdlloader.la
+
+## Automake-1.9.6 doesn't clean subdir AC_LIBOBJ compiled objects
+## automatically:
+CLEANFILES            += $(LIBOBJS) $(LTLIBOBJS)
+
+EXTRA_DIST            += libltdl/COPYING.LIB \
+                         libltdl/configure.ac \
+                         libltdl/Makefile.am \
+                         libltdl/aclocal.m4 \
+                         libltdl/Makefile.in \
+                         libltdl/configure \
+                         libltdl/config-h.in \
+                         libltdl/README
+
+## --------------------------- ##
+## Gnulib Makefile.am snippets ##
+## --------------------------- ##
+
+BUILT_SOURCES  += libltdl/$(ARGZ_H)
+EXTRA_DIST     += libltdl/argz_.h \
+                  libltdl/argz.c
+
+# We need the following in order to create an <argz.h> when the system
+# doesn't have one that works with the given compiler.
+all-local $(lib_OBJECTS): libltdl/$(ARGZ_H)
+libltdl/argz.h: libltdl/argz_.h
+       $(AM_V_at)$(mkinstalldirs) . libltdl/
+       $(AM_V_GEN)cp $(srcdir)/libltdl/argz_.h address@hidden
+       $(AM_V_at)mv address@hidden $@
+MOSTLYCLEANFILES += libltdl/argz.h \
+                   libltdl/argz.h-t
diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index 0c7b62d..42c470b 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -320,6 +320,7 @@ func_fixup_Makefile ()
     my_filename="$1"
     my_srcdir="$2"
     my_destdir="$3"
+    my_destfile="$my_filename"
     my_fixup_non_subpackage_script='/^[^#]/{
       s,(LIBOBJS),(ltdl_LIBOBJS),g
       s,(LTLIBOBJS),(ltdl_LTLIBOBJS),g
@@ -336,7 +337,7 @@ func_fixup_Makefile ()
        my_fixup_non_subpackage_script=`echo "$my_fixup_non_subpackage_script" 
| \
                sed 's,libltdl/,,'`
        my_fixup_inc_paths_script= ;;
-      Makefile.inc)
+      ltdl.mk)
        repl=$ltdldir
        repl_uscore=`$ECHO "$repl" | $SED 's,[/.+-],_,g'`
        my_fixup_inc_paths_script="\
@@ -348,17 +349,23 @@ func_fixup_Makefile ()
          s,)/libltdl ,)/@repl@ ,
          s,@repl_uscore@,${repl_uscore},g
          s,@repl@,${repl},g"
+
+       # FIXME: Remove in 2013
+       cat Makefile.am 2>/dev/null | \
+         $EGREP '^-?include '"$my_destdir"'/Makefile.inc$' - >/dev/null &&
+         my_destfile=Makefile.inc
        ;;
     esac
 
-    $RM "$my_destdir/$my_filename" 2>/dev/null
-    $opt_quiet || func_echo "creating file \`$my_destdir/$my_filename'"
+
+    $RM "$my_destdir/$my_destfile" 2>/dev/null
+    $opt_quiet || func_echo "creating file \`$my_destdir/$my_destfile'"
     if $opt_dry_run; then :;
     else
       $SED "$my_fixup_non_subpackage_script
            $my_fixup_inc_paths_script" \
-       < "$my_srcdir/$my_filename" > "$my_destdir/$my_filename" ||
-       func_fatal_error "cannot create $my_destdir/$my_filename"
+       < "$my_srcdir/$my_filename" > "$my_destdir/$my_destfile" ||
+       func_fatal_error "cannot create $my_destdir/$my_destfile"
     fi
 }
 
@@ -1163,9 +1170,9 @@ func_install_pkgltdl_files ()
 
     # These files are handled specially, depending on ltdl_mode:
     if test "x$ltdl_mode" = "xsubproject"; then
-      func_massage_pkgltdl_files 'Makefile.inc'
+      func_massage_pkgltdl_files 'ltdl.mk'
     else
-      func_massage_pkgltdl_files 'Makefile.am|Makefile.in*|aclocal.m4|config*'
+      func_massage_pkgltdl_files 
'Makefile.am|Makefile.in|aclocal.m4|config*|ltdl.mk'
     fi
 
     func_copy_some_files "$pkgltdl_files" \
@@ -1177,7 +1184,7 @@ func_install_pkgltdl_files ()
         func_fixup_Makefile "Makefile.am" "$pkgltdldir/libltdl" "$ltdldir"
         ;;
       nonrecursive)
-        func_fixup_Makefile "Makefile.inc" "$pkgltdldir/libltdl" "$ltdldir"
+        func_fixup_Makefile "ltdl.mk" "$pkgltdldir/libltdl" "$ltdldir"
         ;;
     esac
 }
@@ -1395,6 +1402,17 @@ func_check_macros ()
       test -n "$ac_ltdldir" ||
         func_echo "Remember to add \`LT_CONFIG_LTDL_DIR([$ltdldir])' to 
\`$configure_ac'."
 
+      # For nonrecursive mode, warn about continued use of Makefile.inc:
+      # FIXME: Remove in 2013
+      if test "x$ltdl_mode" = "xnonrecursive"; then
+       if cat *.mk Makefile.am 2>/dev/null | \
+           $EGREP '^-?include '"$ltdldir"'/Makefile.inc' - >/dev/null
+       then
+         func_error "Use of \`include $ltdldir/Makefile.inc' is deprecated!"
+         func_echo "Consider updating to use of \`include $ltdldir/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
@@ -1450,7 +1468,7 @@ func_check_macros ()
   # without --install, and the project may not be using Automake.
   all_pkgconfig_files="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"
+  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"
 
   # Locations for important files:
   address@hidden@
diff --git a/tests/libtoolize.at b/tests/libtoolize.at
index a0f0d6d..3b213b1 100644
--- a/tests/libtoolize.at
+++ b/tests/libtoolize.at
@@ -323,7 +323,7 @@ libtoolize: copying file `ltdl/lt_error.c'
 libtoolize: copying file `ltdl/ltdl.c'
 libtoolize: copying file `ltdl/ltdl.h'
 libtoolize: copying file `ltdl/slist.c'
-libtoolize: creating file `ltdl/Makefile.inc'
+libtoolize: creating file `ltdl/ltdl.mk'
 libtoolize: Remember to add `LT_CONFIG_LTDL_DIR([ltdl])' to `configure.ac'.
 libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 ]])
@@ -825,7 +825,7 @@ libtoolize: copying file `ltdl/lt_error.c'
 libtoolize: copying file `ltdl/ltdl.c'
 libtoolize: copying file `ltdl/ltdl.h'
 libtoolize: copying file `ltdl/slist.c'
-libtoolize: creating file `ltdl/Makefile.inc'
+libtoolize: creating file `ltdl/ltdl.mk'
 ]])
 
 AT_DATA([configure.ac],
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..f9ed258
--- /dev/null
+++ b/tests/old-ltdl-iface.at
@@ -0,0 +1,135 @@
+# 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.
+####
+
+
+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/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/shl_load.c'
+libtoolize: linking file `ltdl/lt__dirent.c'
+libtoolize: linking file `ltdl/lt__strl.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/preopen.c'
+libtoolize: linking file `ltdl/lt__alloc.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: linking file `ltdl/slist.c'
+libtoolize: creating file `ltdl/Makefile.inc'
+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.1





reply via email to

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