From: Gary V. Vaughan Date: Thu, 24 Mar 2005 12:59:29 +0000 (+0000) Subject: As a prerequisite for being able to test an uninstalled libtoolize X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9e40b06c07fa5bcc028da2dd2dd9154661e7d1e;p=thirdparty%2Flibtool.git As a prerequisite for being able to test an uninstalled libtoolize for copying files correctly from the source tree, we must know exactly which files should be copied by the --ltdl option to avoid accidentally picking up compilation objects and other noise when $builddir == $srcdir: * libltdl/loaders/Makefile.am (ltdldatadir, ltdldatafiles) (install-data-local): Removed... * libltdl/Makefile.am (ltdldatafiles): ...and consolidated here. (show-ltdldatafiles): New rule... * Makefile.am (ltdldatafiles, libtoolize): ...used to substitute exactly which files are installed by libtoolize --ltdl. (edit): Move pkgvmacro_DATA substitution expression... (libtoolize): ...to here. * libtoolize.m4sh: Use func_copy_some_files() instead of func_copy_all_from_path() to copy the --ltdl option installed files. (pkgvltdldirs): New path variable to search for files installed by --ltdl option. (func_massage_pkgvltdl_files): New function to calculate the list of ltdl installation files. --- diff --git a/ChangeLog b/ChangeLog index 6c39b629a..c4dbd36b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2005-03-24 Gary V. Vaughan + + As a prerequisite for being able to test an uninstalled libtoolize + for copying files correctly from the source tree, we must know + exactly which files should be copied by the --ltdl option to avoid + accidentally picking up compilation objects and other noise when + $builddir == $srcdir: + + * libltdl/loaders/Makefile.am (ltdldatadir, ltdldatafiles) + (install-data-local): Removed... + * libltdl/Makefile.am (ltdldatafiles): ...and consolidated here. + (show-ltdldatafiles): New rule... + * Makefile.am (ltdldatafiles, libtoolize): ...used to substitute + exactly which files are installed by libtoolize --ltdl. + (edit): Move pkgvmacro_DATA substitution expression... + (libtoolize): ...to here. + * libtoolize.m4sh: Use func_copy_some_files() instead of + func_copy_all_from_path() to copy the --ltdl option installed + files. + (pkgvltdldirs): New path variable to search for files installed by + --ltdl option. + (func_massage_pkgvltdl_files): New function to calculate the list + of ltdl installation files. + 2005-03-22 Ralf Wildenhues (tiny change) * m4/libtool.m4, m4/ltdl.m4: Indentation and quoting cleanup. diff --git a/Makefile.am b/Makefile.am index 317f88bc2..50c9ce260 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,7 +32,6 @@ edit = sed \ -e 's,@datadir\@,$(datadir),g' \ -e 's,@pkgdatadir\@,$(pkgdatadir),g' \ -e 's,@aclocaldir\@,$(aclocaldir),g' \ - -e 's,@aclocal_DATA\@,$(aclocal_DATA),g' \ -e 's,@host_triplet\@,$(host_triplet),g' \ -e "s,@configure_input\@,Generated from $$input; do not edit by hand,g" @@ -136,7 +135,10 @@ 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" \ $(top_srcdir)/libtoolize.in > libtoolize.tmp chmod a+x libtoolize.tmp chmod a-w libtoolize.tmp diff --git a/libltdl/Makefile.am b/libltdl/Makefile.am index 3833d550a..b35a3e1ce 100644 --- a/libltdl/Makefile.am +++ b/libltdl/Makefile.am @@ -73,7 +73,14 @@ ltdldatafiles = COPYING.LIB README \ $(libltdl_la_SOURCES) \ lt__dirent.c libltdl/lt__dirent.h \ lt__strl.c libltdl/lt__strl.h \ - argz_.h argz.c + 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: @@ -82,6 +89,11 @@ install-data-local: ( 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)" + ## 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 index dcacf885f..18dc2f134 100644 --- a/libltdl/loaders/Makefile.am +++ b/libltdl/loaders/Makefile.am @@ -42,19 +42,3 @@ EXTRA_LTLIBRARIES = dlopen.la dld_link.la dyld.la load_add_on.la \ dlopen_la_LIBADD = $(LIBADD_DLOPEN) shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) dld_link_la_LIBADD = -ldld - - -## These are installed as a subdirectory of pkgdatadir so that -## libtoolize --ltdl can find them later: -ltdldatadir = $(pkgdatadir)/libltdl/loaders -ltdldatafiles = Makefile.am Makefile.in \ - dld_link.c dlopen.c dyld.c \ - load_add_on.c loadlibrary.c 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 -; ) - diff --git a/libtoolize.m4sh b/libtoolize.m4sh index 3cf2441e1..19a98a4b6 100644 --- a/libtoolize.m4sh +++ b/libtoolize.m4sh @@ -83,6 +83,7 @@ libtoolize_flags= prefix=@prefix@ datadir=@datadir@ pkgdatadir=@pkgdatadir@ +pkgltdldir=@pkgdatadir@/libltdl aclocaldir=@aclocaldir@ auxdir= m4dir= @@ -298,20 +299,20 @@ func_copy_all_files () done IFS="$my_save_IFS" - func_copy_some_files "$my_basedir" "$my_srcfiles" \ + func_copy_some_files "$my_srcfiles" "$my_basedir" \ "$my_destdir" "$my_copy_cb" } -# func_copy_some_files srcdir srcfile_spec destdir [copy_cb=func_copy_cb] +# func_copy_some_files srcfile_spec srcdirs destdir [copy_cb=func_copy_cb] # Call COPY_CB for each regular file in SRCDIR named by the ':' delimited # names in SRCFILE_SPEC. The odd calling convention is needed to allow # spaces in file and directory names. func_copy_some_files () { $opt_debug - my_srcdir="$1" - my_srcfile_spec="$2" + my_srcfile_spec="$1" + my_srcdir="$2" my_destdir="$3" my_copy_cb="${4-func_copy_cb}" @@ -355,7 +356,6 @@ func_scan_files () test -n "`cd $pkgdatadir && ls`" \ || func_fatal_error "can not list files in \`$pkgdatadir'" - # Set local variables to reflect contents of configure.ac my_uses_autoconf=false my_sed_scan_configure_ac='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; @@ -758,7 +758,7 @@ func_massage_aclocal_DATA () for my_filename in @aclocal_DATA@; do my_filename=`$ECHO "X$my_filename" | $Xsed -e "$basename"` - # ignore excluded filenames + # ignore excluded filenames if test -n "$my_glob_exclude"; then eval 'case $my_filename in '$my_glob_exclude') continue ;; esac' fi @@ -771,6 +771,35 @@ func_massage_aclocal_DATA () } +# func_massage_pkgvltdl_files [glob_exclude] +# @pkgvltdl_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_pkgvltdl_files () +{ + pkgvltdl_files= # GLOBAL VAR + + my_glob_exclude="$1" + + # Massage a value for pkgvltdl_files from the value used in Makefile.am + for my_filename in @pkgvltdl_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 :$pkgvltdl_files: in + *:$my_filename:*) ;; + *) pkgvltdl_files="$pkgvltdl_files:$my_filename" ;; + esac + done + + # strip spurious leading `:' + pkgvltdl_files=`$ECHO "X$pkgvltdl_files" | $Xsed -e 's,^:*,,'` +} + + ## ----------- ## ## Main. ## ## ----------- ## @@ -778,6 +807,8 @@ func_massage_aclocal_DATA () { rerun_aclocal=false + func_massage_pkgvltdl_files + # libtool.m4 and ltdl.m4 are handled specially below func_massage_aclocal_DATA 'libtool.m4|ltdl.m4' @@ -789,7 +820,7 @@ func_massage_aclocal_DATA () # Copy all the files from installed libltdl to this project, if the # user specified `--ltdl'. if test -n "$ltdldir"; then - eval func_copy_all_files -r "$pkgdatadir/libltdl" "$ltdldir" + eval func_copy_some_files "$pkgvltdl_files" "$pkgltdldir" "$ltdldir" # libtoolize the newly copied libltdl tree ( cd "$ltdldir" && "$progpath" $libtoolize_flags ) || exit $EXIT_FAILURE @@ -821,7 +852,7 @@ func_massage_aclocal_DATA () func_verbose "Not copying \`$m4dir/ltdl.m4', libltdl not used." fi - func_copy_some_files "$aclocaldir" "$pkgmacro_files" \ + func_copy_some_files "$pkgmacro_files" "$aclocaldir" \ "$m4dir" func_serial_update fi }