#!/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="" # Java support enabled by default, can switch it off with --disable-java ENABLE_JAVA=1 # GDBM support enabled by default, can switch it off with --disable-jdbm USE_GDBM=1 # JDBM support enabled by default, can switch it off with --disable-jdbm USE_JDBM=1 # 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-java) ENABLE_JAVA=0 USE_JDBM=0 ;; --disable-gdbm) USE_GDBM=0 ;; --disable-jdbm) USE_JDBM=0 ;; --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) # now compile expat during the configure stage itself echo "" echo "Configuring expat" echo "" cd "$PACKAGES/expat" if test ! -d expat-1.95.8 ; then gzip -dc expat-1.95.8.tar.gz | tar -xf - fi #Configure and compile 32-bit expat echo ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT cd "$PACKAGES/expat/expat-1.95.8" && \ ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT echo make $ENVIRONMENT make $ENVIRONMENT echo make install $ENVIRONMENT make install $ENVIRONMENT # configure and compile libiconv during configuration stage echo "" echo "Configuring iconv" echo "" cd "$PACKAGES/iconv" if test ! -d libiconv-1.13.1 ; then gzip -dc libiconv-1.13.1.tar.gz | tar -xf - fi # configure echo ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT cd "$PACKAGES/iconv/libiconv-1.13.1" && \ ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT # make echo make $ENVIRONMENT make $ENVIRONMENT # make install echo make install $ENVIRONMENT make install $ENVIRONMENT #./configure $CACHE_FILE --prefix="$PACKAGES/iconv" --disable-shared $HOSTTARGETFLAGS&& #make && make install # configure GDBM echo "" echo "Configuring GDBM" if test $USE_GDBM ; then echo "" cd "$PACKAGES/gdbm" echo ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT cd "$PACKAGES/gdbm/gdbm-1.8.3" && \ ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT else echo " GDBM support disabled." echo " add '--enable-gdbm' to the configure command to include GDBM support." echo "" fi # configure JDBM echo "" echo "Configuring JDBM" if test $USE_JDBM ; then echo "" cd "$PACKAGES/jdbm" if test ! -d jdbm-1.0 ; then gzip -dc gs-jdbm-1.0.tar.gz | tar -xf - fi if test "x$JAVAC" = "x" ; then JAVAC=javac fi if test "x$JAVACFLAGS" = "x" ; then JAVACFLAGS="-source 1.4 -target 1.4" fi cd jdbm-1.0 && cat Makefile.in | sed -e "s,@JAVAC@,$JAVAC,g" -e "s,@JAVACFLAGS@,$JAVACFLAGS,g" > Makefile else echo "JDBM support disabled." echo " add '--enable-jdbm' to the configure command to include JDBM support." echo "" fi # configure SQLite echo "" echo "Configuring SQLite" if test x$USE_SQLITE = xtrue ; then echo "" cd "$PACKAGES/sqlite" if test ! -d sqlite-amalgamation-3.6.23.1 ; then gzip -dc sqlite-amalgamation-3.6.23.1.tar.gz | tar -xf - fi echo ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT cd "$PACKAGES/sqlite/sqlite-amalgamation-3.6.23.1" && \ ./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 ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT cd "$PACKAGES/search4j" && \ ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT