From: Gary V. Vaughan Date: Mon, 4 Apr 2005 12:29:52 +0000 (+0000) Subject: Getting the value of ltdldatafiles from a submake was not X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d3db374c7fd4884c1b0235637aa660bd598f63a;p=thirdparty%2Flibtool.git Getting the value of ltdldatafiles from a submake was not portable, and had problems with GNU make-3.80 at least. This changeset pulls the installation rules for libtoolize's copy of the libltdl sources out of libltdl/Makefile.am so that ltdldatafiles is defined in the same Makefile that uses it. Also, this makes a start at cleaning up libltdl/Makefile.am so that it is useful in a package that uses `libtoolize --ltdl': * libltdl/loaders/Makefile.am: Removed entirely. * libltdl/Makefile.am (dlopen.la, dld_link.la, dyld.la) (load_add_on.la, loadlibrary.la, shl_load.la): All built from here now that the loaders submake has gone. (show-ltdldatafiles): Removed. No longer required. (ltdldatadir, ltdldatafiles, install-local): Moved from here... * Makefile.am (ltdldatadir, ltdldatafiles, install-local): ..to here. (libtoolize): Substitute $(ltdldatafiles) directly without calling make to get the value from libltdl/Makefile. --- diff --git a/ChangeLog b/ChangeLog index 2844ed9a2..f6328f6b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,25 @@ -2005-03-29 Gary V. Vaughan +2005-04-04 Gary V. Vaughan + + Getting the value of ltdldatafiles from a submake was not + portable, and had problems with GNU make-3.80 at least. This + changeset pulls the installation rules for libtoolize's copy of + the libltdl sources out of libltdl/Makefile.am so that + ltdldatafiles is defined in the same Makefile that uses it. Also, + this makes a start at cleaning up libltdl/Makefile.am so that it + is useful in a package that uses `libtoolize --ltdl': + + * libltdl/loaders/Makefile.am: Removed entirely. + * libltdl/Makefile.am (dlopen.la, dld_link.la, dyld.la) + (load_add_on.la, loadlibrary.la, shl_load.la): All built from here + now that the loaders submake has gone. + (show-ltdldatafiles): Removed. No longer required. + (ltdldatadir, ltdldatafiles, install-local): Moved from here... + * Makefile.am (ltdldatadir, ltdldatafiles, install-local): ..to + here. + (libtoolize): Substitute $(ltdldatafiles) directly without calling + make to get the value from libltdl/Makefile. + +2005-04-01 Gary V. Vaughan Fix problems with serial comparison sed scripts, and factor out common code from similar serial comparison functions: diff --git a/Makefile.am b/Makefile.am index 50c9ce260..696060f60 100644 --- a/Makefile.am +++ b/Makefile.am @@ -135,10 +135,9 @@ libtoolize: $(top_srcdir)/libtoolize.in rm -f libtoolize.tmp libtoolize $(timestamp); \ input="libtoolize.m4sh"; \ - ltdldatafiles=`cd libltdl; make show-ltdldatafiles`; \ $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \ -e 's,@aclocal_DATA\@,$(aclocal_DATA),g' \ - -e "s,@pkgvltdl_files\@,`echo $$ltdldatafiles`,g" \ + -e "s,@pkgvltdl_files\@,$(ltdldatafiles),g" \ $(top_srcdir)/libtoolize.in > libtoolize.tmp chmod a+x libtoolize.tmp chmod a-w libtoolize.tmp @@ -183,9 +182,45 @@ configure-subdirs distdir: $(DIST_MAKEFILE_LIST) abs_srcdir=`cd $(top_srcdir) && pwd`; \ (cd $$dir && $$abs_srcdir/$$dir/configure) || exit 1 +## These are installed as a subdirectory of pkgdatadir so that +## libtoolize --ltdl can find them later: +ltdldatadir = $(pkgvdatadir)/libltdl +ltdldatafiles = COPYING.LIB README \ + Makefile.am Makefile.in \ + argz_.h argz.c \ + configure.ac configure \ + 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 + install-data-local: ## Don't install over the top of an old pkgdatadir -rm -rf $(DESTDIR)$(pkgdatadir) +## To avoid spurious reconfiguration when the user installs these files +## with libtoolize, we have to preserve their timestamps carefully: + $(mkinstalldirs) $(DESTDIR)$(ltdldatadir) + ( cd $(srcdir)/libltdl && $(AMTAR) chf - $(ltdldatafiles); ) \ + | ( umask 0 && cd $(DESTDIR)$(ltdldatadir) && $(AMTAR) xf -; ) install-data-hook: chmod +x $(DESTDIR)$(pkgdatadir)/config.guess diff --git a/configure.ac b/configure.ac index 63e60f518..6d2768692 100644 --- a/configure.ac +++ b/configure.ac @@ -184,6 +184,5 @@ AM_CONDITIONAL(HAVE_RC, [test -n "[$]_LT_TAGVAR(compiler, RC)"]) ## -------- ## ## Outputs. ## ## -------- ## -AC_CONFIG_FILES([Makefile libltdl/Makefile libltdl/loaders/Makefile - doc/Makefile tests/Makefile]) +AC_CONFIG_FILES([Makefile libltdl/Makefile doc/Makefile tests/Makefile]) AC_OUTPUT diff --git a/libltdl/Makefile.am b/libltdl/Makefile.am index b35a3e1ce..15d2b1c64 100644 --- a/libltdl/Makefile.am +++ b/libltdl/Makefile.am @@ -18,8 +18,6 @@ ## the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ## Boston, MA 02111-1307, USA. -SUBDIRS = loaders . - BUILT_SOURCES = MOSTLYCLEANFILES = EXTRA_DIST = configure.ac @@ -32,67 +30,74 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/libltdl AM_LDFLAGS = -no-undefined VERSION_INFO = -version-info 6:0:0 -pkgincludedir = $(includedir)/libltdl +noinst_LTLIBRARIES = $(LT_DLLOADERS) if INSTALL_LTDL -include_HEADERS = ltdl.h -pkginclude_HEADERS = libltdl/lt_system.h libltdl/lt_error.h \ +nobase_include_HEADERS = ltdl.h \ + libltdl/lt_system.h libltdl/lt_error.h \ libltdl/lt_dlloader.h lib_LTLIBRARIES = libltdl.la endif if CONVENIENCE_LTDL -noinst_LTLIBRARIES = libltdlc.la +noinst_LTLIBRARIES += libltdlc.la endif -libltdl_la_SOURCES = ltdl.c ltdl.h \ - lt_error.c libltdl/lt_error.h \ +## !!NOTE!! Be sure to update ../Makefile.am:ltdldatafiles if you +## make any changes here: +libltdl_la_SOURCES = 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 \ - lt__alloc.c libltdl/lt__alloc.h \ - libltdl/lt__glibc.h \ - libltdl/lt__dirent.h \ - slist.c libltdl/slist.h \ - lt_dlloader.c libltdl/lt_dlloader.h loaders/preopen.c + libltdl/slist.h \ + loaders/preopen.c \ + lt__alloc.c \ + lt_dlloader.c \ + lt_error.c \ + ltdl.c ltdl.h \ + slist.c libltdl_la_CPPFLAGS = -DLTDLOPEN=libltdl $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(LTLIBOBJS) +libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=libltdlc $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) +libltdlc_la_DEPENDENCIES= $(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 = dlopen.la dld_link.la dyld.la load_add_on.la \ + loadlibrary.la shl_load.la + +dlopen_la_SOURCES = loaders/dlopen.c +dlopen_la_LDFLAGS = -module -avoid-version +dlopen_la_LIBADD = $(LIBADD_DLOPEN) + +dld_link_la_SOURCES = loaders/dld_link.c +dld_link_la_LDFLAGS = -module -avoid-version +dld_link_la_LIBADD = -ldld + +dyld_la_SOURCES = loaders/dyld.c +dyld_la_LDFLAGS = -module -avoid-version + +load_add_on_la_SOURCES = loaders/load_add_on.c +load_add_on_la_LDFLAGS = -module -avoid-version + +loadlibrary_la_SOURCES = loaders/loadlibrary.c +loadlibrary_la_LDFLAGS = -module -avoid-version -## These are installed as a subdirectory of pkgdatadir so that -## libtoolize --ltdl can find them later: -ltdldatadir = $(pkgdatadir)/libltdl -ltdldatafiles = COPYING.LIB README \ - Makefile.am Makefile.in \ - configure.ac configure \ - $(libltdl_la_SOURCES) \ - lt__dirent.c libltdl/lt__dirent.h \ - lt__strl.c libltdl/lt__strl.h \ - argz_.h argz.c \ - loaders/Makefile.am loaders/Makefile.in \ - loaders/dld_link.c \ - loaders/dlopen.c \ - loaders/dyld.c \ - loaders/load_add_on.c \ - loaders/loadlibrary.c \ - loaders/shl_load.c - -## To avoid spurious reconfiguration when the user installs these files -## with libtoolize, we have to preserve their timestamps carefully: -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(ltdldatadir) - ( cd $(srcdir) && $(AMTAR) chf - $(ltdldatafiles); ) \ - | ( umask 0 && cd $(DESTDIR)$(ltdldatadir) && $(AMTAR) xf -; ) - -## This rule is used by the top Makefile.am to get the list of ltdl -## files that libtoolize will use to implement 'libtoolize --ltdl': -show-ltdldatafiles: - @echo "$(ltdldatafiles)" +shl_load_la_SOURCES = loaders/shl_load.c +shl_load_la_LDFLAGS = -module -avoid-version +shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) ## Make sure these will be cleaned even when they're not built by default: CLEANFILES = libltdl.la libltdlc.la libdlloader.la diff --git a/libltdl/loaders/Makefile.am b/libltdl/loaders/Makefile.am deleted file mode 100644 index 18dc2f134..000000000 --- a/libltdl/loaders/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## Process this file with automake to produce Makefile.in -## -## Copyright (C) 2004, 2005 Free Software Foundation, Inc. -## -## This program 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. -## -## This program 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 this program; see the file COPYING. If not, write to -## the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -## Boston, MA 02111-1307, USA. - -BUILT_SOURCES = -MOSTLYCLEANFILES = -EXTRA_DIST = - -AUTOMAKE_OPTIONS = foreign - -DEFS = -DHAVE_CONFIG_H="<$(CONFIG_H)>" -DLTDL -AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) \ - -I.. -I$(srcdir)/.. -I$(srcdir)/../libltdl -AM_LDFLAGS = -module -avoid-version - -pkgincludedir = $(includedir)/libltdl - - -## 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: -noinst_LTLIBRARIES = $(LT_DLLOADERS) -EXTRA_LTLIBRARIES = dlopen.la dld_link.la dyld.la load_add_on.la \ - loadlibrary.la shl_load.la - -dlopen_la_LIBADD = $(LIBADD_DLOPEN) -shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) -dld_link_la_LIBADD = -ldld diff --git a/m4/ltdl.m4 b/m4/ltdl.m4 index c7ac88b98..1cd271040 100644 --- a/m4/ltdl.m4 +++ b/m4/ltdl.m4 @@ -448,7 +448,7 @@ LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do - LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen loaders/$lt_loader " + LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform])