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