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