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 |
|
---|
24 | # SQLite support enabled by default, can switch it off with --disable-sqlite
|
---|
25 | USE_SQLITE=true
|
---|
26 | # yaz compilation enabled by default, can switch it off with --disable-yaz
|
---|
27 | USE_YAZ=true
|
---|
28 | # z3950 server disabled by default, switch it on with --enable-z3950
|
---|
29 | USE_Z3950=false
|
---|
30 | # CORBA support disabled by default, switch it on with --enable-corba
|
---|
31 | USE_CORBA=false
|
---|
32 | MICO_DIR=default
|
---|
33 |
|
---|
34 | # parse any arguments given from toplevel configure
|
---|
35 | while test $# -ne 0; do
|
---|
36 | case "$1" in
|
---|
37 | --cache-file=*)
|
---|
38 | cache_filename=`echo $1 | sed s/--cache-file=//`
|
---|
39 | # turn relative path into an absolute path
|
---|
40 | cache_dir=`echo $cache_filename | sed 's@/[^/]*$@@'`
|
---|
41 | cache_dir=`cd $cache_dir 2>/dev/null && pwd`
|
---|
42 |
|
---|
43 | cache_basefile=`echo $cache_filename | sed 's@.*/@@'`
|
---|
44 | cache_file="$cache_dir/$cache_basefile"
|
---|
45 | if test ! -f "$cache_file"; then
|
---|
46 | CACHE_FILE=""
|
---|
47 | else
|
---|
48 | CACHE_FILE="--cache-file=$cache_file"
|
---|
49 | fi
|
---|
50 | ;;
|
---|
51 | --disable-sqlite)
|
---|
52 | USE_SQLITE=false
|
---|
53 | ;;
|
---|
54 | --disable-yaz)
|
---|
55 | USE_YAZ=false
|
---|
56 | ;;
|
---|
57 | --enable-z3950)
|
---|
58 | USE_Z3950=true
|
---|
59 | ;;
|
---|
60 | --enable-corba)
|
---|
61 | USE_CORBA=true
|
---|
62 | ;;
|
---|
63 | --with-micodir=*)
|
---|
64 | if test $1 = ""; then
|
---|
65 | $1 = "default"
|
---|
66 | fi
|
---|
67 | MICO_DIR=$1
|
---|
68 | ;;
|
---|
69 | --prefix=*)
|
---|
70 | prefix=`echo $1 | sed s/--prefix=//`
|
---|
71 | ;;
|
---|
72 | --bindir=*)
|
---|
73 | # where to install binaries to
|
---|
74 | bindir=`echo $1 | sed s/--bindir=//`
|
---|
75 | # turn relative path into an absolute path
|
---|
76 | if test -d "$bindir" ; then
|
---|
77 | bindir=`cd "$bindir" ; pwd `
|
---|
78 | cd "$PACKAGES"
|
---|
79 | elif test -z `echo $bindir | sed '/^\// p;D'` ; then
|
---|
80 | rel_bindir="`echo $bindir | sed s@/.*@@`"
|
---|
81 | cd "$rel_bindir"
|
---|
82 | bindir="`pwd`/`echo $bindir | sed s@^[^/]*/@@`"
|
---|
83 | cd "$PACKAGES"
|
---|
84 | else
|
---|
85 | # bindir doesn't exist, and isn't relative
|
---|
86 | true
|
---|
87 | fi
|
---|
88 | ;;
|
---|
89 | --host=* | --target=*)
|
---|
90 | HOSTTARGETFLAGS="$HOSTTARGETFLAGS $1"
|
---|
91 | ;;
|
---|
92 | *)
|
---|
93 | # ignore all other options for now
|
---|
94 | ;;
|
---|
95 | esac
|
---|
96 | shift
|
---|
97 | done
|
---|
98 |
|
---|
99 | # note! Our GSDL package currently always installs into it's source
|
---|
100 | # directory, ignoring any --prefix given to configure.
|
---|
101 | # When this is fixed, uncomment the relevant lines below...
|
---|
102 |
|
---|
103 | ##if test -z "$prefix" ; then
|
---|
104 | prefix="${GSDLHOME}"
|
---|
105 | ##fi
|
---|
106 |
|
---|
107 | ##if test -z "$bindir" ; then
|
---|
108 | bindir="${prefix}/bin/$GSDLOS"
|
---|
109 | ##fi
|
---|
110 |
|
---|
111 | # This loads the top configure's cache file, with variables already set.
|
---|
112 | if test -f "$cache_file" ; then
|
---|
113 | . $cache_file
|
---|
114 | fi
|
---|
115 |
|
---|
116 | # we assume that gzip and tar are on the search path.
|
---|
117 | # non-GNU versions of tar don't take the -z option.
|
---|
118 |
|
---|
119 |
|
---|
120 |
|
---|
121 | # configure expat (needs to be done before XML::Parser
|
---|
122 | echo ""
|
---|
123 | echo "Configuring expat"
|
---|
124 | echo ""
|
---|
125 | cd "$PACKAGES/expat"
|
---|
126 | if test ! -d expat-1.95.8 ;
|
---|
127 | then
|
---|
128 | gzip -dc expat-1.95.8.tar.gz | tar -xf -
|
---|
129 | fi
|
---|
130 |
|
---|
131 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
132 |
|
---|
133 | cd "$PACKAGES/expat/expat-1.95.8" && \
|
---|
134 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --with-pic --prefix=$PACKAGES/expat --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
135 |
|
---|
136 |
|
---|
137 | # configure GDBM
|
---|
138 | echo ""
|
---|
139 | echo "Configuring GDBM"
|
---|
140 | echo ""
|
---|
141 | cd "$PACKAGES/gdbm"
|
---|
142 |
|
---|
143 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
144 |
|
---|
145 | cd "$PACKAGES/gdbm/gdbm-1.8.3" && \
|
---|
146 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure $CACHE_FILE --disable-shared --prefix=$PACKAGES/gdbm $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
147 |
|
---|
148 |
|
---|
149 | # configure SQLite
|
---|
150 | echo ""
|
---|
151 | echo "Configuring SQLite"
|
---|
152 | if test x$USE_SQLITE = xtrue ;
|
---|
153 | then
|
---|
154 | echo ""
|
---|
155 | cd "$PACKAGES/sqlite"
|
---|
156 | if test ! -d sqlite-amalgamation-3.5.9 ;
|
---|
157 | then
|
---|
158 | gzip -dc sqlite-amalgamation-3.5.9.tar.gz | tar -xf -
|
---|
159 | fi
|
---|
160 | cd sqlite-amalgamation-3.5.9 && \
|
---|
161 | ./configure $CACHE_FILE --prefix="$PACKAGES/sqlite" --bindir="$bindir" $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
162 | else
|
---|
163 | echo "SQLite support disabled."
|
---|
164 | echo " add '--enable-sqlite' to the configure command to include SQLite support."
|
---|
165 | echo ""
|
---|
166 | fi
|
---|
167 |
|
---|
168 | # configure search4j
|
---|
169 | echo ""
|
---|
170 | echo "Configuring search4j"
|
---|
171 | echo ""
|
---|
172 | cd "$PACKAGES/search4j"
|
---|
173 |
|
---|
174 | echo CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
|
---|
175 |
|
---|
176 | cd "$PACKAGES/search4j" && \
|
---|
177 | CFLAGS="$CFLAGS $COMPAT32BITFLAGS" CXXFLAGS="$CXXFLAGS $COMPAT32BITFLAGS" LDFLAGS="$LDFLAGS $COMPAT32BITFLAGS" ./configure --bindir="$GSDLHOME/bin/$GSDLOS" $CACHE_FILE $HOSTTARGETFLAGS $ENVIRONMENT
|
---|