summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-04-06 11:03:00 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-08-24 15:59:40 -0300
commit2dffee8de9c4584726b7d2f9b6c4d910b7d0b861 (patch)
tree84e737aae976287d3abcaadbdd9fef7ffa2413f2
parent791aae87c4d5c67c175f4ee7a0989d20481c24d5 (diff)
Require pkg-config as an optional build dependency on Linux (#775)
With this commit: * if pkgconfig is installed, it will expand the code inside the shell if, adding the pkgconfig-based tests for the dependencies of Linux delay accounting. * if pkgconfig is not installed, it will add an error message inside the test of Linux delay accounting, telling the user to install pkgconfig and rebuild the configure script if they want to use Linux delay accounting. The end result is: * people running Linux * will not need pkgconfig when not using delay accounting * will need pkgconfig when using delay accounting * if they don't have it * they are told by configure they need to install it and re-run autogen.sh when running from Git * they are told by configure they need to install it and re-run configure when running from the tarball * people not running Linux * will never need pkgconfig ...and in none of the above scenarios the generated configure script produces unexpanded macros for users checking out the sources from Git.
-rw-r--r--configure.ac16
1 files changed, 10 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index aab90889..de3d04b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -334,12 +334,16 @@ fi
AC_ARG_ENABLE(delayacct, [AS_HELP_STRING([--enable-delayacct], [enable linux delay accounting])],, enable_delayacct="no")
if test "x$enable_delayacct" = xyes
then
- PKG_PROG_PKG_CONFIG()
- PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [missing_libraries="$missing_libraries libnl-3"])
- PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [missing_libraries="$missing_libraries libnl-genl-3"])
- CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS"
- LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS"
- AC_DEFINE(HAVE_DELAYACCT, 1, [Define if delay accounting support should be enabled.])
+ m4_ifdef([PKG_PROG_PKG_CONFIG], [
+ PKG_PROG_PKG_CONFIG()
+ PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [missing_libraries="$missing_libraries libnl-3"])
+ PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [missing_libraries="$missing_libraries libnl-genl-3"])
+ CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS"
+ LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS"
+ AC_DEFINE(HAVE_DELAYACCT, 1, [Define if delay accounting support should be enabled.])
+ ], [
+ AC_MSG_ERROR([htop on Linux requires pkg-config for checking delayacct requirements. Please install pkg-config and run ./autogen.sh to rebuild the configure script.])
+ ])
fi

© 2014-2024 Faster IT GmbH | imprint | privacy policy