root/main/trunk/greenstone2/build-src/packages/configure @ 31834

Revision 31834, 11.2 KB (checked in by ak19, 2 years ago)

Going to check if at least wget-1.15 still compiles on the 64 bit release kit linux VM, albeit with open ssl now.

  • Property svn:executable set to *
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
152#openssl_pkgname=openssl-1.1.0f
153if test ! -d $openssl_pkgname ;
154then
155  gzip -dc $openssl_pkgname.tar.gz | tar -xf -
156fi
157cd $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.
175echo ./config --prefix=$PACKAGES/openssl --openssldir=$PACKAGES/openssl no-shared
176./config --prefix=$PACKAGES/openssl --openssldir=$PACKAGES/openssl no-shared
177# make
178echo make
179make
180# make install
181echo make install
182make install
183
184# now move the include, lib and bin folders to the correct place
185
186# configure the wvWare Word document converter
187echo ""
188echo "Configuring wvWare"
189echo ""
190
191# datadir flag is for default location of wvHtml.xml config file
192if test x$USE_WVWARE = xtrue ;
193then
194
195  # Look to see if gnome-lib extension is present and if so, source its devel.bash file
196  if [ -d ../../ext/gnome-lib ] ; then
197    pushd ../../ext/gnome-lib
198    source ./devel.bash
199    popd
200  fi
201
202  if [ -d ../../../ext/gnome-lib-minimal ] ; then
203    pushd ../../../ext/gnome-lib-minimal
204    source ./devel.bash
205    popd
206  fi
207
208  cd "$PACKAGES/wv"
209  if [ "x$GSDLOS" = "xdarwin" ]; then
210    WV_LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Carbon"
211  else
212    WV_LDFLAGS="$LDFLAGS"
213  fi
214  gzip -dc wv-1.2.4-gs.tar.gz | tar -xf - 
215  cd wv-gs && \
216  ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --libdir="$libdir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS --disable-shared --enable-static LDFLAGS="$WV_LDFLAGS"
217else
218  echo "wvWare support disabled."
219  echo "  add '--enable-wvware' to the configure command to include wvWare support."
220  echo ""
221fi
222
223if test x$? = x1 ;
224then
225  echo "Configuration of wvWare failed."
226  exit 1
227fi
228
229# configure the pdftohtml converter
230echo ""
231echo "Configuring pdftohtml"
232echo ""
233
234cd "$PACKAGES/pdftohtml"
235gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
236cd pdftohtml_gs && \
237./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
238
239if test x$? = x1 ;
240then
241  echo "Configuration of pdftohtml failed."
242  exit 1
243fi
244
245# rtftohtml converter
246echo ""
247echo "Configuring rtftohtml"
248echo ""
249
250cd "$PACKAGES/rtftohtml"
251gzip -dc rtftohtml-gs.tar.gz | tar -xf -
252cd rtftohtml_src && \
253./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
254
255if test x$? = x1 ;
256then
257  echo "Configuration of rtftohtml failed."
258  exit 1
259fi
260
261# configure wget
262wget_pkgname=wget-1.15-gs
263#wget_pkgname=wget-1.17.1-gs
264echo ""
265echo "Configuring wget"
266echo ""
267cd "$PACKAGES/wget"
268gzip -dc $wget_pkgname.tar.gz | tar -xf -
269if test x$crossOS = "xandroid" ;
270then
271  wget_extraargs="gl_cv_header_working_stdint_h=yes ac_cv_func_getopt_long_only=no"
272else
273  wget_extraargs=
274fi
275
276# When compiling wget-1.15-gs without openssl as before:
277#./configure $CACHE_FILE --prefix=$PACKAGES/wget --without-ssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
278
279# We weren't compiling up wget statically before either and we still aren't
280# However, to compile up wget (statically or not) with openssl, see
281# https://stackoverflow.com/questions/9817337/compiling-wget-with-static-linking-self-compiled-openssl-library-linking-issu
282# Note: contrary to the instructions at the link, if the cppflags and ldflags are set during the
283# configure stage, as we now do, then the make command needn't additionally set them as well.
284# So just make, make install works thereafter
285
286echo copying "$PACKAGES/wget/wgetrc-gs.in" file to "$bindir/wgetrc"
287cp "$PACKAGES/wget/wgetrc-gs.in" "$bindir/wgetrc"
288echo cd "$PACKAGES/wget/$wget_pkgname"
289
290# for wget-1.15-gs. (can also try adding --localstatedir="$bindir/wget" --enable-iri)
291echo CPPFLAGS="-I$PACKAGES/openssl/include" LDFLAGS="-L$PACKAGES/openssl/lib" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraarg
292cd "$PACKAGES/wget/$wget_pkgname" && \
293CPPFLAGS="-I$PACKAGES/openssl/include" LDFLAGS="-L$PACKAGES/openssl/lib" ./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
294
295# for wget-1.17.1-gs. (can also try adding --localstatedir="$bindir/wget" --enable-iri)
296##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
297##cd "$PACKAGES/wget/$wget_pkgname" && \
298##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
299
300
301if test x$? = x1 ;
302then
303  echo "Configuration of wget failed."
304  exit 1
305fi
306
307# configure XML::Parser perl module
308echo ""
309echo "Configuring XML::Parser"
310echo ""
311cd "$PACKAGES/cpan"
312
313perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl`
314
315gzip -dc XML-Parser-2.41.tar.gz | tar -xf -
316cd "$PACKAGES/cpan/XML-Parser-2.41" && \
317
318perl Makefile.PL \
319  PREFIX="$GSDLHOME/perllib/cpan/XML" \
320  INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
321  INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
322  INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
323  INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
324  SITEPREFIX="$GSDLHOME/perllib/cpan" \
325  EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
326  EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
327
328if test x$? = x1 ;
329then
330  echo "Configuration of XML-Parser failed."
331  exit 1
332fi
333
334# configure powerpoint converter
335echo ""
336echo "Configuring xlhtml (powerpoint & excel converter)"
337echo ""
338cd "$PACKAGES/xlhtml"
339gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
340cd xlhtml-0.4.9.0 && \
341./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
342
343if test x$? = x1 ;
344then
345  echo "Configuration of xlhtml failed."
346  exit 1
347fi
348
349# configure IsisGdl program
350echo ""
351echo "Configuring IsisGdl (CDS/ISIS database reader)"
352echo ""
353cd "$PACKAGES/isis-gdl" && \
354./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
355
356if test x$? = x1 ;
357then
358  echo "Configuration of IsisGdl failed."
359  exit 1
360fi
361
362# configure HTMLTidy program
363echo ""
364echo "Configuring HTMLTidy"
365echo ""
366cd "$PACKAGES/html-tidy"
367gzip -dc tidy.tgz | tar -xf -
368cd "$PACKAGES/html-tidy/tidy" && \
369./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
370
371if test x$? = x1 ;
372then
373  echo "Configuration of HTMLTidy failed."
374  exit 1
375fi
Note: See TracBrowser for help on using the browser.