summaryrefslogtreecommitdiff
path: root/mk/buildlink3/libtool-fix-la
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-03-30 17:25:19 +0000
committerjlam <jlam@pkgsrc.org>2004-03-30 17:25:19 +0000
commit7783b66d89d5aac6ef8c6aff6780dfeea5ae4b51 (patch)
treea22ce4a0550f9fd3ce8ab76192c914e7eed55f9a /mk/buildlink3/libtool-fix-la
parentecbc5f3db72a3b6696478286b326b0c11cee21dd (diff)
downloadpkgsrc-7783b66d89d5aac6ef8c6aff6780dfeea5ae4b51.tar.gz
Extend the capabilities of buildlink3's libtool wrapper a bit compared
to the stock libtool: you can now copy or symlink an uninstalled libtool archive file somewhere else than its build directory, and you can still link against it. This allows us to more easily bolt libtool build machinery onto packages that have unusual(ly crappy) build systems that rely on installing libraries to some common build directory after they're built. We do this by adding a "buildlibdir" variable to the uninstalled libtool archive that points to the build directory of the archive. Whenever we link against this archive, we rewrite the path to archive on the libtool command line so that it points to the true archive. This allows the real libtool to find the files under $buildlibdir/.libs.
Diffstat (limited to 'mk/buildlink3/libtool-fix-la')
-rw-r--r--mk/buildlink3/libtool-fix-la59
1 files changed, 29 insertions, 30 deletions
diff --git a/mk/buildlink3/libtool-fix-la b/mk/buildlink3/libtool-fix-la
index 86d5ef6baa6..58b222f6afb 100644
--- a/mk/buildlink3/libtool-fix-la
+++ b/mk/buildlink3/libtool-fix-la
@@ -1,4 +1,4 @@
-# $NetBSD: libtool-fix-la,v 1.3 2004/03/13 03:41:13 uebayasi Exp $
+# $NetBSD: libtool-fix-la,v 1.4 2004/03/30 17:25:19 jlam Exp $
#
# For *.la files, in the "relink_command" line, we make the following
# replacements:
@@ -129,37 +129,36 @@ if $test -f $lafile; then
;;
esac
done
- if $test -z "$deps" && $test -z "$relink" || \
- @EGREP@ "^#.*modified by buildlink3" $lafile >/dev/null 2>&1; then
- :
+ #
+ # Save the orignal .la file produced by libtool as
+ # .la.blsav, and create the new one with a signature.
+ #
+ @MV@ -f $lafile ${lafile}.blsav
+ if $test -n "$deps"; then
+ (
+ $cat ${lafile}.blsav | @SED@ -e '/^dependency_libs=/,$d'
+ $echo "dependency_libs='$deps'"
+ $cat ${lafile}.blsav | @SED@ -e '1,/^dependency_libs=/d'
+ ) > ${lafile}.tmp
else
- # Save the orignal .la file produced by libtool as
- # .la.blsav, and create the new one with a signature.
- #
- @MV@ -f $lafile ${lafile}.blsav
- if $test -n "$deps"; then
- (
- $cat ${lafile}.blsav | @SED@ -e '/^dependency_libs=/,$d'
- $echo "dependency_libs='$deps'"
- $cat ${lafile}.blsav | @SED@ -e '1,/^dependency_libs=/d'
- ) > ${lafile}.tmp
- else
- $cat ${lafile}.blsav > ${lafile}.tmp
- fi
- if $test -n "$relink"; then
- (
- $cat ${lafile}.tmp | @SED@ -e '/^relink_command=/,$d'
- $echo "relink_command='$relink'"
- $cat ${lafile}.tmp | @SED@ -e '1,/^relink_command=/d'
- ) > $lafile
- else
- $cat ${lafile}.tmp > $lafile
- fi
- $echo >> $lafile
- $echo "# This file has been modified by buildlink3." >> $lafile
- @RM@ ${lafile}.tmp
- $echo "==> Fixed $lafile" >> $wrapperlog
+ $cat ${lafile}.blsav > ${lafile}.tmp
+ fi
+ if $test -n "$relink"; then
+ (
+ $cat ${lafile}.tmp | @SED@ -e '/^relink_command=/,$d'
+ $echo "relink_command='$relink'"
+ $cat ${lafile}.tmp | @SED@ -e '1,/^relink_command=/d'
+ ) > $lafile
+ else
+ $cat ${lafile}.tmp > $lafile
fi
+ $echo >> $lafile
+ $echo "# Directory that this library was built in:" >> $lafile
+ $echo "buildlibdir='"`cd .; $pwd`"'" >> $lafile
+ $echo >> $lafile
+ $echo "# This file has been modified by buildlink3." >> $lafile
+ @RM@ ${lafile}.tmp
+ $echo "==> Fixed $lafile" >> $wrapperlog
#
# Fix up any .lai files (libtool archives that will be installed).
#