| #!/bin/sh |
| |
| |
| # |
| # The Apache Software License, Version 1.1 |
| # |
| # Copyright (c) 1999 The Apache Software Foundation. All rights |
| # reserved. |
| # |
| # Redistribution and use in source and binary forms, with or without |
| # modification, are permitted provided that the following conditions |
| # are met: |
| # |
| # 1. Redistributions of source code must retain the above copyright |
| # notice, this list of conditions and the following disclaimer. |
| # |
| # 2. Redistributions in binary form must reproduce the above copyright |
| # notice, this list of conditions and the following disclaimer in |
| # the documentation and/or other materials provided with the |
| # distribution. |
| # |
| # 3. The end-user documentation included with the redistribution, |
| # if any, must include the following acknowledgment: |
| # "This product includes software developed by the |
| # Apache Software Foundation (http://www.apache.org/)." |
| # Alternately, this acknowledgment may appear in the software itself, |
| # if and wherever such third-party acknowledgments normally appear. |
| # |
| # 4. The names "Xerces" and "Apache Software Foundation" must |
| # not be used to endorse or promote products derived from this |
| # software without prior written permission. For written |
| # permission, please contact apache\@apache.org. |
| # |
| # 5. Products derived from this software may not be called "Apache", |
| # nor may "Apache" appear in their name, without prior written |
| # permission of the Apache Software Foundation. |
| # |
| # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
| # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| # DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR |
| # ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
| # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| # SUCH DAMAGE. |
| # ==================================================================== |
| # |
| # This software consists of voluntary contributions made by many |
| # individuals on behalf of the Apache Software Foundation, and was |
| # originally based on software copyright (c) 1999, International |
| # Business Machines, Inc., http://www.ibm.com . For more information |
| # on the Apache Software Foundation, please see |
| # <http://www.apache.org/>. |
| # |
| # |
| # $Log$ |
| # Revision 1.1 1999/11/09 01:02:57 twl |
| # Initial revision |
| # |
| # Revision 1.4 1999/11/08 20:44:09 rahul |
| # Swat for adding in Product name and CVS comment log variable. |
| # |
| # |
| |
| # |
| # runConfigure : This script will run the "configure" script for the appropriate platform |
| # Only supported platforms are recognized |
| |
| usage() |
| { |
| echo "runConfigure: Helper script to run \"configure\" for one of the supported platforms" |
| echo "Usage: runConfigure \"options\"" |
| echo " where options may be any of the following:" |
| echo " -p <platform> (accepts 'aix', 'linux', 'solaris', 'hp-10', 'hp-11')" |
| echo " -c <C compiler name> (e.g. gcc or xlc)" |
| echo " -x <C++ compiler name> (e.g. g++ or xlC)" |
| echo " -d (specifies that you want to build debug version)" |
| echo " -m <message loader> can be 'inmem', 'icu' or 'iconv'" |
| echo " -n <net accessor> can be 'fileonly' or 'libwww'" |
| echo " -t <transcoder> can be 'icu' or 'native'" |
| echo " -r <thread option> can be 'pthread' or 'dce' (only used on HP-11)" |
| echo " -l <extra linker options>" |
| echo " -z <extra compiler options>" |
| echo " -h (to get help on the above commands)" |
| } |
| |
| if test ${1}o = "o"; then |
| usage |
| exit -1 |
| fi |
| |
| if test ${XML4CROOT}o = "o"; then |
| echo ERROR : You have not set your XML4CROOT environment variable |
| echo Though this environment variable has nothing to do with creating makefiles, |
| echo this is just a general warning to prevent you from pitfalls in future. Please |
| echo set an environment variable called XML4CROOT to indicate where you installed |
| echo the XML4C files, and run this command again to proceed. See the documentation |
| echo for an example if you are still confused. |
| exit -1 |
| fi |
| |
| if test $1 = "-h"; then |
| usage |
| exit -1 |
| fi |
| |
| # Get the command line parameters |
| set -- `getopt p:c:x:dm:n:t:r:l:z:h $*` |
| if [ $? != 0 ] |
| then |
| usage |
| exit -1 |
| fi |
| |
| # Set up the default values for each parameter |
| debug=off # by default debug is off |
| transcoder=native # by default use native transcoder |
| msgloader=iconv # by default use native transcoder |
| netaccessor=fileonly # by default use fileonly |
| |
| for i in $* |
| do |
| case $i in |
| -p) |
| platform=$2; shift 2;; |
| |
| -c) |
| ccompiler=$2; shift 2;; |
| |
| -x) |
| cppcompiler=$2; shift 2;; |
| |
| -d) |
| debug=on; shift;; |
| |
| -m) |
| msgloader=$2; shift 2;; |
| |
| -n) |
| netaccessor=$2; shift 2;; |
| |
| -t) |
| transcoder=$2; shift 2;; |
| |
| -r) |
| thread=$2; shift 2;; |
| |
| -l) |
| linkeroption=$2; shift 2;; |
| |
| -z) |
| compileroption=$2; shift 2;; |
| |
| -h) |
| usage |
| exit -1;; |
| |
| --) |
| shift; break;; |
| esac |
| done |
| |
| echo "Generating makefiles with the following options ..." |
| echo "Platform: $platform" |
| echo "C Compiler: $ccompiler" |
| echo "C++ Compiler: $cppcompiler" |
| echo "Extra compile options: $compileroption" |
| echo "Extra link options: $linkeroption" |
| if test $debug = "off"; then |
| echo "Debug is OFF" |
| debugflag="-w -O"; |
| else |
| echo "Debug is ON" |
| debugflag="-g"; |
| fi |
| echo "Message Loader: $msgloader" |
| echo "Net Accessor: $netaccessor" |
| echo "Transcoder: $transcoder" |
| echo "Thread option: $thread" |
| |
| # Now check if the options are correct or not, bail out if incorrect |
| case $platform in |
| aix | linux | solaris | hp-10 | hp-11) |
| # platform has been recognized |
| ;; |
| *) |
| echo "I do not recognize the platform '$platform'. Please type '${0} -h' for help." |
| exit -1;; |
| esac |
| |
| # Now check for the transcoder |
| transcoderoption="-DXML_USE_NATIVE_TRANSCODER" |
| TRANSCODER=NATIVE |
| |
| if test $transcoder; then |
| case $transcoder in |
| icu) |
| transcoderoption="-DXML_USE_ICU_TRANSCODER" ; |
| TRANSCODER=ICU ;; |
| |
| native) |
| transcoderoption="-DXML_USE_NATIVE_TRANSCODER" ; |
| TRANSCODER=NATIVE ;; |
| |
| *) |
| echo "I do not recognize the transcoder option '$transcoder'. Please type '${0} -h' for help." |
| exit -1;; |
| esac |
| fi |
| |
| export TRANSCODER |
| |
| # Now check for the message loader |
| MESSAGELOADER=INMEM; # By default use in-memory |
| msgloaderoption="-DXML_USE_INMEM_MESSAGELOADER" |
| |
| if test $msgloader ; then |
| case $msgloader in |
| icu) |
| MESSAGELOADER=ICU; |
| msgloaderoption="-DXML_USE_ICU_MESSAGELOADER" ;; |
| |
| inmem) |
| MESSAGELOADER=INMEM; |
| msgloaderoption="-DXML_USE_INMEM_MESSAGELOADER" ;; |
| |
| iconv) |
| MESSAGELOADER=ICONV; |
| msgloaderoption="-DXML_USE_ICONV_MESSAGELOADER" ;; |
| |
| *) |
| echo "I do not recognize the message loader option '$msgloader'. Please type '${0} -h' for help." |
| exit -1;; |
| esac |
| fi |
| |
| export MESSAGELOADER |
| |
| # Check for the threading option only for hp-11 |
| if test $platform = "hp-11"; then |
| if test $thread; then |
| case $thread in |
| pthread) |
| threadingoption="-DXML_USE_PTHREAD" ;; |
| |
| dce) |
| threadingoption="-DXML_USE_DCE" ;; |
| |
| *) |
| echo "I do not recognize the thread option '$thread'. Please type '${0} -h' for help." |
| exit -1;; |
| esac |
| else |
| echo "You must provide a thread option for HPUX-11". Cannot proceed any further. |
| exit -1; |
| fi |
| fi |
| |
| # Set the C compiler and C++ compiler environment variables |
| CC=$ccompiler; export CC |
| CXX=$cppcompiler; export CXX |
| |
| case $cppcompiler in |
| xlC | xlc | xlC_r | xlc_r) |
| LDFLAGS="-lC"; export LDFLAGS |
| LIBS="-L/usr/lpp/xlC/lib"; export LIBS ;; |
| |
| g++ | c++) |
| LDFLAGS="-lc"; export LDFLAGS |
| LIBS="-L/usr/local/lib"; export LIBS ;; |
| |
| cc | CC) |
| LDFLAGS="-lC"; export LDFLAGS |
| LIBS="-L/usr/lib -L/usr/ccs/lib"; export LIBS ;; |
| |
| acc | aCC) |
| LDFLAGS="-lC"; export LDFLAGS |
| LIBS="-L/usr/lib -L/opt/aCC/lib"; export LIBS ;; |
| |
| *) |
| echo "I do not recognize the C++ compiler '$cppcompiler'. Continuing anyway ..." |
| ;; |
| esac |
| |
| USELIBWWW=0; # By default use file-only |
| # Check for the type of net accessor |
| if test $netaccessor ; then |
| case $netaccessor in |
| fileonly) |
| netaccessoroption="" ;; |
| |
| libwww) |
| if test -z ${LIBWWWROOT} ; then |
| echo "You have not defined your LIBWWWROOT environment variable. Cannot proceed further ..." |
| exit -1; |
| fi |
| netaccessoroption="-DXML_USE_NETACCESSOR_LIBWWW -I${LIBWWWROOT}/include" ; |
| LIBS="$LIBS -L${LIBWWWROOT}/lib -lwww"; |
| USELIBWWW=1;; |
| |
| *) |
| echo "I do not recognize the netaccessor option '$netaccessor'. Please type '${0} -h' for help." |
| exit -1;; |
| esac |
| fi |
| |
| export USELIBWWW; |
| |
| # Set the extra C and C++ compiler flags |
| CXXFLAGS="$debugflag $compileroption $transcoderoption $msgloaderoption $threadingoption $netaccessoroption"; export CXXFLAGS |
| CFLAGS="$debugflag $compileroption $transcoderoption $msgloaderoption $threadingoption $netaccessoroption"; export CFLAGS |
| |
| echo |
| rm -f config.cache |
| rm -f config.log |
| rm -f config.status |
| ./configure |
| |
| echo |
| echo If the result of the above commands look OK to you, go to the directory |
| echo ${XML4CROOT}/src and type \"make\" to make the XML4C system. |
| |
| exit 0; |
| |