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