created separate client installer
[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"
80ce37ac 49MODULES="libnetxms 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
ef0c727b
VK
102AC_ARG_WITH(nxhttpd,
103[AS_HELP_STRING(--with-nxhttpd,build web interface)],
104[
105 COMPONENTS="$COMPONENTS nxhttpd"
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"
188 CPPFLAGS="$CPPFLAGS -I/usr/local/include -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"
80ce37ac 231 MODULES="libexpat libnetxms install sqlite snmp libnxsl libnxlp server agent libnxmap libnxcl client nxhttpd nxscript nxcptest"
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"
c5c0f362 333 MODULES="$MODULES libnxmap libnxsl libnxlp 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
ef0c727b 382check_substr "$COMPONENTS" "nxhttpd"
1010cff7 383if test $? = 0; then
ef0c727b
VK
384 BUILD_NXHTTPD="yes"
385 MODULES="$MODULES libnxmap libnxcl nxhttpd"
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 -fno-const-strings)
525 OLD_CXXFLGAS="$CXXFLAGS"
526 CXXFLAGS="$CXXFLAGS -fno-const-strings"
527 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
528 [ AC_MSG_RESULT(yes) ],
529 [
530 CXXFLAGS="$OLD_CXXFLAGS"
531 AC_MSG_RESULT(no)
532 ])
533
534 AC_MSG_CHECKING(whether C++ compiler accepts -Wno-deprecated)
535 OLD_CXXFLGAS="$CXXFLAGS"
536 CXXFLAGS="$CXXFLAGS -Wno-deprecated"
537 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
538 [ AC_MSG_RESULT(yes) ],
539 [
540 CXXFLAGS="$OLD_CXXFLAGS"
541 AC_MSG_RESULT(no)
542 ])
543
ef0c727b
VK
544 AC_LANG_POP([C++])
545
779ce551
VK
546 if test "x$PLATFORM" = "xHP-UX"; then
547 AC_MSG_CHECKING(whether C compiler accepts -mlp64)
548 OLD_CPPFLGAS="$CPPFLAGS"
549 CPPFLAGS="$CPPFLAGS -mlp64"
550 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
551 [
552 LDFLAGS="-mlp64 -L/usr/lib/hpux64 -L/usr/local/lib/hpux64 $LDFLAGS"
553 AC_MSG_RESULT(yes)
554 ],
555 [
556 CPPFLAGS="$OLD_CPPFLAGS"
557 AC_MSG_RESULT(no)
558 ])
559 fi
560
ce5592b2
VK
561 if test "x$ENABLE_DEBUG" = "xyes"; then
562 CPPFLAGS="$CPPFLAGS -ggdb3"
563 fi
ef0c727b
VK
564fi
565
566
567#--------------------------------------------------------------------
568# Additional include and library directories
569#--------------------------------------------------------------------
570
571if test -d /usr/local/include; then
572 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
573fi
574
575if test -d /usr/kerberos/include; then
576 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
577fi
578
579if test -d /usr/local/lib; then
580 LDFLAGS="$LDFLAGS -L/usr/local/lib"
581fi
582
583
584#--------------------------------------------------------------------
585# Check for threads library - either POSIX or GNU
586#--------------------------------------------------------------------
587
588if test "x$USE_PTH" = "xyes"; then
589 AC_CHECK_HEADER(pth.h,,AC_MSG_ERROR([*** GNU Pth thread support not installed - please install first ***]))
590else
591 AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed - please install first ***]))
592
593 if test "x$CXX" = "xaCC"; then
594 PTHREAD_LIBS=""
595 else
596 PTHREAD_LIBS="error"
597 AC_MSG_CHECKING(for old style FreeBSD -pthread flag)
598 AC_EGREP_CPP(yes,
599 [#if defined(__FreeBSD_cc_version) || defined(__OpenBSD__)
600 yes
601 #endif
602 ], AC_MSG_RESULT(yes)
603 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" PTHREAD_LIBS="-pthread",
604 AC_MSG_RESULT(no))
605 if test "x$PTHREAD_LIBS" = "xerror"; then
606 AC_CHECK_LIB(pthread, pthread_attr_init,
607 PTHREAD_LIBS="-lpthread")
608 fi
609 if test "x$PTHREAD_LIBS" = "xerror"; then
610 AC_CHECK_LIB(pthreads, pthread_attr_init,
611 PTHREAD_LIBS="-lpthreads")
612 fi
613 if test "x$PTHREAD_LIBS" = "xerror"; then
614 AC_CHECK_FUNC(pthread_attr_init,
615 PTHREAD_LIBS="")
616 fi
617 fi
618
619 if test "x$PTHREAD_LIBS" = "xerror"; then
620 AC_MSG_ERROR(*** Unable to locate working posix thread library ***)
621 fi
622 LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
623
624 # Extensions to posix threads
625 AC_CHECK_HEADERS([pthread_np.h],,,[
9c29f76e 626#include <pthread.h>
ef0c727b
VK
627 ])
628 AC_CHECK_FUNCS([pthread_cond_reltimedwait_np])
629
630 # Check for recursive mutexes
631 AC_CHECK_FUNCS([pthread_mutexattr_settype pthread_mutexattr_setkind_np])
632 AC_CHECK_DECLS([PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_RECURSIVE_NP, MUTEX_TYPE_COUNTING_FAST],,,[
9c29f76e
VK
633#include <pthread.h>
634#if HAVE_PTHREAD_NP_H
635#include <pthread_np.h>
636#endif
ef0c727b
VK
637 ])
638
639 # Check for read/write locks
640 # On Linux, rwlock functions declared always, but pthread_rwlock_t may need
641 # additional defines
642 AC_CHECK_FUNCS([pthread_rwlock_init pthread_rwlock_timedrdlock pthread_rwlock_timedwrlock])
643 if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then
644 AC_CACHE_CHECK([for pthread_rwlock_t], ac_cv_struct_pthread_rw,
9c29f76e
VK
645 [AC_TRY_COMPILE([
646#include <sys/types.h>
647#include <pthread.h>
648 ],
ef0c727b
VK
649 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
650 ac_cv_struct_pthread_rw=yes, [
9c29f76e
VK
651 AC_TRY_COMPILE([
652#define _XOPEN_SOURCE 500
653#include <sys/types.h>
654#include <pthread.h>
655 ],
ef0c727b
VK
656 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
657 ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
658 if test "$ac_cv_struct_pthread_rw" = "yes"; then
659 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
660 fi
661 ])])
662 if test "$ac_cv_struct_pthread_rw" = "yes"; then
663 AC_DEFINE(HAVE_PTHREAD_RWLOCK, 1, Define to 1 if you have working pthread read/write locks)
664 fi
665 fi
666
667fi
668
669
670#--------------------------------------------------------------------
671# Checks for OpenSSL
672#--------------------------------------------------------------------
673
674if test "x$DISABLE_ENCRYPTION" != "xyes" ; then
675 AC_CHECK_LIB(crypto, RSA_new,
676 [
677 AC_DEFINE(WITH_OPENSSL,,[with openssl])
678 AC_CHECK_LIB(crypto, EVP_aes_256_cbc,
679 [], [AC_DEFINE(NETXMS_NO_AES,,[desc])])
680 AC_CHECK_LIB(crypto, EVP_bf_cbc,
681 [], [AC_DEFINE(NETXMS_NO_BF,,[desc])])
682 AC_CHECK_LIB(crypto, EVP_idea_cbc,
683 [], [AC_DEFINE(NETXMS_NO_IDEA,,[desc])])
684 AC_CHECK_LIB(crypto, EVP_des_ede3_cbc,
685 [], [AC_DEFINE(NETXMS_NO_DES,,[desc])])
686 ],
687 [
688 if test "x$REQUIRE_ENCRYPTION" = "xyes"; then
689 AC_MSG_ERROR(libcrypto is required for encryption support)
690 else
691 AC_MSG_RESULT(libcrypto is required for encryption support)
692 fi
693 ])
694fi
695
696
697#--------------------------------------------------------------------
698# Checks for other libs.
699#--------------------------------------------------------------------
d16cf8a5 700
779ce551 701AC_CHECK_LIB(xnet, accept)
521d90e7 702AC_CHECK_LIB(socket, if_nameindex)
87bb64a7 703AC_CHECK_LIB(dl, dlopen)
1b3c0ef0 704AC_CHECK_LIB(kstat, kstat_open)
b821526a 705AC_CHECK_LIB(gnugetopt, getopt_long)
d16cf8a5 706
e0760102
VK
707if test "x$BUILD_SERVER" = "xyes" ; then
708 AC_CHECK_LIB(termcap, tgetstr, [], [AC_CHECK_LIB(ncurses, tgetstr, [], AC_CHECK_LIB(curses, tgetstr))])
709 AC_CHECK_LIB(readline, readline)
710fi
711
ef0c727b
VK
712if test "x$NEED_ZLIB" = "xyes"; then
713 AC_CHECK_HEADER(zlib.h,,AC_MSG_ERROR([*** ZLib development package not installed - please install first ***]))
714 AC_CHECK_LIB(z, deflate)
715fi
716
1bb6b449
VK
717HAVE_LIBEXPAT=yes
718AC_CHECK_HEADER(expat.h,,HAVE_LIBEXPAT=no)
719AC_CHECK_LIB(expat, XML_Parse, [], [ HAVE_LIBEXPAT=no ])
80ce37ac
VK
720if test "x$HAVE_LIBEXPAT" = "xno"; then
721 MODULES="libexpat $MODULES"
722 CPPFLAGS="$CPPFLAGS "
1bb6b449 723fi
ef0c727b
VK
724
725#--------------------------------------------------------------------
726# Checks for header files
727#--------------------------------------------------------------------
d16cf8a5 728
b64f0430 729AC_CHECK_HEADERS([sys/types.h sys/stat.h unistd.h stdarg.h fcntl.h alloca.h])
be6467e9 730AC_CHECK_HEADERS([sys/int_types.h time.h sys/time.h sys/utsname.h])
ca6ad6bb 731AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h net/nh.h sys/socket.h])
70fed300 732AC_CHECK_HEADERS([fcntl.h dirent.h sys/ioctl.h sys/sockio.h poll.h termios.h])
80ce37ac 733AC_CHECK_HEADERS([inttypes.h memory.h stdint.h stdlib.h strings.h string.h])
aa24418a
VK
734AC_CHECK_HEADERS([readline/readline.h byteswap.h sys/select.h dlfcn.h])
735AC_CHECK_HEADERS([sys/sysctl.h sys/param.h sys/user.h vm/vm_param.h syslog.h getopt.h])
ade50e8b
AK
736AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h],,,
737[[#ifdef HAVE_SYS_TYPES_H
738# include <sys/types.h>
739#endif
740#ifdef HAVE_SYS_TIME_H
741# include <sys/time.h>
742#endif
743#ifdef HAVE_SYS_SOCKET_H
744# include <sys/socket.h>
745#endif
746]])
d16cf8a5 747
ef0c727b
VK
748
749#--------------------------------------------------------------------
750# Checks for data types
751#--------------------------------------------------------------------
752
d16cf8a5
AK
753AC_CHECK_SIZEOF(short)
754AC_CHECK_SIZEOF(int)
755AC_CHECK_SIZEOF(long)
756AC_CHECK_SIZEOF(long long)
757
758AC_TYPE_PID_T
759AC_TYPE_SIGNAL
760AC_TYPE_SIZE_T
761AC_STRUCT_TIMEZONE
762
51128b42
VK
763AC_CHECK_TYPES([long long, unsigned long long, int64_t, uint64_t, u_int64_t])
764AC_CHECK_TYPES([mode_t, off_t, socklen_t],,,[
4c779d83
VK
765#if HAVE_SYS_TYPES_H
766#include <sys/types.h>
767#endif
768#if HAVE_SYS_SOCKET_H
769#include <sys/socket.h>
770#endif
771])
e0293f7f
VK
772AC_CHECK_TYPES([struct stat64],,,[
773#if HAVE_SYS_STAT_H
774#include <sys/stat.h>
775#endif
776])
521d90e7 777
e25cadc9 778
ef0c727b
VK
779#--------------------------------------------------------------------
780# Checks for functions
781#--------------------------------------------------------------------
d16cf8a5
AK
782
783AC_FUNC_ERROR_AT_LINE
d16cf8a5 784AC_FUNC_MEMCMP
d16cf8a5
AK
785AC_FUNC_SELECT_ARGTYPES
786AC_FUNC_STRFTIME
787AC_FUNC_STRTOD
788AC_FUNC_VPRINTF
789
80ce37ac 790AC_CHECK_FUNCS([gettimeofday memmove memset bcopy strchr strcspn strdup strerror])
b50f1100 791AC_CHECK_FUNCS([strrchr strtol strtoul strtoll strtoull])
467e30e1 792AC_CHECK_FUNCS([if_nametoindex daemon mmap strerror_r scandir uname poll])
aa24418a
VK
793AC_CHECK_FUNCS([usleep nanosleep getopt_long gmtime_r localtime_r lstat64])
794
795AC_CHECK_DECLS([nanosleep])
be6467e9
VK
796
797# Check if timezone is a function
798AC_MSG_CHECKING(for timezone function)
799AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
800#if HAVE_TIME_H
801#include <time.h>
802#endif
803#if HAVE_SYS_TIME_H
804#include <sys/time.h>
805#endif
806]],[[
807int main()
808{
809 timezone(0, 0);
810 return 0;
811}
812]])
813],[
814AC_MSG_RESULT(yes)
815AC_DEFINE(HAVE_TIMEZONE,1,Define to 1 if timezone function is available)
816],[
817AC_MSG_RESULT(no)
445cba33
VK
818AC_CHECK_DECLS([timezone],,,[
819#if HAVE_TIME_H
820#include <time.h>
821#endif
822#if HAVE_SYS_TIME_H
823#include <sys/time.h>
824#endif
825])
be6467e9
VK
826])
827
828# Check if struct tm has tm_gmtoff member
829AC_MSG_CHECKING(for struct tm.tm_gmtoff)
830AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
831#if HAVE_TIME_H
832#include <time.h>
833#endif
834#if HAVE_SYS_TIME_H
835#include <sys/time.h>
836#endif
837]],[[
838int main()
839{
840 struct tm t;
841 return t.tm_gmtoff;
842}
843]])
844],[
845AC_MSG_RESULT(yes)
846AC_DEFINE(HAVE_TM_GMTOFF,1,Define to 1 if struct tm has tm_gmtoff member)
847],[
848AC_MSG_RESULT(no)
849])
d16cf8a5 850
99e50bb7
VK
851AC_CHECK_DECLS([getopt_long],,,[
852#if HAVE_GETOPT_H
853#include <getopt.h>
854#endif
855])
73d7fbdb 856
f91feddc 857AC_CHECK_FUNCS([sysctlbyname sysctlnametomib])
70fed300
AK
858AC_CHECK_FUNCS([tcgetattr tcsetattr cfsetospeed cfsetispeed])
859
d16cf8a5
AK
860# sockets/resolver (probably for solaris)
861AC_CHECK_FUNC(connect, , [AC_CHECK_LIB(socket, connect)])
862AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(resolv, gethostbyname)])
863AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)])
864
865if test "x$ac_cv_lib_nsl_gethostbyname" != "xyes" && test "x$ac_cv_func_gethostbyname" != "xyes" ; then
866 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(socket, gethostbyname)])
867fi
868
869if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname" ; then
870 AC_MSG_CHECKING([if we can include libnsl + libsocket])
871 LIBS="-lnsl -lsocket $LIBS"
872 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void) gethostbyname]])],[my_ac_link_result=yes],[my_ac_link_result=no ])
873 if test "$my_ac_link_result" = "no" ; then
874 AC_MSG_RESULT([failure])
875 AC_MSG_ERROR([unable to use gethostbyname()])
876 else
877 AC_MSG_RESULT([success])
878 fi
879fi
880
c6491611
VK
881# asprintf, scprintf, etc.
882AC_CHECK_FUNCS([asprintf aswprintf vasprintf vaswprintf])
883AC_CHECK_FUNCS([scprintf scwprintf vscprintf vscwprintf])
884
885AC_MSG_CHECKING(whether snprintf returns required buffer size)
886AC_RUN_IFELSE(
887 [AC_LANG_PROGRAM([
888#include <stdio.h>
889#include <string.h>
890 ], [
891 return !(snprintf(NULL, 0, "test: %d", 1000) >= 10);
892 ])
893 ],
894 [ AC_MSG_RESULT(yes)
895 AC_DEFINE(SNPRINTF_RETURNS_REQUIRED_SIZE, 1, Define to 1 if snprintf returns required buffer size in case of truncation)
896 ],
897 [ AC_MSG_RESULT(no) ],
898 [ AC_MSG_RESULT(no) ]
899)
900
901
dff54fed 902
ef0c727b
VK
903#--------------------------------------------------------------------
904# Checks for macros and definitions
905#--------------------------------------------------------------------
dff54fed 906
ef0c727b
VK
907AC_CHECK_DECLS([__bswap_32, __bswap_64, htonll, ntohll],,,[
908#ifdef HAVE_SYS_TYPES_H
99e50bb7 909#include <sys/types.h>
ef0c727b
VK
910#endif
911#if HAVE_BYTESWAP_H
912#include <byteswap.h>
913#endif
914#if HAVE_NETINET_IN_H
915#include <netinet/in.h>
916#endif
917#if HAVE_NET_NH_H
918#include <net/nh.h>
919#endif
920])
aa24418a
VK
921AC_CHECK_DECLS([RTLD_NOW, RTLD_GLOBAL],,,[
922#ifdef HAVE_UNISTD_H
923#include <unistd.h>
924#endif
925#ifdef HAVE_DLFCN_H
926#include <dlfcn.h>
927#endif
928])
dff54fed 929
dff54fed 930
ef0c727b
VK
931#--------------------------------------------------------------------
932# AIX specific checks
933#--------------------------------------------------------------------
d16cf8a5 934
ef0c727b
VK
935if test "x$PLATFORM" = "xAIX"; then
936 AC_CHECK_HEADERS([procinfo.h],,,[[ ]])
937 AC_CHECK_DECLS([getkerninfo])
938 AC_CHECK_FUNCS([getprocs64],,,[
939#if HAVE_PROCINFO_H
940#include <procinfo.h>
6cd41ceb 941#endif
ef0c727b 942 ])
7e56bf2e
VK
943fi
944
cd4c8ca3 945
aa24418a
VK
946#--------------------------------------------------------------------
947# *BSD specific checks
948#--------------------------------------------------------------------
949
950AC_CHECK_LIB(kvm, kvm_open)
951AC_CHECK_FUNCS([kvm_getswapinfo])
952AC_CHECK_TYPES([struct kinfo_proc2],,,[
953#if HAVE_SYS_SYSCTL_H
954#include <sys/sysctl.h>
955#endif
956])
957
958
8b86c5dc
VK
959#--------------------------------------------------------------------
960# Check for wxWidgets
961#--------------------------------------------------------------------
962
963if test "x$NEED_WXWIDGETS" = "xyes"; then
964 AC_PATH_PROGS([WXCONF], [wx-config wxgtk2-2.8-config], [no], [$PATH:/usr/local/bin])
965 if test "x$WXCONF" = "xno"; then
966 AC_MSG_ERROR([*** wxWidgets not installed - unable to build GUI components ***])
967 else
968 AC_PATH_PROGS([WXRC], [wxrc wxrc-gtk2-2.8], [no], [$PATH:/usr/local/bin])
969 if test "x$WXRC" = "xno"; then
970 AC_MSG_ERROR([*** wxWidgets resource compiler not found - unable to build GUI components ***])
971 else
972 NEED_UNICODE=`$WXCONF --selected-config | grep unicode | wc -l`
973 if test $NEED_UNICODE -eq 1; then
974 BUILD_UNICODE="yes"
273da39a 975 WX_UNICODE="yes"
8b86c5dc
VK
976 fi
977 CXXFLAGS="$CXXFLAGS `$WXCONF --cxxflags --debug=$ENABLE_DEBUG`"
978 LDFLAGS="$LDFLAGS `$WXCONF --libs --debug=$ENABLE_DEBUG`"
979 fi
980 fi
bfc410a1
VK
981 $WXCONF --cxxflags | grep error >/dev/null
982 if test $? = 0; then
983 echo "wx-config output:"
984 echo "*** BEGIN ***"
985 $WXCONF --cxxflags
986 echo "*** END ***"
987 AC_MSG_ERROR([*** wxWidgets is not configured properly - see wx-config output above ***])
988 fi
8b86c5dc
VK
989fi
990
991
ef0c727b
VK
992#--------------------------------------------------------------------
993# Check for UNICODE stuff
994#--------------------------------------------------------------------
3e39fcde 995
8b86c5dc 996AC_CHECK_HEADERS([wchar.h wctype.h iconv.h])
aa24418a 997AC_CHECK_TYPES([wchar_t, wint_t],,,[
6b93c954
VK
998#if HAVE_WCHAR_H
999#include <wchar.h>
1000#endif
1001])
3e39fcde 1002AC_CHECK_SIZEOF(wchar_t)
aa24418a
VK
1003AC_CHECK_FUNCS([wcslen wcsdup wcsncpy wcstoll wcstoull towupper wcserror wcserror_r])
1004AC_CHECK_FUNCS([wfopen wopen wstat wgetenv wrename wunlink])
dff54fed 1005
3265ba38 1006if test "x$DISABLE_ICONV" != "xyes"; then
75c30ed4 1007 AC_CHECK_LIB(iconv, libiconv_open,
dff54fed 1008 [ ac_found_iconv=yes
75c30ed4
VK
1009 LDFLAGS="$LDFLAGS -liconv"
1010 AC_CHECK_FUNCS(libiconv, ac_found_iconv=yes, ac_found_iconv=no)
1011 ],
1012 [
1013 AC_CHECK_LIB(iconv, iconv,
1014 [ ac_found_iconv=yes
1015 LDFLAGS="$LDFLAGS -liconv"
1016 ])
1017 AC_CHECK_FUNCS(iconv, ac_found_iconv=yes, ac_found_iconv=no)
1018 ])
dff54fed
VK
1019else
1020 ac_found_iconv=no
ef0c727b 1021 CPPFLAGS="$CPPFLAGS -D__DISABLE_ICONV"
dff54fed 1022fi
93571e7f
VK
1023
1024AC_MSG_CHECKING(whether iconv supports UCS-2-INTERNAL)
1025AC_RUN_IFELSE(
1026 [AC_LANG_PROGRAM([
1027#if HAVE_ICONV_H
1028#include <iconv.h>
1029#endif
1030 ], [
1031 return iconv_open("UTF-8","UCS-2-INTERNAL")==(iconv_t)(-1);
1032 ])
1033 ],
1034 [ AC_MSG_RESULT(yes)
1035 AC_DEFINE(HAVE_ICONV_UCS_2_INTERNAL, 1, Define to 1 if iconv supports UCS-2-INTERNAL)
1036 valid_ucs2_code="UCS-2-INTERNAL"
1037 ],
1038 [ AC_MSG_RESULT(no) ],
1039 [ AC_MSG_RESULT(no) ]
1040)
1041
1042AC_MSG_CHECKING(whether iconv supports UCS-2)
1043AC_RUN_IFELSE(
1044 [AC_LANG_PROGRAM([
1045#if HAVE_ICONV_H
1046#include <iconv.h>
1047#endif
1048 ], [
1049 return iconv_open("UTF-8","UCS-2")==(iconv_t)(-1);
1050 ])
1051 ],
1052 [ AC_MSG_RESULT(yes)
1053 AC_DEFINE(HAVE_ICONV_UCS_2, 1, Define to 1 if iconv supports UCS-2)
1054 valid_ucs2_code="UCS-2"
1055 ],
1056 [ AC_MSG_RESULT(no) ],
8b86c5dc 1057 [ AC_MSG_RESULT(no) ]
93571e7f
VK
1058)
1059
1060AC_MSG_CHECKING(whether iconv supports UCS2)
1061AC_RUN_IFELSE(
1062 [AC_LANG_PROGRAM([
1063#if HAVE_ICONV_H
1064#include <iconv.h>
1065#endif
1066 ], [
1067 return iconv_open("UTF-8","UCS2")==(iconv_t)(-1);
1068 ])
1069 ],
1070 [ AC_MSG_RESULT(yes)
1071 AC_DEFINE(HAVE_ICONV_UCS2, 1, Define to 1 if iconv supports UCS2)
1072 valid_ucs2_code="UCS2"
1073 ],
1074 [ AC_MSG_RESULT(no) ],
1075 [ AC_MSG_RESULT(no) ]
1076)
1077
44bccbbc
VK
1078AC_MSG_CHECKING(whether iconv supports UCS-2BE)
1079AC_RUN_IFELSE(
1080 [AC_LANG_PROGRAM([
1081#if HAVE_ICONV_H
1082#include <iconv.h>
1083#endif
1084 ], [
1085 return iconv_open("UTF-8","UCS-2BE")==(iconv_t)(-1);
1086 ])
1087 ],
1088 [ AC_MSG_RESULT(yes)
1089 AC_DEFINE(HAVE_ICONV_UCS_2BE, 1, Define to 1 if iconv supports UCS-2BE)
1090 valid_ucs2_code="UCS-2BE"
1091 ],
1092 [ AC_MSG_RESULT(no) ],
1093 [ AC_MSG_RESULT(no) ]
1094)
1095
6e17f325
VK
1096AC_MSG_CHECKING(whether iconv supports UCS-2LE)
1097AC_RUN_IFELSE(
1098 [AC_LANG_PROGRAM([
1099#if HAVE_ICONV_H
1100#include <iconv.h>
1101#endif
1102 ], [
1103 return iconv_open("UTF-8","UCS-2LE")==(iconv_t)(-1);
1104 ])
1105 ],
1106 [ AC_MSG_RESULT(yes)
1107 AC_DEFINE(HAVE_ICONV_UCS_2LE, 1, Define to 1 if iconv supports UCS-2LE)
1108 valid_ucs2_code="UCS-2LE"
1109 ],
1110 [ AC_MSG_RESULT(no) ],
1111 [ AC_MSG_RESULT(no) ]
1112)
1113
8b86c5dc
VK
1114AC_MSG_CHECKING(whether iconv supports UCS-4-INTERNAL)
1115AC_RUN_IFELSE(
1116 [AC_LANG_PROGRAM([
1117#if HAVE_ICONV_H
1118#include <iconv.h>
1119#endif
1120 ], [
1121 return iconv_open("UTF-8","UCS-4-INTERNAL")==(iconv_t)(-1);
1122 ])
1123 ],
1124 [ AC_MSG_RESULT(yes)
1125 AC_DEFINE(HAVE_ICONV_UCS_4_INTERNAL, 1, Define to 1 if iconv supports UCS-4-INTERNAL)
1126 valid_ucs4_code="UCS-4-INTERNAL"
1127 ],
1128 [ AC_MSG_RESULT(no) ],
1129 [ AC_MSG_RESULT(no) ]
1130)
1131
1132AC_MSG_CHECKING(whether iconv supports UCS-4)
1133AC_RUN_IFELSE(
1134 [AC_LANG_PROGRAM([
1135#if HAVE_ICONV_H
1136#include <iconv.h>
1137#endif
1138 ], [
1139 return iconv_open("UTF-8","UCS-4")==(iconv_t)(-1);
1140 ])
1141 ],
1142 [ AC_MSG_RESULT(yes)
1143 AC_DEFINE(HAVE_ICONV_UCS_4, 1, Define to 1 if iconv supports UCS-4)
1144 valid_ucs4_code="UCS-4"
1145 ],
1146 [ AC_MSG_RESULT(no) ],
1147 [ AC_MSG_RESULT(no) ]
1148)
1149
1150AC_MSG_CHECKING(whether iconv supports UCS4)
1151AC_RUN_IFELSE(
1152 [AC_LANG_PROGRAM([
1153#if HAVE_ICONV_H
1154#include <iconv.h>
1155#endif
1156 ], [
1157 return iconv_open("UTF-8","UCS4")==(iconv_t)(-1);
1158 ])
1159 ],
1160 [ AC_MSG_RESULT(yes)
1161 AC_DEFINE(HAVE_ICONV_UCS4, 1, Define to 1 if iconv supports UCS4)
1162 valid_ucs4_code="UCS4"
1163 ],
1164 [ AC_MSG_RESULT(no) ],
1165 [ AC_MSG_RESULT(no) ]
1166)
1167
1168AC_MSG_CHECKING(whether iconv supports UCS-4BE)
1169AC_RUN_IFELSE(
1170 [AC_LANG_PROGRAM([
1171#if HAVE_ICONV_H
1172#include <iconv.h>
1173#endif
1174 ], [
1175 return iconv_open("UTF-8","UCS-4BE")==(iconv_t)(-1);
1176 ])
1177 ],
1178 [ AC_MSG_RESULT(yes)
1179 AC_DEFINE(HAVE_ICONV_UCS_4BE, 1, Define to 1 if iconv supports UCS-4BE)
1180 valid_ucs4_code="UCS-4BE"
1181 ],
1182 [ AC_MSG_RESULT(no) ],
1183 [ AC_MSG_RESULT(no) ]
1184)
1185
6e17f325
VK
1186AC_MSG_CHECKING(whether iconv supports UCS-4LE)
1187AC_RUN_IFELSE(
1188 [AC_LANG_PROGRAM([
1189#if HAVE_ICONV_H
1190#include <iconv.h>
1191#endif
1192 ], [
1193 return iconv_open("UTF-8","UCS-4LE")==(iconv_t)(-1);
1194 ])
1195 ],
1196 [ AC_MSG_RESULT(yes)
1197 AC_DEFINE(HAVE_ICONV_UCS_4LE, 1, Define to 1 if iconv supports UCS-4LE)
1198 valid_ucs4_code="UCS-4LE"
1199 ],
1200 [ AC_MSG_RESULT(no) ],
1201 [ AC_MSG_RESULT(no) ]
1202)
1203
5e40a69e
VK
1204AC_MSG_CHECKING(whether iconv supports ISO8859-1)
1205AC_RUN_IFELSE(
1206 [AC_LANG_PROGRAM([
1207#if HAVE_ICONV_H
1208#include <iconv.h>
1209#endif
1210 ], [
1211 return iconv_open("UTF-8","ISO8859-1")==(iconv_t)(-1);
1212 ])
1213 ],
1214 [ AC_MSG_RESULT(yes)
1215 AC_DEFINE(HAVE_ICONV_ISO8859_1, 1, Define to 1 if iconv supports ISO8859-1)
1216 ],
1217 [ AC_MSG_RESULT(no) ],
1218 [ AC_MSG_RESULT(no) ]
1219)
1220
1221AC_MSG_CHECKING(whether iconv supports ISO-8859-1)
1222AC_RUN_IFELSE(
1223 [AC_LANG_PROGRAM([
1224#if HAVE_ICONV_H
1225#include <iconv.h>
1226#endif
1227 ], [
1228 return iconv_open("UTF-8","ISO-8859-1")==(iconv_t)(-1);
1229 ])
1230 ],
1231 [ AC_MSG_RESULT(yes)
1232 AC_DEFINE(HAVE_ICONV_ISO_8859_1, 1, Define to 1 if iconv supports ISO-8859-1)
1233 ],
1234 [ AC_MSG_RESULT(no) ],
1235 [ AC_MSG_RESULT(no) ]
1236)
1237
1238AC_MSG_CHECKING(whether iconv supports ASCII)
1239AC_RUN_IFELSE(
1240 [AC_LANG_PROGRAM([
1241#if HAVE_ICONV_H
1242#include <iconv.h>
1243#endif
1244 ], [
1245 return iconv_open("UTF-8","ASCII")==(iconv_t)(-1);
1246 ])
1247 ],
1248 [ AC_MSG_RESULT(yes)
1249 AC_DEFINE(HAVE_ICONV_ASCII, 1, Define to 1 if iconv supports ASCII)
1250 ],
1251 [ AC_MSG_RESULT(no) ],
1252 [ AC_MSG_RESULT(no) ]
1253)
1254
93571e7f
VK
1255AC_MSG_CHECKING(whether iconv supports //IGNORE)
1256AC_RUN_IFELSE(
1257 [AC_LANG_PROGRAM([
1258#if HAVE_ICONV_H
1259#include <iconv.h>
1260#endif
1261 ], [
1262 return iconv_open("UTF-8//IGNORE","$valid_ucs2_code")==(iconv_t)(-1);
1263 ])
1264 ],
1265 [ AC_MSG_RESULT(yes)
1266 AC_DEFINE(HAVE_ICONV_IGNORE, 1, Define to 1 if iconv supports //IGNORE option)
1267 ],
1268 [ AC_MSG_RESULT(no) ],
1269 [ AC_MSG_RESULT(no) ]
1270)
3e39fcde 1271
19619a35
AK
1272# taken from ZSH's configure
1273# Check if iconv uses const in prototype declaration
24b1570c 1274if test "x$ac_found_iconv" = "xyes"; then
19619a35
AK
1275 AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
1276 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
1277 #include <iconv.h>]],
1278 [[#ifdef __cplusplus
1279 "C"
1280 #endif
1281 #if defined(__STDC__) || defined(__cplusplus)
1282 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1283 #else
1284 size_t iconv();
1285 #endif]])],
1286 [ac_cv_iconv_const=],
1287 [ac_cv_iconv_const=const])])
1288 AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
1289 [Define as const if the declaration of iconv() needs const.])
1290fi
1291
93571e7f 1292if test $ac_cv_sizeof_wchar_t -eq 2; then
8b86c5dc
VK
1293 AC_DEFINE(UNICODE_UCS2, 1, Define to 1 if you have 2-byte wchar_t)
1294fi
1295
1296if test $ac_cv_sizeof_wchar_t -eq 4; then
1297 AC_DEFINE(UNICODE_UCS4, 1, Define to 1 if you have 4-byte wchar_t)
1298fi
1299
c29360a9 1300
ca0f4ea3
VK
1301#--------------------------------------------------------------------
1302# MySQL
1303#--------------------------------------------------------------------
1304
1305check_substr "$COMPONENTS" "mysql"
1306if test $? = 0; then
9c29f76e 1307 AC_CHECK_LIB(mysqlclient, mysql_init, [],
ca0f4ea3 1308 [AC_MSG_ERROR(libmysqlclient is requred for MySQL support)])
9c29f76e
VK
1309 AC_MSG_CHECKING(whether mysql clients can run)
1310 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1311#include <stdio.h>
1312#include <mysql.h>
1313int main(void)
1314{
1315 MYSQL *a = mysql_init(NULL);
1316 return 0;
1317}
1318 ]])],[],[
1319 AC_MSG_RESULT(no)
1320 AC_MSG_ERROR(Your MySQL client libraries aren't properly installed)
1321 ],[])
ca0f4ea3
VK
1322 AC_MSG_RESULT(yes)
1323 AC_CHECK_FUNCS(mysql_real_escape_string)
1324fi
1325
1326
58ed4897
VK
1327#--------------------------------------------------------------------
1328# PostgreSQL
1329#--------------------------------------------------------------------
1330
203458b7 1331check_substr "$COMPONENTS" "pgsql"
58ed4897
VK
1332if test $? = 0; then
1333 AC_CHECK_LIB(m, floor)
1334 AC_CHECK_LIB(pq, PQconnectdb, ,
1335 [AC_MSG_ERROR(libpq is required for PostgreSQL support)])
1336 AC_MSG_CHECKING(whether postgresql clients can run)
1337 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1338 #include <stdio.h>
1339 #include <libpq-fe.h>
1340 int main(void)
1341 {
1342 PGconn *a = PQconnectdb("");
1343 return 0;
1344 }
1345 ]])],[],[
1346 AC_MSG_RESULT(no)
1347 AC_MSG_ERROR(Your PostgreSQL client libraries aren't properly installed)
1348 ],[])
1349 AC_MSG_RESULT(yes)
7070538d 1350 AC_CHECK_LIB(pq, PQfformat, [ AC_DEFINE(HAVE_PQFFORMAT, 1, PQfformat not exist in 7.3) ])
58ed4897
VK
1351fi
1352
1353
9c29f76e
VK
1354#--------------------------------------------------------------------
1355# ODBC
1356#--------------------------------------------------------------------
1357
1358check_substr "$COMPONENTS" "odbc"
1359if test $? = 0; then
1360 AC_CHECK_LIB(odbc, SQLAllocHandle, [],
1361 [AC_MSG_ERROR(libodbc is required for ODBC support)])
1362fi
1363
1364
41b4790d
VK
1365#--------------------------------------------------------------------
1366# Oracle
1367#--------------------------------------------------------------------
1368
1369check_substr "$COMPONENTS" "oracle"
1370if test $? = 0; then
1371 AC_CHECK_HEADER(oci.h,,AC_MSG_ERROR([*** Cannot find oci.h - check your Oracle client installation ***]))
1372 AC_CHECK_LIB(clntsh, OCIHandleAlloc, [],
1373 [AC_MSG_ERROR(libclntsh is required for Oracle support)])
1374fi
1375
1376
c3cfc039
VK
1377#--------------------------------------------------------------------
1378# nxhttpd
1379#--------------------------------------------------------------------
1380
1381check_substr "$COMPONENTS" "nxhttpd"
1382if test $? = 0; then
1383 AC_CHECK_HEADER(gd.h,,AC_MSG_ERROR([*** GD support not installed - please install first ***]))
1384 AC_CHECK_LIB(gd, gdImageCreate, [], [
1385 AC_MSG_ERROR(libgd is required for web interface)
1386 ])
1387
1388fi
1389
1390
ca0f4ea3
VK
1391#--------------------------------------------------------------------
1392# Other settings
1393#--------------------------------------------------------------------
1394
273da39a 1395CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DPREFIX=\\\"\${prefix}\\\" -DPREFIXW=L\\\"\${prefix}\\\" -DDATADIR=\\\"\${pkgdatadir}\\\" -DLIBDIR=\\\"\${libdir}\\\""
ca0f4ea3 1396
8b86c5dc
VK
1397AM_CONDITIONAL([BUILD_UNICODE_LIBS], [test "x$BUILD_UNICODE" = "xyes"])
1398
ca0f4ea3 1399
ef0c727b
VK
1400#--------------------------------------------------------------------
1401# Substitute variables
1402#--------------------------------------------------------------------
82fa7c5d 1403
ef0c727b
VK
1404AC_SUBST(DB_DRIVERS)
1405AC_SUBST(MODULES)
1406AC_SUBST(SUBAGENT_DIRS)
1407AC_SUBST(SERVER_TOOLS)
1408AC_SUBST(TOP_LEVEL_MODULES)
1409AC_SUBST(CONTRIB_MODULES)
c2612d83 1410AC_SUBST(CLIENT_COMPONENTS)
ef0c727b
VK
1411AC_SUBST(STATIC_SUBAGENT_LIST)
1412AC_SUBST(SUBAGENT_LIBS)
1413AC_SUBST(BUILD_SERVER)
1414AC_SUBST(UNSTABLE_SUBAGENT_DIRS)
db91456f 1415AC_SUBST(WXRC)
d16cf8a5 1416
ef0c727b
VK
1417#--------------------------------------------------------------------
1418# Shared libs versions
d16cf8a5
AK
1419#
1420# versioning scheme: current:revision:age
1421#
1422# current
1423# The number of the current interface exported by the library. A current
1424# value of `0', means that you are calling the interface exported by this
1425# library interface 0.
1426#
1427# revision
1428# The implementation number of the most recent interface exported by this
1429# library. In this case, a revision value of `0' means that this is the
1430# first implementation of the interface.
1431# If the next release of this library exports the same interface, but has a
1432# different implementation (perhaps some bugs have been fixed), the revision
1433# number will be higher, but current number will be the same. In that case,
1434# when given a choice, the library with the highest revision will always
1435# be used by the runtime loader.
1436#
1437# age
1438# The number of previous additional interfaces supported by this library.
1439# If age were `2', then this library can be linked into executables which
1440# were built with a release of this library that exported the current
1441# interface number, current, or any of the previous two interfaces.
1442# By definition age must be less than or equal to current. At the outset,
1443# only the first ever interface is implemented, so age can only be `0'.
ef0c727b 1444#--------------------------------------------------------------------
d16cf8a5 1445
8c5adf3a 1446NETXMS_LIBRARY_VERSION=0:2:0
c7d14846 1447AC_SUBST(NETXMS_LIBRARY_VERSION)
d16cf8a5 1448
ef0c727b
VK
1449
1450#--------------------------------------------------------------------
1451# Generate output files
1452#--------------------------------------------------------------------
d16cf8a5
AK
1453
1454AC_CONFIG_FILES([
ef0c727b 1455 README
0c3c0c39
AK
1456 Makefile
1457 contrib/Makefile
0c3c0c39 1458 contrib/startup/Makefile
daaefaaf 1459 contrib/startup/gentoo/Makefile
0c3c0c39 1460 contrib/startup/redhat/Makefile
5de3893d 1461 contrib/startup/suse/Makefile
9993edf4 1462 contrib/startup/ubuntu/Makefile
82fa7c5d 1463 contrib/mibs/Makefile
3f2f9f2b 1464 contrib/backgrounds/Makefile
0c3c0c39 1465 doc/Makefile
a48203d2
VK
1466 doc/internal/Makefile
1467 doc/manuals/Makefile
1468 doc/misc/Makefile
0c3c0c39
AK
1469 images/Makefile
1470 include/Makefile
1471 m4/Makefile
1472 netware/Makefile
1473 sql/Makefile
0c3c0c39 1474 src/Makefile
8817f620 1475 src/sqlite/Makefile
80ce37ac
VK
1476 src/libexpat/Makefile
1477 src/libexpat/libexpat/Makefile
0c3c0c39 1478 src/libnetxms/Makefile
0c3c0c39 1479 src/libnxcl/Makefile
aa8d6795 1480 src/libnxlp/Makefile
c002b04a 1481 src/libnxsl/Makefile
1d410d50 1482 src/libnxmap/Makefile
1b1edd49
VK
1483 src/install/Makefile
1484 src/install/windows/Makefile
c2612d83 1485 src/client/Makefile
551592f4 1486 src/client/install/Makefile
c94fa5c2 1487 src/client/nxalarm/Makefile
e84701c5
VK
1488 src/client/nxevent/Makefile
1489 src/client/nxpush/Makefile
59ffa5b7 1490 src/client/nxsms/Makefile
23c8c53e
AK
1491 src/client/windows/nxuilib/Makefile
1492 src/client/windows/nxuilib/res/Makefile
1493 src/client/windows/nxuilib/sounds/Makefile
d9db1c72 1494 src/client/nxlexer/Makefile
23c8c53e
AK
1495 src/client/windows/nxcon/Makefile
1496 src/client/windows/nxcon/icons/Makefile
1497 src/client/windows/nxcon/res/Makefile
23c8c53e
AK
1498 src/client/windows/nxav/Makefile
1499 src/client/windows/nxav/res/Makefile
1500 src/client/windows/nxnotify/Makefile
1501 src/client/windows/nxnotify/res/Makefile
b6e8dffe 1502 src/nxcptest/Makefile
f519aa3e 1503 src/nxscript/Makefile
0c3c0c39
AK
1504 src/server/Makefile
1505 src/server/core/Makefile
a551fe4d 1506 src/server/netxmsd/Makefile
0c3c0c39
AK
1507 src/server/dbdrv/Makefile
1508 src/server/dbdrv/odbc/Makefile
1509 src/server/dbdrv/mssql/Makefile
1510 src/server/dbdrv/mysql/Makefile
1511 src/server/dbdrv/pgsql/Makefile
9486b324 1512 src/server/dbdrv/sqlite/Makefile
5de3893d 1513 src/server/dbdrv/oracle/Makefile
d8f2e39b
VK
1514 src/server/smsdrv/Makefile
1515 src/server/smsdrv/generic/Makefile
91369aca 1516 src/server/smsdrv/nxagent/Makefile
0c3c0c39
AK
1517 src/server/tools/Makefile
1518 src/server/tools/nxget/Makefile
1519 src/server/tools/nxaction/Makefile
1520 src/server/tools/nxadm/Makefile
5b0c7d0d
VK
1521 src/server/tools/nxconfig/Makefile
1522 src/server/tools/nxconfig/res/Makefile
f90d7fc5 1523 src/server/tools/nxdbmgr/Makefile
d24fdaf4 1524 src/server/tools/nxupload/Makefile
0c3c0c39 1525 src/server/libnxsrv/Makefile
c5c0f362
VK
1526 src/snmp/Makefile
1527 src/snmp/libnxsnmp/Makefile
1528 src/snmp/nxmibc/Makefile
1529 src/snmp/nxsnmpget/Makefile
1530 src/snmp/nxsnmpset/Makefile
1531 src/snmp/nxsnmpwalk/Makefile
0c3c0c39
AK
1532 src/agent/Makefile
1533 src/agent/core/Makefile
5795bf90 1534 src/agent/install/Makefile
0c3c0c39
AK
1535 src/agent/subagents/Makefile
1536 src/agent/subagents/linux/Makefile
1537 src/agent/subagents/sunos/Makefile
d0b5a098 1538 src/agent/subagents/aix/Makefile
9bdf494f 1539 src/agent/subagents/hpux/Makefile
0c3c0c39
AK
1540 src/agent/subagents/skeleton/Makefile
1541 src/agent/subagents/freebsd/Makefile
992ba479 1542 src/agent/subagents/openbsd/Makefile
ad0f1ada 1543 src/agent/subagents/netbsd/Makefile
2b23dc1e 1544 src/agent/subagents/ipso/Makefile
0c3c0c39 1545 src/agent/subagents/netware/Makefile
1bc607cc
VK
1546 src/agent/subagents/winnt/Makefile
1547 src/agent/subagents/win9x/Makefile
0c3c0c39 1548 src/agent/subagents/winperf/Makefile
3737b4b9 1549 src/agent/subagents/wmi/Makefile
93f15c2a 1550 src/agent/subagents/portCheck/Makefile
abc48356 1551 src/agent/subagents/ping/Makefile
dbca7ed1 1552 src/agent/subagents/sms/Makefile
2f06a66e 1553 src/agent/subagents/ups/Makefile
539ab0c3
AK
1554 src/agent/subagents/ecs/Makefile
1555 src/agent/subagents/odbcquery/Makefile
0d362f93 1556 src/agent/subagents/logwatch/Makefile
420d9ecf
AK
1557 src/webui/nxhttpd/Makefile
1558 src/webui/nxhttpd/static/Makefile
1559 src/webui/nxhttpd/static/images/Makefile
1560 src/webui/nxhttpd/static/images/buttons/Makefile
1561 src/webui/nxhttpd/static/images/buttons/normal/Makefile
1562 src/webui/nxhttpd/static/images/buttons/pressed/Makefile
1563 src/webui/nxhttpd/static/images/ctrlpanel/Makefile
1564 src/webui/nxhttpd/static/images/objects/Makefile
1565 src/webui/nxhttpd/static/images/status/Makefile
0c3c0c39 1566 tools/Makefile
d16cf8a5
AK
1567])
1568
12249937
VK
1569AC_OUTPUT
1570
ef0c727b 1571echo "Updating libtool"
5cecf50e
AK
1572sed 's,$SED -e "/${host}-//g",$SED -e "s/${host}-//g",g' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
1573
779ce551
VK
1574# On HP-UX, libtool passes +b instead of -Wl,+b even if gcc/g++ used as linker
1575if test "x$CC" = "xgcc" && test "x$PLATFORM" = "xHP-UX"; then
1576 sed "s,hardcode_libdir_flag_spec_ld=,#hardcode_libdir_flag_spec_ld=,g" < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
1577fi
1578
ef0c727b
VK
1579#--------------------------------------------------------------------
1580# Print summary
1581#--------------------------------------------------------------------
a7442678 1582
a7442678
AK
1583echo
1584echo
1585echo
1586echo '---------------------------------------------------------------------'
1587echo ' Configure results'
1588echo '---------------------------------------------------------------------'
1589echo
8b86c5dc 1590 echo "Prefix : ${prefix}"
a7442678 1591if test "x${BUILD_SERVER}" = "xyes"; then
8b86c5dc 1592 echo "Build Server : YES"
a7442678 1593else
8b86c5dc 1594 echo "Build Server : NO"
a7442678
AK
1595fi
1596if test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"; then
8b86c5dc 1597 echo "Encryption enabled : YES"
a7442678 1598else
8b86c5dc 1599 echo "Encryption enabled : NO"
a7442678
AK
1600fi
1601if test "x${DB_DRIVERS}" != "x"; then
8b86c5dc 1602 echo "Build DB-Drivers :${DB_DRIVERS}"
a7442678 1603else
8b86c5dc 1604 echo "Build DB-Drivers : NO"
a7442678
AK
1605fi
1606if test "x${BUILD_CLIENT}" = "xyes"; then
8b86c5dc 1607 echo "Build Clients : YES"
a7442678 1608else
8b86c5dc 1609 echo "Build Clients : NO"
a7442678 1610fi
ef0c727b 1611if test "x${BUILD_NXHTTPD}" = "xyes"; then
8b86c5dc 1612 echo "Build Web Interface : YES"
2654e540 1613else
8b86c5dc 1614 echo "Build Web Interface : NO"
2654e540 1615fi
a7442678 1616if test "x${BUILD_AGENT}" = "xyes"; then
8b86c5dc
VK
1617 echo "Build Agent : YES"
1618 echo "Subagents list : ${SUBAGENT_DIRS}"
a7442678 1619else
8b86c5dc 1620 echo "Build Agent : NO"
a7442678 1621fi
e8636669 1622if test "x${BUILD_STATIC_AGENT}" = "xyes"; then
8b86c5dc
VK
1623 echo "Build Static Agent : YES"
1624 echo "Subagents list : ${STATIC_SUBAGENT_LIST}"
e8636669 1625else
8b86c5dc 1626 echo "Build Static Agent : NO"
e8636669 1627fi
8b86c5dc
VK
1628if test "x${BUILD_UNICODE}" = "xyes"; then
1629 echo "Build UNICODE libraries : YES"
1630else
1631 echo "Build UNICODE libraries : NO"
1632fi
1bb6b449
VK
1633if test "x${HAVE_LIBEXPAT}" = "xyes"; then
1634 echo "XML support in NXCP : YES"
1635else
1636 echo "XML support in NXCP : NO"
1637fi