[1668] | 1 | #! /bin/sh
|
---|
| 2 |
|
---|
| 3 | PACKAGES=`pwd`
|
---|
[1704] | 4 | cd ..
|
---|
| 5 | GSDLHOME=`pwd`
|
---|
| 6 | cd $PACKAGES
|
---|
[2987] | 7 |
|
---|
[2952] | 8 | GSDLOS=`uname -s |tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
[2987] | 9 | # check for running bash under cygwin
|
---|
| 10 | if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
|
---|
| 11 | then
|
---|
| 12 | GSDLOS=windows
|
---|
| 13 | fi
|
---|
| 14 |
|
---|
[2421] | 15 | prefix=""
|
---|
| 16 | bindir=""
|
---|
[2725] | 17 | HOSTTARGETFLAGS=""
|
---|
[1668] | 18 |
|
---|
[13475] | 19 | # only some of the packages can take environment variables as options to
|
---|
| 20 | # configure
|
---|
| 21 | # format is VAR=value, e.g "LDFLAGS=-static"
|
---|
[13740] | 22 | ENVIRONMENT=""
|
---|
[13475] | 23 |
|
---|
[15814] | 24 | # SQLite support disabled by default, switch it on with --enable-sqlite
|
---|
| 25 | USE_SQLITE=false
|
---|
[12494] | 26 | # yaz compilation enabled by default, can switch it off with --disable-yaz
|
---|
| 27 | USE_YAZ=true
|
---|
| 28 | # z3950 server disabled by default, switch it on with --enable-z3950
|
---|
| 29 | USE_Z3950=false
|
---|
[15814] | 30 | # CORBA support disabled by default, switch it on with --enable-corba
|
---|
| 31 | USE_CORBA=false
|
---|
| 32 | MICO_DIR=default
|
---|
[13772] | 33 |
|
---|
[1715] | 34 | # parse any arguments given from toplevel configure
|
---|
| 35 | while test $# -ne 0; do
|
---|
| 36 | case "$1" in
|
---|
| 37 | --cache-file=*)
|
---|
| 38 | cache_filename=`echo $1 | sed s/--cache-file=//`
|
---|
| 39 | # turn relative path into an absolute path
|
---|
| 40 | cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
|
---|
| 41 | cache_dir=`cd $cache_dir 2>/dev/null && pwd`
|
---|
| 42 |
|
---|
| 43 | cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
|
---|
| 44 | cache_file="$cache_dir/$cache_basefile"
|
---|
| 45 | if test ! -f "$cache_file"; then
|
---|
| 46 | CACHE_FILE=""
|
---|
| 47 | else
|
---|
| 48 | CACHE_FILE="--cache-file=$cache_file"
|
---|
| 49 | fi
|
---|
| 50 | ;;
|
---|
[15814] | 51 | --enable-sqlite)
|
---|
| 52 | USE_SQLITE=true
|
---|
[1940] | 53 | ;;
|
---|
[12494] | 54 | --disable-yaz)
|
---|
| 55 | USE_YAZ=false
|
---|
| 56 | ;;
|
---|
[15814] | 57 | --enable-z3950)
|
---|
| 58 | USE_Z3950=true
|
---|
| 59 | ;;
|
---|
[2113] | 60 | --enable-corba)
|
---|
| 61 | USE_CORBA=true
|
---|
| 62 | ;;
|
---|
[2173] | 63 | --with-micodir=*)
|
---|
| 64 | if test $1 = ""; then
|
---|
| 65 | $1 = "default"
|
---|
| 66 | fi
|
---|
| 67 | MICO_DIR=$1
|
---|
| 68 | ;;
|
---|
[2421] | 69 | --prefix=*)
|
---|
| 70 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
| 71 | ;;
|
---|
[2019] | 72 | --bindir=*)
|
---|
[2421] | 73 | # where to install binaries to
|
---|
[2169] | 74 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
[2952] | 75 | # turn relative path into an absolute path
|
---|
| 76 | if test -d "$bindir" ; then
|
---|
| 77 | bindir=`cd "$bindir" ; pwd `
|
---|
[2169] | 78 | cd "$PACKAGES"
|
---|
| 79 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
[2952] | 80 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
| 81 | cd "$rel_bindir"
|
---|
| 82 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
[2169] | 83 | cd "$PACKAGES"
|
---|
| 84 | else
|
---|
| 85 | # bindir doesn't exist, and isn't relative
|
---|
| 86 | true
|
---|
| 87 | fi
|
---|
[2019] | 88 | ;;
|
---|
[2725] | 89 | --host=* | --target=*)
|
---|
| 90 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
| 91 | ;;
|
---|
[1715] | 92 | *)
|
---|
| 93 | # ignore all other options for now
|
---|
| 94 | ;;
|
---|
| 95 | esac
|
---|
| 96 | shift
|
---|
| 97 | done
|
---|
| 98 |
|
---|
[2421] | 99 | # note! Our GSDL package currently always installs into it's source
|
---|
| 100 | # directory, ignoring any --prefix given to configure.
|
---|
| 101 | # When this is fixed, uncomment the relevant lines below...
|
---|
| 102 |
|
---|
| 103 | ##if test -z "$prefix" ; then
|
---|
| 104 | prefix="${GSDLHOME}"
|
---|
| 105 | ##fi
|
---|
| 106 |
|
---|
| 107 | ##if test -z "$bindir" ; then
|
---|
| 108 | bindir="${prefix}/bin/$GSDLOS"
|
---|
| 109 | ##fi
|
---|
| 110 |
|
---|
[2952] | 111 | # This loads the top configure's cache file, with variables already set.
|
---|
| 112 | if test -f "$cache_file" ; then
|
---|
| 113 | . $cache_file
|
---|
| 114 | fi
|
---|
[2421] | 115 |
|
---|
[2169] | 116 | # we assume that gzip and tar are on the search path.
|
---|
| 117 | # non-GNU versions of tar don't take the -z option.
|
---|
| 118 |
|
---|
[2380] | 119 | if test $USE_CORBA = true ; then
|
---|
[2173] | 120 | if test $MICO_DIR = default; then
|
---|
| 121 | # configure the MICO CORBA ORB
|
---|
| 122 | echo ""
|
---|
| 123 | echo "Configuring MICO CORBA"
|
---|
| 124 | echo ""
|
---|
[1715] | 125 |
|
---|
[2173] | 126 | cd "$PACKAGES/mico"
|
---|
| 127 | gzip -dc mico-2.3.5.tar.gz | tar -xf -
|
---|
[6334] | 128 | cd mico && \
|
---|
[2173] | 129 | ./configure $CACHE_FILE --prefix=$PACKAGES/mico/ --disable-coss --disable-naming --disable-relship --disable-events --disable-streams --disable-property --disable-trader --disable-time --disable-debug --enable-optimize --enable-final --enable-speed-tune
|
---|
| 130 | sed 's/tools//' $PACKAGES/mico/mico/Makefile | sed 's/ldconfig//' >$PACKAGES/mico/mico/Makefile.out
|
---|
| 131 | mv $PACKAGES/mico/mico/Makefile.out $PACKAGES/mico/mico/Makefile
|
---|
| 132 | else
|
---|
| 133 | #MICO is on the system path
|
---|
| 134 | echo ""
|
---|
| 135 | echo "Taking MICO from system paths"
|
---|
| 136 | echo ""
|
---|
| 137 | fi
|
---|
[2169] | 138 | else
|
---|
| 139 | echo "corba support disabled - mico compiler not required."
|
---|
| 140 | echo " add '--enable-corba' to the configure command to include corba support."
|
---|
| 141 | echo ""
|
---|
[2113] | 142 | fi
|
---|
[1715] | 143 |
|
---|
[2129] | 144 |
|
---|
| 145 |
|
---|
| 146 |
|
---|
[2169] | 147 |
|
---|
[1668] | 148 | # configure the wvWare Word document converter
|
---|
| 149 | echo ""
|
---|
| 150 | echo "Configuring wvWare"
|
---|
[1978] | 151 | echo ""
|
---|
[1668] | 152 |
|
---|
[1996] | 153 | cd "$PACKAGES/wv"
|
---|
[3075] | 154 | gzip -dc wv-0.7.1-gs.tar.gz | tar -xf -
|
---|
[2582] | 155 | # datadir is for default location of wvHtml.xml config file
|
---|
[6334] | 156 | cd wv-gs && \
|
---|
[2725] | 157 | ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS
|
---|
[1668] | 158 |
|
---|
[1961] | 159 | # configure the pdftohtml converter
|
---|
| 160 | echo ""
|
---|
| 161 | echo "Configuring pdftohtml"
|
---|
| 162 | echo ""
|
---|
[1668] | 163 |
|
---|
[1996] | 164 | cd "$PACKAGES/pdftohtml"
|
---|
[7284] | 165 | gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf -
|
---|
| 166 | cd pdftohtml_gs && \
|
---|
[13475] | 167 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[1961] | 168 |
|
---|
[2582] | 169 | # rtftohtml converter
|
---|
| 170 | echo ""
|
---|
| 171 | echo "Configuring rtftohtml"
|
---|
| 172 | echo ""
|
---|
[2349] | 173 |
|
---|
[2582] | 174 | cd "$PACKAGES/rtftohtml"
|
---|
| 175 | gzip -dc rtftohtml-gs.tar.gz | tar -xf -
|
---|
[6334] | 176 | cd rtftohtml_src && \
|
---|
[2902] | 177 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
[2582] | 178 |
|
---|
| 179 |
|
---|
[12494] | 180 | # D2M stuff needed for z3950server
|
---|
| 181 | echo ""
|
---|
| 182 | echo "Configuring D2M"
|
---|
| 183 | if test x$USE_Z3950 = xtrue ;
|
---|
| 184 | then
|
---|
| 185 | USE_YAZ=true
|
---|
| 186 | echo ""
|
---|
| 187 | cd "$PACKAGES/d2m"
|
---|
| 188 | ./configure $CACHE_FILE --prefix="$PACKAGES/d2m" $HOSTTARGETFLAGS
|
---|
| 189 | else
|
---|
| 190 | echo "Z39.50 support disabled - D2M library not required."
|
---|
| 191 | echo " add '--enable-z3950' to the configure command to include z39.50 support."
|
---|
| 192 | echo ""
|
---|
| 193 | fi
|
---|
| 194 |
|
---|
[1715] | 195 | # YAZ Z39.50 toolkit
|
---|
[2052] | 196 | echo ""
|
---|
| 197 | echo "Configuring YAZ"
|
---|
[12494] | 198 | if test x$USE_YAZ = xtrue ;
|
---|
[1940] | 199 | then
|
---|
[12494] | 200 | echo "YAZ library support enabled"
|
---|
| 201 | echo "add --disable-yaz to the configure command to disable this"
|
---|
[1940] | 202 | echo ""
|
---|
[10173] | 203 | cd "$PACKAGES/yaz"
|
---|
| 204 | gzip -dc yaz-2.1.4.tar.gz | tar -xf -
|
---|
| 205 | cd yaz-2.1.4 && \
|
---|
[13018] | 206 | ./configure $CACHE_FILE --prefix="$PACKAGES/yaz" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
[1940] | 207 | else
|
---|
[12494] | 208 | echo "YAZ support disabled"
|
---|
[1940] | 209 | echo ""
|
---|
| 210 | fi
|
---|
[1715] | 211 |
|
---|
[1704] | 212 | # configure wget
|
---|
| 213 | echo ""
|
---|
| 214 | echo "Configuring wget"
|
---|
| 215 | echo ""
|
---|
[3000] | 216 | cd "$PACKAGES/wget"
|
---|
[2349] | 217 | gzip -dc wget.tar.gz | tar -xf -
|
---|
[7672] | 218 | cd "$PACKAGES/wget/wget-1.9" && \
|
---|
[2725] | 219 | ./configure $CACHE_FILE --prefix=$PACKAGES/wget --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
[2169] | 220 |
|
---|
[8658] | 221 | # configure expat (needs to be done before XML::Parser
|
---|
| 222 | echo ""
|
---|
| 223 | echo "Configuring expat"
|
---|
| 224 | echo ""
|
---|
| 225 | cd "$PACKAGES/expat"
|
---|
| 226 | gzip -dc expat-1.95.8.tar.gz | tar -xf -
|
---|
| 227 | cd "$PACKAGES/expat/expat-1.95.8" && \
|
---|
[15551] | 228 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[8658] | 229 |
|
---|
[2809] | 230 | # configure XML::Parser perl module
|
---|
| 231 | echo ""
|
---|
| 232 | echo "Configuring XML::Parser"
|
---|
| 233 | echo ""
|
---|
[2988] | 234 | cd "$PACKAGES/cpan"
|
---|
[8066] | 235 | perl_dir=`echo 'my $vn = $]; $vn =~ s/5\.00(\d).*$/perl-5.$1/; print "$vn" ' | perl`
|
---|
[8658] | 236 | gzip -dc XML-Parser-2.34.tar.gz | tar -xf -
|
---|
| 237 | cd "$PACKAGES/cpan/XML-Parser-2.34" && \
|
---|
| 238 | perl Makefile.PL \
|
---|
[15456] | 239 | PREFIX="$GSDLHOME/perllib/cpan/XML" \
|
---|
[8658] | 240 | INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
[15456] | 241 | INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
[8658] | 242 | INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 243 | INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \
|
---|
| 244 | SITEPREFIX="$GSDLHOME/perllib/cpan" \
|
---|
[9402] | 245 | EXPATINCPATH="$GSDLHOME/packages/expat/include" \
|
---|
[8658] | 246 | EXPATLIBPATH="$GSDLHOME/packages/expat/lib"
|
---|
[2169] | 247 |
|
---|
[2985] | 248 | # configure powerpoint converter
|
---|
| 249 | echo ""
|
---|
[2988] | 250 | echo "Configuring xlhtml (powerpoint & excel converter)"
|
---|
[2985] | 251 | echo ""
|
---|
[2988] | 252 | cd "$PACKAGES/xlhtml"
|
---|
[2985] | 253 | gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf -
|
---|
[6334] | 254 | cd xlhtml-0.4.9.0 && \
|
---|
[2985] | 255 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
[2809] | 256 |
|
---|
[6128] | 257 |
|
---|
| 258 | # configure IsisGdl program
|
---|
| 259 | echo ""
|
---|
[6334] | 260 | echo "Configuring IsisGdl (CDS/ISIS database reader)"
|
---|
[6128] | 261 | echo ""
|
---|
[6334] | 262 | cd "$PACKAGES/isis-gdl" && \
|
---|
[13475] | 263 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[12004] | 264 |
|
---|
[13970] | 265 | # configure HTMLTidy program
|
---|
| 266 | echo ""
|
---|
| 267 | echo "Configuring HTMLTidy"
|
---|
| 268 | echo ""
|
---|
| 269 | cd "$PACKAGES/html-tidy"
|
---|
[14167] | 270 | gzip -dc tidy.tgz | tar -xf -
|
---|
[13970] | 271 | cd "$PACKAGES/html-tidy/tidy" && \
|
---|
| 272 | ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[15781] | 273 |
|
---|
| 274 | # configure SQLite
|
---|
| 275 | echo ""
|
---|
| 276 | echo "Configuring SQLite"
|
---|
[15814] | 277 | if test x$USE_SQLITE = xtrue ;
|
---|
| 278 | then
|
---|
| 279 | echo ""
|
---|
| 280 | cd "$PACKAGES/sqlite"
|
---|
[15922] | 281 | unzip sqlite-amalgamation-3.5.9.tar.gz
|
---|
[15814] | 282 | cd sqlite-amalgamation-3.5.9 && \
|
---|
| 283 | ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 284 | else
|
---|
| 285 | echo "SQLite support disabled."
|
---|
| 286 | echo " add '--enable-sqlite' to the configure command to include SQLite support."
|
---|
| 287 | echo ""
|
---|
| 288 | fi
|
---|