1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # run as: ./makegs2.sh
|
---|
4 | # or ./makegs2.sh gnome-lib to compile GS2 using gnome-lib
|
---|
5 | # which checks out gnome-lib src from svn if needed and if possible
|
---|
6 |
|
---|
7 | docheckout=$1
|
---|
8 | gsdlhome=`pwd`
|
---|
9 | echo "**** GSDLHOME: $gsdlhome"
|
---|
10 |
|
---|
11 | bitness=`uname -m`
|
---|
12 | # if we're 64 bit, add -fPIC to CFLAGS. Check if bitness contains substring "64"
|
---|
13 | if [[ $bitness == *"64"* ]]; then
|
---|
14 | export CFLAGS="-fPIC $CFLAGS"
|
---|
15 | echo "64 bit unix system, incl -fPIC in CFLAGS so it is now: $CFLAGS"
|
---|
16 | fi
|
---|
17 |
|
---|
18 | # Compile by chaining the commands with && so it stops at that stage after an error
|
---|
19 | cd $gsdlhome
|
---|
20 | if [ "x$docheckout" = "xgnome-lib" ]; then
|
---|
21 | ./configure --enable-gnome-lib-ext --enable-apache-httpd \
|
---|
22 | && make \
|
---|
23 | && make install
|
---|
24 | else
|
---|
25 | ./configure --enable-apache-httpd \
|
---|
26 | && make \
|
---|
27 | && make install
|
---|
28 | fi
|
---|
29 |
|
---|
30 | status=$?
|
---|
31 | echo "****************************************"
|
---|
32 | if [ $status = 0 ] ; then
|
---|
33 | # 5. Message to warn user that the env of this x-term uses gnome-lib
|
---|
34 | # and GUIs may not work from this console
|
---|
35 | if [ "x$docheckout" = "xgnome-lib" ]; then
|
---|
36 | echo "*** The environment for this console has been set to compile Greenstone with gnome-lib."
|
---|
37 | echo "*** As a result, graphical applications may not work well."
|
---|
38 | echo "*** In such a case, open a new console."
|
---|
39 | else
|
---|
40 | echo "Finished compiling Greenstone2. (Compiled without gnome-lib)"
|
---|
41 | fi
|
---|
42 | else
|
---|
43 | echo "@@@ Error compiling up Greenstone. Return status: $status"
|
---|
44 | fi
|
---|
45 | if [[ $bitness == *"64"* ]]; then
|
---|
46 | echo ""
|
---|
47 | echo "This unix is 64 bit. So added -fPIC to CFLAGS, which is now: $CFLAGS"
|
---|
48 | fi
|
---|
49 | echo "****************************************"
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|