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