freebsd-ports/lang/ocaml/files/patch-configure
Piotr Kubaj 3aaf31100b lang/ocaml: fix build on powerpc64le
Use GCC, like on powerpc64 and add powerpc64le entry to configure script.

Approved by:    tier 2 blanket
2021-01-03 14:34:33 +00:00

85 lines
4 KiB
Text

--- configure.orig 2017-07-13 08:56:44 UTC
+++ configure
@@ -806,7 +806,7 @@ if test $with_sharedlibs = "yes"; then
*-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*|*-*-freebsd[1-9][0-9]*\
|*-*-openbsd*|*-*-netbsd*|*-*-dragonfly*|*-*-gnu*|*-*-haiku*)
sharedcccompopts="-fPIC"
- mksharedlib="$bytecc -shared"
+ mksharedlib="$bytecc $bytecclinkopts -shared"
bytecclinkopts="$bytecclinkopts -Wl,-E"
byteccrpath="-Wl,-rpath,"
mksharedlibrpath="-Wl,-rpath,"
@@ -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;;
sparc*-*-linux*) natdynlink=true;;
i686-*-kfreebsd*) natdynlink=true;;
x86_64-*-kfreebsd*) 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=elf;;
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;;
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';;
+ arm,freebsd) profiling='true';;
arm,linux*) profiling='true';;
power,elf) profiling='true';;
power,bsd*) profiling='true';;
@@ -1168,7 +1178,7 @@ fi
if test "$with_curses" = "yes"; then
for libs in "" "-lcurses" "-ltermcap" "-lcurses -ltermcap" "-lncurses"; do
- if sh ./hasgot $libs tgetent tgetstr tgetnum tputs; then
+ if sh ./hasgot -i term.h $libs tgetent tgetstr tgetnum tputs; then
inf "termcap functions found (with libraries '$libs')"
echo "#define HAS_TERMCAP" >> s.h
curseslibs="${libs}"
@@ -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
-echo "ARCH=$arch" >> Makefile
+echo "SYSTEM_ARCH=$arch" >> Makefile
echo "MODEL=$model" >> Makefile
echo "SYSTEM=$system" >> Makefile
echo "NATIVECC=$nativecc $nativecccompopts" >> Makefile