From 494fca82784c77cb241416bc632d84f8d7409fa7 Mon Sep 17 00:00:00 2001 From: jaapb Date: Fri, 4 Mar 2016 15:19:42 +0000 Subject: Added OCAML_USE_OASIS_DYNRUN option --- mk/ocaml.mk | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'mk') diff --git a/mk/ocaml.mk b/mk/ocaml.mk index 4aab02d081c..e173616a1de 100644 --- a/mk/ocaml.mk +++ b/mk/ocaml.mk @@ -1,4 +1,4 @@ -# $NetBSD: ocaml.mk,v 1.5 2016/02/06 12:10:34 jaapb Exp $ +# $NetBSD: ocaml.mk,v 1.6 2016/03/04 15:19:42 jaapb Exp $ # # This Makefile fragment handles the common variables used by OCaml packages. # @@ -16,6 +16,8 @@ # package uses findlib infrastructure # OCAML_USE_OASIS [implies OCAML_USE_FINDLIB] # package uses oasis infrastructure +# OCAML_USE_OASIS_DYNRUN [implies OCAML_USE_OASIS] +# package uses oasis.dynrun # OCAML_USE_OPAM # package uses OPAM # OASIS_BUILD_ARGS @@ -34,6 +36,7 @@ _VARGROUPS+= ocaml _PKG_VARS.ocaml= \ OCAML_USE_FINDLIB \ OCAML_USE_OASIS \ + OCAML_USE_OASIS_DYNRUN \ OCAML_USE_OPAM \ OCAML_BUILD_ARGS _DEF_VARS.ocaml= \ @@ -47,6 +50,9 @@ OCAML_USE_FINDLIB?= no # Default value of OCAML_USE_OASIS OCAML_USE_OASIS?= no +# Default value of OCAML_USE_OASIS_DYNRUN +OCAML_USE_OASIS_DYNRUN?= no + # Default value of OCAML_USE_OPAM OCAML_USE_OPAM?= no @@ -62,6 +68,14 @@ OCAML_USE_OPT_COMPILER?= yes OCAML_USE_OPT_COMPILER?= no .endif +# +# Configure stuff for OASIS_DYNRUN +# +.if ${OCAML_USE_OASIS_DYNRUN} == "yes" +.include "../../devel/ocaml-oasis/buildlink3.mk" +OCAML_USE_OASIS= yes +.endif + # # Configure stuff for OASIS # @@ -109,20 +123,29 @@ PLIST.ocaml-opt= yes # OASIS targets # .if ${OCAML_USE_OASIS} == "yes" +.if ${OCAML_USE_OASIS_DYNRUN} == "yes" +pre-configure: + ${RUN} cd ${WRKSRC} && ocamlfind ocamlc -linkpkg -package oasis.dynrun -o setup setup.ml && ${RM} setup.cmo setup.cmi + +OASIS_EXEC=./setup +.else +OASIS_EXEC=ocaml setup.ml +.endif + # Redefine configure target do-configure: ${RUN} cd ${WRKSRC} && \ - ${SETENV} ${CONFIGURE_ENV} ocaml setup.ml -configure ${CONFIGURE_ARGS} + ${SETENV} ${CONFIGURE_ENV} ${OASIS_EXEC} -configure ${CONFIGURE_ARGS} # Redefine build target do-build: ${RUN} cd ${WRKSRC} && \ - ${SETENV} ${MAKE_ENV} ocaml setup.ml -build ${OASIS_BUILD_ARGS} + ${SETENV} ${MAKE_ENV} ${OASIS_EXEC} -build ${OASIS_BUILD_ARGS} # Redefine install target do-install: ${RUN} cd ${WRKSRC} && \ - ocaml setup.ml -install + ${OASIS_EXEC} -install .endif # Add dependency to ocaml. -- cgit v1.2.3