source: main/trunk/greenstone2/runtime-src/packages/configure@ 31762

Last change on this file since 31762 was 31076, checked in by sjm84, 7 years ago

Getting GS2 yaz client compile in 32 bi tlsb linux environment again when we're disabling shared and enabling static. In such a case, we are forced to tell pkgconfig to do things statically too by passing in --static

  • Property svn:executable set to *
File size: 6.9 KB
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# GDBM compilation enabled by default, can switch it off with --disable-gdbm
25USE_GDBM=true
26# JDBM compilation enabled by default, can switch it off with --disable-jdbm
27USE_JDBM=true
28# SQLite support enabled by default, can switch it off with --disable-sqlite
29USE_SQLITE=true
30# yaz compilation enabled by default, can switch it off with --disable-yaz
31USE_YAZ=true
32# z3950 server disabled by default, switch it on with --enable-z3950
33USE_Z3950=false
34# CORBA support disabled by default, switch it on with --enable-corba
35USE_CORBA=false
36MICO_DIR=default
37# Apache's httpd (web server) enabled by default
38USE_APACHE_HTTPD=false
39
40# parse any arguments given from toplevel configure
41while 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 ;;
57 --disable-gdbm)
58 USE_GDBM=false
59 ;;
60 --disable-jdbm)
61 USE_JDBM=false
62 ;;
63 --disable-sqlite)
64 USE_SQLITE=false
65 ;;
66 --disable-yaz)
67 USE_YAZ=false
68 ;;
69 --enable-z3950)
70 USE_Z3950=true
71 ;;
72 --enable-corba)
73 USE_CORBA=true
74 ;;
75 --with-micodir=*)
76 if test $1 = ""; then
77 $1 = "default"
78 fi
79 MICO_DIR=$1
80 ;;
81 --enable-apache-httpd)
82 USE_APACHE_HTTPD=true
83 ;;
84 --prefix=*)
85 prefix=`echo $1 | sed s/--prefix=//`
86 ;;
87 --bindir=*)
88 # where to install binaries to
89 bindir=`echo $1 | sed s/--bindir=//`
90 # turn relative path into an absolute path
91 if test -d "$bindir" ; then
92 bindir=`cd "$bindir" ; pwd `
93 cd "$PACKAGES"
94 elif test -z `echo $bindir | sed '/^\// p;D'` ; then
95 rel_bindir="`echo $bindir | sed s@/.*@@`"
96 cd "$rel_bindir"
97 bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
98 cd "$PACKAGES"
99 else
100 # bindir doesn't exist, and isn't relative
101 true
102 fi
103 ;;
104 --host=* | --target=*)
105 HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
106 ;;
107 *)
108 # ignore all other options for now
109 ;;
110 esac
111 shift
112done
113
114# note! Our GSDL package currently always installs into it's source
115# directory, ignoring any --prefix given to configure.
116# When this is fixed, uncomment the relevant lines below...
117
118##if test -z "$prefix" ; then
119prefix="${GSDLHOME}"
120##fi
121
122##if test -z "$bindir" ; then
123bindir="${prefix}/bin/$GSDLOS"
124##fi
125
126# This loads the top configure's cache file, with variables already set.
127if test -f "$cache_file" ; then
128 . $cache_file
129fi
130
131# we assume that gzip and tar are on the search path.
132# non-GNU versions of tar don't take the -z option.
133
134if test $USE_CORBA = true ; then
135 if test $MICO_DIR = default; then
136 # configure the MICO CORBA ORB
137 echo ""
138 echo "Configuring MICO CORBA"
139 echo ""
140
141 cd "$PACKAGES/mico"
142 gzip -dc mico-2.3.13-gs.tar.gz | tar -xf -
143 cd mico && \
144 ./configure $CACHE_FILE --prefix=$PACKAGES/mico/ --disable-coss --disable-naming --disable-relship --disable-events --disable-streams --disable-property --disable-trader --disable-time
145#--disable-debug
146#--enable-optimize --enable-final --enable-speed-tune
147# sed 's/tools//' $PACKAGES/mico/mico/Makefile | sed 's/ldconfig//' >$PACKAGES/mico/mico/Makefile.out
148
149# Remove any references to running 'tools' and 'ldconfig' as these require
150# admin permissions when running 'make install'.
151# Use fgrep here to knock out the entire line containing $(LDCONFIG), because
152# there may be a special tab preceding the line which in a Makefile can have
153# special meaning. Don't want to leave it in by itself.
154 sed 's/tools//' $PACKAGES/mico/mico/Makefile | fgrep -iv ldconfig >$PACKAGES/mico/mico/Makefile.out
155 mv $PACKAGES/mico/mico/Makefile.out $PACKAGES/mico/mico/Makefile
156 else
157 #MICO is on the system path
158 echo ""
159 echo "Taking MICO from system paths"
160 echo ""
161 fi
162else
163 echo "corba support disabled - mico compiler not required."
164 echo " add '--enable-corba' to the configure command to include corba support."
165 echo ""
166fi
167
168
169
170# D2M stuff needed for z3950server
171echo ""
172echo "Configuring D2M"
173if test x$USE_Z3950 = xtrue ;
174then
175 USE_YAZ=true
176 echo ""
177 cd "$PACKAGES/d2m"
178 ./configure $CACHE_FILE --prefix="$PACKAGES/d2m" $HOSTTARGETFLAGS
179else
180 echo "Z39.50 support disabled - D2M library not required."
181 echo " add '--enable-z3950' to the configure command to include z39.50 support."
182 echo ""
183fi
184
185# YAZ Z39.50 toolkit
186# http://stackoverflow.com/questions/21027388/how-to-make-pkg-check-modules-work-with-static-libraries
187echo ""
188echo "Configuring YAZ"
189if test x$USE_YAZ = xtrue ;
190then
191 echo "YAZ library support enabled"
192 echo "add --disable-yaz to the configure command to disable this"
193 echo ""
194 cd "$PACKAGES/yaz"
195 gzip -dc yaz-2.1.56.tar.gz | tar -xf -
196 cd yaz-2.1.56 && \
197 ac_cv_path_pkgconfigpath="pkg-config --static" ./configure $CACHE_FILE --prefix="$PACKAGES/yaz" --bindir="$bindir" --disable-shared --enable-static $HOSTTARGETFLAGS
198else
199 echo "YAZ support disabled"
200 echo ""
201fi
202
203
204# Apache's HTTPD web server
205echo ""
206echo "Configuring Apache httpd"
207if test x$USE_APACHE_HTTPD = xtrue ;
208then
209 echo "Apache httpd support enabled"
210 echo "add --disable-apache-httpd to the configure command to disable this"
211 echo ""
212# echo "Setting up libiconv (used by Apache httpd)"
213# cd "$PACKAGES/apache-httpd"
214# if [ ! -e libiconv-1.13.1 ] ; then gzip -dc libiconv-1.13.1.tar.gz | tar -xf - ; fi
215# cd libiconv-1.13.1&& \
216# ./configure $CACHE_FILE --prefix="${prefix}/apache-httpd/${GSDLOS}" --disable-shared $HOSTTARGETFLAGS&&
217# make && make install
218# echo ""
219 echo "Configuring Apache httpd"
220 cd "$PACKAGES/apache-httpd"
221 if [ ! -e httpd-2.2.11 ] ; then gzip -dc httpd-2.2.11-gs.tar.gz | tar -xf - ; fi
222 cd httpd-2.2.11&& \
223
224CFLAGS="$CFLAGS -I${GSDLHOME}/common-src/packages/iconv/include" CXXFLAGS="$CXXFLAGS -I${GSDLHOME}/common-src/packages/iconv/include" LDFLAGS="$LDFLAGS -L${GSDLHOME}/common-src/packages/iconv/lib -L${GSDLHOME}/common-src/packages/sqlite/lib" ./configure $CACHE_FILE --with-included-apr --with-layout=BinaryDistribution --enable-most --enable-rewrite --prefix="${prefix}/apache-httpd/${GSDLOS}" $HOSTTARGETFLAGS --with-iconv
225
226else
227 echo "Apache httpd support disabled"
228 echo "add --enable-apache-httpd to the configure command to enable this"
229 echo ""
230fi
231
232
Note: See TracBrowser for help on using the repository browser.