summaryrefslogtreecommitdiff
path: root/lang/ocaml
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2016-02-29 13:51:27 +0000
committerjperkin <jperkin@pkgsrc.org>2016-02-29 13:51:27 +0000
commit15c3477ddb3bf0eda1335a708f066c7fd00e77a3 (patch)
treee26d524d4ecc74ac1c4de20abe005b76653c0584 /lang/ocaml
parent7515ebbc3febdf7efcd6466ebafb8de3490f7d5a (diff)
downloadpkgsrc-15c3477ddb3bf0eda1335a708f066c7fd00e77a3.tar.gz
Ensure linker arguments get passed to ocamlmklib correctly.
Diffstat (limited to 'lang/ocaml')
-rw-r--r--lang/ocaml/buildlink3.mk3
-rw-r--r--lang/ocaml/files/wrapper.sh12
2 files changed, 10 insertions, 5 deletions
diff --git a/lang/ocaml/buildlink3.mk b/lang/ocaml/buildlink3.mk
index e95aaf52b15..719588f6623 100644
--- a/lang/ocaml/buildlink3.mk
+++ b/lang/ocaml/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.35 2016/01/16 10:32:53 jaapb Exp $
+# $NetBSD: buildlink3.mk,v 1.36 2016/02/29 13:51:27 jperkin Exp $
BUILDLINK_TREE+= ocaml
@@ -25,6 +25,7 @@ ocaml-wrappers:
-e 's|@OCAML_PREFIX@|${BUILDLINK_PREFIX.ocaml}|g' \
-e 's|@CFLAGS@|'${CFLAGS:Q}'|g' \
-e 's|@LDFLAGS@|'${LDFLAGS:Q}'|g' \
+ -e 's|@WRAPPEE@|'$$w'|g' \
< ${.CURDIR}/../../lang/ocaml/files/wrapper.sh \
> ${BUILDLINK_DIR}/bin/"$$w"; \
${CHMOD} +x ${BUILDLINK_DIR}/bin/"$$w"; \
diff --git a/lang/ocaml/files/wrapper.sh b/lang/ocaml/files/wrapper.sh
index 7eac0758ad3..e5fe8214fb5 100644
--- a/lang/ocaml/files/wrapper.sh
+++ b/lang/ocaml/files/wrapper.sh
@@ -1,13 +1,13 @@
#!@SH@
-# $NetBSD: wrapper.sh,v 1.2 2005/02/04 21:35:51 adrianp Exp $
+# $NetBSD: wrapper.sh,v 1.3 2016/02/29 13:51:28 jperkin Exp $
BINDIR='@OCAML_PREFIX@'
CFLAGS='@CFLAGS@'
LDFLAGS='@LDFLAGS@'
+WRAPPEE='@WRAPPEE@'
-if echo "$@" | grep ' -c ' >/dev/null
-then
+if echo "$@" | grep ' -c ' >/dev/null || [ "${WRAPPEE}" = "ocamlmklib" ]; then
flags="${CFLAGS}"
else
flags="${CFLAGS} ${LDFLAGS}"
@@ -18,4 +18,8 @@ do
MLFLAGS="${MLFLAGS} -ccopt ${f}"
done
-exec "@OCAML_PREFIX@/bin/`basename $0`" ${MLFLAGS} "$@"
+if [ "${WRAPPEE}" = "ocamlmklib" ]; then
+ MLFLAGS="${MLFLAGS} ${LDFLAGS}"
+fi
+
+exec "@OCAML_PREFIX@/bin/${WRAPPEE}" ${MLFLAGS} "$@"