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