Skip to content
Snippets Groups Projects
runConfigure 20 KiB
Newer Older
#! /bin/sh
#
# Copyright 1999-2001,2004 The Apache Software Foundation.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#      http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
PeiYong Zhang's avatar
PeiYong Zhang committed
#
#
#
# $Id$
#

#
# runConfigure:
#    This script will run the "configure" script for the appropriate
#    platform. Only supported platforms are recognized.
#
# The following variables are defined and exported at the end of this
# script.
#
# BITSTOBUILD
# TRANSCODER
# MESSAGELOADER
# NETACCESSOR
# CC
# CXX
# CXXFLAGS
# CFLAGS
# LDFLAGS
# LIBS
PeiYong Zhang's avatar
PeiYong Zhang committed
#

usage()
{
    echo "runConfigure: Helper script to run \"configure\" for one of the 
              supported platforms"
PeiYong Zhang's avatar
PeiYong Zhang committed
    echo "Usage: runConfigure \"options\""
    echo "       where options may be any of the following:"
    echo "       -p <platform> (accepts 'aix', 'beos', 'linux', 'freebsd', 
            'netbsd', 'solaris', 'hp-10', 'hp-11', 'openserver', 'unixware', 
David Abram Cargill's avatar
David Abram Cargill committed
            'os400', 'os390', 'irix', 'ptx', 'tru64', 'macosx', 'cygwin', 
            'qnx', 'interix', 'mingw-msys')
            [required; no default]"
    echo "       -c <C compiler name> (e.g. gcc, cc, xlc_r, qcc, icc, icpc or ecc) 
            [default is make default; cc for gnu make]"
    echo "       -x <C++ compiler name> (e.g. g++, CC, aCC, aCC05, xlC_r, xlC_rv5compat, QCC, 
Alberto Massari's avatar
Alberto Massari committed
            icc, icpc or ecc) [default is make default; g++ for gnu make]"
    echo "       -d (specifies that you want to build debug version)
            [default: no debug]"
    echo "       -m <message loader> can be 'inmem', 'icu', 'MsgFile' or 
            'iconv' [default: inmem]"
    echo "       -n <net accessor> can be 'fileonly', 'libwww', 'socket' or 
            'native' [default: socket]"
David Abram Cargill's avatar
David Abram Cargill committed
    echo "       -t <transcoder> can be 'icu', 'Iconv400', 'Uniconv390',  
             'IconvFBSD', 'IconvGNU' or 'native'
             [default: native]"
    echo "       -r <thread option> can be 'pthread' or 'dce' 
             (AIX, HP-11, and Solaris) or  'sproc' (IRIX) or 'none'
             [default: pthread]"
    echo "       -b <bitsToBuild> (accepts '64', '32')"   [default: 32]
PeiYong Zhang's avatar
PeiYong Zhang committed
    echo "       -l <extra linker options>"
    echo "       -z <extra compiler options>"
    echo "       -P <install-prefix>"
    echo "       -C <any one extra configure options>"
    echo "       -h (get help on the above commands)"
PeiYong Zhang's avatar
PeiYong Zhang committed
}

ERROR_EXIT_CODE=1

if test ${1}o = "o"; then
   usage
   exit ${ERROR_EXIT_CODE}
fi

if test ${XERCESCROOT}o = "o"; then
   echo ERROR : You have not set your XERCESCROOT environment variable
   echo Though this environment variable has nothing to do with creating 
   echo makefiles, this is just a general warning to prevent you from 
   echo pitfalls in future. To use this script other than for -h output please
   echo set an environment variable called XERCESCROOT to indicate where you 
   echo installed the XERCES-C files, and run this command again to proceed. 
   echo See the documentation for an example if you are still confused.
   if test $1 != "-h"; then
     exit ${ERROR_EXIT_CODE}
   fi
   echo 
PeiYong Zhang's avatar
PeiYong Zhang committed
fi

if test $1 = "-h"; then
   usage
   exit ${ERROR_EXIT_CODE}
fi

# Set up the default values for each parameter
debug=off                # by default debug is off
transcoder=native        # by default use native transcoder
msgloader=inmem          # by default use inmem message loader
netaccessor=socket       # by default use socket (can do HTTP URL's)
thread=pthread           # by default use POSIX threads
configureoptions=""
bitsToBuild=32           # by default 32 bit build assumed
PeiYong Zhang's avatar
PeiYong Zhang committed

# Check the command line parameters
if test -x /usr/bin/getopt -o -x bin/getopt; then
David Abram Cargill's avatar
David Abram Cargill committed
	#
	# os400 Users will need to comment out the next line.
	getoptErr=`getopt p:c:x:dm:n:t:r:b:l:z:P:C:h $*`
	if [ $? != 0 ]
	   then
	   usage
	   exit ${ERROR_EXIT_CODE}
	fi
	# Now get the command line parameters
	set -- `getopt p:c:x:dm:n:t:r:b:l:z:P:C:h $*`
	while [ $# -gt 0 ]
	   do
	   case $1 in
	   -p)
			platform=$2; shift 2;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -c)
			ccompiler=$2; shift 2;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -x)
			cppcompiler=$2; shift 2;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -d)
			debug=on; shift;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -m)
			msgloader=$2; shift 2;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -n)
			netaccessor=$2; shift 2;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -t)
			transcoder=$2; shift 2;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -r)
			thread=$2; shift 2;;
Tinny Ng's avatar
Tinny Ng committed

	   -b)
			bitsToBuild=$2; shift 2;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -z)
			compileroptions="$compileroptions $2"; shift 2;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -l)
			linkeroptions="$linkeroptions $2"; shift 2;;
	   -P)
			configureoptions="$configureoptions --prefix=$2"; shift 2;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -C)
			configureoptions="$configureoptions $2"; shift 2;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   -h)
			usage
			exit ${ERROR_EXIT_CODE};;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   --)
			shift; break;;
PeiYong Zhang's avatar
PeiYong Zhang committed

	   *)
		   echo "unknown option $1"
		   usage
		   exit ${ERROR_EXIT_CODE};;
	   esac
	done

else
	while getopts "p:c:x:dm:n:t:r:b:l:z:P:C:h" switch; do
	   case $switch in
	   p)
			platform=$OPTARG;;

	   c)
			ccompiler=$OPTARG;;

	   x)
			cppcompiler=$OPTARG;;

	   d)
			debug=on;;

	   m)
			msgloader=$OPTARG;;

	   n)
			netaccessor=$OPTARG;;

	   t)
			transcoder=$OPTARG;;

	   r)
			thread=$OPTARG;;

	   b)
			bitsToBuild=$OPTARG;;

	   z)
			compileroptions="$compileroptions $OPTARG";;

	   l)
			linkeroptions="$linkeroptions $OPTARG";;

	   P)
			configureoptions="$configureoptions --prefix=$OPTARG";;

	   C)
			configureoptions="$configureoptions $OPTARG";;

	   h)
			usage
			exit ${ERROR_EXIT_CODE};;

	   *)
		   echo "unknown option -$switch $OPTARG"
		   usage
		   exit ${ERROR_EXIT_CODE};;
	   esac
	done
fi
PeiYong Zhang's avatar
PeiYong Zhang committed

echo "Generating makefiles with the following options ..."
echo "Platform: $platform"
echo "C Compiler: $ccompiler"
echo "C++ Compiler: $cppcompiler"
echo "Message Loader: $msgloader"
echo "Net Accessor: $netaccessor"
echo "Transcoder: $transcoder"
echo "Thread option: $thread"
echo "bitsToBuild option: $bitsToBuild"
echo "Extra compile options: $compileroptions"
echo "Extra link options: $linkeroptions"
PeiYong Zhang's avatar
PeiYong Zhang committed
echo "Extra configure options: $configureoptions"


#
# Now check if the options are correct or not, bail out if incorrect
#

case $platform in
David Abram Cargill's avatar
David Abram Cargill committed
   aix | openserver | unixware | beos | linux | freebsd | netbsd | solaris | hp-10 | hp-11 | os400 | os390 | irix | ptx | tru64 | macosx | cygwin | qnx | interix | mingw-msys)
PeiYong Zhang's avatar
PeiYong Zhang committed
       # platform has been recognized
       ;;
   *)
      echo "I do not recognize the platform '$platform'. Please type '${0} -h' for help."
      exit ${ERROR_EXIT_CODE};;
esac

#
# Enable debugging or not...
#

if test $debug = "off"; then
    echo "Debug is OFF"
    if test ${SYSOVR}o = "o"; then
      if test $platform = "os400"; then
         echo "NATIVE OS400 BUILD"
         debugflag="";
      elif test $platform = "irix"; then
PeiYong Zhang's avatar
PeiYong Zhang committed
      elif test $platform = "aix"; then
David Abram Cargill's avatar
David Abram Cargill committed
      elif test $platform = "os390"; then
         debugflag="";         
PeiYong Zhang's avatar
PeiYong Zhang committed
      else
PeiYong Zhang's avatar
PeiYong Zhang committed
      fi
    else
      echo "OVERRIDE FOR OS400 ON AIX"
      debugflag="";
    fi
else
    echo "Debug is ON"
    debugflag="-g";
fi


#
# Check for the threading option
#
if test $thread = "none"; then
    THREADS=none
    threadingDefines="-DAPP_NO_THREADS -DXML_USE_NO_THREADS"
David Abram Cargill's avatar
David Abram Cargill committed
    if test $platform = "os400"; then
    	threadingDefines="-DXML_USE_PTHREADS"
    fi
PeiYong Zhang's avatar
PeiYong Zhang committed
else
    THREADS=pthread
    threadingDefines="-DXML_USE_PTHREADS"
    threadingLibs="-lpthread"
    if test $platform = "hp-11"; then
        if test $thread; then
        case $thread in
           pthread)
               ;;
           dce)
               THREADS=dce ;
               threadingLibs="-lcma" ;
               threadingDefines="-D_PTHREADS_DRAFT4 -D_THREAD_SAFE -DXML_USE_DCE" ;;
           *)
               echo "I do not recognize the thread option '$thread'. Please type '${0} -h' for help." ;
               exit ${ERROR_EXIT_CODE};;
        esac
        fi
    elif test $platform = "qnx"; then
        threadingLibs=""; ## QNX has pthread API in libc
    elif test $platform = "openserver"; then
        case $thread in
           pthread)
               if test $cppcompiler = "g++"; then
                  threadingLibs="-Wl,-B,static,-l,pthread,-B,dynamic"
               fi
               ;;
           *)
               echo "I do not recognize the thread option '$thread'."
               echo "Please type '${0} -h' for help."
               exit ${ERROR_EXIT_CODE}
               ;;
        esac
PeiYong Zhang's avatar
PeiYong Zhang committed
    elif test $platform = "freebsd"; then
        threadingLibs="-pthread -lc_r"
        threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS"
    elif test $platform = "netbsd"; then
        threadingLibs="-pthread -lpthread"
        threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS"
PeiYong Zhang's avatar
PeiYong Zhang committed
    elif test $platform = "aix"; then
        aix_version=`./config.guess`;
        echo Found host system to be $aix_version
        case $aix_version in
           *4.3*)
              ## Linkflags control the use of libpthreads on AIX
              threadingLibs="-lpthreads_compat";;
           *)
              threadingLibs="-lpthreads";;
        esac
        if test $thread; then
        case $thread in
           pthread)
               ;;
           dce)
               THREADS=dce ;
               threadingDefines="-DXML_USE_DCE"
               case $aix_version in
                  *4.3*)
                     ## Linkflags control the use of libpthreads on AIX
                     threadingLibs="-ldcelibc_r -ldcepthreads -lpthreads_compat";;
                  *)
                     threadingLibs="-lC_r -lC -ldcelibc_r -ldcepthreads";;
               esac
               ;;
           *)
               echo "I do not recognize the thread option '$thread'. Please type '${0} -h' for help." ;
               exit ${ERROR_EXIT_CODE};;
        esac
        fi
    elif test $platform = "ptx"; then
        threadingLibs=" "
        if test -z $XMLINSTALL; then
            XMLINSTALL=$ICUROOT         ## use either the -C or the -P option now.
        fi
    elif test $platform = "hp-10"; then
        THREADS=dce
        threadingLibs="-lcma"
        threadingDefines="-DXML_USE_DCE"
David Abram Cargill's avatar
David Abram Cargill committed
    elif test $platform = "os390"; then       
        threadingLibs=""
        threadingDefines="-D_OPEN_THREADS"        
PeiYong Zhang's avatar
PeiYong Zhang committed
    elif test $platform = "unixware"; then
        threadingLibs="" ## Linkflags control the use of threads on UnixWare
    elif test $platform = "solaris"; then
        if test $thread; then
        case $thread in
           pthread)
               ;;
           dce)
               THREADS=dce ;
               threadingLibs="-ldce";
               threadingDefines="-DXML_USE_DCE";;
           *)
               echo "I do not recognize the thread option '$thread'. Please type '${0} -h' for help." ;
PeiYong Zhang's avatar
PeiYong Zhang committed
               exit ${ERROR_EXIT_CODE};;
        esac
        fi
    elif test $platform = "irix"; then
        if test $thread; then
        case $thread in
        pthread)
            ;;

        sproc)
            threadingLibs=" ";
            threadingDefines="-DXML_USE_SPROC" ;;
        *)
            echo "I do not recognize the thread option '$thread'. Please type '${0} -h' for help." ;
PeiYong Zhang's avatar
PeiYong Zhang committed
            exit ${ERROR_EXIT_CODE};;
        esac
        fi
    elif test $platform = "mingw-msys"; then
        threadingLibs="-mthreads"
        threadingDefines="-mthreads"
PeiYong Zhang's avatar
PeiYong Zhang committed
    fi
fi

export THREADS

#
# Check for the bitsToBuild option
#

#
#  hp-10 | freebsd | netbsd | irix | openserver | unixware | os400 | ptx | tru64 | macosx
#
if test $bitsToBuild = 64; then
Tinny Ng's avatar
Tinny Ng committed
    bitstobuildDefines=" -DXML_BITSTOBUILD_64 "
PeiYong Zhang's avatar
PeiYong Zhang committed
    bitstobuildLink=" "
    if test $platform; then
        case $platform in
           solaris)
Tinny Ng's avatar
Tinny Ng committed
              bitstobuildDefines=" $bitstobuildDefines -xarch=v9 "
              bitstobuildLink=" -xarch=v9 " ;;
              bitstobuildDefines=" $bitstobuildDefines -q64 -qwarn64 " ;;
           hp-11)
               if test $cppcompiler; then
                   case $cppcompiler in
                       aCC)
                          bitstobuildDefines=" $bitstobuildDefines +DA2.0W "
                          bitstobuildLink=" +DA2.0W " ;;     
                       aCC05)
                          bitstobuildDefines=" $bitstobuildDefines +DD64 "
                          bitstobuildLink=" +DD64 " ;;
                       *)
                       ;;
                   esac
               fi ;;
           linux)
               if test $cppcompiler; then
                   case $cppcompiler in
                       xlC*)
                          bitstobuildDefines=" $bitstobuildDefines -q64 -qwarn64 "
                          bitstobuildLink=" -q64 " ;;
                       *)
                       ;;
                   esac
               fi ;;
           *)
            ;;
        esac
    fi
elif test $bitsToBuild = 32; then
    bitstobuildDefines=" "
PeiYong Zhang's avatar
PeiYong Zhang committed
    bitstobuildLink=" "
else
    echo "I do not recognize the bitsToBuild '$bitsToBuild'. Please type '${0} -h' for help."
    exit ${ERROR_EXIT_CODE};
fi

#
# to export in case it is needed in Makefile.in/Makefine.incl
#
BITSTOBUILD=$bitsToBuild
export BITSTOBUILD
PeiYong Zhang's avatar
PeiYong Zhang committed

#
# Now check for what kind of transcoding service is desired.
#

transcodingDefines="-DXML_USE_NATIVE_TRANSCODER"
TRANSCODER=NATIVE

if test $transcoder; then
case $transcoder in
   icu)
       if test ${ICUROOT}o = "o"; then
           echo '***Error*** ICUROOT environment variable not defined. Exiting...';
           exit ${ERROR_EXIT_CODE};
       fi
       transcodingDefines="-DXML_USE_ICU_TRANSCODER -I${ICUROOT}/include";
       transcodingLibs="-L${ICUROOT} -L${ICUROOT}/lib -L${ICUROOT}/data";
       TRANSCODER=ICU;;
   Iconv400)
       transcodingDefines="-DXML_USE_ICONV400_TRANSCODER" ;
David Abram Cargill's avatar
David Abram Cargill committed
       TRANSCODER=Iconv400 ;;   
   Uniconv390)
       transcodingDefines="-DXML_USE_UNICONV390_TRANSCODER" ;
       TRANSCODER=Uniconv390 ;;
PeiYong Zhang's avatar
PeiYong Zhang committed
   IconvFBSD)
       TRANSCODER=IconvFBSD ;
       transcodingDefines="-DXML_USE_LIBICONV -I/usr/local/include" ;;
   IconvGNU)
       TRANSCODER=IconvGNU ;
       transcodingDefines="-DXML_USE_GNU_TRANSCODER -I/usr/local/include" ;;
PeiYong Zhang's avatar
PeiYong Zhang committed
   native)
 	if test $platform = "cygwin"; then
 	    TRANSCODER=Cygwin ;
 	    transcodingDefines="-DXML_USE_CYGWIN_TRANSCODER" ;
 	elif test $platform = "mingw-msys"; then
 	    TRANSCODER=Cygwin ;
 	    transcodingDefines="-DXML_USE_CYGWIN_TRANSCODER" ;
 	elif test $platform = "freebsd"; then
PeiYong Zhang's avatar
PeiYong Zhang committed
           TRANSCODER=IconvFBSD ;
       fi ;;
   *)
      echo "I do not recognize the transcoder option '$transcoder'. Please type '${0} -h' for help."
      exit ${ERROR_EXIT_CODE};;
esac
fi

export TRANSCODER


#
# Now check for the message loader
#

MESSAGELOADER=INMEM         # By default use in-memory
msgloaderDefines="-DXML_USE_INMEM_MESSAGELOADER"

if test $msgloader ; then
case $msgloader in
PeiYong Zhang's avatar
PeiYong Zhang committed
   icu | ICU)
PeiYong Zhang's avatar
PeiYong Zhang committed
       if test ${ICUROOT}o = "o" ; then
           echo '***Error*** ICUROOT environment variable not defined. Exiting...';
           exit ${ERROR_EXIT_CODE};
       fi
       MESSAGELOADER=ICU;
       msgloaderLibs="-L${ICUROOT} -L${ICUROOT}/lib -L${ICUROOT}/data -L${XERCESCROOT}/lib";
PeiYong Zhang's avatar
PeiYong Zhang committed
       msgloaderDefines="-DXML_USE_ICU_MESSAGELOADER -I${ICUROOT}/include";;
PeiYong Zhang's avatar
PeiYong Zhang committed

   inmem)
       ;;
   MsgFile)
       MESSAGELOADER=MSGFILE;
       msgloaderDefines="-DXML_USE_MSGFILE_MESSAGELOADER" ;;


   iconv)
       MESSAGELOADER=ICONV;
       msgloaderDefines="-DXML_USE_ICONV_MESSAGELOADER" ;;

   *)
      echo "I do not recognize the message loader option '$msgloader'. Please type '${0} -h' for help.";
      exit ${ERROR_EXIT_CODE};;
esac
fi

export MESSAGELOADER




#
# Check for the type of net accessor
#

NETACCESSOR=Socket               # By default use socket (does HTTP URL's)
if test $netaccessor ; then
case $netaccessor in
   fileonly)
       NETACCESSOR=FileOnly
       netaccessorDefines="" ;;

   socket)
       NETACCESSOR=Socket
       netaccessorDefines="-DXML_USE_NETACCESSOR_SOCKET"
       case $platform in
PeiYong Zhang's avatar
PeiYong Zhang committed
               netaccessorLibs="-lnsl -lsocket";;
           hp-11)
               netaccessorLibs="-lnsl";;
           aix)
               #netaccessorLibs="-lbsd";;
               netaccessorLibs="";;
           qnx) 
               netaccessorLibs="-lsocket";;
PeiYong Zhang's avatar
PeiYong Zhang committed
           solaris)
               netaccessorLibs="-lnsl -lsocket"
             if test $thread = "dce"; then
                 netaccessorLibs=""
             fi
             ;;
           *)
               ;;
       esac;;

   libwww)
       NETACCESSOR=LibWWW
       if test -z "`libwww-config --libs 2>/dev/null`" ; then
           echo "Netaccessor is libwww, but libwww-config is not found. Cannot proceed further."
           exit ${ERROR_EXIT_CODE};
       fi
       netaccessorDefines="-DXML_USE_NETACCESSOR_LIBWWW `libwww-config --cflags`"
       netaccessorLibs="`libwww-config --libs`"
       USELIBWWW=1;;

   native)
       if test $platform = "macosx"; then
           NETACCESSOR=NATIVE
           netaccessorDefines="-DXML_USE_NETACCESSOR_NATIVE"
           netaccessorLibs=""
       else
           echo "netaccessor option '$netaccessor' is supported on 'macosx' only."
           exit ${ERROR_EXIT_CODE}
       fi
Tinny Ng's avatar
Tinny Ng committed

PeiYong Zhang's avatar
PeiYong Zhang committed
       ;;

   *)
       echo "I do not recognize the netaccessor option '$netaccessor'. Please type '${0} -h' for help."
       exit ${ERROR_EXIT_CODE};;
esac
fi

export NETACCESSOR



#
# Set the C compiler and C++ compiler environment variables
#

case $cppcompiler in
   xlC_rv5compat)
      CXX="xlC_r"
      CXXVER="v5compat"
      ;;
      
   xlC* | xlc* | g++ | c++ | cc | CC | aCC | icc | icpc | ICC | cxx | ecc | QCC )
      CXX="$cppcompiler"
PeiYong Zhang's avatar
PeiYong Zhang committed
      ;;
   aCC05)
      CXX="aCC"
      CXXVER="aCC05"
      ;;      
   '')
   	  echo "C++ compiler not specified...we'll assume that configure will find it..."
   	  ;;
PeiYong Zhang's avatar
PeiYong Zhang committed

   *)
      echo "I do not recognize the C++ compiler '$cppcompiler'. Continuing anyway..."
PeiYong Zhang's avatar
PeiYong Zhang committed
      ;;
esac

CC="$ccompiler"
export CC

export CXX

export CXXVER

PeiYong Zhang's avatar
PeiYong Zhang committed
#
# Set the extra C and C++ compiler flags
#
# include the user defined CXXFLAGS/CFLAGS first in case they have
# set an platform spefic flags
#

#
# these defines are required when building the DLL
#
buildDefines="-DPROJ_XMLPARSER  -DPROJ_XMLUTIL  -DPROJ_PARSERS  -DPROJ_SAX4C  -DPROJ_SAX2  -DPROJ_DOM -DPROJ_DEPRECATED_DOM -DPROJ_VALIDATORS"

CXXFLAGS="$CXXFLAGS $compileroptions $debugflag $buildDefines $transcodingDefines $msgloaderDefines $threadingDefines $netaccessorDefines $bitstobuildDefines"
PeiYong Zhang's avatar
PeiYong Zhang committed
export CXXFLAGS

CFLAGS="$CFLAGS $compileroptions $debugflag $buildDefines $transcodingDefines $msgloaderDefines $threadingDefines $netaccessorDefines  $bitstobuildDefines"
PeiYong Zhang's avatar
PeiYong Zhang committed
export CFLAGS

# gcc crashes if optimisation is turned on in a Tru64 environment
if test "$platform" = "tru64" -a "$CXX" = "g++"; then
PeiYong Zhang's avatar
PeiYong Zhang committed
    CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-O[0-9]*//g'`
    CFLAGS=`echo $CFLAGS | sed -e 's/-O[0-9]*//g'`
    export CXXFLAGS CFLAGS
fi

PeiYong Zhang's avatar
PeiYong Zhang committed
LDFLAGS="$LDFLAGS $linkeroptions $bitstobuildLink"
PeiYong Zhang's avatar
PeiYong Zhang committed
export LDFLAGS

PeiYong Zhang's avatar
PeiYong Zhang committed
LIBS="$transcodingLibs $msgloaderLibs $threadingLibs $netaccessorLibs"
PeiYong Zhang's avatar
PeiYong Zhang committed
export LIBS


echo
rm -f config.cache
rm -f config.log
rm -f config.status
if test $platform = "os400"; then
./configure --host AS400-OS400 $configureoptions
elif test $platform = "ptx"; then
./configure --prefix=$XMLINSTALL
else
sh ./configure $configureoptions
fi
# exit if configure failed
if test $? != 0; then
  exit 1
fi

echo
echo In future, you may also directly type the following commands to create the Makefiles.
echo
echo export TRANSCODER=\"$TRANSCODER\"
echo export MESSAGELOADER=\"$MESSAGELOADER\"
echo export NETACCESSOR=\"$NETACCESSOR\"
echo export THREADS=\"$THREADS\"
echo export BITSTOBUILD=\"$BITSTOBUILD\"
PeiYong Zhang's avatar
PeiYong Zhang committed
echo export CC=\"$CC\"
echo export CXX=\"$CXX\"
echo export CXXFLAGS=\"$CXXFLAGS\"
echo export CFLAGS=\"$CFLAGS\"
echo export LDFLAGS=\"$LDFLAGS\"
echo export LIBS=\"$LIBS\"
echo configure $configureoptions

echo
echo If the result of the above commands look OK to you, go to the directory
echo ${XERCESCROOT}/src/xercesc and type \"gmake\" to make the XERCES-C system.
PeiYong Zhang's avatar
PeiYong Zhang committed

exit  0;