updated autoconf
Costa Tsaousis (ktsaou) committed
Mar 4, 2017 at 21:59 UTC
117fa1c86034f5002b4e53ad3862a28295ebba68
2 files changed
+91
-60
configure.ac
+90
-59
@@ -72,10 +72,10 @@ AC_ARG_WITH(
72
[webdir="\$(pkgdatadir)/web"]
73
)
74
AC_ARG_WITH(
75
- [cap],
76
- [AS_HELP_STRING([--with-cap], [build with libcap])],
75
+ [libcap],
76
+ [AS_HELP_STRING([--with-libcap], [build with libcap])],
77
,
78
- [with_cap="detect"]
78
+ [with_libcap="detect"]
79
)
80
AC_ARG_WITH(
81
[zlib],
@@ -109,11 +109,11 @@ AC_ARG_ENABLE(
109
# fails on centos6
110
#AX_CHECK_ENABLE_DEBUG()
111
112
-AX_GCC_FUNC_ATTRIBUTE(returns_nonnull)
113
-AX_GCC_FUNC_ATTRIBUTE(malloc)
114
-AX_GCC_FUNC_ATTRIBUTE(noreturn)
115
-AX_GCC_FUNC_ATTRIBUTE(format)
116
-AX_GCC_FUNC_ATTRIBUTE(warn_unused_result)
112
+AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
113
+AX_GCC_FUNC_ATTRIBUTE([malloc])
114
+AX_GCC_FUNC_ATTRIBUTE([noreturn])
115
+AX_GCC_FUNC_ATTRIBUTE([format])
116
+AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
117
118
AC_CHECK_FUNCS_ONCE(accept4)
119
AC_CHECK_TYPES([struct timespec, clockid_t], [], [], [[#include <time.h>]])
@@ -158,9 +158,9 @@ darwin*)
158
;;
159
esac
160
161
-AM_CONDITIONAL([FREEBSD], [test x$build_target = xfreebsd])
162
-AM_CONDITIONAL([MACOS], [test x$build_target = xmacos])
163
-AM_CONDITIONAL([LINUX], [test x$build_target = xlinux])
161
+AM_CONDITIONAL([FREEBSD], [test "${build_target}" = "freebsd"])
162
+AM_CONDITIONAL([MACOS], [test "${build_target}" = "macos"])
163
+AM_CONDITIONAL([LINUX], [test "${build_target}" = "linux"])
164
165
166
# -----------------------------------------------------------------------------
@@ -231,7 +231,7 @@ fi
231
232
if test "${with_math}" = "yes"; then
233
test -z "${MATH_LIBS}" && AC_MSG_ERROR([math required but not found])
234
- AC_DEFINE([STORAGE_WITH_MATH], [1], [math settings])
234
+ AC_DEFINE([STORAGE_WITH_MATH], [1], [math usability])
235
OPTIONAL_MATH_CFLAGS="${MATH_CFLAGS}"
236
OPTIONAL_MATH_LIBS="${MATH_LIBS}"
237
fi
@@ -240,13 +240,15 @@ fi
240
# -----------------------------------------------------------------------------
241
# zlib
242
243
+PKG_CHECK_MODULES(
244
+ [ZLIB],
245
+ [zlib],
246
+ [have_zlib=yes],
247
+ [have_zlib=no]
248
+)
249
+test "${with_zlib}" = "yes" -a "${have_zlib}" != "yes" && AC_MSG_ERROR([zlib required but not found. Try installing 'zlib1g-dev' or 'zlib-devel'.])
250
if test "${with_zlib}" = "yes"; then
244
- PKG_CHECK_MODULES(
245
- [ZLIB],
246
- [zlib],
247
- )
248
- test -z "${ZLIB_LIBS}" && AC_MSG_ERROR([zlib required but not found. Try installing 'zlib1g-dev' or 'zlib-devel'.])
249
- AC_DEFINE([NETDATA_WITH_ZLIB], [1], [zlib settings])
251
+ AC_DEFINE([NETDATA_WITH_ZLIB], [1], [zlib usability])
252
OPTIONAL_ZLIB_CLFAGS="${ZLIB_CFLAGS}"
253
OPTIONAL_ZLIB_LIBS="${ZLIB_LIBS}"
254
fi
@@ -259,9 +261,8 @@ PKG_CHECK_MODULES(
261
[UUID],
262
[uuid],
263
[have_uuid=yes],
262
- [have_uuid=no]
264
+ [AC_MSG_ERROR([libuuid required but not found. Try installing 'uuid-dev' or 'libuuid-devel'.])]
265
)
264
-test "${have_uuid}" = "no" && AC_MSG_ERROR([libuuid required but not found. Try installing 'uuid-dev' or 'libuuid-devel'.])
266
AC_DEFINE([NETDATA_WITH_UUID], [1], [uuid usability])
267
OPTIONAL_UUID_CLFAGS="${UUID_CFLAGS}"
268
OPTIONAL_UUID_LIBS="${UUID_LIBS}"
@@ -270,68 +271,98 @@ OPTIONAL_UUID_LIBS="${UUID_LIBS}"
271
# -----------------------------------------------------------------------------
272
# libcap
273
273
-if test "${with_cap}" != "no"; then
274
- PKG_CHECK_MODULES(
275
- [CAP],
276
- [libcap],
277
- [have_cap=yes],
278
- [have_cap=no]
279
- )
280
-fi
281
-test "${have_cap}" = "no" -a "${with_cap}" = "yes" && AC_MSG_ERROR([libcap required but not found.])
282
-if test "${have_cap}" = "yes"; then
274
+PKG_CHECK_MODULES(
275
+ [LIBCAP],
276
+ [libcap],
277
+ [have_libcap=yes],
278
+ [have_libcap=no]
279
+)
280
+test "${with_libcap}" = "yes" -a "${have_libcap}" != "yes" && AC_MSG_ERROR([libcap required but not found.])
281
+
282
+AC_MSG_CHECKING([if libcap should be used])
283
+if test "${with_libcap}" != "no"; then
284
+ with_libcap="yes"
285
AC_DEFINE([HAVE_CAPABILITY], [1], [libcap usability])
284
- OPTIONAL_CAP_CLFAGS="${CAP_CFLAGS}"
285
- OPTIONAL_CAP_LIBS="${CAP_LIBS}"
286
+ OPTIONAL_LIBCAP_CLFAGS="${LIBCAP_CFLAGS}"
287
+ OPTIONAL_LIBCAP_LIBS="${LIBCAP_LIBS}"
288
+else
289
+ with_libcap="no"
290
fi
287
-AM_CONDITIONAL([ENABLE_CAPABILITY], [test "${have_cap}" = "yes"])
291
+AC_MSG_RESULT([${with_libcap}])
292
+AM_CONDITIONAL([ENABLE_CAPABILITY], [test "${with_libcap}" = "yes"])
293
294
295
# -----------------------------------------------------------------------------
296
# apps.plugin
297
293
-AM_CONDITIONAL([ENABLE_PLUGIN_APPS], [test "${build_target}" != "macos"])
298
+AC_MSG_CHECKING([if apps.plugin should be enabled])
299
+if test "${build_target}" != "macos"; then
300
+ enable_plugin_apps="yes"
301
+else
302
+ enable_plugin_apps="no"
303
+fi
304
+AC_MSG_RESULT([${enable_plugin_apps}])
305
+AM_CONDITIONAL([ENABLE_PLUGIN_APPS], [test "${enable_plugin_apps}" = "yes"])
306
307
308
# -----------------------------------------------------------------------------
309
# freeipmi.plugin - libipmimonitoring
310
299
-if test "${enable_plugin_freeipmi}" != "no"; then
300
- PKG_CHECK_MODULES(
301
- [IPMIMONITORING],
302
- [libipmimonitoring],
303
- [have_ipmimonitoring=yes],
304
- [have_ipmimonitoring=no]
305
- )
306
-fi
307
-test "${have_ipmimonitoring}" = "no" -a "${enable_plugin_freeipmi}" = "yes" && \
311
+PKG_CHECK_MODULES(
312
+ [IPMIMONITORING],
313
+ [libipmimonitoring],
314
+ [have_ipmimonitoring=yes],
315
+ [have_ipmimonitoring=no]
316
+)
317
+test "${enable_plugin_freeipmi}" = "yes" -a "${have_ipmimonitoring}" != "yes" && \
318
AC_MSG_ERROR([ipmimonitoring required but not found. Try installing 'libipmimonitoring-dev' or 'libipmimonitoring-devel'])
309
-if test "${have_ipmimonitoring}" = "yes"; then
319
+
320
+AC_MSG_CHECKING([if freeipmi.plugin should be enabled])
321
+if test "${enable_plugin_freeipmi}" != "no" -a "${have_ipmimonitoring}" = "yes"; then
322
+ enable_plugin_freeipmi="yes"
323
AC_DEFINE([HAVE_FREEIPMI], [1], [ipmimonitoring usability])
324
OPTIONAL_IPMIMONITORING_CLFAGS="${IPMIMONITORING_CFLAGS}"
325
OPTIONAL_IPMIMONITORING_LIBS="${IPMIMONITORING_LIBS}"
326
+else
327
+ enable_plugin_freeipmi="no"
328
fi
314
-AM_CONDITIONAL([ENABLE_PLUGIN_FREEIPMI], [test "${have_ipmimonitoring}" = "yes"])
329
+AC_MSG_RESULT([${enable_plugin_freeipmi}])
330
+AM_CONDITIONAL([ENABLE_PLUGIN_FREEIPMI], [test "${enable_plugin_freeipmi}" = "yes"])
331
332
333
# -----------------------------------------------------------------------------
334
# nfacct.plugin - libmnl, libnetfilter_acct
335
320
-if test "${enable_plugin_nfacct}" = "yes"; then
321
- PKG_CHECK_MODULES(
322
- [NFACCT],
323
- [libnetfilter_acct],
324
- )
325
- PKG_CHECK_MODULES(
326
- [LIBMNL],
327
- [libmnl],
328
- )
329
- test -z "${NFACCT_LIBS}" && AC_MSG_ERROR([netfilter_acct required but not found])
330
- test -z "${LIBMNL_LIBS}" && AC_MSG_ERROR([libmnl required but not found. Try installing 'libmnl-dev' or 'libmnl-devel'])
331
- AC_DEFINE([INTERNAL_PLUGIN_NFACCT], [1], [nfacct plugin settings])
336
+PKG_CHECK_MODULES(
337
+ [NFACCT],
338
+ [libnetfilter_acct],
339
+ [have_libnetfilter_acct=yes],
340
+ [have_libnetfilter_acct=no]
341
+)
342
+PKG_CHECK_MODULES(
343
+ [LIBMNL],
344
+ [libmnl],
345
+ [have_libmnl=yes],
346
+ [have_libmnl=no]
347
+)
348
+
349
+test "${enable_plugin_nfacct}" = "yes" -a "${have_libnetfilter_acct}" != "yes" && \
350
+ AC_MSG_ERROR([netfilter_acct required but not found])
351
+
352
+test "${enable_plugin_nfacct}" = "yes" -a "${have_libmnl}" != "yes" && \
353
+ AC_MSG_ERROR([libmnl required but not found. Try installing 'libmnl-dev' or 'libmnl-devel'])
354
+
355
+AC_MSG_CHECKING([if nfacct.plugin should be enabled])
356
+if test "${enable_plugin_nfacct}" != "no" -a "${have_libnetfilter_acct}" = "yes" -a "${have_libmnl}" = "yes"; then
357
+ enable_plugin_nfacct="yes"
358
+ AC_DEFINE([INTERNAL_PLUGIN_NFACCT], [1], [nfacct plugin usability])
359
OPTIONAL_NFACCT_CLFAGS="${NFACCT_CFLAGS} ${LIBMNL_CFLAGS}"
360
OPTIONAL_NFACCT_LIBS="${NFACCT_LIBS} ${LIBMNL_LIBS}"
361
+else
362
+ enable_plugin_nfacct="no"
363
fi
364
+AC_MSG_RESULT([${enable_plugin_nfacct}])
365
+AM_CONDITIONAL([ENABLE_PLUGIN_NFACCT], [test "${enable_plugin_nfacct}" = "yes"])
366
367
368
# -----------------------------------------------------------------------------
@@ -357,8 +388,8 @@ AC_SUBST([OPTIONAL_ZLIB_CLFAGS])
388
AC_SUBST([OPTIONAL_ZLIB_LIBS])
389
AC_SUBST([OPTIONAL_UUID_CLFAGS])
390
AC_SUBST([OPTIONAL_UUID_LIBS])
360
-AC_SUBST([OPTIONAL_CAP_CFLAGS])
361
-AC_SUBST([OPTIONAL_CAP_LIBS])
391
+AC_SUBST([OPTIONAL_LIBCAP_CFLAGS])
392
+AC_SUBST([OPTIONAL_LIBCAP_LIBS])
393
AC_SUBST([OPTIONAL_IPMIMONITORING_CFLAGS])
394
AC_SUBST([OPTIONAL_IPMIMONITORING_LIBS])
395
src/Makefile.am
+1
-1
@@ -163,7 +163,7 @@ endif
163
164
apps_plugin_LDADD = \
165
$(OPTIONAL_MATH_LIBS) \
166
- $(OPTIONAL_CAP_LIBS) \
166
+ $(OPTIONAL_LIBCAP_LIBS) \
167
$(NULL)
168
169
freeipmi_plugin_SOURCES = \