From: Guy Harris Date: Thu, 16 Jan 2014 22:40:46 +0000 (-0800) Subject: Use AC_CHECK_TOOL to find ar. X-Git-Tag: tcpdump-4.6.0~269 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/3b149607b9dfb9ecf3d344e970a608b7944629a1 Use AC_CHECK_TOOL to find ar. On some platforms, such as at least some versions of HP-UX, AR isn't automatically set by make. --- diff --git a/Makefile.in b/Makefile.in index 7f765847..4f997280 100644 --- a/Makefile.in +++ b/Makefile.in @@ -39,6 +39,7 @@ VPATH = @srcdir@ # CC = @CC@ +AR = @AR@ MKDEP = @MKDEP@ PROG = tcpdump CCOPT = @V_CCOPT@ diff --git a/configure b/configure index 1356816c..667109a6 100755 --- a/configure +++ b/configure @@ -633,6 +633,7 @@ V_DEFS V_CCOPT MKDEP DEPENDENCY_CFLAG +AR RANLIB PCAP_CONFIG LIBOBJS @@ -7468,6 +7469,98 @@ else RANLIB="$ac_cv_prog_RANLIB" fi +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + rm -f os-proto.h if test "${LBL_CFLAGS+set}" = set; then diff --git a/configure.in b/configure.in index 08fac5d2..fa816538 100644 --- a/configure.in +++ b/configure.in @@ -991,6 +991,7 @@ AC_CHECK_HEADERS(pcap/usb.h,,,[#include ]) CPPFLAGS="$savedcppflags" AC_PROG_RANLIB +AC_CHECK_TOOL([AR], [ar]) AC_LBL_DEVEL(V_CCOPT)