summaryrefslogtreecommitdiff
path: root/mk/buildlink2/libtool.sh
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2002-12-22 19:02:43 +0000
committerjlam <jlam@pkgsrc.org>2002-12-22 19:02:43 +0000
commitcfaa1ad9ff56e51e0dbd30c9e071697df16d8a55 (patch)
treed810fff0b2bba973326f3623cd87f02062726744 /mk/buildlink2/libtool.sh
parentb6a7beb4b34980bde61fe1242a805859f18ac4d4 (diff)
downloadpkgsrc-cfaa1ad9ff56e51e0dbd30c9e071697df16d8a55.tar.gz
The buildlink2 problems on non-NetBSD platform seem to be related to
correct manipulation of variables containing values with escaped metacharacters by the shell. The new code only does partial caching, which doesn't cache "special" arguments that contain escaped metacharacters or other oddly quoted values. On certain platforms listed in _BLNK_CACHE_ALL in bsd.buildlink2.mk, we do full caching, which has enormous speed benefits since it avoids an extra sed invocation per "special" argument. Known working platforms: MacOS X 10.1.5 (schmonz) MacOS X 10.2 (grant) NetBSD 1.6 [full caching] (jlam) OpenBSD (cjep) Solaris 8 (grant) Solaris 9 (salo)
Diffstat (limited to 'mk/buildlink2/libtool.sh')
-rw-r--r--mk/buildlink2/libtool.sh26
1 files changed, 12 insertions, 14 deletions
diff --git a/mk/buildlink2/libtool.sh b/mk/buildlink2/libtool.sh
index 4ad3b6094bf..a005bb62216 100644
--- a/mk/buildlink2/libtool.sh
+++ b/mk/buildlink2/libtool.sh
@@ -1,6 +1,6 @@
#!@BUILDLINK_SHELL@
#
-# $NetBSD: libtool.sh,v 1.6 2002/11/14 21:45:21 jlam Exp $
+# $NetBSD: libtool.sh,v 1.7 2002/12/22 19:02:44 jlam Exp $
Xsed='@SED@ -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
@@ -13,6 +13,7 @@ specificlogic="@_BLNK_WRAP_SPECIFIC_LOGIC@"
libtool_fix_la="@_BLNK_LIBTOOL_FIX_LA@"
wrapperlog="@_BLNK_WRAP_LOG@"
updatecache=${BUILDLINK_UPDATE_CACHE-yes}
+cacheall=${BUILDLINK_CACHE_ALL-no}
cmd="@WRAPPEE@"
lafile=
@@ -23,7 +24,7 @@ case "$1" in
doinstall=yes
;;
*)
- while [ $# -gt 0 ]; do
+ while @TEST@ $# -gt 0; do
arg="$1"; shift
case $arg in
--fix-la)
@@ -36,8 +37,8 @@ case "$1" in
esac
;;
--mode|--mode=install)
- if [ "$arg" = "--mode=install" ] || \
- [ "$arg" = "--mode" -a "$1" = "install" ]; then
+ if @TEST@ "$arg" = "--mode=install" || \
+ @TEST@ "$arg" = "--mode" -a "$1" = "install"; then
doinstall=yes
break
fi
@@ -56,19 +57,17 @@ case "$1" in
;;
esac
. $specificlogic
- args="$args $arg"
+ cmd="$cmd $arg"
done
;;
esac
-if [ -n "$doinstall" ]; then
- args="$args $arg"
- while [ $# -gt 0 ]; do
+if @TEST@ -n "$doinstall"; then
+ cmd="$cmd $arg"
+ while @TEST@ $# -gt 0; do
arg="$1"; shift
case $arg in
*[\`\"\$\\]*)
- arg=`@ECHO@ X$arg | \
- $Xsed -e "$sed_quote_subst" \
- `
+ arg=`@ECHO@ "X$arg" | $Xsed -e "$sed_quote_subst"`
;;
esac
case $arg in
@@ -76,10 +75,9 @@ if [ -n "$doinstall" ]; then
arg="\"$arg\""
;;
esac
- args="$args $arg"
+ cmd="$cmd $arg"
done
fi
-cmd="$cmd $args"
@_BLNK_WRAP_ENV@
@_BLNK_WRAP_SANITIZE_PATH@
@@ -88,7 +86,7 @@ cmd="$cmd $args"
eval $cmd
wrapper_result=$?
-if [ -n "$lafile" ] && [ -f "$lafile" ]; then
+if @TEST@ -n "$lafile" && @TEST@ -f "$lafile"; then
. $libtool_fix_la
fi