Files
org-hyperion-cules/_build
Volker Bandke 5f99f5075f remove --prefix=pwd from ./configure invocation
git-svn-id: file:///home/jj/hercules.svn/trunk@1072 956126f8-22a0-4046-8f4a-272fa8102e63
2002-12-16 16:19:17 +00:00

173 lines
6.4 KiB
Bash

#!/bin/bash
# +-------------------------------------------------------------------+
# ! !
# ! Name: _hercbuild !
# ! !
# ! Desc: build Hercules with various options !
# ! !
# ! Usage: !
# ! !
# ! >>- build -+------------------------+-+---------------------+->< !
# ! ! ! ! ! !
# ! +- -c --+- i586 -------+-+ +- -t -+-- fthread -+-+ !
# ! ! ! ! ! !
# ! +- i686 -------+ +-- f -------+ !
# ! ! ! ! ! !
# ! +- pentium ----+ +-- pthread -+ !
# ! ! ! ! ! !
# ! +- athlon -----+ +-- p -------+ !
# ! ! ! !
# ! +- pentiumpro -+ !
# ! ! ! !
# ! +- p4 ---------+ !
# ! ! ! !
# ! +- pentium4 ---+ !
# ! !
# ! Defaults: build -c `uname -m` -t f !
# ! !
# +-------------------------------------------------------------------+
# !
# ! Change Log: '$Log$
# ! Change Log: 'Revision 1.15 2002/12/15 21:56:03 vbandke
# ! Change Log: 'Complete rework. Include support for P4 processor
# ! Change Log: '
function lower() {
if [ "${1}X" = "X" ] ; then
RESULT=""
else
RESULT=`echo -E "${1}" | tr [:upper:] [:lower:]`
fi
}
function pause() {
echo -e "Press the ENTER key to continue "
read dummy
}
. set_color_vars
clear
echo -e "\n\n${YELLOW} Building Hercules Binaries from local Source\n${TURQ}"
THREAD_SET=false
CPU_SET=false
AUTO_SET=false
ANSI_SET=true
CPU_TYPE=auto
THREAD_TYPE=fthread
while getopts :c:nt: THE_OPT ; do
lower ${THE_OPT}
THE_OPT=${RESULT}
case ${THE_OPT} in
c) CPU_TYPE=${OPTARG}
CPU_SET=true
;;
n) ANSI_SET=false
;;
t) THREAD_TYPE=${OPTARG}
THREAD_SET=true
;;
:) echo -e "\a${RED}Required information is missing\n"
pause
exit
;;
\?) echo -e "\a${RED}Invalid command switch ${WHITE}${OPTARG}${TURQ}\n"
echo -e "\n${TURQ}Syntax is\n"
echo -e "_hercbuild [-c <cputype>] [-t <threadmodel>] [-n]"
echo -e " ! ! !"
echo -e " ! ! +--- no-ansi, do not"
echo -e " ! ! use fancy colours"
echo -e " ! +---------------------- thread model to use"
echo -e " ! f or fthread (default)"
echo -e " ! p or posix "
echo -e " +------------------------------------- target cpu type "
echo -e " i586 for Pentium "
echo -e " i686 for Pentium Pro "
echo -e " p4 for Pentium 4 "
echo -e " "
echo -e " The default is _build -c `uname -m` -t f"
echo -e " "
pause
exit
;;
esac
done
if ! ${CPU_SET} ; then
CPU_TYPE=`uname -m`
BUILD_OPT=
HOST_OPT=
fi
lower ${CPU_TYPE}
CPU_TYPE=${RESULT}
case ${CPU_TYPE} in
i586 | pentium | athlon)
BUILD_OPT=--build=i586-pc-cygwin
TARG_DIR=i586
;;
i686 | pentiumpro)
BUILD_OPT=--build=i686-pc-cygwin
TARG_DIR=i686
;;
p4 | pentium4)
TARG_DIR=p4
OPTOPT="-fomit-frame-pointer -O6 -march=pentium4 -mcpu=pentium4 "
OPTOPT=${OPTOPT}" -mmmx -msse -msse2 -minline-all-stringops -mfpmath=sse "
OPTOPT=${OPTOPT}" -maccumulate-outgoing-args"
;;
*) echo -e "\a${RED}Invalid CPU type ${WHITE}${CPU_TYPE}${DEFAULT}"
pause
exit
;;
esac
echo -e "${TURQ}Building Hercules binaries for ${WHITE}${CPU_TYPE}${TURQ} processor"
if ! ${THREAD_SET} ; then
THREAD_TYPE=fthread
fi
lower ${THREAD_TYPE}
THREAD_TYPE=${RESULT}
case ${THREAD_TYPE} in
f | fthread | fish ) FTHREAD=yes
THREAD_TYPE="optimzed thread (Fish)"
;;
p | pthread | posix) FTHREAD=no
THREAD_TYPE="standard thread (posix)"
;;
*) echo -e "\a${RED}Invalid thread model ${WHITE}${THREAD_TYPE}${DEFAULT}"
pause
exit
;;
esac
echo -e "${TURQ}Hercules will be using the ${THREAD_TYPE} model"
if ! test -f ./configure -a -f ABOUT-NLS ; then
sh autogen.sh
RC=$?
if [ ${RC} = 0 ] ; then
echo -e "${TURQ}autogen completed successfully"
else
echo -e "${RED}autogen processing failed"
pause
exit
fi
fi
THIS_DIR=${PWD}
if [ $FTHREAD = yes ]
then
FDIR=fthread
else
FDIR=pthread
fi
mkdir -p ${TARG_DIR}_${FDIR}
cd ${TARG_DIR}_${FDIR}
#../configure --prefix=`pwd` ${BUILD_OPT} --enable-fthreads=${FTHREAD} --enable-custom="compiled for ${TARG_DIR}" --enable-optimization="${OPTOPT}"
../configure ${BUILD_OPT} --enable-fthreads=${FTHREAD} --enable-custom="compiled for ${TARG_DIR}" --enable-optimization="${OPTOPT}"
RC=$?
if [ $RC = 0 ]
then
if test -f version.o
then
rm -f version.o
fi
make && make install-strip
else
echo -e "${RED}\a./configure script failed with RC= ${RC}"
fi
cd ..