[16568] | 1 | #! /bin/sh
|
---|
| 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 |
|
---|
| 24 | # SQLite support enabled by default, can switch it off with --disable-sqlite
|
---|
| 25 | USE_SQLITE=true
|
---|
| 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
|
---|
| 30 | # CORBA support disabled by default, switch it on with --enable-corba
|
---|
| 31 | USE_CORBA=false
|
---|
| 32 | MICO_DIR=default
|
---|
[18484] | 33 | # Apache's httpd (web server) enabled by default
|
---|
[18485] | 34 | USE_APACHE_HTTPD=false
|
---|
[16568] | 35 |
|
---|
| 36 | # parse any arguments given from toplevel configure
|
---|
| 37 | while test $# -ne 0; do
|
---|
| 38 | case "$1" in
|
---|
| 39 | --cache-file=*)
|
---|
| 40 | cache_filename=`echo $1 | sed s/--cache-file=//`
|
---|
| 41 | # turn relative path into an absolute path
|
---|
| 42 | cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
|
---|
| 43 | cache_dir=`cd $cache_dir 2>/dev/null && pwd`
|
---|
| 44 |
|
---|
| 45 | cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
|
---|
| 46 | cache_file="$cache_dir/$cache_basefile"
|
---|
| 47 | if test ! -f "$cache_file"; then
|
---|
| 48 | CACHE_FILE=""
|
---|
| 49 | else
|
---|
| 50 | CACHE_FILE="--cache-file=$cache_file"
|
---|
| 51 | fi
|
---|
| 52 | ;;
|
---|
| 53 | --disable-sqlite)
|
---|
| 54 | USE_SQLITE=false
|
---|
| 55 | ;;
|
---|
| 56 | --disable-yaz)
|
---|
| 57 | USE_YAZ=false
|
---|
| 58 | ;;
|
---|
| 59 | --enable-z3950)
|
---|
| 60 | USE_Z3950=true
|
---|
| 61 | ;;
|
---|
| 62 | --enable-corba)
|
---|
| 63 | USE_CORBA=true
|
---|
| 64 | ;;
|
---|
| 65 | --with-micodir=*)
|
---|
| 66 | if test $1 = ""; then
|
---|
| 67 | $1 = "default"
|
---|
| 68 | fi
|
---|
| 69 | MICO_DIR=$1
|
---|
| 70 | ;;
|
---|
[18484] | 71 | --enable-apache-httpd)
|
---|
[18485] | 72 | USE_APACHE_HTTPD=true
|
---|
[18484] | 73 | ;;
|
---|
[16568] | 74 | --prefix=*)
|
---|
| 75 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
| 76 | ;;
|
---|
| 77 | --bindir=*)
|
---|
| 78 | # where to install binaries to
|
---|
| 79 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
| 80 | # turn relative path into an absolute path
|
---|
| 81 | if test -d "$bindir" ; then
|
---|
| 82 | bindir=`cd "$bindir" ; pwd `
|
---|
| 83 | cd "$PACKAGES"
|
---|
| 84 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
| 85 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
| 86 | cd "$rel_bindir"
|
---|
| 87 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
| 88 | cd "$PACKAGES"
|
---|
| 89 | else
|
---|
| 90 | # bindir doesn't exist, and isn't relative
|
---|
| 91 | true
|
---|
| 92 | fi
|
---|
| 93 | ;;
|
---|
| 94 | --host=* | --target=*)
|
---|
| 95 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
| 96 | ;;
|
---|
| 97 | *)
|
---|
| 98 | # ignore all other options for now
|
---|
| 99 | ;;
|
---|
| 100 | esac
|
---|
| 101 | shift
|
---|
| 102 | done
|
---|
| 103 |
|
---|
| 104 | # note! Our GSDL package currently always installs into it's source
|
---|
| 105 | # directory, ignoring any --prefix given to configure.
|
---|
| 106 | # When this is fixed, uncomment the relevant lines below...
|
---|
| 107 |
|
---|
| 108 | ##if test -z "$prefix" ; then
|
---|
| 109 | prefix="${GSDLHOME}"
|
---|
| 110 | ##fi
|
---|
| 111 |
|
---|
| 112 | ##if test -z "$bindir" ; then
|
---|
| 113 | bindir="${prefix}/bin/$GSDLOS"
|
---|
| 114 | ##fi
|
---|
| 115 |
|
---|
| 116 | # This loads the top configure's cache file, with variables already set.
|
---|
| 117 | if test -f "$cache_file" ; then
|
---|
| 118 | . $cache_file
|
---|
| 119 | fi
|
---|
| 120 |
|
---|
| 121 | # we assume that gzip and tar are on the search path.
|
---|
| 122 | # non-GNU versions of tar don't take the -z option.
|
---|
| 123 |
|
---|
| 124 | if test $USE_CORBA = true ; then
|
---|
| 125 | if test $MICO_DIR = default; then
|
---|
| 126 | # configure the MICO CORBA ORB
|
---|
| 127 | echo ""
|
---|
| 128 | echo "Configuring MICO CORBA"
|
---|
| 129 | echo ""
|
---|
| 130 |
|
---|
| 131 | cd "$PACKAGES/mico"
|
---|
| 132 | gzip -dc mico-2.3.5.tar.gz | tar -xf -
|
---|
| 133 | cd mico && \
|
---|
| 134 | ./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
|
---|
| 135 | sed 's/tools//' $PACKAGES/mico/mico/Makefile | sed 's/ldconfig//' >$PACKAGES/mico/mico/Makefile.out
|
---|
| 136 | mv $PACKAGES/mico/mico/Makefile.out $PACKAGES/mico/mico/Makefile
|
---|
| 137 | else
|
---|
| 138 | #MICO is on the system path
|
---|
| 139 | echo ""
|
---|
| 140 | echo "Taking MICO from system paths"
|
---|
| 141 | echo ""
|
---|
| 142 | fi
|
---|
| 143 | else
|
---|
| 144 | echo "corba support disabled - mico compiler not required."
|
---|
| 145 | echo " add '--enable-corba' to the configure command to include corba support."
|
---|
| 146 | echo ""
|
---|
| 147 | fi
|
---|
| 148 |
|
---|
| 149 |
|
---|
| 150 |
|
---|
| 151 | # D2M stuff needed for z3950server
|
---|
| 152 | echo ""
|
---|
| 153 | echo "Configuring D2M"
|
---|
| 154 | if test x$USE_Z3950 = xtrue ;
|
---|
| 155 | then
|
---|
| 156 | USE_YAZ=true
|
---|
| 157 | echo ""
|
---|
| 158 | cd "$PACKAGES/d2m"
|
---|
| 159 | ./configure $CACHE_FILE --prefix="$PACKAGES/d2m" $HOSTTARGETFLAGS
|
---|
| 160 | else
|
---|
| 161 | echo "Z39.50 support disabled - D2M library not required."
|
---|
| 162 | echo " add '--enable-z3950' to the configure command to include z39.50 support."
|
---|
| 163 | echo ""
|
---|
| 164 | fi
|
---|
| 165 |
|
---|
| 166 | # YAZ Z39.50 toolkit
|
---|
| 167 | echo ""
|
---|
| 168 | echo "Configuring YAZ"
|
---|
| 169 | if test x$USE_YAZ = xtrue ;
|
---|
| 170 | then
|
---|
| 171 | echo "YAZ library support enabled"
|
---|
| 172 | echo "add --disable-yaz to the configure command to disable this"
|
---|
| 173 | echo ""
|
---|
| 174 | cd "$PACKAGES/yaz"
|
---|
| 175 | gzip -dc yaz-2.1.4.tar.gz | tar -xf -
|
---|
| 176 | cd yaz-2.1.4 && \
|
---|
| 177 | ./configure $CACHE_FILE --prefix="$PACKAGES/yaz" --bindir="$bindir" $HOSTTARGETFLAGS
|
---|
| 178 | else
|
---|
| 179 | echo "YAZ support disabled"
|
---|
| 180 | echo ""
|
---|
| 181 | fi
|
---|
| 182 |
|
---|
[18484] | 183 |
|
---|
| 184 | # Apache's HTTPD web server
|
---|
| 185 | echo ""
|
---|
| 186 | echo "Configuring Apache httpd"
|
---|
| 187 | if test x$USE_APACHE_HTTPD = xtrue ;
|
---|
| 188 | then
|
---|
| 189 | echo "Apache httpd support enabled"
|
---|
| 190 | echo "add --disable-apache-httpd to the configure command to disable this"
|
---|
| 191 | echo ""
|
---|
| 192 | cd "$PACKAGES/apache-httpd"
|
---|
| 193 | gzip -dc httpd-2.2.11.tar.gz | tar -xf -
|
---|
| 194 | cd httpd-2.2.11&& \
|
---|
[19301] | 195 | ./configure $CACHE_FILE --with-included-apr --with-layout=BinaryDistribution --enable-most --prefix="${prefix}/apache-httpd/${GSDLOS}" $HOSTTARGETFLAGS
|
---|
[18484] | 196 | else
|
---|
| 197 | echo "Apache httpd support disabled"
|
---|
[18485] | 198 | echo "add --enable-apache-httpd to the configure command to enable this"
|
---|
[18484] | 199 | echo ""
|
---|
| 200 | fi
|
---|
| 201 |
|
---|
| 202 |
|
---|