pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/lang/ocaml Looks like the rpath problem is a bit more ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/681b855072eb
branches: trunk
changeset: 486196:681b855072eb
user: jmmv <jmmv%pkgsrc.org@localhost>
date: Fri Dec 24 18:49:09 2004 +0000
description:
Looks like the rpath problem is a bit more serious than I initially thought
(it currently affects packages using X11, but I guess it will also cause
problems when using pkgviews, for example).
So, instead of fixing it on a package basis, create some wrappers in the
buildlink directory that parse CFLAGS and LDFLAGS contents and convert them
to ocaml flags (basically, prepend -ccopt to each of them).
diffstat:
lang/ocaml/buildlink3.mk | 18 +++++++++++++++++-
lang/ocaml/files/wrapper.sh | 19 +++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletions(-)
diffs (55 lines):
diff -r 448979b213fc -r 681b855072eb lang/ocaml/buildlink3.mk
--- a/lang/ocaml/buildlink3.mk Fri Dec 24 18:41:03 2004 +0000
+++ b/lang/ocaml/buildlink3.mk Fri Dec 24 18:49:09 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.10 2004/12/24 17:16:04 jmmv Exp $
+# $NetBSD: buildlink3.mk,v 1.11 2004/12/24 18:49:09 jmmv Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
OCAML_BUILDLINK3_MK:= ${OCAML_BUILDLINK3_MK}+
@@ -23,6 +23,22 @@
PRINT_PLIST_AWK+= /^@dirrm lib\/ocaml$$/ \
{ print "@comment in ocaml: " $$0; next }
+BUILDLINK_TARGETS+= ocaml-wrappers
+OCAML_WRAPPERS= ocaml ocamlc ocamlc.opt ocamlcp ocamlmklib ocamlmktop \
+ ocamlopt ocamlopt.opt
+
+ocaml-wrappers:
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ for w in ${OCAML_WRAPPERS}; do \
+ ${SED} -e 's|@SH@|${SH}|g' \
+ -e 's|@OCAML_PREFIX@|${BUILDLINK_PREFIX.ocaml}|g' \
+ -e 's|@CFLAGS@|${CFLAGS}|g' \
+ -e 's|@LDFLAGS@|${LDFLAGS}|g' \
+ <${.CURDIR}/../../lang/ocaml/files/wrapper.sh \
+ >${BUILDLINK_DIR}/bin/$$w; \
+ ${CHMOD} +x ${BUILDLINK_DIR}/bin/$$w; \
+ done
+
.endif # OCAML_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff -r 448979b213fc -r 681b855072eb lang/ocaml/files/wrapper.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ocaml/files/wrapper.sh Fri Dec 24 18:49:09 2004 +0000
@@ -0,0 +1,19 @@
+#!@SH@
+
+BINDIR='@OCAML_PREFIX@'
+CFLAGS='@CFLAGS@'
+LDFLAGS='@LDFLAGS@'
+
+if echo "$@" | grep ' -c ' >/dev/null
+then
+ flags="${CFLAGS}"
+else
+ flags="${CFLAGS} ${LDFLAGS}"
+fi
+
+for f in ${flags}
+do
+ MLFLAGS="${MLFLAGS} -ccopt ${f}"
+done
+
+exec "@OCAML_PREFIX@/bin/`basename $0`" ${MLFLAGS} "$@"
Home |
Main Index |
Thread Index |
Old Index