implemented sendEvent call in Java API; implemented event identification by name
[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
4cdb7f66 7AC_INIT([NetXMS], [1.1.7], [bugs@netxms.org])
ba1d810c
AK
8AC_CONFIG_AUX_DIR(config)
9AM_CONFIG_HEADER(config.h)
d16cf8a5 10AM_INIT_AUTOMAKE
09867021 11m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
d16cf8a5 12
aa24418a 13AC_CONFIG_MACRO_DIR([m4])
5387ff75 14
ef0c727b
VK
15#--------------------------------------------------------------------
16# Functions
17#--------------------------------------------------------------------
5387ff75 18
ef0c727b
VK
19check_substr()
20{
1010cff7 21 for w in $1; do
ef0c727b
VK
22 if test "x$w" = "x$2"; then
23 return 0;
24 fi
25 done
26 return 1
27}
16dff090 28
d3c8926d 29
ef0c727b
VK
30#--------------------------------------------------------------------
31# Initialize variables
32#--------------------------------------------------------------------
d3c8926d 33
ef0c727b
VK
34PLATFORM=`uname -s`
35COMPONENTS=""
36DISABLE_ICONV="no"
37DISABLE_ENCRYPTION="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"
f65df2b1 48MODULES="libnetxms tools install"
ef0c727b
VK
49STATIC_SUBAGENT_LIST=""
50SUBAGENT_DIRS=""
51SUBAGENT_LIBS=""
ef0c727b
VK
52SERVER_TOOLS=""
53TOP_LEVEL_MODULES=""
54CONTRIB_MODULES=""
c2612d83 55CLIENT_COMPONENTS=""
8b86c5dc 56BUILD_UNICODE="no"
7d8c91ef 57ORACLE_LIBS=""
6fce76d8
VK
58PGSQL_LIBS=""
59MYSQL_LIBS=""
60ODBC_LIBS=""
467c489f 61FORCE_INTERNAL_EXPAT="no"
17b35ccc
VK
62USE_INTERNAL_LIBTRE="no"
63FORCE_INTERNAL_LIBTRE="no"
1fd41bcd
VK
64USE_INTERNAL_ZLIB="no"
65FORCE_INTERNAL_ZLIB="no"
cc297a70 66FORCE_32BIT_BUILD="no"
545bda2d
VK
67LDFLAGS_PREFIX=""
68LDFLAGS_SUFFIX=""
1ef5e57a
VK
69LTINIT_CC=""
70LTINIT_CXX=""
d3c8926d 71
16dff090 72
fecf6a2b
VK
73#--------------------------------------------------------------------
74# Common compilation flags
75#--------------------------------------------------------------------
76
77CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
78
79
ef0c727b
VK
80#--------------------------------------------------------------------
81# Parse command line parameters
82#--------------------------------------------------------------------
7c9c94a7 83
ef0c727b
VK
84AC_ARG_WITH(server,
85[AS_HELP_STRING(--with-server,build server)],
86[
8817f620 87 COMPONENTS="$COMPONENTS sqlite snmp server agent"
c5c0f362
VK
88])
89
90AC_ARG_WITH(snmp,
91[AS_HELP_STRING(--with-snmp,build SNMP library and tools)],
92[
93 COMPONENTS="$COMPONENTS snmp"
ef0c727b 94])
7c9c94a7 95
ef0c727b
VK
96AC_ARG_WITH(client,
97[AS_HELP_STRING(--with-client,build client library and tools)],
98[
99 COMPONENTS="$COMPONENTS client"
100])
d16cf8a5 101
ef0c727b
VK
102AC_ARG_WITH(agent,
103[AS_HELP_STRING(--with-agent,build agent)],
104[
8817f620 105 COMPONENTS="$COMPONENTS sqlite agent"
ef0c727b 106])
d16cf8a5 107
ef0c727b
VK
108AC_ARG_WITH(static-agent,
109[AS_HELP_STRING(--with-static-agent,build statically linked agent)],
110[
8817f620 111 COMPONENTS="$COMPONENTS sqlite static-agent"
ef0c727b 112])
d16cf8a5 113
ef0c727b
VK
114AC_ARG_WITH(ipso-agent,
115[AS_HELP_STRING(--with-ipso-agent,build statically linked IPSO agent)],
116[
971abf4f 117 COMPONENTS="$COMPONENTS ipso-agent"
ef0c727b 118])
521d90e7 119
e02b69b9
VK
120AC_ARG_WITH(webui,
121[AS_HELP_STRING(--with-webui,build web interface)],
ef0c727b 122[
e02b69b9 123 COMPONENTS="$COMPONENTS webui"
ef0c727b 124])
d16cf8a5 125
ef0c727b
VK
126AC_ARG_WITH(mdebug,
127[AS_HELP_STRING(--with-mdebug,use debug version of memory allocation functions)],
128[
129 CPPFLAGS="$CPPFLAGS -DNETXMS_MEMORY_DEBUG"
130])
d16cf8a5 131
467c489f
VK
132AC_ARG_WITH(internal-libexpat,
133[AS_HELP_STRING(--with-internal-libexpat,force use of bundled libexpat)],
134[
135 FORCE_INTERNAL_EXPAT="yes"
136])
137
17b35ccc
VK
138AC_ARG_WITH(internal-libtre,
139[AS_HELP_STRING(--with-internal-libtre,force use of bundled libtre)],
140[
141 FORCE_INTERNAL_LIBTRE="yes"
142])
143
1fd41bcd
VK
144AC_ARG_WITH(internal-zlib,
145[AS_HELP_STRING(--with-internal-zlib,force use of bundled zlib)],
146[
147 FORCE_INTERNAL_ZLIB="yes"
148])
149
9486b324
VK
150AC_ARG_WITH(sqlite,
151[AS_HELP_STRING(--with-sqlite,build SQLite database driver)],
152[ if test "x$withval" != "xno" ; then
8817f620 153 COMPONENTS="$COMPONENTS sqlite_drv"
ef0c727b 154 DBDRIVER_SELECTED="yes"
9486b324
VK
155fi ])
156
c4b88c3d
VK
157AC_ARG_WITH(odbc,
158[AS_HELP_STRING(--with-odbc,build ODBC database driver)],
159[ if test "x$withval" != "xno" ; then
160 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
161 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
162 LDFLAGS="$LDFLAGS -L${withval}/lib"
163 CPPFLAGS="$CPPFLAGS -I${withval}/include"
ef0c727b
VK
164 fi
165 COMPONENTS="$COMPONENTS odbc"
166 DBDRIVER_SELECTED="yes"
c4b88c3d
VK
167fi ])
168
41b4790d
VK
169AC_ARG_WITH(oracle,
170[AS_HELP_STRING(--with-oracle,build Oracle database driver)],
171[ if test "x$withval" != "xno" ; then
172 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
7d8c91ef
VK
173 if test -x "$withval/lib" ; then
174 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
175 LDFLAGS="$LDFLAGS -L${withval}/lib"
176 else
177 LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
178 LDFLAGS="$LDFLAGS -L${withval}"
179 fi
180 if test -x "$withval/include" ; then
181 CPPFLAGS="$CPPFLAGS -I${withval}/include"
182 fi
183 if test -x "$withval/sdk/include" ; then
184 CPPFLAGS="$CPPFLAGS -I${withval}/sdk/include"
185 fi
41b4790d
VK
186 fi
187 COMPONENTS="$COMPONENTS oracle"
188 DBDRIVER_SELECTED="yes"
189fi ])
190
d16cf8a5 191AC_ARG_WITH(mysql,
c4b88c3d 192[AS_HELP_STRING(--with-mysql,build MySQL database driver)],
d16cf8a5
AK
193[ if test "x$withval" != "xno" ; then
194 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
195 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
196 LDFLAGS="$LDFLAGS -L${withval}/lib -L${withval}/lib/mysql -L${withval}/mysql/lib"
6693a1d0 197 CPPFLAGS="$CPPFLAGS -I${withval}/include -I${withval}/include/mysql -I${withval}/mysql/include"
d16cf8a5 198 else
007ae516
VK
199 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}"
200 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 201 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 202 fi
ef0c727b
VK
203 COMPONENTS="$COMPONENTS mysql"
204 DBDRIVER_SELECTED="yes"
6693a1d0 205fi ])
d16cf8a5
AK
206
207AC_ARG_WITH(pgsql,
c4b88c3d 208[AS_HELP_STRING(--with-pgsql,build PostgreSQL database driver)],
d16cf8a5 209[ if test "x$withval" != "xno" ; then
6693a1d0
AK
210 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
211 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
212 LDFLAGS="$LDFLAGS -L${withval}/lib -L${withval}/lib/pgsql -L${withval}/lib/postgresql -L${withval}/pgsql/lib -L${withval}/postgresql/lib"
213 CPPFLAGS="$CPPFLAGS -I${withval}/include -I${withval}/include/pgsql -I${withval}/include/postgresql -I${withval}/pgsql/include -I${withval}/postgresql/include"
214 else
007ae516
VK
215 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}"
216 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
217 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"
218 fi
ef0c727b
VK
219 COMPONENTS="$COMPONENTS pgsql"
220 DBDRIVER_SELECTED="yes"
6693a1d0 221fi ])
d16cf8a5 222
84277a0f
AK
223AC_ARG_WITH(db2,
224[AS_HELP_STRING(--with-db2,build DB2 database driver)],
225[ if test "x$withval" != "xno" ; then
226 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
227 if test `uname -m` = 'i386' || test `uname -m` = 'i686'; then
228 DB2_LIB_DIR=lib32
229 else
230 DB2_LIB_DIR=lib64
231 fi
232 if test -x "$withval/${DB2_LIB_DIR}" ; then
233 LD_RUN_PATH="${withval}/${DB2_LIB_DIR}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
234 LDFLAGS="$LDFLAGS -L${withval}/${DB2_LIB_DIR}"
235 else
236 LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
237 LDFLAGS="$LDFLAGS -L${withval}"
238 fi
239 if test -x "$withval/include" ; then
240 CPPFLAGS="$CPPFLAGS -I${withval}/include"
241 fi
242
243 unset DB2_LIB_DIR
244 fi
245 COMPONENTS="$COMPONENTS db2"
246 DBDRIVER_SELECTED="yes"
247fi ])
248
37861c72
VK
249AC_ARG_WITH(informix,
250[AS_HELP_STRING(--with-informix,build Informix database driver)],
251[ if test "x$withval" != "xno" ; then
252 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
253 if test -x "$withval/lib/cli" ; then
254 LD_RUN_PATH="${withval}/lib/cli${LD_RUN_PATH:+:}${LD_RUN_PATH}"
255 LDFLAGS="$LDFLAGS -L${withval}/lib/cli"
256 if test -x "$withval/lib/esql" ; then
257 LD_RUN_PATH="${withval}/lib/esql${LD_RUN_PATH:+:}${LD_RUN_PATH}"
258 LDFLAGS="$LDFLAGS -L${withval}/lib/esql"
259 fi
260 else
261 LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
262 LDFLAGS="$LDFLAGS -L${withval}"
263 fi
264 if test -x "$withval/incl/cli" ; then
265 CPPFLAGS="$CPPFLAGS -I${withval}/incl/cli"
266 fi
267 fi
268 COMPONENTS="$COMPONENTS informix"
269 DBDRIVER_SELECTED="yes"
270fi ])
271
ef0c727b 272AC_ARG_WITH(openssl,
1010cff7
VK
273[AS_HELP_STRING(--with-openssl,specify OpenSSL location)],
274[
275 if test "x$withval" != "xno" ; then
276 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
277 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
278 LDFLAGS="$LDFLAGS -L${withval}/lib"
279 CPPFLAGS="$CPPFLAGS -I${withval}/include"
280 else
281 LD_RUN_PATH="/usr/local/lib:/opt/openssl/lib:/usr/local/ssl/lib:${LD_RUN_PATH:+:}${LD_RUN_PATH}"
282 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/opt/openssl/lib"
4d37b0c5 283 CPPFLAGS="$CPPFLAGS -I/opt/openssl/include"
ef0c727b 284 fi
1010cff7
VK
285 fi
286 REQUIRE_ENCRYPTION="yes"
287])
ef0c727b 288
c3cfc039
VK
289AC_ARG_WITH(gd,
290[AS_HELP_STRING(--with-gd,specify GD location)],
291[
292 if test "x$withval" != "x" && test "x$withval" != "xyes" ; then
293 LD_RUN_PATH="${withval}/lib${LD_RUN_PATH:+:}${LD_RUN_PATH}"
294 LDFLAGS="$LDFLAGS -L${withval}/lib"
295 CPPFLAGS="$CPPFLAGS -I${withval}/include"
296 fi
297])
298
ef0c727b
VK
299AC_ARG_ENABLE(iconv,
300[AS_HELP_STRING(--disable-iconv,do not use iconv() for text conversions)],
3a7ce527 301[
ef0c727b 302 DISABLE_ICONV="yes"
3a7ce527 303])
3a7ce527 304
ef0c727b
VK
305AC_ARG_ENABLE(encryption,
306[AS_HELP_STRING(--disable-encryption,disable encryption support)],
e0760102 307[
ef0c727b 308 DISABLE_ENCRYPTION="yes"
e0760102
VK
309])
310
a67fa146
VK
311AC_ARG_ENABLE(unicode,
312[AS_HELP_STRING(--enable-unicode,enable UNICODE build)],
313[
314 BUILD_UNICODE="yes"
315 CPPFLAGS="$CPPFLAGS -DUNICODE"
316])
317
f974a50a
VK
318AC_ARG_ENABLE(debug,
319[AS_HELP_STRING(--enable-debug,enable additional debugging functionality)],
320[
321 ENABLE_DEBUG="yes"
322])
323
cc297a70
VK
324AC_ARG_ENABLE(64bit,
325[AS_HELP_STRING(--disable-64bit,disable 64bit build (force 32bit build event on 64bit machine))],
326[
327 FORCE_32BIT_BUILD="yes"
328])
329
ef0c727b
VK
330AC_ARG_WITH(dist,
331[AS_HELP_STRING(--with-dist,for maintainers only)],
87f1fff0 332 DB_DRIVERS=" mysql pgsql odbc mssql sqlite oracle db2 informix"
1fd41bcd 333 MODULES="libexpat libtre zlib libnetxms install sqlite snmp libnxsl libnxlp db server agent libnxmap libnxcl client nxscript tools webui"
80e96a82 334 SUBAGENT_DIRS="linux freebsd openbsd netbsd sunos aix ipso hpux odbcquery informix"
ef0c727b
VK
335 NXCONFIG="nxconfig"
336 TOP_LEVEL_MODULES="sql images"
337 CONTRIB_MODULES="mibs backgrounds"
9cb6c12f 338 CLIENT_COMPONENTS="nxalarm nxevent nxlexer nxpush nxsms scilexer windows"
ef0c727b
VK
339 SERVER_TOOLS="nxconfig"
340)
341
d8ca9c03 342
ef0c727b
VK
343#--------------------------------------------------------------------
344# Validate command line parameters and set various checking options
345#--------------------------------------------------------------------
346
8817f620
VK
347check_substr "$COMPONENTS" "sqlite"
348if test $? = 0; then
349 MODULES="$MODULES sqlite"
350fi
351
ef0c727b 352check_substr "$COMPONENTS" "static-agent"
1010cff7 353if test $? = 0; then
971abf4f
VK
354 if test "x$COMPONENTS" != "x sqlite static-agent"; then
355 AC_MSG_ERROR(Static agent and other components are mutually exclusive.)
ef0c727b
VK
356 fi
357 STATIC_BUILD="yes"
358 BUILD_STATIC_AGENT="yes"
aa8d6795 359 MODULES="$MODULES libnxlp agent"
3a6979cf 360 DISABLE_ICONV="yes"
ef0c727b 361 CPPFLAGS="$CPPFLAGS -D_STATIC_AGENT"
971abf4f
VK
362 STATIC_SUBAGENT_LIST="ecs logwatch ping portcheck ups"
363 SUBAGENT_LIBS="../subagents/ecs/libnsm_ecs.la ../subagents/logwatch/libnsm_logwatch.la ../subagents/ping/libnsm_ping.la ../subagents/portCheck/libnsm_portCheck.la ../subagents/ups/libnsm_ups.la"
e8636669 364
ef0c727b 365 case "$PLATFORM" in
e8636669
VK
366 Linux)
367 SUBAGENT_DIRS="linux"
971abf4f 368 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/linux/libnsm_linux.la"
d0b5a098 369 STATIC_SUBAGENT_LIST="linux $STATIC_SUBAGENT_LIST"
e8636669
VK
370 ;;
371 FreeBSD)
372 SUBAGENT_DIRS="freebsd"
971abf4f 373 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/freebsd/libnsm_freebsd.la"
d0b5a098 374 STATIC_SUBAGENT_LIST="freebsd $STATIC_SUBAGENT_LIST"
e8636669 375 ;;
992ba479
AK
376 OpenBSD)
377 SUBAGENT_DIRS="openbsd"
971abf4f 378 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/openbsd/libnsm_openbsd.la"
992ba479
AK
379 STATIC_SUBAGENT_LIST="openbsd $STATIC_SUBAGENT_LIST"
380 ;;
ad0f1ada
VK
381 NetBSD)
382 SUBAGENT_DIRS="netbsd"
971abf4f 383 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/netbsd/libnsm_netbsd.la"
ad0f1ada
VK
384 STATIC_SUBAGENT_LIST="netbsd $STATIC_SUBAGENT_LIST"
385 ;;
e8636669
VK
386 SunOS)
387 SUBAGENT_DIRS="sunos"
971abf4f 388 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/sunos/libnsm_sunos.la"
d0b5a098
VK
389 STATIC_SUBAGENT_LIST="sunos $STATIC_SUBAGENT_LIST"
390 ;;
391 AIX)
392 SUBAGENT_DIRS="aix"
971abf4f 393 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/aix/libnsm_aix.la"
d0b5a098 394 STATIC_SUBAGENT_LIST="aix $STATIC_SUBAGENT_LIST"
e8636669 395 ;;
c29360a9
VK
396 HP-UX)
397 SUBAGENT_DIRS="hpux"
971abf4f 398 SUBAGENT_LIBS="$SUBAGENT_LIBS ../subagents/hpux/libnsm_hpux.la"
c29360a9
VK
399 STATIC_SUBAGENT_LIST="hpux $STATIC_SUBAGENT_LIST"
400 ;;
e8636669
VK
401 *)
402 # unknown
403 ;;
404 esac
ef0c727b 405fi
2b23dc1e 406
ef0c727b 407check_substr "$COMPONENTS" "ipso-agent"
1010cff7 408if test $? = 0; then
fd5a401b 409 if test "x$COMPONENTS" != "x ipso-agent"; then
971abf4f 410 AC_MSG_ERROR(IPSO agent and other components are mutually exclusive.)
ef0c727b
VK
411 fi
412 STATIC_BUILD="yes"
413 BUILD_STATIC_AGENT="yes"
3a6979cf 414 DISABLE_ICONV="yes"
ef0c727b 415 USE_PTH="yes"
aa8d6795 416 MODULES="$MODULES libnxlp agent"
aa24418a 417 CPPFLAGS="$CPPFLAGS -D_STATIC_AGENT -D_IPSO -D_USE_GNU_PTH -DSQLITE_THREADSAFE=0 -I/usr/local/include"
ef0c727b 418 LDFLAGS="$LDFLAGS -all-static"
971abf4f 419 STATIC_SUBAGENT_LIST="ecs ipso logwatch ping portcheck ups"
ef0c727b 420 SUBAGENT_DIRS="ipso"
971abf4f 421 SUBAGENT_LIBS="../subagents/ecs/libnsm_ecs.la ../subagents/ipso/libnsm_ipso.la ../subagents/logwatch/libnsm_logwatch.la ../subagents/ping/libnsm_ping.la ../subagents/portCheck/libnsm_portCheck.la ../subagents/ups/libnsm_ups.la"
ef0c727b 422fi
c688d2a7 423
c5c0f362
VK
424check_substr "$COMPONENTS" "snmp"
425if test $? = 0; then
426 NEED_ZLIB="yes"
427 MODULES="$MODULES snmp"
428fi
429
ef0c727b 430check_substr "$COMPONENTS" "server"
1010cff7 431if test $? = 0; then
ef0c727b
VK
432 if test "x$DBDRIVER_SELECTED" != "xyes"; then
433 AC_MSG_ERROR(You must select at least one database driver when building server.)
434 fi
435 BUILD_SERVER="yes"
d1834406 436 MODULES="$MODULES libnxmap libnxsl libnxlp db server nxscript"
ef0c727b
VK
437 TOP_LEVEL_MODULES="$TOP_LEVEL_MODULES sql images"
438 CONTRIB_MODULES="$CONTRIB_MODULES mibs backgrounds"
439fi
dff54fed 440
e44986e5
VK
441check_substr "$COMPONENTS" "client"
442if test $? = 0; then
443 BUILD_CLIENT="yes"
444 NEED_ZLIB="yes"
aa24418a 445 MODULES="$MODULES libnxmap libnxcl client"
36ad9f45 446 CLIENT_COMPONENTS="$CLIENT_COMPONENTS nxalarm nxevent nxpush nxsms"
e44986e5
VK
447fi
448
ef0c727b 449check_substr "$COMPONENTS" "agent"
1010cff7 450if test $? = 0; then
ef0c727b 451 BUILD_AGENT="yes"
28ba6824 452 MODULES="$MODULES libnxlp db agent"
1010cff7
VK
453
454 case "$PLATFORM" in
455 Linux)
456 SUBAGENT_DIRS="linux"
457 ;;
458 FreeBSD)
459 SUBAGENT_DIRS="freebsd"
460 ;;
461 OpenBSD)
462 SUBAGENT_DIRS="openbsd"
463 ;;
ad0f1ada
VK
464 NetBSD)
465 SUBAGENT_DIRS="netbsd"
466 ;;
1010cff7
VK
467 SunOS)
468 SUBAGENT_DIRS="sunos"
469 ;;
470 AIX)
471 SUBAGENT_DIRS="aix"
472 ;;
473 HP-UX)
474 SUBAGENT_DIRS="hpux"
475 ;;
476 *)
477 # unknown
478 ;;
479 esac
ef0c727b 480fi
b97191d2 481
e02b69b9 482check_substr "$COMPONENTS" "webui"
1010cff7 483if test $? = 0; then
ef0c727b 484 BUILD_NXHTTPD="yes"
e02b69b9 485 MODULES="$MODULES libnxmap libnxcl webui"
ef0c727b 486fi
b67a9e12 487
ef0c727b 488check_substr "$COMPONENTS" "mysql"
1010cff7 489if test $? = 0; then
ef0c727b 490 DB_DRIVERS="$DB_DRIVERS mysql"
b67a9e12 491fi
6619a6b0 492
ef0c727b 493check_substr "$COMPONENTS" "pgsql"
1010cff7 494if test $? = 0; then
ef0c727b
VK
495 DB_DRIVERS="$DB_DRIVERS pgsql"
496fi
e8636669 497
8817f620 498check_substr "$COMPONENTS" "sqlite_drv"
1010cff7 499if test $? = 0; then
ef0c727b 500 DB_DRIVERS="$DB_DRIVERS sqlite"
e8636669
VK
501fi
502
ef0c727b 503check_substr "$COMPONENTS" "odbc"
1010cff7 504if test $? = 0; then
ef0c727b 505 DB_DRIVERS="$DB_DRIVERS odbc"
80e96a82 506 SUBAGENT_DIRS="$SUBAGENT_DIRS odbcquery"
ef0c727b
VK
507fi
508
41b4790d
VK
509check_substr "$COMPONENTS" "oracle"
510if test $? = 0; then
511 DB_DRIVERS="$DB_DRIVERS oracle"
512fi
513
84277a0f
AK
514check_substr "$COMPONENTS" "db2"
515if test $? = 0; then
516 DB_DRIVERS="$DB_DRIVERS db2"
517fi
518
87f1fff0
VK
519check_substr "$COMPONENTS" "informix"
520if test $? = 0; then
521 DB_DRIVERS="$DB_DRIVERS informix"
80e96a82 522 SUBAGENT_DIRS="$SUBAGENT_DIRS informix"
87f1fff0
VK
523fi
524
ef0c727b
VK
525
526#--------------------------------------------------------------------
527# Check for programs
528#--------------------------------------------------------------------
529
530if test "x$PLATFORM" = "xHP-UX"; then
e7d9c4ae 531 AC_CHECK_PROG([CCC], [aCC], [aCC])
ef0c727b
VK
532fi
533AC_PROG_CC(aCC gcc cc cl)
534AC_PROG_CPP
535AC_PROG_CXX
c3cfc039 536if test "x$CXX" = "xg++"; then
753206b5
AK
537 AC_CHECK_PROG([GPLUSPLUS], [g++], [yes], [no])
538 if test "x$GPLUSPLUS" = "xno"; then
c3cfc039
VK
539 AC_MSG_ERROR([*** FATAL: Cannot find any usable C++ compiler])
540 fi
541fi
ef0c727b
VK
542AC_PROG_INSTALL
543AC_PROG_LEX
76154a95 544AC_CHECK_PROGS(YACC,bison byacc,yacc)
ef0c727b
VK
545AC_PROG_LN_S
546
547AC_ARG_VAR(PERL,local path to the perl interpreter)
548perl_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/perl/bin:/opt/perl/usr/bin:/opt/perl/usr/local/bin"
549AC_PATH_PROG(PERL,perl,/usr/bin/env perl,$perl_possible_path)
550
551
ef0c727b
VK
552#--------------------------------------------------------------------
553# C/C++ capabilities
554#--------------------------------------------------------------------
555
556AC_C_CONST
557AC_PROG_GCC_TRADITIONAL
1d9cc60e 558AC_C_BIGENDIAN
ef0c727b
VK
559
560
561#--------------------------------------------------------------------
562# Platform-dependent settings
563#--------------------------------------------------------------------
564
565case "$PLATFORM" in
566 AIX)
545bda2d 567 LDFLAGS_PREFIX="-no-undefined -Wl,-brtl $LDFLAGS"
ef0c727b
VK
568 ;;
569 HP-UX)
53c96e2d 570 CPPFLAGS="$CPPFLAGS -D_HPUX -D_HPUX_SOURCE -D_POSIX_PTHREAD_SEMANTICS -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED=1 -D_REENTRANT -D_INCLUDE_LONGLONG"
ef0c727b 571 if test "x$CXX" = "xaCC"; then
53c96e2d 572 CFLAGS="$CFLAGS -AC99"
cfd95c74 573 CXXFLAGS="-mt $CXXFLAGS +W749 +W829"
ef0c727b
VK
574 LDFLAGS="$LDFLAGS -mt"
575 fi
576 ;;
75c30ed4 577 SunOS)
27ed5b1d 578 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
75c30ed4
VK
579 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
580 export LD_LIBRARY_PATH
581 ;;
56b2f755
VK
582 Linux)
583 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
584 ;;
ef0c727b
VK
585 *)
586 ;;
587esac
588
589
590#--------------------------------------------------------------------
c90d3610 591# C++ compiler tuning:
cc297a70 592# * Disable C++ exceptions and RTTI
779ce551 593# * Turn on 64bit mode on HP-UX/Itanium
cc297a70 594# * Turn on 64bit mode on AIX
ef0c727b
VK
595#--------------------------------------------------------------------
596
597if test "x$CC" = "xgcc" ; then
598
599 AC_LANG_PUSH([C++])
600
601 AC_MSG_CHECKING(whether C++ compiler accepts -fno-rtti)
e6b112bc 602 OLD_CXXFLAGS="$CXXFLAGS"
ef0c727b
VK
603 CXXFLAGS="$CXXFLAGS -fno-rtti"
604 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
605 [ AC_MSG_RESULT(yes) ],
606 [
607 CXXFLAGS="$OLD_CXXFLAGS"
608 AC_MSG_RESULT(no)
609 ])
610
611 AC_MSG_CHECKING(whether C++ compiler accepts -fno-exceptions)
e6b112bc 612 OLD_CXXFLAGS="$CXXFLAGS"
ef0c727b
VK
613 CXXFLAGS="$CXXFLAGS -fno-exceptions"
614 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
615 [ AC_MSG_RESULT(yes) ],
616 [
617 CXXFLAGS="$OLD_CXXFLAGS"
618 AC_MSG_RESULT(no)
619 ])
620
621 AC_LANG_POP([C++])
622
bdf8e578 623 AC_MSG_CHECKING(whether C compiler accepts -Wno-unused-result)
e6b112bc 624 OLD_CPPFLAGS="$CPPFLAGS"
bdf8e578
VK
625 CPPFLAGS="$CPPFLAGS -Wno-unused-result"
626 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
627 [ AC_MSG_RESULT(yes) ],
628 [
629 CPPFLAGS="$OLD_CPPFLAGS"
630 AC_MSG_RESULT(no)
631 ])
632
779ce551 633 if test "x$PLATFORM" = "xHP-UX"; then
cc297a70
VK
634 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
635 AC_MSG_CHECKING(whether C compiler accepts -milp32)
636 OLD_CPPFLAGS="$CPPFLAGS"
637 CPPFLAGS="$CPPFLAGS -milp32"
638 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
639 [
640 LDFLAGS="-milp32 $LDFLAGS"
641 AC_MSG_RESULT(yes)
642 ],
643 [
644 CPPFLAGS="$OLD_CPPFLAGS"
645 AC_MSG_RESULT(no)
646 ])
647 else
648 AC_MSG_CHECKING(whether C compiler accepts -mlp64)
649 OLD_CPPFLAGS="$CPPFLAGS"
650 CPPFLAGS="$CPPFLAGS -mlp64"
651 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
652 [
653 LDFLAGS="-mlp64 -L/usr/lib/hpux64 -L/usr/local/lib/hpux64 $LDFLAGS"
654 AC_MSG_RESULT(yes)
655 ],
656 [
657 CPPFLAGS="$OLD_CPPFLAGS"
658 AC_MSG_RESULT(no)
659 ])
660 fi
661 fi
662
663 if test "x$PLATFORM" = "xAIX"; then
664 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
665 AC_MSG_CHECKING(whether C compiler accepts -maix32)
666 OLD_CPPFLAGS="$CPPFLAGS"
667 CPPFLAGS="$CPPFLAGS -maix32"
fecf6a2b 668 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
cc297a70
VK
669 [
670 LDFLAGS="-maix32 $LDFLAGS"
1ef5e57a
VK
671 LTINIT_CC="gcc -maix32"
672 LTINIT_CXX="g++ -maix32"
1c45282c 673 OBJECT_MODE=32
cc297a70
VK
674 AC_MSG_RESULT(yes)
675 ],
676 [
677 CPPFLAGS="$OLD_CPPFLAGS"
678 AC_MSG_RESULT(no)
679 ])
680 else
681 AC_MSG_CHECKING(whether C compiler accepts -maix64)
682 OLD_CPPFLAGS="$CPPFLAGS"
683 CPPFLAGS="$CPPFLAGS -maix64"
fecf6a2b 684 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
cc297a70
VK
685 [
686 LDFLAGS="-maix64 $LDFLAGS"
1ef5e57a
VK
687 LTINIT_CC="gcc -maix64"
688 LTINIT_CXX="g++ -maix64"
1c45282c 689 OBJECT_MODE=64
cc297a70
VK
690 AC_MSG_RESULT(yes)
691 ],
692 [
693 CPPFLAGS="$OLD_CPPFLAGS"
694 AC_MSG_RESULT(no)
695 ])
696 fi
779ce551
VK
697 fi
698
ce5592b2
VK
699 if test "x$ENABLE_DEBUG" = "xyes"; then
700 CPPFLAGS="$CPPFLAGS -ggdb3"
701 fi
ef0c727b
VK
702fi
703
cfd95c74
VK
704if test "x$CXX" = "xaCC" ; then
705 if test "x$FORCE_32BIT_BUILD" = "xyes"; then
706 AC_MSG_CHECKING(whether C compiler accepts +DD32)
4d37b0c5 707 OLD_CPPFLAGS="$CPPFLAGS"
cfd95c74
VK
708 CPPFLAGS="+DD32 $CPPFLAGS"
709 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
710 [
711 LDFLAGS="+DD32 $LDFLAGS"
712 AC_MSG_RESULT(yes)
713 ],
714 [
4d37b0c5
VK
715 CPPFLAGS="$OLD_CPPFLAGS"
716 AC_MSG_RESULT(no)
cfd95c74 717 ])
4d37b0c5 718 else
cfd95c74
VK
719 AC_MSG_CHECKING(whether C compiler accepts +DD64)
720 OLD_CPPFLAGS="$CPPFLAGS"
721 CPPFLAGS="+DD64 $CPPFLAGS"
722 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])],
723 [
724 LDFLAGS="+DD64 $LDFLAGS"
725 AC_MSG_RESULT(yes)
726 ],
727 [
728 CPPFLAGS="$OLD_CPPFLAGS"
729 AC_MSG_RESULT(no)
730 ])
4d37b0c5 731 fi
ef0c727b
VK
732fi
733
edb018d7
VK
734
735#--------------------------------------------------------------------
736# Initialize libtool
737#--------------------------------------------------------------------
738
739if test "x$STATIC_BUILD" = "xyes"; then
740 enable_shared=no
741 enable_static=yes
742else
743 enable_shared=yes
744 enable_static=no
745fi
1ef5e57a
VK
746
747if test "x$LTINIT_CC" != "x"; then
748 SAVED_CC="$CC"
749 CC="$LTINIT_CC"
750fi
751if test "x$LTINIT_CXX" != "x"; then
752 SAVED_CXX="$CXX"
753 CXX="$LTINIT_CXX"
754fi
755
ff12e2f1 756LT_PREREQ([2.2])
1ef5e57a
VK
757LT_INIT([dlopen])
758
759if test "x$SAVED_CC" != "x"; then
760 CC="$SAVED_CC"
761fi
762if test "x$SAVED_CXX" != "x"; then
763 CXX="$SAVED_CXX"
764fi
edb018d7
VK
765
766
cfd95c74
VK
767#--------------------------------------------------------------------
768# Additional include and library directories
769#--------------------------------------------------------------------
ef0c727b 770
cfd95c74
VK
771if test "x$CXX" != "xaCC"; then
772 if test -d /usr/local/include; then
773 if test "x$CC" = "xgcc"; then
774 AC_MSG_CHECKING(whether -I/usr/local/include needed)
775 OLD_CPPFLAGS="$CPPFLAGS"
776 CPPFLAGS="$CPPFLAGS -Werror -I/usr/local/include"
777 AC_TRY_COMPILE([],[],
778 [
779 CPPFLAGS="$OLD_CPPFLAGS -I/usr/local/include"
780 AC_MSG_RESULT(yes)
781 ],
782 [
783 CPPFLAGS="$OLD_CPPFLAGS"
784 AC_MSG_RESULT(no)
785 ]
786 )
787 else
788 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
789 fi
790 fi
791
792 if test -d /usr/kerberos/include; then
793 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
794 fi
ef0c727b 795
cfd95c74
VK
796 if test -d /usr/local/lib; then
797 LDFLAGS="$LDFLAGS -L/usr/local/lib"
798 fi
799fi
ef0c727b
VK
800
801#--------------------------------------------------------------------
802# Check for threads library - either POSIX or GNU
803#--------------------------------------------------------------------
804
805if test "x$USE_PTH" = "xyes"; then
806 AC_CHECK_HEADER(pth.h,,AC_MSG_ERROR([*** GNU Pth thread support not installed - please install first ***]))
807else
808 AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed - please install first ***]))
809
810 if test "x$CXX" = "xaCC"; then
811 PTHREAD_LIBS=""
812 else
813 PTHREAD_LIBS="error"
814 AC_MSG_CHECKING(for old style FreeBSD -pthread flag)
815 AC_EGREP_CPP(yes,
816 [#if defined(__FreeBSD_cc_version) || defined(__OpenBSD__)
817 yes
818 #endif
819 ], AC_MSG_RESULT(yes)
fecf6a2b 820 PTHREAD_LIBS="-pthread",
ef0c727b
VK
821 AC_MSG_RESULT(no))
822 if test "x$PTHREAD_LIBS" = "xerror"; then
823 AC_CHECK_LIB(pthread, pthread_attr_init,
824 PTHREAD_LIBS="-lpthread")
825 fi
f725c1b7 826 # On HP-UX (at least 11.00) pthread library contains
b041c587 827 # __pthread_attr_init_system instead of pthread_attr_init
f725c1b7 828 if test "x$PTHREAD_LIBS" = "xerror"; then
b041c587 829 AC_CHECK_LIB(pthread, __pthread_attr_init_system,
f725c1b7
VK
830 PTHREAD_LIBS="-lpthread")
831 fi
ef0c727b
VK
832 if test "x$PTHREAD_LIBS" = "xerror"; then
833 AC_CHECK_LIB(pthreads, pthread_attr_init,
834 PTHREAD_LIBS="-lpthreads")
835 fi
836 if test "x$PTHREAD_LIBS" = "xerror"; then
837 AC_CHECK_FUNC(pthread_attr_init,
838 PTHREAD_LIBS="")
839 fi
840 fi
841
842 if test "x$PTHREAD_LIBS" = "xerror"; then
843 AC_MSG_ERROR(*** Unable to locate working posix thread library ***)
844 fi
8d131dda 845 LIBS="$LIBS $PTHREAD_LIBS"
ef0c727b
VK
846
847 # Extensions to posix threads
848 AC_CHECK_HEADERS([pthread_np.h],,,[
9c29f76e 849#include <pthread.h>
ef0c727b
VK
850 ])
851 AC_CHECK_FUNCS([pthread_cond_reltimedwait_np])
852
853 # Check for recursive mutexes
39086394
VK
854 AC_CHECK_FUNCS([pthread_mutexattr_settype __pthread_mutexattr_settype pthread_mutexattr_setkind_np])
855 AC_CHECK_DECLS([pthread_mutexattr_settype, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_RECURSIVE_NP, MUTEX_TYPE_COUNTING_FAST],,,[
9c29f76e
VK
856#include <pthread.h>
857#if HAVE_PTHREAD_NP_H
858#include <pthread_np.h>
859#endif
ef0c727b
VK
860 ])
861
862 # Check for read/write locks
863 # On Linux, rwlock functions declared always, but pthread_rwlock_t may need
864 # additional defines
865 AC_CHECK_FUNCS([pthread_rwlock_init pthread_rwlock_timedrdlock pthread_rwlock_timedwrlock])
866 if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then
867 AC_CACHE_CHECK([for pthread_rwlock_t], ac_cv_struct_pthread_rw,
9c29f76e
VK
868 [AC_TRY_COMPILE([
869#include <sys/types.h>
870#include <pthread.h>
871 ],
ef0c727b
VK
872 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
873 ac_cv_struct_pthread_rw=yes, [
9c29f76e
VK
874 AC_TRY_COMPILE([
875#define _XOPEN_SOURCE 500
876#include <sys/types.h>
877#include <pthread.h>
878 ],
ef0c727b
VK
879 [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
880 ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
881 if test "$ac_cv_struct_pthread_rw" = "yes"; then
882 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
883 fi
884 ])])
885 if test "$ac_cv_struct_pthread_rw" = "yes"; then
886 AC_DEFINE(HAVE_PTHREAD_RWLOCK, 1, Define to 1 if you have working pthread read/write locks)
887 fi
888 fi
889
890fi
891
892
893#--------------------------------------------------------------------
894# Checks for OpenSSL
895#--------------------------------------------------------------------
896
897if test "x$DISABLE_ENCRYPTION" != "xyes" ; then
898 AC_CHECK_LIB(crypto, RSA_new,
899 [
900 AC_DEFINE(WITH_OPENSSL,,[with openssl])
901 AC_CHECK_LIB(crypto, EVP_aes_256_cbc,
902 [], [AC_DEFINE(NETXMS_NO_AES,,[desc])])
903 AC_CHECK_LIB(crypto, EVP_bf_cbc,
904 [], [AC_DEFINE(NETXMS_NO_BF,,[desc])])
905 AC_CHECK_LIB(crypto, EVP_idea_cbc,
906 [], [AC_DEFINE(NETXMS_NO_IDEA,,[desc])])
907 AC_CHECK_LIB(crypto, EVP_des_ede3_cbc,
908 [], [AC_DEFINE(NETXMS_NO_DES,,[desc])])
909 ],
910 [
911 if test "x$REQUIRE_ENCRYPTION" = "xyes"; then
912 AC_MSG_ERROR(libcrypto is required for encryption support)
913 else
914 AC_MSG_RESULT(libcrypto is required for encryption support)
915 fi
916 ])
917fi
918
919
0322eed7
VK
920#--------------------------------------------------------------------
921# Checks for header files
922#--------------------------------------------------------------------
923
924AC_CHECK_HEADERS([sys/types.h sys/stat.h unistd.h stdarg.h fcntl.h alloca.h])
2e98cdb4 925AC_CHECK_HEADERS([sys/int_types.h time.h sys/time.h sys/utsname.h sys/wait.h])
0322eed7
VK
926AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h net/nh.h sys/socket.h])
927AC_CHECK_HEADERS([fcntl.h dirent.h sys/ioctl.h sys/sockio.h poll.h termios.h])
928AC_CHECK_HEADERS([inttypes.h memory.h stdint.h stdlib.h strings.h string.h])
929AC_CHECK_HEADERS([readline/readline.h byteswap.h sys/select.h dlfcn.h])
930AC_CHECK_HEADERS([sys/sysctl.h sys/param.h sys/user.h vm/vm_param.h syslog.h getopt.h])
f09c2d05 931AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h],,,
0322eed7
VK
932[[#ifdef HAVE_SYS_TYPES_H
933# include <sys/types.h>
934#endif
935#ifdef HAVE_SYS_TIME_H
936# include <sys/time.h>
937#endif
938#ifdef HAVE_SYS_SOCKET_H
939# include <sys/socket.h>
940#endif
941]])
942
943
ef0c727b
VK
944#--------------------------------------------------------------------
945# Checks for other libs.
946#--------------------------------------------------------------------
d16cf8a5 947
779ce551 948AC_CHECK_LIB(xnet, accept)
521d90e7 949AC_CHECK_LIB(socket, if_nameindex)
87bb64a7 950AC_CHECK_LIB(dl, dlopen)
1b3c0ef0 951AC_CHECK_LIB(kstat, kstat_open)
b821526a 952AC_CHECK_LIB(gnugetopt, getopt_long)
d16cf8a5 953
e0760102
VK
954if test "x$BUILD_SERVER" = "xyes" ; then
955 AC_CHECK_LIB(termcap, tgetstr, [], [AC_CHECK_LIB(ncurses, tgetstr, [], AC_CHECK_LIB(curses, tgetstr))])
0322eed7
VK
956 AC_CHECK_LIB(readline, readline, [], [AC_CHECK_LIB(edit, readline)])
957 AC_CHECK_FUNCS([readline])
958
959 # Check if passing rl_insert to rl_bind_key needs cast
960 if test "$ac_cv_func_readline" = "yes"; then
961 AC_LANG_PUSH([C++])
962
963 AC_MSG_CHECKING(for rl_insert cast)
964
965 AC_TRY_COMPILE(
966 [
967#include <stdio.h>
968#include <readline/readline.h>
969 ],[ rl_bind_key('\t', (Function *)rl_insert); ],
970 [
971 AC_MSG_RESULT((Function *))
972 AC_DEFINE(RL_INSERT_CAST,(Function *),Required cast for rl_insert)
973 ],[
974 AC_TRY_COMPILE(
975 [
976#include <stdio.h>
977#include <readline/readline.h>
978 ],[ rl_bind_key('\t', (rl_command_func_t *)rl_insert); ],
979 [
980 AC_MSG_RESULT((rl_command_func_t *))
981 AC_DEFINE(RL_INSERT_CAST,(rl_command_func_t *),Required cast for rl_insert)
982 ],[
983 AC_MSG_RESULT(not needed)
984 AC_DEFINE(RL_INSERT_CAST,,Required cast for rl_insert)
985 ]
986 )
987 ]
988 )
989
990 AC_LANG_POP([C++])
991 fi
e0760102
VK
992fi
993
ef0c727b 994if test "x$NEED_ZLIB" = "xyes"; then
1fd41bcd
VK
995 if test "x$FORCE_INTERNAL_ZLIB" = "xyes"; then
996 HAVE_ZLIB=no
997 else
998 HAVE_ZLIB=yes
999 AC_CHECK_HEADER(zlib.h,,HAVE_ZLIB=no)
1000 if test "x$HAVE_ZLIB" = "xyes"; then
1001 AC_CHECK_LIB(z, deflate, [], [ HAVE_ZLIB=no ])
1002 fi
1003 fi
1004 if test "x$HAVE_ZLIB" = "xno"; then
1005 MODULES="zlib $MODULES"
1006 fi
ef0c727b
VK
1007fi
1008
467c489f
VK
1009if test "x$FORCE_INTERNAL_EXPAT" = "xyes"; then
1010 HAVE_LIBEXPAT=no
1011else
1012 HAVE_LIBEXPAT=yes
1013 AC_CHECK_HEADER(expat.h,,HAVE_LIBEXPAT=no)
1014 AC_CHECK_LIB(expat, XML_Parse, [], [ HAVE_LIBEXPAT=no ])
1015fi
80ce37ac
VK
1016if test "x$HAVE_LIBEXPAT" = "xno"; then
1017 MODULES="libexpat $MODULES"
1bb6b449 1018fi
ef0c727b 1019
17b35ccc
VK
1020if test "x$FORCE_INTERNAL_LIBTRE" = "xyes"; then
1021 HAVE_LIBTRE=no
1022else
1023 HAVE_LIBTRE=yes
1024 AC_CHECK_HEADER(tre/regex.h,,HAVE_LIBTRE=no)
1025 AC_CHECK_LIB(tre, tre_compile, [], [ HAVE_LIBTRE=no ])
1026fi
1027if test "x$HAVE_LIBTRE" = "xno"; then
1028 MODULES="libtre $MODULES"
1029 AC_DEFINE(USE_BUNDLED_LIBTRE,1,Define to 1 if bundled libtre is used)
a67fa146 1030
720c23d0
VK
1031 tre_version_1='0'
1032 tre_version_2='8'
1033 tre_version_3='0'
a67fa146
VK
1034 tre_version=$tre_version_1.$tre_version_2.$tre_version_3
1035 AC_DEFINE_UNQUOTED(TRE_VERSION, "$tre_version", [ TRE version string. ])
1036 AC_DEFINE_UNQUOTED(TRE_VERSION_1, $tre_version_1, [ TRE version level 1. ])
1037 AC_DEFINE_UNQUOTED(TRE_VERSION_2, $tre_version_2, [ TRE version level 2. ])
1038 AC_DEFINE_UNQUOTED(TRE_VERSION_3, $tre_version_3, [ TRE version level 3. ])
1039 AC_SUBST(TRE_VERSION, $tre_version)
1040
1041 AC_DEFINE(TRE_REGEX_T_FIELD,value,[Define to a field in the regex_t struct where TRE should store a pointer to the internal tre_tnfa_t structure])
1042 AC_DEFINE(TRE_APPROX, 1, [ Define if you want to enable approximate matching functionality. ])
17b35ccc 1043fi
ef0c727b
VK
1044
1045#--------------------------------------------------------------------
1046# Checks for data types
1047#--------------------------------------------------------------------
1048
d16cf8a5
AK
1049AC_CHECK_SIZEOF(short)
1050AC_CHECK_SIZEOF(int)
1051AC_CHECK_SIZEOF(long)
1052AC_CHECK_SIZEOF(long long)
1053
1054AC_TYPE_PID_T
1055AC_TYPE_SIGNAL
1056AC_TYPE_SIZE_T
1057AC_STRUCT_TIMEZONE
1058
3071f10a 1059AC_CHECK_TYPES([long long, unsigned long long, int64_t, uint64_t, u_int64_t, uuid_t])
51128b42 1060AC_CHECK_TYPES([mode_t, off_t, socklen_t],,,[
4c779d83
VK
1061#if HAVE_SYS_TYPES_H
1062#include <sys/types.h>
1063#endif
1064#if HAVE_SYS_SOCKET_H
1065#include <sys/socket.h>
1066#endif
1067])
e0293f7f
VK
1068AC_CHECK_TYPES([struct stat64],,,[
1069#if HAVE_SYS_STAT_H
1070#include <sys/stat.h>
1071#endif
1072])
521d90e7 1073
e25cadc9 1074
ef0c727b
VK
1075#--------------------------------------------------------------------
1076# Checks for functions
1077#--------------------------------------------------------------------
d16cf8a5
AK
1078
1079AC_FUNC_ERROR_AT_LINE
d16cf8a5 1080AC_FUNC_MEMCMP
d16cf8a5
AK
1081AC_FUNC_SELECT_ARGTYPES
1082AC_FUNC_STRFTIME
1083AC_FUNC_STRTOD
1084AC_FUNC_VPRINTF
1085
80ce37ac 1086AC_CHECK_FUNCS([gettimeofday memmove memset bcopy strchr strcspn strdup strerror])
b50f1100 1087AC_CHECK_FUNCS([strrchr strtol strtoul strtoll strtoull])
467e30e1 1088AC_CHECK_FUNCS([if_nametoindex daemon mmap strerror_r scandir uname poll])
aa24418a
VK
1089AC_CHECK_FUNCS([usleep nanosleep getopt_long gmtime_r localtime_r lstat64])
1090
1091AC_CHECK_DECLS([nanosleep])
be6467e9 1092
b0823d06
VK
1093# Check if strerror_r is POSIX-compliant
1094if test "$ac_cv_func_strerror_r" = "yes"; then
1095 AC_MSG_CHECKING(if strerror_r is POSIX compliant)
1096 AC_LANG_PUSH([C++])
1097 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7f9423af
VK
1098#if HAVE_STRING_H
1099#include <string.h>
1100#endif
1101#if HAVE_ERRNO_H
1102#include <errno.h>
1103#endif
b0823d06 1104 ]],[[
7f9423af
VK
1105 int e;
1106 char buffer[256];
1107 e = strerror_r(1, buffer, 256);
1108 return e;
b0823d06
VK
1109 ]])
1110 ],[
1111 AC_MSG_RESULT(yes)
1112 AC_DEFINE(HAVE_POSIX_STRERROR_R,1,Define to 1 if strerror_r function is POSIX compliant)
1113 ],[
1114 AC_MSG_RESULT(no)
1115 AC_DEFINE(HAVE_POSIX_STRERROR_R,0,Define to 1 if strerror_r function is POSIX compliant)
1116 ])
1117 AC_LANG_POP([C++])
1118fi
1119
be6467e9
VK
1120# Check if timezone is a function
1121AC_MSG_CHECKING(for timezone function)
1122AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1123#if HAVE_TIME_H
1124#include <time.h>
1125#endif
1126#if HAVE_SYS_TIME_H
1127#include <sys/time.h>
1128#endif
1129]],[[
be6467e9 1130 timezone(0, 0);
be6467e9
VK
1131]])
1132],[
1133AC_MSG_RESULT(yes)
1134AC_DEFINE(HAVE_TIMEZONE,1,Define to 1 if timezone function is available)
1135],[
1136AC_MSG_RESULT(no)
445cba33
VK
1137AC_CHECK_DECLS([timezone],,,[
1138#if HAVE_TIME_H
1139#include <time.h>
1140#endif
1141#if HAVE_SYS_TIME_H
1142#include <sys/time.h>
1143#endif
1144])
be6467e9
VK
1145])
1146
1147# Check if struct tm has tm_gmtoff member
1148AC_MSG_CHECKING(for struct tm.tm_gmtoff)
1149AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1150#if HAVE_TIME_H
1151#include <time.h>
1152#endif
1153#if HAVE_SYS_TIME_H
1154#include <sys/time.h>
1155#endif
1156]],[[
be6467e9
VK
1157 struct tm t;
1158 return t.tm_gmtoff;
be6467e9
VK
1159]])
1160],[
1161AC_MSG_RESULT(yes)
1162AC_DEFINE(HAVE_TM_GMTOFF,1,Define to 1 if struct tm has tm_gmtoff member)
1163],[
1164AC_MSG_RESULT(no)
1165])
d16cf8a5 1166
99e50bb7
VK
1167AC_CHECK_DECLS([getopt_long],,,[
1168#if HAVE_GETOPT_H
1169#include <getopt.h>
1170#endif
1171])
73d7fbdb 1172
f91feddc 1173AC_CHECK_FUNCS([sysctlbyname sysctlnametomib])
70fed300
AK
1174AC_CHECK_FUNCS([tcgetattr tcsetattr cfsetospeed cfsetispeed])
1175
d16cf8a5
AK
1176# sockets/resolver (probably for solaris)
1177AC_CHECK_FUNC(connect, , [AC_CHECK_LIB(socket, connect)])
1178AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(resolv, gethostbyname)])
1179AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)])
1180
1181if test "x$ac_cv_lib_nsl_gethostbyname" != "xyes" && test "x$ac_cv_func_gethostbyname" != "xyes" ; then
1182 AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(socket, gethostbyname)])
1183fi
1184
1185if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname" ; then
1186 AC_MSG_CHECKING([if we can include libnsl + libsocket])
1187 LIBS="-lnsl -lsocket $LIBS"
1188 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void) gethostbyname]])],[my_ac_link_result=yes],[my_ac_link_result=no ])
1189 if test "$my_ac_link_result" = "no" ; then
1190 AC_MSG_RESULT([failure])
1191 AC_MSG_ERROR([unable to use gethostbyname()])
1192 else
1193 AC_MSG_RESULT([success])
1194 fi
1195fi
1196
c6491611
VK
1197# asprintf, scprintf, etc.
1198AC_CHECK_FUNCS([asprintf aswprintf vasprintf vaswprintf])
1199AC_CHECK_FUNCS([scprintf scwprintf vscprintf vscwprintf])
1200
1201AC_MSG_CHECKING(whether snprintf returns required buffer size)
1202AC_RUN_IFELSE(
1203 [AC_LANG_PROGRAM([
1204#include <stdio.h>
1205#include <string.h>
1206 ], [
1207 return !(snprintf(NULL, 0, "test: %d", 1000) >= 10);
1208 ])
1209 ],
1210 [ AC_MSG_RESULT(yes)
1211 AC_DEFINE(SNPRINTF_RETURNS_REQUIRED_SIZE, 1, Define to 1 if snprintf returns required buffer size in case of truncation)
1212 ],
1213 [ AC_MSG_RESULT(no) ],
1214 [ AC_MSG_RESULT(no) ]
1215)
1216
1217
dff54fed 1218
ef0c727b
VK
1219#--------------------------------------------------------------------
1220# Checks for macros and definitions
1221#--------------------------------------------------------------------
dff54fed 1222
ef0c727b
VK
1223AC_CHECK_DECLS([__bswap_32, __bswap_64, htonll, ntohll],,,[
1224#ifdef HAVE_SYS_TYPES_H
99e50bb7 1225#include <sys/types.h>
ef0c727b
VK
1226#endif
1227#if HAVE_BYTESWAP_H
1228#include <byteswap.h>
1229#endif
1230#if HAVE_NETINET_IN_H
1231#include <netinet/in.h>
1232#endif
1233#if HAVE_NET_NH_H
1234#include <net/nh.h>
1235#endif
1236])
aa24418a
VK
1237AC_CHECK_DECLS([RTLD_NOW, RTLD_GLOBAL],,,[
1238#ifdef HAVE_UNISTD_H
1239#include <unistd.h>
1240#endif
1241#ifdef HAVE_DLFCN_H
1242#include <dlfcn.h>
1243#endif
1244])
ce7565e7
VK
1245AC_CHECK_DECLS([va_copy, __va_copy],,,[
1246#ifdef HAVE_UNISTD_H
1247#include <unistd.h>
1248#endif
1249#ifdef HAVE_STDARG_H
1250#include <stdarg.h>
1251#endif
1252#ifdef HAVE_STDLIB_H
1253#include <stdlib.h>
1254#endif
1255])
dff54fed 1256
dff54fed 1257
ef0c727b
VK
1258#--------------------------------------------------------------------
1259# AIX specific checks
1260#--------------------------------------------------------------------
d16cf8a5 1261
ef0c727b
VK
1262if test "x$PLATFORM" = "xAIX"; then
1263 AC_CHECK_HEADERS([procinfo.h],,,[[ ]])
1264 AC_CHECK_DECLS([getkerninfo])
1265 AC_CHECK_FUNCS([getprocs64],,,[
1266#if HAVE_PROCINFO_H
1267#include <procinfo.h>
6cd41ceb 1268#endif
ef0c727b 1269 ])
7e56bf2e
VK
1270fi
1271
cd4c8ca3 1272
ba8db57b
VK
1273#--------------------------------------------------------------------
1274# HP-UX specific checks
1275#--------------------------------------------------------------------
1276
1277if test "x$PLATFORM" = "xHP-UX"; then
f09c2d05
VK
1278 AC_CHECK_HEADERS([sys/mib.h],,,[[ ]])
1279 AC_CHECK_DECLS([SIOCGIFNAME, SIOCGIFINDEX],,,[
1280#if HAVE_NET_IF_H
1281#include <net/if.h>
1282#endif
1283 ])
1284 AC_CHECK_DECLS([ID_ifXEntry, open_mib_64],,,[
1285#if HAVE_SYS_MIB_H
1286#include <sys/mib.h>
1287#endif
1288 ])
cfd95c74
VK
1289
1290 AC_MSG_CHECKING(if pst_diskinfo has read/write stats fields)
1291 AC_LANG_PUSH([C++])
1292 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1293#include <sys/pstat.h>
1294 ]], [[
1295pst_diskinfo d;
1296int x;
1297x = (int)d.psd_dkread;
1298x = (int)d.psd_dkwrite;
1299 ]])],
1300 [
1301 AC_DEFINE([HAVE_DISKINFO_RWSTATS],[1],[Define to 1 if pst_diskinfo has read/write stats fields])
1302 AC_MSG_RESULT(yes)
1303 ],
1304 [
1305 AC_MSG_RESULT(no)
1306 ])
1307 AC_LANG_POP([C++])
ba8db57b
VK
1308fi
1309
1310
aa24418a
VK
1311#--------------------------------------------------------------------
1312# *BSD specific checks
1313#--------------------------------------------------------------------
1314
1315AC_CHECK_LIB(kvm, kvm_open)
1316AC_CHECK_FUNCS([kvm_getswapinfo])
1317AC_CHECK_TYPES([struct kinfo_proc2],,,[
1318#if HAVE_SYS_SYSCTL_H
1319#include <sys/sysctl.h>
1320#endif
1321])
1322
1323
28ba6824
VK
1324#--------------------------------------------------------------------
1325# FreeBSD specific checks
1326#--------------------------------------------------------------------
1327
1328if test "x$PLATFORM" = "xFreeBSD"; then
61f58c11
VK
1329 AC_CHECK_DECLS([RTF_WASCLONED],[],[],[
1330#if HAVE_SYS_TYPES_H
1331#include <sys/types.h>
1332#endif
1333#if HAVE_SYS_SOCKET_H
1334#include <sys/socket.h>
1335#endif
1336#include <net/route.h>
1337 ])
28ba6824
VK
1338fi
1339
1340
ea6615cf
VK
1341#--------------------------------------------------------------------
1342# OpenBSD specific checks
1343#--------------------------------------------------------------------
1344
1345if test "x$PLATFORM" = "xOpenBSD"; then
1346 AC_MSG_CHECKING(if kvm_getprocs requires sizeof kinfo_proc argument)
1347 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1348#include <sys/param.h>
1349#include <sys/proc.h>
1350#include <kvm.h>
1351#include <sys/user.h>
1352 ]],[[
1353 int count;
1354 kvm_getprocs(NULL, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc), &count);
1355 return 0;
1356 ]])
1357 ],[
1358 AC_MSG_RESULT(yes)
1359 AC_DEFINE(KVM_GETPROCS_REQUIRES_SIZEOF,1,Define to 1 if kvm_getprocs requires sizeof kinfo_proc)
1360 ],[
1361 AC_MSG_RESULT(no)
1362 AC_DEFINE(KVM_GETPROCS_REQUIRES_SIZEOF,0,Define to 1 if kvm_getprocs requires sizeof kinfo_proc)
1363 ])
1364
1365 AC_MSG_CHECKING(if struct kinfo_proc has member kp_proc)
1366 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1367#include <sys/param.h>
1368#include <sys/proc.h>
1369#include <kvm.h>
1370#include <sys/user.h>
1371 ]],[[
1372 struct kinfo_proc p;
1373 return p.kp_proc.p_pid;
1374 ]])
1375 ],[
1376 AC_MSG_RESULT(yes)
1377 AC_DEFINE(KINFO_PROC_HAS_KP_PROC,1,Define to 1 if struct kinfo_proc has member kp_proc)
1378 ],[
1379 AC_MSG_RESULT(no)
1380 AC_DEFINE(KINFO_PROC_HAS_KP_PROC,0,Define to 1 if struct kinfo_proc has member kp_proc)
1381 ])
1382fi
1383
1384
ef0c727b
VK
1385#--------------------------------------------------------------------
1386# Check for UNICODE stuff
1387#--------------------------------------------------------------------
3e39fcde 1388
8b86c5dc 1389AC_CHECK_HEADERS([wchar.h wctype.h iconv.h])
aa24418a 1390AC_CHECK_TYPES([wchar_t, wint_t],,,[
6b93c954
VK
1391#if HAVE_WCHAR_H
1392#include <wchar.h>
1393#endif
1394])
3e39fcde 1395AC_CHECK_SIZEOF(wchar_t)
aa24418a
VK
1396AC_CHECK_FUNCS([wcslen wcsdup wcsncpy wcstoll wcstoull towupper wcserror wcserror_r])
1397AC_CHECK_FUNCS([wfopen wopen wstat wgetenv wrename wunlink])
ba8db57b 1398AC_CHECK_FUNCS([wfopen wopen wstat wgetenv wrename wunlink])
dff54fed 1399
3265ba38 1400if test "x$DISABLE_ICONV" != "xyes"; then
75c30ed4 1401 AC_CHECK_LIB(iconv, libiconv_open,
dff54fed 1402 [ ac_found_iconv=yes
8d131dda 1403 LIBS="$LIBS -liconv"
75c30ed4
VK
1404 AC_CHECK_FUNCS(libiconv, ac_found_iconv=yes, ac_found_iconv=no)
1405 ],
1406 [
1407 AC_CHECK_LIB(iconv, iconv,
1408 [ ac_found_iconv=yes
8d131dda 1409 LIBS="$LIBS -liconv"
75c30ed4
VK
1410 ])
1411 AC_CHECK_FUNCS(iconv, ac_found_iconv=yes, ac_found_iconv=no)
1412 ])
dff54fed
VK
1413else
1414 ac_found_iconv=no
ef0c727b 1415 CPPFLAGS="$CPPFLAGS -D__DISABLE_ICONV"
dff54fed 1416fi
93571e7f
VK
1417
1418AC_MSG_CHECKING(whether iconv supports UCS-2-INTERNAL)
1419AC_RUN_IFELSE(
1420 [AC_LANG_PROGRAM([
1421#if HAVE_ICONV_H
1422#include <iconv.h>
1423#endif
1424 ], [
1425 return iconv_open("UTF-8","UCS-2-INTERNAL")==(iconv_t)(-1);
1426 ])
1427 ],
1428 [ AC_MSG_RESULT(yes)
1429 AC_DEFINE(HAVE_ICONV_UCS_2_INTERNAL, 1, Define to 1 if iconv supports UCS-2-INTERNAL)
1430 valid_ucs2_code="UCS-2-INTERNAL"
1431 ],
1432 [ AC_MSG_RESULT(no) ],
1433 [ AC_MSG_RESULT(no) ]
1434)
1435
1436AC_MSG_CHECKING(whether iconv supports UCS-2)
1437AC_RUN_IFELSE(
1438 [AC_LANG_PROGRAM([
1439#if HAVE_ICONV_H
1440#include <iconv.h>
1441#endif
1442 ], [
1443 return iconv_open("UTF-8","UCS-2")==(iconv_t)(-1);
1444 ])
1445 ],
1446 [ AC_MSG_RESULT(yes)
1447 AC_DEFINE(HAVE_ICONV_UCS_2, 1, Define to 1 if iconv supports UCS-2)
1448 valid_ucs2_code="UCS-2"
1449 ],
1450 [ AC_MSG_RESULT(no) ],
8b86c5dc 1451 [ AC_MSG_RESULT(no) ]
93571e7f
VK
1452)
1453
1454AC_MSG_CHECKING(whether iconv supports UCS2)
1455AC_RUN_IFELSE(
1456 [AC_LANG_PROGRAM([
1457#if HAVE_ICONV_H
1458#include <iconv.h>
1459#endif
1460 ], [
1461 return iconv_open("UTF-8","UCS2")==(iconv_t)(-1);
1462 ])
1463 ],
1464 [ AC_MSG_RESULT(yes)
1465 AC_DEFINE(HAVE_ICONV_UCS2, 1, Define to 1 if iconv supports UCS2)
1466 valid_ucs2_code="UCS2"
1467 ],
1468 [ AC_MSG_RESULT(no) ],
1469 [ AC_MSG_RESULT(no) ]
1470)
1471
44bccbbc
VK
1472AC_MSG_CHECKING(whether iconv supports UCS-2BE)
1473AC_RUN_IFELSE(
1474 [AC_LANG_PROGRAM([
1475#if HAVE_ICONV_H
1476#include <iconv.h>
1477#endif
1478 ], [
1479 return iconv_open("UTF-8","UCS-2BE")==(iconv_t)(-1);
1480 ])
1481 ],
1482 [ AC_MSG_RESULT(yes)
1483 AC_DEFINE(HAVE_ICONV_UCS_2BE, 1, Define to 1 if iconv supports UCS-2BE)
1484 valid_ucs2_code="UCS-2BE"
1485 ],
1486 [ AC_MSG_RESULT(no) ],
1487 [ AC_MSG_RESULT(no) ]
1488)
1489
6e17f325
VK
1490AC_MSG_CHECKING(whether iconv supports UCS-2LE)
1491AC_RUN_IFELSE(
1492 [AC_LANG_PROGRAM([
1493#if HAVE_ICONV_H
1494#include <iconv.h>
1495#endif
1496 ], [
1497 return iconv_open("UTF-8","UCS-2LE")==(iconv_t)(-1);
1498 ])
1499 ],
1500 [ AC_MSG_RESULT(yes)
1501 AC_DEFINE(HAVE_ICONV_UCS_2LE, 1, Define to 1 if iconv supports UCS-2LE)
1502 valid_ucs2_code="UCS-2LE"
1503 ],
1504 [ AC_MSG_RESULT(no) ],
1505 [ AC_MSG_RESULT(no) ]
1506)
1507
4a4e1feb
VK
1508AC_MSG_CHECKING(whether iconv supports UTF-16)
1509AC_RUN_IFELSE(
1510 [AC_LANG_PROGRAM([
1511#if HAVE_ICONV_H
1512#include <iconv.h>
1513#endif
1514 ], [
1515 return iconv_open("UTF-8","UTF-16")==(iconv_t)(-1);
1516 ])
1517 ],
1518 [ AC_MSG_RESULT(yes)
1519 AC_DEFINE(HAVE_ICONV_UTF_16, 1, Define to 1 if iconv supports UTF-16)
1520 valid_ucs2_code="UTF-16"
1521 ],
1522 [ AC_MSG_RESULT(no) ],
1523 [ AC_MSG_RESULT(no) ]
1524)
1525
8b86c5dc
VK
1526AC_MSG_CHECKING(whether iconv supports UCS-4-INTERNAL)
1527AC_RUN_IFELSE(
1528 [AC_LANG_PROGRAM([
1529#if HAVE_ICONV_H
1530#include <iconv.h>
1531#endif
1532 ], [
1533 return iconv_open("UTF-8","UCS-4-INTERNAL")==(iconv_t)(-1);
1534 ])
1535 ],
1536 [ AC_MSG_RESULT(yes)
1537 AC_DEFINE(HAVE_ICONV_UCS_4_INTERNAL, 1, Define to 1 if iconv supports UCS-4-INTERNAL)
1538 valid_ucs4_code="UCS-4-INTERNAL"
1539 ],
1540 [ AC_MSG_RESULT(no) ],
1541 [ AC_MSG_RESULT(no) ]
1542)
1543
1544AC_MSG_CHECKING(whether iconv supports UCS-4)
1545AC_RUN_IFELSE(
1546 [AC_LANG_PROGRAM([
1547#if HAVE_ICONV_H
1548#include <iconv.h>
1549#endif
1550 ], [
1551 return iconv_open("UTF-8","UCS-4")==(iconv_t)(-1);
1552 ])
1553 ],
1554 [ AC_MSG_RESULT(yes)
1555 AC_DEFINE(HAVE_ICONV_UCS_4, 1, Define to 1 if iconv supports UCS-4)
1556 valid_ucs4_code="UCS-4"
1557 ],
1558 [ AC_MSG_RESULT(no) ],
1559 [ AC_MSG_RESULT(no) ]
1560)
1561
1562AC_MSG_CHECKING(whether iconv supports UCS4)
1563AC_RUN_IFELSE(
1564 [AC_LANG_PROGRAM([
1565#if HAVE_ICONV_H
1566#include <iconv.h>
1567#endif
1568 ], [
1569 return iconv_open("UTF-8","UCS4")==(iconv_t)(-1);
1570 ])
1571 ],
1572 [ AC_MSG_RESULT(yes)
1573 AC_DEFINE(HAVE_ICONV_UCS4, 1, Define to 1 if iconv supports UCS4)
1574 valid_ucs4_code="UCS4"
1575 ],
1576 [ AC_MSG_RESULT(no) ],
1577 [ AC_MSG_RESULT(no) ]
1578)
1579
1580AC_MSG_CHECKING(whether iconv supports UCS-4BE)
1581AC_RUN_IFELSE(
1582 [AC_LANG_PROGRAM([
1583#if HAVE_ICONV_H
1584#include <iconv.h>
1585#endif
1586 ], [
1587 return iconv_open("UTF-8","UCS-4BE")==(iconv_t)(-1);
1588 ])
1589 ],
1590 [ AC_MSG_RESULT(yes)
1591 AC_DEFINE(HAVE_ICONV_UCS_4BE, 1, Define to 1 if iconv supports UCS-4BE)
1592 valid_ucs4_code="UCS-4BE"
1593 ],
1594 [ AC_MSG_RESULT(no) ],
1595 [ AC_MSG_RESULT(no) ]
1596)
1597
6e17f325
VK
1598AC_MSG_CHECKING(whether iconv supports UCS-4LE)
1599AC_RUN_IFELSE(
1600 [AC_LANG_PROGRAM([
1601#if HAVE_ICONV_H
1602#include <iconv.h>
1603#endif
1604 ], [
1605 return iconv_open("UTF-8","UCS-4LE")==(iconv_t)(-1);
1606 ])
1607 ],
1608 [ AC_MSG_RESULT(yes)
1609 AC_DEFINE(HAVE_ICONV_UCS_4LE, 1, Define to 1 if iconv supports UCS-4LE)
1610 valid_ucs4_code="UCS-4LE"
1611 ],
1612 [ AC_MSG_RESULT(no) ],
1613 [ AC_MSG_RESULT(no) ]
1614)
1615
4a4e1feb
VK
1616AC_MSG_CHECKING(whether iconv supports UTF-32)
1617AC_RUN_IFELSE(
1618 [AC_LANG_PROGRAM([
1619#if HAVE_ICONV_H
1620#include <iconv.h>
1621#endif
1622 ], [
1623 return iconv_open("UTF-8","UTF-32")==(iconv_t)(-1);
1624 ])
1625 ],
1626 [ AC_MSG_RESULT(yes)
1627 AC_DEFINE(HAVE_ICONV_UTF_32, 1, Define to 1 if iconv supports UTF-32)
1628 valid_ucs4_code="UTF-32"
1629 ],
1630 [ AC_MSG_RESULT(no) ],
1631 [ AC_MSG_RESULT(no) ]
1632)
1633
5e40a69e
VK
1634AC_MSG_CHECKING(whether iconv supports ISO8859-1)
1635AC_RUN_IFELSE(
1636 [AC_LANG_PROGRAM([
1637#if HAVE_ICONV_H
1638#include <iconv.h>
1639#endif
1640 ], [
1641 return iconv_open("UTF-8","ISO8859-1")==(iconv_t)(-1);
1642 ])
1643 ],
1644 [ AC_MSG_RESULT(yes)
1645 AC_DEFINE(HAVE_ICONV_ISO8859_1, 1, Define to 1 if iconv supports ISO8859-1)
1646 ],
1647 [ AC_MSG_RESULT(no) ],
1648 [ AC_MSG_RESULT(no) ]
1649)
1650
1651AC_MSG_CHECKING(whether iconv supports ISO-8859-1)
1652AC_RUN_IFELSE(
1653 [AC_LANG_PROGRAM([
1654#if HAVE_ICONV_H
1655#include <iconv.h>
1656#endif
1657 ], [
1658 return iconv_open("UTF-8","ISO-8859-1")==(iconv_t)(-1);
1659 ])
1660 ],
1661 [ AC_MSG_RESULT(yes)
1662 AC_DEFINE(HAVE_ICONV_ISO_8859_1, 1, Define to 1 if iconv supports ISO-8859-1)
1663 ],
1664 [ AC_MSG_RESULT(no) ],
1665 [ AC_MSG_RESULT(no) ]
1666)
1667
1668AC_MSG_CHECKING(whether iconv supports ASCII)
1669AC_RUN_IFELSE(
1670 [AC_LANG_PROGRAM([
1671#if HAVE_ICONV_H
1672#include <iconv.h>
1673#endif
1674 ], [
1675 return iconv_open("UTF-8","ASCII")==(iconv_t)(-1);
1676 ])
1677 ],
1678 [ AC_MSG_RESULT(yes)
1679 AC_DEFINE(HAVE_ICONV_ASCII, 1, Define to 1 if iconv supports ASCII)
1680 ],
1681 [ AC_MSG_RESULT(no) ],
1682 [ AC_MSG_RESULT(no) ]
1683)
1684
93571e7f
VK
1685AC_MSG_CHECKING(whether iconv supports //IGNORE)
1686AC_RUN_IFELSE(
1687 [AC_LANG_PROGRAM([
1688#if HAVE_ICONV_H
1689#include <iconv.h>
1690#endif
1691 ], [
1692 return iconv_open("UTF-8//IGNORE","$valid_ucs2_code")==(iconv_t)(-1);
1693 ])
1694 ],
1695 [ AC_MSG_RESULT(yes)
1696 AC_DEFINE(HAVE_ICONV_IGNORE, 1, Define to 1 if iconv supports //IGNORE option)
1697 ],
1698 [ AC_MSG_RESULT(no) ],
1699 [ AC_MSG_RESULT(no) ]
1700)
3e39fcde 1701
19619a35
AK
1702# taken from ZSH's configure
1703# Check if iconv uses const in prototype declaration
24b1570c 1704if test "x$ac_found_iconv" = "xyes"; then
53c96e2d 1705 AC_LANG_PUSH([C++])
19619a35 1706 AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
7f9423af
VK
1707 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1708#include <stdlib.h>
f6a2136d 1709#if HAVE_ICONV_H
7f9423af 1710#include <iconv.h>
7f9423af 1711#endif
f6a2136d
VK
1712 ]],
1713 [[
3e51d371
VK
1714 char **p = NULL;
1715 iconv(0, (const char **)p, 0, 0, 0);
7f9423af 1716 ]])],
3e51d371
VK
1717 [ac_cv_iconv_const=const],
1718 [ac_cv_iconv_const=])])
53c96e2d 1719 AC_LANG_POP([C++])
19619a35
AK
1720 AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
1721 [Define as const if the declaration of iconv() needs const.])
1722fi
1723
a67fa146
VK
1724if test "x$ac_cv_type_wchar_t" = "xyes"; then
1725 if test $ac_cv_sizeof_wchar_t -eq 2; then
1726 AC_DEFINE(UNICODE_UCS2, 1, Define to 1 if you have 2-byte wchar_t)
1727 fi
8b86c5dc 1728
a67fa146
VK
1729 if test $ac_cv_sizeof_wchar_t -eq 4; then
1730 AC_DEFINE(UNICODE_UCS4, 1, Define to 1 if you have 4-byte wchar_t)
1731 fi
1732
1733 if test "x$USE_INTERNAL_LIBTRE" = "xyes"; then
1734 AC_DEFINE(TRE_WCHAR, 1, [ Define to enable wide character support in libtre.])
1735 fi
1736else
1737 if test "x$BUILD_UNICODE" = "xyes"; then
1738 AC_MSG_ERROR(wchar_t is required for UNICODE build)
1739 fi
8b86c5dc
VK
1740fi
1741
c29360a9 1742
ca0f4ea3
VK
1743#--------------------------------------------------------------------
1744# MySQL
1745#--------------------------------------------------------------------
1746
1747check_substr "$COMPONENTS" "mysql"
1748if test $? = 0; then
6fce76d8 1749 AC_CHECK_LIB(mysqlclient, mysql_init, [MYSQL_LIBS="-lmysqlclient"],
ca0f4ea3 1750 [AC_MSG_ERROR(libmysqlclient is requred for MySQL support)])
aa7794f0 1751
8d131dda
VK
1752 OLD_LIBS="$LIBS"
1753 LIBS="$LIBS $MYSQL_LIBS"
aa7794f0 1754
9c29f76e
VK
1755 AC_MSG_CHECKING(whether mysql clients can run)
1756 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1757#include <stdio.h>
1758#include <mysql.h>
1759int main(void)
1760{
1761 MYSQL *a = mysql_init(NULL);
1762 return 0;
1763}
1764 ]])],[],[
1765 AC_MSG_RESULT(no)
1766 AC_MSG_ERROR(Your MySQL client libraries aren't properly installed)
1767 ],[])
ca0f4ea3 1768 AC_MSG_RESULT(yes)
6fce76d8 1769
ca0f4ea3 1770 AC_CHECK_FUNCS(mysql_real_escape_string)
8d131dda 1771 LIBS="$OLD_LIBS"
ca0f4ea3
VK
1772fi
1773
1774
58ed4897
VK
1775#--------------------------------------------------------------------
1776# PostgreSQL
1777#--------------------------------------------------------------------
1778
203458b7 1779check_substr "$COMPONENTS" "pgsql"
58ed4897
VK
1780if test $? = 0; then
1781 AC_CHECK_LIB(m, floor)
6fce76d8 1782 AC_CHECK_LIB(pq, PQconnectdb, [PGSQL_LIBS="-lpq"],
58ed4897 1783 [AC_MSG_ERROR(libpq is required for PostgreSQL support)])
6fce76d8
VK
1784
1785 AC_MSG_CHECKING(whether postgresql clients can run)
8d131dda
VK
1786 OLD_LIBS="$LIBS"
1787 LIBS="$LIBS $PGSQL_LIBS"
6fce76d8
VK
1788 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1789 #include <stdio.h>
1790 #include <libpq-fe.h>
1791 int main(void)
1792 {
1793 PGconn *a = PQconnectdb("");
1794 return 0;
1795 }
1796 ]])],[AC_MSG_RESULT(yes)],[
58ed4897
VK
1797 AC_MSG_RESULT(no)
1798 AC_MSG_ERROR(Your PostgreSQL client libraries aren't properly installed)
1799 ],[])
8d131dda 1800 LIBS="$OLD_LIBS"
7070538d 1801 AC_CHECK_LIB(pq, PQfformat, [ AC_DEFINE(HAVE_PQFFORMAT, 1, PQfformat not exist in 7.3) ])
58ed4897
VK
1802fi
1803
1804
9c29f76e
VK
1805#--------------------------------------------------------------------
1806# ODBC
1807#--------------------------------------------------------------------
1808
1809check_substr "$COMPONENTS" "odbc"
1810if test $? = 0; then
6fce76d8 1811 AC_CHECK_LIB(odbc, SQLAllocHandle, [ODBC_LIBS="-lodbc"],
9c29f76e
VK
1812 [AC_MSG_ERROR(libodbc is required for ODBC support)])
1813fi
1814
1815
41b4790d
VK
1816#--------------------------------------------------------------------
1817# Oracle
1818#--------------------------------------------------------------------
1819
1820check_substr "$COMPONENTS" "oracle"
1821if test $? = 0; then
1822 AC_CHECK_HEADER(oci.h,,AC_MSG_ERROR([*** Cannot find oci.h - check your Oracle client installation ***]))
7d8c91ef
VK
1823 AC_CHECK_LIB(nnz11, nzstrcpy, [NNZ_LIB=-lnnz11],
1824 [
1825 AC_CHECK_LIB(nnz10, nzstrcpy, [NNZ_LIB=-lnnz10], [], [-lclntsh])
1826 ], [-lclntsh])
1827 AC_CHECK_LIB(clntsh, OCIHandleAlloc, [ORACLE_LIBS="-lclntsh $NNZ_LIB"],
1828 [AC_MSG_ERROR(libclntsh is required for Oracle support)], [$NNZ_LIB])
045845e5 1829 AC_CHECK_LIB(rt, sem_destroy, [ORACLE_LIBS="$ORACLE_LIBS -lrt"], [])
41b4790d
VK
1830fi
1831
84277a0f
AK
1832#--------------------------------------------------------------------
1833# DB2
1834#--------------------------------------------------------------------
1835
1836check_substr "$COMPONENTS" "db2"
1837if test $? = 0; then
1838 AC_CHECK_HEADER(sql.h,,AC_MSG_ERROR([*** Cannot find sql.h - check your DB2 client installation ***]))
1839 AC_CHECK_LIB(db2, SQLAllocHandle, [DB2_LIBS="-ldb2"],
1840 [AC_MSG_ERROR(libdb2 is required for DB2 support)])
1841fi
41b4790d 1842
37861c72
VK
1843#--------------------------------------------------------------------
1844# Informix
1845#--------------------------------------------------------------------
1846
1847check_substr "$COMPONENTS" "informix"
1848if test $? = 0; then
1849 AC_CHECK_HEADER(infxcli.h,,AC_MSG_ERROR([*** Cannot find infxcli.h - check your Informix client installation ***]))
4f2e8e9b
VK
1850 AC_CHECK_LIB(thcli, SQLAllocHandle, [INFORMIX_LIBS="-lthcli"],
1851 [AC_MSG_ERROR(libthcli is required for Informix support)])
37861c72
VK
1852fi
1853
c3cfc039
VK
1854#--------------------------------------------------------------------
1855# nxhttpd
1856#--------------------------------------------------------------------
1857
e02b69b9 1858check_substr "$COMPONENTS" "webui"
c3cfc039
VK
1859if test $? = 0; then
1860 AC_CHECK_HEADER(gd.h,,AC_MSG_ERROR([*** GD support not installed - please install first ***]))
1861 AC_CHECK_LIB(gd, gdImageCreate, [], [
1862 AC_MSG_ERROR(libgd is required for web interface)
1863 ])
1864
1865fi
1866
1867
ca0f4ea3
VK
1868#--------------------------------------------------------------------
1869# Other settings
1870#--------------------------------------------------------------------
1871
644f97f5 1872CPPFLAGS="$CPPFLAGS -DPREFIX=\\\"\${prefix}\\\" -DPREFIXW=L\\\"\${prefix}\\\" -DDATADIR=\\\"\${pkgdatadir}\\\" -DBINDIR=\\\"\${bindir}\\\" -DLIBDIR=\\\"\${libdir}\\\" -DPKGLIBDIR=\\\"\${pkglibdir}\\\""
545bda2d 1873LDFLAGS="$LDFLAGS_PREFIX $LDFLAGS $LDFLAGS_SUFFIX"
ca0f4ea3 1874
551ec9ca 1875AM_CONDITIONAL([USE_INTERNAL_EXPAT], [test "x$HAVE_LIBEXPAT" = "xno"])
17b35ccc 1876AM_CONDITIONAL([USE_INTERNAL_LIBTRE], [test "x$HAVE_LIBTRE" = "xno"])
1fd41bcd 1877AM_CONDITIONAL([USE_INTERNAL_ZLIB], [test "$NEED_ZLIB/$HAVE_ZLIB" = "yes/no"])
8b86c5dc 1878
ca0f4ea3 1879
ef0c727b
VK
1880#--------------------------------------------------------------------
1881# Substitute variables
1882#--------------------------------------------------------------------
82fa7c5d 1883
ef0c727b
VK
1884AC_SUBST(DB_DRIVERS)
1885AC_SUBST(MODULES)
1886AC_SUBST(SUBAGENT_DIRS)
1887AC_SUBST(SERVER_TOOLS)
1888AC_SUBST(TOP_LEVEL_MODULES)
1889AC_SUBST(CONTRIB_MODULES)
c2612d83 1890AC_SUBST(CLIENT_COMPONENTS)
ef0c727b
VK
1891AC_SUBST(STATIC_SUBAGENT_LIST)
1892AC_SUBST(SUBAGENT_LIBS)
1893AC_SUBST(BUILD_SERVER)
6fce76d8
VK
1894AC_SUBST(MYSQL_LIBS)
1895AC_SUBST(PGSQL_LIBS)
7d8c91ef 1896AC_SUBST(ORACLE_LIBS)
6fce76d8 1897AC_SUBST(ODBC_LIBS)
84277a0f 1898AC_SUBST(DB2_LIBS)
87f1fff0 1899AC_SUBST(INFORMIX_LIBS)
11ce9a66 1900AC_SUBST(OBJECT_MODE)
d16cf8a5 1901
ef0c727b
VK
1902#--------------------------------------------------------------------
1903# Shared libs versions
d16cf8a5
AK
1904#
1905# versioning scheme: current:revision:age
1906#
1907# current
1908# The number of the current interface exported by the library. A current
1909# value of `0', means that you are calling the interface exported by this
1910# library interface 0.
1911#
1912# revision
1913# The implementation number of the most recent interface exported by this
1914# library. In this case, a revision value of `0' means that this is the
1915# first implementation of the interface.
1916# If the next release of this library exports the same interface, but has a
1917# different implementation (perhaps some bugs have been fixed), the revision
1918# number will be higher, but current number will be the same. In that case,
1919# when given a choice, the library with the highest revision will always
1920# be used by the runtime loader.
1921#
1922# age
1923# The number of previous additional interfaces supported by this library.
1924# If age were `2', then this library can be linked into executables which
1925# were built with a release of this library that exported the current
1926# interface number, current, or any of the previous two interfaces.
1927# By definition age must be less than or equal to current. At the outset,
1928# only the first ever interface is implemented, so age can only be `0'.
ef0c727b 1929#--------------------------------------------------------------------
d16cf8a5 1930
17b35ccc 1931NETXMS_LIBRARY_VERSION=1:0:0
c7d14846 1932AC_SUBST(NETXMS_LIBRARY_VERSION)
d16cf8a5 1933
ef0c727b
VK
1934
1935#--------------------------------------------------------------------
1936# Generate output files
1937#--------------------------------------------------------------------
d16cf8a5
AK
1938
1939AC_CONFIG_FILES([
ef0c727b 1940 README
0c3c0c39
AK
1941 Makefile
1942 contrib/Makefile
0c3c0c39 1943 contrib/startup/Makefile
fa66d60c 1944 contrib/startup/debian/Makefile
daaefaaf 1945 contrib/startup/gentoo/Makefile
0c3c0c39 1946 contrib/startup/redhat/Makefile
5de3893d 1947 contrib/startup/suse/Makefile
9993edf4 1948 contrib/startup/ubuntu/Makefile
82fa7c5d 1949 contrib/mibs/Makefile
3f2f9f2b 1950 contrib/backgrounds/Makefile
0c3c0c39 1951 doc/Makefile
a48203d2
VK
1952 doc/internal/Makefile
1953 doc/manuals/Makefile
1954 doc/misc/Makefile
0c3c0c39
AK
1955 images/Makefile
1956 include/Makefile
1957 m4/Makefile
0c3c0c39 1958 src/Makefile
9191f6ad
VK
1959 src/agent/Makefile
1960 src/agent/core/Makefile
1961 src/agent/install/Makefile
1962 src/agent/subagents/Makefile
9191f6ad 1963 src/agent/subagents/aix/Makefile
80e96a82 1964 src/agent/subagents/ecs/Makefile
9191f6ad 1965 src/agent/subagents/freebsd/Makefile
80e96a82
VK
1966 src/agent/subagents/hpux/Makefile
1967 src/agent/subagents/informix/Makefile
9191f6ad 1968 src/agent/subagents/ipso/Makefile
80e96a82
VK
1969 src/agent/subagents/linux/Makefile
1970 src/agent/subagents/logwatch/Makefile
1971 src/agent/subagents/netbsd/Makefile
1972 src/agent/subagents/odbcquery/Makefile
1973 src/agent/subagents/openbsd/Makefile
9191f6ad 1974 src/agent/subagents/ping/Makefile
80e96a82 1975 src/agent/subagents/portCheck/Makefile
9191f6ad 1976 src/agent/subagents/sms/Makefile
80e96a82 1977 src/agent/subagents/sunos/Makefile
9191f6ad 1978 src/agent/subagents/ups/Makefile
80e96a82
VK
1979 src/agent/subagents/winnt/Makefile
1980 src/agent/subagents/winperf/Makefile
1981 src/agent/subagents/wmi/Makefile
c2612d83 1982 src/client/Makefile
551592f4 1983 src/client/install/Makefile
c94fa5c2 1984 src/client/nxalarm/Makefile
e84701c5 1985 src/client/nxevent/Makefile
9cb6c12f 1986 src/client/nxlexer/Makefile
e84701c5 1987 src/client/nxpush/Makefile
59ffa5b7 1988 src/client/nxsms/Makefile
9cb6c12f
VK
1989 src/client/scilexer/Makefile
1990 src/client/windows/Makefile
1991 src/client/windows/nxav/Makefile
1992 src/client/windows/nxav/res/Makefile
23c8c53e
AK
1993 src/client/windows/nxcon/Makefile
1994 src/client/windows/nxcon/icons/Makefile
1995 src/client/windows/nxcon/res/Makefile
23c8c53e
AK
1996 src/client/windows/nxnotify/Makefile
1997 src/client/windows/nxnotify/res/Makefile
9cb6c12f
VK
1998 src/client/windows/nxuilib/Makefile
1999 src/client/windows/nxuilib/res/Makefile
2000 src/client/windows/nxuilib/sounds/Makefile
d1834406
VK
2001 src/db/Makefile
2002 src/db/dbdrv/Makefile
87f1fff0
VK
2003 src/db/dbdrv/db2/Makefile
2004 src/db/dbdrv/informix/Makefile
d1834406
VK
2005 src/db/dbdrv/odbc/Makefile
2006 src/db/dbdrv/mssql/Makefile
2007 src/db/dbdrv/mysql/Makefile
87f1fff0 2008 src/db/dbdrv/oracle/Makefile
d1834406
VK
2009 src/db/dbdrv/pgsql/Makefile
2010 src/db/dbdrv/sqlite/Makefile
d1834406 2011 src/db/libnxdb/Makefile
9191f6ad
VK
2012 src/install/Makefile
2013 src/install/windows/Makefile
2014 src/libexpat/Makefile
2015 src/libexpat/libexpat/Makefile
2016 src/libnetxms/Makefile
2017 src/libnxcl/Makefile
2018 src/libnxlp/Makefile
2019 src/libnxmap/Makefile
2020 src/libnxsl/Makefile
a67fa146
VK
2021 src/libtre/Makefile
2022 src/libtre/win32/Makefile
9191f6ad 2023 src/nxscript/Makefile
0c3c0c39
AK
2024 src/server/Makefile
2025 src/server/core/Makefile
644f97f5
VK
2026 src/server/drivers/Makefile
2027 src/server/drivers/baystack/Makefile
b1bd1fb2 2028 src/server/drivers/cat2900xl/Makefile
910846cc 2029 src/server/drivers/catalyst/Makefile
644f97f5 2030 src/server/drivers/ers8000/Makefile
4e592faf
VK
2031 src/server/drivers/lib/Makefile
2032 src/server/drivers/lib/avaya-ers/Makefile
b1bd1fb2 2033 src/server/drivers/lib/cisco/Makefile
81ecaf38 2034 src/server/drivers/netscreen/Makefile
d770a97c
VK
2035 src/server/include/Makefile
2036 src/server/libnxsrv/Makefile
2037 src/server/netxmsd/Makefile
d8f2e39b
VK
2038 src/server/smsdrv/Makefile
2039 src/server/smsdrv/generic/Makefile
91369aca 2040 src/server/smsdrv/nxagent/Makefile
aab8a8b6 2041 src/server/smsdrv/portech/Makefile
0c3c0c39 2042 src/server/tools/Makefile
0c3c0c39
AK
2043 src/server/tools/nxaction/Makefile
2044 src/server/tools/nxadm/Makefile
9191f6ad 2045 src/server/tools/nxap/Makefile
5b0c7d0d
VK
2046 src/server/tools/nxconfig/Makefile
2047 src/server/tools/nxconfig/res/Makefile
f90d7fc5 2048 src/server/tools/nxdbmgr/Makefile
4e2debcc 2049 src/server/tools/nxencpasswd/Makefile
9191f6ad 2050 src/server/tools/nxget/Makefile
d24fdaf4 2051 src/server/tools/nxupload/Makefile
c5c0f362
VK
2052 src/snmp/Makefile
2053 src/snmp/libnxsnmp/Makefile
2054 src/snmp/nxmibc/Makefile
2055 src/snmp/nxsnmpget/Makefile
2056 src/snmp/nxsnmpset/Makefile
2057 src/snmp/nxsnmpwalk/Makefile
9191f6ad 2058 src/sqlite/Makefile
f65df2b1
VK
2059 src/tools/Makefile
2060 src/tools/nxcptest/Makefile
2061 src/tools/nxdevcfg/Makefile
e02b69b9 2062 src/webui/Makefile
420d9ecf
AK
2063 src/webui/nxhttpd/Makefile
2064 src/webui/nxhttpd/static/Makefile
2065 src/webui/nxhttpd/static/images/Makefile
2066 src/webui/nxhttpd/static/images/buttons/Makefile
2067 src/webui/nxhttpd/static/images/buttons/normal/Makefile
2068 src/webui/nxhttpd/static/images/buttons/pressed/Makefile
2069 src/webui/nxhttpd/static/images/ctrlpanel/Makefile
2070 src/webui/nxhttpd/static/images/objects/Makefile
2071 src/webui/nxhttpd/static/images/status/Makefile
1fd41bcd 2072 src/zlib/Makefile
9191f6ad 2073 sql/Makefile
0c3c0c39 2074 tools/Makefile
d16cf8a5
AK
2075])
2076
12249937
VK
2077AC_OUTPUT
2078
ef0c727b 2079echo "Updating libtool"
5cecf50e
AK
2080sed 's,$SED -e "/${host}-//g",$SED -e "s/${host}-//g",g' < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
2081
779ce551
VK
2082# On HP-UX, libtool passes +b instead of -Wl,+b even if gcc/g++ used as linker
2083if test "x$CC" = "xgcc" && test "x$PLATFORM" = "xHP-UX"; then
2084 sed "s,hardcode_libdir_flag_spec_ld=,#hardcode_libdir_flag_spec_ld=,g" < ./libtool > libtool.new && mv libtool.new libtool && chmod +x ./libtool
2085fi
2086
b677ef59
VK
2087# On AIX, correct OBJECT_MODE must be set before linking
2088# To avoid manual setting by user, we add this to libtool script
2089if test "x$PLATFORM" = "xAIX"; then
2090 head -n 1 ./libtool > ./libtool.new
2091 echo "export OBJECT_MODE=$OBJECT_MODE" >> ./libtool.new
2092 tail -n +2 ./libtool >> ./libtool.new
2093 mv libtool.new libtool
2094 chmod +x ./libtool
2095fi
2096
ef0c727b
VK
2097#--------------------------------------------------------------------
2098# Print summary
2099#--------------------------------------------------------------------
a7442678 2100
a7442678
AK
2101echo
2102echo
2103echo
2104echo '---------------------------------------------------------------------'
2105echo ' Configure results'
2106echo '---------------------------------------------------------------------'
2107echo
8b86c5dc 2108 echo "Prefix : ${prefix}"
a7442678 2109if test "x${BUILD_SERVER}" = "xyes"; then
8b86c5dc 2110 echo "Build Server : YES"
a7442678 2111else
8b86c5dc 2112 echo "Build Server : NO"
a7442678
AK
2113fi
2114if test "x${ac_cv_lib_crypto_RSA_new}" = "xyes"; then
8b86c5dc 2115 echo "Encryption enabled : YES"
a7442678 2116else
8b86c5dc 2117 echo "Encryption enabled : NO"
a7442678
AK
2118fi
2119if test "x${DB_DRIVERS}" != "x"; then
8b86c5dc 2120 echo "Build DB-Drivers :${DB_DRIVERS}"
a7442678 2121else
8b86c5dc 2122 echo "Build DB-Drivers : NO"
a7442678
AK
2123fi
2124if test "x${BUILD_CLIENT}" = "xyes"; then
8b86c5dc 2125 echo "Build Clients : YES"
a7442678 2126else
8b86c5dc 2127 echo "Build Clients : NO"
a7442678 2128fi
ef0c727b 2129if test "x${BUILD_NXHTTPD}" = "xyes"; then
8b86c5dc 2130 echo "Build Web Interface : YES"
2654e540 2131else
8b86c5dc 2132 echo "Build Web Interface : NO"
2654e540 2133fi
a7442678 2134if test "x${BUILD_AGENT}" = "xyes"; then
8b86c5dc
VK
2135 echo "Build Agent : YES"
2136 echo "Subagents list : ${SUBAGENT_DIRS}"
a7442678 2137else
8b86c5dc 2138 echo "Build Agent : NO"
a7442678 2139fi
e8636669 2140if test "x${BUILD_STATIC_AGENT}" = "xyes"; then
8b86c5dc
VK
2141 echo "Build Static Agent : YES"
2142 echo "Subagents list : ${STATIC_SUBAGENT_LIST}"
e8636669 2143else
8b86c5dc 2144 echo "Build Static Agent : NO"
e8636669 2145fi
8b86c5dc 2146if test "x${BUILD_UNICODE}" = "xyes"; then
a67fa146 2147 echo "UNICODE build : YES"
8b86c5dc 2148else
a67fa146 2149 echo "UNICODE build : NO"
8b86c5dc 2150fi
551ec9ca
VK
2151if test "x${HAVE_LIBEXPAT}" = "xno"; then
2152 echo "Use internal libexpat : YES"
1bb6b449 2153else
551ec9ca 2154 echo "Use internal libexpat : NO"
1bb6b449 2155fi
17b35ccc
VK
2156if test "x${HAVE_LIBTRE}" = "xno"; then
2157 echo "Use internal libtre : YES"
2158else
2159 echo "Use internal libtre : NO"
2160fi
1fd41bcd
VK
2161if test "x${NEED_ZLIB}" = "xyes"; then
2162 if test "x${HAVE_ZLIB}" = "xno"; then
2163 echo "Use internal zlib : YES"
2164 else
2165 echo "Use internal zlib : NO"
2166 fi
2167fi
cc297a70
VK
2168if test "x${FORCE_32BIT_BUILD}" = "xyes"; then
2169 echo "Force 32bit build : YES"
2170else
2171 echo "Force 32bit build : NO"
2172fi
7d8c91ef
VK
2173
2174echo "CPPFLAGS : ${CPPFLAGS}"
2175echo "CXXFLAGS : ${CXXFLAGS}"
2176echo "CFLAGS : ${CFLAGS}"
2177echo "LDFLAGS : ${LDFLAGS}"
8d131dda 2178echo "LIBS : ${LIBS}"
7d8c91ef 2179
6fce76d8
VK
2180if test "x${MYSQL_LIBS}" != "x"; then
2181 echo "MySQL libs : ${MYSQL_LIBS}"
2182fi
2183if test "x${PGSQL_LIBS}" != "x"; then
2184 echo "PostgreSQL libs : ${PGSQL_LIBS}"
2185fi
7d8c91ef
VK
2186if test "x${ORACLE_LIBS}" != "x"; then
2187 echo "Oracle libs : ${ORACLE_LIBS}"
2188fi
6fce76d8
VK
2189if test "x${ODBC_LIBS}" != "x"; then
2190 echo "ODBC libs : ${ODBC_LIBS}"
2191fi
84277a0f
AK
2192if test "x${DB2_LIBS}" != "x"; then
2193 echo "DB2 libs : ${DB2_LIBS}"
2194fi
37861c72
VK
2195if test "x${INFORMIX_LIBS}" != "x"; then
2196 echo "Informix libs : ${INFORMIX_LIBS}"
2197fi