]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Check for pcap_free_datalinks().
authorGuy Harris <[email protected]>
Mon, 19 May 2014 17:56:52 +0000 (10:56 -0700)
committerGuy Harris <[email protected]>
Mon, 19 May 2014 17:56:52 +0000 (10:56 -0700)
Fixes GitHub issue #390.

Also, if all we do when checking for a function is set a HAVE_XXX
AC_CHECK_FUNC, as AC_CHECK_FUNCS will set the #define for you.

aclocal.m4
config.h.in
configure

index fb0a6627545288f5a1458ac023c3999b4301d4a8..74fe833c58eea16dc6246739c075a307158bef91 100644 (file)
@@ -615,14 +615,15 @@ reproduce this problem ourselves.])
     dnl if they're not present.
     dnl
     AC_CHECK_FUNC(pcap_list_datalinks,
-       AC_DEFINE(HAVE_PCAP_LIST_DATALINKS, 1,
-           [define if libpcap has pcap_list_datalinks()]),
+       [
+           AC_DEFINE(HAVE_PCAP_LIST_DATALINKS, 1,
+               [define if libpcap has pcap_list_datalinks()])
+           AC_CHECK_FUNCS(pcap_free_datalinks)
+       ],
        [
            AC_LIBOBJ(datalinks)
        ])
-    AC_CHECK_FUNC(pcap_set_datalink,
-       AC_DEFINE(HAVE_PCAP_SET_DATALINK, 1,
-           [define if libpcap has pcap_set_datalink()]))
+    AC_CHECK_FUNCS(pcap_set_datalink)
     AC_CHECK_FUNC(pcap_datalink_name_to_val,
        [
            AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL, 1,
@@ -648,6 +649,7 @@ reproduce this problem ourselves.])
     dnl
     dnl Check for "pcap_dump_ftell()" and use a substitute version
     dnl if it's not present.
+    dnl
     AC_CHECK_FUNC(pcap_dump_ftell,
        AC_DEFINE(HAVE_PCAP_DUMP_FTELL, 1,
            [define if libpcap has pcap_dump_ftell()]),
index 7ac47c0d65abf210eae5ddeec34faab3205ffb6c..d7f37c6a96ac9423800cbb8a606d841855fe7e25 100644 (file)
 /* Define to 1 if you have the `pcap_findalldevs' function. */
 #undef HAVE_PCAP_FINDALLDEVS
 
+/* Define to 1 if you have the `pcap_free_datalinks' function. */
+#undef HAVE_PCAP_FREE_DATALINKS
+
 /* Define to 1 if the system has the type `pcap_if_t'. */
 #undef HAVE_PCAP_IF_T
 
 /* Define to 1 if you have the `pcap_setdirection' function. */
 #undef HAVE_PCAP_SETDIRECTION
 
-/* define if libpcap has pcap_set_datalink() */
+/* Define to 1 if you have the `pcap_set_datalink' function. */
 #undef HAVE_PCAP_SET_DATALINK
 
 /* Define to 1 if you have the `pcap_set_tstamp_type' function. */
index 559c873134ed970a31475d779a233dca7ddbbbd7..c8f9590cb85c04faab9789d3459d1c9a78534e36 100755 (executable)
--- a/configure
+++ b/configure
@@ -6079,8 +6079,21 @@ fi
                         ac_fn_c_check_func "$LINENO" "pcap_list_datalinks" "ac_cv_func_pcap_list_datalinks"
 if test "x$ac_cv_func_pcap_list_datalinks" = xyes; then :
 
+
 $as_echo "#define HAVE_PCAP_LIST_DATALINKS 1" >>confdefs.h
 
+           for ac_func in pcap_free_datalinks
+do :
+  ac_fn_c_check_func "$LINENO" "pcap_free_datalinks" "ac_cv_func_pcap_free_datalinks"
+if test "x$ac_cv_func_pcap_free_datalinks" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_FREE_DATALINKS 1
+_ACEOF
+
+fi
+done
+
+
 else
 
            case " $LIBOBJS " in
@@ -6092,12 +6105,16 @@ esac
 
 fi
 
-    ac_fn_c_check_func "$LINENO" "pcap_set_datalink" "ac_cv_func_pcap_set_datalink"
+    for ac_func in pcap_set_datalink
+do :
+  ac_fn_c_check_func "$LINENO" "pcap_set_datalink" "ac_cv_func_pcap_set_datalink"
 if test "x$ac_cv_func_pcap_set_datalink" = xyes; then :
-
-$as_echo "#define HAVE_PCAP_SET_DATALINK 1" >>confdefs.h
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_SET_DATALINK 1
+_ACEOF
 
 fi
+done
 
     ac_fn_c_check_func "$LINENO" "pcap_datalink_name_to_val" "ac_cv_func_pcap_datalink_name_to_val"
 if test "x$ac_cv_func_pcap_datalink_name_to_val" = xyes; then :
@@ -6146,7 +6163,7 @@ fi
 done
 
 
-                ac_fn_c_check_func "$LINENO" "pcap_dump_ftell" "ac_cv_func_pcap_dump_ftell"
+                    ac_fn_c_check_func "$LINENO" "pcap_dump_ftell" "ac_cv_func_pcap_dump_ftell"
 if test "x$ac_cv_func_pcap_dump_ftell" = xyes; then :
 
 $as_echo "#define HAVE_PCAP_DUMP_FTELL 1" >>confdefs.h