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

Last change on this file since 27635 was 27635, checked in by ak19, 11 years ago

Checking return status of compilation so it stops on error.

  • Property svn:executable set to *
File size: 2.7 KB
RevLine 
[27131]1#!/bin/bash
2
3# run as: ./makegs2.sh
[27134]4# or ./makegs2.sh gnome-lib to check out gnome-lib src from svn
[27131]5
6# NOT SUPPORTED YET: or run as ./makegs2.sh min
7# to check out gnome-lib minimal binary from svn (won't be working out
8# which minimal version is required for now, 32/64 bit, linux/darwin)
9
10gsdlhome=`pwd`
11echo "**** GSDLHOME: $gsdlhome"
12docheckout=$1
13
14gnomelibsrc=$gsdlhome/ext/gnome-lib
15gnomelibbin=$gsdlhome/ext/gnome-lib-minimal
16gnomelib=
17
18
19# 1. grab gnome-lib src (or bin eventually) from svn if told to
[27134]20if [ "x$docheckout" = "xgnome-lib" ]; then
21 if [ ! -d "$gnomelibsrc" ]; then
22 echo "**** $gnomelibsrc doesn't yet exist. Checking out from SVN..."
[27131]23 svn co http://svn.greenstone.org/gs2-extensions/gnome-lib/trunk/src ext/gnome-lib
24 fi
25#elif [ "x$docheckout" = "xmin" ]; then
26# work out os and bit-architecture
27# and then can get the correct gnome-lib bin version for this from svn
28fi
29
30
31# 2. compile gnome-lib if we need to
32if [ -d "$gnomelibbin" ]; then
33
34 echo "**** Found a gnomelib binary"
35 gnomelib=$gnomelibbin
36
37elif [ -d "$gnomelibsrc" ]; then
38
39 echo "**** Found a gnomelib src folder"
40 gnomelib=$gnomelibsrc
41
42 if [ -d "$gnomelibsrc/linux" ]; then
43 echo "*** gnomelib already compiled up in $gnomelibsrc/linux"
44 else
45 echo "*** Going to compile up the $gnomelibsrc folder"
46 cd $gnomelib
47 ./CASCADE-MAKE.sh
[27635]48 gnomestatus=$?
49 if [ $gnomestatus != 0 ] ; then
50 echo "****************************************"
51 echo "@@@ Failed to compile up gnomelib successfully"
52 echo "****************************************"
53 exit -1
54 fi
[27131]55 #cd $gsdlhome
56 fi
57else
58 echo "@@@@ No gnome-lib found.... Proceding to compile without it..."
59 echo "@@@@ Assuming this is what you want (Ctrl-C to cancel compilation)"
60 sleep 3
61fi
62
63
64# 3. set up compiling environment to use gnome-lib, if there is a gnome-lib
65if [ ! -z "$gnomelib" ] ; then
66 echo "***** gnomelib folder: $gnomelib"
67 cd $gnomelib
68 source devel.bash
69 #cd $gsdlhome
70fi
71
72
73# 4. now can compile as usual, having set up the environment for wvware
[27635]74# chain the commands with && so it stops at that stage after an error
[27131]75cd $gsdlhome
[27635]76./configure --enable-apache-httpd \
77 && make \
78 && make install
[27131]79
[27635]80status=$?
81echo "****************************************"
82if [ $status = 0 ] ; then
83 # 5. Message to warn user that the env of this x-term uses gnome-lib
84 # and GUIs may not work from this console
[27131]85
[27635]86 echo "*** The environment for this console has been set to compile Greenstone with gnome-lib."
87 echo "*** As a result, graphical applications may not work well."
88 echo "*** In such a case, open a new console."
89
90else
91 echo "@@@ Error compiling up Greenstone. Return status: $status"
92fi
93echo "****************************************"
94
95
96
Note: See TracBrowser for help on using the repository browser.