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