#!/bin/bash # run as: ./makegs2.sh # or ./makegs2.sh gnome-lib to compile GS2 using gnome-lib # which checks out gnome-lib src from svn if needed and if possible docheckout=$1 gsdlhome=`pwd` echo "**** GSDLHOME: $gsdlhome" bitness=`uname -m` # if we're 64 bit, add -fPIC to CFLAGS. Check if bitness contains substring "64" if [[ $bitness == *"64"* ]]; then export CFLAGS="-fPIC $CFLAGS" echo "64 bit unix system, incl -fPIC in CFLAGS so it is now: $CFLAGS" fi # Compile by chaining the commands with && so it stops at that stage after an error cd $gsdlhome if [ "x$docheckout" = "xgnome-lib" ]; then ./configure --enable-gnome-lib-ext --enable-apache-httpd \ && make \ && make install else ./configure --enable-apache-httpd \ && make \ && make install fi status=$? echo "****************************************" if [ $status = 0 ] ; then # 5. Message to warn user that the env of this x-term uses gnome-lib # and GUIs may not work from this console if [ "x$docheckout" = "xgnome-lib" ]; then echo "*** The environment for this console has been set to compile Greenstone with gnome-lib." echo "*** As a result, graphical applications may not work well." echo "*** In such a case, open a new console." else echo "Finished compiling Greenstone2. (Compiled without gnome-lib)" fi else echo "@@@ Error compiling up Greenstone. Return status: $status" fi if [[ $bitness == *"64"* ]]; then echo "" echo "This unix is 64 bit. So added -fPIC to CFLAGS, which is now: $CFLAGS" fi echo "****************************************"