nxhttpd traces removed
[public/netxms.git] / configure.ac
1 # $Id$
2 #
3 # NetXMS - Network Management System
4 # Configure script
5 #
6
7 AC_INIT([NetXMS], [1.2.1], [bugs@netxms.org])
8 AC_CONFIG_AUX_DIR(config)
9 AM_CONFIG_HEADER(config.h)
10 AM_INIT_AUTOMAKE
11 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
12
13 AC_CONFIG_MACRO_DIR([m4])
14
15 #--------------------------------------------------------------------
16 # Functions
17 #--------------------------------------------------------------------
18
19 check_substr()
20 {
21 for w in $1; do
22 if test "x$w" = "x$2"; then
23 return 0;
24 fi
25 done
26 return 1
27 }
28
29
30 #--------------------------------------------------------------------
31 # Initialize variables
32 #--------------------------------------------------------------------
33
34 PLATFORM=`uname -s`
35 COMPONENTS=""
36 DISABLE_ICONV="no"
37 DISABLE_ENCRYPTION="no"
38 ENABLE_DEBUG="no"
39 STATIC_BUILD="no"
40 ALL_STATIC="no"
41 DBDRIVER_SELECTED="no"
42 USE_PTH="no"
43 BUILD_SERVER="no"
44 BUILD_AGENT="no"
45 BUILD_CLIENT="no"
46 BUILD_STATIC_AGENT="no"
47 NEED_ZLIB="no"
48 MODULES="libnetxms tools install"
49 STATIC_SUBAGENT_LIST=""
50 PROPOSED_STATIC_SUBAGENTS="default"
51 SUBAGENT_DIRS=""
52 SUBAGENT_LIBS=""
53 SERVER_TOOLS=""
54 TOP_LEVEL_MODULES=""
55 CONTRIB_MODULES=""
56 CLIENT_COMPONENTS=""
57 BUILD_UNICODE="no"
58 ORACLE_LIBS=""
59 PGSQL_LIBS=""
60 MYSQL_LIBS=""
61 ODBC_LIBS=""
62 FORCE_INTERNAL_EXPAT="no"
63 USE_INTERNAL_LIBTRE="no"
64 FORCE_INTERNAL_LIBTRE="no"
65 USE_INTERNAL_ZLIB="no"
66 FORCE_INTERNAL_ZLIB="no"
67 FORCE_32BIT_BUILD="no"
68 FORCE_INTERNAL_GETOPT="no"
69 LDFLAGS_PREFIX=""
70 LDFLAGS_SUFFIX=""
71 LTINIT_CC=""
72 LTINIT_CXX=""
73
74
75 #--------------------------------------------------------------------
76 # Common compilation flags
77 #--------------------------------------------------------------------
78
79 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
80
81
82 #--------------------------------------------------------------------
83 # Parse command line parameters
84 #--------------------------------------------------------------------
85
86 AC_ARG_WITH(server,
87 [AS_HELP_STRING(--with-server,build server)],
88 [
89 COMPONENTS="$COMPONENTS sqlite snmp server agent"
90 ])
91
92 AC_ARG_WITH(snmp,
93 [AS_HELP_STRING(--with-snmp,build SNMP library and tools)],
94 [
95 COMPONENTS="$COMPONENTS snmp"
96 ])
97
98 AC_ARG_WITH(client,
99 [AS_HELP_STRING(--with-client,build client library and tools)],
100 [
101 COMPONENTS="$COMPONENTS client"
102 ])
103
104 AC_ARG_WITH(agent,
105 [AS_HELP_STRING(--with-agent,build agent)],
106 [
107 COMPONENTS="$COMPONENTS sqlite agent"
108 ])
109
110 AC_ARG_WITH(static-agent,
111 [AS_HELP_STRING(--with-static-agent,build statically linked agent)],
112 [
113 COMPONENTS="$COMPONENTS sqlite static-agent"
114 ])
115
116 AC_ARG_WITH(ipso-agent,
117 [AS_HELP_STRING(--with-ipso-agent,build statically linked IPSO agent)],
118 [
119 COMPONENTS="$COMPONENTS ipso-agent"
120 ])
121
122 AC_ARG_WITH(mdebug,
123 [AS_HELP_STRING(--with-mdebug,use debug version of memory allocation functions)],
124 [
125 CPPFLAGS="$CPPFLAGS -DNETXMS_MEMORY_DEBUG"
126 ])
127
128 AC_ARG_WITH(internal-libexpat,
129 [AS_HELP_STRING(--with-internal-libexpat,force use of bundled libexpat)],
130 [
131 FORCE_INTERNAL_EXPAT="yes"
132 ])
133
134 AC_ARG_WITH(internal-libtre,
135 [AS_HELP_STRING(--with-internal-libtre,force use of bundled libtre)],
136 [
137 FORCE_INTERNAL_LIBTRE="yes"
138 ])
139
140 AC_ARG_WITH(internal-zlib,
141 [AS_HELP_STRING(--with-internal-zlib,force use of bundled zlib)],
142 [
143 FORCE_INTERNAL_ZLIB="yes"
144 ])
145
146 AC_ARG_WITH(internal-getopt,
147 [AS_HELP_STRING(--with-internal-getopt,force use of bundled getopt)],
148 [
149 FORCE_INTERNAL_GETOPT="yes"
150 ])
151
152 AC_ARG_WITH(all-static,
153 [AS_HELP_STRING(--with-all-static,use -all-static flag for linking executables)],
154 [
155 ALL_STATIC="yes"
156 ])
157
158 AC_ARG_WITH(static-subagents,
159 [AS_HELP_STRING(--with-static-subagents=list,define list of static subagents (separated by spaces))],
160 [
161 PROPOSED_STATIC_SUBAGENTS="$withval"
162 ])
163
164 AC_ARG_WITH(sqlite,
165 [AS_HELP_STRING(--with-sqlite,build SQLite database driver)],
166 [ if test "x$withval" != "xno" ; then
167 COMPONENTS="$COMPONENTS sqlite_drv"
168 DBDRIVER_SELECTED="yes"
169 fi ])
170
171 AC_ARG_WITH(odbc,
172 [AS_HELP_STRING(--with-odbc,build ODBC database driver)],
173 [ if test "x$withval" != "xno" ; then
174 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
175 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
176 LDFLAGS="$LDFLAGS -L${withval}/lib"
177 CPPFLAGS="$CPPFLAGS -I${withval}/include"
178 fi
179 COMPONENTS="$COMPONENTS odbc"
180 DBDRIVER_SELECTED="yes"
181 fi ])
182
183 AC_ARG_WITH(oracle,
184 [AS_HELP_STRING(--with-oracle,build Oracle database driver)],
185 [ if test "x$withval" != "xno" ; then
186 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
187 if test -x "$withval/lib" ; then
188 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
189 LDFLAGS="$LDFLAGS -L${withval}/lib"
190 else
191 LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
192 LDFLAGS="$LDFLAGS -L${withval}"
193 fi
194 if test -x "$withval/include" ; then
195 CPPFLAGS="$CPPFLAGS -I${withval}/include"
196 fi
197 if test -x "$withval/sdk/include" ; then
198 CPPFLAGS="$CPPFLAGS -I${withval}/sdk/include"
199 fi
200 fi
201 COMPONENTS="$COMPONENTS oracle"
202 DBDRIVER_SELECTED="yes"
203 fi ])
204
205 AC_ARG_WITH(mysql,
206 [AS_HELP_STRING(--with-mysql,build MySQL database driver)],
207 [ if test "x$withval" != "xno" ; then
208 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
209 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
210 LDFLAGS="$LDFLAGS -L${withval}/lib -L${withval}/lib/mysql -L${withval}/mysql/lib"
211 CPPFLAGS="$CPPFLAGS -I${withval}/include -I${withval}/include/mysql -I${withval}/mysql/include"
212 else
213 LD_RUN_PATH="/usr/local/mysql/lib:/usr/local/mysql/lib/mysql:/usr/lib64/mysql:/usr/lib/mysql:/usr/mysql/lib:/usr/mysql/lib/mysql:/usr/local/lib/mysql:${LD_RUN_PATH:+:}${LD_RUN_PATH}"
214 LDFLAGS="$LDFLAGS -L/usr/local/mysql/lib -L/usr/lib64/mysql -L/usr/lib/mysql -L/usr/mysql/lib -L/usr/local/lib/mysql -L/usr/local/mysql/lib/mysql -L/usr/mysql/lib/mysql"
215 CPPFLAGS="$CPPFLAGS -I/usr/local/mysql/include -I/usr/include/mysql -I/usr/mysql/include -I/usr/local/include/mysql -I/usr/local/mysql/include/mysql -I/usr/mysql/include/mysql"
216 fi
217 COMPONENTS="$COMPONENTS mysql"
218 DBDRIVER_SELECTED="yes"
219 fi ])
220
221 AC_ARG_WITH(pgsql,
222 [AS_HELP_STRING(--with-pgsql,build PostgreSQL database driver)],
223 [ if test "x$withval" != "xno" ; then
224 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
225 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
226 LDFLAGS="$LDFLAGS -L${withval}/lib -L${withval}/lib/pgsql -L${withval}/lib/postgresql -L${withval}/pgsql/lib -L${withval}/postgresql/lib"
227 CPPFLAGS="$CPPFLAGS -I${withval}/include -I${withval}/include/pgsql -I${withval}/include/postgresql -I${withval}/pgsql/include -I${withval}/postgresql/include"
228 else
229 LD_RUN_PATH="/usr/local/pgsql/lib:/usr/local/pgsql/lib/pgsql:/usr/lib64/pgsql:/usr/lib/pgsql:/usr/pgsql/lib:/usr/pgsql/lib/pgsql:/usr/local/lib/pgsql:/usr/local/postgresql/lib:/usr/local/postgresql/lib/postgresql:/usr/lib/postgresql:/usr/postgresql/lib:/usr/postgresql/lib/postgresql:/usr/local/lib/postgresql:${LD_RUN_PATH:+:}${LD_RUN_PATH}"
230 LDFLAGS="$LDFLAGS -L/usr/local/pgsql/lib -L/usr/lib64/pgsql -L/usr/lib/pgsql -L/usr/pgsql/lib -L/usr/local/lib/pgsql -L/usr/local/pgsql/lib/pgsql -L/usr/pgsql/lib/pgsql -L/usr/local/postgresql/lib -L/usr/lib/postgresql -L/usr/postgresql/lib -L/usr/local/lib/postgresql -L/usr/local/postgresql/lib/postgresql -L/usr/postgresql/lib/postgresql"
231 CPPFLAGS="$CPPFLAGS -I/usr/local/pgsql/include -I/usr/include/pgsql -I/usr/pgsql/include -I/usr/local/include/pgsql -I/usr/local/pgsql/include/pgsql -I/usr/pgsql/include/pgsql -I/usr/local/postgresql/include -I/usr/include/postgresql -I/usr/postgresql/include -I/usr/local/include/postgresql -I/usr/local/postgresql/include/postgresql -I/usr/postgresql/include/postgresql"
232 fi
233 COMPONENTS="$COMPONENTS pgsql"
234 DBDRIVER_SELECTED="yes"
235 fi ])
236
237 AC_ARG_WITH(db2,
238 [AS_HELP_STRING(--with-db2,build DB2 database driver)],
239 [ if test "x$withval" != "xno" ; then
240 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
241 if test `uname -m` = 'i386' || test `uname -m` = 'i686'; then
242 DB2_LIB_DIR=lib32
243 else
244 DB2_LIB_DIR=lib64
245 fi
246 if test -x "$withval/${DB2_LIB_DIR}" ; then
247 LD_RUN_PATH="${withval}/${DB2_LIB_DIR}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
248 LDFLAGS="$LDFLAGS -L${withval}/${DB2_LIB_DIR}"
249 else
250 LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
251 LDFLAGS="$LDFLAGS -L${withval}"
252 fi
253 if test -x "$withval/include" ; then
254 CPPFLAGS="$CPPFLAGS -I${withval}/include"
255 fi
256
257 unset DB2_LIB_DIR
258 fi
259 COMPONENTS="$COMPONENTS db2"
260 DBDRIVER_SELECTED="yes"
261 fi ])
262
263 AC_ARG_WITH(informix,
264 [AS_HELP_STRING(--with-informix,build Informix database driver)],
265 [ if test "x$withval" != "xno" ; then
266 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
267 if test -x "$withval/lib/cli" ; then
268 LD_RUN_PATH="${withval}/lib/cli${LD_RUN_PATH:+:}${LD_RUN_PATH}"
269 LDFLAGS="$LDFLAGS -L${withval}/lib/cli"
270 if test -x "$withval/lib/esql" ; then
271 LD_RUN_PATH="${withval}/lib/esql${LD_RUN_PATH:+:}${LD_RUN_PATH}"
272 LDFLAGS="$LDFLAGS -L${withval}/lib/esql"
273 fi
274 else
275 LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
276 LDFLAGS="$LDFLAGS -L${withval}"
277 fi
278 if test -x "$withval/incl/cli" ; then
279 CPPFLAGS="$CPPFLAGS -I${withval}/incl/cli"
280 fi
281 fi
282 COMPONENTS="$COMPONENTS informix"
283 DBDRIVER_SELECTED="yes"
284 fi ])
285
286 AC_ARG_WITH(openssl,
287 [AS_HELP_STRING(--with-openssl,specify OpenSSL location)],
288 [
289 if test "x$withval" != "xno" ; then
290 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
291 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
292 LDFLAGS="$LDFLAGS -L${withval}/lib"
293 CPPFLAGS="$CPPFLAGS -I${withval}/include"
294 else
295 LD_RUN_PATH="/usr/local/lib:/opt/openssl/lib:/usr/local/ssl/lib:${LD_RUN_PATH:+:}${LD_RUN_PATH}"
296 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/opt/openssl/lib"
297 CPPFLAGS="$CPPFLAGS -I/opt/openssl/include"
298 fi
299 fi
300 REQUIRE_ENCRYPTION="yes"
301 ])
302
303 AC_ARG_WITH(gd,
304 [AS_HELP_STRING(--with-gd,specify GD location)],
305 [
306 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
307 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
308 LDFLAGS="$LDFLAGS -L${withval}/lib"
309 CPPFLAGS="$CPPFLAGS -I${withval}/include"
310 fi
311 ])
312
313 AC_ARG_ENABLE(iconv,
314 [AS_HELP_STRING(--disable-iconv,do not use iconv() for text conversions)],
315 [
316 DISABLE_ICONV="yes"
317 ])
318
319 AC_ARG_ENABLE(encryption,
320 [AS_HELP_STRING(--disable-encryption,disable encryption support)],
321 [
322 DISABLE_ENCRYPTION="yes"
323 ])
324
325 AC_ARG_ENABLE(unicode,
326 [AS_HELP_STRING(--enable-unicode,enable UNICODE build)],
327 [
328 BUILD_UNICODE="yes"
329 CPPFLAGS="$CPPFLAGS -DUNICODE"
330 ])
331
332 AC_ARG_ENABLE(debug,
333 [AS_HELP_STRING(--enable-debug,enable additional debugging functionality)],
334 [
335 ENABLE_DEBUG="yes"
336 ])
337
338 AC_ARG_ENABLE(64bit,
339 [AS_HELP_STRING(--disable-64bit,disable 64bit build (force 32bit build event on 64bit machine))],
340 [
341 FORCE_32BIT_BUILD="yes"
342 ])
343
344 AC_ARG_WITH(dist,
345 [AS_HELP_STRING(--with-dist,for maintainers only)],
346 DB_DRIVERS=" mysql pgsql odbc mssql sqlite oracle db2 informix"
347 MODULES="libexpat libtre zlib libnetxms install sqlite snmp libnxsl libnxlp db server agent libnxmap libnxcl client nxscript tools"
348 SUBAGENT_DIRS="linux freebsd openbsd netbsd sunos aix ipso hpux odbcquery informix oracle"
349 NXCONFIG="nxconfig"
350 TOP_LEVEL_MODULES="sql images"
351 CONTRIB_MODULES="mibs backgrounds"
352 CLIENT_COMPONENTS="nxalarm nxevent nxlexer nxpush nxsms scilexer windows"
353 SERVER_TOOLS="nxconfig"
354 )
355
356
357 #--------------------------------------------------------------------
358 # Validate command line parameters and set various checking options
359 #--------------------------------------------------------------------
360
361 check_substr "$COMPONENTS" "sqlite"
362 if test $? = 0; then
363 MODULES="$MODULES sqlite"
364 fi
365
366 check_substr "$COMPONENTS" "static-agent"
367 if test $? = 0; then
368 if test "x$COMPONENTS" != "x sqlite static-agent"; then
369 AC_MSG_ERROR(Static agent and other components are mutually exclusive.)
370 fi
371 STATIC_BUILD="yes"
372 BUILD_STATIC_AGENT="yes"
373 MODULES="$MODULES libnxlp agent"
374 DISABLE_ICONV="yes"
375 CPPFLAGS="$CPPFLAGS -D_STATIC_AGENT"
376 if test "x$PROPOSED_STATIC_SUBAGENTS" = "xdefault"; then
377 STATIC_SUBAGENT_LIST="ecs logwatch ping portcheck ups"
378 else
379 STATIC_SUBAGENT_LIST="$PROPOSED_STATIC_SUBAGENTS"
380 fi
381 SUBAGENT_LIBS="../subagents/ecs/ecs.la ../subagents/logwatch/logwatch.la ../subagents/ping/ping.la ../subagents/portCheck/portcheck.la ../subagents/ups/ups.la"
382
383 case "$PLATFORM" in
384 Linux)
385 SUBAGENT_DIRS="linux"
386 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/linux/linux.la"
387 STATIC_SUBAGENT_LIST="linux $STATIC_SUBAGENT_LIST"
388 ;;
389 FreeBSD)
390 SUBAGENT_DIRS="freebsd"
391 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/freebsd/freebsd.la"
392 STATIC_SUBAGENT_LIST="freebsd $STATIC_SUBAGENT_LIST"
393 ;;
394 OpenBSD)
395 SUBAGENT_DIRS="openbsd"
396 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/openbsd/openbsd.la"
397 STATIC_SUBAGENT_LIST="openbsd $STATIC_SUBAGENT_LIST"
398 ;;
399 NetBSD)
400 SUBAGENT_DIRS="netbsd"
401 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/netbsd/netbsd.la"
402 STATIC_SUBAGENT_LIST="netbsd $STATIC_SUBAGENT_LIST"
403 ;;
404 SunOS)
405 SUBAGENT_DIRS="sunos"
406 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/sunos/sunos.la"
407 STATIC_SUBAGENT_LIST="sunos $STATIC_SUBAGENT_LIST"
408 ;;
409 AIX)
410 SUBAGENT_DIRS="aix"
411 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/aix/aix.la"
412 STATIC_SUBAGENT_LIST="aix $STATIC_SUBAGENT_LIST"
413 ;;
414 HP-UX)
415 SUBAGENT_DIRS="hpux"
416 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/hpux/hpux.la"
417 STATIC_SUBAGENT_LIST="hpux $STATIC_SUBAGENT_LIST"
418 ;;
419 *)
420 # unknown
421 ;;
422 esac
423 fi
424
425 check_substr "$COMPONENTS" "ipso-agent"
426 if test $? = 0; then
427 if test "x$COMPONENTS" != "x ipso-agent"; then
428 AC_MSG_ERROR(IPSO agent and other components are mutually exclusive.)
429 fi
430 STATIC_BUILD="yes"
431 BUILD_STATIC_AGENT="yes"
432 DISABLE_ICONV="yes"
433 USE_PTH="yes"
434 MODULES="$MODULES libnxlp agent"
435 CPPFLAGS="$CPPFLAGS -D_STATIC_AGENT -D_IPSO -D_USE_GNU_PTH -DSQLITE_THREADSAFE=0 -I/usr/local/include"
436 LDFLAGS="$LDFLAGS -all-static"
437 STATIC_SUBAGENT_LIST="ecs ipso logwatch ping portcheck ups"
438 SUBAGENT_DIRS="ipso"
439 SUBAGENT_LIBS="../subagents/ecs/ecs.la ../subagents/ipso/ipso.la ../subagents/logwatch/logwatch.la ../subagents/ping/ping.la ../subagents/portCheck/portcheck.la ../subagents/ups/ups.la"
440 fi
441
442 check_substr "$COMPONENTS" "snmp"
443 if test $? = 0; then
444 NEED_ZLIB="yes"
445 MODULES="$MODULES snmp"
446 fi
447
448 check_substr "$COMPONENTS" "server"
449 if test $? = 0; then
450 if test "x$DBDRIVER_SELECTED" != "xyes"; then
451 AC_MSG_ERROR(You must select at least one database driver when building server.)
452 fi
453 BUILD_SERVER="yes"
454 MODULES="$MODULES libnxmap libnxsl libnxlp db server nxscript"
455 TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES sql images"
456 CONTRIB_MODULES="$CONTRIB_MODULES mibs backgrounds"
457 fi
458
459 check_substr "$COMPONENTS" "client"
460 if test $? = 0; then
461 BUILD_CLIENT="yes"
462 NEED_ZLIB="yes"
463 MODULES="$MODULES libnxmap libnxcl client"
464 CLIENT_COMPONENTS="$CLIENT_COMPONENTS nxalarm nxevent nxpush nxsms"
465 fi
466
467 check_substr "$COMPONENTS" "agent"
468 if test $? = 0; then
469 BUILD_AGENT="yes"
470 MODULES="$MODULES libnxlp db agent"
471
472 case "$PLATFORM" in
473 Linux)
474 SUBAGENT_DIRS="linux"
475 ;;
476 FreeBSD)
477 SUBAGENT_DIRS="freebsd"
478 ;;
479 OpenBSD)
480 SUBAGENT_DIRS="openbsd"
481 ;;
482 NetBSD)
483 SUBAGENT_DIRS="netbsd"
484 ;;
485 SunOS)
486 SUBAGENT_DIRS="sunos"
487 ;;
488 AIX)
489 SUBAGENT_DIRS="aix"
490 ;;
491 HP-UX)
492 SUBAGENT_DIRS="hpux"
493 ;;
494 *)
495 # unknown
496 ;;
497 esac
498 fi
499
500 check_substr "$COMPONENTS" "mysql"
501 if test $? = 0; then
502 DB_DRIVERS="$DB_DRIVERS mysql"
503 fi
504
505 check_substr "$COMPONENTS" "pgsql"
506 if test $? = 0; then
507 DB_DRIVERS="$DB_DRIVERS pgsql"
508 fi
509
510 check_substr "$COMPONENTS" "sqlite_drv"
511 if test $? = 0; then
512 DB_DRIVERS="$DB_DRIVERS sqlite"
513 fi
514
515 check_substr "$COMPONENTS" "odbc"
516 if test $? = 0; then
517 DB_DRIVERS="$DB_DRIVERS odbc"
518 SUBAGENT_DIRS="$SUBAGENT_DIRS odbcquery"
519 fi
520
521 check_substr "$COMPONENTS" "oracle"
522 if test $? = 0; then
523 DB_DRIVERS="$DB_DRIVERS oracle"
524 SUBAGENT_DIRS="$SUBAGENT_DIRS oracle"
525 fi
526
527 check_substr "$COMPONENTS" "db2"
528 if test $? = 0; then
529 DB_DRIVERS="$DB_DRIVERS db2"
530 fi
531
532 check_substr "$COMPONENTS" "informix"
533 if test $? = 0; then
534 DB_DRIVERS="$DB_DRIVERS informix"
535 SUBAGENT_DIRS="$SUBAGENT_DIRS informix"
536 fi
537
538
539 #--------------------------------------------------------------------
540 # Check for programs
541 #--------------------------------------------------------------------
542
543 if test "x$PLATFORM" = "xHP-UX"; then
544 AC_CHECK_PROG([CCC], [aCC], [aCC])
545 fi
546 if test "x$PLATFORM" = "xAIX"; then
547 AC_CHECK_PROG([CCC], [xlC_r], [xlC_r])
548 fi
549 AC_PROG_CC(aCC xlC_r gcc cc cl)
550 AC_PROG_CPP
551 AC_PROG_CXX
552 if test "x$CXX" = "xg++"; then
553 AC_CHECK_PROG([GPLUSPLUS], [g++], [yes], [no])
554 if test "x$GPLUSPLUS" = "xno"; then
555 AC_MSG_ERROR([*** FATAL: Cannot find any usable C++ compiler])
556 fi
557 fi
558 AC_PROG_INSTALL
559 AC_PROG_LEX
560 AC_CHECK_PROGS(YACC,bison byacc,yacc)
561 AC_PROG_LN_S
562
563 AC_ARG_VAR(PERL,local path to the perl interpreter)
564 perl_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/perl/bin:/opt/perl/usr/bin:/opt/perl/usr/local/bin"
565 AC_PATH_PROG(PERL,perl,/usr/bin/env perl,$perl_possible_path)
566
567
568 #--------------------------------------------------------------------
569 # C/C++ capabilities
570 #--------------------------------------------------------------------
571
572 AC_C_CONST
573 AC_PROG_GCC_TRADITIONAL
574 AC_C_BIGENDIAN
575
576
577 #--------------------------------------------------------------------
578 # Platform-dependent settings
579 #--------------------------------------------------------------------
580
581 case "$PLATFORM" in
582 AIX)
583 LDFLAGS_PREFIX="-no-undefined -Wl,-brtl $LDFLAGS"
584 ;;
585 HP-UX)
586 CPPFLAGS="$CPPFLAGS -D_HPUX -D_HPUX_SOURCE -D_POSIX_PTHREAD_SEMANTICS -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED=1 -D_REENTRANT -D_INCLUDE_LONGLONG"
587 if test "x$CXX" = "xaCC"; then
588 CFLAGS="$CFLAGS -AC99"
589 CXXFLAGS="-mt $CXXFLAGS +W749 +W829"
590 LDFLAGS="$LDFLAGS -mt"
591 fi
592 ;;
593 SunOS)
594 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
595 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
596 export LD_LIBRARY_PATH
597 ;;
598 Linux)
599 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
600 ;;
601 *)
602 ;;
603 esac
604
605
606 #--------------------------------------------------------------------
607 # C++ compiler tuning:
608 # * Disable C++ exceptions and RTTI
609 # * Turn on 64bit mode on HP-UX/Itanium
610 # * Turn on 64bit mode on AIX
611 #--------------------------------------------------------------------
612
613 if test "x$CC" = "xgcc" ; then
614
615 AC_LANG_PUSH([C++])
616
617 AC_MSG_CHECKING(whether C++ compiler accepts -fno-rtti)
618 OLD_CXXFLAGS="$CXXFLAGS"
619 CXXFLAGS="$CXXFLAGS -fno-rtti"
620 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
621 [ AC_MSG_RESULT(yes) ],
622 [
623 CXXFLAGS="$OLD_CXXFLAGS"
624 AC_MSG_RESULT(no)
625 ])
626
627 AC_MSG_CHECKING(whether C++ compiler accepts -fno-exceptions)
628 OLD_CXXFLAGS="$CXXFLAGS"
629 CXXFLAGS="$CXXFLAGS -fno-exceptions"
630 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
631 [ AC_MSG_RESULT(yes) ],
632 [
633 CXXFLAGS="$OLD_CXXFLAGS"
634 AC_MSG_RESULT(no)
635 ])
636
637 AC_LANG_POP([C++])
638
639 #AC_MSG_CHECKING(whether C compiler accepts -Wno-unused-result)
640 #OLD_CPPFLAGS="$CPPFLAGS"
641 #CPPFLAGS="$CPPFLAGS -Wno-unused-result"
642 #AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
643 # [ AC_MSG_RESULT(yes) ],
644 # [
645 # CPPFLAGS="$OLD_CPPFLAGS"
646 # AC_MSG_RESULT(no)
647 # ])
648
649 if test "x$PLATFORM" = "xHP-UX"; then
650 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
651 AC_MSG_CHECKING(whether C compiler accepts -milp32)
652 OLD_CPPFLAGS="$CPPFLAGS"
653 CPPFLAGS="$CPPFLAGS -milp32"
654 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
655 [
656 LDFLAGS="-milp32 $LDFLAGS"
657 AC_MSG_RESULT(yes)
658 ],
659 [
660 CPPFLAGS="$OLD_CPPFLAGS"
661 AC_MSG_RESULT(no)
662 ])
663 else
664 AC_MSG_CHECKING(whether C compiler accepts -mlp64)
665 OLD_CPPFLAGS="$CPPFLAGS"
666 CPPFLAGS="$CPPFLAGS -mlp64"
667 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
668 [
669 LDFLAGS="-mlp64 -L/usr/lib/hpux64 -L/usr/local/lib/hpux64 $LDFLAGS"
670 AC_MSG_RESULT(yes)
671 ],
672 [
673 CPPFLAGS="$OLD_CPPFLAGS"
674 AC_MSG_RESULT(no)
675 ])
676 fi
677 fi
678
679 if test "x$PLATFORM" = "xAIX"; then
680 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
681 AC_MSG_CHECKING(whether C compiler accepts -maix32)
682 OLD_CPPFLAGS="$CPPFLAGS"
683 CPPFLAGS="$CPPFLAGS -maix32"
684 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
685 [
686 LDFLAGS="-maix32 $LDFLAGS"
687 LTINIT_CC="gcc -maix32"
688 LTINIT_CXX="g++ -maix32"
689 OBJECT_MODE=32
690 AC_MSG_RESULT(yes)
691 ],
692 [
693 CPPFLAGS="$OLD_CPPFLAGS"
694 AC_MSG_RESULT(no)
695 ])
696 else
697 AC_MSG_CHECKING(whether C compiler accepts -maix64)
698 OLD_CPPFLAGS="$CPPFLAGS"
699 CPPFLAGS="$CPPFLAGS -maix64"
700 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
701 [
702 LDFLAGS="-maix64 $LDFLAGS"
703 LTINIT_CC="gcc -maix64"
704 LTINIT_CXX="g++ -maix64"
705 OBJECT_MODE=64
706 AC_MSG_RESULT(yes)
707 ],
708 [
709 CPPFLAGS="$OLD_CPPFLAGS"
710 AC_MSG_RESULT(no)
711 ])
712 fi
713 fi
714
715 if test "x$ENABLE_DEBUG" = "xyes"; then
716 CPPFLAGS="$CPPFLAGS -ggdb3"
717 fi
718 fi
719
720 if test "x$CXX" = "xaCC" ; then
721 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
722 AC_MSG_CHECKING(whether C compiler accepts +DD32)
723 OLD_CPPFLAGS="$CPPFLAGS"
724 CPPFLAGS="+DD32 $CPPFLAGS"
725 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
726 [
727 LDFLAGS="+DD32 $LDFLAGS"
728 AC_MSG_RESULT(yes)
729 ],
730 [
731 CPPFLAGS="$OLD_CPPFLAGS"
732 AC_MSG_RESULT(no)
733 ])
734 else
735 AC_MSG_CHECKING(whether C compiler accepts +DD64)
736 OLD_CPPFLAGS="$CPPFLAGS"
737 CPPFLAGS="+DD64 $CPPFLAGS"
738 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
739 [
740 LDFLAGS="+DD64 $LDFLAGS"
741 AC_MSG_RESULT(yes)
742 ],
743 [
744 CPPFLAGS="$OLD_CPPFLAGS"
745 AC_MSG_RESULT(no)
746 ])
747 fi
748 fi
749
750 if test "x$CXX" = "xxlC_r" ; then
751 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
752 AC_MSG_CHECKING(whether C compiler accepts -q32)
753 OLD_CPPFLAGS="$CPPFLAGS"
754 CPPFLAGS="-q32 $CPPFLAGS"
755 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
756 [
757 LDFLAGS="-q32 $LDFLAGS"
758 OBJECT_MODE=32
759 AC_MSG_RESULT(yes)
760 ],
761 [
762 CPPFLAGS="$OLD_CPPFLAGS"
763 AC_MSG_RESULT(no)
764 ])
765 else
766 AC_MSG_CHECKING(whether C compiler accepts -q64)
767 OLD_CPPFLAGS="$CPPFLAGS"
768 CPPFLAGS="-q64 $CPPFLAGS"
769 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
770 [
771 LDFLAGS="-q64 $LDFLAGS"
772 OBJECT_MODE=64
773 AC_MSG_RESULT(yes)
774 ],
775 [
776 CPPFLAGS="$OLD_CPPFLAGS"
777 AC_MSG_RESULT(no)
778 ])
779 fi
780 fi
781
782
783 #--------------------------------------------------------------------
784 # Initialize libtool
785 #--------------------------------------------------------------------
786
787 if test "x$STATIC_BUILD" = "xyes"; then
788 enable_shared=no
789 enable_static=yes
790 else
791 enable_shared=yes
792 enable_static=no
793 fi
794
795 if test "x$LTINIT_CC" != "x"; then
796 SAVED_CC="$CC"
797 CC="$LTINIT_CC"
798 fi
799 if test "x$LTINIT_CXX" != "x"; then
800 SAVED_CXX="$CXX"
801 CXX="$LTINIT_CXX"
802 fi
803
804 LT_PREREQ([2.2])
805 LT_INIT([dlopen])
806
807 if test "x$SAVED_CC" != "x"; then
808 CC="$SAVED_CC"
809 fi
810 if test "x$SAVED_CXX" != "x"; then
811 CXX="$SAVED_CXX"
812 fi
813
814
815 #--------------------------------------------------------------------
816 # Additional include and library directories
817 #--------------------------------------------------------------------
818
819 if test "x$CXX" != "xaCC"; then
820 if test -d /usr/local/include; then
821 if test "x$CC" = "xgcc"; then
822 AC_MSG_CHECKING(whether -I/usr/local/include needed)
823 OLD_CPPFLAGS="$CPPFLAGS"
824 CPPFLAGS="$CPPFLAGS -Werror -I/usr/local/include"
825 AC_TRY_COMPILE([],[],
826 [
827 CPPFLAGS="$OLD_CPPFLAGS -I/usr/local/include"
828 AC_MSG_RESULT(yes)
829 ],
830 [
831 CPPFLAGS="$OLD_CPPFLAGS"
832 AC_MSG_RESULT(no)
833 ]
834 )
835 else
836 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
837 fi
838 fi
839
840 if test -d /usr/kerberos/include; then
841 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
842 fi
843
844 if test -d /usr/local/lib; then
845 LDFLAGS="$LDFLAGS -L/usr/local/lib"
846 fi
847 fi
848
849 #--------------------------------------------------------------------
850 # Check for threads library - either POSIX or GNU
851 #--------------------------------------------------------------------
852
853 if test "x$USE_PTH" = "xyes"; then
854 AC_CHECK_HEADER(pth.h,,AC_MSG_ERROR([*** GNU Pth thread support not installed - please install first ***]))
855 else
856 AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed - please install first ***]))
857
858 if test "x$CXX" = "xaCC"; then
859 PTHREAD_LIBS=""
860 else
861 PTHREAD_LIBS="error"
862 AC_MSG_CHECKING(for old style FreeBSD -pthread flag)
863 AC_EGREP_CPP(yes,
864 [#if defined(__FreeBSD_cc_version) || defined(__OpenBSD__)
865 yes
866 #endif
867 ], AC_MSG_RESULT(yes)
868 PTHREAD_LIBS="-pthread",
869 AC_MSG_RESULT(no))
870 if test "x$PTHREAD_LIBS" = "xerror"; then
871 AC_CHECK_LIB(pthread, pthread_attr_init,
872 PTHREAD_LIBS="-lpthread")
873 fi
874 # On HP-UX (at least 11.00) pthread library contains
875 # __pthread_attr_init_system instead of pthread_attr_init
876 if test "x$PTHREAD_LIBS" = "xerror"; then
877 AC_CHECK_LIB(pthread, __pthread_attr_init_system,
878 PTHREAD_LIBS="-lpthread")
879 fi
880 if test "x$PTHREAD_LIBS" = "xerror"; then
881 AC_CHECK_LIB(pthreads, pthread_attr_init,
882 PTHREAD_LIBS="-lpthreads")
883 fi
884 if test "x$PTHREAD_LIBS" = "xerror"; then
885 AC_CHECK_FUNC(pthread_attr_init,
886 PTHREAD_LIBS="")
887 fi
888 fi
889
890 if test "x$PTHREAD_LIBS" = "xerror"; then
891 AC_MSG_ERROR(*** Unable to locate working posix thread library ***)
892 fi
893 LIBS="$LIBS $PTHREAD_LIBS"
894
895 # Extensions to posix threads
896 AC_CHECK_HEADERS([pthread_np.h],,,[
897 #include <pthread.h>
898 ])
899 AC_CHECK_FUNCS([pthread_cond_reltimedwait_np])
900
901 # Check for recursive mutexes
902 AC_CHECK_FUNCS([pthread_mutexattr_settype __pthread_mutexattr_settype pthread_mutexattr_setkind_np])
903 AC_CHECK_DECLS([pthread_mutexattr_settype, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_RECURSIVE_NP, MUTEX_TYPE_COUNTING_FAST],,,[
904 #include <pthread.h>
905 #if HAVE_PTHREAD_NP_H
906 #include <pthread_np.h>
907 #endif
908 ])
909
910 # Check for read/write locks
911 # On Linux, rwlock functions declared always, but pthread_rwlock_t may need
912 # additional defines
913 AC_CHECK_FUNCS([pthread_rwlock_init pthread_rwlock_timedrdlock pthread_rwlock_timedwrlock])
914 if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then
915 AC_CACHE_CHECK([for pthread_rwlock_t], ac_cv_struct_pthread_rw,
916 [AC_TRY_COMPILE([
917 #include <sys/types.h>
918 #include <pthread.h>
919 ],
920 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
921 ac_cv_struct_pthread_rw=yes, [
922 AC_TRY_COMPILE([
923 #define _XOPEN_SOURCE 500
924 #include <sys/types.h>
925 #include <pthread.h>
926 ],
927 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
928 ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
929 if test "$ac_cv_struct_pthread_rw" = "yes"; then
930 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
931 fi
932 ])])
933 if test "$ac_cv_struct_pthread_rw" = "yes"; then
934 AC_DEFINE(HAVE_PTHREAD_RWLOCK, 1, Define to 1 if you have working pthread read/write locks)
935 fi
936 fi
937
938 fi
939
940
941 #--------------------------------------------------------------------
942 # Checks for OpenSSL
943 #--------------------------------------------------------------------
944
945 if test "x$DISABLE_ENCRYPTION" != "xyes" ; then
946 AC_CHECK_LIB(crypto, RSA_new,
947 [
948 AC_DEFINE(WITH_OPENSSL,,[with openssl])
949 AC_CHECK_LIB(crypto, EVP_aes_256_cbc,
950 [], [AC_DEFINE(NETXMS_NO_AES,,[desc])])
951 AC_CHECK_LIB(crypto, EVP_bf_cbc,
952 [], [AC_DEFINE(NETXMS_NO_BF,,[desc])])
953 AC_CHECK_LIB(crypto, EVP_idea_cbc,
954 [], [AC_DEFINE(NETXMS_NO_IDEA,,[desc])])
955 AC_CHECK_LIB(crypto, EVP_des_ede3_cbc,
956 [], [AC_DEFINE(NETXMS_NO_DES,,[desc])])
957 ],
958 [
959 if test "x$REQUIRE_ENCRYPTION" = "xyes"; then
960 AC_MSG_ERROR(libcrypto is required for encryption support)
961 else
962 AC_MSG_RESULT(libcrypto is required for encryption support)
963 fi
964 ])
965 fi
966
967
968 #--------------------------------------------------------------------
969 # Checks for header files
970 #--------------------------------------------------------------------
971
972 AC_CHECK_HEADERS([sys/types.h sys/stat.h unistd.h stdarg.h fcntl.h alloca.h])
973 AC_CHECK_HEADERS([sys/int_types.h time.h sys/time.h sys/utsname.h sys/wait.h])
974 AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h net/nh.h sys/socket.h])
975 AC_CHECK_HEADERS([fcntl.h dirent.h sys/ioctl.h sys/sockio.h poll.h termios.h])
976 AC_CHECK_HEADERS([inttypes.h memory.h stdint.h stdlib.h strings.h string.h])
977 AC_CHECK_HEADERS([readline/readline.h byteswap.h sys/select.h dlfcn.h])
978 AC_CHECK_HEADERS([sys/sysctl.h sys/param.h sys/user.h vm/vm_param.h syslog.h])
979 AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h],,,
980 [[#ifdef HAVE_SYS_TYPES_H
981 # include <sys/types.h>
982 #endif
983 #ifdef HAVE_SYS_TIME_H
984 # include <sys/time.h>
985 #endif
986 #ifdef HAVE_SYS_SOCKET_H
987 # include <sys/socket.h>
988 #endif
989 ]])
990
991
992 #--------------------------------------------------------------------
993 # Checks for other libs.
994 #--------------------------------------------------------------------
995
996 AC_CHECK_LIB(xnet, accept)
997 AC_CHECK_LIB(socket, if_nameindex)
998 AC_CHECK_LIB(dl, dlopen)
999 AC_CHECK_LIB(kstat, kstat_open)
1000
1001 if test "x$BUILD_SERVER" = "xyes" ; then
1002 AC_CHECK_LIB(termcap, tgetstr, [], [AC_CHECK_LIB(ncurses, tgetstr, [], AC_CHECK_LIB(curses, tgetstr))])
1003 AC_CHECK_LIB(readline, readline, [], [AC_CHECK_LIB(edit, readline)])
1004 AC_CHECK_FUNCS([readline])
1005
1006 # Check if passing rl_insert to rl_bind_key needs cast
1007 if test "$ac_cv_func_readline" = "yes"; then
1008 AC_LANG_PUSH([C++])
1009
1010 AC_MSG_CHECKING(for rl_insert cast)
1011
1012 AC_TRY_COMPILE(
1013 [
1014 #include <stdio.h>
1015 #include <readline/readline.h>
1016 ],[ rl_bind_key('\t', (Function *)rl_insert); ],
1017 [
1018 AC_MSG_RESULT((Function *))
1019 AC_DEFINE(RL_INSERT_CAST,(Function *),Required cast for rl_insert)
1020 ],[
1021 AC_TRY_COMPILE(
1022 [
1023 #include <stdio.h>
1024 #include <readline/readline.h>
1025 ],[ rl_bind_key('\t', (rl_command_func_t *)rl_insert); ],
1026 [
1027 AC_MSG_RESULT((rl_command_func_t *))
1028 AC_DEFINE(RL_INSERT_CAST,(rl_command_func_t *),Required cast for rl_insert)
1029 ],[
1030 AC_MSG_RESULT(not needed)
1031 AC_DEFINE(RL_INSERT_CAST,,Required cast for rl_insert)
1032 ]
1033 )
1034 ]
1035 )
1036
1037 AC_LANG_POP([C++])
1038 fi
1039 fi
1040
1041 if test "x$NEED_ZLIB" = "xyes"; then
1042 if test "x$FORCE_INTERNAL_ZLIB" = "xyes"; then
1043 HAVE_ZLIB=no
1044 else
1045 HAVE_ZLIB=yes
1046 AC_CHECK_HEADER(zlib.h,,HAVE_ZLIB=no)
1047 if test "x$HAVE_ZLIB" = "xyes"; then
1048 AC_CHECK_LIB(z, deflate, [], [ HAVE_ZLIB=no ])
1049 fi
1050 fi
1051 if test "x$HAVE_ZLIB" = "xno"; then
1052 MODULES="zlib $MODULES"
1053 fi
1054 fi
1055
1056 if test "x$FORCE_INTERNAL_EXPAT" = "xyes"; then
1057 HAVE_LIBEXPAT=no
1058 else
1059 HAVE_LIBEXPAT=yes
1060 AC_CHECK_HEADER(expat.h,,HAVE_LIBEXPAT=no)
1061 AC_CHECK_LIB(expat, XML_Parse, [], [ HAVE_LIBEXPAT=no ])
1062 fi
1063 if test "x$HAVE_LIBEXPAT" = "xno"; then
1064 MODULES="libexpat $MODULES"
1065 fi
1066
1067 if test "x$FORCE_INTERNAL_LIBTRE" = "xyes"; then
1068 HAVE_LIBTRE=no
1069 else
1070 HAVE_LIBTRE=yes
1071 AC_CHECK_HEADER(tre/regex.h,,HAVE_LIBTRE=no)
1072 AC_CHECK_LIB(tre, tre_compile, [], [ HAVE_LIBTRE=no ])
1073 fi
1074 if test "x$HAVE_LIBTRE" = "xno"; then
1075 MODULES="libtre $MODULES"
1076 AC_DEFINE(USE_BUNDLED_LIBTRE,1,Define to 1 if bundled libtre is used)
1077
1078 tre_version_1='0'
1079 tre_version_2='8'
1080 tre_version_3='0'
1081 tre_version=$tre_version_1.$tre_version_2.$tre_version_3
1082 AC_DEFINE_UNQUOTED(TRE_VERSION, "$tre_version", [ TRE version string. ])
1083 AC_DEFINE_UNQUOTED(TRE_VERSION_1, $tre_version_1, [ TRE version level 1. ])
1084 AC_DEFINE_UNQUOTED(TRE_VERSION_2, $tre_version_2, [ TRE version level 2. ])
1085 AC_DEFINE_UNQUOTED(TRE_VERSION_3, $tre_version_3, [ TRE version level 3. ])
1086 AC_SUBST(TRE_VERSION, $tre_version)
1087
1088 AC_DEFINE(TRE_REGEX_T_FIELD,value,[Define to a field in the regex_t struct where TRE should store a pointer to the internal tre_tnfa_t structure])
1089 AC_DEFINE(TRE_APPROX, 1, [ Define if you want to enable approximate matching functionality. ])
1090 fi
1091
1092 #--------------------------------------------------------------------
1093 # Checks for data types
1094 #--------------------------------------------------------------------
1095
1096 AC_CHECK_SIZEOF(short)
1097 AC_CHECK_SIZEOF(int)
1098 AC_CHECK_SIZEOF(long)
1099 AC_CHECK_SIZEOF(long long)
1100
1101 AC_TYPE_PID_T
1102 AC_TYPE_SIGNAL
1103 AC_TYPE_SIZE_T
1104 AC_STRUCT_TIMEZONE
1105
1106 AC_CHECK_TYPES([long long, unsigned long long, int64_t, uint64_t, u_int64_t, uuid_t])
1107 AC_CHECK_TYPES([mode_t, off_t, socklen_t],,,[
1108 #if HAVE_SYS_TYPES_H
1109 #include <sys/types.h>
1110 #endif
1111 #if HAVE_SYS_SOCKET_H
1112 #include <sys/socket.h>
1113 #endif
1114 ])
1115 AC_CHECK_TYPES([struct stat64],,,[
1116 #if HAVE_SYS_STAT_H
1117 #include <sys/stat.h>
1118 #endif
1119 ])
1120
1121
1122 #--------------------------------------------------------------------
1123 # Checks for functions
1124 #--------------------------------------------------------------------
1125
1126 AC_FUNC_ERROR_AT_LINE
1127 AC_FUNC_MEMCMP
1128 AC_FUNC_SELECT_ARGTYPES
1129 AC_FUNC_STRFTIME
1130 AC_FUNC_STRTOD
1131 AC_FUNC_VPRINTF
1132
1133 AC_CHECK_FUNCS([gettimeofday memmove memset bcopy strchr strcspn strdup strerror])
1134 AC_CHECK_FUNCS([strrchr strtol strtoul strtoll strtoull])
1135 AC_CHECK_FUNCS([if_nametoindex daemon mmap strerror_r scandir uname poll])
1136 AC_CHECK_FUNCS([usleep nanosleep gmtime_r localtime_r lstat64])
1137
1138 AC_CHECK_DECLS([nanosleep])
1139
1140 # Check if strerror_r is POSIX-compliant
1141 if test "$ac_cv_func_strerror_r" = "yes"; then
1142 AC_MSG_CHECKING(if strerror_r is POSIX compliant)
1143 AC_LANG_PUSH([C++])
1144 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1145 #if HAVE_STRING_H
1146 #include <string.h>
1147 #endif
1148 #if HAVE_ERRNO_H
1149 #include <errno.h>
1150 #endif
1151 ]],[[
1152 int e;
1153 char buffer[256];
1154 e = strerror_r(1, buffer, 256);
1155 return e;
1156 ]])
1157 ],[
1158 AC_MSG_RESULT(yes)
1159 AC_DEFINE(HAVE_POSIX_STRERROR_R,1,Define to 1 if strerror_r function is POSIX compliant)
1160 ],[
1161 AC_MSG_RESULT(no)
1162 AC_DEFINE(HAVE_POSIX_STRERROR_R,0,Define to 1 if strerror_r function is POSIX compliant)
1163 ])
1164 AC_LANG_POP([C++])
1165 fi
1166
1167 # Check if timezone is a function
1168 AC_MSG_CHECKING(for timezone function)
1169 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1170 #if HAVE_TIME_H
1171 #include <time.h>
1172 #endif
1173 #if HAVE_SYS_TIME_H
1174 #include <sys/time.h>
1175 #endif
1176 ]],[[
1177 timezone(0, 0);
1178 ]])
1179 ],[
1180 AC_MSG_RESULT(yes)
1181 AC_DEFINE(HAVE_TIMEZONE,1,Define to 1 if timezone function is available)
1182 ],[
1183 AC_MSG_RESULT(no)
1184 AC_CHECK_DECLS([timezone],,,[
1185 #if HAVE_TIME_H
1186 #include <time.h>
1187 #endif
1188 #if HAVE_SYS_TIME_H
1189 #include <sys/time.h>
1190 #endif
1191 ])
1192 ])
1193
1194 # Check if struct tm has tm_gmtoff member
1195 AC_MSG_CHECKING(for struct tm.tm_gmtoff)
1196 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1197 #if HAVE_TIME_H
1198 #include <time.h>
1199 #endif
1200 #if HAVE_SYS_TIME_H
1201 #include <sys/time.h>
1202 #endif
1203 ]],[[
1204 struct tm t;
1205 return t.tm_gmtoff;
1206 ]])
1207 ],[
1208 AC_MSG_RESULT(yes)
1209 AC_DEFINE(HAVE_TM_GMTOFF,1,Define to 1 if struct tm has tm_gmtoff member)
1210 ],[
1211 AC_MSG_RESULT(no)
1212 ])
1213
1214 AC_CHECK_FUNCS([sysctlbyname sysctlnametomib])
1215 AC_CHECK_FUNCS([tcgetattr tcsetattr cfsetospeed cfsetispeed])
1216
1217 # sockets/resolver (probably for solaris)
1218 AC_CHECK_FUNC(connect, , [AC_CHECK_LIB(socket, connect)])
1219 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(resolv, gethostbyname)])
1220 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)])
1221
1222 if test "x$ac_cv_lib_nsl_gethostbyname" != "xyes" && test "x$ac_cv_func_gethostbyname" != "xyes" ; then
1223 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(socket, gethostbyname)])
1224 fi
1225
1226 if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname" ; then
1227 AC_MSG_CHECKING([if we can include libnsl + libsocket])
1228 LIBS="-lnsl -lsocket $LIBS"
1229 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void) gethostbyname]])],[my_ac_link_result=yes],[my_ac_link_result=no ])
1230 if test "$my_ac_link_result" = "no" ; then
1231 AC_MSG_RESULT([failure])
1232 AC_MSG_ERROR([unable to use gethostbyname()])
1233 else
1234 AC_MSG_RESULT([success])
1235 fi
1236 fi
1237
1238 # asprintf, scprintf, etc.
1239 AC_CHECK_FUNCS([asprintf aswprintf vasprintf vaswprintf])
1240 AC_CHECK_FUNCS([scprintf scwprintf vscprintf vscwprintf])
1241
1242 AC_MSG_CHECKING(whether snprintf returns required buffer size)
1243 AC_RUN_IFELSE(
1244 [AC_LANG_PROGRAM([
1245 #include <stdio.h>
1246 #include <string.h>
1247 ], [
1248 return !(snprintf(NULL, 0, "test: %d", 1000) >= 10);
1249 ])
1250 ],
1251 [ AC_MSG_RESULT(yes)
1252 AC_DEFINE(SNPRINTF_RETURNS_REQUIRED_SIZE, 1, Define to 1 if snprintf returns required buffer size in case of truncation)
1253 ],
1254 [ AC_MSG_RESULT(no) ],
1255 [ AC_MSG_RESULT(no) ]
1256 )
1257
1258
1259
1260 #--------------------------------------------------------------------
1261 # Checks for macros and definitions
1262 #--------------------------------------------------------------------
1263
1264 AC_CHECK_DECLS([__bswap_32, __bswap_64, htonll, ntohll],,,[
1265 #ifdef HAVE_SYS_TYPES_H
1266 #include <sys/types.h>
1267 #endif
1268 #if HAVE_BYTESWAP_H
1269 #include <byteswap.h>
1270 #endif
1271 #if HAVE_NETINET_IN_H
1272 #include <netinet/in.h>
1273 #endif
1274 #if HAVE_NET_NH_H
1275 #include <net/nh.h>
1276 #endif
1277 ])
1278 AC_CHECK_DECLS([RTLD_NOW, RTLD_GLOBAL],,,[
1279 #ifdef HAVE_UNISTD_H
1280 #include <unistd.h>
1281 #endif
1282 #ifdef HAVE_DLFCN_H
1283 #include <dlfcn.h>
1284 #endif
1285 ])
1286 AC_CHECK_DECLS([va_copy, __va_copy],,,[
1287 #ifdef HAVE_UNISTD_H
1288 #include <unistd.h>
1289 #endif
1290 #ifdef HAVE_STDARG_H
1291 #include <stdarg.h>
1292 #endif
1293 #ifdef HAVE_STDLIB_H
1294 #include <stdlib.h>
1295 #endif
1296 ])
1297
1298
1299 #--------------------------------------------------------------------
1300 # getopt
1301 #--------------------------------------------------------------------
1302
1303 if test "x$FORCE_INTERNAL_GETOPT" = "xyes"; then
1304 AC_DEFINE([USE_BUNDLED_GETOPT], [1], [Define to 1 if bundled getopt must be used])
1305 else
1306 AC_CHECK_HEADERS([getopt.h])
1307 AC_CHECK_LIB(gnugetopt, getopt_long)
1308 AC_CHECK_DECLS([getopt_long],,,[
1309 #if HAVE_GETOPT_H
1310 #include <getopt.h>
1311 #endif
1312 ])
1313 fi
1314
1315
1316 #--------------------------------------------------------------------
1317 # AIX specific checks
1318 #--------------------------------------------------------------------
1319
1320 if test "x$PLATFORM" = "xAIX"; then
1321 AC_CHECK_HEADERS([procinfo.h],,,[[ ]])
1322 AC_CHECK_DECLS([getkerninfo, getprocs, getprocs64],,,[
1323 #if HAVE_PROCINFO_H
1324 #include <procinfo.h>
1325 #endif
1326 ])
1327 AC_CHECK_FUNCS([getprocs64],,,[
1328 #if HAVE_PROCINFO_H
1329 #include <procinfo.h>
1330 #endif
1331 ])
1332 fi
1333
1334
1335 #--------------------------------------------------------------------
1336 # HP-UX specific checks
1337 #--------------------------------------------------------------------
1338
1339 if test "x$PLATFORM" = "xHP-UX"; then
1340 AC_CHECK_HEADERS([sys/mib.h],,,[[ ]])
1341 AC_CHECK_DECLS([SIOCGIFNAME, SIOCGIFINDEX],,,[
1342 #if HAVE_NET_IF_H
1343 #include <net/if.h>
1344 #endif
1345 ])
1346 AC_CHECK_DECLS([ID_ifXEntry, open_mib_64],,,[
1347 #if HAVE_SYS_MIB_H
1348 #include <sys/mib.h>
1349 #endif
1350 ])
1351
1352 AC_MSG_CHECKING(if pst_diskinfo has read/write stats fields)
1353 AC_LANG_PUSH([C++])
1354 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1355 #include <sys/pstat.h>
1356 ]], [[
1357 pst_diskinfo d;
1358 int x;
1359 x = (int)d.psd_dkread;
1360 x = (int)d.psd_dkwrite;
1361 ]])],
1362 [
1363 AC_DEFINE([HAVE_DISKINFO_RWSTATS],[1],[Define to 1 if pst_diskinfo has read/write stats fields])
1364 AC_MSG_RESULT(yes)
1365 ],
1366 [
1367 AC_MSG_RESULT(no)
1368 ])
1369 AC_LANG_POP([C++])
1370 fi
1371
1372
1373 #--------------------------------------------------------------------
1374 # *BSD specific checks
1375 #--------------------------------------------------------------------
1376
1377 AC_CHECK_LIB(kvm, kvm_open)
1378 AC_CHECK_FUNCS([kvm_getswapinfo])
1379 AC_CHECK_TYPES([struct kinfo_proc2],,,[
1380 #if HAVE_SYS_SYSCTL_H
1381 #include <sys/sysctl.h>
1382 #endif
1383 ])
1384
1385
1386 #--------------------------------------------------------------------
1387 # FreeBSD specific checks
1388 #--------------------------------------------------------------------
1389
1390 if test "x$PLATFORM" = "xFreeBSD"; then
1391 AC_CHECK_DECLS([RTF_WASCLONED],[],[],[
1392 #if HAVE_SYS_TYPES_H
1393 #include <sys/types.h>
1394 #endif
1395 #if HAVE_SYS_SOCKET_H
1396 #include <sys/socket.h>
1397 #endif
1398 #include <net/route.h>
1399 ])
1400 fi
1401
1402
1403 #--------------------------------------------------------------------
1404 # OpenBSD specific checks
1405 #--------------------------------------------------------------------
1406
1407 if test "x$PLATFORM" = "xOpenBSD"; then
1408 AC_MSG_CHECKING(if kvm_getprocs requires sizeof kinfo_proc argument)
1409 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1410 #include <sys/param.h>
1411 #include <sys/proc.h>
1412 #include <kvm.h>
1413 #include <sys/user.h>
1414 ]],[[
1415 int count;
1416 kvm_getprocs(NULL, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc), &count);
1417 return 0;
1418 ]])
1419 ],[
1420 AC_MSG_RESULT(yes)
1421 AC_DEFINE(KVM_GETPROCS_REQUIRES_SIZEOF,1,Define to 1 if kvm_getprocs requires sizeof kinfo_proc)
1422 ],[
1423 AC_MSG_RESULT(no)
1424 AC_DEFINE(KVM_GETPROCS_REQUIRES_SIZEOF,0,Define to 1 if kvm_getprocs requires sizeof kinfo_proc)
1425 ])
1426
1427 AC_MSG_CHECKING(if struct kinfo_proc has member kp_proc)
1428 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1429 #include <sys/param.h>
1430 #include <sys/proc.h>
1431 #include <kvm.h>
1432 #include <sys/user.h>
1433 ]],[[
1434 struct kinfo_proc p;
1435 return p.kp_proc.p_pid;
1436 ]])
1437 ],[
1438 AC_MSG_RESULT(yes)
1439 AC_DEFINE(KINFO_PROC_HAS_KP_PROC,1,Define to 1 if struct kinfo_proc has member kp_proc)
1440 ],[
1441 AC_MSG_RESULT(no)
1442 AC_DEFINE(KINFO_PROC_HAS_KP_PROC,0,Define to 1 if struct kinfo_proc has member kp_proc)
1443 ])
1444 fi
1445
1446
1447 #--------------------------------------------------------------------
1448 # Check for UNICODE stuff
1449 #--------------------------------------------------------------------
1450
1451 AC_CHECK_HEADERS([wchar.h wctype.h iconv.h])
1452 AC_CHECK_TYPES([wchar_t, wint_t],,,[
1453 #if HAVE_WCHAR_H
1454 #include <wchar.h>
1455 #endif
1456 ])
1457 AC_CHECK_SIZEOF(wchar_t)
1458 AC_CHECK_FUNCS([wcslen wcsdup wcsncpy wcstoll wcstoull towupper wcserror wcserror_r])
1459 AC_CHECK_FUNCS([wfopen wopen wstat wgetenv wrename wunlink])
1460 AC_CHECK_FUNCS([wfopen wopen wstat wgetenv wrename wunlink])
1461
1462 if test "x$DISABLE_ICONV" != "xyes"; then
1463 AC_CHECK_LIB(iconv, libiconv_open,
1464 [ ac_found_iconv=yes
1465 LIBS="$LIBS -liconv"
1466 AC_CHECK_FUNCS(libiconv, ac_found_iconv=yes, ac_found_iconv=no)
1467 ],
1468 [
1469 AC_CHECK_LIB(iconv, iconv,
1470 [ ac_found_iconv=yes
1471 LIBS="$LIBS -liconv"
1472 ])
1473 AC_CHECK_FUNCS(iconv, ac_found_iconv=yes, ac_found_iconv=no)
1474 ])
1475 else
1476 ac_found_iconv=no
1477 CPPFLAGS="$CPPFLAGS -D__DISABLE_ICONV"
1478 fi
1479
1480 AC_MSG_CHECKING(whether iconv supports UCS-2-INTERNAL)
1481 AC_RUN_IFELSE(
1482 [AC_LANG_PROGRAM([
1483 #if HAVE_ICONV_H
1484 #include <iconv.h>
1485 #endif
1486 ], [
1487 return iconv_open("UTF-8","UCS-2-INTERNAL")==(iconv_t)(-1);
1488 ])
1489 ],
1490 [ AC_MSG_RESULT(yes)
1491 AC_DEFINE(HAVE_ICONV_UCS_2_INTERNAL, 1, Define to 1 if iconv supports UCS-2-INTERNAL)
1492 valid_ucs2_code="UCS-2-INTERNAL"
1493 ],
1494 [ AC_MSG_RESULT(no) ],
1495 [ AC_MSG_RESULT(no) ]
1496 )
1497
1498 AC_MSG_CHECKING(whether iconv supports UCS-2)
1499 AC_RUN_IFELSE(
1500 [AC_LANG_PROGRAM([
1501 #if HAVE_ICONV_H
1502 #include <iconv.h>
1503 #endif
1504 ], [
1505 return iconv_open("UTF-8","UCS-2")==(iconv_t)(-1);
1506 ])
1507 ],
1508 [ AC_MSG_RESULT(yes)
1509 AC_DEFINE(HAVE_ICONV_UCS_2, 1, Define to 1 if iconv supports UCS-2)
1510 valid_ucs2_code="UCS-2"
1511 ],
1512 [ AC_MSG_RESULT(no) ],
1513 [ AC_MSG_RESULT(no) ]
1514 )
1515
1516 AC_MSG_CHECKING(whether iconv supports UCS2)
1517 AC_RUN_IFELSE(
1518 [AC_LANG_PROGRAM([
1519 #if HAVE_ICONV_H
1520 #include <iconv.h>
1521 #endif
1522 ], [
1523 return iconv_open("UTF-8","UCS2")==(iconv_t)(-1);
1524 ])
1525 ],
1526 [ AC_MSG_RESULT(yes)
1527 AC_DEFINE(HAVE_ICONV_UCS2, 1, Define to 1 if iconv supports UCS2)
1528 valid_ucs2_code="UCS2"
1529 ],
1530 [ AC_MSG_RESULT(no) ],
1531 [ AC_MSG_RESULT(no) ]
1532 )
1533
1534 AC_MSG_CHECKING(whether iconv supports UCS-2BE)
1535 AC_RUN_IFELSE(
1536 [AC_LANG_PROGRAM([
1537 #if HAVE_ICONV_H
1538 #include <iconv.h>
1539 #endif
1540 ], [
1541 return iconv_open("UTF-8","UCS-2BE")==(iconv_t)(-1);
1542 ])
1543 ],
1544 [ AC_MSG_RESULT(yes)
1545 AC_DEFINE(HAVE_ICONV_UCS_2BE, 1, Define to 1 if iconv supports UCS-2BE)
1546 valid_ucs2_code="UCS-2BE"
1547 ],
1548 [ AC_MSG_RESULT(no) ],
1549 [ AC_MSG_RESULT(no) ]
1550 )
1551
1552 AC_MSG_CHECKING(whether iconv supports UCS-2LE)
1553 AC_RUN_IFELSE(
1554 [AC_LANG_PROGRAM([
1555 #if HAVE_ICONV_H
1556 #include <iconv.h>
1557 #endif
1558 ], [
1559 return iconv_open("UTF-8","UCS-2LE")==(iconv_t)(-1);
1560 ])
1561 ],
1562 [ AC_MSG_RESULT(yes)
1563 AC_DEFINE(HAVE_ICONV_UCS_2LE, 1, Define to 1 if iconv supports UCS-2LE)
1564 valid_ucs2_code="UCS-2LE"
1565 ],
1566 [ AC_MSG_RESULT(no) ],
1567 [ AC_MSG_RESULT(no) ]
1568 )
1569
1570 AC_MSG_CHECKING(whether iconv supports UTF-16)
1571 AC_RUN_IFELSE(
1572 [AC_LANG_PROGRAM([
1573 #if HAVE_ICONV_H
1574 #include <iconv.h>
1575 #endif
1576 ], [
1577 return iconv_open("UTF-8","UTF-16")==(iconv_t)(-1);
1578 ])
1579 ],
1580 [ AC_MSG_RESULT(yes)
1581 AC_DEFINE(HAVE_ICONV_UTF_16, 1, Define to 1 if iconv supports UTF-16)
1582 valid_ucs2_code="UTF-16"
1583 ],
1584 [ AC_MSG_RESULT(no) ],
1585 [ AC_MSG_RESULT(no) ]
1586 )
1587
1588 AC_MSG_CHECKING(whether iconv supports UCS-4-INTERNAL)
1589 AC_RUN_IFELSE(
1590 [AC_LANG_PROGRAM([
1591 #if HAVE_ICONV_H
1592 #include <iconv.h>
1593 #endif
1594 ], [
1595 return iconv_open("UTF-8","UCS-4-INTERNAL")==(iconv_t)(-1);
1596 ])
1597 ],
1598 [ AC_MSG_RESULT(yes)
1599 AC_DEFINE(HAVE_ICONV_UCS_4_INTERNAL, 1, Define to 1 if iconv supports UCS-4-INTERNAL)
1600 valid_ucs4_code="UCS-4-INTERNAL"
1601 ],
1602 [ AC_MSG_RESULT(no) ],
1603 [ AC_MSG_RESULT(no) ]
1604 )
1605
1606 AC_MSG_CHECKING(whether iconv supports UCS-4)
1607 AC_RUN_IFELSE(
1608 [AC_LANG_PROGRAM([
1609 #if HAVE_ICONV_H
1610 #include <iconv.h>
1611 #endif
1612 ], [
1613 return iconv_open("UTF-8","UCS-4")==(iconv_t)(-1);
1614 ])
1615 ],
1616 [ AC_MSG_RESULT(yes)
1617 AC_DEFINE(HAVE_ICONV_UCS_4, 1, Define to 1 if iconv supports UCS-4)
1618 valid_ucs4_code="UCS-4"
1619 ],
1620 [ AC_MSG_RESULT(no) ],
1621 [ AC_MSG_RESULT(no) ]
1622 )
1623
1624 AC_MSG_CHECKING(whether iconv supports UCS4)
1625 AC_RUN_IFELSE(
1626 [AC_LANG_PROGRAM([
1627 #if HAVE_ICONV_H
1628 #include <iconv.h>
1629 #endif
1630 ], [
1631 return iconv_open("UTF-8","UCS4")==(iconv_t)(-1);
1632 ])
1633 ],
1634 [ AC_MSG_RESULT(yes)
1635 AC_DEFINE(HAVE_ICONV_UCS4, 1, Define to 1 if iconv supports UCS4)
1636 valid_ucs4_code="UCS4"
1637 ],
1638 [ AC_MSG_RESULT(no) ],
1639 [ AC_MSG_RESULT(no) ]
1640 )
1641
1642 AC_MSG_CHECKING(whether iconv supports UCS-4BE)
1643 AC_RUN_IFELSE(
1644 [AC_LANG_PROGRAM([
1645 #if HAVE_ICONV_H
1646 #include <iconv.h>
1647 #endif
1648 ], [
1649 return iconv_open("UTF-8","UCS-4BE")==(iconv_t)(-1);
1650 ])
1651 ],
1652 [ AC_MSG_RESULT(yes)
1653 AC_DEFINE(HAVE_ICONV_UCS_4BE, 1, Define to 1 if iconv supports UCS-4BE)
1654 valid_ucs4_code="UCS-4BE"
1655 ],
1656 [ AC_MSG_RESULT(no) ],
1657 [ AC_MSG_RESULT(no) ]
1658 )
1659
1660 AC_MSG_CHECKING(whether iconv supports UCS-4LE)
1661 AC_RUN_IFELSE(
1662 [AC_LANG_PROGRAM([
1663 #if HAVE_ICONV_H
1664 #include <iconv.h>
1665 #endif
1666 ], [
1667 return iconv_open("UTF-8","UCS-4LE")==(iconv_t)(-1);
1668 ])
1669 ],
1670 [ AC_MSG_RESULT(yes)
1671 AC_DEFINE(HAVE_ICONV_UCS_4LE, 1, Define to 1 if iconv supports UCS-4LE)
1672 valid_ucs4_code="UCS-4LE"
1673 ],
1674 [ AC_MSG_RESULT(no) ],
1675 [ AC_MSG_RESULT(no) ]
1676 )
1677
1678 AC_MSG_CHECKING(whether iconv supports UTF-32)
1679 AC_RUN_IFELSE(
1680 [AC_LANG_PROGRAM([
1681 #if HAVE_ICONV_H
1682 #include <iconv.h>
1683 #endif
1684 ], [
1685 return iconv_open("UTF-8","UTF-32")==(iconv_t)(-1);
1686 ])
1687 ],
1688 [ AC_MSG_RESULT(yes)
1689 AC_DEFINE(HAVE_ICONV_UTF_32, 1, Define to 1 if iconv supports UTF-32)
1690 valid_ucs4_code="UTF-32"
1691 ],
1692 [ AC_MSG_RESULT(no) ],
1693 [ AC_MSG_RESULT(no) ]
1694 )
1695
1696 AC_MSG_CHECKING(whether iconv supports ISO8859-1)
1697 AC_RUN_IFELSE(
1698 [AC_LANG_PROGRAM([
1699 #if HAVE_ICONV_H
1700 #include <iconv.h>
1701 #endif
1702 ], [
1703 return iconv_open("UTF-8","ISO8859-1")==(iconv_t)(-1);
1704 ])
1705 ],
1706 [ AC_MSG_RESULT(yes)
1707 AC_DEFINE(HAVE_ICONV_ISO8859_1, 1, Define to 1 if iconv supports ISO8859-1)
1708 ],
1709 [ AC_MSG_RESULT(no) ],
1710 [ AC_MSG_RESULT(no) ]
1711 )
1712
1713 AC_MSG_CHECKING(whether iconv supports ISO-8859-1)
1714 AC_RUN_IFELSE(
1715 [AC_LANG_PROGRAM([
1716 #if HAVE_ICONV_H
1717 #include <iconv.h>
1718 #endif
1719 ], [
1720 return iconv_open("UTF-8","ISO-8859-1")==(iconv_t)(-1);
1721 ])
1722 ],
1723 [ AC_MSG_RESULT(yes)
1724 AC_DEFINE(HAVE_ICONV_ISO_8859_1, 1, Define to 1 if iconv supports ISO-8859-1)
1725 ],
1726 [ AC_MSG_RESULT(no) ],
1727 [ AC_MSG_RESULT(no) ]
1728 )
1729
1730 AC_MSG_CHECKING(whether iconv supports ASCII)
1731 AC_RUN_IFELSE(
1732 [AC_LANG_PROGRAM([
1733 #if HAVE_ICONV_H
1734 #include <iconv.h>
1735 #endif
1736 ], [
1737 return iconv_open("UTF-8","ASCII")==(iconv_t)(-1);
1738 ])
1739 ],
1740 [ AC_MSG_RESULT(yes)
1741 AC_DEFINE(HAVE_ICONV_ASCII, 1, Define to 1 if iconv supports ASCII)
1742 ],
1743 [ AC_MSG_RESULT(no) ],
1744 [ AC_MSG_RESULT(no) ]
1745 )
1746
1747 AC_MSG_CHECKING(whether iconv supports //IGNORE)
1748 AC_RUN_IFELSE(
1749 [AC_LANG_PROGRAM([
1750 #if HAVE_ICONV_H
1751 #include <iconv.h>
1752 #endif
1753 ], [
1754 return iconv_open("UTF-8//IGNORE","$valid_ucs2_code")==(iconv_t)(-1);
1755 ])
1756 ],
1757 [ AC_MSG_RESULT(yes)
1758 AC_DEFINE(HAVE_ICONV_IGNORE, 1, Define to 1 if iconv supports //IGNORE option)
1759 ],
1760 [ AC_MSG_RESULT(no) ],
1761 [ AC_MSG_RESULT(no) ]
1762 )
1763
1764 # taken from ZSH's configure
1765 # Check if iconv uses const in prototype declaration
1766 if test "x$ac_found_iconv" = "xyes"; then
1767 AC_LANG_PUSH([C++])
1768 AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
1769 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1770 #include <stdlib.h>
1771 #if HAVE_ICONV_H
1772 #include <iconv.h>
1773 #endif
1774 ]],
1775 [[
1776 char **p = NULL;
1777 iconv(0, (const char **)p, 0, 0, 0);
1778 ]])],
1779 [ac_cv_iconv_const=const],
1780 [ac_cv_iconv_const=])])
1781 AC_LANG_POP([C++])
1782 AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
1783 [Define as const if the declaration of iconv() needs const.])
1784 fi
1785
1786 if test "x$ac_cv_type_wchar_t" = "xyes"; then
1787 if test $ac_cv_sizeof_wchar_t -eq 2; then
1788 AC_DEFINE(UNICODE_UCS2, 1, Define to 1 if you have 2-byte wchar_t)
1789 fi
1790
1791 if test $ac_cv_sizeof_wchar_t -eq 4; then
1792 AC_DEFINE(UNICODE_UCS4, 1, Define to 1 if you have 4-byte wchar_t)
1793 fi
1794
1795 if test "x$USE_INTERNAL_LIBTRE" = "xyes"; then
1796 AC_DEFINE(TRE_WCHAR, 1, [ Define to enable wide character support in libtre.])
1797 fi
1798 else
1799 if test "x$BUILD_UNICODE" = "xyes"; then
1800 AC_MSG_ERROR(wchar_t is required for UNICODE build)
1801 fi
1802 fi
1803
1804
1805 #--------------------------------------------------------------------
1806 # MySQL
1807 #--------------------------------------------------------------------
1808
1809 check_substr "$COMPONENTS" "mysql"
1810 if test $? = 0; then
1811 AC_CHECK_LIB(mysqlclient, mysql_init, [MYSQL_LIBS="-lmysqlclient"],
1812 [AC_MSG_ERROR(libmysqlclient is requred for MySQL support)])
1813
1814 OLD_LIBS="$LIBS"
1815 LIBS="$LIBS $MYSQL_LIBS"
1816
1817 AC_MSG_CHECKING(whether mysql clients can run)
1818 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1819 #include <stdio.h>
1820 #include <mysql.h>
1821 int main(void)
1822 {
1823 MYSQL *a = mysql_init(NULL);
1824 return 0;
1825 }
1826 ]])],[],[
1827 AC_MSG_RESULT(no)
1828 AC_MSG_ERROR(Your MySQL client libraries aren't properly installed)
1829 ],[])
1830 AC_MSG_RESULT(yes)
1831
1832 AC_CHECK_FUNCS(mysql_real_escape_string)
1833 LIBS="$OLD_LIBS"
1834 fi
1835
1836
1837 #--------------------------------------------------------------------
1838 # PostgreSQL
1839 #--------------------------------------------------------------------
1840
1841 check_substr "$COMPONENTS" "pgsql"
1842 if test $? = 0; then
1843 AC_CHECK_LIB(m, floor)
1844 AC_CHECK_LIB(pq, PQconnectdb, [PGSQL_LIBS="-lpq"],
1845 [AC_MSG_ERROR(libpq is required for PostgreSQL support)])
1846
1847 AC_MSG_CHECKING(whether postgresql clients can run)
1848 OLD_LIBS="$LIBS"
1849 LIBS="$LIBS $PGSQL_LIBS"
1850 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1851 #include <stdio.h>
1852 #include <libpq-fe.h>
1853 int main(void)
1854 {
1855 PGconn *a = PQconnectdb("");
1856 return 0;
1857 }
1858 ]])],[AC_MSG_RESULT(yes)],[
1859 AC_MSG_RESULT(no)
1860 AC_MSG_ERROR(Your PostgreSQL client libraries aren't properly installed)
1861 ],[])
1862 LIBS="$OLD_LIBS"
1863 AC_CHECK_LIB(pq, PQfformat, [ AC_DEFINE(HAVE_PQFFORMAT, 1, PQfformat not exist in 7.3) ])
1864 fi
1865
1866
1867 #--------------------------------------------------------------------
1868 # ODBC
1869 #--------------------------------------------------------------------
1870
1871 check_substr "$COMPONENTS" "odbc"
1872 if test $? = 0; then
1873 AC_CHECK_LIB(odbc, SQLAllocHandle, [ODBC_LIBS="-lodbc"],
1874 [AC_MSG_ERROR(libodbc is required for ODBC support)])
1875 fi
1876
1877
1878 #--------------------------------------------------------------------
1879 # Oracle
1880 #--------------------------------------------------------------------
1881
1882 check_substr "$COMPONENTS" "oracle"
1883 if test $? = 0; then
1884 AC_CHECK_HEADER(oci.h,,AC_MSG_ERROR([*** Cannot find oci.h - check your Oracle client installation ***]))
1885 AC_CHECK_LIB(nnz11, nzstrcpy, [NNZ_LIB=-lnnz11],
1886 [
1887 AC_CHECK_LIB(nnz10, nzstrcpy, [NNZ_LIB=-lnnz10], [], [-lclntsh])
1888 ], [-lclntsh])
1889 AC_CHECK_LIB(clntsh, OCIHandleAlloc, [ORACLE_LIBS="-lclntsh $NNZ_LIB"],
1890 [AC_MSG_ERROR(libclntsh is required for Oracle support)], [$NNZ_LIB])
1891 AC_CHECK_LIB(rt, sem_destroy, [ORACLE_LIBS="$ORACLE_LIBS -lrt"], [])
1892 fi
1893
1894 #--------------------------------------------------------------------
1895 # DB2
1896 #--------------------------------------------------------------------
1897
1898 check_substr "$COMPONENTS" "db2"
1899 if test $? = 0; then
1900 AC_CHECK_HEADER(sql.h,,AC_MSG_ERROR([*** Cannot find sql.h - check your DB2 client installation ***]))
1901 AC_CHECK_LIB(db2, SQLAllocHandle, [DB2_LIBS="-ldb2"],
1902 [AC_MSG_ERROR(libdb2 is required for DB2 support)])
1903 fi
1904
1905 #--------------------------------------------------------------------
1906 # Informix
1907 #--------------------------------------------------------------------
1908
1909 check_substr "$COMPONENTS" "informix"
1910 if test $? = 0; then
1911 AC_CHECK_HEADER(infxcli.h,,AC_MSG_ERROR([*** Cannot find infxcli.h - check your Informix client installation ***]))
1912 AC_CHECK_LIB(thcli, SQLAllocHandle, [INFORMIX_LIBS="-lthcli"],
1913 [AC_MSG_ERROR(libthcli is required for Informix support)])
1914 fi
1915
1916
1917 #--------------------------------------------------------------------
1918 # Other settings
1919 #--------------------------------------------------------------------
1920
1921 CPPFLAGS="$CPPFLAGS -DPREFIX=\\\"\${prefix}\\\" -DPREFIXW=L\\\"\${prefix}\\\" -DDATADIR=\\\"\${pkgdatadir}\\\" -DBINDIR=\\\"\${bindir}\\\" -DLIBDIR=\\\"\${libdir}\\\" -DPKGLIBDIR=\\\"\${pkglibdir}\\\""
1922 LDFLAGS="$LDFLAGS_PREFIX $LDFLAGS $LDFLAGS_SUFFIX"
1923
1924 AM_CONDITIONAL([USE_INTERNAL_EXPAT], [test "x$HAVE_LIBEXPAT" = "xno"])
1925 AM_CONDITIONAL([USE_INTERNAL_LIBTRE], [test "x$HAVE_LIBTRE" = "xno"])
1926 AM_CONDITIONAL([USE_INTERNAL_ZLIB], [test "$NEED_ZLIB/$HAVE_ZLIB" = "yes/no"])
1927 AM_CONDITIONAL([STATIC_BUILD], [test "x$STATIC_BUILD" = "xyes"])
1928 AM_CONDITIONAL([ALL_STATIC], [test "x$ALL_STATIC" = "xyes"])
1929
1930
1931 #--------------------------------------------------------------------
1932 # Substitute variables
1933 #--------------------------------------------------------------------
1934
1935 AC_SUBST(DB_DRIVERS)
1936 AC_SUBST(MODULES)
1937 AC_SUBST(SUBAGENT_DIRS)
1938 AC_SUBST(SERVER_TOOLS)
1939 AC_SUBST(TOP_LEVEL_MODULES)
1940 AC_SUBST(CONTRIB_MODULES)
1941 AC_SUBST(CLIENT_COMPONENTS)
1942 AC_SUBST(STATIC_SUBAGENT_LIST)
1943 AC_SUBST(SUBAGENT_LIBS)
1944 AC_SUBST(BUILD_SERVER)
1945 AC_SUBST(MYSQL_LIBS)
1946 AC_SUBST(PGSQL_LIBS)
1947 AC_SUBST(ORACLE_LIBS)
1948 AC_SUBST(ODBC_LIBS)
1949 AC_SUBST(DB2_LIBS)
1950 AC_SUBST(INFORMIX_LIBS)
1951 AC_SUBST(OBJECT_MODE)
1952
1953 #--------------------------------------------------------------------
1954 # Shared libs versions
1955 #
1956 # versioning scheme: current:revision:age
1957 #
1958 # current
1959 # The number of the current interface exported by the library. A current
1960 # value of `0', means that you are calling the interface exported by this
1961 # library interface 0.
1962 #
1963 # revision
1964 # The implementation number of the most recent interface exported by this
1965 # library. In this case, a revision value of `0' means that this is the
1966 # first implementation of the interface.
1967 # If the next release of this library exports the same interface, but has a
1968 # different implementation (perhaps some bugs have been fixed), the revision
1969 # number will be higher, but current number will be the same. In that case,
1970 # when given a choice, the library with the highest revision will always
1971 # be used by the runtime loader.
1972 #
1973 # age
1974 # The number of previous additional interfaces supported by this library.
1975 # If age were `2', then this library can be linked into executables which
1976 # were built with a release of this library that exported the current
1977 # interface number, current, or any of the previous two interfaces.
1978 # By definition age must be less than or equal to current. At the outset,
1979 # only the first ever interface is implemented, so age can only be `0'.
1980 #--------------------------------------------------------------------
1981
1982 NETXMS_LIBRARY_VERSION=1:0:0
1983 AC_SUBST(NETXMS_LIBRARY_VERSION)
1984
1985
1986 #--------------------------------------------------------------------
1987 # Generate output files
1988 #--------------------------------------------------------------------
1989
1990 AC_CONFIG_FILES([
1991 README
1992 Makefile
1993 contrib/Makefile
1994 contrib/backgrounds/Makefile
1995 contrib/integration/Makefile
1996 contrib/integration/HP_EVA/Makefile
1997 contrib/mibs/Makefile
1998 contrib/startup/Makefile
1999 contrib/startup/debian/Makefile
2000 contrib/startup/gentoo/Makefile
2001 contrib/startup/hp-ux/Makefile
2002 contrib/startup/redhat/Makefile
2003 contrib/startup/suse/Makefile
2004 contrib/startup/ubuntu/Makefile
2005 contrib/startup/solaris/Makefile
2006 doc/Makefile
2007 doc/internal/Makefile
2008 doc/manuals/Makefile
2009 doc/misc/Makefile
2010 images/Makefile
2011 include/Makefile
2012 m4/Makefile
2013 src/Makefile
2014 src/agent/Makefile
2015 src/agent/core/Makefile
2016 src/agent/install/Makefile
2017 src/agent/subagents/Makefile
2018 src/agent/subagents/aix/Makefile
2019 src/agent/subagents/ecs/Makefile
2020 src/agent/subagents/freebsd/Makefile
2021 src/agent/subagents/hpux/Makefile
2022 src/agent/subagents/informix/Makefile
2023 src/agent/subagents/ipso/Makefile
2024 src/agent/subagents/linux/Makefile
2025 src/agent/subagents/logwatch/Makefile
2026 src/agent/subagents/netbsd/Makefile
2027 src/agent/subagents/odbcquery/Makefile
2028 src/agent/subagents/openbsd/Makefile
2029 src/agent/subagents/oracle/Makefile
2030 src/agent/subagents/ping/Makefile
2031 src/agent/subagents/portCheck/Makefile
2032 src/agent/subagents/sms/Makefile
2033 src/agent/subagents/sunos/Makefile
2034 src/agent/subagents/ups/Makefile
2035 src/agent/subagents/winnt/Makefile
2036 src/agent/subagents/winperf/Makefile
2037 src/agent/subagents/wmi/Makefile
2038 src/agent/tools/Makefile
2039 src/agent/tools/nxapush/Makefile
2040 src/client/Makefile
2041 src/client/install/Makefile
2042 src/client/nxalarm/Makefile
2043 src/client/nxevent/Makefile
2044 src/client/nxlexer/Makefile
2045 src/client/nxpush/Makefile
2046 src/client/nxsms/Makefile
2047 src/client/scilexer/Makefile
2048 src/client/windows/Makefile
2049 src/client/windows/nxav/Makefile
2050 src/client/windows/nxav/res/Makefile
2051 src/client/windows/nxcon/Makefile
2052 src/client/windows/nxcon/icons/Makefile
2053 src/client/windows/nxcon/res/Makefile
2054 src/client/windows/nxnotify/Makefile
2055 src/client/windows/nxnotify/res/Makefile
2056 src/client/windows/nxuilib/Makefile
2057 src/client/windows/nxuilib/res/Makefile
2058 src/client/windows/nxuilib/sounds/Makefile
2059 src/db/Makefile
2060 src/db/dbdrv/Makefile
2061 src/db/dbdrv/db2/Makefile
2062 src/db/dbdrv/informix/Makefile
2063 src/db/dbdrv/odbc/Makefile
2064 src/db/dbdrv/mssql/Makefile
2065 src/db/dbdrv/mysql/Makefile
2066 src/db/dbdrv/oracle/Makefile
2067 src/db/dbdrv/pgsql/Makefile
2068 src/db/dbdrv/sqlite/Makefile
2069 src/db/libnxdb/Makefile
2070 src/install/Makefile
2071 src/install/windows/Makefile
2072 src/libexpat/Makefile
2073 src/libexpat/libexpat/Makefile
2074 src/libnetxms/Makefile
2075 src/libnxcl/Makefile
2076 src/libnxlp/Makefile
2077 src/libnxmap/Makefile
2078 src/libnxsl/Makefile
2079 src/libtre/Makefile
2080 src/libtre/win32/Makefile
2081 src/nxscript/Makefile
2082 src/server/Makefile
2083 src/server/core/Makefile
2084 src/server/drivers/Makefile
2085 src/server/drivers/baystack/Makefile
2086 src/server/drivers/cat2900xl/Makefile
2087 src/server/drivers/catalyst/Makefile
2088 src/server/drivers/ers8000/Makefile
2089 src/server/drivers/lib/Makefile
2090 src/server/drivers/lib/avaya-ers/Makefile
2091 src/server/drivers/lib/cisco/Makefile
2092 src/server/drivers/netscreen/Makefile
2093 src/server/include/Makefile
2094 src/server/libnxsrv/Makefile
2095 src/server/netxmsd/Makefile
2096 src/server/smsdrv/Makefile
2097 src/server/smsdrv/generic/Makefile
2098 src/server/smsdrv/nxagent/Makefile
2099 src/server/smsdrv/portech/Makefile
2100 src/server/tools/Makefile
2101 src/server/tools/nxaction/Makefile
2102 src/server/tools/nxadm/Makefile
2103 src/server/tools/nxap/Makefile
2104 src/server/tools/nxconfig/Makefile
2105 src/server/tools/nxconfig/res/Makefile
2106 src/server/tools/nxdbmgr/Makefile
2107 src/server/tools/nxencpasswd/Makefile
2108 src/server/tools/nxget/Makefile
2109 src/server/tools/nxupload/Makefile
2110 src/snmp/Makefile
2111 src/snmp/libnxsnmp/Makefile
2112 src/snmp/nxmibc/Makefile
2113 src/snmp/nxsnmpget/Makefile
2114 src/snmp/nxsnmpset/Makefile
2115 src/snmp/nxsnmpwalk/Makefile
2116 src/sqlite/Makefile
2117 src/tools/Makefile
2118 src/tools/nxcptest/Makefile
2119 src/tools/nxdevcfg/Makefile
2120 src/zlib/Makefile
2121 sql/Makefile
2122 tools/Makefile
2123 ])
2124
2125 AC_OUTPUT
2126
2127 echo "Updating libtool"
2128 sed 's,$SED -e "/${host}-//g",$SED -e "s/${host}-//g",g' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
2129
2130 # On HP-UX, libtool passes +b instead of -Wl,+b even if gcc/g++ used as linker
2131 if test "x$CC" = "xgcc" && test "x$PLATFORM" = "xHP-UX"; then
2132 sed "s,hardcode_libdir_flag_spec_ld=,#hardcode_libdir_flag_spec_ld=,g" < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
2133 fi
2134
2135 # On AIX, correct OBJECT_MODE must be set before linking
2136 # To avoid manual setting by user, we add this to libtool script
2137 if test "x$PLATFORM" = "xAIX"; then
2138 head -n 1 ./libtool > ./libtool.new
2139 echo "export OBJECT_MODE=$OBJECT_MODE" >> ./libtool.new
2140 tail -n +2 ./libtool >> ./libtool.new
2141 mv libtool.new libtool
2142 chmod +x ./libtool
2143 fi
2144
2145 #--------------------------------------------------------------------
2146 # Print summary
2147 #--------------------------------------------------------------------
2148
2149 echo
2150 echo
2151 echo
2152 echo '---------------------------------------------------------------------'
2153 echo ' Configure results'
2154 echo '---------------------------------------------------------------------'
2155 echo
2156 echo "Prefix : ${prefix}"
2157 if test "x${BUILD_SERVER}" = "xyes"; then
2158 echo "Build Server : YES"
2159 else
2160 echo "Build Server : NO"
2161 fi
2162 if test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"; then
2163 echo "Encryption enabled : YES"
2164 else
2165 echo "Encryption enabled : NO"
2166 fi
2167 if test "x${DB_DRIVERS}" != "x"; then
2168 echo "Build DB-Drivers :${DB_DRIVERS}"
2169 else
2170 echo "Build DB-Drivers : NO"
2171 fi
2172 if test "x${BUILD_CLIENT}" = "xyes"; then
2173 echo "Build Clients : YES"
2174 else
2175 echo "Build Clients : NO"
2176 fi
2177 if test "x${BUILD_AGENT}" = "xyes"; then
2178 echo "Build Agent : YES"
2179 echo "Subagents list : ${SUBAGENT_DIRS}"
2180 else
2181 echo "Build Agent : NO"
2182 fi
2183 if test "x${BUILD_STATIC_AGENT}" = "xyes"; then
2184 echo "Build Static Agent : YES"
2185 echo "Subagents list : ${STATIC_SUBAGENT_LIST}"
2186 else
2187 echo "Build Static Agent : NO"
2188 fi
2189 if test "x${BUILD_UNICODE}" = "xyes"; then
2190 echo "UNICODE build : YES"
2191 else
2192 echo "UNICODE build : NO"
2193 fi
2194 if test "x${HAVE_LIBEXPAT}" = "xno"; then
2195 echo "Use internal libexpat : YES"
2196 else
2197 echo "Use internal libexpat : NO"
2198 fi
2199 if test "x${HAVE_LIBTRE}" = "xno"; then
2200 echo "Use internal libtre : YES"
2201 else
2202 echo "Use internal libtre : NO"
2203 fi
2204 if test "x${NEED_ZLIB}" = "xyes"; then
2205 if test "x${HAVE_ZLIB}" = "xno"; then
2206 echo "Use internal zlib : YES"
2207 else
2208 echo "Use internal zlib : NO"
2209 fi
2210 fi
2211 if test "x${FORCE_32BIT_BUILD}" = "xyes"; then
2212 echo "Force 32bit build : YES"
2213 else
2214 echo "Force 32bit build : NO"
2215 fi
2216
2217 echo "CPPFLAGS : ${CPPFLAGS}"
2218 echo "CXXFLAGS : ${CXXFLAGS}"
2219 echo "CFLAGS : ${CFLAGS}"
2220 echo "LDFLAGS : ${LDFLAGS}"
2221 echo "LIBS : ${LIBS}"
2222
2223 if test "x${MYSQL_LIBS}" != "x"; then
2224 echo "MySQL libs : ${MYSQL_LIBS}"
2225 fi
2226 if test "x${PGSQL_LIBS}" != "x"; then
2227 echo "PostgreSQL libs : ${PGSQL_LIBS}"
2228 fi
2229 if test "x${ORACLE_LIBS}" != "x"; then
2230 echo "Oracle libs : ${ORACLE_LIBS}"
2231 fi
2232 if test "x${ODBC_LIBS}" != "x"; then
2233 echo "ODBC libs : ${ODBC_LIBS}"
2234 fi
2235 if test "x${DB2_LIBS}" != "x"; then
2236 echo "DB2 libs : ${DB2_LIBS}"
2237 fi
2238 if test "x${INFORMIX_LIBS}" != "x"; then
2239 echo "Informix libs : ${INFORMIX_LIBS}"
2240 fi