diff options
author | jlam <jlam> | 2003-03-14 19:37:30 +0000 |
---|---|---|
committer | jlam <jlam> | 2003-03-14 19:37:30 +0000 |
commit | f69d0aee59b843edb712e3c7201d67c1860a9902 (patch) | |
tree | 4ee2e06249d68477cf3fb68be1f095453bcec90d /mk/bsd.pkg.mk | |
parent | 2045c3a17f778f4291f00ac8495b025fac1eb26c (diff) | |
download | pkgsrc-f69d0aee59b843edb712e3c7201d67c1860a9902.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/bsd.pkg.mk')
-rw-r--r-- | mk/bsd.pkg.mk | 32 |
1 files changed, 19 insertions, 13 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) |