]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Only set HAVE_LIBPCAP if we have both the libraries and header files Fixes #2245
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 11 Jun 2018 13:08:53 +0000 (09:08 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 11 Jun 2018 13:08:53 +0000 (09:08 -0400)
configure
configure.ac
src/include/autoconf.h.in

index 0c59a3c8a9d5583ab592b011bb88ef20d075820c..32970d7f796442d9b6b447cf91190aa9a4ee3ba2 100755 (executable)
--- a/configure
+++ b/configure
@@ -2425,6 +2425,8 @@ ac_config_headers="$ac_config_headers src/include/autoconf.h"
 
 
 
+
+
 
 RADIUSD_MAJOR_VERSION=`cat VERSION | cut -f1 -d.`
 RADIUSD_MINOR_VERSION=`cat VERSION | cut -f2 -d.`
@@ -6888,10 +6890,6 @@ if test "x$ac_cv_lib_pcap_pcap_open_live" != "xyes"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcap library not found, silently disabling the RADIUS sniffer, and ARP listener.  Use --with-pcap-lib-dir=<path>." >&5
 $as_echo "$as_me: WARNING: pcap library not found, silently disabling the RADIUS sniffer, and ARP listener.  Use --with-pcap-lib-dir=<path>." >&2;}
 else
-
-$as_echo "#define HAVE_LIBPCAP 1" >>confdefs.h
-
-
   for ac_func in \
     pcap_fopen_offline \
     pcap_dump_fopen \
@@ -9168,9 +9166,9 @@ fi
 
 smart_prefix=
 
-  if test "x$ac_cv_header_pcap_h" = "xyes"; then
+  if test "x$ac_cv_header_pcap_h" = "xyes" && test "x$ac_cv_lib_pcap_pcap_open_live" = "xyes"; then
 
-$as_echo "#define HAVE_PCAP_H 1" >>confdefs.h
+$as_echo "#define HAVE_LIBPCAP 1" >>confdefs.h
 
 
 
index 43fdbbc3f820dfdc67370ba9a79cb71fff8ba6cf..92267654797c7e73816cfbc537eff5cca961a9c3 100644 (file)
@@ -883,10 +883,6 @@ FR_SMART_CHECK_LIB(pcap, pcap_open_live)
 if test "x$ac_cv_lib_pcap_pcap_open_live" != "xyes"; then
   AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer, and ARP listener.  Use --with-pcap-lib-dir=<path>.])
 else
-  AC_DEFINE(HAVE_LIBPCAP, 1,
-    [Define to 1 if you have the `pcap' library (-lpcap).]
-  )
-
   AC_CHECK_FUNCS(\
     pcap_fopen_offline \
     pcap_dump_fopen \
@@ -1248,8 +1244,8 @@ else
   dnl #
   smart_try_dir="$pcap_include_dir"
   FR_SMART_CHECK_INCLUDE([pcap.h])
-  if test "x$ac_cv_header_pcap_h" = "xyes"; then
-    AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
+  if test "x$ac_cv_header_pcap_h" = "xyes" && test "x$ac_cv_lib_pcap_pcap_open_live" = "xyes"; then
+    AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the `pcap' library (-lpcap) and header file <pcap.h>.])
     AC_SUBST(PCAP_LIBS)
     AC_SUBST(PCAP_LDFLAGS)
   else
index 122bf332a2cc366bc0a8bc6308fd3d6c9b3643d1..bef4f0caee9c09334c82292c30dae1de18a832e5 100644 (file)
@@ -60,9 +60,6 @@
 /* Define to 1 if you have the <sys/capability.h> header file. */
 #undef HAVE_CAPABILITY_H
 
-/* Define to 1 if you have the <linux/if_packet.h> header file. */
-#undef HAVE_LINUX_IF_PACKET_H
-
 /* Define to 1 if you have the `clock_gettime' function. */
 #undef HAVE_CLOCK_GETTIME
 
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
-/* Define to 1 if you have the `pcap' library (-lpcap). */
+/* Define to 1 if you have the `pcap' library (-lpcap) and header file
+   <pcap.h>. */
 #undef HAVE_LIBPCAP
 
 /* Define if you have a readline compatible library */
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
+/* Define to 1 if you have the <linux/if_packet.h> header file. */
+#undef HAVE_LINUX_IF_PACKET_H
+
 /* Define to 1 if you have the `localtime_r' function. */
 #undef HAVE_LOCALTIME_R
 
 /* Define to 1 if you have the `pcap_fopen_offline' function. */
 #undef HAVE_PCAP_FOPEN_OFFLINE
 
-/* Define to 1 if you have the <pcap.h> header file. */
-#undef HAVE_PCAP_H
-
 /* define this if we have libpcre */
 #undef HAVE_PCRE