support for struct dirent.d_type added to Linux readdir wrapper
[public/netxms.git] / configure.ac
1 # $Id$
2 #
3 # NetXMS - Network Management System
4 # Configure script
5 #
6
7 AC_INIT([NetXMS], [2.1-RC1], [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 find_existing_dir()
30 {
31 for d in "$@"; do
32 if test -d "$d"; then
33 __dir="$d"
34 return 0;
35 fi
36 done
37 return 1
38 }
39
40
41 #--------------------------------------------------------------------
42 # Initialize variables
43 #--------------------------------------------------------------------
44
45 PLATFORM=`uname -s`
46 CPUTYPE=`uname -p`
47 COMPONENTS=""
48 DISABLE_ICONV="no"
49 DISABLE_ENCRYPTION="no"
50 DISABLE_LMSENSORS="no"
51 DISABLE_SSH="no"
52 ENABLE_DEBUG="no"
53 ENABLE_WERROR="no"
54 STATIC_BUILD="no"
55 ALL_STATIC="no"
56 DBDRIVER_SELECTED="no"
57 USE_PTH="no"
58 BUILD_SERVER="no"
59 BUILD_AGENT="no"
60 BUILD_CLIENT="no"
61 BUILD_STATIC_AGENT="no"
62 BUILD_SDK="no"
63 MODULES="libnetxms tools install"
64 STATIC_SUBAGENT_LIST=""
65 PROPOSED_STATIC_SUBAGENTS="default"
66 SUBAGENT_DIRS=""
67 SUBAGENT_LIBS=""
68 AGENT_DIRS=""
69 SERVER_LIBS=""
70 SERVER_TOOLS=""
71 SERVER_INCLUDE=""
72 SMSDRV_DIRS=""
73 HDLINK_DIRS=""
74 PDSDRV_DIRS=""
75 TOP_LEVEL_MODULES=""
76 CONTRIB_MODULES=""
77 CLIENT_COMPONENTS=""
78 BUILD_UNICODE="yes"
79 FORCE_INTERNAL_EXPAT="no"
80 FORCE_INTERNAL_LIBTRE="yes"
81 USE_INTERNAL_LIBTRE="no"
82 FORCE_INTERNAL_LIBTRE="no"
83 FORCE_INTERNAL_JANSSON="no"
84 FORCE_INTERNAL_ZLIB="no"
85 FORCE_INTERNAL_SQLITE="no"
86 FORCE_32BIT_BUILD="no"
87 FORCE_INTERNAL_GETOPT="no"
88 LDFLAGS_PREFIX=""
89 LDFLAGS_SUFFIX=""
90 LTINIT_CC=""
91 LTINIT_CXX=""
92 SQLFLAGS=""
93 RUNTIME_PREFIX=""
94 RUNTIME_STATE_DIR=""
95 HPUX_HPPA="no"
96 XMPP_SUPPORT="yes"
97 ZEROMQ_SUPPORT="no"
98 ZEROMQ_REQUIRED="no"
99 ZEROMQ_CPPFLAGS=""
100 ZEROMQ_LDFLAGS=""
101 MQTT_SUPPORT="yes"
102 MQTT_REQUIRED="no"
103 MQTT_CPPFLAGS=""
104 MQTT_LDFLAGS=""
105 MQTT_LIBS=""
106 LDAP_SUPPORT="yes"
107 DISABLE_READLINE="yes"
108 TUXEDO_LIBS=""
109 TUXEDO_TPINIT=""
110 MONGODB_LIBS=""
111 VMGR_LIBS=""
112 LIBVIRT_BASE=""
113 DISABLE_IPV6="no"
114 IPV6_SUPPORT="no"
115 INSTALL_LIBPATH=""
116 WITH_ENCRYPTION="no"
117 DISABLE_COMMONCRYPTO="no"
118 OPENSSL_LIBSSL="ssl"
119 OPENSSL_LIBCRYPTO="crypto"
120
121
122 #--------------------------------------------------------------------
123 # Common compilation flags
124 #--------------------------------------------------------------------
125
126 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DTRE_WCHAR=1"
127
128
129 #--------------------------------------------------------------------
130 # Parse command line parameters
131 #--------------------------------------------------------------------
132
133 AC_ARG_WITH(runtime-prefix,
134 [AS_HELP_STRING(--with-runtime-prefix=prefix,installation prefix to be used at run time)],
135 [
136 RUNTIME_PREFIX="$withval"
137 RUNTIME_STATE_DIR="$RUNTIME_PREFIX/var"
138 ])
139
140 AC_ARG_WITH(runtime-state-dir,
141 [AS_HELP_STRING(--with-runtime-state-dir=path,state directory to be used at run time)],
142 [
143 RUNTIME_STATE_DIR="$withval"
144 ])
145
146 AC_ARG_WITH(server,
147 [AS_HELP_STRING(--with-server,build server)],
148 [
149 COMPONENTS="$COMPONENTS sqlite snmp server agent sqlite_drv"
150 ])
151
152 AC_ARG_WITH(snmp,
153 [AS_HELP_STRING(--with-snmp,build SNMP library and tools)],
154 [
155 COMPONENTS="$COMPONENTS snmp"
156 ])
157
158 AC_ARG_WITH(client,
159 [AS_HELP_STRING(--with-client,build client library and tools)],
160 [
161 COMPONENTS="$COMPONENTS client"
162 ])
163
164 AC_ARG_WITH(client-proxy,
165 [AS_HELP_STRING(--with-client-proxy,build client proxy)],
166 [
167 COMPONENTS="$COMPONENTS client-proxy"
168 ])
169
170 AC_ARG_WITH(agent,
171 [AS_HELP_STRING(--with-agent,build agent)],
172 [
173 COMPONENTS="$COMPONENTS sqlite snmp agent sqlite_drv"
174 ])
175
176 AC_ARG_WITH(static-agent,
177 [AS_HELP_STRING(--with-static-agent,build statically linked agent)],
178 [
179 COMPONENTS="$COMPONENTS sqlite snmp static-agent sqlite_drv"
180 FORCE_INTERNAL_EXPAT="yes"
181 FORCE_INTERNAL_JANSSON="yes"
182 FORCE_INTERNAL_LIBTRE="yes"
183 FORCE_INTERNAL_SQLITE="yes"
184 FORCE_INTERNAL_ZLIB="yes"
185 ])
186
187 AC_ARG_WITH(ipso-agent,
188 [AS_HELP_STRING(--with-ipso-agent,build statically linked IPSO agent)],
189 [
190 COMPONENTS="$COMPONENTS ipso-agent"
191 ])
192
193 AC_ARG_WITH(sdk,
194 [AS_HELP_STRING(--with-sdk,build and install files necessary for extension development)],
195 [
196 COMPONENTS="$COMPONENTS sqlite sdk"
197 TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES include"
198 SERVER_INCLUDE="include"
199 BUILD_SDK="yes"
200 ])
201
202 AC_ARG_WITH(static-sdk,
203 [AS_HELP_STRING(--with-static-sdk,build and install files necessary for extension development (static libs only))],
204 [
205 COMPONENTS="$COMPONENTS sqlite sdk"
206 TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES include"
207 SERVER_INCLUDE="include"
208 BUILD_SDK="yes"
209 STATIC_BUILD="yes"
210 ])
211
212 AC_ARG_WITH(mdebug,
213 [AS_HELP_STRING(--with-mdebug,use debug version of memory allocation functions)],
214 [
215 CPPFLAGS="$CPPFLAGS -DNETXMS_MEMORY_DEBUG"
216 ])
217
218 AC_ARG_WITH(profiler,
219 [AS_HELP_STRING(--with-profiler,link with libprofiler from gperftools)],
220 [
221 LDFLAGS="$LDFLAGS -lprofiler"
222 ])
223
224 AC_ARG_WITH(internal-libexpat,
225 [AS_HELP_STRING(--with-internal-libexpat,force use of bundled libexpat)],
226 [
227 FORCE_INTERNAL_EXPAT="yes"
228 ])
229
230 AC_ARG_WITH(internal-libtre,
231 [AS_HELP_STRING(--with-internal-libtre,force use of bundled libtre)],
232 [
233 FORCE_INTERNAL_LIBTRE="yes"
234 ])
235
236 AC_ARG_WITH(internal-libjansson,
237 [AS_HELP_STRING(--with-internal-libjansson,force use of bundled libjansson)],
238 [
239 FORCE_INTERNAL_JANSSON="yes"
240 ])
241
242 AC_ARG_WITH(internal-zlib,
243 [AS_HELP_STRING(--with-internal-zlib,force use of bundled zlib)],
244 [
245 FORCE_INTERNAL_ZLIB="yes"
246 ])
247
248 AC_ARG_WITH(internal-sqlite,
249 [AS_HELP_STRING(--with-internal-sqlite,force use of bundled sqlite)],
250 [
251 FORCE_INTERNAL_SQLITE="yes"
252 ])
253
254 AC_ARG_WITH(internal-getopt,
255 [AS_HELP_STRING(--with-internal-getopt,force use of bundled getopt)],
256 [
257 FORCE_INTERNAL_GETOPT="yes"
258 ])
259
260 AC_ARG_WITH(all-static,
261 [AS_HELP_STRING(--with-all-static,use -all-static flag for linking executables)],
262 [
263 ALL_STATIC="yes"
264 ])
265
266 AC_ARG_WITH(static-subagents,
267 [AS_HELP_STRING(--with-static-subagents-list,define list of static subagents (separated by spaces))],
268 [
269 PROPOSED_STATIC_SUBAGENTS="$withval"
270 ])
271
272 AC_ARG_WITH(jdk,
273 [AS_HELP_STRING(--with-jdk,build Java-dependent components)],
274 [ if test "x$withval" != "xno" ; then
275 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
276 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
277 LDFLAGS="$LDFLAGS -L${withval}/lib"
278 CPPFLAGS="$CPPFLAGS -I${withval}/include"
279 if test -d "${withval}/include/linux"; then
280 CPPFLAGS="$CPPFLAGS -I${withval}/include/linux"
281 fi
282 if test -d "${withval}/include/solaris"; then
283 CPPFLAGS="$CPPFLAGS -I${withval}/include/solaris"
284 fi
285 AC_DEFINE_UNQUOTED([JDK_LOCATION],["$withval"],[JDK location])
286 fi
287 COMPONENTS="$COMPONENTS java"
288 fi ])
289
290 AC_ARG_WITH(tuxedo,
291 [AS_HELP_STRING(--with-tuxedo,build Tuxedo-dependent components)],
292 [ if test "x$withval" != "xno" ; then
293 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
294 TUXEDO_BASE="$withval"
295 fi
296 COMPONENTS="$COMPONENTS tuxedo"
297 fi ])
298
299 AC_ARG_WITH(zeromq,
300 [AS_HELP_STRING(--with-zeromq,build with ZeroMQ)],
301 [ if test "x$withval" != "xno" ; then
302 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
303 ZEROMQ_BASE="$withval"
304 ZEROMQ_REQUIRED=yes
305 fi
306 COMPONENTS="$COMPONENTS zeromq"
307 ZEROMQ_SUPPORT=yes
308 else
309 ZEROMQ_SUPPORT=no
310 fi ])
311
312 AC_ARG_WITH(mqtt,
313 [AS_HELP_STRING(--with-mqtt,build with MQTT support)],
314 [ if test "x$withval" != "xno" ; then
315 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
316 MQTT_BASE="$withval"
317 MQTT_REQUIRED=yes
318 fi
319 MQTT_SUPPORT=yes
320 else
321 MQTT_SUPPORT=no
322 fi ])
323
324 AC_ARG_WITH(mongodb,
325 [AS_HELP_STRING(--with-mongodb,build MongoDB-dependent components)],
326 [ if test "x$withval" != "xno" ; then
327 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
328 MONGODB_BASE="$withval"
329 fi
330 COMPONENTS="$COMPONENTS mongodb"
331 fi ])
332
333 AC_ARG_WITH(vmgr,
334 [AS_HELP_STRING(--with-vmgr,build VirtualHost management subagent)],
335 [ if test "x$withval" != "xno" ; then
336 COMPONENTS="$COMPONENTS vmgr"
337 fi ])
338
339 AC_ARG_WITH(libvirt,
340 [AS_HELP_STRING(--with-libvirt,provide libvirt location)],
341 [ if test "x$withval" != "xno" ; then
342 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
343 LIBVIRT_BASE="$withval"
344 fi
345 fi ])
346
347 AC_ARG_WITH(sqlite,
348 [AS_HELP_STRING(--with-sqlite,build SQLite database driver)],
349 [ if test "x$withval" != "xno" ; then
350 COMPONENTS="$COMPONENTS sqlite_drv"
351 DBDRIVER_SELECTED="yes"
352 fi ])
353
354 AC_ARG_WITH(odbc,
355 [AS_HELP_STRING(--with-odbc,build ODBC database driver)],
356 [ if test "x$withval" != "xno" ; then
357 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
358 ODBC_LD_RUN_PATH="${withval}/lib"
359 ODBC_LDFLAGS="-L${withval}/lib"
360 ODBC_CPPFLAGS="-I${withval}/include"
361 fi
362 COMPONENTS="$COMPONENTS odbc"
363 DBDRIVER_SELECTED="yes"
364 fi ])
365
366 AC_ARG_WITH(oracle,
367 [AS_HELP_STRING(--with-oracle,build Oracle database driver)],
368 [ if test "x$withval" != "xno" ; then
369 ORABASE="$ORACLE_HOME"
370 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
371 ORABASE="$withval"
372 fi
373 if test "x$ORABASE" != "x"; then
374 if test -x "$ORABASE/lib" ; then
375 ORACLE_LD_RUN_PATH="${ORABASE}/lib"
376 ORACLE_LDFLAGS="-L${ORABASE}/lib"
377 else
378 ORACLE_LD_RUN_PATH="${ORABASE}"
379 ORACLE_LDFLAGS="-L${ORABASE}"
380 fi
381 if test -x "$ORABASE/include" ; then
382 ORACLE_CPPFLAGS="-I${ORABASE}/include"
383 fi
384 if test -x "$ORABASE/sdk/include" ; then
385 ORACLE_CPPFLAGS="-I${ORABASE}/sdk/include"
386 fi
387 if test -x "$ORABASE/rdbms/public" ; then
388 ORACLE_CPPFLAGS="-I${ORABASE}/rdbms/public"
389 fi
390 fi
391 COMPONENTS="$COMPONENTS oracle"
392 DBDRIVER_SELECTED="yes"
393 fi ])
394
395 AC_ARG_WITH(mysql,
396 [AS_HELP_STRING(--with-mysql,build MySQL database driver)],
397 [ if test "x$withval" != "xno" ; then
398 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
399 if find_existing_dir "${withval}/lib" "${withval}/lib/mysql" "${withval}/mysql/lib"; then
400 MYSQL_LD_RUN_PATH="$__dir$"
401 MYSQL_LDFLAGS="-L$__dir"
402 fi
403 if find_existing_dir "${withval}/include" "${withval}/include/mysql" "${withval}/mysql/include"; then
404 MYSQL_CPPFLAGS="-I$__dir"
405 fi
406 else
407 if find_existing_dir "/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"; then
408 MYSQL_LD_RUN_PATH="$__dir$"
409 MYSQL_LDFLAGS="-L$__dir"
410 fi
411 if find_existing_dir "/usr/local/mysql/include" "/usr/include/mysql" "/usr/mysql/include" "/usr/local/include/mysql" "/usr/local/mysql/include/mysql" "/usr/mysql/include/mysql"; then
412 MYSQL_CPPFLAGS="-I$__dir"
413 fi
414 fi
415 COMPONENTS="$COMPONENTS mysql"
416 DBDRIVER_SELECTED="yes"
417 fi ])
418
419 AC_ARG_WITH(pgsql,
420 [AS_HELP_STRING(--with-pgsql,build PostgreSQL database driver)],
421 [ if test "x$withval" != "xno" ; then
422 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
423 if find_existing_dir "${withval}/lib" "${withval}/lib/pgsql" "${withval}/lib/postgresql" "${withval}/pgsql/lib" "${withval}/postgresql/lib"; then
424 PGSQL_LD_RUN_PATH="$__dir$"
425 PGSQL_LDFLAGS="-L$__dir"
426 fi
427 if find_existing_dir "${withval}/include" "${withval}/include/pgsql" "${withval}/include/postgresql" "${withval}/pgsql/include" "${withval}/postgresql/include"; then
428 PGSQL_CPPFLAGS="-I$__dir"
429 fi
430 else
431 if find_existing_dir "/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"; then
432 PGSQL_LD_RUN_PATH="$__dir$"
433 PGSQL_LDFLAGS="-L$__dir"
434 fi
435 if find_existing_dir "/usr/local/pgsql/include" "/usr/include/pgsql" "/usr/pgsql/include" "/usr/local/include/pgsql" "/usr/local/pgsql/include/pgsql" "/usr/pgsql/include/pgsql" "/usr/local/postgresql/include" "/usr/include/postgresql" "/usr/postgresql/include" "/usr/local/include/postgresql" "/usr/local/postgresql/include/postgresql" "/usr/postgresql/include/postgresql"; then
436 PGSQL_CPPFLAGS="-I$__dir"
437 fi
438 fi
439 COMPONENTS="$COMPONENTS pgsql"
440 DBDRIVER_SELECTED="yes"
441 fi ])
442
443 AC_ARG_WITH(db2,
444 [AS_HELP_STRING(--with-db2,build DB2 database driver)],
445 [ if test "x$withval" != "xno" ; then
446 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
447 if test `uname -m` = 'i386' || test `uname -m` = 'i686'; then
448 DB2_LIB_DIR=lib32
449 else
450 DB2_LIB_DIR=lib64
451 fi
452 if test -x "$withval/${DB2_LIB_DIR}" ; then
453 LD_RUN_PATH="${withval}/${DB2_LIB_DIR}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
454 LDFLAGS="$LDFLAGS -L${withval}/${DB2_LIB_DIR}"
455 else
456 LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
457 LDFLAGS="$LDFLAGS -L${withval}"
458 fi
459 if test -x "$withval/include" ; then
460 CPPFLAGS="$CPPFLAGS -I${withval}/include"
461 fi
462
463 unset DB2_LIB_DIR
464 fi
465 COMPONENTS="$COMPONENTS db2"
466 DBDRIVER_SELECTED="yes"
467 fi ])
468
469 AC_ARG_WITH(informix,
470 [AS_HELP_STRING(--with-informix,build Informix database driver)],
471 [ if test "x$withval" != "xno" ; then
472 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
473 if test -x "$withval/lib/cli" ; then
474 LD_RUN_PATH="${withval}/lib/cli${LD_RUN_PATH:+:}${LD_RUN_PATH}"
475 LDFLAGS="$LDFLAGS -L${withval}/lib/cli"
476 if test -x "$withval/lib/esql" ; then
477 LD_RUN_PATH="${withval}/lib/esql${LD_RUN_PATH:+:}${LD_RUN_PATH}"
478 LDFLAGS="$LDFLAGS -L${withval}/lib/esql"
479 fi
480 else
481 LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
482 LDFLAGS="$LDFLAGS -L${withval}"
483 fi
484 if test -x "$withval/incl/cli" ; then
485 CPPFLAGS="$CPPFLAGS -I${withval}/incl/cli"
486 fi
487 fi
488 COMPONENTS="$COMPONENTS informix"
489 DBDRIVER_SELECTED="yes"
490 fi ])
491
492 AC_ARG_WITH(openssl,
493 [AS_HELP_STRING(--with-openssl,specify OpenSSL location)],
494 [
495 if test "x$withval" != "xno" ; then
496 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
497 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
498 LDFLAGS="$LDFLAGS -L${withval}/lib"
499 CPPFLAGS="$CPPFLAGS -I${withval}/include"
500 else
501 LD_RUN_PATH="/usr/local/lib:/opt/openssl/lib:/usr/local/ssl/lib:${LD_RUN_PATH:+:}${LD_RUN_PATH}"
502 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/opt/openssl/lib"
503 CPPFLAGS="$CPPFLAGS -I/opt/openssl/include"
504 fi
505 fi
506 ])
507
508 AC_ARG_ENABLE(commoncrypto,
509 [AS_HELP_STRING(--disable-commoncrypto,disable CommonCrypto usage on Mac OS X)],
510 [
511 if test "x$enableval" = "xno"; then
512 DISABLE_COMMONCRYPTO="yes"
513 fi
514 ])
515
516 AC_ARG_WITH(bundled-openssl,
517 [AS_HELP_STRING(--with-bundled-openssl,use bundled OpenSSL libraries with product-specific prefix)],
518 [
519 OPENSSL_LIBSSL="nxssl"
520 OPENSSL_LIBCRYPTO="nxcrypto"
521 ])
522
523 AC_ARG_ENABLE(ssh,
524 [AS_HELP_STRING(--disable-ssh,disable SSH support)],
525 [
526 if test "x$enableval" = "xno"; then
527 DISABLE_SSH="yes"
528 fi
529 ])
530
531 AC_ARG_WITH(jemalloc,
532 [AS_HELP_STRING(--with-jemalloc,specify libjemalloc location)],
533 [
534 if test "x$withval" != "xno" ; then
535 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
536 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
537 LDFLAGS="$LDFLAGS -L${withval}/lib"
538 CPPFLAGS="$CPPFLAGS -I${withval}/include"
539 INSTALL_LIBPATH="${withval}/lib${INSTALL_LIBPATH:+:}${INSTALL_LIBPATH}"
540 fi
541 fi
542 ])
543
544 AC_ARG_ENABLE(iconv,
545 [AS_HELP_STRING(--disable-iconv,do not use iconv() for text conversions)],
546 [
547 if test "x$$enableval" = "xno"; then
548 DISABLE_ICONV="yes"
549 fi
550 ])
551
552 AC_ARG_ENABLE(ipv6,
553 [AS_HELP_STRING(--disable-ipv6,disable IPv6 support)],
554 [
555 if test "x$$enableval" = "xno"; then
556 DISABLE_IPV6="yes"
557 fi
558 ])
559
560 AC_ARG_ENABLE(iconv-cache,
561 [AS_HELP_STRING([--enable-iconv-cache=@<:@yes/no/auto@:>@],
562 [cache iconv descriptors [default=auto]])],,
563 [enable_iconv_cache=auto])
564
565 AC_ARG_ENABLE(readline,
566 [AS_HELP_STRING(--disable-readline,do not use libreadline)],
567 [
568 if test "x$$enableval" = "xno"; then
569 DISABLE_READLINE="yes"
570 fi
571 ])
572
573 AC_ARG_ENABLE(encryption,
574 [AS_HELP_STRING(--disable-encryption,disable encryption support)],
575 [
576 if test "x$$enableval" = "xno"; then
577 DISABLE_ENCRYPTION="yes"
578 XMPP_SUPPORT="no"
579 fi
580 ])
581
582 AC_ARG_ENABLE(lmsensors,
583 [AS_HELP_STRING(--disable-lmsensors,disable lmsensors support)],
584 [
585 if test "x$$enableval" = "xno"; then
586 DISABLE_LMSENSORS="yes"
587 fi
588 ])
589
590 AC_ARG_ENABLE(xmpp,
591 [AS_HELP_STRING(--disable-xmpp,disable XMPP support)],
592 [
593 if test "x$$enableval" = "xno"; then
594 XMPP_SUPPORT="no"
595 fi
596 ])
597
598 AC_ARG_ENABLE(ldap,
599 [AS_HELP_STRING(--disable-ldap,disable LDAP support)],
600 [
601 if test "x$$enableval" = "xno"; then
602 LDAP_SUPPORT="no"
603 fi
604 ])
605
606 AC_ARG_ENABLE(unicode,
607 [AS_HELP_STRING(--disable-unicode,disable UNICODE build)],
608 [
609 if test "x$enableval" = "xno"; then
610 BUILD_UNICODE="no"
611 FORCE_INTERNAL_LIBTRE="no"
612 DISABLE_READLINE="no"
613 fi
614 ])
615
616 AC_ARG_ENABLE(debug,
617 [AS_HELP_STRING(--enable-debug,enable additional debugging functionality)],
618 [
619 if test "x$enableval" = "xyes"; then
620 ENABLE_DEBUG="yes"
621 fi
622 ])
623
624 AC_ARG_ENABLE(werror,
625 [AS_HELP_STRING(--enable-werror,threat all warnings as errors)],
626 [
627 if test "x$enableval" = "xyes"; then
628 ENABLE_WERROR="yes"
629 fi
630 ])
631
632 AC_ARG_ENABLE(64bit,
633 [AS_HELP_STRING(--disable-64bit,disable 64bit build (force 32bit build on 64bit machine))],
634 [
635 if test "x$enableval" = "xno"; then
636 FORCE_32BIT_BUILD="yes"
637 fi
638 ])
639
640 AC_ARG_WITH(dist,
641 [AS_HELP_STRING(--with-dist,for maintainers only)],
642 DB_DRIVERS=" mysql pgsql odbc mssql sqlite oracle db2 informix"
643 MODULES="appagent jansson libexpat libstrophe libtre zlib libnetxms install sqlite snmp libnxsl libnxmb libnxlp libnxcc db server smsdrv agent libnxmap client nxscript nxcproxy nxlptest tools"
644 SUBAGENT_DIRS="linux ds18x20 freebsd openbsd minix mqtt mysql netbsd sunos aix ipso hpux odbcquery informix oracle lmsensors darwin rpi java jmx bind9 ubntlw netsvc db2 tuxedo mongodb ssh vmgr"
645 AGENT_DIRS="libnxtux"
646 SMSDRV_DIRS="anysms kannel mymobile nexmo nxagent slack smseagle text2reach websms"
647 HDLINK_DIRS="jira redmine"
648 PDSDRV_DIRS="rrdtool"
649 NXCONFIG="nxconfig"
650 TOP_LEVEL_MODULES="include sql images tests"
651 SERVER_INCLUDE="include"
652 CONTRIB_MODULES="mibs backgrounds music templates"
653 CLIENT_COMPONENTS="nxalarm nxevent nxpush nxshell nxsms"
654 SERVER_TOOLS="nxconfig"
655 )
656
657 AC_ARG_WITH(rpi-agent,
658 [AS_HELP_STRING(--with-rpi-agent,build Raspberry Pi agent)],
659 [
660 COMPONENTS="$COMPONENTS raspberrypi"
661 ])
662
663 AC_ARG_WITH(tests,
664 [AS_HELP_STRING(--with-tests,build tests)],
665 [
666 TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES tests"
667 ])
668
669
670 #--------------------------------------------------------------------
671 # Set LD_LIBRARY_PATH from LD_RUN_PATH because on some systems
672 # LD_RUN_PATH ignored by linker and some tests may fail
673 #--------------------------------------------------------------------
674
675 export LD_RUN_PATH
676 if test "x$LD_RUN_PATH" != "x"; then
677 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}${LD_RUN_PATH}"
678 export LD_LIBRARY_PATH
679 fi
680
681
682 #--------------------------------------------------------------------
683 # Validate command line parameters and set various checking options
684 #--------------------------------------------------------------------
685
686 check_substr "$COMPONENTS" "snmp"
687 if test $? = 0; then
688 MODULES="$MODULES snmp"
689 fi
690
691 check_substr "$COMPONENTS" "static-agent"
692 if test $? = 0; then
693 if test "x$COMPONENTS" != "x sqlite snmp static-agent sqlite_drv"; then
694 AC_MSG_ERROR(Static agent and other components are mutually exclusive.)
695 fi
696 STATIC_BUILD="yes"
697 BUILD_STATIC_AGENT="yes"
698 MODULES="$MODULES appagent libnxlp db agent"
699 DISABLE_ICONV="yes"
700 CPPFLAGS="$CPPFLAGS -D_STATIC_AGENT"
701 if test "x$PROPOSED_STATIC_SUBAGENTS" = "xdefault"; then
702 STATIC_SUBAGENT_LIST="ecs filemgr logwatch ping portcheck ups"
703 else
704 STATIC_SUBAGENT_LIST="$PROPOSED_STATIC_SUBAGENTS"
705 fi
706
707 SUBAGENT_LIBS="../subagents/ecs/ecs.la ../subagents/filemgr/filemgr.la ../subagents/logwatch/logwatch.la ../subagents/ping/ping.la ../subagents/portCheck/portcheck.la ../subagents/ups/ups.la"
708
709 check_substr "$STATIC_SUBAGENT_LIST" "odbcquery"
710 if test $? = 0; then
711 COMPONENTS="$COMPONENTS odbc"
712 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/odbcquery/odbcquery.la"
713 fi
714
715 check_substr "$STATIC_SUBAGENT_LIST" "oracle"
716 if test $? = 0; then
717 COMPONENTS="$COMPONENTS oracle"
718 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/oracle/oracle.la"
719 fi
720
721 check_substr "$STATIC_SUBAGENT_LIST" "informix"
722 if test $? = 0; then
723 COMPONENTS="$COMPONENTS informix"
724 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/informix/informix.la"
725 fi
726
727 check_substr "$STATIC_SUBAGENT_LIST" "db2"
728 if test $? = 0; then
729 COMPONENTS="$COMPONENTS db2"
730 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/db2/db2.la"
731 fi
732
733 check_substr "$STATIC_SUBAGENT_LIST" "mysql"
734 if test $? = 0; then
735 COMPONENTS="$COMPONENTS mysql"
736 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/mysql/mysql.la"
737 fi
738
739 case "$PLATFORM" in
740 Linux)
741 SUBAGENT_DIRS="linux ds18x20"
742 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/linux/linux.la ../subagents/ds18x20/ds18x20.la"
743 STATIC_SUBAGENT_LIST="linux ds18x20 $STATIC_SUBAGENT_LIST"
744 ;;
745 FreeBSD)
746 SUBAGENT_DIRS="freebsd"
747 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/freebsd/freebsd.la"
748 STATIC_SUBAGENT_LIST="freebsd $STATIC_SUBAGENT_LIST"
749 ;;
750 OpenBSD)
751 SUBAGENT_DIRS="openbsd"
752 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/openbsd/openbsd.la"
753 STATIC_SUBAGENT_LIST="openbsd $STATIC_SUBAGENT_LIST"
754 ;;
755 NetBSD)
756 SUBAGENT_DIRS="netbsd"
757 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/netbsd/netbsd.la"
758 STATIC_SUBAGENT_LIST="netbsd $STATIC_SUBAGENT_LIST"
759 ;;
760 SunOS)
761 SUBAGENT_DIRS="sunos"
762 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/sunos/sunos.la"
763 STATIC_SUBAGENT_LIST="sunos $STATIC_SUBAGENT_LIST"
764 ;;
765 AIX)
766 SUBAGENT_DIRS="aix"
767 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/aix/aix.la"
768 STATIC_SUBAGENT_LIST="aix $STATIC_SUBAGENT_LIST"
769 ;;
770 HP-UX)
771 SUBAGENT_DIRS="hpux"
772 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/hpux/hpux.la"
773 STATIC_SUBAGENT_LIST="hpux $STATIC_SUBAGENT_LIST"
774 ;;
775 Darwin)
776 SUBAGENT_DIRS="darwin"
777 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/darwin/darwin.la"
778 STATIC_SUBAGENT_LIST="darwin $STATIC_SUBAGENT_LIST"
779 ;;
780 Minix)
781 SUBAGENT_DIRS="minix"
782 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/minix/minix.la"
783 STATIC_SUBAGENT_LIST="minix $STATIC_SUBAGENT_LIST"
784 ;;
785 *)
786 # unknown
787 ;;
788 esac
789 fi
790
791 check_substr "$COMPONENTS" "ipso-agent"
792 if test $? = 0; then
793 if test "x$COMPONENTS" != "x ipso-agent"; then
794 AC_MSG_ERROR(IPSO agent and other components are mutually exclusive.)
795 fi
796 STATIC_BUILD="yes"
797 BUILD_STATIC_AGENT="yes"
798 DISABLE_ICONV="yes"
799 USE_PTH="yes"
800 MODULES="$MODULES appagent libnxlp db agent"
801 CPPFLAGS="$CPPFLAGS -D_STATIC_AGENT -D_IPSO -DSQLITE_THREADSAFE=0 -I/usr/local/include"
802 LDFLAGS="$LDFLAGS -all-static"
803 STATIC_SUBAGENT_LIST="ecs ipso logwatch ping portcheck ups"
804 SUBAGENT_DIRS="ipso"
805 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"
806 fi
807
808 check_substr "$COMPONENTS" "agent"
809 if test $? = 0; then
810 BUILD_AGENT="yes"
811 MODULES="$MODULES appagent libnxlp db agent"
812
813 case "$PLATFORM" in
814 Linux)
815 SUBAGENT_DIRS="linux ds18x20"
816 ;;
817 FreeBSD)
818 SUBAGENT_DIRS="freebsd"
819 ;;
820 OpenBSD)
821 SUBAGENT_DIRS="openbsd"
822 ;;
823 NetBSD)
824 SUBAGENT_DIRS="netbsd"
825 ;;
826 SunOS)
827 SUBAGENT_DIRS="sunos"
828 ;;
829 AIX)
830 SUBAGENT_DIRS="aix"
831 ;;
832 HP-UX)
833 SUBAGENT_DIRS="hpux"
834 ;;
835 Darwin)
836 SUBAGENT_DIRS="darwin"
837 ;;
838 Minix)
839 SUBAGENT_DIRS="minix"
840 ;;
841 *)
842 # unknown
843 ;;
844 esac
845 fi
846
847 check_substr "$COMPONENTS" "server"
848 if test $? = 0; then
849 if test "x$DBDRIVER_SELECTED" != "xyes"; then
850 AC_MSG_ERROR(You must select at least one database driver when building server.)
851 fi
852 BUILD_SERVER="yes"
853 MODULES="$MODULES libnxmap libnxsl libnxcc server smsdrv nxscript"
854 TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES sql images"
855 CONTRIB_MODULES="$CONTRIB_MODULES mibs backgrounds music templates"
856 SMSDRV_DIRS="$SMSDRV_DIRS nxagent"
857 if test "x$XMPP_SUPPORT" = "xyes"; then
858 MODULES="libstrophe $MODULES"
859 AC_DEFINE(XMPP_SUPPORTED, 1, Define to 1 if XMPP is supported)
860 fi
861 fi
862
863 check_substr "$COMPONENTS" "client"
864 if test $? = 0; then
865 BUILD_CLIENT="yes"
866 MODULES="$MODULES client"
867 CLIENT_COMPONENTS="$CLIENT_COMPONENTS nxalarm nxevent nxpush nxsms"
868 check_substr "$COMPONENTS" "java"
869 if test $? = 0; then
870 CLIENT_COMPONENTS="$CLIENT_COMPONENTS nxshell"
871 fi
872 fi
873
874 check_substr "$COMPONENTS" "client-proxy"
875 if test $? = 0; then
876 MODULES="$MODULES nxcproxy"
877 fi
878
879 check_substr "$COMPONENTS" "mysql"
880 if test $? = 0; then
881 DB_DRIVERS="$DB_DRIVERS mysql"
882 SUBAGENT_DIRS="$SUBAGENT_DIRS mysql"
883 fi
884
885 check_substr "$COMPONENTS" "pgsql"
886 if test $? = 0; then
887 DB_DRIVERS="$DB_DRIVERS pgsql"
888 fi
889
890 check_substr "$COMPONENTS" "sqlite_drv"
891 if test $? = 0; then
892 DB_DRIVERS="$DB_DRIVERS sqlite"
893 fi
894
895 check_substr "$COMPONENTS" "odbc"
896 if test $? = 0; then
897 DB_DRIVERS="$DB_DRIVERS odbc"
898 fi
899
900 check_substr "$COMPONENTS" "oracle"
901 if test $? = 0; then
902 DB_DRIVERS="$DB_DRIVERS oracle"
903 SUBAGENT_DIRS="$SUBAGENT_DIRS oracle"
904 fi
905
906 check_substr "$COMPONENTS" "db2"
907 if test $? = 0; then
908 DB_DRIVERS="$DB_DRIVERS db2"
909 SUBAGENT_DIRS="$SUBAGENT_DIRS db2"
910 fi
911
912 check_substr "$COMPONENTS" "informix"
913 if test $? = 0; then
914 DB_DRIVERS="$DB_DRIVERS informix"
915 SUBAGENT_DIRS="$SUBAGENT_DIRS informix"
916 fi
917
918 check_substr "$COMPONENTS" "raspberrypi"
919 if test $? = 0; then
920 SUBAGENT_DIRS="$SUBAGENT_DIRS rpi"
921 fi
922
923 check_substr "$COMPONENTS" "java"
924 if test $? = 0; then
925 SUBAGENT_DIRS="$SUBAGENT_DIRS java bind9 jmx ubntlw"
926 fi
927
928 check_substr "$COMPONENTS" "tuxedo"
929 if test $? = 0; then
930 AGENT_DIRS="$AGENT_DIRS libnxtux"
931 SUBAGENT_DIRS="$SUBAGENT_DIRS tuxedo"
932 fi
933
934 check_substr "$COMPONENTS" "mongodb"
935 if test $? = 0; then
936 SUBAGENT_DIRS="$SUBAGENT_DIRS mongodb"
937 fi
938
939 check_substr "$COMPONENTS" "vmgr"
940 if test $? = 0; then
941 SUBAGENT_DIRS="$SUBAGENT_DIRS vmgr"
942 fi
943
944 check_substr "$COMPONENTS" "sdk"
945 if test $? = 0; then
946 if test "x$STATIC_BUILD" = "xyes"; then
947 MODULES="$MODULES appagent libnxmap client libnxmb"
948 else
949 MODULES="$MODULES appagent libnxmap client libnxsl libnxmb libnxlp libnxcc db nxscript smsdrv snmp"
950 fi
951 fi
952
953
954 #--------------------------------------------------------------------
955 # Check for programs
956 #--------------------------------------------------------------------
957
958 if test "x$PLATFORM" = "xHP-UX"; then
959 AC_CHECK_PROG([CC], [aCC], [aCC])
960 AC_CHECK_PROG([CCC], [aCC], [aCC])
961 fi
962 if test "x$PLATFORM" = "xAIX"; then
963 AC_CHECK_PROG([CC], [xlc_r], [xlc_r])
964 AC_CHECK_PROG([CCC], [xlC_r], [xlC_r])
965 fi
966 if test "x$PLATFORM" = "xSunOS"; then
967 AC_CHECK_PROG([CC], [cc], [cc])
968 AC_CHECK_PROG([CCC], [CC], [CC])
969 fi
970 if test "x$PLATFORM" = "xMinix"; then
971 AC_CHECK_PROG([CC], [clang], [clang])
972 AC_CHECK_PROG([CCC], [clang++], [clang++])
973 fi
974 AC_PROG_CC
975 AC_PROG_CPP
976 AC_PROG_CXX
977 if test "x$CXX" = "xg++"; then
978 AC_CHECK_PROG([GPLUSPLUS], [g++], [yes], [no])
979 if test "x$GPLUSPLUS" = "xno"; then
980 AC_MSG_ERROR([*** FATAL: Cannot find any usable C++ compiler])
981 fi
982 fi
983 if test "x$CXX" = "xclang++"; then
984 LIBS="$LIBS -lc++"
985 fi
986 AM_PROG_AS
987 AC_PROG_INSTALL
988 AC_PROG_LEX
989 AC_CHECK_PROGS(YACC,bison byacc,yacc)
990 AC_PROG_LN_S
991
992 AC_ARG_VAR(PERL,local path to the perl interpreter)
993 perl_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/perl/bin:/opt/perl/usr/bin:/opt/perl/usr/local/bin"
994 AC_PATH_PROG(PERL,perl,/usr/bin/env perl,$perl_possible_path)
995
996
997 #--------------------------------------------------------------------
998 # C/C++ capabilities
999 #--------------------------------------------------------------------
1000
1001 AC_C_CONST
1002 AC_PROG_GCC_TRADITIONAL
1003 AC_C_BIGENDIAN
1004
1005
1006 #--------------------------------------------------------------------
1007 # Platform-dependent settings
1008 #--------------------------------------------------------------------
1009
1010 case "$PLATFORM" in
1011 AIX)
1012 LDFLAGS_PREFIX="-no-undefined -Wl,-brtl $LDFLAGS"
1013 ;;
1014 HP-UX)
1015 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"
1016 if test "x$CXX" = "xaCC"; then
1017 CPPFLAGS="$CPPFLAGS -D_HP_ATOMIC_INLINE"
1018 CFLAGS="$CFLAGS -AC99"
1019 CXXFLAGS="-mt $CXXFLAGS +W749 +W829 +W4232"
1020 LDFLAGS="$LDFLAGS -mt"
1021 fi
1022 if test `uname -m` != 'ia64'; then
1023 HPUX_HPPA="yes"
1024 fi
1025 ;;
1026 SunOS)
1027 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D__EXTENSIONS__"
1028 AC_MSG_CHECKING(whether C compiler accepts -O2)
1029 OLD_CPPFLAGS="$CPPFLAGS"
1030 CPPFLAGS="$CPPFLAGS -O2"
1031 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1032 [ AC_MSG_RESULT(yes) ],
1033 [
1034 CPPFLAGS="$OLD_CPPFLAGS"
1035 AC_MSG_RESULT(no)
1036 ])
1037 ;;
1038 Linux)
1039 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -O2"
1040 ;;
1041 Darwin)
1042 CPPFLAGS="$CPPFLAGS -Wno-deprecated-declarations -O2"
1043 ;;
1044 Minix)
1045 CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
1046 LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
1047 USE_PTH="yes"
1048 ;;
1049 *)
1050 ;;
1051 esac
1052
1053
1054 #--------------------------------------------------------------------
1055 # C++ compiler tuning:
1056 # * Disable C++ exceptions and RTTI
1057 # * Turn on 64bit mode on HP-UX/Itanium
1058 # * Turn on 64bit mode on AIX
1059 # * Turn on 64bit mode on Solaris
1060 # * Disable inconsistent C/C++ linkage warnings for Solaris Studio
1061 #--------------------------------------------------------------------
1062
1063 if test "x$ac_compiler_gnu" = "xyes" ; then
1064 SQLFLAGS="-x c -Wundef"
1065 CPPFLAGS="$CPPFLAGS -Wformat"
1066
1067 AC_MSG_CHECKING(whether C compiler accepts -Wno-unused-result)
1068 OLD_CPPFLAGS="$CPPFLAGS"
1069 CPPFLAGS="$CPPFLAGS -Wno-unused-result"
1070 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1071 [ AC_MSG_RESULT(yes) ],
1072 [
1073 CPPFLAGS="$OLD_CPPFLAGS"
1074 AC_MSG_RESULT(no)
1075 ])
1076
1077 AC_MSG_CHECKING(whether C compiler accepts -Werror=return-type)
1078 OLD_CPPFLAGS="$CPPFLAGS"
1079 CPPFLAGS="$CPPFLAGS -Werror=return-type"
1080 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1081 [ AC_MSG_RESULT(yes) ],
1082 [
1083 CPPFLAGS="$OLD_CPPFLAGS"
1084 AC_MSG_RESULT(no)
1085 ])
1086
1087 AC_LANG_PUSH([C++])
1088
1089 AC_MSG_CHECKING(whether C++ compiler accepts -fno-rtti)
1090 OLD_CXXFLAGS="$CXXFLAGS"
1091 CXXFLAGS="$CXXFLAGS -fno-rtti"
1092 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1093 [ AC_MSG_RESULT(yes) ],
1094 [
1095 CXXFLAGS="$OLD_CXXFLAGS"
1096 AC_MSG_RESULT(no)
1097 ])
1098
1099 AC_MSG_CHECKING(whether C++ compiler accepts -fno-exceptions)
1100 OLD_CXXFLAGS="$CXXFLAGS"
1101 CXXFLAGS="$CXXFLAGS -fno-exceptions"
1102 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1103 [ AC_MSG_RESULT(yes) ],
1104 [
1105 CXXFLAGS="$OLD_CXXFLAGS"
1106 AC_MSG_RESULT(no)
1107 ])
1108
1109 AC_LANG_POP([C++])
1110
1111 MACHINE=`uname -m`
1112 if test "x$MACHINE" = "xi686" -o "x$MACHINE" = "xi586"; then
1113 AC_MSG_CHECKING(whether C compiler accepts -march=$MACHINE)
1114 OLD_CPPFLAGS="$CPPFLAGS"
1115 CPPFLAGS="$CPPFLAGS -march=$MACHINE"
1116 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1117 [
1118 AC_MSG_RESULT(yes)
1119 ],
1120 [
1121 CPPFLAGS="$OLD_CPPFLAGS"
1122 AC_MSG_RESULT(no)
1123 ])
1124 fi
1125
1126 if test "x$PLATFORM" = "xHP-UX"; then
1127 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
1128 AC_MSG_CHECKING(whether C compiler accepts -milp32)
1129 OLD_CPPFLAGS="$CPPFLAGS"
1130 CPPFLAGS="$CPPFLAGS -milp32"
1131 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1132 [
1133 LDFLAGS="-milp32 $LDFLAGS"
1134 AC_MSG_RESULT(yes)
1135 ],
1136 [
1137 CPPFLAGS="$OLD_CPPFLAGS"
1138 AC_MSG_RESULT(no)
1139 ])
1140 else
1141 AC_MSG_CHECKING(whether C compiler accepts -mlp64)
1142 OLD_CPPFLAGS="$CPPFLAGS"
1143 CPPFLAGS="$CPPFLAGS -mlp64"
1144 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1145 [
1146 LDFLAGS="-mlp64 -L/usr/lib/hpux64 -L/usr/local/lib/hpux64 $LDFLAGS"
1147 AC_MSG_RESULT(yes)
1148 ],
1149 [
1150 CPPFLAGS="$OLD_CPPFLAGS"
1151 AC_MSG_RESULT(no)
1152 ])
1153 fi
1154 fi
1155
1156 if test "x$PLATFORM" = "xAIX"; then
1157 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
1158 AC_MSG_CHECKING(whether C compiler accepts -maix32)
1159 OLD_CPPFLAGS="$CPPFLAGS"
1160 CPPFLAGS="$CPPFLAGS -maix32"
1161 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1162 [
1163 LDFLAGS="-maix32 $LDFLAGS"
1164 LTINIT_CC="$CC -maix32"
1165 LTINIT_CXX="$CXX -maix32"
1166 OBJECT_MODE=32
1167 AC_MSG_RESULT(yes)
1168 ],
1169 [
1170 CPPFLAGS="$OLD_CPPFLAGS"
1171 AC_MSG_RESULT(no)
1172 ])
1173 else
1174 AC_MSG_CHECKING(whether C compiler accepts -maix64)
1175 OLD_CPPFLAGS="$CPPFLAGS"
1176 CPPFLAGS="$CPPFLAGS -maix64"
1177 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1178 [
1179 LDFLAGS="-maix64 $LDFLAGS"
1180 LTINIT_CC="$CC -maix64"
1181 LTINIT_CXX="$CXX -maix64"
1182 OBJECT_MODE=64
1183 AC_MSG_RESULT(yes)
1184 ],
1185 [
1186 CPPFLAGS="$OLD_CPPFLAGS"
1187 AC_MSG_RESULT(no)
1188 ])
1189 fi
1190 fi
1191
1192 if test "x$PLATFORM" = "xSunOS"; then
1193 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
1194 AC_MSG_CHECKING(whether C compiler accepts -m32)
1195 OLD_CPPFLAGS="$CPPFLAGS"
1196 CPPFLAGS="$CPPFLAGS -m32"
1197 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1198 [
1199 LDFLAGS="-m32 $LDFLAGS"
1200 LTINIT_CC="$CC -m32"
1201 LTINIT_CXX="$CXX -m32"
1202 AC_MSG_RESULT(yes)
1203 ],
1204 [
1205 CPPFLAGS="$OLD_CPPFLAGS"
1206 AC_MSG_RESULT(no)
1207 ])
1208 else
1209 AC_MSG_CHECKING(whether C compiler accepts -m64)
1210 OLD_CPPFLAGS="$CPPFLAGS"
1211 CPPFLAGS="$CPPFLAGS -m64"
1212 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1213 [
1214 LDFLAGS="-m64 $LDFLAGS"
1215 LTINIT_CC="$CC -m64"
1216 LTINIT_CXX="$CXX -m64"
1217 AC_MSG_RESULT(yes)
1218 ],
1219 [
1220 CPPFLAGS="$OLD_CPPFLAGS"
1221 AC_MSG_RESULT(no)
1222 ])
1223 fi
1224 fi
1225
1226
1227 if test "x$PLATFORM" = "xLinux"; then
1228 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
1229 AC_MSG_CHECKING(whether C compiler accepts -m32)
1230 OLD_CPPFLAGS="$CPPFLAGS"
1231 CPPFLAGS="$CPPFLAGS -m32"
1232 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1233 [
1234 LDFLAGS="-m32 $LDFLAGS"
1235 LTINIT_CC="$CC -m32"
1236 LTINIT_CXX="$CXX -m32"
1237 AC_MSG_RESULT(yes)
1238 ],
1239 [
1240 CPPFLAGS="$OLD_CPPFLAGS"
1241 AC_MSG_RESULT(no)
1242 ])
1243 fi
1244 fi
1245
1246 if test "x$ENABLE_DEBUG" = "xyes"; then
1247 CPPFLAGS="$CPPFLAGS -ggdb3"
1248 fi
1249 fi
1250
1251 if test "x$CXX" = "xaCC" ; then
1252 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
1253 if test "x$HPUX_HPPA" = "xyes"; then
1254 ARCHFLAG="+DA1.1"
1255 else
1256 ARCHFLAG="+DD32"
1257 fi
1258 AC_MSG_CHECKING(whether C compiler accepts $ARCHFLAG)
1259 OLD_CPPFLAGS="$CPPFLAGS"
1260 CPPFLAGS="$ARCHFLAG $CPPFLAGS"
1261 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1262 [
1263 LDFLAGS="$ARCHFLAG $LDFLAGS"
1264 CCASFLAGS="$ARCHFLAG $CCASFLAGS"
1265 AC_MSG_RESULT(yes)
1266 ],
1267 [
1268 CPPFLAGS="$OLD_CPPFLAGS"
1269 AC_MSG_RESULT(no)
1270 ])
1271 else
1272 if test "x$HPUX_HPPA" = "xyes"; then
1273 ARCHFLAG="+DA2.0W"
1274 else
1275 ARCHFLAG="+DD64"
1276 fi
1277 AC_MSG_CHECKING(whether C compiler accepts $ARCHFLAG)
1278 OLD_CPPFLAGS="$CPPFLAGS"
1279 CPPFLAGS="$ARCHFLAG $CPPFLAGS"
1280 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1281 [
1282 LDFLAGS="$ARCHFLAG $LDFLAGS"
1283 CCASFLAGS="$ARCHFLAG $CCASFLAGS"
1284 AC_MSG_RESULT(yes)
1285 ],
1286 [
1287 CPPFLAGS="$OLD_CPPFLAGS"
1288 AC_MSG_RESULT(no)
1289 ])
1290 fi
1291 fi
1292
1293 if test "x$CXX" = "xxlC_r" ; then
1294 SQLFLAGS="-qnoppline"
1295 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
1296 AC_MSG_CHECKING(whether C compiler accepts -q32)
1297 OLD_CPPFLAGS="$CPPFLAGS"
1298 CPPFLAGS="-q32 $CPPFLAGS"
1299 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1300 [
1301 LDFLAGS="-q32 $LDFLAGS"
1302 OBJECT_MODE=32
1303 AC_MSG_RESULT(yes)
1304 ],
1305 [
1306 CPPFLAGS="$OLD_CPPFLAGS"
1307 AC_MSG_RESULT(no)
1308 ])
1309 else
1310 AC_MSG_CHECKING(whether C compiler accepts -q64)
1311 OLD_CPPFLAGS="$CPPFLAGS"
1312 CPPFLAGS="-q64 $CPPFLAGS"
1313 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1314 [
1315 LDFLAGS="-q64 $LDFLAGS"
1316 OBJECT_MODE=64
1317 AC_MSG_RESULT(yes)
1318 ],
1319 [
1320 CPPFLAGS="$OLD_CPPFLAGS"
1321 AC_MSG_RESULT(no)
1322 ])
1323 fi
1324 fi
1325
1326 if test "x$CXX" = "xCC" ; then
1327 SQLFLAGS="-Qn"
1328 CPPFLAGS="$CPPFLAGS -mt"
1329 CXXFLAGS="$CXXFLAGS -erroff=badargtype2w,wbadinit"
1330
1331 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
1332 AC_MSG_CHECKING(whether C compiler accepts -m32)
1333 count=`$CC -flags | grep '^\-m32 ' | wc -l`
1334 if test $count -eq 1; then
1335 AC_MSG_RESULT(yes)
1336 CPPFLAGS="$CPPFLAGS -m32"
1337 LDFLAGS="-m32 $LDFLAGS"
1338 else
1339 AC_MSG_RESULT(no)
1340 fi
1341 else
1342 TEST_XARCH="no"
1343 AC_MSG_CHECKING(whether C compiler accepts -m64)
1344 count=`$CC -flags | grep '^\-m64 ' | wc -l`
1345 if test $count -eq 1; then
1346 AC_MSG_RESULT(yes)
1347 CPPFLAGS="$CPPFLAGS -m64"
1348 LDFLAGS="-m64 $LDFLAGS"
1349 else
1350 AC_MSG_RESULT(no)
1351 TEST_XARCH="yes"
1352 fi
1353 if test "x$TEST_XARCH" = "xyes"; then
1354 if test "x$CPUTYPE" = "xsparc"; then
1355 ARCH="-xarch=v9"
1356 else
1357 ARCH="-xarch=amd64"
1358 fi
1359 AC_MSG_CHECKING(whether C compiler accepts $ARCH)
1360 OLD_CPPFLAGS="$CPPFLAGS"
1361 CPPFLAGS="$CPPFLAGS $ARCH"
1362 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
1363 [
1364 LDFLAGS="$ARCH $LDFLAGS"
1365 AC_MSG_RESULT(yes)
1366 ],
1367 [
1368 CPPFLAGS="$OLD_CPPFLAGS"
1369 AC_MSG_RESULT(no)
1370 ])
1371 fi
1372 fi
1373 fi
1374
1375
1376 #--------------------------------------------------------------------
1377 # Initialize libtool
1378 #--------------------------------------------------------------------
1379
1380 if test "x$STATIC_BUILD" = "xyes"; then
1381 enable_shared=no
1382 enable_static=yes
1383 else
1384 enable_shared=yes
1385 if test "x$BUILD_SDK" = "xyes"; then
1386 enable_static=yes
1387 else
1388 enable_static=no
1389 fi
1390 fi
1391
1392 if test "x$LTINIT_CC" != "x"; then
1393 SAVED_CC="$CC"
1394 CC="$LTINIT_CC"
1395 fi
1396 if test "x$LTINIT_CXX" != "x"; then
1397 SAVED_CXX="$CXX"
1398 CXX="$LTINIT_CXX"
1399 fi
1400
1401 LT_PREREQ([2.2])
1402 LT_INIT([dlopen])
1403
1404 if test "x$SAVED_CC" != "x"; then
1405 CC="$SAVED_CC"
1406 fi
1407 if test "x$SAVED_CXX" != "x"; then
1408 CXX="$SAVED_CXX"
1409 fi
1410
1411
1412 #--------------------------------------------------------------------
1413 # Additional include and library directories
1414 #--------------------------------------------------------------------
1415
1416 if test "x$CXX" != "xaCC"; then
1417 if test -d /usr/local/include; then
1418 if test "x$ac_compiler_gnu" = "xyes"; then
1419 AC_MSG_CHECKING(whether -I/usr/local/include needed)
1420 OLD_CPPFLAGS="$CPPFLAGS"
1421 CPPFLAGS="$CPPFLAGS -Werror -I/usr/local/include"
1422 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
1423 [
1424 CPPFLAGS="$OLD_CPPFLAGS -I/usr/local/include"
1425 AC_MSG_RESULT(yes)
1426 ],
1427 [
1428 CPPFLAGS="$OLD_CPPFLAGS"
1429 AC_MSG_RESULT(no)
1430 ]
1431 )
1432 else
1433 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
1434 fi
1435 fi
1436
1437 if test -d /usr/kerberos/include; then
1438 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
1439 fi
1440
1441 if test -d /usr/local/lib; then
1442 LDFLAGS="$LDFLAGS -L/usr/local/lib"
1443 fi
1444 fi
1445
1446
1447 #--------------------------------------------------------------------
1448 # Check for additional system libraries
1449 #--------------------------------------------------------------------
1450
1451 AC_CHECK_LIB(xnet, accept)
1452 AC_CHECK_LIB(socket, if_nameindex)
1453 AC_CHECK_LIB(dl, dlopen)
1454 AC_CHECK_LIB(kstat, kstat_open)
1455
1456 # sockets/resolver
1457 if test "$BUILD_SERVER-$XMPP_SUPPORT" = "yes-yes"; then
1458 AC_CHECK_HEADERS([arpa/nameser_compat.h])
1459 AC_CHECK_FUNC(res_query, , [AC_CHECK_LIB(resolv, res_query, [], [AC_CHECK_LIB(resolv, __res_query)])])
1460 fi
1461 AC_CHECK_FUNC(connect, , [AC_CHECK_LIB(socket, connect)])
1462 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(resolv, gethostbyname)])
1463 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)])
1464
1465 if test "x$ac_cv_lib_nsl_gethostbyname" != "xyes" && test "x$ac_cv_func_gethostbyname" != "xyes" ; then
1466 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(socket, gethostbyname)])
1467 fi
1468
1469 if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname" ; then
1470 AC_MSG_CHECKING([if we can include libnsl + libsocket])
1471 LIBS="-lnsl -lsocket $LIBS"
1472 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void) gethostbyname]])],[my_ac_link_result=yes],[my_ac_link_result=no ])
1473 if test "$my_ac_link_result" = "no" ; then
1474 AC_MSG_RESULT([failure])
1475 AC_MSG_ERROR([unable to use gethostbyname()])
1476 else
1477 AC_MSG_RESULT([success])
1478 fi
1479 fi
1480
1481
1482 #--------------------------------------------------------------------
1483 # Check for threads library - either POSIX or GNU
1484 #--------------------------------------------------------------------
1485
1486 if test "x$USE_PTH" = "xyes"; then
1487 AC_CHECK_HEADER(pth.h,,AC_MSG_ERROR([*** GNU Pth thread support not installed - please install first ***]))
1488 CPPFLAGS="$CPPFLAGS -D_USE_GNU_PTH"
1489 LIBS="$LIBS -lpth"
1490 else
1491 AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed - please install first ***]))
1492
1493 if test "x$CXX" = "xaCC"; then
1494 PTHREAD_LIBS=""
1495 else
1496 PTHREAD_LIBS="error"
1497 AC_MSG_CHECKING(for old style FreeBSD -pthread flag)
1498 AC_EGREP_CPP(yes,
1499 [#if defined(__FreeBSD_cc_version) || defined(__OpenBSD__)
1500 yes
1501 #endif
1502 ], [
1503 AC_MSG_RESULT(yes)
1504 PTHREAD_LIBS="-pthread"
1505 if test "x$CXX" = "xc++"; then
1506 # Quash clang's "-pthread unused during compilation" warnings
1507 PTHREAD_LDFLAGS="-Wc,-Qunused-arguments"
1508 fi
1509 ],
1510 AC_MSG_RESULT(no))
1511 if test "x$PTHREAD_LIBS" = "xerror"; then
1512 AC_CHECK_LIB(pthread, pthread_attr_init,
1513 PTHREAD_LIBS="-lpthread")
1514 fi
1515 # On HP-UX (at least 11.00) pthread library contains
1516 # __pthread_attr_init_system instead of pthread_attr_init
1517 if test "x$PTHREAD_LIBS" = "xerror"; then
1518 AC_CHECK_LIB(pthread, __pthread_attr_init_system,
1519 PTHREAD_LIBS="-lpthread")
1520 fi
1521 if test "x$PTHREAD_LIBS" = "xerror"; then
1522 AC_CHECK_LIB(pthreads, pthread_attr_init,
1523 PTHREAD_LIBS="-lpthreads")
1524 fi
1525 if test "x$PTHREAD_LIBS" = "xerror"; then
1526 AC_CHECK_FUNC(pthread_attr_init,
1527 PTHREAD_LIBS="")
1528 fi
1529 fi
1530
1531 if test "x$PTHREAD_LIBS" = "xerror"; then
1532 AC_MSG_ERROR(*** Unable to locate working posix thread library ***)
1533 fi
1534 LIBS="$LIBS $PTHREAD_LIBS"
1535
1536 # Extensions to posix threads
1537 AC_CHECK_HEADERS([pthread_np.h],,,[
1538 #include <pthread.h>
1539 ])
1540 AC_CHECK_FUNCS([pthread_cond_reltimedwait_np])
1541
1542 # Check for recursive mutexes
1543 AC_CHECK_FUNCS([pthread_mutexattr_settype __pthread_mutexattr_settype pthread_mutexattr_setkind_np])
1544 AC_CHECK_DECLS([pthread_mutexattr_settype, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_RECURSIVE_NP, MUTEX_TYPE_COUNTING_FAST],,,[
1545 #include <pthread.h>
1546 #if HAVE_PTHREAD_NP_H
1547 #include <pthread_np.h>
1548 #endif
1549 ])
1550
1551 # Check for read/write locks
1552 # On Linux, rwlock functions declared always, but pthread_rwlock_t may need
1553 # additional defines
1554 AC_CHECK_FUNCS([pthread_rwlock_init pthread_rwlock_timedrdlock pthread_rwlock_timedwrlock])
1555 if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then
1556 AC_CACHE_CHECK([for pthread_rwlock_t], ac_cv_struct_pthread_rw,
1557 [AC_COMPILE_IFELSE([
1558 AC_LANG_PROGRAM([
1559 #include <sys/types.h>
1560 #include <pthread.h>
1561 ],
1562 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;])],
1563 ac_cv_struct_pthread_rw=yes, [
1564 AC_COMPILE_IFELSE([
1565 AC_LANG_PROGRAM([
1566 #define _XOPEN_SOURCE 500
1567 #include <sys/types.h>
1568 #include <pthread.h>
1569 ],
1570 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;])],
1571 ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
1572 if test "$ac_cv_struct_pthread_rw" = "yes"; then
1573 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
1574 fi
1575 ])])
1576 if test "$ac_cv_struct_pthread_rw" = "yes"; then
1577 AC_DEFINE(HAVE_PTHREAD_RWLOCK, 1, Define to 1 if you have working pthread read/write locks)
1578 fi
1579 fi
1580
1581 fi
1582
1583
1584 #--------------------------------------------------------------------
1585 # Checks for OpenSSL/CommonCrypto
1586 #--------------------------------------------------------------------
1587
1588 if test "x$DISABLE_ENCRYPTION" != "xyes" ; then
1589 USE_COMMONCRYPTO="no"
1590 if test "x$PLATFORM" = "xDarwin" -a "x$DISABLE_COMMONCRYPTO" != "xyes"; then
1591 AC_CHECK_FUNC(CC_MD5_Init, [
1592 AC_DEFINE(WITH_COMMONCRYPTO, 1, Define to 1 if you have CommonCrypto library and headers)
1593 USE_COMMONCRYPTO="yes"
1594 WITH_ENCRYPTION="yes"
1595 ])
1596 fi
1597 if test "x$USE_COMMONCRYPTO" != "xyes"; then
1598 AC_CHECK_LIB($OPENSSL_LIBCRYPTO, RSA_new,
1599 [
1600 AC_DEFINE(WITH_OPENSSL, 1, Define to 1 if you have OpenSSL library and headers)
1601 AC_CHECK_LIB($OPENSSL_LIBCRYPTO, EVP_aes_256_cbc,
1602 [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_AES,,[desc])])
1603 AC_CHECK_LIB($OPENSSL_LIBCRYPTO, EVP_bf_cbc,
1604 [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_BF,,[desc])])
1605 AC_CHECK_LIB($OPENSSL_LIBCRYPTO, EVP_idea_cbc,
1606 [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_IDEA,,[desc])])
1607 AC_CHECK_LIB($OPENSSL_LIBCRYPTO, EVP_des_ede3_cbc,
1608 [HAVE_LIBCRYPTO="yes"], [AC_DEFINE(NETXMS_NO_DES,,[desc])])
1609 if test "x$HAVE_LIBCRYPTO" = "xyes"; then
1610 WITH_ENCRYPTION="yes"
1611 LIBS="$LIBS -l$OPENSSL_LIBSSL -l$OPENSSL_LIBCRYPTO"
1612 else
1613 AC_MSG_ERROR(lib$OPENSSL_LIBCRYPTO does not provide any suitable encryption algorithm)
1614 fi
1615
1616 AC_CHECK_FUNCS([X509_STORE_set_verify_cb])
1617 ],
1618 [
1619 AC_MSG_ERROR(lib$OPENSSL_LIBCRYPTO is required for encryption support)
1620 ])
1621 fi
1622 fi
1623
1624
1625 #--------------------------------------------------------------------
1626 # Checks for header files
1627 #--------------------------------------------------------------------
1628
1629 AC_CHECK_HEADERS([sys/types.h sys/stat.h unistd.h stdarg.h fcntl.h])
1630 AC_CHECK_HEADERS([sys/int_types.h time.h sys/time.h sys/utsname.h sys/wait.h])
1631 AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h netinet/tcp.h net/nh.h sys/socket.h])
1632 AC_CHECK_HEADERS([fcntl.h dirent.h sys/ioctl.h sys/sockio.h poll.h termios.h])
1633 AC_CHECK_HEADERS([inttypes.h memory.h stdint.h stdlib.h strings.h string.h])
1634 AC_CHECK_HEADERS([readline/readline.h byteswap.h sys/select.h dlfcn.h locale.h])
1635 AC_CHECK_HEADERS([sys/sysctl.h sys/param.h sys/user.h vm/vm_param.h syslog.h])
1636 AC_CHECK_HEADERS([grp.h pwd.h malloc.h stdbool.h utime.h])
1637 AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h],,,
1638 [[#ifdef HAVE_SYS_TYPES_H
1639 # include <sys/types.h>
1640 #endif
1641 #ifdef HAVE_SYS_TIME_H
1642 # include <sys/time.h>
1643 #endif
1644 #ifdef HAVE_SYS_SOCKET_H
1645 # include <sys/socket.h>
1646 #endif
1647 ]])
1648
1649
1650 #--------------------------------------------------------------------
1651 # Checks for alloca
1652 #--------------------------------------------------------------------
1653
1654 AC_CHECK_HEADERS([alloca.h])
1655 AC_MSG_CHECKING(for alloca)
1656 AC_LANG_PUSH([C++])
1657 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1658 #if HAVE_STDLIB_H
1659 #include <stdlib.h>
1660 #endif
1661 #if HAVE_MALLOC_H
1662 #include <malloc.h>
1663 #endif
1664 #if HAVE_ALLOCA_H
1665 #include <alloca.h>
1666 #endif
1667 ]],[[
1668 char *p = (char *)alloca(256);
1669 return (p != NULL) ? 0 : 1;
1670 ]])
1671 ],[
1672 AC_MSG_RESULT(yes)
1673 AC_DEFINE(HAVE_ALLOCA,1,Define to 1 if alloca function is available)
1674 ],[
1675 AC_MSG_RESULT(no)
1676 AC_DEFINE(HAVE_ALLOCA,0,Define to 1 if alloca function is available)
1677 ])
1678 AC_LANG_POP([C++])
1679
1680
1681 #--------------------------------------------------------------------
1682 # Checks for d_type in struct dirent
1683 #--------------------------------------------------------------------
1684
1685 AC_MSG_CHECKING(for d_type in struct dirent)
1686 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1687 #if HAVE_STDLIB_H
1688 #include <stdlib.h>
1689 #endif
1690 #if HAVE_DIRENT_H
1691 #include <dirent.h>
1692 #endif
1693 ]],[[
1694 struct dirent d;
1695 return d.d_type;
1696 ]])
1697 ],[
1698 AC_MSG_RESULT(yes)
1699 AC_DEFINE(HAVE_DIRENT_D_TYPE,1,Define to 1 if struct dirent has member d_type)
1700 ],[
1701 AC_MSG_RESULT(no)
1702 AC_DEFINE(HAVE_DIRENT_D_TYPE,0,Define to 1 if struct dirent has member d_type)
1703 ])
1704 AC_CHECK_DECLS([DT_DIR, DT_REG, DT_UNKNOWN],,,[
1705 #if HAVE_DIRENT_H
1706 #include <dirent.h>
1707 #endif
1708 ])
1709
1710
1711 #--------------------------------------------------------------------
1712 # Checks for IPv6 support
1713 #--------------------------------------------------------------------
1714
1715 if test "x$DISABLE_IPV6" != "xyes"; then
1716 AC_CHECK_DECL(AF_INET6,,,[
1717 #if HAVE_NETINET_IN_H
1718 #include <netinet/in.h>
1719 #endif
1720 ])
1721 if test "x$ac_cv_have_decl_AF_INET6" = "xyes"; then
1722 AC_CHECK_TYPE(struct sockaddr_in6, [
1723 AC_DEFINE(WITH_IPV6, 1, Define to have IPv6 support)
1724 IPV6_SUPPORT="yes"
1725 ],,[
1726 #if HAVE_NETINET_IN_H
1727 #include <netinet/in.h>
1728 #endif
1729 ])
1730 fi
1731 fi
1732
1733
1734 #--------------------------------------------------------------------
1735 # Checks for RADIUS client library
1736 #--------------------------------------------------------------------
1737
1738 if test "x$BUILD_SERVER" = "xyes" ; then
1739 AC_CHECK_HEADERS([radcli/radcli.h])
1740 if test "x$ac_cv_header_radcli_radcli_h" = "xyes"; then
1741 AC_CHECK_LIB(radcli, rc_auth, [
1742 SERVER_LIBS="$SERVER_LIBS -lradcli"
1743 AC_DEFINE(USE_RADCLI, 1, Define to 1 if radcli is used as RADIUS client)
1744 ])
1745 fi
1746 fi
1747
1748
1749 #--------------------------------------------------------------------
1750 # Checks for other libs.
1751 #--------------------------------------------------------------------
1752
1753 if test "x$BUILD_SERVER" = "xyes" ; then
1754 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"]))])
1755 if test "x$DISABLE_READLINE" = "xno"; then
1756 AC_CHECK_LIB(readline, readline, [SERVER_LIBS="$SERVER_LIBS -lreadline"], [AC_CHECK_LIB(edit, readline, [SERVER_LIBS="$SERVER_LIBS -ledit"])])
1757
1758 SAVED_LIBS="$LIBS"
1759 LIBS="$LIBS $SERVER_LIBS"
1760
1761 AC_CHECK_FUNCS([readline])
1762
1763 # Check if passing rl_insert to rl_bind_key needs cast
1764 if test "$ac_cv_func_readline" = "yes"; then
1765 AC_LANG_PUSH([C++])
1766
1767 AC_MSG_CHECKING(for rl_insert cast)
1768
1769 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1770 [
1771 #include <stdio.h>
1772 #include <readline/readline.h>
1773 ],[ rl_bind_key('\t', (Function *)rl_insert); ])],
1774 [
1775 AC_MSG_RESULT((Function *))
1776 AC_DEFINE(RL_INSERT_CAST,(Function *),Required cast for rl_insert)
1777 ],[
1778 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1779 [
1780 #include <stdio.h>
1781 #include <readline/readline.h>
1782 ],[ rl_bind_key('\t', (rl_command_func_t *)rl_insert); ])],
1783 [
1784 AC_MSG_RESULT((rl_command_func_t *))
1785 AC_DEFINE(RL_INSERT_CAST,(rl_command_func_t *),Required cast for rl_insert)
1786 ],[
1787 AC_MSG_RESULT(not needed)
1788 AC_DEFINE(RL_INSERT_CAST,,Required cast for rl_insert)
1789 ]
1790 )
1791 ]
1792 )
1793
1794 AC_LANG_POP([C++])
1795 fi
1796 LIBS="$SAVED_LIBS"
1797 fi
1798 fi
1799
1800 check_substr "$COMPONENTS" "sqlite"
1801 if test $? = 0; then
1802 if test "x$FORCE_INTERNAL_SQLITE" = "xyes"; then
1803 HAVE_SQLITE=no
1804 else
1805 OLD_LIBS="$LIBS"
1806 HAVE_SQLITE=yes
1807 AC_CHECK_HEADER(sqlite3.h,,HAVE_SQLITE=no)
1808 if test "x$HAVE_SQLITE" = "xyes"; then
1809 AC_CHECK_LIB(sqlite3, sqlite3_initialize, [], [ HAVE_SQLITE=no ])
1810 fi
1811 if test "x$HAVE_SQLITE" = "xyes"; then
1812 if test "x$cross_compiling" = "xyes"; then
1813 AC_MSG_WARN([Cross-compiling mode is active, assuming libsqlite3 is thread-safe])
1814 else
1815 AC_MSG_CHECKING(if libsqlite3 is thread-safe)
1816 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1817 #include <sqlite3.h>
1818 ]],[[
1819 return sqlite3_threadsafe() ? 0 : 1;
1820 ]])
1821 ],[
1822 AC_MSG_RESULT(yes)
1823 ],[
1824 AC_MSG_RESULT(no)
1825 HAVE_SQLITE=no
1826 ])
1827 fi
1828 fi
1829 LIBS="$OLD_LIBS"
1830 fi
1831 if test "x$HAVE_SQLITE" = "xno"; then
1832 MODULES="sqlite $MODULES"
1833 fi
1834 fi
1835
1836 if test "x$FORCE_INTERNAL_ZLIB" = "xyes"; then
1837 HAVE_ZLIB=no
1838 else
1839 HAVE_ZLIB=yes
1840 AC_CHECK_HEADER(zlib.h,,HAVE_ZLIB=no)
1841 if test "x$HAVE_ZLIB" = "xyes"; then
1842 AC_CHECK_LIB(z, deflate, [], [ HAVE_ZLIB=no ])
1843 fi
1844 fi
1845 if test "x$HAVE_ZLIB" = "xno"; then
1846 MODULES="zlib $MODULES"
1847 fi
1848
1849 if test "x$FORCE_INTERNAL_EXPAT" = "xyes"; then
1850 HAVE_LIBEXPAT=no
1851 else
1852 HAVE_LIBEXPAT=yes
1853 AC_CHECK_HEADER(expat.h,,HAVE_LIBEXPAT=no)
1854 AC_CHECK_LIB(expat, XML_Parse, [], [ HAVE_LIBEXPAT=no ])
1855 fi
1856 if test "x$HAVE_LIBEXPAT" = "xno"; then
1857 MODULES="libexpat $MODULES"
1858 fi
1859
1860 if test "x$FORCE_INTERNAL_LIBTRE" = "xyes"; then
1861 HAVE_LIBTRE=no
1862 else
1863 HAVE_LIBTRE=yes
1864 AC_CHECK_HEADER(tre/regex.h,,HAVE_LIBTRE=no)
1865 AC_CHECK_LIB(tre, tre_compile, [], [ HAVE_LIBTRE=no ])
1866 fi
1867 if test "x$HAVE_LIBTRE" = "xno"; then
1868 MODULES="libtre $MODULES"
1869 AC_DEFINE(USE_BUNDLED_LIBTRE,1,Define to 1 if bundled libtre is used)
1870
1871 tre_version_1='0'
1872 tre_version_2='8'
1873 tre_version_3='0'
1874 tre_version=$tre_version_1.$tre_version_2.$tre_version_3
1875 AC_DEFINE_UNQUOTED(TRE_VERSION, "$tre_version", [ TRE version string. ])
1876 AC_DEFINE_UNQUOTED(TRE_VERSION_1, $tre_version_1, [ TRE version level 1. ])
1877 AC_DEFINE_UNQUOTED(TRE_VERSION_2, $tre_version_2, [ TRE version level 2. ])
1878 AC_DEFINE_UNQUOTED(TRE_VERSION_3, $tre_version_3, [ TRE version level 3. ])
1879 AC_SUBST(TRE_VERSION, $tre_version)
1880
1881 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])
1882 AC_DEFINE(TRE_APPROX, 1, [ Define if you want to enable approximate matching functionality. ])
1883 fi
1884
1885 if test "x$FORCE_INTERNAL_JANSSON" = "xyes"; then
1886 HAVE_JANSSON=no
1887 else
1888 HAVE_JANSSON=yes
1889 AC_CHECK_HEADER(jansson.h,,HAVE_JANSSON=no)
1890 AC_CHECK_LIB(jansson, json_object, [ HAVE_JANSSON=yes ], [ HAVE_JANSSON=no ])
1891 fi
1892 if test "x$HAVE_JANSSON" = "xno"; then
1893 MODULES="jansson $MODULES"
1894 fi
1895
1896 if test "x$DISABLE_LMSENSORS" = "xno"; then
1897 HAVE_LMSENSORS=yes
1898 AC_CHECK_HEADER(sensors/sensors.h,,HAVE_LMSENSORS=no)
1899 if test "x$HAVE_LMSENSORS" = "xyes"; then
1900 AC_CHECK_LIB(sensors, sensors_init, [ DUMMY="" ], [ HAVE_LMSENSORS=no ])
1901 fi
1902 if test "x$HAVE_LMSENSORS" = "xyes"; then
1903 SUBAGENT_DIRS="$SUBAGENT_DIRS lmsensors"
1904 fi
1905 fi
1906
1907 AC_CHECK_HEADER(curl/curl.h,HAVE_LIBCURL=yes,HAVE_LIBCURL=no)
1908 if test "x$HAVE_LIBCURL" = "xyes"; then
1909 AC_CHECK_LIB(curl, curl_global_init, [ HAVE_LIBCURL=yes ], [ HAVE_LIBCURL=no ])
1910 AC_CHECK_DECLS([CURLOPT_NOSIGNAL, curl_version_info],,,[
1911 #ifdef HAVE_CURL_CURL_H
1912 #include <curl/curl.h>
1913 #endif
1914 ])
1915 fi
1916
1917 if test "x$HAVE_LIBCURL" = "xyes"; then
1918 SUBAGENT_DIRS="$SUBAGENT_DIRS netsvc"
1919 SMSDRV_DIRS="$SMSDRV_DIRS anysms kannel mymobile nexmo slack smseagle text2reach websms"
1920 HDLINK_DIRS="$HDLINK_DIRS jira redmine"
1921 AC_DEFINE(HAVE_LIBCURL, 1, Define to 1 if libcurl is available)
1922 fi
1923
1924 if test "x$DISABLE_SSH" != "xyes"; then
1925 AC_CHECK_HEADER(libssh/libssh.h,HAVE_LIBSSH=yes,HAVE_LIBSSH=no)
1926 if test "x$HAVE_LIBSSH" = "xyes"; then
1927 AC_CHECK_LIB(ssh, ssh_version, [ HAVE_LIBSSH=yes ], [ HAVE_LIBSSH=no ])
1928 fi
1929
1930 if test "x$HAVE_LIBSSH" = "xyes"; then
1931 SUBAGENT_DIRS="$SUBAGENT_DIRS ssh"
1932 AC_DEFINE(HAVE_LIBSSH, 1, Define to 1 if libssh is available)
1933 else
1934 AC_MSG_ERROR(libssh is required for SSH support. Check that it is installed or use --disable-ssh option)
1935 fi
1936 else
1937 HAVE_LIBSSH=no
1938 fi
1939
1940 if test "x$LDAP_SUPPORT" = "xyes"; then
1941 AC_CHECK_HEADER(ldap.h,HAVE_LDAP=yes,HAVE_LDAP=no)
1942 if test "x$HAVE_LDAP" = "xyes"; then
1943 AC_CHECK_LIB(ldap, ldap_init, [ HAVE_LDAP=yes ], [ HAVE_LDAP=no ])
1944 if test "x$HAVE_LDAP" = "xyes"; then
1945 AC_CHECK_LIB(lber, ber_init, [ SERVER_LIBS="-llber $SERVER_LIBS" ])
1946 fi
1947 fi
1948 if test "x$HAVE_LDAP" = "xyes"; then
1949 SERVER_LIBS="-lldap $SERVER_LIBS"
1950 AC_DEFINE(WITH_LDAP, 1, Define to 1 if you have LDAP libraries and headers)
1951 AC_CHECK_HEADERS([ldap_ssl.h],,,
1952 [
1953 #include <ldap.h>
1954 ])
1955 AC_CHECK_TYPES([ber_int_t],,,
1956 [
1957 #include <ldap.h>
1958 #if HAVE_LDAP_SSL_H
1959 #include <ldap_ssl.h>
1960 #endif
1961 ])
1962
1963 OLD_LIBS="$LIBS"
1964 LIBS="$LIBS -lldap"
1965 AC_CHECK_FUNCS([ldap_initialize ldapssl_init])
1966 AC_CHECK_FUNCS([ldap_control_create ldap_create_control nsldapi_build_control])
1967 AC_CHECK_FUNCS([ldap_create_page_control ldap_parse_page_control])
1968 LIBS="$OLD_LIBS"
1969
1970 AC_CHECK_DECLS([nsldapi_build_control],,,
1971 [
1972 #include <ldap.h>
1973 #if HAVE_LDAP_SSL_H
1974 #include <ldap_ssl.h>
1975 #endif
1976 ])
1977 fi
1978 LDAP_SUPPORT="$HAVE_LDAP"
1979 fi
1980
1981 #--------------------------------------------------------------------
1982 # Checks for data types
1983 #--------------------------------------------------------------------
1984
1985 AC_CHECK_SIZEOF(short)
1986 AC_CHECK_SIZEOF(int)
1987 AC_CHECK_SIZEOF(long)
1988 AC_CHECK_SIZEOF(long long)
1989
1990 AC_TYPE_PID_T
1991 AC_TYPE_SIZE_T
1992 AC_STRUCT_TIMEZONE
1993
1994 AC_CHECK_TYPES([long long, unsigned long long, int64_t, uint64_t, u_int64_t, uuid_t, bool],,,[
1995 #ifdef HAVE_STDBOOL_H
1996 #include <stdbool.h>
1997 #endif
1998 #ifdef HAVE_STDINT_H
1999 #include <stdint.h>
2000 #endif
2001 ])
2002 AC_CHECK_TYPES([mode_t, off_t, socklen_t],,,[
2003 #if HAVE_SYS_TYPES_H
2004 #include <sys/types.h>
2005 #endif
2006 #if HAVE_SYS_SOCKET_H
2007 #include <sys/socket.h>
2008 #endif
2009 ])
2010 AC_CHECK_TYPES([struct stat64],,,[
2011 #if HAVE_SYS_STAT_H
2012 #include <sys/stat.h>
2013 #endif
2014 ])
2015
2016
2017 #--------------------------------------------------------------------
2018 # Checks for functions
2019 #--------------------------------------------------------------------
2020
2021 AC_FUNC_ERROR_AT_LINE
2022 AC_FUNC_MEMCMP
2023 AC_FUNC_SELECT_ARGTYPES
2024 AC_FUNC_STRFTIME
2025 AC_FUNC_STRTOD
2026 AC_FUNC_VPRINTF
2027
2028 AC_CHECK_FUNCS([gettimeofday memmove memset bcopy strchr strcspn strdup strerror])
2029 AC_CHECK_FUNCS([strrchr strlwr strtok_r strtol strtoul strtoll strtoull setlocale])
2030 AC_CHECK_FUNCS([tolower if_nametoindex daemon mmap strerror_r scandir uname poll])
2031 AC_CHECK_FUNCS([usleep nanosleep gmtime_r localtime_r stat64 fstat64 lstat64])
2032 AC_CHECK_FUNCS([fopen64 strptime timegm gethostbyname2_r getaddrinfo rand_r])
2033 AC_CHECK_FUNCS([itoa _itoa isatty getgrnam getpwnam malloc_info malloc_trim utime])
2034
2035 AC_CHECK_DECLS([nanosleep, daemon, strerror])
2036
2037 # Do not use inet_pton on Solaris as it has binary compatibility problems
2038 if test "$PLATFORM" != "SunOS"; then
2039 AC_CHECK_FUNCS([inet_pton])
2040 fi
2041
2042 # Check if strerror_r is POSIX-compliant
2043 if test "$ac_cv_func_strerror_r" = "yes"; then
2044 AC_MSG_CHECKING(if strerror_r is POSIX compliant)
2045 AC_LANG_PUSH([C++])
2046 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2047 #if HAVE_STRING_H
2048 #include <string.h>
2049 #endif
2050 #if HAVE_ERRNO_H
2051 #include <errno.h>
2052 #endif
2053 ]],[[
2054 int e;
2055 char buffer[256];
2056 e = strerror_r(1, buffer, 256);
2057 return e;
2058 ]])
2059 ],[
2060 AC_MSG_RESULT(yes)
2061 AC_DEFINE(HAVE_POSIX_STRERROR_R,1,Define to 1 if strerror_r function is POSIX compliant)
2062 ],[
2063 AC_MSG_RESULT(no)
2064 AC_DEFINE(HAVE_POSIX_STRERROR_R,0,Define to 1 if strerror_r function is POSIX compliant)
2065 ])
2066 AC_LANG_POP([C++])
2067 fi
2068
2069 # Check if struct tm has tm_gmtoff member
2070 AC_MSG_CHECKING(for struct tm.tm_gmtoff)
2071 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2072 #if HAVE_TIME_H
2073 #include <time.h>
2074 #endif
2075 #if HAVE_SYS_TIME_H
2076 #include <sys/time.h>
2077 #endif
2078 ]],[[
2079 struct tm t;
2080 return t.tm_gmtoff;
2081 ]])
2082 ],[
2083 AC_MSG_RESULT(yes)
2084 AC_DEFINE(HAVE_TM_GMTOFF,1,Define to 1 if struct tm has tm_gmtoff member)
2085 ],[
2086 AC_MSG_RESULT(no)
2087 ])
2088
2089 AC_CHECK_FUNCS([sysctlbyname sysctlnametomib])
2090 AC_CHECK_FUNCS([tcgetattr tcsetattr cfsetospeed cfsetispeed])
2091
2092 # asprintf, scprintf, etc.
2093 AC_CHECK_FUNCS([asprintf aswprintf vasprintf vaswprintf])
2094 AC_CHECK_FUNCS([scprintf scwprintf vscprintf vscwprintf])
2095 AC_CHECK_FUNCS([snprintf vsnprintf])
2096
2097 AC_MSG_CHECKING(whether snprintf returns required buffer size)
2098 AC_RUN_IFELSE(
2099 [AC_LANG_PROGRAM([
2100 #include <stdio.h>
2101 #include <string.h>
2102 ], [
2103 return !(snprintf(NULL, 0, "test: %d", 1000) >= 10);
2104 ])
2105 ],
2106 [ AC_MSG_RESULT(yes)
2107 AC_DEFINE(SNPRINTF_RETURNS_REQUIRED_SIZE, 1, Define to 1 if snprintf returns required buffer size in case of truncation)
2108 ],
2109 [ AC_MSG_RESULT(no) ],
2110 [ AC_MSG_RESULT(no) ]
2111 )
2112
2113 AC_MSG_CHECKING(whether free correctly handles NULL pointer)
2114 AC_RUN_IFELSE(
2115 [AC_LANG_PROGRAM([
2116 #include <stdlib.h>
2117 ], [
2118 free(NULL);
2119 return 0;
2120 ])
2121 ],
2122 [ AC_MSG_RESULT(yes)
2123 AC_DEFINE(FREE_IS_NULL_SAFE, 1, Define to 1 if free corectly handles NULL pointer)
2124 ],
2125 [ AC_MSG_RESULT(no) ],
2126 [ AC_MSG_RESULT(no) ]
2127 )
2128
2129
2130 #--------------------------------------------------------------------
2131 # Checks for macros and definitions
2132 #--------------------------------------------------------------------
2133
2134 AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64, htonll, ntohll],,,[
2135 #ifdef HAVE_SYS_TYPES_H
2136 #include <sys/types.h>
2137 #endif
2138 #if HAVE_BYTESWAP_H
2139 #include <byteswap.h>
2140 #endif
2141 #if HAVE_NETINET_IN_H
2142 #include <netinet/in.h>
2143 #endif
2144 #if HAVE_NET_NH_H
2145 #include <net/nh.h>
2146 #endif
2147 ])
2148 AC_CHECK_DECLS([RTLD_NOW, RTLD_GLOBAL],,,[
2149 #ifdef HAVE_UNISTD_H
2150 #include <unistd.h>
2151 #endif
2152 #ifdef HAVE_DLFCN_H
2153 #include <dlfcn.h>
2154 #endif
2155 ])
2156 AC_CHECK_DECLS([va_copy, __va_copy],,,[
2157 #ifdef HAVE_UNISTD_H
2158 #include <unistd.h>
2159 #endif
2160 #ifdef HAVE_STDARG_H
2161 #include <stdarg.h>
2162 #endif
2163 #ifdef HAVE_STDLIB_H
2164 #include <stdlib.h>
2165 #endif
2166 ])
2167
2168
2169 #--------------------------------------------------------------------
2170 # getopt
2171 #--------------------------------------------------------------------
2172
2173 if test "x$FORCE_INTERNAL_GETOPT" = "xyes"; then
2174 AC_DEFINE([USE_BUNDLED_GETOPT], [1], [Define to 1 if bundled getopt must be used])
2175 else
2176 AC_CHECK_HEADERS([getopt.h])
2177 AC_CHECK_LIB(gnugetopt, getopt_long)
2178 AC_CHECK_DECLS([getopt_long],,,[
2179 #if HAVE_GETOPT_H
2180 #include <getopt.h>
2181 #endif
2182 ])
2183 fi
2184
2185
2186 #--------------------------------------------------------------------
2187 # Linux specific checks
2188 #--------------------------------------------------------------------
2189
2190 if test "x$PLATFORM" = "xLinux"; then
2191 AC_CHECK_HEADERS([sys/reboot.h],,,[[ ]])
2192 AC_CHECK_DECLS([reboot, RB_AUTOBOOT, RB_POWER_OFF, RB_HALT_SYSTEM],,,[
2193 #if HAVE_SYS_REBOOT_H
2194 #include <sys/reboot.h>
2195 #endif
2196 ])
2197 AC_CHECK_FUNCS([reboot],,,[
2198 #if HAVE_SYS_REBOOT_H
2199 #include <sys/reboot.h>
2200 #endif
2201 ])
2202
2203 AC_CHECK_HEADERS([jemalloc/jemalloc.h],
2204 [
2205 AC_CHECK_LIB(jemalloc, malloc,
2206 [
2207 WITH_JEMALLOC="yes"
2208 AC_DEFINE(WITH_JEMALLOC,1,Define to 1 if libjemalloc is used)
2209 ])
2210 ])
2211 fi
2212
2213
2214 #--------------------------------------------------------------------
2215 # AIX specific checks
2216 #--------------------------------------------------------------------
2217
2218 if test "x$PLATFORM" = "xAIX"; then
2219 AC_CHECK_HEADERS([procinfo.h],,,[[ ]])
2220 AC_CHECK_DECLS([getkerninfo, getprocs, getprocs64, __sync_add_and_fetch, __sync_sub_and_fetch],,,[
2221 #if HAVE_PROCINFO_H
2222 #include <procinfo.h>
2223 #endif
2224 ])
2225 AC_CHECK_FUNCS([getprocs64],,,[
2226 #if HAVE_PROCINFO_H
2227 #include <procinfo.h>
2228 #endif
2229 ])
2230 fi
2231
2232
2233 #--------------------------------------------------------------------
2234 # Solaris specific checks
2235 #--------------------------------------------------------------------
2236
2237 if test "x$PLATFORM" = "xSunOS"; then
2238 AC_CHECK_FUNCS([atomic_inc_32_nv atomic_dec_32_nv],,,[
2239 #include <sys/atomic.h>
2240 ])
2241 fi
2242
2243
2244 #--------------------------------------------------------------------
2245 # HP-UX specific checks
2246 #--------------------------------------------------------------------
2247
2248 if test "x$PLATFORM" = "xHP-UX"; then
2249 AC_CHECK_HEADERS([atomic.h sys/mib.h],,,[[ ]])
2250 AC_CHECK_DECLS([SIOCGIFNAME, SIOCGIFINDEX],,,[
2251 #if HAVE_NET_IF_H
2252 #include <net/if.h>
2253 #endif
2254 ])
2255 AC_CHECK_DECLS([ID_ifXEntry, open_mib_64],,,[
2256 #if HAVE_SYS_MIB_H
2257 #include <sys/mib.h>
2258 #endif
2259 ])
2260
2261 AC_MSG_CHECKING(if pst_diskinfo has read/write stats fields)
2262 AC_LANG_PUSH([C++])
2263 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2264 #include <sys/pstat.h>
2265 ]], [[
2266 pst_diskinfo d;
2267 int x;
2268 x = (int)d.psd_dkread;
2269 x = (int)d.psd_dkwrite;
2270 ]])],
2271 [
2272 AC_DEFINE([HAVE_DISKINFO_RWSTATS],[1],[Define to 1 if pst_diskinfo has read/write stats fields])
2273 AC_MSG_RESULT(yes)
2274 ],
2275 [
2276 AC_MSG_RESULT(no)
2277 ])
2278 AC_LANG_POP([C++])
2279 fi
2280
2281
2282 #--------------------------------------------------------------------
2283 # *BSD specific checks
2284 #--------------------------------------------------------------------
2285
2286 AC_CHECK_HEADERS([sys/event.h])
2287 AC_CHECK_LIB(kvm, kvm_open)
2288 AC_CHECK_FUNCS([kvm_openfiles kvm_getswapinfo kqueue])
2289 AC_CHECK_TYPES([struct kinfo_proc2],,,[
2290 #if HAVE_SYS_SYSCTL_H
2291 #include <sys/sysctl.h>
2292 #endif
2293 ])
2294
2295
2296 #--------------------------------------------------------------------
2297 # FreeBSD specific checks
2298 #--------------------------------------------------------------------
2299
2300 if test "x$PLATFORM" = "xFreeBSD"; then
2301 AC_CHECK_DECLS([RTF_WASCLONED],[],[],[
2302 #if HAVE_SYS_TYPES_H
2303 #include <sys/types.h>
2304 #endif
2305 #if HAVE_SYS_SOCKET_H
2306 #include <sys/socket.h>
2307 #endif
2308 #include <net/route.h>
2309 ])
2310 fi
2311
2312
2313 #--------------------------------------------------------------------
2314 # OpenBSD specific checks
2315 #--------------------------------------------------------------------
2316
2317 if test "x$PLATFORM" = "xOpenBSD"; then
2318 AC_MSG_CHECKING(if kvm_getprocs requires sizeof kinfo_proc argument)
2319 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2320 #include <sys/param.h>
2321 #include <sys/proc.h>
2322 #include <kvm.h>
2323 #include <sys/user.h>
2324 ]],[[
2325 int count;
2326 kvm_getprocs(NULL, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc), &count);
2327 return 0;
2328 ]])
2329 ],[
2330 AC_MSG_RESULT(yes)
2331 AC_DEFINE(KVM_GETPROCS_REQUIRES_SIZEOF,1,Define to 1 if kvm_getprocs requires sizeof kinfo_proc)
2332 ],[
2333 AC_MSG_RESULT(no)
2334 AC_DEFINE(KVM_GETPROCS_REQUIRES_SIZEOF,0,Define to 1 if kvm_getprocs requires sizeof kinfo_proc)
2335 ])
2336
2337 AC_MSG_CHECKING(if struct kinfo_proc has member kp_proc)
2338 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2339 #include <sys/param.h>
2340 #include <sys/proc.h>
2341 #include <kvm.h>
2342 #include <sys/user.h>
2343 ]],[[
2344 struct kinfo_proc p;
2345 return p.kp_proc.p_pid;
2346 ]])
2347 ],[
2348 AC_MSG_RESULT(yes)
2349 AC_DEFINE(KINFO_PROC_HAS_KP_PROC,1,Define to 1 if struct kinfo_proc has member kp_proc)
2350 ],[
2351 AC_MSG_RESULT(no)
2352 AC_DEFINE(KINFO_PROC_HAS_KP_PROC,0,Define to 1 if struct kinfo_proc has member kp_proc)
2353 ])
2354 fi
2355
2356
2357 #--------------------------------------------------------------------
2358 # Minix specific checks
2359 #--------------------------------------------------------------------
2360
2361 if test "x$PLATFORM" = "xMinix"; then
2362 AC_CHECK_HEADERS([minix/minlib.h])
2363 fi
2364
2365
2366 #--------------------------------------------------------------------
2367 # Check for UNICODE stuff
2368 #--------------------------------------------------------------------
2369
2370 if test "x$BUILD_UNICODE" = "xyes"; then
2371 CPPFLAGS="$CPPFLAGS -DUNICODE"
2372 fi
2373
2374 AC_CHECK_HEADERS([wchar.h wctype.h iconv.h widec.h])
2375 AC_CHECK_TYPES([wchar_t, wint_t],,,[
2376 #if HAVE_WCHAR_H
2377 #include <wchar.h>
2378 #endif
2379 ])
2380 AC_CHECK_SIZEOF(wchar_t,,[
2381 #if HAVE_WCHAR_H
2382 #include <wchar.h>
2383 #endif
2384 ])
2385 AC_CHECK_FUNCS([wcslen wcsdup wcsncpy wcstoll wcstoull towupper towlower])
2386 AC_CHECK_FUNCS([wcslwr wcserror wcserror_r wfopen wfopen64 fputws putws])
2387 AC_CHECK_FUNCS([wopen wstat waccess wgetenv wrename wunlink wremove wchdir])
2388 AC_CHECK_FUNCS([wmkdir wrmdir wsystem wmkstemp wpopen wctime wchmod vwscanf])
2389 AC_CHECK_FUNCS([vswscanf vfwscanf wcscasecmp wcsncasecmp wcstombs wcsrtombs])
2390 AC_CHECK_FUNCS([mbstowcs mbsrtowcs itow _itow wcsftime wcstok wutime])
2391
2392 AC_CHECK_DECLS([putws],,,[
2393 #if HAVE_WCHAR_H
2394 #include <wchar.h>
2395 #endif
2396 ])
2397
2398 if test "x$ac_cv_func_wcsftime" = "xyes"; then
2399 AC_MSG_CHECKING(whether wcsftime is working correctly)
2400 AC_RUN_IFELSE(
2401 [AC_LANG_PROGRAM([
2402 #include <stdio.h>
2403 #ifdef HAVE_UNISTD_H
2404 #include <unistd.h>
2405 #endif
2406 #ifdef HAVE_TIME_H
2407 #include <time.h>
2408 #endif
2409 #ifdef HAVE_SYS_TIME_H
2410 #include <sys/time.h>
2411 #endif
2412 #if HAVE_WCHAR_H
2413 #include <wchar.h>
2414 #endif
2415 ], [[
2416 wchar_t buffer[64];
2417 struct tm *ltm;
2418 time_t t;
2419
2420 t = time(NULL);
2421 ltm = localtime(&t);
2422 wcsftime(buffer, 64, L"%Y", ltm);
2423 return wcstol(buffer, NULL, 10) == ltm->tm_year + 1900 ? 0 : 1;
2424 ]])
2425 ],
2426 [ AC_MSG_RESULT(yes)
2427 AC_DEFINE(WORKING_WCSFTIME, 1, Define to 1 if wcsftime is working correctly)
2428 ],
2429 [ AC_MSG_RESULT(no) ],
2430 [ AC_MSG_RESULT(no) ]
2431 )
2432 fi
2433
2434 if test "x$DISABLE_ICONV" != "xyes"; then
2435 AC_CHECK_LIB(iconv, libiconv_open,
2436 [ ac_found_iconv=yes
2437 LIBS="$LIBS -liconv"
2438 AC_CHECK_FUNCS(libiconv, ac_found_iconv=yes, ac_found_iconv=no)
2439 ],
2440 [
2441 AC_CHECK_LIB(iconv, iconv,
2442 [ ac_found_iconv=yes
2443 LIBS="$LIBS -liconv"
2444 ])
2445 AC_CHECK_FUNCS(iconv, ac_found_iconv=yes, ac_found_iconv=no)
2446 ])
2447 else
2448 ac_found_iconv=no
2449 CPPFLAGS="$CPPFLAGS -D__DISABLE_ICONV"
2450 fi
2451
2452 AC_MSG_CHECKING(whether fgetws can be used with popen)
2453 AC_RUN_IFELSE(
2454 [AC_LANG_PROGRAM([
2455 #include <stdio.h>
2456 #ifdef HAVE_UNISTD_H
2457 #include <unistd.h>
2458 #endif
2459 #if HAVE_WCHAR_H
2460 #include <wchar.h>
2461 #endif
2462 ], [[
2463 int rc = 1;
2464 wchar_t line[4096];
2465 FILE *f = popen("echo test", "r");
2466 if(f!=NULL)
2467 {
2468 fgetws(line, 4096, f);
2469 pclose(f);
2470 rc = 0;
2471 }
2472 return rc;
2473 ]])
2474 ],
2475 [ AC_MSG_RESULT(yes)
2476 AC_DEFINE(SAFE_FGETWS_WITH_POPEN, 1, Define to 1 if fgetws can be used with popen)
2477 ],
2478 [ AC_MSG_RESULT(no) ],
2479 [ AC_MSG_RESULT(no) ]
2480 )
2481
2482 AC_MSG_CHECKING(whether iconv supports UCS-2-INTERNAL)
2483 AC_RUN_IFELSE(
2484 [AC_LANG_PROGRAM([
2485 #if HAVE_ICONV_H
2486 #include <iconv.h>
2487 #endif
2488 ], [
2489 return iconv_open("UTF-8","UCS-2-INTERNAL")==(iconv_t)(-1);
2490 ])
2491 ],
2492 [ AC_MSG_RESULT(yes)
2493 AC_DEFINE(HAVE_ICONV_UCS_2_INTERNAL, 1, Define to 1 if iconv supports UCS-2-INTERNAL)
2494 valid_ucs2_code="UCS-2-INTERNAL"
2495 ],
2496 [ AC_MSG_RESULT(no) ],
2497 [ AC_MSG_RESULT(no) ]
2498 )
2499
2500 AC_MSG_CHECKING(whether iconv supports UCS-2)
2501 AC_RUN_IFELSE(
2502 [AC_LANG_PROGRAM([
2503 #if HAVE_ICONV_H
2504 #include <iconv.h>
2505 #endif
2506 ], [
2507 return iconv_open("UTF-8","UCS-2")==(iconv_t)(-1);
2508 ])
2509 ],
2510 [ AC_MSG_RESULT(yes)
2511 AC_DEFINE(HAVE_ICONV_UCS_2, 1, Define to 1 if iconv supports UCS-2)
2512 valid_ucs2_code="UCS-2"
2513 ],
2514 [ AC_MSG_RESULT(no) ],
2515 [ AC_MSG_RESULT(no) ]
2516 )
2517
2518 AC_MSG_CHECKING(whether iconv supports UCS2)
2519 AC_RUN_IFELSE(
2520 [AC_LANG_PROGRAM([
2521 #if HAVE_ICONV_H
2522 #include <iconv.h>
2523 #endif
2524 ], [
2525 return iconv_open("UTF-8","UCS2")==(iconv_t)(-1);
2526 ])
2527 ],
2528 [ AC_MSG_RESULT(yes)
2529 AC_DEFINE(HAVE_ICONV_UCS2, 1, Define to 1 if iconv supports UCS2)
2530 valid_ucs2_code="UCS2"
2531 ],
2532 [ AC_MSG_RESULT(no) ],
2533 [ AC_MSG_RESULT(no) ]
2534 )
2535
2536 AC_MSG_CHECKING(whether iconv supports UCS-2BE)
2537 AC_RUN_IFELSE(
2538 [AC_LANG_PROGRAM([
2539 #if HAVE_ICONV_H
2540 #include <iconv.h>
2541 #endif
2542 ], [
2543 return iconv_open("UTF-8","UCS-2BE")==(iconv_t)(-1);
2544 ])
2545 ],
2546 [ AC_MSG_RESULT(yes)
2547 AC_DEFINE(HAVE_ICONV_UCS_2BE, 1, Define to 1 if iconv supports UCS-2BE)
2548 valid_ucs2_code="UCS-2BE"
2549 ],
2550 [ AC_MSG_RESULT(no) ],
2551 [ AC_MSG_RESULT(no) ]
2552 )
2553
2554 AC_MSG_CHECKING(whether iconv supports UCS-2LE)
2555 AC_RUN_IFELSE(
2556 [AC_LANG_PROGRAM([
2557 #if HAVE_ICONV_H
2558 #include <iconv.h>
2559 #endif
2560 ], [
2561 return iconv_open("UTF-8","UCS-2LE")==(iconv_t)(-1);
2562 ])
2563 ],
2564 [ AC_MSG_RESULT(yes)
2565 AC_DEFINE(HAVE_ICONV_UCS_2LE, 1, Define to 1 if iconv supports UCS-2LE)
2566 valid_ucs2_code="UCS-2LE"
2567 ],
2568 [ AC_MSG_RESULT(no) ],
2569 [ AC_MSG_RESULT(no) ]
2570 )
2571
2572 AC_MSG_CHECKING(whether iconv supports UTF-16)
2573 AC_RUN_IFELSE(
2574 [AC_LANG_PROGRAM([
2575 #if HAVE_ICONV_H
2576 #include <iconv.h>
2577 #endif
2578 ], [
2579 return iconv_open("UTF-8","UTF-16")==(iconv_t)(-1);
2580 ])
2581 ],
2582 [ AC_MSG_RESULT(yes)
2583 AC_DEFINE(HAVE_ICONV_UTF_16, 1, Define to 1 if iconv supports UTF-16)
2584 valid_ucs2_code="UTF-16"
2585 ],
2586 [ AC_MSG_RESULT(no) ],
2587 [ AC_MSG_RESULT(no) ]
2588 )
2589
2590 AC_MSG_CHECKING(whether iconv supports UCS-4-INTERNAL)
2591 AC_RUN_IFELSE(
2592 [AC_LANG_PROGRAM([
2593 #if HAVE_ICONV_H
2594 #include <iconv.h>
2595 #endif
2596 ], [
2597 return iconv_open("UTF-8","UCS-4-INTERNAL")==(iconv_t)(-1);
2598 ])
2599 ],
2600 [ AC_MSG_RESULT(yes)
2601 AC_DEFINE(HAVE_ICONV_UCS_4_INTERNAL, 1, Define to 1 if iconv supports UCS-4-INTERNAL)
2602 valid_ucs4_code="UCS-4-INTERNAL"
2603 ],
2604 [ AC_MSG_RESULT(no) ],
2605 [ AC_MSG_RESULT(no) ]
2606 )
2607
2608 AC_MSG_CHECKING(whether iconv supports UCS-4)
2609 AC_RUN_IFELSE(
2610 [AC_LANG_PROGRAM([
2611 #if HAVE_ICONV_H
2612 #include <iconv.h>
2613 #endif
2614 ], [
2615 return iconv_open("UTF-8","UCS-4")==(iconv_t)(-1);
2616 ])
2617 ],
2618 [ AC_MSG_RESULT(yes)
2619 AC_DEFINE(HAVE_ICONV_UCS_4, 1, Define to 1 if iconv supports UCS-4)
2620 valid_ucs4_code="UCS-4"
2621 ],
2622 [ AC_MSG_RESULT(no) ],
2623 [ AC_MSG_RESULT(no) ]
2624 )
2625
2626 AC_MSG_CHECKING(whether iconv supports UCS4)
2627 AC_RUN_IFELSE(
2628 [AC_LANG_PROGRAM([
2629 #if HAVE_ICONV_H
2630 #include <iconv.h>
2631 #endif
2632 ], [
2633 return iconv_open("UTF-8","UCS4")==(iconv_t)(-1);
2634 ])
2635 ],
2636 [ AC_MSG_RESULT(yes)
2637 AC_DEFINE(HAVE_ICONV_UCS4, 1, Define to 1 if iconv supports UCS4)
2638 valid_ucs4_code="UCS4"
2639 ],
2640 [ AC_MSG_RESULT(no) ],
2641 [ AC_MSG_RESULT(no) ]
2642 )
2643
2644 AC_MSG_CHECKING(whether iconv supports UCS-4BE)
2645 AC_RUN_IFELSE(
2646 [AC_LANG_PROGRAM([
2647 #if HAVE_ICONV_H
2648 #include <iconv.h>
2649 #endif
2650 ], [
2651 return iconv_open("UTF-8","UCS-4BE")==(iconv_t)(-1);
2652 ])
2653 ],
2654 [ AC_MSG_RESULT(yes)
2655 AC_DEFINE(HAVE_ICONV_UCS_4BE, 1, Define to 1 if iconv supports UCS-4BE)
2656 valid_ucs4_code="UCS-4BE"
2657 ],
2658 [ AC_MSG_RESULT(no) ],
2659 [ AC_MSG_RESULT(no) ]
2660 )
2661
2662 AC_MSG_CHECKING(whether iconv supports UCS-4LE)
2663 AC_RUN_IFELSE(
2664 [AC_LANG_PROGRAM([
2665 #if HAVE_ICONV_H
2666 #include <iconv.h>
2667 #endif
2668 ], [
2669 return iconv_open("UTF-8","UCS-4LE")==(iconv_t)(-1);
2670 ])
2671 ],
2672 [ AC_MSG_RESULT(yes)
2673 AC_DEFINE(HAVE_ICONV_UCS_4LE, 1, Define to 1 if iconv supports UCS-4LE)
2674 valid_ucs4_code="UCS-4LE"
2675 ],
2676 [ AC_MSG_RESULT(no) ],
2677 [ AC_MSG_RESULT(no) ]
2678 )
2679
2680 AC_MSG_CHECKING(whether iconv supports UTF-32)
2681 AC_RUN_IFELSE(
2682 [AC_LANG_PROGRAM([
2683 #if HAVE_ICONV_H
2684 #include <iconv.h>
2685 #endif
2686 ], [
2687 return iconv_open("UTF-8","UTF-32")==(iconv_t)(-1);
2688 ])
2689 ],
2690 [ AC_MSG_RESULT(yes)
2691 AC_DEFINE(HAVE_ICONV_UTF_32, 1, Define to 1 if iconv supports UTF-32)
2692 valid_ucs4_code="UTF-32"
2693 ],
2694 [ AC_MSG_RESULT(no) ],
2695 [ AC_MSG_RESULT(no) ]
2696 )
2697
2698 AC_MSG_CHECKING(whether iconv supports //IGNORE)
2699 AC_RUN_IFELSE(
2700 [AC_LANG_PROGRAM([
2701 #if HAVE_ICONV_H
2702 #include <iconv.h>
2703 #endif
2704 ], [
2705 return iconv_open("UTF-8//IGNORE","$valid_ucs2_code")==(iconv_t)(-1);
2706 ])
2707 ],
2708 [ AC_MSG_RESULT(yes)
2709 AC_DEFINE(HAVE_ICONV_IGNORE, 1, Define to 1 if iconv supports //IGNORE option)
2710 ],
2711 [ AC_MSG_RESULT(no) ],
2712 [ AC_MSG_RESULT(no) ]
2713 )
2714
2715 AC_MSG_CHECKING(whether iconv supports state reset)
2716 AC_RUN_IFELSE(
2717 [AC_LANG_PROGRAM([
2718 #include <stdio.h>
2719 #if HAVE_ICONV_H
2720 #include <iconv.h>
2721 #endif
2722 ], [
2723 iconv_t cd = iconv_open("UTF-8","$valid_ucs2_code");
2724 if (cd == (iconv_t)(-1)) return 1;
2725 return iconv(cd, NULL, NULL, NULL, NULL) != 0;
2726 ])
2727 ],
2728 [ AC_MSG_RESULT(yes)
2729 AC_DEFINE(HAVE_ICONV_STATE_RESET, 1, Define to 1 if iconv supports state reset)
2730 ],
2731 [ AC_MSG_RESULT(no) ],
2732 [ AC_MSG_RESULT(no) ]
2733 )
2734
2735 AC_MSG_CHECKING(whether iconv descriptor cache is needed)
2736 case $enable_iconv_cache in
2737 auto)
2738 case $PLATFORM in
2739 SunOS|HP-UX|AIX)
2740 enable_iconv_cache=yes
2741 ;;
2742 *)
2743 enable_iconv_cache=no
2744 ;;
2745 esac
2746 ;;
2747 yes|no)
2748 ;;
2749 *)
2750 AC_MSG_ERROR([Value given to --enable-iconv-cache must be one of yes, no or auto])
2751 ;;
2752 esac
2753 if test "x$enable_iconv_cache" = "xyes"; then
2754 AC_DEFINE(WITH_ICONV_CACHE, 1, Define to 1 to enable iconv descriptor cache)
2755 fi
2756 AC_MSG_RESULT($enable_iconv_cache)
2757
2758 # taken from ZSH's configure
2759 # Check if iconv uses const in prototype declaration
2760 if test "x$ac_found_iconv" = "xyes"; then
2761 AC_LANG_PUSH([C++])
2762 AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
2763 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2764 #include <stdlib.h>
2765 #if HAVE_ICONV_H
2766 #include <iconv.h>
2767 #endif
2768 ]],
2769 [[
2770 char **p = NULL;
2771 iconv(0, (const char **)p, 0, 0, 0);
2772 ]])],
2773 [ac_cv_iconv_const=const],
2774 [ac_cv_iconv_const=])])
2775 AC_LANG_POP([C++])
2776 AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
2777 [Define as const if the declaration of iconv() needs const.])
2778 fi
2779
2780 if test "x$ac_cv_type_wchar_t" = "xyes"; then
2781 if test $ac_cv_sizeof_wchar_t -eq 2; then
2782 AC_DEFINE(UNICODE_UCS2, 1, Define to 1 if you have 2-byte wchar_t)
2783 fi
2784
2785 if test $ac_cv_sizeof_wchar_t -eq 4; then
2786 AC_DEFINE(UNICODE_UCS4, 1, Define to 1 if you have 4-byte wchar_t)
2787 fi
2788
2789 if test "x$USE_INTERNAL_LIBTRE" = "xyes"; then
2790 AC_DEFINE(TRE_WCHAR, 1, [ Define to enable wide character support in libtre.])
2791 fi
2792 else
2793 if test "x$BUILD_UNICODE" = "xyes"; then
2794 AC_MSG_ERROR(wchar_t is required for UNICODE build)
2795 fi
2796 fi
2797
2798
2799 #--------------------------------------------------------------------
2800 # MySQL
2801 #--------------------------------------------------------------------
2802
2803 check_substr "$COMPONENTS" "mysql"
2804 if test $? = 0; then
2805 OLD_CPPFLAGS="$CPPFLAGS"
2806 OLD_LDFLAGS="$LDFLAGS"
2807 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2808
2809 CPPFLAGS="$CPPFLAGS $MYSQL_CPPFLAGS"
2810 LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
2811 if test "x$MYSQL_LD_RUN_PATH" != "x"; then
2812 LD_RUN_PATH="${MYSQL_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2813 fi
2814
2815 AC_CHECK_HEADER(mysql.h,,AC_MSG_ERROR([Cannot find mysql.h - check your MySQL client installation]))
2816
2817 AC_CHECK_LIB(mysqlclient, mysql_init, [MYSQL_LIBS="-lmysqlclient"],
2818 [AC_MSG_ERROR(libmysqlclient is requred for MySQL support)])
2819
2820 OLD_LIBS="$LIBS"
2821 LIBS="$LIBS $MYSQL_LIBS"
2822
2823 AC_CHECK_FUNCS(mysql_real_escape_string)
2824
2825 CPPFLAGS="$OLD_CPPFLAGS"
2826 LDFLAGS="$OLD_LDFLAGS"
2827 LD_RUN_PATH="$OLD_LD_RUN_PATH"
2828 LIBS="$OLD_LIBS"
2829 fi
2830
2831
2832 #--------------------------------------------------------------------
2833 # PostgreSQL
2834 #--------------------------------------------------------------------
2835
2836 check_substr "$COMPONENTS" "pgsql"
2837 if test $? = 0; then
2838 OLD_CPPFLAGS="$CPPFLAGS"
2839 OLD_LDFLAGS="$LDFLAGS"
2840 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2841
2842 CPPFLAGS="$CPPFLAGS $PGSQL_CPPFLAGS"
2843 LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS"
2844 if test "x$PGSQL_LD_RUN_PATH" != "x"; then
2845 LD_RUN_PATH="${PGSQL_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2846 fi
2847
2848 AC_CHECK_HEADER(libpq-fe.h,,AC_MSG_ERROR([Cannot find libpq-fe.h - check your PostgreSQL client installation]))
2849
2850 AC_CHECK_DECLS([PGRES_SINGLE_TUPLE],,,[
2851 #include <libpq-fe.h>
2852 ])
2853
2854 AC_CHECK_LIB(m, floor)
2855 AC_CHECK_LIB(pq, PQconnectdb, [PGSQL_LIBS="-lpq"], [
2856 if test "x$PLATFORM" = "xSunOS"; then
2857 if test -d "$PGSQL_LD_RUN_PATH/sparcv9"; then
2858 PGSQL_LDFLAGS="$PGSQL_LDFLAGS/sparcv9"
2859 else
2860 PGSQL_LDFLAGS="$PGSQL_LDFLAGS/64"
2861 fi
2862 LDFLAGS="$OLD_LDFLAGS $PGSQL_LDFLAGS"
2863 if test "x$PGSQL_LD_RUN_PATH" != "x"; then
2864 PGSQL_LD_RUN_PATH="$PGSQL_LD_RUN_PATH/sparcv9"
2865 LD_RUN_PATH="${PGSQL_LD_RUN_PATH}${OLD_LD_RUN_PATH:+:}${OLD_LD_RUN_PATH}"
2866 fi
2867 unset ac_cv_lib_pq_PQconnectdb
2868 AC_CHECK_LIB(pq, PQconnectdb, [PGSQL_LIBS="-lpq"], [
2869 AC_MSG_ERROR(libpq is required for PostgreSQL support)])
2870 else
2871 AC_MSG_ERROR(libpq is required for PostgreSQL support)
2872 fi
2873 ])
2874
2875 CPPFLAGS="$OLD_CPPFLAGS"
2876 LDFLAGS="$OLD_LDFLAGS"
2877 LD_RUN_PATH="$OLD_LD_RUN_PATH"
2878 fi
2879
2880
2881 #--------------------------------------------------------------------
2882 # ODBC
2883 #--------------------------------------------------------------------
2884
2885 check_substr "$COMPONENTS" "odbc"
2886 if test $? = 0; then
2887 OLD_CPPFLAGS="$CPPFLAGS"
2888 OLD_LDFLAGS="$LDFLAGS"
2889 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2890
2891 CPPFLAGS="$CPPFLAGS $ODBC_CPPFLAGS"
2892 LDFLAGS="$LDFLAGS $ODBC_LDFLAGS"
2893 if test "x$ODBC_LD_RUN_PATH" != "x"; then
2894 LD_RUN_PATH="${ODBC_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2895 fi
2896
2897 AC_CHECK_LIB(odbc, SQLAllocHandle, [ODBC_LIBS="-lodbc"],
2898 [AC_MSG_ERROR(libodbc is required for ODBC support)])
2899 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2900 SUBAGENT_LIBS="$SUBAGENT_LIBS $ODBC_LIBS"
2901 AC_CHECK_LIB(ltdl, lt_dlopen, [SUBAGENT_LIBS="$SUBAGENT_LIBS -lltdl"], [])
2902 fi
2903
2904 CPPFLAGS="$OLD_CPPFLAGS"
2905 LDFLAGS="$OLD_LDFLAGS"
2906 LD_RUN_PATH="$OLD_LD_RUN_PATH"
2907 fi
2908
2909
2910 #--------------------------------------------------------------------
2911 # Oracle
2912 #--------------------------------------------------------------------
2913
2914 check_substr "$COMPONENTS" "oracle"
2915 if test $? = 0; then
2916 OLD_CPPFLAGS="$CPPFLAGS"
2917 OLD_LDFLAGS="$LDFLAGS"
2918 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2919
2920 CPPFLAGS="$CPPFLAGS $ORACLE_CPPFLAGS"
2921 LDFLAGS="$LDFLAGS $ORACLE_LDFLAGS"
2922 if test "x$ORACLE_LD_RUN_PATH" != "x"; then
2923 LD_RUN_PATH="${ORACLE_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2924 fi
2925
2926 AC_CHECK_HEADER(oci.h,,AC_MSG_ERROR([*** Cannot find oci.h - check your Oracle client installation ***]))
2927 AC_CHECK_LIB(nnz12, nzstrcpy, [NNZ_LIB=-lnnz12],
2928 [
2929 AC_CHECK_LIB(nnz11, nzstrcpy, [NNZ_LIB=-lnnz11],
2930 [
2931 AC_CHECK_LIB(nnz10, nzstrcpy, [NNZ_LIB=-lnnz10], [], [-lclntsh])
2932 ], [-lclntsh])
2933 ], [-lclntsh])
2934 AC_CHECK_LIB(clntsh, OCIHandleAlloc, [ORACLE_LIBS="-lclntsh $NNZ_LIB"],
2935 [AC_MSG_ERROR(libclntsh is required for Oracle support)], [$NNZ_LIB])
2936 AC_CHECK_LIB(rt, sem_destroy, [ORACLE_LIBS="$ORACLE_LIBS -lrt"], [])
2937 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2938 SUBAGENT_LIBS="$SUBAGENT_LIBS $ORACLE_LIBS"
2939 fi
2940
2941 CPPFLAGS="$OLD_CPPFLAGS"
2942 LDFLAGS="$OLD_LDFLAGS"
2943 LD_RUN_PATH="$OLD_LD_RUN_PATH"
2944 fi
2945
2946 #--------------------------------------------------------------------
2947 # DB2
2948 #--------------------------------------------------------------------
2949
2950 check_substr "$COMPONENTS" "db2"
2951 if test $? = 0; then
2952 AC_CHECK_HEADER(sql.h,,AC_MSG_ERROR([*** Cannot find sql.h - check your DB2 client installation ***]))
2953 AC_CHECK_LIB(db2, SQLAllocHandle, [DB2_LIBS="-ldb2"],
2954 [AC_MSG_ERROR(libdb2 is required for DB2 support)])
2955 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2956 SUBAGENT_LIBS="$SUBAGENT_LIBS $DB2_LIBS"
2957 fi
2958 fi
2959
2960 #--------------------------------------------------------------------
2961 # Informix
2962 #--------------------------------------------------------------------
2963
2964 check_substr "$COMPONENTS" "informix"
2965 if test $? = 0; then
2966 AC_CHECK_HEADER(infxcli.h,,AC_MSG_ERROR([*** Cannot find infxcli.h - check your Informix client installation ***]))
2967 AC_CHECK_LIB(thcli, SQLAllocHandle, [INFORMIX_LIBS="-lthcli"],
2968 [AC_MSG_ERROR(libthcli is required for Informix support)])
2969 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2970 SUBAGENT_LIBS="$SUBAGENT_LIBS $INFORMIX_LIBS"
2971 fi
2972 fi
2973
2974
2975 #--------------------------------------------------------------------
2976 # Java
2977 #--------------------------------------------------------------------
2978
2979 check_substr "$COMPONENTS" "java"
2980 if test $? = 0; then
2981 AC_CHECK_HEADER(jni.h,,AC_MSG_ERROR([*** Cannot find jni.h - check your JDK installation ***]))
2982 fi
2983
2984
2985 #--------------------------------------------------------------------
2986 # Tuxedo
2987 #--------------------------------------------------------------------
2988
2989 check_substr "$COMPONENTS" "tuxedo"
2990 if test $? = 0; then
2991 OLD_CPPFLAGS="$CPPFLAGS"
2992 OLD_LDFLAGS="$LDFLAGS"
2993 OLD_LIBS="$LIBS"
2994
2995 if test "x$TUXEDO_BASE" != "x"; then
2996 TUXEDO_CPPFLAGS="-I$TUXEDO_BASE/include"
2997 TUXEDO_LDFLAGS="-L$TUXEDO_BASE/lib"
2998 CPPFLAGS="$CPPFLAGS $TUXEDO_CPPFLAGS"
2999 LDFLAGS="$LDFLAGS $TUXEDO_LDFLAGS"
3000 fi
3001
3002 AC_CHECK_HEADER(atmi.h,,AC_MSG_ERROR([*** Cannot find atmi.h - check your Tuxedo installation ***]))
3003
3004 # https://community.oracle.com/thread/2346582
3005 if test "x$PLATFORM" = "xLinux"; then
3006 TUXEDO_LDFLAGS="$TUXEDO_LDFLAGS -Xlinker --no-as-needed"
3007 LDFLAGS="$LDFLAGS -Xlinker --no-as-needed"
3008 fi
3009
3010 if test "$PLATFORM" = "SunOS"; then
3011 AC_CHECK_LIB(rt, nanosleep, [ TUXEDO_LIBS="$TUXEDO_LIBS -lrt" ])
3012 fi
3013
3014 if test "$PLATFORM" = "AIX"; then
3015 AC_MSG_CHECKING(for xa_switchp in libengine)
3016 OLD_LIBS_LIBENGINE="$LIBS"
3017 LIBS="$LIBS -lengine"
3018 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern char *xa_switchp; ]], [[ *xa_switchp = 0; ]])],
3019 [
3020 AC_MSG_RESULT(yes)
3021 TUXEDO_LIBS="$TUXEDO_LIBS -lengine"
3022 ],
3023 [ AC_MSG_RESULT(no) ])
3024 LIBS="$OLD_LIBS_LIBENGINE"
3025 fi
3026
3027 LIBS="$LIBS $TUXEDO_LIBS"
3028 AC_CHECK_LIB(tux, tpcall, [], [AC_MSG_ERROR(libtux is required for Tuxedo support)])
3029
3030 CPPFLAGS="$OLD_CPPFLAGS"
3031 LDFLAGS="$OLD_LDFLAGS"
3032 LIBS="$OLD_LIBS"
3033
3034 if test "x$PLATFORM" = "xAIX"; then
3035 if test -e $TUXEDO_BASE/lib/tpinit.o; then
3036 TUXEDO_TPINIT="$TUXEDO_BASE/lib/tpinit.o"
3037 fi
3038 fi
3039 fi
3040
3041
3042 #--------------------------------------------------------------------
3043 # ZeroMQ
3044 #--------------------------------------------------------------------
3045
3046 check_substr "$COMPONENTS" "zeromq"
3047 if test $? = 0; then
3048 OLD_CPPFLAGS="$CPPFLAGS"
3049 OLD_LDFLAGS="$LDFLAGS"
3050 OLD_LIBS="$LIBS"
3051
3052 if test "x$ZEROMQ_BASE" != "x"; then
3053 ZEROMQ_CPPFLAGS="-I$ZEROMQ_BASE/include"
3054 ZEROMQ_LDFLAGS="-L$ZEROMQ_BASE/lib"
3055 CPPFLAGS="$CPPFLAGS $ZEROMQ_CPPFLAGS"
3056 LDFLAGS="$LDFLAGS $ZEROMQ_LDFLAGS"
3057 fi
3058
3059 AC_CHECK_HEADER(zmq.h,,[
3060 if test "x$ZEROMQ_REQUIRED" = "xyes"; then
3061 AC_MSG_ERROR([*** Cannot find zmq.h - check your ZeroMQ installation ***])
3062 else
3063 ZEROMQ_SUPPORT="no"
3064 fi
3065 ])
3066 AC_CHECK_LIB(zmq, zmq_ctx_new, [ SERVER_LIBS="$SERVER_LIBS -lzmq" ], [
3067 if test "x$ZEROMQ_REQUIRED" = "xyes"; then
3068 AC_MSG_ERROR([*** libzmq is missing or too old - check your ZeroMQ installation ***])
3069 else
3070 ZEROMQ_SUPPORT="no"
3071 fi
3072 ])
3073
3074 if test "x$ZEROMQ_SUPPORT" = "xyes"; then
3075 AC_DEFINE(WITH_ZMQ, 1, Define to 1 if ZeroMQ is supported)
3076 fi
3077
3078 CPPFLAGS="$OLD_CPPFLAGS"
3079 LDFLAGS="$OLD_LDFLAGS"
3080 LIBS="$OLD_LIBS"
3081 fi
3082
3083
3084 #--------------------------------------------------------------------
3085 # MQTT
3086 #--------------------------------------------------------------------
3087
3088 if test "x$MQTT_SUPPORT" = "xyes"; then
3089 OLD_CPPFLAGS="$CPPFLAGS"
3090 OLD_LDFLAGS="$LDFLAGS"
3091 OLD_LIBS="$LIBS"
3092
3093 if test "x$MQTT_BASE" != "x"; then
3094 MQTT_CPPFLAGS="-I$MQTT_BASE/include"
3095 MQTT_LDFLAGS="-L$MQTT_BASE/lib"
3096 CPPFLAGS="$CPPFLAGS $MQTT_CPPFLAGS"
3097 LDFLAGS="$LDFLAGS $MQTT_LDFLAGS"
3098 fi
3099
3100 AC_CHECK_HEADER(mosquitto.h,,[
3101 if test "x$MQTT_REQUIRED" = "xyes"; then
3102 AC_MSG_ERROR([*** Cannot find mosquitto.h - check your libmosquitto installation ***])
3103 else
3104 MQTT_SUPPORT="no"
3105 fi
3106 ])
3107 AC_CHECK_LIB(mosquitto, mosquitto_lib_init, [ MQTT_LIBS="-lmosquitto" ], [
3108 if test "x$MQTT_REQUIRED" = "xyes"; then
3109 AC_MSG_ERROR([*** libmosquitto is missing - check your libmosquitto installation ***])
3110 else
3111 MQTT_SUPPORT="no"
3112 fi
3113 ])
3114
3115 if test "x$MQTT_SUPPORT" = "xyes"; then
3116 AC_DEFINE(WITH_MQTT, 1, Define to 1 if MQTT is supported)
3117 SUBAGENT_DIRS="$SUBAGENT_DIRS mqtt"
3118 fi
3119
3120 CPPFLAGS="$OLD_CPPFLAGS"
3121 LDFLAGS="$OLD_LDFLAGS"
3122 LIBS="$OLD_LIBS"
3123 fi
3124
3125
3126 #--------------------------------------------------------------------
3127 # MongoDB
3128 #--------------------------------------------------------------------
3129
3130 check_substr "$COMPONENTS" "mongodb"
3131 if test $? = 0; then
3132 OLD_CPPFLAGS="$CPPFLAGS"
3133 OLD_LDFLAGS="$LDFLAGS"
3134 OLD_LIBS="$LIBS"
3135
3136 if test "x$MONGODB_BASE" != "x"; then
3137 MONGODB_CPPFLAGS="-I$MONGODB_BASE/include/libmongoc-1.0/ -I$MONGODB_BASE/include/libbson-1.0/"
3138 MONGODB_LDFLAGS="-L$MONGODB_BASE/lib"
3139 CPPFLAGS="$CPPFLAGS $MONGODB_CPPFLAGS"
3140 LDFLAGS="$LDFLAGS $MONGODB_LDFLAGS"
3141 else
3142 MONGODB_CPPFLAGS="-I/usr/local/include/libmongoc-1.0/ -I/usr/local/include/libbson-1.0/"
3143 MONGODB_LDFLAGS="-L/usr/local/lib"
3144 CPPFLAGS="$CPPFLAGS $MONGODB_CPPFLAGS"
3145 LDFLAGS="$LDFLAGS $MONGODB_LDFLAGS"
3146 fi
3147
3148 AC_CHECK_HEADER(mongoc.h,,AC_MSG_ERROR([*** Cannot find mongoc.h - check your MongoDB installation ***]))
3149 AC_CHECK_LIB(mongoc-1.0, mongoc_client_get_database, [ MONGODB_LIBS="$MONGODB_LIBS -lmongoc-1.0" ])
3150 AC_CHECK_LIB(bson-1.0, nanosleep, [ MONGODB_LIBS="$MONGODB_LIBS -lbson-1.0" ])
3151
3152 LIBS="$LIBS $MONGODB_LIBS"
3153
3154 CPPFLAGS="$OLD_CPPFLAGS"
3155 LDFLAGS="$OLD_LDFLAGS"
3156 LIBS="$OLD_LIBS"
3157 fi
3158
3159 #--------------------------------------------------------------------
3160 # VMGR
3161 #--------------------------------------------------------------------
3162
3163 check_substr "$COMPONENTS" "vmgr"
3164 if test $? = 0; then
3165 OLD_CPPFLAGS="$CPPFLAGS"
3166 OLD_LDFLAGS="$LDFLAGS"
3167 OLD_LIBS="$LIBS"
3168
3169 if test "x$LIBVIRT_BASE" != "x"; then
3170 VMGR_CPPFLAGS="-I$LIBVIRT_BASE/include"
3171 VMGR_LDFLAGS="-L$LIBVIRT_BASE/lib"
3172 CPPFLAGS="$CPPFLAGS $VMGR_CPPFLAGS"
3173 LDFLAGS="$LDFLAGS $VMGR_LDFLAGS"
3174 else
3175 VMGR_CPPFLAGS=""
3176 VMGR_LDFLAGS=""
3177 CPPFLAGS="$CPPFLAGS $VMGR_CPPFLAGS"
3178 LDFLAGS="$LDFLAGS $VMGR_LDFLAGS"
3179 fi
3180
3181 AC_CHECK_HEADER(libvirt/libvirt.h,,AC_MSG_ERROR([*** Cannot find libvirt.h - check your libvirt installation ***]))
3182 AC_CHECK_LIB(virt, virConnectGetLibVersion, [ VMGR_LIBS="$VMGR_LIBS -lvirt" ])
3183 LIBS="$LIBS $VMGR_LIBS"
3184
3185 AC_CHECK_FUNCS([virDomainGetTime])
3186
3187 CPPFLAGS="$OLD_CPPFLAGS"
3188 LDFLAGS="$OLD_LDFLAGS"
3189 LIBS="$OLD_LIBS"
3190 fi
3191
3192 #--------------------------------------------------------------------
3193 # Other settings
3194 #--------------------------------------------------------------------
3195
3196 if test "x$RUNTIME_PREFIX" = "x"; then
3197 if test "x${BUILD_UNICODE}" = "xyes"; then
3198 CPPFLAGS="$CPPFLAGS -DPREFIX=L\\\"\${prefix}\\\" -DDATADIR=L\\\"\${pkgdatadir}\\\" -DBINDIR=L\\\"\${bindir}\\\" -DLIBDIR=L\\\"\${libdir}\\\" -DPKGLIBDIR=L\\\"\${pkglibdir}\\\" -DSTATEDIR=L\\\"\${localstatedir}/lib/netxms\\\""
3199 else
3200 CPPFLAGS="$CPPFLAGS -DPREFIX=\\\"\${prefix}\\\" -DDATADIR=\\\"\${pkgdatadir}\\\" -DBINDIR=\\\"\${bindir}\\\" -DLIBDIR=\\\"\${libdir}\\\" -DPKGLIBDIR=\\\"\${pkglibdir}\\\" -DSTATEDIR=\\\"\${localstatedir}/lib/netxms\\\""
3201 fi
3202 else
3203 if test "x${BUILD_UNICODE}" = "xyes"; then
3204 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\\\" -DSTATEDIR=L\\\"$RUNTIME_STATE_DIR/lib/netxms\\\""
3205 else
3206 CPPFLAGS="$CPPFLAGS -DPREFIX=\\\"$RUNTIME_PREFIX\\\" -DDATADIR=\\\"$RUNTIME_PREFIX/share/netxms\\\" -DBINDIR=\\\"$RUNTIME_PREFIX/bin\\\" -DLIBDIR=\\\"$RUNTIME_PREFIX/lib\\\" -DPKGLIBDIR=\\\"$RUNTIME_PREFIX/lib/netxms\\\" -DSTATEDIR=\\\"$RUNTIME_STATE_DIR/lib/netxms\\\""
3207 fi
3208 LDFLAGS_SUFFIX="$LDFLAGS_SUFFIX -R $RUNTIME_PREFIX/lib"
3209 fi
3210
3211 LDFLAGS="$LDFLAGS_PREFIX $LDFLAGS $PTHREAD_LDFLAGS $LDFLAGS_SUFFIX"
3212
3213 if test "x${ENABLE_WERROR}" = "xyes"; then
3214 CPPFLAGS="$CPPFLAGS -Werror"
3215 fi
3216
3217 if test "x$PLATFORM" = "xDarwin"; then
3218 SHLIB_SUFFIX=".so"
3219 else
3220 if test "x$shrext_cmds" != "x"; then
3221 SHLIB_SUFFIX="$shrext_cmds"
3222 else
3223 SHLIB_SUFFIX=".so"
3224 fi
3225 fi
3226 AC_DEFINE_UNQUOTED([SHLIB_SUFFIX], _T("$SHLIB_SUFFIX"), [Define to platform's shared library suffix])
3227
3228 if test "x$ENABLE_DEBUG" = "xno"; then
3229 CPPFLAGS="$CPPFLAGS -DNDEBUG"
3230 fi
3231
3232 if test "x$WITH_JEMALLOC" = "xyes"; then
3233 LIBS="$LIBS -ljemalloc"
3234 fi
3235
3236 AM_CONDITIONAL([USE_INTERNAL_EXPAT], [test "x$HAVE_LIBEXPAT" = "xno"])
3237 AM_CONDITIONAL([USE_INTERNAL_LIBTRE], [test "x$HAVE_LIBTRE" = "xno"])
3238 AM_CONDITIONAL([USE_INTERNAL_JANSSON], [test "x$HAVE_JANSSON" = "xno"])
3239 AM_CONDITIONAL([USE_INTERNAL_SQLITE], [test "x$HAVE_SQLITE" = "xno"])
3240 AM_CONDITIONAL([USE_INTERNAL_ZLIB], [test "$HAVE_ZLIB" = "no"])
3241 AM_CONDITIONAL([STATIC_BUILD], [test "x$STATIC_BUILD" = "xyes"])
3242 AM_CONDITIONAL([ALL_STATIC], [test "x$ALL_STATIC" = "xyes"])
3243 AM_CONDITIONAL([USE_ENCRYPTION], [test "x${WITH_ENCRYPTION}" = "xyes"])
3244 AM_CONDITIONAL([HPUX_HPPA], [test "x$HPUX_HPPA" = "xyes"])
3245 AM_CONDITIONAL([MQTT_SUPPORT], [test "x$MQTT_SUPPORT" = "xyes"])
3246 AM_CONDITIONAL([XMPP_SUPPORT], [test "x$XMPP_SUPPORT" = "xyes"])
3247 AM_CONDITIONAL([ZEROMQ_SUPPORT], [test "x$ZEROMQ_SUPPORT" = "xyes"])
3248
3249
3250 #--------------------------------------------------------------------
3251 # Get compiler version
3252 #--------------------------------------------------------------------
3253
3254 COMPILER_VERSION=""
3255 for opt in -qversion --version -v -V; do
3256 v=`$CXX $opt 2>/dev/null | head -1`
3257 if test $? = 0; then
3258 if test "x$COMPILER_VERSION" = "x"; then
3259 COMPILER_VERSION="$v"
3260 AC_DEFINE_UNQUOTED([CPP_COMPILER_VERSION], "$COMPILER_VERSION", [C++ compiler version information])
3261 fi
3262 fi
3263 done
3264
3265
3266 #--------------------------------------------------------------------
3267 # Cleanup variables
3268 #--------------------------------------------------------------------
3269
3270 AS_IF([test "x$with_dist" = "xyes"],
3271 [
3272 AGENT_DIRS=`echo $AGENT_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
3273 SUBAGENT_DIRS=`echo $SUBAGENT_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
3274 MODULES=`echo $MODULES|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
3275 SMSDRV_DIRS=`echo $SMSDRV_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
3276 HDLINK_DIRS=`echo $HDLINK_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
3277 ])
3278
3279
3280 #--------------------------------------------------------------------
3281 # Substitute variables
3282 #--------------------------------------------------------------------
3283
3284 AC_SUBST(DB_DRIVERS)
3285 AC_SUBST(MODULES)
3286 AC_SUBST(AGENT_DIRS)
3287 AC_SUBST(SUBAGENT_DIRS)
3288 AC_SUBST(SERVER_INCLUDE)
3289 AC_SUBST(SERVER_LIBS)
3290 AC_SUBST(SERVER_TOOLS)
3291 AC_SUBST(SMSDRV_DIRS)
3292 AC_SUBST(HDLINK_DIRS)
3293 AC_SUBST(PDSDRV_DIRS)
3294 AC_SUBST(TOP_LEVEL_MODULES)
3295 AC_SUBST(CONTRIB_MODULES)
3296 AC_SUBST(CLIENT_COMPONENTS)
3297 AC_SUBST(STATIC_SUBAGENT_LIST)
3298 AC_SUBST(SUBAGENT_LIBS)
3299 AC_SUBST(BUILD_SERVER)
3300 AC_SUBST(BUILD_SDK)
3301 AC_SUBST(MYSQL_CPPFLAGS)
3302 AC_SUBST(MYSQL_LDFLAGS)
3303 AC_SUBST(MYSQL_LIBS)
3304 AC_SUBST(PGSQL_CPPFLAGS)
3305 AC_SUBST(PGSQL_LDFLAGS)
3306 AC_SUBST(PGSQL_LIBS)
3307 AC_SUBST(ORACLE_CPPFLAGS)
3308 AC_SUBST(ORACLE_LDFLAGS)
3309 AC_SUBST(ORACLE_LIBS)
3310 AC_SUBST(ODBC_CPPFLAGS)
3311 AC_SUBST(ODBC_LDFLAGS)
3312 AC_SUBST(ODBC_LIBS)
3313 AC_SUBST(DB2_CPPFLAGS)
3314 AC_SUBST(DB2_LDFLAGS)
3315 AC_SUBST(DB2_LIBS)
3316 AC_SUBST(INFORMIX_CPPFLAGS)
3317 AC_SUBST(INFORMIX_LDFLAGS)
3318 AC_SUBST(INFORMIX_LIBS)
3319 AC_SUBST(OBJECT_MODE)
3320 AC_SUBST(SQLFLAGS)
3321 AC_SUBST(SHLIB_SUFFIX)
3322 AC_SUBST(TUXEDO_CPPFLAGS)
3323 AC_SUBST(TUXEDO_LDFLAGS)
3324 AC_SUBST(TUXEDO_LIBS)
3325 AC_SUBST(TUXEDO_TPINIT)
3326 AC_SUBST(MONGODB_CPPFLAGS)
3327 AC_SUBST(MONGODB_LDFLAGS)
3328 AC_SUBST(MONGODB_LIBS)
3329 AC_SUBST(MQTT_CPPFLAGS)
3330 AC_SUBST(MQTT_LDFLAGS)
3331 AC_SUBST(MQTT_LIBS)
3332 AC_SUBST(VMGR_CPPFLAGS)
3333 AC_SUBST(VMGR_LDFLAGS)
3334 AC_SUBST(VMGR_LIBS)
3335 AC_SUBST(INSTALL_LIBPATH)
3336 AC_SUBST(ZEROMQ_CPPFLAGS)
3337 AC_SUBST(ZEROMQ_LDFLAGS)
3338
3339 #--------------------------------------------------------------------
3340 # Shared libs versions
3341 #
3342 # versioning scheme: current:revision:age
3343 #
3344 # current
3345 # The number of the current interface exported by the library. A current
3346 # value of `0', means that you are calling the interface exported by this
3347 # library interface 0.
3348 #
3349 # revision
3350 # The implementation number of the most recent interface exported by this
3351 # library. In this case, a revision value of `0' means that this is the
3352 # first implementation of the interface.
3353 # If the next release of this library exports the same interface, but has a
3354 # different implementation (perhaps some bugs have been fixed), the revision
3355 # number will be higher, but current number will be the same. In that case,
3356 # when given a choice, the library with the highest revision will always
3357 # be used by the runtime loader.
3358 #
3359 # age
3360 # The number of previous additional interfaces supported by this library.
3361 # If age were `2', then this library can be linked into executables which
3362 # were built with a release of this library that exported the current
3363 # interface number, current, or any of the previous two interfaces.
3364 # By definition age must be less than or equal to current. At the outset,
3365 # only the first ever interface is implemented, so age can only be `0'.
3366 #--------------------------------------------------------------------
3367
3368 NETXMS_LIBRARY_VERSION=2:0:0
3369 AC_SUBST(NETXMS_LIBRARY_VERSION)
3370
3371 #--------------------------------------------------------------------
3372 # Generate output files
3373 #--------------------------------------------------------------------
3374
3375 AC_CONFIG_FILES([
3376 Makefile
3377 contrib/Makefile
3378 contrib/backgrounds/Makefile
3379 contrib/integration/Makefile
3380 contrib/integration/HP_EVA/Makefile
3381 contrib/integration/HP_P2000/Makefile
3382 contrib/mibs/Makefile
3383 contrib/music/Makefile
3384 contrib/startup/Makefile
3385 contrib/startup/systemd/Makefile
3386 contrib/startup/debian/Makefile
3387 contrib/startup/gentoo/Makefile
3388 contrib/startup/hp-ux/Makefile
3389 contrib/startup/redhat/Makefile
3390 contrib/startup/suse/Makefile
3391 contrib/startup/ubuntu/Makefile
3392 contrib/startup/solaris/Makefile
3393 contrib/templates/Makefile
3394 doc/Makefile
3395 doc/internal/Makefile
3396 doc/manuals/Makefile
3397 doc/misc/Makefile
3398 images/Makefile
3399 include/Makefile
3400 m4/Makefile
3401 src/Makefile
3402 src/agent/Makefile
3403 src/agent/core/Makefile
3404 src/agent/install/Makefile
3405 src/agent/libnxagent/Makefile
3406 src/agent/libnxappc/Makefile
3407 src/agent/libnxsd/Makefile
3408 src/agent/libnxtux/Makefile
3409 src/agent/subagents/Makefile
3410 src/agent/subagents/aix/Makefile
3411 src/agent/subagents/bind9/Makefile
3412 src/agent/subagents/darwin/Makefile
3413 src/agent/subagents/db2/Makefile
3414 src/agent/subagents/dbquery/Makefile
3415 src/agent/subagents/devemu/Makefile
3416 src/agent/subagents/ds18x20/Makefile
3417 src/agent/subagents/ecs/Makefile
3418 src/agent/subagents/filemgr/Makefile
3419 src/agent/subagents/freebsd/Makefile
3420 src/agent/subagents/gps/Makefile
3421 src/agent/subagents/hpux/Makefile
3422 src/agent/subagents/informix/Makefile
3423 src/agent/subagents/ipso/Makefile
3424 src/agent/subagents/java/Makefile
3425 src/agent/subagents/java/java/Makefile
3426 src/agent/subagents/jmx/Makefile
3427 src/agent/subagents/linux/Makefile
3428 src/agent/subagents/lmsensors/Makefile
3429 src/agent/subagents/logwatch/Makefile
3430 src/agent/subagents/minix/Makefile
3431 src/agent/subagents/mqtt/Makefile
3432 src/agent/subagents/mysql/Makefile
3433 src/agent/subagents/netbsd/Makefile
3434 src/agent/subagents/netsvc/Makefile
3435 src/agent/subagents/odbcquery/Makefile
3436 src/agent/subagents/openbsd/Makefile
3437 src/agent/subagents/oracle/Makefile
3438 src/agent/subagents/ping/Makefile
3439 src/agent/subagents/portCheck/Makefile
3440 src/agent/subagents/rpi/Makefile
3441 src/agent/subagents/sms/Makefile
3442 src/agent/subagents/ssh/Makefile
3443 src/agent/subagents/sunos/Makefile
3444 src/agent/subagents/tuxedo/Makefile
3445 src/agent/subagents/mongodb/Makefile
3446 src/agent/subagents/ubntlw/Makefile
3447 src/agent/subagents/ups/Makefile
3448 src/agent/subagents/vmgr/Makefile
3449 src/agent/subagents/winnt/Makefile
3450 src/agent/subagents/winperf/Makefile
3451 src/agent/subagents/wmi/Makefile
3452 src/agent/tools/Makefile
3453 src/agent/tools/nxappget/Makefile
3454 src/agent/tools/nxapush/Makefile
3455 src/appagent/Makefile
3456 src/client/Makefile
3457 src/client/install/Makefile
3458 src/client/libnxclient/Makefile
3459 src/client/nxalarm/Makefile
3460 src/client/nxevent/Makefile
3461 src/client/nxpush/Makefile
3462 src/client/nxshell/Makefile
3463 src/client/nxshell/java/Makefile
3464 src/client/nxsms/Makefile
3465 src/db/Makefile
3466 src/db/dbdrv/Makefile
3467 src/db/dbdrv/db2/Makefile
3468 src/db/dbdrv/informix/Makefile
3469 src/db/dbdrv/odbc/Makefile
3470 src/db/dbdrv/mssql/Makefile
3471 src/db/dbdrv/mysql/Makefile
3472 src/db/dbdrv/oracle/Makefile
3473 src/db/dbdrv/pgsql/Makefile
3474 src/db/dbdrv/sqlite/Makefile
3475 src/db/libnxdb/Makefile
3476 src/install/Makefile
3477 src/install/windows/Makefile
3478 src/jansson/Makefile
3479 src/libexpat/Makefile
3480 src/libexpat/libexpat/Makefile
3481 src/libnetxms/Makefile
3482 src/libnxcc/Makefile
3483 src/libnxlp/Makefile
3484 src/libnxmap/Makefile
3485 src/libnxmb/Makefile
3486 src/libnxsl/Makefile
3487 src/libstrophe/Makefile
3488 src/libtre/Makefile
3489 src/libtre/win32/Makefile
3490 src/nxcproxy/Makefile
3491 src/nxlptest/Makefile
3492 src/nxscript/Makefile
3493 src/server/Makefile
3494 src/server/core/Makefile
3495 src/server/drivers/Makefile
3496 src/server/drivers/airespace/Makefile
3497 src/server/drivers/at/Makefile
3498 src/server/drivers/baystack/Makefile
3499 src/server/drivers/cat2900xl/Makefile
3500 src/server/drivers/catalyst/Makefile
3501 src/server/drivers/cisco-esw/Makefile
3502 src/server/drivers/cisco-sb/Makefile
3503 src/server/drivers/dell-pwc/Makefile
3504 src/server/drivers/dlink/Makefile
3505 src/server/drivers/ers8000/Makefile
3506 src/server/drivers/extreme/Makefile
3507 src/server/drivers/h3c/Makefile
3508 src/server/drivers/hpsw/Makefile
3509 src/server/drivers/ignitenet/Makefile
3510 src/server/drivers/juniper/Makefile
3511 src/server/drivers/lib/Makefile
3512 src/server/drivers/lib/avaya-ers/Makefile
3513 src/server/drivers/lib/cisco/Makefile
3514 src/server/drivers/mikrotik/Makefile
3515 src/server/drivers/netscreen/Makefile
3516 src/server/drivers/ntws/Makefile
3517 src/server/drivers/ping3/Makefile
3518 src/server/drivers/procurve/Makefile
3519 src/server/drivers/qtech-olt/Makefile
3520 src/server/drivers/symbol-ws/Makefile
3521 src/server/drivers/tb/Makefile
3522 src/server/drivers/ubnt/Makefile
3523 src/server/hdlink/Makefile
3524 src/server/hdlink/jira/Makefile
3525 src/server/hdlink/redmine/Makefile
3526 src/server/include/Makefile
3527 src/server/libnxsrv/Makefile
3528 src/server/netxmsd/Makefile
3529 src/server/pdsdrv/Makefile
3530 src/server/pdsdrv/rrdtool/Makefile
3531 src/server/tools/Makefile
3532 src/server/tools/nxaction/Makefile
3533 src/server/tools/nxadm/Makefile
3534 src/server/tools/nxap/Makefile
3535 src/server/tools/nxconfig/Makefile
3536 src/server/tools/nxconfig/res/Makefile
3537 src/server/tools/nxdbmgr/Makefile
3538 src/server/tools/nxget/Makefile
3539 src/server/tools/nxminfo/Makefile
3540 src/server/tools/nxupload/Makefile
3541 src/smsdrv/Makefile
3542 src/smsdrv/anysms/Makefile
3543 src/smsdrv/dbemu/Makefile
3544 src/smsdrv/dummy/Makefile
3545 src/smsdrv/generic/Makefile
3546 src/smsdrv/kannel/Makefile
3547 src/smsdrv/mymobile/Makefile
3548 src/smsdrv/nexmo/Makefile
3549 src/smsdrv/nxagent/Makefile
3550 src/smsdrv/portech/Makefile
3551 src/smsdrv/slack/Makefile
3552 src/smsdrv/smseagle/Makefile
3553 src/smsdrv/text2reach/Makefile
3554 src/smsdrv/websms/Makefile
3555 src/snmp/Makefile
3556 src/snmp/libnxsnmp/Makefile
3557 src/snmp/nxmibc/Makefile
3558 src/snmp/nxsnmpget/Makefile
3559 src/snmp/nxsnmpset/Makefile
3560 src/snmp/nxsnmpwalk/Makefile
3561 src/sqlite/Makefile
3562 src/tools/Makefile
3563 src/tools/nxdevcfg/Makefile
3564 src/tools/nxencpasswd/Makefile
3565 src/tools/nxgenguid/Makefile
3566 src/zlib/Makefile
3567 sql/Makefile
3568 tests/Makefile
3569 tests/include/Makefile
3570 tests/test-libnetxms/Makefile
3571 tests/test-libnxcc/Makefile
3572 tests/test-libnxdb/Makefile
3573 tests/test-libnxsnmp/Makefile
3574 tools/Makefile
3575 ])
3576
3577 AC_OUTPUT
3578
3579 echo "Updating libtool"
3580 sed 's,$SED -e "/${host}-//g",$SED -e "s/${host}-//g",g' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
3581
3582 # On HP-UX, libtool passes +b instead of -Wl,+b even if gcc/g++ used as linker
3583 if test "x$ac_compiler_gnu" = "xyes" && test "x$PLATFORM" = "xHP-UX"; then
3584 sed "s,hardcode_libdir_flag_spec_ld=,#hardcode_libdir_flag_spec_ld=,g" < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
3585 fi
3586
3587 # On AIX, correct OBJECT_MODE must be set before linking
3588 # To avoid manual setting by user, we add this to libtool script
3589 if test "x$PLATFORM" = "xAIX"; then
3590 head -n 1 ./libtool > ./libtool.new
3591 echo "export OBJECT_MODE=$OBJECT_MODE" >> ./libtool.new
3592 tail -n +2 ./libtool >> ./libtool.new
3593 mv libtool.new libtool
3594 chmod +x ./libtool
3595 fi
3596
3597 #--------------------------------------------------------------------
3598 # Print summary
3599 #--------------------------------------------------------------------
3600
3601 echo
3602 echo
3603 echo
3604 echo '---------------------------------------------------------------------'
3605 echo ' Configure results'
3606 echo '---------------------------------------------------------------------'
3607 echo
3608 echo "Prefix : ${prefix}"
3609 echo "Platform : ${PLATFORM}"
3610 echo "Shared library suffix : ${SHLIB_SUFFIX}"
3611 if test "x$IPV6_SUPPORT" = "xyes"; then
3612 echo "IPv6 support : YES"
3613 else
3614 echo "IPv6 support : NO"
3615 fi
3616 if test "x${MQTT_SUPPORT}" = "xyes"; then
3617 echo "MQTT support : YES"
3618 else
3619 echo "MQTT support : NO"
3620 fi
3621 if test "x${BUILD_SERVER}" = "xyes"; then
3622 echo "Build Server : YES"
3623 echo "Server libs : ${SERVER_LIBS}"
3624 if test "x${LDAP_SUPPORT}" = "xyes"; then
3625 echo "LDAP support : YES"
3626 else
3627 echo "LDAP support : NO"
3628 fi
3629 if test "x${XMPP_SUPPORT}" = "xyes"; then
3630 echo "XMPP support : YES"
3631 else
3632 echo "XMPP support : NO"
3633 fi
3634 if test "x${ZEROMQ_SUPPORT}" = "xyes"; then
3635 echo "ZeroMQ support : YES"
3636 else
3637 echo "ZeroMQ support : NO"
3638 fi
3639 else
3640 echo "Build Server : NO"
3641 fi
3642 if test "x${WITH_ENCRYPTION}" = "xyes"; then
3643 echo "Encryption enabled : YES"
3644 else
3645 echo "Encryption enabled : NO"
3646 fi
3647 if test "x${HAVE_LIBSSH}" = "xyes"; then
3648 echo "SSH support enabled : YES"
3649 else
3650 echo "SSH support enabled : NO"
3651 fi
3652 if test "x${DB_DRIVERS}" != "x"; then
3653 echo "Build DB-Drivers :${DB_DRIVERS}"
3654 else
3655 echo "Build DB-Drivers : NO"
3656 fi
3657 if test "x${BUILD_CLIENT}" = "xyes"; then
3658 echo "Build Clients : YES"
3659 else
3660 echo "Build Clients : NO"
3661 fi
3662 if test "x${BUILD_AGENT}" = "xyes"; then
3663 echo "Build Agent : YES"
3664 echo "Agent extra components : ${AGENT_DIRS}"
3665 echo "Subagents list : ${SUBAGENT_DIRS}"
3666 else
3667 echo "Build Agent : NO"
3668 fi
3669 if test "x${BUILD_STATIC_AGENT}" = "xyes"; then
3670 echo "Build Static Agent : YES"
3671 echo "Subagents list : ${STATIC_SUBAGENT_LIST}"
3672 else
3673 echo "Build Static Agent : NO"
3674 fi
3675 if test "x${BUILD_UNICODE}" = "xyes"; then
3676 echo "UNICODE build : YES"
3677 else
3678 echo "UNICODE build : NO"
3679 fi
3680 if test "x${HAVE_LIBEXPAT}" = "xno"; then
3681 echo "Use internal libexpat : YES"
3682 else
3683 echo "Use internal libexpat : NO"
3684 fi
3685 if test "x${HAVE_LIBTRE}" = "xno"; then
3686 echo "Use internal libtre : YES"
3687 else
3688 echo "Use internal libtre : NO"
3689 fi
3690 if test "x${HAVE_JANSSON}" = "xno"; then
3691 echo "Use internal libjansson : YES"
3692 else
3693 echo "Use internal libjansson : NO"
3694 fi
3695 check_substr "$COMPONENTS" "sqlite"
3696 if test $? = 0; then
3697 if test "x${HAVE_SQLITE}" = "xno"; then
3698 echo "Use internal sqlite : YES"
3699 else
3700 echo "Use internal sqlite : NO"
3701 fi
3702 fi
3703 if test "x${HAVE_ZLIB}" = "xno"; then
3704 echo "Use internal zlib : YES"
3705 else
3706 echo "Use internal zlib : NO"
3707 fi
3708 if test "x${FORCE_32BIT_BUILD}" = "xyes"; then
3709 echo "Force 32bit build : YES"
3710 else
3711 echo "Force 32bit build : NO"
3712 fi
3713
3714 echo "C compiler : ${CC}"
3715 echo "C++ compiler : ${CXX}"
3716 echo "C++ compiler info : ${COMPILER_VERSION}"
3717 echo "CPPFLAGS : ${CPPFLAGS}"
3718 echo "CXXFLAGS : ${CXXFLAGS}"
3719 echo "CFLAGS : ${CFLAGS}"
3720 echo "LDFLAGS : ${LDFLAGS}"
3721 echo "LIBS : ${LIBS}"
3722
3723 if test "x${MYSQL_CPPFLAGS}" != "x"; then
3724 echo "MySQL CPPFLAGS : ${MYSQL_CPPFLAGS}"
3725 fi
3726 if test "x${MYSQL_LDFLAGS}" != "x"; then
3727 echo "MySQL LDFLAGS : ${MYSQL_LDFLAGS}"
3728 fi
3729 if test "x${MYSQL_LIBS}" != "x"; then
3730 echo "MySQL LIBS : ${MYSQL_LIBS}"
3731 fi
3732
3733 if test "x${PGSQL_CPPFLAGS}" != "x"; then
3734 echo "PostgreSQL CPPFLAGS : ${PGSQL_CPPFLAGS}"
3735 fi
3736 if test "x${PGSQL_LDFLAGS}" != "x"; then
3737 echo "PostgreSQL LDFLAGS : ${PGSQL_LDFLAGS}"
3738 fi
3739 if test "x${PGSQL_LIBS}" != "x"; then
3740 echo "PostgreSQL LIBS : ${PGSQL_LIBS}"
3741 fi
3742
3743 if test "x${ORACLE_CPPFLAGS}" != "x"; then
3744 echo "Oracle CPPFLAGS : ${ORACLE_CPPFLAGS}"
3745 fi
3746 if test "x${ORACLE_LDFLAGS}" != "x"; then
3747 echo "Oracle LDFLAGS : ${ORACLE_LDFLAGS}"
3748 fi
3749 if test "x${ORACLE_LIBS}" != "x"; then
3750 echo "Oracle LIBS : ${ORACLE_LIBS}"
3751 fi
3752
3753 if test "x${ODBC_CPPFLAGS}" != "x"; then
3754 echo "ODBC CPPFLAGS : ${ODBC_CPPFLAGS}"
3755 fi
3756 if test "x${ODBC_LDFLAGS}" != "x"; then
3757 echo "ODBC LDFLAGS : ${ODBC_LDFLAGS}"
3758 fi
3759 if test "x${ODBC_LIBS}" != "x"; then
3760 echo "ODBC LIBS : ${ODBC_LIBS}"
3761 fi
3762
3763 if test "x${DB2_CPPFLAGS}" != "x"; then
3764 echo "DB2 CPPFLAGS : ${DB2_CPPFLAGS}"
3765 fi
3766 if test "x${DB2_LDFLAGS}" != "x"; then
3767 echo "DB2 LDFLAGS : ${DB2_LDFLAGS}"
3768 fi
3769 if test "x${DB2_LIBS}" != "x"; then
3770 echo "DB2 LIBS : ${DB2_LIBS}"
3771 fi
3772
3773 if test "x${INFORMIX_CPPFLAGS}" != "x"; then
3774 echo "Informix CPPFLAGS : ${INFORMIX_CPPFLAGS}"
3775 fi
3776 if test "x${INFORMIX_LDFLAGS}" != "x"; then
3777 echo "Informix LDFLAGS : ${INFORMIX_LDFLAGS}"
3778 fi
3779 if test "x${INFORMIX_LIBS}" != "x"; then
3780 echo "Informix LIBS : ${INFORMIX_LIBS}"
3781 fi
3782
3783 if test "x${TUXEDO_CPPFLAGS}" != "x"; then
3784 echo "Tuxedo CPPFLAGS : ${TUXEDO_CPPFLAGS}"
3785 fi
3786 if test "x${TUXEDO_LDFLAGS}" != "x"; then
3787 echo "Tuxedo LDFLAGS : ${TUXEDO_LDFLAGS}"
3788 fi
3789 if test "x${TUXEDO_LIBS}" != "x"; then
3790 echo "Tuxedo LIBS : ${TUXEDO_LIBS}"
3791 fi
3792
3793 if test "x${MONGODB_CPPFLAGS}" != "x"; then
3794 echo "MongoDB CPPFLAGS : ${MONGODB_CPPFLAGS}"
3795 fi
3796 if test "x${MONGODB_LDFLAGS}" != "x"; then
3797 echo "MongoDB LDFLAGS : ${MONGODB_LDFLAGS}"
3798 fi
3799
3800 if test "x${ZEROMQ_CPPFLAGS}" != "x"; then
3801 echo "ZeroMQ CPPFLAGS : ${ZEROMQ_CPPFLAGS}"
3802 fi
3803 if test "x${ZEROMQ_LDFLAGS}" != "x"; then
3804 echo "ZeroMQ LDFLAGS : ${ZEROMQ_LDFLAGS}"
3805 fi
3806
3807 if test "x${VMGR_CPPFLAGS}" != "x"; then
3808 echo "Vmgr CPPFLAGS : ${VMGR_CPPFLAGS}"
3809 fi
3810 if test "x${VMGR_LDFLAGS}" != "x"; then
3811 echo "Vmgr LDFLAGS : ${VMGR_LDFLAGS}"
3812 fi
3813 if test "x${VMGR_LIBS}" != "x"; then
3814 echo "Vmgr LIBS : ${VMGR_LIBS}"
3815 fi
3816
3817 FLAGS_CPP="src/tools/nxdevcfg/flags.cpp"
3818 echo "/* Automatically generated by configure */" > $FLAGS_CPP
3819 echo "#include <nms_common.h>" >> $FLAGS_CPP
3820 echo "const TCHAR *g_cppFlags = _T(\"${CPPFLAGS}\");" >> $FLAGS_CPP
3821 echo "const TCHAR *g_cFlags = _T(\"${CFLAGS}\");" >> $FLAGS_CPP
3822 echo "const TCHAR *g_cxxFlags = _T(\"${CXXFLAGS}\");" >> $FLAGS_CPP
3823 echo "const TCHAR *g_ldFlags = _T(\"${LDFLAGS}\");" >> $FLAGS_CPP
3824 echo "const TCHAR *g_libs = _T(\"${LIBS}\");" >> $FLAGS_CPP
3825 echo "const TCHAR *g_cc = _T(\"${CC}\");" >> $FLAGS_CPP
3826 echo "const TCHAR *g_cxx = _T(\"${CXX}\");" >> $FLAGS_CPP
3827 echo "const TCHAR *g_ld = _T(\"${LD}\");" >> $FLAGS_CPP
3828 echo "const TCHAR *g_perl = _T(\"${PERL}\");" >> $FLAGS_CPP
3829 echo "const TCHAR *g_serverLibs = _T(\"${SERVER_LIBS}\");" >> $FLAGS_CPP
3830 echo "const TCHAR *g_tuxedoCppFlags = _T(\"${TUXEDO_CPPFLAGS}\");" >> $FLAGS_CPP
3831 echo "const TCHAR *g_tuxedoLdFlags = _T(\"${TUXEDO_LDFLAGS}\");" >> $FLAGS_CPP
3832 echo "const TCHAR *g_tuxedoLibs = _T(\"${TUXEDO_LIBS}\");" >> $FLAGS_CPP