1 | #! /bin/sh
|
---|
2 |
|
---|
3 | PACKAGES=`pwd`
|
---|
4 | cd ../..
|
---|
5 | GSDLHOME=`pwd`
|
---|
6 | cd $PACKAGES
|
---|
7 |
|
---|
8 | GSDLOS=`uname -s |tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
9 | # check for running bash under cygwin
|
---|
10 | if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
|
---|
11 | then
|
---|
12 | GSDLOS=windows
|
---|
13 | fi
|
---|
14 |
|
---|
15 | prefix=""
|
---|
16 | bindir=""
|
---|
17 | HOSTTARGETFLAGS=""
|
---|
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"
|
---|
22 | ENVIRONMENT=""
|
---|
23 |
|
---|
24 | # GDBM support enabled by default, can switch it off with --disable-jdbm
|
---|
25 | USE_GDBM=1
|
---|
26 | # JDBM support enabled by default, can switch it off with --disable-jdbm
|
---|
27 | USE_JDBM=1
|
---|
28 | # SQLite support enabled by default, can switch it off with --disable-sqlite
|
---|
29 | USE_SQLITE=true
|
---|
30 | # yaz compilation enabled by default, can switch it off with --disable-yaz
|
---|
31 | USE_YAZ=true
|
---|
32 | # z3950 server disabled by default, switch it on with --enable-z3950
|
---|
33 | USE_Z3950=false
|
---|
34 | # CORBA support disabled by default, switch it on with --enable-corba
|
---|
35 | USE_CORBA=false
|
---|
36 | MICO_DIR=default
|
---|
37 |
|
---|
38 | # parse any arguments given from toplevel configure
|
---|
39 | while 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
|
---|
107 | done
|
---|
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
|
---|
114 | prefix="${GSDLHOME}"
|
---|
115 | ##fi
|
---|
116 |
|
---|
117 | ##if test -z "$bindir" ; then
|
---|
118 | bindir="${prefix}/bin/$GSDLOS"
|
---|
119 | ##fi
|
---|
120 |
|
---|
121 | # This loads the top configure's cache file, with variables already set.
|
---|
122 | if test -f "$cache_file" ; then
|
---|
123 | . $cache_file
|
---|
124 | fi
|
---|
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
|
---|
133 | echo ""
|
---|
134 | echo "Configuring expat"
|
---|
135 | echo ""
|
---|
136 | cd "$PACKAGES/expat"
|
---|
137 | if test ! -d expat-1.95.8 ;
|
---|
138 | then
|
---|
139 | gzip -dc expat-1.95.8.tar.gz | tar -xf -
|
---|
140 | fi
|
---|
141 |
|
---|
142 | cd "$PACKAGES/expat/expat-1.95.8"
|
---|
143 |
|
---|
144 | if test -e Makefile ; then
|
---|
145 | echo make distclean && \
|
---|
146 | make distclean
|
---|
147 | fi
|
---|
148 |
|
---|
149 | #Configure and compile 32-bit expat
|
---|
150 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
151 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
152 |
|
---|
153 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
|
---|
154 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
|
---|
155 |
|
---|
156 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
|
---|
157 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
|
---|
158 |
|
---|
159 | echo make distclean && \
|
---|
160 | make distclean
|
---|
161 |
|
---|
162 | if test ! -z "$COMPAT32BITFLAGS" ; then
|
---|
163 | echo "Generating native 64-bit version of expat"
|
---|
164 | #Configure and compile 64-bit expat
|
---|
165 | echo ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" --libdir="$PACKAGES/expat/lib64" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
166 | ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" --libdir="$PACKAGES/expat/lib64" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
167 |
|
---|
168 | echo make $ENVIRONMENT
|
---|
169 | make $ENVIRONMENT
|
---|
170 |
|
---|
171 | echo make install $ENVIRONMENT
|
---|
172 | make install $ENVIRONMENT
|
---|
173 |
|
---|
174 | echo make distclean && \
|
---|
175 | make distclean
|
---|
176 | fi
|
---|
177 |
|
---|
178 | # configure and compile libiconv during configuration stage
|
---|
179 | echo ""
|
---|
180 | echo "Configuring iconv"
|
---|
181 | echo ""
|
---|
182 | cd "$PACKAGES/iconv"
|
---|
183 | if test ! -d libiconv-1.13.1 ;
|
---|
184 | then
|
---|
185 | gzip -dc libiconv-1.13.1.tar.gz | tar -xf -
|
---|
186 | fi
|
---|
187 |
|
---|
188 | cd "$PACKAGES/iconv/libiconv-1.13.1"
|
---|
189 |
|
---|
190 | if test -e Makefile ; then
|
---|
191 | echo make distclean && \
|
---|
192 | make distclean
|
---|
193 | fi
|
---|
194 |
|
---|
195 | # configure
|
---|
196 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
197 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
198 |
|
---|
199 | # make
|
---|
200 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
|
---|
201 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
|
---|
202 |
|
---|
203 | # make install
|
---|
204 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
|
---|
205 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
|
---|
206 |
|
---|
207 | if test ! -z "$COMPAT32BITFLAGS" ; then
|
---|
208 | echo "Generating native 64-bit version of iconv"
|
---|
209 | # used in apache web server, for example
|
---|
210 |
|
---|
211 | # distclean
|
---|
212 | echo make distclean && \
|
---|
213 | make distclean
|
---|
214 |
|
---|
215 | # configure
|
---|
216 | echo ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
217 | ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" --libdir="$PACKAGES/iconv/lib64" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
218 |
|
---|
219 | # make
|
---|
220 | echo make $ENVIRONMENT
|
---|
221 | make $ENVIRONMENT
|
---|
222 |
|
---|
223 | # make install
|
---|
224 | echo make install $ENVIRONMENT
|
---|
225 | make install $ENVIRONMENT
|
---|
226 | fi
|
---|
227 |
|
---|
228 | echo make distclean && \
|
---|
229 | make distclean
|
---|
230 |
|
---|
231 | #./configure $CACHE_FILE --prefix="$PACKAGES/iconv" --disable-shared $HOSTTARGETFLAGS&&
|
---|
232 | #make && make install
|
---|
233 |
|
---|
234 |
|
---|
235 | # configure GDBM
|
---|
236 | echo ""
|
---|
237 | echo "Configuring GDBM"
|
---|
238 | if test $USE_GDBM ;
|
---|
239 | then
|
---|
240 | echo ""
|
---|
241 | cd "$PACKAGES/gdbm"
|
---|
242 |
|
---|
243 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
244 |
|
---|
245 | cd "$PACKAGES/gdbm/gdbm-1.8.3" && \
|
---|
246 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
247 | else
|
---|
248 | echo " GDBM support disabled."
|
---|
249 | echo " add '--enable-gdbm' to the configure command to include GDBM support."
|
---|
250 | echo ""
|
---|
251 | fi
|
---|
252 |
|
---|
253 | # configure JDBM
|
---|
254 | echo ""
|
---|
255 | echo "Configuring JDBM"
|
---|
256 | if test $USE_JDBM ;
|
---|
257 | then
|
---|
258 | echo ""
|
---|
259 | cd "$PACKAGES/jdbm"
|
---|
260 | if test ! -d jdbm-1.0 ;
|
---|
261 | then
|
---|
262 | gzip -dc gs-jdbm-1.0.tar.gz | tar -xf -
|
---|
263 | fi
|
---|
264 | else
|
---|
265 | echo "JDBM support disabled."
|
---|
266 | echo " add '--enable-jdbm' to the configure command to include JDBM support."
|
---|
267 | echo ""
|
---|
268 | fi
|
---|
269 |
|
---|
270 | # configure SQLite
|
---|
271 | echo ""
|
---|
272 | echo "Configuring SQLite"
|
---|
273 | if test x$USE_SQLITE = xtrue ;
|
---|
274 | then
|
---|
275 | echo ""
|
---|
276 | cd "$PACKAGES/sqlite"
|
---|
277 | if test ! -d sqlite-amalgamation-3.6.23.1 ;
|
---|
278 | then
|
---|
279 | gzip -dc sqlite-amalgamation-3.6.23.1.tar.gz | tar -xf -
|
---|
280 | fi
|
---|
281 |
|
---|
282 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
283 |
|
---|
284 | cd "$PACKAGES/sqlite/sqlite-amalgamation-3.6.23.1" && \
|
---|
285 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
286 | else
|
---|
287 | echo "SQLite support disabled."
|
---|
288 | echo " add '--enable-sqlite' to the configure command to include SQLite support."
|
---|
289 | echo ""
|
---|
290 | fi
|
---|
291 |
|
---|
292 | # configure search4j
|
---|
293 | echo ""
|
---|
294 | echo "Configuring search4j"
|
---|
295 | echo ""
|
---|
296 | cd "$PACKAGES/search4j"
|
---|
297 |
|
---|
298 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
299 |
|
---|
300 | cd "$PACKAGES/search4j" && \
|
---|
301 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
|
---|