-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.in
465 lines (387 loc) · 11.4 KB
/
configure.in
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
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl NOTE: Ths needs a bit of cleanup as some things are not needed
dnl simply inherited from unixODBC.
dnl
AC_INIT(unixODBC-GUI-Qt, 2.3.0)
AM_INIT_AUTOMAKE
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CPP
AM_PROG_LEX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_CXX
dnl Check if we want to worry about threads
AC_ARG_ENABLE( threads,
[ --enable-threads build with thread support [default=yes]],
[ case "${enableval}" in
yes) thread=true ;;
no) thread=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-thread) ;;
esac],[thread=true])
AC_ARG_ENABLE( gnuthreads,
[ --enable-gnuthreads build with gnu threads support [default=no]],
[ case "${enableval}" in
yes) gnuthread=true ;;
no) gnuthread=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gnuthread) ;;
esac],[gnuthread=false])
AC_ARG_ENABLE( readline,
[ --enable-readline build with readline support [default=yes]],
[ case "${enableval}" in
yes) readline=true ;;
no) readline=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-readline) ;;
esac],[readline=true])
AC_ARG_ENABLE( inicaching,
[ --enable-inicaching build with ini file caching support [default=yes]],
[ case "${enableval}" in
yes) inicaching=true ;;
no) inicaching=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-inicaching) ;;
esac],[inicaching=true])
dnl Check for sys/sem.h
AC_CHECK_HEADERS(sys/sem.h, semh=true, semh=false)
AC_ARG_ENABLE( stats,
[ --enable-stats build with statistic gathering support [default=yes]],
[ case "${enableval}" in
yes) if test "x$semh" = "xfalse"; then
AC_MSG_ERROR(stats enabled but required header was not found)
fi
stats=true ;;
no) stats=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-stats) ;;
esac],[stats=$semh])
AC_ARG_ENABLE( rtldgroup,
[ --enable-rtldgroup build with RTLD_GROUP passed to dlopen (when supported) [default=yes]],
[ case "${enableval}" in
yes) rtldgroup=true ;;
no) rtldgroup=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-rltdgroup) ;;
esac],[rtldgroup=true])
AC_ARG_ENABLE( ltdllib,
[ --enable-ltdllib Use system libltdl.so (if found) [default=no]],
[ case "${enableval}" in
yes) ltdllib=true ;;
no) ltdllib=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ltdllib) ;;
esac],[ltdllib=false])
dnl Enable building of the convenience library
dnl and set LIBLTDL accordingly
INCLTDL=""
LIBLTDL=""
AC_MSG_CHECKING( Have we enabled using RTLD_GROUP )
if test "x$rtldgroup" = "xtrue"; then
AC_MSG_RESULT( yes )
AC_LIBLTDL_CONVENIENCE
else
AC_MSG_RESULT( no );
AC_LIBLTDL_CONVENIENCE_G
fi
dnl Check for dlopen support
AC_LIBTOOL_DLOPEN
dnl for cygwin support
AC_LIBTOOL_WIN32_DLL
dnl Configure libtool
AM_PROG_LIBTOOL
dnl Configure libltdl
AC_CONFIG_SUBDIRS(libltdl)
use_builtin_libtool="no"
dnl override the libtool lines if we use the system libs
if test "x$ltdllib" = "xtrue"; then
AC_CHECK_LIB( ltdl, lt_dlopen, [ LIBLTDL="-lltdl" ], [use_builtin_libtool="yes"] )
if test "x$use_builtin_libtool" = "xno"; then
AC_CHECK_HEADERS(ltdl.h, [], [use_builtin_libtool="yes"] )
fi
else
use_builtin_libtool="yes"
fi
AC_MSG_CHECKING( if we are using the included libltdl )
AC_MSG_RESULT( $use_builtin_libtool )
dnl Substitute INCLTDL and LIBLTDL in the Makefiles
AC_SUBST(LTDLINCL)
AC_SUBST(LIBLTDL)
dnl Find shared lib extension
AC_MSG_CHECKING(for shared lib extension)
SHLIBEXT="$shrext_cmds"
AC_MSG_RESULT($shrext_cmds)
AC_SUBST(SHLIBEXT)
if test "x$iconv" = "xtrue";
then
AM_ICONV
iconv_char_enc="auto-search"
AC_ARG_WITH(iconv_char_enc,
[ --with-iconv-char-enc=enc Encoding to use as ASCII [default=auto-search] ],
iconv_char_enc="$withval"
)
ICONV_CHAR_ENCODING="$iconv_char_enc"
iconv_ucode_enc="auto-search"
AC_ARG_WITH(iconv_ucode_enc,
[ --with-iconv-ucode-enc=enc Encoding to use as UNICODE [default=auto-search] ],
iconv_ucode_enc="$withval"
)
ICONV_CHAR_ENCODING=""
ICONV_UNICODE_ENCODING=""
if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING( for encoding to use for CHAR representations );
ICONV_CHAR_ENCODING="$iconv_char_enc"
AC_MSG_RESULT( $iconv_char_enc );
AC_MSG_CHECKING( for encoding to use for UNICODE representations );
ICONV_UNICODE_ENCODING="$iconv_ucode_enc"
AC_MSG_RESULT( $iconv_ucode_enc );
fi
AC_SUBST(ICONV_CHAR_ENCODING)
AC_SUBST(ICONV_UNICODE_ENCODING)
fi
dnl Checks for libraries.
AC_CHECK_LIB(crypt, crypt, [ LIBADD_CRYPT="-lcrypt"; AC_DEFINE(HAVE_LIBCRYPT)],)
AC_SUBST(LIBADD_CRYPT)
AC_CHECK_LIB(m, pow, [ LIBADD_POW="-lm" ], )
AC_SUBST(LIBADD_POW)
have_readline="no"
if test "x$readline" = "xtrue"; then
AC_CHECK_LIB_NOC(readline, readline,
[
READLINE=-lreadline
have_readline="yes"
],
[
dnl try with -lcurses
AC_CHECK_LIB_NOC(readline, readline,
[
READLINE="-lreadline -lcurses"
have_readline="yes"
],
[
],
-lcurses )
])
if test "x$have_readline" = "xyes"; then
AC_CHECK_HEADERS(readline/history.h, [AC_DEFINE(HAVE_READLINE, 1)])
fi
fi
AC_SUBST(READLINE)
AC_MSG_CHECKING( Are we using ini caching )
if test "x$inicaching" = "xtrue"; then
CFLAGS="$CFLAGS -DENABLE_INI_CACHING"
AC_MSG_RESULT( yes );
else
AC_MSG_RESULT( no );
fi
dnl Are we using flex
if test "x$drivers" = "xtrue"; then
AC_MSG_CHECKING( Are we using flex )
if test "x$LEX" = "xflex"; then
LFLAGS="$LFLAGS -i"
AC_MSG_RESULT( yes );
AC_CHECK_LIB(c, scandir, [AC_DEFINE(HAVE_SCANDIR, 1)] )
else
AC_MSG_RESULT( no - text driver disabled );
fi
AM_CONDITIONAL(HAVE_FLEX, test "x$LEX" = "xflex" )
AC_SUBST(LFLAGS)
else
AM_CONDITIONAL(HAVE_FLEX, test "xabc" = "xdef" )
fi
case $host_os in
*qnx* )
qnx="true"
AC_DEFINE(QNX_LIBLTDL)
;;
esac
dnl check how time() can be used
AC_HEADER_TIME
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_SIZEOF(long, 4)
AC_MSG_CHECKING([if platform is 64 bit])
if test "$ac_cv_sizeof_long" = "8"; then
AC_MSG_RESULT( Yes );
AC_DEFINE(PLATFORM64)
else
AC_MSG_RESULT( No );
fi
AC_CHECK_LONG_LONG
AC_CHECK_SIZEOF([long int])
AC_CHECK_FUNCS( strcasecmp strncasecmp vsnprintf strtol atoll strtoll endpwent gettimeofday ftime time stricmp strnicmp )
LIBADD_DL=
AC_SUBST(LIBADD_DL)
THREADLIB=""
if test "x$thread" = "xtrue"; then
if test "x$gnuthread" = "xtrue"; then
AC_CHECK_PTH( 1.3.0 )
CPPFLAGS="$CPPFLAGS $PTH_CPPFLAGS"
CFLAGS="$CFLAGS $PTH_CFLAGS"
LDFLAGS="$LDFLAGS $PTH_LDFLAGS"
THREADLIB="$PTH_LIBS"
AC_DEFINE(HAVE_LIBPTH,1)
AC_DEFINE(_REENTRANT)
else
gotthread="no";
AC_MSG_CHECKING( if os is AIX )
case $host_os in
"aix"*)
raw_threads="no";
AC_MSG_RESULT( yes - disable check for libthread );
;;
*)
raw_threads="yes";
AC_MSG_RESULT( no - enable check for libthread );
;;
esac
if test "x$raw_threads" = "xyes"; then
AC_CHECK_LIB_NOC(thread, mutex_lock,
[
AC_DEFINE(HAVE_LIBTHREAD,1)
dnl Check if the compiler will build with -mt as a option, this is a solaris thing
AC_CHECK_COMP_OPT(mt)
AC_DEFINE(_REENTRANT)
gotthread="yes";
THREADLIB="-lthread"
])
fi
if test "x$gotthread" = "xno"; then
AC_CHECK_LIBPT_NOC(pthread, pthread_mutex_lock,
[
AC_DEFINE(HAVE_LIBPTHREAD,1)
AC_DEFINE(_REENTRANT)
gotthread="yes";
THREADLIB="-lpthread"
if test "x$ac_cv_prog_gcc"="xyes"; then
dnl Check if the compiler will build with -pthread as a option
AC_CHECK_COMP_OPT(pthread)
else
dnl Check if the compiler will build with -mt as a option
AC_CHECK_COMP_OPT(mt)
fi
])
fi
if test "x$gotthread" = "xno"; then
AC_CHECK_LIBPT_NOC(c, pthread_mutex_lock,
[
AC_DEFINE(HAVE_LIBPTHREAD,1)
AC_DEFINE(_REENTRANT)
gotthread="yes";
THREADLIB=""
if test "x$ac_cv_prog_gcc"="xyes"; then
dnl Check if the compiler will build with -pthread as a option
AC_CHECK_COMP_OPT(pthread)
else
dnl Check if the compiler will build with -mt as a option
AC_CHECK_COMP_OPT(mt)
fi
])
fi
if test "x$gotthread" = "xno"; then
if test "x$ac_cv_prog_gcc"="xyes"; then
dnl This is for freebsd that needs -lpthread before it finds the lib
AC_CHECK_COMP_OPT(pthread)
AC_CHECK_LIBPT_NOC(c, pthread_mutex_lock,
[
AC_DEFINE(HAVE_LIBPTHREAD,1)
AC_DEFINE(_REENTRANT)
THREADLIB="-pthread -lc_r"
gotthread="yes";
])
fi
fi
dnl Check for AIX
if test "x$gotthread" = "xno"; then
SAVECFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -D_THREAD_SAFE -D_ALL_SOURCE -D_LONG_LONG"
AC_CHECK_LIBPT_NOC(pthread, pthread_mutex_lock,
[
AC_DEFINE(HAVE_LIBPTHREAD,1)
gotthread="yes";
THREADLIB="-lpthread"
])
CFLAGS="$SAVECFLAGS"
AC_DEFINE(_THREAD_SAFE)
AC_DEFINE(_ALL_SOURCE)
AC_DEFINE(_LONG_LONG)
fi
if test "x$gotthread" = "xyes"; then
dnl do not add a -lc because of this
save_LIBS=$LIBS
AC_CHECK_LIB(c, localtime_r, [AC_DEFINE(HAVE_LOCALTIME_R, 1)] )
LIBS=$save_LIBS
fi
fi
fi
case $host_os in
"darwin"*)
stats="false"
macosx="yes"
AC_DEFINE(OSXHEADER)
;;
sysv5Open*)
if test "x$THREADLIB" = "x"; then
LIBS="$LIBS $THREADLIB"
else
LIBS="$LIBS -Kthread"
fi
;;
*)
LIBS="$LIBS $THREADLIB"
;;
esac
if test "x$stats" = "xtrue"; then
AC_CHECK_FUNCS( ftok semget shmget semop snprintf,[],[stats=false])
fi
if test "x$stats" = "xtrue"; then
AC_CHECK_SEMUNDOO
AC_DEFINE(COLLECT_STATS)
fi
dnl I need to check for libsocket before testing X
AC_CHECK_LIB(socket, socket, [LIBSOCKET="-lsocket"]) dnl for Solaris
AC_SUBST(LIBSOCKET)
AC_CHECK_LIB(nsl, gethostbyname, [LIBNSL="-lnsl"]) dnl for Solaris
AC_SUBST(LIBNSL)
dnl
dnl BEGIN: check for qt (using qt.m4)...
dnl
FUN_CHECK_QT
dnl
dnl END: check for qt
dnl
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(malloc.h unistd.h pwd.h crypt.h limits.h synch.h strings.h string.h locale.h sys/malloc.h sys/types.h sys/sem.h stdarg.h varargs.h sys/time.h sys/timeb.h time.h )
dnl INCLUDES_COMMON="$INCLUDES_COMMON $USER_INCLUDES";
dnl AC_SUBST(all_includes)
dnl AC_SUBST(all_libraries)
dnl Export this so it can be used in an INCLUDES line in a Makefile.am...
AC_SUBST(INCLUDES_COMMON)
if test "x$fastvalidate" = "xtrue"; then
AC_DEFINE(FAST_HANDLE_VALIDATE)
fi
if test "x$handlemap" = "xtrue"; then
AC_DEFINE(WITH_HANDLE_REDIRECT)
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_TYPE_UID_T
AC_HEADER_DIRENT
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_VPRINTF
AC_CHECK_FUNCS( putenv socket strdup strstr setenv setlocale strchr )
dnl LIB_VERSION="1:0:1"
dnl AC_SUBST(LIB_VERSION)
dnl We use the following version format to make some qmake friendly code happy...
CFLAGS="$CFLAGS -DV_MAJOUR=1 -DV_MINOR=0 -DV_RELEASE=1"
CXXFLAGS="$CXXFLAGS -DV_MAJOUR=1 -DV_MINOR=0 -DV_RELEASE=1"
AC_OUTPUT( Makefile \
ini/Makefile \
odbcinstQ4/Makefile \
gtrtstQ4/Makefile \
ODBCCreateDataSourceQ4/Makefile \
ODBCManageDataSourcesQ4/Makefile \
ODBCTestQ4/Makefile
)