[16565] | 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
|
---|
[26664] | 14 | if test "x$crossOS" != "x" ; then
|
---|
| 15 | # Override derived value with value explicitly provided in crossOS
|
---|
| 16 | GSDLOS=$crossOS
|
---|
| 17 | fi
|
---|
[16565] | 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 |
|
---|
[23800] | 28 | # WVWARE compilation enabled by default, can switch it off with --disable-wvware
|
---|
| 29 | USE_WVWARE=true
|
---|
[22058] | 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
|
---|
[16565] | 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 | ;;
|
---|
[23800] | 61 | --disable-wvware)
|
---|
| 62 | USE_WVWARE=false
|
---|
| 63 | ;;
|
---|
[22058] | 64 | --disable-gdbm)
|
---|
| 65 | USE_GDBM=false
|
---|
| 66 | ;;
|
---|
| 67 | --disable-jdbm)
|
---|
| 68 | USE_JDBM=false
|
---|
| 69 | ;;
|
---|
[16565] | 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 | ;;
|
---|
[26664] | 108 | --host=* | --target=* | --build=*)
|
---|
[16565] | 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 |
|
---|
[23588] | 130 | libdir="${prefix}/lib/$GSDLOS"
|
---|
| 131 |
|
---|
[16565] | 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 |
|
---|
[27092] | 146 | # datadir flag is for default location of wvHtml.xml config file
|
---|
| 147 | if test x$USE_WVWARE = xtrue ;
|
---|
| 148 | then
|
---|
[23800] | 149 | cd "$PACKAGES/wv"
|
---|
| 150 | gzip -dc wv-1.2.4-gs.tar.gz | tar -xf -
|
---|
[27092] | 151 | cd wv-gs && \
|
---|
| 152 | ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --libdir="$libdir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
|
---|
[23800] | 153 | else
|
---|
| 154 | echo "wvWare support disabled."
|
---|
| 155 | echo " add '--enable-wvware' to the configure command to include wvWare support."
|
---|
| 156 | echo ""
|
---|
| 157 | fi
|
---|
[16565] | 158 |
|
---|
[26054] | 159 | if test x$? = x1 ;
|
---|
| 160 | then
|
---|
| 161 | echo "Configuration of wvWare failed."
|
---|
| 162 | exit 1
|
---|
| 163 | fi
|
---|
| 164 |
|
---|
[16565] | 165 | # configure the pdftohtml converter
|
---|
| 166 | echo ""
|
---|
| 167 | echo "Configuring pdftohtml"
|
---|
| 168 | echo ""
|
---|
| 169 |
|
---|
| 170 | cd "$PACKAGES/pdftohtml"
|
---|
| 171 | gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
|
---|
| 172 | cd pdftohtml_gs && \
|
---|
| 173 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 174 |
|
---|
[26054] | 175 | if test x$? = x1 ;
|
---|
| 176 | then
|
---|
| 177 | echo "Configuration of pdftohtml failed."
|
---|
| 178 | exit 1
|
---|
| 179 | fi
|
---|
| 180 |
|
---|
[16565] | 181 | # rtftohtml converter
|
---|
| 182 | echo ""
|
---|
| 183 | echo "Configuring rtftohtml"
|
---|
| 184 | echo ""
|
---|
| 185 |
|
---|
| 186 | cd "$PACKAGES/rtftohtml"
|
---|
| 187 | gzip -dc rtftohtml-gs.tar.gz | tar -xf -
|
---|
| 188 | cd rtftohtml_src && \
|
---|
| 189 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
| 190 |
|
---|
[26054] | 191 | if test x$? = x1 ;
|
---|
| 192 | then
|
---|
| 193 | echo "Configuration of rtftohtml failed."
|
---|
| 194 | exit 1
|
---|
| 195 | fi
|
---|
[16565] | 196 |
|
---|
| 197 | # configure wget
|
---|
| 198 | echo ""
|
---|
| 199 | echo "Configuring wget"
|
---|
| 200 | echo ""
|
---|
| 201 | cd "$PACKAGES/wget"
|
---|
| 202 | gzip -dc wget.tar.gz | tar -xf -
|
---|
[26819] | 203 | if test x$crossOS = "xandroid" ;
|
---|
| 204 | then
|
---|
| 205 | wget_extraargs="gl_cv_header_working_stdint_h=yes ac_cv_func_getopt_long_only=no"
|
---|
| 206 | else
|
---|
| 207 | wget_extraargs=
|
---|
| 208 | fi
|
---|
| 209 |
|
---|
[24815] | 210 | cd "$PACKAGES/wget/wget-1.13.4" && \
|
---|
[26819] | 211 | #./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
|
---|
| 212 | ./configure $CACHE_FILE --prefix=$PACKAGES/wget --without-ssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS $wget_extraargs
|
---|
[16565] | 213 |
|
---|
[26054] | 214 | if test x$? = x1 ;
|
---|
| 215 | then
|
---|
| 216 | echo "Configuration of wget failed."
|
---|
| 217 | exit 1
|
---|
| 218 | fi
|
---|
| 219 |
|
---|
[16565] | 220 | # configure XML::Parser perl module
|
---|
| 221 | echo ""
|
---|
| 222 | echo "Configuring XML::Parser"
|
---|
| 223 | echo ""
|
---|
| 224 | cd "$PACKAGES/cpan"
|
---|
[22414] | 225 |
|
---|
| 226 | perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl`
|
---|
| 227 |
|
---|
[16565] | 228 | gzip -dc XML-Parser-2.34.tar.gz | tar -xf -
|
---|
| 229 | cd "$PACKAGES/cpan/XML-Parser-2.34" && \
|
---|
[22378] | 230 |
|
---|
[16565] | 231 | perl Makefile.PL \
|
---|
| 232 | PREFIX="$GSDLHOME/perllib/cpan/XML" \
|
---|
| 233 | INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 234 | INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 235 | INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 236 | INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 237 | SITEPREFIX="$GSDLHOME/perllib/cpan" \
|
---|
[18244] | 238 | EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \
|
---|
| 239 | EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib"
|
---|
[16565] | 240 |
|
---|
[26054] | 241 | if test x$? = x1 ;
|
---|
| 242 | then
|
---|
| 243 | echo "Configuration of XML-Parser failed."
|
---|
| 244 | exit 1
|
---|
| 245 | fi
|
---|
[25151] | 246 |
|
---|
[16565] | 247 | # configure powerpoint converter
|
---|
| 248 | echo ""
|
---|
| 249 | echo "Configuring xlhtml (powerpoint & excel converter)"
|
---|
| 250 | echo ""
|
---|
| 251 | cd "$PACKAGES/xlhtml"
|
---|
[22159] | 252 | gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
|
---|
| 253 | cd xlhtml-0.4.9.0 && \
|
---|
[16565] | 254 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
| 255 |
|
---|
[26054] | 256 | if test x$? = x1 ;
|
---|
| 257 | then
|
---|
| 258 | echo "Configuration of xlhtml failed."
|
---|
| 259 | exit 1
|
---|
| 260 | fi
|
---|
[16565] | 261 |
|
---|
| 262 | # configure IsisGdl program
|
---|
| 263 | echo ""
|
---|
| 264 | echo "Configuring IsisGdl (CDS/ISIS database reader)"
|
---|
| 265 | echo ""
|
---|
| 266 | cd "$PACKAGES/isis-gdl" && \
|
---|
| 267 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 268 |
|
---|
[26054] | 269 | if test x$? = x1 ;
|
---|
| 270 | then
|
---|
| 271 | echo "Configuration of IsisGdl failed."
|
---|
| 272 | exit 1
|
---|
| 273 | fi
|
---|
| 274 |
|
---|
[16565] | 275 | # configure HTMLTidy program
|
---|
| 276 | echo ""
|
---|
| 277 | echo "Configuring HTMLTidy"
|
---|
| 278 | echo ""
|
---|
| 279 | cd "$PACKAGES/html-tidy"
|
---|
| 280 | gzip -dc tidy.tgz | tar -xf -
|
---|
| 281 | cd "$PACKAGES/html-tidy/tidy" && \
|
---|
| 282 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 283 |
|
---|
[26054] | 284 | if test x$? = x1 ;
|
---|
| 285 | then
|
---|
| 286 | echo "Configuration of HTMLTidy failed."
|
---|
| 287 | exit 1
|
---|
| 288 | fi |
---|