summaryrefslogtreecommitdiff
path: root/lang/gawk
diff options
context:
space:
mode:
authorgrant <grant>2003-07-09 08:17:42 +0000
committergrant <grant>2003-07-09 08:17:42 +0000
commitcd6056bfb95f96af45a5a702e0f78f58d4e4a642 (patch)
tree02e0a464fd308041b13ff46af06945dd76fccfb2 /lang/gawk
parent358a98817755a49a131ff7b2b90232b1176339b5 (diff)
downloadpkgsrc-cd6056bfb95f96af45a5a702e0f78f58d4e4a642.tar.gz
add a buildlink for gawk. this is derived from and shares the same
purpose as gsed/buildlink2.mk. XXX IRIX is currently listed in _INCOMPAT_AWK - this should be removed if awk on IRIX is known to be good.
Diffstat (limited to 'lang/gawk')
-rw-r--r--lang/gawk/buildlink2.mk56
1 files changed, 56 insertions, 0 deletions
diff --git a/lang/gawk/buildlink2.mk b/lang/gawk/buildlink2.mk
new file mode 100644
index 00000000000..cd03167a639
--- /dev/null
+++ b/lang/gawk/buildlink2.mk
@@ -0,0 +1,56 @@
+# $NetBSD: buildlink2.mk,v 1.1 2003/07/09 08:17:42 grant Exp $
+
+.if !defined(GAWK_BUILDLINK2_MK)
+GAWK_BUILDLINK2_MK= # defined
+
+.include "../../mk/bsd.prefs.mk"
+
+BUILDLINK_DEPENDS.gawk?= gawk>=3.1.1
+BUILDLINK_PKGSRCDIR.gawk?= ../../lang/gawk
+
+#
+# Some packages may really need GNU awk, but most just demand a
+# working awk.
+#
+
+.if defined(USE_GNU_AWK)
+_NEED_GNU_AWK= YES
+.else
+_NEED_GNU_AWK= NO
+
+# Not sure about IRIX, mark it incompatible for now
+_INCOMPAT_AWK= IRIX-*-*
+
+INCOMPAT_AWK?= # empty
+. for _pattern_ in ${_INCOMPAT_AWK} ${INCOMPAT_AWK}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_NEED_GNU_AWK= YES
+. endif
+. endfor
+
+.endif
+
+.if ${_NEED_GNU_AWK} == "YES"
+BUILDLINK_DEPMETHOD.gawk?= build
+BUILDLINK_PACKAGES+= gawk
+BUILDLINK_PREFIX.gawk_DEFAULT= ${LOCALBASE}
+BUILDLINK_FILES.gawk= bin/${GNU_PROGRAM_PREFIX}awk
+EVAL_PREFIX+= BUILDLINK_PREFIX.gawk=gawk
+.endif
+
+BUILDLINK_TARGETS+= gawk-buildlink gawk-buildlink-bin
+
+gawk-buildlink: _BUILDLINK_USE
+
+gawk-buildlink-bin:
+.if ${_NEED_GNU_AWK} == "YES"
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ [ ! -f ${BUILDLINK_DIR}/bin/awk ] && \
+ ${LN} -fs ${GNU_PROGRAM_PREFIX}awk ${BUILDLINK_DIR}/bin/awk
+.else
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ [ ! -f ${BUILDLINK_DIR}/bin/awk ] && \
+ ${LN} -fs ${AWK} ${BUILDLINK_DIR}/bin/awk
+.endif
+
+.endif # GAWK_BUILDLINK2_MK