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