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

Revision 24632, 6.6 KB (checked in by sjm84, 8 years ago)

wget will no longer look for a gettext/intl library

  • 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
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
155# configure the pdftohtml converter
156echo ""
157echo "Configuring pdftohtml"
158echo ""
159
160cd "$PACKAGES/pdftohtml"
161gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
162cd pdftohtml_gs && \
163./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
164
165# rtftohtml converter
166echo ""
167echo "Configuring rtftohtml"
168echo ""
169
170cd "$PACKAGES/rtftohtml"
171gzip -dc rtftohtml-gs.tar.gz | tar -xf -
172cd rtftohtml_src && \
173./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
174
175
176
177# configure wget
178echo ""
179echo "Configuring wget"
180echo ""
181cd "$PACKAGES/wget"
182gzip -dc wget.tar.gz | tar -xf -
183cd "$PACKAGES/wget/wget-1.11.4" && \
184./configure $CACHE_FILE --prefix=$PACKAGES/wget --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS
185
186
187# configure XML::Parser perl module
188echo ""
189echo "Configuring XML::Parser"
190echo ""
191cd "$PACKAGES/cpan"
192
193perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl`
194
195gzip -dc XML-Parser-2.34.tar.gz | tar -xf -
196cd "$PACKAGES/cpan/XML-Parser-2.34" && \
197
198#Use 64-bit expat library on 64-bit machines, otherwise use 32-bit
199if test ! -z "$COMPAT32BITFLAGS" ; then
200perl Makefile.PL \
201  PREFIX="$GSDLHOME/perllib/cpan/XML" \
202  INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
203  INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
204  INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
205  INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
206  SITEPREFIX="$GSDLHOME/perllib/cpan" \
207  EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
208  EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib64"
209else
210perl Makefile.PL \
211  PREFIX="$GSDLHOME/perllib/cpan/XML" \
212  INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
213  INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
214  INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
215  INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
216  SITEPREFIX="$GSDLHOME/perllib/cpan" \
217  EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
218  EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
219fi
220
221# configure powerpoint converter
222echo ""
223echo "Configuring xlhtml (powerpoint & excel converter)"
224echo ""
225cd "$PACKAGES/xlhtml"
226gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
227cd xlhtml-0.4.9.0 && \
228./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
229
230
231# configure IsisGdl program
232echo ""
233echo "Configuring IsisGdl (CDS/ISIS database reader)"
234echo ""
235cd "$PACKAGES/isis-gdl" && \
236./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
237
238# configure HTMLTidy program
239echo ""
240echo "Configuring HTMLTidy"
241echo ""
242cd "$PACKAGES/html-tidy"
243gzip -dc tidy.tgz | tar -xf -
244cd "$PACKAGES/html-tidy/tidy" && \
245./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
246
Note: See TracBrowser for help on using the browser.