about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2014-10-24 14:45:47 -0700
committerRoland McGrath <roland@hack.frob.com>2014-10-24 14:45:47 -0700
commit461a7b1e4551ee9018f7542c21ff32b0f9872e7f (patch)
tree9b94af8d879cb7ab5a1d9ede3eaa5baecd48c12c /configure
parent70996a373dd38296254029423ae6d87c02e7184a (diff)
downloadglibc-461a7b1e4551ee9018f7542c21ff32b0f9872e7f.tar.gz
glibc-461a7b1e4551ee9018f7542c21ff32b0f9872e7f.tar.xz
glibc-461a7b1e4551ee9018f7542c21ff32b0f9872e7f.zip
Rework compiler version check in configure.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure96
1 files changed, 33 insertions, 63 deletions
diff --git a/configure b/configure
index 89566c54c6..24888d990b 100755
--- a/configure
+++ b/configure
@@ -4599,69 +4599,6 @@ fi
 
 # These programs are version sensitive.
 
-for ac_prog in ${ac_tool_prefix}gcc ${ac_tool_prefix}cc
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; 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_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # 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_CC="$ac_prog"
-    $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
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$CC" && break
-done
-
-if test -z "$CC"; then
-  ac_verc_fail=yes
-else
-  # Found it, now check the version.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $CC" >&5
-$as_echo_n "checking version of $CC... " >&6; }
-  ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
-  case $ac_prog_version in
-    '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-    4.[4-9].* | 4.[1-9][0-9].* | [5-9].* )
-       ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-    *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-
-  esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
-$as_echo "$ac_prog_version" >&6; }
-fi
-if test $ac_verc_fail = yes; then
-  critic_missing="$critic_missing gcc"
-fi
-
 for ac_prog in gnumake gmake make
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -4979,6 +4916,39 @@ if test $ac_verc_fail = yes; then
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc" >&5
+$as_echo_n "checking if $CC is sufficient to build libc... " >&6; }
+if ${libc_cv_compiler_ok+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+#if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
+#error insufficient compiler
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libc_cv_compiler_ok=yes
+else
+  libc_cv_compiler_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok" >&5
+$as_echo "$libc_cv_compiler_ok" >&6; }
+if test $libc_cv_compiler_ok != yes; then :
+  critic_missing="$critic_missing compiler"
+fi
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
 set dummy ${ac_tool_prefix}nm; ac_word=$2