]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
configure.ac: Update AC_PROG_CC checks
authorMark Wielaard <mark@klomp.org>
Sat, 28 Jan 2023 20:11:35 +0000 (21:11 +0100)
committerMark Wielaard <mark@klomp.org>
Sat, 28 Jan 2023 20:11:38 +0000 (21:11 +0100)
AM_PROG_CC_C_O has been obsolete since automake 1.14.
AC_PROG_CC does the same check. With autoconf 2.70 we
must use AC_PROG_CC (which will check for c11 and c99),
for earlier versions we'll use AC_PROG_CC_C99.

configure.ac

index 47b2a5fe8f0377b1dbcfd4df47bd42bdc53c19a5..625063beb446a87ebddfaef150fdea415268d7b0 100755 (executable)
@@ -50,8 +50,11 @@ CXXFLAGS="$CXXFLAGS"
 #----------------------------------------------------------------------------
 
 AC_PROG_LN_S
-AC_PROG_CC
-AM_PROG_CC_C_O
+m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99])
+# Make sure we can compile in C99 mode.
+if test "$ac_cv_prog_cc_c99" = "no"; then
+    AC_MSG_ERROR([Valgrind relies on a C compiler supporting C99])
+fi
 AC_PROG_CPP
 AC_PROG_CXX
 # AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with
@@ -136,12 +139,6 @@ else
 fi
 rm $tmpfile
 
-# Make sure we can compile in C99 mode.
-AC_PROG_CC_C99
-if test "$ac_cv_prog_cc_c99" = "no"; then
-    AC_MSG_ERROR([Valgrind relies on a C compiler supporting C99])
-fi
-
 # We don't want gcc < 3.0
 AC_MSG_CHECKING([for a supported version of gcc])