configure: add fallback when checking for ar

This commit is contained in:
Matthew Flatt 2013-11-21 20:24:32 -07:00
parent 79f3fd5e64
commit 9213d1aa79
2 changed files with 49 additions and 2 deletions

47
racket/src/configure vendored
View File

@ -672,6 +672,7 @@ EXEEXT
OBJEXT
CPP
RANLIB
platform_ar_found
STRIP
GREP
EGREP
@ -3848,6 +3849,47 @@ fi
if test "$AR" = '' ; then
AR="${ac_tool_prefix}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_platform_ar_found+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$platform_ar_found"; then
ac_cv_prog_platform_ar_found="$platform_ar_found" # 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_platform_ar_found="yes"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_prog_platform_ar_found" && ac_cv_prog_platform_ar_found="no"
fi
fi
platform_ar_found=$ac_cv_prog_platform_ar_found
if test -n "$platform_ar_found"; then
{ echo "$as_me:$LINENO: result: $platform_ar_found" >&5
echo "${ECHO_T}$platform_ar_found" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
if test "$platform_ar_found" = 'no' ; then
AR="ar"
fi
fi
if test "$ARFLAGS" = '' ; then
ARFLAGS=ruv
@ -10040,6 +10082,7 @@ EXEEXT!$EXEEXT$ac_delim
OBJEXT!$OBJEXT$ac_delim
CPP!$CPP$ac_delim
RANLIB!$RANLIB$ac_delim
platform_ar_found!$platform_ar_found$ac_delim
STRIP!$STRIP$ac_delim
GREP!$GREP$ac_delim
EGREP!$EGREP$ac_delim
@ -10078,7 +10121,6 @@ EXTRA_GMP_DEP!$EXTRA_GMP_DEP$ac_delim
OSX!$OSX$ac_delim
NOT_OSX!$NOT_OSX$ac_delim
MINGW!$MINGW$ac_delim
NOT_MINGW!$NOT_MINGW$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@ -10120,6 +10162,7 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
NOT_MINGW!$NOT_MINGW$ac_delim
FRAMEWORK_INSTALL_DIR!$FRAMEWORK_INSTALL_DIR$ac_delim
FRAMEWORK_REL_INSTALL!$FRAMEWORK_REL_INSTALL$ac_delim
FRAMEWORK_PREFIX!$FRAMEWORK_PREFIX$ac_delim
@ -10182,7 +10225,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 60; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 61; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

View File

@ -484,6 +484,10 @@ fi
AC_PROG_RANLIB
if test "$AR" = '' ; then
AR="${ac_tool_prefix}ar"
AC_CHECK_PROG(platform_ar_found, $AR, yes, no)
if test "$platform_ar_found" = 'no' ; then
AR="ar"
fi
fi
if test "$ARFLAGS" = '' ; then
ARFLAGS=ruv