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