diff options
author | jlam <jlam@pkgsrc.org> | 2003-03-14 19:37:30 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2003-03-14 19:37:30 +0000 |
commit | 3ef633718c6eecbd852195de9329d45632a10352 (patch) | |
tree | 4ee2e06249d68477cf3fb68be1f095453bcec90d /mk | |
parent | 1940384395085677c2036358dfcccfad791a4dd8 (diff) | |
download | pkgsrc-3ef633718c6eecbd852195de9329d45632a10352.tar.gz |
(1) Publicly export the value of _OPSYS_RPATH_NAME as RPATH_FLAG;
Makefiles simply need to use this value often, for better or for
worse.
(2) Create a new variable FIX_RPATH that lists variables that should
be cleansed of -R or -rpath values if ${_USE_RPATH} is "no". By
default, FIX_RPATH contains LIBS, X11_LDFLAGS, and LDFLAGS, and
additional variables may be appended from package Makefiles.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 32 | ||||
-rw-r--r-- | mk/bsd.prefs.mk | 6 |
2 files changed, 24 insertions, 14 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index d2d00bcc8ee..7d8c2095f7a 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1150 2003/03/04 14:50:09 seb Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1151 2003/03/14 19:37:49 jlam Exp $ # # This file is in the public domain. # @@ -269,23 +269,16 @@ SHCOMMENT?= ${ECHO_MSG} >/dev/null '***' DISTINFO_FILE?= ${.CURDIR}/distinfo +FIX_RPATH+= LIBS .if defined(USE_X11) X11_LDFLAGS= # empty -. if ${_USE_RPATH} == "yes" -X11_LDFLAGS+= -Wl,${_OPSYS_RPATH_NAME}${X11BASE}/lib -. endif +X11_LDFLAGS+= -Wl,${RPATH_FLAG}${X11BASE}/lib X11_LDFLAGS+= -L${X11BASE}/lib LDFLAGS+= ${X11_LDFLAGS} .endif -.if ${_USE_RPATH} == "yes" -LDFLAGS+= -Wl,${_OPSYS_RPATH_NAME}${LOCALBASE}/lib -.else -. if !empty(USE_BUILDLINK2:M[nN][oO]) -LDFLAGS:= ${LDFLAGS:N*-Wl,-R*:N*-rpath*} -. endif -.endif - +LDFLAGS+= -Wl,${RPATH_FLAG}${LOCALBASE}/lib LDFLAGS+= -L${LOCALBASE}/lib +FIX_RPATH+= X11_LDFLAGS LDFLAGS MAKE_ENV+= LDFLAGS="${LDFLAGS}" CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" M4="${M4}" YACC="${YACC}" @@ -531,7 +524,7 @@ MESSAGE_SUBST_SED= ${MESSAGE_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/} .endif PKGCONFIG_OVERRIDE_SED= \ - '-e s|^\(Libs:.*[ ]\)-L\([ ]*[^ ]*\)\(.*\)$$|\1-Wl,${_OPSYS_RPATH_NAME}\2 -L\2\3|' + '-e s|^\(Libs:.*[ ]\)-L\([ ]*[^ ]*\)\(.*\)$$|\1-Wl,${RPATH_FLAG}\2 -L\2\3|' # Latest version of digest(1) required for pkgsrc DIGEST_REQD= 20010302 @@ -662,6 +655,19 @@ RMAN?= ${X11BASE}/bin/rman . endif .endif +# FIX_RPATH will remove compiler or linker settings related to run-time +# library search path settings if _USE_RPATH is "no". +# +.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 +${var}:= ${${var}:N-Wl,${_rpath_flag}*:N${_rpath_flag}*} +. endfor +. endfor +. endif +.endif + .if defined(EVAL_PREFIX) . for def in ${EVAL_PREFIX} . if !defined(${def:C/=.*//}_DEFAULT) diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk index f07206139e3..8bb63a707f1 100644 --- a/mk/bsd.prefs.mk +++ b/mk/bsd.prefs.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prefs.mk,v 1.106 2003/01/25 22:39:56 jschauma Exp $ +# $NetBSD: bsd.prefs.mk,v 1.107 2003/03/14 19:37:49 jlam Exp $ # # Make file, included to get the site preferences, if any. Should # only be included by package Makefiles before any .if defined() @@ -248,6 +248,10 @@ X11PREFIX= ${X11BASE} XMKMF_CMD?= ${X11PREFIX}/bin/xmkmf .endif +# RPATH_FLAG publicly exports the linker flag used to specify run-time +# library search paths. +# +RPATH_FLAG?= ${_OPSYS_RPATH_NAME} .ifndef DIGEST DIGEST:= ${LOCALBASE}/bin/digest |