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

Last change on this file since 27091 was 27091, checked in by ak19, 10 years ago

Automating configuring and compiling of wvware with gnome-lib. Tested with GS2. Still to test with GS3.

  • Property svn:executable set to *
File size: 8.3 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# configure the wvWare Word document converter
142echo ""
143echo "Configuring wvWare"
144echo ""
145
146if test x$USE_WVWARE = xtrue ; then
147
148 gnomelibmin="${prefix}/ext/gnome-lib-minimal"
149 gnomelibsrc="${prefix}/ext/gnome-lib"
150 gnomelibcompiled="${prefix}/ext/gnome-lib/$GSDLOS"
151# the gnome-lib folder (minimal or src) from which we'll run
152# source devel.bash before we can configure (and eventually compile) wvware:
153 gnomelibdir=""
154
155# a gnome-lib-minimal folder is a binary gnome-lib, so doesn't
156# need to be compiled up
157 if test -d "$gnomelibmin" ; then
158 gnomelibdir=$gnomelibmin
159
160 else
161 if test -d "$gnomelibsrc" ; then
162 gnomelibdir=$gnomelibsrc
163
164 if test ! -d "$gnomelibcompiled" ; then
165# there is a gnome-lib source folder but it's not yet compiled up,
166# so compile it first before we can configure let alone compile wvware
167 echo "*** Going to compile gnome-lib source code in $gnomelibsrc"
168 cd "$gnomelibsrc" && chmod a+rx devel.bash && ./CASCADE-MAKE.sh
169 fi
170 fi
171 fi
172
173 cd "$PACKAGES/wv"
174 gzip -dc wv-1.2.4-gs.tar.gz | tar -xf -
175
176# datadir flag is for default location of wvHtml.xml config file
177 if test -z "$gnomelibdir" ; then
178 cd "wv-gs" && \
179 ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --libdir="$libdir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
180
181 else
182 echo "**** Compiling wvware with the help of gnome-lib in $gnomelibdir"
183
184 /bin/bash -c "cd \"$gnomelibdir\" source devel.bash && cd \"$PACKAGES/wv/wv-gs\" ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir=\"$bindir\" --libdir=\"$libdir\" --datadir=\"$prefix/etc/packages\" $HOSTTARGETFLAGS"
185 fi
186
187else
188 echo "wvWare support disabled."
189 echo " add '--enable-wvware' to the configure command to include wvWare support."
190 echo ""
191fi
192
193if test x$? = x1 ;
194then
195 echo "Configuration of wvWare failed."
196 exit 1
197fi
198
199# configure the pdftohtml converter
200echo ""
201echo "Configuring pdftohtml"
202echo ""
203
204cd "$PACKAGES/pdftohtml"
205gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
206cd pdftohtml_gs && \
207./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
208
209if test x$? = x1 ;
210then
211 echo "Configuration of pdftohtml failed."
212 exit 1
213fi
214
215# rtftohtml converter
216echo ""
217echo "Configuring rtftohtml"
218echo ""
219
220cd "$PACKAGES/rtftohtml"
221gzip -dc rtftohtml-gs.tar.gz | tar -xf -
222cd rtftohtml_src && \
223./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
224
225if test x$? = x1 ;
226then
227 echo "Configuration of rtftohtml failed."
228 exit 1
229fi
230
231# configure wget
232echo ""
233echo "Configuring wget"
234echo ""
235cd "$PACKAGES/wget"
236gzip -dc wget.tar.gz | tar -xf -
237if test x$crossOS = "xandroid" ;
238then
239 wget_extraargs="gl_cv_header_working_stdint_h=yes ac_cv_func_getopt_long_only=no"
240else
241 wget_extraargs=
242fi
243
244cd "$PACKAGES/wget/wget-1.13.4" && \
245#./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
246./configure $CACHE_FILE --prefix=$PACKAGES/wget --without-ssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
247
248if test x$? = x1 ;
249then
250 echo "Configuration of wget failed."
251 exit 1
252fi
253
254# configure XML::Parser perl module
255echo ""
256echo "Configuring XML::Parser"
257echo ""
258cd "$PACKAGES/cpan"
259
260perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl`
261
262gzip -dc XML-Parser-2.34.tar.gz | tar -xf -
263cd "$PACKAGES/cpan/XML-Parser-2.34" && \
264
265perl Makefile.PL \
266 PREFIX="$GSDLHOME/perllib/cpan/XML" \
267 INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
268 INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
269 INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
270 INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
271 SITEPREFIX="$GSDLHOME/perllib/cpan" \
272 EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
273 EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
274
275if test x$? = x1 ;
276then
277 echo "Configuration of XML-Parser failed."
278 exit 1
279fi
280
281# configure powerpoint converter
282echo ""
283echo "Configuring xlhtml (powerpoint & excel converter)"
284echo ""
285cd "$PACKAGES/xlhtml"
286gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
287cd xlhtml-0.4.9.0 && \
288./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
289
290if test x$? = x1 ;
291then
292 echo "Configuration of xlhtml failed."
293 exit 1
294fi
295
296# configure IsisGdl program
297echo ""
298echo "Configuring IsisGdl (CDS/ISIS database reader)"
299echo ""
300cd "$PACKAGES/isis-gdl" && \
301./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
302
303if test x$? = x1 ;
304then
305 echo "Configuration of IsisGdl failed."
306 exit 1
307fi
308
309# configure HTMLTidy program
310echo ""
311echo "Configuring HTMLTidy"
312echo ""
313cd "$PACKAGES/html-tidy"
314gzip -dc tidy.tgz | tar -xf -
315cd "$PACKAGES/html-tidy/tidy" && \
316./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
317
318if test x$? = x1 ;
319then
320 echo "Configuration of HTMLTidy failed."
321 exit 1
322fi
Note: See TracBrowser for help on using the repository browser.