[25745] | 1 | #! /bin/sh
|
---|
[16568] | 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
|
---|
| 14 |
|
---|
| 15 | prefix=""
|
---|
| 16 | bindir=""
|
---|
| 17 | HOSTTARGETFLAGS=""
|
---|
| 18 |
|
---|
| 19 | # only some of the packages can take environment variables as options to
|
---|
| 20 | # configure
|
---|
| 21 | # format is VAR=value, e.g "LDFLAGS=-static"
|
---|
| 22 | ENVIRONMENT=""
|
---|
| 23 |
|
---|
[22058] | 24 | # GDBM compilation enabled by default, can switch it off with --disable-gdbm
|
---|
| 25 | USE_GDBM=true
|
---|
| 26 | # JDBM compilation enabled by default, can switch it off with --disable-jdbm
|
---|
| 27 | USE_JDBM=true
|
---|
[16568] | 28 | # SQLite support enabled by default, can switch it off with --disable-sqlite
|
---|
| 29 | USE_SQLITE=true
|
---|
| 30 | # yaz compilation enabled by default, can switch it off with --disable-yaz
|
---|
| 31 | USE_YAZ=true
|
---|
| 32 | # z3950 server disabled by default, switch it on with --enable-z3950
|
---|
| 33 | USE_Z3950=false
|
---|
| 34 | # CORBA support disabled by default, switch it on with --enable-corba
|
---|
| 35 | USE_CORBA=false
|
---|
| 36 | MICO_DIR=default
|
---|
[18484] | 37 | # Apache's httpd (web server) enabled by default
|
---|
[18485] | 38 | USE_APACHE_HTTPD=false
|
---|
[16568] | 39 |
|
---|
| 40 | # parse any arguments given from toplevel configure
|
---|
| 41 | while test $# -ne 0; do
|
---|
| 42 | case "$1" in
|
---|
| 43 | --cache-file=*)
|
---|
| 44 | cache_filename=`echo $1 | sed s/--cache-file=//`
|
---|
| 45 | # turn relative path into an absolute path
|
---|
| 46 | cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
|
---|
| 47 | cache_dir=`cd $cache_dir 2>/dev/null && pwd`
|
---|
| 48 |
|
---|
| 49 | cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
|
---|
| 50 | cache_file="$cache_dir/$cache_basefile"
|
---|
| 51 | if test ! -f "$cache_file"; then
|
---|
| 52 | CACHE_FILE=""
|
---|
| 53 | else
|
---|
| 54 | CACHE_FILE="--cache-file=$cache_file"
|
---|
| 55 | fi
|
---|
| 56 | ;;
|
---|
[22058] | 57 | --disable-gdbm)
|
---|
| 58 | USE_GDBM=false
|
---|
| 59 | ;;
|
---|
| 60 | --disable-jdbm)
|
---|
| 61 | USE_JDBM=false
|
---|
| 62 | ;;
|
---|
[16568] | 63 | --disable-sqlite)
|
---|
| 64 | USE_SQLITE=false
|
---|
| 65 | ;;
|
---|
| 66 | --disable-yaz)
|
---|
| 67 | USE_YAZ=false
|
---|
| 68 | ;;
|
---|
| 69 | --enable-z3950)
|
---|
| 70 | USE_Z3950=true
|
---|
| 71 | ;;
|
---|
| 72 | --enable-corba)
|
---|
| 73 | USE_CORBA=true
|
---|
| 74 | ;;
|
---|
| 75 | --with-micodir=*)
|
---|
| 76 | if test $1 = ""; then
|
---|
| 77 | $1 = "default"
|
---|
| 78 | fi
|
---|
| 79 | MICO_DIR=$1
|
---|
| 80 | ;;
|
---|
[18484] | 81 | --enable-apache-httpd)
|
---|
[18485] | 82 | USE_APACHE_HTTPD=true
|
---|
[18484] | 83 | ;;
|
---|
[16568] | 84 | --prefix=*)
|
---|
| 85 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
| 86 | ;;
|
---|
| 87 | --bindir=*)
|
---|
| 88 | # where to install binaries to
|
---|
| 89 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
| 90 | # turn relative path into an absolute path
|
---|
| 91 | if test -d "$bindir" ; then
|
---|
| 92 | bindir=`cd "$bindir" ; pwd `
|
---|
| 93 | cd "$PACKAGES"
|
---|
| 94 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
| 95 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
| 96 | cd "$rel_bindir"
|
---|
| 97 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
| 98 | cd "$PACKAGES"
|
---|
| 99 | else
|
---|
| 100 | # bindir doesn't exist, and isn't relative
|
---|
| 101 | true
|
---|
| 102 | fi
|
---|
| 103 | ;;
|
---|
| 104 | --host=* | --target=*)
|
---|
| 105 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
| 106 | ;;
|
---|
| 107 | *)
|
---|
| 108 | # ignore all other options for now
|
---|
| 109 | ;;
|
---|
| 110 | esac
|
---|
| 111 | shift
|
---|
| 112 | done
|
---|
| 113 |
|
---|
| 114 | # note! Our GSDL package currently always installs into it's source
|
---|
| 115 | # directory, ignoring any --prefix given to configure.
|
---|
| 116 | # When this is fixed, uncomment the relevant lines below...
|
---|
| 117 |
|
---|
| 118 | ##if test -z "$prefix" ; then
|
---|
| 119 | prefix="${GSDLHOME}"
|
---|
| 120 | ##fi
|
---|
| 121 |
|
---|
| 122 | ##if test -z "$bindir" ; then
|
---|
| 123 | bindir="${prefix}/bin/$GSDLOS"
|
---|
| 124 | ##fi
|
---|
| 125 |
|
---|
| 126 | # This loads the top configure's cache file, with variables already set.
|
---|
| 127 | if test -f "$cache_file" ; then
|
---|
| 128 | . $cache_file
|
---|
| 129 | fi
|
---|
| 130 |
|
---|
| 131 | # we assume that gzip and tar are on the search path.
|
---|
| 132 | # non-GNU versions of tar don't take the -z option.
|
---|
| 133 |
|
---|
| 134 | if test $USE_CORBA = true ; then
|
---|
| 135 | if test $MICO_DIR = default; then
|
---|
| 136 | # configure the MICO CORBA ORB
|
---|
| 137 | echo ""
|
---|
| 138 | echo "Configuring MICO CORBA"
|
---|
| 139 | echo ""
|
---|
| 140 |
|
---|
| 141 | cd "$PACKAGES/mico"
|
---|
[25227] | 142 | gzip -dc mico-2.3.13-gs.tar.gz | tar -xf -
|
---|
[16568] | 143 | cd mico && \
|
---|
[25189] | 144 | ./configure $CACHE_FILE --prefix=$PACKAGES/mico/ --disable-coss --disable-naming --disable-relship --disable-events --disable-streams --disable-property --disable-trader --disable-time
|
---|
| 145 | #--disable-debug
|
---|
| 146 | #--enable-optimize --enable-final --enable-speed-tune
|
---|
| 147 | # sed 's/tools//' $PACKAGES/mico/mico/Makefile | sed 's/ldconfig//' >$PACKAGES/mico/mico/Makefile.out
|
---|
| 148 |
|
---|
| 149 | # Remove any references to running 'tools' and 'ldconfig' as these require
|
---|
| 150 | # admin permissions when running 'make install'.
|
---|
| 151 | # Use fgrep here to knock out the entire line containing $(LDCONFIG), because
|
---|
| 152 | # there may be a special tab preceding the line which in a Makefile can have
|
---|
| 153 | # special meaning. Don't want to leave it in by itself.
|
---|
| 154 | sed 's/tools//' $PACKAGES/mico/mico/Makefile | fgrep -iv ldconfig >$PACKAGES/mico/mico/Makefile.out
|
---|
[16568] | 155 | mv $PACKAGES/mico/mico/Makefile.out $PACKAGES/mico/mico/Makefile
|
---|
| 156 | else
|
---|
| 157 | #MICO is on the system path
|
---|
| 158 | echo ""
|
---|
| 159 | echo "Taking MICO from system paths"
|
---|
| 160 | echo ""
|
---|
| 161 | fi
|
---|
| 162 | else
|
---|
| 163 | echo "corba support disabled - mico compiler not required."
|
---|
| 164 | echo " add '--enable-corba' to the configure command to include corba support."
|
---|
| 165 | echo ""
|
---|
| 166 | fi
|
---|
| 167 |
|
---|
| 168 |
|
---|
| 169 |
|
---|
| 170 | # D2M stuff needed for z3950server
|
---|
| 171 | echo ""
|
---|
| 172 | echo "Configuring D2M"
|
---|
| 173 | if test x$USE_Z3950 = xtrue ;
|
---|
| 174 | then
|
---|
| 175 | USE_YAZ=true
|
---|
| 176 | echo ""
|
---|
| 177 | cd "$PACKAGES/d2m"
|
---|
| 178 | ./configure $CACHE_FILE --prefix="$PACKAGES/d2m" $HOSTTARGETFLAGS
|
---|
| 179 | else
|
---|
| 180 | echo "Z39.50 support disabled - D2M library not required."
|
---|
| 181 | echo " add '--enable-z3950' to the configure command to include z39.50 support."
|
---|
| 182 | echo ""
|
---|
| 183 | fi
|
---|
| 184 |
|
---|
| 185 | # YAZ Z39.50 toolkit
|
---|
| 186 | echo ""
|
---|
| 187 | echo "Configuring YAZ"
|
---|
| 188 | if test x$USE_YAZ = xtrue ;
|
---|
| 189 | then
|
---|
| 190 | echo "YAZ library support enabled"
|
---|
| 191 | echo "add --disable-yaz to the configure command to disable this"
|
---|
| 192 | echo ""
|
---|
| 193 | cd "$PACKAGES/yaz"
|
---|
[30954] | 194 | gzip -dc yaz-2.1.56.tar.gz | tar -xf -
|
---|
| 195 | cd yaz-2.1.56 && \
|
---|
[31059] | 196 | ./configure $CACHE_FILE --prefix="$PACKAGES/yaz" --bindir="$bindir" --disable-shared --enable-static $HOSTTARGETFLAGS
|
---|
[16568] | 197 | else
|
---|
| 198 | echo "YAZ support disabled"
|
---|
| 199 | echo ""
|
---|
| 200 | fi
|
---|
| 201 |
|
---|
[18484] | 202 |
|
---|
| 203 | # Apache's HTTPD web server
|
---|
| 204 | echo ""
|
---|
| 205 | echo "Configuring Apache httpd"
|
---|
| 206 | if test x$USE_APACHE_HTTPD = xtrue ;
|
---|
| 207 | then
|
---|
| 208 | echo "Apache httpd support enabled"
|
---|
| 209 | echo "add --disable-apache-httpd to the configure command to disable this"
|
---|
| 210 | echo ""
|
---|
[20832] | 211 | # echo "Setting up libiconv (used by Apache httpd)"
|
---|
| 212 | # cd "$PACKAGES/apache-httpd"
|
---|
| 213 | # if [ ! -e libiconv-1.13.1 ] ; then gzip -dc libiconv-1.13.1.tar.gz | tar -xf - ; fi
|
---|
| 214 | # cd libiconv-1.13.1&& \
|
---|
| 215 | # ./configure $CACHE_FILE --prefix="${prefix}/apache-httpd/${GSDLOS}" --disable-shared $HOSTTARGETFLAGS&&
|
---|
| 216 | # make && make install
|
---|
| 217 | # echo ""
|
---|
[20668] | 218 | echo "Configuring Apache httpd"
|
---|
| 219 | cd "$PACKAGES/apache-httpd"
|
---|
| 220 | if [ ! -e httpd-2.2.11 ] ; then gzip -dc httpd-2.2.11-gs.tar.gz | tar -xf - ; fi
|
---|
[18484] | 221 | cd httpd-2.2.11&& \
|
---|
[22378] | 222 |
|
---|
[26977] | 223 | CFLAGS="$CFLAGS -I${GSDLHOME}/common-src/packages/iconv/include" CXXFLAGS="$CXXFLAGS -I${GSDLHOME}/common-src/packages/iconv/include" LDFLAGS="$LDFLAGS -L${GSDLHOME}/common-src/packages/iconv/lib -L${GSDLHOME}/common-src/packages/sqlite/lib" ./configure $CACHE_FILE --with-included-apr --with-layout=BinaryDistribution --enable-most --enable-rewrite --prefix="${prefix}/apache-httpd/${GSDLOS}" $HOSTTARGETFLAGS --with-iconv
|
---|
[22378] | 224 |
|
---|
| 225 | else
|
---|
[18484] | 226 | echo "Apache httpd support disabled"
|
---|
[18485] | 227 | echo "add --enable-apache-httpd to the configure command to enable this"
|
---|
[18484] | 228 | echo ""
|
---|
| 229 | fi
|
---|
| 230 |
|
---|
| 231 |
|
---|