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