root/main/trunk/greenstone2/common-src/packages/configure @ 21869

Revision 21869, 8.5 KB (checked in by davidb, 10 years ago)

Upgrading to a newer version of SQLITE to (hopefully) fix problem with Windows version not accepting end-of-line characters when commands are piped to it. Ticket at SQLITE web site reports this to be a problem and that shifting to a 3.6.x version eliminates the problem

  • 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# JDBM support enabled by default, can switch it off with --disable-jdbm
25ENABLE_JDBM=1
26# SQLite support enabled by default, can switch it off with --disable-sqlite
27USE_SQLITE=true
28# yaz compilation enabled by default, can switch it off with --disable-yaz
29USE_YAZ=true
30# z3950 server disabled by default, switch it on with --enable-z3950
31USE_Z3950=false
32# CORBA support disabled by default, switch it on with --enable-corba
33USE_CORBA=false
34MICO_DIR=default
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-jdbm)
54        ENABLE_JDBM=0
55        ;;
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
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
124
125
126# configure expat (needs to be done before XML::Parser)
127# now compile expat during the configure stage itself
128echo ""
129echo "Configuring expat"
130echo ""
131cd "$PACKAGES/expat"
132if test ! -d expat-1.95.8 ;
133then
134  gzip -dc expat-1.95.8.tar.gz | tar -xf -
135fi
136
137echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
138
139cd "$PACKAGES/expat/expat-1.95.8" && \
140CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
141
142echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
143CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
144
145echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
146CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
147
148
149# configure and compile libiconv during configuration stage
150echo ""
151echo "Configuring iconv"
152echo ""
153cd "$PACKAGES/iconv"
154if test ! -d libiconv-1.13.1 ;
155then
156  gzip -dc libiconv-1.13.1.tar.gz | tar -xf -
157fi
158
159# configure
160echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
161cd "$PACKAGES/iconv/libiconv-1.13.1" && \
162CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --enable-shared --enable-static --prefix="$PACKAGES/iconv" $HOSTTARGETFLAGS $ENVIRONMENT
163
164# make
165echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
166CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make $ENVIRONMENT
167
168# make install
169echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
170CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" make install $ENVIRONMENT
171
172if 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
186  echo make $ENVIRONMENT
187  make $ENVIRONMENT
188
189  # make install
190  make install $ENVIRONMENT
191  make install $ENVIRONMENT
192
193fi
194
195#./configure $CACHE_FILE --prefix="$PACKAGES/iconv" --disable-shared $HOSTTARGETFLAGS&&
196#make && make install
197
198
199# configure GDBM
200echo ""
201echo "Configuring GDBM"
202echo ""
203cd "$PACKAGES/gdbm"
204
205echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
206
207cd "$PACKAGES/gdbm/gdbm-1.8.3" && \
208CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
209
210
211# configure JDBM
212echo ""
213echo "Configuring JDBM"
214if test $ENABLE_JDBM  ;
215then
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
222else
223  echo "JDBM support disabled."
224  echo "  add '--enable-jdbm' to the configure command to include JDBM support."
225  echo ""
226fi
227
228# configure SQLite
229echo ""
230echo "Configuring SQLite"
231if test x$USE_SQLITE = xtrue ;
232then
233  echo ""
234  cd "$PACKAGES/sqlite"
235  if test ! -d sqlite-amalgamation-3.6.23.1 ;
236  then
237    gzip -dc sqlite-amalgamation-3.6.23.1.tar.gz | tar -xf -
238  fi
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
244else
245  echo "SQLite support disabled."
246  echo "  add '--enable-sqlite' to the configure command to include SQLite support."
247  echo ""
248fi
249
250# configure search4j
251echo ""
252echo "Configuring search4j"
253echo ""
254cd "$PACKAGES/search4j"
255
256echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
257
258cd "$PACKAGES/search4j" && \
259 CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
Note: See TracBrowser for help on using the browser.