summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.se>2015-11-25 17:07:20 +0000
committerThomas Habets <thomas@habets.se>2015-11-25 17:07:20 +0000
commitdd7192ee8c7d2b15d711ac8e44dd04c2a5c6359d (patch)
tree774c2c374e8f10a273a079c72847e8254c102846 /configure.ac
parentcd38568fe3923b99c2be216bc841270c1ceecb6c (diff)
downloadarping-dd7192ee8c7d2b15d711ac8e44dd04c2a5c6359d.tar.gz
Check if `libnet_init()` takes const for device.
Const was added somewhere between Libnet 1.1.4 and 1.1.6 and correct prototype is needed for unit test mocks.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 611a044..65f1884 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,6 +88,20 @@ else
esac
fi
+AC_CACHE_CHECK([for libnet_init signature has const],
+ ac_cv_have_libnet_init_const, [
+ AC_TRY_RUN(
+ [
+#include<libnet.h>
+libnet_t*libnet_init(int a,const char* b,char* c){}
+int main(){}
+],
+ [ ac_cv_have_libnet_init_const="yes" ],
+ [ ac_cv_have_libnet_init_const="no" ])
+])
+if test x$ac_cv_have_libnet_init_const = xyes; then
+ AC_DEFINE([HAVE_LIBNET_INIT_CONST], [1], [Libnet init takes const char device])
+fi
# check for CLOCK_MONOTONIC