summaryrefslogtreecommitdiff
path: root/lang/smlnj/Makefile
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2016-07-03 19:15:02 +0000
committerdholland <dholland@pkgsrc.org>2016-07-03 19:15:02 +0000
commitf7dac646aee347ea6ffb90c8a61a2e3a282693bf (patch)
tree9e2304f8036235858c560356e216e248d34ab431 /lang/smlnj/Makefile
parent92856f783c3412997dc096df1be738db1269884e (diff)
downloadpkgsrc-f7dac646aee347ea6ffb90c8a61a2e3a282693bf.tar.gz
Use SUBST instead of manual seddery.
Diffstat (limited to 'lang/smlnj/Makefile')
-rw-r--r--lang/smlnj/Makefile55
1 files changed, 33 insertions, 22 deletions
diff --git a/lang/smlnj/Makefile b/lang/smlnj/Makefile
index ed27f85c49c..d2cdf307b1c 100644
--- a/lang/smlnj/Makefile
+++ b/lang/smlnj/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2016/07/03 19:08:22 dholland Exp $
+# $NetBSD: Makefile,v 1.28 2016/07/03 19:15:02 dholland Exp $
#
DISTNAME= boot.${BOX}-unix
@@ -45,6 +45,7 @@ SML_LIBDIR= ${SML_BASE}/lib
SML_BINDIR= ${SML_BASE}/bin
SML_SCRIPTS= _link-sml _run-sml _ml-build _ml-makedepend
+# note that this includes bsd.prefs.mk
.include "../../lang/smlnj/Makefile.common"
#
@@ -79,28 +80,38 @@ post-extract:
post-patch:
cd ${WRKDIR}/src && pax -rw runtime ${WRKDIR}/base/
-# resolve definition of SML_BASE, CFLAGS in patched files
+# Turn of nlffi on powerpc (I guess it doesn't work?)
+#
+# XXX: this switch doesn't work any more as the line in question doesn't
+# exist in the current version. Someone with a PPC build machine,
+# please check it out and either change it to match the file if still
+# needed, or get rid of it.
+.if ${MACHINE_ARCH} == "powerpc"
+SUBST_CLASSES+= nlffi
+SUBST_STAGE.nlffi= pre-configure
+SUBST_MESSAGE.nlffi= Turning off nlffi
+SUBST_FILES.nlffi= config/targets
+SUBST_SED.nlffi= -e '/^request nlffi$$/d'
+.endif # powerpc
+
+# resolve definition of SML_BASE
+SUBST_CLASSES+= smlbase
+SUBST_STAGE.smlbase= pre-configure
+SUBST_MESSAGE.smlbase= Setting SML_BASE
+SUBST_FILES.smlbase= ${SML_SCRIPTS:S/^/config\//}
+SUBST_VARS.smlbase= SML_BASE
+
+# resolve definition of CFLAGS in patched files
+# (note that we need to do this in both src/runtime and base/runtime)
+SUBST_CLASSES+= cflags
+SUBST_STAGE.cflags= pre-configure
+SUBST_MESSAGE.cflags= Setting CFLAGS
+SUBST_FILES.cflags= src/runtime/objs/* base/runtime/objs/*
+SUBST_VARS.cflags= CFLAGS
+
+# nothing here any more
do-configure:
- set -e; \
- if [ ${MACHINE_ARCH} = "powerpc" ]; then \
- ${AWK} '(! /^request nlffi$$/) { print }' \
- < ${WRKDIR}/config/targets \
- > ${WRKDIR}/temp; \
- ${MV} ${WRKDIR}/temp ${WRKDIR}/config/targets; \
- fi
- set -e; \
- cd ${WRKDIR}/config; \
- for f in ${SML_SCRIPTS}; do \
- ${CP} "$${f}" "$${f}.tmp"; \
- ${SED} -e 's|@SML_BASE@|${SML_BASE}|g' \
- < "$${f}.tmp" > "$${f}"; \
- done; \
- cd ${WRKDIR}/src/runtime/objs; \
- for f in *; do \
- ${CP} "$${f}" "$${f}.tmp"; \
- ${SED} -e 's|@CFLAGS@|'${CFLAGS:Q}'|g' \
- < "$${f}.tmp" > "$${f}"; \
- done
+ ${DO_NADA}
# The build target needs to run $WRKDIR/config/install.sh
do-build: