diff --git a/lang/ocaml/Makefile b/lang/ocaml/Makefile index 792a5a26664c..15f40a121325 100644 --- a/lang/ocaml/Makefile +++ b/lang/ocaml/Makefile @@ -1,169 +1,168 @@ # Created by: Kiriyama Kazuhiko # for committer: bump PORTREVISION for math/facile whenever ocaml gets updated PORTNAME= ocaml PORTVERSION= 4.07.1 CATEGORIES= lang MASTER_SITES= http://caml.inria.fr/pub/distrib/${DISTNAME:R}/ GENTOO \ http://caml.inria.fr/pub/distrib/${DISTNAME:R}/:docs PKGNAMESUFFIX= ${SFX} MAINTAINER= michipili@gmail.com COMMENT= Objective Caml compiler and programming environment LICENSE= QPL10 LGPL20 LICENSE_COMB= multi LICENSE_NAME_QPL10= Q Public License, Version 1.0 LICENSE_FILE_QPL10= ${WRKSRC}/LICENSE LICENSE_PERMS_QPL10= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept -BROKEN_aarch64= Does not build: sh: as: not found BROKEN_riscv64= fails to build: hasgot.c:3:12: use of undeclared identifier 'secure_getenv' BROKEN_sparc64= No rule to make target 'none.o', needed by 'libasmrun.a' BROKEN_mips64= No ASM support BROKEN_mips= No ASM support BUILD_DEPENDS= as:devel/binutils RUN_DEPENDS= as:devel/binutils USES= cpe compiler:c11 gmake shebangfix tar:xz USE_LDCONFIG= yes CPE_VENDOR= inria HAS_CONFIGURE= yes ALL_TARGET= world.opt STRIP= SSP_UNSAFE= yes MAKE_JOBS_UNSAFE= yes LDFLAGS_armv6= -Wl,-znotext LDFLAGS_armv7= -Wl,-znotext LDFLAGS_i386= -Wl,-znotext SHEBANG_LANG= awk awk_OLD_CMD= /bin/awk awk_CMD= /usr/bin/awk SHEBANG_FILES= tools/ocaml-instr-graph tools/ocaml-instr-report CONFIGURE_ARGS= -verbose -prefix "${PREFIX}" \ -cc "${CC}" \ -aspp "${CC} -c" \ -partialld "${LD} -r" OPTIONS_DEFINE= X11 THREADS DOCS EXAMPLES OPTIONS_DEFAULT=X11 THREADS CMP_LIB_DESC= Install compiler libraries MODOPT= camlp4o camlp4r ocamlc ocamldep ocamldoc ocamllex ocamlopt PATTERN= [[:space:]]*(do|then)?[[:space:]]*)(\$$\(CP\)|cp)([[:space:]] DOCSDISTNAME= ${DISTNAME:C/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/\1.\2/} CONFLICTS= metaocaml .include .if ${PORT_OPTIONS:MDOCS} DISTFILES:= ${DISTNAME}${EXTRACT_SUFX} \ ${DOCSDISTNAME}-refman-html.tar.gz:docs \ ${DOCSDISTNAME}-refman.ps.gz:docs \ ${DOCSDISTNAME}-refman.pdf:docs EXTRACT_ONLY:= ${DISTNAME}${EXTRACT_SUFX} \ ${DOCSDISTNAME}-refman-html.tar.gz PLIST_SUB+= DOC="" PORTDOCS= htmlman ${DOCSDISTNAME}-refman.ps.gz ${DOCSDISTNAME}-refman.pdf .else PLIST_SUB+= DOC="@comment " .endif .if ${ARCH} == armv6 || ${ARCH} == armv7 CONFIGURE_ARGS+= -as "${AS} ${ASFLAGS} -meabi=5" .elif ${ARCH} == powerpc LLD_UNSAFE= yes .else CONFIGURE_ARGS+= -as "${AS} ${ASFLAGS}" .endif .if ${PORT_OPTIONS:MTHREADS} PLIST_SUB+= THREADS="" THR_LD= -lpthread .else PLIST_SUB+= THREADS="@comment " THR_LD= #empty CONFIGURE_ARGS+=-no-pthread .endif .if ${PORT_OPTIONS:MX11} PLIST_SUB+= X11="" USES+= xorg USE_XORG= x11 CONFLICTS+= ocaml-nox11 CONFIGURE_ARGS+=-x11include ${LOCALBASE}/include -x11lib ${LOCALBASE}/lib .else PLIST_SUB+= X11="@comment " SFX= -nox11 CONFLICTS+= ocaml CONFIGURE_ARGS+=-no-graph .endif .include .if defined(NO_PROFILE) || ${ARCH:Mpowerpc} || ${ARCH:Mamd64} PLIST_SUB+= PROF="@comment " .else PLIST_SUB+= PROF="" .endif .if defined(PPC_ABI) && ${PPC_ABI} == ELFv2 EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-asmcomp_power_arch.ml USE_GCC= yes .endif .if ${ARCH} == powerpc64le USE_GCC= yes .endif post-extract: .if ${PORT_OPTIONS:MDOCS} @if ! (cd ${WRKDIR} && \ ${TAR} xf ${_DISTDIR}${DOCSDISTNAME}-refman-html.tar.gz \ ) \ then \ exit 1; \ fi; .endif post-patch: @${REINPLACE_CMD} \ -e '\|MKLIB=|s|ar rc|${AR} rc|' \ -e '\|RANLIB|s|ranlib|${RANLIB}|' \ -e '\|^ldflags=|s|""|"${LDFLAGS}"|' \ ${WRKSRC}/configure @${REINPLACE_CMD} -e 's,$$(ARCH),$$(SYSTEM_ARCH),' \ ${WRKSRC}/Makefile ${WRKSRC}/Makefile.tools \ ${WRKSRC}/asmrun/Makefile \ ${WRKSRC}/ocamltest/Makefile \ ${WRKSRC}/otherlibs/systhreads/Makefile \ ${WRKSRC}/testsuite/tests/asmgen/Makefile post-configure: @${REINPLACE_CMD} -E \ -e '/^PTHREAD_LINK/s,-pthread,${THR_LD},g' \ ${WRKSRC}/config/Makefile check-test: do-install @cd ${WRKSRC}/testsuite; ${RM} _log; for d in tests/* ; do \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} one DIR=$${d} \ 2>&1 | tee -a _log || ${TRUE} ; done ; \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} report post-install: .if ${PORT_OPTIONS:MDOCS} ${MKDIR} ${STAGEDIR}${DOCSDIR} (cd ${WRKDIR} && ${COPYTREE_SHARE} htmlman ${STAGEDIR}${DOCSDIR}) ${INSTALL_DATA} ${_DISTDIR}${DOCSDISTNAME}-refman.ps.gz ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${_DISTDIR}${DOCSDISTNAME}-refman.pdf ${STAGEDIR}${DOCSDIR} .endif # Spacetime profiling is only available for native code on 64-bit targets .if ${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == i386 || ${ARCH} == powerpc @${REINPLACE_CMD} -e '/raw_spacetime_lib/d' ${TMPPLIST} .endif .include diff --git a/lang/ocaml/files/patch-configure b/lang/ocaml/files/patch-configure index b7be1fa6c6ba..df53ede3357f 100644 --- a/lang/ocaml/files/patch-configure +++ b/lang/ocaml/files/patch-configure @@ -1,76 +1,77 @@ --- configure.orig 2017-07-13 08:56:44 UTC +++ configure @@ -838,6 +838,7 @@ if test $with_sharedlibs = "yes"; then x86_64-*-darwin*) natdynlink=true;; s390x*-*-linux*) natdynlink=true;; powerpc*-*-linux*) natdynlink=true;; + powerpc*-*-freebsd*) natdynlink=true;; i686-*-kfreebsd*) natdynlink=true;; x86_64-*-kfreebsd*) natdynlink=true;; x86_64-*-dragonfly*) natdynlink=true;; @@ -854,6 +855,7 @@ if test $with_sharedlibs = "yes"; then arm*-*-freebsd*) natdynlink=true;; earm*-*-netbsd*) natdynlink=true;; aarch64-*-linux*) natdynlink=true;; + aarch64-*-freebsd*) natdynlink=true;; esac fi @@ -921,6 +923,10 @@ case "$target" in powerpc*-*-linux*) arch=power; if $arch64; then model=ppc64; else model=ppc; fi system=elf;; + powerpc64le*-*-freebsd*) arch=power; model=ppc64le; system=bsd_elf;; + powerpc*-*-freebsd*) arch=power; + if $arch64; then model=ppc64; else model=ppc; fi + system=bsd_elf;; powerpc-*-netbsd*) arch=power; model=ppc; system=netbsd;; powerpc-*-openbsd*) arch=power; model=ppc; system=bsd_elf;; s390x*-*-linux*) arch=s390x; model=z10; system=elf;; @@ -930,6 +936,7 @@ case "$target" in armv6t2*-*-linux-gnueabi) arch=arm; model=armv6t2; system=linux_eabi;; armv6*-*-linux-gnueabi) arch=arm; model=armv6; system=linux_eabi;; armv6*-*-freebsd*) arch=arm; model=armv6; system=freebsd;; + armv7*-*-freebsd*) arch=arm; model=armv7; system=freebsd;; earmv6*-*-netbsd*) arch=arm; model=armv6; system=netbsd;; earmv7*-*-netbsd*) arch=arm; model=armv7; system=netbsd;; armv5te*-*-linux-gnueabi) arch=arm; model=armv5te; system=linux_eabi;; @@ -946,6 +953,7 @@ case "$target" in x86_64-*-darwin*) arch=amd64; system=macosx;; x86_64-*-mingw*) arch=amd64; system=mingw;; aarch64-*-linux*) arch=arm64; system=linux;; + aarch64-*-freebsd*) arch=arm64; system=freebsd;; x86_64-*-cygwin*) arch=amd64; system=cygwin;; esac -@@ -1051,10 +1059,12 @@ case "$arch,$system" in - case "$nativecc" in gcc*) ;; *) cc_profile='-xpg';; esac;; +@@ -1086,10 +1094,13 @@ case "$arch,$system" in + i386,macosx) profiling='true';; amd64,linux) profiling='true';; amd64,openbsd) profiling='true';; + amd64,dragonfly) profiling='true';; amd64,freebsd) profiling='true';; amd64,netbsd) profiling='true';; arm,netbsd) profiling='true';; amd64,gnu) profiling='true';; ++ arm64,freebsd) profiling='true';; + arm,freebsd) profiling='true';; arm,linux*) profiling='true';; power,elf) profiling='true';; power,bsd*) profiling='true';; @@ -2029,7 +2037,7 @@ MKLIB=${TOOLPREF}ar rc \$(1) \$(2); ${TOOLPREF}ranlib #ml Printf.sprintf "${TOOLPREF}ar rc %s %s %s && ${TOOLPREF}ranlib %s" #ml out opts files out;; EOF -config ARCH "$arch" +config SYSTEM_ARCH "$arch" config MODEL "$model" config SYSTEM "$system" config OCAMLOPT_CFLAGS "$common_cflags" @@ -2112,7 +2122,7 @@ config NATDYNLINK "$natdynlink" config CMXS "$cmxs" config MKEXE "$mkexe" config MKEXEDEBUGFLAG "$mkexedebugflag" -config MKDLL "$mksharedlib" +config MKDLL "$mksharedlib \$(LDFLAGS)" config MKMAINDLL "$mkmaindll" config RUNTIMED "${debugruntime}" config RUNTIMEI "${with_instrumented_runtime}"