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

Revision 31832, 10.6 KB (checked in by ak19, 3 years ago)

Moved to compiling up wget-1.17.1-gs, so adding the appropriate tar.gz file besides the changes to build-src/packages' configure and Makefiles.

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