Index: head/lang/ocaml/Makefile =================================================================== --- head/lang/ocaml/Makefile (revision 456401) +++ head/lang/ocaml/Makefile (revision 456402) @@ -1,168 +1,168 @@ # Created by: Kiriyama Kazuhiko # $FreeBSD$ # for committer: bump PORTREVISION for math/facile whenever ocaml gets updated PORTNAME= ocaml PORTVERSION= 4.02.3 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: No rule to make target aarch64.o, needed by libasmrun.a +BROKEN_aarch64= Does not build: sh: as: not found BROKEN_armv7= Does not build: hasgot.c: undefined reference to `tgetent' BROKEN_powerpc64= Does not build: error: too few arguments to function gethostbyname_r BROKEN_sparc64= ocamlc.opt seg-faults, please try to fix BROKEN_mips64= No ASM support BROKEN_mips= No ASM support USES= cpe gmake tar:xz USE_LDCONFIG= yes CPE_VENDOR= inria REINPLACE_ARGS= -i "" HAS_CONFIGURE= yes ALL_TARGET= world.opt STRIP= SSP_UNSAFE= yes MAKE_JOBS_UNSAFE= yes MAKE_ENV+= STAGEDIR="${STAGEDIR}" CONFIGURE_ARGS= -verbose -prefix "${PREFIX}" \ -cc "${CC} ${CFLAGS}" \ -as "${AS} ${ASFLAGS}" \ -aspp "${CC} -c" \ -partialld "${LD} -r" OPTIONS_DEFINE= X11 THREADS DOCS EXAMPLES OPTIONS_DEFAULT=X11 THREADS CMP_LIB_DESC= Install compiler libraries PORTDOCS= htmlman ${DOCSDISTNAME}-refman.ps.gz \ ${DOCSDISTNAME}-refman.pdf 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-[0-9]* .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" .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="" USE_XORG= x11 CONFLICTS+= ocaml-nox11-[0-9]* CONFIGURE_ARGS+=-x11include ${LOCALBASE}/include -x11lib ${LOCALBASE}/lib .else PLIST_SUB+= X11="@comment " SFX= -nox11 CONFLICTS+= ocaml-[0-9]* CONFIGURE_ARGS+=-no-graph .endif .include .include "${FILESDIR}/manfiles" .if defined(NO_PROFILE) || ${ARCH:Mpowerpc} || ${ARCH:Mamd64} PLIST_SUB+= PROF="@comment " .else PLIST_SUB+= PROF="" .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: # Don't hardcode GCC for depend target @${REINPLACE_CMD} \ -e '\|MKLIB=|s|ar rc|${AR} rc|' \ -e '\|RANLIB|s|ranlib|${RANLIB}|' \ -e '\|bytecclinkopts=|s|""|"${LDFLAGS}"|' \ -e "\|nativecclinkopts=|s|''|\"${LDFLAGS:C/-Wl,//}\"|" \ -e '\|mksharedlib=|s|$$bytecc|& $$bytecclinkopts|' \ -e 's|-lbfd -ldl|-lbfd $$dllib|' \ ${WRKSRC}/configure @${REINPLACE_CMD} -e 's,$$(ARCH),$$(SYSTEM_ARCH),' \ ${WRKSRC}/Makefile ${WRKSRC}/asmrun/Makefile \ ${WRKSRC}/otherlibs/systhreads/Makefile \ ${WRKSRC}/testsuite/makefiles/Makefile.common \ ${WRKSRC}/testsuite/tests/asmcomp/Makefile post-configure: # CFLAGS safeness @${REINPLACE_CMD} -E \ -e 's|(BYTECCCOMPOPTS[ \t]*=.*)|\1 ${CFLAGS}|' \ -e 's|(NATIVECCCOMPOPTS[ \t]*=.*)|\1 ${CFLAGS}|' \ -e '/^PTHREAD_LINK/s,-pthread,${THR_LD},g' \ ${WRKSRC}/config/Makefile # INSTALL* safeness (which preserves the correct permissions despite # user's umask(1) @${FIND} ${WRKDIR} -type f -name Makefile -print0 | \ ${XARGS} -0 -n 5 -x ${REINPLACE_CMD} -E \ -e 's,^(${PATTERN}+.*INSTALLDIR),\1\$${BSD_INSTALL_DATA} \4,' \ -e 's,^(${PATTERN}+.*BINDIR),\1\$${BSD_INSTALL_PROGRAM} \4,' \ -e 's,^(${PATTERN}+.*LIBDIR),\1\$${BSD_INSTALL_DATA} \4,' \ -e 's,(${PATTERN}+.*(MANDIR|MANODIR|MANEXT)),\1\$${BSD_INSTALL_MAN} \4,' 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 # Fix permissions for ld.conf @${CHMOD} 644 ${STAGEDIR}${PREFIX}/lib/ocaml/ld.conf .include Index: head/lang/ocaml/files/patch-configure =================================================================== --- head/lang/ocaml/files/patch-configure (revision 456401) +++ head/lang/ocaml/files/patch-configure (revision 456402) @@ -1,189 +1,204 @@ --- configure.orig 2015-05-12 14:46:37 UTC +++ configure @@ -446,7 +446,7 @@ esac # Configure compiler to use in further tests -cc="$bytecc -O $bytecclinkopts" +cc="$bytecc $bytecclinkopts" export cc cclibs verbose # Check C compiler @@ -688,9 +688,9 @@ if test $with_sharedlibs = "yes"; then mksharedlib="$flexlink" mkmaindll="$flexlink -maindll" shared_libraries_supported=true;; - *-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*|*-*-freebsd[1-9][0-9]*|*-*-openbsd*|*-*-netbsd*|*-*-gnu*|*-*-haiku*) + *-*-linux-gnu|*-*-linux|*-*-dragonfly*|*-*-freebsd[3-9]*|*-*-freebsd[1-9][0-9]*|*-*-openbsd*|*-*-netbsd*|*-*-gnu*|*-*-haiku*) sharedcccompopts="-fPIC" - mksharedlib="$bytecc -shared" + mksharedlib="$bytecc $bytecclinkopts $bytecclinkopts $bytecclinkopts -shared" bytecclinkopts="$bytecclinkopts -Wl,-E" byteccrpath="-Wl,-rpath," mksharedlibrpath="-Wl,-rpath," @@ -700,7 +700,7 @@ if test $with_sharedlibs = "yes"; then case "$bytecc" in *gcc*) sharedcccompopts="-fPIC" - mksharedlib="$bytecc -shared" + mksharedlib="$bytecc $bytecclinkopts $bytecclinkopts $bytecclinkopts -shared" byteccrpath="-Wl,-rpath," mksharedlibrpath="-Wl,-rpath," shared_libraries_supported=true;; @@ -716,11 +716,11 @@ if test $with_sharedlibs = "yes"; then *gcc*) sharedcccompopts="-fPIC" if sh ./solaris-ld; then - mksharedlib="$bytecc -shared" + mksharedlib="$bytecc $bytecclinkopts $bytecclinkopts $bytecclinkopts -shared" byteccrpath="-R" mksharedlibrpath="-R" else - mksharedlib="$bytecc -shared" + mksharedlib="$bytecc $bytecclinkopts $bytecclinkopts $bytecclinkopts -shared" bytecclinkopts="$bytecclinkopts -Wl,-E" natdynlinkopts="-Wl,-E" byteccrpath="-Wl,-rpath," @@ -744,12 +744,12 @@ if test $with_sharedlibs = "yes"; then mksharedlibrpath="-rpath " shared_libraries_supported=true;; i[3456]86-*-darwin[89].*) - mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress -read_only_relocs suppress" + mksharedlib="$bytecc $bytecclinkopts $bytecclinkopts $bytecclinkopts -bundle -flat_namespace -undefined suppress -read_only_relocs suppress" bytecccompopts="$dl_defs $bytecccompopts" dl_needs_underscore=false shared_libraries_supported=true;; *-apple-darwin*) - mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress -Wl,-no_compact_unwind" + mksharedlib="$bytecc $bytecclinkopts $bytecclinkopts $bytecclinkopts -bundle -flat_namespace -undefined suppress -Wl,-no_compact_unwind" bytecccompopts="$dl_defs $bytecccompopts" dl_needs_underscore=false shared_libraries_supported=true;; @@ -759,7 +759,7 @@ if test $with_sharedlibs = "yes"; then shared_libraries_supported=false;; *-*-openbsd*) sharedcccompopts="-fPIC" - mksharedlib="$bytecc -shared" + mksharedlib="$bytecc $bytecclinkopts $bytecclinkopts $bytecclinkopts -shared" bytecclinkopts="$bytecclinkopts -Wl,-E" natdynlinkopts="-Wl,-E" byteccrpath="-Wl,-rpath," @@ -790,9 +790,11 @@ if test $with_sharedlibs = "yes"; then fi;; x86_64-*-darwin*) natdynlink=true;; powerpc*-*-linux*) natdynlink=true;; + powerpc*-*-freebsd*) natdynlink=true;; sparc*-*-linux*) natdynlink=true;; i686-*-kfreebsd*) natdynlink=true;; x86_64-*-kfreebsd*) natdynlink=true;; + x86_64-*-dragonfly*) natdynlink=true;; i[3456]86-*-freebsd*) natdynlink=true;; x86_64-*-freebsd*) natdynlink=true;; i[3456]86-*-openbsd*) natdynlink=true;; -@@ -844,6 +846,7 @@ case "$target" in +@@ -804,6 +806,7 @@ if test $with_sharedlibs = "yes"; then + arm*-*-linux*) natdynlink=true;; + arm*-*-freebsd*) natdynlink=true;; + aarch64-*-linux*) natdynlink=true;; ++ aarch64-*-freebsd*) natdynlink=true;; + esac + fi + +@@ -844,6 +847,7 @@ case "$target" in i[3456]86-*-gnu*) arch=i386; system=gnu;; i[3456]86-*-mingw*) arch=i386; system=mingw;; powerpc*-*-linux*) arch=power; model=ppc; system=elf;; + powerpc-*-freebsd*) arch=power; model=ppc; system=bsd_elf;; powerpc-*-netbsd*) arch=power; model=ppc; system=elf;; powerpc-*-openbsd*) arch=power; model=ppc; system=bsd_elf;; powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;; -@@ -862,6 +865,7 @@ case "$target" in +@@ -862,12 +866,14 @@ case "$target" in zaurus*-*-openbsd*) arch=arm; system=bsd;; x86_64-*-linux*) arch=amd64; system=linux;; x86_64-*-gnu*) arch=amd64; system=gnu;; + x86_64-*-dragonfly*) arch=amd64; system=dragonfly;; x86_64-*-freebsd*) arch=amd64; system=freebsd;; x86_64-*-netbsd*) arch=amd64; system=netbsd;; x86_64-*-openbsd*) arch=amd64; system=openbsd;; -@@ -889,7 +893,7 @@ else + 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 + +@@ -889,7 +895,7 @@ else fi nativecccompopts='' -nativecclinkopts='' +nativecclinkopts="" # FIXME the naming of nativecclinkopts is broken: these are options for # ld (for shared libs), not for cc nativeccrpath="$byteccrpath" -@@ -932,6 +936,8 @@ case "$arch,$system" in +@@ -932,6 +938,8 @@ case "$arch,$system" in esac;; arm,freebsd) as="${TOOLPREF}cc -c" aspp="${TOOLPREF}cc -c";; + *,dragonfly) as="${TOOLPREF}as" + aspp="${TOOLPREF}cc -c";; *,freebsd) as="${TOOLPREF}as" aspp="${TOOLPREF}cc -c";; amd64,*|arm,*|arm64,*|i386,*|power,bsd*|sparc,*) -@@ -955,9 +961,11 @@ case "$arch,$system" in +@@ -955,9 +963,11 @@ case "$arch,$system" in case "$nativecc" in gcc*) ;; *) cc_profile='-xpg';; esac;; amd64,linux) profiling='prof';; amd64,openbsd) profiling='prof';; + amd64,dragonfly) profiling='prof';; amd64,freebsd) profiling='prof';; amd64,netbsd) profiling='prof';; amd64,gnu) profiling='prof';; + arm,freebsd) profiling='prof';; arm,linux*) profiling='prof';; power,elf) profiling='prof';; power,bsd*) profiling='prof';; -@@ -1415,6 +1423,8 @@ if test "$pthread_wanted" = "yes"; then +@@ -1415,6 +1425,8 @@ if test "$pthread_wanted" = "yes"; then case "$target" in *-*-solaris*) pthread_link="-lpthread -lposix4" pthread_caml_link="-cclib -lpthread -cclib -lposix4";; + *-*-dragon*) pthread_link="-pthread" + pthread_caml_link="-cclib -pthread";; *-*-freebsd*) pthread_link="-pthread" pthread_caml_link="-cclib -pthread";; *-*-openbsd*) pthread_link="-pthread" -@@ -1431,7 +1441,7 @@ if test "$pthread_wanted" = "yes"; then +@@ -1431,7 +1443,7 @@ if test "$pthread_wanted" = "yes"; then bytecccompopts="$bytecccompopts -D_REENTRANT" nativecccompopts="$nativecccompopts -D_REENTRANT" case "$target" in - *-*-freebsd*) + *-*-freebsd*|*-*-dragonfly*) bytecccompopts="$bytecccompopts -D_THREAD_SAFE" nativecccompopts="$nativecccompopts -D_THREAD_SAFE";; *-*-openbsd*) -@@ -1601,6 +1611,7 @@ if test "$x11_include" = "not found"; th +@@ -1601,6 +1613,7 @@ if test "$x11_include" = "not found"; then else x11_libs="-L$dir" case "$target" in + *-*-freebsd*|*-*-dragonfly*) x11_link="-L$dir -lX11";; *-kfreebsd*-gnu) x11_link="-L$dir -lX11";; *-*-*bsd*) x11_link="-R$dir -L$dir -lX11";; *) x11_link="-L$dir -lX11";; -@@ -1644,10 +1655,10 @@ echo "X11_LINK=$x11_link" >> Makefile +@@ -1644,10 +1657,10 @@ echo "X11_LINK=$x11_link" >> Makefile # Look for BFD library if sh ./hasgot -DPACKAGE=ocaml -i bfd.h && \ - sh ./hasgot -DPACKAGE=ocaml -lbfd -ldl -liberty -lz bfd_openr; then + sh ./hasgot -DPACKAGE=ocaml -lbfd $dllib -liberty -lz bfd_openr; then inf "BFD library found." echo "#define HAS_LIBBFD" >> s.h - echo "LIBBFD_LINK=-lbfd -ldl -liberty -lz" >> Makefile + echo "LIBBFD_LINK=-lbfd $dllib -liberty -lz" >> Makefile else wrn "BFD library not found, 'objinfo' will be unable to display info on .cmxs files." echo "LIBBFD_LINK=" >> Makefile -@@ -1686,12 +1697,6 @@ if $no_naked_pointers; then +@@ -1686,12 +1699,6 @@ if $no_naked_pointers; then echo "#define NO_NAKED_POINTERS" >> m.h fi -# Add Unix-style optimization flag -bytecccompopts="-O $bytecccompopts" -dllcccompopts="-O $dllcccompopts" -nativecccompopts="-O $nativecccompopts" -sharedcccompopts="-O $sharedcccompopts" - # Final twiddling of compiler options to work around known bugs nativeccprofopts="$nativecccompopts" -@@ -1723,7 +1728,7 @@ SYSLIB=-l\$(1) +@@ -1723,7 +1730,7 @@ SYSLIB=-l\$(1) MKLIB=${TOOLPREF}ar rc \$(1) \$(2); ${TOOLPREF}ranlib \$(1) #ml let mklib out files opts = Printf.sprintf "${TOOLPREF}ar rc %s %s %s; ${TOOLPREF}ranlib %s" out opts files out;; EOF -echo "ARCH=$arch" >> Makefile +echo "SYSTEM_ARCH=$arch" >> Makefile echo "MODEL=$model" >> Makefile echo "SYSTEM=$system" >> Makefile echo "NATIVECC=$nativecc" >> Makefile