source: main/trunk/greenstone2/build-src/packages/configure@ 31824

Last change on this file since 31824 was 31824, checked in by ak19, 7 years ago

We now compile up OpenSSL, since wget needs SSL support to download https pages. wget is now compiled up OpenSSL, achieved by changes during wget's configure phase. OpenSSL is configured and compiled up during GS' configure phase. Details are in the updated README at wget level.

  • Property svn:executable set to *
File size: 9.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
14if test "x$crossOS" != "x" ; then
15 # Override derived value with value explicitly provided in crossOS
16 GSDLOS=$crossOS
17fi
18
19prefix=""
20bindir=""
21HOSTTARGETFLAGS=""
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"
26ENVIRONMENT=""
27
28# WVWARE compilation enabled by default, can switch it off with --disable-wvware
29USE_WVWARE=true
30# GDBM compilation enabled by default, can switch it off with --disable-gdbm
31USE_GDBM=true
32# JDBM compilation enabled by default, can switch it off with --disable-jdbm
33USE_JDBM=true
34# SQLite support enabled by default, can switch it off with --disable-sqlite
35USE_SQLITE=true
36# yaz compilation enabled by default, can switch it off with --disable-yaz
37USE_YAZ=true
38# z3950 server disabled by default, switch it on with --enable-z3950
39USE_Z3950=false
40# CORBA support disabled by default, switch it on with --enable-corba
41USE_CORBA=false
42MICO_DIR=default
43
44# parse any arguments given from toplevel configure
45while 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
116done
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
123prefix="${GSDLHOME}"
124##fi
125
126##if test -z "$bindir" ; then
127bindir="${prefix}/bin/$GSDLOS"
128##fi
129
130libdir="${prefix}/lib/$GSDLOS"
131
132# This loads the top configure's cache file, with variables already set.
133if test -f "$cache_file" ; then
134 . $cache_file
135fi
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
147echo ""
148echo "Configuring openssl"
149echo ""
150cd "$PACKAGES/openssl"
151openssl_pkgname=openssl-1.0.2l
152if test ! -d $openssl_pkgname ;
153then
154 gzip -dc $openssl_pkgname.tar.gz | tar -xf -
155fi
156cd openssl-1.0.2l
157
158# configure
159# see the INSTALL file for OpenSSL to see config options for openssl
160# --prefix indicates where the generated lib, include and bin folders will go
161# --openssldir will contain the manuals and other non-essentials
162# we'll put them into $bindir/openssl for wget to use
163echo ./config --prefix=$bindir/openssl --openssldir=$PACKAGES/openssl no-shared
164./config --prefix=$bindir/openssl --openssldir=$PACKAGES/openssl no-shared
165# make
166echo make
167make
168# make install
169echo make install
170make install
171
172# now move the include, lib and bin folders to the correct place
173
174# configure the wvWare Word document converter
175echo ""
176echo "Configuring wvWare"
177echo ""
178
179# datadir flag is for default location of wvHtml.xml config file
180if test x$USE_WVWARE = xtrue ;
181then
182
183 # Look to see if gnome-lib extension is present and if so, source its devel.bash file
184 if [ -d ../../ext/gnome-lib ] ; then
185 pushd ../../ext/gnome-lib
186 source ./devel.bash
187 popd
188 fi
189
190 if [ -d ../../../ext/gnome-lib-minimal ] ; then
191 pushd ../../../ext/gnome-lib-minimal
192 source ./devel.bash
193 popd
194 fi
195
196 cd "$PACKAGES/wv"
197 if [ "x$GSDLOS" = "xdarwin" ]; then
198 WV_LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Carbon"
199 else
200 WV_LDFLAGS="$LDFLAGS"
201 fi
202 gzip -dc wv-1.2.4-gs.tar.gz | tar -xf -
203 cd wv-gs && \
204 ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --libdir="$libdir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS --disable-shared --enable-static LDFLAGS="$WV_LDFLAGS"
205else
206 echo "wvWare support disabled."
207 echo " add '--enable-wvware' to the configure command to include wvWare support."
208 echo ""
209fi
210
211if test x$? = x1 ;
212then
213 echo "Configuration of wvWare failed."
214 exit 1
215fi
216
217# configure the pdftohtml converter
218echo ""
219echo "Configuring pdftohtml"
220echo ""
221
222cd "$PACKAGES/pdftohtml"
223gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
224cd pdftohtml_gs && \
225./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
226
227if test x$? = x1 ;
228then
229 echo "Configuration of pdftohtml failed."
230 exit 1
231fi
232
233# rtftohtml converter
234echo ""
235echo "Configuring rtftohtml"
236echo ""
237
238cd "$PACKAGES/rtftohtml"
239gzip -dc rtftohtml-gs.tar.gz | tar -xf -
240cd rtftohtml_src && \
241./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
242
243if test x$? = x1 ;
244then
245 echo "Configuration of rtftohtml failed."
246 exit 1
247fi
248
249# configure wget
250echo ""
251echo "Configuring wget"
252echo ""
253cd "$PACKAGES/wget"
254gzip -dc wget-1.15-gs.tar.gz | tar -xf -
255if test x$crossOS = "xandroid" ;
256then
257 wget_extraargs="gl_cv_header_working_stdint_h=yes ac_cv_func_getopt_long_only=no"
258else
259 wget_extraargs=
260fi
261
262#./configure $CACHE_FILE --prefix=$PACKAGES/wget --without-ssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
263
264# We weren't compiling up wget statically before either
265# However, to compile up wget (statically or not) with openssl, see
266# https://stackoverflow.com/questions/9817337/compiling-wget-with-static-linking-self-compiled-openssl-library-linking-issu
267# Note: if the cppflags and ldflags are set during the configure stage, as we now do,
268# then the make command needn't additionally set them as well. So just make, make install then works
269echo cd "$PACKAGES/wget/wget-1.15-gs"
270echo CPPFLAGS="-I/$bindir/openssl/include" LDFLAGS="-L/$bindir/openssl/lib" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
271cd "$PACKAGES/wget/wget-1.15-gs" && \
272CPPFLAGS="-I/$bindir/openssl/include" LDFLAGS="-L/$bindir/openssl/lib" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
273
274
275##
276##CPPFLAGS="-I/Scratch/ak19/gs3-svn-13July2017/gs2build/bin/linux/openssl/include" LDFLAGS="-L/Scratch/ak19/gs3-svn-13July2017/gs2build/bin/linux/openssl/lib" ./configure --prefix=/Scratch/ak19/gs3-svn-13July2017/gs2build/build-src/packages/wget --with-ssl=openssl --bindir="/Scratch/ak19/gs3-svn-13July2017/gs2build/bin/linux" -disable-nls
277##
278##make CPPFLAGS="-I/Scratch/ak19/gs3-svn-13July2017/gs2build/bin/linux/openssl/include" LDFLAGS="-L/Scratch/ak19/gs3-svn-13July2017/gs2build/bin/linux/openssl/lib -static"
279
280if test x$? = x1 ;
281then
282 echo "Configuration of wget failed."
283 exit 1
284fi
285
286# configure XML::Parser perl module
287echo ""
288echo "Configuring XML::Parser"
289echo ""
290cd "$PACKAGES/cpan"
291
292perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl`
293
294gzip -dc XML-Parser-2.41.tar.gz | tar -xf -
295cd "$PACKAGES/cpan/XML-Parser-2.41" && \
296
297perl Makefile.PL \
298 PREFIX="$GSDLHOME/perllib/cpan/XML" \
299 INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
300 INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
301 INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
302 INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
303 SITEPREFIX="$GSDLHOME/perllib/cpan" \
304 EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
305 EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
306
307if test x$? = x1 ;
308then
309 echo "Configuration of XML-Parser failed."
310 exit 1
311fi
312
313# configure powerpoint converter
314echo ""
315echo "Configuring xlhtml (powerpoint & excel converter)"
316echo ""
317cd "$PACKAGES/xlhtml"
318gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
319cd xlhtml-0.4.9.0 && \
320./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
321
322if test x$? = x1 ;
323then
324 echo "Configuration of xlhtml failed."
325 exit 1
326fi
327
328# configure IsisGdl program
329echo ""
330echo "Configuring IsisGdl (CDS/ISIS database reader)"
331echo ""
332cd "$PACKAGES/isis-gdl" && \
333./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
334
335if test x$? = x1 ;
336then
337 echo "Configuration of IsisGdl failed."
338 exit 1
339fi
340
341# configure HTMLTidy program
342echo ""
343echo "Configuring HTMLTidy"
344echo ""
345cd "$PACKAGES/html-tidy"
346gzip -dc tidy.tgz | tar -xf -
347cd "$PACKAGES/html-tidy/tidy" && \
348./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
349
350if test x$? = x1 ;
351then
352 echo "Configuration of HTMLTidy failed."
353 exit 1
354fi
Note: See TracBrowser for help on using the repository browser.