Changeset View
Changeset View
Standalone View
Standalone View
lang/ocaml/files/patch-configure
- This file was added.
--- configure.orig 2015-05-12 14:46:37 UTC | --- configure.orig 2019-02-27 02:14:29 UTC | ||||
+++ configure | +++ configure | ||||
@@ -446,7 +446,7 @@ esac | @@ -913,6 +913,7 @@ if $with_sharedlibs; then | ||||
# 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 -shared" | |||||
bytecclinkopts="$bytecclinkopts -Wl,-E" | |||||
byteccrpath="-Wl,-rpath," | |||||
mksharedlibrpath="-Wl,-rpath," | |||||
@@ -790,9 +790,11 @@ if test $with_sharedlibs = "yes"; then | |||||
fi;; | |||||
x86_64-*-darwin*) natdynlink=true;; | x86_64-*-darwin*) natdynlink=true;; | ||||
s390x*-*-linux*) natdynlink=true;; | |||||
powerpc*-*-linux*) natdynlink=true;; | powerpc*-*-linux*) natdynlink=true;; | ||||
+ powerpc*-*-freebsd*) natdynlink=true;; | + powerpc*-*-freebsd*) natdynlink=true;; | ||||
sparc*-*-linux*) natdynlink=true;; | |||||
i686-*-kfreebsd*) natdynlink=true;; | i686-*-kfreebsd*) natdynlink=true;; | ||||
x86_64-*-kfreebsd*) natdynlink=true;; | x86_64-*-kfreebsd*) natdynlink=true;; | ||||
+ x86_64-*-dragonfly*) natdynlink=true;; | x86_64-*-dragonfly*) natdynlink=true;; | ||||
i[3456]86-*-freebsd*) natdynlink=true;; | @@ -928,6 +929,7 @@ if $with_sharedlibs; then | ||||
x86_64-*-freebsd*) natdynlink=true;; | |||||
i[3456]86-*-openbsd*) natdynlink=true;; | |||||
@@ -804,6 +806,7 @@ if test $with_sharedlibs = "yes"; then | |||||
arm*-*-linux*) natdynlink=true;; | |||||
arm*-*-freebsd*) natdynlink=true;; | arm*-*-freebsd*) natdynlink=true;; | ||||
earm*-*-netbsd*) natdynlink=true;; | |||||
aarch64-*-linux*) natdynlink=true;; | aarch64-*-linux*) natdynlink=true;; | ||||
+ aarch64-*-freebsd*) natdynlink=true;; | + aarch64-*-freebsd*) natdynlink=true;; | ||||
esac | esac | ||||
fi | fi | ||||
@@ -844,6 +847,7 @@ case "$target" in | @@ -976,6 +978,8 @@ case "$target" in | ||||
i[3456]86-*-gnu*) arch=i386; system=gnu;; | powerpc*-*-linux*) arch=power; | ||||
i[3456]86-*-mingw*) arch=i386; system=mingw;; | if $arch64; then model=ppc64; else model=ppc; fi | ||||
powerpc*-*-linux*) arch=power; model=ppc; system=elf;; | system=elf;; | ||||
+ powerpc-*-freebsd*) arch=power; model=ppc; system=bsd_elf;; | + powerpc-*-freebsd*) arch=power; model=ppc; system=bsd_elf;; | ||||
powerpc-*-netbsd*) arch=power; model=ppc; system=elf;; | + powerpc64-*-freebsd*) arch=power; model=ppc64; system=bsd_elf;; | ||||
powerpc-*-netbsd*) arch=power; model=ppc; system=netbsd;; | |||||
powerpc-*-openbsd*) arch=power; model=ppc; system=bsd_elf;; | powerpc-*-openbsd*) arch=power; model=ppc; system=bsd_elf;; | ||||
powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;; | s390x*-*-linux*) arch=s390x; model=z10; system=elf;; | ||||
@@ -862,12 +866,14 @@ case "$target" in | @@ -987,6 +991,7 @@ case "$target" in | ||||
zaurus*-*-openbsd*) arch=arm; system=bsd;; | armv6t2*-*-linux-gnueabi) arch=arm; model=armv6t2; system=linux_eabi;; | ||||
x86_64-*-linux*) arch=amd64; system=linux;; | armv6*-*-linux-gnueabi) arch=arm; model=armv6; system=linux_eabi;; | ||||
x86_64-*-gnu*) arch=amd64; system=gnu;; | armv6*-*-freebsd*) arch=arm; model=armv6; system=freebsd;; | ||||
+ x86_64-*-dragonfly*) arch=amd64; system=dragonfly;; | + armv7*-*-freebsd*) arch=arm; model=armv7; system=freebsd;; | ||||
x86_64-*-freebsd*) arch=amd64; system=freebsd;; | earmv6*-*-netbsd*) arch=arm; model=armv6; system=netbsd;; | ||||
x86_64-*-netbsd*) arch=amd64; system=netbsd;; | earmv7*-*-netbsd*) arch=arm; model=armv7; system=netbsd;; | ||||
x86_64-*-openbsd*) arch=amd64; system=openbsd;; | armv5te*-*-linux-gnueabi) arch=arm; model=armv5te; system=linux_eabi;; | ||||
@@ -1003,6 +1008,7 @@ case "$target" in | |||||
x86_64-*-darwin*) arch=amd64; system=macosx;; | x86_64-*-darwin*) arch=amd64; system=macosx;; | ||||
x86_64-*-mingw*) arch=amd64; system=mingw;; | x86_64-*-mingw*) arch=amd64; system=mingw;; | ||||
aarch64-*-linux*) arch=arm64; system=linux;; | aarch64-*-linux*) arch=arm64; system=linux;; | ||||
+ aarch64-*-freebsd*) arch=arm64; system=freebsd;; | + aarch64-*-freebsd*) arch=arm64; system=freebsd;; | ||||
x86_64-*-cygwin*) arch=amd64; system=cygwin;; | x86_64-*-cygwin*) arch=amd64; system=cygwin;; | ||||
esac | 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 +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 +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 +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 +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 +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 +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 +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" | |||||
@@ -1701,6 +1708,11 @@ case "$buggycc" in | |||||
nativecccompopts="$nativecccompopts -fomit-frame-pointer";; | |||||
esac | |||||
+# Allow user-defined C compiler flags | |||||
+ | |||||
+bytecccompopts="$bytecccompopts $CFLAGS" | |||||
+nativecccompopts="$nativecccompopts $CFLAGS" | |||||
+ | |||||
# Finish generated files | |||||
cclibs="$cclibs $mathlib" | |||||
@@ -1723,7 +1735,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 |