fixed various bugs in log api (backported from stronghold project)
[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
dff54fed 881
ef0c727b
VK
882#--------------------------------------------------------------------
883# Checks for macros and definitions
884#--------------------------------------------------------------------
dff54fed 885
ef0c727b
VK
886AC_CHECK_DECLS([__bswap_32, __bswap_64, htonll, ntohll],,,[
887#ifdef HAVE_SYS_TYPES_H
99e50bb7 888#include <sys/types.h>
ef0c727b
VK
889#endif
890#if HAVE_BYTESWAP_H
891#include <byteswap.h>
892#endif
893#if HAVE_NETINET_IN_H
894#include <netinet/in.h>
895#endif
896#if HAVE_NET_NH_H
897#include <net/nh.h>
898#endif
899])
aa24418a
VK
900AC_CHECK_DECLS([RTLD_NOW, RTLD_GLOBAL],,,[
901#ifdef HAVE_UNISTD_H
902#include <unistd.h>
903#endif
904#ifdef HAVE_DLFCN_H
905#include <dlfcn.h>
906#endif
907])
dff54fed 908
dff54fed 909
ef0c727b
VK
910#--------------------------------------------------------------------
911# AIX specific checks
912#--------------------------------------------------------------------
d16cf8a5 913
ef0c727b
VK
914if test "x$PLATFORM" = "xAIX"; then
915 AC_CHECK_HEADERS([procinfo.h],,,[[ ]])
916 AC_CHECK_DECLS([getkerninfo])
917 AC_CHECK_FUNCS([getprocs64],,,[
918#if HAVE_PROCINFO_H
919#include <procinfo.h>
6cd41ceb 920#endif
ef0c727b 921 ])
7e56bf2e
VK
922fi
923
cd4c8ca3 924
aa24418a
VK
925#--------------------------------------------------------------------
926# *BSD specific checks
927#--------------------------------------------------------------------
928
929AC_CHECK_LIB(kvm, kvm_open)
930AC_CHECK_FUNCS([kvm_getswapinfo])
931AC_CHECK_TYPES([struct kinfo_proc2],,,[
932#if HAVE_SYS_SYSCTL_H
933#include <sys/sysctl.h>
934#endif
935])
936
937
8b86c5dc
VK
938#--------------------------------------------------------------------
939# Check for wxWidgets
940#--------------------------------------------------------------------
941
942if test "x$NEED_WXWIDGETS" = "xyes"; then
943 AC_PATH_PROGS([WXCONF], [wx-config wxgtk2-2.8-config], [no], [$PATH:/usr/local/bin])
944 if test "x$WXCONF" = "xno"; then
945 AC_MSG_ERROR([*** wxWidgets not installed - unable to build GUI components ***])
946 else
947 AC_PATH_PROGS([WXRC], [wxrc wxrc-gtk2-2.8], [no], [$PATH:/usr/local/bin])
948 if test "x$WXRC" = "xno"; then
949 AC_MSG_ERROR([*** wxWidgets resource compiler not found - unable to build GUI components ***])
950 else
951 NEED_UNICODE=`$WXCONF --selected-config | grep unicode | wc -l`
952 if test $NEED_UNICODE -eq 1; then
953 BUILD_UNICODE="yes"
273da39a 954 WX_UNICODE="yes"
8b86c5dc
VK
955 fi
956 CXXFLAGS="$CXXFLAGS `$WXCONF --cxxflags --debug=$ENABLE_DEBUG`"
957 LDFLAGS="$LDFLAGS `$WXCONF --libs --debug=$ENABLE_DEBUG`"
958 fi
959 fi
bfc410a1
VK
960 $WXCONF --cxxflags | grep error >/dev/null
961 if test $? = 0; then
962 echo "wx-config output:"
963 echo "*** BEGIN ***"
964 $WXCONF --cxxflags
965 echo "*** END ***"
966 AC_MSG_ERROR([*** wxWidgets is not configured properly - see wx-config output above ***])
967 fi
8b86c5dc
VK
968fi
969
970
ef0c727b
VK
971#--------------------------------------------------------------------
972# Check for UNICODE stuff
973#--------------------------------------------------------------------
3e39fcde 974
8b86c5dc 975AC_CHECK_HEADERS([wchar.h wctype.h iconv.h])
aa24418a 976AC_CHECK_TYPES([wchar_t, wint_t],,,[
6b93c954
VK
977#if HAVE_WCHAR_H
978#include <wchar.h>
979#endif
980])
3e39fcde 981AC_CHECK_SIZEOF(wchar_t)
aa24418a
VK
982AC_CHECK_FUNCS([wcslen wcsdup wcsncpy wcstoll wcstoull towupper wcserror wcserror_r])
983AC_CHECK_FUNCS([wfopen wopen wstat wgetenv wrename wunlink])
dff54fed 984
3265ba38 985if test "x$DISABLE_ICONV" != "xyes"; then
75c30ed4 986 AC_CHECK_LIB(iconv, libiconv_open,
dff54fed 987 [ ac_found_iconv=yes
75c30ed4
VK
988 LDFLAGS="$LDFLAGS -liconv"
989 AC_CHECK_FUNCS(libiconv, ac_found_iconv=yes, ac_found_iconv=no)
990 ],
991 [
992 AC_CHECK_LIB(iconv, iconv,
993 [ ac_found_iconv=yes
994 LDFLAGS="$LDFLAGS -liconv"
995 ])
996 AC_CHECK_FUNCS(iconv, ac_found_iconv=yes, ac_found_iconv=no)
997 ])
dff54fed
VK
998else
999 ac_found_iconv=no
ef0c727b 1000 CPPFLAGS="$CPPFLAGS -D__DISABLE_ICONV"
dff54fed 1001fi
93571e7f
VK
1002
1003AC_MSG_CHECKING(whether iconv supports UCS-2-INTERNAL)
1004AC_RUN_IFELSE(
1005 [AC_LANG_PROGRAM([
1006#if HAVE_ICONV_H
1007#include <iconv.h>
1008#endif
1009 ], [
1010 return iconv_open("UTF-8","UCS-2-INTERNAL")==(iconv_t)(-1);
1011 ])
1012 ],
1013 [ AC_MSG_RESULT(yes)
1014 AC_DEFINE(HAVE_ICONV_UCS_2_INTERNAL, 1, Define to 1 if iconv supports UCS-2-INTERNAL)
1015 valid_ucs2_code="UCS-2-INTERNAL"
1016 ],
1017 [ AC_MSG_RESULT(no) ],
1018 [ AC_MSG_RESULT(no) ]
1019)
1020
1021AC_MSG_CHECKING(whether iconv supports UCS-2)
1022AC_RUN_IFELSE(
1023 [AC_LANG_PROGRAM([
1024#if HAVE_ICONV_H
1025#include <iconv.h>
1026#endif
1027 ], [
1028 return iconv_open("UTF-8","UCS-2")==(iconv_t)(-1);
1029 ])
1030 ],
1031 [ AC_MSG_RESULT(yes)
1032 AC_DEFINE(HAVE_ICONV_UCS_2, 1, Define to 1 if iconv supports UCS-2)
1033 valid_ucs2_code="UCS-2"
1034 ],
1035 [ AC_MSG_RESULT(no) ],
8b86c5dc 1036 [ AC_MSG_RESULT(no) ]
93571e7f
VK
1037)
1038
1039AC_MSG_CHECKING(whether iconv supports UCS2)
1040AC_RUN_IFELSE(
1041 [AC_LANG_PROGRAM([
1042#if HAVE_ICONV_H
1043#include <iconv.h>
1044#endif
1045 ], [
1046 return iconv_open("UTF-8","UCS2")==(iconv_t)(-1);
1047 ])
1048 ],
1049 [ AC_MSG_RESULT(yes)
1050 AC_DEFINE(HAVE_ICONV_UCS2, 1, Define to 1 if iconv supports UCS2)
1051 valid_ucs2_code="UCS2"
1052 ],
1053 [ AC_MSG_RESULT(no) ],
1054 [ AC_MSG_RESULT(no) ]
1055)
1056
44bccbbc
VK
1057AC_MSG_CHECKING(whether iconv supports UCS-2BE)
1058AC_RUN_IFELSE(
1059 [AC_LANG_PROGRAM([
1060#if HAVE_ICONV_H
1061#include <iconv.h>
1062#endif
1063 ], [
1064 return iconv_open("UTF-8","UCS-2BE")==(iconv_t)(-1);
1065 ])
1066 ],
1067 [ AC_MSG_RESULT(yes)
1068 AC_DEFINE(HAVE_ICONV_UCS_2BE, 1, Define to 1 if iconv supports UCS-2BE)
1069 valid_ucs2_code="UCS-2BE"
1070 ],
1071 [ AC_MSG_RESULT(no) ],
1072 [ AC_MSG_RESULT(no) ]
1073)
1074
6e17f325
VK
1075AC_MSG_CHECKING(whether iconv supports UCS-2LE)
1076AC_RUN_IFELSE(
1077 [AC_LANG_PROGRAM([
1078#if HAVE_ICONV_H
1079#include <iconv.h>
1080#endif
1081 ], [
1082 return iconv_open("UTF-8","UCS-2LE")==(iconv_t)(-1);
1083 ])
1084 ],
1085 [ AC_MSG_RESULT(yes)
1086 AC_DEFINE(HAVE_ICONV_UCS_2LE, 1, Define to 1 if iconv supports UCS-2LE)
1087 valid_ucs2_code="UCS-2LE"
1088 ],
1089 [ AC_MSG_RESULT(no) ],
1090 [ AC_MSG_RESULT(no) ]
1091)
1092
8b86c5dc
VK
1093AC_MSG_CHECKING(whether iconv supports UCS-4-INTERNAL)
1094AC_RUN_IFELSE(
1095 [AC_LANG_PROGRAM([
1096#if HAVE_ICONV_H
1097#include <iconv.h>
1098#endif
1099 ], [
1100 return iconv_open("UTF-8","UCS-4-INTERNAL")==(iconv_t)(-1);
1101 ])
1102 ],
1103 [ AC_MSG_RESULT(yes)
1104 AC_DEFINE(HAVE_ICONV_UCS_4_INTERNAL, 1, Define to 1 if iconv supports UCS-4-INTERNAL)
1105 valid_ucs4_code="UCS-4-INTERNAL"
1106 ],
1107 [ AC_MSG_RESULT(no) ],
1108 [ AC_MSG_RESULT(no) ]
1109)
1110
1111AC_MSG_CHECKING(whether iconv supports UCS-4)
1112AC_RUN_IFELSE(
1113 [AC_LANG_PROGRAM([
1114#if HAVE_ICONV_H
1115#include <iconv.h>
1116#endif
1117 ], [
1118 return iconv_open("UTF-8","UCS-4")==(iconv_t)(-1);
1119 ])
1120 ],
1121 [ AC_MSG_RESULT(yes)
1122 AC_DEFINE(HAVE_ICONV_UCS_4, 1, Define to 1 if iconv supports UCS-4)
1123 valid_ucs4_code="UCS-4"
1124 ],
1125 [ AC_MSG_RESULT(no) ],
1126 [ AC_MSG_RESULT(no) ]
1127)
1128
1129AC_MSG_CHECKING(whether iconv supports UCS4)
1130AC_RUN_IFELSE(
1131 [AC_LANG_PROGRAM([
1132#if HAVE_ICONV_H
1133#include <iconv.h>
1134#endif
1135 ], [
1136 return iconv_open("UTF-8","UCS4")==(iconv_t)(-1);
1137 ])
1138 ],
1139 [ AC_MSG_RESULT(yes)
1140 AC_DEFINE(HAVE_ICONV_UCS4, 1, Define to 1 if iconv supports UCS4)
1141 valid_ucs4_code="UCS4"
1142 ],
1143 [ AC_MSG_RESULT(no) ],
1144 [ AC_MSG_RESULT(no) ]
1145)
1146
1147AC_MSG_CHECKING(whether iconv supports UCS-4BE)
1148AC_RUN_IFELSE(
1149 [AC_LANG_PROGRAM([
1150#if HAVE_ICONV_H
1151#include <iconv.h>
1152#endif
1153 ], [
1154 return iconv_open("UTF-8","UCS-4BE")==(iconv_t)(-1);
1155 ])
1156 ],
1157 [ AC_MSG_RESULT(yes)
1158 AC_DEFINE(HAVE_ICONV_UCS_4BE, 1, Define to 1 if iconv supports UCS-4BE)
1159 valid_ucs4_code="UCS-4BE"
1160 ],
1161 [ AC_MSG_RESULT(no) ],
1162 [ AC_MSG_RESULT(no) ]
1163)
1164
6e17f325
VK
1165AC_MSG_CHECKING(whether iconv supports UCS-4LE)
1166AC_RUN_IFELSE(
1167 [AC_LANG_PROGRAM([
1168#if HAVE_ICONV_H
1169#include <iconv.h>
1170#endif
1171 ], [
1172 return iconv_open("UTF-8","UCS-4LE")==(iconv_t)(-1);
1173 ])
1174 ],
1175 [ AC_MSG_RESULT(yes)
1176 AC_DEFINE(HAVE_ICONV_UCS_4LE, 1, Define to 1 if iconv supports UCS-4LE)
1177 valid_ucs4_code="UCS-4LE"
1178 ],
1179 [ AC_MSG_RESULT(no) ],
1180 [ AC_MSG_RESULT(no) ]
1181)
1182
5e40a69e
VK
1183AC_MSG_CHECKING(whether iconv supports ISO8859-1)
1184AC_RUN_IFELSE(
1185 [AC_LANG_PROGRAM([
1186#if HAVE_ICONV_H
1187#include <iconv.h>
1188#endif
1189 ], [
1190 return iconv_open("UTF-8","ISO8859-1")==(iconv_t)(-1);
1191 ])
1192 ],
1193 [ AC_MSG_RESULT(yes)
1194 AC_DEFINE(HAVE_ICONV_ISO8859_1, 1, Define to 1 if iconv supports ISO8859-1)
1195 ],
1196 [ AC_MSG_RESULT(no) ],
1197 [ AC_MSG_RESULT(no) ]
1198)
1199
1200AC_MSG_CHECKING(whether iconv supports ISO-8859-1)
1201AC_RUN_IFELSE(
1202 [AC_LANG_PROGRAM([
1203#if HAVE_ICONV_H
1204#include <iconv.h>
1205#endif
1206 ], [
1207 return iconv_open("UTF-8","ISO-8859-1")==(iconv_t)(-1);
1208 ])
1209 ],
1210 [ AC_MSG_RESULT(yes)
1211 AC_DEFINE(HAVE_ICONV_ISO_8859_1, 1, Define to 1 if iconv supports ISO-8859-1)
1212 ],
1213 [ AC_MSG_RESULT(no) ],
1214 [ AC_MSG_RESULT(no) ]
1215)
1216
1217AC_MSG_CHECKING(whether iconv supports ASCII)
1218AC_RUN_IFELSE(
1219 [AC_LANG_PROGRAM([
1220#if HAVE_ICONV_H
1221#include <iconv.h>
1222#endif
1223 ], [
1224 return iconv_open("UTF-8","ASCII")==(iconv_t)(-1);
1225 ])
1226 ],
1227 [ AC_MSG_RESULT(yes)
1228 AC_DEFINE(HAVE_ICONV_ASCII, 1, Define to 1 if iconv supports ASCII)
1229 ],
1230 [ AC_MSG_RESULT(no) ],
1231 [ AC_MSG_RESULT(no) ]
1232)
1233
93571e7f
VK
1234AC_MSG_CHECKING(whether iconv supports //IGNORE)
1235AC_RUN_IFELSE(
1236 [AC_LANG_PROGRAM([
1237#if HAVE_ICONV_H
1238#include <iconv.h>
1239#endif
1240 ], [
1241 return iconv_open("UTF-8//IGNORE","$valid_ucs2_code")==(iconv_t)(-1);
1242 ])
1243 ],
1244 [ AC_MSG_RESULT(yes)
1245 AC_DEFINE(HAVE_ICONV_IGNORE, 1, Define to 1 if iconv supports //IGNORE option)
1246 ],
1247 [ AC_MSG_RESULT(no) ],
1248 [ AC_MSG_RESULT(no) ]
1249)
3e39fcde 1250
19619a35
AK
1251# taken from ZSH's configure
1252# Check if iconv uses const in prototype declaration
24b1570c 1253if test "x$ac_found_iconv" = "xyes"; then
19619a35
AK
1254 AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
1255 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
1256 #include <iconv.h>]],
1257 [[#ifdef __cplusplus
1258 "C"
1259 #endif
1260 #if defined(__STDC__) || defined(__cplusplus)
1261 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1262 #else
1263 size_t iconv();
1264 #endif]])],
1265 [ac_cv_iconv_const=],
1266 [ac_cv_iconv_const=const])])
1267 AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
1268 [Define as const if the declaration of iconv() needs const.])
1269fi
1270
93571e7f 1271if test $ac_cv_sizeof_wchar_t -eq 2; then
8b86c5dc
VK
1272 AC_DEFINE(UNICODE_UCS2, 1, Define to 1 if you have 2-byte wchar_t)
1273fi
1274
1275if test $ac_cv_sizeof_wchar_t -eq 4; then
1276 AC_DEFINE(UNICODE_UCS4, 1, Define to 1 if you have 4-byte wchar_t)
1277fi
1278
c29360a9 1279
ca0f4ea3
VK
1280#--------------------------------------------------------------------
1281# MySQL
1282#--------------------------------------------------------------------
1283
1284check_substr "$COMPONENTS" "mysql"
1285if test $? = 0; then
9c29f76e 1286 AC_CHECK_LIB(mysqlclient, mysql_init, [],
ca0f4ea3 1287 [AC_MSG_ERROR(libmysqlclient is requred for MySQL support)])
9c29f76e
VK
1288 AC_MSG_CHECKING(whether mysql clients can run)
1289 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1290#include <stdio.h>
1291#include <mysql.h>
1292int main(void)
1293{
1294 MYSQL *a = mysql_init(NULL);
1295 return 0;
1296}
1297 ]])],[],[
1298 AC_MSG_RESULT(no)
1299 AC_MSG_ERROR(Your MySQL client libraries aren't properly installed)
1300 ],[])
ca0f4ea3
VK
1301 AC_MSG_RESULT(yes)
1302 AC_CHECK_FUNCS(mysql_real_escape_string)
1303fi
1304
1305
58ed4897
VK
1306#--------------------------------------------------------------------
1307# PostgreSQL
1308#--------------------------------------------------------------------
1309
203458b7 1310check_substr "$COMPONENTS" "pgsql"
58ed4897
VK
1311if test $? = 0; then
1312 AC_CHECK_LIB(m, floor)
1313 AC_CHECK_LIB(pq, PQconnectdb, ,
1314 [AC_MSG_ERROR(libpq is required for PostgreSQL support)])
1315 AC_MSG_CHECKING(whether postgresql clients can run)
1316 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1317 #include <stdio.h>
1318 #include <libpq-fe.h>
1319 int main(void)
1320 {
1321 PGconn *a = PQconnectdb("");
1322 return 0;
1323 }
1324 ]])],[],[
1325 AC_MSG_RESULT(no)
1326 AC_MSG_ERROR(Your PostgreSQL client libraries aren't properly installed)
1327 ],[])
1328 AC_MSG_RESULT(yes)
7070538d 1329 AC_CHECK_LIB(pq, PQfformat, [ AC_DEFINE(HAVE_PQFFORMAT, 1, PQfformat not exist in 7.3) ])
58ed4897
VK
1330fi
1331
1332
9c29f76e
VK
1333#--------------------------------------------------------------------
1334# ODBC
1335#--------------------------------------------------------------------
1336
1337check_substr "$COMPONENTS" "odbc"
1338if test $? = 0; then
1339 AC_CHECK_LIB(odbc, SQLAllocHandle, [],
1340 [AC_MSG_ERROR(libodbc is required for ODBC support)])
1341fi
1342
1343
41b4790d
VK
1344#--------------------------------------------------------------------
1345# Oracle
1346#--------------------------------------------------------------------
1347
1348check_substr "$COMPONENTS" "oracle"
1349if test $? = 0; then
1350 AC_CHECK_HEADER(oci.h,,AC_MSG_ERROR([*** Cannot find oci.h - check your Oracle client installation ***]))
1351 AC_CHECK_LIB(clntsh, OCIHandleAlloc, [],
1352 [AC_MSG_ERROR(libclntsh is required for Oracle support)])
1353fi
1354
1355
c3cfc039
VK
1356#--------------------------------------------------------------------
1357# nxhttpd
1358#--------------------------------------------------------------------
1359
1360check_substr "$COMPONENTS" "nxhttpd"
1361if test $? = 0; then
1362 AC_CHECK_HEADER(gd.h,,AC_MSG_ERROR([*** GD support not installed - please install first ***]))
1363 AC_CHECK_LIB(gd, gdImageCreate, [], [
1364 AC_MSG_ERROR(libgd is required for web interface)
1365 ])
1366
1367fi
1368
1369
ca0f4ea3
VK
1370#--------------------------------------------------------------------
1371# Other settings
1372#--------------------------------------------------------------------
1373
273da39a 1374CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DPREFIX=\\\"\${prefix}\\\" -DPREFIXW=L\\\"\${prefix}\\\" -DDATADIR=\\\"\${pkgdatadir}\\\" -DLIBDIR=\\\"\${libdir}\\\""
ca0f4ea3 1375
8b86c5dc
VK
1376AM_CONDITIONAL([BUILD_UNICODE_LIBS], [test "x$BUILD_UNICODE" = "xyes"])
1377
ca0f4ea3 1378
ef0c727b
VK
1379#--------------------------------------------------------------------
1380# Substitute variables
1381#--------------------------------------------------------------------
82fa7c5d 1382
ef0c727b
VK
1383AC_SUBST(DB_DRIVERS)
1384AC_SUBST(MODULES)
1385AC_SUBST(SUBAGENT_DIRS)
1386AC_SUBST(SERVER_TOOLS)
1387AC_SUBST(TOP_LEVEL_MODULES)
1388AC_SUBST(CONTRIB_MODULES)
c2612d83 1389AC_SUBST(CLIENT_COMPONENTS)
ef0c727b
VK
1390AC_SUBST(STATIC_SUBAGENT_LIST)
1391AC_SUBST(SUBAGENT_LIBS)
1392AC_SUBST(BUILD_SERVER)
1393AC_SUBST(UNSTABLE_SUBAGENT_DIRS)
db91456f 1394AC_SUBST(WXRC)
d16cf8a5 1395
ef0c727b
VK
1396#--------------------------------------------------------------------
1397# Shared libs versions
d16cf8a5
AK
1398#
1399# versioning scheme: current:revision:age
1400#
1401# current
1402# The number of the current interface exported by the library. A current
1403# value of `0', means that you are calling the interface exported by this
1404# library interface 0.
1405#
1406# revision
1407# The implementation number of the most recent interface exported by this
1408# library. In this case, a revision value of `0' means that this is the
1409# first implementation of the interface.
1410# If the next release of this library exports the same interface, but has a
1411# different implementation (perhaps some bugs have been fixed), the revision
1412# number will be higher, but current number will be the same. In that case,
1413# when given a choice, the library with the highest revision will always
1414# be used by the runtime loader.
1415#
1416# age
1417# The number of previous additional interfaces supported by this library.
1418# If age were `2', then this library can be linked into executables which
1419# were built with a release of this library that exported the current
1420# interface number, current, or any of the previous two interfaces.
1421# By definition age must be less than or equal to current. At the outset,
1422# only the first ever interface is implemented, so age can only be `0'.
ef0c727b 1423#--------------------------------------------------------------------
d16cf8a5 1424
8c5adf3a 1425NETXMS_LIBRARY_VERSION=0:2:0
c7d14846 1426AC_SUBST(NETXMS_LIBRARY_VERSION)
d16cf8a5 1427
ef0c727b
VK
1428
1429#--------------------------------------------------------------------
1430# Generate output files
1431#--------------------------------------------------------------------
d16cf8a5
AK
1432
1433AC_CONFIG_FILES([
ef0c727b 1434 README
0c3c0c39
AK
1435 Makefile
1436 contrib/Makefile
0c3c0c39 1437 contrib/startup/Makefile
daaefaaf 1438 contrib/startup/gentoo/Makefile
0c3c0c39 1439 contrib/startup/redhat/Makefile
5de3893d 1440 contrib/startup/suse/Makefile
9993edf4 1441 contrib/startup/ubuntu/Makefile
82fa7c5d 1442 contrib/mibs/Makefile
3f2f9f2b 1443 contrib/backgrounds/Makefile
0c3c0c39 1444 doc/Makefile
a48203d2
VK
1445 doc/internal/Makefile
1446 doc/manuals/Makefile
1447 doc/misc/Makefile
0c3c0c39
AK
1448 images/Makefile
1449 include/Makefile
1450 m4/Makefile
1451 netware/Makefile
1452 sql/Makefile
0c3c0c39 1453 src/Makefile
8817f620 1454 src/sqlite/Makefile
80ce37ac
VK
1455 src/libexpat/Makefile
1456 src/libexpat/libexpat/Makefile
0c3c0c39 1457 src/libnetxms/Makefile
0c3c0c39 1458 src/libnxcl/Makefile
aa8d6795 1459 src/libnxlp/Makefile
c002b04a 1460 src/libnxsl/Makefile
1d410d50 1461 src/libnxmap/Makefile
1b1edd49
VK
1462 src/install/Makefile
1463 src/install/windows/Makefile
c2612d83 1464 src/client/Makefile
c94fa5c2 1465 src/client/nxalarm/Makefile
e84701c5
VK
1466 src/client/nxevent/Makefile
1467 src/client/nxpush/Makefile
59ffa5b7 1468 src/client/nxsms/Makefile
23c8c53e
AK
1469 src/client/windows/nxuilib/Makefile
1470 src/client/windows/nxuilib/res/Makefile
1471 src/client/windows/nxuilib/sounds/Makefile
d9db1c72 1472 src/client/nxlexer/Makefile
23c8c53e
AK
1473 src/client/windows/nxcon/Makefile
1474 src/client/windows/nxcon/icons/Makefile
1475 src/client/windows/nxcon/res/Makefile
23c8c53e
AK
1476 src/client/windows/nxav/Makefile
1477 src/client/windows/nxav/res/Makefile
1478 src/client/windows/nxnotify/Makefile
1479 src/client/windows/nxnotify/res/Makefile
b6e8dffe 1480 src/nxcptest/Makefile
f519aa3e 1481 src/nxscript/Makefile
0c3c0c39
AK
1482 src/server/Makefile
1483 src/server/core/Makefile
a551fe4d 1484 src/server/netxmsd/Makefile
0c3c0c39
AK
1485 src/server/dbdrv/Makefile
1486 src/server/dbdrv/odbc/Makefile
1487 src/server/dbdrv/mssql/Makefile
1488 src/server/dbdrv/mysql/Makefile
1489 src/server/dbdrv/pgsql/Makefile
9486b324 1490 src/server/dbdrv/sqlite/Makefile
5de3893d 1491 src/server/dbdrv/oracle/Makefile
d8f2e39b
VK
1492 src/server/smsdrv/Makefile
1493 src/server/smsdrv/generic/Makefile
91369aca 1494 src/server/smsdrv/nxagent/Makefile
0c3c0c39
AK
1495 src/server/tools/Makefile
1496 src/server/tools/nxget/Makefile
1497 src/server/tools/nxaction/Makefile
1498 src/server/tools/nxadm/Makefile
5b0c7d0d
VK
1499 src/server/tools/nxconfig/Makefile
1500 src/server/tools/nxconfig/res/Makefile
f90d7fc5 1501 src/server/tools/nxdbmgr/Makefile
d24fdaf4 1502 src/server/tools/nxupload/Makefile
0c3c0c39 1503 src/server/libnxsrv/Makefile
c5c0f362
VK
1504 src/snmp/Makefile
1505 src/snmp/libnxsnmp/Makefile
1506 src/snmp/nxmibc/Makefile
1507 src/snmp/nxsnmpget/Makefile
1508 src/snmp/nxsnmpset/Makefile
1509 src/snmp/nxsnmpwalk/Makefile
0c3c0c39
AK
1510 src/agent/Makefile
1511 src/agent/core/Makefile
5795bf90 1512 src/agent/install/Makefile
0c3c0c39
AK
1513 src/agent/subagents/Makefile
1514 src/agent/subagents/linux/Makefile
1515 src/agent/subagents/sunos/Makefile
d0b5a098 1516 src/agent/subagents/aix/Makefile
9bdf494f 1517 src/agent/subagents/hpux/Makefile
0c3c0c39
AK
1518 src/agent/subagents/skeleton/Makefile
1519 src/agent/subagents/freebsd/Makefile
992ba479 1520 src/agent/subagents/openbsd/Makefile
ad0f1ada 1521 src/agent/subagents/netbsd/Makefile
2b23dc1e 1522 src/agent/subagents/ipso/Makefile
0c3c0c39 1523 src/agent/subagents/netware/Makefile
1bc607cc
VK
1524 src/agent/subagents/winnt/Makefile
1525 src/agent/subagents/win9x/Makefile
0c3c0c39 1526 src/agent/subagents/winperf/Makefile
3737b4b9 1527 src/agent/subagents/wmi/Makefile
93f15c2a 1528 src/agent/subagents/portCheck/Makefile
abc48356 1529 src/agent/subagents/ping/Makefile
dbca7ed1 1530 src/agent/subagents/sms/Makefile
2f06a66e 1531 src/agent/subagents/ups/Makefile
539ab0c3
AK
1532 src/agent/subagents/ecs/Makefile
1533 src/agent/subagents/odbcquery/Makefile
0d362f93 1534 src/agent/subagents/logwatch/Makefile
420d9ecf
AK
1535 src/webui/nxhttpd/Makefile
1536 src/webui/nxhttpd/static/Makefile
1537 src/webui/nxhttpd/static/images/Makefile
1538 src/webui/nxhttpd/static/images/buttons/Makefile
1539 src/webui/nxhttpd/static/images/buttons/normal/Makefile
1540 src/webui/nxhttpd/static/images/buttons/pressed/Makefile
1541 src/webui/nxhttpd/static/images/ctrlpanel/Makefile
1542 src/webui/nxhttpd/static/images/objects/Makefile
1543 src/webui/nxhttpd/static/images/status/Makefile
0c3c0c39 1544 tools/Makefile
d16cf8a5
AK
1545])
1546
12249937
VK
1547AC_OUTPUT
1548
ef0c727b 1549echo "Updating libtool"
5cecf50e
AK
1550sed 's,$SED -e "/${host}-//g",$SED -e "s/${host}-//g",g' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
1551
779ce551
VK
1552# On HP-UX, libtool passes +b instead of -Wl,+b even if gcc/g++ used as linker
1553if test "x$CC" = "xgcc" && test "x$PLATFORM" = "xHP-UX"; then
1554 sed "s,hardcode_libdir_flag_spec_ld=,#hardcode_libdir_flag_spec_ld=,g" < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
1555fi
1556
ef0c727b
VK
1557#--------------------------------------------------------------------
1558# Print summary
1559#--------------------------------------------------------------------
a7442678 1560
a7442678
AK
1561echo
1562echo
1563echo
1564echo '---------------------------------------------------------------------'
1565echo ' Configure results'
1566echo '---------------------------------------------------------------------'
1567echo
8b86c5dc 1568 echo "Prefix : ${prefix}"
a7442678 1569if test "x${BUILD_SERVER}" = "xyes"; then
8b86c5dc 1570 echo "Build Server : YES"
a7442678 1571else
8b86c5dc 1572 echo "Build Server : NO"
a7442678
AK
1573fi
1574if test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"; then
8b86c5dc 1575 echo "Encryption enabled : YES"
a7442678 1576else
8b86c5dc 1577 echo "Encryption enabled : NO"
a7442678
AK
1578fi
1579if test "x${DB_DRIVERS}" != "x"; then
8b86c5dc 1580 echo "Build DB-Drivers :${DB_DRIVERS}"
a7442678 1581else
8b86c5dc 1582 echo "Build DB-Drivers : NO"
a7442678
AK
1583fi
1584if test "x${BUILD_CLIENT}" = "xyes"; then
8b86c5dc 1585 echo "Build Clients : YES"
a7442678 1586else
8b86c5dc 1587 echo "Build Clients : NO"
a7442678 1588fi
ef0c727b 1589if test "x${BUILD_NXHTTPD}" = "xyes"; then
8b86c5dc 1590 echo "Build Web Interface : YES"
2654e540 1591else
8b86c5dc 1592 echo "Build Web Interface : NO"
2654e540 1593fi
a7442678 1594if test "x${BUILD_AGENT}" = "xyes"; then
8b86c5dc
VK
1595 echo "Build Agent : YES"
1596 echo "Subagents list : ${SUBAGENT_DIRS}"
a7442678 1597else
8b86c5dc 1598 echo "Build Agent : NO"
a7442678 1599fi
e8636669 1600if test "x${BUILD_STATIC_AGENT}" = "xyes"; then
8b86c5dc
VK
1601 echo "Build Static Agent : YES"
1602 echo "Subagents list : ${STATIC_SUBAGENT_LIST}"
e8636669 1603else
8b86c5dc 1604 echo "Build Static Agent : NO"
e8636669 1605fi
8b86c5dc
VK
1606if test "x${BUILD_UNICODE}" = "xyes"; then
1607 echo "Build UNICODE libraries : YES"
1608else
1609 echo "Build UNICODE libraries : NO"
1610fi
1bb6b449
VK
1611if test "x${HAVE_LIBEXPAT}" = "xyes"; then
1612 echo "XML support in NXCP : YES"
1613else
1614 echo "XML support in NXCP : NO"
1615fi