Skip to content
Snippets Groups Projects
configure 125 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
nohowto="no"
options="                    \
   enable_afs                \
   enable_alien              \
   enable_asimage            \
   enable_builtin_afterimage \
   enable_builtin_freetype   \
   enable_builtin_pcre       \
   enable_cern               \
   enable_chirp              \
   enable_clarens            \
   enable_dcache             \
   enable_exceptions         \
   enable_explicitlink       \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_gfal               \
   enable_globus             \
   enable_krb5               \
   enable_ldap               \
   enable_mathcore           \
   enable_mathmore           \
Fons Rademakers's avatar
Fons Rademakers committed
   enable_monalisa           \
   enable_mysql              \
   enable_opengl             \
   enable_oracle             \
   enable_peac               \
   enable_pgsql              \
   enable_pythia             \
   enable_pythia6            \
   enable_python             \
   enable_qt                 \
Rene Brun's avatar
Rene Brun committed
   enable_minuit2            \
   enable_ruby               \
   enable_rfio               \
   enable_rpath              \
   enable_sapdb              \
   enable_shadowpw           \
   enable_shared             \
   enable_soversion          \
   enable_srp                \
   enable_ssl                \
   enable_table              \
   enable_thread             \
   enable_venus              \
   enable_xml                \
   enable_xrootd             \
"

#
# This sets all options to "yes" - we turn off those we don't want
# on per default explictly afterwards.
#
for c in $options ; do eval $c="yes" ; done

enable_mathcore=no
enable_mathmore=no
Rene Brun's avatar
Rene Brun committed
enable_minuit2=no
enable_table=no
enable_thread=           # must be set explicitely via --enable-thread
enable_xrootd=           # must be set explicitely via --enable-xrootd
#
# ./configure arguments and defaults set via supported env vars
#
envvars="
THREAD           \
OPENGL           \
ORACLE           \
Fons Rademakers's avatar
Fons Rademakers committed
GFAL             \
Rene Brun's avatar
Rene Brun committed
PYTHONDIR        \
VENUS            \
DCACHE           \
CHIRP            \
ALIEN            \
ASIMAGE          \
LDAP             \
GLOBUS_LOCATION  \
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
   cc=`eval echo "$"$c`
   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
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

######################################################################
#
### 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"
}

#_____________________________________________________________________
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"
    while test $# -gt 1  ; do
	echo $ac_n " $1,$ac_c"
	shift
	if test $# -eq 1 ; then
	    echo $ac_n " or$ac_c"
	fi
    done
    echo $ac_n " $1 ... $ac_c"
}
#_____________________________________________________________________
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
    fi

    # Save arguments in logical names
    chklib64=$1

    if [ "x`basename $chklib64 .a`" != "x`basename $chklib64`" ]; then
        # we have an archive .a file
        objdump -a $chklib64 | grep 'x86-64' > /dev/null 2>& 1
    else
        file -L $chklib64 | grep '64-bit' > /dev/null 2>& 1
    fi
    if test $? -eq 0 ; then
        is_lib64=1
    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

    libdirs="$*"

    # 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
    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"
    fi

    # 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
Fons Rademakers's avatar
Fons Rademakers committed
            l=`echo $l | sed 's,^//,/,'`
Fons Rademakers's avatar
Fons Rademakers committed
            if test ! -d $l ; then
		continue
            fi
            for j in ${libs} ; do
	        # 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
Fons Rademakers's avatar
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
    if test "x$found_dir" = "xno" || test "x$found_lib" = "xno" ; then
	    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") || \
           test "x$maclib" = "xyes" ; then
	    found_lib=${found_dir}/${found_lib}
	    found_dir=""
	else
	    found_lib=`echo $found_lib | sed 's|^lib\(.*\)\..*|-l\1|'`
	    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="$*"

    # 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.
    for i in $hdrdirs; do
        for j in ${hdrs} ; do
	    # 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
                found_dir=$i
                found_hdr=$j
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
	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"
    #fi
    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_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
        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
Fons Rademakers's avatar
Fons Rademakers committed
    exts=".so .lib"
    if test ! "x$shared" = "xno" ; then
	exts="$exts .a"
    else
	exts=".a $exts"
    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
Fons Rademakers's avatar
Fons Rademakers committed
	if test ! -r $d/$symbollib ; then
	    for i in $exts ; do
		if test -r $d/$symbollib$i ; then
		    symbolfile=$d/$symbollib$i
		    break 2
Fons Rademakers's avatar
Fons Rademakers committed
    done

    if test "x$symbolfile" = "x" || test ! -r $symbolfile ; then
       found_symbol=0
       return 1
    fi

Fons Rademakers's avatar
Fons Rademakers committed
    checking_msg "$symbol in $symbolfile"
    nm $symbolfile 2> /dev/stdout | grep $symbol > /dev/null 2>&1
    if test $? -eq 0 ; then
        found_symbol=1
    else
Fons Rademakers's avatar
Fons Rademakers committed
	nm $symbolfile 2> /dev/stdout | grep "no symbols" > /dev/null 2>&1
	if test $? -eq 0 ; then
	    # stripped library - only safe test is to link against the
	    # library!  However, we do not know what compiler to use
	    # so we can not do the test.  Assume the symbol is in
	    cat <<EOF > conftest.mk
include config/Makefile.${arch}
conftest:conftest.c $symbolfile
	\$(CC) \$(CFLAGS) \$(LDFLAGS) $symbolfile \$< -o \$@

conftest.c:
	echo "extern int $symbol (); " > \$@
	echo "int main() { $symbol (); return 0; }" >> \$@
EOF
	    $gnumake -f conftest.mk > /dev/null 2>&1
	    rm -rf conftest.c conftest.mk conftest
	    if test $? -eq 0 ; then
		found_symbol=1
	    else
        found_symbol=0
    fi
Fons Rademakers's avatar
Fons Rademakers committed
	else
	    found_symbol=0
	fi
    fi
    if test $found_symbol -eq 1 ; then
	echo "ok"
    else
	echo "no"
    fi
#_____________________________________________________________________
guess_architecture () {
    # Try to guess the architecture of the host system
    # Note, that there's no attempt at guessing the compiler.
    # The `native' compiler is used in all cases.
    # If a user really want a specifific compiler, s/he better use the
    # first argument to do so.
    arch=`uname -s | tr '[A-Z]' '[a-z]'`
    chip=`uname -m | tr '[A-Z]' '[a-z]'`
    rele=`uname -r`
    case "$arch:$chip:$rele" in
        aix*)                  arch=aix5            ;;
        osf1*:alpha:*)         arch=alphacxx6       ;;
        freebsd*:*:6*)         arch=freebsd5        ;;
Fons Rademakers's avatar
Fons Rademakers committed
        freebsd*:*:5*)         arch=freebsd5        ;;
        freebsd*:*:4*)         arch=freebsd4        ;;
        freebsd*:*:*)          arch=freebsd         ;;
        hp-ux:ia64:*)          arch=hpuxia64acc     ;;
        hp-ux:*:*)             arch=hpuxacc         ;;
        hurd*:*:*)             arch=hurddeb         ;;
        linux:ia64:*)          arch=linuxia64gcc    ;;
        linux:x86_64:*)        arch=linuxx8664gcc   ;;
        linux:alpha:*)         arch=linuxalphagcc   ;;
        linux:ppc64*:*)        arch=linuxppc64gcc   ;;
        linux:ppc*:*)          arch=linuxppcgcc     ;;
Fons Rademakers's avatar
Fons Rademakers committed
        openbsd*:*:*)          arch=openbsd         ;;
        darwin:power*:*)       arch=macosx          ;;
        irix*:sgi*:*)          arch=sgicc           ;;
        sunos:sun*:6*)         arch=solarisCC5      ;;
        sunos:sun*:5*)         arch=solarisCC5      ;;
        sunos:sun*:4*)         arch=solaris         ;;
        cygwin_*:*86:*)        arch=win32           ;;
        cygwin_*:pentium:*)    arch=win32           ;;
        cygwin_*:ia64)         arch=win32           ;;
        *)
            echo "Attempts at guessing your architecture failed."
            echo "Please specify the architecture as the first argument."
            echo "Do '$0 --help' for a list of avaliable architectures."
            exit 1
            ;;
   esac
}

###################################################################
#
### echo %%% Some skeleton and config files
#
ARCHS=config/ARCHS
MAKEIN=config/Makefile.in
MAKEOUT=config/Makefile.config
CONFIN=config/config.in
CONFOUT=include/config.h
RCONFIN=config/root-config.in
RCONFOUT=bin/root-config
ROOTRCOUT=etc/system.rootrc
ROOTAUTHRCIN=config/rootauthrc.in
ROOTAUTHRCOUT=etc/system.rootauthrc
ROOTDAEMONRCIN=config/rootdaemonrc.in
ROOTDAEMONRCOUT=etc/system.rootdaemonrc
MEMPROBEIN=config/memprobe.in
MEMPROBEOUT=bin/memprobe
MIMEUNIXIN=config/mimes.unix.in
MIMEWIN32IN=config/mimes.win32.in
MIMEOUT=etc/root.mimes
Fons Rademakers's avatar
Fons Rademakers committed
ROOTDIN=config/rootd.in
ROOTDOUT=etc/rootd
ROOTDXINETDIN=config/rootd.xinetd.in
ROOTDXINETDOUT=etc/rootd.xinetd
PROOFDIN=config/proofd.in
PROOFDOUT=etc/proofd
PROOFDXINETDIN=config/proofd.xinetd.in
PROOFDXINETDOUT=etc/proofd.xinetd
Fons Rademakers's avatar
Fons Rademakers committed
ROOTHELPIN=config/root-help.el.in
ROOTHELPOUT=build/misc/root-help.el
HTMLIN=config/html.C.in
HTMLOUT=macros/html.C
######################################################################
#
### echo %%% Testing the echo features
#
if  `(echo "testing\c"; echo 1,2,3) | grep c > /dev/null` ; then
  if `(echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn > /dev/null`; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi


######################################################################
#
### echo %%% Help function
#
\`configure' configures ROOT $vers to adapt to many kind of systems.

Usage:     $0 [architecture] [flag=value]

The architecture to build for will be guessed from the output of 'uname'.
If, however, that fails, or you don't want the 'native' compiler on the
host platform, you can specify the architecture to use by passing as the
FIRST argument one of the architecures given at the end of this message.

   FLAG            DESCRIPTION               DEFAULT
   --aclocaldir    Autoconf macro install dir(<prefix>/share/aclocal)
   --bindir        Binary installation dir   (<prefix>/bin)
   --build         Build configuration [debug, exceptions, ...],
                   overrides the ROOTBUILD shell variable
   --cintincdir    CINT interpeted headers   (<libdir>/cint)
   --datadir       Data installation dir     (<prefix>/share/root)
   --docdir        Documentation             (<prefix>/share/doc/root)
   --elispdir      Where to put Emacs Lisp   (<prefix>/share/emacs/site-lisp)
   --etcdir        Config installation dir   (/etc/root)
   --fontdir       Font installation dir     (<datadir>/fonts)
   --iconpath      Icon installation dir     (<datadir>/icons)
   --incdir        Header installation dir   (<prefix>/include/root)
   --libdir        Library installation dir  (<prefix>/lib/root)
   --macrodir      Macro installation dir    (<datadir>/macros)
   --mandir        Manpages installation dir (<prefix>/share/man/man1)
   --no-create     Do not create output files, dry run
   --prefix        Installation prefix       (/usr/local)
   --proofdir      PROOF utils dir           (<datadir>/proof)
   --srcdir        Sources installation dir  (<datadir>/src)
   --testdir       Tests                     (<docdir>/test)
   --tutdir        Tutorials                 (<docdir>/tutorial)

If any of the flags --cintincdir, --datadir, --docdir, --etcdir, --iconpath
--incdir, --libdir, --macrodir, --mandir, --prefix, or --proofdir is given,
ROOT will be compiled with static directory names, and you should not set
the ROOTSYS environment variable.

enable/disable options, prefix with either --enable- or --disable-
  afs                AFS support, requires AFS libs and objects
Fons Rademakers's avatar
Fons Rademakers committed
  alien              AliEn support, requires libgliteUI from ALICE
  asimage            Image processing support, requires libAfterImage
  builtin-afterimage Built included libAfterImage, or use system libAfterImage
  builtin-freetype   Built included libfreetype, or use system libfreetype
  builtin-pcre       Built included libpcre, or use system libpcre
  cern               CERNLIB usage, build h2root and g2root
  chirp              Chirp support (Condor remote I/O), requires libchirp_client
  cintex             Build the libCintex Reflex interface library
  clarens            Clarens RPC support, optionally used by PROOF
  dcache             dCache support, requires libdcap from DESY
  exceptions         Turn on compiler exception handling capability
  explicitlink       Explicitly link with all dependent libraries
Fons Rademakers's avatar
Fons Rademakers committed
  gfal               GFAL support, requires libgfal
  globus             Globus authentication support, requires Globus toolkit
  krb5               Kerberos5 support, requires Kerberos libs
  ldap               LDAP support, requires (Open)LDAP libs
  mathcore           Build the new libMathCore math library
  mathmore           Build the new libMathMore extended math library
Rene Brun's avatar
Rene Brun committed
  minuit2            Build the new libMinuit2 minimizer library
Fons Rademakers's avatar
Fons Rademakers committed
  monalisa           Monalisa monitoring support, requires libapmoncpp
  mysql              MySQL support, requires libmysqlclient
  opengl             OpenGL support, requires libGL and libGLU
  oracle             Oracle support, requires libocci
  peac               PEAC, PROOF Enabled Analysis Center, requires Clarens
  pgsql              PostgreSQL support, requires libpq
  pythia             Pythia5 EG support, requires libPythia
  pythia6            Pythia6 EG support, requires libPythia6
  python             Python ROOT bindings, requires python >= 2.1
  qt                 Qt graphics backend, requires libqt >= 3
  reflex             Build the libReflex dictionary library
  rfio               CASTOR support, requires libshift from CASTOR >= 1.5.2
  roofit             Build the libRooFit advanced fitting package
  rpath              Set run-time library load path on executables
  ruby               Ruby ROOT bindings, requires ruby >= 1.8
  sapdb              SapDB support, requires libsqlod and libsqlrte
  shadowpw           Shadow password support
  shared             Use shared 3rd party libraries if possible
  soversion          Set version number in sonames (recommended)
  srp                SRP support, requires SRP source tree
  ssl                SSL encryption support, requires openssl
  table              Build libTable contrib library
  thread             Thread support
  venus              Venus EG support, requires libVenus
  xml                XML parser interface
  xrootd             Build xrootd file server and its client (if supported)
with options, prefix with --with-, enables corresponding support
  afs                AFS support, location of AFS distribution
Fons Rademakers's avatar
Fons Rademakers committed
  alien-incdir       AliEn support, location of gliteUI.h
  alien-libdir       AliEn support, location of libgliteUI
  cern-libdir        HBOOK converter, location of CERNLIB libraries
  chirp-incdir       Chirp support, location of chirp_client.h
  chirp-libdir       Chirp support, location of libchirp_client
Fons Rademakers's avatar
Fons Rademakers committed
  cppunit            Cppunit testing, directory of the cppunit installation
  dcap-incdir        dCache support, location of dcap.h
  dcap-libdir        dCache support, location of libdcap
Fons Rademakers's avatar
Fons Rademakers committed
  dicttype           dictionary type: "cint" (default), "reflex", or "gccxml"
Fons Rademakers's avatar
Fons Rademakers committed
  gfal-incdir        GFAL support, location of gfal_api.h
  gfal-libdir        GFAL support, location of libgfal
  gccxml             Gccxml support, directory of the gccxml installation
Fons Rademakers's avatar
Fons Rademakers committed
  globus             Globus support, path to what should be GLOBUS_LOCATION
  krb5               Kerberos5 support, location of Kerberos distribution
  krb5-incdir        Kerberos5 support, location of krb5.h
  krb5-libdir        Kerberos5 support, location of libkrb5
  ldap-incdir        LDAP support, location of ldap.h
  ldap-libdir        LDAP support, location of libldap
Fons Rademakers's avatar
Fons Rademakers committed
  monalisa-incdir    Monalisa support, location of ApMon.h
  monalisa-libdir    Monalisa support, location of libapmoncpp
  mysql-incdir       MySQL support, location of mysql.h
  mysql-libdir       MySQL support, location of libmysqlclient
  opengl-incdir      OpenGL support, location of GL/gl.h
  opengl-libdir      OpenGL support, location of libGL
  oracle-incdir      Oracle support, location of occi.h
  oracle-libdir      Oracle support, location of libocci
  pgsql-incdir       PostgreSQL support, location of libpq-fe.h
  pgsql-libdir       PostgreSQL support, location of libpq
  pythia-libdir      PYHTIA support, location of libPythia
  pythia6-libdir     PYHTIA6 support, location of libPythia6
  python-incdir      Python support, location of Python.h
  python-libdir      Python support, location of libpython
  qt-incdir          Qt support, location of qt.h
  qt-libdir          Qt support, location of libqt-mt or libqt
  ruby-incdir        Ruby support, location of ruby.h
  ruby-libdir        Ruby support, location of libruby
  sapdb-incdir       SapDB support, location of sql.h
  sapdb-libdir       SapDB support, location of libsqlod
  shift-incdir       CASTOR support, location of stager_api.h
  shift-libdir       CASTOR support, location of libshift
  srp                Secure Remote Passwd support, location of SRP distribution
  srp-incdir         SRP support, location header of t_server.h
  srp-libdir         SRP support, location header of libsrp.a
  ssl-incdir         OpenSSL support, location of openssl headers
  ssl-libdir         OpenSSL support, location of libssl
  sys-iconpath       Extra icon path
  thread-libdir      Thread support, path to libpthread
  venus-libdir       VENUS support, location of libVenus
  xml-incdir         XML support, location of libxml/tree.h
  xml-libdir         XML support, location of libxml2
  x11-libdir         X11 support, path to libX11
  xpm-libdir         XPM support, path to libXpm
Fons Rademakers's avatar
Fons Rademakers committed
  xrootd             XROOTD support, path to alternative XROOTD distribution
Supported Architectures:

EOF
   cat config/ARCHS | sed -e 's/^/   /'
cat <<EOF

Help output is rather long, so you may want to pipe it through a pager, like
for example

  $0 --help | more

Report bugs to <rootdev@root.cern.ch>
######################################################################
#
### echo %%% See if we got the architecture
#
if test $# -lt 1 ; then
      -h|--help) confhelp ; exit 0 ;;
      -*) # in case the first argument wasn't an architecure but an option
          guess_architecture
          ;;
       *)
          arch=$1
          shift
          ;;
# check that we got a valid architecture
if test "$arch" = "linuxegcs" ; then
    arch="linux"
fi
if test "$arch" = "win32gdk" ; then
    arch="win32"
fi

if `awk '{ print $1 }' $ARCHS | grep "^$arch$" > /dev/null  2>&1` ; then
   echo "Configuring for $arch"
else
   echo "Invalid architecture. Try $0 --help"
   exit 1
fi

platform=`grep "^PLATFORM *=" config/Makefile.$arch | awk '{ print $3 }'`

linuxppc64*|sgicc64)
   checkonlylib64="yes" ;;
linuxx8664*)
Fons Rademakers's avatar
Fons Rademakers committed
hpuxia64acc)
   checkhpux64="yes" ;;
Fons Rademakers's avatar
Fons Rademakers committed
case $platform in
win32|linux|macosx)
   gnumake="make" ;;
*)
   gnumake="gmake" ;;
esac

if test "x$platform" = "xmacosx" ; then
Fons Rademakers's avatar
Fons Rademakers committed
   finkdir=`which fink 2>&1 | sed -ne "s/\/bin\/fink//p"`
fi
######################################################################
#
### echo %%% Some clean up
#
trap "rm -f Makefile.tmp config.tmp root-config.tmp rootrc.tmp \
      rootauthrc.tmp rootdaemonrc.tmp memprobe.tmp rootd.tmp \
      proofd.tmp rootd.xinetd.tmp proofd.xinetd.tmp conftest.mk \
      conftest.c conftest; exit 1" 1 2 3 15
######################################################################
#
### echo %%% Command line arguments
#
if test $# -gt 0 ; then
   while test ! "x$1" = "x" ; do
      case "$1" in
      -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
      *) optarg= ;;
      esac

      case $1 in
      --help|-h) confhelp ;   exit 0 ;;
      ################################################################
      #
      # With options to specifiy third part software
      #
Fons Rademakers's avatar
Fons Rademakers committed
      --nohowto)               nohowto="yes"         ;;
      --with-afs=*)            afsdir=$optarg        ; enable_afs="yes"     ;;
      --with-alien-incdir=*)   alienincdir=$optarg   ; enable_alien="yes"   ;;
      --with-alien-libdir=*)   alienlibdir=$optarg   ; enable_alien="yes"   ;;
      --with-afterimage-incdir=*) afterimageincdir=$optarg; enable_builtin_afterimage=no ;;
      --with-afterimage-libdir=*) afterimagelibdir=$optarg; enable_builtin_afterimage=no ;;
      --with-cern-libdir=*)    cernlibdir=$optarg    ; enable_cern="yes"    ;;
      --with-chirp-incdir=*)   chirpincdir=$optarg   ; enable_chirp="yes"   ;;
      --with-chirp-libdir=*)   chirplibdir=$optarg   ; enable_chirp="yes"   ;;
Fons Rademakers's avatar
Fons Rademakers committed
      --with-cppunit=*)        cppunit=$optarg       ;;
      --with-dcap-incdir=*)    dcapincdir=$optarg    ; enable_dcache="yes"  ;;
      --with-dcap-libdir=*)    dcaplibdir=$optarg    ; enable_dcache="yes"  ;;
Fons Rademakers's avatar
Fons Rademakers committed
      --with-dicttype=*)       dicttype=$optarg      ;;
      --with-gfal-incdir=*)    gfalincdir=$optarg    ; enable_gfal="yes"    ;;
      --with-gfal-libdir=*)    gfallibdir=$optarg    ; enable_gfal="yes"    ;;
      --with-globus=*)         globusdir=$optarg     ; enable_globus="yes"  ;;
      --with-gccxml=*)         gccxml=$optarg        ;;
      --with-krb5=*)           krb5dir=$optarg       ; enable_krb5="yes"    ;;
      --with-krb5-incdir=*)    krb5incdir=$optarg    ; enable_krb5="yes"    ;;
      --with-krb5-libdir=*)    krb5libdir=$optarg    ; enable_krb5="yes"    ;;
      --with-ldap-incdir=*)    ldapincdir=$optarg    ; enable_ldap="yes"    ;;
      --with-ldap-libdir=*)    ldaplibdir=$optarg    ; enable_ldap="yes"    ;;
      --with-opengl-incdir=*)  openglincdir=$optarg  ; enable_opengl="yes"  ;;
      --with-opengl-libdir=*)  opengllibdir=$optarg  ; enable_opengl="yes"  ;;
Fons Rademakers's avatar
Fons Rademakers committed
      --with-mysql-incdir=*)   mysqlincdir=$optarg   ; enable_mysql="yes"   ;;
      --with-mysql-libdir=*)   mysqllibdir=$optarg   ; enable_mysql="yes"   ;;
      --with-monalisa-incdir=*)monalisaincdir=$optarg; enable_monalisa="yes";;
      --with-monalisa-libdir=*)monalisalibdir=$optarg; enable_monalisa="yes";;
      --with-oracle-incdir=*)  oracleincdir=$optarg  ; enable_oracle="yes"  ;;
      --with-oracle-libdir=*)  oraclelibdir=$optarg  ; enable_oracle="yes"  ;;
      --with-pgsql-incdir=*)   pgsqlincdir=$optarg   ; enable_pgsql="yes"   ;;
      --with-pgsql-libdir=*)   pgsqllibdir=$optarg   ; enable_pgsql="yes"   ;;
      --with-pythia-libdir=*)  pythialibdir=$optarg  ; enable_pythia="yes"  ;;
      --with-pythia6-libdir=*) pythia6libdir=$optarg ; enable_pythia6="yes" ;;
      --with-python-incdir=*)  pythonincdir=$optarg  ; enable_python="yes"  ;;
      --with-python-libdir=*)  pythonlibdir=$optarg  ; enable_python="yes"  ;;
      --with-qt-incdir=*)      qtincdir=$optarg      ; enable_qt="yes"      ;;
      --with-qt-libdir=*)      qtlibdir=$optarg      ; enable_qt="yes"      ;;
      --with-ruby-incdir=*)    rubyincdir=$optarg    ; enable_ruby="yes"    ;;
      --with-ruby-libdir=*)    rubylibdir=$optarg    ; enable_ruby="yes"    ;;
      --with-sapdb-incdir=*)   sapdbincdir=$optarg   ; enable_sapdb="yes"   ;;
      --with-sapdb-libdir=*)   sapdblibdir=$optarg   ; enable_sapdb="yes"   ;;
      --with-shift-incdir=*)   shiftincdir=$optarg   ; enable_rfio="yes"    ;;
      --with-shift-libdir=*)   shiftlibdir=$optarg   ; enable_rfio="yes"    ;;
      --with-srp=*)            srpdir=$optarg        ; enable_srp="yes"     ;;
      --with-srp-incdir=*)     srpincdir=$optarg     ; enable_srp="yes"     ;;
      --with-srp-libdir=*)     srplibdir=$optarg     ; enable_srp="yes"     ;;
Fons Rademakers's avatar
Fons Rademakers committed
      --with-ssl-incdir=*)     sslincdir=$optarg     ; enable_ssl="yes"     ;;
      --with-ssl-libdir=*)     ssllibdir=$optarg     ; enable_ssl="yes"     ;;
      --with-sys-iconpath=*)   extraiconpath=$optarg ;;
      --with-thread-libdir=*)  threadlibdir=$optarg  ; enable_thread="yes"  ;;
      --with-venus-libdir=*)   venuslibdir=$optarg   ; enable_venus="yes"   ;;
      --with-xml-incdir=*)     xmlincdir=$optarg     ; enable_xml="yes"     ;;
      --with-xml-libdir=*)     xmllibdir=$optarg     ; enable_xml="yes"     ;;
      --with-x11-libdir=*)     x11libdir=$optarg     ;;
      --with-xpm-libdir=*)     xpmlibdir=$optarg     ;;
Fons Rademakers's avatar
Fons Rademakers committed
      --with-xrootd=*)         xrootddir=$optarg     ; enable_xrootd="yes"  ;;
      ################################################################
      #
      # Enable/disable to turn on/off third party software linkage and
      # features
      #
	f=`echo $1 | sed -e 's/--//' -e 's/-/_/g'`
	eval $f=yes
	for c in $options ; do
	   if test "x$c" = "x$f" ; then
	      f=""