pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Extend the capabilities of buildlink3's ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/f2fd68562f2e
branches: trunk
changeset: 471734:f2fd68562f2e
user: jlam <jlam%pkgsrc.org@localhost>
date: Tue Mar 30 17:25:19 2004 +0000
description:
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:
mk/buildlink3/bsd.buildlink3.mk | 5 ++-
mk/buildlink3/libtool-fix-la | 59 +++++++++++++++++++--------------------
mk/buildlink3/libtool-post-cache | 17 ++++++++---
mk/buildlink3/libtool-post-logic | 30 ++++++++++++++++++--
mk/buildlink3/libtool.sh | 5 ++-
5 files changed, 76 insertions(+), 40 deletions(-)
diffs (205 lines):
diff -r 1e23273e43ac -r f2fd68562f2e mk/buildlink3/bsd.buildlink3.mk
--- a/mk/buildlink3/bsd.buildlink3.mk Tue Mar 30 17:23:48 2004 +0000
+++ b/mk/buildlink3/bsd.buildlink3.mk Tue Mar 30 17:25:19 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.133 2004/03/29 06:05:10 jlam Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.134 2004/03/30 17:25:19 jlam Exp $
#
# An example package buildlink3.mk file:
#
@@ -1377,9 +1377,12 @@
-e "s|@BUILDLINK_SHELL@|${BUILDLINK_SHELL}|g" \
-e "s|@WRKDIR@|${WRKDIR}|g" \
-e "s|@WRKSRC@|${WRKSRC}|g" \
+ -e "s|@BASENAME@|${BASENAME:Q}|g" \
-e "s|@CAT@|${CAT:Q}|g" \
+ -e "s|@DIRNAME@|${DIRNAME:Q}|g" \
-e "s|@ECHO@|${ECHO:Q}|g" \
-e "s|@EXPR@|${EXPR:Q}|g" \
+ -e "s|@PWD_CMD@|${PWD_CMD:Q}|g" \
-e "s|@SED@|${SED:Q}|g" \
-e "s|@TEST@|${TEST:Q}|g" \
-e "s|@TOUCH@|${TOUCH:Q}|g" \
diff -r 1e23273e43ac -r f2fd68562f2e mk/buildlink3/libtool-fix-la
--- a/mk/buildlink3/libtool-fix-la Tue Mar 30 17:23:48 2004 +0000
+++ b/mk/buildlink3/libtool-fix-la Tue Mar 30 17:25:19 2004 +0000
@@ -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 @@
;;
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).
#
diff -r 1e23273e43ac -r f2fd68562f2e mk/buildlink3/libtool-post-cache
--- a/mk/buildlink3/libtool-post-cache Tue Mar 30 17:23:48 2004 +0000
+++ b/mk/buildlink3/libtool-post-cache Tue Mar 30 17:25:19 2004 +0000
@@ -1,12 +1,19 @@
-# $NetBSD: libtool-post-cache,v 1.2 2003/09/02 06:59:57 jlam Exp $
+# $NetBSD: libtool-post-cache,v 1.3 2004/03/30 17:25:19 jlam Exp $
#
# This file implements the default action of the "libtool" private
-# cache, and tells the libtool wrapper to skip the common cache lookup
-# for all directories and library args that may reference a locally
-# linked libtool archive; the appropriate action will be taken instead
-# by libtool-post-logic.
+# cache.
+# Skip the common cache lookup for all directories and library args that
+# may reference a locally-linked libtool archive.
+#
-L.|-L./*|-L..*|-L[!/]*|-L${WRKSRC}*|-l*)
skipcache=yes
;;
+
+# Skip the common cache lookup for all libtool archives that reference a
+# locally-linked libtool archive.
+#
+./*.la|../*.la|[!/]*.la|${WRKSRC}/*.la)
+ skipcache=yes
+ ;;
esac
diff -r 1e23273e43ac -r f2fd68562f2e mk/buildlink3/libtool-post-logic
--- a/mk/buildlink3/libtool-post-logic Tue Mar 30 17:23:48 2004 +0000
+++ b/mk/buildlink3/libtool-post-logic Tue Mar 30 17:25:19 2004 +0000
@@ -1,4 +1,6 @@
-# $NetBSD: libtool-post-logic,v 1.3 2003/09/19 22:49:22 jlam Exp $
+# $NetBSD: libtool-post-logic,v 1.4 2004/03/30 17:25:19 jlam Exp $
+
+case $arg in
#
# Workaround software authors that don't follow the libtool
# documentation and link against uninstalled libtool archives with:
@@ -13,8 +15,7 @@
# directories that are mentioned in -L* arguments to to libtool
# wrapper, and checking to see if <dir>/libfoo.la exists when we see
# "-lfoo" on the libtool command line.
-
-case $arg in
+#
-L.|-L./*|-L..*|-L[!/]*|-L${WRKSRC}*)
case $fixlibpath in
yes)
@@ -44,6 +45,11 @@
for dir in $rellpath; do
la="$dir/lib$lib.la"
if $test -f "$la"; then
+ ldir=`cd $dir; $pwd`
+ buildlibdir=`. $la; $echo $buildlibdir`
+ if $test "$ldir" != "$buildlibdir"; then
+ la="$buildlibdir/lib$lib.la"
+ fi
$echo "*** [buildlink3] Warning: libtool replaced $arg with $la" >> $wrapperlog
$echo "*** [buildlink3] Warning: libtool replaced $arg with $la" 1>&2
arg="$la"
@@ -55,4 +61,22 @@
esac
addtoprivatecache=yes
;;
+
+# Replace all references to locally-linked libtool archives with the full
+# paths to the archives in $buildlibdir if $buildlibdir differs from the
+# referenced directory. This makes linking against a symlinked local
+# libtool archive possible.
+#
+./*.la|../*.la|[!/]*.la|${WRKSRC}/*.la)
+ labase=`$basename $arg`
+ ladir=`$dirname $arg`
+ ldir=`cd $ladir; $pwd`
+ buildlibdir=`. $ladir/$labase; $echo $buildlibdir`
+ if $test "$ldir" != "$buildlibdir"; then
+ arg="$buildlibdir/$labase"
+ $echo "*** [buildlink3] Warning: libtool replaced $ladir/$labase with $arg" >> $wrapperlog
+ $echo "*** [buildlink3] Warning: libtool replaced $ladir/$labase with $arg" 1>&2
+ fi
+ addtoprivatecache=yes
+ ;;
esac
diff -r 1e23273e43ac -r f2fd68562f2e mk/buildlink3/libtool.sh
--- a/mk/buildlink3/libtool.sh Tue Mar 30 17:23:48 2004 +0000
+++ b/mk/buildlink3/libtool.sh Tue Mar 30 17:25:19 2004 +0000
@@ -1,6 +1,6 @@
#!@BUILDLINK_SHELL@
#
-# $NetBSD: libtool.sh,v 1.16 2004/03/13 03:41:13 uebayasi Exp $
+# $NetBSD: libtool.sh,v 1.17 2004/03/30 17:25:19 jlam Exp $
Xsed='@SED@ -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
@@ -30,9 +30,12 @@
cacheall="${BUILDLINK_CACHE_ALL-no}"
reorder="${BUILDLINK_REORDER-no}"
+basename="@BASENAME@"
cat="@CAT@"
+dirname="@DIRNAME@"
echo="@ECHO@"
expr="@EXPR@"
+pwd="@PWD_CMD@"
test="@TEST@"
BUILDLINK_DIR="@BUILDLINK_DIR@"
Home |
Main Index |
Thread Index |
Old Index