configure: add --target and use "target" instead of "host" for variables
(Patch by Adrien Nader!) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13853 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
9111707486
commit
feac346c2f
|
@ -20,6 +20,7 @@ libdir=''
|
||||||
mandir=''
|
mandir=''
|
||||||
manext=1
|
manext=1
|
||||||
host_type=unknown
|
host_type=unknown
|
||||||
|
target_type=""
|
||||||
ccoption=''
|
ccoption=''
|
||||||
asoption=''
|
asoption=''
|
||||||
asppoption=''
|
asppoption=''
|
||||||
|
@ -108,6 +109,8 @@ while : ; do
|
||||||
shift;;
|
shift;;
|
||||||
-host*|--host*)
|
-host*|--host*)
|
||||||
host_type=$2; shift;;
|
host_type=$2; shift;;
|
||||||
|
-target*|--target*)
|
||||||
|
target_type=$2; shift;;
|
||||||
-cc*)
|
-cc*)
|
||||||
ccoption="$2"; shift;;
|
ccoption="$2"; shift;;
|
||||||
-as)
|
-as)
|
||||||
|
@ -222,7 +225,14 @@ fi
|
||||||
if host=`../gnu/config.sub $host_type`; then :; else
|
if host=`../gnu/config.sub $host_type`; then :; else
|
||||||
err "Please specify the correct host type with the -host option"
|
err "Please specify the correct host type with the -host option"
|
||||||
fi
|
fi
|
||||||
inf "Configuring for a $host ..."
|
inf "Configuring for host $host ..."
|
||||||
|
|
||||||
|
if test -n "$target_type"; then
|
||||||
|
target="$target_type"
|
||||||
|
else
|
||||||
|
target="$host"
|
||||||
|
fi
|
||||||
|
inf "Configuring for target $target ..."
|
||||||
|
|
||||||
# Do we have gcc?
|
# Do we have gcc?
|
||||||
|
|
||||||
|
@ -241,7 +251,7 @@ fi
|
||||||
|
|
||||||
buggycc="no"
|
buggycc="no"
|
||||||
|
|
||||||
case "$host,$cc" in
|
case "$target,$cc" in
|
||||||
i[3456]86-*-*,gcc*)
|
i[3456]86-*-*,gcc*)
|
||||||
case `$cc --version` in
|
case `$cc --version` in
|
||||||
2.7.2.1) cat <<'EOF'
|
2.7.2.1) cat <<'EOF'
|
||||||
|
@ -292,7 +302,7 @@ ostype="Unix"
|
||||||
exe=""
|
exe=""
|
||||||
iflexdir=""
|
iflexdir=""
|
||||||
|
|
||||||
case "$bytecc,$host" in
|
case "$bytecc,$target" in
|
||||||
cc,*-*-nextstep*)
|
cc,*-*-nextstep*)
|
||||||
# GNU C extensions disabled, but __GNUC__ still defined!
|
# GNU C extensions disabled, but __GNUC__ still defined!
|
||||||
bytecccompopts="-fno-defer-pop $gcc_warnings -U__GNUC__ -posix"
|
bytecccompopts="-fno-defer-pop $gcc_warnings -U__GNUC__ -posix"
|
||||||
|
@ -500,7 +510,7 @@ esac
|
||||||
|
|
||||||
# Determine alignment constraints
|
# Determine alignment constraints
|
||||||
|
|
||||||
case "$host" in
|
case "$target" in
|
||||||
sparc*-*-*|hppa*-*-*|arm*-*-*|mips*-*-*)
|
sparc*-*-*|hppa*-*-*|arm*-*-*|mips*-*-*)
|
||||||
# On Sparc V9 with certain versions of gcc, determination of double
|
# On Sparc V9 with certain versions of gcc, determination of double
|
||||||
# alignment is not reliable (PR#1521), hence force it.
|
# alignment is not reliable (PR#1521), hence force it.
|
||||||
|
@ -533,7 +543,7 @@ case "$host" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if $int64_native; then
|
if $int64_native; then
|
||||||
case "$host" in
|
case "$target" in
|
||||||
# PR#5088: autodetection is unreliable on ARM. PR#5280: also on MIPS.
|
# PR#5088: autodetection is unreliable on ARM. PR#5280: also on MIPS.
|
||||||
sparc*-*-*|hppa*-*-*|arm*-*-*|mips*-*-*)
|
sparc*-*-*|hppa*-*-*|arm*-*-*|mips*-*-*)
|
||||||
if test $2 = 8; then
|
if test $2 = 8; then
|
||||||
|
@ -584,7 +594,7 @@ mksharedlibrpath=''
|
||||||
natdynlinkopts=""
|
natdynlinkopts=""
|
||||||
|
|
||||||
if test $withsharedlibs = "yes"; then
|
if test $withsharedlibs = "yes"; then
|
||||||
case "$host" in
|
case "$target" in
|
||||||
*-*-cygwin*)
|
*-*-cygwin*)
|
||||||
mksharedlib="$flexlink"
|
mksharedlib="$flexlink"
|
||||||
mkmaindll="$flexlink -maindll"
|
mkmaindll="$flexlink -maindll"
|
||||||
|
@ -678,7 +688,7 @@ fi
|
||||||
natdynlink=false
|
natdynlink=false
|
||||||
|
|
||||||
if test $withsharedlibs = "yes"; then
|
if test $withsharedlibs = "yes"; then
|
||||||
case "$host" in
|
case "$target" in
|
||||||
*-*-cygwin*) natdynlink=true;;
|
*-*-cygwin*) natdynlink=true;;
|
||||||
i[3456]86-*-linux*) natdynlink=true;;
|
i[3456]86-*-linux*) natdynlink=true;;
|
||||||
i[3456]86-*-gnu*) natdynlink=true;;
|
i[3456]86-*-gnu*) natdynlink=true;;
|
||||||
|
@ -717,7 +727,7 @@ arch=none
|
||||||
model=default
|
model=default
|
||||||
system=unknown
|
system=unknown
|
||||||
|
|
||||||
case "$host" in
|
case "$target" in
|
||||||
sparc*-*-solaris2.*) arch=sparc; system=solaris;;
|
sparc*-*-solaris2.*) arch=sparc; system=solaris;;
|
||||||
sparc*-*-*bsd*) arch=sparc; system=bsd;;
|
sparc*-*-*bsd*) arch=sparc; system=bsd;;
|
||||||
sparc*-*-linux*) arch=sparc; system=linux;;
|
sparc*-*-linux*) arch=sparc; system=linux;;
|
||||||
|
@ -761,7 +771,7 @@ case "$host" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Some platforms exist both in 32-bit and 64-bit variants, not distinguished
|
# Some platforms exist both in 32-bit and 64-bit variants, not distinguished
|
||||||
# by $host. Turn off native code compilation on platforms where 64-bit mode
|
# by $target. Turn off native code compilation on platforms where 64-bit mode
|
||||||
# is not supported. (PR#4441)
|
# is not supported. (PR#4441)
|
||||||
|
|
||||||
if $arch64; then
|
if $arch64; then
|
||||||
|
@ -783,7 +793,7 @@ nativecclinkopts=''
|
||||||
# ld (for shared libs), not for cc
|
# ld (for shared libs), not for cc
|
||||||
nativeccrpath="$byteccrpath"
|
nativeccrpath="$byteccrpath"
|
||||||
|
|
||||||
case "$arch,$nativecc,$system,$host_type" in
|
case "$arch,$nativecc,$system,$target" in
|
||||||
*,*,nextstep,*) nativecccompopts="$gcc_warnings -U__GNUC__ -posix"
|
*,*,nextstep,*) nativecccompopts="$gcc_warnings -U__GNUC__ -posix"
|
||||||
nativecclinkopts="-posix";;
|
nativecclinkopts="-posix";;
|
||||||
*,*,rhapsody,*darwin[1-5].*)
|
*,*,rhapsody,*darwin[1-5].*)
|
||||||
|
@ -869,7 +879,7 @@ echo "ARCMD=ar" >> Makefile
|
||||||
|
|
||||||
if (SHELL=/bin/sh; export SHELL; (./sharpbang || ./sharpbang2) >/dev/null); then
|
if (SHELL=/bin/sh; export SHELL; (./sharpbang || ./sharpbang2) >/dev/null); then
|
||||||
inf "#! appears to work in shell scripts."
|
inf "#! appears to work in shell scripts."
|
||||||
case "$host" in
|
case "$target" in
|
||||||
*-*-sunos*|*-*-unicos*)
|
*-*-sunos*|*-*-unicos*)
|
||||||
wrn "We won't use it, though, because under SunOS and Unicos it breaks " \
|
wrn "We won't use it, though, because under SunOS and Unicos it breaks " \
|
||||||
"on pathnames longer than 30 characters"
|
"on pathnames longer than 30 characters"
|
||||||
|
@ -1139,7 +1149,7 @@ if sh ./hasgot mktime; then
|
||||||
echo "#define HAS_MKTIME" >> s.h
|
echo "#define HAS_MKTIME" >> s.h
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$host" in
|
case "$target" in
|
||||||
*-*-cygwin*) ;; # setsid emulation under Cygwin breaks the debugger
|
*-*-cygwin*) ;; # setsid emulation under Cygwin breaks the debugger
|
||||||
*) if sh ./hasgot setsid; then
|
*) if sh ./hasgot setsid; then
|
||||||
inf "setsid() found."
|
inf "setsid() found."
|
||||||
|
@ -1245,7 +1255,7 @@ echo "BNG_ASM_LEVEL=$bng_asm_level" >> Makefile
|
||||||
systhread_support=false
|
systhread_support=false
|
||||||
|
|
||||||
if test "$pthread_wanted" = "yes"; then
|
if test "$pthread_wanted" = "yes"; then
|
||||||
case "$host" in
|
case "$target" in
|
||||||
*-*-solaris*) pthread_link="-lpthread -lposix4"
|
*-*-solaris*) pthread_link="-lpthread -lposix4"
|
||||||
pthread_caml_link="-cclib -lpthread -cclib -lposix4";;
|
pthread_caml_link="-cclib -lpthread -cclib -lposix4";;
|
||||||
*-*-freebsd*) pthread_link="-pthread"
|
*-*-freebsd*) pthread_link="-pthread"
|
||||||
|
@ -1261,7 +1271,7 @@ if test "$pthread_wanted" = "yes"; then
|
||||||
otherlibraries="$otherlibraries systhreads"
|
otherlibraries="$otherlibraries systhreads"
|
||||||
bytecccompopts="$bytecccompopts -D_REENTRANT"
|
bytecccompopts="$bytecccompopts -D_REENTRANT"
|
||||||
nativecccompopts="$nativecccompopts -D_REENTRANT"
|
nativecccompopts="$nativecccompopts -D_REENTRANT"
|
||||||
case "$host" in
|
case "$target" in
|
||||||
*-*-freebsd*)
|
*-*-freebsd*)
|
||||||
bytecccompopts="$bytecccompopts -D_THREAD_SAFE"
|
bytecccompopts="$bytecccompopts -D_THREAD_SAFE"
|
||||||
nativecccompopts="$nativecccompopts -D_THREAD_SAFE";;
|
nativecccompopts="$nativecccompopts -D_THREAD_SAFE";;
|
||||||
|
@ -1430,7 +1440,7 @@ if test "$x11_include" = "not found"; then
|
||||||
x11_link="-lX11"
|
x11_link="-lX11"
|
||||||
else
|
else
|
||||||
x11_libs="-L$dir"
|
x11_libs="-L$dir"
|
||||||
case "$host" in
|
case "$target" in
|
||||||
*-kfreebsd*-gnu) x11_link="-L$dir -lX11";;
|
*-kfreebsd*-gnu) x11_link="-L$dir -lX11";;
|
||||||
*-*-*bsd*) x11_link="-R$dir -L$dir -lX11";;
|
*-*-*bsd*) x11_link="-R$dir -L$dir -lX11";;
|
||||||
*) x11_link="-L$dir -lX11";;
|
*) x11_link="-L$dir -lX11";;
|
||||||
|
@ -1557,7 +1567,7 @@ if test $has_tk = true; then
|
||||||
-ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin -lpthread $tkauxlibs \
|
-ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin -lpthread $tkauxlibs \
|
||||||
Tcl_DoOneEvent
|
Tcl_DoOneEvent
|
||||||
then
|
then
|
||||||
case "$host" in
|
case "$target" 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*) 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";;
|
*) tk_libs="-L/usr/pkg/lib $tk_libs $tk_x11_libs -ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin -lpthread $tkauxlibs";;
|
||||||
esac
|
esac
|
||||||
|
@ -1571,14 +1581,14 @@ if test $has_tk = true; then
|
||||||
if sh ./hasgot $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
|
if sh ./hasgot $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
|
||||||
inf "Tcl/Tk libraries found."
|
inf "Tcl/Tk libraries found."
|
||||||
elif sh ./hasgot -L/sw/lib $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
|
elif sh ./hasgot -L/sw/lib $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
|
||||||
case "$host" in
|
case "$target" in
|
||||||
*-*-*bsd*) tk_libs="-R/sw/lib -L/sw/lib $tk_libs";;
|
*-*-*bsd*) tk_libs="-R/sw/lib -L/sw/lib $tk_libs";;
|
||||||
*) tk_libs="-L/sw/lib $tk_libs";;
|
*) tk_libs="-L/sw/lib $tk_libs";;
|
||||||
esac
|
esac
|
||||||
inf "Tcl/Tk libraries found."
|
inf "Tcl/Tk libraries found."
|
||||||
elif sh ./hasgot -L/usr/pkg/lib $tk_libs $tk_x11_libs $tkauxlibs \
|
elif sh ./hasgot -L/usr/pkg/lib $tk_libs $tk_x11_libs $tkauxlibs \
|
||||||
Tk_SetGrid; then
|
Tk_SetGrid; then
|
||||||
case "$host" in
|
case "$target" in
|
||||||
*-*-*bsd*) tk_libs="-R/usr/pkg/lib -L/usr/pkg/lib $tk_libs";;
|
*-*-*bsd*) tk_libs="-R/usr/pkg/lib -L/usr/pkg/lib $tk_libs";;
|
||||||
*) tk_libs="-L/usr/pkg/lib $tk_libs";;
|
*) tk_libs="-L/usr/pkg/lib $tk_libs";;
|
||||||
esac
|
esac
|
||||||
|
@ -1632,7 +1642,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$with_frame_pointers" = "true"; then
|
if test "$with_frame_pointers" = "true"; then
|
||||||
case "$host,$cc" in
|
case "$target,$cc" in
|
||||||
x86_64-*-linux*,gcc*)
|
x86_64-*-linux*,gcc*)
|
||||||
nativecccompopts="$nativecccompopts -g -fno-omit-frame-pointer"
|
nativecccompopts="$nativecccompopts -g -fno-omit-frame-pointer"
|
||||||
bytecccompopts="$bytecccompopts -g -fno-omit-frame-pointer"
|
bytecccompopts="$bytecccompopts -g -fno-omit-frame-pointer"
|
||||||
|
|
Loading…
Reference in New Issue