implemented object search by comments; fixed issue 283 (backported from 1.0.x)
[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
ef0c727b
VK
88AC_ARG_WITH(agent,
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
0322eed7
VK
723#--------------------------------------------------------------------
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
ef0c727b
VK
747#--------------------------------------------------------------------
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 858
b0823d06
VK
859# Check if strerror_r is POSIX-compliant
860if test "$ac_cv_func_strerror_r" = "yes"; then
861 AC_MSG_CHECKING(if strerror_r is POSIX compliant)
862 AC_LANG_PUSH([C++])
863 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
864 #if HAVE_STRING_H
865 #include <string.h>
866 #endif
867 #if HAVE_ERRNO_H
868 #include <errno.h>
869 #endif
870 ]],[[
871 int main()
872 {
873 int e;
874 char buffer[256];
875 e = strerror_r(1, buffer, 256);
876 return e;
877 }
878 ]])
879 ],[
880 AC_MSG_RESULT(yes)
881 AC_DEFINE(HAVE_POSIX_STRERROR_R,1,Define to 1 if strerror_r function is POSIX compliant)
882 ],[
883 AC_MSG_RESULT(no)
884 AC_DEFINE(HAVE_POSIX_STRERROR_R,0,Define to 1 if strerror_r function is POSIX compliant)
885 ])
886 AC_LANG_POP([C++])
887fi
888
be6467e9
VK
889# Check if timezone is a function
890AC_MSG_CHECKING(for timezone function)
891AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
892#if HAVE_TIME_H
893#include <time.h>
894#endif
895#if HAVE_SYS_TIME_H
896#include <sys/time.h>
897#endif
898]],[[
899int main()
900{
901 timezone(0, 0);
902 return 0;
903}
904]])
905],[
906AC_MSG_RESULT(yes)
907AC_DEFINE(HAVE_TIMEZONE,1,Define to 1 if timezone function is available)
908],[
909AC_MSG_RESULT(no)
445cba33
VK
910AC_CHECK_DECLS([timezone],,,[
911#if HAVE_TIME_H
912#include <time.h>
913#endif
914#if HAVE_SYS_TIME_H
915#include <sys/time.h>
916#endif
917])
be6467e9
VK
918])
919
920# Check if struct tm has tm_gmtoff member
921AC_MSG_CHECKING(for struct tm.tm_gmtoff)
922AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
923#if HAVE_TIME_H
924#include <time.h>
925#endif
926#if HAVE_SYS_TIME_H
927#include <sys/time.h>
928#endif
929]],[[
930int main()
931{
932 struct tm t;
933 return t.tm_gmtoff;
934}
935]])
936],[
937AC_MSG_RESULT(yes)
938AC_DEFINE(HAVE_TM_GMTOFF,1,Define to 1 if struct tm has tm_gmtoff member)
939],[
940AC_MSG_RESULT(no)
941])
d16cf8a5 942
99e50bb7
VK
943AC_CHECK_DECLS([getopt_long],,,[
944#if HAVE_GETOPT_H
945#include <getopt.h>
946#endif
947])
73d7fbdb 948
f91feddc 949AC_CHECK_FUNCS([sysctlbyname sysctlnametomib])
70fed300
AK
950AC_CHECK_FUNCS([tcgetattr tcsetattr cfsetospeed cfsetispeed])
951
d16cf8a5
AK
952# sockets/resolver (probably for solaris)
953AC_CHECK_FUNC(connect, , [AC_CHECK_LIB(socket, connect)])
954AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(resolv, gethostbyname)])
955AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)])
956
957if test "x$ac_cv_lib_nsl_gethostbyname" != "xyes" && test "x$ac_cv_func_gethostbyname" != "xyes" ; then
958 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(socket, gethostbyname)])
959fi
960
961if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname" ; then
962 AC_MSG_CHECKING([if we can include libnsl + libsocket])
963 LIBS="-lnsl -lsocket $LIBS"
964 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void) gethostbyname]])],[my_ac_link_result=yes],[my_ac_link_result=no ])
965 if test "$my_ac_link_result" = "no" ; then
966 AC_MSG_RESULT([failure])
967 AC_MSG_ERROR([unable to use gethostbyname()])
968 else
969 AC_MSG_RESULT([success])
970 fi
971fi
972
c6491611
VK
973# asprintf, scprintf, etc.
974AC_CHECK_FUNCS([asprintf aswprintf vasprintf vaswprintf])
975AC_CHECK_FUNCS([scprintf scwprintf vscprintf vscwprintf])
976
977AC_MSG_CHECKING(whether snprintf returns required buffer size)
978AC_RUN_IFELSE(
979 [AC_LANG_PROGRAM([
980#include <stdio.h>
981#include <string.h>
982 ], [
983 return !(snprintf(NULL, 0, "test: %d", 1000) >= 10);
984 ])
985 ],
986 [ AC_MSG_RESULT(yes)
987 AC_DEFINE(SNPRINTF_RETURNS_REQUIRED_SIZE, 1, Define to 1 if snprintf returns required buffer size in case of truncation)
988 ],
989 [ AC_MSG_RESULT(no) ],
990 [ AC_MSG_RESULT(no) ]
991)
992
993
dff54fed 994
ef0c727b
VK
995#--------------------------------------------------------------------
996# Checks for macros and definitions
997#--------------------------------------------------------------------
dff54fed 998
ef0c727b
VK
999AC_CHECK_DECLS([__bswap_32, __bswap_64, htonll, ntohll],,,[
1000#ifdef HAVE_SYS_TYPES_H
99e50bb7 1001#include <sys/types.h>
ef0c727b
VK
1002#endif
1003#if HAVE_BYTESWAP_H
1004#include <byteswap.h>
1005#endif
1006#if HAVE_NETINET_IN_H
1007#include <netinet/in.h>
1008#endif
1009#if HAVE_NET_NH_H
1010#include <net/nh.h>
1011#endif
1012])
aa24418a
VK
1013AC_CHECK_DECLS([RTLD_NOW, RTLD_GLOBAL],,,[
1014#ifdef HAVE_UNISTD_H
1015#include <unistd.h>
1016#endif
1017#ifdef HAVE_DLFCN_H
1018#include <dlfcn.h>
1019#endif
1020])
ce7565e7
VK
1021AC_CHECK_DECLS([va_copy, __va_copy],,,[
1022#ifdef HAVE_UNISTD_H
1023#include <unistd.h>
1024#endif
1025#ifdef HAVE_STDARG_H
1026#include <stdarg.h>
1027#endif
1028#ifdef HAVE_STDLIB_H
1029#include <stdlib.h>
1030#endif
1031])
dff54fed 1032
dff54fed 1033
ef0c727b
VK
1034#--------------------------------------------------------------------
1035# AIX specific checks
1036#--------------------------------------------------------------------
d16cf8a5 1037
ef0c727b
VK
1038if test "x$PLATFORM" = "xAIX"; then
1039 AC_CHECK_HEADERS([procinfo.h],,,[[ ]])
1040 AC_CHECK_DECLS([getkerninfo])
1041 AC_CHECK_FUNCS([getprocs64],,,[
1042#if HAVE_PROCINFO_H
1043#include <procinfo.h>
6cd41ceb 1044#endif
ef0c727b 1045 ])
7e56bf2e
VK
1046fi
1047
cd4c8ca3 1048
aa24418a
VK
1049#--------------------------------------------------------------------
1050# *BSD specific checks
1051#--------------------------------------------------------------------
1052
1053AC_CHECK_LIB(kvm, kvm_open)
1054AC_CHECK_FUNCS([kvm_getswapinfo])
1055AC_CHECK_TYPES([struct kinfo_proc2],,,[
1056#if HAVE_SYS_SYSCTL_H
1057#include <sys/sysctl.h>
1058#endif
1059])
1060
1061
28ba6824
VK
1062
1063#--------------------------------------------------------------------
1064# FreeBSD specific checks
1065#--------------------------------------------------------------------
1066
1067if test "x$PLATFORM" = "xFreeBSD"; then
61f58c11
VK
1068 AC_CHECK_DECLS([RTF_WASCLONED],[],[],[
1069#if HAVE_SYS_TYPES_H
1070#include <sys/types.h>
1071#endif
1072#if HAVE_SYS_SOCKET_H
1073#include <sys/socket.h>
1074#endif
1075#include <net/route.h>
1076 ])
28ba6824
VK
1077fi
1078
1079
8b86c5dc
VK
1080#--------------------------------------------------------------------
1081# Check for wxWidgets
1082#--------------------------------------------------------------------
1083
1084if test "x$NEED_WXWIDGETS" = "xyes"; then
1085 AC_PATH_PROGS([WXCONF], [wx-config wxgtk2-2.8-config], [no], [$PATH:/usr/local/bin])
1086 if test "x$WXCONF" = "xno"; then
1087 AC_MSG_ERROR([*** wxWidgets not installed - unable to build GUI components ***])
1088 else
1089 AC_PATH_PROGS([WXRC], [wxrc wxrc-gtk2-2.8], [no], [$PATH:/usr/local/bin])
1090 if test "x$WXRC" = "xno"; then
1091 AC_MSG_ERROR([*** wxWidgets resource compiler not found - unable to build GUI components ***])
1092 else
1093 NEED_UNICODE=`$WXCONF --selected-config | grep unicode | wc -l`
1094 if test $NEED_UNICODE -eq 1; then
1095 BUILD_UNICODE="yes"
273da39a 1096 WX_UNICODE="yes"
8b86c5dc
VK
1097 fi
1098 CXXFLAGS="$CXXFLAGS `$WXCONF --cxxflags --debug=$ENABLE_DEBUG`"
1099 LDFLAGS="$LDFLAGS `$WXCONF --libs --debug=$ENABLE_DEBUG`"
1100 fi
1101 fi
bfc410a1
VK
1102 $WXCONF --cxxflags | grep error >/dev/null
1103 if test $? = 0; then
1104 echo "wx-config output:"
1105 echo "*** BEGIN ***"
1106 $WXCONF --cxxflags
1107 echo "*** END ***"
1108 AC_MSG_ERROR([*** wxWidgets is not configured properly - see wx-config output above ***])
1109 fi
8b86c5dc
VK
1110fi
1111
1112
ef0c727b
VK
1113#--------------------------------------------------------------------
1114# Check for UNICODE stuff
1115#--------------------------------------------------------------------
3e39fcde 1116
8b86c5dc 1117AC_CHECK_HEADERS([wchar.h wctype.h iconv.h])
aa24418a 1118AC_CHECK_TYPES([wchar_t, wint_t],,,[
6b93c954
VK
1119#if HAVE_WCHAR_H
1120#include <wchar.h>
1121#endif
1122])
3e39fcde 1123AC_CHECK_SIZEOF(wchar_t)
aa24418a
VK
1124AC_CHECK_FUNCS([wcslen wcsdup wcsncpy wcstoll wcstoull towupper wcserror wcserror_r])
1125AC_CHECK_FUNCS([wfopen wopen wstat wgetenv wrename wunlink])
dff54fed 1126
3265ba38 1127if test "x$DISABLE_ICONV" != "xyes"; then
75c30ed4 1128 AC_CHECK_LIB(iconv, libiconv_open,
dff54fed 1129 [ ac_found_iconv=yes
75c30ed4
VK
1130 LDFLAGS="$LDFLAGS -liconv"
1131 AC_CHECK_FUNCS(libiconv, ac_found_iconv=yes, ac_found_iconv=no)
1132 ],
1133 [
1134 AC_CHECK_LIB(iconv, iconv,
1135 [ ac_found_iconv=yes
1136 LDFLAGS="$LDFLAGS -liconv"
1137 ])
1138 AC_CHECK_FUNCS(iconv, ac_found_iconv=yes, ac_found_iconv=no)
1139 ])
dff54fed
VK
1140else
1141 ac_found_iconv=no
ef0c727b 1142 CPPFLAGS="$CPPFLAGS -D__DISABLE_ICONV"
dff54fed 1143fi
93571e7f
VK
1144
1145AC_MSG_CHECKING(whether iconv supports UCS-2-INTERNAL)
1146AC_RUN_IFELSE(
1147 [AC_LANG_PROGRAM([
1148#if HAVE_ICONV_H
1149#include <iconv.h>
1150#endif
1151 ], [
1152 return iconv_open("UTF-8","UCS-2-INTERNAL")==(iconv_t)(-1);
1153 ])
1154 ],
1155 [ AC_MSG_RESULT(yes)
1156 AC_DEFINE(HAVE_ICONV_UCS_2_INTERNAL, 1, Define to 1 if iconv supports UCS-2-INTERNAL)
1157 valid_ucs2_code="UCS-2-INTERNAL"
1158 ],
1159 [ AC_MSG_RESULT(no) ],
1160 [ AC_MSG_RESULT(no) ]
1161)
1162
1163AC_MSG_CHECKING(whether iconv supports UCS-2)
1164AC_RUN_IFELSE(
1165 [AC_LANG_PROGRAM([
1166#if HAVE_ICONV_H
1167#include <iconv.h>
1168#endif
1169 ], [
1170 return iconv_open("UTF-8","UCS-2")==(iconv_t)(-1);
1171 ])
1172 ],
1173 [ AC_MSG_RESULT(yes)
1174 AC_DEFINE(HAVE_ICONV_UCS_2, 1, Define to 1 if iconv supports UCS-2)
1175 valid_ucs2_code="UCS-2"
1176 ],
1177 [ AC_MSG_RESULT(no) ],
8b86c5dc 1178 [ AC_MSG_RESULT(no) ]
93571e7f
VK
1179)
1180
1181AC_MSG_CHECKING(whether iconv supports UCS2)
1182AC_RUN_IFELSE(
1183 [AC_LANG_PROGRAM([
1184#if HAVE_ICONV_H
1185#include <iconv.h>
1186#endif
1187 ], [
1188 return iconv_open("UTF-8","UCS2")==(iconv_t)(-1);
1189 ])
1190 ],
1191 [ AC_MSG_RESULT(yes)
1192 AC_DEFINE(HAVE_ICONV_UCS2, 1, Define to 1 if iconv supports UCS2)
1193 valid_ucs2_code="UCS2"
1194 ],
1195 [ AC_MSG_RESULT(no) ],
1196 [ AC_MSG_RESULT(no) ]
1197)
1198
44bccbbc
VK
1199AC_MSG_CHECKING(whether iconv supports UCS-2BE)
1200AC_RUN_IFELSE(
1201 [AC_LANG_PROGRAM([
1202#if HAVE_ICONV_H
1203#include <iconv.h>
1204#endif
1205 ], [
1206 return iconv_open("UTF-8","UCS-2BE")==(iconv_t)(-1);
1207 ])
1208 ],
1209 [ AC_MSG_RESULT(yes)
1210 AC_DEFINE(HAVE_ICONV_UCS_2BE, 1, Define to 1 if iconv supports UCS-2BE)
1211 valid_ucs2_code="UCS-2BE"
1212 ],
1213 [ AC_MSG_RESULT(no) ],
1214 [ AC_MSG_RESULT(no) ]
1215)
1216
6e17f325
VK
1217AC_MSG_CHECKING(whether iconv supports UCS-2LE)
1218AC_RUN_IFELSE(
1219 [AC_LANG_PROGRAM([
1220#if HAVE_ICONV_H
1221#include <iconv.h>
1222#endif
1223 ], [
1224 return iconv_open("UTF-8","UCS-2LE")==(iconv_t)(-1);
1225 ])
1226 ],
1227 [ AC_MSG_RESULT(yes)
1228 AC_DEFINE(HAVE_ICONV_UCS_2LE, 1, Define to 1 if iconv supports UCS-2LE)
1229 valid_ucs2_code="UCS-2LE"
1230 ],
1231 [ AC_MSG_RESULT(no) ],
1232 [ AC_MSG_RESULT(no) ]
1233)
1234
8b86c5dc
VK
1235AC_MSG_CHECKING(whether iconv supports UCS-4-INTERNAL)
1236AC_RUN_IFELSE(
1237 [AC_LANG_PROGRAM([
1238#if HAVE_ICONV_H
1239#include <iconv.h>
1240#endif
1241 ], [
1242 return iconv_open("UTF-8","UCS-4-INTERNAL")==(iconv_t)(-1);
1243 ])
1244 ],
1245 [ AC_MSG_RESULT(yes)
1246 AC_DEFINE(HAVE_ICONV_UCS_4_INTERNAL, 1, Define to 1 if iconv supports UCS-4-INTERNAL)
1247 valid_ucs4_code="UCS-4-INTERNAL"
1248 ],
1249 [ AC_MSG_RESULT(no) ],
1250 [ AC_MSG_RESULT(no) ]
1251)
1252
1253AC_MSG_CHECKING(whether iconv supports UCS-4)
1254AC_RUN_IFELSE(
1255 [AC_LANG_PROGRAM([
1256#if HAVE_ICONV_H
1257#include <iconv.h>
1258#endif
1259 ], [
1260 return iconv_open("UTF-8","UCS-4")==(iconv_t)(-1);
1261 ])
1262 ],
1263 [ AC_MSG_RESULT(yes)
1264 AC_DEFINE(HAVE_ICONV_UCS_4, 1, Define to 1 if iconv supports UCS-4)
1265 valid_ucs4_code="UCS-4"
1266 ],
1267 [ AC_MSG_RESULT(no) ],
1268 [ AC_MSG_RESULT(no) ]
1269)
1270
1271AC_MSG_CHECKING(whether iconv supports UCS4)
1272AC_RUN_IFELSE(
1273 [AC_LANG_PROGRAM([
1274#if HAVE_ICONV_H
1275#include <iconv.h>
1276#endif
1277 ], [
1278 return iconv_open("UTF-8","UCS4")==(iconv_t)(-1);
1279 ])
1280 ],
1281 [ AC_MSG_RESULT(yes)
1282 AC_DEFINE(HAVE_ICONV_UCS4, 1, Define to 1 if iconv supports UCS4)
1283 valid_ucs4_code="UCS4"
1284 ],
1285 [ AC_MSG_RESULT(no) ],
1286 [ AC_MSG_RESULT(no) ]
1287)
1288
1289AC_MSG_CHECKING(whether iconv supports UCS-4BE)
1290AC_RUN_IFELSE(
1291 [AC_LANG_PROGRAM([
1292#if HAVE_ICONV_H
1293#include <iconv.h>
1294#endif
1295 ], [
1296 return iconv_open("UTF-8","UCS-4BE")==(iconv_t)(-1);
1297 ])
1298 ],
1299 [ AC_MSG_RESULT(yes)
1300 AC_DEFINE(HAVE_ICONV_UCS_4BE, 1, Define to 1 if iconv supports UCS-4BE)
1301 valid_ucs4_code="UCS-4BE"
1302 ],
1303 [ AC_MSG_RESULT(no) ],
1304 [ AC_MSG_RESULT(no) ]
1305)
1306
6e17f325
VK
1307AC_MSG_CHECKING(whether iconv supports UCS-4LE)
1308AC_RUN_IFELSE(
1309 [AC_LANG_PROGRAM([
1310#if HAVE_ICONV_H
1311#include <iconv.h>
1312#endif
1313 ], [
1314 return iconv_open("UTF-8","UCS-4LE")==(iconv_t)(-1);
1315 ])
1316 ],
1317 [ AC_MSG_RESULT(yes)
1318 AC_DEFINE(HAVE_ICONV_UCS_4LE, 1, Define to 1 if iconv supports UCS-4LE)
1319 valid_ucs4_code="UCS-4LE"
1320 ],
1321 [ AC_MSG_RESULT(no) ],
1322 [ AC_MSG_RESULT(no) ]
1323)
1324
5e40a69e
VK
1325AC_MSG_CHECKING(whether iconv supports ISO8859-1)
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","ISO8859-1")==(iconv_t)(-1);
1333 ])
1334 ],
1335 [ AC_MSG_RESULT(yes)
1336 AC_DEFINE(HAVE_ICONV_ISO8859_1, 1, Define to 1 if iconv supports ISO8859-1)
1337 ],
1338 [ AC_MSG_RESULT(no) ],
1339 [ AC_MSG_RESULT(no) ]
1340)
1341
1342AC_MSG_CHECKING(whether iconv supports ISO-8859-1)
1343AC_RUN_IFELSE(
1344 [AC_LANG_PROGRAM([
1345#if HAVE_ICONV_H
1346#include <iconv.h>
1347#endif
1348 ], [
1349 return iconv_open("UTF-8","ISO-8859-1")==(iconv_t)(-1);
1350 ])
1351 ],
1352 [ AC_MSG_RESULT(yes)
1353 AC_DEFINE(HAVE_ICONV_ISO_8859_1, 1, Define to 1 if iconv supports ISO-8859-1)
1354 ],
1355 [ AC_MSG_RESULT(no) ],
1356 [ AC_MSG_RESULT(no) ]
1357)
1358
1359AC_MSG_CHECKING(whether iconv supports ASCII)
1360AC_RUN_IFELSE(
1361 [AC_LANG_PROGRAM([
1362#if HAVE_ICONV_H
1363#include <iconv.h>
1364#endif
1365 ], [
1366 return iconv_open("UTF-8","ASCII")==(iconv_t)(-1);
1367 ])
1368 ],
1369 [ AC_MSG_RESULT(yes)
1370 AC_DEFINE(HAVE_ICONV_ASCII, 1, Define to 1 if iconv supports ASCII)
1371 ],
1372 [ AC_MSG_RESULT(no) ],
1373 [ AC_MSG_RESULT(no) ]
1374)
1375
93571e7f
VK
1376AC_MSG_CHECKING(whether iconv supports //IGNORE)
1377AC_RUN_IFELSE(
1378 [AC_LANG_PROGRAM([
1379#if HAVE_ICONV_H
1380#include <iconv.h>
1381#endif
1382 ], [
1383 return iconv_open("UTF-8//IGNORE","$valid_ucs2_code")==(iconv_t)(-1);
1384 ])
1385 ],
1386 [ AC_MSG_RESULT(yes)
1387 AC_DEFINE(HAVE_ICONV_IGNORE, 1, Define to 1 if iconv supports //IGNORE option)
1388 ],
1389 [ AC_MSG_RESULT(no) ],
1390 [ AC_MSG_RESULT(no) ]
1391)
3e39fcde 1392
19619a35
AK
1393# taken from ZSH's configure
1394# Check if iconv uses const in prototype declaration
24b1570c 1395if test "x$ac_found_iconv" = "xyes"; then
19619a35
AK
1396 AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
1397 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
1398 #include <iconv.h>]],
1399 [[#ifdef __cplusplus
1400 "C"
1401 #endif
1402 #if defined(__STDC__) || defined(__cplusplus)
1403 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1404 #else
1405 size_t iconv();
1406 #endif]])],
1407 [ac_cv_iconv_const=],
1408 [ac_cv_iconv_const=const])])
1409 AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
1410 [Define as const if the declaration of iconv() needs const.])
1411fi
1412
93571e7f 1413if test $ac_cv_sizeof_wchar_t -eq 2; then
8b86c5dc
VK
1414 AC_DEFINE(UNICODE_UCS2, 1, Define to 1 if you have 2-byte wchar_t)
1415fi
1416
1417if test $ac_cv_sizeof_wchar_t -eq 4; then
1418 AC_DEFINE(UNICODE_UCS4, 1, Define to 1 if you have 4-byte wchar_t)
1419fi
1420
c29360a9 1421
ca0f4ea3
VK
1422#--------------------------------------------------------------------
1423# MySQL
1424#--------------------------------------------------------------------
1425
1426check_substr "$COMPONENTS" "mysql"
1427if test $? = 0; then
6fce76d8 1428 AC_CHECK_LIB(mysqlclient, mysql_init, [MYSQL_LIBS="-lmysqlclient"],
ca0f4ea3 1429 [AC_MSG_ERROR(libmysqlclient is requred for MySQL support)])
aa7794f0
VK
1430
1431 OLD_LDFLAGS="$LDFLAGS"
1432 LDFLAGS="$LDFLAGS $MYSQL_LIBS"
1433
9c29f76e
VK
1434 AC_MSG_CHECKING(whether mysql clients can run)
1435 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1436#include <stdio.h>
1437#include <mysql.h>
1438int main(void)
1439{
1440 MYSQL *a = mysql_init(NULL);
1441 return 0;
1442}
1443 ]])],[],[
1444 AC_MSG_RESULT(no)
1445 AC_MSG_ERROR(Your MySQL client libraries aren't properly installed)
1446 ],[])
ca0f4ea3 1447 AC_MSG_RESULT(yes)
6fce76d8 1448
ca0f4ea3 1449 AC_CHECK_FUNCS(mysql_real_escape_string)
6fce76d8 1450 LDFLAGS="$OLD_LDFLAGS"
ca0f4ea3
VK
1451fi
1452
1453
58ed4897
VK
1454#--------------------------------------------------------------------
1455# PostgreSQL
1456#--------------------------------------------------------------------
1457
203458b7 1458check_substr "$COMPONENTS" "pgsql"
58ed4897
VK
1459if test $? = 0; then
1460 AC_CHECK_LIB(m, floor)
6fce76d8 1461 AC_CHECK_LIB(pq, PQconnectdb, [PGSQL_LIBS="-lpq"],
58ed4897 1462 [AC_MSG_ERROR(libpq is required for PostgreSQL support)])
6fce76d8
VK
1463
1464 AC_MSG_CHECKING(whether postgresql clients can run)
1465 OLD_LDFLAGS="$LDFLAGS"
1466 LDFLAGS="$LDFLAGS $PGSQL_LIBS"
1467 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1468 #include <stdio.h>
1469 #include <libpq-fe.h>
1470 int main(void)
1471 {
1472 PGconn *a = PQconnectdb("");
1473 return 0;
1474 }
1475 ]])],[AC_MSG_RESULT(yes)],[
58ed4897
VK
1476 AC_MSG_RESULT(no)
1477 AC_MSG_ERROR(Your PostgreSQL client libraries aren't properly installed)
1478 ],[])
6fce76d8 1479 LDFLAGS="$OLD_LDFLAGS"
7070538d 1480 AC_CHECK_LIB(pq, PQfformat, [ AC_DEFINE(HAVE_PQFFORMAT, 1, PQfformat not exist in 7.3) ])
58ed4897
VK
1481fi
1482
1483
9c29f76e
VK
1484#--------------------------------------------------------------------
1485# ODBC
1486#--------------------------------------------------------------------
1487
1488check_substr "$COMPONENTS" "odbc"
1489if test $? = 0; then
6fce76d8 1490 AC_CHECK_LIB(odbc, SQLAllocHandle, [ODBC_LIBS="-lodbc"],
9c29f76e
VK
1491 [AC_MSG_ERROR(libodbc is required for ODBC support)])
1492fi
1493
1494
41b4790d
VK
1495#--------------------------------------------------------------------
1496# Oracle
1497#--------------------------------------------------------------------
1498
1499check_substr "$COMPONENTS" "oracle"
1500if test $? = 0; then
1501 AC_CHECK_HEADER(oci.h,,AC_MSG_ERROR([*** Cannot find oci.h - check your Oracle client installation ***]))
7d8c91ef
VK
1502 AC_CHECK_LIB(nnz11, nzstrcpy, [NNZ_LIB=-lnnz11],
1503 [
1504 AC_CHECK_LIB(nnz10, nzstrcpy, [NNZ_LIB=-lnnz10], [], [-lclntsh])
1505 ], [-lclntsh])
1506 AC_CHECK_LIB(clntsh, OCIHandleAlloc, [ORACLE_LIBS="-lclntsh $NNZ_LIB"],
1507 [AC_MSG_ERROR(libclntsh is required for Oracle support)], [$NNZ_LIB])
41b4790d
VK
1508fi
1509
1510
c3cfc039
VK
1511#--------------------------------------------------------------------
1512# nxhttpd
1513#--------------------------------------------------------------------
1514
e02b69b9 1515check_substr "$COMPONENTS" "webui"
c3cfc039
VK
1516if test $? = 0; then
1517 AC_CHECK_HEADER(gd.h,,AC_MSG_ERROR([*** GD support not installed - please install first ***]))
1518 AC_CHECK_LIB(gd, gdImageCreate, [], [
1519 AC_MSG_ERROR(libgd is required for web interface)
1520 ])
1521
1522fi
1523
1524
ca0f4ea3
VK
1525#--------------------------------------------------------------------
1526# Other settings
1527#--------------------------------------------------------------------
1528
273da39a 1529CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DPREFIX=\\\"\${prefix}\\\" -DPREFIXW=L\\\"\${prefix}\\\" -DDATADIR=\\\"\${pkgdatadir}\\\" -DLIBDIR=\\\"\${libdir}\\\""
ca0f4ea3 1530
8b86c5dc 1531AM_CONDITIONAL([BUILD_UNICODE_LIBS], [test "x$BUILD_UNICODE" = "xyes"])
551ec9ca 1532AM_CONDITIONAL([USE_INTERNAL_EXPAT], [test "x$HAVE_LIBEXPAT" = "xno"])
8b86c5dc 1533
ca0f4ea3 1534
ef0c727b
VK
1535#--------------------------------------------------------------------
1536# Substitute variables
1537#--------------------------------------------------------------------
82fa7c5d 1538
ef0c727b
VK
1539AC_SUBST(DB_DRIVERS)
1540AC_SUBST(MODULES)
1541AC_SUBST(SUBAGENT_DIRS)
1542AC_SUBST(SERVER_TOOLS)
1543AC_SUBST(TOP_LEVEL_MODULES)
1544AC_SUBST(CONTRIB_MODULES)
c2612d83 1545AC_SUBST(CLIENT_COMPONENTS)
ef0c727b
VK
1546AC_SUBST(STATIC_SUBAGENT_LIST)
1547AC_SUBST(SUBAGENT_LIBS)
1548AC_SUBST(BUILD_SERVER)
1549AC_SUBST(UNSTABLE_SUBAGENT_DIRS)
db91456f 1550AC_SUBST(WXRC)
6fce76d8
VK
1551AC_SUBST(MYSQL_LIBS)
1552AC_SUBST(PGSQL_LIBS)
7d8c91ef 1553AC_SUBST(ORACLE_LIBS)
6fce76d8 1554AC_SUBST(ODBC_LIBS)
d16cf8a5 1555
ef0c727b
VK
1556#--------------------------------------------------------------------
1557# Shared libs versions
d16cf8a5
AK
1558#
1559# versioning scheme: current:revision:age
1560#
1561# current
1562# The number of the current interface exported by the library. A current
1563# value of `0', means that you are calling the interface exported by this
1564# library interface 0.
1565#
1566# revision
1567# The implementation number of the most recent interface exported by this
1568# library. In this case, a revision value of `0' means that this is the
1569# first implementation of the interface.
1570# If the next release of this library exports the same interface, but has a
1571# different implementation (perhaps some bugs have been fixed), the revision
1572# number will be higher, but current number will be the same. In that case,
1573# when given a choice, the library with the highest revision will always
1574# be used by the runtime loader.
1575#
1576# age
1577# The number of previous additional interfaces supported by this library.
1578# If age were `2', then this library can be linked into executables which
1579# were built with a release of this library that exported the current
1580# interface number, current, or any of the previous two interfaces.
1581# By definition age must be less than or equal to current. At the outset,
1582# only the first ever interface is implemented, so age can only be `0'.
ef0c727b 1583#--------------------------------------------------------------------
d16cf8a5 1584
8c5adf3a 1585NETXMS_LIBRARY_VERSION=0:2:0
c7d14846 1586AC_SUBST(NETXMS_LIBRARY_VERSION)
d16cf8a5 1587
ef0c727b
VK
1588
1589#--------------------------------------------------------------------
1590# Generate output files
1591#--------------------------------------------------------------------
d16cf8a5
AK
1592
1593AC_CONFIG_FILES([
ef0c727b 1594 README
0c3c0c39
AK
1595 Makefile
1596 contrib/Makefile
0c3c0c39 1597 contrib/startup/Makefile
daaefaaf 1598 contrib/startup/gentoo/Makefile
0c3c0c39 1599 contrib/startup/redhat/Makefile
5de3893d 1600 contrib/startup/suse/Makefile
9993edf4 1601 contrib/startup/ubuntu/Makefile
82fa7c5d 1602 contrib/mibs/Makefile
3f2f9f2b 1603 contrib/backgrounds/Makefile
0c3c0c39 1604 doc/Makefile
a48203d2
VK
1605 doc/internal/Makefile
1606 doc/manuals/Makefile
1607 doc/misc/Makefile
0c3c0c39
AK
1608 images/Makefile
1609 include/Makefile
1610 m4/Makefile
1611 netware/Makefile
1612 sql/Makefile
0c3c0c39 1613 src/Makefile
8817f620 1614 src/sqlite/Makefile
80ce37ac
VK
1615 src/libexpat/Makefile
1616 src/libexpat/libexpat/Makefile
0c3c0c39 1617 src/libnetxms/Makefile
0c3c0c39 1618 src/libnxcl/Makefile
aa8d6795 1619 src/libnxlp/Makefile
c002b04a 1620 src/libnxsl/Makefile
1d410d50 1621 src/libnxmap/Makefile
1b1edd49
VK
1622 src/install/Makefile
1623 src/install/windows/Makefile
c2612d83 1624 src/client/Makefile
551592f4 1625 src/client/install/Makefile
c94fa5c2 1626 src/client/nxalarm/Makefile
e84701c5
VK
1627 src/client/nxevent/Makefile
1628 src/client/nxpush/Makefile
59ffa5b7 1629 src/client/nxsms/Makefile
23c8c53e
AK
1630 src/client/windows/nxuilib/Makefile
1631 src/client/windows/nxuilib/res/Makefile
1632 src/client/windows/nxuilib/sounds/Makefile
d9db1c72 1633 src/client/nxlexer/Makefile
23c8c53e
AK
1634 src/client/windows/nxcon/Makefile
1635 src/client/windows/nxcon/icons/Makefile
1636 src/client/windows/nxcon/res/Makefile
23c8c53e
AK
1637 src/client/windows/nxav/Makefile
1638 src/client/windows/nxav/res/Makefile
1639 src/client/windows/nxnotify/Makefile
1640 src/client/windows/nxnotify/res/Makefile
b6e8dffe 1641 src/nxcptest/Makefile
f519aa3e 1642 src/nxscript/Makefile
d1834406
VK
1643 src/db/Makefile
1644 src/db/dbdrv/Makefile
1645 src/db/dbdrv/odbc/Makefile
1646 src/db/dbdrv/mssql/Makefile
1647 src/db/dbdrv/mysql/Makefile
1648 src/db/dbdrv/pgsql/Makefile
1649 src/db/dbdrv/sqlite/Makefile
1650 src/db/dbdrv/oracle/Makefile
1651 src/db/libnxdb/Makefile
0c3c0c39
AK
1652 src/server/Makefile
1653 src/server/core/Makefile
d770a97c
VK
1654 src/server/include/Makefile
1655 src/server/libnxsrv/Makefile
1656 src/server/netxmsd/Makefile
d8f2e39b
VK
1657 src/server/smsdrv/Makefile
1658 src/server/smsdrv/generic/Makefile
91369aca 1659 src/server/smsdrv/nxagent/Makefile
0c3c0c39
AK
1660 src/server/tools/Makefile
1661 src/server/tools/nxget/Makefile
1662 src/server/tools/nxaction/Makefile
1663 src/server/tools/nxadm/Makefile
5b0c7d0d
VK
1664 src/server/tools/nxconfig/Makefile
1665 src/server/tools/nxconfig/res/Makefile
f90d7fc5 1666 src/server/tools/nxdbmgr/Makefile
4e2debcc 1667 src/server/tools/nxencpasswd/Makefile
d24fdaf4 1668 src/server/tools/nxupload/Makefile
c5c0f362
VK
1669 src/snmp/Makefile
1670 src/snmp/libnxsnmp/Makefile
1671 src/snmp/nxmibc/Makefile
1672 src/snmp/nxsnmpget/Makefile
1673 src/snmp/nxsnmpset/Makefile
1674 src/snmp/nxsnmpwalk/Makefile
0c3c0c39
AK
1675 src/agent/Makefile
1676 src/agent/core/Makefile
5795bf90 1677 src/agent/install/Makefile
0c3c0c39
AK
1678 src/agent/subagents/Makefile
1679 src/agent/subagents/linux/Makefile
1680 src/agent/subagents/sunos/Makefile
d0b5a098 1681 src/agent/subagents/aix/Makefile
9bdf494f 1682 src/agent/subagents/hpux/Makefile
0c3c0c39
AK
1683 src/agent/subagents/skeleton/Makefile
1684 src/agent/subagents/freebsd/Makefile
992ba479 1685 src/agent/subagents/openbsd/Makefile
ad0f1ada 1686 src/agent/subagents/netbsd/Makefile
2b23dc1e 1687 src/agent/subagents/ipso/Makefile
0c3c0c39 1688 src/agent/subagents/netware/Makefile
1bc607cc
VK
1689 src/agent/subagents/winnt/Makefile
1690 src/agent/subagents/win9x/Makefile
0c3c0c39 1691 src/agent/subagents/winperf/Makefile
3737b4b9 1692 src/agent/subagents/wmi/Makefile
93f15c2a 1693 src/agent/subagents/portCheck/Makefile
abc48356 1694 src/agent/subagents/ping/Makefile
dbca7ed1 1695 src/agent/subagents/sms/Makefile
2f06a66e 1696 src/agent/subagents/ups/Makefile
539ab0c3
AK
1697 src/agent/subagents/ecs/Makefile
1698 src/agent/subagents/odbcquery/Makefile
0d362f93 1699 src/agent/subagents/logwatch/Makefile
e02b69b9 1700 src/webui/Makefile
420d9ecf
AK
1701 src/webui/nxhttpd/Makefile
1702 src/webui/nxhttpd/static/Makefile
1703 src/webui/nxhttpd/static/images/Makefile
1704 src/webui/nxhttpd/static/images/buttons/Makefile
1705 src/webui/nxhttpd/static/images/buttons/normal/Makefile
1706 src/webui/nxhttpd/static/images/buttons/pressed/Makefile
1707 src/webui/nxhttpd/static/images/ctrlpanel/Makefile
1708 src/webui/nxhttpd/static/images/objects/Makefile
1709 src/webui/nxhttpd/static/images/status/Makefile
0c3c0c39 1710 tools/Makefile
d16cf8a5
AK
1711])
1712
12249937
VK
1713AC_OUTPUT
1714
ef0c727b 1715echo "Updating libtool"
5cecf50e
AK
1716sed 's,$SED -e "/${host}-//g",$SED -e "s/${host}-//g",g' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
1717
779ce551
VK
1718# On HP-UX, libtool passes +b instead of -Wl,+b even if gcc/g++ used as linker
1719if test "x$CC" = "xgcc" && test "x$PLATFORM" = "xHP-UX"; then
1720 sed "s,hardcode_libdir_flag_spec_ld=,#hardcode_libdir_flag_spec_ld=,g" < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
1721fi
1722
ef0c727b
VK
1723#--------------------------------------------------------------------
1724# Print summary
1725#--------------------------------------------------------------------
a7442678 1726
a7442678
AK
1727echo
1728echo
1729echo
1730echo '---------------------------------------------------------------------'
1731echo ' Configure results'
1732echo '---------------------------------------------------------------------'
1733echo
8b86c5dc 1734 echo "Prefix : ${prefix}"
a7442678 1735if test "x${BUILD_SERVER}" = "xyes"; then
8b86c5dc 1736 echo "Build Server : YES"
a7442678 1737else
8b86c5dc 1738 echo "Build Server : NO"
a7442678
AK
1739fi
1740if test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"; then
8b86c5dc 1741 echo "Encryption enabled : YES"
a7442678 1742else
8b86c5dc 1743 echo "Encryption enabled : NO"
a7442678
AK
1744fi
1745if test "x${DB_DRIVERS}" != "x"; then
8b86c5dc 1746 echo "Build DB-Drivers :${DB_DRIVERS}"
a7442678 1747else
8b86c5dc 1748 echo "Build DB-Drivers : NO"
a7442678
AK
1749fi
1750if test "x${BUILD_CLIENT}" = "xyes"; then
8b86c5dc 1751 echo "Build Clients : YES"
a7442678 1752else
8b86c5dc 1753 echo "Build Clients : NO"
a7442678 1754fi
ef0c727b 1755if test "x${BUILD_NXHTTPD}" = "xyes"; then
8b86c5dc 1756 echo "Build Web Interface : YES"
2654e540 1757else
8b86c5dc 1758 echo "Build Web Interface : NO"
2654e540 1759fi
a7442678 1760if test "x${BUILD_AGENT}" = "xyes"; then
8b86c5dc
VK
1761 echo "Build Agent : YES"
1762 echo "Subagents list : ${SUBAGENT_DIRS}"
a7442678 1763else
8b86c5dc 1764 echo "Build Agent : NO"
a7442678 1765fi
e8636669 1766if test "x${BUILD_STATIC_AGENT}" = "xyes"; then
8b86c5dc
VK
1767 echo "Build Static Agent : YES"
1768 echo "Subagents list : ${STATIC_SUBAGENT_LIST}"
e8636669 1769else
8b86c5dc 1770 echo "Build Static Agent : NO"
e8636669 1771fi
8b86c5dc
VK
1772if test "x${BUILD_UNICODE}" = "xyes"; then
1773 echo "Build UNICODE libraries : YES"
1774else
1775 echo "Build UNICODE libraries : NO"
1776fi
551ec9ca
VK
1777if test "x${HAVE_LIBEXPAT}" = "xno"; then
1778 echo "Use internal libexpat : YES"
1bb6b449 1779else
551ec9ca 1780 echo "Use internal libexpat : NO"
1bb6b449 1781fi
7d8c91ef
VK
1782
1783echo "CPPFLAGS : ${CPPFLAGS}"
1784echo "CXXFLAGS : ${CXXFLAGS}"
1785echo "CFLAGS : ${CFLAGS}"
1786echo "LDFLAGS : ${LDFLAGS}"
1787
6fce76d8
VK
1788if test "x${MYSQL_LIBS}" != "x"; then
1789 echo "MySQL libs : ${MYSQL_LIBS}"
1790fi
1791if test "x${PGSQL_LIBS}" != "x"; then
1792 echo "PostgreSQL libs : ${PGSQL_LIBS}"
1793fi
7d8c91ef
VK
1794if test "x${ORACLE_LIBS}" != "x"; then
1795 echo "Oracle libs : ${ORACLE_LIBS}"
1796fi
6fce76d8
VK
1797if test "x${ODBC_LIBS}" != "x"; then
1798 echo "ODBC libs : ${ODBC_LIBS}"
1799fi
1800