[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 |
|
---|
[21419] | 24 | # JDBM support enabled by default, can switch it off with --disable-jdbm
|
---|
| 25 | ENABLE_JDBM=1
|
---|
[16566] | 26 | # SQLite support enabled by default, can switch it off with --disable-sqlite
|
---|
| 27 | USE_SQLITE=true
|
---|
| 28 | # yaz compilation enabled by default, can switch it off with --disable-yaz
|
---|
| 29 | USE_YAZ=true
|
---|
| 30 | # z3950 server disabled by default, switch it on with --enable-z3950
|
---|
| 31 | USE_Z3950=false
|
---|
| 32 | # CORBA support disabled by default, switch it on with --enable-corba
|
---|
| 33 | USE_CORBA=false
|
---|
| 34 | MICO_DIR=default
|
---|
| 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 | ;;
|
---|
[21419] | 53 | --disable-jdbm)
|
---|
| 54 | ENABLE_JDBM=0
|
---|
| 55 | ;;
|
---|
[16566] | 56 | --disable-sqlite)
|
---|
| 57 | USE_SQLITE=false
|
---|
| 58 | ;;
|
---|
| 59 | --disable-yaz)
|
---|
| 60 | USE_YAZ=false
|
---|
| 61 | ;;
|
---|
| 62 | --enable-z3950)
|
---|
| 63 | USE_Z3950=true
|
---|
| 64 | ;;
|
---|
| 65 | --enable-corba)
|
---|
| 66 | USE_CORBA=true
|
---|
| 67 | ;;
|
---|
| 68 | --with-micodir=*)
|
---|
| 69 | if test $1 = ""; then
|
---|
| 70 | $1 = "default"
|
---|
| 71 | fi
|
---|
| 72 | MICO_DIR=$1
|
---|
| 73 | ;;
|
---|
| 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 |
|
---|
| 125 |
|
---|
[20832] | 126 | # configure expat (needs to be done before XML::Parser)
|
---|
| 127 | # now compile expat during the configure stage itself
|
---|
[16566] | 128 | echo ""
|
---|
| 129 | echo "Configuring expat"
|
---|
| 130 | echo ""
|
---|
| 131 | cd "$PACKAGES/expat"
|
---|
[19575] | 132 | if test ! -d expat-1.95.8 ;
|
---|
| 133 | then
|
---|
[19593] | 134 | gzip -dc expat-1.95.8.tar.gz | tar -xf -
|
---|
[19575] | 135 | fi
|
---|
[16566] | 136 |
|
---|
| 137 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 138 |
|
---|
| 139 | cd "$PACKAGES/expat/expat-1.95.8" && \
|
---|
| 140 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 141 |
|
---|
[21452] | 142 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
|
---|
| 143 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
|
---|
[16566] | 144 |
|
---|
[21452] | 145 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
|
---|
| 146 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
|
---|
[20832] | 147 |
|
---|
| 148 |
|
---|
| 149 | # configure and compile libiconv during configuration stage
|
---|
| 150 | echo ""
|
---|
| 151 | echo "Configuring iconv"
|
---|
| 152 | echo ""
|
---|
| 153 | cd "$PACKAGES/iconv"
|
---|
| 154 | if test ! -d libiconv-1.13.1 ;
|
---|
| 155 | then
|
---|
| 156 | gzip -dc libiconv-1.13.1.tar.gz | tar -xf -
|
---|
| 157 | fi
|
---|
| 158 |
|
---|
| 159 | # configure
|
---|
[21432] | 160 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[20832] | 161 | cd "$PACKAGES/iconv/libiconv-1.13.1" && \
|
---|
[21432] | 162 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[20832] | 163 |
|
---|
| 164 | # make
|
---|
[21452] | 165 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
|
---|
| 166 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
|
---|
[20832] | 167 |
|
---|
| 168 | # make install
|
---|
[21452] | 169 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
|
---|
| 170 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
|
---|
[20832] | 171 |
|
---|
[21432] | 172 | if test ! -z "$COMPAT32BITFLAGS" ; then
|
---|
| 173 | echo "Generating native 64-bit version as well"
|
---|
| 174 | # used in apache web server, for example
|
---|
| 175 |
|
---|
| 176 | # dist clean
|
---|
| 177 | cd "$PACKAGES/iconv/libiconv-1.13.1"
|
---|
| 178 | echo make distclean && \
|
---|
| 179 | make distclean
|
---|
| 180 |
|
---|
| 181 | # configure
|
---|
| 182 | echo ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" --libdir="$PACKAGES/iconv/lib64" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 183 | ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" --libdir="$PACKAGES/iconv/lib64" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 184 |
|
---|
| 185 | # make
|
---|
[21452] | 186 | echo make $ENVIRONMENT
|
---|
| 187 | make $ENVIRONMENT
|
---|
[21432] | 188 |
|
---|
| 189 | # make install
|
---|
[21452] | 190 | make install $ENVIRONMENT
|
---|
| 191 | make install $ENVIRONMENT
|
---|
[21432] | 192 |
|
---|
| 193 | fi
|
---|
| 194 |
|
---|
[20832] | 195 | #./configure $CACHE_FILE --prefix="$PACKAGES/iconv" --disable-shared $HOSTTARGETFLAGS&&
|
---|
| 196 | #make && make install
|
---|
| 197 |
|
---|
| 198 |
|
---|
[18023] | 199 | # configure GDBM
|
---|
| 200 | echo ""
|
---|
| 201 | echo "Configuring GDBM"
|
---|
| 202 | echo ""
|
---|
| 203 | cd "$PACKAGES/gdbm"
|
---|
| 204 |
|
---|
| 205 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 206 |
|
---|
| 207 | cd "$PACKAGES/gdbm/gdbm-1.8.3" && \
|
---|
| 208 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 209 |
|
---|
| 210 |
|
---|
[21409] | 211 | # configure JDBM
|
---|
| 212 | echo ""
|
---|
| 213 | echo "Configuring JDBM"
|
---|
[21419] | 214 | if test $ENABLE_JDBM ;
|
---|
[21409] | 215 | then
|
---|
| 216 | echo ""
|
---|
| 217 | cd "$PACKAGES/jdbm"
|
---|
| 218 | if test ! -d jdbm-1.0 ;
|
---|
| 219 | then
|
---|
| 220 | gzip -dc gs-jdbm-1.0.tar.gz | tar -xf -
|
---|
| 221 | fi
|
---|
| 222 | else
|
---|
| 223 | echo "JDBM support disabled."
|
---|
| 224 | echo " add '--enable-jdbm' to the configure command to include JDBM support."
|
---|
| 225 | echo ""
|
---|
| 226 | fi
|
---|
| 227 |
|
---|
[16566] | 228 | # configure SQLite
|
---|
| 229 | echo ""
|
---|
| 230 | echo "Configuring SQLite"
|
---|
| 231 | if test x$USE_SQLITE = xtrue ;
|
---|
| 232 | then
|
---|
| 233 | echo ""
|
---|
| 234 | cd "$PACKAGES/sqlite"
|
---|
[21869] | 235 | if test ! -d sqlite-amalgamation-3.6.23.1 ;
|
---|
[21409] | 236 | then
|
---|
[21869] | 237 | gzip -dc sqlite-amalgamation-3.6.23.1.tar.gz | tar -xf -
|
---|
[19575] | 238 | fi
|
---|
[19778] | 239 |
|
---|
| 240 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 241 |
|
---|
| 242 | cd "$PACKAGES/sqlite/sqlite-amalgamation-3.5.9" && \
|
---|
| 243 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
[16566] | 244 | else
|
---|
| 245 | echo "SQLite support disabled."
|
---|
| 246 | echo " add '--enable-sqlite' to the configure command to include SQLite support."
|
---|
| 247 | echo ""
|
---|
| 248 | fi
|
---|
[17497] | 249 |
|
---|
| 250 | # configure search4j
|
---|
| 251 | echo ""
|
---|
| 252 | echo "Configuring search4j"
|
---|
| 253 | echo ""
|
---|
| 254 | cd "$PACKAGES/search4j"
|
---|
| 255 |
|
---|
| 256 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
| 257 |
|
---|
| 258 | cd "$PACKAGES/search4j" && \
|
---|
| 259 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
|
---|