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