root/gsdl/trunk/runtime-src/packages/configure @ 19301

Revision 19301, 5.3 KB (checked in by davidb, 10 years ago)

Added -with-included-apr to help Apache compile on different distributions of Unix

  • Property svn:executable set to *
Line 
1#! /bin/sh
2
3PACKAGES=`pwd`
4cd ../..
5GSDLHOME=`pwd`
6cd $PACKAGES
7
8GSDLOS=`uname -s |tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
9# check for running bash under cygwin
10if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
11then
12 GSDLOS=windows
13fi
14
15prefix=""
16bindir=""
17HOSTTARGETFLAGS=""
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"
22ENVIRONMENT=""
23
24# SQLite support enabled by default, can switch it off with --disable-sqlite
25USE_SQLITE=true
26# yaz compilation enabled by default, can switch it off with --disable-yaz
27USE_YAZ=true
28# z3950 server disabled by default, switch it on with --enable-z3950
29USE_Z3950=false
30# CORBA support disabled by default, switch it on with --enable-corba
31USE_CORBA=false
32MICO_DIR=default
33# Apache's httpd (web server) enabled by default
34USE_APACHE_HTTPD=false
35
36# parse any arguments given from toplevel configure
37while 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        ;;       
71    --enable-apache-httpd)
72        USE_APACHE_HTTPD=true
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
102done
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
109prefix="${GSDLHOME}"
110##fi
111
112##if test -z "$bindir" ; then
113bindir="${prefix}/bin/$GSDLOS"
114##fi
115
116# This loads the top configure's cache file, with variables already set.
117if test -f "$cache_file" ; then
118  . $cache_file
119fi
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
124if 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
143else
144  echo "corba support disabled - mico compiler not required."
145  echo "  add '--enable-corba' to the configure command to include corba support."
146  echo ""
147fi
148
149
150
151# D2M stuff needed for z3950server
152echo ""
153echo "Configuring D2M"
154if test x$USE_Z3950 = xtrue ;
155then
156  USE_YAZ=true
157  echo ""
158  cd "$PACKAGES/d2m"
159  ./configure $CACHE_FILE --prefix="$PACKAGES/d2m" $HOSTTARGETFLAGS
160else
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 ""
164fi
165   
166# YAZ Z39.50 toolkit
167echo ""
168echo "Configuring YAZ"
169if test x$USE_YAZ = xtrue ;
170then
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
178else
179  echo "YAZ support disabled"
180  echo ""
181fi
182
183
184# Apache's HTTPD web server
185echo ""
186echo "Configuring Apache httpd"
187if test x$USE_APACHE_HTTPD = xtrue ;
188then
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&& \
195    ./configure $CACHE_FILE --with-included-apr --with-layout=BinaryDistribution --enable-most --prefix="${prefix}/apache-httpd/${GSDLOS}" $HOSTTARGETFLAGS
196else
197  echo "Apache httpd support disabled"
198  echo "add --enable-apache-httpd to the configure command to enable this"
199  echo ""
200fi
201
202
Note: See TracBrowser for help on using the browser.