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

Last change on this file since 21409 was 21409, checked in by davidb, 14 years ago

Introduction of --enable-jdbm flag

  • Property svn:executable set to *
File size: 7.8 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# SQLite support enabled by default, can switch it off with --disable-sqlite
25USE_SQLITE=true
26# yaz compilation enabled by default, can switch it off with --disable-yaz
27USE_YAZ=true
28# z3950 server disabled by default, switch it on with --enable-z3950
29USE_Z3950=false
30# CORBA support disabled by default, switch it on with --enable-corba
31USE_CORBA=false
32MICO_DIR=default
33
34# parse any arguments given from toplevel configure
35while test $# -ne 0; do
36 case "$1" in
37 --cache-file=*)
38 cache_filename=`echo $1 | sed s/--cache-file=//`
39 # turn relative path into an absolute path
40 cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
41 cache_dir=`cd $cache_dir 2>/dev/null && pwd`
42
43 cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
44 cache_file="$cache_dir/$cache_basefile"
45 if test ! -f "$cache_file"; then
46 CACHE_FILE=""
47 else
48 CACHE_FILE="--cache-file=$cache_file"
49 fi
50 ;;
51 --disable-sqlite)
52 USE_SQLITE=false
53 ;;
54 --disable-yaz)
55 USE_YAZ=false
56 ;;
57 --enable-z3950)
58 USE_Z3950=true
59 ;;
60 --enable-corba)
61 USE_CORBA=true
62 ;;
63 --with-micodir=*)
64 if test $1 = ""; then
65 $1 = "default"
66 fi
67 MICO_DIR=$1
68 ;;
69 --prefix=*)
70 prefix=`echo $1 | sed s/--prefix=//`
71 ;;
72 --bindir=*)
73 # where to install binaries to
74 bindir=`echo $1 | sed s/--bindir=//`
75 # turn relative path into an absolute path
76 if test -d "$bindir" ; then
77 bindir=`cd "$bindir" ; pwd `
78 cd "$PACKAGES"
79 elif test -z `echo $bindir | sed '/^\// p;D'` ; then
80 rel_bindir="`echo $bindir | sed s@/.*@@`"
81 cd "$rel_bindir"
82 bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
83 cd "$PACKAGES"
84 else
85 # bindir doesn't exist, and isn't relative
86 true
87 fi
88 ;;
89 --host=* | --target=*)
90 HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
91 ;;
92 *)
93 # ignore all other options for now
94 ;;
95 esac
96 shift
97done
98
99# note! Our GSDL package currently always installs into it's source
100# directory, ignoring any --prefix given to configure.
101# When this is fixed, uncomment the relevant lines below...
102
103##if test -z "$prefix" ; then
104prefix="${GSDLHOME}"
105##fi
106
107##if test -z "$bindir" ; then
108bindir="${prefix}/bin/$GSDLOS"
109##fi
110
111# This loads the top configure's cache file, with variables already set.
112if test -f "$cache_file" ; then
113 . $cache_file
114fi
115
116# we assume that gzip and tar are on the search path.
117# non-GNU versions of tar don't take the -z option.
118
119
120
121# configure expat (needs to be done before XML::Parser)
122# now compile expat during the configure stage itself
123echo ""
124echo "Configuring expat"
125echo ""
126cd "$PACKAGES/expat"
127if test ! -d expat-1.95.8 ;
128then
129 gzip -dc expat-1.95.8.tar.gz | tar -xf -
130fi
131
132echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
133
134cd "$PACKAGES/expat/expat-1.95.8" && \
135CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
136
137echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $HOSTTARGETFLAGS $ENVIRONMENT
138CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $HOSTTARGETFLAGS $ENVIRONMENT
139
140echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $HOSTTARGETFLAGS $ENVIRONMENT
141CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $HOSTTARGETFLAGS $ENVIRONMENT
142
143
144# configure and compile libiconv during configuration stage
145echo ""
146echo "Configuring iconv"
147echo ""
148cd "$PACKAGES/iconv"
149if test ! -d libiconv-1.13.1 ;
150then
151 gzip -dc libiconv-1.13.1.tar.gz | tar -xf -
152fi
153
154# configure
155echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
156cd "$PACKAGES/iconv/libiconv-1.13.1" && \
157CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
158
159# make
160echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $HOSTTARGETFLAGS $ENVIRONMENT
161CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $HOSTTARGETFLAGS $ENVIRONMENT
162
163# make install
164echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $HOSTTARGETFLAGS $ENVIRONMENT
165CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $HOSTTARGETFLAGS $ENVIRONMENT
166
167#./configure $CACHE_FILE --prefix="$PACKAGES/iconv" --disable-shared $HOSTTARGETFLAGS&&
168#make && make install
169
170
171# configure GDBM
172echo ""
173echo "Configuring GDBM"
174echo ""
175cd "$PACKAGES/gdbm"
176
177echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
178
179cd "$PACKAGES/gdbm/gdbm-1.8.3" && \
180CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
181
182
183# configure JDBM
184echo ""
185echo "Configuring JDBM"
186if test x$USE_JDBM = xtrue ;
187then
188 echo ""
189 cd "$PACKAGES/jdbm"
190 if test ! -d jdbm-1.0 ;
191 then
192 gzip -dc gs-jdbm-1.0.tar.gz | tar -xf -
193 fi
194else
195 echo "JDBM support disabled."
196 echo " add '--enable-jdbm' to the configure command to include JDBM support."
197 echo ""
198fi
199
200# configure SQLite
201echo ""
202echo "Configuring SQLite"
203if test x$USE_SQLITE = xtrue ;
204then
205 echo ""
206 cd "$PACKAGES/sqlite"
207 if test ! -d sqlite-amalgamation-3.5.9 ;
208 then
209 gzip -dc sqlite-amalgamation-3.5.9.tar.gz | tar -xf -
210 fi
211
212 echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
213
214 cd "$PACKAGES/sqlite/sqlite-amalgamation-3.5.9" && \
215 CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
216else
217 echo "SQLite support disabled."
218 echo " add '--enable-sqlite' to the configure command to include SQLite support."
219 echo ""
220fi
221
222# configure search4j
223echo ""
224echo "Configuring search4j"
225echo ""
226cd "$PACKAGES/search4j"
227
228echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
229
230cd "$PACKAGES/search4j" && \
231 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.