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