[23356] | 1 | #!/bin/sh
|
---|
[16566] | 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 |
|
---|
[23356] | 24 | # Java support enabled by default, can switch it off with --disable-java
|
---|
| 25 | ENABLE_JAVA=1
|
---|
[22058] | 26 | # GDBM support enabled by default, can switch it off with --disable-jdbm
|
---|
| 27 | USE_GDBM=1
|
---|
[21419] | 28 | # JDBM support enabled by default, can switch it off with --disable-jdbm
|
---|
[22058] | 29 | USE_JDBM=1
|
---|
[16566] | 30 | # SQLite support enabled by default, can switch it off with --disable-sqlite
|
---|
| 31 | USE_SQLITE=true
|
---|
| 32 | # yaz compilation enabled by default, can switch it off with --disable-yaz
|
---|
| 33 | USE_YAZ=true
|
---|
| 34 | # z3950 server disabled by default, switch it on with --enable-z3950
|
---|
| 35 | USE_Z3950=false
|
---|
| 36 | # CORBA support disabled by default, switch it on with --enable-corba
|
---|
| 37 | USE_CORBA=false
|
---|
| 38 | MICO_DIR=default
|
---|
| 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 | ;;
|
---|
[23356] | 57 | --disable-java)
|
---|
| 58 | ENABLE_JAVA=0
|
---|
| 59 | USE_JDBM=0
|
---|
| 60 | ;;
|
---|
[22058] | 61 | --disable-gdbm)
|
---|
| 62 | USE_GDBM=0
|
---|
| 63 | ;;
|
---|
[21419] | 64 | --disable-jdbm)
|
---|
[22058] | 65 | USE_JDBM=0
|
---|
[21419] | 66 | ;;
|
---|
[16566] | 67 | --disable-sqlite)
|
---|
| 68 | USE_SQLITE=false
|
---|
| 69 | ;;
|
---|
| 70 | --disable-yaz)
|
---|
| 71 | USE_YAZ=false
|
---|
| 72 | ;;
|
---|
| 73 | --enable-z3950)
|
---|
| 74 | USE_Z3950=true
|
---|
| 75 | ;;
|
---|
| 76 | --enable-corba)
|
---|
| 77 | USE_CORBA=true
|
---|
| 78 | ;;
|
---|
| 79 | --with-micodir=*)
|
---|
| 80 | if test $1 = ""; then
|
---|
| 81 | $1 = "default"
|
---|
| 82 | fi
|
---|
| 83 | MICO_DIR=$1
|
---|
| 84 | ;;
|
---|
| 85 | --prefix=*)
|
---|
| 86 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
| 87 | ;;
|
---|
| 88 | --bindir=*)
|
---|
| 89 | # where to install binaries to
|
---|
| 90 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
| 91 | # turn relative path into an absolute path
|
---|
| 92 | if test -d "$bindir" ; then
|
---|
| 93 | bindir=`cd "$bindir" ; pwd `
|
---|
| 94 | cd "$PACKAGES"
|
---|
| 95 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
| 96 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
| 97 | cd "$rel_bindir"
|
---|
| 98 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
| 99 | cd "$PACKAGES"
|
---|
| 100 | else
|
---|
| 101 | # bindir doesn't exist, and isn't relative
|
---|
| 102 | true
|
---|
| 103 | fi
|
---|
| 104 | ;;
|
---|
| 105 | --host=* | --target=*)
|
---|
| 106 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
| 107 | ;;
|
---|
| 108 | *)
|
---|
| 109 | # ignore all other options for now
|
---|
| 110 | ;;
|
---|
| 111 | esac
|
---|
| 112 | shift
|
---|
| 113 | done
|
---|
| 114 |
|
---|
| 115 | # note! Our GSDL package currently always installs into it's source
|
---|
| 116 | # directory, ignoring any --prefix given to configure.
|
---|
| 117 | # When this is fixed, uncomment the relevant lines below...
|
---|
| 118 |
|
---|
| 119 | ##if test -z "$prefix" ; then
|
---|
| 120 | prefix="${GSDLHOME}"
|
---|
| 121 | ##fi
|
---|
| 122 |
|
---|
| 123 | ##if test -z "$bindir" ; then
|
---|
| 124 | bindir="${prefix}/bin/$GSDLOS"
|
---|
| 125 | ##fi
|
---|
| 126 |
|
---|
| 127 | # This loads the top configure's cache file, with variables already set.
|
---|
| 128 | if test -f "$cache_file" ; then
|
---|
| 129 | . $cache_file
|
---|
| 130 | fi
|
---|
| 131 |
|
---|
| 132 | # we assume that gzip and tar are on the search path.
|
---|
| 133 | # non-GNU versions of tar don't take the -z option.
|
---|
| 134 |
|
---|
| 135 |
|
---|
| 136 |
|
---|
[20832] | 137 | # configure expat (needs to be done before XML::Parser)
|
---|
| 138 | # now compile expat during the configure stage itself
|
---|
[16566] | 139 | echo ""
|
---|
| 140 | echo "Configuring expat"
|
---|
| 141 | echo ""
|
---|
| 142 | cd "$PACKAGES/expat"
|
---|
[19575] | 143 | if test ! -d expat-1.95.8 ;
|
---|
| 144 | then
|
---|
[19593] | 145 | gzip -dc expat-1.95.8.tar.gz | tar -xf -
|
---|
[19575] | 146 | fi
|
---|
[16566] | 147 |
|
---|
[22391] | 148 | #Configure and compile 32-bit expat
|
---|
[23508] | 149 | echo ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[16566] | 150 |
|
---|
[23508] | 151 | cd "$PACKAGES/expat/expat-1.95.8" && \
|
---|
| 152 | ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[16566] | 153 |
|
---|
[23508] | 154 | echo make $ENVIRONMENT
|
---|
| 155 | make $ENVIRONMENT
|
---|
[20832] | 156 |
|
---|
[23508] | 157 | echo make install $ENVIRONMENT
|
---|
| 158 | make install $ENVIRONMENT
|
---|
[20832] | 159 |
|
---|
| 160 | # configure and compile libiconv during configuration stage
|
---|
| 161 | echo ""
|
---|
| 162 | echo "Configuring iconv"
|
---|
| 163 | echo ""
|
---|
| 164 | cd "$PACKAGES/iconv"
|
---|
| 165 | if test ! -d libiconv-1.13.1 ;
|
---|
| 166 | then
|
---|
| 167 | gzip -dc libiconv-1.13.1.tar.gz | tar -xf -
|
---|
| 168 | fi
|
---|
| 169 |
|
---|
[23508] | 170 | # configure
|
---|
| 171 | echo ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[22378] | 172 |
|
---|
[23508] | 173 | cd "$PACKAGES/iconv/libiconv-1.13.1" && \
|
---|
| 174 | ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[22378] | 175 |
|
---|
[20832] | 176 | # make
|
---|
[23508] | 177 | echo make $ENVIRONMENT
|
---|
| 178 | make $ENVIRONMENT
|
---|
[20832] | 179 |
|
---|
| 180 | # make install
|
---|
[23508] | 181 | echo make install $ENVIRONMENT
|
---|
| 182 | make install $ENVIRONMENT
|
---|
[20832] | 183 |
|
---|
| 184 | #./configure $CACHE_FILE --prefix="$PACKAGES/iconv" --disable-shared $HOSTTARGETFLAGS&&
|
---|
| 185 | #make && make install
|
---|
| 186 |
|
---|
| 187 |
|
---|
[18023] | 188 | # configure GDBM
|
---|
| 189 | echo ""
|
---|
| 190 | echo "Configuring GDBM"
|
---|
[22058] | 191 | if test $USE_GDBM ;
|
---|
| 192 | then
|
---|
| 193 | echo ""
|
---|
| 194 | cd "$PACKAGES/gdbm"
|
---|
[18023] | 195 |
|
---|
[22058] | 196 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[18023] | 197 |
|
---|
[22058] | 198 | cd "$PACKAGES/gdbm/gdbm-1.8.3" && \
|
---|
| 199 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 200 | else
|
---|
| 201 | echo " GDBM support disabled."
|
---|
| 202 | echo " add '--enable-gdbm' to the configure command to include GDBM support."
|
---|
| 203 | echo ""
|
---|
| 204 | fi
|
---|
[18023] | 205 |
|
---|
[21409] | 206 | # configure JDBM
|
---|
| 207 | echo ""
|
---|
| 208 | echo "Configuring JDBM"
|
---|
[22058] | 209 | if test $USE_JDBM ;
|
---|
[21409] | 210 | then
|
---|
| 211 | echo ""
|
---|
| 212 | cd "$PACKAGES/jdbm"
|
---|
| 213 | if test ! -d jdbm-1.0 ;
|
---|
| 214 | then
|
---|
| 215 | gzip -dc gs-jdbm-1.0.tar.gz | tar -xf -
|
---|
| 216 | fi
|
---|
[23356] | 217 |
|
---|
| 218 | if test "x$JAVAC" = "x" ; then
|
---|
| 219 | JAVAC=javac
|
---|
| 220 | fi
|
---|
| 221 |
|
---|
| 222 | if test "x$JAVACFLAGS" = "x" ; then
|
---|
| 223 | JAVACFLAGS="-source 1.4 -target 1.4"
|
---|
| 224 | fi
|
---|
| 225 |
|
---|
| 226 | cd jdbm-1.0 && cat Makefile.in | sed -e "s,@JAVAC@,$JAVAC,g" -e "s,@JAVACFLAGS@,$JAVACFLAGS,g" > Makefile
|
---|
[21409] | 227 | else
|
---|
| 228 | echo "JDBM support disabled."
|
---|
| 229 | echo " add '--enable-jdbm' to the configure command to include JDBM support."
|
---|
| 230 | echo ""
|
---|
| 231 | fi
|
---|
| 232 |
|
---|
[16566] | 233 | # configure SQLite
|
---|
| 234 | echo ""
|
---|
| 235 | echo "Configuring SQLite"
|
---|
| 236 | if test x$USE_SQLITE = xtrue ;
|
---|
| 237 | then
|
---|
| 238 | echo ""
|
---|
| 239 | cd "$PACKAGES/sqlite"
|
---|
[21869] | 240 | if test ! -d sqlite-amalgamation-3.6.23.1 ;
|
---|
[21409] | 241 | then
|
---|
[21869] | 242 | gzip -dc sqlite-amalgamation-3.6.23.1.tar.gz | tar -xf -
|
---|
[19575] | 243 | fi
|
---|
[19778] | 244 |
|
---|
[23508] | 245 | echo ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[19778] | 246 |
|
---|
[21873] | 247 | cd "$PACKAGES/sqlite/sqlite-amalgamation-3.6.23.1" && \
|
---|
[23508] | 248 | ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[16566] | 249 | else
|
---|
| 250 | echo "SQLite support disabled."
|
---|
| 251 | echo " add '--enable-sqlite' to the configure command to include SQLite support."
|
---|
| 252 | echo ""
|
---|
| 253 | fi
|
---|
[17497] | 254 |
|
---|
| 255 | # configure search4j
|
---|
| 256 | echo ""
|
---|
| 257 | echo "Configuring search4j"
|
---|
| 258 | echo ""
|
---|
| 259 | cd "$PACKAGES/search4j"
|
---|
| 260 |
|
---|
[23508] | 261 |
|
---|
[23308] | 262 | echo ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[17497] | 263 |
|
---|
| 264 | cd "$PACKAGES/search4j" && \
|
---|
[23308] | 265 | ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
|
---|