lang/ocaml: Fix NO_PROFILE setting and native compiler for DragonFly

The ocaml port was not respecting a NO_PROFILE definition in make.conf,
which causes a stage check failure (missing files) if it is set. Improve
that logic and patch the configure script in numerous places to support
building the native code compiler on DragonFly.  This is one of those
famous ports that think all BSDs have the pattern "bsd" in their target
triplet.

Continued under PR: ports/188158
This commit is contained in:
John Marino 2014-05-07 08:27:28 +00:00
parent becbea3e90
commit c1d7b20915
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=353142
2 changed files with 88 additions and 14 deletions

View file

@ -110,7 +110,7 @@ CONFIGURE_ARGS+=-no-tk
OCAML_ARCH= ${ARCH:S/x86_64/amd64/:S/powerpc/power/}
.if ${OCAML_ARCH} == power
.if defined(NO_PROFILE) || ${OCAML_ARCH} == power || ${OPSYS} == DragonFly
PLIST_SUB+= PROF="@comment "
.else
PLIST_SUB+= PROF=""

View file

@ -1,15 +1,19 @@
--- configure.orig 2013-08-23 08:22:36.000000000 +0200
+++ configure 2014-04-26 14:15:43.000000000 +0200
@@ -547,7 +547,7 @@
--- configure.orig 2013-08-23 06:22:36.000000000 +0000
+++ configure
@@ -545,9 +545,10 @@ if test $withsharedlibs = "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*)
- *-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*|*-*-freebsd[1-9][0-9]*|*-*-openbsd*|*-*-netbsd*|*-*-gnu*)
+ *-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*|*-*-freebsd[1-9][0-9]*| \
+ *-*-dragonfly*|*-*-openbsd*|*-*-netbsd*|*-*-gnu*)
sharedcccompopts="-fPIC"
- mksharedlib="$bytecc -shared"
+ mksharedlib="$bytecc $bytecclinkopts -shared"
bytecclinkopts="$bytecclinkopts -Wl,-E"
byteccrpath="-Wl,-rpath,"
mksharedlibrpath="-Wl,-rpath,"
@@ -557,7 +557,7 @@
@@ -557,7 +558,7 @@ if test $withsharedlibs = "yes"; then
case "$bytecc" in
gcc*)
sharedcccompopts="-fPIC"
@ -18,7 +22,7 @@
byteccrpath="-Wl,-rpath,"
mksharedlibrpath="-Wl,-rpath,"
shared_libraries_supported=true;;
@@ -573,11 +573,11 @@
@@ -573,11 +574,11 @@ if test $withsharedlibs = "yes"; then
gcc*)
sharedcccompopts="-fPIC"
if sh ./solaris-ld; then
@ -32,7 +36,7 @@
bytecclinkopts="$bytecclinkopts -Wl,-E"
natdynlinkopts="-Wl,-E"
byteccrpath="-Wl,-rpath,"
@@ -601,12 +601,12 @@
@@ -601,12 +602,12 @@ if test $withsharedlibs = "yes"; then
mksharedlibrpath="-rpath "
shared_libraries_supported=true;;
i[3456]86-*-darwin[89].*)
@ -47,7 +51,7 @@
bytecccompopts="$dl_defs $bytecccompopts"
dl_needs_underscore=false
shared_libraries_supported=true;;
@@ -616,7 +616,7 @@
@@ -616,7 +617,7 @@ if test $withsharedlibs = "yes"; then
shared_libraries_supported=false;;
*-*-openbsd*)
sharedcccompopts="-fPIC"
@ -56,7 +60,24 @@
bytecclinkopts="$bytecclinkopts -Wl,-E"
natdynlinkopts="-Wl,-E"
byteccrpath="-Wl,-rpath,"
@@ -695,6 +695,7 @@
@@ -651,6 +652,8 @@ if test $withsharedlibs = "yes"; then
x86_64-*-kfreebsd*) natdynlink=true;;
i[345]86-*-freebsd*) natdynlink=true;;
x86_64-*-freebsd*) natdynlink=true;;
+ i[345]86-*-dragonfly*) natdynlink=true;;
+ x86_64-*-dragonfly*) natdynlink=true;;
i[345]86-*-openbsd*) natdynlink=true;;
x86_64-*-openbsd*) natdynlink=true;;
i[345]86-*-netbsd*) natdynlink=true;;
@@ -680,6 +683,7 @@ case "$host" in
sparc*-*-gnu*) arch=sparc; system=gnu;;
i[3456]86-*-linux*) arch=i386; system=linux_`sh ./runtest elf.c`;;
i[3456]86-*-*bsd*) arch=i386; system=bsd_`sh ./runtest elf.c`;;
+ i[3456]86-*-dragonfly*) arch=i386; system=bsd_elf;;
i[3456]86-*-nextstep*) arch=i386; system=nextstep;;
i[3456]86-*-solaris*) if $arch64; then
arch=amd64; system=solaris
@@ -695,6 +699,7 @@ case "$host" in
fi;;
i[3456]86-*-gnu*) arch=i386; system=gnu;;
powerpc*-*-linux*) arch=power; model=ppc; system=elf;;
@ -64,7 +85,15 @@
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;;
@@ -734,7 +735,7 @@
@@ -714,6 +719,7 @@ case "$host" in
x86_64-*-netbsd*) arch=amd64; system=netbsd;;
x86_64-*-openbsd*) arch=amd64; system=openbsd;;
x86_64-*-darwin*) arch=amd64; system=macosx;;
+ x86_64-*-dragonfly*) arch=amd64; system=dragonfly;;
esac
# Some platforms exist both in 32-bit and 64-bit variants, not distinguished
@@ -734,7 +740,7 @@ else
fi
nativecccompopts=''
@ -73,15 +102,34 @@
# FIXME the naming of nativecclinkopts is broken: these are options for
# ld (for shared libs), not for cc
nativeccrpath="$byteccrpath"
@@ -803,6 +804,7 @@
@@ -803,6 +809,8 @@ case "$arch,$model,$system" in
amd64,*,linux) profiling='prof';;
amd64,*,gnu) profiling='prof';;
arm,*,linux*) profiling='prof';;
+ *,*,freebsd) profiling='prof';;
+ *,*,dragonfly) profiling='prof';;
*) profiling='noprof';;
esac
@@ -1388,7 +1390,6 @@
@@ -1204,7 +1212,7 @@ if test "$pthread_wanted" = "yes"; then
case "$host" in
*-*-solaris*) pthread_link="-lpthread -lposix4"
pthread_caml_link="-cclib -lpthread -cclib -lposix4";;
- *-*-freebsd*) pthread_link="-pthread"
+ *-*-freebsd*|*-*-dragonfly*) pthread_link="-pthread"
pthread_caml_link="-cclib -pthread";;
*-*-openbsd*) pthread_link="-pthread"
pthread_caml_link="-cclib -pthread";;
@@ -1218,7 +1226,7 @@ if test "$pthread_wanted" = "yes"; then
bytecccompopts="$bytecccompopts -D_REENTRANT"
nativecccompopts="$nativecccompopts -D_REENTRANT"
case "$host" in
- *-*-freebsd*)
+ *-*-freebsd*|*-*-dragonfly*)
bytecccompopts="$bytecccompopts -D_THREAD_SAFE"
nativecccompopts="$nativecccompopts -D_THREAD_SAFE";;
*-*-openbsd*)
@@ -1388,7 +1396,6 @@ if test "$x11_include" = "not found"; th
x11_libs="-L$dir"
case "$host" in
*-kfreebsd*-gnu) x11_link="-L$dir -lX11";;
@ -89,7 +137,33 @@
*) x11_link="-L$dir -lX11";;
esac
fi
@@ -1564,10 +1565,10 @@
@@ -1514,7 +1521,7 @@ if test $has_tk = true; then
Tcl_DoOneEvent
then
case "$host" in
- *-*-*bsd*) tk_libs="-R/usr/pkg/lib -L/usr/pkg/lib $tk_libs $tk_x11_libs -ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin -lpthread $tkauxlibs";;
+ *-*-*bsd*|*-*-dragonfly*) tk_libs="-R/usr/pkg/lib -L/usr/pkg/lib $tk_libs $tk_x11_libs -ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin -lpthread $tkauxlibs";;
*) tk_libs="-L/usr/pkg/lib $tk_libs $tk_x11_libs -ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin -lpthread $tkauxlibs";;
esac
else
@@ -1528,14 +1535,14 @@ if test $has_tk = true; then
echo "Tcl/Tk libraries found."
elif sh ./hasgot -L/sw/lib $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
case "$host" in
- *-*-*bsd*) tk_libs="-R/sw/lib -L/sw/lib $tk_libs";;
+ *-*-*bsd*|*-*-dragonfly*) tk_libs="-R/sw/lib -L/sw/lib $tk_libs";;
*) tk_libs="-L/sw/lib $tk_libs";;
esac
echo "Tcl/Tk libraries found."
elif sh ./hasgot -L/usr/pkg/lib $tk_libs $tk_x11_libs $tkauxlibs \
Tk_SetGrid; then
case "$host" in
- *-*-*bsd*) tk_libs="-R/usr/pkg/lib -L/usr/pkg/lib $tk_libs";;
+ *-*-*bsd*|*-*-dragonfly*) tk_libs="-R/usr/pkg/lib -L/usr/pkg/lib $tk_libs";;
*) tk_libs="-L/usr/pkg/lib $tk_libs";;
esac
echo "Tcl/Tk libraries found."
@@ -1564,10 +1571,10 @@ fi
# Look for BFD library
if ./hasgot -i bfd.h && \