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

Last change on this file since 26054 was 26054, checked in by sjm84, 12 years ago

Configuration will now fail if one of the build-src packages fails to configure

  • Property svn:executable set to *
File size: 6.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
14
15prefix=""
16bindir=""
17HOSTTARGETFLAGS=""
18
19# only some of the packages can take environment variables as options to
20# configure
21# format is VAR=value, e.g "LDFLAGS=-static"
22ENVIRONMENT=""
23
24# WVWARE compilation enabled by default, can switch it off with --disable-wvware
25USE_WVWARE=true
26# GDBM compilation enabled by default, can switch it off with --disable-gdbm
27USE_GDBM=true
28# JDBM compilation enabled by default, can switch it off with --disable-jdbm
29USE_JDBM=true
30# SQLite support enabled by default, can switch it off with --disable-sqlite
31USE_SQLITE=true
32# yaz compilation enabled by default, can switch it off with --disable-yaz
33USE_YAZ=true
34# z3950 server disabled by default, switch it on with --enable-z3950
35USE_Z3950=false
36# CORBA support disabled by default, switch it on with --enable-corba
37USE_CORBA=false
38MICO_DIR=default
39
40# parse any arguments given from toplevel configure
41while test $# -ne 0; do
42 case "$1" in
43 --cache-file=*)
44 cache_filename=`echo $1 | sed s/--cache-file=//`
45 # turn relative path into an absolute path
46 cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
47 cache_dir=`cd $cache_dir 2>/dev/null && pwd`
48
49 cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
50 cache_file="$cache_dir/$cache_basefile"
51 if test ! -f "$cache_file"; then
52 CACHE_FILE=""
53 else
54 CACHE_FILE="--cache-file=$cache_file"
55 fi
56 ;;
57 --disable-wvware)
58 USE_WVWARE=false
59 ;;
60 --disable-gdbm)
61 USE_GDBM=false
62 ;;
63 --disable-jdbm)
64 USE_JDBM=false
65 ;;
66 --disable-sqlite)
67 USE_SQLITE=false
68 ;;
69 --disable-yaz)
70 USE_YAZ=false
71 ;;
72 --enable-z3950)
73 USE_Z3950=true
74 ;;
75 --enable-corba)
76 USE_CORBA=true
77 ;;
78 --with-micodir=*)
79 if test $1 = ""; then
80 $1 = "default"
81 fi
82 MICO_DIR=$1
83 ;;
84 --prefix=*)
85 prefix=`echo $1 | sed s/--prefix=//`
86 ;;
87 --bindir=*)
88 # where to install binaries to
89 bindir=`echo $1 | sed s/--bindir=//`
90 # turn relative path into an absolute path
91 if test -d "$bindir" ; then
92 bindir=`cd "$bindir" ; pwd `
93 cd "$PACKAGES"
94 elif test -z `echo $bindir | sed '/^\// p;D'` ; then
95 rel_bindir="`echo $bindir | sed s@/.*@@`"
96 cd "$rel_bindir"
97 bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
98 cd "$PACKAGES"
99 else
100 # bindir doesn't exist, and isn't relative
101 true
102 fi
103 ;;
104 --host=* | --target=*)
105 HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
106 ;;
107 *)
108 # ignore all other options for now
109 ;;
110 esac
111 shift
112done
113
114# note! Our GSDL package currently always installs into it's source
115# directory, ignoring any --prefix given to configure.
116# When this is fixed, uncomment the relevant lines below...
117
118##if test -z "$prefix" ; then
119prefix="${GSDLHOME}"
120##fi
121
122##if test -z "$bindir" ; then
123bindir="${prefix}/bin/$GSDLOS"
124##fi
125
126libdir="${prefix}/lib/$GSDLOS"
127
128# This loads the top configure's cache file, with variables already set.
129if test -f "$cache_file" ; then
130 . $cache_file
131fi
132
133# we assume that gzip and tar are on the search path.
134# non-GNU versions of tar don't take the -z option.
135
136
137# configure the wvWare Word document converter
138echo ""
139echo "Configuring wvWare"
140echo ""
141
142# datadir flag is for default location of wvHtml.xml config file
143if test x$USE_WVWARE = xtrue ;
144then
145 cd "$PACKAGES/wv"
146 gzip -dc wv-1.2.4-gs.tar.gz | tar -xf -
147 cd wv-gs && \
148 ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --libdir="$libdir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
149else
150 echo "wvWare support disabled."
151 echo " add '--enable-wvware' to the configure command to include wvWare support."
152 echo ""
153fi
154
155if test x$? = x1 ;
156then
157 echo "Configuration of wvWare failed."
158 exit 1
159fi
160
161# configure the pdftohtml converter
162echo ""
163echo "Configuring pdftohtml"
164echo ""
165
166cd "$PACKAGES/pdftohtml"
167gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
168cd pdftohtml_gs && \
169./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
170
171if test x$? = x1 ;
172then
173 echo "Configuration of pdftohtml failed."
174 exit 1
175fi
176
177# rtftohtml converter
178echo ""
179echo "Configuring rtftohtml"
180echo ""
181
182cd "$PACKAGES/rtftohtml"
183gzip -dc rtftohtml-gs.tar.gz | tar -xf -
184cd rtftohtml_src && \
185./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
186
187if test x$? = x1 ;
188then
189 echo "Configuration of rtftohtml failed."
190 exit 1
191fi
192
193# configure wget
194echo ""
195echo "Configuring wget"
196echo ""
197cd "$PACKAGES/wget"
198gzip -dc wget.tar.gz | tar -xf -
199cd "$PACKAGES/wget/wget-1.13.4" && \
200#./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS
201./configure $CACHE_FILE --prefix=$PACKAGES/wget --without-ssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS
202
203if test x$? = x1 ;
204then
205 echo "Configuration of wget failed."
206 exit 1
207fi
208
209# configure XML::Parser perl module
210echo ""
211echo "Configuring XML::Parser"
212echo ""
213cd "$PACKAGES/cpan"
214
215perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl`
216
217gzip -dc XML-Parser-2.34.tar.gz | tar -xf -
218cd "$PACKAGES/cpan/XML-Parser-2.34" && \
219
220perl Makefile.PL \
221 PREFIX="$GSDLHOME/perllib/cpan/XML" \
222 INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
223 INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
224 INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
225 INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
226 SITEPREFIX="$GSDLHOME/perllib/cpan" \
227 EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
228 EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
229
230if test x$? = x1 ;
231then
232 echo "Configuration of XML-Parser failed."
233 exit 1
234fi
235
236# configure powerpoint converter
237echo ""
238echo "Configuring xlhtml (powerpoint & excel converter)"
239echo ""
240cd "$PACKAGES/xlhtml"
241gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
242cd xlhtml-0.4.9.0 && \
243./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
244
245if test x$? = x1 ;
246then
247 echo "Configuration of xlhtml failed."
248 exit 1
249fi
250
251# configure IsisGdl program
252echo ""
253echo "Configuring IsisGdl (CDS/ISIS database reader)"
254echo ""
255cd "$PACKAGES/isis-gdl" && \
256./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
257
258if test x$? = x1 ;
259then
260 echo "Configuration of IsisGdl failed."
261 exit 1
262fi
263
264# configure HTMLTidy program
265echo ""
266echo "Configuring HTMLTidy"
267echo ""
268cd "$PACKAGES/html-tidy"
269gzip -dc tidy.tgz | tar -xf -
270cd "$PACKAGES/html-tidy/tidy" && \
271./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
272
273if test x$? = x1 ;
274then
275 echo "Configuration of HTMLTidy failed."
276 exit 1
277fi
Note: See TracBrowser for help on using the repository browser.