source: main/trunk/greenstone2/makegs2.sh@ 31903

Last change on this file since 31903 was 31732, checked in by ak19, 7 years ago

Developers' GS2 compile bash script now adds -fPIC to CFLAGS on unix. Else it's easy to forget to add manually to the unix env, and wastes time when compiling GS2. Untested on Macs.

  • Property svn:executable set to *
File size: 1.5 KB
Line 
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
7docheckout=$1
8gsdlhome=`pwd`
9echo "**** GSDLHOME: $gsdlhome"
10
11bitness=`uname -m`
12# if we're 64 bit, add -fPIC to CFLAGS. Check if bitness contains substring "64"
13if [[ $bitness == *"64"* ]]; then
14 export CFLAGS="-fPIC $CFLAGS"
15 echo "64 bit unix system, incl -fPIC in CFLAGS so it is now: $CFLAGS"
16fi
17
18# Compile by chaining the commands with && so it stops at that stage after an error
19cd $gsdlhome
20if [ "x$docheckout" = "xgnome-lib" ]; then
21 ./configure --enable-gnome-lib-ext --enable-apache-httpd \
22 && make \
23 && make install
24else
25 ./configure --enable-apache-httpd \
26 && make \
27 && make install
28fi
29
30status=$?
31echo "****************************************"
32if [ $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
42else
43 echo "@@@ Error compiling up Greenstone. Return status: $status"
44fi
45if [[ $bitness == *"64"* ]]; then
46 echo ""
47 echo "This unix is 64 bit. So added -fPIC to CFLAGS, which is now: $CFLAGS"
48fi
49echo "****************************************"
50
51
52
Note: See TracBrowser for help on using the repository browser.