[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 4/4] add libtool --mode=finish mode for sysroot
From: |
Paolo Bonzini |
Subject: |
[PATCH v2 4/4] add libtool --mode=finish mode for sysroot |
Date: |
Thu, 12 Aug 2010 21:23:06 -0400 |
---
doc/libtool.texi | 18 ++++++++++++------
libltdl/config/ltmain.m4sh | 21 +++++++++++++++++++++
tests/sysroot.at | 3 +++
3 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 914bd1d..4b256bf 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -1721,12 +1721,18 @@ commands are also completed.
@cindex finish mode
@cindex mode, finish
address@hidden mode helps system administrators install libtool libraries
-so that they can be located and linked into user programs.
-
-Each @var{mode-arg} is interpreted as the name of a library directory.
-Running this command may require superuser privileges, so the
address@hidden option may be useful.
address@hidden mode has two functions. One is to help system administrators
+install libtool libraries so that they can be located and linked into
+user programs. To invoke this functionality, pass the name of a library
+directory as @var{mode-arg}. Running this command may require superuser
+privileges, and the @option{--dry-run} option may be useful.
+
+The second is to facilitate transferring libtool libraries to a native
+compilation environment after they were built in a cross-compilation
+environment. Cross-compilation environments may rely on recent libtool
+features, and running libtool in finish mode will make it easier to
+work with older versions of libtool. This task is performed whenever
+the @var{mode-arg} is a @samp{.la} file.
@node Uninstall mode
@section Uninstall mode
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index b03b724..639ce0a 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -1418,6 +1418,27 @@ func_mode_finish ()
fi
done
+ if test -n "$libs"; then
+ tmpdir=`func_mktempdir`
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED 's/[].[^$\\*|]/\\\\&/g'`
+ sysroot_cmd="s|\([ ']\)$sysroot_regex|\1|g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ for lib in $libs; do
+ $opt_dry_run || {
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ }
+ file="$outputname"
+ done
+ $opt_dry_run || ${RM}r "$tmpdir"
+ fi
+
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
diff --git a/tests/sysroot.at b/tests/sysroot.at
index 869c9c4..c0ac6d1 100644
--- a/tests/sysroot.at
+++ b/tests/sysroot.at
@@ -186,6 +186,9 @@ LT_AT_BOOTSTRAP([], [-I $abs_top_srcdir/libltdl/m4],
[ignore],
AT_CHECK([$MAKE install DESTDIR=$sysroot], [0], [ignore], [ignore])
AT_CHECK([test -f $sysroot/$prefix/bin/prog$EXEEXT])
AT_CHECK([grep -F "$sysroot" "$sysroot/$prefix/bin/prog$EXEEXT"], [1])
+AT_CHECK([grep "'.*=" $sysroot/$prefix/lib/lib2.la], [0], [ignore])
+AT_CHECK([./libtool --mode=finish $sysroot/$prefix/lib/lib@<:@12@:>@.la], [0],
[ignore])
+AT_CHECK([grep "'.*=" $sysroot/$prefix/lib/lib@<:@12@:>@.la], [1])
# missing tests
# 1) pass absolute .la files
--
1.7.1
Re: [PATCH v2 0/3] sysroot followup patches, Charles Wilson, 2010/08/16