diff options
Diffstat (limited to 'lang/ocaml')
-rw-r--r-- | lang/ocaml/buildlink3.mk | 3 | ||||
-rw-r--r-- | lang/ocaml/files/wrapper.sh | 12 |
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} "$@" |