+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.
-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"
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
$(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:
( 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
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 -; )
-
prefix=@prefix@
datadir=@datadir@
pkgdatadir=@pkgdatadir@
+pkgltdldir=@pkgdatadir@/libltdl
aclocaldir=@aclocaldir@
auxdir=
m4dir=
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}"
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 .*$,,;
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
}
+# 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. ##
## ----------- ##
{
rerun_aclocal=false
+ func_massage_pkgvltdl_files
+
# libtool.m4 and ltdl.m4 are handled specially below
func_massage_aclocal_DATA 'libtool.m4|ltdl.m4'
# 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
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
}