]> The Tcpdump Group git mirrors - libpcap/commitdiff
Use the right version of ar when cross-building.
authorAlon Bar-Lev <[email protected]>
Fri, 16 Apr 2010 10:02:27 +0000 (03:02 -0700)
committerGuy Harris <[email protected]>
Fri, 16 Apr 2010 10:02:27 +0000 (03:02 -0700)
Reviewed-By: Guy Harris <[email protected]>
Makefile.in
configure
configure.in

index 6c8deb54591c2ccea8af8095c2f1b82ccaf55ab5..e17a24b76463ebbad64c62ab6eb85d109fb05b26 100644 (file)
@@ -46,6 +46,7 @@ VPATH = @srcdir@
 
 LD = /usr/bin/ld
 CC = @CC@
 
 LD = /usr/bin/ld
 CC = @CC@
+AR = @AR@
 CCOPT = @V_CCOPT@
 INCLS = -I. @V_INCLS@
 DEFS = @DEFS@ @V_DEFS@
 CCOPT = @V_CCOPT@
 INCLS = -I. @V_INCLS@
 DEFS = @DEFS@ @V_DEFS@
@@ -340,7 +341,7 @@ all: libpcap.a shared pcap-config
 
 libpcap.a: $(OBJ)
        @rm -f $@
 
 libpcap.a: $(OBJ)
        @rm -f $@
-       ar rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
+       $(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
        $(RANLIB) $@
 
 shared: libpcap.$(DYEXT)
        $(RANLIB) $@
 
 shared: libpcap.$(DYEXT)
@@ -413,7 +414,7 @@ libpcap.sl: $(OBJ)
 libpcap.shareda: $(OBJ)
        @rm -f $@ shr.o
        $(CC) @V_SHLIB_OPT@ -o shr.o $(OBJ) $(ADDLOBJS) $(LDFLAGS) $(LIBS)
 libpcap.shareda: $(OBJ)
        @rm -f $@ shr.o
        $(CC) @V_SHLIB_OPT@ -o shr.o $(OBJ) $(ADDLOBJS) $(LDFLAGS) $(LIBS)
-       ar rc $@ shr.o
+       $(AR) rc $@ shr.o
 
 #
 # For platforms that don't support shared libraries (or on which we
 
 #
 # For platforms that don't support shared libraries (or on which we
index a2d96d587c199feadb477d9255168f9721981b78..b7fd5e97b068708b53d7f08dc28c2671fa776fbd 100755 (executable)
--- a/configure
+++ b/configure
@@ -679,6 +679,7 @@ HAVE_LINUX_TPACKET_AUXDATA
 V_LEX
 V_YACC
 RANLIB
 V_LEX
 V_YACC
 RANLIB
+AR
 V_CCOPT
 V_DEFS
 V_FINDALLDEVS
 V_CCOPT
 V_DEFS
 V_FINDALLDEVS
@@ -9835,6 +9836,102 @@ else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
 
   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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$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
+  { echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$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
+  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR=""
+  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
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
 
 rm -f os-proto.h
     if test "${LBL_CFLAGS+set}" = set; then
 
 rm -f os-proto.h
     if test "${LBL_CFLAGS+set}" = set; then
@@ -11450,6 +11547,7 @@ HAVE_LINUX_TPACKET_AUXDATA!$HAVE_LINUX_TPACKET_AUXDATA$ac_delim
 V_LEX!$V_LEX$ac_delim
 V_YACC!$V_YACC$ac_delim
 RANLIB!$RANLIB$ac_delim
 V_LEX!$V_LEX$ac_delim
 V_YACC!$V_YACC$ac_delim
 RANLIB!$RANLIB$ac_delim
+AR!$AR$ac_delim
 V_CCOPT!$V_CCOPT$ac_delim
 V_DEFS!$V_DEFS$ac_delim
 V_FINDALLDEVS!$V_FINDALLDEVS$ac_delim
 V_CCOPT!$V_CCOPT$ac_delim
 V_DEFS!$V_DEFS$ac_delim
 V_FINDALLDEVS!$V_FINDALLDEVS$ac_delim
@@ -11477,7 +11575,7 @@ INSTALL_DATA!$INSTALL_DATA$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 43ea7cb7251ecf30c5508f98b8a470f70814817c..43e8f18225f49ac285b43945ae7f9fd52afe12cf 100644 (file)
@@ -1313,6 +1313,7 @@ solaris*)
 esac
 
 AC_PROG_RANLIB
 esac
 
 AC_PROG_RANLIB
+AC_CHECK_TOOL([AR], [ar])
 
 AC_LBL_DEVEL(V_CCOPT)
 
 
 AC_LBL_DEVEL(V_CCOPT)