-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This changeset requires autoconf and automake patched according to:
http://lists.gnu.org/archive/html/autoconf-patches/2005-04/msg00028.html But I think it is fine for HEAD to rely on CVS autoconf/automake, although I don't want to commit until the above patches are in too. That done, a backport to branch-2-0 will require reverting to running libltdl/configure as a subconfigure, otherwise we can't release it bootstrapped with autoconf-2.59 and automake-1.9.5. HOWEVER: autoconf-2.59 still doesn't recognise Darwin's use of -lcrt2.o in g77, so the fortran tests will always fail on Darwin. Maybe we should bootstrap even branch-2-0 with CVS autoconf to avoid that problem? If we decide to do that, then it might ease our maintenance burden to backport this patch more or less as is (without a subconfigure hack)... the whole changeset is, after all, inspired by a bug in branch-2-0. Thoughts? After the backport (in whatever form it eventually takes), is there anything else holding back a 2.0 release that I've forgotten? If not, I propose an alpha release, and a round of testing, with 2.0 a few weeks later! :-D Okay to commit (after autoconf & automake changes are in CVS)? Reorganise the libtool tree to create a bootstrapped libltdl for installation to the libtoolize master tree, so that libltdl is useable even in the extreme case of when automake and autoconf are not installed on the developers machine. Part of this change requires some duplication of rules between Makefile.am (which builds libltdl for this distribution) and libltdl/Makefile.am (which is used by projects that libltoolize --ltdl --copy), so libtool now really does use a single toplevel Makefile.am, and we generate libltdl/Makefile.am from that: * m4, config: Moved from here... * libltdl/m4, libltdl/config: ...to here, to reduce the amount of kludging needed in bootstrap for autoreconf to run. * libltdl/m4/ltdl.m4: Increment serial number. (LTDL_INIT): Accept an optional directory argument to prefix each of the LD_DLLOADERS locations. Default to empty for backwards compatibility. * Makefile.maint: Adjust to compensate. * configure.ac (AC_CONFIG_AUX_DIR, AC_CONFIG_MACRO_DIR): Adjust. (AC_CONFIG_LIBOBJ_DIR): Set here so that we can build LTLIBOBJS from in a subdirectory from the amalgamated Makefile.am. (AM_PROG_CC_C_O, AM_INIT_AUTOMAKE): Use subdir-objects. (AC_CONFIG_FILES): Remove libltdl/Makefile.am. * libltdl/Makefile.am: Removed from repository, and merged into Makefile.am as we now generate it... * Makefile.am (libltdl/Makefile.am): ...from here, by extracting the merged rules, and tweaking paths to accomodate the difference in directory from Makefile.am to libltdl/Makefile.am. (nobase_dist_pkgdata_DATA): Automake generated installation rules change timestamps of installed files, so renamed this... (configauxfiles): ...to this... (libtoolize): ...substitute it... (install-data-local): ...install manually, preserving timestamps... (install-data-hook): ...and set execute bit as appropriate. (libltdl/Makefile.in): New rule. Called from... * bootstrap: ...here to avoid relying on config.status at bootstrap time. (auxdir, m4dir): Extract from configure.ac for ease of future maintenance. Adjust all references. (reconfdirs): Call autoreconf for libltdl too -- even though we don't use it for the build, libltdl/configure and friends are installed with `libtoolize --ltdl --copy'. * libtoolize.m4sh: Add files from the installed config master tree to libtoolize --ltdl project subdirectory. Diagnose duplicated files when --ltdl is used in an autotooled project. It's perfectly fine to run `libtoolize --ltdl --copy' in a tree that has no configure.ac or configure.in; we want libltdl to be useful even to projects that don't use autotools themselves. (libtoolize_flags): Removed. Changed all callers. (func_massage_pkgconfig_files): New function. * tests/standalone.at: New tests for using libltdl without supporting configury in the parent project. * tests/testsuite.at: Run them! - -- Gary V. Vaughan ())_. [EMAIL PROTECTED],gnu.org} Research Scientist ( '/ http://tkd.kicks-ass.net GNU Hacker / )= http://www.gnu.org/software/libtool Technical Author `(_~)_ http://sources.redhat.com/autobook _________________________________________________________ This patch notification generated by tlaapply version 0.9 http://tkd.kicks-ass.net/arch/[EMAIL PROTECTED]/cvs-utils--tla--1.0 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFCbj5sFRMICSmD1gYRAoq8AJ47WJCDGZEQvNllTwv4EgkFoRw6OQCfSYJl tBqva0WFzGDO/jmauvLZDlk= =Hkru -----END PGP SIGNATURE-----
* looking for [EMAIL PROTECTED]/libtool--gary--1.0--patch-22 to compare with * comparing to [EMAIL PROTECTED]/libtool--gary--1.0--patch-22 D/ config/.arch-ids D/ m4/.arch-ids A/ libltdl/config/.arch-ids A/ libltdl/m4/.arch-ids D libltdl/.arch-ids/Makefile.am.id D libltdl/Makefile.am A tests/.arch-ids/standalone.at.id A tests/standalone.at M Makefile.am M Makefile.maint M bootstrap M configure.ac M libtoolize.m4sh M libltdl/m4/ltdl.m4 M ChangeLog M tests/testsuite.at /> config libltdl/config /> m4 libltdl/m4 => config/.arch-ids/=id libltdl/config/.arch-ids/=id => config/.arch-ids/general.m4sh.id libltdl/config/.arch-ids/general.m4sh.id => config/.arch-ids/getopt.m4sh.id libltdl/config/.arch-ids/getopt.m4sh.id => config/.arch-ids/ltmain.m4sh.id libltdl/config/.arch-ids/ltmain.m4sh.id => config/.arch-ids/mailnotify.m4sh.id libltdl/config/.arch-ids/mailnotify.m4sh.id => config/.arch-ids/mkstamp.id libltdl/config/.arch-ids/mkstamp.id => m4/.arch-ids/=id libltdl/m4/.arch-ids/=id => m4/.arch-ids/argz.m4.id libltdl/m4/.arch-ids/argz.m4.id => m4/.arch-ids/libtool.m4.id libltdl/m4/.arch-ids/libtool.m4.id => m4/.arch-ids/ltdl.m4.id libltdl/m4/.arch-ids/ltdl.m4.id => m4/.arch-ids/ltoptions.m4.id libltdl/m4/.arch-ids/ltoptions.m4.id => m4/.arch-ids/ltsugar.m4.id libltdl/m4/.arch-ids/ltsugar.m4.id => m4/.arch-ids/ltversion.in.id libltdl/m4/.arch-ids/ltversion.in.id => m4/.arch-ids/lt~obsolete.m4.id libltdl/m4/.arch-ids/lt~obsolete.m4.id * modified files Index: Changelog from Gary V. Vaughan <[EMAIL PROTECTED]> Reorganise the libtool tree to create a bootstrapped libltdl for installation to the libtoolize master tree, so that libltdl is useable even in the extreme case of when automake and autoconf are not installed on the developers machine. Part of this change requires some duplication of rules between Makefile.am (which builds libltdl for this distribution) and libltdl/Makefile.am (which is used by projects that libltoolize --ltdl --copy), so libtool now really does use a single toplevel Makefile.am, and we generate libltdl/Makefile.am from that: * m4, config: Moved from here... * libltdl/m4, libltdl/config: ...to here, to reduce the amount of kludging needed in bootstrap for autoreconf to run. * libltdl/m4/ltdl.m4: Increment serial number. (LTDL_INIT): Accept an optional directory argument to prefix each of the LD_DLLOADERS locations. Default to empty for backwards compatibility. * Makefile.maint: Adjust to compensate. * configure.ac (AC_CONFIG_AUX_DIR, AC_CONFIG_MACRO_DIR): Adjust. (AC_CONFIG_LIBOBJ_DIR): Set here so that we can build LTLIBOBJS from in a subdirectory from the amalgamated Makefile.am. (AM_PROG_CC_C_O, AM_INIT_AUTOMAKE): Use subdir-objects. (AC_CONFIG_FILES): Remove libltdl/Makefile.am. * libltdl/Makefile.am: Removed from repository, and merged into Makefile.am as we now generate it... * Makefile.am (libltdl/Makefile.am): ...from here, by extracting the merged rules, and tweaking paths to accomodate the difference in directory from Makefile.am to libltdl/Makefile.am. (nobase_dist_pkgdata_DATA): Automake generated installation rules change timestamps of installed files, so renamed this... (configauxfiles): ...to this... (libtoolize): ...substitute it... (install-data-local): ...install manually, preserving timestamps... (install-data-hook): ...and set execute bit as appropriate. (libltdl/Makefile.in): New rule. Called from... * bootstrap: ...here to avoid relying on config.status at bootstrap time. (auxdir, m4dir): Extract from configure.ac for ease of future maintenance. Adjust all references. (reconfdirs): Call autoreconf for libltdl too -- even though we don't use it for the build, libltdl/configure and friends are installed with `libtoolize --ltdl --copy'. * libtoolize.m4sh: Add files from the installed config master tree to libtoolize --ltdl project subdirectory. Diagnose duplicated files when --ltdl is used in an autotooled project. It's perfectly fine to run `libtoolize --ltdl --copy' in a tree that has no configure.ac or configure.in; we want libltdl to be useful even to projects that don't use autotools themselves. (libtoolize_flags): Removed. Changed all callers. (func_massage_pkgconfig_files): New function. * tests/standalone.at: New tests for using libltdl without supporting configury in the parent project. * tests/testsuite.at: Run them! --- orig/Makefile.am +++ mod/Makefile.am @@ -22,12 +22,20 @@ ## the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ## Boston, MA 02111-1307, USA. -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I libltdl/m4 -BUILD_SUBDIRS = . libltdl -SUBDIRS = $(BUILD_SUBDIRS) -DIST_SUBDIRS = $(BUILD_SUBDIRS) -EXTRA_DIST = +DIST_SUBDIRS = . + +BUILT_SOURCES = + +CLEANFILES = +MOSTLYCLEANFILES = +DISTCLEANFILES = + +EXTRA_DIST = + +auxdir = libltdl/config +m4dir = libltdl/m4 ## ---------------- ## @@ -44,6 +52,7 @@ $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \ -e 's,@aclocal_DATA\@,$(aclocalfiles),g' \ -e "s,@pkgltdl_files\@,$(ltdldatafiles),g" \ + -e "s,@pkgconfig_files\@,$(auxfiles),g" \ $(srcdir)/libtoolize.in > libtoolize.tmp chmod a+x libtoolize.tmp chmod a-w libtoolize.tmp @@ -55,9 +64,9 @@ $(srcdir)/libtoolize.in: $(sh_files) libtoolize.m4sh Makefile.am cd $(srcdir); \ rm -f libtoolize.in; \ - $(M4SH) -B ./config libtoolize.m4sh > libtoolize.in + $(M4SH) -B $(auxdir) libtoolize.m4sh > libtoolize.in -libtool: $(top_builddir)/config.status $(srcdir)/config/ltmain.sh \ +libtool: $(top_builddir)/config.status $(srcdir)/$(auxdir)/ltmain.sh \ $(srcdir)/stamp-vcl cd $(top_builddir) && $(SHELL) ./config.status $@ @@ -101,32 +110,21 @@ *) TIMESTAMP="" ;; \ esac -sh_files = config/general.m4sh config/getopt.m4sh -EXTRA_DIST += bootstrap libtoolize.in config/ltmain.m4sh config/mkstamp \ - $(sh_files) stamp-vcl ChangeLog.1996 ChangeLog.1997 \ - ChangeLog.1998 ChangeLog.1999 ChangeLog.2000 ChangeLog.2001 \ - ChangeLog.2002 ChangeLog.2003 -CLEANFILES = libtool libtoolize \ - libtoolize.tmp config/ltmain.tmp m4/ltversion.tmp -DISTCLEANFILES = - -# These are required by libtoolize and must be executable when installed. -# Since _SCRIPTS gets the program transform applied we make them -# executable by hand -nobase_dist_pkgdata_DATA = config/config.guess config/config.sub \ - config/ltmain.sh config/install-sh - -# Everything that gets picked up by aclocal is automatically distributed, -# this is the list of macro files we install on the user's system. -aclocalfiles = m4/argz.m4 m4/libtool.m4 m4/ltdl.m4 \ - m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 +sh_files = $(auxdir)/general.m4sh $(auxdir)/getopt.m4sh +EXTRA_DIST += bootstrap libtoolize.in $(auxdir)/ltmain.m4sh \ + $(auxdir)/mkstamp $(sh_files) stamp-vcl \ + ChangeLog.1996 ChangeLog.1997 ChangeLog.1998 \ + ChangeLog.1999 ChangeLog.2000 ChangeLog.2001 \ + ChangeLog.2002 ChangeLog.2003 ChangeLog.2004 +CLEANFILES += libtool libtoolize libtoolize.tmp \ + $(auxdir)/ltmain.tmp $(m4dir)/ltversion.tmp ## We know that $(srcdir)/ChangeLog has been edited if stamp-vcl ## needs updating, so we assume we have write access to $(srcdir). ## If we try to maintain ./stamp-vcl to avoid writing to a possibly ## read-only $(srcdir), then when the two stamp-vcls differ, distcheck ## will try to update the one in the read-only source tree it makes. -MKSTAMP = $(SHELL) $(srcdir)/config/mkstamp +MKSTAMP = $(SHELL) $(srcdir)/$(auxdir)/mkstamp $(srcdir)/stamp-vcl: vcl-tmp clean-ltmain-sh ChangeLog vcl-tmp: @set dummy `$(MKSTAMP) < $(srcdir)/ChangeLog`; shift; \ @@ -141,7 +139,7 @@ ## source tree version in current builds. clean-ltmain-sh: @-test "$(srcdir)" = "$(top_builddir)" || \ - rm -f "$(top_builddir)/config/ltmain.sh" + rm -f "$(top_builddir)/$(auxdir)/ltmain.sh" # We build ltversion.m4 here, instead of from config.status, # because config.status is rerun each time one of configure's @@ -150,40 +148,185 @@ # a loop otherwise. # Use `$(srcdir)/m4' for the benefit of non-GNU makes: this is # how ltversion.m4 appears in our dependencies. -EXTRA_DIST += m4/ltversion.in m4/ltversion.m4 -$(srcdir)/m4/ltversion.m4: m4/ltversion.in configure.ac $(srcdir)/stamp-vcl +EXTRA_DIST += $(m4dir)/ltversion.in $(m4dir)/ltversion.m4 +$(srcdir)/$(m4dir)/ltversion.m4: $(m4dir)/ltversion.in configure.ac $(srcdir)/stamp-vcl set dummy `$(MKSTAMP) < $(srcdir)/ChangeLog`; shift; \ cd $(srcdir); \ - rm -f m4/ltversion.tmp; \ + rm -f $(m4dir)/ltversion.tmp; \ serial=`echo $$1 | sed 's,^1[.],,g'`; \ input="ltversion.in"; \ $(edit) -e "s,@MACRO_REVISION\@,$$1,g" \ -e "s,@MACRO_SERIAL\@,$$serial,g" \ - m4/ltversion.in > m4/ltversion.tmp; \ - chmod a-w m4/ltversion.tmp; \ - mv -f m4/ltversion.tmp m4/ltversion.m4 + $(m4dir)/ltversion.in > $(m4dir)/ltversion.tmp; \ + chmod a-w $(m4dir)/ltversion.tmp; \ + mv -f $(m4dir)/ltversion.tmp $(m4dir)/ltversion.m4 ## And for similar reasons, ltmain.sh can't be built from config.status. ## !WARNING! If you edit this rule to change the contents of ltmain.sh, -## you must `touch $(srcdir)/config/ltmain.in' from the +## you must `touch $(srcdir)/$(auxdir)/ltmain.in' from the ## shell if you need ltmain.sh to be regenerated. Ideally, we ## should make this rule depend on Makefile but that will break ## distcheck (at least) by rebuilding ltmain.sh in the source ## tree whenever config.status regenerates the Makefile. -EXTRA_DIST += config/ltmain.sh -$(srcdir)/config/ltmain.sh: $(sh_files) config/ltmain.m4sh configure.ac \ +EXTRA_DIST += $(auxdir)/ltmain.sh +$(srcdir)/$(auxdir)/ltmain.sh: $(sh_files) $(auxdir)/ltmain.m4sh configure.ac \ $(srcdir)/stamp-vcl $(timestamp); \ cd $(srcdir); \ - rm -f config/ltmain.in config/ltmain.tmp config/ltmain.sh; \ - $(M4SH) -B ./config config/ltmain.m4sh > config/ltmain.in; \ + rm -f $(auxdir)/ltmain.in $(auxdir)/ltmain.tmp \ + $(auxdir)/ltmain.sh; \ + $(M4SH) -B $(auxdir) $(auxdir)/ltmain.m4sh \ + > $(auxdir)/ltmain.in; \ input="ltmain.m4sh"; \ $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \ -e "s,@package_revision\@,$$1,g" \ - config/ltmain.in > config/ltmain.tmp; \ - rm -f config/ltmain.in; \ - chmod a-w config/ltmain.tmp; \ - mv -f config/ltmain.tmp config/ltmain.sh + $(auxdir)/ltmain.in > $(auxdir)/ltmain.tmp; \ + rm -f $(auxdir)/ltmain.in; \ + chmod a-w $(auxdir)/ltmain.tmp; \ + mv -f $(auxdir)/ltmain.tmp $(auxdir)/ltmain.sh + +$(srcdir)/libltdl/Makefile.am: Makefile.am + cd $(srcdir); \ + in=Makefile.am; out=libltdl/Makefile.am; \ + rm -f $$out; \ + $(SED) '/^## Makefile.am -- /,/## Boston, MA/ p; \ + d' $$in > $$out; \ + { echo 'ACLOCAL_AMFLAGS = -I m4'; \ + echo 'AUTOMAKE_OPTIONS = foreign'; \ + echo 'BUILT_SOURCES ='; \ + echo 'EXTRA_DIST ='; \ + echo 'CLEANFILES ='; \ + echo 'MOSTLYCLEANFILES ='; \ + } >> $$out; \ + $(SED) '/^# ### BEGIN /,/^# ### END / \ + { s,libltdl_,,; s,libltdl/,,; s,: libltdl/,: ,; \ + s,\$$(libltdl_,$$(,; p; }; \ + d' $$in >> $$out; + chmod a-w $(srcdir)/libltdl/Makefile.am + +$(srcdir)/libltdl/Makefile.in: libltdl/Makefile.am + @echo ' cd $(srcdir)/libltdl && $(AUTOMAKE) Makefile'; \ + cd $(srcdir)/libltdl && $(AUTOMAKE) Makefile + + +## -------- ## +## Libltdl. ## +## -------- ## + +# ### BEGIN libltdl/Makefile.am + +DEFS = -DHAVE_CONFIG_H="<$(CONFIG_H)>" -DLTDL +AM_CPPFLAGS = -I. -Ilibltdl -I$(srcdir)/libltdl \ + -I$(srcdir)/libltdl/libltdl +AM_LDFLAGS = -no-undefined +VERSION_INFO = -version-info 6:0:0 + +noinst_LTLIBRARIES = $(LT_DLLOADERS) + +if INSTALL_LTDL +include_HEADERS = libltdl/ltdl.h \ + libltdl/libltdl/lt_system.h \ + libltdl/libltdl/lt_error.h \ + libltdl/libltdl/lt_dlloader.h +lib_LTLIBRARIES = libltdl/libltdl.la + +ltdlincludedir = $(includedir)/libltdl +install-data-hook: + $(mkinstalldirs) $(DESTDIR)$(ltdlincludedir) + @for f in lt_system.h lt_error.h lt_dlloader.h; do \ + test -f $(DESTDIR)$(includedir)/$$f || continue; \ + echo "mv $(DESTDIR)$(includedir)/$$f $(DESTDIR)$(ltdlincludedir)"; \ + mv $(DESTDIR)$(includedir)/$$f $(DESTDIR)$(ltdlincludedir); \ + done +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 + +libltdl_libltdl_la_CPPFLAGS = -DLTDLOPEN=libltdl $(AM_CPPFLAGS) +libltdl_libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(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=libltdlc $(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 + + +## --------------------------- ## +## Gnulib Makefile.am snippets ## +## --------------------------- ## + +BUILT_SOURCES += libltdl/$(ARGZ_H) +EXTRA_DIST += libltdl/argz_.h + +# 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 + cp $(srcdir)/libltdl/argz_.h [EMAIL PROTECTED] + mv [EMAIL PROTECTED] $@ +MOSTLYCLEANFILES += libltdl/argz.h \ + libltdl/argz.h-t + +# ### END libltdl/Makefile.am ## -------------- ## @@ -205,58 +348,65 @@ ## Installation. ## ## ------------- ## +# These are required by libtoolize and must be executable when installed. +# The timestamps on these files must be preserved carefully so we install, +# uninstall and set executable with custom rules here. +auxexefiles = config/compile config/config.guess config/config.sub \ + config/depcomp config/install-sh config/missing +auxfiles = $(auxexefiles) config/ltmain.sh + +# Everything that gets picked up by aclocal is automatically distributed, +# this is the list of macro files we install on the user's system. +aclocalfiles = m4/argz.m4 m4/libtool.m4 m4/ltdl.m4 m4/ltoptions.m4 \ + m4/ltsugar.m4 m4/ltversion.m4 + ## 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 \ - 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 +ltdldatafiles = libltdl/COPYING.LIB \ + libltdl/README \ + libltdl/Makefile.am \ + libltdl/Makefile.in \ + libltdl/aclocal.m4 \ + libltdl/config-h.in \ + libltdl/configure.ac \ + libltdl/configure \ + libltdl/argz_.h \ + libltdl/argz.c \ + libltdl/loaders/dld_link.c \ + libltdl/loaders/dlopen.c \ + libltdl/loaders/dyld.c \ + libltdl/loaders/load_add_on.c \ + libltdl/loaders/loadlibrary.c \ + libltdl/loaders/shl_load.c \ + libltdl/lt__dirent.c \ + libltdl/lt__strl.c \ + $(libltdl_libltdl_la_SOURCES) -install-data-local: +install-data-local: libltdl/Makefile.in ## 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 -; ) + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + ( cd $(srcdir) && $(AMTAR) chf - $(ltdldatafiles); ) \ + | ( umask 0 && cd $(DESTDIR)$(pkgdatadir) && $(AMTAR) xf -; ) +## And similarly copy the config auxilliary files into the master tree + ( cd $(srcdir)/libltdl && $(AMTAR) chf - $(auxfiles); ) \ + | ( umask 0 && cd $(DESTDIR)$(pkgdatadir) && $(AMTAR) xf -; ) + @for f in : $(auxexefiles); do \ + test "X$$f" = X: && continue; \ + echo "chmod +x '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + chmod +x "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done +## Put a copy of the libtool m4 macros in the aclocal dir $(mkinstalldirs) $(DESTDIR)$(aclocaldir) @for p in $(aclocalfiles); do \ f=`echo "$$p" | sed 's|^.*/||'`; \ aclocalfiles="$$aclocalfiles $$f"; \ done; \ - ( cd $(srcdir)/m4 && $(AMTAR) chf - $$aclocalfiles; ) \ + ( cd $(srcdir)/$(m4dir) && $(AMTAR) chf - $$aclocalfiles; ) \ | ( umask 0 && cd $(DESTDIR)$(aclocaldir) && $(AMTAR) xf -; ) -install-data-hook: - chmod +x $(DESTDIR)$(pkgdatadir)/config/config.guess - chmod +x $(DESTDIR)$(pkgdatadir)/config/config.sub - chmod +x $(DESTDIR)$(pkgdatadir)/config/install-sh - ## ------------- ## ## Distribution. ## @@ -293,6 +443,7 @@ tests/functests.at \ tests/inherited_flags.at \ tests/libtoolize.at \ + tests/standalone.at \ tests/stresstest.at \ tests/link-order.at \ tests/template.at @@ -327,6 +478,7 @@ tests/atconfig: config.status $(SHELL) ./config.status tests/atconfig + DISTCLEANFILES += tests/atconfig lt__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd @@ -445,10 +597,10 @@ # Use `$(srcdir)/tests' for the benefit of non-GNU makes: this is # how defs.in appears in our dependencies. -$(srcdir)/tests/defs.in: config/general.m4sh tests/defs.m4sh Makefile.am +$(srcdir)/tests/defs.in: $(auxdir)/general.m4sh tests/defs.m4sh Makefile.am cd $(srcdir); \ rm -f tests/defs.in; \ - $(M4SH) -B ./config tests/defs.m4sh > tests/defs.in + $(M4SH) -B $(auxdir) tests/defs.m4sh > tests/defs.in # We need to remove any files that the above tests created. clean-local-legacy: --- orig/Makefile.maint +++ mod/Makefile.maint @@ -1,6 +1,6 @@ ## Makefile.maint -- Makefile rules for libtool maintainers -*-Makefile-*- ## -## Copyright (C) 2004 Free Software Foundation +## Copyright (C) 2004, 2005 Free Software Foundation ## ## 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 @@ -31,11 +31,11 @@ TEXI2HTML = texi2html -$(top_srcdir)/commit: $(top_srcdir)/config/mailnotify clcommit.m4sh +$(srcdir)/commit: $(srcdir)/$(auxdir)/mailnotify clcommit.m4sh $(timestamp); \ - cd $(top_srcdir); \ + cd $(srcdir); \ rm -f commit commit.in commit.tmp; \ - $(M4SH) -B ./config clcommit.m4sh > commit.in; \ + $(M4SH) -B $(auxdir) clcommit.m4sh > commit.in; \ input="clcommit.m4sh"; \ $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" commit.in > commit.tmp; \ chmod a+x commit.tmp; \ @@ -43,9 +43,9 @@ mv -f commit.tmp commit; \ rm -f commit.in -$(top_srcdir)/config/mailnotify: config/mailnotify.m4sh +$(srcdir)/$(auxdir)/mailnotify: $(auxdir)/mailnotify.m4sh $(timestamp); \ - cd $(top_srcdir)/config; \ + cd $(srcdir)/$(auxdir); \ rm -f mailnotify mailnotify.in mailnotify.tmp; \ $(M4SH) -B . mailnotify.m4sh > mailnotify.in; \ input="mailnotify.m4sh"; \ @@ -119,10 +119,10 @@ ## FIXME should be a lot more here FETCHFILES = \ ./INSTALL \ -config/install-sh \ -config/config.guess \ -config/config.sub \ -config/texinfo.tex +$(auxdir)/install-sh \ +$(auxdir)/config.guess \ +$(auxdir)/config.sub \ +$(auxdir)/texinfo.tex ## Fetch the latest versions of files we care about. .PHONY: fetch @@ -238,7 +238,7 @@ .PHONY: web-manual web-manual: - @$(LN_S) $(top_srcdir)/doc/libtool.texi doc/manual.texi + @$(LN_S) $(srcdir)/doc/libtool.texi doc/manual.texi $(TEXI2HTML) -I doc -monolithic -number -verbose doc/manual.texi @mv doc/manual.html manual.html @rm -f doc/manual.texi --- orig/bootstrap +++ mod/bootstrap @@ -39,6 +39,19 @@ exit 1 } + +# Extract auxdir and m4dir from configure.ac: +my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; + /AC_CONFIG_AUX_DIR[^_]/ { + s,^.*AC_CONFIG_AUX_DIR([[ ]*\([^])]*\).*$,auxdir=\1,; p; + }; + /AC_CONFIG_MACRO_DIR/ { + s,^.*AC_CONFIG_MACRO_DIR([[ ]*\([^])]*\).*$,m4dir=\1,; p; + }; + d;' +eval `cat configure.ac 2>/dev/null | $SED "$my_sed_traces"` + + # Upgrade caveat: cat <<'EOF' WARNING: If bootstrapping with this script fails, it may be due to an @@ -52,10 +65,10 @@ rm -rf `find . -path './{arch}' -prune -o \( -name autom4te.cache -o -name libtool \) -print` # Delete stale files from previous libtool versions. -rm -f acinclude.m4 config/ltmain.sh libltdl/config.h +rm -f acinclude.m4 libltdl/config.h if test -z "$reconfdirs"; then - reconfdirs=". `ls -1d tests/*demo tests/*demo[0-9]`" + reconfdirs=". libltdl `ls -1d tests/*demo tests/*demo[0-9]`" fi # Extract the package name and version number from configure.ac: @@ -71,13 +84,14 @@ # We don't have all the substitution values to build ltmain.sh from this # script yet, but we need config/ltmain.sh for the libtool commands in # configure, and ltversion.m4 to generate configure in the first place: -rm -f ./config/ltmain.sh ./m4/ltversion.m4 +rm -f $auxdir/ltmain.sh $m4dir/ltversion.m4 -$MAKE ./config/ltmain.sh ./doc/notes.txt ./m4/ltversion.m4 ./libtoolize.in \ - ./tests/defs.in ./tests/package.m4 ./tests/testsuite \ +$MAKE $auxdir/ltmain.sh $m4dir/ltversion.m4 ./doc/notes.txt \ + ./libtoolize.in ./tests/defs.in ./tests/package.m4 \ + ./tests/testsuite ./libltdl/Makefile.am \ srcdir=. top_srcdir=. PACKAGE="$2" VERSION="$3" \ PACKAGE_BUGREPORT="[EMAIL PROTECTED]" M4SH="$AUTOM4TE --language=m4sh" \ - AUTOTEST="$AUTOM4TE --language=autotest" MAKEINFO="$MAKEINFO" + AUTOTEST="$AUTOM4TE --language=autotest" SED="$SED" MAKEINFO="$MAKEINFO" test -f clcommit.m4sh && $MAKE -f Makefile.maint commit \ srcdir=. top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="$AUTOM4TE -l m4sh" \ @@ -86,25 +100,33 @@ rm -f Makefile # Make a dummy libtoolize script for autoreconf: -test -f clcommit.m4sh && cat > ./config/libtoolize <<'EOF' +test -f clcommit.m4sh && cat > $auxdir/libtoolize <<'EOF' #! /bin/sh # This is a dummy file for bootstrapping CVS libtool. echo "$0: Bootstrap detected, no files installed." | sed 's,^.*/,,g' exit 0 EOF -chmod 755 ./config/libtoolize +chmod 755 $auxdir/libtoolize # Running the installed `libtoolize' will trash the local (newer) libtool.m4 # among others. Call the dummy script we made earlier. -LIBTOOLIZE=`pwd`/config/libtoolize +LIBTOOLIZE=`pwd`/$auxdir/libtoolize export LIBTOOLIZE for sub in $reconfdirs; do $AUTORECONF --force --verbose --install $sub done +# Autoheader valiantly tries to prevent needless reconfigurations by +# not changing the timestamp of config-h.in unless the file contents +# are updated. Unfortunately config-h.in depends on aclocal.m4 which +# *is* updated, so running 'libtoolize --ltdl=. && configure && make' +# causes autoheader to be called... undesireable for users that do not +# have it! Fudge the timestamp to prevent that: +sleep 2 && touch libltdl/config-h.in + # Remove our dummy libtoolize -rm -f ./config/libtoolize +rm -f $auxdir/libtoolize # These files can cause an infinite configure loop if left behind. rm -f Makefile libltdl/Makefile libtool vcl.tmp @@ -112,7 +134,7 @@ # This file is misgenerated earlier in bootstrap to satisfy automake 1.9.1 # and earlier, but has a new enough timestamp to not be updated. Force it # to be regenerated at make-time with proper substitutions in place: -touch config/ltmain.in +touch $auxdir/ltmain.in # Commit script caveat: cat <<'EOF' @@ -120,7 +142,7 @@ WARNING: after you have run `configure' to discover the real whereabouts WARNING: of `sed', `grep' etc. like this: WARNING: -WARNING: rm -f config/mailnotify; make -f Makefile.maint commit +WARNING: rm -f $auxdir/mailnotify; make -f Makefile.maint commit EOF exit 0 --- orig/configure.ac +++ mod/configure.ac @@ -27,7 +27,9 @@ AC_INIT([libtool], [2.1a], [EMAIL PROTECTED]) AC_CONFIG_HEADERS([config.h:config-h.in]) AC_CONFIG_SRCDIR([libtoolize.in]) -AC_CONFIG_AUX_DIR([config]) +AC_CONFIG_AUX_DIR([libltdl/config]) +AC_CONFIG_MACRO_DIR([libltdl/m4]) +AC_CONFIG_LIBOBJ_DIR([libltdl]) ## ------------------------ ## @@ -113,7 +115,7 @@ dnl These are bootstrap requirements, once built, libtool may work with dnl much older releases of autoconf and automake. See release notes. -AM_INIT_AUTOMAKE([1.8 gnits dist-bzip2])dnl We use auto-m4_including +AM_INIT_AUTOMAKE([1.8 gnits subdir-objects dist-bzip2]) dnl We use m4sh to generate libtool's portable shell scripts AC_SUBST([M4SH], ['$(AUTOM4TE) --language=m4sh']) @@ -155,13 +157,14 @@ # a good C compiler: if the following C++ tests fail, the whole libtool # build fails! AC_PROG_CC +AM_PROG_CC_C_O AC_PROG_CPP ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## LT_INIT([dlopen win32-dll]) -LTDL_INIT +LTDL_INIT([libltdl]) # Enable all the language support we can LT_LANG(C++) @@ -182,5 +185,5 @@ ## -------- ## ## Outputs. ## ## -------- ## -AC_CONFIG_FILES([Makefile libltdl/Makefile]) +AC_CONFIG_FILES([Makefile]) AC_OUTPUT --- orig/m4/ltdl.m4 +++ mod/libltdl/m4/ltdl.m4 @@ -5,7 +5,7 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 7 LTDL_INIT +# serial 8 LTDL_INIT # LT_WITH_LTDL([DIRECTORY]) # ------------------------- @@ -136,12 +136,17 @@ dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) -# LTDL_INIT -# --------- +# LTDL_INIT([DIRECTORY]) +# ---------------------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. AC_DEFUN([LTDL_INIT], -[AC_REQUIRE([AC_PROG_CC])dnl +[m4_if([$#], 1, [m4_divert_push([DEFAULTS])dnl +# libltdl will be built in the named DIRECTORY, relative to $top_builddir. +lt_ltdl_dir='$1' +m4_divert_pop([DEFAULTS])])dnl + +AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_HEADER_DIRENT])dnl @@ -379,6 +384,9 @@ LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) +test "X${lt_ltdl_dir-.}" != X. && + lt_ltdl_dir=`echo "$lt_ltdl_dir/" | sed 's,/*$,/,'` + AC_LANG_PUSH([C]) LIBADD_DLOPEN= @@ -386,7 +394,7 @@ [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN="-ldl" libltdl_cv_lib_dl_dlopen="yes" - LT_DLLOADERS="$LT_DLLOADERS dlopen.la"], + LT_DLLOADERS="$LT_DLLOADERS ${lt_ltdl_dir}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include <dlfcn.h> #endif @@ -394,12 +402,12 @@ [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes" - LT_DLLOADERS="$LT_DLLOADERS dlopen.la"], + LT_DLLOADERS="$LT_DLLOADERS ${lt_ltdl_dir}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" - LT_DLLOADERS="$LT_DLLOADERS dlopen.la"])])]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_ltdl_dir}dlopen.la"])])]) if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" @@ -413,11 +421,11 @@ AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) - LT_DLLOADERS="$LT_DLLOADERS shl_load.la"], + LT_DLLOADERS="$LT_DLLOADERS ${lt_ltdl_dir}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) - LT_DLLOADERS="$LT_DLLOADERS shl_load.la" + LT_DLLOADERS="$LT_DLLOADERS ${lt_ltdl_dir}shl_load.la" LIBADD_SHL_LOAD="-ldld"])]) AC_SUBST([LIBADD_SHL_LOAD]) @@ -427,20 +435,20 @@ AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) - LT_DLLOADERS="$LT_DLLOADERS dyld.la"]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_ltdl_dir}dyld.la"]) ;; beos*) - LT_DLLOADERS="$LT_DLLOADERS load_add_on.la" + LT_DLLOADERS="$LT_DLLOADERS ${lt_ltdl_dir}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) - LT_DLLOADERS="$LT_DLLOADERS loadlibrary.la" + LT_DLLOADERS="$LT_DLLOADERS ${lt_ltdl_dir}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) - LT_DLLOADERS="$LT_DLLOADERS dld_link.la"]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_ltdl_dir}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) --- orig/libtoolize.m4sh +++ mod/libtoolize.m4sh @@ -73,16 +73,15 @@ opt_link=: opt_debug=: +seen_autoconf=false seen_libtool=false seen_ltdl=false -# Collect flags to pass into libltdl libtoolize -libtoolize_flags= - # Locations for important files: [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ auxdir= m4dir= @@ -103,12 +102,9 @@ opt="$1" shift case $opt in - --copy|-c) opt_link=false - libtoolize_flags="$libtoolize_flags --copy" - ;; + --copy|-c) opt_link=false ;; --debug) func_echo "enabling shell trace mode" - libtoolize_flags="$libtoolize_flags --debug" opt_debug='set -x' $opt_debug ;; @@ -121,16 +117,11 @@ MKDIR="$ECHO $MKDIR" TAR="$ECHO $TAR" fi - libtoolize_flags="${libtoolize_flags} --dry-run" ;; - --force|-f) opt_force=: - libtoolize_flags="${libtoolize_flags} --force" - ;; + --force|-f) opt_force=: ;; - --install|-i) opt_install=: - libtoolize_flags="${libtoolize_flags} --install" - ;; + --install|-i) opt_install=: ;; --ltdl) ltdldir=libltdl if test "$#" -gt 0; then @@ -143,12 +134,9 @@ --quiet|--automake|-q) # --automake is for 1.5 compatibility opt_quiet=: - libtoolize_flags="${libtoolize_flags} --quiet" ;; - --verbose|-v) opt_verbose=: - libtoolize_flags="${libtoolize_flags} --verbose" - ;; + --verbose|-v) opt_verbose=: ;; # Separate optargs to long options: --*=*) @@ -226,18 +214,23 @@ test -f "$my_srcdir/$my_file" || \ { func_error "\`$my_file' not found in \`$my_srcdir'"; return; } - func_mkdir_p "$my_destdir" + case $opt_verbose in + false) my_copy_msg="file \`$my_destdir/$my_file'" ;; + *) my_copy_msg="file from \`$my_srcdir/$my_file'" ;; + esac + + func_mkdir_p `$ECHO "X$my_destdir/$my_file" | $Xsed -e "$dirname"` $RM "$my_destdir/$my_file" if $opt_link && $LN_S "$my_srcdir/$my_file" "$my_destdir/$my_file"; then - $opt_quiet || func_echo "copying file \`$my_destdir/$my_file'" + $opt_quiet || func_echo "linking $my_copy_msg" copy_return_status=0 elif { ( cd "$my_srcdir" 2>/dev/null && $TAR chf - "$my_file" 2>/dev/null; ) \ | ( umask 0 && cd "$my_destdir" 2>/dev/null && "$TAR" xf - >/dev/null 2>&1; ) } ; then - $opt_quiet || func_echo "copying file \`$my_destdir/$my_file'" + $opt_quiet || func_echo "copying $my_copy_msg" copy_return_status=0 elif $CP -p "$my_srcdir/$my_file" "$my_destdir/$my_file"; then - $opt_quiet || func_echo "copying file \`$my_destdir/$my_file'" + $opt_quiet || func_echo "copying $my_copy_msg" copy_return_status=0 else func_error "can not copy \`$my_srcdir/$my_file' to \`$my_destdir/'" @@ -349,18 +342,19 @@ $opt_debug # Prefer configure.ac to configure.in test -f configure.ac && configure_ac=configure.ac - test -f "$configure_ac" \ - || func_fatal_help "\`$configure_ac' does not exist" + test -f "$configure_ac" || configure_ac= # Set local variables to reflect contents of configure.ac - my_uses_autoconf=false my_sed_scan_configure_ac='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; - /AC_INIT/ { s,^.*$,my_uses_autoconf=:,; p; }; + /AC_INIT/ { s,^.*$,seen_autoconf=:,; p; }; d' - eval `$SED "$my_sed_scan_configure_ac" "$configure_ac"` + test -z "$configure_ac" \ + || eval `$SED "$my_sed_scan_configure_ac" "$configure_ac"` - $my_uses_autoconf || { - func_verbose "$configure_ac: not using Autoconf" + $seen_autoconf || { + my_configure_ac= + test -n "$configure_ac" && my_configure_ac="$configure_ac: " + func_verbose "${my_configure_ac}not using Autoconf" return } @@ -746,6 +740,10 @@ func_check_macros () { $opt_debug + + $seen_autoconf \ + || return + # Don't trace for this, we're just checking the user didn't invoke it # directly from configure.ac. $SED 's,[d]nl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB \ @@ -796,6 +794,9 @@ # Massage a value for pkgltdl_files from the value used in Makefile.am for my_filename in @pkgltdl_files@; do + # Strip surplus leading 'libltdl/': + my_filename=`expr "X$my_filename" : 'Xlibltdl/\(.*\)'` + # ignore excluded filenames if test -n "$my_glob_exclude"; then eval 'case $my_filename in '$my_glob_exclude') continue ;; esac' @@ -813,6 +814,35 @@ } +# func_massage_pkgconfig_files [glob_exclude] +# @pkgconfig_files\@ is substituted as per its value in Makefile.am; this +# function massages it into a suitable format for func_copy_some_files. +func_massage_pkgconfig_files () +{ + pkgconfig_files= # GLOBAL VAR + + my_glob_exclude="$1" + + # Massage a value for pkgconfig_files from the value used in Makefile.am + for my_filename in @pkgconfig_files@; do + + # ignore excluded filenames + if test -n "$my_glob_exclude"; then + eval 'case $my_filename in '$my_glob_exclude') continue ;; esac' + fi + + # ignore duplicates + case :$pkgconfig_files: in + *:$my_filename:*) ;; + *) pkgconfig_files="$pkgconfig_files:$my_filename" ;; + esac + done + + # strip spurious leading `:' + pkgconfig_files=`$ECHO "X$pkgconfig_files" | $Xsed -e 's,^:*,,'` +} + + # func_nonemptydir_p dirvar # DIRVAR is the name of a variable to evaluate. Unless DIRVAR names # a directory that exists and is non-empty abort with a diagnostic. @@ -841,13 +871,16 @@ # Allow the user to override the master libtoolize repository: if test -n "$_lt_pkgdatadir"; then - pkgdatadir="$_lt_pkgdatadir" - aclocaldir="$_lt_pkgdatadir/m4" + pkgltdldir="$_lt_pkgdatadir" + pkgdatadir="$_lt_pkgdatadir/libltdl" + aclocaldir="$_lt_pkgdatadir/libltdl/m4" fi + func_nonemptydir_p pkgltdldir func_nonemptydir_p pkgdatadir func_nonemptydir_p aclocaldir func_massage_pkgltdl_files + func_massage_pkgconfig_files # libtool.m4 and ltdl.m4 are handled specially below func_massage_aclocal_DATA 'libtool.m4|ltdl.m4' @@ -860,24 +893,38 @@ # Copy all the files from installed libltdl to this project, if the # user specified `--ltdl'. if test -n "$ltdldir"; then - func_copy_some_files "$pkgltdl_files" "$pkgdatadir/libltdl" "$ltdldir" + func_copy_some_files "$pkgltdl_files" "$pkgltdldir/libltdl" "$ltdldir" - # libtoolize the newly copied libltdl tree - ( cd "$ltdldir" && eval "$progpath" $libtoolize_flags ) \ - || exit $EXIT_FAILURE - fi + # Unless we share CONFIG_MACRO_DIR with our parent project, + # copy macros here. + if test "$ltdldir/m4" != "$m4dir"; then + func_copy_some_files "$pkgmacro_files:libtool.m4:ltdl.m4" \ + "$aclocaldir" "$ltdldir/m4" + fi - # Copy all the installed utility files to the auxiliary directory if - # `--install' was passed, or else copy just ltmain.sh. - $opt_quiet || if test "$auxdir" != .; then - func_echo "putting files in AC_CONFIG_AUX_DIR, \`$auxdir'." + # Unless we share CONFIG_AUX_DIR with our parent project, + # copy config aux files into libltdl. + if test "$ltdldir/config" != "$auxdir"; then + func_copy_some_files "$pkgconfig_files" "$pkgdatadir" "$ltdldir" + fi fi - if $opt_install; then - func_config_update config.guess "$pkgdatadir/config" "$auxdir" - func_config_update config.sub "$pkgdatadir/config" "$auxdir" - func_install_update install-sh "$pkgdatadir/config" "$auxdir" + + # If they are newer, copy all the installed utility files to the + # auxiliary directory if `--install' was passed, or else copy just + # ltmain.sh. + if test -n "$auxdir"; then + $opt_quiet || if test "$auxdir" != .; then + func_echo "putting files in AC_CONFIG_AUX_DIR, \`$auxdir'." + fi + if $opt_install; then + func_config_update config.guess "$pkgdatadir/config" "$auxdir" + func_config_update config.sub "$pkgdatadir/config" "$auxdir" + func_install_update install-sh "$pkgdatadir/config" "$auxdir" + fi + func_ltmain_update ltmain.sh "$pkgdatadir/config" "$auxdir" + else + func_verbose "AC_CONFIG_AUX_DIR not defined, not copying libtool auxilliary files." fi - func_ltmain_update ltmain.sh "$pkgdatadir/config" "$auxdir" # Copy libtool's m4 macros to the macro directory, if they are newer. if test -n "$m4dir"; then @@ -897,6 +944,15 @@ else func_verbose "AC_CONFIG_MACRO_DIR not defined, not copying libtool macro files." fi + + # Offer some suggestions for avoiding duplicate files in a project + # that uses libltdl: + if test -n "$ltdldir" && $seen_autoconf; then + $opt_quiet || test "$ltdldir/config" = "$auxdir" || \ + func_echo "consider using \`AC_CONFIG_AUX_DIR([[$ltdldir/config]])' in $configure_ac" + $opt_quiet || test "$ltdldir/m4" = "$m4dir" || \ + func_echo "consider using \`AC_CONFIG_MACRO_DIR([[$ltdldir/m4]])' in $configure_ac" + fi } exit $exit_status --- orig/tests/testsuite.at +++ mod/tests/testsuite.at @@ -74,3 +74,5 @@ m4_include([libtoolize.at]) # link order test m4_include([link-order.at]) +# standalone libldtl compilation +m4_include([standalone.at]) * added files --- /dev/null +++ /Users/gary/devel/savannah/libtool--gary--1.0/,,[EMAIL PROTECTED]/new-files-archive/./tests/.arch-ids/standalone.at.id @@ -0,0 +1 @@ +Gary V. Vaughan <[EMAIL PROTECTED]> Tue Apr 26 13:52:34 2005 23843.0 --- /dev/null +++ /Users/gary/devel/savannah/libtool--gary--1.0/,,[EMAIL PROTECTED]/new-files-archive/./tests/standalone.at @@ -0,0 +1,157 @@ +# Hand crafted tests for GNU Libtool. -*- Autotest -*- +# Copyright 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, 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; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +AT_BANNER([Standalone Libltdl.]) + +## ------------------------ ## +## Softlinked libltdl tree. ## +## ------------------------ ## + +AT_SETUP([compiling softlinked libltdl]) + +LT_AT_LIBTOOLIZE([--ltdl=.]) +./configure +${MAKE-make} + +AT_CHECK([test -f libltdlc.la]) + +AT_CLEANUP + + +## -------------------- ## +## Copied libltdl tree. ## +## -------------------- ## + +AT_SETUP([compiling copied libltdl]) + +LT_AT_LIBTOOLIZE([--copy --ltdl=.]) +./configure +${MAKE-make} + +AT_CHECK([test -f libltdlc.la]) + +AT_CLEANUP + + +## ------------------------- ## +## Installable libltdl tree. ## +## ------------------------- ## + +AT_SETUP([installable libltdl]) + +prefix=`pwd`/_inst + +LT_AT_LIBTOOLIZE([--copy --ltdl=.]) +./configure --enable-ltdl-install --prefix=$prefix +${MAKE-make} all install + +AT_CHECK([test -f $prefix/lib/libltdl.la]) +AT_CHECK([test -f $prefix/include/ltdl.h]) + +AT_CLEANUP + + +## ----------------------------------------------- ## +## libltdl is usable without Autoconf or Automake. ## +## ----------------------------------------------- ## + +AT_SETUP([linking libltdl without autotools]) + +AT_DATA([module.c], +[[char * +hello (void) +{ + return "Hello!"; +} +]]) + +AT_DATA([main.c], +[[#include <stdio.h> +#include "ltdl.h" + +int +main (int argc, char **argv) +{ + lt_dlhandle handle; + char *(*func) (void) = 0; + int status = 1; + + LTDL_SET_PRELOADED_SYMBOLS(); + if (lt_dlinit() != 0) { + fprintf (stderr, "error during initialisation: %s\n", lt_dlerror()); + return 1; + } + + handle = lt_dlopen("module.la"); + if (!handle) { + fprintf (stderr, "error dlopening module.la: %s\n", lt_dlerror()); + goto finish; + } + + func = (char *(*)(void)) lt_dlsym (handle, "hello"); + if (!func) { + fprintf (stderr, "error fetching func: %s\n", lt_dlerror()); + goto finish; + } + + printf ("%s\n", (*func) ()); + status = 0; + +finish: + lt_dlexit(); + + return status; +} +]]) + +AT_DATA([Makefile], +[[LIBTOOL = ./libltdl/libtool +INCLUDES = -I./libltdl +MODFLAGS = -module -avoid-version + +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(INCLUDES) +LTLINK = $(LIBTOOL) --mode=link $(CC) $(CPPFLAGS) $(INCLUDES) $(LDFLAGS) + +TARGETS = libltdl/libltdlc.la module.la ltdldemo + +all: $(TARGETS) + +$(LIBTOOL) libltdl/libltdlc.la: + cd libltdl && ./configure && $(MAKE) + +ltdldemo: $(LIBTOOL) module.la libltdl/libltdlc.la main.c + $(LTLINK) -o ltdldemo main.c -dlopen module.la ./libltdl/libltdlc.la + +module.la: $(LIBTOOL) module.lo + $(LTLINK) -o module.la module.lo $(MODFLAGS) -rpath /dev/null + +module.lo: $(LIBTOOL) module.c + $(LTCOMPILE) -c module.c +]]) + +LT_AT_LIBTOOLIZE([--copy --ltdl]) +${MAKE-make} CC="$CC" CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" + +AT_DATA([expout], +[[Hello! +]]) + +AT_CHECK([./ltdldemo], 0, expout) + +AT_CLEANUP