summaryrefslogtreecommitdiff
path: root/mk/buildlink3/libtool-fix-la
diff options
context:
space:
mode:
authorjlam <jlam>2004-03-30 17:25:19 +0000
committerjlam <jlam>2004-03-30 17:25:19 +0000
commit34d0ab44803ce07f98bece9745a4d2928ece38ec (patch)
treea22ce4a0550f9fd3ce8ab76192c914e7eed55f9a /mk/buildlink3/libtool-fix-la
parent8ee42c55a059c070c28fec13dfe0f31d9439c699 (diff)
downloadpkgsrc-34d0ab44803ce07f98bece9745a4d2928ece38ec.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).
#