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

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

Fix for using --enable-jdbm

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