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