summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorgdt <gdt@pkgsrc.org>2018-10-16 00:19:40 +0000
committergdt <gdt@pkgsrc.org>2018-10-16 00:19:40 +0000
commit665060a576652a0101049515d2ce1ec11071b9cd (patch)
treeaacea3086e498479678af5b1031910e787b745ff /lang
parent74909604b38f32b7ee45071a0ce60ade27078799 (diff)
downloadpkgsrc-665060a576652a0101049515d2ce1ec11071b9cd.tar.gz
ocaml: Adjust PLIST for old MacOS
MacOS before 10.13 lacks the POSIX-required clock_gettime(), and fails to build some "instrumented runtime" files. Conditionalize the PLIST and avoid expecting these on older MacOS. Based almost entirely on a patch from Ryo Kogule on tech-pkg@, with minor munging by me.
Diffstat (limited to 'lang')
-rw-r--r--lang/ocaml/Makefile14
-rw-r--r--lang/ocaml/PLIST14
2 files changed, 19 insertions, 9 deletions
diff --git a/lang/ocaml/Makefile b/lang/ocaml/Makefile
index b41e069207c..7870977e8fe 100644
--- a/lang/ocaml/Makefile
+++ b/lang/ocaml/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.120 2018/07/19 12:16:38 jaapb Exp $
+# $NetBSD: Makefile,v 1.121 2018/10/16 00:19:40 gdt Exp $
.include "Makefile.common"
@@ -12,7 +12,8 @@ USE_TOOLS+= bash
USE_GCC_RUNTIME= yes
-PLIST_VARS+= ocaml-stub ocaml-prof ocaml-opt ocaml-nat ocaml-spacetime
+PLIST_VARS+= ocaml-stub ocaml-prof ocaml-opt ocaml-nat ocaml-spacetime \
+ instrumented_runtime
.include "options.mk"
###
@@ -61,6 +62,13 @@ PLIST.ocaml-nat= yes
PLIST.ocaml-spacetime= yes
.endif
+# clock_gettime(2), required by POSIX, is necessary for the
+# instrumented_runtime feature.
+# It is missing on macOS before 10.12.
+.if ${OPSYS} != "Darwin" || ${OS_VERSION:R:R} >= 16
+PLIST.instrumented_runtime=yes
+.endif
+
# This is needed because ${WRKSRC}/build/partial-install.sh uses
# $PWD as part of its script. However, with /bin/sh on SunOS
# (cd work/foo-1.0 && echo $PWD) will show that the value of PWD is
@@ -80,8 +88,10 @@ EXTRA_RT_LIBS.*=
PRINT_PLIST_AWK+= { gsub(/lib\/ocaml\/${PKGMANDIR:S|/|\\/|}/, "lib/ocaml/$${PKGMANDIR}"); }
+.if defined(PLIST.instrumented_runtime)
REPLACE_BASH+= tools/ocaml-instr-graph
REPLACE_AWK+= tools/ocaml-instr-report
+.endif
do-test:
cd ${WRKSRC}/testsuite && ${MAKE_PROGRAM} all
diff --git a/lang/ocaml/PLIST b/lang/ocaml/PLIST
index 2b781557b83..86aae2f6314 100644
--- a/lang/ocaml/PLIST
+++ b/lang/ocaml/PLIST
@@ -1,7 +1,7 @@
-@comment $NetBSD: PLIST,v 1.48 2018/09/25 11:39:12 jperkin Exp $
+@comment $NetBSD: PLIST,v 1.49 2018/10/16 00:19:40 gdt Exp $
bin/ocaml
-bin/ocaml-instr-graph
-bin/ocaml-instr-report
+${PLIST.instrumented_runtime}bin/ocaml-instr-graph
+${PLIST.instrumented_runtime}bin/ocaml-instr-report
bin/ocamlc
bin/ocamlc.byte
${PLIST.ocaml-opt}bin/ocamlc.opt
@@ -38,7 +38,7 @@ bin/ocamlprof.byte
${PLIST.ocaml-opt}bin/ocamlprof.opt
bin/ocamlrun
bin/ocamlrund
-bin/ocamlruni
+${PLIST.instrumented_runtime}bin/ocamlruni
bin/ocamlyacc
lib/ocaml/Makefile.config
lib/ocaml/VERSION
@@ -1300,14 +1300,14 @@ ${PLIST.ocaml-opt}lib/ocaml/libasmrun.a
${PLIST.ocaml-opt}lib/ocaml/libasmrun_pic.a
${PLIST.ocaml-opt}lib/ocaml/libasmrun_shared.so
${PLIST.ocaml-opt}lib/ocaml/libasmrund.a
-${PLIST.ocaml-opt}lib/ocaml/libasmruni.a
+${PLIST.instrumented_runtime}${PLIST.ocaml-opt}lib/ocaml/libasmruni.a
${PLIST.ocaml-prof}${PLIST.ocaml-opt}lib/ocaml/libasmrunp.a
${PLIST.ocaml-opt}lib/ocaml/libbigarray.a
${PLIST.ocaml-opt}lib/ocaml/libcamlrun.a
${PLIST.ocaml-opt}lib/ocaml/libcamlrun_pic.a
${PLIST.ocaml-opt}lib/ocaml/libcamlrun_shared.so
${PLIST.ocaml-opt}lib/ocaml/libcamlrund.a
-${PLIST.ocaml-opt}lib/ocaml/libcamlruni.a
+${PLIST.instrumented_runtime}${PLIST.ocaml-opt}lib/ocaml/libcamlruni.a
${PLIST.ocaml-opt}lib/ocaml/libcamlstr.a
${PLIST.ocaml-spacetime}${PLIST.ocaml-opt}lib/ocaml/libraw_spacetime_lib.a
${PLIST.ocaml-opt}lib/ocaml/libthreads.a
@@ -2047,7 +2047,7 @@ lib/ocaml/stublibs/dllvmthreads.so
lib/ocaml/sys.ml
lib/ocaml/sys.mli
lib/ocaml/target_camlheaderd
-lib/ocaml/target_camlheaderi
+${PLIST.instrumented_runtime}lib/ocaml/target_camlheaderi
lib/ocaml/thread.mli
lib/ocaml/threadUnix.mli
lib/ocaml/threads/condition.cmi