Fixed some 64bit portability issues
[public/netxms.git] / configure.ac
CommitLineData
29fa8356 1# $Id: configure.ac,v 1.113 2005-10-28 16:04:48 victor Exp $
d16cf8a5
AK
2#
3# Process this file with autoconf to produce a configure script.
4#
5
e08c79a8 6AC_INIT([NetXMS], [0.2.6], [NetXMS Team <bugs@netxms.org>])
d16cf8a5
AK
7AC_CONFIG_AUX_DIR([config])
8AM_CONFIG_HEADER([config.h])
9AM_INIT_AUTOMAKE
10
5387ff75
VK
11
12# --------------------------------------------------------------------------
13# checks for programs.
14
15AC_PROG_CC
16AC_PROG_CPP
17AC_PROG_CXX
18AC_PROG_INSTALL
b32538f9
VK
19AC_PROG_LEX
20AC_PROG_YACC
882e43d4 21AC_PROG_LN_S
5387ff75 22
e0760102
VK
23# --------------------------------------------------------------------------
24# disable C++ exceptions
063e34ad 25CFLAGS="$CFLAGS -fno-exceptions"
e0760102 26CPPFLAGS="$CPPFLAGS -fno-exceptions"
6f926182 27LDFLAGS="$LDFLAGS"
e8636669 28SUBAGENT_LIBS=""
5387ff75 29
7c9c94a7
VK
30# --------------------------------------------------------------------------
31# set LDFLAGS depending on OS
32
33case `uname -s` in
34 AIX)
35 LDFLAGS="-no-undefined $LDFLAGS"
36 ;;
37 *)
38 ;;
39esac
40
d16cf8a5
AK
41# --------------------------------------------------------------------------
42# misc
43
44AC_ARG_VAR(PERL,local path to the perl interpreter)
45perl_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/perl/bin:/opt/perl/usr/bin:/opt/perl/usr/local/bin"
46AC_PATH_PROG(PERL,perl,/usr/bin/env perl,$perl_possible_path)
47
48if test -d /usr/local/include; then
49 CFLAGS="$CFLAGS -I/usr/local/include"
2cb1fb26 50 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
d16cf8a5
AK
51fi
52
53if test -d /usr/kerberos/include; then
54 CFLAGS="$CFLAGS -I/usr/kerberos/include"
2cb1fb26 55 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
d16cf8a5 56fi
521d90e7 57
d16cf8a5
AK
58if test -d /usr/local/lib; then
59 LDFLAGS="$LDFLAGS -L/usr/local/lib"
60fi
61
ae82f88f
VK
62# --------------------------------------------------------------------------
63# check for system pthread.h
64
65AC_CHECK_HEADERS([/usr/include/pthread.h])
66
d16cf8a5
AK
67# --------------------------------------------------------------------------
68# command line options
69
c4b88c3d
VK
70AC_ARG_WITH(odbc,
71[AS_HELP_STRING(--with-odbc,build ODBC database driver)],
72[ if test "x$withval" != "xno" ; then
73 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
74 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
75 LDFLAGS="$LDFLAGS -L${withval}/lib"
76 CPPFLAGS="$CPPFLAGS -I${withval}/include"
77 fi
e8636669 78 DYNAMIC_COMPONENTS="yes"
c4b88c3d
VK
79 with_odbc="yes"
80 AC_DEFINE(WITH_ODBC,,[with odbc])
81 DB_DRIVERS="$DB_DRIVERS odbc"
82 AC_CHECK_LIB(odbc, SQLAllocHandle, ,
b11f69d6 83 [AC_MSG_ERROR(libodbc is required for ODBC support)])
c4b88c3d
VK
84fi ])
85
d16cf8a5 86AC_ARG_WITH(mysql,
c4b88c3d 87[AS_HELP_STRING(--with-mysql,build MySQL database driver)],
d16cf8a5
AK
88[ if test "x$withval" != "xno" ; then
89 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
90 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
91 LDFLAGS="$LDFLAGS -L${withval}/lib -L${withval}/lib/mysql -L${withval}/mysql/lib"
6693a1d0 92 CPPFLAGS="$CPPFLAGS -I${withval}/include -I${withval}/include/mysql -I${withval}/mysql/include"
d16cf8a5
AK
93 else
94 LD_RUN_PATH="/usr/local/mysql/lib:/usr/local/mysql/lib/mysql:/usr/lib/mysql:/usr/mysql/lib:/usr/mysql/lib/mysql:/usr/local/lib/mysql:${LD_RUN_PATH:+:}${LD_RUN_PATH}"
95 LDFLAGS="$LDFLAGS -L/usr/local/mysql/lib -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 96 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 97 fi
e8636669 98 DYNAMIC_COMPONENTS="yes"
d16cf8a5
AK
99 AC_CHECK_LIB(m, floor)
100 AC_CHECK_LIB(z, gzclose)
101 with_mysql="yes"
102 AC_DEFINE(WITH_MYSQL,,[with mysql])
6693a1d0 103 DB_DRIVERS="$DB_DRIVERS mysql"
d16cf8a5 104 AC_CHECK_LIB(mysqlclient, mysql_init, ,
b11f69d6 105 [AC_MSG_ERROR(libmysqlclient is requred for MySQL support)])
d16cf8a5
AK
106 AC_MSG_CHECKING(whether mysql clients can run)
107 AC_RUN_IFELSE([AC_LANG_SOURCE([[
108 #include <stdio.h>
109 #include <mysql.h>
110 int main(void)
111 {
112 MYSQL *a = mysql_init(NULL);
113 return 0;
114 }
115 ]])],[],[
116 AC_MSG_RESULT(no)
117 AC_MSG_ERROR(Your MySQL client libraries aren't properly installed)
118 ],[])
119 AC_MSG_RESULT(yes)
120 AC_CHECK_FUNCS(mysql_real_escape_string)
6693a1d0 121fi ])
d16cf8a5
AK
122
123AC_ARG_WITH(pgsql,
c4b88c3d 124[AS_HELP_STRING(--with-pgsql,build PostgreSQL database driver)],
d16cf8a5 125[ if test "x$withval" != "xno" ; then
6693a1d0
AK
126 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
127 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
128 LDFLAGS="$LDFLAGS -L${withval}/lib -L${withval}/lib/pgsql -L${withval}/lib/postgresql -L${withval}/pgsql/lib -L${withval}/postgresql/lib"
129 CPPFLAGS="$CPPFLAGS -I${withval}/include -I${withval}/include/pgsql -I${withval}/include/postgresql -I${withval}/pgsql/include -I${withval}/postgresql/include"
130 else
131 LD_RUN_PATH="/usr/local/pgsql/lib:/usr/local/pgsql/lib/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}"
132 LDFLAGS="$LDFLAGS -L/usr/local/pgsql/lib -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"
133 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"
134 fi
e8636669 135 DYNAMIC_COMPONENTS="yes"
6693a1d0
AK
136 AC_CHECK_LIB(m, floor)
137 AC_CHECK_LIB(z, gzclose)
138 with_pgsql="yes"
139 DB_DRIVERS="$DB_DRIVERS pgsql"
140 AC_DEFINE(WITH_PGSQL,,[with pgsql])
141 AC_CHECK_LIB(pq, PQconnectdb, ,
b11f69d6 142 [AC_MSG_ERROR(libpq is required for PostgreSQL support)])
6693a1d0
AK
143 AC_MSG_CHECKING(whether postgresql clients can run)
144 AC_RUN_IFELSE([AC_LANG_SOURCE([[
145 #include <stdio.h>
146 #include <libpq-fe.h>
147 int main(void)
148 {
149 PGconn *a = PQconnectdb("");
150 return 0;
151 }
152 ]])],[],[
153 AC_MSG_RESULT(no)
154 AC_MSG_ERROR(Your PostgreSQL client libraries aren't properly installed)
155 ],[])
156 AC_MSG_RESULT(yes)
157fi ])
d16cf8a5 158
3a7ce527
AK
159AC_ARG_WITH(server,
160[AS_HELP_STRING(--with-server,build server)],
161[
148f47cf 162 MODULES="$MODULES libnxsnmp server nxmibc"
abc48356
VK
163 TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES sql images"
164 CONTRIB_MODULES="$CONTRIB_MODULES mibs"
08ffa53e 165 BUILD_SERVER="yes"
e8636669 166 DYNAMIC_COMPONENTS="yes"
3a7ce527 167])
3a7ce527
AK
168
169
e0760102
VK
170AC_ARG_WITH(client,
171[AS_HELP_STRING(--with-client,build client library and tools)],
172[
1e8eed7a 173 MODULES="$MODULES libnxcl nxevent nxreport console"
e0760102 174 BUILD_CLIENT="yes"
e8636669 175 DYNAMIC_COMPONENTS="yes"
e0760102
VK
176])
177
178
3a7ce527
AK
179SUBAGENT_DIRS=""
180AC_ARG_WITH(agent,
181[AS_HELP_STRING(--with-agent,build agent)],
182[
a7442678 183 BUILD_AGENT=yes
0c3c0c39 184 MODULES="$MODULES agent"
3a7ce527
AK
185 case `uname -s` in
186 Linux)
187 SUBAGENT_DIRS="linux"
188 ;;
189 FreeBSD)
190 SUBAGENT_DIRS="freebsd"
191 ;;
192 SunOS)
193 SUBAGENT_DIRS="sunos"
194 ;;
d0b5a098
VK
195 AIX)
196 SUBAGENT_DIRS="aix"
197 ;;
3a7ce527
AK
198 *)
199 # unknown
200 ;;
201 esac
e8636669
VK
202 DYNAMIC_COMPONENTS="yes"
203])
204
205AC_ARG_WITH(static-agent,
206[AS_HELP_STRING(--with-static-agent,build statically linked agent)],
207[
208 BUILD_STATIC_AGENT="yes"
209 MODULES="$MODULES agent"
210 CFLAGS="$CFLAGS -D_STATIC_AGENT"
211 CPPFLAGS="$CPPFLAGS -D_STATIC_AGENT"
212# STATIC_SUBAGENT_LIST="ping portcheck"
213 case `uname -s` in
214 Linux)
215 SUBAGENT_DIRS="linux"
d0b5a098
VK
216 SUBAGENT_LIBS="../subagents/linux/libnsm_linux.la"
217 STATIC_SUBAGENT_LIST="linux $STATIC_SUBAGENT_LIST"
e8636669
VK
218 ;;
219 FreeBSD)
220 SUBAGENT_DIRS="freebsd"
d0b5a098
VK
221 SUBAGENT_LIBS="../subagents/freebsd/libnsm_freebsd.la"
222 STATIC_SUBAGENT_LIST="freebsd $STATIC_SUBAGENT_LIST"
e8636669
VK
223 ;;
224 SunOS)
225 SUBAGENT_DIRS="sunos"
d0b5a098
VK
226 SUBAGENT_LIBS="../subagents/sunos/libnsm_sunos.la"
227 STATIC_SUBAGENT_LIST="sunos $STATIC_SUBAGENT_LIST"
228 ;;
229 AIX)
230 SUBAGENT_DIRS="aix"
231 SUBAGENT_LIBS="../subagents/aix/libnsm_aix.la"
232 STATIC_SUBAGENT_LIST="aix $STATIC_SUBAGENT_LIST"
e8636669
VK
233 ;;
234 *)
235 # unknown
236 ;;
237 esac
3a7ce527 238])
0c3c0c39
AK
239
240AC_ARG_WITH(dist,
241[AS_HELP_STRING(--with-dist,for maintainers only)],
242 DB_DRIVERS="mysql pgsql odbc mssql"
29fa8356 243 MODULES="libnxsnmp server agent libnxcl nxevent nxreport nxmibc console www"
221f5602 244 SUBAGENT_DIRS="linux freebsd sunos aix"
5b0c7d0d 245 NXCONFIG="nxconfig"
abc48356
VK
246 TOP_LEVEL_MODULES="sql images"
247 CONTRIB_MODULES="mibs"
0c3c0c39
AK
248)
249
b97191d2
AK
250AC_ARG_WITH(nxsm,
251[AS_HELP_STRING(--with-nxsm,build session manager for web interface)],
252[
253 MODULES="$MODULES www"
254 BUILD_CLIENT="yes"
e8636669 255 DYNAMIC_COMPONENTS="yes"
b97191d2
AK
256])
257
a7442678
AK
258AC_ARG_WITH(openssl,
259 [AS_HELP_STRING(--with-openssl,specify OpenSSL location)],
260 [
a7442678
AK
261 if test "x$withval" != "xno" ; then
262 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
263 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
264 LDFLAGS="$LDFLAGS -L${withval}/lib"
265 CPPFLAGS="$CPPFLAGS -I${withval}/include"
266 else
267 LD_RUN_PATH="/usr/local/lib:/opt/openssl/lib:${LD_RUN_PATH:+:}${LD_RUN_PATH}"
268 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/opt/openssl/lib"
269 CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/opt/openssl/include"
270 fi
ad6eb83b
AK
271 AC_CHECK_LIB(crypto, RSA_new,
272 [
273 AC_DEFINE(WITH_OPENSSL,,[with openssl])
274 AC_CHECK_LIB(crypto, EVP_aes_256_cbc,
275 [], [AC_DEFINE(NETXMS_NO_AES,,[desc])])
276 AC_CHECK_LIB(crypto, EVP_bf_cbc,
277 [], [AC_DEFINE(NETXMS_NO_BF,,[desc])])
278 AC_CHECK_LIB(crypto, EVP_idea_cbc,
279 [], [AC_DEFINE(NETXMS_NO_IDEA,,[desc])])
280 AC_CHECK_LIB(crypto, EVP_des_ede3_cbc,
281 [], [AC_DEFINE(NETXMS_NO_DES,,[desc])])
282 ],
a7442678
AK
283 [AC_MSG_ERROR(libcrypto is required for encryption support)])
284 fi
a7442678 285 ],
ad6eb83b
AK
286 [
287 AC_CHECK_LIB(crypto, RSA_new,
288 [
289 AC_DEFINE(WITH_OPENSSL,,[with openssl])
290 AC_CHECK_LIB(crypto, EVP_aes_256_cbc,
291 [], [AC_DEFINE(NETXMS_NO_AES,,[desc])])
292 AC_CHECK_LIB(crypto, EVP_bf_cbc,
293 [], [AC_DEFINE(NETXMS_NO_BF,,[desc])])
294 AC_CHECK_LIB(crypto, EVP_idea_cbc,
295 [], [AC_DEFINE(NETXMS_NO_IDEA,,[desc])])
296 AC_CHECK_LIB(crypto, EVP_des_ede3_cbc,
297 [], [AC_DEFINE(NETXMS_NO_DES,,[desc])])
298 ],
299 [AC_MSG_RESULT(libcrypto is required for encryption support)])
300 ])
6619a6b0 301
0c3c0c39
AK
302AC_SUBST(DB_DRIVERS)
303AC_SUBST(MODULES)
3a7ce527 304AC_SUBST(SUBAGENT_DIRS)
5b0c7d0d 305AC_SUBST(NXCONFIG)
abc48356
VK
306AC_SUBST(TOP_LEVEL_MODULES)
307AC_SUBST(CONTRIB_MODULES)
e8636669
VK
308AC_SUBST(STATIC_SUBAGENT_LIST)
309AC_SUBST(SUBAGENT_LIBS)
310
311# --------------------------------------------------------------------------
312# If --with-static-agent selected, other components cannot be selected
313# Select shared or static libraries depending on agent build type
314if test "x$BUILD_STATIC_AGENT" = "xyes" ; then
315 if test "x$DYNAMIC_COMPONENTS" = "xyes" ; then
316 AC_MSG_ERROR(Static agent and other components are mutally exclusive.)
317 fi
5669350c 318 ${enable_shared=no}
e8636669 319else
5669350c 320 ${enable_static=no}
e8636669
VK
321fi
322
323AC_LIBTOOL_DLOPEN
324AC_PROG_LIBTOOL
3a7ce527 325
d16cf8a5
AK
326# --------------------------------------------------------------------------
327# checks for libs.
328
329#AC_CHECK_LIB([socket], [socket])
330#AC_CHECK_LIB([nsl], [gethostbyname])
331
521d90e7 332AC_CHECK_LIB(socket, if_nameindex)
87bb64a7 333AC_CHECK_LIB(dl, dlopen)
1b3c0ef0 334AC_CHECK_LIB(kstat, kstat_open)
d16cf8a5 335
e0760102
VK
336if test "x$BUILD_SERVER" = "xyes" ; then
337 AC_CHECK_LIB(termcap, tgetstr, [], [AC_CHECK_LIB(ncurses, tgetstr, [], AC_CHECK_LIB(curses, tgetstr))])
338 AC_CHECK_LIB(readline, readline)
339fi
340
d16cf8a5
AK
341# --------------------------------------------------------------------------
342# checks for headers.
343
344AC_HEADER_STDC
345AC_HEADER_STAT
346AC_HEADER_TIME
521d90e7 347AC_CHECK_HEADERS([sys/int_types.h])
d16cf8a5 348AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h sys/socket.h])
467e30e1 349AC_CHECK_HEADERS([fcntl.h dirent.h sys/ioctl.h sys/sockio.h poll.h])
85303064 350AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h])
14ab1131 351AC_CHECK_HEADERS([readline/readline.h])
f52be742 352AC_CHECK_HEADERS([byteswap.h])
eca0b061 353AC_CHECK_HEADERS([sys/mman.h])
31a11006 354AC_CHECK_HEADERS([sys/utsname.h])
d16cf8a5 355
d16cf8a5
AK
356# --------------------------------------------------------------------------
357# types
358AC_CHECK_SIZEOF(short)
359AC_CHECK_SIZEOF(int)
360AC_CHECK_SIZEOF(long)
361AC_CHECK_SIZEOF(long long)
362
363AC_TYPE_PID_T
364AC_TYPE_SIGNAL
365AC_TYPE_SIZE_T
366AC_STRUCT_TIMEZONE
367
521d90e7 368AC_CHECK_TYPES([int64_t, uint64_t, u_int64_t])
eca0b061 369AC_CHECK_TYPES([off_t])
521d90e7 370
d16cf8a5
AK
371# --------------------------------------------------------------------------
372# C/CPP caps
373
374AC_PROG_GCC_TRADITIONAL
375AC_C_CONST
376AC_C_BIGENDIAN
377
f52be742
VK
378# --------------------------------------------------------------------------
379# macros
380
381AC_CHECK_DECLS([__bswap_64],,,[
382#if HAVE_BYTESWAP_H
383#include <byteswap.h>
384#endif
385])
85303064
VK
386AC_CHECK_DECLS([SIOCGIFADDR, SIOCGIFNETMASK, SIOCGIFHWADDR],,,[
387#if HAVE_SYS_IOCTL_H
388#include <sys/ioctl.h>
389#endif
390#if HAVE_SYS_SOCKIO_H
391#include <sys/sockio.h>
392#endif
393])
f52be742 394
d16cf8a5
AK
395# --------------------------------------------------------------------------
396# library functions
397
398AC_FUNC_ERROR_AT_LINE
abc48356
VK
399#AC_FUNC_MALLOC
400#AC_FUNC_REALLOC
d16cf8a5 401AC_FUNC_MEMCMP
d16cf8a5
AK
402AC_FUNC_SELECT_ARGTYPES
403AC_FUNC_STRFTIME
404AC_FUNC_STRTOD
405AC_FUNC_VPRINTF
406
b50f1100
VK
407AC_CHECK_FUNCS([gettimeofday memmove memset strchr strcspn strdup strerror])
408AC_CHECK_FUNCS([strrchr strtol strtoul strtoll strtoull])
467e30e1 409AC_CHECK_FUNCS([if_nametoindex daemon mmap strerror_r scandir uname poll])
d16cf8a5 410
d16cf8a5
AK
411# sockets/resolver (probably for solaris)
412AC_CHECK_FUNC(connect, , [AC_CHECK_LIB(socket, connect)])
413AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(resolv, gethostbyname)])
414AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)])
415
416if test "x$ac_cv_lib_nsl_gethostbyname" != "xyes" && test "x$ac_cv_func_gethostbyname" != "xyes" ; then
417 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(socket, gethostbyname)])
418fi
419
420if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname" ; then
421 AC_MSG_CHECKING([if we can include libnsl + libsocket])
422 LIBS="-lnsl -lsocket $LIBS"
423 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void) gethostbyname]])],[my_ac_link_result=yes],[my_ac_link_result=no ])
424 if test "$my_ac_link_result" = "no" ; then
425 AC_MSG_RESULT([failure])
426 AC_MSG_ERROR([unable to use gethostbyname()])
427 else
428 AC_MSG_RESULT([success])
429 fi
430fi
431
3d9b275c 432#ALK: CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" PTHREAD_LIBS="-pthread",
d16cf8a5
AK
433# posix threads
434AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed - please install first ***]))
435
436PTHREAD_LIBS=error
437AC_MSG_CHECKING(for old style FreeBSD -pthread flag)
438AC_EGREP_CPP(yes,
a910e139 439 [#if defined(__FreeBSD_cc_version) || defined(__OpenBSD__)
d16cf8a5
AK
440 yes
441 #endif
442 ], AC_MSG_RESULT(yes)
6693a1d0 443 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" PTHREAD_LIBS="-pthread",
d16cf8a5
AK
444 AC_MSG_RESULT(no))
445if test "x$PTHREAD_LIBS" = xerror; then
446 AC_CHECK_LIB(pthread, pthread_attr_init,
6693a1d0 447 PTHREAD_LIBS="-lpthread")
d16cf8a5
AK
448fi
449if test "x$PTHREAD_LIBS" = xerror; then
450 AC_CHECK_LIB(pthreads, pthread_attr_init,
6693a1d0 451 PTHREAD_LIBS="-lpthreads")
d16cf8a5 452fi
d16cf8a5 453if test "x$PTHREAD_LIBS" = xerror; then
6693a1d0
AK
454 AC_CHECK_FUNC(pthread_attr_init,
455 PTHREAD_LIBS="")
d16cf8a5
AK
456fi
457if test "x$PTHREAD_LIBS" = xerror; then
458 AC_MSG_ERROR(*** Unable to locate working posix thread library ***)
459fi
460AC_SUBST(PTHREAD_LIBS)
461
696fc54f
VK
462# Extensions to posix threads
463AC_CHECK_FUNCS([pthread_cond_reltimedwait_np])
464
82fa7c5d 465# misc
f8a000b8 466CPPFLAGS="$CPPFLAGS -DDATADIR=\\\"\${pkgdatadir}\\\" -DLIBDIR=\\\"\${libdir}\\\""
82fa7c5d 467
d16cf8a5
AK
468# --------------------------------------------------------------------------
469
470# shared libs versions
471#
472# versioning scheme: current:revision:age
473#
474# current
475# The number of the current interface exported by the library. A current
476# value of `0', means that you are calling the interface exported by this
477# library interface 0.
478#
479# revision
480# The implementation number of the most recent interface exported by this
481# library. In this case, a revision value of `0' means that this is the
482# first implementation of the interface.
483# If the next release of this library exports the same interface, but has a
484# different implementation (perhaps some bugs have been fixed), the revision
485# number will be higher, but current number will be the same. In that case,
486# when given a choice, the library with the highest revision will always
487# be used by the runtime loader.
488#
489# age
490# The number of previous additional interfaces supported by this library.
491# If age were `2', then this library can be linked into executables which
492# were built with a release of this library that exported the current
493# interface number, current, or any of the previous two interfaces.
494# By definition age must be less than or equal to current. At the outset,
495# only the first ever interface is implemented, so age can only be `0'.
496#
497#
498#
499
d8f2e39b
VK
500LIBNETXMS_LIBRARY_VERSION=0:2:0
501LIBNXCSCP_LIBRARY_VERSION=0:2:0
502LIBNXSNMP_LIBRARY_VERSION=0:2:0
503LIBNXSRV_LIBRARY_VERSION=0:2:0
504LIBNXCORE_LIBRARY_VERSION=0:2:0
505DBDRV_LIBRARY_VERSION=0:2:0
506SMSDRV_LIBRARY_VERSION=0:2:0
d16cf8a5 507AC_SUBST(LIBNETXMS_LIBRARY_VERSION)
3e7f0791 508AC_SUBST(LIBNXCSCP_LIBRARY_VERSION)
d853cd74 509AC_SUBST(LIBNXSNMP_LIBRARY_VERSION)
aa3b26fd 510AC_SUBST(LIBNXSRV_LIBRARY_VERSION)
17a48052 511AC_SUBST(LIBNXCORE_LIBRARY_VERSION)
b900a78b 512AC_SUBST(DBDRV_LIBRARY_VERSION)
d8f2e39b 513AC_SUBST(SMSDRV_LIBRARY_VERSION)
d16cf8a5
AK
514
515# --------------------------------------------------------------------------
516
517AC_CONFIG_FILES([
d16cf8a5 518 README
0c3c0c39
AK
519 Makefile
520 contrib/Makefile
0c3c0c39
AK
521 contrib/dct/Makefile
522 contrib/startup/Makefile
523 contrib/startup/redhat/Makefile
82fa7c5d 524 contrib/mibs/Makefile
0c3c0c39
AK
525 doc/Makefile
526 images/Makefile
527 include/Makefile
528 m4/Makefile
529 netware/Makefile
530 sql/Makefile
0c3c0c39
AK
531 src/Makefile
532 src/libnetxms/Makefile
533 src/libnxcscp/Makefile
d853cd74 534 src/libnxsnmp/Makefile
0c3c0c39 535 src/libnxcl/Makefile
1b1edd49
VK
536 src/install/Makefile
537 src/install/windows/Makefile
0c3c0c39
AK
538 src/console/Makefile
539 src/console/win32/Makefile
540 src/console/win32/icons/Makefile
541 src/console/win32/res/Makefile
542 src/console/win32starter/Makefile
672441ac 543 src/console/nxav/Makefile
2b463d08 544 src/console/nxav/res/Makefile
672441ac 545 src/console/cmdline/Makefile
2b463d08
VK
546 src/console/PocketPC/Makefile
547 src/console/PocketPC/res/Makefile
0c3c0c39 548 src/nxevent/Makefile
1e8eed7a 549 src/nxreport/Makefile
148f47cf 550 src/nxmibc/Makefile
0c3c0c39
AK
551 src/server/Makefile
552 src/server/core/Makefile
a551fe4d 553 src/server/netxmsd/Makefile
0c3c0c39
AK
554 src/server/dbdrv/Makefile
555 src/server/dbdrv/odbc/Makefile
556 src/server/dbdrv/mssql/Makefile
557 src/server/dbdrv/mysql/Makefile
558 src/server/dbdrv/pgsql/Makefile
d8f2e39b
VK
559 src/server/smsdrv/Makefile
560 src/server/smsdrv/generic/Makefile
0c3c0c39
AK
561 src/server/tools/Makefile
562 src/server/tools/nxget/Makefile
563 src/server/tools/nxaction/Makefile
564 src/server/tools/nxadm/Makefile
5b0c7d0d
VK
565 src/server/tools/nxconfig/Makefile
566 src/server/tools/nxconfig/res/Makefile
f90d7fc5 567 src/server/tools/nxdbmgr/Makefile
d853cd74 568 src/server/tools/nxsnmpget/Makefile
734c670f 569 src/server/tools/nxsnmpwalk/Makefile
d24fdaf4 570 src/server/tools/nxupload/Makefile
0c3c0c39
AK
571 src/server/libnxsrv/Makefile
572 src/agent/Makefile
573 src/agent/core/Makefile
5795bf90 574 src/agent/install/Makefile
0c3c0c39
AK
575 src/agent/subagents/Makefile
576 src/agent/subagents/linux/Makefile
577 src/agent/subagents/sunos/Makefile
d0b5a098 578 src/agent/subagents/aix/Makefile
0c3c0c39
AK
579 src/agent/subagents/skeleton/Makefile
580 src/agent/subagents/freebsd/Makefile
581 src/agent/subagents/netware/Makefile
1bc607cc
VK
582 src/agent/subagents/winnt/Makefile
583 src/agent/subagents/win9x/Makefile
0c3c0c39 584 src/agent/subagents/winperf/Makefile
93f15c2a 585 src/agent/subagents/portCheck/Makefile
abc48356 586 src/agent/subagents/ping/Makefile
b97191d2
AK
587 src/www/Makefile
588 src/www/iis/Makefile
589 src/www/nxsm/Makefile
0c3c0c39 590 tools/Makefile
d16cf8a5
AK
591])
592
12249937
VK
593AC_OUTPUT
594
6f926182
AK
595#echo "Updating libtool-1"
596#sed 's/-lc_r/-lc_rXXX/' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
5cecf50e
AK
597
598echo "Updating libtool-2"
599sed 's,$SED -e "/${host}-//g",$SED -e "s/${host}-//g",g' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
600
6f926182
AK
601#if test ! "x$BUILD_SERVER" = "xyes" ; then
602# echo "Updating libtool-3"
603# $PERL tools/patch_libtool.pl <libtool >libtool.new
604# mv libtool.new libtool
605# chmod 755 libtool
606#fi
a7442678
AK
607
608
609
610###########################
611#
612echo
613echo
614echo
615echo '---------------------------------------------------------------------'
616echo ' Configure results'
617echo '---------------------------------------------------------------------'
618echo
619 echo "Prefix : ${prefix}"
620if test "x${BUILD_SERVER}" = "xyes"; then
621 echo "Build Server : YES"
622else
623 echo "Build Server : NO"
624fi
625if test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"; then
626 echo "Encryption enabled : YES"
627else
628 echo "Encryption enabled : NO"
629fi
630if test "x${DB_DRIVERS}" != "x"; then
631 echo "Build DB-Drivers : ${DB_DRIVERS}"
632else
633 echo "Build DB-Drivers : NO"
634fi
635if test "x${BUILD_CLIENT}" = "xyes"; then
636 echo "Build Clients : YES"
637else
638 echo "Build Clients : NO"
639fi
640if test "x${BUILD_AGENT}" = "xyes"; then
641 echo "Build Agent : YES"
642 echo "Subagents list : ${SUBAGENT_DIRS}"
643else
644 echo "Build Agent : NO"
645fi
e8636669
VK
646if test "x${BUILD_STATIC_AGENT}" = "xyes"; then
647 echo "Build Static Agent : YES"
648 echo "Subagents list : ${STATIC_SUBAGENT_LIST}"
649else
650 echo "Build Static Agent : NO"
651fi