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