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