summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-07-02 18:39:24 +0200
committerraveit65 <[email protected]>2020-07-19 16:07:11 +0200
commitbff29f926f56aba490e3f7b6f2d11e6a1aae46c7 (patch)
tree5e1cb37be1071f64665097820ab92d4e08a8ce4c /configure.ac
parent46329dddf49af7a60e04d26c550c5919bbda9909 (diff)
downloadmate-applets-bff29f926f56aba490e3f7b6f2d11e6a1aae46c7.tar.bz2
mate-applets-bff29f926f56aba490e3f7b6f2d11e6a1aae46c7.tar.xz
netspeed: add netlink support
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac61
1 files changed, 46 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index 14302952..d08f7e13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,7 +150,7 @@ if test "x$with_upower" != xno; then
PKG_CHECK_MODULES(UPOWER, upower-glib >= $UPOWER_REQUIRED,
HAVE_UPOWER="yes",
HAVE_UPOWER="no")
-
+
if test "x$HAVE_UPOWER" = "xyes"; then
AC_DEFINE(HAVE_UPOWER, 1, [UPOWER available])
fi
@@ -399,24 +399,54 @@ dnl ***************************************************************************
AM_CONDITIONAL(BUILD_TIMERAPPLET, test "x$HAVE_LIBNOTIFY" = "xyes")
dnl ***************************************************************************
-dnl *** iwlib support for netspeed applet ***
+dnl *** iwlib/netfilter support for netspeed applet ***
dnl ***************************************************************************
+
+AC_ARG_WITH(iwevgenie,
+ AS_HELP_STRING([--with-iwevgenie],
+ [Build with iwlib support for netspeed applet]),
+ [],
+ [with_iwevgenie=no])
+AC_ARG_WITH(nl,
+ AS_HELP_STRING([--with-nl],
+ [Build with netfilter support for netspeed applet]),
+ [],
+ [with_nl=yes])
+
+if test "x$with_iwevgenie" = "xyes" -a "x$with_nl" = "xyes"; then
+ AC_MSG_ERROR([--with-iwevgenie and --with-nl cannot be used at the same time])
+fi
+
have_iwevgenie=no
-AC_MSG_CHECKING([for libiw >= 28pre9])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
- #include <iwlib.h>
- #ifndef IWEVGENIE
- #error "not found"
- #endif])],
- [have_iwevgenie=yes],
+if test "x$with_iwevgenie" = "xyes"; then
+ AC_MSG_CHECKING([for libiw >= 28pre9])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+ #include <iwlib.h>
+ #ifndef IWEVGENIE
+ #error "not found"
+ #endif])],
+ [have_iwevgenie=yes],
AC_MSG_WARN([iwlib.h not found. It's provided by libiw or wireless-tools (depends on the distro)])
-)
-AC_MSG_RESULT([$have_iwevgenie])
-if test "$have_iwevgenie" = yes; then
- AC_DEFINE(HAVE_IW, 1, [Defined if you have libiw/wireless-tools (depends on the distro)])
- IWLIB=-liw
- AC_SUBST(IWLIB)
+ )
+ AC_MSG_RESULT([$have_iwevgenie])
+fi
+if test "x$have_iwevgenie" = "xyes"; then
+ AC_DEFINE(HAVE_IW, 1, [Defined if you have libiw/wireless-tools (depends on the distro)])
+ IW_LIBS=-liw
+ AC_SUBST(IW_LIBS)
+fi
+AM_CONDITIONAL(HAVE_IW, test "x$have_iwevgenie" = "xyes")
+
+have_nl=no
+if test "x$with_nl" = "xyes"; then
+ PKG_CHECK_MODULES(NL, libnl-genl-3.0, [have_nl=yes])
+fi
+if test "x$have_nl" = "xyes"; then
+ AC_DEFINE(HAVE_NL, 1, [Enable Generic Netlink Library])
+ AC_SUBST(NL_CFLAGS)
+ AC_SUBST(NL_LIBS)
fi
+AM_CONDITIONAL(HAVE_NL, test "x$have_nl" = "xyes")
dnl ***************************************************************************
dnl *** Check if IPv6 is available ***
@@ -627,6 +657,7 @@ mate-applets-$VERSION configure summary:
- multiload $build_gtop_applets
- netspeed $build_gtop_applets
- iwlib support $have_iwevgenie
+ - netfilter support $have_nl
- stickynotes $enable_stickynotes
- timerapplet $HAVE_LIBNOTIFY
- trashapplet always