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