2013-01-03 09:32:11 -05:00
|
|
|
# $OpenBSD: ocaml.port.mk,v 1.23 2013/01/03 14:32:11 chrisz Exp $
|
2002-11-13 16:42:15 -05:00
|
|
|
|
2002-11-26 15:11:24 -05:00
|
|
|
# regular file usage for bytecode:
|
|
|
|
# PLIST -- bytecode base files
|
|
|
|
# PFRAG.foo -- bytecode files for FLAVOR == foo
|
|
|
|
# PFRAG.no-foo -- bytecode files for FLAVOR != foo
|
|
|
|
# extended file usage for nativecode:
|
|
|
|
# PFRAG.native -- nativecode base files
|
2005-01-22 09:28:38 -05:00
|
|
|
# PFRAG.foo-native -- nativecode files for FLAVOR == foo
|
|
|
|
# PFRAG.no-foo-native -- nativecode files for FLAVOR != foo
|
2002-11-13 16:42:15 -05:00
|
|
|
|
2012-11-30 14:38:09 -05:00
|
|
|
OCAML_VERSION=4.00.1
|
2006-12-26 17:07:18 -05:00
|
|
|
|
2012-08-18 17:49:16 -04:00
|
|
|
.include <bsd.port.arch.mk>
|
|
|
|
|
|
|
|
.if ${PROPERTIES:Mocaml_native}
|
2002-11-13 16:42:15 -05:00
|
|
|
MODOCAML_NATIVE=Yes
|
2002-11-26 15:11:24 -05:00
|
|
|
# include nativecode base files
|
2004-09-15 15:10:00 -04:00
|
|
|
PKG_ARGS+=-Dnative=1
|
2012-12-31 10:17:00 -05:00
|
|
|
.else
|
|
|
|
MODOCAML_NATIVE=No
|
|
|
|
# remove native base file entry from PLIST
|
|
|
|
PKG_ARGS+=-Dnative=0
|
|
|
|
.endif
|
2002-11-26 15:11:24 -05:00
|
|
|
|
2012-08-18 17:49:16 -04:00
|
|
|
.if ${PROPERTIES:Mocaml_native_dynlink}
|
2010-12-07 10:01:35 -05:00
|
|
|
MODOCAML_NATDYNLINK=Yes
|
2013-01-03 09:32:11 -05:00
|
|
|
MODOCAML_OCAMLDOC?=ocamldoc.opt
|
2010-12-07 10:01:35 -05:00
|
|
|
# include native dynlink base files
|
|
|
|
PKG_ARGS+=-Ddynlink=1
|
|
|
|
.else
|
|
|
|
MODOCAML_NATDYNLINK=No
|
2013-01-03 09:32:11 -05:00
|
|
|
MODOCAML_OCAMLDOC?=ocamldoc
|
2010-12-07 10:01:35 -05:00
|
|
|
# remove native dynlink base file entry from PLIST
|
|
|
|
PKG_ARGS+=-Ddynlink=0
|
|
|
|
.endif
|
|
|
|
|
2012-12-31 10:17:00 -05:00
|
|
|
RUN_DEPENDS += lang/ocaml
|
2012-11-30 14:38:09 -05:00
|
|
|
BUILD_DEPENDS += lang/ocaml
|
2013-01-03 09:32:11 -05:00
|
|
|
MAKE_ENV += OCAMLFIND_DESTDIR=${DESTDIR}${TRUEPREFIX}/lib/ocaml \
|
|
|
|
OCAMLFIND_COMMANDS="ocamldoc=${MODOCAML_OCAMLDOC}"
|
2012-08-18 17:49:16 -04:00
|
|
|
|
|
|
|
MODOCAML_pre-fake = \
|
|
|
|
${SUDO} ${INSTALL_DATA_DIR} ${WRKINST}${LOCALBASE}/lib/ocaml/stublibs
|
|
|
|
|
2006-05-28 23:44:49 -04:00
|
|
|
|
2012-08-18 17:49:16 -04:00
|
|
|
######################################################################
|
|
|
|
#
|
|
|
|
# CONFIGURE_STYLE for oasis.
|
|
|
|
#
|
|
|
|
# Also overrides do-{build,install,test}
|
|
|
|
#
|
|
|
|
.if ${CONFIGURE_STYLE:L:Moasis}
|
|
|
|
|
|
|
|
ALL_TARGET ?= -build -doc
|
|
|
|
# XXX can't do ?= here, because INSTALL_TARGET is already initialized
|
|
|
|
# with default value
|
|
|
|
INSTALL_TARGET = -install
|
|
|
|
REGRESS_TARGET ?= -test
|
|
|
|
_MODOASIS_SETUP = ${WRKDIR}/oasis_setup.byte
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# CONFIGURE
|
|
|
|
.if ${PROPERTIES:Mocaml_native}
|
|
|
|
_MODOASIS_OCAMLC = ocamlc.opt
|
|
|
|
.else
|
|
|
|
_MODOASIS_OCAMLC = ocamlc
|
|
|
|
.endif
|
|
|
|
MODOASIS_configure = \
|
|
|
|
${_MODOASIS_OCAMLC} -o ${_MODOASIS_SETUP} ${WRKSRC}/setup.ml && \
|
|
|
|
cd ${WRKSRC} && \
|
|
|
|
rm setup.cm[io] && \
|
|
|
|
${SETENV} ${CONFIGURE_ENV} ${_MODOASIS_SETUP} -configure \
|
|
|
|
--destdir ${WRKINST} \
|
2012-08-20 20:24:22 -04:00
|
|
|
--mandir ${PREFIX}/man \
|
|
|
|
--infodir ${PREFIX}/info \
|
2012-11-30 14:38:09 -05:00
|
|
|
--override pkg_name ${PKGNAME:C/-[0-9].*//} \
|
2012-08-18 17:49:16 -04:00
|
|
|
${CONFIGURE_ARGS}
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# BUILD
|
2012-09-05 17:36:31 -04:00
|
|
|
BUILD_DEPENDS+= sysutils/findlib
|
2012-08-18 17:49:16 -04:00
|
|
|
MODOASIS_BUILD_TARGET = cd ${WRKSRC}
|
|
|
|
. for TARGET in ${ALL_TARGET}
|
|
|
|
MODOASIS_BUILD_TARGET += \
|
|
|
|
&& ${SETENV} ${MAKE_ENV} ${_MODOASIS_SETUP} ${TARGET}
|
|
|
|
. endfor
|
|
|
|
. if !target(do-build)
|
|
|
|
do-build:
|
|
|
|
${MODOASIS_BUILD_TARGET}
|
|
|
|
. endif
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# INSTALL
|
|
|
|
MODOASIS_INSTALL_TARGET = cd ${WRKSRC}
|
|
|
|
. for TARGET in ${INSTALL_TARGET}
|
|
|
|
MODOASIS_INSTALL_TARGET += \
|
|
|
|
&& ${SETENV} ${MAKE_ENV} ${_MODOASIS_SETUP} ${TARGET}
|
|
|
|
. endfor
|
|
|
|
. if !target(do-install)
|
|
|
|
do-install:
|
|
|
|
${MODOASIS_INSTALL_TARGET}
|
|
|
|
. endif
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# REGRESS
|
|
|
|
MODOASIS_REGRESS_TARGET = cd ${WRKSRC}
|
|
|
|
. for TARGET in ${REGRESS_TARGET}
|
|
|
|
MODOASIS_REGRESS_TARGET += \
|
|
|
|
&& ${SETENV} ${MAKE_ENV} ${_MODOASIS_SETUP} ${TARGET}
|
|
|
|
. endfor
|
|
|
|
. if !target(do-regress)
|
|
|
|
do-regress:
|
|
|
|
${MODOASIS_REGRESS_TARGET}
|
|
|
|
. endif
|
|
|
|
|
|
|
|
.endif
|