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