-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·396 lines (365 loc) · 9.07 KB
/
configure
File metadata and controls
executable file
·396 lines (365 loc) · 9.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
#!/bin/sh
test -z "$TMP" && TMP=/tmp
PREFIX=/usr/local
usage()
{
cat << EOF
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$PREFIX]
By default, 'make install' will install all the files in
'$PREFIX/bin', '$PREFIX/lib' etc. You can specify
an installation prefix other than '$PREFIX' using '--prefix',
for instance '--prefix=$HOME'.
Platform:
--platform=PLATFORM select platform specific Makefile
Use a file of your choosing from the Makefiles directory.
Default: autodetect.
Optional Packages:
--with-gdbm enable trivial Gdbm queries
--with-ingres enable Ingres queries
--with-lago enable Lago database queries
--with-mimer enable Mimer database support
--with-msql enable MiniSQL database queries
--with-mysql enable Mysql database queries
--with-odbc=library enable database queries over ODBC
--with-oracle enable Oracle database queries
--with-postgres enable Postgres database queries
--with-shsql enable shSQL/QUISP queries
--with-sqlite enable Sqlite database queries
--with-sqlite3 enable Sqlite version 3 database queries
--with-tds enable Microsoft SQL and Sybase
--disable-static do not build static library
--disable-shared do not build dynamic library
Report bugs to <ulric@siag.nu>.
EOF
exit
}
DIRS=
SHAREDLIB='$(SHAREDLIB)'
STATICLIB='$(STATICLIB)'
trylib()
{
echo "int main(){main();}" > tryconf.c
echo Looking for "$1"
#echo gcc tryconf.c $DIRS "$1" $LDFLAGS
gcc tryconf.c $DIRS "$1" $LDFLAGS > /dev/null 2>&1
}
tryheader()
{
cat < EOF > tryconf.c
#include <$1>
int x;
EOF
gcc tryconf.c $LDFLAGS > /dev/null 2>&1
}
tryprog()
{
PROG=`which $1`
test ! -z "$PROG" -a -x "$PROG"
}
if trylib -lsocket; then
LDFLAGS="$LDFLAGS -lsocket"
LDFLAGS_CFG="$LDFLAGS_CFG -lsocket"
fi
if trylib -lnsl; then
LDFLAGS="$LDFLAGS -lnsl"
LDFLAGS_CFG="$LDFLAGS_CFG -lnsl"
fi
UNAME=`uname`
case "$UNAME" in
Darwin )
PLATFORM=Darwin
;;
Linux )
PLATFORM=Linux
;;
* )
PLATFORM=Other
;;
esac
CFLAGS=-Wall
while test $# != 0; do
case "$1" in
--help | -h )
usage
;;
--prefix=* )
PREFIX=`echo "$1"|cut -f 2- -d =`
echo "PREFIX=$PREFIX"
;;
--platform=* )
PLATFORM=`echo "$1"|cut -f 2- -d =`
echo "PLATFORM=$PLATFORM"
;;
--with-gdbm )
echo "With gdbm"
LDFLAGS_CFG="$LDFLAGS_CFG -lgdbm"
if trylib -lgdbm; then
echo "gdbm found"
LDFLAGS="$LDFLAGS -lgdbm"
CFLAGS="$CFLAGS -DHAVE_LIBGDBM"
else
echo "gdbm not found"
exit 1
fi
;;
--with-ingres )
echo "With Ingres"
if test -z "$II_SYSTEM"; then
echo "II_SYSTEM not set, giving up"
exit 1
fi
echo "II_SYSTEM=$II_SYSTEM"
LDFLAGS="$LDFLAGS -L$II_SYSTEM/ingres/lib -lingres"
LDFLAGS_CFG="$LDFLAGS_CFG -L$II_SYSTEM/ingres/lib -lingres"
CFLAGS="$CFLAGS -I$II_SYSTEM/ingres/files"
CFLAGS_CFG="$CFLAGS_CFG -I$II_SYSTEM/ingres/files"
if trylib -lingres; then
echo "ingres found"
CFLAGS="$CFLAGS -DHAVE_INGRES"
else
echo "ingres not found"
exit 1
fi
if trylib -lpthread; then
echo "pthread found"
LDFLAGS="$LDFLAGS -lpthread"
LDFLAGS_CFG="$LDFLAGS_CFG -lpthread"
fi
if trylib -ldl; then
echo "dl found"
LDFLAGS="$LDFLAGS -ldl"
LDFLAGS_CFG="$LDFLAGS_CFG -ldl"
fi
if trylib -lcrypt; then
echo "crypt found"
LDFLAGS="$LDFLAGS -lcrypt"
LDFLAGS_CFG="$LDFLAGS_CFG -lcrypt"
fi
if trylib -lm; then
echo "m found"
LDFLAGS="$LDFLAGS -lm"
LDFLAGS_CFG="$LDFLAGS_CFG -lm"
fi
;;
--with-lago )
echo "With lago"
if test -d /usr/local/lago/lib; then
LDFLAGS="$LDFLAGS -L/usr/local/lago/lib"
LDFLAGS_CFG="$LDFLAGS_CFG -L/usr/local/lago/lib"
fi
LDFLAGS_CFG="$LDFLAGS_CFG -llago"
if trylib -llago; then
echo "lago found"
LDFLAGS="$LDFLAGS -llago"
CFLAGS="$CFLAGS -DHAVE_LIBLAGO"
else
echo "lago not found"
exit 1
fi
;;
--with-msql )
echo "With msql"
if test -d /usr/local/Hughes; then
LDFLAGS="$LDFLAGS -L/usr/local/Hughes/lib"
LDFLAGS_CFG="$LDFLAGS_CFG -L/usr/local/Hughes/lib"
CFLAGS="$CFLAGS -I/usr/local/Hughes/include"
CFLAGS_CFG="$CFLAGS_CFG -I/usr/local/Hughes/include"
fi
LDFLAGS_CFG="$LDFLAGS_CFG -lmsql"
if trylib -lmsql; then
echo "msql found"
LDFLAGS="$LDFLAGS -lmsql"
CFLAGS="$CFLAGS -DHAVE_LIBMSQL"
else
echo "msql not found"
exit 1
fi
;;
--with-mysql )
echo "With mysql"
if tryprog mysql_config; then
echo "mysql_config found"
LDFLAGS_CFG="$LDFLAGS_CFG `mysql_config --libs`"
LDFLAGS="$LDFLAGS `mysql_config --libs`"
CFLAGS_CFG="$CFLAGS_CFG `mysql_config --cflags`"
CFLAGS="$CFLAGS `mysql_config --cflags`"
CFLAGS="$CFLAGS -DHAVE_LIBMYSQLCLIENT"
else
echo "mysql_config not found"
exit 1
fi
;;
--with-sqlite )
echo "With sqlite"
if trylib -lsqlite; then
echo "sqlite found"
LDFLAGS="$LDFLAGS -lsqlite"
LDFLAGS_CFG="$LDFLAGS_CFG -lsqlite"
CFLAGS="$CFLAGS -DHAVE_LIBSQLITE"
else
echo "sqlite not found"
exit 1
fi
;;
--with-sqlite3 )
echo "With sqlite3"
if trylib -lsqlite3; then
echo "sqlite3 found"
LDFLAGS="$LDFLAGS -lsqlite3"
LDFLAGS_CFG="$LDFLAGS_CFG -lsqlite3"
CFLAGS="$CFLAGS -DHAVE_LIBSQLITE3"
else
echo "sqlite3 not found"
exit 1
fi
;;
--with-mimer )
echo "With mimer"
LDFLAGS_CFG="$LDFLAGS_CFG -lmimer"
if trylib -lpthread; then
echo "pthread found"
LDFLAGS_CFG="-lpthread $LDFLAGS_CFG"
LDFLAGS="-lpthread $LDFLAGS"
fi
if trylib -lmimer; then
echo "mimer found"
LDFLAGS_CFG="-lmimer $LDFLAGS"
LDFLAGS="-lmimer $LDFLAGS"
CFLAGS="$CFLAGS -DHAVE_LIBMIMER"
else
echo "mimer not found"
exit 1
fi
;;
--with-postgres )
echo "With postgres"
if test -d /usr/local/pgsql; then
CFLAGS_CFG="$CFLAGS_CFG -I/usr/local/pgsql/include"
LDFLAGS_CFG="$LDFLAGS_CFG -L/usr/local/pgsql/lib -lpq"
CFLAGS="$CFLAGS -I/usr/local/pgsql/include"
LDFLAGS="$LDFLAGS -L/usr/local/pgsql/lib"
fi
if trylib -lpq; then
echo "pq found"
LDFLAGS="$LDFLAGS -lpq"
CFLAGS="$CFLAGS -DHAVE_LIBPQ"
else
echo "pq not found"
exit 1
fi
;;
--with-oracle* )
echo "With oracle"
x=`echo "$1"|cut -f 2- -s -d =`
if test ! -z "$x"; then
ORACLE_HOME="$x"
export ORACLE_HOME
fi
if test -z "$ORACLE_HOME"; then
echo "ORACLE_HOME not set, giving up"
exit 1
fi
echo "ORACLE_HOME=$ORACLE_HOME"
CFLAGS_CFG="$CFLAGS_CFG -I$ORACLE_HOME/rdbms/demo -I$ORACLE_HOME/rdbms/public -I$ORACLE_HOME/sdk/include"
LDFLAGS_CFG="$LDFLAGS_CFG -L$ORACLE_HOME/lib -L$ORACLE_HOME"
CFLAGS="$CFLAGS -I$ORACLE_HOME/rdbms/demo -I$ORACLE_HOME/rdbms/public -I$ORACLE_HOME/sdk/include"
LDFLAGS="$LDFLAGS -L$ORACLE_HOME/lib -L$ORACLE_HOME"
if trylib -lclntsh; then
echo "clntsh found"
LDFLAGS="$LDFLAGS -lclntsh"
LDFLAGS_CFG="$LDFLAGS_CFG -lclntsh"
CFLAGS="$CFLAGS -DHAVE_LIBCLNTSH"
else
# Maybe they have renamed it? :D
CLNTSH=`find $ORACLE_HOME -type f -name 'libclntsh.so*'|head -1`
if test "$CLNTSH"; then
echo "$CLNTSH found"
LDFLAGS="$LDFLAGS $CLNTSH"
LDFLAGS_CFG="$LDFLAGS_CFG $CLNTSH"
CFLAGS="$CFLAGS -DHAVE_LIBCLNTSH"
else
echo "clntsh not found"
exit 1
fi
fi
;;
--with-odbc* )
echo "enable database queries over ODBC"
ODBCLIB=`echo "$1"|cut -f 2- -s -d =`
test -z "$ODBCLIB" && ODBCLIB=odbc
echo "ODBCLIB=$ODBCLIB"
if trylib -l$ODBCLIB; then
echo "$ODBCLIB found"
LDFLAGS="$LDFLAGS -l$ODBCLIB"
if tryheader windows.h; then
CFLAGS="$CFLAGS -DHAVE_WINDOWS_H"
fi
CFLAGS="$CFLAGS -DHAVE_LIBODBC"
else
echo "$ODBCLIB not found"
exit 1
fi
;;
--with-shsql )
echo "With shsql"
LDFLAGS_CFG="$LDFLAGS_CFG -lshsql"
if trylib -lshsql; then
echo "shsql found"
LDFLAGS="$LDFLAGS -lshsql"
CFLAGS="$CFLAGS -DHAVE_LIBSHSQL"
else
echo "shsql not found"
exit 1
fi
;;
--with-tds )
echo "With TDS"
LDFLAGS_CFG="$LDFLAGS_CFG -ltds"
if trylib -ltds; then
echo "tds found"
LDFLAGS="$LDFLAGS -ltds"
CFLAGS="$CFLAGS -DHAVE_LIBTDS"
CFLAGS_CFG="$CFLAGS_CFG -DHAVE_LIBTDS"
else
echo "tds not found"
exit 1
fi
;;
--disable-static )
echo "Do not build static library"
STATICLIB=
;;
--disable-shared )
echo "Do not build shared library"
SHAREDLIB=
;;
* )
usage
;;
esac
shift
done
rm -f Makefile
echo "LDFLAGS = $LDFLAGS" >> Makefile
echo "CFLAGS = $CFLAGS" >> Makefile
echo "LDFLAGS_CFG = $LDFLAGS_CFG" >> Makefile
echo "CFLAGS_CFG = $CFLAGS_CFG" >> Makefile
echo "PREFIX = $PREFIX" >> Makefile
cat config.in >> Makefile
echo "$PLATFORM ($UNAME)"
if test ! -s "Makefiles/$PLATFORM"; then
echo "No Makefile for $PLATFORM"
exit 1
fi
cat "Makefiles/$PLATFORM" >> Makefile
#echo '.all: $(SHAREDLIB) $(STATICLIB) $(PROGS)' >> Makefile
echo '.all: '$SHAREDLIB' '$STATICLIB' $(PROGS)' >> Makefile
rm -f a.out tryconf.c