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