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