source: main/trunk/greenstone2/common-src/packages/configure@ 24075

Last change on this file since 24075 was 24075, checked in by davidb, 13 years ago

Updating SQLite to a more recent release (May 2011) supporting casting operations (used in our numeric searching)

  • Property svn:executable set to *
File size: 11.1 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# Java support enabled by default, can switch it off with --disable-java
25ENABLE_JAVA=1
26# GDBM support enabled by default, can switch it off with --disable-jdbm
27USE_GDBM=1
28# JDBM support enabled by default, can switch it off with --disable-jdbm
29USE_JDBM=1
30# SQLite support enabled by default, can switch it off with --disable-sqlite
31USE_SQLITE=true
32# yaz compilation enabled by default, can switch it off with --disable-yaz
33USE_YAZ=true
34# z3950 server disabled by default, switch it on with --enable-z3950
35USE_Z3950=false
36# CORBA support disabled by default, switch it on with --enable-corba
37USE_CORBA=false
38MICO_DIR=default
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-java)
58 ENABLE_JAVA=0
59 USE_JDBM=0
60 ;;
61 --disable-gdbm)
62 USE_GDBM=0
63 ;;
64 --disable-jdbm)
65 USE_JDBM=0
66 ;;
67 --disable-sqlite)
68 USE_SQLITE=false
69 ;;
70 --disable-yaz)
71 USE_YAZ=false
72 ;;
73 --enable-z3950)
74 USE_Z3950=true
75 ;;
76 --enable-corba)
77 USE_CORBA=true
78 ;;
79 --with-micodir=*)
80 if test $1 = ""; then
81 $1 = "default"
82 fi
83 MICO_DIR=$1
84 ;;
85 --prefix=*)
86 prefix=`echo $1 | sed s/--prefix=//`
87 ;;
88 --bindir=*)
89 # where to install binaries to
90 bindir=`echo $1 | sed s/--bindir=//`
91 # turn relative path into an absolute path
92 if test -d "$bindir" ; then
93 bindir=`cd "$bindir" ; pwd `
94 cd "$PACKAGES"
95 elif test -z `echo $bindir | sed '/^\// p;D'` ; then
96 rel_bindir="`echo $bindir | sed s@/.*@@`"
97 cd "$rel_bindir"
98 bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
99 cd "$PACKAGES"
100 else
101 # bindir doesn't exist, and isn't relative
102 true
103 fi
104 ;;
105 --host=* | --target=*)
106 HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
107 ;;
108 *)
109 # ignore all other options for now
110 ;;
111 esac
112 shift
113done
114
115# note! Our GSDL package currently always installs into it's source
116# directory, ignoring any --prefix given to configure.
117# When this is fixed, uncomment the relevant lines below...
118
119##if test -z "$prefix" ; then
120prefix="${GSDLHOME}"
121##fi
122
123##if test -z "$bindir" ; then
124bindir="${prefix}/bin/$GSDLOS"
125##fi
126
127#libdir="${prefix}/lib/$GSDLOS"
128
129# This loads the top configure's cache file, with variables already set.
130if test -f "$cache_file" ; then
131 . $cache_file
132fi
133
134# we assume that gzip and tar are on the search path.
135# non-GNU versions of tar don't take the -z option.
136
137
138
139# configure expat (needs to be done before XML::Parser)
140# now compile expat during the configure stage itself
141echo ""
142echo "Configuring expat"
143echo ""
144cd "$PACKAGES/expat"
145if test ! -d expat-1.95.8 ;
146then
147 gzip -dc expat-1.95.8.tar.gz | tar -xf -
148fi
149
150cd "$PACKAGES/expat/expat-1.95.8"
151
152if test -e Makefile ; then
153 echo make distclean && \
154 make distclean
155fi
156
157#Configure and compile 32-bit expat
158echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
159CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
160
161echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
162CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
163
164echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
165CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
166
167echo make distclean && \
168make distclean
169
170if test ! -z "$COMPAT32BITFLAGS" ; then
171 echo "Generating native 64-bit version of expat"
172 #Configure and compile 64-bit expat
173 echo ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" --libdir="$PACKAGES/expat/lib64" $HOSTTARGETFLAGS $ENVIRONMENT
174 ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" --libdir="$PACKAGES/expat/lib64" $HOSTTARGETFLAGS $ENVIRONMENT
175
176 echo make $ENVIRONMENT
177 make $ENVIRONMENT
178
179 echo make install $ENVIRONMENT
180 make install $ENVIRONMENT
181
182 echo make distclean && \
183 make distclean
184fi
185
186# configure and compile libiconv during configuration stage
187echo ""
188echo "Configuring iconv"
189echo ""
190cd "$PACKAGES/iconv"
191
192# Darwin requires a different version of iconv than the one we use for Linux
193if test $GSDLOS != darwin ; then
194
195 if test ! -d libiconv-1.13.1 ; then
196 gzip -dc libiconv-1.13.1.tar.gz | tar -xf -
197 fi
198 cd "$PACKAGES/iconv/libiconv-1.13.1"
199
200 if test -e Makefile ; then
201 echo make distclean && \
202 make distclean
203 fi
204
205 # configure
206 echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
207 CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
208else
209 if test ! -d libiconv-1.11 ; then
210 gzip -dc libiconv-1.11.tar.gz | tar -xf -
211 fi
212 cd "$PACKAGES/iconv/libiconv-1.11"
213
214 if test -e Makefile ; then
215 echo make distclean && \
216 make distclean
217 fi
218
219 # configure
220 echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
221 CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
222fi
223
224# make
225echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
226CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
227
228# make install
229echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
230CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
231
232if test ! -z "$COMPAT32BITFLAGS" ; then
233 echo "Generating native 64-bit version of iconv"
234 # used in apache web server, for example
235
236 # distclean
237 echo make distclean && \
238 make distclean
239
240 # configure
241 echo ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
242 ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" --libdir="$PACKAGES/iconv/lib64" $HOSTTARGETFLAGS $ENVIRONMENT
243
244 # make
245 echo make $ENVIRONMENT
246 make $ENVIRONMENT
247
248 # make install
249 echo make install $ENVIRONMENT
250 make install $ENVIRONMENT
251fi
252
253echo make distclean && \
254make distclean
255
256#./configure $CACHE_FILE --prefix="$PACKAGES/iconv" --disable-shared $HOSTTARGETFLAGS&&
257#make && make install
258
259
260# configure GDBM
261echo ""
262echo "Configuring GDBM"
263if test $USE_GDBM ;
264then
265 echo ""
266 cd "$PACKAGES/gdbm"
267
268 echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
269
270 cd "$PACKAGES/gdbm/gdbm-1.8.3" && \
271 CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
272else
273 echo " GDBM support disabled."
274 echo " add '--enable-gdbm' to the configure command to include GDBM support."
275 echo ""
276fi
277
278# configure JDBM
279echo ""
280echo "Configuring JDBM"
281if test $USE_JDBM ;
282then
283 echo ""
284 cd "$PACKAGES/jdbm"
285 if test ! -d jdbm-1.0 ;
286 then
287 gzip -dc gs-jdbm-1.0.tar.gz | tar -xf -
288 fi
289
290 if test "x$JAVAC" = "x" ; then
291 JAVAC=javac
292 fi
293
294 if test "x$JAVACFLAGS" = "x" ; then
295 JAVACFLAGS="-source 1.4 -target 1.4"
296 fi
297
298 cd jdbm-1.0 && cat Makefile.in | sed -e "s,@JAVAC@,$JAVAC,g" -e "s,@JAVACFLAGS@,$JAVACFLAGS,g" > Makefile
299else
300 echo "JDBM support disabled."
301 echo " add '--enable-jdbm' to the configure command to include JDBM support."
302 echo ""
303fi
304
305# configure SQLite
306echo ""
307echo "Configuring SQLite"
308if test x$USE_SQLITE = xtrue ;
309then
310 echo ""
311 cd "$PACKAGES/sqlite"
312 if test ! -d sqlite-autoconf-3070602 ;
313 then
314 gzip -dc sqlite-autoconf-3070602.tar.gz | tar -xf -
315 fi
316
317 arch=`uname -p`
318
319 if test $arch = powerpc ; then
320 CFLAGS="-DSQLITE_ENABLE_LOCKING_STYLE=0 $CFLAGS"
321 fi
322
323 echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
324
325 cd "$PACKAGES/sqlite/sqlite-autoconf-3070602" && \
326 CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
327else
328 echo "SQLite support disabled."
329 echo " add '--enable-sqlite' to the configure command to include SQLite support."
330 echo ""
331fi
332
333# configure search4j
334echo ""
335echo "Configuring search4j"
336echo ""
337cd "$PACKAGES/search4j"
338
339#echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
340echo ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
341
342cd "$PACKAGES/search4j" && \
343 ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
344# CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
Note: See TracBrowser for help on using the repository browser.