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