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 | if test "x$crossOS" != "x" ; then
|
---|
15 | # Override derived value with value explicitly provided in crossOS
|
---|
16 | GSDLOS=$crossOS
|
---|
17 | fi
|
---|
18 |
|
---|
19 | prefix=""
|
---|
20 | bindir=""
|
---|
21 | HOSTTARGETFLAGS=""
|
---|
22 |
|
---|
23 | # only some of the packages can take environment variables as options to
|
---|
24 | # configure
|
---|
25 | # format is VAR=value, e.g "LDFLAGS=-static"
|
---|
26 | ENVIRONMENT=""
|
---|
27 |
|
---|
28 | # WVWARE compilation enabled by default, can switch it off with --disable-wvware
|
---|
29 | USE_WVWARE=true
|
---|
30 | # GDBM compilation enabled by default, can switch it off with --disable-gdbm
|
---|
31 | USE_GDBM=true
|
---|
32 | # JDBM compilation enabled by default, can switch it off with --disable-jdbm
|
---|
33 | USE_JDBM=true
|
---|
34 | # SQLite support enabled by default, can switch it off with --disable-sqlite
|
---|
35 | USE_SQLITE=true
|
---|
36 | # yaz compilation enabled by default, can switch it off with --disable-yaz
|
---|
37 | USE_YAZ=true
|
---|
38 | # z3950 server disabled by default, switch it on with --enable-z3950
|
---|
39 | USE_Z3950=false
|
---|
40 | # CORBA support disabled by default, switch it on with --enable-corba
|
---|
41 | USE_CORBA=false
|
---|
42 | MICO_DIR=default
|
---|
43 |
|
---|
44 | # parse any arguments given from toplevel configure
|
---|
45 | while test $# -ne 0; do
|
---|
46 | case "$1" in
|
---|
47 | --cache-file=*)
|
---|
48 | cache_filename=`echo $1 | sed s/--cache-file=//`
|
---|
49 | # turn relative path into an absolute path
|
---|
50 | cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
|
---|
51 | cache_dir=`cd $cache_dir 2>/dev/null && pwd`
|
---|
52 |
|
---|
53 | cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
|
---|
54 | cache_file="$cache_dir/$cache_basefile"
|
---|
55 | if test ! -f "$cache_file"; then
|
---|
56 | CACHE_FILE=""
|
---|
57 | else
|
---|
58 | CACHE_FILE="--cache-file=$cache_file"
|
---|
59 | fi
|
---|
60 | ;;
|
---|
61 | --disable-wvware)
|
---|
62 | USE_WVWARE=false
|
---|
63 | ;;
|
---|
64 | --disable-gdbm)
|
---|
65 | USE_GDBM=false
|
---|
66 | ;;
|
---|
67 | --disable-jdbm)
|
---|
68 | USE_JDBM=false
|
---|
69 | ;;
|
---|
70 | --disable-sqlite)
|
---|
71 | USE_SQLITE=false
|
---|
72 | ;;
|
---|
73 | --disable-yaz)
|
---|
74 | USE_YAZ=false
|
---|
75 | ;;
|
---|
76 | --enable-z3950)
|
---|
77 | USE_Z3950=true
|
---|
78 | ;;
|
---|
79 | --enable-corba)
|
---|
80 | USE_CORBA=true
|
---|
81 | ;;
|
---|
82 | --with-micodir=*)
|
---|
83 | if test $1 = ""; then
|
---|
84 | $1 = "default"
|
---|
85 | fi
|
---|
86 | MICO_DIR=$1
|
---|
87 | ;;
|
---|
88 | --prefix=*)
|
---|
89 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
90 | ;;
|
---|
91 | --bindir=*)
|
---|
92 | # where to install binaries to
|
---|
93 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
94 | # turn relative path into an absolute path
|
---|
95 | if test -d "$bindir" ; then
|
---|
96 | bindir=`cd "$bindir" ; pwd `
|
---|
97 | cd "$PACKAGES"
|
---|
98 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
99 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
100 | cd "$rel_bindir"
|
---|
101 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
102 | cd "$PACKAGES"
|
---|
103 | else
|
---|
104 | # bindir doesn't exist, and isn't relative
|
---|
105 | true
|
---|
106 | fi
|
---|
107 | ;;
|
---|
108 | --host=* | --target=* | --build=*)
|
---|
109 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
110 | ;;
|
---|
111 | *)
|
---|
112 | # ignore all other options for now
|
---|
113 | ;;
|
---|
114 | esac
|
---|
115 | shift
|
---|
116 | done
|
---|
117 |
|
---|
118 | # note! Our GSDL package currently always installs into it's source
|
---|
119 | # directory, ignoring any --prefix given to configure.
|
---|
120 | # When this is fixed, uncomment the relevant lines below...
|
---|
121 |
|
---|
122 | ##if test -z "$prefix" ; then
|
---|
123 | prefix="${GSDLHOME}"
|
---|
124 | ##fi
|
---|
125 |
|
---|
126 | ##if test -z "$bindir" ; then
|
---|
127 | bindir="${prefix}/bin/$GSDLOS"
|
---|
128 | ##fi
|
---|
129 |
|
---|
130 | libdir="${prefix}/lib/$GSDLOS"
|
---|
131 |
|
---|
132 | # This loads the top configure's cache file, with variables already set.
|
---|
133 | if test -f "$cache_file" ; then
|
---|
134 | . $cache_file
|
---|
135 | fi
|
---|
136 |
|
---|
137 | # we assume that gzip and tar are on the search path.
|
---|
138 | # non-GNU versions of tar don't take the -z option.
|
---|
139 |
|
---|
140 |
|
---|
141 |
|
---|
142 | # The way common-src compiles up expat during the configure stage itself,
|
---|
143 | # configure openssl (needs to be done before wget)
|
---|
144 | # and compile openssl during the configure stage itself.
|
---|
145 | # Needed by wget for https support
|
---|
146 |
|
---|
147 | echo ""
|
---|
148 | echo "Configuring openssl"
|
---|
149 | echo ""
|
---|
150 | cd "$PACKAGES/openssl"
|
---|
151 | openssl_pkgname=openssl-1.0.2l
|
---|
152 | #openssl_pkgname=openssl-1.1.0f
|
---|
153 | if test ! -d $openssl_pkgname ;
|
---|
154 | then
|
---|
155 | gzip -dc $openssl_pkgname.tar.gz | tar -xf -
|
---|
156 | fi
|
---|
157 | cd $openssl_pkgname
|
---|
158 |
|
---|
159 | # configure
|
---|
160 | # see the INSTALL file for OpenSSL to see config options for openssl
|
---|
161 | # --prefix indicates where the generated lib, include and bin folders will go
|
---|
162 | # --openssldir will contain the manuals and other non-essentials
|
---|
163 | # BEWARE: The defaults for --prefix and meaning of --openssldir differ between
|
---|
164 | # versions of openssl. In the earlier version (1.0.* like 1.0.2l), if
|
---|
165 | # --prefix is not supplied then the generated lib, include and bin folders
|
---|
166 | # will also go into --openssldir.
|
---|
167 | # In the newer version 1.1.* 1.1.0f, if --prefix is not supplied, it will
|
---|
168 | # try to install the generated lib, include and bin folders into a system place.
|
---|
169 | # So better to provide both --opennssldir and --prefix, for both openssl versions
|
---|
170 | # to compile succesfully.
|
---|
171 | # If you ever want to have the .a libraries that building openssl generates,
|
---|
172 | # then point the --prefix to the $bindir. We currently don't need to put them
|
---|
173 | # into $bindir/openssl for wget to use, since wget is built against openssl's
|
---|
174 | # static libraries and therefore wget doesn't need these when running.
|
---|
175 |
|
---|
176 | # for 64 bit Macs, need to run ./Configure with darwin64-x86_64-cc, rather than ./config
|
---|
177 | # To overcome an error in openssl's perl script determining the LLVM version, we also need force the
|
---|
178 | # compilers to be GNU since Clang comes back with an LLVM version that doesn't work out
|
---|
179 | stored_CC=$CC
|
---|
180 | stored_CXX=$CXX
|
---|
181 | if [[ "x$GSDLOS" == "xdarwin" ]] && [[ `uname -m` == *"64" ]] ; then
|
---|
182 | export CC="gcc"
|
---|
183 | export CXX="g++"
|
---|
184 | echo ./Configure --openssldir=$PACKAGES/openssl no-shared darwin64-x86_64-cc
|
---|
185 | #CC="gcc" CXX="g++" ./Configure --openssldir=$PACKAGES/openssl no-shared darwin64-x86_64-cc
|
---|
186 | ./Configure --openssldir=$PACKAGES/openssl no-shared darwin64-x86_64-cc
|
---|
187 | else
|
---|
188 | echo ./config --prefix=$PACKAGES/openssl --openssldir=$PACKAGES/openssl no-shared
|
---|
189 | ./config --prefix=$PACKAGES/openssl --openssldir=$PACKAGES/openssl no-shared
|
---|
190 | fi
|
---|
191 | # make
|
---|
192 | echo make
|
---|
193 | make
|
---|
194 | # make install
|
---|
195 | echo make install
|
---|
196 | make install
|
---|
197 | # restore the compile flags
|
---|
198 | export CC=$stored_CC
|
---|
199 | export CXX=$stored_CXX
|
---|
200 |
|
---|
201 | # now move the include, lib and bin folders to the correct place
|
---|
202 |
|
---|
203 | # configure the wvWare Word document converter
|
---|
204 | echo ""
|
---|
205 | echo "Configuring wvWare"
|
---|
206 | echo ""
|
---|
207 |
|
---|
208 | # datadir flag is for default location of wvHtml.xml config file
|
---|
209 | if test x$USE_WVWARE = xtrue ;
|
---|
210 | then
|
---|
211 |
|
---|
212 | # Look to see if gnome-lib extension is present and if so, source its devel.bash file
|
---|
213 | if [ -d ../../ext/gnome-lib ] ; then
|
---|
214 | pushd ../../ext/gnome-lib
|
---|
215 | source ./devel.bash
|
---|
216 | popd
|
---|
217 | fi
|
---|
218 |
|
---|
219 | if [ -d ../../../ext/gnome-lib-minimal ] ; then
|
---|
220 | pushd ../../../ext/gnome-lib-minimal
|
---|
221 | source ./devel.bash
|
---|
222 | popd
|
---|
223 | fi
|
---|
224 |
|
---|
225 | cd "$PACKAGES/wv"
|
---|
226 | if [ "x$GSDLOS" = "xdarwin" ]; then
|
---|
227 | WV_LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Carbon"
|
---|
228 | else
|
---|
229 | WV_LDFLAGS="$LDFLAGS"
|
---|
230 | fi
|
---|
231 | gzip -dc wv-1.2.4-gs.tar.gz | tar -xf -
|
---|
232 | cd wv-gs && \
|
---|
233 | ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --libdir="$libdir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS --disable-shared --enable-static LDFLAGS="$WV_LDFLAGS"
|
---|
234 | else
|
---|
235 | echo "wvWare support disabled."
|
---|
236 | echo " add '--enable-wvware' to the configure command to include wvWare support."
|
---|
237 | echo ""
|
---|
238 | fi
|
---|
239 |
|
---|
240 | if test x$? = x1 ;
|
---|
241 | then
|
---|
242 | echo "Configuration of wvWare failed."
|
---|
243 | exit 1
|
---|
244 | fi
|
---|
245 |
|
---|
246 | # configure the pdftohtml converter
|
---|
247 | echo ""
|
---|
248 | echo "Configuring pdftohtml"
|
---|
249 | echo ""
|
---|
250 |
|
---|
251 | cd "$PACKAGES/pdftohtml"
|
---|
252 | gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
|
---|
253 | cd pdftohtml_gs && \
|
---|
254 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
255 |
|
---|
256 | if test x$? = x1 ;
|
---|
257 | then
|
---|
258 | echo "Configuration of pdftohtml failed."
|
---|
259 | exit 1
|
---|
260 | fi
|
---|
261 |
|
---|
262 | # rtftohtml converter
|
---|
263 | echo ""
|
---|
264 | echo "Configuring rtftohtml"
|
---|
265 | echo ""
|
---|
266 |
|
---|
267 | cd "$PACKAGES/rtftohtml"
|
---|
268 | gzip -dc rtftohtml-gs.tar.gz | tar -xf -
|
---|
269 | cd rtftohtml_src && \
|
---|
270 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
271 |
|
---|
272 | if test x$? = x1 ;
|
---|
273 | then
|
---|
274 | echo "Configuration of rtftohtml failed."
|
---|
275 | exit 1
|
---|
276 | fi
|
---|
277 |
|
---|
278 | # On darwin, the wget binary that we build (in $GSDLHOME/bin/$GSDLOS/wget)
|
---|
279 | # finds a system libiconv, as you'll notice when you run "otool -L wget"
|
---|
280 | # That's because we expressly don't compile up libiconv on Macs anymore,
|
---|
281 | # as the Mac system will have the right libiconv installed.
|
---|
282 |
|
---|
283 | # configure wget
|
---|
284 | #wget_pkgname=wget-1.15-gs
|
---|
285 | wget_pkgname=wget-1.17.1-gs
|
---|
286 | echo ""
|
---|
287 | echo "Configuring wget"
|
---|
288 | echo ""
|
---|
289 | cd "$PACKAGES/wget"
|
---|
290 | gzip -dc $wget_pkgname.tar.gz | tar -xf -
|
---|
291 | if test x$crossOS = "xandroid" ;
|
---|
292 | then
|
---|
293 | wget_extraargs="gl_cv_header_working_stdint_h=yes ac_cv_func_getopt_long_only=no"
|
---|
294 | else
|
---|
295 | wget_extraargs=
|
---|
296 | fi
|
---|
297 |
|
---|
298 | # When compiling wget-1.15-gs without openssl as before:
|
---|
299 | #./configure $CACHE_FILE --prefix=$PACKAGES/wget --without-ssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
|
---|
300 |
|
---|
301 | # We weren't compiling up wget statically before either and we still aren't
|
---|
302 | # However, to compile up wget (statically or not) with openssl, as we do now to support retrieving from https urls, see
|
---|
303 | # https://stackoverflow.com/questions/9817337/compiling-wget-with-static-linking-self-compiled-openssl-library-linking-issu
|
---|
304 | # Note: contrary to the instructions at the link, if the cppflags and ldflags are set during the
|
---|
305 | # configure stage, as we now do, then the make command needn't additionally set them as well.
|
---|
306 | # So just make, make install works thereafter
|
---|
307 |
|
---|
308 | echo copying "$PACKAGES/wget/wgetrc-gs.in" file to "$bindir/wgetrc"
|
---|
309 | cp "$PACKAGES/wget/wgetrc-gs.in" "$bindir/wgetrc"
|
---|
310 | echo cd "$PACKAGES/wget/$wget_pkgname"
|
---|
311 |
|
---|
312 | # for wget-1.15-gs. (can also try adding --localstatedir="$bindir/wget" --enable-iri)
|
---|
313 | ##echo CPPFLAGS="-I$PACKAGES/openssl/include $CPPFLAGS" LDFLAGS="-L$PACKAGES/openssl/lib $LDFLAGS" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraarg
|
---|
314 | ##cd "$PACKAGES/wget/$wget_pkgname" && \
|
---|
315 | ##CPPFLAGS="-I$PACKAGES/openssl/include $CPPFLAGS" LDFLAGS="-L$PACKAGES/openssl/lib $LDFLAGS" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
|
---|
316 |
|
---|
317 | # for wget-1.17.1-gs. (can also try adding --localstatedir="$bindir/wget" --enable-iri)
|
---|
318 | echo OPENSSL_CFLAGS="-I$PACKAGES/openssl/include" OPENSSL_LIBS="-L$PACKAGES/openssl/lib -lssl -lcrypto" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --with-openssl=auto --with-libssl-prefix="$PACKAGES/openssl" --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
|
---|
319 | cd "$PACKAGES/wget/$wget_pkgname" && \
|
---|
320 | OPENSSL_CFLAGS="-I$PACKAGES/openssl/include" OPENSSL_LIBS="-L$PACKAGES/openssl/lib -lssl -lcrypto" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --with-openssl=auto --with-libssl-prefix="$PACKAGES/openssl" --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
|
---|
321 |
|
---|
322 |
|
---|
323 | if test x$? = x1 ;
|
---|
324 | then
|
---|
325 | echo "Configuration of wget failed."
|
---|
326 | exit 1
|
---|
327 | fi
|
---|
328 |
|
---|
329 | # configure XML::Parser perl module
|
---|
330 | echo ""
|
---|
331 | echo "Configuring XML::Parser"
|
---|
332 | echo ""
|
---|
333 | cd "$PACKAGES/cpan"
|
---|
334 |
|
---|
335 | perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl`
|
---|
336 |
|
---|
337 | gzip -dc XML-Parser-2.41.tar.gz | tar -xf -
|
---|
338 | cd "$PACKAGES/cpan/XML-Parser-2.41" && \
|
---|
339 |
|
---|
340 | perl Makefile.PL \
|
---|
341 | PREFIX="$GSDLHOME/perllib/cpan/XML" \
|
---|
342 | INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
343 | INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
344 | INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
345 | INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
346 | SITEPREFIX="$GSDLHOME/perllib/cpan" \
|
---|
347 | EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
|
---|
348 | EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
|
---|
349 |
|
---|
350 | if test x$? = x1 ;
|
---|
351 | then
|
---|
352 | echo "Configuration of XML-Parser failed."
|
---|
353 | exit 1
|
---|
354 | fi
|
---|
355 |
|
---|
356 | # configure powerpoint converter
|
---|
357 | echo ""
|
---|
358 | echo "Configuring xlhtml (powerpoint & excel converter)"
|
---|
359 | echo ""
|
---|
360 | cd "$PACKAGES/xlhtml"
|
---|
361 | gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
|
---|
362 | cd xlhtml-0.4.9.0 && \
|
---|
363 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
364 |
|
---|
365 | if test x$? = x1 ;
|
---|
366 | then
|
---|
367 | echo "Configuration of xlhtml failed."
|
---|
368 | exit 1
|
---|
369 | fi
|
---|
370 |
|
---|
371 | # configure IsisGdl program
|
---|
372 | echo ""
|
---|
373 | echo "Configuring IsisGdl (CDS/ISIS database reader)"
|
---|
374 | echo ""
|
---|
375 | cd "$PACKAGES/isis-gdl" && \
|
---|
376 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
377 |
|
---|
378 | if test x$? = x1 ;
|
---|
379 | then
|
---|
380 | echo "Configuration of IsisGdl failed."
|
---|
381 | exit 1
|
---|
382 | fi
|
---|
383 |
|
---|
384 | # configure HTMLTidy program
|
---|
385 | echo ""
|
---|
386 | echo "Configuring HTMLTidy"
|
---|
387 | echo ""
|
---|
388 | cd "$PACKAGES/html-tidy"
|
---|
389 | gzip -dc tidy.tgz | tar -xf -
|
---|
390 | cd "$PACKAGES/html-tidy/tidy" && \
|
---|
391 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
392 |
|
---|
393 | if test x$? = x1 ;
|
---|
394 | then
|
---|
395 | echo "Configuration of HTMLTidy failed."
|
---|
396 | exit 1
|
---|
397 | fi
|
---|