ruby-changes:70973
From: Nobuyoshi <ko1@a...>
Date: Sat, 22 Jan 2022 20:14:05 +0900 (JST)
Subject: [ruby-changes:70973] ad150a1459 (master): Override `AC_C_PROGRAM` on old autoconf
https://git.ruby-lang.org/ruby.git/commit/?id=ad150a1459 From ad150a14598980095260add74474498a642ab5ba Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 22 Jan 2022 19:05:02 +0900 Subject: Override `AC_C_PROGRAM` on old autoconf Autoconf 2.69 fails to detect `-Werror=old-style-definition` due to the old style definition of `main`. --- tool/m4/ruby_try_cflags.m4 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tool/m4/ruby_try_cflags.m4 b/tool/m4/ruby_try_cflags.m4 index f2c6a3094e9..228fe65245d 100644 --- a/tool/m4/ruby_try_cflags.m4 +++ b/tool/m4/ruby_try_cflags.m4 @@ -1,4 +1,19 @@ https://github.com/ruby/ruby/blob/trunk/tool/m4/ruby_try_cflags.m4#L1 dnl -*- Autoconf -*- +dnl +dnl Autoconf 2.67 fails to detect `-Werror=old-style-definition` due +dnl to the old style definition of `main`. +m4_version_prereq([2.70], [], [ +m4_define([AC_LANG_PROGRAM(C)], +[$1 +int +main (void) +{ +$2 + ; + return 0; +}]) +])dnl +dnl AC_DEFUN([RUBY_TRY_CFLAGS], [ AC_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS]) RUBY_WERROR_FLAG([ -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/