]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
As a prerequisite for being able to test an uninstalled libtoolize
authorGary V. Vaughan <gary@gnu.org>
Thu, 24 Mar 2005 12:59:29 +0000 (12:59 +0000)
committerGary V. Vaughan <gary@gnu.org>
Thu, 24 Mar 2005 12:59:29 +0000 (12:59 +0000)
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.

ChangeLog
Makefile.am
libltdl/Makefile.am
libltdl/loaders/Makefile.am
libtoolize.m4sh

index 6c39b629af6b4edfd7adba59aa81f8104f096fec..c4dbd36b515d19b33d8c3236132a283e24813732 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2005-03-24  Gary V. Vaughan  <gary@gnu.org>
+
+       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  <Ralf.Wildenhues@gmx.de>  (tiny change)
 
        * m4/libtool.m4, m4/ltdl.m4: Indentation and quoting cleanup.
index 317f88bc2360c806e874876ee3b3a159a6f24759..50c9ce260e5365ef94f98048dde712f2a8fcff63 100644 (file)
@@ -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
index 3833d550a3b802f3b2b91ef84206faa8a659d25b..b35a3e1ce4cd3fa660392c88f953788f7ed570bd 100644 (file)
@@ -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
 
index dcacf885f7374a3bb2dfc3671aab7ce20ab0bbad..18dc2f1340910d381c680d11da5b39614e2f828c 100644 (file)
@@ -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 -; )
-
index 3cf2441e1c7fff1fc4f8d2092aab946205655e4e..19a98a4b6e07c8c0a341b657bfd0d5be8e3f8c11 100644 (file)
@@ -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
 }