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