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

Revision 30896, 7.6 KB (checked in by ak19, 4 years ago)

Fixing error in commit.

  • 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# 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
150  # Look to see if gnome-lib extension is present and if so, source its devel.bash file
151  if [ -d ../../ext/gnome-lib ] ; then
152    pushd ../../ext/gnome-lib
153    source ./devel.bash
154    popd
155  fi
156
157  if [ -d ../../../ext/gnome-lib-minimal ] ; then
158    pushd ../../../ext/gnome-lib-minimal
159    source ./devel.bash
160    popd
161  fi
162
163  cd "$PACKAGES/wv"
164  if [ "x$GSDLOS" = "xdarwin" ]; then
165    WV_LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Carbon"
166  else
167    WV_LDFLAGS="$LDFLAGS"
168  fi
169  gzip -dc wv-1.2.4-gs.tar.gz | tar -xf - 
170  cd wv-gs && \
171  ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --libdir="$libdir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS --disable-shared --enable-static LDFLAGS="$WV_LDFLAGS"
172else
173  echo "wvWare support disabled."
174  echo "  add '--enable-wvware' to the configure command to include wvWare support."
175  echo ""
176fi
177
178if test x$? = x1 ;
179then
180  echo "Configuration of wvWare failed."
181  exit 1
182fi
183
184# configure the pdftohtml converter
185echo ""
186echo "Configuring pdftohtml"
187echo ""
188
189cd "$PACKAGES/pdftohtml"
190gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
191cd pdftohtml_gs && \
192./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
193
194if test x$? = x1 ;
195then
196  echo "Configuration of pdftohtml failed."
197  exit 1
198fi
199
200# rtftohtml converter
201echo ""
202echo "Configuring rtftohtml"
203echo ""
204
205cd "$PACKAGES/rtftohtml"
206gzip -dc rtftohtml-gs.tar.gz | tar -xf -
207cd rtftohtml_src && \
208./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
209
210if test x$? = x1 ;
211then
212  echo "Configuration of rtftohtml failed."
213  exit 1
214fi
215
216# configure wget
217echo ""
218echo "Configuring wget"
219echo ""
220cd "$PACKAGES/wget"
221gzip -dc wget-1.15-gs.tar.gz | tar -xf -
222if test x$crossOS = "xandroid" ;
223then
224  wget_extraargs="gl_cv_header_working_stdint_h=yes ac_cv_func_getopt_long_only=no"
225else
226  wget_extraargs=
227fi
228
229cd "$PACKAGES/wget/wget-1.15-gs" && \
230#./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
231./configure $CACHE_FILE --prefix=$PACKAGES/wget --without-ssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
232
233if test x$? = x1 ;
234then
235  echo "Configuration of wget failed."
236  exit 1
237fi
238
239# configure XML::Parser perl module
240echo ""
241echo "Configuring XML::Parser"
242echo ""
243cd "$PACKAGES/cpan"
244
245perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl`
246
247gzip -dc XML-Parser-2.41.tar.gz | tar -xf -
248cd "$PACKAGES/cpan/XML-Parser-2.41" && \
249
250perl Makefile.PL \
251  PREFIX="$GSDLHOME/perllib/cpan/XML" \
252  INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
253  INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
254  INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
255  INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
256  SITEPREFIX="$GSDLHOME/perllib/cpan" \
257  EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
258  EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
259
260if test x$? = x1 ;
261then
262  echo "Configuration of XML-Parser failed."
263  exit 1
264fi
265
266# configure powerpoint converter
267echo ""
268echo "Configuring xlhtml (powerpoint & excel converter)"
269echo ""
270cd "$PACKAGES/xlhtml"
271gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
272cd xlhtml-0.4.9.0 && \
273./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
274
275if test x$? = x1 ;
276then
277  echo "Configuration of xlhtml failed."
278  exit 1
279fi
280
281# configure IsisGdl program
282echo ""
283echo "Configuring IsisGdl (CDS/ISIS database reader)"
284echo ""
285cd "$PACKAGES/isis-gdl" && \
286./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
287
288if test x$? = x1 ;
289then
290  echo "Configuration of IsisGdl failed."
291  exit 1
292fi
293
294# configure HTMLTidy program
295echo ""
296echo "Configuring HTMLTidy"
297echo ""
298cd "$PACKAGES/html-tidy"
299gzip -dc tidy.tgz | tar -xf -
300cd "$PACKAGES/html-tidy/tidy" && \
301./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
302
303if test x$? = x1 ;
304then
305  echo "Configuration of HTMLTidy failed."
306  exit 1
307fi
Note: See TracBrowser for help on using the browser.