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