]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use AC_PATH_TOOL, not AC_PATH_PROG, to find pcap-config.
authorMike Frysinger <[email protected]>
Wed, 1 Dec 2010 00:13:05 +0000 (16:13 -0800)
committerGuy Harris <[email protected]>
Wed, 1 Dec 2010 00:13:56 +0000 (16:13 -0800)
The PROG variant does not take into consideration cross-compilation, so
it always looks for "pcap-config" which finds the host script.  So use
the TOOL variant instead which first searches for the cross-prefixed
pcap-config before falling back to the bare "pcap-config".

Reviewed-By: Guy Harris <[email protected]>
aclocal.m4
configure

index 1c3affab8ee74e0fbd25f5190e34bb810487be99..959ddd5e3171b5b9203c009edae4d5b553f5219a 100644 (file)
@@ -309,7 +309,7 @@ AC_DEFUN(AC_LBL_LIBPCAP,
            #
            # Look for pcap-config.
            #
-           AC_PATH_PROG(PCAP_CONFIG, pcap-config)
+           AC_PATH_TOOL(PCAP_CONFIG, pcap-config)
            if test -n "$PCAP_CONFIG" ; then
                #
                # Found - use it to get the include flags for
index 92d67a0847d0001ab1a61b228d9cb665a189c092..f6551cb04aa8a76396c6952de125962d287bf626 100755 (executable)
--- a/configure
+++ b/configure
@@ -9465,8 +9465,9 @@ echo "${ECHO_T}not found" >&6; }
            #
            # Look for pcap-config.
            #
-           # Extract the first word of "pcap-config", so it can be a program name with args.
-set dummy pcap-config; ac_word=$2
+           if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pcap-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pcap-config; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_PCAP_CONFIG+set}" = set; then
@@ -9505,6 +9506,67 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
+fi
+if test -z "$ac_cv_path_PCAP_CONFIG"; then
+  ac_pt_PCAP_CONFIG=$PCAP_CONFIG
+  # Extract the first word of "pcap-config", so it can be a program name with args.
+set dummy pcap-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_PCAP_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PCAP_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PCAP_CONFIG="$ac_pt_PCAP_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PCAP_CONFIG=$ac_cv_path_ac_pt_PCAP_CONFIG
+if test -n "$ac_pt_PCAP_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_PCAP_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PCAP_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_pt_PCAP_CONFIG" = x; then
+    PCAP_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to [email protected]." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to [email protected]." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PCAP_CONFIG=$ac_pt_PCAP_CONFIG
+  fi
+else
+  PCAP_CONFIG="$ac_cv_path_PCAP_CONFIG"
+fi
+
            if test -n "$PCAP_CONFIG" ; then
                #
                # Found - use it to get the include flags for