configure.ac: Update AC_PROG_CC and AC_PROG_LEX for autoconf 2.70

Message ID 20221022195819.90560-1-mark@klomp.org
State Committed
Headers
Series configure.ac: Update AC_PROG_CC and AC_PROG_LEX for autoconf 2.70 |

Commit Message

Mark Wielaard Oct. 22, 2022, 7:58 p.m. UTC
  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. Also use
AC_PROG_LEX([noyywrap]), the extra argument is ignored with earlier
versions, but required for 2.70.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 ChangeLog    | 5 +++++
 configure.ac | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
  

Comments

Mark Wielaard Oct. 27, 2022, 4:49 p.m. UTC | #1
On Sat, 2022-10-22 at 21:58 +0200, Mark Wielaard wrote:
> 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. Also use
> AC_PROG_LEX([noyywrap]), the extra argument is ignored with earlier
> versions, but required for 2.70.

Pushed,

Mark
  

Patch

diff --git a/ChangeLog b/ChangeLog
index 60624183..ee566f53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@ 
+2022-10-22  Mark Wielaard  <mark@klomp.org>
+
+	* configure.ac: Use AC_PROG_CC with autoconf 2.70, or AC_PROG_CC_C99
+	for earlier versions. Use AC_PROG_LEX([noyywrap]).
+
 2022-09-13  Aleksei Vetrov  <vvvvvv@google.com>
 
 	* NEWS (libdwfl): Add dwfl_report_offline_memory.
diff --git a/configure.ac b/configure.ac
index 03b67a9d..1084b469 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,11 +88,11 @@  AS_IF([test "$use_locks" = yes],
 
 AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
 
-AC_PROG_CC_C99
+m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99])
 AC_PROG_CXX
 AC_PROG_RANLIB
 AC_PROG_YACC
-AM_PROG_LEX
+AC_PROG_LEX([noyywrap])
 # Only available since automake 1.12
 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 AC_CHECK_TOOL([READELF], [readelf])