libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] add libtool --mode=finish mode for sysroot


From: Paolo Bonzini
Subject: [PATCH 2/2] add libtool --mode=finish mode for sysroot
Date: Thu, 12 Aug 2010 00:12:17 -0400

---
 doc/libtool.texi           |   17 +++++++++++++----
 libltdl/config/ltmain.m4sh |   20 ++++++++++++++++++++
 2 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/doc/libtool.texi b/doc/libtool.texi
index 914bd1d..5b21a32 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -1721,12 +1721,21 @@ commands are also completed.
 @cindex finish mode
 @cindex mode, finish
 
address@hidden mode helps system administrators install libtool libraries
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.
 
-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.
+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.
+
+Each @var{mode-arg} can be the name of a library directory, in which
+case both of the above tasks are performed; in this case, running this
+command may require superuser privileges, and the @option{--dry-run}
+option may be useful.  Instead, if the @var{mode-arg} is a @samp{.la}
+file, only the second task will be done.
 
 @node Uninstall mode
 @section Uninstall mode
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index a8e9aa7..2c9f3b0 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -1426,6 +1426,26 @@ 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" $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
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]