pkgsrc/lang/ocaml/Makefile
jaapb 1f583dbce3 Updated lang/ocaml to version 4.14.0.
This is a long-overdue update, so there are many changes. Details are in
the Changes file in the distribution.

The mk/ocaml file will be moved to lang/ocaml and the logic for selecting
whether to use the native-code compiler will be factored out into
native.mk to avoid duplications.

This is the final version before OCaml 5.0 arrives, which has
multicore support and should be a major change from the 4.x versions.
2022-05-24 18:25:38 +00:00

64 lines
1.7 KiB
Makefile

# $NetBSD: Makefile,v 1.144 2022/05/24 18:25:38 jaapb Exp $
.include "Makefile.common"
TEST_PROGRAM= ocamltest
MAKE_JOBS_SAFE= no
UNLIMIT_RESOURCES= stacksize
USE_TOOLS+= bash
USE_LANGUAGES+= c
USE_LIBTOOL= yes
USE_GNU_CONFIGURE_HOST= no
#USE_GCC_RUNTIME= yes
.include "options.mk"
.include "native.mk"
# Options
.if ${OCAML_USE_OPT_COMPILER} == "yes"
CONFIGURE_ARGS+= --enable-native-compiler
BUILD_TARGET= world.opt
.else
CONFIGURE_ARGS+= --disable-native-compiler
BUILD_TARGET= world
.endif
# This is needed because ${WRKSRC}/build/partial-install.sh uses
# $PWD as part of its script. However, with /bin/sh on SunOS
# (cd work/foo-1.0 && echo $PWD) will show that the value of PWD is
# set before the cd takes place and is then passed down. So the end
# result is when ./build/partial-install.sh is called, PWD is set
# to /usr/pkgsrc/devel/ocaml instead of ${WRKSRC}. /bin/ksh, which
# is what ${SH} is on SunOS, doesn't exhibit this behaviour.
.if ${OPSYS} == "SunOS"
INSTALL_MAKE_FLAGS+= SHELL=${SH:Q}
.endif
INSTALLATION_DIRS= share/doc/ocaml
OPSYSVARS+= EXTRA_RT_LIBS
EXTRA_RT_LIBS.NetBSD= -lcurses
EXTRA_RT_LIBS.*=
PRINT_PLIST_AWK+= { gsub(/lib\/ocaml\/${PKGMANDIR:S|/|\\/|}/, "lib/ocaml/$${PKGMANDIR}"); }
do-test:
cd ${WRKSRC} && ${MAKE_PROGRAM} ${TEST_PROGRAM}
cd ${WRKSRC}/testsuite && ${MAKE_PROGRAM} all
.if ${OPSYS} == "Darwin"
.PHONY: fix-darwin-install-name
post-install: fix-darwin-install-name
fix-darwin-install-name:
for f in ${DESTDIR}${PREFIX}/lib/ocaml/*.so \
${DESTDIR}${PREFIX}/lib/ocaml/stublibs/*.so; do \
install_name_tool -id `${ECHO} $$f | ${SED} -e 's,${DESTDIR},,g'` $$f; \
done
.endif
.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/termcap.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"