[Midnightbsd-cvs] mports: bsd.perl.mk: add support for detecting your installed version of
ctriv at midnightbsd.org
ctriv at midnightbsd.org
Thu May 1 17:20:47 EDT 2008
Log Message:
-----------
add support for detecting your installed version of perl (if
PACKAGE_BUILDING isn't set).
Modified Files:
--------------
mports/Mk:
bsd.perl.mk (r1.10 -> r1.11)
-------------- next part --------------
Index: bsd.perl.mk
===================================================================
RCS file: /home/cvs/mports/Mk/bsd.perl.mk,v
retrieving revision 1.10
retrieving revision 1.11
diff -L Mk/bsd.perl.mk -L Mk/bsd.perl.mk -u -r1.10 -r1.11
--- Mk/bsd.perl.mk
+++ Mk/bsd.perl.mk
@@ -45,11 +45,53 @@
# PERL_MODBUILD - Use Module::Build to configure, build and install port.
##
+#
+# Common Vars.
+#
+PERL_ARCH?= mach
+PERL_BRANCH?= ${PERL_VERSION:C/\.[0-9]+$//}
+PERL_PORT?= perl${PERL_BRANCH}
+SITE_PERL_REL?= lib/perl5/site_perl/${PERL_VER}
+SITE_PERL?= ${LOCALBASE}/${SITE_PERL_REL}
+PERL= ${LOCALBASE}/bin/perl
+PERL5= ${PERL}${PERL_VERSION}
+PERL_TEST_TARGET?= test
+
+# PERL_CONFIGURE implies USE_PERL5
+.if defined(PERL_CONFIGURE) || defined(PERL_MODBUILD)
+USE_PERL5= yes
+.endif
+
+
+# USE_PERL5_(RUN|BUILD) implies USE_PERL5, USE_PERL5 => USE_PERL5_*
+.if defined(USE_PERL5_BUILD)
+USE_PERL5= ${USE_PERL5_BUILD}
+.elif defined(USE_PERL5_RUN)
+USE_PERL5= ${USE_PERL5_RUN}
+.elif defined(USE_PERL5)
+USE_PERL5_RUN=yes
+USE_PERL5_BUILD=yes
+.endif
+
+
+.if ${USE_PERL5:L} == "yes"
+USE_PERL5= ${PERL_BRANCH}
+.endif
+
#
# Perl version stuff.
#
-PERL_VERSION?= 5.8.8
+_DEFAULT_PERL_VERSION= 5.8.8
+_DEFAULT_PERL_BRANCH= 5.8
+
+.if exists(${PERL}) && !defined(PACKAGE_BUILDING)
+PERL_VERSION!= ${PERL} -MConfig -le 'print $$Config{version}'
+.else
+PERL_VERSION= ${_DEFAULT_PERL_VERSION}
+.endif
+
+
PERL_VER?= ${PERL_VERSION}
.if !defined(PERL_LEVEL) && defined(PERL_VERSION)
@@ -70,29 +112,15 @@
-#
-# Common Vars.
-#
-PERL_ARCH?= mach
-PERL_PORT?= perl5.8
-SITE_PERL_REL?= lib/perl5/site_perl/${PERL_VER}
-SITE_PERL?= ${LOCALBASE}/${SITE_PERL_REL}
-PERL5= ${LOCALBASE}/bin/perl${PERL_VERSION}
-PERL= ${LOCALBASE}/bin/perl
-PERL_TEST_TARGET?= test
-
-# PERL_CONFIGURE implies USE_PERL5
-.if defined(PERL_CONFIGURE)
-USE_PERL5= yes
-.endif
+# XXX parse USE_PERL=5.8 5.10+
#
# dependancies
#
PERL_NO_DEPENDS?= NO
-.if ${PERL_NO_DEPENDS} == "NO"
-.if defined(USE_PERL5) || defined(USE_PERL5_BUILD)
+.if ${PERL_NO_DEPENDS:U} == "NO"
+.if defined(USE_PERL5_BUILD)
EXTRACT_DEPENDS+=${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
PATCH_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
BUILD_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
@@ -200,3 +228,4 @@
.endif
.endif # defined(_POSTMKINCLUDED) && !defined(Perl_Post_Include)
+
More information about the Midnightbsd-cvs
mailing list