#!/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$ # ! Change log: 'Revision 1.10 2001/12/15 21:13:07 vbandke # ! Change log: 'del version.o before build to keep timestamp display current # ! Change log: ' # ! Change log: 'Revision 1.9 2001/10/29 07:02:23 vbandke # ! Change log: 'no message # ! Change log: ' # ! Change log: 'Revision 1.8 2001/10/22 08:49:46 vbandke # ! Change log: 'Id RCS ID String etc # ! Change log: ' # ! Change log: 'Revision 1.7 2001/10/22 08:44:58 vbandke # ! Change log: 'no message # ! # +------------------------------------------------------------------------------- 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 if test -f version.o then rm -f version.o fi make && make install-strip else echo "./configure script failed with RC=" $? fi cd ..