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