[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
HEAD: lift nonrecursive naming restriction
From: |
Ralf Wildenhues |
Subject: |
HEAD: lift nonrecursive naming restriction |
Date: |
Sat, 26 Nov 2005 10:40:26 +0100 |
User-agent: |
Mutt/1.5.9i |
This patch should allow the libltdl directory to be named differently
also in nonrecursive mode. (Hi Bob!)
It always copies Makefile.inc, which is the only reasonable thing to do
in this situation anyway. It also always updates it, which might be
debatable, but seems safe to me.
OK to apply to CVS HEAD?
Cheers,
Ralf
* libtoolize.m4sh (func_fixup_Makefile_inc): New function.
(main): Call it in nonrecursive mode to mangle Makefile.inc.
* tests/nonrecursive.at: adjusted to test this.
Index: libtoolize.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libtoolize.m4sh,v
retrieving revision 1.47
diff -u -r1.47 libtoolize.m4sh
--- libtoolize.m4sh 20 Nov 2005 10:33:26 -0000 1.47
+++ libtoolize.m4sh 26 Nov 2005 09:38:54 -0000
@@ -359,6 +359,30 @@
IFS="$my_save_IFS"
}
+# func_fixup_Makefile_inc srcfile srcdir destdir
+func_fixup_Makefile_inc ()
+{
+ my_filename="$1"
+ my_srcdir="$2"
+ my_destdir="$3"
+
+ repl=$ltdldir
+ repl_uscore=`$ECHO "X$repl" | $Xsed -e 's,[[/.+-]],_,g'`
+ $RM "$my_destdir/$my_filename" 2>/dev/null
+ $opt_quiet || func_echo "creating file \`$my_destdir/$my_filename'"
+ if $opt_dry_run; then :;
+ else
+ $SED "\
+ s,libltdl_,${repl_uscore}_,
+ s,libltdl/,${repl}/,
+ s,: libltdl/,: ${repl}/,
+ s,\\\$(libltdl_,\$(${repl_uscore}_,
+ s,)/libltdl ,)/${repl} ,
+ " < "$my_srcdir/$my_filename" > "$my_destdir/$my_filename" ||
+ func_fatal_error "cannot create $my_destdir/$my_filename"
+ fi
+}
+
# func_scan_files
# Scan configure.(ac|in) and aclocal.m4 (if present) for use of libltdl
# and libtool. Possibly running some of these tools if necessary.
@@ -1069,10 +1093,13 @@
# For recursive ltdl modes, copy a suitable Makefile.{am,inc}:
case $ltdl_mode in
recursive) pkgltdl_files="Makefile.am:$pkgltdl_files" ;;
- nonrecursive) pkgltdl_files="Makefile.inc:$pkgltdl_files" ;;
esac
func_copy_some_files "$pkgltdl_files" "$pkgltdldir/libltdl" "$ltdldir"
+
+ case $ltdl_mode in
+ nonrecursive) func_fixup_Makefile_inc "Makefile.inc"
"$pkgltdldir/libltdl" "$ltdldir" ;;
+ esac
# Unless we share CONFIG_MACRO_DIR with our parent project,
# copy macros here.
Index: tests/nonrecursive.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/nonrecursive.at,v
retrieving revision 1.4
diff -u -r1.4 nonrecursive.at
--- tests/nonrecursive.at 14 Nov 2005 22:19:40 -0000 1.4
+++ tests/nonrecursive.at 25 Nov 2005 19:14:19 -0000
@@ -23,10 +23,10 @@
m4_pushdef([_LTDL_SETUP],
[AT_DATA([configure.ac],
[[AC_INIT([subdirectory-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
-LT_CONFIG_LTDL_DIR([libltdl], [nonrecursive])
-AC_CONFIG_AUX_DIR([libltdl/config])
-AC_CONFIG_MACRO_DIR([libltdl/m4])
-AC_CONFIG_LIBOBJ_DIR([libltdl])
+LT_CONFIG_LTDL_DIR([ltdl], [nonrecursive])
+AC_CONFIG_AUX_DIR([ltdl/config])
+AC_CONFIG_MACRO_DIR([ltdl/m4])
+AC_CONFIG_LIBOBJ_DIR([ltdl])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_PROG_CC
AM_PROG_CC_C_O
@@ -37,7 +37,7 @@
]])
AT_DATA([Makefile.am],
-[[ACLOCAL_AMFLAGS = -I libltdl/m4
+[[ACLOCAL_AMFLAGS = -I ltdl/m4
BUILT_SOURCES =
AM_CPPFLAGS =
@@ -53,7 +53,7 @@
CLEANFILES =
MOSTLYCLEANFILES =
-include libltdl/Makefile.inc
+include ltdl/Makefile.inc
foo_la_LDFLAGS = -module -avoid-version
foo_la_SOURCES = foo.c
@@ -71,16 +71,16 @@
_LTDL_SETUP
LT_AT_LIBTOOLIZE([--ltdl])
-AT_CHECK([if test -f libltdl/configure.ac; then false; fi])
+AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
# Support vanilla autoconf-2.59 & automake-1.9.6
for file in argz.c lt__dirent.c lt__strl.c; do
- cp libltdl/$file $file
+ cp ltdl/$file $file
done
-LT_AT_BOOTSTRAP([ignore], [-I libltdl/m4], [ignore], [--add-missing --copy])
+LT_AT_BOOTSTRAP([ignore], [-I ltdl/m4], [ignore], [--add-missing --copy])
-AT_CHECK([test -f libltdl/libltdlc.la])
+AT_CHECK([test -f ltdl/libltdlc.la])
AT_CLEANUP
@@ -94,16 +94,16 @@
_LTDL_SETUP
LT_AT_LIBTOOLIZE([--copy --ltdl])
-AT_CHECK([if test -f libltdl/configure.ac; then false; fi])
+AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
# Support vanilla autoconf-2.59 & automake-1.9.6
for file in argz.c lt__dirent.c lt__strl.c; do
- cp libltdl/$file $file
+ cp ltdl/$file $file
done
-LT_AT_BOOTSTRAP([ignore], [-I libltdl/m4], [ignore], [--add-missing --copy])
+LT_AT_BOOTSTRAP([ignore], [-I ltdl/m4], [ignore], [--add-missing --copy])
-AT_CHECK([test -f libltdl/libltdlc.la])
+AT_CHECK([test -f ltdl/libltdlc.la])
AT_CLEANUP
@@ -119,14 +119,14 @@
prefix=`pwd`/_inst
LT_AT_LIBTOOLIZE([--copy --ltdl])
-AT_CHECK([if test -f libltdl/configure.ac; then false; fi])
+AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
# Support vanilla autoconf-2.59 & automake-1.9.6
for file in argz.c lt__dirent.c lt__strl.c; do
- cp libltdl/$file $file
+ cp ltdl/$file $file
done
-LT_AT_BOOTSTRAP([ignore], [-I libltdl/m4], [ignore], [--add-missing --copy],
+LT_AT_BOOTSTRAP([ignore], [-I ltdl/m4], [ignore], [--add-missing --copy],
[], [--enable-ltdl-install --prefix=$prefix], [all install])
AT_CHECK([test -f $prefix/lib/libltdl.la])
- HEAD: lift nonrecursive naming restriction,
Ralf Wildenhues <=