diff options
author | joerg <joerg@pkgsrc.org> | 2011-11-27 19:46:00 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2011-11-27 19:46:00 +0000 |
commit | fd3c6def8f38a58e43c7c885a3b670af010b7ad0 (patch) | |
tree | 93f16118b4e56810affc86c8646d1033978cec02 | |
parent | d69bc6a2e7b627011953091f7f5f88223a41a162 (diff) | |
download | pkgsrc-fd3c6def8f38a58e43c7c885a3b670af010b7ad0.tar.gz |
omake tries to link with the ocaml runtime directly. This fails as
libocamlrun.a has a curses dependency on NetBSD. Patch the linker
invocation to allow adding platform specific options.
-rw-r--r-- | lang/ocaml/Makefile | 15 | ||||
-rw-r--r-- | lang/ocaml/distinfo | 3 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-bytecomp_bytelink.ml | 22 |
3 files changed, 37 insertions, 3 deletions
diff --git a/lang/ocaml/Makefile b/lang/ocaml/Makefile index b620be98bc0..33b2b3b571a 100644 --- a/lang/ocaml/Makefile +++ b/lang/ocaml/Makefile @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.73 2011/11/27 19:11:59 marino Exp $ +# $NetBSD: Makefile,v 1.74 2011/11/27 19:46:00 joerg Exp $ PKG_DESTDIR_SUPPORT= user-destdir .include "Makefile.common" -PKGREVISION= 3 +PKGREVISION= 4 CONFIGURE_ARGS+= -no-tk CONFIGURE_ARGS+= -cc ${CC} @@ -70,6 +70,17 @@ PLIST_SRC+= ${PKGDIR}/PLIST INSTALL_MAKE_FLAGS+= SHELL=${SH:Q} .endif +.if ${OPSYS} == "NetBSD" +EXTRA_RT_LIBS= -lcurses +.else +EXTRA_RT_LIBS= +.endif + +SUBST_CLASSES+= extra-rt-libs +SUBST_FILES.extra-rt-libs= bytecomp/bytelink.ml +SUBST_SED.extra-rt-libs+= -e 's,@EXTRA_RT_LIBS@,${EXTRA_RT_LIBS},g' +SUBST_STAGE.extra-rt-libs= pre-configure + do-test: cd ${WRKSRC}/testsuite && ${MAKE_PROGRAM} all diff --git a/lang/ocaml/distinfo b/lang/ocaml/distinfo index 5baf25a7c05..238ba0c9163 100644 --- a/lang/ocaml/distinfo +++ b/lang/ocaml/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.58 2011/11/27 19:11:59 marino Exp $ +$NetBSD: distinfo,v 1.59 2011/11/27 19:46:00 joerg Exp $ SHA1 (ocaml-3.12.0.tar.bz2) = 33ebbfb1115806f117808f37e40d206c8994943d RMD160 (ocaml-3.12.0.tar.bz2) = 3d10d5f7431d8200688fa74122e7ed528126a0fa @@ -37,3 +37,4 @@ SHA1 (patch-bu) = 0b3bbe273142ebed3a24e7e92d4cfd9f30a032b6 SHA1 (patch-bv) = 595641bb079174f393e420bdf5c48fe8ca1912cf SHA1 (patch-bw) = 6214af031d165f7485f5b422262e8a0e0cc95588 SHA1 (patch-bx) = 3cfcad488901f616a3a2f968247d7915f05891d7 +SHA1 (patch-bytecomp_bytelink.ml) = 182c5f7cb9e79aadbfe62eaf0b5523ae121cb2b4 diff --git a/lang/ocaml/patches/patch-bytecomp_bytelink.ml b/lang/ocaml/patches/patch-bytecomp_bytelink.ml new file mode 100644 index 00000000000..b90e17b07a9 --- /dev/null +++ b/lang/ocaml/patches/patch-bytecomp_bytelink.ml @@ -0,0 +1,22 @@ +$NetBSD: patch-bytecomp_bytelink.ml,v 1.1 2011/11/27 19:46:00 joerg Exp $ + +--- bytecomp/bytelink.ml.orig 2011-11-26 23:11:19.000000000 +0000 ++++ bytecomp/bytelink.ml +@@ -467,7 +467,7 @@ void caml_startup(char ** argv)\n\ + + let build_custom_runtime prim_name exec_name = + Ccomp.call_linker Ccomp.Exe exec_name +- ([prim_name] @ List.rev !Clflags.ccobjs @ ["-lcamlrun"]) ++ ([prim_name] @ List.rev !Clflags.ccobjs @ ["-lcamlrun @EXTRA_RT_LIBS@"]) + (Clflags.std_include_flag "-I" ^ " " ^ Config.bytecomp_c_libraries) + + let append_bytecode_and_cleanup bytecode_name exec_name prim_name = +@@ -547,7 +547,7 @@ let link objfiles output_name = + temps := obj_file :: !temps; + if not ( + Ccomp.call_linker Ccomp.MainDll output_name +- ([obj_file] @ List.rev !Clflags.ccobjs @ ["-lcamlrun"]) ++ ([obj_file] @ List.rev !Clflags.ccobjs @ ["-lcamlrun @EXTRA_RT_LIBS@"]) + Config.bytecomp_c_libraries + ) then raise (Error Custom_runtime); + end |