1
0
Fork 0

Francesco Brisa, Brandano: Updated download_and_compile script

Supports new eventinput option, fixes Atlas issue.
This commit is contained in:
ThorstenB 2011-05-19 20:20:53 +02:00
parent fd0475c032
commit ae211a06f7

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
#* Written by Francesco Angelo Brisa, started January 2008. #* Written by Francesco Angelo Brisa, started January 2008.
# #
# Copyright (C) 2008 Francesco Angelo Brisa - http://brisa.homelinux.net # Copyright (C) 2008 Francesco Angelo Brisa
# email: francesco@brisa.homelinux.net - fbrisa@yahoo.it # email: fbrisa@gmail.com - fbrisa@yahoo.it
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
VERSION="1.2" VERSION="1.4"
#COMPILE GIT FGFS #COMPILE GIT FGFS
@ -46,9 +46,11 @@ DOWNLOAD="y"
JOPTION="" JOPTION=""
OOPTION=""
DEBUG="" DEBUG=""
WITH_EVENT_INPUT=""
while getopts "suhc:p:a:d:r:j:g" OPTION while getopts "suhc:p:a:d:r:j:O:ge" OPTION
do do
case $OPTION in case $OPTION in
s) s)
@ -78,11 +80,19 @@ do
j) j)
JOPTION=" -j"$OPTARG" " JOPTION=" -j"$OPTARG" "
;; ;;
O)
OOPTION=" -O"$OPTARG" "
;;
g) g)
DEBUG="CXXFLAGS=-g" DEBUG="CXXFLAGS=-g"
;; ;;
e)
WITH_EVENT_INPUT="--with-eventinput"
;;
?) ?)
echo "errore" echo "error"
WHATTOBUILD="--help" WHATTOBUILD="--help"
#exit #exit
;; ;;
@ -132,19 +142,21 @@ if [ "$WHATTOBUILD" = "--help" ]
then then
echo "$0 Version $VERSION" echo "$0 Version $VERSION"
echo "Usage:" echo "Usage:"
echo "./$0 [-u] [-h] [-s] [-a y|n] [-c y|n] [-p y|n] [-d y|n] [-r y|n] [ALL|PLIB|OSG|SIMGEAR|FGFS|FGRUN|FGCOM|FGCOMGUI|ATLAS] [UPDATE]" echo "./$0 [-u] [-h] [-s] [-e] [-g] [-a y|n] [-c y|n] [-p y|n] [-d y|n] [-r y|n] [ALL|PLIB|OSG|SIMGEAR|FGFS|FGRUN|FGCOM|FGCOMGUI|ATLAS] [UPDATE]"
echo "* without options it recompiles: PLIB,OSG,SIMGEAR,FGFS,FGRUN" echo "* without options it recompiles: PLIB,OSG,SIMGEAR,FGFS,FGRUN"
echo "* Using ALL compiles everything" echo "* Using ALL compiles everything"
echo "* Adding UPDATE it does not rebuild all (faster but to use only after one successfull first compile)" echo "* Adding UPDATE it does not rebuild all (faster but to use only after one successfull first compile)"
echo "Switches:" echo "Switches:"
echo "* -u such as using UPDATE" echo "* -u such as using UPDATE"
echo "* -h show this help" echo "* -h show this help"
echo "* -e compile FlightGear with --with-eventinput option (experimental)"
echo "* -g compile with debug info for gcc" echo "* -g compile with debug info for gcc"
echo "* -a y|n y=do an apt-get update n=skip apt-get update default=y" echo "* -a y|n y=do an apt-get update n=skip apt-get update default=y"
echo "* -p y|n y=download packages n=skip download packages default=y" echo "* -p y|n y=download packages n=skip download packages default=y"
echo "* -c y|n y=compile programs n=do not compile programs default=y" echo "* -c y|n y=compile programs n=do not compile programs default=y"
echo "* -d y|n y=fetch programs from internet (cvs, svn, etc...) n=do not fetch default=y" echo "* -d y|n y=fetch programs from internet (cvs, svn, etc...) n=do not fetch default=y"
echo "* -j X Add -jX to the make compiolation default=None" echo "* -j X Add -jX to the make compilation default=None"
echo "* -O X Add -OX to the make compilation default=None"
echo "* -r y|n y=reconfigure programs before compiling them n=do not reconfigure default=y" echo "* -r y|n y=reconfigure programs before compiling them n=do not reconfigure default=y"
echo "* -s compile only last stable known versions default=y" echo "* -s compile only last stable known versions default=y"
@ -159,7 +171,7 @@ fi
echo "**************************************" echo "**************************************"
echo "* *" echo "* *"
echo "* Warning, the compilation process *" echo "* Warning, the compilation process *"
echo "* is going to use 7 or more Gbytes *" echo "* is going to use 9 or more Gbytes *"
echo "* of space and at least a couple of *" echo "* of space and at least a couple of *"
echo "* hours to download and build FG. *" echo "* hours to download and build FG. *"
echo "* *" echo "* *"
@ -220,6 +232,7 @@ echo "COMPILE=$COMPILE" >> $LOGFILE
echo "RECONFIGURE=$RECONFIGURE" >> $LOGFILE echo "RECONFIGURE=$RECONFIGURE" >> $LOGFILE
echo "DOWNLOAD=$DOWNLOAD" >> $LOGFILE echo "DOWNLOAD=$DOWNLOAD" >> $LOGFILE
echo "JOPTION=$JOPTION" >> $LOGFILE echo "JOPTION=$JOPTION" >> $LOGFILE
echo "OOPTION=$OOPTION" >> $LOGFILE
echo "DEBUG=$DEBUG" >> $LOGFILE echo "DEBUG=$DEBUG" >> $LOGFILE
@ -394,8 +407,8 @@ then
if [ "$COMPILE" = "y" ] if [ "$COMPILE" = "y" ]
then then
echo "MAKE plib" >> $LOGFILE echo "MAKE plib" >> $LOGFILE
echo "make $JOPTION" >> $LOGFILE echo "make $JOPTION $OOPTION" >> $LOGFILE
make $JOPTION 2>&1 | tee -a $LOGFILE make $JOPTION $OOPTION 2>&1 | tee -a $LOGFILE
if [ ! -d $INSTALL_DIR_PLIB ] if [ ! -d $INSTALL_DIR_PLIB ]
@ -429,7 +442,7 @@ then
echo "****************************************" | tee -a $LOGFILE echo "****************************************" | tee -a $LOGFILE
OSG_SVN=$OSG_UNSTABLE_REVISION OSG_SVN=$OSG_UNSTABLE_REVISION
if [ "$STABLE" = "STABLE" -o "Y" = "Y" ] if [ "$STABLE" = "STABLE" ]
then then
OSG_SVN=$OSG_STABLE_REVISION OSG_SVN=$OSG_STABLE_REVISION
fi fi
@ -462,7 +475,7 @@ then
if [ "$COMPILE" = "y" ] if [ "$COMPILE" = "y" ]
then then
echo "COMPILING OSG" >> $LOGFILE echo "COMPILING OSG" >> $LOGFILE
make $JOPTION 2>&1 | tee -a $LOGFILE make $JOPTION $OOPTION 2>&1 | tee -a $LOGFILE
if [ ! -d $INSTALL_DIR_OSG ] if [ ! -d $INSTALL_DIR_OSG ]
then then
@ -559,8 +572,8 @@ then
if [ "$COMPILE" = "y" ] if [ "$COMPILE" = "y" ]
then then
echo "MAKE SIMGEAR" >> $LOGFILE echo "MAKE SIMGEAR" >> $LOGFILE
echo "make $JOPTION" >> $LOGFILE echo "make $JOPTION $OOPTION " >> $LOGFILE
make $JOPTION 2>&1 | tee -a $LOGFILE make $JOPTION $OOPTION 2>&1 | tee -a $LOGFILE
echo "INSTALL SIMGEAR" >> $LOGFILE echo "INSTALL SIMGEAR" >> $LOGFILE
make install 2>&1 | tee -a $LOGFILE make install 2>&1 | tee -a $LOGFILE
@ -634,16 +647,16 @@ then
./autogen.sh 2>&1 | tee -a $LOGFILE ./autogen.sh 2>&1 | tee -a $LOGFILE
echo "CONFIGURE FGFS" >> $LOGFILE echo "CONFIGURE FGFS" >> $LOGFILE
echo ./configure "$DEBUG" --with-eventinput --prefix=$INSTALL_DIR_FGFS --exec-prefix=$INSTALL_DIR_FGFS --with-osg="$INSTALL_DIR_OSG" --with-simgear="$INSTALL_DIR_SIMGEAR" --with-plib="$INSTALL_DIR_PLIB" echo ./configure "$DEBUG" $WITH_EVENT_INPUT --prefix=$INSTALL_DIR_FGFS --exec-prefix=$INSTALL_DIR_FGFS --with-osg="$INSTALL_DIR_OSG" --with-simgear="$INSTALL_DIR_SIMGEAR" --with-plib="$INSTALL_DIR_PLIB"
./configure "$DEBUG" --with-eventinput --prefix=$INSTALL_DIR_FGFS --exec-prefix=$INSTALL_DIR_FGFS --with-osg="$INSTALL_DIR_OSG" --with-simgear="$INSTALL_DIR_SIMGEAR" --with-plib="$INSTALL_DIR_PLIB" 2>&1 | tee -a $LOGFILE ./configure "$DEBUG" $WITH_EVENT_INPUT --prefix=$INSTALL_DIR_FGFS --exec-prefix=$INSTALL_DIR_FGFS --with-osg="$INSTALL_DIR_OSG" --with-simgear="$INSTALL_DIR_SIMGEAR" --with-plib="$INSTALL_DIR_PLIB" 2>&1 | tee -a $LOGFILE
fi fi
fi fi
if [ "$COMPILE" = "y" ] if [ "$COMPILE" = "y" ]
then then
echo "MAKE FGFS" >> $LOGFILE echo "MAKE FGFS" >> $LOGFILE
echo "make $JOPTION" >> $LOGFILE echo "make $JOPTION $OOPTION" >> $LOGFILE
make $JOPTION 2>&1 | tee -a $LOGFILE make $JOPTION $OOPTION 2>&1 | tee -a $LOGFILE
echo "INSTALL FGFS" >> $LOGFILE echo "INSTALL FGFS" >> $LOGFILE
make install 2>&1 | tee -a $LOGFILE make install 2>&1 | tee -a $LOGFILE
@ -788,8 +801,8 @@ then
if [ "$COMPILE" = "y" ] if [ "$COMPILE" = "y" ]
then then
echo "MAKE FGRUN" >> $LOGFILE echo "MAKE FGRUN" >> $LOGFILE
echo "make $JOPTION" >> $LOGFILE echo "make $JOPTION $OOPTION" >> $LOGFILE
make $JOPTION 2>1 | tee -a $LOGFILE make $JOPTION $OOPTION 2>1 | tee -a $LOGFILE
echo "INSTALL FGRUN" >> $LOGFILE echo "INSTALL FGRUN" >> $LOGFILE
make install 2>&1 | tee -a $LOGFILE make install 2>&1 | tee -a $LOGFILE
@ -849,6 +862,7 @@ then
if [ "$RECONFIGURE" = "y" ] if [ "$RECONFIGURE" = "y" ]
then then
cp Makefile Makefile.original
cat Makefile | sed s/\\//MY_SLASH_HERE/g > Makefile_NOSLASHES cat Makefile | sed s/\\//MY_SLASH_HERE/g > Makefile_NOSLASHES
@ -856,7 +870,7 @@ then
# 1 # 1
INSTALL_DIR_PLIB_NO_SLASHES=$(echo "$INSTALL_DIR_PLIB" | sed -e 's/\//MY_SLASH_HERE/g') INSTALL_DIR_PLIB_NO_SLASHES=$(echo "$INSTALL_DIR_PLIB" | sed -e 's/\//MY_SLASH_HERE/g')
cat Makefile_NOSLASHES | sed s/PLIB_PREFIX:=MY_SLASH_HEREusrMY_SLASH_HERElocalMY_SLASH_HEREsrcMY_SLASH_HEREfgfs-builderMY_SLASH_HEREinstall/PLIB_PREFIX:=$INSTALL_DIR_PLIB_NO_SLASHES/g > Makefile_temp cat Makefile_NOSLASHES | sed s/PLIB_PREFIX\ *:=\ *MY_SLASH_HEREusrMY_SLASH_HERElocalMY_SLASH_HEREsrcMY_SLASH_HEREfgfs-builderMY_SLASH_HEREinstall/PLIB_PREFIX\ :=\ $INSTALL_DIR_PLIB_NO_SLASHES/g > Makefile_temp
mv -f Makefile_temp Makefile_NOSLASHES mv -f Makefile_temp Makefile_NOSLASHES
#2 #2
@ -864,7 +878,7 @@ then
CXXFLAGS2=$CXXFLAGS" -I $INSTALL_DIR_SIMGEAR/include -I $INSTALL_DIR_OSG/include" CXXFLAGS2=$CXXFLAGS" -I $INSTALL_DIR_SIMGEAR/include -I $INSTALL_DIR_OSG/include"
CXXFLAGS3=$(echo $CXXFLAGS2 | sed s/\\//MY_SLASH_HERE/g) CXXFLAGS3=$(echo $CXXFLAGS2 | sed s/\\//MY_SLASH_HERE/g)
cat Makefile_NOSLASHES | sed s/^CXXFLAGS.*/"$CXXFLAGS3"/g > Makefile_temp cat Makefile_NOSLASHES | sed s/^CXXFLAGS\ *:=.*/"$CXXFLAGS3"/g > Makefile_temp
mv -f Makefile_temp Makefile_NOSLASHES mv -f Makefile_temp Makefile_NOSLASHES
#3 #3
@ -879,10 +893,10 @@ then
INSTALL_DIR_FGCOM_NO_SLASHS=$(echo "$INSTALL_DIR_FGCOM" | sed -e 's/\//MY_SLASH_HERE/g') INSTALL_DIR_FGCOM_NO_SLASHS=$(echo "$INSTALL_DIR_FGCOM" | sed -e 's/\//MY_SLASH_HERE/g')
INSTALL_BIN_FGCOM_NO_SLASHS="$INSTALL_DIR_FGCOM_NO_SLASHS""MY_SLASH_HEREbin" INSTALL_BIN_FGCOM_NO_SLASHS="$INSTALL_DIR_FGCOM_NO_SLASHS""MY_SLASH_HEREbin"
cat Makefile_NOSLASHES | sed s/INSTALL_BIN:=MY_SLASH_HEREusrMY_SLASH_HERElocalMY_SLASH_HEREbin/INSTALL_BIN:=$INSTALL_BIN_FGCOM_NO_SLASHS/g > Makefile_temp cat Makefile_NOSLASHES | sed s/INSTALL_BIN\ *:=\ *MY_SLASH_HEREusrMY_SLASH_HERElocalMY_SLASH_HEREbin/INSTALL_BIN\ :=\ $INSTALL_BIN_FGCOM_NO_SLASHS/g > Makefile_temp
mv -f Makefile_temp Makefile_NOSLASHES mv -f Makefile_temp Makefile_NOSLASHES
cat Makefile_NOSLASHES | sed s/INSTALL_DIR:=MY_SLASH_HEREusrMY_SLASH_HERElocal/INSTALL_DIR:=$INSTALL_DIR_FGCOM_NO_SLASHS/g > Makefile_temp cat Makefile_NOSLASHES | sed s/INSTALL_DIR\ *:=\ *MY_SLASH_HEREusrMY_SLASH_HERElocal/INSTALL_DIR\ :=\ $INSTALL_DIR_FGCOM_NO_SLASHS/g > Makefile_temp
mv -f Makefile_temp Makefile_NOSLASHES mv -f Makefile_temp Makefile_NOSLASHES
@ -898,8 +912,8 @@ then
if [ "$COMPILE" = "y" ] if [ "$COMPILE" = "y" ]
then then
echo "MAKE FGCOM" >> $LOGFILE echo "MAKE FGCOM" >> $LOGFILE
echo "make $JOPTION" >> $LOGFILE echo "make $JOPTION $OOPTION" >> $LOGFILE
make $JOPTION 2>&1 | tee -a $LOGFILE make $JOPTION $OOPTION 2>&1 | tee -a $LOGFILE
echo "INSTALL FGCOM" >> $LOGFILE echo "INSTALL FGCOM" >> $LOGFILE
make install 2>&1 | tee -a $LOGFILE make install 2>&1 | tee -a $LOGFILE
@ -1006,7 +1020,11 @@ then
#patch -p0 < atlas-CVS.diff #patch -p0 < atlas-CVS.diff
#cd .. #cd ..
#echo " OK" >> $LOGFILE #echo " OK" >> $LOGFILE
echo "fixing old function name \".get_gbs_center2(\" in Subbucket.cxx"
cd Atlas/src
cp Subbucket.cxx Subbucket.cxx.original
cat Subbucket.cxx.original | sed s/\.get_gbs_center2\(/\.get_gbs_center\(/g > Subbucket.cxx
cd "$CBD"
fi fi
cd Atlas cd Atlas
#cd Atlas-0.3.0 #cd Atlas-0.3.0
@ -1025,8 +1043,8 @@ then
if [ "$COMPILE" = "y" ] if [ "$COMPILE" = "y" ]
then then
echo "MAKE ATLAS" >> $LOGFILE echo "MAKE ATLAS" >> $LOGFILE
echo "make $JOPTION" >> $LOGFILE echo "make $JOPTION $OOPTION" >> $LOGFILE
make $JOPTION 2>&1 | tee -a $LOGFILE make $JOPTION $OOPTION 2>&1 | tee -a $LOGFILE
echo "INSTALL ATLAS" >> $LOGFILE echo "INSTALL ATLAS" >> $LOGFILE
make install 2>&1 | tee -a $LOGFILE make install 2>&1 | tee -a $LOGFILE