source: main/trunk/greenstone2/runtime-src/packages/configure@ 25149

Last change on this file since 25149 was 25149, checked in by kjdon, 12 years ago

getting greenstone to work properly on 64 bit machines. COMPAT32BITFLAGS is no more. Don't need -m32 option. Instead, have ARCH_DEP_FLAGS, which gets -fPIC on 64 bit machines. Note that I have used version 2.63 of autoconf. SOme configure files had previously been generated with v 2.65. Have also got rid of lib64 for compiling expat and iconv - only need one version now, not 32 bit version for greenstone and 64 bit version for apache

  • Property svn:executable set to *
File size: 6.2 KB
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.5.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 --disable-debug --enable-optimize --enable-final --enable-speed-tune
145 sed 's/tools//' $PACKAGES/mico/mico/Makefile | sed 's/ldconfig//' >$PACKAGES/mico/mico/Makefile.out
146 mv $PACKAGES/mico/mico/Makefile.out $PACKAGES/mico/mico/Makefile
147 else
148 #MICO is on the system path
149 echo ""
150 echo "Taking MICO from system paths"
151 echo ""
152 fi
153else
154 echo "corba support disabled - mico compiler not required."
155 echo " add '--enable-corba' to the configure command to include corba support."
156 echo ""
157fi
158
159
160
161# D2M stuff needed for z3950server
162echo ""
163echo "Configuring D2M"
164if test x$USE_Z3950 = xtrue ;
165then
166 USE_YAZ=true
167 echo ""
168 cd "$PACKAGES/d2m"
169 ./configure $CACHE_FILE --prefix="$PACKAGES/d2m" $HOSTTARGETFLAGS
170else
171 echo "Z39.50 support disabled - D2M library not required."
172 echo " add '--enable-z3950' to the configure command to include z39.50 support."
173 echo ""
174fi
175
176# YAZ Z39.50 toolkit
177echo ""
178echo "Configuring YAZ"
179if test x$USE_YAZ = xtrue ;
180then
181 echo "YAZ library support enabled"
182 echo "add --disable-yaz to the configure command to disable this"
183 echo ""
184 cd "$PACKAGES/yaz"
185 gzip -dc yaz-2.1.4.tar.gz | tar -xf -
186 cd yaz-2.1.4 && \
187 ./configure $CACHE_FILE --prefix="$PACKAGES/yaz" --bindir="$bindir" $HOSTTARGETFLAGS
188else
189 echo "YAZ support disabled"
190 echo ""
191fi
192
193
194# Apache's HTTPD web server
195echo ""
196echo "Configuring Apache httpd"
197if test x$USE_APACHE_HTTPD = xtrue ;
198then
199 echo "Apache httpd support enabled"
200 echo "add --disable-apache-httpd to the configure command to disable this"
201 echo ""
202# echo "Setting up libiconv (used by Apache httpd)"
203# cd "$PACKAGES/apache-httpd"
204# if [ ! -e libiconv-1.13.1 ] ; then gzip -dc libiconv-1.13.1.tar.gz | tar -xf - ; fi
205# cd libiconv-1.13.1&& \
206# ./configure $CACHE_FILE --prefix="${prefix}/apache-httpd/${GSDLOS}" --disable-shared $HOSTTARGETFLAGS&&
207# make && make install
208# echo ""
209 echo "Configuring Apache httpd"
210 cd "$PACKAGES/apache-httpd"
211 if [ ! -e httpd-2.2.11 ] ; then gzip -dc httpd-2.2.11-gs.tar.gz | tar -xf - ; fi
212 cd httpd-2.2.11&& \
213
214CFLAGS="$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" ./configure $CACHE_FILE --with-included-apr --with-layout=BinaryDistribution --enable-most --prefix="${prefix}/apache-httpd/${GSDLOS}" $HOSTTARGETFLAGS --with-iconv
215
216else
217 echo "Apache httpd support disabled"
218 echo "add --enable-apache-httpd to the configure command to enable this"
219 echo ""
220fi
221
222
Note: See TracBrowser for help on using the repository browser.