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