summaryrefslogtreecommitdiff
path: root/mk/tools/perl.mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk/tools/perl.mk')
-rw-r--r--mk/tools/perl.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/mk/tools/perl.mk b/mk/tools/perl.mk
new file mode 100644
index 00000000000..111d9dc7254
--- /dev/null
+++ b/mk/tools/perl.mk
@@ -0,0 +1,18 @@
+# $NetBSD: perl.mk,v 1.1 2005/04/27 17:29:06 jlam Exp $
+
+# Create a symlink from ${TOOLS_DIR}/bin/perl to ${PERL5} when USE_PERL5
+# is defined. This ensures that the correct perl is executed when it's
+# invoked as a bare "perl".
+#
+.if defined(USE_PERL5) && !defined(TOOLS_IGNORE.perl)
+. if !empty(PKGPATH:Mlang/perl58)
+MAKEFLAGS+= TOOLS_IGNORE.perl=
+. else
+. include "../../lang/perl5/buildlink3.mk"
+TOOLS_SYMLINK+= perl
+TOOLS_REAL_CMD.perl= ${PERL5}
+. if exists(${TOOLS_REAL_CMD.perl})
+PERL5= ${TOOLS_REAL_CMD.perl}
+. endif
+. endif
+.endif