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