Files
org-hyperion-cules/_build
Volker Bandke 072fb1c392 no message
git-svn-id: file:///home/jj/hercules.svn/trunk@406 956126f8-22a0-4046-8f4a-272fa8102e63
2001-10-22 08:44:58 +00:00

83 lines
2.3 KiB
Bash

#!/bin/bash
# +-------------------------------------------------------------------------------+
# ! !
# ! Name: _build !
# ! !
# ! Desc: build Hercules with various options !
# ! !
# ! Use: build [i586 | i686] [fthreads | nofthreads] !
# ! !
# ! Defaults: build `uname -m` fthreads !
# ! !
# ! Last Change: '$Id$'
# ! !
# ! Change log: '$Log$'
# +-------------------------------------------------------------------------------+
if ! test -f configure
then
echo "running autogen.sh"
sh autogen.sh
echo "autogen complete"
fi
THIS_DIR=`pwd`
if [ $# = 0 ]
then
HOST_ARCH=`uname -m`
FTHREAD=yes
BUILD_OPT=
HOST_OPT=
elif [ $# = 1 ]
then
HOST_ARCH=`uname -m`
BUILD_OPT=
HOST_OPT=
FTHREAD=no
if [ $1 = i586 -o $1 = i686 ]
then
HOST_ARCH=$1
HOST_OPT=--host=${HOST_ARCH}-pc-cygwin
BUILD_OPT=--build=${HOST_ARCH}-pc-cygwin
FTHREAD=yes
elif [ $1 = nofthread -o $1 = pthread ]
then
FTHREAD=no
elif [ $1 = fthread -o $1 = nopthread ]
then
FTHREAD=yes
else
echo "Invalid option " $1
exit
fi
elif [ $# = 2 ]
then
HOST_ARCH=$1
HOST_OPT=--host=${HOST_ARCH}-pc-cygwin
BUILD_OPT=--build=${HOST_ARCH}-pc-cygwin
if [ $2 = fthread -o $2 = nopthread ]
then
FTHREAD=yes
elif [ $2 = pthread -o $2 = nofthread ]
then
FTHREAD=no
else
echo "Invalid second parameter: $2"
exit
fi
fi
if [ $FTHREAD = yes ]
then
FDIR=fthread
else
FDIR=pthread
fi
mkdir -p ${HOST_ARCH}_${FDIR}
cd ${HOST_ARCH}_${FDIR}
../configure --prefix=`pwd` ${HOST_OPT} ${BUILD_OPT} --enable-fthreads=${FTHREAD} --enable-custom="compiled for ${HOST_ARCH}"
if [ $? = 0 ]
then
make && make install-strip
else
echo "./configure script failed with RC=" $?
fi
cd ..