Default nxreporting.xml renamed to nxreporting.sample.xml
[public/netxms.git] / configure.ac
CommitLineData
8e76f8aa 1# $Id$
d16cf8a5 2#
ef0c727b
VK
3# NetXMS - Network Management System
4# Configure script
d16cf8a5
AK
5#
6
b0931498 7AC_INIT([NetXMS], [2.0-M1], [bugs@netxms.org])
ba1d810c 8AC_CONFIG_AUX_DIR(config)
8e7f84bf 9AC_CONFIG_HEADERS(config.h)
d16cf8a5 10AM_INIT_AUTOMAKE
09867021 11m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
d16cf8a5 12
aa24418a 13AC_CONFIG_MACRO_DIR([m4])
5387ff75 14
ef0c727b
VK
15#--------------------------------------------------------------------
16# Functions
17#--------------------------------------------------------------------
5387ff75 18
ef0c727b
VK
19check_substr()
20{
1010cff7 21 for w in $1; do
ef0c727b
VK
22 if test "x$w" = "x$2"; then
23 return 0;
24 fi
25 done
26 return 1
27}
16dff090 28
b535eed6
VK
29find_existing_dir()
30{
31 for d in "$@"; do
32 if test -d "$d"; then
33 __dir="$d"
34 return 0;
35 fi
36 done
37 return 1
38}
39
d3c8926d 40
ef0c727b
VK
41#--------------------------------------------------------------------
42# Initialize variables
43#--------------------------------------------------------------------
d3c8926d 44
ef0c727b 45PLATFORM=`uname -s`
c3900dbb 46CPUTYPE=`uname -p`
ef0c727b
VK
47COMPONENTS=""
48DISABLE_ICONV="no"
49DISABLE_ENCRYPTION="no"
4050bafb 50DISABLE_LMSENSORS="no"
f974a50a 51ENABLE_DEBUG="no"
25ae8377 52ENABLE_WERROR="no"
ef0c727b 53STATIC_BUILD="no"
c1165d33 54ALL_STATIC="no"
ef0c727b
VK
55DBDRIVER_SELECTED="no"
56USE_PTH="no"
57BUILD_SERVER="no"
58BUILD_AGENT="no"
59BUILD_CLIENT="no"
ef0c727b 60BUILD_STATIC_AGENT="no"
447350a9 61BUILD_SDK="no"
ef0c727b 62NEED_ZLIB="no"
f65df2b1 63MODULES="libnetxms tools install"
ef0c727b 64STATIC_SUBAGENT_LIST=""
c1165d33 65PROPOSED_STATIC_SUBAGENTS="default"
ef0c727b
VK
66SUBAGENT_DIRS=""
67SUBAGENT_LIBS=""
7c48e2aa 68SERVER_LIBS=""
ef0c727b 69SERVER_TOOLS=""
7dda4453 70SERVER_INCLUDE=""
31b0f68b 71SMSDRV_DIRS=""
6fad8870 72HDLINK_DIRS=""
52a2232c 73PDSDRV_DIRS=""
ef0c727b
VK
74TOP_LEVEL_MODULES=""
75CONTRIB_MODULES=""
c2612d83 76CLIENT_COMPONENTS=""
8b86c5dc 77BUILD_UNICODE="no"
467c489f 78FORCE_INTERNAL_EXPAT="no"
17b35ccc
VK
79USE_INTERNAL_LIBTRE="no"
80FORCE_INTERNAL_LIBTRE="no"
f5393033 81FORCE_INTERNAL_JANSSON="no"
1fd41bcd 82FORCE_INTERNAL_ZLIB="no"
cc297a70 83FORCE_32BIT_BUILD="no"
df9812a9 84FORCE_INTERNAL_GETOPT="no"
545bda2d
VK
85LDFLAGS_PREFIX=""
86LDFLAGS_SUFFIX=""
1ef5e57a
VK
87LTINIT_CC=""
88LTINIT_CXX=""
9113e749 89SQLFLAGS=""
a5a95ac8 90RUNTIME_PREFIX=""
6dde8627 91HPUX_HPPA="no"
058bf6fc 92XMPP_SUPPORT="yes"
2cfe4482 93LDAP_SUPPORT="yes"
65834be3 94DISABLE_READLINE="no"
d3c8926d 95
16dff090 96
fecf6a2b
VK
97#--------------------------------------------------------------------
98# Common compilation flags
99#--------------------------------------------------------------------
100
842c22f4 101CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DTRE_WCHAR=1"
fecf6a2b
VK
102
103
ef0c727b
VK
104#--------------------------------------------------------------------
105# Parse command line parameters
106#--------------------------------------------------------------------
7c9c94a7 107
a5a95ac8 108AC_ARG_WITH(runtime-prefix,
125543aa 109[AS_HELP_STRING(--with-runtime-prefix=prefix,installation prefix to be used at run time)],
a5a95ac8
VK
110[
111 RUNTIME_PREFIX="$withval"
112])
113
ef0c727b
VK
114AC_ARG_WITH(server,
115[AS_HELP_STRING(--with-server,build server)],
116[
8817f620 117 COMPONENTS="$COMPONENTS sqlite snmp server agent"
c5c0f362
VK
118])
119
120AC_ARG_WITH(snmp,
121[AS_HELP_STRING(--with-snmp,build SNMP library and tools)],
122[
123 COMPONENTS="$COMPONENTS snmp"
ef0c727b 124])
7c9c94a7 125
ef0c727b
VK
126AC_ARG_WITH(client,
127[AS_HELP_STRING(--with-client,build client library and tools)],
128[
129 COMPONENTS="$COMPONENTS client"
130])
d16cf8a5 131
a7a03ffd
VK
132AC_ARG_WITH(client-proxy,
133[AS_HELP_STRING(--with-client-proxy,build client proxy)],
134[
135 COMPONENTS="$COMPONENTS client-proxy"
136])
137
ef0c727b
VK
138AC_ARG_WITH(agent,
139[AS_HELP_STRING(--with-agent,build agent)],
140[
8817f620 141 COMPONENTS="$COMPONENTS sqlite agent"
ef0c727b 142])
d16cf8a5 143
ef0c727b
VK
144AC_ARG_WITH(static-agent,
145[AS_HELP_STRING(--with-static-agent,build statically linked agent)],
146[
8817f620 147 COMPONENTS="$COMPONENTS sqlite static-agent"
fb12fd54
VK
148 FORCE_INTERNAL_EXPAT="yes"
149 FORCE_INTERNAL_LIBTRE="yes"
150 FORCE_INTERNAL_JANSSON="yes"
151 FORCE_INTERNAL_ZLIB="yes"
ef0c727b 152])
d16cf8a5 153
ef0c727b
VK
154AC_ARG_WITH(ipso-agent,
155[AS_HELP_STRING(--with-ipso-agent,build statically linked IPSO agent)],
156[
971abf4f 157 COMPONENTS="$COMPONENTS ipso-agent"
ef0c727b 158])
521d90e7 159
7dda4453
VK
160AC_ARG_WITH(sdk,
161[AS_HELP_STRING(--with-sdk,build and install files necessary for extension development)],
162[
b550188f 163 COMPONENTS="$COMPONENTS sqlite sdk"
7dda4453
VK
164 TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES include"
165 SERVER_INCLUDE="include"
447350a9 166 BUILD_SDK="yes"
4671448c
VK
167])
168
169AC_ARG_WITH(static-sdk,
170[AS_HELP_STRING(--with-static-sdk,build and install files necessary for extension development (static libs only))],
171[
b550188f 172 COMPONENTS="$COMPONENTS sqlite sdk"
4671448c
VK
173 TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES include"
174 SERVER_INCLUDE="include"
175 BUILD_SDK="yes"
176 STATIC_BUILD="yes"
7dda4453
VK
177])
178
ef0c727b
VK
179AC_ARG_WITH(mdebug,
180[AS_HELP_STRING(--with-mdebug,use debug version of memory allocation functions)],
181[
182 CPPFLAGS="$CPPFLAGS -DNETXMS_MEMORY_DEBUG"
183])
d16cf8a5 184
b82ad936
AK
185AC_ARG_WITH(profiler,
186[AS_HELP_STRING(--with-profiler,link with libprofiler from gperftools)],
187[
188 LDFLAGS="$LDFLAGS -lprofiler"
189])
190
467c489f
VK
191AC_ARG_WITH(internal-libexpat,
192[AS_HELP_STRING(--with-internal-libexpat,force use of bundled libexpat)],
193[
194 FORCE_INTERNAL_EXPAT="yes"
195])
196
17b35ccc
VK
197AC_ARG_WITH(internal-libtre,
198[AS_HELP_STRING(--with-internal-libtre,force use of bundled libtre)],
199[
200 FORCE_INTERNAL_LIBTRE="yes"
201])
202
f5393033
VK
203AC_ARG_WITH(internal-libjansson,
204[AS_HELP_STRING(--with-internal-libjansson,force use of bundled libjansson)],
205[
206 FORCE_INTERNAL_JANSSON="yes"
207])
208
1fd41bcd
VK
209AC_ARG_WITH(internal-zlib,
210[AS_HELP_STRING(--with-internal-zlib,force use of bundled zlib)],
211[
212 FORCE_INTERNAL_ZLIB="yes"
213])
214
df9812a9
VK
215AC_ARG_WITH(internal-getopt,
216[AS_HELP_STRING(--with-internal-getopt,force use of bundled getopt)],
217[
218 FORCE_INTERNAL_GETOPT="yes"
219])
220
c1165d33
VK
221AC_ARG_WITH(all-static,
222[AS_HELP_STRING(--with-all-static,use -all-static flag for linking executables)],
223[
224 ALL_STATIC="yes"
225])
226
227AC_ARG_WITH(static-subagents,
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"
e47404b3 478 SMSDRV_DIRS="kannel 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"
d6a7a843 485 CLIENT_COMPONENTS="nxalarm nxevent nxpush nxsms"
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
12313882
VK
502#--------------------------------------------------------------------
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
ef0c727b
VK
513#--------------------------------------------------------------------
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
ef0c727b
VK
789#--------------------------------------------------------------------
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
0322eed7
VK
1305#--------------------------------------------------------------------
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
ef0c727b
VK
1329#--------------------------------------------------------------------
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"
e47404b3 1471 SMSDRV_DIRS="$SMSDRV_DIRS kannel 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 ])
b00236dd 1490 AC_CHECK_LIB(ldap, ldap_control_create, [
1491 AC_DEFINE(HAVE_LDAP_CONTROL_CREATE, 1, Define to 1 if you have ldap_control_create function)
1492 ])
1493 AC_CHECK_LIB(ldap, ldap_parse_page_control, [
1494 AC_DEFINE(HAVE_LDAP_PARSE_PAGE_CONTROL, 1, Define to 1 if you have ldap_parse_page_control function)
1495 ])
1496 AC_CHECK_LIB(ldap, ldap_create_page_control, [
1497 AC_DEFINE(HAVE_LDAP_CREATE_PAGE_CONTROL, 1, Define to 1 if you have ldap_create_page_control function)
1498 ])
d9177dd1 1499 fi
2cfe4482 1500 LDAP_SUPPORT="$HAVE_LDAP"
d9177dd1 1501fi
1502
ef0c727b
VK
1503#--------------------------------------------------------------------
1504# Checks for data types
1505#--------------------------------------------------------------------
1506
d16cf8a5
AK
1507AC_CHECK_SIZEOF(short)
1508AC_CHECK_SIZEOF(int)
1509AC_CHECK_SIZEOF(long)
1510AC_CHECK_SIZEOF(long long)
1511
1512AC_TYPE_PID_T
d16cf8a5
AK
1513AC_TYPE_SIZE_T
1514AC_STRUCT_TIMEZONE
1515
3071f10a 1516AC_CHECK_TYPES([long long, unsigned long long, int64_t, uint64_t, u_int64_t, uuid_t])
51128b42 1517AC_CHECK_TYPES([mode_t, off_t, socklen_t],,,[
4c779d83
VK
1518#if HAVE_SYS_TYPES_H
1519#include <sys/types.h>
1520#endif
1521#if HAVE_SYS_SOCKET_H
1522#include <sys/socket.h>
1523#endif
1524])
e0293f7f
VK
1525AC_CHECK_TYPES([struct stat64],,,[
1526#if HAVE_SYS_STAT_H
1527#include <sys/stat.h>
1528#endif
1529])
521d90e7 1530
e25cadc9 1531
ef0c727b
VK
1532#--------------------------------------------------------------------
1533# Checks for functions
1534#--------------------------------------------------------------------
d16cf8a5
AK
1535
1536AC_FUNC_ERROR_AT_LINE
d16cf8a5 1537AC_FUNC_MEMCMP
d16cf8a5
AK
1538AC_FUNC_SELECT_ARGTYPES
1539AC_FUNC_STRFTIME
1540AC_FUNC_STRTOD
1541AC_FUNC_VPRINTF
1542
80ce37ac 1543AC_CHECK_FUNCS([gettimeofday memmove memset bcopy strchr strcspn strdup strerror])
c1099678 1544AC_CHECK_FUNCS([strrchr strlwr strtol strtoul strtoll strtoull setlocale])
467e30e1 1545AC_CHECK_FUNCS([if_nametoindex daemon mmap strerror_r scandir uname poll])
c601fc15 1546AC_CHECK_FUNCS([usleep nanosleep gmtime_r localtime_r stat64 fstat64 lstat64])
17cfa4f1 1547AC_CHECK_FUNCS([fopen64 strptime timegm gethostbyname2_r])
aa24418a
VK
1548
1549AC_CHECK_DECLS([nanosleep])
be6467e9 1550
b0823d06
VK
1551# Check if strerror_r is POSIX-compliant
1552if test "$ac_cv_func_strerror_r" = "yes"; then
1553 AC_MSG_CHECKING(if strerror_r is POSIX compliant)
1554 AC_LANG_PUSH([C++])
1555 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7f9423af
VK
1556#if HAVE_STRING_H
1557#include <string.h>
1558#endif
1559#if HAVE_ERRNO_H
1560#include <errno.h>
1561#endif
b0823d06 1562 ]],[[
7f9423af
VK
1563 int e;
1564 char buffer[256];
1565 e = strerror_r(1, buffer, 256);
1566 return e;
b0823d06
VK
1567 ]])
1568 ],[
1569 AC_MSG_RESULT(yes)
1570 AC_DEFINE(HAVE_POSIX_STRERROR_R,1,Define to 1 if strerror_r function is POSIX compliant)
1571 ],[
1572 AC_MSG_RESULT(no)
1573 AC_DEFINE(HAVE_POSIX_STRERROR_R,0,Define to 1 if strerror_r function is POSIX compliant)
1574 ])
1575 AC_LANG_POP([C++])
1576fi
1577
be6467e9
VK
1578# Check if struct tm has tm_gmtoff member
1579AC_MSG_CHECKING(for struct tm.tm_gmtoff)
1580AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1581#if HAVE_TIME_H
1582#include <time.h>
1583#endif
1584#if HAVE_SYS_TIME_H
1585#include <sys/time.h>
1586#endif
1587]],[[
be6467e9
VK
1588 struct tm t;
1589 return t.tm_gmtoff;
be6467e9
VK
1590]])
1591],[
1592AC_MSG_RESULT(yes)
1593AC_DEFINE(HAVE_TM_GMTOFF,1,Define to 1 if struct tm has tm_gmtoff member)
1594],[
1595AC_MSG_RESULT(no)
1596])
d16cf8a5 1597
f91feddc 1598AC_CHECK_FUNCS([sysctlbyname sysctlnametomib])
70fed300
AK
1599AC_CHECK_FUNCS([tcgetattr tcsetattr cfsetospeed cfsetispeed])
1600
058bf6fc 1601# sockets/resolver
d00ad4c6
VK
1602if test "$BUILD_SERVER-$XMPP_SUPPORT" = "yes-yes"; then
1603 AC_CHECK_HEADERS([arpa/nameser_compat.h])
1604 AC_CHECK_FUNC(res_query, , [AC_CHECK_LIB(resolv, res_query, [], [AC_CHECK_LIB(resolv, __res_query)])])
1605fi
d16cf8a5
AK
1606AC_CHECK_FUNC(connect, , [AC_CHECK_LIB(socket, connect)])
1607AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(resolv, gethostbyname)])
1608AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)])
1609
1610if test "x$ac_cv_lib_nsl_gethostbyname" != "xyes" && test "x$ac_cv_func_gethostbyname" != "xyes" ; then
1611 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(socket, gethostbyname)])
1612fi
1613
1614if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname" ; then
1615 AC_MSG_CHECKING([if we can include libnsl + libsocket])
1616 LIBS="-lnsl -lsocket $LIBS"
1617 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void) gethostbyname]])],[my_ac_link_result=yes],[my_ac_link_result=no ])
1618 if test "$my_ac_link_result" = "no" ; then
1619 AC_MSG_RESULT([failure])
1620 AC_MSG_ERROR([unable to use gethostbyname()])
1621 else
1622 AC_MSG_RESULT([success])
1623 fi
1624fi
1625
c6491611
VK
1626# asprintf, scprintf, etc.
1627AC_CHECK_FUNCS([asprintf aswprintf vasprintf vaswprintf])
1628AC_CHECK_FUNCS([scprintf scwprintf vscprintf vscwprintf])
1629
1630AC_MSG_CHECKING(whether snprintf returns required buffer size)
1631AC_RUN_IFELSE(
1632 [AC_LANG_PROGRAM([
1633#include <stdio.h>
1634#include <string.h>
1635 ], [
1636 return !(snprintf(NULL, 0, "test: %d", 1000) >= 10);
1637 ])
1638 ],
1639 [ AC_MSG_RESULT(yes)
1640 AC_DEFINE(SNPRINTF_RETURNS_REQUIRED_SIZE, 1, Define to 1 if snprintf returns required buffer size in case of truncation)
1641 ],
1642 [ AC_MSG_RESULT(no) ],
1643 [ AC_MSG_RESULT(no) ]
1644)
1645
1646
dff54fed 1647
ef0c727b
VK
1648#--------------------------------------------------------------------
1649# Checks for macros and definitions
1650#--------------------------------------------------------------------
dff54fed 1651
ef0c727b
VK
1652AC_CHECK_DECLS([__bswap_32, __bswap_64, htonll, ntohll],,,[
1653#ifdef HAVE_SYS_TYPES_H
99e50bb7 1654#include <sys/types.h>
ef0c727b
VK
1655#endif
1656#if HAVE_BYTESWAP_H
1657#include <byteswap.h>
1658#endif
1659#if HAVE_NETINET_IN_H
1660#include <netinet/in.h>
1661#endif
1662#if HAVE_NET_NH_H
1663#include <net/nh.h>
1664#endif
1665])
aa24418a
VK
1666AC_CHECK_DECLS([RTLD_NOW, RTLD_GLOBAL],,,[
1667#ifdef HAVE_UNISTD_H
1668#include <unistd.h>
1669#endif
1670#ifdef HAVE_DLFCN_H
1671#include <dlfcn.h>
1672#endif
1673])
ce7565e7
VK
1674AC_CHECK_DECLS([va_copy, __va_copy],,,[
1675#ifdef HAVE_UNISTD_H
1676#include <unistd.h>
1677#endif
1678#ifdef HAVE_STDARG_H
1679#include <stdarg.h>
1680#endif
1681#ifdef HAVE_STDLIB_H
1682#include <stdlib.h>
1683#endif
1684])
dff54fed 1685
dff54fed 1686
df9812a9
VK
1687#--------------------------------------------------------------------
1688# getopt
1689#--------------------------------------------------------------------
1690
1691if test "x$FORCE_INTERNAL_GETOPT" = "xyes"; then
1692 AC_DEFINE([USE_BUNDLED_GETOPT], [1], [Define to 1 if bundled getopt must be used])
1693else
1694 AC_CHECK_HEADERS([getopt.h])
1695 AC_CHECK_LIB(gnugetopt, getopt_long)
1696 AC_CHECK_DECLS([getopt_long],,,[
1697#if HAVE_GETOPT_H
1698#include <getopt.h>
1699#endif
1700 ])
1701fi
1702
1703
671651a1
VK
1704#--------------------------------------------------------------------
1705# Linux specific checks
1706#--------------------------------------------------------------------
1707
1708if test "x$PLATFORM" = "xLinux"; then
1709 AC_CHECK_HEADERS([sys/reboot.h],,,[[ ]])
1710 AC_CHECK_DECLS([reboot, RB_AUTOBOOT, RB_POWER_OFF, RB_HALT_SYSTEM],,,[
1711#if HAVE_SYS_REBOOT_H
1712#include <sys/reboot.h>
1713#endif
1714 ])
1715 AC_CHECK_FUNCS([reboot],,,[
1716#if HAVE_SYS_REBOOT_H
1717#include <sys/reboot.h>
1718#endif
1719 ])
1720fi
1721
1722
ef0c727b
VK
1723#--------------------------------------------------------------------
1724# AIX specific checks
1725#--------------------------------------------------------------------
d16cf8a5 1726
ef0c727b
VK
1727if test "x$PLATFORM" = "xAIX"; then
1728 AC_CHECK_HEADERS([procinfo.h],,,[[ ]])
efdaffe4 1729 AC_CHECK_DECLS([getkerninfo, getprocs, getprocs64, __sync_add_and_fetch, __sync_sub_and_fetch],,,[
df9812a9
VK
1730#if HAVE_PROCINFO_H
1731#include <procinfo.h>
1732#endif
1733 ])
ef0c727b
VK
1734 AC_CHECK_FUNCS([getprocs64],,,[
1735#if HAVE_PROCINFO_H
1736#include <procinfo.h>
6cd41ceb 1737#endif
ef0c727b 1738 ])
7e56bf2e
VK
1739fi
1740
cd4c8ca3 1741
f47bd4ca
VK
1742#--------------------------------------------------------------------
1743# Solaris specific checks
1744#--------------------------------------------------------------------
1745
1746if test "x$PLATFORM" = "xSunOS"; then
1747 AC_CHECK_FUNCS([atomic_inc_32_nv atomic_dec_32_nv],,,[
1748#include <sys/atomic.h>
1749 ])
1750fi
1751
1752
ba8db57b
VK
1753#--------------------------------------------------------------------
1754# HP-UX specific checks
1755#--------------------------------------------------------------------
1756
1757if test "x$PLATFORM" = "xHP-UX"; then
3268bb77 1758 AC_CHECK_HEADERS([atomic.h sys/mib.h],,,[[ ]])
f09c2d05
VK
1759 AC_CHECK_DECLS([SIOCGIFNAME, SIOCGIFINDEX],,,[
1760#if HAVE_NET_IF_H
1761#include <net/if.h>
1762#endif
1763 ])
1764 AC_CHECK_DECLS([ID_ifXEntry, open_mib_64],,,[
1765#if HAVE_SYS_MIB_H
1766#include <sys/mib.h>
1767#endif
1768 ])
cfd95c74
VK
1769
1770 AC_MSG_CHECKING(if pst_diskinfo has read/write stats fields)
1771 AC_LANG_PUSH([C++])
1772 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1773#include <sys/pstat.h>
1774 ]], [[
1775pst_diskinfo d;
1776int x;
1777x = (int)d.psd_dkread;
1778x = (int)d.psd_dkwrite;
1779 ]])],
1780 [
1781 AC_DEFINE([HAVE_DISKINFO_RWSTATS],[1],[Define to 1 if pst_diskinfo has read/write stats fields])
1782 AC_MSG_RESULT(yes)
1783 ],
1784 [
1785 AC_MSG_RESULT(no)
1786 ])
1787 AC_LANG_POP([C++])
ba8db57b
VK
1788fi
1789
1790
aa24418a
VK
1791#--------------------------------------------------------------------
1792# *BSD specific checks
1793#--------------------------------------------------------------------
1794
1795AC_CHECK_LIB(kvm, kvm_open)
1796AC_CHECK_FUNCS([kvm_getswapinfo])
1797AC_CHECK_TYPES([struct kinfo_proc2],,,[
1798#if HAVE_SYS_SYSCTL_H
1799#include <sys/sysctl.h>
1800#endif
1801])
1802
1803
28ba6824
VK
1804#--------------------------------------------------------------------
1805# FreeBSD specific checks
1806#--------------------------------------------------------------------
1807
1808if test "x$PLATFORM" = "xFreeBSD"; then
61f58c11
VK
1809 AC_CHECK_DECLS([RTF_WASCLONED],[],[],[
1810#if HAVE_SYS_TYPES_H
1811#include <sys/types.h>
1812#endif
1813#if HAVE_SYS_SOCKET_H
1814#include <sys/socket.h>
1815#endif
1816#include <net/route.h>
1817 ])
28ba6824
VK
1818fi
1819
1820
ea6615cf
VK
1821#--------------------------------------------------------------------
1822# OpenBSD specific checks
1823#--------------------------------------------------------------------
1824
1825if test "x$PLATFORM" = "xOpenBSD"; then
1826 AC_MSG_CHECKING(if kvm_getprocs requires sizeof kinfo_proc argument)
1827 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1828#include <sys/param.h>
1829#include <sys/proc.h>
1830#include <kvm.h>
1831#include <sys/user.h>
1832 ]],[[
1833 int count;
1834 kvm_getprocs(NULL, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc), &count);
1835 return 0;
1836 ]])
1837 ],[
1838 AC_MSG_RESULT(yes)
1839 AC_DEFINE(KVM_GETPROCS_REQUIRES_SIZEOF,1,Define to 1 if kvm_getprocs requires sizeof kinfo_proc)
1840 ],[
1841 AC_MSG_RESULT(no)
1842 AC_DEFINE(KVM_GETPROCS_REQUIRES_SIZEOF,0,Define to 1 if kvm_getprocs requires sizeof kinfo_proc)
1843 ])
1844
1845 AC_MSG_CHECKING(if struct kinfo_proc has member kp_proc)
1846 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1847#include <sys/param.h>
1848#include <sys/proc.h>
1849#include <kvm.h>
1850#include <sys/user.h>
1851 ]],[[
1852 struct kinfo_proc p;
1853 return p.kp_proc.p_pid;
1854 ]])
1855 ],[
1856 AC_MSG_RESULT(yes)
1857 AC_DEFINE(KINFO_PROC_HAS_KP_PROC,1,Define to 1 if struct kinfo_proc has member kp_proc)
1858 ],[
1859 AC_MSG_RESULT(no)
1860 AC_DEFINE(KINFO_PROC_HAS_KP_PROC,0,Define to 1 if struct kinfo_proc has member kp_proc)
1861 ])
1862fi
1863
1864
ef0c727b
VK
1865#--------------------------------------------------------------------
1866# Check for UNICODE stuff
1867#--------------------------------------------------------------------
3e39fcde 1868
8b86c5dc 1869AC_CHECK_HEADERS([wchar.h wctype.h iconv.h])
aa24418a 1870AC_CHECK_TYPES([wchar_t, wint_t],,,[
6b93c954
VK
1871#if HAVE_WCHAR_H
1872#include <wchar.h>
1873#endif
1874])
f172d7b7
VK
1875AC_CHECK_SIZEOF(wchar_t,,[
1876#if HAVE_WCHAR_H
1877#include <wchar.h>
1878#endif
1879])
fdf1ed50
VK
1880AC_CHECK_FUNCS([wcslen wcsdup wcsncpy wcstoll wcstoull towupper towlower])
1881AC_CHECK_FUNCS([wcslwr wcserror wcserror_r wfopen wfopen64 fputws putws])
1882AC_CHECK_FUNCS([wopen wstat waccess wgetenv wrename wunlink wremove wchdir])
1883AC_CHECK_FUNCS([wmkdir wrmdir wsystem wmkstemp wpopen wctime wchmod vwscanf])
1884AC_CHECK_FUNCS([vswscanf vfwscanf wcscasecmp wcsncasecmp wcstombs wcsrtombs])
dff54fed 1885
3265ba38 1886if test "x$DISABLE_ICONV" != "xyes"; then
75c30ed4 1887 AC_CHECK_LIB(iconv, libiconv_open,
dff54fed 1888 [ ac_found_iconv=yes
8d131dda 1889 LIBS="$LIBS -liconv"
75c30ed4
VK
1890 AC_CHECK_FUNCS(libiconv, ac_found_iconv=yes, ac_found_iconv=no)
1891 ],
1892 [
1893 AC_CHECK_LIB(iconv, iconv,
1894 [ ac_found_iconv=yes
8d131dda 1895 LIBS="$LIBS -liconv"
75c30ed4
VK
1896 ])
1897 AC_CHECK_FUNCS(iconv, ac_found_iconv=yes, ac_found_iconv=no)
1898 ])
dff54fed
VK
1899else
1900 ac_found_iconv=no
ef0c727b 1901 CPPFLAGS="$CPPFLAGS -D__DISABLE_ICONV"
dff54fed 1902fi
93571e7f 1903
3bf0df9f
VK
1904AC_MSG_CHECKING(whether fgetws can be used with popen)
1905AC_RUN_IFELSE(
1906 [AC_LANG_PROGRAM([
1907#include <stdio.h>
1908#ifdef HAVE_UNISTD_H
1909#include <unistd.h>
1910#endif
1911#if HAVE_WCHAR_H
1912#include <wchar.h>
1913#endif
1914 ], [[
1915 int rc = 1;
1916 wchar_t line[4096];
1917 FILE *f = popen("echo test", "r");
1918 if(f!=NULL)
1919 {
1920 fgetws(line, 4096, f);
1921 pclose(f);
1922 rc = 0;
1923 }
1924 return rc;
1925 ]])
1926 ],
1927 [ AC_MSG_RESULT(yes)
1928 AC_DEFINE(SAFE_FGETWS_WITH_POPEN, 1, Define to 1 if fgetws can be used with popen)
1929 ],
1930 [ AC_MSG_RESULT(no) ],
1931 [ AC_MSG_RESULT(no) ]
1932)
1933
93571e7f
VK
1934AC_MSG_CHECKING(whether iconv supports UCS-2-INTERNAL)
1935AC_RUN_IFELSE(
1936 [AC_LANG_PROGRAM([
1937#if HAVE_ICONV_H
1938#include <iconv.h>
1939#endif
1940 ], [
1941 return iconv_open("UTF-8","UCS-2-INTERNAL")==(iconv_t)(-1);
1942 ])
1943 ],
1944 [ AC_MSG_RESULT(yes)
1945 AC_DEFINE(HAVE_ICONV_UCS_2_INTERNAL, 1, Define to 1 if iconv supports UCS-2-INTERNAL)
1946 valid_ucs2_code="UCS-2-INTERNAL"
1947 ],
1948 [ AC_MSG_RESULT(no) ],
1949 [ AC_MSG_RESULT(no) ]
1950)
1951
1952AC_MSG_CHECKING(whether iconv supports UCS-2)
1953AC_RUN_IFELSE(
1954 [AC_LANG_PROGRAM([
1955#if HAVE_ICONV_H
1956#include <iconv.h>
1957#endif
1958 ], [
1959 return iconv_open("UTF-8","UCS-2")==(iconv_t)(-1);
1960 ])
1961 ],
1962 [ AC_MSG_RESULT(yes)
1963 AC_DEFINE(HAVE_ICONV_UCS_2, 1, Define to 1 if iconv supports UCS-2)
1964 valid_ucs2_code="UCS-2"
1965 ],
1966 [ AC_MSG_RESULT(no) ],
8b86c5dc 1967 [ AC_MSG_RESULT(no) ]
93571e7f
VK
1968)
1969
1970AC_MSG_CHECKING(whether iconv supports UCS2)
1971AC_RUN_IFELSE(
1972 [AC_LANG_PROGRAM([
1973#if HAVE_ICONV_H
1974#include <iconv.h>
1975#endif
1976 ], [
1977 return iconv_open("UTF-8","UCS2")==(iconv_t)(-1);
1978 ])
1979 ],
1980 [ AC_MSG_RESULT(yes)
1981 AC_DEFINE(HAVE_ICONV_UCS2, 1, Define to 1 if iconv supports UCS2)
1982 valid_ucs2_code="UCS2"
1983 ],
1984 [ AC_MSG_RESULT(no) ],
1985 [ AC_MSG_RESULT(no) ]
1986)
1987
44bccbbc
VK
1988AC_MSG_CHECKING(whether iconv supports UCS-2BE)
1989AC_RUN_IFELSE(
1990 [AC_LANG_PROGRAM([
1991#if HAVE_ICONV_H
1992#include <iconv.h>
1993#endif
1994 ], [
1995 return iconv_open("UTF-8","UCS-2BE")==(iconv_t)(-1);
1996 ])
1997 ],
1998 [ AC_MSG_RESULT(yes)
1999 AC_DEFINE(HAVE_ICONV_UCS_2BE, 1, Define to 1 if iconv supports UCS-2BE)
2000 valid_ucs2_code="UCS-2BE"
2001 ],
2002 [ AC_MSG_RESULT(no) ],
2003 [ AC_MSG_RESULT(no) ]
2004)
2005
6e17f325
VK
2006AC_MSG_CHECKING(whether iconv supports UCS-2LE)
2007AC_RUN_IFELSE(
2008 [AC_LANG_PROGRAM([
2009#if HAVE_ICONV_H
2010#include <iconv.h>
2011#endif
2012 ], [
2013 return iconv_open("UTF-8","UCS-2LE")==(iconv_t)(-1);
2014 ])
2015 ],
2016 [ AC_MSG_RESULT(yes)
2017 AC_DEFINE(HAVE_ICONV_UCS_2LE, 1, Define to 1 if iconv supports UCS-2LE)
2018 valid_ucs2_code="UCS-2LE"
2019 ],
2020 [ AC_MSG_RESULT(no) ],
2021 [ AC_MSG_RESULT(no) ]
2022)
2023
4a4e1feb
VK
2024AC_MSG_CHECKING(whether iconv supports UTF-16)
2025AC_RUN_IFELSE(
2026 [AC_LANG_PROGRAM([
2027#if HAVE_ICONV_H
2028#include <iconv.h>
2029#endif
2030 ], [
2031 return iconv_open("UTF-8","UTF-16")==(iconv_t)(-1);
2032 ])
2033 ],
2034 [ AC_MSG_RESULT(yes)
2035 AC_DEFINE(HAVE_ICONV_UTF_16, 1, Define to 1 if iconv supports UTF-16)
2036 valid_ucs2_code="UTF-16"
2037 ],
2038 [ AC_MSG_RESULT(no) ],
2039 [ AC_MSG_RESULT(no) ]
2040)
2041
8b86c5dc
VK
2042AC_MSG_CHECKING(whether iconv supports UCS-4-INTERNAL)
2043AC_RUN_IFELSE(
2044 [AC_LANG_PROGRAM([
2045#if HAVE_ICONV_H
2046#include <iconv.h>
2047#endif
2048 ], [
2049 return iconv_open("UTF-8","UCS-4-INTERNAL")==(iconv_t)(-1);
2050 ])
2051 ],
2052 [ AC_MSG_RESULT(yes)
2053 AC_DEFINE(HAVE_ICONV_UCS_4_INTERNAL, 1, Define to 1 if iconv supports UCS-4-INTERNAL)
2054 valid_ucs4_code="UCS-4-INTERNAL"
2055 ],
2056 [ AC_MSG_RESULT(no) ],
2057 [ AC_MSG_RESULT(no) ]
2058)
2059
2060AC_MSG_CHECKING(whether iconv supports UCS-4)
2061AC_RUN_IFELSE(
2062 [AC_LANG_PROGRAM([
2063#if HAVE_ICONV_H
2064#include <iconv.h>
2065#endif
2066 ], [
2067 return iconv_open("UTF-8","UCS-4")==(iconv_t)(-1);
2068 ])
2069 ],
2070 [ AC_MSG_RESULT(yes)
2071 AC_DEFINE(HAVE_ICONV_UCS_4, 1, Define to 1 if iconv supports UCS-4)
2072 valid_ucs4_code="UCS-4"
2073 ],
2074 [ AC_MSG_RESULT(no) ],
2075 [ AC_MSG_RESULT(no) ]
2076)
2077
2078AC_MSG_CHECKING(whether iconv supports UCS4)
2079AC_RUN_IFELSE(
2080 [AC_LANG_PROGRAM([
2081#if HAVE_ICONV_H
2082#include <iconv.h>
2083#endif
2084 ], [
2085 return iconv_open("UTF-8","UCS4")==(iconv_t)(-1);
2086 ])
2087 ],
2088 [ AC_MSG_RESULT(yes)
2089 AC_DEFINE(HAVE_ICONV_UCS4, 1, Define to 1 if iconv supports UCS4)
2090 valid_ucs4_code="UCS4"
2091 ],
2092 [ AC_MSG_RESULT(no) ],
2093 [ AC_MSG_RESULT(no) ]
2094)
2095
2096AC_MSG_CHECKING(whether iconv supports UCS-4BE)
2097AC_RUN_IFELSE(
2098 [AC_LANG_PROGRAM([
2099#if HAVE_ICONV_H
2100#include <iconv.h>
2101#endif
2102 ], [
2103 return iconv_open("UTF-8","UCS-4BE")==(iconv_t)(-1);
2104 ])
2105 ],
2106 [ AC_MSG_RESULT(yes)
2107 AC_DEFINE(HAVE_ICONV_UCS_4BE, 1, Define to 1 if iconv supports UCS-4BE)
2108 valid_ucs4_code="UCS-4BE"
2109 ],
2110 [ AC_MSG_RESULT(no) ],
2111 [ AC_MSG_RESULT(no) ]
2112)
2113
6e17f325
VK
2114AC_MSG_CHECKING(whether iconv supports UCS-4LE)
2115AC_RUN_IFELSE(
2116 [AC_LANG_PROGRAM([
2117#if HAVE_ICONV_H
2118#include <iconv.h>
2119#endif
2120 ], [
2121 return iconv_open("UTF-8","UCS-4LE")==(iconv_t)(-1);
2122 ])
2123 ],
2124 [ AC_MSG_RESULT(yes)
2125 AC_DEFINE(HAVE_ICONV_UCS_4LE, 1, Define to 1 if iconv supports UCS-4LE)
2126 valid_ucs4_code="UCS-4LE"
2127 ],
2128 [ AC_MSG_RESULT(no) ],
2129 [ AC_MSG_RESULT(no) ]
2130)
2131
4a4e1feb
VK
2132AC_MSG_CHECKING(whether iconv supports UTF-32)
2133AC_RUN_IFELSE(
2134 [AC_LANG_PROGRAM([
2135#if HAVE_ICONV_H
2136#include <iconv.h>
2137#endif
2138 ], [
2139 return iconv_open("UTF-8","UTF-32")==(iconv_t)(-1);
2140 ])
2141 ],
2142 [ AC_MSG_RESULT(yes)
2143 AC_DEFINE(HAVE_ICONV_UTF_32, 1, Define to 1 if iconv supports UTF-32)
2144 valid_ucs4_code="UTF-32"
2145 ],
2146 [ AC_MSG_RESULT(no) ],
2147 [ AC_MSG_RESULT(no) ]
2148)
2149
93571e7f
VK
2150AC_MSG_CHECKING(whether iconv supports //IGNORE)
2151AC_RUN_IFELSE(
2152 [AC_LANG_PROGRAM([
2153#if HAVE_ICONV_H
2154#include <iconv.h>
2155#endif
2156 ], [
2157 return iconv_open("UTF-8//IGNORE","$valid_ucs2_code")==(iconv_t)(-1);
2158 ])
2159 ],
2160 [ AC_MSG_RESULT(yes)
2161 AC_DEFINE(HAVE_ICONV_IGNORE, 1, Define to 1 if iconv supports //IGNORE option)
2162 ],
2163 [ AC_MSG_RESULT(no) ],
2164 [ AC_MSG_RESULT(no) ]
2165)
3e39fcde 2166
bd96aa53
VK
2167AC_MSG_CHECKING(whether iconv supports state reset)
2168AC_RUN_IFELSE(
2169 [AC_LANG_PROGRAM([
2170#include <stdio.h>
2171#if HAVE_ICONV_H
2172#include <iconv.h>
2173#endif
2174 ], [
2175 iconv_t cd = iconv_open("UTF-8","$valid_ucs2_code");
2176 if (cd == (iconv_t)(-1)) return 1;
2177 return iconv(cd, NULL, NULL, NULL, NULL) != 0;
2178 ])
2179 ],
2180 [ AC_MSG_RESULT(yes)
2181 AC_DEFINE(HAVE_ICONV_STATE_RESET, 1, Define to 1 if iconv supports state reset)
2182 ],
2183 [ AC_MSG_RESULT(no) ],
2184 [ AC_MSG_RESULT(no) ]
2185)
2186
2187AC_MSG_CHECKING(whether iconv descriptor cache is needed)
2188case $enable_iconv_cache in
2189 auto)
2190 case $PLATFORM in
2191 SunOS|HP-UX|AIX)
2192 enable_iconv_cache=yes
2193 ;;
2194 *)
2195 enable_iconv_cache=no
2196 ;;
2197 esac
2198 ;;
2199 yes|no)
2200 ;;
2201 *)
2202 AC_MSG_ERROR([Value given to --enable-iconv-cache must be one of yes, no or auto])
2203 ;;
2204esac
2205if test "x$enable_iconv_cache" = "xyes"; then
2206 AC_DEFINE(WITH_ICONV_CACHE, 1, Define to 1 to enable iconv descriptor cache)
2207fi
2208AC_MSG_RESULT($enable_iconv_cache)
2209
19619a35
AK
2210# taken from ZSH's configure
2211# Check if iconv uses const in prototype declaration
24b1570c 2212if test "x$ac_found_iconv" = "xyes"; then
53c96e2d 2213 AC_LANG_PUSH([C++])
19619a35 2214 AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
7f9423af
VK
2215 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2216#include <stdlib.h>
f6a2136d 2217#if HAVE_ICONV_H
7f9423af 2218#include <iconv.h>
7f9423af 2219#endif
f6a2136d
VK
2220 ]],
2221 [[
3e51d371
VK
2222 char **p = NULL;
2223 iconv(0, (const char **)p, 0, 0, 0);
7f9423af 2224 ]])],
3e51d371
VK
2225 [ac_cv_iconv_const=const],
2226 [ac_cv_iconv_const=])])
53c96e2d 2227 AC_LANG_POP([C++])
19619a35
AK
2228 AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
2229 [Define as const if the declaration of iconv() needs const.])
2230fi
2231
bd96aa53
VK
2232AC_MSG_CHECKING(if iconv descriptor cache is needed)
2233
2234
a67fa146
VK
2235if test "x$ac_cv_type_wchar_t" = "xyes"; then
2236 if test $ac_cv_sizeof_wchar_t -eq 2; then
2237 AC_DEFINE(UNICODE_UCS2, 1, Define to 1 if you have 2-byte wchar_t)
2238 fi
8b86c5dc 2239
a67fa146
VK
2240 if test $ac_cv_sizeof_wchar_t -eq 4; then
2241 AC_DEFINE(UNICODE_UCS4, 1, Define to 1 if you have 4-byte wchar_t)
2242 fi
2243
2244 if test "x$USE_INTERNAL_LIBTRE" = "xyes"; then
2245 AC_DEFINE(TRE_WCHAR, 1, [ Define to enable wide character support in libtre.])
2246 fi
2247else
2248 if test "x$BUILD_UNICODE" = "xyes"; then
2249 AC_MSG_ERROR(wchar_t is required for UNICODE build)
2250 fi
8b86c5dc
VK
2251fi
2252
c29360a9 2253
ca0f4ea3
VK
2254#--------------------------------------------------------------------
2255# MySQL
2256#--------------------------------------------------------------------
2257
2258check_substr "$COMPONENTS" "mysql"
2259if test $? = 0; then
9f1ea006
VK
2260 OLD_CPPFLAGS="$CPPFLAGS"
2261 OLD_LDFLAGS="$LDFLAGS"
2262 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2263
2264 CPPFLAGS="$CPPFLAGS $MYSQL_CPPFLAGS"
2265 LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
2266 if test "x$MYSQL_LD_RUN_PATH" != "x"; then
2267 LD_RUN_PATH="${MYSQL_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2268 fi
2269
2270 AC_CHECK_HEADER(mysql.h,,AC_MSG_ERROR([Cannot find mysql.h - check your PostgreSQL client installation]))
2271
6fce76d8 2272 AC_CHECK_LIB(mysqlclient, mysql_init, [MYSQL_LIBS="-lmysqlclient"],
ca0f4ea3 2273 [AC_MSG_ERROR(libmysqlclient is requred for MySQL support)])
aa7794f0 2274
8d131dda
VK
2275 OLD_LIBS="$LIBS"
2276 LIBS="$LIBS $MYSQL_LIBS"
aa7794f0 2277
ca0f4ea3 2278 AC_CHECK_FUNCS(mysql_real_escape_string)
9f1ea006
VK
2279
2280 CPPFLAGS="$OLD_CPPFLAGS"
2281 LDFLAGS="$OLD_LDFLAGS"
2282 LD_RUN_PATH="$OLD_LD_RUN_PATH"
8d131dda 2283 LIBS="$OLD_LIBS"
ca0f4ea3
VK
2284fi
2285
2286
58ed4897
VK
2287#--------------------------------------------------------------------
2288# PostgreSQL
2289#--------------------------------------------------------------------
2290
203458b7 2291check_substr "$COMPONENTS" "pgsql"
58ed4897 2292if test $? = 0; then
b535eed6
VK
2293 OLD_CPPFLAGS="$CPPFLAGS"
2294 OLD_LDFLAGS="$LDFLAGS"
2295 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2296
2297 CPPFLAGS="$CPPFLAGS $PGSQL_CPPFLAGS"
2298 LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS"
2299 if test "x$PGSQL_LD_RUN_PATH" != "x"; then
2300 LD_RUN_PATH="${PGSQL_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2301 fi
2302
9f1ea006
VK
2303 AC_CHECK_HEADER(libpq-fe.h,,AC_MSG_ERROR([Cannot find libpq-fe.h - check your PostgreSQL client installation]))
2304
58ed4897 2305 AC_CHECK_LIB(m, floor)
b535eed6
VK
2306 AC_CHECK_LIB(pq, PQconnectdb, [PGSQL_LIBS="-lpq"], [
2307 if test "x$PLATFORM" = "xSunOS"; then
2308 PGSQL_LDFLAGS="$PGSQL_LDFLAGS/sparcv9"
2309 LDFLAGS="$OLD_LDFLAGS $PGSQL_LDFLAGS"
2310 if test "x$PGSQL_LD_RUN_PATH" != "x"; then
2311 PGSQL_LD_RUN_PATH="$PGSQL_LD_RUN_PATH/sparcv9"
2312 LD_RUN_PATH="${PGSQL_LD_RUN_PATH}${OLD_LD_RUN_PATH:+:}${OLD_LD_RUN_PATH}"
2313 fi
2314 unset ac_cv_lib_pq_PQconnectdb
2315 AC_CHECK_LIB(pq, PQconnectdb, [PGSQL_LIBS="-lpq"], [
2316 AC_MSG_ERROR(libpq is required for PostgreSQL support)])
2317 else
2318 AC_MSG_ERROR(libpq is required for PostgreSQL support)
2319 fi
2320 ])
6fce76d8 2321
b535eed6
VK
2322 CPPFLAGS="$OLD_CPPFLAGS"
2323 LDFLAGS="$OLD_LDFLAGS"
2324 LD_RUN_PATH="$OLD_LD_RUN_PATH"
58ed4897
VK
2325fi
2326
2327
9c29f76e
VK
2328#--------------------------------------------------------------------
2329# ODBC
2330#--------------------------------------------------------------------
2331
2332check_substr "$COMPONENTS" "odbc"
2333if test $? = 0; then
2cfe4482
VK
2334 OLD_CPPFLAGS="$CPPFLAGS"
2335 OLD_LDFLAGS="$LDFLAGS"
2336 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2337
2338 CPPFLAGS="$CPPFLAGS $ODBC_CPPFLAGS"
b535eed6 2339 LDFLAGS="$LDFLAGS $ODBC_LDFLAGS"
2cfe4482
VK
2340 if test "x$ODBC_LD_RUN_PATH" != "x"; then
2341 LD_RUN_PATH="${ODBC_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2342 fi
2343
6fce76d8 2344 AC_CHECK_LIB(odbc, SQLAllocHandle, [ODBC_LIBS="-lodbc"],
9c29f76e 2345 [AC_MSG_ERROR(libodbc is required for ODBC support)])
60a1159a
VK
2346 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2347 SUBAGENT_LIBS="$SUBAGENT_LIBS $ODBC_LIBS"
2348 AC_CHECK_LIB(ltdl, lt_dlopen, [SUBAGENT_LIBS="$SUBAGENT_LIBS -lltdl"], [])
2349 fi
2cfe4482
VK
2350
2351 CPPFLAGS="$OLD_CPPFLAGS"
2352 LDFLAGS="$OLD_LDFLAGS"
2353 LD_RUN_PATH="$OLD_LD_RUN_PATH"
9c29f76e
VK
2354fi
2355
2356
41b4790d
VK
2357#--------------------------------------------------------------------
2358# Oracle
2359#--------------------------------------------------------------------
2360
2361check_substr "$COMPONENTS" "oracle"
2362if test $? = 0; then
2cfe4482
VK
2363 OLD_CPPFLAGS="$CPPFLAGS"
2364 OLD_LDFLAGS="$LDFLAGS"
2365 OLD_LD_RUN_PATH="$LD_RUN_PATH"
2366
2367 CPPFLAGS="$CPPFLAGS $ORACLE_CPPFLAGS"
b535eed6 2368 LDFLAGS="$LDFLAGS $ORACLE_LDFLAGS"
2cfe4482
VK
2369 if test "x$ORACLE_LD_RUN_PATH" != "x"; then
2370 LD_RUN_PATH="${ORACLE_LD_RUN_PATH}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
2371 fi
2372
41b4790d 2373 AC_CHECK_HEADER(oci.h,,AC_MSG_ERROR([*** Cannot find oci.h - check your Oracle client installation ***]))
7d8c91ef
VK
2374 AC_CHECK_LIB(nnz11, nzstrcpy, [NNZ_LIB=-lnnz11],
2375 [
2376 AC_CHECK_LIB(nnz10, nzstrcpy, [NNZ_LIB=-lnnz10], [], [-lclntsh])
2377 ], [-lclntsh])
2378 AC_CHECK_LIB(clntsh, OCIHandleAlloc, [ORACLE_LIBS="-lclntsh $NNZ_LIB"],
2379 [AC_MSG_ERROR(libclntsh is required for Oracle support)], [$NNZ_LIB])
045845e5 2380 AC_CHECK_LIB(rt, sem_destroy, [ORACLE_LIBS="$ORACLE_LIBS -lrt"], [])
60a1159a
VK
2381 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2382 SUBAGENT_LIBS="$SUBAGENT_LIBS $ORACLE_LIBS"
2383 fi
2cfe4482
VK
2384
2385 CPPFLAGS="$OLD_CPPFLAGS"
2386 LDFLAGS="$OLD_LDFLAGS"
2387 LD_RUN_PATH="$OLD_LD_RUN_PATH"
41b4790d
VK
2388fi
2389
84277a0f
AK
2390#--------------------------------------------------------------------
2391# DB2
2392#--------------------------------------------------------------------
2393
2394check_substr "$COMPONENTS" "db2"
2395if test $? = 0; then
2396 AC_CHECK_HEADER(sql.h,,AC_MSG_ERROR([*** Cannot find sql.h - check your DB2 client installation ***]))
2397 AC_CHECK_LIB(db2, SQLAllocHandle, [DB2_LIBS="-ldb2"],
2398 [AC_MSG_ERROR(libdb2 is required for DB2 support)])
6afe141e 2399 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2400 SUBAGENT_LIBS="$SUBAGENT_LIBS $DB2_LIBS"
2401 fi
84277a0f 2402fi
41b4790d 2403
37861c72
VK
2404#--------------------------------------------------------------------
2405# Informix
2406#--------------------------------------------------------------------
2407
2408check_substr "$COMPONENTS" "informix"
2409if test $? = 0; then
2410 AC_CHECK_HEADER(infxcli.h,,AC_MSG_ERROR([*** Cannot find infxcli.h - check your Informix client installation ***]))
4f2e8e9b
VK
2411 AC_CHECK_LIB(thcli, SQLAllocHandle, [INFORMIX_LIBS="-lthcli"],
2412 [AC_MSG_ERROR(libthcli is required for Informix support)])
60a1159a
VK
2413 if test "x$BUILD_STATIC_AGENT" = "xyes"; then
2414 SUBAGENT_LIBS="$SUBAGENT_LIBS $INFORMIX_LIBS"
2415 fi
37861c72
VK
2416fi
2417
c3cfc039 2418
50e4bc8c
VK
2419#--------------------------------------------------------------------
2420# Java
2421#--------------------------------------------------------------------
2422
2423check_substr "$COMPONENTS" "java"
2424if test $? = 0; then
2425 AC_CHECK_HEADER(jni.h,,AC_MSG_ERROR([*** Cannot find jni.h - check your JDK installation ***]))
b535eed6
VK
2426 AC_CHECK_LIB(jvm, SQLAllocHandle, [JAVA_LIBS="-ljvm"],
2427 [AC_MSG_ERROR(libjvm is required for Java support)])
50e4bc8c
VK
2428fi
2429
2430
ca0f4ea3
VK
2431#--------------------------------------------------------------------
2432# Other settings
2433#--------------------------------------------------------------------
2434
a5a95ac8
VK
2435if test "x$RUNTIME_PREFIX" = "x"; then
2436 if test "x${BUILD_UNICODE}" = "xyes"; then
2437 CPPFLAGS="$CPPFLAGS -DPREFIX=L\\\"\${prefix}\\\" -DDATADIR=L\\\"\${pkgdatadir}\\\" -DBINDIR=L\\\"\${bindir}\\\" -DLIBDIR=L\\\"\${libdir}\\\" -DPKGLIBDIR=L\\\"\${pkglibdir}\\\""
2438 else
2439 CPPFLAGS="$CPPFLAGS -DPREFIX=\\\"\${prefix}\\\" -DDATADIR=\\\"\${pkgdatadir}\\\" -DBINDIR=\\\"\${bindir}\\\" -DLIBDIR=\\\"\${libdir}\\\" -DPKGLIBDIR=\\\"\${pkglibdir}\\\""
2440 fi
b07c50cc 2441else
a5a95ac8
VK
2442 if test "x${BUILD_UNICODE}" = "xyes"; then
2443 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\\\""
2444 else
2445 CPPFLAGS="$CPPFLAGS -DPREFIX=\\\"$RUNTIME_PREFIX\\\" -DDATADIR=\\\"$RUNTIME_PREFIX/share/netxms\\\" -DBINDIR=\\\"$RUNTIME_PREFIX/bin\\\" -DLIBDIR=\\\"$RUNTIME_PREFIX/lib\\\" -DPKGLIBDIR=\\\"$RUNTIME_PREFIX/lib/netxms\\\""
2446 fi
b07c50cc 2447fi
545bda2d 2448LDFLAGS="$LDFLAGS_PREFIX $LDFLAGS $LDFLAGS_SUFFIX"
ca0f4ea3 2449
25ae8377
VK
2450if test "x${ENABLE_WERROR}" = "xyes"; then
2451 CPPFLAGS="$CPPFLAGS -Werror"
2452fi
2453
cbc4d191
VK
2454if test "x$PLATFORM" = "xDarwin"; then
2455 SHLIB_SUFFIX=".so"
2456else
2457 if test "x$shrext_cmds" != "x"; then
2458 SHLIB_SUFFIX="$shrext_cmds"
2459 else
2460 SHLIB_SUFFIX=".so"
2461 fi
2b479c92 2462fi
cbc4d191 2463AC_DEFINE_UNQUOTED([SHLIB_SUFFIX], _T("$SHLIB_SUFFIX"), [Define to platform's shared library suffix])
2b479c92 2464
8c9993b4
VK
2465if test "x$ENABLE_DEBUG" = "xno"; then
2466 CPPFLAGS="$CPPFLAGS -DNDEBUG"
2467fi
2468
551ec9ca 2469AM_CONDITIONAL([USE_INTERNAL_EXPAT], [test "x$HAVE_LIBEXPAT" = "xno"])
17b35ccc 2470AM_CONDITIONAL([USE_INTERNAL_LIBTRE], [test "x$HAVE_LIBTRE" = "xno"])
f5393033 2471AM_CONDITIONAL([USE_INTERNAL_JANSSON], [test "x$HAVE_JANSSON" = "xno"])
1fd41bcd 2472AM_CONDITIONAL([USE_INTERNAL_ZLIB], [test "$NEED_ZLIB/$HAVE_ZLIB" = "yes/no"])
c1165d33
VK
2473AM_CONDITIONAL([STATIC_BUILD], [test "x$STATIC_BUILD" = "xyes"])
2474AM_CONDITIONAL([ALL_STATIC], [test "x$ALL_STATIC" = "xyes"])
eca43970 2475AM_CONDITIONAL([USE_ENCRYPTION], [test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"])
6dde8627 2476AM_CONDITIONAL([HPUX_HPPA], [test "x$HPUX_HPPA" = "xyes"])
058bf6fc 2477AM_CONDITIONAL([XMPP_SUPPORT], [test "x$XMPP_SUPPORT" = "xyes"])
8b86c5dc 2478
ca0f4ea3 2479
ef0c727b
VK
2480#--------------------------------------------------------------------
2481# Substitute variables
2482#--------------------------------------------------------------------
82fa7c5d 2483
ef0c727b
VK
2484AC_SUBST(DB_DRIVERS)
2485AC_SUBST(MODULES)
2486AC_SUBST(SUBAGENT_DIRS)
7dda4453 2487AC_SUBST(SERVER_INCLUDE)
7c48e2aa 2488AC_SUBST(SERVER_LIBS)
ef0c727b 2489AC_SUBST(SERVER_TOOLS)
c20f8eb7 2490AC_SUBST(SMSDRV_DIRS)
6fad8870 2491AC_SUBST(HDLINK_DIRS)
52a2232c 2492AC_SUBST(PDSDRV_DIRS)
ef0c727b
VK
2493AC_SUBST(TOP_LEVEL_MODULES)
2494AC_SUBST(CONTRIB_MODULES)
c2612d83 2495AC_SUBST(CLIENT_COMPONENTS)
ef0c727b
VK
2496AC_SUBST(STATIC_SUBAGENT_LIST)
2497AC_SUBST(SUBAGENT_LIBS)
2498AC_SUBST(BUILD_SERVER)
447350a9 2499AC_SUBST(BUILD_SDK)
2cfe4482
VK
2500AC_SUBST(MYSQL_CPPFLAGS)
2501AC_SUBST(MYSQL_LDFLAGS)
6fce76d8 2502AC_SUBST(MYSQL_LIBS)
2cfe4482
VK
2503AC_SUBST(PGSQL_CPPFLAGS)
2504AC_SUBST(PGSQL_LDFLAGS)
6fce76d8 2505AC_SUBST(PGSQL_LIBS)
2cfe4482
VK
2506AC_SUBST(ORACLE_CPPFLAGS)
2507AC_SUBST(ORACLE_LDFLAGS)
7d8c91ef 2508AC_SUBST(ORACLE_LIBS)
2cfe4482
VK
2509AC_SUBST(ODBC_CPPFLAGS)
2510AC_SUBST(ODBC_LDFLAGS)
6fce76d8 2511AC_SUBST(ODBC_LIBS)
2cfe4482
VK
2512AC_SUBST(DB2_CPPFLAGS)
2513AC_SUBST(DB2_LDFLAGS)
84277a0f 2514AC_SUBST(DB2_LIBS)
2cfe4482
VK
2515AC_SUBST(INFORMIX_CPPFLAGS)
2516AC_SUBST(INFORMIX_LDFLAGS)
87f1fff0 2517AC_SUBST(INFORMIX_LIBS)
11ce9a66 2518AC_SUBST(OBJECT_MODE)
9113e749 2519AC_SUBST(SQLFLAGS)
cbc4d191 2520AC_SUBST(SHLIB_SUFFIX)
d16cf8a5 2521
ef0c727b
VK
2522#--------------------------------------------------------------------
2523# Shared libs versions
d16cf8a5
AK
2524#
2525# versioning scheme: current:revision:age
2526#
2527# current
2528# The number of the current interface exported by the library. A current
2529# value of `0', means that you are calling the interface exported by this
2530# library interface 0.
2531#
2532# revision
2533# The implementation number of the most recent interface exported by this
2534# library. In this case, a revision value of `0' means that this is the
2535# first implementation of the interface.
2536# If the next release of this library exports the same interface, but has a
2537# different implementation (perhaps some bugs have been fixed), the revision
2538# number will be higher, but current number will be the same. In that case,
2539# when given a choice, the library with the highest revision will always
2540# be used by the runtime loader.
2541#
2542# age
2543# The number of previous additional interfaces supported by this library.
2544# If age were `2', then this library can be linked into executables which
2545# were built with a release of this library that exported the current
2546# interface number, current, or any of the previous two interfaces.
2547# By definition age must be less than or equal to current. At the outset,
2548# only the first ever interface is implemented, so age can only be `0'.
ef0c727b 2549#--------------------------------------------------------------------
d16cf8a5 2550
17b35ccc 2551NETXMS_LIBRARY_VERSION=1:0:0
c7d14846 2552AC_SUBST(NETXMS_LIBRARY_VERSION)
d16cf8a5 2553
ef0c727b
VK
2554#--------------------------------------------------------------------
2555# Generate output files
2556#--------------------------------------------------------------------
d16cf8a5
AK
2557
2558AC_CONFIG_FILES([
0c3c0c39
AK
2559 Makefile
2560 contrib/Makefile
36874eca
VK
2561 contrib/backgrounds/Makefile
2562 contrib/integration/Makefile
2563 contrib/integration/HP_EVA/Makefile
bad6cc0c 2564 contrib/integration/HP_P2000/Makefile
36874eca 2565 contrib/mibs/Makefile
0c3c0c39 2566 contrib/startup/Makefile
fa66d60c 2567 contrib/startup/debian/Makefile
daaefaaf 2568 contrib/startup/gentoo/Makefile
7483d0bf 2569 contrib/startup/hp-ux/Makefile
0c3c0c39 2570 contrib/startup/redhat/Makefile
5de3893d 2571 contrib/startup/suse/Makefile
9993edf4 2572 contrib/startup/ubuntu/Makefile
6adf3219 2573 contrib/startup/solaris/Makefile
0c3c0c39 2574 doc/Makefile
a48203d2
VK
2575 doc/internal/Makefile
2576 doc/manuals/Makefile
2577 doc/misc/Makefile
0c3c0c39
AK
2578 images/Makefile
2579 include/Makefile
2580 m4/Makefile
0c3c0c39 2581 src/Makefile
9191f6ad 2582 src/agent/Makefile
6ac698ed 2583 src/agent/appagent/Makefile
9191f6ad
VK
2584 src/agent/core/Makefile
2585 src/agent/install/Makefile
a2a24e9d 2586 src/agent/libnxsd/Makefile
9191f6ad 2587 src/agent/subagents/Makefile
9191f6ad 2588 src/agent/subagents/aix/Makefile
df8b3df7 2589 src/agent/subagents/darwin/Makefile
52f5ee00
VK
2590 src/agent/subagents/db2/Makefile
2591 src/agent/subagents/dbquery/Makefile
ab1e80fd 2592 src/agent/subagents/devemu/Makefile
80e96a82 2593 src/agent/subagents/ecs/Makefile
ab1e80fd 2594 src/agent/subagents/filemgr/Makefile
9191f6ad 2595 src/agent/subagents/freebsd/Makefile
80e96a82
VK
2596 src/agent/subagents/hpux/Makefile
2597 src/agent/subagents/informix/Makefile
9191f6ad 2598 src/agent/subagents/ipso/Makefile
50e4bc8c
VK
2599 src/agent/subagents/java/Makefile
2600 src/agent/subagents/java/java/Makefile
2601 src/agent/subagents/java/java/src/Makefile
2602 src/agent/subagents/java/java/src/main/Makefile
2603 src/agent/subagents/java/java/src/main/java/Makefile
2604 src/agent/subagents/java/java/src/main/java/org/Makefile
2605 src/agent/subagents/java/java/src/main/java/org/netxms/Makefile
2606 src/agent/subagents/java/java/src/main/java/org/netxms/agent/Makefile
80e96a82 2607 src/agent/subagents/linux/Makefile
df8b3df7 2608 src/agent/subagents/lmsensors/Makefile
80e96a82
VK
2609 src/agent/subagents/logwatch/Makefile
2610 src/agent/subagents/netbsd/Makefile
df8b3df7 2611 src/agent/subagents/netsvc/Makefile
80e96a82
VK
2612 src/agent/subagents/odbcquery/Makefile
2613 src/agent/subagents/openbsd/Makefile
4d1753cd 2614 src/agent/subagents/oracle/Makefile
9191f6ad 2615 src/agent/subagents/ping/Makefile
80e96a82 2616 src/agent/subagents/portCheck/Makefile
df8b3df7 2617 src/agent/subagents/rpi/Makefile
9191f6ad 2618 src/agent/subagents/sms/Makefile
80e96a82 2619 src/agent/subagents/sunos/Makefile
9191f6ad 2620 src/agent/subagents/ups/Makefile
80e96a82
VK
2621 src/agent/subagents/winnt/Makefile
2622 src/agent/subagents/winperf/Makefile
52f5ee00 2623 src/agent/subagents/wmi/Makefile
0bd64860 2624 src/agent/tools/Makefile
6ac698ed 2625 src/agent/tools/nxappget/Makefile
0bd64860 2626 src/agent/tools/nxapush/Makefile
c2612d83 2627 src/client/Makefile
551592f4 2628 src/client/install/Makefile
c94fa5c2 2629 src/client/nxalarm/Makefile
e84701c5
VK
2630 src/client/nxevent/Makefile
2631 src/client/nxpush/Makefile
59ffa5b7 2632 src/client/nxsms/Makefile
d1834406
VK
2633 src/db/Makefile
2634 src/db/dbdrv/Makefile
87f1fff0
VK
2635 src/db/dbdrv/db2/Makefile
2636 src/db/dbdrv/informix/Makefile
d1834406
VK
2637 src/db/dbdrv/odbc/Makefile
2638 src/db/dbdrv/mssql/Makefile
2639 src/db/dbdrv/mysql/Makefile
87f1fff0 2640 src/db/dbdrv/oracle/Makefile
d1834406
VK
2641 src/db/dbdrv/pgsql/Makefile
2642 src/db/dbdrv/sqlite/Makefile
d1834406 2643 src/db/libnxdb/Makefile
9191f6ad
VK
2644 src/install/Makefile
2645 src/install/windows/Makefile
f5393033 2646 src/jansson/Makefile
9191f6ad
VK
2647 src/libexpat/Makefile
2648 src/libexpat/libexpat/Makefile
2649 src/libnetxms/Makefile
2650 src/libnxcl/Makefile
2651 src/libnxlp/Makefile
2652 src/libnxmap/Makefile
2653 src/libnxsl/Makefile
058bf6fc 2654 src/libstrophe/Makefile
a67fa146
VK
2655 src/libtre/Makefile
2656 src/libtre/win32/Makefile
a7a03ffd 2657 src/nxcproxy/Makefile
8dca469f 2658 src/nxlptest/Makefile
9191f6ad 2659 src/nxscript/Makefile
0c3c0c39
AK
2660 src/server/Makefile
2661 src/server/core/Makefile
644f97f5 2662 src/server/drivers/Makefile
386f88e3 2663 src/server/drivers/airespace/Makefile
0239cfea 2664 src/server/drivers/at/Makefile
644f97f5 2665 src/server/drivers/baystack/Makefile
b1bd1fb2 2666 src/server/drivers/cat2900xl/Makefile
910846cc 2667 src/server/drivers/catalyst/Makefile
fce03ab9 2668 src/server/drivers/cisco-esw/Makefile
ae8ea5a6 2669 src/server/drivers/cisco-sb/Makefile
8bdfaed8 2670 src/server/drivers/dell-pwc/Makefile
a548def4 2671 src/server/drivers/dlink/Makefile
644f97f5 2672 src/server/drivers/ers8000/Makefile
d7e23292 2673 src/server/drivers/h3c/Makefile
4e592faf
VK
2674 src/server/drivers/lib/Makefile
2675 src/server/drivers/lib/avaya-ers/Makefile
b1bd1fb2 2676 src/server/drivers/lib/cisco/Makefile
a73592db 2677 src/server/drivers/mikrotik/Makefile
81ecaf38 2678 src/server/drivers/netscreen/Makefile
e10e890e 2679 src/server/drivers/ntws/Makefile
c183a9f9 2680 src/server/drivers/ping3/Makefile
9b13553b 2681 src/server/drivers/procurve/Makefile
217e4d6a 2682 src/server/drivers/symbol-ws/Makefile
8cf94ffe 2683 src/server/drivers/ubnt/Makefile
6fad8870
VK
2684 src/server/hdlink/Makefile
2685 src/server/hdlink/jira/Makefile
d770a97c
VK
2686 src/server/include/Makefile
2687 src/server/libnxsrv/Makefile
2688 src/server/netxmsd/Makefile
52a2232c
VK
2689 src/server/pdsdrv/Makefile
2690 src/server/pdsdrv/rrdtool/Makefile
d8f2e39b 2691 src/server/smsdrv/Makefile
8d7f1bea 2692 src/server/smsdrv/dummy/Makefile
d8f2e39b 2693 src/server/smsdrv/generic/Makefile
e47404b3 2694 src/server/smsdrv/kannel/Makefile
91369aca 2695 src/server/smsdrv/nxagent/Makefile
aab8a8b6 2696 src/server/smsdrv/portech/Makefile
8d7f1bea 2697 src/server/smsdrv/websms/Makefile
0c3c0c39 2698 src/server/tools/Makefile
0c3c0c39
AK
2699 src/server/tools/nxaction/Makefile
2700 src/server/tools/nxadm/Makefile
9191f6ad 2701 src/server/tools/nxap/Makefile
5b0c7d0d
VK
2702 src/server/tools/nxconfig/Makefile
2703 src/server/tools/nxconfig/res/Makefile
f90d7fc5 2704 src/server/tools/nxdbmgr/Makefile
9191f6ad 2705 src/server/tools/nxget/Makefile
d24fdaf4 2706 src/server/tools/nxupload/Makefile
c5c0f362
VK
2707 src/snmp/Makefile
2708 src/snmp/libnxsnmp/Makefile
2709 src/snmp/nxmibc/Makefile
2710 src/snmp/nxsnmpget/Makefile
2711 src/snmp/nxsnmpset/Makefile
2712 src/snmp/nxsnmpwalk/Makefile
9191f6ad 2713 src/sqlite/Makefile
f65df2b1 2714 src/tools/Makefile
f65df2b1 2715 src/tools/nxdevcfg/Makefile
56e13b13 2716 src/tools/nxencpasswd/Makefile
1fd41bcd 2717 src/zlib/Makefile
9191f6ad 2718 sql/Makefile
33a10d92
VK
2719 tests/Makefile
2720 tests/include/Makefile
2721 tests/test-libnetxms/Makefile
66c11d49 2722 tests/test-libnxdb/Makefile
0c3c0c39 2723 tools/Makefile
d16cf8a5
AK
2724])
2725
12249937
VK
2726AC_OUTPUT
2727
ef0c727b 2728echo "Updating libtool"
5cecf50e
AK
2729sed 's,$SED -e "/${host}-//g",$SED -e "s/${host}-//g",g' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
2730
779ce551 2731# On HP-UX, libtool passes +b instead of -Wl,+b even if gcc/g++ used as linker
5482ef16 2732if test "x$ac_compiler_gnu" = "xyes" && test "x$PLATFORM" = "xHP-UX"; then
779ce551
VK
2733 sed "s,hardcode_libdir_flag_spec_ld=,#hardcode_libdir_flag_spec_ld=,g" < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
2734fi
2735
b677ef59
VK
2736# On AIX, correct OBJECT_MODE must be set before linking
2737# To avoid manual setting by user, we add this to libtool script
2738if test "x$PLATFORM" = "xAIX"; then
2739 head -n 1 ./libtool > ./libtool.new
2740 echo "export OBJECT_MODE=$OBJECT_MODE" >> ./libtool.new
2741 tail -n +2 ./libtool >> ./libtool.new
2742 mv libtool.new libtool
2743 chmod +x ./libtool
2744fi
2745
ef0c727b
VK
2746#--------------------------------------------------------------------
2747# Print summary
2748#--------------------------------------------------------------------
a7442678 2749
a7442678
AK
2750echo
2751echo
2752echo
2753echo '---------------------------------------------------------------------'
2754echo ' Configure results'
2755echo '---------------------------------------------------------------------'
2756echo
8b86c5dc 2757 echo "Prefix : ${prefix}"
cbc4d191
VK
2758 echo "Platform : ${PLATFORM}"
2759 echo "Shared library suffix : ${SHLIB_SUFFIX}"
a7442678 2760if test "x${BUILD_SERVER}" = "xyes"; then
8b86c5dc 2761 echo "Build Server : YES"
7c48e2aa 2762 echo "Server libs : ${SERVER_LIBS}"
2cfe4482
VK
2763 if test "x${LDAP_SUPPORT}" = "xyes"; then
2764 echo "LDAP support : YES"
2765 else
2766 echo "LDAP support : NO"
2767 fi
058bf6fc
VK
2768 if test "x${XMPP_SUPPORT}" = "xyes"; then
2769 echo "XMPP support : YES"
2770 else
2771 echo "XMPP support : NO"
2772 fi
a7442678 2773else
8b86c5dc 2774 echo "Build Server : NO"
a7442678
AK
2775fi
2776if test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"; then
8b86c5dc 2777 echo "Encryption enabled : YES"
a7442678 2778else
8b86c5dc 2779 echo "Encryption enabled : NO"
a7442678
AK
2780fi
2781if test "x${DB_DRIVERS}" != "x"; then
8b86c5dc 2782 echo "Build DB-Drivers :${DB_DRIVERS}"
a7442678 2783else
8b86c5dc 2784 echo "Build DB-Drivers : NO"
a7442678
AK
2785fi
2786if test "x${BUILD_CLIENT}" = "xyes"; then
8b86c5dc 2787 echo "Build Clients : YES"
a7442678 2788else
8b86c5dc 2789 echo "Build Clients : NO"
a7442678
AK
2790fi
2791if test "x${BUILD_AGENT}" = "xyes"; then
8b86c5dc
VK
2792 echo "Build Agent : YES"
2793 echo "Subagents list : ${SUBAGENT_DIRS}"
a7442678 2794else
8b86c5dc 2795 echo "Build Agent : NO"
a7442678 2796fi
e8636669 2797if test "x${BUILD_STATIC_AGENT}" = "xyes"; then
8b86c5dc
VK
2798 echo "Build Static Agent : YES"
2799 echo "Subagents list : ${STATIC_SUBAGENT_LIST}"
e8636669 2800else
8b86c5dc 2801 echo "Build Static Agent : NO"
e8636669 2802fi
8b86c5dc 2803if test "x${BUILD_UNICODE}" = "xyes"; then
a67fa146 2804 echo "UNICODE build : YES"
8b86c5dc 2805else
a67fa146 2806 echo "UNICODE build : NO"
8b86c5dc 2807fi
551ec9ca
VK
2808if test "x${HAVE_LIBEXPAT}" = "xno"; then
2809 echo "Use internal libexpat : YES"
1bb6b449 2810else
551ec9ca 2811 echo "Use internal libexpat : NO"
1bb6b449 2812fi
17b35ccc
VK
2813if test "x${HAVE_LIBTRE}" = "xno"; then
2814 echo "Use internal libtre : YES"
2815else
2816 echo "Use internal libtre : NO"
2817fi
f5393033
VK
2818if test "x${HAVE_JANSSON}" = "xno"; then
2819 echo "Use internal libjansson : YES"
2820else
2821 echo "Use internal libjansson : NO"
2822fi
1fd41bcd
VK
2823if test "x${NEED_ZLIB}" = "xyes"; then
2824 if test "x${HAVE_ZLIB}" = "xno"; then
2825 echo "Use internal zlib : YES"
2826 else
2827 echo "Use internal zlib : NO"
2828 fi
2829fi
cc297a70
VK
2830if test "x${FORCE_32BIT_BUILD}" = "xyes"; then
2831 echo "Force 32bit build : YES"
2832else
2833 echo "Force 32bit build : NO"
2834fi
7d8c91ef 2835
9113e749
VK
2836echo "C compiler : ${CC}"
2837echo "C++ compiler : ${CXX}"
7d8c91ef
VK
2838echo "CPPFLAGS : ${CPPFLAGS}"
2839echo "CXXFLAGS : ${CXXFLAGS}"
2840echo "CFLAGS : ${CFLAGS}"
2841echo "LDFLAGS : ${LDFLAGS}"
8d131dda 2842echo "LIBS : ${LIBS}"
7d8c91ef 2843
2cfe4482
VK
2844if test "x${MYSQL_CPPFLAGS}" != "x"; then
2845 echo "MySQL CPPFLAGS : ${MYSQL_CPPFLAGS}"
2846fi
2847if test "x${MYSQL_LDFLAGS}" != "x"; then
2848 echo "MySQL LDFLAGS : ${MYSQL_LDFLAGS}"
2849fi
6fce76d8 2850if test "x${MYSQL_LIBS}" != "x"; then
2cfe4482
VK
2851 echo "MySQL LIBS : ${MYSQL_LIBS}"
2852fi
2853
2854if test "x${PGSQL_CPPFLAGS}" != "x"; then
2855 echo "PostgreSQL CPPFLAGS : ${PGSQL_CPPFLAGS}"
2856fi
2857if test "x${PGSQL_LDFLAGS}" != "x"; then
2858 echo "PostgreSQL LDFLAGS : ${PGSQL_LDFLAGS}"
6fce76d8
VK
2859fi
2860if test "x${PGSQL_LIBS}" != "x"; then
2cfe4482
VK
2861 echo "PostgreSQL LIBS : ${PGSQL_LIBS}"
2862fi
2863
2864if test "x${ORACLE_CPPFLAGS}" != "x"; then
2865 echo "Oracle CPPFLAGS : ${ORACLE_CPPFLAGS}"
2866fi
2867if test "x${ORACLE_LDFLAGS}" != "x"; then
2868 echo "Oracle LDFLAGS : ${ORACLE_LDFLAGS}"
6fce76d8 2869fi
7d8c91ef 2870if test "x${ORACLE_LIBS}" != "x"; then
2cfe4482
VK
2871 echo "Oracle LIBS : ${ORACLE_LIBS}"
2872fi
2873
2874if test "x${ODBC_CPPFLAGS}" != "x"; then
2875 echo "ODBC CPPFLAGS : ${ODBC_CPPFLAGS}"
2876fi
2877if test "x${ODBC_LDFLAGS}" != "x"; then
2878 echo "ODBC LDFLAGS : ${ODBC_LDFLAGS}"
7d8c91ef 2879fi
6fce76d8 2880if test "x${ODBC_LIBS}" != "x"; then
2cfe4482
VK
2881 echo "ODBC LIBS : ${ODBC_LIBS}"
2882fi
2883
2884if test "x${DB2_CPPFLAGS}" != "x"; then
2885 echo "DB2 CPPFLAGS : ${DB2_CPPFLAGS}"
2886fi
2887if test "x${DB2_LDFLAGS}" != "x"; then
2888 echo "DB2 LDFLAGS : ${DB2_LDFLAGS}"
6fce76d8 2889fi
84277a0f 2890if test "x${DB2_LIBS}" != "x"; then
2cfe4482
VK
2891 echo "DB2 LIBS : ${DB2_LIBS}"
2892fi
2893
2894if test "x${INFORMIX_CPPFLAGS}" != "x"; then
2895 echo "Informix CPPFLAGS : ${INFORMIX_CPPFLAGS}"
2896fi
2897if test "x${INFORMIX_LDFLAGS}" != "x"; then
2898 echo "Informix LDFLAGS : ${INFORMIX_LDFLAGS}"
84277a0f 2899fi
37861c72 2900if test "x${INFORMIX_LIBS}" != "x"; then
2cfe4482 2901 echo "Informix LIBS : ${INFORMIX_LIBS}"
37861c72 2902fi
ecbed20c
VK
2903
2904FLAGS_CPP="src/tools/nxdevcfg/flags.cpp"
2905echo "/* Automatically generated by configure */" > $FLAGS_CPP
d541b129
VK
2906echo "#include <nms_common.h>" >> $FLAGS_CPP
2907echo "const TCHAR *g_cppFlags = _T(\"${CPPFLAGS}\");" >> $FLAGS_CPP
2908echo "const TCHAR *g_cFlags = _T(\"${CFLAGS}\");" >> $FLAGS_CPP
2909echo "const TCHAR *g_cxxFlags = _T(\"${CXXFLAGS}\");" >> $FLAGS_CPP
2910echo "const TCHAR *g_ldFlags = _T(\"${LDFLAGS}\");" >> $FLAGS_CPP
2911echo "const TCHAR *g_libs = _T(\"${LIBS}\");" >> $FLAGS_CPP
7dda4453
VK
2912echo "const TCHAR *g_cc = _T(\"${CC}\");" >> $FLAGS_CPP
2913echo "const TCHAR *g_cxx = _T(\"${CXX}\");" >> $FLAGS_CPP
2914echo "const TCHAR *g_ld = _T(\"${LD}\");" >> $FLAGS_CPP
2915echo "const TCHAR *g_perl = _T(\"${PERL}\");" >> $FLAGS_CPP