#! /bin/sh PACKAGES=`pwd` cd ../.. GSDLHOME=`pwd` cd $PACKAGES GSDLOS=`uname -s |tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # check for running bash under cygwin if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ; then GSDLOS=windows fi if test "x$crossOS" != "x" ; then # Override derived value with value explicitly provided in crossOS GSDLOS=$crossOS fi prefix="" bindir="" HOSTTARGETFLAGS="" # only some of the packages can take environment variables as options to # configure # format is VAR=value, e.g "LDFLAGS=-static" ENVIRONMENT="" # WVWARE compilation enabled by default, can switch it off with --disable-wvware USE_WVWARE=true # GDBM compilation enabled by default, can switch it off with --disable-gdbm USE_GDBM=true # JDBM compilation enabled by default, can switch it off with --disable-jdbm USE_JDBM=true # SQLite support enabled by default, can switch it off with --disable-sqlite USE_SQLITE=true # yaz compilation enabled by default, can switch it off with --disable-yaz USE_YAZ=true # z3950 server disabled by default, switch it on with --enable-z3950 USE_Z3950=false # CORBA support disabled by default, switch it on with --enable-corba USE_CORBA=false MICO_DIR=default # parse any arguments given from toplevel configure while test $# -ne 0; do case "$1" in --cache-file=*) cache_filename=`echo $1 | sed s/--cache-file=//` # turn relative path into an absolute path cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'` cache_dir=`cd $cache_dir 2>/dev/null && pwd` cache_basefile=`echo $cache_filename | sed 's@.*/@@'` cache_file="$cache_dir/$cache_basefile" if test ! -f "$cache_file"; then CACHE_FILE="" else CACHE_FILE="--cache-file=$cache_file" fi ;; --disable-wvware) USE_WVWARE=false ;; --disable-gdbm) USE_GDBM=false ;; --disable-jdbm) USE_JDBM=false ;; --disable-sqlite) USE_SQLITE=false ;; --disable-yaz) USE_YAZ=false ;; --enable-z3950) USE_Z3950=true ;; --enable-corba) USE_CORBA=true ;; --with-micodir=*) if test $1 = ""; then $1 = "default" fi MICO_DIR=$1 ;; --prefix=*) prefix=`echo $1 | sed s/--prefix=//` ;; --bindir=*) # where to install binaries to bindir=`echo $1 | sed s/--bindir=//` # turn relative path into an absolute path if test -d "$bindir" ; then bindir=`cd "$bindir" ; pwd ` cd "$PACKAGES" elif test -z `echo $bindir | sed '/^\// p;D'` ; then rel_bindir="`echo $bindir | sed s@/.*@@`" cd "$rel_bindir" bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`" cd "$PACKAGES" else # bindir doesn't exist, and isn't relative true fi ;; --host=* | --target=* | --build=*) HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1" ;; *) # ignore all other options for now ;; esac shift done # note! Our GSDL package currently always installs into it's source # directory, ignoring any --prefix given to configure. # When this is fixed, uncomment the relevant lines below... ##if test -z "$prefix" ; then prefix="${GSDLHOME}" ##fi ##if test -z "$bindir" ; then bindir="${prefix}/bin/$GSDLOS" ##fi libdir="${prefix}/lib/$GSDLOS" # This loads the top configure's cache file, with variables already set. if test -f "$cache_file" ; then . $cache_file fi # we assume that gzip and tar are on the search path. # non-GNU versions of tar don't take the -z option. # configure the wvWare Word document converter echo "" echo "Configuring wvWare" echo "" # datadir flag is for default location of wvHtml.xml config file if test x$USE_WVWARE = xtrue ; then cd "$PACKAGES/wv" gzip -dc wv-1.2.4-gs.tar.gz | tar -xf - cd wv-gs && \ ./configure $CACHE_FILE --prefix=$PACKAGES/wv --bindir="$bindir" --libdir="$libdir" --datadir="$prefix/etc/packages" $HOSTTARGETFLAGS else echo "wvWare support disabled." echo " add '--enable-wvware' to the configure command to include wvWare support." echo "" fi if test x$? = x1 ; then echo "Configuration of wvWare failed." exit 1 fi # configure the pdftohtml converter echo "" echo "Configuring pdftohtml" echo "" cd "$PACKAGES/pdftohtml" gzip -dc pdftohtml_0_36_gs.tar.gz | tar -xf - cd pdftohtml_gs && \ ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT if test x$? = x1 ; then echo "Configuration of pdftohtml failed." exit 1 fi # rtftohtml converter echo "" echo "Configuring rtftohtml" echo "" cd "$PACKAGES/rtftohtml" gzip -dc rtftohtml-gs.tar.gz | tar -xf - cd rtftohtml_src && \ ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS if test x$? = x1 ; then echo "Configuration of rtftohtml failed." exit 1 fi # configure wget echo "" echo "Configuring wget" echo "" cd "$PACKAGES/wget" gzip -dc wget.tar.gz | tar -xf - cd "$PACKAGES/wget/wget-1.13.4" && \ #./configure $CACHE_FILE --prefix=$PACKAGES/wget --with-ssl=openssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS ./configure $CACHE_FILE --prefix=$PACKAGES/wget --without-ssl --bindir="$bindir" -disable-nls $HOSTTARGETFLAGS if test x$? = x1 ; then echo "Configuration of wget failed." exit 1 fi # configure XML::Parser perl module echo "" echo "Configuring XML::Parser" echo "" cd "$PACKAGES/cpan" perl_dir=`echo 'my $vn = sprintf("%vd", $^V); $vn =~ s/\.\d+?$//; print "perl-$vn";' | perl` gzip -dc XML-Parser-2.34.tar.gz | tar -xf - cd "$PACKAGES/cpan/XML-Parser-2.34" && \ perl Makefile.PL \ PREFIX="$GSDLHOME/perllib/cpan/XML" \ INSTALLSITELIB="$GSDLHOME/perllib/cpan/$perl_dir" \ INSTALLSITEARCH="$GSDLHOME/perllib/cpan/$perl_dir" \ INSTALLMAN1DIR="$GSDLHOME/perllib/cpan/$perl_dir" \ INSTALLMAN3DIR="$GSDLHOME/perllib/cpan/$perl_dir" \ SITEPREFIX="$GSDLHOME/perllib/cpan" \ EXPATINCPATH="$GSDLHOME/common-src/packages/expat/include" \ EXPATLIBPATH="$GSDLHOME/common-src/packages/expat/lib" if test x$? = x1 ; then echo "Configuration of XML-Parser failed." exit 1 fi # configure powerpoint converter echo "" echo "Configuring xlhtml (powerpoint & excel converter)" echo "" cd "$PACKAGES/xlhtml" gzip -dc xlhtml-0.4.9.0-gs.tar.gz | tar -xf - cd xlhtml-0.4.9.0 && \ ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS if test x$? = x1 ; then echo "Configuration of xlhtml failed." exit 1 fi # configure IsisGdl program echo "" echo "Configuring IsisGdl (CDS/ISIS database reader)" echo "" cd "$PACKAGES/isis-gdl" && \ ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT if test x$? = x1 ; then echo "Configuration of IsisGdl failed." exit 1 fi # configure HTMLTidy program echo "" echo "Configuring HTMLTidy" echo "" cd "$PACKAGES/html-tidy" gzip -dc tidy.tgz | tar -xf - cd "$PACKAGES/html-tidy/tidy" && \ ./configure $CACHE_FILE --prefix="$prefix" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT if test x$? = x1 ; then echo "Configuration of HTMLTidy failed." exit 1 fi