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