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