release 2.1-M2 preparation
[public/netxms.git] / configure.ac
1 # $Id$
2 #
3 # NetXMS - Network Management System
4 # Configure script
5 #
6
7 AC_INIT([NetXMS], [2.1-M2], [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 jmx 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 jmx 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 stdbool.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 #ifdef HAVE_STDBOOL_H
1921 #include <stdbool.h>
1922 #endif
1923 #ifdef HAVE_STDINT_H
1924 #include <stdint.h>
1925 #endif
1926 ])
1927 AC_CHECK_TYPES([mode_t, off_t, socklen_t],,,[
1928 #if HAVE_SYS_TYPES_H
1929 #include <sys/types.h>
1930 #endif
1931 #if HAVE_SYS_SOCKET_H
1932 #include <sys/socket.h>
1933 #endif
1934 ])
1935 AC_CHECK_TYPES([struct stat64],,,[
1936 #if HAVE_SYS_STAT_H
1937 #include <sys/stat.h>
1938 #endif
1939 ])
1940
1941
1942 #--------------------------------------------------------------------
1943 # Checks for functions
1944 #--------------------------------------------------------------------
1945
1946 AC_FUNC_ERROR_AT_LINE
1947 AC_FUNC_MEMCMP
1948 AC_FUNC_SELECT_ARGTYPES
1949 AC_FUNC_STRFTIME
1950 AC_FUNC_STRTOD
1951 AC_FUNC_VPRINTF
1952
1953 AC_CHECK_FUNCS([gettimeofday memmove memset bcopy strchr strcspn strdup strerror])
1954 AC_CHECK_FUNCS([strrchr strlwr strtok_r strtol strtoul strtoll strtoull setlocale])
1955 AC_CHECK_FUNCS([tolower if_nametoindex daemon mmap strerror_r scandir uname poll])
1956 AC_CHECK_FUNCS([usleep nanosleep gmtime_r localtime_r stat64 fstat64 lstat64])
1957 AC_CHECK_FUNCS([fopen64 strptime timegm gethostbyname2_r getaddrinfo rand_r])
1958 AC_CHECK_FUNCS([itoa _itoa isatty getgrnam getpwnam malloc_info malloc_trim])
1959
1960 AC_CHECK_DECLS([nanosleep, daemon, strerror])
1961
1962 # Do not use inet_pton on Solaris as it has binary compatibility problems
1963 if test "$PLATFORM" != "SunOS"; then
1964 AC_CHECK_FUNCS([inet_pton])
1965 fi
1966
1967 # Check if strerror_r is POSIX-compliant
1968 if test "$ac_cv_func_strerror_r" = "yes"; then
1969 AC_MSG_CHECKING(if strerror_r is POSIX compliant)
1970 AC_LANG_PUSH([C++])
1971 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1972 #if HAVE_STRING_H
1973 #include <string.h>
1974 #endif
1975 #if HAVE_ERRNO_H
1976 #include <errno.h>
1977 #endif
1978 ]],[[
1979 int e;
1980 char buffer[256];
1981 e = strerror_r(1, buffer, 256);
1982 return e;
1983 ]])
1984 ],[
1985 AC_MSG_RESULT(yes)
1986 AC_DEFINE(HAVE_POSIX_STRERROR_R,1,Define to 1 if strerror_r function is POSIX compliant)
1987 ],[
1988 AC_MSG_RESULT(no)
1989 AC_DEFINE(HAVE_POSIX_STRERROR_R,0,Define to 1 if strerror_r function is POSIX compliant)
1990 ])
1991 AC_LANG_POP([C++])
1992 fi
1993
1994 # Check if struct tm has tm_gmtoff member
1995 AC_MSG_CHECKING(for struct tm.tm_gmtoff)
1996 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1997 #if HAVE_TIME_H
1998 #include <time.h>
1999 #endif
2000 #if HAVE_SYS_TIME_H
2001 #include <sys/time.h>
2002 #endif
2003 ]],[[
2004 struct tm t;
2005 return t.tm_gmtoff;
2006 ]])
2007 ],[
2008 AC_MSG_RESULT(yes)
2009 AC_DEFINE(HAVE_TM_GMTOFF,1,Define to 1 if struct tm has tm_gmtoff member)
2010 ],[
2011 AC_MSG_RESULT(no)
2012 ])
2013
2014 AC_CHECK_FUNCS([sysctlbyname sysctlnametomib])
2015 AC_CHECK_FUNCS([tcgetattr tcsetattr cfsetospeed cfsetispeed])
2016
2017 # asprintf, scprintf, etc.
2018 AC_CHECK_FUNCS([asprintf aswprintf vasprintf vaswprintf])
2019 AC_CHECK_FUNCS([scprintf scwprintf vscprintf vscwprintf])
2020 AC_CHECK_FUNCS([snprintf vsnprintf])
2021
2022 AC_MSG_CHECKING(whether snprintf returns required buffer size)
2023 AC_RUN_IFELSE(
2024 [AC_LANG_PROGRAM([
2025 #include <stdio.h>
2026 #include <string.h>
2027 ], [
2028 return !(snprintf(NULL, 0, "test: %d", 1000) >= 10);
2029 ])
2030 ],
2031 [ AC_MSG_RESULT(yes)
2032 AC_DEFINE(SNPRINTF_RETURNS_REQUIRED_SIZE, 1, Define to 1 if snprintf returns required buffer size in case of truncation)
2033 ],
2034 [ AC_MSG_RESULT(no) ],
2035 [ AC_MSG_RESULT(no) ]
2036 )
2037
2038 AC_MSG_CHECKING(whether free correctly handles NULL pointer)
2039 AC_RUN_IFELSE(
2040 [AC_LANG_PROGRAM([
2041 #include <stdlib.h>
2042 ], [
2043 free(NULL);
2044 return 0;
2045 ])
2046 ],
2047 [ AC_MSG_RESULT(yes)
2048 AC_DEFINE(FREE_IS_NULL_SAFE, 1, Define to 1 if free corectly handles NULL pointer)
2049 ],
2050 [ AC_MSG_RESULT(no) ],
2051 [ AC_MSG_RESULT(no) ]
2052 )
2053
2054
2055 #--------------------------------------------------------------------
2056 # Checks for macros and definitions
2057 #--------------------------------------------------------------------
2058
2059 AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64, htonll, ntohll],,,[
2060 #ifdef HAVE_SYS_TYPES_H
2061 #include <sys/types.h>
2062 #endif
2063 #if HAVE_BYTESWAP_H
2064 #include <byteswap.h>
2065 #endif
2066 #if HAVE_NETINET_IN_H
2067 #include <netinet/in.h>
2068 #endif
2069 #if HAVE_NET_NH_H
2070 #include <net/nh.h>
2071 #endif
2072 ])
2073 AC_CHECK_DECLS([RTLD_NOW, RTLD_GLOBAL],,,[
2074 #ifdef HAVE_UNISTD_H
2075 #include <unistd.h>
2076 #endif
2077 #ifdef HAVE_DLFCN_H
2078 #include <dlfcn.h>
2079 #endif
2080 ])
2081 AC_CHECK_DECLS([va_copy, __va_copy],,,[
2082 #ifdef HAVE_UNISTD_H
2083 #include <unistd.h>
2084 #endif
2085 #ifdef HAVE_STDARG_H
2086 #include <stdarg.h>
2087 #endif
2088 #ifdef HAVE_STDLIB_H
2089 #include <stdlib.h>
2090 #endif
2091 ])
2092
2093
2094 #--------------------------------------------------------------------
2095 # getopt
2096 #--------------------------------------------------------------------
2097
2098 if test "x$FORCE_INTERNAL_GETOPT" = "xyes"; then
2099 AC_DEFINE([USE_BUNDLED_GETOPT], [1], [Define to 1 if bundled getopt must be used])
2100 else
2101 AC_CHECK_HEADERS([getopt.h])
2102 AC_CHECK_LIB(gnugetopt, getopt_long)
2103 AC_CHECK_DECLS([getopt_long],,,[
2104 #if HAVE_GETOPT_H
2105 #include <getopt.h>
2106 #endif
2107 ])
2108 fi
2109
2110
2111 #--------------------------------------------------------------------
2112 # Linux specific checks
2113 #--------------------------------------------------------------------
2114
2115 if test "x$PLATFORM" = "xLinux"; then
2116 AC_CHECK_HEADERS([sys/reboot.h],,,[[ ]])
2117 AC_CHECK_DECLS([reboot, RB_AUTOBOOT, RB_POWER_OFF, RB_HALT_SYSTEM],,,[
2118 #if HAVE_SYS_REBOOT_H
2119 #include <sys/reboot.h>
2120 #endif
2121 ])
2122 AC_CHECK_FUNCS([reboot],,,[
2123 #if HAVE_SYS_REBOOT_H
2124 #include <sys/reboot.h>
2125 #endif
2126 ])
2127
2128 AC_CHECK_HEADERS([jemalloc/jemalloc.h],
2129 [
2130 AC_CHECK_LIB(jemalloc, malloc,
2131 [
2132 WITH_JEMALLOC="yes"
2133 AC_DEFINE(WITH_JEMALLOC,1,Define to 1 if libjemalloc is used)
2134 ])
2135 ])
2136 fi
2137
2138
2139 #--------------------------------------------------------------------
2140 # AIX specific checks
2141 #--------------------------------------------------------------------
2142
2143 if test "x$PLATFORM" = "xAIX"; then
2144 AC_CHECK_HEADERS([procinfo.h],,,[[ ]])
2145 AC_CHECK_DECLS([getkerninfo, getprocs, getprocs64, __sync_add_and_fetch, __sync_sub_and_fetch],,,[
2146 #if HAVE_PROCINFO_H
2147 #include <procinfo.h>
2148 #endif
2149 ])
2150 AC_CHECK_FUNCS([getprocs64],,,[
2151 #if HAVE_PROCINFO_H
2152 #include <procinfo.h>
2153 #endif
2154 ])
2155 fi
2156
2157
2158 #--------------------------------------------------------------------
2159 # Solaris specific checks
2160 #--------------------------------------------------------------------
2161
2162 if test "x$PLATFORM" = "xSunOS"; then
2163 AC_CHECK_FUNCS([atomic_inc_32_nv atomic_dec_32_nv],,,[
2164 #include <sys/atomic.h>
2165 ])
2166 fi
2167
2168
2169 #--------------------------------------------------------------------
2170 # HP-UX specific checks
2171 #--------------------------------------------------------------------
2172
2173 if test "x$PLATFORM" = "xHP-UX"; then
2174 AC_CHECK_HEADERS([atomic.h sys/mib.h],,,[[ ]])
2175 AC_CHECK_DECLS([SIOCGIFNAME, SIOCGIFINDEX],,,[
2176 #if HAVE_NET_IF_H
2177 #include <net/if.h>
2178 #endif
2179 ])
2180 AC_CHECK_DECLS([ID_ifXEntry, open_mib_64],,,[
2181 #if HAVE_SYS_MIB_H
2182 #include <sys/mib.h>
2183 #endif
2184 ])
2185
2186 AC_MSG_CHECKING(if pst_diskinfo has read/write stats fields)
2187 AC_LANG_PUSH([C++])
2188 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2189 #include <sys/pstat.h>
2190 ]], [[
2191 pst_diskinfo d;
2192 int x;
2193 x = (int)d.psd_dkread;
2194 x = (int)d.psd_dkwrite;
2195 ]])],
2196 [
2197 AC_DEFINE([HAVE_DISKINFO_RWSTATS],[1],[Define to 1 if pst_diskinfo has read/write stats fields])
2198 AC_MSG_RESULT(yes)
2199 ],
2200 [
2201 AC_MSG_RESULT(no)
2202 ])
2203 AC_LANG_POP([C++])
2204 fi
2205
2206
2207 #--------------------------------------------------------------------
2208 # *BSD specific checks
2209 #--------------------------------------------------------------------
2210
2211 AC_CHECK_HEADERS([sys/event.h])
2212 AC_CHECK_LIB(kvm, kvm_open)
2213 AC_CHECK_FUNCS([kvm_openfiles kvm_getswapinfo kqueue])
2214 AC_CHECK_TYPES([struct kinfo_proc2],,,[
2215 #if HAVE_SYS_SYSCTL_H
2216 #include <sys/sysctl.h>
2217 #endif
2218 ])
2219
2220
2221 #--------------------------------------------------------------------
2222 # FreeBSD specific checks
2223 #--------------------------------------------------------------------
2224
2225 if test "x$PLATFORM" = "xFreeBSD"; then
2226 AC_CHECK_DECLS([RTF_WASCLONED],[],[],[
2227 #if HAVE_SYS_TYPES_H
2228 #include <sys/types.h>
2229 #endif
2230 #if HAVE_SYS_SOCKET_H
2231 #include <sys/socket.h>
2232 #endif
2233 #include <net/route.h>
2234 ])
2235 fi
2236
2237
2238 #--------------------------------------------------------------------
2239 # OpenBSD specific checks
2240 #--------------------------------------------------------------------
2241
2242 if test "x$PLATFORM" = "xOpenBSD"; then
2243 AC_MSG_CHECKING(if kvm_getprocs requires sizeof kinfo_proc argument)
2244 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2245 #include <sys/param.h>
2246 #include <sys/proc.h>
2247 #include <kvm.h>
2248 #include <sys/user.h>
2249 ]],[[
2250 int count;
2251 kvm_getprocs(NULL, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc), &count);
2252 return 0;
2253 ]])
2254 ],[
2255 AC_MSG_RESULT(yes)
2256 AC_DEFINE(KVM_GETPROCS_REQUIRES_SIZEOF,1,Define to 1 if kvm_getprocs requires sizeof kinfo_proc)
2257 ],[
2258 AC_MSG_RESULT(no)
2259 AC_DEFINE(KVM_GETPROCS_REQUIRES_SIZEOF,0,Define to 1 if kvm_getprocs requires sizeof kinfo_proc)
2260 ])
2261
2262 AC_MSG_CHECKING(if struct kinfo_proc has member kp_proc)
2263 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2264 #include <sys/param.h>
2265 #include <sys/proc.h>
2266 #include <kvm.h>
2267 #include <sys/user.h>
2268 ]],[[
2269 struct kinfo_proc p;
2270 return p.kp_proc.p_pid;
2271 ]])
2272 ],[
2273 AC_MSG_RESULT(yes)
2274 AC_DEFINE(KINFO_PROC_HAS_KP_PROC,1,Define to 1 if struct kinfo_proc has member kp_proc)
2275 ],[
2276 AC_MSG_RESULT(no)
2277 AC_DEFINE(KINFO_PROC_HAS_KP_PROC,0,Define to 1 if struct kinfo_proc has member kp_proc)
2278 ])
2279 fi
2280
2281
2282 #--------------------------------------------------------------------
2283 # Minix specific checks
2284 #--------------------------------------------------------------------
2285
2286 if test "x$PLATFORM" = "xMinix"; then
2287 AC_CHECK_HEADERS([minix/minlib.h])
2288 fi
2289
2290
2291 #--------------------------------------------------------------------
2292 # Check for UNICODE stuff
2293 #--------------------------------------------------------------------
2294
2295 if test "x$BUILD_UNICODE" = "xyes"; then
2296 CPPFLAGS="$CPPFLAGS -DUNICODE"
2297 fi
2298
2299 AC_CHECK_HEADERS([wchar.h wctype.h iconv.h widec.h])
2300 AC_CHECK_TYPES([wchar_t, wint_t],,,[
2301 #if HAVE_WCHAR_H
2302 #include <wchar.h>
2303 #endif
2304 ])
2305 AC_CHECK_SIZEOF(wchar_t,,[
2306 #if HAVE_WCHAR_H
2307 #include <wchar.h>
2308 #endif
2309 ])
2310 AC_CHECK_FUNCS([wcslen wcsdup wcsncpy wcstoll wcstoull towupper towlower])
2311 AC_CHECK_FUNCS([wcslwr wcserror wcserror_r wfopen wfopen64 fputws putws])
2312 AC_CHECK_FUNCS([wopen wstat waccess wgetenv wrename wunlink wremove wchdir])
2313 AC_CHECK_FUNCS([wmkdir wrmdir wsystem wmkstemp wpopen wctime wchmod vwscanf])
2314 AC_CHECK_FUNCS([vswscanf vfwscanf wcscasecmp wcsncasecmp wcstombs wcsrtombs])
2315 AC_CHECK_FUNCS([mbstowcs mbsrtowcs itow _itow wcsftime wcstok])
2316
2317 AC_CHECK_DECLS([putws],,,[
2318 #if HAVE_WCHAR_H
2319 #include <wchar.h>
2320 #endif
2321 ])
2322
2323 if test "x$ac_cv_func_wcsftime" = "xyes"; then
2324 AC_MSG_CHECKING(whether wcsftime is working correctly)
2325 AC_RUN_IFELSE(
2326 [AC_LANG_PROGRAM([
2327 #include <stdio.h>
2328 #ifdef HAVE_UNISTD_H
2329 #include <unistd.h>
2330 #endif
2331 #ifdef HAVE_TIME_H
2332 #include <time.h>
2333 #endif
2334 #ifdef HAVE_SYS_TIME_H
2335 #include <sys/time.h>
2336 #endif
2337 #if HAVE_WCHAR_H
2338 #include <wchar.h>
2339 #endif
2340 ], [[
2341 wchar_t buffer[64];
2342 struct tm *ltm;
2343 time_t t;
2344
2345 t = time(NULL);
2346 ltm = localtime(&t);
2347 wcsftime(buffer, 64, L"%Y", ltm);
2348 return wcstol(buffer, NULL, 10) == ltm->tm_year + 1900 ? 0 : 1;
2349 ]])
2350 ],
2351 [ AC_MSG_RESULT(yes)
2352 AC_DEFINE(WORKING_WCSFTIME, 1, Define to 1 if wcsftime is working correctly)
2353 ],
2354 [ AC_MSG_RESULT(no) ],
2355 [ AC_MSG_RESULT(no) ]
2356 )
2357 fi
2358
2359 if test "x$DISABLE_ICONV" != "xyes"; then
2360 AC_CHECK_LIB(iconv, libiconv_open,
2361 [ ac_found_iconv=yes
2362 LIBS="$LIBS -liconv"
2363 AC_CHECK_FUNCS(libiconv, ac_found_iconv=yes, ac_found_iconv=no)
2364 ],
2365 [
2366 AC_CHECK_LIB(iconv, iconv,
2367 [ ac_found_iconv=yes
2368 LIBS="$LIBS -liconv"
2369 ])
2370 AC_CHECK_FUNCS(iconv, ac_found_iconv=yes, ac_found_iconv=no)
2371 ])
2372 else
2373 ac_found_iconv=no
2374 CPPFLAGS="$CPPFLAGS -D__DISABLE_ICONV"
2375 fi
2376
2377 AC_MSG_CHECKING(whether fgetws can be used with popen)
2378 AC_RUN_IFELSE(
2379 [AC_LANG_PROGRAM([
2380 #include <stdio.h>
2381 #ifdef HAVE_UNISTD_H
2382 #include <unistd.h>
2383 #endif
2384 #if HAVE_WCHAR_H
2385 #include <wchar.h>
2386 #endif
2387 ], [[
2388 int rc = 1;
2389 wchar_t line[4096];
2390 FILE *f = popen("echo test", "r");
2391 if(f!=NULL)
2392 {
2393 fgetws(line, 4096, f);
2394 pclose(f);
2395 rc = 0;
2396 }
2397 return rc;
2398 ]])
2399 ],
2400 [ AC_MSG_RESULT(yes)
2401 AC_DEFINE(SAFE_FGETWS_WITH_POPEN, 1, Define to 1 if fgetws can be used with popen)
2402 ],
2403 [ AC_MSG_RESULT(no) ],
2404 [ AC_MSG_RESULT(no) ]
2405 )
2406
2407 AC_MSG_CHECKING(whether iconv supports UCS-2-INTERNAL)
2408 AC_RUN_IFELSE(
2409 [AC_LANG_PROGRAM([
2410 #if HAVE_ICONV_H
2411 #include <iconv.h>
2412 #endif
2413 ], [
2414 return iconv_open("UTF-8","UCS-2-INTERNAL")==(iconv_t)(-1);
2415 ])
2416 ],
2417 [ AC_MSG_RESULT(yes)
2418 AC_DEFINE(HAVE_ICONV_UCS_2_INTERNAL, 1, Define to 1 if iconv supports UCS-2-INTERNAL)
2419 valid_ucs2_code="UCS-2-INTERNAL"
2420 ],
2421 [ AC_MSG_RESULT(no) ],
2422 [ AC_MSG_RESULT(no) ]
2423 )
2424
2425 AC_MSG_CHECKING(whether iconv supports UCS-2)
2426 AC_RUN_IFELSE(
2427 [AC_LANG_PROGRAM([
2428 #if HAVE_ICONV_H
2429 #include <iconv.h>
2430 #endif
2431 ], [
2432 return iconv_open("UTF-8","UCS-2")==(iconv_t)(-1);
2433 ])
2434 ],
2435 [ AC_MSG_RESULT(yes)
2436 AC_DEFINE(HAVE_ICONV_UCS_2, 1, Define to 1 if iconv supports UCS-2)
2437 valid_ucs2_code="UCS-2"
2438 ],
2439 [ AC_MSG_RESULT(no) ],
2440 [ AC_MSG_RESULT(no) ]
2441 )
2442
2443 AC_MSG_CHECKING(whether iconv supports UCS2)
2444 AC_RUN_IFELSE(
2445 [AC_LANG_PROGRAM([
2446 #if HAVE_ICONV_H
2447 #include <iconv.h>
2448 #endif
2449 ], [
2450 return iconv_open("UTF-8","UCS2")==(iconv_t)(-1);
2451 ])
2452 ],
2453 [ AC_MSG_RESULT(yes)
2454 AC_DEFINE(HAVE_ICONV_UCS2, 1, Define to 1 if iconv supports UCS2)
2455 valid_ucs2_code="UCS2"
2456 ],
2457 [ AC_MSG_RESULT(no) ],
2458 [ AC_MSG_RESULT(no) ]
2459 )
2460
2461 AC_MSG_CHECKING(whether iconv supports UCS-2BE)
2462 AC_RUN_IFELSE(
2463 [AC_LANG_PROGRAM([
2464 #if HAVE_ICONV_H
2465 #include <iconv.h>
2466 #endif
2467 ], [
2468 return iconv_open("UTF-8","UCS-2BE")==(iconv_t)(-1);
2469 ])
2470 ],
2471 [ AC_MSG_RESULT(yes)
2472 AC_DEFINE(HAVE_ICONV_UCS_2BE, 1, Define to 1 if iconv supports UCS-2BE)
2473 valid_ucs2_code="UCS-2BE"
2474 ],
2475 [ AC_MSG_RESULT(no) ],
2476 [ AC_MSG_RESULT(no) ]
2477 )
2478
2479 AC_MSG_CHECKING(whether iconv supports UCS-2LE)
2480 AC_RUN_IFELSE(
2481 [AC_LANG_PROGRAM([
2482 #if HAVE_ICONV_H
2483 #include <iconv.h>
2484 #endif
2485 ], [
2486 return iconv_open("UTF-8","UCS-2LE")==(iconv_t)(-1);
2487 ])
2488 ],
2489 [ AC_MSG_RESULT(yes)
2490 AC_DEFINE(HAVE_ICONV_UCS_2LE, 1, Define to 1 if iconv supports UCS-2LE)
2491 valid_ucs2_code="UCS-2LE"
2492 ],
2493 [ AC_MSG_RESULT(no) ],
2494 [ AC_MSG_RESULT(no) ]
2495 )
2496
2497 AC_MSG_CHECKING(whether iconv supports UTF-16)
2498 AC_RUN_IFELSE(
2499 [AC_LANG_PROGRAM([
2500 #if HAVE_ICONV_H
2501 #include <iconv.h>
2502 #endif
2503 ], [
2504 return iconv_open("UTF-8","UTF-16")==(iconv_t)(-1);
2505 ])
2506 ],
2507 [ AC_MSG_RESULT(yes)
2508 AC_DEFINE(HAVE_ICONV_UTF_16, 1, Define to 1 if iconv supports UTF-16)
2509 valid_ucs2_code="UTF-16"
2510 ],
2511 [ AC_MSG_RESULT(no) ],
2512 [ AC_MSG_RESULT(no) ]
2513 )
2514
2515 AC_MSG_CHECKING(whether iconv supports UCS-4-INTERNAL)
2516 AC_RUN_IFELSE(
2517 [AC_LANG_PROGRAM([
2518 #if HAVE_ICONV_H
2519 #include <iconv.h>
2520 #endif
2521 ], [
2522 return iconv_open("UTF-8","UCS-4-INTERNAL")==(iconv_t)(-1);
2523 ])
2524 ],
2525 [ AC_MSG_RESULT(yes)
2526 AC_DEFINE(HAVE_ICONV_UCS_4_INTERNAL, 1, Define to 1 if iconv supports UCS-4-INTERNAL)
2527 valid_ucs4_code="UCS-4-INTERNAL"
2528 ],
2529 [ AC_MSG_RESULT(no) ],
2530 [ AC_MSG_RESULT(no) ]
2531 )
2532
2533 AC_MSG_CHECKING(whether iconv supports UCS-4)
2534 AC_RUN_IFELSE(
2535 [AC_LANG_PROGRAM([
2536 #if HAVE_ICONV_H
2537 #include <iconv.h>
2538 #endif
2539 ], [
2540 return iconv_open("UTF-8","UCS-4")==(iconv_t)(-1);
2541 ])
2542 ],
2543 [ AC_MSG_RESULT(yes)
2544 AC_DEFINE(HAVE_ICONV_UCS_4, 1, Define to 1 if iconv supports UCS-4)
2545 valid_ucs4_code="UCS-4"
2546 ],
2547 [ AC_MSG_RESULT(no) ],
2548 [ AC_MSG_RESULT(no) ]
2549 )
2550
2551 AC_MSG_CHECKING(whether iconv supports UCS4)
2552 AC_RUN_IFELSE(
2553 [AC_LANG_PROGRAM([
2554 #if HAVE_ICONV_H
2555 #include <iconv.h>
2556 #endif
2557 ], [
2558 return iconv_open("UTF-8","UCS4")==(iconv_t)(-1);
2559 ])
2560 ],
2561 [ AC_MSG_RESULT(yes)
2562 AC_DEFINE(HAVE_ICONV_UCS4, 1, Define to 1 if iconv supports UCS4)
2563 valid_ucs4_code="UCS4"
2564 ],
2565 [ AC_MSG_RESULT(no) ],
2566 [ AC_MSG_RESULT(no) ]
2567 )
2568
2569 AC_MSG_CHECKING(whether iconv supports UCS-4BE)
2570 AC_RUN_IFELSE(
2571 [AC_LANG_PROGRAM([
2572 #if HAVE_ICONV_H
2573 #include <iconv.h>
2574 #endif
2575 ], [
2576 return iconv_open("UTF-8","UCS-4BE")==(iconv_t)(-1);
2577 ])
2578 ],
2579 [ AC_MSG_RESULT(yes)
2580 AC_DEFINE(HAVE_ICONV_UCS_4BE, 1, Define to 1 if iconv supports UCS-4BE)
2581 valid_ucs4_code="UCS-4BE"
2582 ],
2583 [ AC_MSG_RESULT(no) ],
2584 [ AC_MSG_RESULT(no) ]
2585 )
2586
2587 AC_MSG_CHECKING(whether iconv supports UCS-4LE)
2588 AC_RUN_IFELSE(
2589 [AC_LANG_PROGRAM([
2590 #if HAVE_ICONV_H
2591 #include <iconv.h>
2592 #endif
2593 ], [
2594 return iconv_open("UTF-8","UCS-4LE")==(iconv_t)(-1);
2595 ])
2596 ],
2597 [ AC_MSG_RESULT(yes)
2598 AC_DEFINE(HAVE_ICONV_UCS_4LE, 1, Define to 1 if iconv supports UCS-4LE)
2599 valid_ucs4_code="UCS-4LE"
2600 ],
2601 [ AC_MSG_RESULT(no) ],
2602 [ AC_MSG_RESULT(no) ]
2603 )
2604
2605 AC_MSG_CHECKING(whether iconv supports UTF-32)
2606 AC_RUN_IFELSE(
2607 [AC_LANG_PROGRAM([
2608 #if HAVE_ICONV_H
2609 #include <iconv.h>
2610 #endif
2611 ], [
2612 return iconv_open("UTF-8","UTF-32")==(iconv_t)(-1);
2613 ])
2614 ],
2615 [ AC_MSG_RESULT(yes)
2616 AC_DEFINE(HAVE_ICONV_UTF_32, 1, Define to 1 if iconv supports UTF-32)
2617 valid_ucs4_code="UTF-32"
2618 ],
2619 [ AC_MSG_RESULT(no) ],
2620 [ AC_MSG_RESULT(no) ]
2621 )
2622
2623 AC_MSG_CHECKING(whether iconv supports //IGNORE)
2624 AC_RUN_IFELSE(
2625 [AC_LANG_PROGRAM([
2626 #if HAVE_ICONV_H
2627 #include <iconv.h>
2628 #endif
2629 ], [
2630 return iconv_open("UTF-8//IGNORE","$valid_ucs2_code")==(iconv_t)(-1);
2631 ])
2632 ],
2633 [ AC_MSG_RESULT(yes)
2634 AC_DEFINE(HAVE_ICONV_IGNORE, 1, Define to 1 if iconv supports //IGNORE option)
2635 ],
2636 [ AC_MSG_RESULT(no) ],
2637 [ AC_MSG_RESULT(no) ]
2638 )
2639
2640 AC_MSG_CHECKING(whether iconv supports state reset)
2641 AC_RUN_IFELSE(
2642 [AC_LANG_PROGRAM([
2643 #include <stdio.h>
2644 #if HAVE_ICONV_H
2645 #include <iconv.h>
2646 #endif
2647 ], [
2648 iconv_t cd = iconv_open("UTF-8","$valid_ucs2_code");
2649 if (cd == (iconv_t)(-1)) return 1;
2650 return iconv(cd, NULL, NULL, NULL, NULL) != 0;
2651 ])
2652 ],
2653 [ AC_MSG_RESULT(yes)
2654 AC_DEFINE(HAVE_ICONV_STATE_RESET, 1, Define to 1 if iconv supports state reset)
2655 ],
2656 [ AC_MSG_RESULT(no) ],
2657 [ AC_MSG_RESULT(no) ]
2658 )
2659
2660 AC_MSG_CHECKING(whether iconv descriptor cache is needed)
2661 case $enable_iconv_cache in
2662 auto)
2663 case $PLATFORM in
2664 SunOS|HP-UX|AIX)
2665 enable_iconv_cache=yes
2666 ;;
2667 *)
2668 enable_iconv_cache=no
2669 ;;
2670 esac
2671 ;;
2672 yes|no)
2673 ;;
2674 *)
2675 AC_MSG_ERROR([Value given to --enable-iconv-cache must be one of yes, no or auto])
2676 ;;
2677 esac
2678 if test "x$enable_iconv_cache" = "xyes"; then
2679 AC_DEFINE(WITH_ICONV_CACHE, 1, Define to 1 to enable iconv descriptor cache)
2680 fi
2681 AC_MSG_RESULT($enable_iconv_cache)
2682
2683 # taken from ZSH's configure
2684 # Check if iconv uses const in prototype declaration
2685 if test "x$ac_found_iconv" = "xyes"; then
2686 AC_LANG_PUSH([C++])
2687 AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
2688 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2689 #include <stdlib.h>
2690 #if HAVE_ICONV_H
2691 #include <iconv.h>
2692 #endif
2693 ]],
2694 [[
2695 char **p = NULL;
2696 iconv(0, (const char **)p, 0, 0, 0);
2697 ]])],
2698 [ac_cv_iconv_const=const],
2699 [ac_cv_iconv_const=])])
2700 AC_LANG_POP([C++])
2701 AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
2702 [Define as const if the declaration of iconv() needs const.])
2703 fi
2704
2705 if test "x$ac_cv_type_wchar_t" = "xyes"; then
2706 if test $ac_cv_sizeof_wchar_t -eq 2; then
2707 AC_DEFINE(UNICODE_UCS2, 1, Define to 1 if you have 2-byte wchar_t)
2708 fi
2709
2710 if test $ac_cv_sizeof_wchar_t -eq 4; then
2711 AC_DEFINE(UNICODE_UCS4, 1, Define to 1 if you have 4-byte wchar_t)
2712 fi
2713
2714 if test "x$USE_INTERNAL_LIBTRE" = "xyes"; then
2715 AC_DEFINE(TRE_WCHAR, 1, [ Define to enable wide character support in libtre.])
2716 fi
2717 else
2718 if test "x$BUILD_UNICODE" = "xyes"; then
2719 AC_MSG_ERROR(wchar_t is required for UNICODE build)
2720 fi
2721 fi
2722
2723
2724 #--------------------------------------------------------------------
2725 # MySQL
2726 #--------------------------------------------------------------------
2727
2728 check_substr "$COMPONENTS" "mysql"
2729 if test $? = 0; then
2730 OLD_CPPFLAGS="$CPPFLAGS"
2731 OLD_LDFLAGS="$LDFLAGS"
2732 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2733
2734 CPPFLAGS="$CPPFLAGS $MYSQL_CPPFLAGS"
2735 LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
2736 if test "x$MYSQL_LD_RUN_PATH" != "x"; then
2737 LD_RUN_PATH="${MYSQL_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2738 fi
2739
2740 AC_CHECK_HEADER(mysql.h,,AC_MSG_ERROR([Cannot find mysql.h - check your MySQL client installation]))
2741
2742 AC_CHECK_LIB(mysqlclient, mysql_init, [MYSQL_LIBS="-lmysqlclient"],
2743 [AC_MSG_ERROR(libmysqlclient is requred for MySQL support)])
2744
2745 OLD_LIBS="$LIBS"
2746 LIBS="$LIBS $MYSQL_LIBS"
2747
2748 AC_CHECK_FUNCS(mysql_real_escape_string)
2749
2750 CPPFLAGS="$OLD_CPPFLAGS"
2751 LDFLAGS="$OLD_LDFLAGS"
2752 LD_RUN_PATH="$OLD_LD_RUN_PATH"
2753 LIBS="$OLD_LIBS"
2754 fi
2755
2756
2757 #--------------------------------------------------------------------
2758 # PostgreSQL
2759 #--------------------------------------------------------------------
2760
2761 check_substr "$COMPONENTS" "pgsql"
2762 if test $? = 0; then
2763 OLD_CPPFLAGS="$CPPFLAGS"
2764 OLD_LDFLAGS="$LDFLAGS"
2765 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2766
2767 CPPFLAGS="$CPPFLAGS $PGSQL_CPPFLAGS"
2768 LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS"
2769 if test "x$PGSQL_LD_RUN_PATH" != "x"; then
2770 LD_RUN_PATH="${PGSQL_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2771 fi
2772
2773 AC_CHECK_HEADER(libpq-fe.h,,AC_MSG_ERROR([Cannot find libpq-fe.h - check your PostgreSQL client installation]))
2774
2775 AC_CHECK_DECLS([PGRES_SINGLE_TUPLE],,,[
2776 #include <libpq-fe.h>
2777 ])
2778
2779 AC_CHECK_LIB(m, floor)
2780 AC_CHECK_LIB(pq, PQconnectdb, [PGSQL_LIBS="-lpq"], [
2781 if test "x$PLATFORM" = "xSunOS"; then
2782 if test -d "$PGSQL_LD_RUN_PATH/sparcv9"; then
2783 PGSQL_LDFLAGS="$PGSQL_LDFLAGS/sparcv9"
2784 else
2785 PGSQL_LDFLAGS="$PGSQL_LDFLAGS/64"
2786 fi
2787 LDFLAGS="$OLD_LDFLAGS $PGSQL_LDFLAGS"
2788 if test "x$PGSQL_LD_RUN_PATH" != "x"; then
2789 PGSQL_LD_RUN_PATH="$PGSQL_LD_RUN_PATH/sparcv9"
2790 LD_RUN_PATH="${PGSQL_LD_RUN_PATH}${OLD_LD_RUN_PATH:+:}${OLD_LD_RUN_PATH}"
2791 fi
2792 unset ac_cv_lib_pq_PQconnectdb
2793 AC_CHECK_LIB(pq, PQconnectdb, [PGSQL_LIBS="-lpq"], [
2794 AC_MSG_ERROR(libpq is required for PostgreSQL support)])
2795 else
2796 AC_MSG_ERROR(libpq is required for PostgreSQL support)
2797 fi
2798 ])
2799
2800 CPPFLAGS="$OLD_CPPFLAGS"
2801 LDFLAGS="$OLD_LDFLAGS"
2802 LD_RUN_PATH="$OLD_LD_RUN_PATH"
2803 fi
2804
2805
2806 #--------------------------------------------------------------------
2807 # ODBC
2808 #--------------------------------------------------------------------
2809
2810 check_substr "$COMPONENTS" "odbc"
2811 if test $? = 0; then
2812 OLD_CPPFLAGS="$CPPFLAGS"
2813 OLD_LDFLAGS="$LDFLAGS"
2814 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2815
2816 CPPFLAGS="$CPPFLAGS $ODBC_CPPFLAGS"
2817 LDFLAGS="$LDFLAGS $ODBC_LDFLAGS"
2818 if test "x$ODBC_LD_RUN_PATH" != "x"; then
2819 LD_RUN_PATH="${ODBC_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2820 fi
2821
2822 AC_CHECK_LIB(odbc, SQLAllocHandle, [ODBC_LIBS="-lodbc"],
2823 [AC_MSG_ERROR(libodbc is required for ODBC support)])
2824 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2825 SUBAGENT_LIBS="$SUBAGENT_LIBS $ODBC_LIBS"
2826 AC_CHECK_LIB(ltdl, lt_dlopen, [SUBAGENT_LIBS="$SUBAGENT_LIBS -lltdl"], [])
2827 fi
2828
2829 CPPFLAGS="$OLD_CPPFLAGS"
2830 LDFLAGS="$OLD_LDFLAGS"
2831 LD_RUN_PATH="$OLD_LD_RUN_PATH"
2832 fi
2833
2834
2835 #--------------------------------------------------------------------
2836 # Oracle
2837 #--------------------------------------------------------------------
2838
2839 check_substr "$COMPONENTS" "oracle"
2840 if test $? = 0; then
2841 OLD_CPPFLAGS="$CPPFLAGS"
2842 OLD_LDFLAGS="$LDFLAGS"
2843 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2844
2845 CPPFLAGS="$CPPFLAGS $ORACLE_CPPFLAGS"
2846 LDFLAGS="$LDFLAGS $ORACLE_LDFLAGS"
2847 if test "x$ORACLE_LD_RUN_PATH" != "x"; then
2848 LD_RUN_PATH="${ORACLE_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2849 fi
2850
2851 AC_CHECK_HEADER(oci.h,,AC_MSG_ERROR([*** Cannot find oci.h - check your Oracle client installation ***]))
2852 AC_CHECK_LIB(nnz12, nzstrcpy, [NNZ_LIB=-lnnz12],
2853 [
2854 AC_CHECK_LIB(nnz11, nzstrcpy, [NNZ_LIB=-lnnz11],
2855 [
2856 AC_CHECK_LIB(nnz10, nzstrcpy, [NNZ_LIB=-lnnz10], [], [-lclntsh])
2857 ], [-lclntsh])
2858 ], [-lclntsh])
2859 AC_CHECK_LIB(clntsh, OCIHandleAlloc, [ORACLE_LIBS="-lclntsh $NNZ_LIB"],
2860 [AC_MSG_ERROR(libclntsh is required for Oracle support)], [$NNZ_LIB])
2861 AC_CHECK_LIB(rt, sem_destroy, [ORACLE_LIBS="$ORACLE_LIBS -lrt"], [])
2862 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2863 SUBAGENT_LIBS="$SUBAGENT_LIBS $ORACLE_LIBS"
2864 fi
2865
2866 CPPFLAGS="$OLD_CPPFLAGS"
2867 LDFLAGS="$OLD_LDFLAGS"
2868 LD_RUN_PATH="$OLD_LD_RUN_PATH"
2869 fi
2870
2871 #--------------------------------------------------------------------
2872 # DB2
2873 #--------------------------------------------------------------------
2874
2875 check_substr "$COMPONENTS" "db2"
2876 if test $? = 0; then
2877 AC_CHECK_HEADER(sql.h,,AC_MSG_ERROR([*** Cannot find sql.h - check your DB2 client installation ***]))
2878 AC_CHECK_LIB(db2, SQLAllocHandle, [DB2_LIBS="-ldb2"],
2879 [AC_MSG_ERROR(libdb2 is required for DB2 support)])
2880 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2881 SUBAGENT_LIBS="$SUBAGENT_LIBS $DB2_LIBS"
2882 fi
2883 fi
2884
2885 #--------------------------------------------------------------------
2886 # Informix
2887 #--------------------------------------------------------------------
2888
2889 check_substr "$COMPONENTS" "informix"
2890 if test $? = 0; then
2891 AC_CHECK_HEADER(infxcli.h,,AC_MSG_ERROR([*** Cannot find infxcli.h - check your Informix client installation ***]))
2892 AC_CHECK_LIB(thcli, SQLAllocHandle, [INFORMIX_LIBS="-lthcli"],
2893 [AC_MSG_ERROR(libthcli is required for Informix support)])
2894 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2895 SUBAGENT_LIBS="$SUBAGENT_LIBS $INFORMIX_LIBS"
2896 fi
2897 fi
2898
2899
2900 #--------------------------------------------------------------------
2901 # Java
2902 #--------------------------------------------------------------------
2903
2904 check_substr "$COMPONENTS" "java"
2905 if test $? = 0; then
2906 AC_CHECK_HEADER(jni.h,,AC_MSG_ERROR([*** Cannot find jni.h - check your JDK installation ***]))
2907 fi
2908
2909
2910 #--------------------------------------------------------------------
2911 # Tuxedo
2912 #--------------------------------------------------------------------
2913
2914 check_substr "$COMPONENTS" "tuxedo"
2915 if test $? = 0; then
2916 OLD_CPPFLAGS="$CPPFLAGS"
2917 OLD_LDFLAGS="$LDFLAGS"
2918 OLD_LIBS="$LIBS"
2919
2920 if test "x$TUXEDO_BASE" != "x"; then
2921 TUXEDO_CPPFLAGS="-I$TUXEDO_BASE/include"
2922 TUXEDO_LDFLAGS="-L$TUXEDO_BASE/lib"
2923 CPPFLAGS="$CPPFLAGS $TUXEDO_CPPFLAGS"
2924 LDFLAGS="$LDFLAGS $TUXEDO_LDFLAGS"
2925 fi
2926
2927 AC_CHECK_HEADER(atmi.h,,AC_MSG_ERROR([*** Cannot find atmi.h - check your Tuxedo installation ***]))
2928
2929 # https://community.oracle.com/thread/2346582
2930 if test "x$PLATFORM" = "xLinux"; then
2931 TUXEDO_LDFLAGS="$TUXEDO_LDFLAGS -Xlinker --no-as-needed"
2932 LDFLAGS="$LDFLAGS -Xlinker --no-as-needed"
2933 fi
2934
2935 if test "$PLATFORM" = "SunOS"; then
2936 AC_CHECK_LIB(rt, nanosleep, [ TUXEDO_LIBS="$TUXEDO_LIBS -lrt" ])
2937 fi
2938
2939 if test "$PLATFORM" = "AIX"; then
2940 AC_MSG_CHECKING(for xa_switchp in libengine)
2941 OLD_LIBS_LIBENGINE="$LIBS"
2942 LIBS="$LIBS -lengine"
2943 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern char *xa_switchp; ]], [[ *xa_switchp = 0; ]])],
2944 [
2945 AC_MSG_RESULT(yes)
2946 TUXEDO_LIBS="$TUXEDO_LIBS -lengine"
2947 ],
2948 [ AC_MSG_RESULT(no) ])
2949 LIBS="$OLD_LIBS_LIBENGINE"
2950 fi
2951
2952 LIBS="$LIBS $TUXEDO_LIBS"
2953 AC_CHECK_LIB(tux, tpcall, [], [AC_MSG_ERROR(libtux is required for Tuxedo support)])
2954
2955 CPPFLAGS="$OLD_CPPFLAGS"
2956 LDFLAGS="$OLD_LDFLAGS"
2957 LIBS="$OLD_LIBS"
2958
2959 if test "x$PLATFORM" = "xAIX"; then
2960 if test -e $TUXEDO_BASE/lib/tpinit.o; then
2961 TUXEDO_TPINIT="$TUXEDO_BASE/lib/tpinit.o"
2962 fi
2963 fi
2964 fi
2965
2966 #--------------------------------------------------------------------
2967 # ZeroMQ
2968 #--------------------------------------------------------------------
2969
2970 check_substr "$COMPONENTS" "zeromq"
2971 if test $? = 0; then
2972 OLD_CPPFLAGS="$CPPFLAGS"
2973 OLD_LDFLAGS="$LDFLAGS"
2974 OLD_LIBS="$LIBS"
2975
2976 if test "x$ZEROMQ_BASE" != "x"; then
2977 ZEROMQ_CPPFLAGS="-I$ZEROMQ_BASE/include"
2978 ZEROMQ_LDFLAGS="-L$ZEROMQ_BASE/lib"
2979 CPPFLAGS="$CPPFLAGS $ZEROMQ_CPPFLAGS"
2980 LDFLAGS="$LDFLAGS $ZEROMQ_LDFLAGS"
2981 fi
2982
2983 AC_CHECK_HEADER(zmq.h,,[
2984 if test "x$ZEROMQ_REQUIRED" = "xyes"; then
2985 AC_MSG_ERROR([*** Cannot find zmq.h - check your ZeroMQ installation ***])
2986 else
2987 ZEROMQ_SUPPORT="no"
2988 fi
2989 ])
2990 AC_CHECK_LIB(zmq, zmq_ctx_new, [ SERVER_LIBS="$SERVER_LIBS -lzmq" ], [
2991 if test "x$ZEROMQ_REQUIRED" = "xyes"; then
2992 AC_MSG_ERROR([*** libzmq is missing or too old - check your ZeroMQ installation ***])
2993 else
2994 ZEROMQ_SUPPORT="no"
2995 fi
2996 ])
2997
2998 if test "x$ZEROMQ_SUPPORT" = "xyes"; then
2999 AC_DEFINE(WITH_ZMQ, 1, Define to 1 if ZeroMQ is supported)
3000 fi
3001
3002 CPPFLAGS="$OLD_CPPFLAGS"
3003 LDFLAGS="$OLD_LDFLAGS"
3004 LIBS="$OLD_LIBS"
3005 fi
3006
3007 #--------------------------------------------------------------------
3008 # MongoDB
3009 #--------------------------------------------------------------------
3010
3011 check_substr "$COMPONENTS" "mongodb"
3012 if test $? = 0; then
3013 OLD_CPPFLAGS="$CPPFLAGS"
3014 OLD_LDFLAGS="$LDFLAGS"
3015 OLD_LIBS="$LIBS"
3016
3017 if test "x$MONGODB_BASE" != "x"; then
3018 MONGODB_CPPFLAGS="-I$MONGODB_BASE/include/libmongoc-1.0/ -I$MONGODB_BASE/include/libbson-1.0/"
3019 MONGODB_LDFLAGS="-L$MONGODB_BASE/lib"
3020 CPPFLAGS="$CPPFLAGS $MONGODB_CPPFLAGS"
3021 LDFLAGS="$LDFLAGS $MONGODB_LDFLAGS"
3022 else
3023 MONGODB_CPPFLAGS="-I/usr/local/include/libmongoc-1.0/ -I/usr/local/include/libbson-1.0/"
3024 MONGODB_LDFLAGS="-L/usr/local/lib"
3025 CPPFLAGS="$CPPFLAGS $MONGODB_CPPFLAGS"
3026 LDFLAGS="$LDFLAGS $MONGODB_LDFLAGS"
3027 fi
3028
3029 AC_CHECK_HEADER(mongoc.h,,AC_MSG_ERROR([*** Cannot find mongoc.h - check your MongoDB installation ***]))
3030 AC_CHECK_LIB(mongoc-1.0, mongoc_client_get_database, [ MONGODB_LIBS="$MONGODB_LIBS -lmongoc-1.0" ])
3031 AC_CHECK_LIB(bson-1.0, nanosleep, [ MONGODB_LIBS="$MONGODB_LIBS -lbson-1.0" ])
3032
3033 LIBS="$LIBS $MONGODB_LIBS"
3034
3035 CPPFLAGS="$OLD_CPPFLAGS"
3036 LDFLAGS="$OLD_LDFLAGS"
3037 LIBS="$OLD_LIBS"
3038 fi
3039
3040 #--------------------------------------------------------------------
3041 # VMGR
3042 #--------------------------------------------------------------------
3043
3044 check_substr "$COMPONENTS" "vmgr"
3045 if test $? = 0; then
3046 OLD_CPPFLAGS="$CPPFLAGS"
3047 OLD_LDFLAGS="$LDFLAGS"
3048 OLD_LIBS="$LIBS"
3049
3050 if test "x$LIBVIRT_BASE" != "x"; then
3051 VMGR_CPPFLAGS="-I$LIBVIRT_BASE/include"
3052 VMGR_LDFLAGS="-L$LIBVIRT_BASE/lib"
3053 CPPFLAGS="$CPPFLAGS $VMGR_CPPFLAGS"
3054 LDFLAGS="$LDFLAGS $VMGR_LDFLAGS"
3055 else
3056 VMGR_CPPFLAGS=""
3057 VMGR_LDFLAGS=""
3058 CPPFLAGS="$CPPFLAGS $VMGR_CPPFLAGS"
3059 LDFLAGS="$LDFLAGS $VMGR_LDFLAGS"
3060 fi
3061
3062 AC_CHECK_HEADER(libvirt/libvirt.h,,AC_MSG_ERROR([*** Cannot find libvirt.h - check your libvirt installation ***]))
3063 AC_CHECK_LIB(virt, virConnectGetLibVersion, [ VMGR_LIBS="$VMGR_LIBS -lvirt" ])
3064 LIBS="$LIBS $VMGR_LIBS"
3065
3066 AC_CHECK_FUNCS([virDomainGetTime])
3067
3068 CPPFLAGS="$OLD_CPPFLAGS"
3069 LDFLAGS="$OLD_LDFLAGS"
3070 LIBS="$OLD_LIBS"
3071 fi
3072
3073 #--------------------------------------------------------------------
3074 # Other settings
3075 #--------------------------------------------------------------------
3076
3077 if test "x$RUNTIME_PREFIX" = "x"; then
3078 if test "x${BUILD_UNICODE}" = "xyes"; then
3079 CPPFLAGS="$CPPFLAGS -DPREFIX=L\\\"\${prefix}\\\" -DDATADIR=L\\\"\${pkgdatadir}\\\" -DBINDIR=L\\\"\${bindir}\\\" -DLIBDIR=L\\\"\${libdir}\\\" -DPKGLIBDIR=L\\\"\${pkglibdir}\\\" -DSTATEDIR=L\\\"\${localstatedir}/lib/netxms\\\""
3080 else
3081 CPPFLAGS="$CPPFLAGS -DPREFIX=\\\"\${prefix}\\\" -DDATADIR=\\\"\${pkgdatadir}\\\" -DBINDIR=\\\"\${bindir}\\\" -DLIBDIR=\\\"\${libdir}\\\" -DPKGLIBDIR=\\\"\${pkglibdir}\\\" -DSTATEDIR=\\\"\${localstatedir}/lib/netxms\\\""
3082 fi
3083 else
3084 if test "x${BUILD_UNICODE}" = "xyes"; then
3085 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\\\""
3086 else
3087 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\\\""
3088 fi
3089 LDFLAGS_SUFFIX="$LDFLAGS_SUFFIX -R $RUNTIME_PREFIX/lib"
3090 fi
3091 LDFLAGS="$LDFLAGS_PREFIX $LDFLAGS $LDFLAGS_SUFFIX"
3092
3093 if test "x${ENABLE_WERROR}" = "xyes"; then
3094 CPPFLAGS="$CPPFLAGS -Werror"
3095 fi
3096
3097 if test "x$PLATFORM" = "xDarwin"; then
3098 SHLIB_SUFFIX=".so"
3099 else
3100 if test "x$shrext_cmds" != "x"; then
3101 SHLIB_SUFFIX="$shrext_cmds"
3102 else
3103 SHLIB_SUFFIX=".so"
3104 fi
3105 fi
3106 AC_DEFINE_UNQUOTED([SHLIB_SUFFIX], _T("$SHLIB_SUFFIX"), [Define to platform's shared library suffix])
3107
3108 if test "x$ENABLE_DEBUG" = "xno"; then
3109 CPPFLAGS="$CPPFLAGS -DNDEBUG"
3110 fi
3111
3112 if test "x$WITH_JEMALLOC" = "xyes"; then
3113 LIBS="$LIBS -ljemalloc"
3114 fi
3115
3116 AM_CONDITIONAL([USE_INTERNAL_EXPAT], [test "x$HAVE_LIBEXPAT" = "xno"])
3117 AM_CONDITIONAL([USE_INTERNAL_LIBTRE], [test "x$HAVE_LIBTRE" = "xno"])
3118 AM_CONDITIONAL([USE_INTERNAL_JANSSON], [test "x$HAVE_JANSSON" = "xno"])
3119 AM_CONDITIONAL([USE_INTERNAL_SQLITE], [test "x$HAVE_SQLITE" = "xno"])
3120 AM_CONDITIONAL([USE_INTERNAL_ZLIB], [test "$HAVE_ZLIB" = "no"])
3121 AM_CONDITIONAL([STATIC_BUILD], [test "x$STATIC_BUILD" = "xyes"])
3122 AM_CONDITIONAL([ALL_STATIC], [test "x$ALL_STATIC" = "xyes"])
3123 AM_CONDITIONAL([USE_ENCRYPTION], [test "x${WITH_ENCRYPTION}" = "xyes"])
3124 AM_CONDITIONAL([HPUX_HPPA], [test "x$HPUX_HPPA" = "xyes"])
3125 AM_CONDITIONAL([XMPP_SUPPORT], [test "x$XMPP_SUPPORT" = "xyes"])
3126 AM_CONDITIONAL([ZEROMQ_SUPPORT], [test "x$ZEROMQ_SUPPORT" = "xyes"])
3127
3128
3129 #--------------------------------------------------------------------
3130 # Get compiler version
3131 #--------------------------------------------------------------------
3132
3133 COMPILER_VERSION=""
3134 for opt in --version -v -V -qversion; do
3135 v=`$CXX $opt 2>/dev/null | head -1`
3136 if test $? = 0; then
3137 if test "x$COMPILER_VERSION" = "x"; then
3138 COMPILER_VERSION="$v"
3139 AC_DEFINE_UNQUOTED([CPP_COMPILER_VERSION], "$COMPILER_VERSION", [C++ compiler version information])
3140 fi
3141 fi
3142 done
3143
3144
3145 #--------------------------------------------------------------------
3146 # Cleanup variables
3147 #--------------------------------------------------------------------
3148
3149 AS_IF([test "x$with_dist" = "xyes"],
3150 [
3151 AGENT_DIRS=`echo $AGENT_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
3152 SUBAGENT_DIRS=`echo $SUBAGENT_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
3153 MODULES=`echo $MODULES|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
3154 SMSDRV_DIRS=`echo $SMSDRV_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
3155 HDLINK_DIRS=`echo $HDLINK_DIRS|perl -nae 'my %seen; my @out; for (@F) {push(@out, $_) unless $seen{$_}++; }; print join(" ", @out)'`
3156 ])
3157
3158
3159 #--------------------------------------------------------------------
3160 # Substitute variables
3161 #--------------------------------------------------------------------
3162
3163 AC_SUBST(DB_DRIVERS)
3164 AC_SUBST(MODULES)
3165 AC_SUBST(AGENT_DIRS)
3166 AC_SUBST(SUBAGENT_DIRS)
3167 AC_SUBST(SERVER_INCLUDE)
3168 AC_SUBST(SERVER_LIBS)
3169 AC_SUBST(SERVER_TOOLS)
3170 AC_SUBST(SMSDRV_DIRS)
3171 AC_SUBST(HDLINK_DIRS)
3172 AC_SUBST(PDSDRV_DIRS)
3173 AC_SUBST(TOP_LEVEL_MODULES)
3174 AC_SUBST(CONTRIB_MODULES)
3175 AC_SUBST(CLIENT_COMPONENTS)
3176 AC_SUBST(STATIC_SUBAGENT_LIST)
3177 AC_SUBST(SUBAGENT_LIBS)
3178 AC_SUBST(BUILD_SERVER)
3179 AC_SUBST(BUILD_SDK)
3180 AC_SUBST(MYSQL_CPPFLAGS)
3181 AC_SUBST(MYSQL_LDFLAGS)
3182 AC_SUBST(MYSQL_LIBS)
3183 AC_SUBST(PGSQL_CPPFLAGS)
3184 AC_SUBST(PGSQL_LDFLAGS)
3185 AC_SUBST(PGSQL_LIBS)
3186 AC_SUBST(ORACLE_CPPFLAGS)
3187 AC_SUBST(ORACLE_LDFLAGS)
3188 AC_SUBST(ORACLE_LIBS)
3189 AC_SUBST(ODBC_CPPFLAGS)
3190 AC_SUBST(ODBC_LDFLAGS)
3191 AC_SUBST(ODBC_LIBS)
3192 AC_SUBST(DB2_CPPFLAGS)
3193 AC_SUBST(DB2_LDFLAGS)
3194 AC_SUBST(DB2_LIBS)
3195 AC_SUBST(INFORMIX_CPPFLAGS)
3196 AC_SUBST(INFORMIX_LDFLAGS)
3197 AC_SUBST(INFORMIX_LIBS)
3198 AC_SUBST(OBJECT_MODE)
3199 AC_SUBST(SQLFLAGS)
3200 AC_SUBST(SHLIB_SUFFIX)
3201 AC_SUBST(TUXEDO_CPPFLAGS)
3202 AC_SUBST(TUXEDO_LDFLAGS)
3203 AC_SUBST(TUXEDO_LIBS)
3204 AC_SUBST(TUXEDO_TPINIT)
3205 AC_SUBST(MONGODB_CPPFLAGS)
3206 AC_SUBST(MONGODB_LDFLAGS)
3207 AC_SUBST(MONGODB_LIBS)
3208 AC_SUBST(VMGR_CPPFLAGS)
3209 AC_SUBST(VMGR_LDFLAGS)
3210 AC_SUBST(VMGR_LIBS)
3211 AC_SUBST(INSTALL_LIBPATH)
3212 AC_SUBST(ZEROMQ_CPPFLAGS)
3213 AC_SUBST(ZEROMQ_LDFLAGS)
3214
3215 #--------------------------------------------------------------------
3216 # Shared libs versions
3217 #
3218 # versioning scheme: current:revision:age
3219 #
3220 # current
3221 # The number of the current interface exported by the library. A current
3222 # value of `0', means that you are calling the interface exported by this
3223 # library interface 0.
3224 #
3225 # revision
3226 # The implementation number of the most recent interface exported by this
3227 # library. In this case, a revision value of `0' means that this is the
3228 # first implementation of the interface.
3229 # If the next release of this library exports the same interface, but has a
3230 # different implementation (perhaps some bugs have been fixed), the revision
3231 # number will be higher, but current number will be the same. In that case,
3232 # when given a choice, the library with the highest revision will always
3233 # be used by the runtime loader.
3234 #
3235 # age
3236 # The number of previous additional interfaces supported by this library.
3237 # If age were `2', then this library can be linked into executables which
3238 # were built with a release of this library that exported the current
3239 # interface number, current, or any of the previous two interfaces.
3240 # By definition age must be less than or equal to current. At the outset,
3241 # only the first ever interface is implemented, so age can only be `0'.
3242 #--------------------------------------------------------------------
3243
3244 NETXMS_LIBRARY_VERSION=2:0:0
3245 AC_SUBST(NETXMS_LIBRARY_VERSION)
3246
3247 #--------------------------------------------------------------------
3248 # Generate output files
3249 #--------------------------------------------------------------------
3250
3251 AC_CONFIG_FILES([
3252 Makefile
3253 contrib/Makefile
3254 contrib/backgrounds/Makefile
3255 contrib/integration/Makefile
3256 contrib/integration/HP_EVA/Makefile
3257 contrib/integration/HP_P2000/Makefile
3258 contrib/mibs/Makefile
3259 contrib/music/Makefile
3260 contrib/startup/Makefile
3261 contrib/startup/debian/Makefile
3262 contrib/startup/gentoo/Makefile
3263 contrib/startup/hp-ux/Makefile
3264 contrib/startup/redhat/Makefile
3265 contrib/startup/suse/Makefile
3266 contrib/startup/ubuntu/Makefile
3267 contrib/startup/solaris/Makefile
3268 contrib/templates/Makefile
3269 doc/Makefile
3270 doc/internal/Makefile
3271 doc/manuals/Makefile
3272 doc/misc/Makefile
3273 images/Makefile
3274 include/Makefile
3275 m4/Makefile
3276 src/Makefile
3277 src/agent/Makefile
3278 src/agent/core/Makefile
3279 src/agent/install/Makefile
3280 src/agent/libnxagent/Makefile
3281 src/agent/libnxappc/Makefile
3282 src/agent/libnxsd/Makefile
3283 src/agent/libnxtux/Makefile
3284 src/agent/subagents/Makefile
3285 src/agent/subagents/aix/Makefile
3286 src/agent/subagents/bind9/Makefile
3287 src/agent/subagents/darwin/Makefile
3288 src/agent/subagents/db2/Makefile
3289 src/agent/subagents/dbquery/Makefile
3290 src/agent/subagents/devemu/Makefile
3291 src/agent/subagents/ds18x20/Makefile
3292 src/agent/subagents/ecs/Makefile
3293 src/agent/subagents/filemgr/Makefile
3294 src/agent/subagents/freebsd/Makefile
3295 src/agent/subagents/gps/Makefile
3296 src/agent/subagents/hpux/Makefile
3297 src/agent/subagents/informix/Makefile
3298 src/agent/subagents/ipso/Makefile
3299 src/agent/subagents/java/Makefile
3300 src/agent/subagents/java/java/Makefile
3301 src/agent/subagents/java/java/src/Makefile
3302 src/agent/subagents/java/java/src/main/Makefile
3303 src/agent/subagents/java/java/src/main/java/Makefile
3304 src/agent/subagents/java/java/src/main/java/org/Makefile
3305 src/agent/subagents/java/java/src/main/java/org/netxms/Makefile
3306 src/agent/subagents/java/java/src/main/java/org/netxms/agent/Makefile
3307 src/agent/subagents/java/java/src/main/java/org/netxms/agent/adapters/Makefile
3308 src/agent/subagents/java/sample/Makefile
3309 src/agent/subagents/java/sample/src/Makefile
3310 src/agent/subagents/java/sample/src/main/Makefile
3311 src/agent/subagents/java/sample/src/main/java/Makefile
3312 src/agent/subagents/java/sample/src/main/java/org/Makefile
3313 src/agent/subagents/java/sample/src/main/java/org/netxms/Makefile
3314 src/agent/subagents/java/sample/src/main/java/org/netxms/agent/Makefile
3315 src/agent/subagents/java/sample/src/main/java/org/netxms/agent/demo/Makefile
3316 src/agent/subagents/jmx/Makefile
3317 src/agent/subagents/linux/Makefile
3318 src/agent/subagents/lmsensors/Makefile
3319 src/agent/subagents/logwatch/Makefile
3320 src/agent/subagents/minix/Makefile
3321 src/agent/subagents/mysql/Makefile
3322 src/agent/subagents/netbsd/Makefile
3323 src/agent/subagents/netsvc/Makefile
3324 src/agent/subagents/odbcquery/Makefile
3325 src/agent/subagents/openbsd/Makefile
3326 src/agent/subagents/oracle/Makefile
3327 src/agent/subagents/ping/Makefile
3328 src/agent/subagents/portCheck/Makefile
3329 src/agent/subagents/rpi/Makefile
3330 src/agent/subagents/sms/Makefile
3331 src/agent/subagents/ssh/Makefile
3332 src/agent/subagents/sunos/Makefile
3333 src/agent/subagents/tuxedo/Makefile
3334 src/agent/subagents/mongodb/Makefile
3335 src/agent/subagents/ubntlw/Makefile
3336 src/agent/subagents/ups/Makefile
3337 src/agent/subagents/vmgr/Makefile
3338 src/agent/subagents/winnt/Makefile
3339 src/agent/subagents/winperf/Makefile
3340 src/agent/subagents/wmi/Makefile
3341 src/agent/tools/Makefile
3342 src/agent/tools/nxappget/Makefile
3343 src/agent/tools/nxapush/Makefile
3344 src/appagent/Makefile
3345 src/client/Makefile
3346 src/client/install/Makefile
3347 src/client/libnxclient/Makefile
3348 src/client/nxalarm/Makefile
3349 src/client/nxevent/Makefile
3350 src/client/nxpush/Makefile
3351 src/client/nxsms/Makefile
3352 src/db/Makefile
3353 src/db/dbdrv/Makefile
3354 src/db/dbdrv/db2/Makefile
3355 src/db/dbdrv/informix/Makefile
3356 src/db/dbdrv/odbc/Makefile
3357 src/db/dbdrv/mssql/Makefile
3358 src/db/dbdrv/mysql/Makefile
3359 src/db/dbdrv/oracle/Makefile
3360 src/db/dbdrv/pgsql/Makefile
3361 src/db/dbdrv/sqlite/Makefile
3362 src/db/libnxdb/Makefile
3363 src/install/Makefile
3364 src/install/windows/Makefile
3365 src/jansson/Makefile
3366 src/libexpat/Makefile
3367 src/libexpat/libexpat/Makefile
3368 src/libnetxms/Makefile
3369 src/libnxcc/Makefile
3370 src/libnxlp/Makefile
3371 src/libnxmap/Makefile
3372 src/libnxmb/Makefile
3373 src/libnxsl/Makefile
3374 src/libstrophe/Makefile
3375 src/libtre/Makefile
3376 src/libtre/win32/Makefile
3377 src/nxcproxy/Makefile
3378 src/nxlptest/Makefile
3379 src/nxscript/Makefile
3380 src/server/Makefile
3381 src/server/core/Makefile
3382 src/server/drivers/Makefile
3383 src/server/drivers/airespace/Makefile
3384 src/server/drivers/at/Makefile
3385 src/server/drivers/baystack/Makefile
3386 src/server/drivers/cat2900xl/Makefile
3387 src/server/drivers/catalyst/Makefile
3388 src/server/drivers/cisco-esw/Makefile
3389 src/server/drivers/cisco-sb/Makefile
3390 src/server/drivers/dell-pwc/Makefile
3391 src/server/drivers/dlink/Makefile
3392 src/server/drivers/ers8000/Makefile
3393 src/server/drivers/h3c/Makefile
3394 src/server/drivers/hpsw/Makefile
3395 src/server/drivers/lib/Makefile
3396 src/server/drivers/lib/avaya-ers/Makefile
3397 src/server/drivers/lib/cisco/Makefile
3398 src/server/drivers/mikrotik/Makefile
3399 src/server/drivers/netscreen/Makefile
3400 src/server/drivers/ntws/Makefile
3401 src/server/drivers/ping3/Makefile
3402 src/server/drivers/procurve/Makefile
3403 src/server/drivers/qtech-olt/Makefile
3404 src/server/drivers/symbol-ws/Makefile
3405 src/server/drivers/tb/Makefile
3406 src/server/drivers/ubnt/Makefile
3407 src/server/hdlink/Makefile
3408 src/server/hdlink/jira/Makefile
3409 src/server/include/Makefile
3410 src/server/libnxsrv/Makefile
3411 src/server/netxmsd/Makefile
3412 src/server/pdsdrv/Makefile
3413 src/server/pdsdrv/rrdtool/Makefile
3414 src/server/tools/Makefile
3415 src/server/tools/nxaction/Makefile
3416 src/server/tools/nxadm/Makefile
3417 src/server/tools/nxap/Makefile
3418 src/server/tools/nxconfig/Makefile
3419 src/server/tools/nxconfig/res/Makefile
3420 src/server/tools/nxdbmgr/Makefile
3421 src/server/tools/nxget/Makefile
3422 src/server/tools/nxminfo/Makefile
3423 src/server/tools/nxupload/Makefile
3424 src/smsdrv/Makefile
3425 src/smsdrv/dummy/Makefile
3426 src/smsdrv/generic/Makefile
3427 src/smsdrv/kannel/Makefile
3428 src/smsdrv/mymobile/Makefile
3429 src/smsdrv/nexmo/Makefile
3430 src/smsdrv/nxagent/Makefile
3431 src/smsdrv/portech/Makefile
3432 src/smsdrv/slack/Makefile
3433 src/smsdrv/smseagle/Makefile
3434 src/smsdrv/text2reach/Makefile
3435 src/smsdrv/websms/Makefile
3436 src/snmp/Makefile
3437 src/snmp/libnxsnmp/Makefile
3438 src/snmp/nxmibc/Makefile
3439 src/snmp/nxsnmpget/Makefile
3440 src/snmp/nxsnmpset/Makefile
3441 src/snmp/nxsnmpwalk/Makefile
3442 src/sqlite/Makefile
3443 src/tools/Makefile
3444 src/tools/nxdevcfg/Makefile
3445 src/tools/nxencpasswd/Makefile
3446 src/tools/nxgenguid/Makefile
3447 src/zlib/Makefile
3448 sql/Makefile
3449 tests/Makefile
3450 tests/include/Makefile
3451 tests/test-libnetxms/Makefile
3452 tests/test-libnxcc/Makefile
3453 tests/test-libnxdb/Makefile
3454 tests/test-libnxsnmp/Makefile
3455 tools/Makefile
3456 ])
3457
3458 AC_OUTPUT
3459
3460 echo "Updating libtool"
3461 sed 's,$SED -e "/${host}-//g",$SED -e "s/${host}-//g",g' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
3462
3463 # On HP-UX, libtool passes +b instead of -Wl,+b even if gcc/g++ used as linker
3464 if test "x$ac_compiler_gnu" = "xyes" && test "x$PLATFORM" = "xHP-UX"; then
3465 sed "s,hardcode_libdir_flag_spec_ld=,#hardcode_libdir_flag_spec_ld=,g" < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
3466 fi
3467
3468 # On AIX, correct OBJECT_MODE must be set before linking
3469 # To avoid manual setting by user, we add this to libtool script
3470 if test "x$PLATFORM" = "xAIX"; then
3471 head -n 1 ./libtool > ./libtool.new
3472 echo "export OBJECT_MODE=$OBJECT_MODE" >> ./libtool.new
3473 tail -n +2 ./libtool >> ./libtool.new
3474 mv libtool.new libtool
3475 chmod +x ./libtool
3476 fi
3477
3478 #--------------------------------------------------------------------
3479 # Print summary
3480 #--------------------------------------------------------------------
3481
3482 echo
3483 echo
3484 echo
3485 echo '---------------------------------------------------------------------'
3486 echo ' Configure results'
3487 echo '---------------------------------------------------------------------'
3488 echo
3489 echo "Prefix : ${prefix}"
3490 echo "Platform : ${PLATFORM}"
3491 echo "Shared library suffix : ${SHLIB_SUFFIX}"
3492 if test "x$IPV6_SUPPORT" = "xyes"; then
3493 echo "IPv6 support : YES"
3494 else
3495 echo "IPv6 support : NO"
3496 fi
3497 if test "x${BUILD_SERVER}" = "xyes"; then
3498 echo "Build Server : YES"
3499 echo "Server libs : ${SERVER_LIBS}"
3500 if test "x${LDAP_SUPPORT}" = "xyes"; then
3501 echo "LDAP support : YES"
3502 else
3503 echo "LDAP support : NO"
3504 fi
3505 if test "x${XMPP_SUPPORT}" = "xyes"; then
3506 echo "XMPP support : YES"
3507 else
3508 echo "XMPP support : NO"
3509 fi
3510 if test "x${ZEROMQ_SUPPORT}" = "xyes"; then
3511 echo "ZeroMQ support : YES"
3512 else
3513 echo "ZeroMQ support : NO"
3514 fi
3515 else
3516 echo "Build Server : NO"
3517 fi
3518 if test "x${WITH_ENCRYPTION}" = "xyes"; then
3519 echo "Encryption enabled : YES"
3520 else
3521 echo "Encryption enabled : NO"
3522 fi
3523 if test "x${HAVE_LIBSSH}" = "xyes"; then
3524 echo "SSH support enabled : YES"
3525 else
3526 echo "SSH support enabled : NO"
3527 fi
3528 if test "x${DB_DRIVERS}" != "x"; then
3529 echo "Build DB-Drivers :${DB_DRIVERS}"
3530 else
3531 echo "Build DB-Drivers : NO"
3532 fi
3533 if test "x${BUILD_CLIENT}" = "xyes"; then
3534 echo "Build Clients : YES"
3535 else
3536 echo "Build Clients : NO"
3537 fi
3538 if test "x${BUILD_AGENT}" = "xyes"; then
3539 echo "Build Agent : YES"
3540 echo "Agent extra components : ${AGENT_DIRS}"
3541 echo "Subagents list : ${SUBAGENT_DIRS}"
3542 else
3543 echo "Build Agent : NO"
3544 fi
3545 if test "x${BUILD_STATIC_AGENT}" = "xyes"; then
3546 echo "Build Static Agent : YES"
3547 echo "Subagents list : ${STATIC_SUBAGENT_LIST}"
3548 else
3549 echo "Build Static Agent : NO"
3550 fi
3551 if test "x${BUILD_UNICODE}" = "xyes"; then
3552 echo "UNICODE build : YES"
3553 else
3554 echo "UNICODE build : NO"
3555 fi
3556 if test "x${HAVE_LIBEXPAT}" = "xno"; then
3557 echo "Use internal libexpat : YES"
3558 else
3559 echo "Use internal libexpat : NO"
3560 fi
3561 if test "x${HAVE_LIBTRE}" = "xno"; then
3562 echo "Use internal libtre : YES"
3563 else
3564 echo "Use internal libtre : NO"
3565 fi
3566 if test "x${HAVE_JANSSON}" = "xno"; then
3567 echo "Use internal libjansson : YES"
3568 else
3569 echo "Use internal libjansson : NO"
3570 fi
3571 check_substr "$COMPONENTS" "sqlite"
3572 if test $? = 0; then
3573 if test "x${HAVE_SQLITE}" = "xno"; then
3574 echo "Use internal sqlite : YES"
3575 else
3576 echo "Use internal sqlite : NO"
3577 fi
3578 fi
3579 if test "x${HAVE_ZLIB}" = "xno"; then
3580 echo "Use internal zlib : YES"
3581 else
3582 echo "Use internal zlib : NO"
3583 fi
3584 if test "x${FORCE_32BIT_BUILD}" = "xyes"; then
3585 echo "Force 32bit build : YES"
3586 else
3587 echo "Force 32bit build : NO"
3588 fi
3589
3590 echo "C compiler : ${CC}"
3591 echo "C++ compiler : ${CXX}"
3592 echo "C++ compiler info : ${COMPILER_VERSION}"
3593 echo "CPPFLAGS : ${CPPFLAGS}"
3594 echo "CXXFLAGS : ${CXXFLAGS}"
3595 echo "CFLAGS : ${CFLAGS}"
3596 echo "LDFLAGS : ${LDFLAGS}"
3597 echo "LIBS : ${LIBS}"
3598
3599 if test "x${MYSQL_CPPFLAGS}" != "x"; then
3600 echo "MySQL CPPFLAGS : ${MYSQL_CPPFLAGS}"
3601 fi
3602 if test "x${MYSQL_LDFLAGS}" != "x"; then
3603 echo "MySQL LDFLAGS : ${MYSQL_LDFLAGS}"
3604 fi
3605 if test "x${MYSQL_LIBS}" != "x"; then
3606 echo "MySQL LIBS : ${MYSQL_LIBS}"
3607 fi
3608
3609 if test "x${PGSQL_CPPFLAGS}" != "x"; then
3610 echo "PostgreSQL CPPFLAGS : ${PGSQL_CPPFLAGS}"
3611 fi
3612 if test "x${PGSQL_LDFLAGS}" != "x"; then
3613 echo "PostgreSQL LDFLAGS : ${PGSQL_LDFLAGS}"
3614 fi
3615 if test "x${PGSQL_LIBS}" != "x"; then
3616 echo "PostgreSQL LIBS : ${PGSQL_LIBS}"
3617 fi
3618
3619 if test "x${ORACLE_CPPFLAGS}" != "x"; then
3620 echo "Oracle CPPFLAGS : ${ORACLE_CPPFLAGS}"
3621 fi
3622 if test "x${ORACLE_LDFLAGS}" != "x"; then
3623 echo "Oracle LDFLAGS : ${ORACLE_LDFLAGS}"
3624 fi
3625 if test "x${ORACLE_LIBS}" != "x"; then
3626 echo "Oracle LIBS : ${ORACLE_LIBS}"
3627 fi
3628
3629 if test "x${ODBC_CPPFLAGS}" != "x"; then
3630 echo "ODBC CPPFLAGS : ${ODBC_CPPFLAGS}"
3631 fi
3632 if test "x${ODBC_LDFLAGS}" != "x"; then
3633 echo "ODBC LDFLAGS : ${ODBC_LDFLAGS}"
3634 fi
3635 if test "x${ODBC_LIBS}" != "x"; then
3636 echo "ODBC LIBS : ${ODBC_LIBS}"
3637 fi
3638
3639 if test "x${DB2_CPPFLAGS}" != "x"; then
3640 echo "DB2 CPPFLAGS : ${DB2_CPPFLAGS}"
3641 fi
3642 if test "x${DB2_LDFLAGS}" != "x"; then
3643 echo "DB2 LDFLAGS : ${DB2_LDFLAGS}"
3644 fi
3645 if test "x${DB2_LIBS}" != "x"; then
3646 echo "DB2 LIBS : ${DB2_LIBS}"
3647 fi
3648
3649 if test "x${INFORMIX_CPPFLAGS}" != "x"; then
3650 echo "Informix CPPFLAGS : ${INFORMIX_CPPFLAGS}"
3651 fi
3652 if test "x${INFORMIX_LDFLAGS}" != "x"; then
3653 echo "Informix LDFLAGS : ${INFORMIX_LDFLAGS}"
3654 fi
3655 if test "x${INFORMIX_LIBS}" != "x"; then
3656 echo "Informix LIBS : ${INFORMIX_LIBS}"
3657 fi
3658
3659 if test "x${TUXEDO_CPPFLAGS}" != "x"; then
3660 echo "Tuxedo CPPFLAGS : ${TUXEDO_CPPFLAGS}"
3661 fi
3662 if test "x${TUXEDO_LDFLAGS}" != "x"; then
3663 echo "Tuxedo LDFLAGS : ${TUXEDO_LDFLAGS}"
3664 fi
3665 if test "x${TUXEDO_LIBS}" != "x"; then
3666 echo "Tuxedo LIBS : ${TUXEDO_LIBS}"
3667 fi
3668
3669 if test "x${MONGODB_CPPFLAGS}" != "x"; then
3670 echo "MongoDB CPPFLAGS : ${MONGODB_CPPFLAGS}"
3671 fi
3672 if test "x${MONGODB_LDFLAGS}" != "x"; then
3673 echo "MongoDB LDFLAGS : ${MONGODB_LDFLAGS}"
3674 fi
3675
3676 if test "x${ZEROMQ_CPPFLAGS}" != "x"; then
3677 echo "ZeroMQ CPPFLAGS : ${ZEROMQ_CPPFLAGS}"
3678 fi
3679 if test "x${ZEROMQ_LDFLAGS}" != "x"; then
3680 echo "ZeroMQ LDFLAGS : ${ZEROMQ_LDFLAGS}"
3681 fi
3682
3683 if test "x${VMGR_CPPFLAGS}" != "x"; then
3684 echo "Vmgr CPPFLAGS : ${VMGR_CPPFLAGS}"
3685 fi
3686 if test "x${VMGR_LDFLAGS}" != "x"; then
3687 echo "Vmgr LDFLAGS : ${VMGR_LDFLAGS}"
3688 fi
3689 if test "x${VMGR_LIBS}" != "x"; then
3690 echo "Vmgr LIBS : ${VMGR_LIBS}"
3691 fi
3692
3693 FLAGS_CPP="src/tools/nxdevcfg/flags.cpp"
3694 echo "/* Automatically generated by configure */" > $FLAGS_CPP
3695 echo "#include <nms_common.h>" >> $FLAGS_CPP
3696 echo "const TCHAR *g_cppFlags = _T(\"${CPPFLAGS}\");" >> $FLAGS_CPP
3697 echo "const TCHAR *g_cFlags = _T(\"${CFLAGS}\");" >> $FLAGS_CPP
3698 echo "const TCHAR *g_cxxFlags = _T(\"${CXXFLAGS}\");" >> $FLAGS_CPP
3699 echo "const TCHAR *g_ldFlags = _T(\"${LDFLAGS}\");" >> $FLAGS_CPP
3700 echo "const TCHAR *g_libs = _T(\"${LIBS}\");" >> $FLAGS_CPP
3701 echo "const TCHAR *g_cc = _T(\"${CC}\");" >> $FLAGS_CPP
3702 echo "const TCHAR *g_cxx = _T(\"${CXX}\");" >> $FLAGS_CPP
3703 echo "const TCHAR *g_ld = _T(\"${LD}\");" >> $FLAGS_CPP
3704 echo "const TCHAR *g_perl = _T(\"${PERL}\");" >> $FLAGS_CPP
3705 echo "const TCHAR *g_serverLibs = _T(\"${SERVER_LIBS}\");" >> $FLAGS_CPP
3706 echo "const TCHAR *g_tuxedoCppFlags = _T(\"${TUXEDO_CPPFLAGS}\");" >> $FLAGS_CPP
3707 echo "const TCHAR *g_tuxedoLdFlags = _T(\"${TUXEDO_LDFLAGS}\");" >> $FLAGS_CPP
3708 echo "const TCHAR *g_tuxedoLibs = _T(\"${TUXEDO_LIBS}\");" >> $FLAGS_CPP