root/main/trunk/greenstone2/runtime-src/packages/configure @ 26552

Revision 26552, 6.7 KB (checked in by sjm84, 7 years ago)

Fixing apache finding the system sqlite instread of the one bundled with Greenstone

  • Property svn:executable set to *
Line 
1#! /bin/sh
2
3PACKAGES=`pwd`
4cd ../..
5GSDLHOME=`pwd`
6cd $PACKAGES
7
8GSDLOS=`uname -s |tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
9# check for running bash under cygwin
10if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
11then
12 GSDLOS=windows
13fi
14
15prefix=""
16bindir=""
17HOSTTARGETFLAGS=""
18
19# only some of the packages can take environment variables as options to
20# configure
21# format is VAR=value, e.g "LDFLAGS=-static"
22ENVIRONMENT=""
23
24# GDBM compilation enabled by default, can switch it off with --disable-gdbm
25USE_GDBM=true
26# JDBM compilation enabled by default, can switch it off with --disable-jdbm
27USE_JDBM=true
28# SQLite support enabled by default, can switch it off with --disable-sqlite
29USE_SQLITE=true
30# yaz compilation enabled by default, can switch it off with --disable-yaz
31USE_YAZ=true
32# z3950 server disabled by default, switch it on with --enable-z3950
33USE_Z3950=false
34# CORBA support disabled by default, switch it on with --enable-corba
35USE_CORBA=false
36MICO_DIR=default
37# Apache's httpd (web server) enabled by default
38USE_APACHE_HTTPD=false
39
40# parse any arguments given from toplevel configure
41while test $# -ne 0; do
42    case "$1" in
43    --cache-file=*)
44        cache_filename=`echo $1 | sed s/--cache-file=//`
45        # turn relative path into an absolute path
46        cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
47        cache_dir=`cd $cache_dir 2>/dev/null && pwd`
48
49        cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
50        cache_file="$cache_dir/$cache_basefile"
51        if test ! -f "$cache_file"; then
52        CACHE_FILE=""
53        else
54        CACHE_FILE="--cache-file=$cache_file"
55        fi
56        ;;
57    --disable-gdbm)
58        USE_GDBM=false
59        ;;
60    --disable-jdbm)
61        USE_JDBM=false
62        ;;
63    --disable-sqlite)
64        USE_SQLITE=false
65        ;;
66    --disable-yaz)
67        USE_YAZ=false
68        ;;
69    --enable-z3950)
70        USE_Z3950=true
71        ;;
72    --enable-corba)
73        USE_CORBA=true
74        ;;
75    --with-micodir=*)
76        if test $1 = ""; then
77          $1 = "default"
78            fi
79        MICO_DIR=$1
80        ;;       
81    --enable-apache-httpd)
82        USE_APACHE_HTTPD=true
83        ;;
84    --prefix=*)
85        prefix=`echo $1 | sed s/--prefix=//`
86        ;;
87    --bindir=*)
88        # where to install binaries to
89        bindir=`echo $1 | sed s/--bindir=//`
90        # turn relative path into an absolute path
91        if test -d "$bindir" ; then
92          bindir=`cd "$bindir" ; pwd `
93          cd "$PACKAGES"
94        elif test -z `echo $bindir | sed '/^\// p;D'` ; then
95          rel_bindir="`echo $bindir | sed s@/.*@@`"
96          cd "$rel_bindir"
97          bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
98          cd "$PACKAGES"
99        else
100          # bindir doesn't exist, and isn't relative
101          true
102        fi
103        ;;
104    --host=* | --target=*)
105        HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
106        ;;
107    *)
108        # ignore all other options for now
109        ;;
110    esac
111    shift
112done
113
114# note! Our GSDL package currently always installs into it's source
115# directory, ignoring any --prefix given to configure.
116# When this is fixed, uncomment the relevant lines below...
117
118##if test -z "$prefix" ; then
119prefix="${GSDLHOME}"
120##fi
121
122##if test -z "$bindir" ; then
123bindir="${prefix}/bin/$GSDLOS"
124##fi
125
126# This loads the top configure's cache file, with variables already set.
127if test -f "$cache_file" ; then
128  . $cache_file
129fi
130
131# we assume that gzip and tar are on the search path.
132# non-GNU versions of tar don't take the -z option.
133
134if test $USE_CORBA = true ; then
135  if test $MICO_DIR = default; then
136    # configure the MICO CORBA ORB
137    echo ""
138    echo "Configuring MICO CORBA"
139    echo ""
140
141    cd "$PACKAGES/mico"
142    gzip -dc mico-2.3.13-gs.tar.gz | tar -xf -
143    cd mico && \
144    ./configure $CACHE_FILE    --prefix=$PACKAGES/mico/  --disable-coss --disable-naming --disable-relship --disable-events --disable-streams --disable-property --disable-trader --disable-time
145#--disable-debug
146#--enable-optimize --enable-final --enable-speed-tune
147#    sed 's/tools//'  $PACKAGES/mico/mico/Makefile | sed 's/ldconfig//' >$PACKAGES/mico/mico/Makefile.out
148
149# Remove any references to running 'tools' and 'ldconfig' as these require
150# admin permissions when running 'make install'.
151# Use fgrep here to knock out the entire line containing $(LDCONFIG), because
152# there may be a special tab preceding the line which in a Makefile can have
153# special meaning. Don't want to leave it in by itself.
154    sed 's/tools//'  $PACKAGES/mico/mico/Makefile | fgrep -iv ldconfig >$PACKAGES/mico/mico/Makefile.out
155    mv $PACKAGES/mico/mico/Makefile.out $PACKAGES/mico/mico/Makefile
156  else
157    #MICO is on the system path
158    echo ""
159    echo "Taking MICO from system paths"
160    echo ""
161  fi
162else
163  echo "corba support disabled - mico compiler not required."
164  echo "  add '--enable-corba' to the configure command to include corba support."
165  echo ""
166fi
167
168
169
170# D2M stuff needed for z3950server
171echo ""
172echo "Configuring D2M"
173if test x$USE_Z3950 = xtrue ;
174then
175  USE_YAZ=true
176  echo ""
177  cd "$PACKAGES/d2m"
178  ./configure $CACHE_FILE --prefix="$PACKAGES/d2m" $HOSTTARGETFLAGS
179else
180  echo "Z39.50 support disabled - D2M library not required."
181  echo "  add '--enable-z3950' to the configure command to include z39.50 support."
182  echo ""
183fi
184   
185# YAZ Z39.50 toolkit
186echo ""
187echo "Configuring YAZ"
188if test x$USE_YAZ = xtrue ;
189then
190  echo "YAZ library support enabled"
191  echo "add --disable-yaz to the configure command to disable this"
192  echo ""
193  cd "$PACKAGES/yaz"
194  gzip -dc yaz-2.1.4.tar.gz | tar -xf -
195  cd yaz-2.1.4 && \
196    ./configure $CACHE_FILE --prefix="$PACKAGES/yaz" --bindir="$bindir" $HOSTTARGETFLAGS
197else
198  echo "YAZ support disabled"
199  echo ""
200fi
201
202
203# Apache's HTTPD web server
204echo ""
205echo "Configuring Apache httpd"
206if test x$USE_APACHE_HTTPD = xtrue ;
207then
208  echo "Apache httpd support enabled"
209  echo "add --disable-apache-httpd to the configure command to disable this"
210  echo ""
211#  echo "Setting up libiconv (used by Apache httpd)"
212#  cd "$PACKAGES/apache-httpd"
213#  if [ ! -e libiconv-1.13.1 ] ; then gzip -dc libiconv-1.13.1.tar.gz | tar -xf - ; fi
214#  cd libiconv-1.13.1&& \
215#    ./configure $CACHE_FILE --prefix="${prefix}/apache-httpd/${GSDLOS}" --disable-shared $HOSTTARGETFLAGS&&
216#    make && make install
217#  echo ""
218  echo "Configuring Apache httpd"
219  cd "$PACKAGES/apache-httpd"
220  if [ ! -e httpd-2.2.11 ] ; then gzip -dc httpd-2.2.11-gs.tar.gz | tar -xf - ; fi
221  cd httpd-2.2.11&& \
222
223CFLAGS="$CFLAGS -I${GSDLHOME}/common-src/packages/iconv/include" CXXFLAGS="$CXXFLAGS -I${GSDLHOME}/common-src/packages/iconv/include" LDFLAGS="$LDFLAGS -L${GSDLHOME}/common-src/packages/iconv/lib -L${GSDLHOME}/common-src/packages/sqlite/lib" ./configure $CACHE_FILE --with-included-apr --with-layout=BinaryDistribution --enable-most --prefix="${prefix}/apache-httpd/${GSDLOS}" $HOSTTARGETFLAGS --with-iconv
224
225else
226  echo "Apache httpd support disabled"
227  echo "add --enable-apache-httpd to the configure command to enable this"
228  echo ""
229fi
230
231
Note: See TracBrowser for help on using the browser.