summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2003-08-28 19:12:51 +0000
committerjlam <jlam>2003-08-28 19:12:51 +0000
commit4e977e34b82cf4cd83fe6624e435ac0de626e8c5 (patch)
tree13f65f6e943dee31926a1909dac874198d5a5a55
parent3069e72c7ce9ffc2b00f0005a85c36b945a670de (diff)
downloadpkgsrc-4e977e34b82cf4cd83fe6624e435ac0de626e8c5.tar.gz
Deal with "-Wl,--rpath -Wl,/path/to/dir" by compressing it into a single
argument "-Wl,--rpath,/path/to/dir". This makes the cache-lookup much easier.
-rw-r--r--mk/bsd.pkg.mk4
-rw-r--r--mk/buildlink3/bsd.buildlink3.mk14
-rw-r--r--mk/buildlink3/gen-transform.sh8
-rw-r--r--mk/buildlink3/libtool.sh4
-rw-r--r--mk/buildlink3/marshall13
-rw-r--r--mk/buildlink3/wrapper.sh13
6 files changed, 48 insertions, 8 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index ced53cf527b..2088d0c7878 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1216.2.41 2003/08/27 11:44:30 jlam Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1216.2.42 2003/08/28 19:12:51 jlam Exp $
#
# This file is in the public domain.
#
@@ -833,7 +833,7 @@ RMAN?= ${X11BASE}/bin/rman
.if !empty(_USE_RPATH:M[nN][oO])
. if defined(FIX_RPATH) && !empty(FIX_RPATH)
. for var in ${FIX_RPATH}
-. for _rpath_flag in ${RPATH_FLAG} -R -rpath -rpath-link
+. for _rpath_flag in ${RPATH_FLAG} -R -rpath -rpath-link --rpath --rpath-link
${var}:= ${${var}:N-Wl,${_rpath_flag}*:N${_rpath_flag}*}
. endfor
. endfor
diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk
index a46d569ec08..eacc97c368b 100644
--- a/mk/buildlink3/bsd.buildlink3.mk
+++ b/mk/buildlink3/bsd.buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.1.2.26 2003/08/28 09:48:20 jlam Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.1.2.27 2003/08/28 19:12:55 jlam Exp $
#
# An example package buildlink3.mk file:
#
@@ -676,6 +676,7 @@ _BLNK_SANITIZED_PATH!= ${ECHO} ${PATH} | ${SED} \
_BLNK_WRAP_SANITIZE_PATH= PATH="${_BLNK_SANITIZED_PATH}"
_BLNK_EMPTY_FILE?= ${BUILDLINK_DIR}/bin/.empty
_BLNK_WRAP_ENV?= ${BUILDLINK_WRAPPER_ENV}
+_BLNK_WRAP_MARSHALL= ${BUILDLINK_DIR}/bin/.marshall
_BLNK_WRAP_PRE_CACHE= ${BUILDLINK_DIR}/bin/.pre-cache
_BLNK_WRAP_CACHE_ADD= ${BUILDLINK_DIR}/bin/.cache-add
_BLNK_WRAP_CACHE= ${BUILDLINK_DIR}/bin/.cache
@@ -702,6 +703,7 @@ _BLNK_WRAP_SETENV.${_wrappee_}= ${_wrappee_}="${BUILDLINK_${_wrappee_}:T}"
_BLNK_WRAP_SANITIZE_PATH.${_wrappee_}= ${_BLNK_WRAP_SANITIZE_PATH}
_BLNK_WRAP_EXTRA_FLAGS.${_wrappee_}= # empty
_BLNK_WRAP_ENV.${_wrappee_}= ${_BLNK_WRAP_ENV}
+_BLNK_WRAP_MARSHALL.${_wrappee_}= ${_BLNK_WRAP_MARSHALL}
_BLNK_WRAP_PRIVATE_PRE_CACHE.${_wrappee_}= ${_BLNK_EMPTY_FILE}
_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}= ${_BLNK_EMPTY_FILE}
_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}= ${_BLNK_EMPTY_FILE}
@@ -834,6 +836,7 @@ _BLNK_WRAPPER_TRANSFORM_SED.${_wrappee_}= \
-e "s|@_BLNK_LIBTOOL_FIX_LA@|${_BLNK_LIBTOOL_FIX_LA:Q}|g" \
-e "s|@_BLNK_WRAP_LOG@|${_BLNK_WRAP_LOG:Q}|g" \
-e "s|@_BLNK_WRAP_EXTRA_FLAGS@|${_BLNK_WRAP_EXTRA_FLAGS.${_wrappee_}:Q}|g" \
+ -e "s|@_BLNK_WRAP_MARSHALL@|${_BLNK_WRAP_MARSHALL.${_wrappee_}:Q}|g" \
-e "s|@_BLNK_WRAP_PRIVATE_PRE_CACHE@|${_BLNK_WRAP_PRIVATE_PRE_CACHE.${_wrappee_}:Q}|g" \
-e "s|@_BLNK_WRAP_PRIVATE_CACHE_ADD@|${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}:Q}|g" \
-e "s|@_BLNK_WRAP_PRIVATE_CACHE@|${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}:Q}|g" \
@@ -851,6 +854,7 @@ buildlink-wrappers: ${BUILDLINK_${_wrappee_}}
.if !target(${BUILDLINK_${_wrappee_}})
${BUILDLINK_${_wrappee_}}: \
${_BLNK_WRAPPER_SH.${_wrappee_}} \
+ ${_BLNK_WRAP_MARSHALL.${_wrappee_}} \
${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}} \
${_BLNK_WRAP_CACHE.${_wrappee_}} \
${_BLNK_WRAP_LOGIC.${_wrappee_}} \
@@ -949,6 +953,11 @@ ${_BLNK_EMPTY_FILE}:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET}
+${_BLNK_WRAP_MARSHALL}: ${.CURDIR}/../../mk/buildlink3/marshall
+ ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+ ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
+ | ${_BLNK_SH_CRUNCH_FILTER} > ${.TARGET}
+
.for _wrappee_ in ${_BLNK_WRAPPEES}
. if !target(${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}})
${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}}:
@@ -1074,7 +1083,8 @@ ${_BLNK_LIBTOOL_FIX_LA}: \
#
_BLNK_RPATH_FLAGS= ${RPATH_FLAG}
_BLNK_RPATH_FLAGS+= -Wl,${RPATH_FLAG}
-.for _rflag_ in -Wl,-R -Wl,-rpath, -Wl,-rpath-link,
+.for _rflag_ in \
+ -Wl,-R -Wl,-rpath, -Wl,--rpath, -Wl,-rpath-link, -Wl,--rpath-link
. if empty(_BLNK_RPATH_FLAGS:M${_rflag_})
_BLNK_RPATH_FLAGS+= ${_rflag_}
. endif
diff --git a/mk/buildlink3/gen-transform.sh b/mk/buildlink3/gen-transform.sh
index 38f08b619c0..d9a6baf02d9 100644
--- a/mk/buildlink3/gen-transform.sh
+++ b/mk/buildlink3/gen-transform.sh
@@ -1,6 +1,6 @@
#!@BUILDLINK_SHELL@
#
-# $NetBSD: gen-transform.sh,v 1.1.2.5 2003/08/28 10:29:09 jlam Exp $
+# $NetBSD: gen-transform.sh,v 1.1.2.6 2003/08/28 19:12:55 jlam Exp $
transform="@_BLNK_TRANSFORM_SEDFILE@"
untransform="@_BLNK_UNTRANSFORM_SEDFILE@"
@@ -44,12 +44,16 @@ EOF
esac
;;
rpath)
+ gen $action mangle:-Wl,--rpath-link,$2:-Wl,--rpath-link,$3
+ gen $action mangle:-Wl,--rpath,$2:-Wl,--rpath,$3
gen $action mangle:-Wl,-rpath-link,$2:-Wl,-rpath-link,$3
gen $action mangle:-Wl,-rpath,$2:-Wl,-rpath,$3
gen $action mangle:-Wl,-R$2:-Wl,-R$3
gen $action mangle:-R$2:-R$3
;;
no-rpath)
+ gen $action _r:-Wl,--rpath-link,
+ gen $action _r:-Wl,--rpath,
gen $action _r:-Wl,-rpath-link,
gen $action _r:-Wl,-rpath,
gen $action _r:-Wl,-R
@@ -153,6 +157,8 @@ EOF
esac
gen $action $r:-I$2
gen $action $r:-L$2
+ gen $action $r:-Wl,--rpath-link,$2
+ gen $action $r:-Wl,--rpath,$2
gen $action $r:-Wl,-rpath-link,$2
gen $action $r:-Wl,-rpath,$2
gen $action $r:-Wl,-R$2
diff --git a/mk/buildlink3/libtool.sh b/mk/buildlink3/libtool.sh
index e4fc31bfca7..53d7377ce9f 100644
--- a/mk/buildlink3/libtool.sh
+++ b/mk/buildlink3/libtool.sh
@@ -1,10 +1,11 @@
#!@BUILDLINK_SHELL@
#
-# $NetBSD: libtool.sh,v 1.1.2.1 2003/08/14 13:16:52 jlam Exp $
+# $NetBSD: libtool.sh,v 1.1.2.2 2003/08/28 19:12:56 jlam Exp $
Xsed='@SED@ -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+marshall="@_BLNK_WRAP_MARSHALL@"
private_pre_cache="@_BLNK_WRAP_PRIVATE_PRE_CACHE@"
private_cache_add="@_BLNK_WRAP_PRIVATE_CACHE_ADD@"
private_cache="@_BLNK_WRAP_PRIVATE_CACHE@"
@@ -68,6 +69,7 @@ case "$1" in
*)
cachehit=no
skipcache=no
+ . $marshall
. $private_cache
case $skipcache,$cachehit in
no,no) . $cache ;;
diff --git a/mk/buildlink3/marshall b/mk/buildlink3/marshall
new file mode 100644
index 00000000000..b01cd8d7d6a
--- /dev/null
+++ b/mk/buildlink3/marshall
@@ -0,0 +1,13 @@
+# $NetBSD: marshall,v 1.1.2.1 2003/08/28 19:12:56 jlam Exp $
+#
+# Merge "-Wl,--rpath -Wl,/path/to/dir" into a single argument
+# "-Wl,--rpath,/path/to/dir" so that we can look it up in the cache.
+#
+case $arg in
+-Wl,-rpath|-Wl,-rpath-link|\
+-Wl,--rpath|-Wl,--rpath-link)
+ nextarg=`$echo "X$1" | $Xsed -e "s|^-Wl,||g"`
+ arg="$arg,$nextarg"
+ shift
+ ;;
+esac
diff --git a/mk/buildlink3/wrapper.sh b/mk/buildlink3/wrapper.sh
index 9694405f6a7..4f36d0907bc 100644
--- a/mk/buildlink3/wrapper.sh
+++ b/mk/buildlink3/wrapper.sh
@@ -1,10 +1,11 @@
#!@BUILDLINK_SHELL@
#
-# $NetBSD: wrapper.sh,v 1.1.2.1 2003/08/14 13:16:55 jlam Exp $
+# $NetBSD: wrapper.sh,v 1.1.2.2 2003/08/28 19:12:56 jlam Exp $
Xsed='@SED@ -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+marshall="@_BLNK_WRAP_MARSHALL@"
private_pre_cache="@_BLNK_WRAP_PRIVATE_PRE_CACHE@"
private_cache_add="@_BLNK_WRAP_PRIVATE_CACHE_ADD@"
private_cache="@_BLNK_WRAP_PRIVATE_CACHE@"
@@ -34,9 +35,17 @@ while $test $# -gt 0; do
arg="$1"; shift
cachehit=no
skipcache=no
+ #
+ # Marshall any group of consecutive arguments into a single
+ # $arg to be checked in the cache and logic files.
+ #
+ . $marshall
+ #
+ # Check the private cache, and possibly set skipcache=yes.
+ #
. $private_cache
#
- # The private cache may set skipcache=yes.
+ # Check the common cache shared by all of the other wrappers.
#
case $skipcache,$cachehit in
no,no) . $cache ;;