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