properly check features in detect mode
Costa Tsaousis (ktsaou) committed
Mar 4, 2017 at 23:05 UTC
f791c458ea6c7e5c5d67807c66341298d6e7b281
1 file changed
+3
-3
configure.ac
+3
-3
@@ -235,7 +235,7 @@ fi
235
test "${with_math}" = "yes" -a -z "${MATH_LIBS}" && AC_MSG_ERROR([math required but not found])
236
237
AC_MSG_CHECKING([if libm should be used])
238
-if test "${with_math}" != "no"; then
238
+if test "${with_math}" != "no" -a ! -z "${MATH_LIBS}"; then
239
with_math="yes"
240
AC_DEFINE([STORAGE_WITH_MATH], [1], [math usability])
241
OPTIONAL_MATH_CFLAGS="${MATH_CFLAGS}"
@@ -258,7 +258,7 @@ PKG_CHECK_MODULES(
258
test "${with_zlib}" = "yes" -a "${have_zlib}" != "yes" && AC_MSG_ERROR([zlib required but not found. Try installing 'zlib1g-dev' or 'zlib-devel'.])
259
260
AC_MSG_CHECKING([if zlib should be used])
261
-if test "${with_zlib}" != "no"; then
261
+if test "${with_zlib}" != "no" -a "${have_zlib}" = "yes"; then
262
with_zlib="yes"
263
AC_DEFINE([NETDATA_WITH_ZLIB], [1], [zlib usability])
264
OPTIONAL_ZLIB_CLFAGS="${ZLIB_CFLAGS}"
@@ -302,7 +302,7 @@ PKG_CHECK_MODULES(
302
test "${with_libcap}" = "yes" -a "${have_libcap}" != "yes" && AC_MSG_ERROR([libcap required but not found.])
303
304
AC_MSG_CHECKING([if libcap should be used])
305
-if test "${with_libcap}" != "no"; then
305
+if test "${with_libcap}" != "no" -a "${have_libcap}" = "yes"; then
306
with_libcap="yes"
307
AC_DEFINE([HAVE_CAPABILITY], [1], [libcap usability])
308
OPTIONAL_LIBCAP_CLFAGS="${LIBCAP_CFLAGS}"