diff options
author | jlam <jlam> | 2001-05-31 22:53:48 +0000 |
---|---|---|
committer | jlam <jlam> | 2001-05-31 22:53:48 +0000 |
commit | 1655a169c1dd7b162f0fde302c5665fccdacf7d5 (patch) | |
tree | 681b6046bcdba73db54d51a4307749c8cb126d38 | |
parent | 4974e1ee490bf1489cf6f979a0340c6270a40c62 (diff) | |
download | pkgsrc-1655a169c1dd7b162f0fde302c5665fccdacf7d5.tar.gz |
* Add buildlink.mk file to link appropriate libraries and headers into
${BUILDLINK_INCDIR} and ${BUILDLINK_LIBDIR}, to be used by other packages.
* Use buildlink.mk files to get dependencies and to prevent unintended
linking against installed libraries or finding installed headers except
for those that are explicitly linked into ${BUILDLINK_INCDIR} and
${BUILDLINK_LIBDIR}.
-rw-r--r-- | devel/rvm/Makefile | 11 | ||||
-rw-r--r-- | devel/rvm/buildlink.mk | 66 |
2 files changed, 74 insertions, 3 deletions
diff --git a/devel/rvm/Makefile b/devel/rvm/Makefile index 28c94e57fbc..ba783e58d3a 100644 --- a/devel/rvm/Makefile +++ b/devel/rvm/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2001/04/27 19:01:55 phil Exp $ +# $NetBSD: Makefile,v 1.4 2001/05/31 22:53:48 jlam Exp $ # DISTNAME= rvm-1.3 @@ -10,8 +10,6 @@ MAINTAINER= phil@cs.wwu.edu HOMEPAGE= http://www.coda.cs.cmu.edu/ COMMENT= Recoverable Virtual Memory -DEPENDS+= lwp>=1.6:../../devel/lwp - #LICENSE= GPL GNU_CONFIGURE= YES @@ -20,4 +18,11 @@ USE_GMAKE= YES LTCONFIG_OVERRIDE= ${WRKSRC}/ltconfig +.include "../../devel/lwp/buildlink.mk" + +CONFIGURE_ARGS+= --with-lwp-includes=${BUILDLINK_INCDIR} +LDFLAGS+= -L${BUILDLINK_LIBDIR} + +pre-configure: ${BUILDLINK_TARGETS} + .include "../../mk/bsd.pkg.mk" diff --git a/devel/rvm/buildlink.mk b/devel/rvm/buildlink.mk new file mode 100644 index 00000000000..26ee318505d --- /dev/null +++ b/devel/rvm/buildlink.mk @@ -0,0 +1,66 @@ +# $NetBSD: buildlink.mk,v 1.1 2001/05/31 22:53:48 jlam Exp $ +# +# This Makefile fragment is included by packages that use rvm. +# +# To use this Makefile fragment, simply: +# +# (1) Optionally define RVM_REQD to the version of rvm desired. +# (2) Include this Makefile fragment in the package Makefile, +# (3) Optionally define BUILDLINK_INCDIR and BUILDLINK_LIBDIR, +# (4) Add ${BUILDLINK_TARGETS} to the prerequisite targets for pre-configure, +# (5) Add ${BUILDLINK_INCDIR} to the front of the C preprocessor's header +# search path, and +# (6) Add ${BUILDLINK_LIBDIR} to the front of the linker's library search +# path. + +.if !defined(RVM_BUILDLINK_MK) +RVM_BUILDLINK_MK= # defined + +.include "../../devel/lwp/buildlink.mk" + +RVM_REQD?= 1.3 +DEPENDS+= rvm>=${RVM_REQD}:../../devel/rvm + +RVM_HEADERS= ${LOCALBASE}/include/rvm/* +RVM_LIBS= ${LOCALBASE}/lib/librds.* +RVM_LIBS+= ${LOCALBASE}/lib/librdslwp.* +RVM_LIBS+= ${LOCALBASE}/lib/librvm.* +RVM_LIBS+= ${LOCALBASE}/lib/librvmlwp.* +RVM_LIBS+= ${LOCALBASE}/lib/libseg.* + +BUILDLINK_INCDIR?= ${WRKDIR}/include +BUILDLINK_LIBDIR?= ${WRKDIR}/lib + +BUILDLINK_TARGETS+= link-rvm-headers +BUILDLINK_TARGETS+= link-rvm-libs + +# This target links the headers into ${BUILDLINK_INCDIR}, which should +# be searched first by the C preprocessor. +# +link-rvm-headers: + @${ECHO} "Linking rvm headers into ${BUILDLINK_INCDIR}." + @${MKDIR} ${BUILDLINK_INCDIR}/rvm + @${RM} -f ${BUILDLINK_INCDIR}/rvm/* + @for inc in ${RVM_HEADERS}; do \ + dest=${BUILDLINK_INCDIR}/rvm/`${BASENAME} $${inc}`; \ + if [ -f $${inc} ]; then \ + ${RM} -f $${dest}; \ + ${LN} -sf $${inc} $${dest}; \ + fi; \ + done + +# This target links the libraries into ${BUILDLINK_LIBDIR}, which should +# be searched first by the linker. +# +link-rvm-libs: + @${ECHO} "Linking rvm libraries into ${BUILDLINK_LIBDIR}." + @${MKDIR} ${BUILDLINK_LIBDIR} + @for lib in ${RVM_LIBS}; do \ + dest=${BUILDLINK_LIBDIR}/`${BASENAME} $${lib}`; \ + if [ -f $${lib} ]; then \ + ${RM} -f $${dest}; \ + ${LN} -sf $${lib} $${dest}; \ + fi; \ + done + +.endif # RVM_BUILDLINK_MK |