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