Newer
Older
# A (not so) simple configure script.
#
# Authors: Christian Holm Christensen and Fons Rademakers
#
# To help with debugging the script, some comments are preprended with
# 3 '#' echo and 3 '%' - replace that pattern with echo and 3 '%' to
# get printouts. When done replace the pattern echo and 3 '%' with the
# original pattern of 3 '#' echo and 3 '%'. Emacs command M-C-% does
# this easily.
#
######################################################################
#
### echo %%% Some global variables
#
found_lib=no
found_dir=no
found_hdr=no
show_pkglist=no
noact="no"
Fons Rademakers
committed
altcc=
altcxx=
altf77=
altld=
Fons Rademakers
committed
host=
options=" \
enable_afs \
enable_alien \
Fons Rademakers
committed
enable_alloc \
Fons Rademakers
committed
enable_astiff \
enable_bonjour \
enable_castor \
Fons Rademakers
committed
enable_cintex \
enable_editline \
enable_dcache \
enable_exceptions \
enable_explicitlink \
Fons Rademakers
committed
enable_genvector \
enable_mathmore \
Fons Rademakers
committed
enable_minuit2 \
enable_opengl \
enable_oracle \
enable_peac \
enable_pgsql \
enable_pythia6 \
Fons Rademakers
committed
enable_reflex \
enable_roofit \
enable_ruby \
enable_rfio \
enable_rpath \
enable_sapdb \
enable_shadowpw \
enable_shared \
enable_soversion \
enable_srp \
enable_ssl \
enable_table \
enable_x11 \
"
DEFAULTENABLE="yes"
for flag in "$@"; do
case $flag in
--gminimal)
DEFAULTENABLE="no"
MINIMALENABLE="enable_x11"
break ;;
--minimal)
DEFAULTENABLE="no"
MINIMALENABLE=""
break ;;
esac
done
# This sets all options to "yes" unless --minimal is specified.
# We turn off those we don't want on per default explictly afterwards.
for c in $options $deprecated_options; do
case ${c} in
${MINIMALENABLE}) eval ${c}="yes" ;;
enable_shared) eval ${c}="yes" ;;
*) eval ${c}="${DEFAULTENABLE}" ;;
esac
done
enable_afs=no
Fons Rademakers
committed
enable_alloc=no
enable_explicitlink=no
enable_qt=no
enable_roofit=no
enable_rpath=no
enable_ruby=no
enable_shadowpw=
enable_soversion=no
enable_thread=yes # cannot be disabled (not in above options list)
enable_xrootd= # must be set explicitely via --enable-xrootd
Fons Rademakers
committed
enable_builtin_freetype=no
enable_builtin_ftgl=no
Fons Rademakers
committed
enable_builtin_pcre=no
enable_builtin_zlib=no
#
# ./configure arguments and defaults set via supported env vars
#
envvars="
THREAD \
OPENGL \
MYSQL \
PGSQL \
QTDIR \
SAPDB \
RFIO \
CASTOR \
PYTHIA6 \
DCACHE \
CHIRP \
ALIEN \
ASIMAGE \
LDAP \
GLOBUS_LOCATION \
SRP \
AFS \
ROOFIT \
TABLE \
"
configenvvars=
if test ! "x$cc" = "x" ; then
if test ! "x$configenvvars" = "x" ; then
configenvvars="$configenvvars $c=$cc"
else
configenvvars="$c=$cc"
fi
fi
done
configargs="$*"
configargs=`echo $configargs | sed 's, *--nohowto,,g'`
configoptions=
if test ! "x$configenvvars" = "x" ; then
configoptions=$configenvvars
fi
if test ! "x$configargs" = "x" ; then
if test ! "x$configoptions" = "x" ; then
configoptions="$configoptions $configargs"
else
configoptions=$configargs
fi
fi
configoptions=`echo $configoptions | sed 's,\\\,\\\\\\\,g'`
######################################################################
#
### echo %%% Some common functions
#
#_____________________________________________________________________
message() {
# Write a simple message to std out
if test $# -lt 1 ; then
echo "message: Too few arguments"
return 1
fi
echo $ac_n "$* ... $ac_c"
logmsg "$*"
}
#_____________________________________________________________________
logmsg() {
# Write a simple message to std out
if test $# -lt 1 ; then
echo "logmsg: Too few arguments"
return 1
fi
if test "x$1" = "x-n"; then
shift
echo -n "$*" >> $logfile
else
echo "$*" >> $logfile
fi
}
#_____________________________________________________________________
result() {
echo "$*"
logmsg "Result: $*"
}
#_____________________________________________________________________
checking_msg() {
# Write a simple "checking" message to std out.
if test $# -lt 1 ; then
echo "checking_msg: Too few arguments"
return 1
fi
echo $ac_n "Checking for$ac_c"
logmsg $ac_n "Checking for$ac_c"
while test $# -gt 1 ; do
echo $ac_n " $1,$ac_c"
logmsg $ac_n " $1,$ac_c"
shift
if test $# -eq 1 ; then
echo $ac_n " or$ac_c"
logmsg $ac_n " or$ac_c"
fi
done
echo $ac_n " $1 ... $ac_c"
Fons Rademakers
committed
#_____________________________________________________________________
check_libpic() {
# This function will try to find out if an archive library [$1]
# contains relocatable code. Currently works only for linux.
# The result of the check is stored in is_libpic, 1 if true,
# 0 otherwise, which should be immediately copied, since the variable
# will be overwritten at next invocation of this function.
is_libpic=1
Fons Rademakers
committed
# Assert that we got enough arguments
if test $# -ne 1 ; then
echo "check_libpic: not 1 argument"
return 1
fi
case $platform in
linux) ;;
*) return 0;
Fons Rademakers
committed
;;
esac
# Save arguments in logical names
chklibpic=$1
if [ "x`basename $chklibpic .a`" != "x`basename $chklibpic`" ]; then
# we have an archive .a file
logmsg "Checking if $chklibpic contains relocatable code"
logmsg " objdump -r $chklibpic | grep -v ' .debug_' | grep 'R_X86_64_32'"
objdump -r $chklibpic | grep -v ' .debug_' | grep 'R_X86_64_32' > /dev/null 2>& 1
Fons Rademakers
committed
ret=$?
logmsg " result: $ret"
if test $ret -eq 0 ; then
is_libpic=0
logmsg " is not a relocatable library"
Fons Rademakers
committed
fi
fi
}
Fons Rademakers
committed
#_____________________________________________________________________
check_lib64() {
# This function will try to find out if a library [$1] contains 64 bit
# or 32 bit code. Currently works only for linux.
# The result of the check is stored in is_lib64, 1 if true,
# 0 otherwise, which should be immediately copied, since the variable
# will be overwritten at next invocation of this function.
is_lib64=0
# Assert that we got enough arguments
if test $# -ne 1 ; then
echo "check_lib64: not 1 argument"
return 1
Fons Rademakers
committed
fi
# Save arguments in logical names
chklib64=$1
logmsg "Checking if $chklib64 is a 64-bit library"
Fons Rademakers
committed
if [ "x`basename $chklib64 .a`" != "x`basename $chklib64`" ]; then
# we have an archive .a file
logmsg " objdump -a $chklib64 | grep 'x86-64'"
if objdump -a $chklib64 | grep 'x86-64' > /dev/null 2>& 1 ; then
ret=1
fi
Fons Rademakers
committed
else
if file -L $chklib64 | grep 'ASCII' > /dev/null 2>& 1 ; then
check_link $chklib64
ret=$link_result
else
logmsg " file -L $chklib64 | grep '64-bit'"
if file -L $chklib64 | grep '64-bit' > /dev/null 2>& 1 ; then
ret=1
fi
fi
Fons Rademakers
committed
fi
if test $ret -eq 1 ; then
Fons Rademakers
committed
is_lib64=1
logmsg " is a 64bit library"
Fons Rademakers
committed
fi
}
#_____________________________________________________________________
check_library() {
# This function will try to locate a library [$1] in the specific
# directory [$3] or in a default path [$*]. If the second argument
# [$2] is not "no", then shared libraries are favoured.
# The result of the search is stored in found_lib and found_dir,
# which should be immediately copied, since the variables value will
# be overwritten at next invocation of this function.
# Assert that we got enough arguments
if test $# -lt 4 ; then
echo "check_library: Too few arguments"
return 1
fi
# Save arguments in local names
lib=$1 ; shift
shared=$1 ; shift
libdirl=$1 ; shift
libdirs="$*"
Fons Rademakers
committed
if test ! "x$iossdk" = "x" ; then
sdklibs=""
for i in $libdirs; do
#if test $i = "/usr/lib"; then
sdklibs="$sdklibs ${iossdk}${i}"
#else
# sdklibs="$sdklibs $i"
#fi
done
libdirs="$sdklibs"
Fons Rademakers
committed
fi
# Write a message
checking_msg $lib
# check if we got a specific argument as to where the library
# is to be found
if test ! "x$libdirl" = "x" ; then
libdirs=$libdirl
fi
found_lib=no
found_dir=no
# Make list of libraries to search for. The .lib extension is for
# Windoze - note $shared is always "no" on windoze, since we need
# the .lib export library to link.
libs=""
for i in $lib ; do
for ext in .a .lib "" ; do # lib without extension for MacOS X
libs="$libs $i$ext"
done
slibs=""
for i in $lib ; do
for ext in .so .sl .dylib .dll.a ; do # .dll.a for cygwin gcc
slibs="$slibs $i$ext"
done
done
if test ! "x$shared" = "xno" ; then
libs="$slibs $libs"
else
libs="$libs $slibs"
fi
# Loop over the list of possible directories, and see if we can
# find any of the library files as determind above.
for i in $libdirs ; do
# look first in the lib32 directories
if test "x$checklib32" = "xyes" ; then
i32=`echo $i | sed -e 's|lib$|lib32|' -e 's|lib/|lib32/|'`
#i="$i32 $i"
i="$i32"
fi
# look first in the lib64 directories
if test "x$checklib64" = "xyes" ; then
i64=`echo $i | sed -e 's|lib$|lib64|' -e 's|lib/|lib64/|'`
Fons Rademakers
committed
i="$i64 $i"
fi
# look only in the lib64 directories
if test "x$checkonlylib64" = "xyes" ; then
i64=`echo $i | sed -e 's|lib$|lib64|' -e 's|lib/|lib64/|'`
i="$i64"
fi
Fons Rademakers
committed
# look only in the hpux64 directories
i="$i64"
# look only in the amd64 directories
if test "x$checksolaris64" = "xyes" ; then
i64=`echo $i | sed 's|\(lib\)|\1/amd64|'`
i="$i64"
fi
logmsg " Checking in directories $i for $libs"
for l in $i ; do
continue
for j in ${libs} ; do
logmsg " Checking for library $j in directory $l"
# if we found the file (it's readable by user), we set the
# logical variables and are on our way, otherwise we continue
liblist=`echo $l/$j` # expands wildcard in $l/$j
for n in ${liblist} ; do
logmsg " Checking $n"
if test -f $n ; then
logmsg " Found file $n"
Fons Rademakers
committed
if test "x$checklib64" = "xyes" ; then
check_lib64 $n
if test $is_lib64 -eq 1 ; then
found_dir=$l
found_lib=$j
break 4
fi
else
found_dir=$l
found_lib=$j
if test "x$arch" = "linux"; then
check_lib64 $n
else
is_lib64=0
fi
Fons Rademakers
committed
if test $is_lib64 -eq 1 ; then
found_dir=no
found_lib=no
Fons Rademakers
committed
# skip cygwin libraries when in pure Win32 mode
if test "x$platform" = "xwin32"; then
case $found_dir in
/lib|/lib/*|/usr/*) found_dir=no ;;
*) break 4;;
esac
else
break 4
fi
Fons Rademakers
committed
fi
else
done
done
done
echo $found_dir
unset libs
unset libdirs
if test "x$found_dir" = "xno" || test "x$found_lib" = "xno" ; then
found_dir=""
found_lib=""
found_raw_lib=""
logmsg " library not found"
flib=""
maclib=""
for i in $lib ; do
for ext in .a .lib "" ; do # lib without extension for MacOS X
if test "x$found_lib" = "x$i$ext" ; then
flib=$i$ext
if test "x$ext" = "x" ; then
maclib="yes"
fi
break 2
fi
done
done
if (test "x$found_lib" = "x$flib" && test "x$shared" = "xno") || \
test "x$maclib" = "xyes" ; then
found_raw_lib=${found_lib}
found_lib=${found_dir}/${found_lib}
found_raw_dir=${found_dir}
found_dir=""
else
found_raw_lib=${found_lib}
found_lib=`echo $found_lib | sed 's|^lib\(.*\)\..*|-l\1|'`
found_raw_dir=${found_dir}
found_dir=-L${found_dir}
Fons Rademakers
committed
# Avoid inclusion of /usr/lib, which is always included anyway
if test "x$found_dir" = "x-L/usr/lib" || \
test "x$found_dir" = "x-L/usr/lib32" || \
test "x$found_dir" = "x-L/usr/lib64" ; then
found_dir=""
fi
fi
# Correct path for win32
if test "x$platform" = "xwin32"; then
if test ! "x$found_lib" = "x" ; then
found_lib=`cygpath -m $found_lib`
fi
if test ! "x$found_dir" = "x" ; then
found_dir=`cygpath -m $found_dir`
fi
fi
fi
unset shared
unset slibs
unset lib
unset flib
unset maclib
unset libdirl
#_____________________________________________________________________
check_header() {
# This function will try to locate a header [$1] in the specific
# directory [$2] or in a default path [$*].
# The result of the search is stored in found_hdr and found_dir,
# which should be immediately copied, since the variables value will
# be overwritten at next invocation of this function.
# Assert that we got enough arguments
if test $# -lt 3 ; then
echo "check_header: Too few arguments"
return 1
fi
# Save arguments in logical names
hdrs=$1 ; shift
hdrdir=$1 ; shift
hdrdirs="$*"
Fons Rademakers
committed
if test ! "x$iossdk" = "x" ; then
sdkhdrs=""
for i in $hdrdirs; do
#if test $i = "/usr/include"; then
sdkhdrs="$sdkhdrs ${iossdk}${i}"
#else
# sdkhdrs="$sdkhdrs $i"
#fi
done
hdrdirs="$sdkhdrs"
Fons Rademakers
committed
fi
# Write a message
checking_msg $hdrs
# Check if we got a specific argument as to where the library
# is to be found
if test ! "x$hdrdir" = "x" ; then
hdrdirs=$hdrdir
fi
found_hdr=no
found_dir=no
# Loop over the list of possible directories, and see if we can
# find any of the library files as determind above.
Fons Rademakers
committed
for i in $hdrdirs; do
logmsg " Checking in directory $i"
for j in ${hdrs} ; do
logmsg " Checking for $j in directory $i"
# if we found the file (it's readable by user), we set the
# logical variables and are on our way, otherwise we continue
if test -r $i/$j ; then
logmsg " $i/$j is read-able"
found_dir=$i
found_hdr=$j
# skip cygwin headers when in pure Win32 mode
if test "x$platform" = "xwin32"; then
case $found_dir in
/usr/*) found_dir="no" ;;
*) break 2;;
esac
else
break 2
fi
fi
done
done
echo $found_dir
if test "x$found_hdr" = "xno" || test "x$found_dir" = "xno" ; then
found_hdr=""
found_dir=""
fi
# Avoid inclusion of /usr/include, which is always included anyway
#if test "x$found_dir" = "x/usr/include" ; then
# found_dir="include"
# Correct path for win32
Fons Rademakers
committed
if test "x$platform" = "xwin32"; then
if test ! "x$found_hdr" = "x" ; then
found_hdr=`cygpath -m $found_hdr`
fi
if test ! "x$found_dir" = "x" ; then
found_dir=`cygpath -m $found_dir`
fi
fi
unset hdrs
unset hdrdirs
unset hdrdir
}
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
#_____________________________________________________________________
check_link() {
# This function will try to link a specific library [$1] in an
# optional directory [$2] and test, optionally, for a specified
# symbol [$3].
# The result of the check is stored in link_result, 1 if true,
# 0 otherwise, which should be immediately copied, since the variable
# will be overwritten at next invocation of this function.
# Assert that we got enough arguments
if test $# -lt 1 ; then
echo "check_link: need at least one argument"
link_result=0
return 1
fi
# save arguments in logical names
linklib="$1"; shift
linkdir=""
if test $# -ge 1 ; then
linkdir="$1"; shift
fi
linksymbol=""
if test $# -ge 1 ; then
linksymbol="$1"
fi
if test "x$linksymbol" = "x" ; then
if test "x$linkdir" = "x" ; then
logmsg " trying to link against $linklib"
else
logmsg " trying to link against $linkdir $linklib"
fi
cat <<EOF > conftest.mk
Fons Rademakers
committed
include ${ac_srcdir}/config/Makefile.${arch}
conftest: conftest.c
\$(CC) \$(CFLAGS) \$(LDFLAGS) $linkdir $linklib \$< -o \$@
conftest.c:
echo "int main() { return 0; }" > \$@
EOF
else
if test "x$linkdir" = "x" ; then
logmsg " trying to resolve symbol $linksymbol in $linklib"
else
logmsg " trying to resolve symbol $linksymbol in $linkdir $linklib"
fi
cat <<EOF > conftest.mk
Fons Rademakers
committed
include ${ac_srcdir}/config/Makefile.${arch}
conftest:conftest.c
\$(CC) \$(CFLAGS) \$(LDFLAGS) $linkdir $linklib \$< -o \$@
conftest.c:
echo "extern int $linksymbol (); " > \$@
echo "int main() { $linksymbol (); return 0; }" >> \$@
EOF
fi
$gnumake -f conftest.mk >> $logfile 2>&1
if test $? -eq 0 ; then
link_result=1
logmsg " Link OK"
else
link_result=0
logmsg " Failed code was"
cat conftest.mk >> $logfile
fi
rm -rf conftest.c conftest.mk conftest
unset linklib
unset linkdir
unset linksymbol
}
#_____________________________________________________________________
check_symbol() {
# This function will try to locate a symbol [$1] in a specific
# library [$2] and in a given directory [$3].
# The result of the check is stored in found_symbol, 1 if true,
# 0 otherwise, which should be immediately copied, since the variable
# will be overwritten at next invocation of this function.
# Assert that we got enough arguments
if test $# -ne 3 ; then
echo "check_symbol: not 3 arguments"
found_symbol=0
return 1
fi
# Save arguments in logical names
symbol=$1 ; shift
symbollib=$1 ; shift
symboldir=$1
if test "x$symbollib" = "x" ; then
found_symbol=0
unset symbol
unset symbollib
unset symboldir
return 1
fi
symbollib=`echo $symbollib | sed -e 's/^-l/lib/'`
if test ! "x$symboldir" = "x" ; then
symboldir=`echo $symboldir | sed -e 's/^-L//'`
# Check if we got a specific argument as to where the library
# is to be found
symbolfile=$symbollib
exts="$exts .a"
exts=".a $exts"
Fons Rademakers
committed
usrlib="/usr/lib"
# look first in the lib32 directories
if test "x$checklib32" = "xyes" ; then
usrlib="/usr/lib32 $usrlib"
fi
# look first in the lib64 directories
if test "x$checklib64" = "xyes" ; then
usrlib="/usr/lib64 $usrlib"
fi
Fons Rademakers
committed
# look only in the lib64 directories
if test "x$checkonlylib64" = "xyes" ; then
usrlib="/usr/lib64"
fi
# look only in the hpux64 directories
Fons Rademakers
committed
if test "x$checkhpux64" = "xyes" ; then
Fons Rademakers
committed
usrlib="/usr/lib/hpux64"
Fons Rademakers
committed
fi
# look only in the amd64 directories
if test "x$checkamd64" = "xyes" ; then
usrlib="/usr/lib/amd64"
fi
Fons Rademakers
committed
for d in "$symboldir" $usrlib ; do
logmsg " Checking in $d"
if test ! -r $d/$symbollib ; then
logmsg " $d/$symbollib not readable"
for i in $exts ; do
logmsg " Checking extension $i with $d/$symbollib"
if test -r $d/$symbollib$i ; then
logmsg " $d/$symbollib$i readable"
symbolfile=$d/$symbollib$i
break 2
else
logmsg "$d/$symbollib readable"
symbolfile=$d/$symbollib
break
if test "x$symbolfile" = "x" || test ! -r $symbolfile ; then
found_symbol=0
unset symbol
unset symbollib
unset symboldir
nm $symbolfile 2>&1 | grep $symbol > /dev/null 2>&1
if test $? -eq 0 ; then
found_symbol=1
nm $symbolfile 2>&1 | grep "no symbols" > /dev/null 2>&1
if test $? -eq 0 ; then
logmsg " $symbolfile is stripped, trying to link"
# stripped library - only safe test is to link against the library
check_link $symbolfile "" $symbol
found_symbol=$link_result
else
found_symbol=0
fi
result "ok"
result "no"
unset symbol
unset symbollib
unset symboldir
Fons Rademakers
committed
#_____________________________________________________________________
check_comp() {
# This function will try to locate the default or alt compiler
# type [$1] in the PATH.
# The result of the check is stored in found_comp, 1 if true,
# 0 otherwise, which should be immediately copied, since the variable
# will be overwritten at next invocation of this function.
# Assert that we got enough arguments
if test $# -ne 1 ; then
echo "check_comp: not 1 argument"
found_comp=0
return 1
fi
comptype="$1"
Fons Rademakers
committed
nocomp=""
Fons Rademakers
committed
if test "x$comptype" = "xLD" ; then
Fons Rademakers
committed
message "Checking for ${compmsgextra}linker (LD)"
Fons Rademakers
committed
else
Fons Rademakers
committed
message "Checking for ${compmsgextra}$comptype compiler"
Fons Rademakers
committed
fi
found_comp=0
case $comptype in
C)
if test "x$altcc" = "x" ; then
if `make -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showcc > /dev/null 2>&1` ; then
altcc=`make -s -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showcc`
Fons Rademakers
committed
else
Fons Rademakers
committed
altcc=`grep '^CC ' ${ac_srcdir}/config/Makefile.$arch | awk '{ if (NF==3) {print $3; exit 0} }'`
Fons Rademakers
committed
fi
if test "x$arch" = "xwin32" ; then
altccorg="cl"
altcctmp="$altcc"
altcc="$altccorg"
fi
Fons Rademakers
committed
fi
altcc1=`echo "$altcc" | awk '{print $1}'`
if `$cwhich $altcc1 > /dev/null 2>&1` ; then
Fons Rademakers
committed
found_comp=1
if test ! "x$altcctmp" = "x" ; then
altcc="$altcctmp"
fi
Fons Rademakers
committed
result "$altcc"
else
nocomp="$altcc"
fi
;;
C++)
if test "x$altcxx" = "x" ; then
if `make -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showcxx > /dev/null 2>&1` ; then
altcxx=`make -s -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showcxx`
Fons Rademakers
committed
else
Fons Rademakers
committed
altcxx=`grep '^CXX ' ${ac_srcdir}/config/Makefile.$arch | awk '{ if (NF==3) {print $3; exit 0} }'`
Fons Rademakers
committed
fi
if test "x$arch" = "xwin32" ; then
altcxxorg="cl"
altcxxtmp="$altcxx"
altcxx="$altcxxorg"
fi
Fons Rademakers
committed
fi
altcxx1=`echo "$altcxx" | awk '{print $1}'`
if `$cwhich $altcxx1 > /dev/null 2>&1` ; then
Fons Rademakers
committed
found_comp=1
if test ! "x$altcxxtmp" = "x" ; then
altcxx="$altcxxtmp"
fi
Fons Rademakers
committed
result "$altcxx"
else
nocomp="$altcxx"
fi
;;
LD)
if test "x$altld" = "x" ; then
if `make -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showld > /dev/null 2>&1` ; then
altld=`make -s -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showld`
Fons Rademakers
committed
else
Fons Rademakers
committed
altld=`grep '^LD ' ${ac_srcdir}/config/Makefile.$arch | awk '{ if (NF==3) {print $3; exit 0} }'`
fi
if test "x$arch" = "xwin32" ; then
altldorg="link"
altldtmp="$altld"
altld="$altldorg"
fi
if test "x$arch" = "xwin32gcc" ; then
altldorg="g++"
altldtmp="$altld"
altld="$altldorg"
fi
Fons Rademakers
committed
fi
altld1=`echo "$altld" | awk '{print $1}'`
if `$cwhich $altld1 > /dev/null 2>&1` ; then
Fons Rademakers
committed
found_comp=1
if test ! "x$altldtmp" = "x" ; then
altld="$altldtmp"
fi
Fons Rademakers
committed
result "$altld"
else
nocomp="$altld"
altldorg=""
Fons Rademakers
committed
fi
;;
F77)
if test "x$altf77" = "x" ; then
if `make -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showf77 > /dev/null 2>&1` ; then
altf77=`make -s -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showf77`
Fons Rademakers
committed
else
Fons Rademakers
committed
altf77=`grep '^F77 ' ${ac_srcdir}/config/Makefile.$arch | awk '{ if (NF==3) {print $3; exit 0} }'`
fi
if test "x$arch" = "xwin32" ; then
altf77org="fl32"
altf77tmp="$altf77"
altf77="$altf77org"
Fons Rademakers
committed
fi
fi
altf771=`echo "$altf77" | awk '{print $1}'`
if `$cwhich $altf771 > /dev/null 2>&1` ; then
Fons Rademakers
committed
found_comp=1
if test ! "x$altf77tmp" = "x" ; then
altf77="$altf77tmp"
Fons Rademakers
committed
fi
result "$altf77"
else
nocomp="$altf77"
altf77org=""
Fons Rademakers
committed
fi
;;
esac