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