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