#! /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 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="" # 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-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=*) 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 # 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 expat (needs to be done before XML::Parser echo "" echo "Configuring expat" echo "" cd "$PACKAGES/expat" gzip -dc expat-1.95.8.tar.gz | tar -xf - echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT cd "$PACKAGES/expat/expat-1.95.8" && \ CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT # configure SQLite echo "" echo "Configuring SQLite" if test x$USE_SQLITE = xtrue ; then echo "" cd "$PACKAGES/sqlite" gzip -dc sqlite-amalgamation-3.5.9.tar.gz | tar -xf - cd sqlite-amalgamation-3.5.9 && \ ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT else echo "SQLite support disabled." echo " add '--enable-sqlite' to the configure command to include SQLite support." echo "" fi # configure search4j echo "" echo "Configuring search4j" echo "" cd "$PACKAGES/search4j" echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT cd "$PACKAGES/search4j" && \ CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT