Skip to content
Snippets Groups Projects
configure 230 KiB
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
Fons Rademakers's avatar
Fons Rademakers committed
fail_on_missing=no
Fons Rademakers's avatar
Fons Rademakers committed
nohowto="no"
Fons Rademakers's avatar
Fons Rademakers committed
logfile=config.log
Fons Rademakers's avatar
Fons Rademakers committed
deprecated_options="         \
   enable_mathcore           \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_cern               \
Fons Rademakers's avatar
Fons Rademakers committed
"

options="                    \
   enable_afs                \
   enable_alien              \
   enable_asimage            \
   enable_builtin_afterimage \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_builtin_ftgl       \
   enable_builtin_freetype   \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_builtin_glew       \
   enable_builtin_pcre       \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_builtin_zlib       \
   enable_chirp              \
   enable_clarens            \
Fons Rademakers's avatar
 
Fons Rademakers committed
   enable_cling              \
   enable_dcache             \
   enable_exceptions         \
   enable_explicitlink       \
Rene Brun's avatar
Rene Brun committed
   enable_fftw3              \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_fitsio             \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_gviz               \
   enable_gdml               \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_gfal               \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_glite              \
   enable_globus             \
Rene Brun's avatar
Rene Brun committed
   enable_gsl_shared         \
   enable_krb5               \
   enable_ldap               \
Rene Brun's avatar
Rene Brun committed
   enable_memstat            \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_monalisa           \
   enable_mysql              \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_odbc               \
   enable_opengl             \
   enable_oracle             \
   enable_peac               \
   enable_pgsql              \
   enable_pythia6            \
   enable_python             \
   enable_qt                 \
   enable_qtgsi              \
   enable_ruby               \
   enable_rfio               \
   enable_rpath              \
   enable_sapdb              \
   enable_shadowpw           \
   enable_shared             \
   enable_soversion          \
   enable_srp                \
   enable_ssl                \
   enable_table              \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_tmva               \
Rene Brun's avatar
Rene Brun committed
   enable_unuran             \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_winrtdebug         \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_xft                \
   enable_xml                \
   enable_xrootd             \
Fons Rademakers's avatar
Fons Rademakers committed
DEFAULTENABLE="yes"
for flag in "$@"; do
    case $flag in
    --gminimal)
       DEFAULTENABLE="no"
Fons Rademakers's avatar
Fons Rademakers committed
       break ;;
     --minimal)
       DEFAULTENABLE="no"
       MINIMALENABLE=""
       break ;;
    esac
done

Fons Rademakers's avatar
Fons Rademakers committed
# This sets all options to "yes" unless --minimal is specified.
# We turn off those we don't want on per default explictly afterwards.
Fons Rademakers's avatar
Fons Rademakers committed
for c in $options $deprecated_options; do
    case ${c} in
        ${MINIMALENABLE}) eval ${c}="yes" ;;
        enable_shared)    eval ${c}="yes" ;;
        *)                eval ${c}="${DEFAULTENABLE}" ;;
    esac
done
Fons Rademakers's avatar
Fons Rademakers committed
for c in $options ; do eval ${c}_explicit="" ; done
Fons Rademakers's avatar
 
Fons Rademakers committed
enable_cling=
enable_gdml=no
Fons Rademakers's avatar
Fons Rademakers committed
enable_globus=no
Rene Brun's avatar
Rene Brun committed
enable_gsl_shared=no
enable_qtgsi=no
Rene Brun's avatar
Rene Brun committed
enable_minuit2=no
enable_table=no
enable_thread=yes        # cannot be disabled (not in above options list)
Rene Brun's avatar
Rene Brun committed
enable_unuran=no
Fons Rademakers's avatar
Fons Rademakers committed
enable_winrtdebug=
enable_xrootd=           # must be set explicitely via --enable-xrootd
enable_builtin_freetype=no
enable_builtin_ftgl=no
Fons Rademakers's avatar
Fons Rademakers committed
enable_builtin_glew=no
enable_builtin_pcre=no
enable_builtin_zlib=no
Fons Rademakers's avatar
Fons Rademakers committed
# Remove old log file
rm -f $logfile

#
# ./configure arguments and defaults set via supported env vars
#
envvars="
THREAD           \
OPENGL           \
MYSQL            \
ORACLE           \
Fons Rademakers's avatar
Fons Rademakers committed
GFAL             \
Fons Rademakers's avatar
Fons Rademakers committed
GSL              \
Rene Brun's avatar
Rene Brun committed
FFTW3            \
Fons Rademakers's avatar
Fons Rademakers committed
CFITSIO          \
Fons Rademakers's avatar
Fons Rademakers committed
GVIZ             \
Rene Brun's avatar
Rene Brun committed
PYTHONDIR        \
Fons Rademakers's avatar
Fons Rademakers committed
AVAHI            \
Fons Rademakers's avatar
Fons Rademakers committed
GLITE            \
Rene Brun's avatar
Rene Brun committed
MEMSTAT          \
Fons Rademakers's avatar
Fons Rademakers committed
MONALISA         \
Fons Rademakers's avatar
Fons Rademakers committed
SSL              \
Rene Brun's avatar
Rene Brun committed
MINUIT2          \
Rene Brun's avatar
Rene Brun committed
XMLDIR           \
Fons Rademakers's avatar
Fons Rademakers committed
ROOTDICTTYPE     \
for c in $envvars ; do
Fons Rademakers's avatar
Fons Rademakers committed
   cc=`eval echo "$"$c | sed 's,\\\,\\\\\\\,g'`
   if test ! "x$cc" = "x" ; then
      if test ! "x$configenvvars" = "x" ; then
         configenvvars="$configenvvars $c=$cc"
      else
         configenvvars="$c=$cc"
      fi
   fi
done
Fons Rademakers's avatar
Fons Rademakers committed
# don't write --nohowto to config.h
Fons Rademakers's avatar
Fons Rademakers committed
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
Fons Rademakers's avatar
Fons Rademakers committed
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
Fons Rademakers's avatar
Fons Rademakers committed
    logmsg "$*"
}

#_____________________________________________________________________
logmsg() {
    # Write a simple message to std out
    if test $# -lt 1 ; then
        echo "logmsg: Too few arguments"
        return 1
Fons Rademakers's avatar
Fons Rademakers committed
    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
Fons Rademakers's avatar
Fons Rademakers committed
    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
Fons Rademakers's avatar
Fons Rademakers committed
    logmsg " $1 ... "
#_____________________________________________________________________
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.


    # Assert that we got enough arguments
    if test $# -ne 1 ; then
        echo "check_libpic: not 1 argument"
        return 1
    fi

    case $platform in
    linux) ;;
           ;;
    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"
Fons Rademakers's avatar
Fons Rademakers committed
        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
        ret=$?
        logmsg " result: $ret"
        if test $ret -eq 0 ; then
            is_libpic=0
            logmsg " is not a relocatable library"
#_____________________________________________________________________
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
    logmsg "Checking if $chklib64 is a 64-bit library"
    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
        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's avatar
Fons Rademakers committed
    logmsg " result: $ret"
#_____________________________________________________________________
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
        sdklibs=""
        for i in $libdirs; do
            #if test $i = "/usr/lib"; then
                sdklibs="$sdklibs ${iossdk}${i}"
            #else
            #    sdklibs="$sdklibs $i"
            #fi
        done
        libdirs="$sdklibs"
    # 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
Fons Rademakers's avatar
Fons Rademakers committed
    logmsg "libraries to check for: $libs"
    # Loop over the list of possible directories, and see if we can
    # find any of the library files as determind above.
        # look first in the lib32 directories
        if test "x$checklib32" = "xyes" ; then
            i32=`echo $i | sed -e 's|lib$|lib32|' -e 's|lib/|lib32/|'`
        # look first in the lib64 directories
        if test "x$checklib64" = "xyes" ; then
            i64=`echo $i | sed -e 's|lib$|lib64|' -e 's|lib/|lib64/|'`
            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/|'`
        # look only in the hpux64 directories
Fons Rademakers's avatar
Fons Rademakers committed
        if test "x$checkhpux64" = "xyes" ; then
Fons Rademakers's avatar
Fons Rademakers committed
            i64=`echo $i | sed 's|\(lib\)|\1/hpux64|'`
Fons Rademakers's avatar
Fons Rademakers committed
        fi
        # 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"
Fons Rademakers's avatar
Fons Rademakers committed
            l=`echo $l | sed 's,^//,/,'`
Fons Rademakers's avatar
Fons Rademakers committed
            if test ! -d $l ; then
Fons Rademakers's avatar
Fons Rademakers committed
            fi
                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
                        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
                            if test $is_lib64 -eq 1 ; then
                                found_dir=no
                                found_lib=no
Fons Rademakers's avatar
Fons Rademakers committed
                            else
                                # 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's avatar
Fons Rademakers committed
                            fi
Fons Rademakers's avatar
Fons Rademakers committed
                        logmsg "  $j not found in $l"
    if test "x$found_dir" = "xno" || test "x$found_lib" = "xno" ; then
        found_dir=""
        found_lib=""
        found_raw_lib=""
        logmsg " library not found"
        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
        if (test "x$found_lib" = "x$flib" && test "x$shared" = "xno") || \
                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}
            # 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

        # 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
#_____________________________________________________________________
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="$*"

        sdkhdrs=""
        for i in $hdrdirs; do
            #if test $i = "/usr/include"; then
                sdkhdrs="$sdkhdrs ${iossdk}${i}"
            #else
            #    sdkhdrs="$sdkhdrs $i"
            #fi
        done
        hdrdirs="$sdkhdrs"
    # 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.
        logmsg " Checking in directory $i"
            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
Fons Rademakers's avatar
Fons Rademakers committed
                # 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
    if test "x$found_hdr" = "xno" || test "x$found_dir" = "xno" ; then
    fi

    # Avoid inclusion of /usr/include, which is always included anyway
    #if test "x$found_dir" = "x/usr/include" ; then
    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

#_____________________________________________________________________
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
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
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"
    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
    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
Fons Rademakers's avatar
Fons Rademakers committed
    exts=".so .lib .dylib"
Fons Rademakers's avatar
Fons Rademakers committed
    if test ! "x$shared" = "xno" ; then
Fons Rademakers's avatar
Fons Rademakers committed
    else
Fons Rademakers's avatar
Fons Rademakers committed
    fi

    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
    # look only in the lib64 directories
    if test "x$checkonlylib64" = "xyes" ; then
        usrlib="/usr/lib64"
    fi
    # look only in the hpux64 directories
    if test "x$checkhpux64" = "xyes" ; then
    # look only in the amd64 directories
    if test "x$checkamd64" = "xyes" ; then
        usrlib="/usr/lib/amd64"
    fi
        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
Fons Rademakers's avatar
Fons Rademakers committed
        else
            logmsg "$d/$symbollib readable"
            symbolfile=$d/$symbollib
            break
Fons Rademakers's avatar
Fons Rademakers committed
    done

    if test "x$symbolfile" = "x" || test ! -r $symbolfile ; then
       found_symbol=0
Fons Rademakers's avatar
Fons Rademakers committed
       logmsg " Symbol not found"
       unset symbol
       unset symbollib
       unset symboldir
Fons Rademakers's avatar
Fons Rademakers committed
    checking_msg "$symbol in $symbolfile"
Fons Rademakers's avatar
Fons Rademakers committed
    nm $symbolfile 2>&1 | grep $symbol > /dev/null 2>&1
    if test $? -eq 0 ; then
        found_symbol=1
Fons Rademakers's avatar
Fons Rademakers committed
        logmsg " Symbol found"
        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
Fons Rademakers's avatar
Fons Rademakers committed
    fi
    if test $found_symbol -eq 1 ; then
Fons Rademakers's avatar
Fons Rademakers committed
    else
Fons Rademakers's avatar
Fons Rademakers committed
    fi
#_____________________________________________________________________
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"
       message "Checking for ${compmsgextra}linker (LD)"
       message "Checking for ${compmsgextra}$comptype compiler"
    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
Fons Rademakers's avatar
Fons Rademakers committed
                altcc=`make -s -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showcc`
                altcc=`grep '^CC ' ${ac_srcdir}/config/Makefile.$arch | awk '{ if (NF==3) {print $3; exit 0} }'`
Fons Rademakers's avatar
Fons Rademakers committed
            if test "x$arch" = "xwin32" ; then
                altccorg="cl"
                altcctmp="$altcc"
                altcc="$altccorg"
            fi
        altcc1=`echo "$altcc" | awk '{print $1}'`
        if `$cwhich $altcc1 > /dev/null 2>&1` ; then
Fons Rademakers's avatar
Fons Rademakers committed
            if test ! "x$altcctmp" = "x" ; then
                altcc="$altcctmp"
            fi
            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
Fons Rademakers's avatar
Fons Rademakers committed
                altcxx=`make -s -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showcxx`
                altcxx=`grep '^CXX ' ${ac_srcdir}/config/Makefile.$arch | awk '{ if (NF==3) {print $3; exit 0} }'`
Fons Rademakers's avatar
Fons Rademakers committed
            if test "x$arch" = "xwin32" ; then
                altcxxorg="cl"
                altcxxtmp="$altcxx"
                altcxx="$altcxxorg"
            fi
        altcxx1=`echo "$altcxx" | awk '{print $1}'`
        if `$cwhich $altcxx1 > /dev/null 2>&1` ; then
Fons Rademakers's avatar
Fons Rademakers committed
            if test ! "x$altcxxtmp" = "x" ; then
                altcxx="$altcxxtmp"
            fi
            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
Fons Rademakers's avatar
Fons Rademakers committed
                altld=`make -s -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showld`
                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"
        altld1=`echo "$altld" | awk '{print $1}'`
        if `$cwhich $altld1 > /dev/null 2>&1` ; then
            if test ! "x$altldtmp" = "x" ; then
                altld="$altldtmp"
            fi
            if `make -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showf77 > /dev/null 2>&1` ; then
Fons Rademakers's avatar
Fons Rademakers committed
                altf77=`make -s -f ${ac_srcdir}/config/Makefile.$arch ROOT_SRCDIR=${ac_srcdir} CONFIGURE=yes showf77`
                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"
        altf771=`echo "$altf77" | awk '{print $1}'`
        if `$cwhich $altf771 > /dev/null 2>&1` ; then
            if test ! "x$altf77tmp" = "x" ; then
                altf77="$altf77tmp"