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