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