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

Last change on this file since 22058 was 22058, checked in by ak19, 14 years ago

Changes to makefiles to 1. incorporate USE_GDBM and USE_JDBM flags (and USE_SQLITE) in most places so that the DEFINES variable is set at all times. This is necessary to ensure that all classes that contain objects with gdbm and jdbm members are of a consistent size. Else we've had experience with Greenstone crashing with memory errors (to do with the similar ENABLE_indexer flags). 2. ENABLE_JDBM is now USE_JDBM. 3. Not everything works now. It still compiles the default way, but the disable-gdbm flag is causing trouble when compiling argdb in recpt since it uses that.

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