- Agent compiles and runs on HP-UX 11.23 on Itanium (using gcc)
[public/netxms.git] / configure.ac
CommitLineData
779ce551 1# $Id: configure.ac,v 1.252 2007-06-28 09:14:04 victor Exp $
d16cf8a5 2#
ef0c727b
VK
3# NetXMS - Network Management System
4# Configure script
d16cf8a5
AK
5#
6
27f31788 7AC_INIT([NetXMS], [0.2.18], [NetXMS Team <bugs@netxms.org>])
ba1d810c
AK
8AC_CONFIG_AUX_DIR(config)
9AM_CONFIG_HEADER(config.h)
d16cf8a5
AK
10AM_INIT_AUTOMAKE
11
5387ff75 12
ef0c727b
VK
13#--------------------------------------------------------------------
14# Functions
15#--------------------------------------------------------------------
5387ff75 16
ef0c727b
VK
17check_substr()
18{
1010cff7 19 for w in $1; do
ef0c727b
VK
20 if test "x$w" = "x$2"; then
21 return 0;
22 fi
23 done
24 return 1
25}
16dff090 26
d3c8926d 27
ef0c727b
VK
28#--------------------------------------------------------------------
29# Initialize variables
30#--------------------------------------------------------------------
d3c8926d 31
ef0c727b
VK
32PLATFORM=`uname -s`
33COMPONENTS=""
34DISABLE_ICONV="no"
35DISABLE_ENCRYPTION="no"
36ENABLE_UNSTABLE="no"
37STATIC_BUILD="no"
38DBDRIVER_SELECTED="no"
39USE_PTH="no"
40BUILD_SERVER="no"
41BUILD_AGENT="no"
42BUILD_CLIENT="no"
43BUILD_NXHTTPD="no"
44BUILD_STATIC_AGENT="no"
45NEED_ZLIB="no"
46MODULES=""
ef0c727b
VK
47STATIC_SUBAGENT_LIST=""
48SUBAGENT_DIRS=""
49SUBAGENT_LIBS=""
50UNSTABLE_SUBAGENT_DIRS=""
51SERVER_TOOLS=""
52TOP_LEVEL_MODULES=""
53CONTRIB_MODULES=""
d3c8926d 54
16dff090 55
ef0c727b
VK
56#--------------------------------------------------------------------
57# Parse command line parameters
58#--------------------------------------------------------------------
7c9c94a7 59
ef0c727b
VK
60AC_ARG_WITH(server,
61[AS_HELP_STRING(--with-server,build server)],
62[
63 COMPONENTS="$COMPONENTS server agent"
64])
7c9c94a7 65
ef0c727b
VK
66AC_ARG_WITH(client,
67[AS_HELP_STRING(--with-client,build client library and tools)],
68[
69 COMPONENTS="$COMPONENTS client"
70])
d16cf8a5 71
ef0c727b
VK
72AC_ARG_WITH(agent,
73[AS_HELP_STRING(--with-agent,build agent)],
74[
75 COMPONENTS="$COMPONENTS agent"
76])
d16cf8a5 77
ef0c727b
VK
78AC_ARG_WITH(static-agent,
79[AS_HELP_STRING(--with-static-agent,build statically linked agent)],
80[
81 COMPONENTS="$COMPONENTS static-agent"
82])
d16cf8a5 83
ef0c727b
VK
84AC_ARG_WITH(ipso-agent,
85[AS_HELP_STRING(--with-ipso-agent,build statically linked IPSO agent)],
86[
87 COMPONENTS="$COMPONENTS ipso-agent"
88])
521d90e7 89
ef0c727b
VK
90AC_ARG_WITH(nxhttpd,
91[AS_HELP_STRING(--with-nxhttpd,build web interface)],
92[
93 COMPONENTS="$COMPONENTS nxhttpd"
9adfeefb
AK
94
95 AC_CHECK_HEADER(gd.h,,AC_MSG_ERROR([*** GD support not installed - please install first ***]))
96 AC_CHECK_LIB(gd, gdImageCreate, [], [
97 AC_MSG_ERROR(libgd is required for web interface)
98 ])
ef0c727b 99])
d16cf8a5 100
ef0c727b
VK
101AC_ARG_WITH(mdebug,
102[AS_HELP_STRING(--with-mdebug,use debug version of memory allocation functions)],
103[
104 CPPFLAGS="$CPPFLAGS -DNETXMS_MEMORY_DEBUG"
105])
d16cf8a5 106
9486b324
VK
107AC_ARG_WITH(sqlite,
108[AS_HELP_STRING(--with-sqlite,build SQLite database driver)],
109[ if test "x$withval" != "xno" ; then
110 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
111 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
112 LDFLAGS="$LDFLAGS -L${withval}/lib"
113 CPPFLAGS="$CPPFLAGS -I${withval}/include"
ef0c727b
VK
114 fi
115 COMPONENTS="$COMPONENTS sqlite"
116 DBDRIVER_SELECTED="yes"
9486b324
VK
117fi ])
118
c4b88c3d
VK
119AC_ARG_WITH(odbc,
120[AS_HELP_STRING(--with-odbc,build ODBC database driver)],
121[ if test "x$withval" != "xno" ; then
122 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
123 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
124 LDFLAGS="$LDFLAGS -L${withval}/lib"
125 CPPFLAGS="$CPPFLAGS -I${withval}/include"
ef0c727b
VK
126 fi
127 COMPONENTS="$COMPONENTS odbc"
128 DBDRIVER_SELECTED="yes"
c4b88c3d
VK
129fi ])
130
d16cf8a5 131AC_ARG_WITH(mysql,
c4b88c3d 132[AS_HELP_STRING(--with-mysql,build MySQL database driver)],
d16cf8a5
AK
133[ if test "x$withval" != "xno" ; then
134 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
135 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
136 LDFLAGS="$LDFLAGS -L${withval}/lib -L${withval}/lib/mysql -L${withval}/mysql/lib"
6693a1d0 137 CPPFLAGS="$CPPFLAGS -I${withval}/include -I${withval}/include/mysql -I${withval}/mysql/include"
d16cf8a5 138 else
007ae516
VK
139 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}"
140 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 141 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 142 fi
ef0c727b
VK
143 COMPONENTS="$COMPONENTS mysql"
144 DBDRIVER_SELECTED="yes"
6693a1d0 145fi ])
d16cf8a5
AK
146
147AC_ARG_WITH(pgsql,
c4b88c3d 148[AS_HELP_STRING(--with-pgsql,build PostgreSQL database driver)],
d16cf8a5 149[ if test "x$withval" != "xno" ; then
6693a1d0
AK
150 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
151 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
152 LDFLAGS="$LDFLAGS -L${withval}/lib -L${withval}/lib/pgsql -L${withval}/lib/postgresql -L${withval}/pgsql/lib -L${withval}/postgresql/lib"
153 CPPFLAGS="$CPPFLAGS -I${withval}/include -I${withval}/include/pgsql -I${withval}/include/postgresql -I${withval}/pgsql/include -I${withval}/postgresql/include"
154 else
007ae516
VK
155 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}"
156 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
157 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"
158 fi
ef0c727b
VK
159 COMPONENTS="$COMPONENTS pgsql"
160 DBDRIVER_SELECTED="yes"
6693a1d0 161fi ])
d16cf8a5 162
ef0c727b 163AC_ARG_WITH(openssl,
1010cff7
VK
164[AS_HELP_STRING(--with-openssl,specify OpenSSL location)],
165[
166 if test "x$withval" != "xno" ; then
167 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
168 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
169 LDFLAGS="$LDFLAGS -L${withval}/lib"
170 CPPFLAGS="$CPPFLAGS -I${withval}/include"
171 else
172 LD_RUN_PATH="/usr/local/lib:/opt/openssl/lib:/usr/local/ssl/lib:${LD_RUN_PATH:+:}${LD_RUN_PATH}"
173 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/opt/openssl/lib"
174 CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/opt/openssl/include"
ef0c727b 175 fi
1010cff7
VK
176 fi
177 REQUIRE_ENCRYPTION="yes"
178])
ef0c727b
VK
179
180AC_ARG_ENABLE(iconv,
181[AS_HELP_STRING(--disable-iconv,do not use iconv() for text conversions)],
3a7ce527 182[
ef0c727b 183 DISABLE_ICONV="yes"
3a7ce527 184])
3a7ce527 185
ef0c727b
VK
186AC_ARG_ENABLE(encryption,
187[AS_HELP_STRING(--disable-encryption,disable encryption support)],
e0760102 188[
ef0c727b 189 DISABLE_ENCRYPTION="yes"
e0760102
VK
190])
191
ef0c727b
VK
192AC_ARG_ENABLE(unstable,
193[AS_HELP_STRING(--enable-unstable,build experimental/unstable components)],
d8ca9c03 194[
ef0c727b 195 ENABLE_UNSTABLE="yes"
d8ca9c03
VK
196])
197
ef0c727b
VK
198AC_ARG_WITH(dist,
199[AS_HELP_STRING(--with-dist,for maintainers only)],
68e4e62d 200 DB_DRIVERS=" mysql pgsql odbc mssql sqlite oracle"
ef0c727b
VK
201 MODULES="libnxsnmp libnxsl server agent libnxmap libnxcl nxevent nxpush nxreport nxmibc console nxhttpd nxscript"
202 SUBAGENT_DIRS="linux freebsd openbsd sunos aix ipso hpux"
203 NXCONFIG="nxconfig"
204 TOP_LEVEL_MODULES="sql images"
205 CONTRIB_MODULES="mibs backgrounds"
539ab0c3 206 UNSTABLE_SUBAGENT_DIRS="logscan odbcquery"
ef0c727b
VK
207 SERVER_TOOLS="nxconfig"
208)
209
d8ca9c03 210
ef0c727b
VK
211#--------------------------------------------------------------------
212# Validate command line parameters and set various checking options
213#--------------------------------------------------------------------
214
215check_substr "$COMPONENTS" "static-agent"
1010cff7 216if test $? = 0; then
ef0c727b
VK
217 if test "x$COMPONENTS" != "x static-agent"; then
218 AC_MSG_ERROR(Static agent and other components are mutally exclusive.)
219 fi
220 STATIC_BUILD="yes"
221 BUILD_STATIC_AGENT="yes"
0c3c0c39 222 MODULES="$MODULES agent"
3a6979cf 223 DISABLE_ICONV="yes"
ef0c727b 224 CPPFLAGS="$CPPFLAGS -D_STATIC_AGENT"
e8636669 225
ef0c727b 226 case "$PLATFORM" in
e8636669
VK
227 Linux)
228 SUBAGENT_DIRS="linux"
d0b5a098
VK
229 SUBAGENT_LIBS="../subagents/linux/libnsm_linux.la"
230 STATIC_SUBAGENT_LIST="linux $STATIC_SUBAGENT_LIST"
e8636669
VK
231 ;;
232 FreeBSD)
233 SUBAGENT_DIRS="freebsd"
d0b5a098
VK
234 SUBAGENT_LIBS="../subagents/freebsd/libnsm_freebsd.la"
235 STATIC_SUBAGENT_LIST="freebsd $STATIC_SUBAGENT_LIST"
e8636669 236 ;;
992ba479
AK
237 OpenBSD)
238 SUBAGENT_DIRS="openbsd"
239 SUBAGENT_LIBS="../subagents/openbsd/libnsm_openbsd.la"
240 STATIC_SUBAGENT_LIST="openbsd $STATIC_SUBAGENT_LIST"
241 ;;
e8636669
VK
242 SunOS)
243 SUBAGENT_DIRS="sunos"
d0b5a098
VK
244 SUBAGENT_LIBS="../subagents/sunos/libnsm_sunos.la"
245 STATIC_SUBAGENT_LIST="sunos $STATIC_SUBAGENT_LIST"
246 ;;
247 AIX)
248 SUBAGENT_DIRS="aix"
249 SUBAGENT_LIBS="../subagents/aix/libnsm_aix.la"
250 STATIC_SUBAGENT_LIST="aix $STATIC_SUBAGENT_LIST"
e8636669 251 ;;
c29360a9
VK
252 HP-UX)
253 SUBAGENT_DIRS="hpux"
254 SUBAGENT_LIBS="../subagents/hpux/libnsm_hpux.la"
255 STATIC_SUBAGENT_LIST="hpux $STATIC_SUBAGENT_LIST"
256 ;;
e8636669
VK
257 *)
258 # unknown
259 ;;
260 esac
ef0c727b 261fi
2b23dc1e 262
ef0c727b 263check_substr "$COMPONENTS" "ipso-agent"
1010cff7 264if test $? = 0; then
ef0c727b
VK
265 if test "x$COMPONENTS" != "x static-agent"; then
266 AC_MSG_ERROR(IPSO agent and other components are mutally exclusive.)
267 fi
268 STATIC_BUILD="yes"
269 BUILD_STATIC_AGENT="yes"
3a6979cf 270 DISABLE_ICONV="yes"
ef0c727b
VK
271 USE_PTH="yes"
272 MODULES="$MODULES agent"
273 CPPFLAGS="$CPPFLAGS -D_STATIC_AGENT -D_IPSO -D_USE_GNU_PTH -I/usr/local/include"
274 LDFLAGS="$LDFLAGS -all-static"
275 STATIC_SUBAGENT_LIST="ipso ping portcheck ups"
276 SUBAGENT_DIRS="ipso"
277 SUBAGENT_LIBS="../subagents/ipso/libnsm_ipso.la ../subagents/ping/libnsm_ping.la ../subagents/portCheck/libnsm_portCheck.la ../subagents/ups/libnsm_ups.la"
278fi
c688d2a7 279
ef0c727b 280check_substr "$COMPONENTS" "server"
1010cff7 281if test $? = 0; then
ef0c727b
VK
282 if test "x$DBDRIVER_SELECTED" != "xyes"; then
283 AC_MSG_ERROR(You must select at least one database driver when building server.)
284 fi
285 BUILD_SERVER="yes"
286 NEED_ZLIB="yes"
287 MODULES="$MODULES libnxmap libnxsnmp libnxsl server nxmibc nxscript"
288 TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES sql images"
289 CONTRIB_MODULES="$CONTRIB_MODULES mibs backgrounds"
290fi
dff54fed 291
ef0c727b 292check_substr "$COMPONENTS" "client"
1010cff7 293if test $? = 0; then
ef0c727b
VK
294 BUILD_CLIENT="yes"
295 NEED_ZLIB="yes"
296 MODULES="$MODULES libnxmap libnxcl nxevent nxpush nxreport console"
297fi
0c3c0c39 298
ef0c727b 299check_substr "$COMPONENTS" "agent"
1010cff7 300if test $? = 0; then
ef0c727b
VK
301 BUILD_AGENT="yes"
302 MODULES="$MODULES agent"
303 if test "x$ENABLE_UNSTABLE" = "xyes"; then
539ab0c3 304 UNSTABLE_SUBAGENT_DIRS="logscan odbcquery"
987b646a 305 fi
1010cff7
VK
306
307 case "$PLATFORM" in
308 Linux)
309 SUBAGENT_DIRS="linux"
310 ;;
311 FreeBSD)
312 SUBAGENT_DIRS="freebsd"
313 ;;
314 OpenBSD)
315 SUBAGENT_DIRS="openbsd"
316 ;;
317 SunOS)
318 SUBAGENT_DIRS="sunos"
319 ;;
320 AIX)
321 SUBAGENT_DIRS="aix"
322 ;;
323 HP-UX)
324 SUBAGENT_DIRS="hpux"
325 ;;
326 *)
327 # unknown
328 ;;
329 esac
ef0c727b 330fi
b97191d2 331
ef0c727b 332check_substr "$COMPONENTS" "nxhttpd"
1010cff7 333if test $? = 0; then
ef0c727b
VK
334 BUILD_NXHTTPD="yes"
335 MODULES="$MODULES libnxmap libnxcl nxhttpd"
336fi
b67a9e12 337
ef0c727b 338check_substr "$COMPONENTS" "mysql"
1010cff7 339if test $? = 0; then
ef0c727b 340 DB_DRIVERS="$DB_DRIVERS mysql"
b67a9e12 341fi
6619a6b0 342
ef0c727b 343check_substr "$COMPONENTS" "pgsql"
1010cff7 344if test $? = 0; then
ef0c727b
VK
345 DB_DRIVERS="$DB_DRIVERS pgsql"
346fi
e8636669 347
ef0c727b 348check_substr "$COMPONENTS" "sqlite"
1010cff7 349if test $? = 0; then
ef0c727b 350 DB_DRIVERS="$DB_DRIVERS sqlite"
e8636669
VK
351fi
352
ef0c727b 353check_substr "$COMPONENTS" "odbc"
1010cff7 354if test $? = 0; then
ef0c727b
VK
355 DB_DRIVERS="$DB_DRIVERS odbc"
356fi
357
358
359#--------------------------------------------------------------------
360# Check for programs
361#--------------------------------------------------------------------
362
363if test "x$PLATFORM" = "xHP-UX"; then
e7d9c4ae 364 AC_CHECK_PROG([CCC], [aCC], [aCC])
ef0c727b
VK
365fi
366AC_PROG_CC(aCC gcc cc cl)
367AC_PROG_CPP
368AC_PROG_CXX
369AC_PROG_INSTALL
370AC_PROG_LEX
371AC_PROG_YACC
372AC_PROG_LN_S
373
374AC_ARG_VAR(PERL,local path to the perl interpreter)
375perl_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/perl/bin:/opt/perl/usr/bin:/opt/perl/usr/local/bin"
376AC_PATH_PROG(PERL,perl,/usr/bin/env perl,$perl_possible_path)
377
378
379#--------------------------------------------------------------------
380# Initialize libtool
381#--------------------------------------------------------------------
382
383if test "x$STATIC_BUILD" = "xyes"; then
384 enable_shared=no
385 enable_static=yes
386else
387 enable_shared=yes
388 enable_static=no
389fi
e8636669
VK
390AC_LIBTOOL_DLOPEN
391AC_PROG_LIBTOOL
3a7ce527 392
d16cf8a5 393
ef0c727b
VK
394#--------------------------------------------------------------------
395# C/C++ capabilities
396#--------------------------------------------------------------------
397
398AC_C_CONST
399AC_PROG_GCC_TRADITIONAL
1d9cc60e 400AC_C_BIGENDIAN
ef0c727b
VK
401
402
403#--------------------------------------------------------------------
404# Platform-dependent settings
405#--------------------------------------------------------------------
406
407case "$PLATFORM" in
408 AIX)
409 LDFLAGS="-no-undefined $LDFLAGS"
410 ;;
411 HP-UX)
412 CPPFLAGS="$CPPFLAGS -D_HPUX -D_HPUX_SOURCE -D_POSIX_PTHREAD_SEMANTICS -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED=1"
413 if test "x$CXX" = "xaCC"; then
414 CXXFLAGS="-mt $CXXFLAGS +W749 +W829"
415 LDFLAGS="$LDFLAGS -mt"
416 fi
417 ;;
418 *)
419 ;;
420esac
421
422
423#--------------------------------------------------------------------
c90d3610
VK
424# C++ compiler tuning:
425# * Disable C++ exceptions
426# * Disable compiling string constants as "const char *"
427# * Disable some GCC warnings
779ce551 428# * Turn on 64bit mode on HP-UX/Itanium
ef0c727b
VK
429#--------------------------------------------------------------------
430
431if test "x$CC" = "xgcc" ; then
432
433 AC_LANG_PUSH([C++])
434
435 AC_MSG_CHECKING(whether C++ compiler accepts -fno-rtti)
436 OLD_CXXFLGAS="$CXXFLAGS"
437 CXXFLAGS="$CXXFLAGS -fno-rtti"
438 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
439 [ AC_MSG_RESULT(yes) ],
440 [
441 CXXFLAGS="$OLD_CXXFLAGS"
442 AC_MSG_RESULT(no)
443 ])
444
445 AC_MSG_CHECKING(whether C++ compiler accepts -fno-exceptions)
446 OLD_CXXFLGAS="$CXXFLAGS"
447 CXXFLAGS="$CXXFLAGS -fno-exceptions"
448 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
449 [ AC_MSG_RESULT(yes) ],
450 [
451 CXXFLAGS="$OLD_CXXFLAGS"
452 AC_MSG_RESULT(no)
453 ])
454
c90d3610
VK
455 AC_MSG_CHECKING(whether C++ compiler accepts -fno-const-strings)
456 OLD_CXXFLGAS="$CXXFLAGS"
457 CXXFLAGS="$CXXFLAGS -fno-const-strings"
458 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
459 [ AC_MSG_RESULT(yes) ],
460 [
461 CXXFLAGS="$OLD_CXXFLAGS"
462 AC_MSG_RESULT(no)
463 ])
464
465 AC_MSG_CHECKING(whether C++ compiler accepts -Wno-deprecated)
466 OLD_CXXFLGAS="$CXXFLAGS"
467 CXXFLAGS="$CXXFLAGS -Wno-deprecated"
468 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
469 [ AC_MSG_RESULT(yes) ],
470 [
471 CXXFLAGS="$OLD_CXXFLAGS"
472 AC_MSG_RESULT(no)
473 ])
474
ef0c727b
VK
475 AC_LANG_POP([C++])
476
779ce551
VK
477 if test "x$PLATFORM" = "xHP-UX"; then
478 AC_MSG_CHECKING(whether C compiler accepts -mlp64)
479 OLD_CPPFLGAS="$CPPFLAGS"
480 CPPFLAGS="$CPPFLAGS -mlp64"
481 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
482 [
483 LDFLAGS="-mlp64 -L/usr/lib/hpux64 -L/usr/local/lib/hpux64 $LDFLAGS"
484 AC_MSG_RESULT(yes)
485 ],
486 [
487 CPPFLAGS="$OLD_CPPFLAGS"
488 AC_MSG_RESULT(no)
489 ])
490 fi
491
ef0c727b
VK
492fi
493
494
495#--------------------------------------------------------------------
496# Additional include and library directories
497#--------------------------------------------------------------------
498
499if test -d /usr/local/include; then
500 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
501fi
502
503if test -d /usr/kerberos/include; then
504 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
505fi
506
507if test -d /usr/local/lib; then
508 LDFLAGS="$LDFLAGS -L/usr/local/lib"
509fi
510
511
512#--------------------------------------------------------------------
513# Check for threads library - either POSIX or GNU
514#--------------------------------------------------------------------
515
516if test "x$USE_PTH" = "xyes"; then
517 AC_CHECK_HEADER(pth.h,,AC_MSG_ERROR([*** GNU Pth thread support not installed - please install first ***]))
518else
519 AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed - please install first ***]))
520
521 if test "x$CXX" = "xaCC"; then
522 PTHREAD_LIBS=""
523 else
524 PTHREAD_LIBS="error"
525 AC_MSG_CHECKING(for old style FreeBSD -pthread flag)
526 AC_EGREP_CPP(yes,
527 [#if defined(__FreeBSD_cc_version) || defined(__OpenBSD__)
528 yes
529 #endif
530 ], AC_MSG_RESULT(yes)
531 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" PTHREAD_LIBS="-pthread",
532 AC_MSG_RESULT(no))
533 if test "x$PTHREAD_LIBS" = "xerror"; then
534 AC_CHECK_LIB(pthread, pthread_attr_init,
535 PTHREAD_LIBS="-lpthread")
536 fi
537 if test "x$PTHREAD_LIBS" = "xerror"; then
538 AC_CHECK_LIB(pthreads, pthread_attr_init,
539 PTHREAD_LIBS="-lpthreads")
540 fi
541 if test "x$PTHREAD_LIBS" = "xerror"; then
542 AC_CHECK_FUNC(pthread_attr_init,
543 PTHREAD_LIBS="")
544 fi
545 fi
546
547 if test "x$PTHREAD_LIBS" = "xerror"; then
548 AC_MSG_ERROR(*** Unable to locate working posix thread library ***)
549 fi
550 LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
551
552 # Extensions to posix threads
553 AC_CHECK_HEADERS([pthread_np.h],,,[
9c29f76e 554#include <pthread.h>
ef0c727b
VK
555 ])
556 AC_CHECK_FUNCS([pthread_cond_reltimedwait_np])
557
558 # Check for recursive mutexes
559 AC_CHECK_FUNCS([pthread_mutexattr_settype pthread_mutexattr_setkind_np])
560 AC_CHECK_DECLS([PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_RECURSIVE_NP, MUTEX_TYPE_COUNTING_FAST],,,[
9c29f76e
VK
561#include <pthread.h>
562#if HAVE_PTHREAD_NP_H
563#include <pthread_np.h>
564#endif
ef0c727b
VK
565 ])
566
567 # Check for read/write locks
568 # On Linux, rwlock functions declared always, but pthread_rwlock_t may need
569 # additional defines
570 AC_CHECK_FUNCS([pthread_rwlock_init pthread_rwlock_timedrdlock pthread_rwlock_timedwrlock])
571 if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then
572 AC_CACHE_CHECK([for pthread_rwlock_t], ac_cv_struct_pthread_rw,
9c29f76e
VK
573 [AC_TRY_COMPILE([
574#include <sys/types.h>
575#include <pthread.h>
576 ],
ef0c727b
VK
577 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
578 ac_cv_struct_pthread_rw=yes, [
9c29f76e
VK
579 AC_TRY_COMPILE([
580#define _XOPEN_SOURCE 500
581#include <sys/types.h>
582#include <pthread.h>
583 ],
ef0c727b
VK
584 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
585 ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
586 if test "$ac_cv_struct_pthread_rw" = "yes"; then
587 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
588 fi
589 ])])
590 if test "$ac_cv_struct_pthread_rw" = "yes"; then
591 AC_DEFINE(HAVE_PTHREAD_RWLOCK, 1, Define to 1 if you have working pthread read/write locks)
592 fi
593 fi
594
595fi
596
597
598#--------------------------------------------------------------------
599# Checks for OpenSSL
600#--------------------------------------------------------------------
601
602if test "x$DISABLE_ENCRYPTION" != "xyes" ; then
603 AC_CHECK_LIB(crypto, RSA_new,
604 [
605 AC_DEFINE(WITH_OPENSSL,,[with openssl])
606 AC_CHECK_LIB(crypto, EVP_aes_256_cbc,
607 [], [AC_DEFINE(NETXMS_NO_AES,,[desc])])
608 AC_CHECK_LIB(crypto, EVP_bf_cbc,
609 [], [AC_DEFINE(NETXMS_NO_BF,,[desc])])
610 AC_CHECK_LIB(crypto, EVP_idea_cbc,
611 [], [AC_DEFINE(NETXMS_NO_IDEA,,[desc])])
612 AC_CHECK_LIB(crypto, EVP_des_ede3_cbc,
613 [], [AC_DEFINE(NETXMS_NO_DES,,[desc])])
614 ],
615 [
616 if test "x$REQUIRE_ENCRYPTION" = "xyes"; then
617 AC_MSG_ERROR(libcrypto is required for encryption support)
618 else
619 AC_MSG_RESULT(libcrypto is required for encryption support)
620 fi
621 ])
622fi
623
624
625#--------------------------------------------------------------------
626# Checks for other libs.
627#--------------------------------------------------------------------
d16cf8a5 628
779ce551 629AC_CHECK_LIB(xnet, accept)
521d90e7 630AC_CHECK_LIB(socket, if_nameindex)
87bb64a7 631AC_CHECK_LIB(dl, dlopen)
1b3c0ef0 632AC_CHECK_LIB(kstat, kstat_open)
d16cf8a5 633
e0760102
VK
634if test "x$BUILD_SERVER" = "xyes" ; then
635 AC_CHECK_LIB(termcap, tgetstr, [], [AC_CHECK_LIB(ncurses, tgetstr, [], AC_CHECK_LIB(curses, tgetstr))])
636 AC_CHECK_LIB(readline, readline)
637fi
638
ef0c727b
VK
639if test "x$NEED_ZLIB" = "xyes"; then
640 AC_CHECK_HEADER(zlib.h,,AC_MSG_ERROR([*** ZLib development package not installed - please install first ***]))
641 AC_CHECK_LIB(z, deflate)
642fi
643
644
645#--------------------------------------------------------------------
646# Checks for header files
647#--------------------------------------------------------------------
d16cf8a5 648
ef0c727b
VK
649AC_CHECK_HEADERS([sys/types.h sys/stat.h unistd.h stdarg.h fcntl.h])
650AC_CHECK_HEADERS([sys/int_types.h sys/time.h sys/utsname.h])
ca6ad6bb 651AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h net/nh.h sys/socket.h])
70fed300 652AC_CHECK_HEADERS([fcntl.h dirent.h sys/ioctl.h sys/sockio.h poll.h termios.h])
ef0c727b
VK
653AC_CHECK_HEADERS([readline/readline.h byteswap.h sys/select.h])
654AC_CHECK_HEADERS([sys/sysctl.h vm/vm_param.h])
ade50e8b
AK
655AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h],,,
656[[#ifdef HAVE_SYS_TYPES_H
657# include <sys/types.h>
658#endif
659#ifdef HAVE_SYS_TIME_H
660# include <sys/time.h>
661#endif
662#ifdef HAVE_SYS_SOCKET_H
663# include <sys/socket.h>
664#endif
665]])
d16cf8a5 666
ef0c727b
VK
667
668#--------------------------------------------------------------------
669# Checks for data types
670#--------------------------------------------------------------------
671
d16cf8a5
AK
672AC_CHECK_SIZEOF(short)
673AC_CHECK_SIZEOF(int)
674AC_CHECK_SIZEOF(long)
675AC_CHECK_SIZEOF(long long)
676
677AC_TYPE_PID_T
678AC_TYPE_SIGNAL
679AC_TYPE_SIZE_T
680AC_STRUCT_TIMEZONE
681
521d90e7 682AC_CHECK_TYPES([int64_t, uint64_t, u_int64_t])
4c779d83
VK
683AC_CHECK_TYPES([off_t, socklen_t],,,[
684#if HAVE_SYS_TYPES_H
685#include <sys/types.h>
686#endif
687#if HAVE_SYS_SOCKET_H
688#include <sys/socket.h>
689#endif
690])
521d90e7 691
e25cadc9 692
ef0c727b
VK
693#--------------------------------------------------------------------
694# Checks for functions
695#--------------------------------------------------------------------
d16cf8a5
AK
696
697AC_FUNC_ERROR_AT_LINE
d16cf8a5 698AC_FUNC_MEMCMP
d16cf8a5
AK
699AC_FUNC_SELECT_ARGTYPES
700AC_FUNC_STRFTIME
701AC_FUNC_STRTOD
702AC_FUNC_VPRINTF
703
b50f1100
VK
704AC_CHECK_FUNCS([gettimeofday memmove memset strchr strcspn strdup strerror])
705AC_CHECK_FUNCS([strrchr strtol strtoul strtoll strtoull])
467e30e1 706AC_CHECK_FUNCS([if_nametoindex daemon mmap strerror_r scandir uname poll])
8aa1f557 707AC_CHECK_FUNCS([nanosleep getopt_long gmtime_r])
d16cf8a5 708
73d7fbdb
VK
709AC_CHECK_DECLS([getopt_long])
710
f91feddc 711AC_CHECK_FUNCS([sysctlbyname sysctlnametomib])
70fed300
AK
712AC_CHECK_FUNCS([tcgetattr tcsetattr cfsetospeed cfsetispeed])
713
d16cf8a5
AK
714# sockets/resolver (probably for solaris)
715AC_CHECK_FUNC(connect, , [AC_CHECK_LIB(socket, connect)])
716AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(resolv, gethostbyname)])
717AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)])
718
719if test "x$ac_cv_lib_nsl_gethostbyname" != "xyes" && test "x$ac_cv_func_gethostbyname" != "xyes" ; then
720 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(socket, gethostbyname)])
721fi
722
723if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname" ; then
724 AC_MSG_CHECKING([if we can include libnsl + libsocket])
725 LIBS="-lnsl -lsocket $LIBS"
726 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void) gethostbyname]])],[my_ac_link_result=yes],[my_ac_link_result=no ])
727 if test "$my_ac_link_result" = "no" ; then
728 AC_MSG_RESULT([failure])
729 AC_MSG_ERROR([unable to use gethostbyname()])
730 else
731 AC_MSG_RESULT([success])
732 fi
733fi
734
dff54fed 735
ef0c727b
VK
736#--------------------------------------------------------------------
737# Checks for macros and definitions
738#--------------------------------------------------------------------
dff54fed 739
ef0c727b
VK
740AC_CHECK_DECLS([__bswap_32, __bswap_64, htonll, ntohll],,,[
741#ifdef HAVE_SYS_TYPES_H
742# include <sys/types.h>
743#endif
744#if HAVE_BYTESWAP_H
745#include <byteswap.h>
746#endif
747#if HAVE_NETINET_IN_H
748#include <netinet/in.h>
749#endif
750#if HAVE_NET_NH_H
751#include <net/nh.h>
752#endif
753])
dff54fed 754
dff54fed 755
ef0c727b
VK
756#--------------------------------------------------------------------
757# AIX specific checks
758#--------------------------------------------------------------------
d16cf8a5 759
ef0c727b
VK
760if test "x$PLATFORM" = "xAIX"; then
761 AC_CHECK_HEADERS([procinfo.h],,,[[ ]])
762 AC_CHECK_DECLS([getkerninfo])
763 AC_CHECK_FUNCS([getprocs64],,,[
764#if HAVE_PROCINFO_H
765#include <procinfo.h>
6cd41ceb 766#endif
ef0c727b 767 ])
7e56bf2e
VK
768fi
769
cd4c8ca3 770
ef0c727b
VK
771#--------------------------------------------------------------------
772# Check for UNICODE stuff
773#--------------------------------------------------------------------
3e39fcde 774
93571e7f 775AC_CHECK_HEADERS([wchar.h iconv.h])
3e39fcde 776AC_CHECK_SIZEOF(wchar_t)
dff54fed 777
3265ba38 778if test "x$DISABLE_ICONV" != "xyes"; then
dff54fed
VK
779 AC_CHECK_LIB(iconv, iconv,
780 [ ac_found_iconv=yes
781 LDFLAGS="$LDFLAGS -liconv"
782 ])
783 AC_CHECK_FUNCS(iconv, ac_found_iconv=yes, ac_found_iconv=no)
784else
785 ac_found_iconv=no
ef0c727b 786 CPPFLAGS="$CPPFLAGS -D__DISABLE_ICONV"
dff54fed 787fi
93571e7f
VK
788
789AC_MSG_CHECKING(whether iconv supports UCS-2-INTERNAL)
790AC_RUN_IFELSE(
791 [AC_LANG_PROGRAM([
792#if HAVE_ICONV_H
793#include <iconv.h>
794#endif
795 ], [
796 return iconv_open("UTF-8","UCS-2-INTERNAL")==(iconv_t)(-1);
797 ])
798 ],
799 [ AC_MSG_RESULT(yes)
800 AC_DEFINE(HAVE_ICONV_UCS_2_INTERNAL, 1, Define to 1 if iconv supports UCS-2-INTERNAL)
801 valid_ucs2_code="UCS-2-INTERNAL"
802 ],
803 [ AC_MSG_RESULT(no) ],
804 [ AC_MSG_RESULT(no) ]
805)
806
807AC_MSG_CHECKING(whether iconv supports UCS-2)
808AC_RUN_IFELSE(
809 [AC_LANG_PROGRAM([
810#if HAVE_ICONV_H
811#include <iconv.h>
812#endif
813 ], [
814 return iconv_open("UTF-8","UCS-2")==(iconv_t)(-1);
815 ])
816 ],
817 [ AC_MSG_RESULT(yes)
818 AC_DEFINE(HAVE_ICONV_UCS_2, 1, Define to 1 if iconv supports UCS-2)
819 valid_ucs2_code="UCS-2"
820 ],
821 [ AC_MSG_RESULT(no) ],
822 [ AC_MSG_RESULT(yes)
823 AC_DEFINE(HAVE_ICONV_UCS_2, 1, Define to 1 if iconv supports UCS-2)
824 ]
825)
826
827AC_MSG_CHECKING(whether iconv supports UCS2)
828AC_RUN_IFELSE(
829 [AC_LANG_PROGRAM([
830#if HAVE_ICONV_H
831#include <iconv.h>
832#endif
833 ], [
834 return iconv_open("UTF-8","UCS2")==(iconv_t)(-1);
835 ])
836 ],
837 [ AC_MSG_RESULT(yes)
838 AC_DEFINE(HAVE_ICONV_UCS2, 1, Define to 1 if iconv supports UCS2)
839 valid_ucs2_code="UCS2"
840 ],
841 [ AC_MSG_RESULT(no) ],
842 [ AC_MSG_RESULT(no) ]
843)
844
44bccbbc
VK
845AC_MSG_CHECKING(whether iconv supports UCS-2BE)
846AC_RUN_IFELSE(
847 [AC_LANG_PROGRAM([
848#if HAVE_ICONV_H
849#include <iconv.h>
850#endif
851 ], [
852 return iconv_open("UTF-8","UCS-2BE")==(iconv_t)(-1);
853 ])
854 ],
855 [ AC_MSG_RESULT(yes)
856 AC_DEFINE(HAVE_ICONV_UCS_2BE, 1, Define to 1 if iconv supports UCS-2BE)
857 valid_ucs2_code="UCS-2BE"
858 ],
859 [ AC_MSG_RESULT(no) ],
860 [ AC_MSG_RESULT(no) ]
861)
862
5e40a69e
VK
863AC_MSG_CHECKING(whether iconv supports ISO8859-1)
864AC_RUN_IFELSE(
865 [AC_LANG_PROGRAM([
866#if HAVE_ICONV_H
867#include <iconv.h>
868#endif
869 ], [
870 return iconv_open("UTF-8","ISO8859-1")==(iconv_t)(-1);
871 ])
872 ],
873 [ AC_MSG_RESULT(yes)
874 AC_DEFINE(HAVE_ICONV_ISO8859_1, 1, Define to 1 if iconv supports ISO8859-1)
875 ],
876 [ AC_MSG_RESULT(no) ],
877 [ AC_MSG_RESULT(no) ]
878)
879
880AC_MSG_CHECKING(whether iconv supports ISO-8859-1)
881AC_RUN_IFELSE(
882 [AC_LANG_PROGRAM([
883#if HAVE_ICONV_H
884#include <iconv.h>
885#endif
886 ], [
887 return iconv_open("UTF-8","ISO-8859-1")==(iconv_t)(-1);
888 ])
889 ],
890 [ AC_MSG_RESULT(yes)
891 AC_DEFINE(HAVE_ICONV_ISO_8859_1, 1, Define to 1 if iconv supports ISO-8859-1)
892 ],
893 [ AC_MSG_RESULT(no) ],
894 [ AC_MSG_RESULT(no) ]
895)
896
897AC_MSG_CHECKING(whether iconv supports ASCII)
898AC_RUN_IFELSE(
899 [AC_LANG_PROGRAM([
900#if HAVE_ICONV_H
901#include <iconv.h>
902#endif
903 ], [
904 return iconv_open("UTF-8","ASCII")==(iconv_t)(-1);
905 ])
906 ],
907 [ AC_MSG_RESULT(yes)
908 AC_DEFINE(HAVE_ICONV_ASCII, 1, Define to 1 if iconv supports ASCII)
909 ],
910 [ AC_MSG_RESULT(no) ],
911 [ AC_MSG_RESULT(no) ]
912)
913
93571e7f
VK
914AC_MSG_CHECKING(whether iconv supports //IGNORE)
915AC_RUN_IFELSE(
916 [AC_LANG_PROGRAM([
917#if HAVE_ICONV_H
918#include <iconv.h>
919#endif
920 ], [
921 return iconv_open("UTF-8//IGNORE","$valid_ucs2_code")==(iconv_t)(-1);
922 ])
923 ],
924 [ AC_MSG_RESULT(yes)
925 AC_DEFINE(HAVE_ICONV_IGNORE, 1, Define to 1 if iconv supports //IGNORE option)
926 ],
927 [ AC_MSG_RESULT(no) ],
928 [ AC_MSG_RESULT(no) ]
929)
3e39fcde 930
19619a35
AK
931# taken from ZSH's configure
932# Check if iconv uses const in prototype declaration
24b1570c 933if test "x$ac_found_iconv" = "xyes"; then
19619a35
AK
934 AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
935 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
936 #include <iconv.h>]],
937 [[#ifdef __cplusplus
938 "C"
939 #endif
940 #if defined(__STDC__) || defined(__cplusplus)
941 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
942 #else
943 size_t iconv();
944 #endif]])],
945 [ac_cv_iconv_const=],
946 [ac_cv_iconv_const=const])])
947 AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
948 [Define as const if the declaration of iconv() needs const.])
949fi
950
93571e7f 951if test $ac_cv_sizeof_wchar_t -eq 2; then
3e39fcde
VK
952 AC_DEFINE(HAVE_USEABLE_WCHAR_T, 1, Define to 1 if you have useable wchar_t)
953fi
954
c29360a9 955
ca0f4ea3
VK
956#--------------------------------------------------------------------
957# MySQL
958#--------------------------------------------------------------------
959
960check_substr "$COMPONENTS" "mysql"
961if test $? = 0; then
9c29f76e 962 AC_CHECK_LIB(mysqlclient, mysql_init, [],
ca0f4ea3 963 [AC_MSG_ERROR(libmysqlclient is requred for MySQL support)])
9c29f76e
VK
964 AC_MSG_CHECKING(whether mysql clients can run)
965 AC_RUN_IFELSE([AC_LANG_SOURCE([[
966#include <stdio.h>
967#include <mysql.h>
968int main(void)
969{
970 MYSQL *a = mysql_init(NULL);
971 return 0;
972}
973 ]])],[],[
974 AC_MSG_RESULT(no)
975 AC_MSG_ERROR(Your MySQL client libraries aren't properly installed)
976 ],[])
ca0f4ea3
VK
977 AC_MSG_RESULT(yes)
978 AC_CHECK_FUNCS(mysql_real_escape_string)
979fi
980
981
58ed4897
VK
982#--------------------------------------------------------------------
983# PostgreSQL
984#--------------------------------------------------------------------
985
203458b7 986check_substr "$COMPONENTS" "pgsql"
58ed4897
VK
987if test $? = 0; then
988 AC_CHECK_LIB(m, floor)
989 AC_CHECK_LIB(pq, PQconnectdb, ,
990 [AC_MSG_ERROR(libpq is required for PostgreSQL support)])
991 AC_MSG_CHECKING(whether postgresql clients can run)
992 AC_RUN_IFELSE([AC_LANG_SOURCE([[
993 #include <stdio.h>
994 #include <libpq-fe.h>
995 int main(void)
996 {
997 PGconn *a = PQconnectdb("");
998 return 0;
999 }
1000 ]])],[],[
1001 AC_MSG_RESULT(no)
1002 AC_MSG_ERROR(Your PostgreSQL client libraries aren't properly installed)
1003 ],[])
1004 AC_MSG_RESULT(yes)
1005fi
1006
1007
9c29f76e
VK
1008#--------------------------------------------------------------------
1009# ODBC
1010#--------------------------------------------------------------------
1011
1012check_substr "$COMPONENTS" "odbc"
1013if test $? = 0; then
1014 AC_CHECK_LIB(odbc, SQLAllocHandle, [],
1015 [AC_MSG_ERROR(libodbc is required for ODBC support)])
1016fi
1017
1018
1019#--------------------------------------------------------------------
1020# SQLite
1021#--------------------------------------------------------------------
1022
1023check_substr "$COMPONENTS" "sqlite"
1024if test $? = 0; then
1025 AC_CHECK_LIB(sqlite3, sqlite3_open, [],
1026 [AC_MSG_ERROR(libsqlite3 is required for SQLite support)])
1027fi
1028
1029
ca0f4ea3
VK
1030#--------------------------------------------------------------------
1031# Other settings
1032#--------------------------------------------------------------------
1033
1034CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DDATADIR=\\\"\${pkgdatadir}\\\" -DLIBDIR=\\\"\${libdir}\\\""
1035
1036
ef0c727b
VK
1037#--------------------------------------------------------------------
1038# Substitute variables
1039#--------------------------------------------------------------------
82fa7c5d 1040
ef0c727b
VK
1041AC_SUBST(DB_DRIVERS)
1042AC_SUBST(MODULES)
1043AC_SUBST(SUBAGENT_DIRS)
1044AC_SUBST(SERVER_TOOLS)
1045AC_SUBST(TOP_LEVEL_MODULES)
1046AC_SUBST(CONTRIB_MODULES)
1047AC_SUBST(STATIC_SUBAGENT_LIST)
1048AC_SUBST(SUBAGENT_LIBS)
1049AC_SUBST(BUILD_SERVER)
1050AC_SUBST(UNSTABLE_SUBAGENT_DIRS)
d16cf8a5 1051
ef0c727b
VK
1052#--------------------------------------------------------------------
1053# Shared libs versions
d16cf8a5
AK
1054#
1055# versioning scheme: current:revision:age
1056#
1057# current
1058# The number of the current interface exported by the library. A current
1059# value of `0', means that you are calling the interface exported by this
1060# library interface 0.
1061#
1062# revision
1063# The implementation number of the most recent interface exported by this
1064# library. In this case, a revision value of `0' means that this is the
1065# first implementation of the interface.
1066# If the next release of this library exports the same interface, but has a
1067# different implementation (perhaps some bugs have been fixed), the revision
1068# number will be higher, but current number will be the same. In that case,
1069# when given a choice, the library with the highest revision will always
1070# be used by the runtime loader.
1071#
1072# age
1073# The number of previous additional interfaces supported by this library.
1074# If age were `2', then this library can be linked into executables which
1075# were built with a release of this library that exported the current
1076# interface number, current, or any of the previous two interfaces.
1077# By definition age must be less than or equal to current. At the outset,
1078# only the first ever interface is implemented, so age can only be `0'.
ef0c727b 1079#--------------------------------------------------------------------
d16cf8a5 1080
c7d14846
VK
1081NETXMS_LIBRARY_VERSION=0:2:0
1082AC_SUBST(NETXMS_LIBRARY_VERSION)
d16cf8a5 1083
ef0c727b
VK
1084
1085#--------------------------------------------------------------------
1086# Generate output files
1087#--------------------------------------------------------------------
d16cf8a5
AK
1088
1089AC_CONFIG_FILES([
ef0c727b 1090 README
0c3c0c39
AK
1091 Makefile
1092 contrib/Makefile
0c3c0c39
AK
1093 contrib/dct/Makefile
1094 contrib/startup/Makefile
daaefaaf 1095 contrib/startup/gentoo/Makefile
0c3c0c39 1096 contrib/startup/redhat/Makefile
5de3893d 1097 contrib/startup/suse/Makefile
82fa7c5d 1098 contrib/mibs/Makefile
3f2f9f2b 1099 contrib/backgrounds/Makefile
0c3c0c39 1100 doc/Makefile
a48203d2
VK
1101 doc/internal/Makefile
1102 doc/manuals/Makefile
1103 doc/misc/Makefile
0c3c0c39
AK
1104 images/Makefile
1105 include/Makefile
1106 m4/Makefile
1107 netware/Makefile
1108 sql/Makefile
0c3c0c39
AK
1109 src/Makefile
1110 src/libnetxms/Makefile
d853cd74 1111 src/libnxsnmp/Makefile
0c3c0c39 1112 src/libnxcl/Makefile
c002b04a 1113 src/libnxsl/Makefile
1d410d50 1114 src/libnxmap/Makefile
1b1edd49
VK
1115 src/install/Makefile
1116 src/install/windows/Makefile
0c3c0c39 1117 src/console/Makefile
8c7d057b
VK
1118 src/console/nxuilib/Makefile
1119 src/console/nxuilib/res/Makefile
f7d8c3b2 1120 src/console/nxuilib/sounds/Makefile
e4d08190 1121 src/console/nxlexer/Makefile
0c3c0c39
AK
1122 src/console/win32/Makefile
1123 src/console/win32/icons/Makefile
1124 src/console/win32/res/Makefile
1125 src/console/win32starter/Makefile
672441ac 1126 src/console/nxav/Makefile
2b463d08 1127 src/console/nxav/res/Makefile
52996299
VK
1128 src/console/nxnotify/Makefile
1129 src/console/nxnotify/res/Makefile
672441ac 1130 src/console/cmdline/Makefile
2b463d08
VK
1131 src/console/PocketPC/Makefile
1132 src/console/PocketPC/res/Makefile
0c3c0c39 1133 src/nxevent/Makefile
09c70d92 1134 src/nxpush/Makefile
1e8eed7a 1135 src/nxreport/Makefile
148f47cf 1136 src/nxmibc/Makefile
f519aa3e 1137 src/nxscript/Makefile
0c3c0c39
AK
1138 src/server/Makefile
1139 src/server/core/Makefile
a551fe4d 1140 src/server/netxmsd/Makefile
0c3c0c39
AK
1141 src/server/dbdrv/Makefile
1142 src/server/dbdrv/odbc/Makefile
1143 src/server/dbdrv/mssql/Makefile
1144 src/server/dbdrv/mysql/Makefile
1145 src/server/dbdrv/pgsql/Makefile
9486b324 1146 src/server/dbdrv/sqlite/Makefile
5de3893d 1147 src/server/dbdrv/oracle/Makefile
d8f2e39b
VK
1148 src/server/smsdrv/Makefile
1149 src/server/smsdrv/generic/Makefile
0c3c0c39
AK
1150 src/server/tools/Makefile
1151 src/server/tools/nxget/Makefile
1152 src/server/tools/nxaction/Makefile
1153 src/server/tools/nxadm/Makefile
5b0c7d0d
VK
1154 src/server/tools/nxconfig/Makefile
1155 src/server/tools/nxconfig/res/Makefile
f90d7fc5 1156 src/server/tools/nxdbmgr/Makefile
d853cd74 1157 src/server/tools/nxsnmpget/Makefile
734c670f 1158 src/server/tools/nxsnmpwalk/Makefile
665b4ccf 1159 src/server/tools/nxsnmpset/Makefile
d24fdaf4 1160 src/server/tools/nxupload/Makefile
0c3c0c39
AK
1161 src/server/libnxsrv/Makefile
1162 src/agent/Makefile
1163 src/agent/core/Makefile
5795bf90 1164 src/agent/install/Makefile
0c3c0c39
AK
1165 src/agent/subagents/Makefile
1166 src/agent/subagents/linux/Makefile
1167 src/agent/subagents/sunos/Makefile
d0b5a098 1168 src/agent/subagents/aix/Makefile
9bdf494f 1169 src/agent/subagents/hpux/Makefile
0c3c0c39
AK
1170 src/agent/subagents/skeleton/Makefile
1171 src/agent/subagents/freebsd/Makefile
992ba479 1172 src/agent/subagents/openbsd/Makefile
2b23dc1e 1173 src/agent/subagents/ipso/Makefile
0c3c0c39 1174 src/agent/subagents/netware/Makefile
1bc607cc
VK
1175 src/agent/subagents/winnt/Makefile
1176 src/agent/subagents/win9x/Makefile
0c3c0c39 1177 src/agent/subagents/winperf/Makefile
93f15c2a 1178 src/agent/subagents/portCheck/Makefile
b36a6eb9 1179 src/agent/subagents/logscan/Makefile
abc48356 1180 src/agent/subagents/ping/Makefile
2f06a66e 1181 src/agent/subagents/ups/Makefile
539ab0c3
AK
1182 src/agent/subagents/ecs/Makefile
1183 src/agent/subagents/odbcquery/Makefile
5de3893d 1184 src/nxhttpd/Makefile
066afcd4
VK
1185 src/nxhttpd/static/Makefile
1186 src/nxhttpd/static/images/Makefile
4351a82a
VK
1187 src/nxhttpd/static/images/buttons/Makefile
1188 src/nxhttpd/static/images/buttons/normal/Makefile
1189 src/nxhttpd/static/images/buttons/pressed/Makefile
6db3b20b 1190 src/nxhttpd/static/images/ctrlpanel/Makefile
18928f80 1191 src/nxhttpd/static/images/objects/Makefile
fb7ce4b9 1192 src/nxhttpd/static/images/status/Makefile
0c3c0c39 1193 tools/Makefile
d16cf8a5
AK
1194])
1195
12249937
VK
1196AC_OUTPUT
1197
ef0c727b 1198echo "Updating libtool"
5cecf50e
AK
1199sed 's,$SED -e "/${host}-//g",$SED -e "s/${host}-//g",g' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
1200
779ce551
VK
1201# On HP-UX, libtool passes +b instead of -Wl,+b even if gcc/g++ used as linker
1202if test "x$CC" = "xgcc" && test "x$PLATFORM" = "xHP-UX"; then
1203 sed "s,hardcode_libdir_flag_spec_ld=,#hardcode_libdir_flag_spec_ld=,g" < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
1204fi
1205
a7442678 1206
ef0c727b
VK
1207#--------------------------------------------------------------------
1208# Print summary
1209#--------------------------------------------------------------------
a7442678 1210
a7442678
AK
1211echo
1212echo
1213echo
1214echo '---------------------------------------------------------------------'
1215echo ' Configure results'
1216echo '---------------------------------------------------------------------'
1217echo
1218 echo "Prefix : ${prefix}"
1219if test "x${BUILD_SERVER}" = "xyes"; then
1220 echo "Build Server : YES"
1221else
1222 echo "Build Server : NO"
1223fi
1224if test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"; then
1225 echo "Encryption enabled : YES"
1226else
1227 echo "Encryption enabled : NO"
1228fi
1229if test "x${DB_DRIVERS}" != "x"; then
1010cff7 1230 echo "Build DB-Drivers :${DB_DRIVERS}"
a7442678
AK
1231else
1232 echo "Build DB-Drivers : NO"
1233fi
1234if test "x${BUILD_CLIENT}" = "xyes"; then
1235 echo "Build Clients : YES"
1236else
1237 echo "Build Clients : NO"
1238fi
ef0c727b 1239if test "x${BUILD_NXHTTPD}" = "xyes"; then
2654e540
AK
1240 echo "Build Web Interface : YES"
1241else
c2503081 1242 echo "Build Web Interface : NO"
2654e540 1243fi
a7442678
AK
1244if test "x${BUILD_AGENT}" = "xyes"; then
1245 echo "Build Agent : YES"
1246 echo "Subagents list : ${SUBAGENT_DIRS}"
1247else
1248 echo "Build Agent : NO"
1249fi
e8636669
VK
1250if test "x${BUILD_STATIC_AGENT}" = "xyes"; then
1251 echo "Build Static Agent : YES"
1252 echo "Subagents list : ${STATIC_SUBAGENT_LIST}"
1253else
1254 echo "Build Static Agent : NO"
1255fi