1 | #! /bin/sh
|
---|
2 |
|
---|
3 | PACKAGES=`pwd`
|
---|
4 | cd ../..
|
---|
5 | GSDLHOME=`pwd`
|
---|
6 | cd $PACKAGES
|
---|
7 |
|
---|
8 | GSDLOS=`uname -s |tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
9 | # check for running bash under cygwin
|
---|
10 | if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
|
---|
11 | then
|
---|
12 | GSDLOS=windows
|
---|
13 | fi
|
---|
14 | if test "x$crossOS" != "x" ; then
|
---|
15 | # Override derived value with value explicitly provided in crossOS
|
---|
16 | GSDLOS=$crossOS
|
---|
17 | fi
|
---|
18 |
|
---|
19 | prefix=""
|
---|
20 | bindir=""
|
---|
21 | HOSTTARGETFLAGS=""
|
---|
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"
|
---|
26 | ENVIRONMENT=""
|
---|
27 |
|
---|
28 | # WVWARE compilation enabled by default, can switch it off with --disable-wvware
|
---|
29 | USE_WVWARE=true
|
---|
30 | # GDBM compilation enabled by default, can switch it off with --disable-gdbm
|
---|
31 | USE_GDBM=true
|
---|
32 | # JDBM compilation enabled by default, can switch it off with --disable-jdbm
|
---|
33 | USE_JDBM=true
|
---|
34 | # SQLite support enabled by default, can switch it off with --disable-sqlite
|
---|
35 | USE_SQLITE=true
|
---|
36 | # yaz compilation enabled by default, can switch it off with --disable-yaz
|
---|
37 | USE_YAZ=true
|
---|
38 | # z3950 server disabled by default, switch it on with --enable-z3950
|
---|
39 | USE_Z3950=false
|
---|
40 | # CORBA support disabled by default, switch it on with --enable-corba
|
---|
41 | USE_CORBA=false
|
---|
42 | MICO_DIR=default
|
---|
43 |
|
---|
44 | # parse any arguments given from toplevel configure
|
---|
45 | while 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
|
---|
116 | done
|
---|
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
|
---|
123 | prefix="${GSDLHOME}"
|
---|
124 | ##fi
|
---|
125 |
|
---|
126 | ##if test -z "$bindir" ; then
|
---|
127 | bindir="${prefix}/bin/$GSDLOS"
|
---|
128 | ##fi
|
---|
129 |
|
---|
130 | libdir="${prefix}/lib/$GSDLOS"
|
---|
131 |
|
---|
132 | # This loads the top configure's cache file, with variables already set.
|
---|
133 | if test -f "$cache_file" ; then
|
---|
134 | . $cache_file
|
---|
135 | fi
|
---|
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
|
---|
142 | echo ""
|
---|
143 | echo "Configuring wvWare"
|
---|
144 | echo ""
|
---|
145 |
|
---|
146 | # datadir flag is for default location of wvHtml.xml config file
|
---|
147 | if test x$USE_WVWARE = xtrue ;
|
---|
148 | then
|
---|
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 | cd "$PACKAGES/wv"
|
---|
158 | gzip -dc wv-1.2.4-gs.tar.gz | tar -xf -
|
---|
159 | cd wv-gs && \
|
---|
160 | ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --libdir="$libdir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
|
---|
161 | else
|
---|
162 | echo "wvWare support disabled."
|
---|
163 | echo " add '--enable-wvware' to the configure command to include wvWare support."
|
---|
164 | echo ""
|
---|
165 | fi
|
---|
166 |
|
---|
167 | if test x$? = x1 ;
|
---|
168 | then
|
---|
169 | echo "Configuration of wvWare failed."
|
---|
170 | exit 1
|
---|
171 | fi
|
---|
172 |
|
---|
173 | # configure the pdftohtml converter
|
---|
174 | echo ""
|
---|
175 | echo "Configuring pdftohtml"
|
---|
176 | echo ""
|
---|
177 |
|
---|
178 | cd "$PACKAGES/pdftohtml"
|
---|
179 | gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
|
---|
180 | cd pdftohtml_gs && \
|
---|
181 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
182 |
|
---|
183 | if test x$? = x1 ;
|
---|
184 | then
|
---|
185 | echo "Configuration of pdftohtml failed."
|
---|
186 | exit 1
|
---|
187 | fi
|
---|
188 |
|
---|
189 | # rtftohtml converter
|
---|
190 | echo ""
|
---|
191 | echo "Configuring rtftohtml"
|
---|
192 | echo ""
|
---|
193 |
|
---|
194 | cd "$PACKAGES/rtftohtml"
|
---|
195 | gzip -dc rtftohtml-gs.tar.gz | tar -xf -
|
---|
196 | cd rtftohtml_src && \
|
---|
197 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
198 |
|
---|
199 | if test x$? = x1 ;
|
---|
200 | then
|
---|
201 | echo "Configuration of rtftohtml failed."
|
---|
202 | exit 1
|
---|
203 | fi
|
---|
204 |
|
---|
205 | # configure wget
|
---|
206 | echo ""
|
---|
207 | echo "Configuring wget"
|
---|
208 | echo ""
|
---|
209 | cd "$PACKAGES/wget"
|
---|
210 | gzip -dc wget-1.15-gs.tar.gz | tar -xf -
|
---|
211 | if test x$crossOS = "xandroid" ;
|
---|
212 | then
|
---|
213 | wget_extraargs="gl_cv_header_working_stdint_h=yes ac_cv_func_getopt_long_only=no"
|
---|
214 | else
|
---|
215 | wget_extraargs=
|
---|
216 | fi
|
---|
217 |
|
---|
218 | cd "$PACKAGES/wget/wget-1.15-gs" && \
|
---|
219 | #./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
|
---|
220 | ./configure $CACHE_FILE --prefix=$PACKAGES/wget --without-ssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
|
---|
221 |
|
---|
222 | if test x$? = x1 ;
|
---|
223 | then
|
---|
224 | echo "Configuration of wget failed."
|
---|
225 | exit 1
|
---|
226 | fi
|
---|
227 |
|
---|
228 | # configure XML::Parser perl module
|
---|
229 | echo ""
|
---|
230 | echo "Configuring XML::Parser"
|
---|
231 | echo ""
|
---|
232 | cd "$PACKAGES/cpan"
|
---|
233 |
|
---|
234 | perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl`
|
---|
235 |
|
---|
236 | gzip -dc XML-Parser-2.41.tar.gz | tar -xf -
|
---|
237 | cd "$PACKAGES/cpan/XML-Parser-2.41" && \
|
---|
238 |
|
---|
239 | perl Makefile.PL \
|
---|
240 | PREFIX="$GSDLHOME/perllib/cpan/XML" \
|
---|
241 | INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
242 | INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
243 | INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
244 | INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
245 | SITEPREFIX="$GSDLHOME/perllib/cpan" \
|
---|
246 | EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
|
---|
247 | EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
|
---|
248 |
|
---|
249 | if test x$? = x1 ;
|
---|
250 | then
|
---|
251 | echo "Configuration of XML-Parser failed."
|
---|
252 | exit 1
|
---|
253 | fi
|
---|
254 |
|
---|
255 | # configure powerpoint converter
|
---|
256 | echo ""
|
---|
257 | echo "Configuring xlhtml (powerpoint & excel converter)"
|
---|
258 | echo ""
|
---|
259 | cd "$PACKAGES/xlhtml"
|
---|
260 | gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
|
---|
261 | cd xlhtml-0.4.9.0 && \
|
---|
262 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
263 |
|
---|
264 | if test x$? = x1 ;
|
---|
265 | then
|
---|
266 | echo "Configuration of xlhtml failed."
|
---|
267 | exit 1
|
---|
268 | fi
|
---|
269 |
|
---|
270 | # configure IsisGdl program
|
---|
271 | echo ""
|
---|
272 | echo "Configuring IsisGdl (CDS/ISIS database reader)"
|
---|
273 | echo ""
|
---|
274 | cd "$PACKAGES/isis-gdl" && \
|
---|
275 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
276 |
|
---|
277 | if test x$? = x1 ;
|
---|
278 | then
|
---|
279 | echo "Configuration of IsisGdl failed."
|
---|
280 | exit 1
|
---|
281 | fi
|
---|
282 |
|
---|
283 | # configure HTMLTidy program
|
---|
284 | echo ""
|
---|
285 | echo "Configuring HTMLTidy"
|
---|
286 | echo ""
|
---|
287 | cd "$PACKAGES/html-tidy"
|
---|
288 | gzip -dc tidy.tgz | tar -xf -
|
---|
289 | cd "$PACKAGES/html-tidy/tidy" && \
|
---|
290 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
291 |
|
---|
292 | if test x$? = x1 ;
|
---|
293 | then
|
---|
294 | echo "Configuration of HTMLTidy failed."
|
---|
295 | exit 1
|
---|
296 | fi
|
---|