diff options
author | jlam <jlam@pkgsrc.org> | 2001-11-24 04:40:31 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2001-11-24 04:40:31 +0000 |
commit | 3200d221e02cb4df4b1eb5e1d6250764817ff378 (patch) | |
tree | 53704cc1a57370436cc97b4b1843f2792c23f3ee /lang | |
parent | 8419f3b2705de031b6ea642b6ce850cd41d89764 (diff) | |
download | pkgsrc-3200d221e02cb4df4b1eb5e1d6250764817ff378.tar.gz |
Add buildlink.mk file for use by perl5 module package Makefiles. This
buildlink.mk file can replace the use of USE_PERL5: it defines all of the
same perl variables as bsd.pkg.mk, adds a dependency on perl>=${PERL5_REQD}
and conditionally includes bsd.perl.mk. It also creates a buildlinkified
Config.pm that makes the local include/library search path include
${BUILDLINK_DIR} instead of hard-coding ${LOCALBASE}. There's more to be
done to make this more useful in strongly buildlinkifying a package, but
it's useful now as-is in weakly buildlinkifying a package.
Diffstat (limited to 'lang')
-rw-r--r-- | lang/perl5/buildlink.mk | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/lang/perl5/buildlink.mk b/lang/perl5/buildlink.mk new file mode 100644 index 00000000000..ba01628ee7c --- /dev/null +++ b/lang/perl5/buildlink.mk @@ -0,0 +1,61 @@ +# $NetBSD: buildlink.mk,v 1.1 2001/11/24 04:40:31 jlam Exp $ +# +# This Makefile fragment is included by packages that use perl. +# +# To use this Makefile fragment, simply: +# +# (1) Optionally define BUILDLINK_DEPENDS.perl to the dependency pattern +# for the version of perl desired. +# (2) Include this Makefile fragment in the package Makefile, + +.include "../../mk/bsd.buildlink.mk" + +BUILDLINK_DEPENDS.perl?= perl>=${PERL5_REQD} +DEPENDS+= ${BUILDLINK_DEPENDS.perl}:../../lang/perl5 + +PERL5?= ${BUILDLINK_PREFIX.perl}/bin/perl +PERL5_REQD?= 5.0 + +BUILDLINK_PREFIX.perl?= ${LOCALBASE} + +BUILDLINK_TARGETS.perl= perl-buildlink +BUILDLINK_TARGETS+= ${BUILDLINK_TARGETS.perl} + +_CONFIG_PM= ${PERL5_ARCHLIB}/Config.pm +_BUILDLINK_CONFIG_PM= ${_CONFIG_PM:S/${BUILDLINK_PREFIX.perl}\//${BUILDLINK_DIR}\//} + +_CONFIG_PM_SED= \ + -e "s|-I${LOCALBASE}/include|-I${BUILDLINK_DIR}/include|g" \ + -e "s|-L${LOCALBASE}/lib|-L${BUILDLINK_DIR}/lib|g" + +.if exists(${PERL5}) +. if exists(${BUILDLINK_PREFIX.perl}/share/mk/bsd.perl.mk) +. include "${BUILDLINK_PREFIX.perl}/share/mk/bsd.perl.mk" +. elif !defined(PERL5_SITELIB) || !defined(PERL5_SITEARCH) || !defined(PERL5_ARCHLIB) +PERL5_SITELIB!= eval `${PERL5} -V:installsitelib 2>/dev/null`; \ + ${ECHO} $${installsitelib} +PERL5_SITEARCH!= eval `${PERL5} -V:installsitearch 2>/dev/null`; \ + ${ECHO} $${installsitearch} +PERL5_ARCHLIB!= eval `${PERL5} -V:installarchlib 2>/dev/null`; \ + ${ECHO} $${installarchlib} +MAKEFLAGS+= PERL5_SITELIB=${PERL5_SITELIB} +MAKEFLAGS+= PERL5_SITEARCH=${PERL5_SITEARCH} +MAKEFLAGS+= PERL5_ARCHLIB=${PERL5_ARCHLIB} +. endif # !exists(bsd.perl.mk) && !defined(PERL5_*) +.endif # exists($PERL5) + +PERL5OPT+= -I${PERL5_ARCHLIB:S/${BUILDLINK_PREFIX.perl}\//${BUILDLINK_DIR}\//} +MAKE_ENV+= PERL5OPT="${PERL5OPT}" + +pre-configure: perl-buildlink + +perl-buildlink: + ${_PKG_SILENT}${_PKG_DEBUG} \ + cookie=${BUILDLINK_DIR}/.perl_buildlink_done; \ + if [ ! -f $${cookie} ]; then \ + ${ECHO_MSG} "Creating ${_BUILDLINK_CONFIG_PM}."; \ + ${MKDIR} ${_BUILDLINK_CONFIG_PM:H}; \ + ${SED} ${_CONFIG_PM_SED} ${_CONFIG_PM} \ + > ${_BUILDLINK_CONFIG_PM}; \ + ${ECHO} ${_BUILDLINK_CONFIG_PM} >> $${cookie}; \ + fi |