]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Try the pcap_dump_ftell() check after pcap-config.
authorDenis Ovsienko <[email protected]>
Sat, 28 Jul 2018 19:07:13 +0000 (20:07 +0100)
committerDenis Ovsienko <[email protected]>
Sat, 28 Jul 2018 19:48:16 +0000 (20:48 +0100)
Apparently, the test for pcap_dump_ftell() cannot succeed if the test
program isn't linked with libpcap, this depending on the output of
pcap-config. That's why all pcap_* function checks come after the
pcap-config check.

This explains why in my working copy a ./configure build of the previous
commit tree with the master branch of libpcap found that the function
was "missing" and tried to substitute it with the local implementation
and eventually failed trying to link with libpcap that actually had the
function.

However, this does not explain why all 32 Travis CI builds of the same
tree passed, including the builds that used autotools.

configure
configure.ac

index 07febdef7bc7bf8b17c90968cae6c62424aa77b4..99860fcfe0395427e32047b7c6a797266f1f916d 100755 (executable)
--- a/configure
+++ b/configure
@@ -5126,19 +5126,6 @@ esac
 
 fi
 
-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
-
-else
-  case " $LIBOBJS " in
-  *" pcap_dump_ftell.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS pcap_dump_ftell.$ac_objext"
- ;;
-esac
-
-fi
-
 
 for ac_func in fork vfork strftime
 do :
@@ -6229,6 +6216,20 @@ _ACEOF
 fi
 done
 
+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
+
+else
+  case " $LIBOBJS " in
+  *" pcap_dump_ftell.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS pcap_dump_ftell.$ac_objext"
+ ;;
+esac
+
+fi
+
+
 
 #
 # Check for special debugging functions
index 5a253743d6ea4a3f1c6ca69ab5a046bf5f83d501..bdcb9e74ebc400d3646a4fa27b9382889276a2ea 100644 (file)
@@ -409,7 +409,7 @@ AC_INCLUDES_DEFAULT
        fi
 ])
 
-AC_REPLACE_FUNCS(strlcat strlcpy strdup strsep getservent getopt_long pcap_dump_ftell)
+AC_REPLACE_FUNCS(strlcat strlcpy strdup strsep getservent getopt_long)
 AC_CHECK_FUNCS(fork vfork strftime)
 AC_CHECK_FUNCS(setlinebuf)
 
@@ -726,6 +726,7 @@ if test $ac_cv_func_pcap_lib_version = "no" ; then
 fi
 AC_CHECK_FUNCS(pcap_setdirection pcap_set_immediate_mode pcap_dump_ftell64)
 AC_CHECK_FUNCS(pcap_open pcap_findalldevs_ex)
+AC_REPLACE_FUNCS(pcap_dump_ftell)
 
 #
 # Check for special debugging functions