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

Last change on this file since 26670 was 26664, checked in by davidb, 11 years ago

Support for cross-compilation added -- the CrossOS check

  • Property svn:executable set to *
File size: 6.9 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
146# datadir flag is for default location of wvHtml.xml config file
147if test x$USE_WVWARE = xtrue ;
148then
149 cd "$PACKAGES/wv"
150 gzip -dc wv-1.2.4-gs.tar.gz | tar -xf -
151 cd wv-gs && \
152 ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --libdir="$libdir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
153else
154 echo "wvWare support disabled."
155 echo " add '--enable-wvware' to the configure command to include wvWare support."
156 echo ""
157fi
158
159if test x$? = x1 ;
160then
161 echo "Configuration of wvWare failed."
162 exit 1
163fi
164
165# configure the pdftohtml converter
166echo ""
167echo "Configuring pdftohtml"
168echo ""
169
170cd "$PACKAGES/pdftohtml"
171gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
172cd pdftohtml_gs && \
173./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
174
175if test x$? = x1 ;
176then
177 echo "Configuration of pdftohtml failed."
178 exit 1
179fi
180
181# rtftohtml converter
182echo ""
183echo "Configuring rtftohtml"
184echo ""
185
186cd "$PACKAGES/rtftohtml"
187gzip -dc rtftohtml-gs.tar.gz | tar -xf -
188cd rtftohtml_src && \
189./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
190
191if test x$? = x1 ;
192then
193 echo "Configuration of rtftohtml failed."
194 exit 1
195fi
196
197# configure wget
198echo ""
199echo "Configuring wget"
200echo ""
201cd "$PACKAGES/wget"
202gzip -dc wget.tar.gz | tar -xf -
203cd "$PACKAGES/wget/wget-1.13.4" && \
204#./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS
205./configure $CACHE_FILE --prefix=$PACKAGES/wget --without-ssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS
206
207if test x$? = x1 ;
208then
209 echo "Configuration of wget failed."
210 exit 1
211fi
212
213# configure XML::Parser perl module
214echo ""
215echo "Configuring XML::Parser"
216echo ""
217cd "$PACKAGES/cpan"
218
219perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl`
220
221gzip -dc XML-Parser-2.34.tar.gz | tar -xf -
222cd "$PACKAGES/cpan/XML-Parser-2.34" && \
223
224perl Makefile.PL \
225 PREFIX="$GSDLHOME/perllib/cpan/XML" \
226 INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
227 INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
228 INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
229 INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
230 SITEPREFIX="$GSDLHOME/perllib/cpan" \
231 EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
232 EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
233
234if test x$? = x1 ;
235then
236 echo "Configuration of XML-Parser failed."
237 exit 1
238fi
239
240# configure powerpoint converter
241echo ""
242echo "Configuring xlhtml (powerpoint & excel converter)"
243echo ""
244cd "$PACKAGES/xlhtml"
245gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
246cd xlhtml-0.4.9.0 && \
247./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
248
249if test x$? = x1 ;
250then
251 echo "Configuration of xlhtml failed."
252 exit 1
253fi
254
255# configure IsisGdl program
256echo ""
257echo "Configuring IsisGdl (CDS/ISIS database reader)"
258echo ""
259cd "$PACKAGES/isis-gdl" && \
260./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
261
262if test x$? = x1 ;
263then
264 echo "Configuration of IsisGdl failed."
265 exit 1
266fi
267
268# configure HTMLTidy program
269echo ""
270echo "Configuring HTMLTidy"
271echo ""
272cd "$PACKAGES/html-tidy"
273gzip -dc tidy.tgz | tar -xf -
274cd "$PACKAGES/html-tidy/tidy" && \
275./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
276
277if test x$? = x1 ;
278then
279 echo "Configuration of HTMLTidy failed."
280 exit 1
281fi
Note: See TracBrowser for help on using the repository browser.