[前][次][番号順一覧][スレッド一覧]

ruby-changes:64937

From: Nobuyoshi <ko1@a...>
Date: Mon, 18 Jan 2021 18:15:45 +0900 (JST)
Subject: [ruby-changes:64937] c32375883a (master): Update for autoconf 2.70

https://git.ruby-lang.org/ruby.git/commit/?id=c32375883a

From c32375883a696fcf8e9e99875f1339ee5474a255 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 12 Dec 2020 22:55:09 +0900
Subject: Update for autoconf 2.70


diff --git a/configure.ac b/configure.ac
index 33e77ca..cd0c9e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/configure.ac#L1
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT()
+AC_INIT
 {
 AC_CONFIG_AUX_DIR(tool)
 AC_CONFIG_MACRO_DIRS(tool/m4)
@@ -168,7 +168,7 @@ rb_test_CFLAGS=${CFLAGS+yes} https://github.com/ruby/ruby/blob/trunk/configure.ac#L168
 rb_test_CXXFLAGS=${CXXFLAGS+yes}
 
 # BSD's ports and MacPorts prefix GNU binutils with 'g'
-AC_PROG_CC_C99
+# AC_PROG_CC_C99
 AC_PROG_CXX
 AC_PROG_CPP
 AC_PROG_RANLIB
@@ -237,6 +237,9 @@ AC_ARG_ENABLE(load-relative, https://github.com/ruby/ruby/blob/trunk/configure.ac#L237
        AS_HELP_STRING([--enable-load-relative], [resolve load paths at run time]),
        [load_relative=$enableval])
 
+# checks for UNIX variants that set C preprocessor variables
+AC_USE_SYSTEM_EXTENSIONS
+
 dnl Checks for programs.
 
 cflagspat=
@@ -276,12 +279,12 @@ AS_CASE(["$host_os:$build_os"], https://github.com/ruby/ruby/blob/trunk/configure.ac#L279
 AS_CASE(["$target_os"],
 [darwin*], [
     AC_MSG_CHECKING(if minimum required OS X version is supported)
-    AC_TRY_CPP([@%:@include <AvailabilityMacros.h>
+    AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include <AvailabilityMacros.h>
 	@%:@if MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5
 	@%:@error pre OS X 10.5
 	[!<===== pre OS X 10.5 =====>]
 	@%:@endif
-	],
+	]])],
 	[macosx_min_required=yes],
 	[AC_MSG_RESULT(no)
 	AC_MSG_ERROR([Unsupported OS X version is required])])
@@ -392,8 +395,8 @@ AS_CASE(["$target_os"], https://github.com/ruby/ruby/blob/trunk/configure.ac#L395
     [mingw*], [
 	test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
 	AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
-	AC_TRY_LINK([@%:@include <stdio.h>],
-		    [FILE* volatile f = stdin; return 0;],
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>]],
+		    [[FILE* volatile f = stdin; return 0;]])],
 		    [rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
 				   tr A-Z a-z |
 				   sed -n '/^[[ 	]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
@@ -437,15 +440,12 @@ for prog in ${ac_tool_prefix:+${ac_tool_prefix}pkg-config} pkg-config; do https://github.com/ruby/ruby/blob/trunk/configure.ac#L440
     test -z "${PKG_CONFIG}" || break
 done
 
-# checks for UNIX variants that set C preprocessor variables
-AC_USE_SYSTEM_EXTENSIONS
-
 AC_MSG_CHECKING([whether it is Android])
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 	@%:@ifdef __ANDROID__
 	@%:@error android
 	@%:@endif
-], [],
+]], [[]])],
 [AC_MSG_RESULT(no)],
 [
 	AC_MSG_RESULT(yes)
@@ -494,7 +494,7 @@ AC_SUBST(CHDIR) https://github.com/ruby/ruby/blob/trunk/configure.ac#L494
 : "compiler section" && {
 RUBY_WERROR_FLAG([
     AC_MSG_CHECKING([whether CFLAGS is valid])
-    AC_TRY_COMPILE([], [],
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
 	[AC_MSG_RESULT(yes)],
 	[
 	AC_MSG_RESULT(no)
@@ -510,7 +510,7 @@ RUBY_WERROR_FLAG([ https://github.com/ruby/ruby/blob/trunk/configure.ac#L510
 	echo '<?xml?><plist><dict><key>CFBundleIdentifier</key><string></string></dict></plist>' > Info.plist &&
 	:
     } || AC_MSG_ERROR([failed to make temporary directory])
-    AC_TRY_LINK([], [],
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
 	[AC_MSG_RESULT(yes)],
 	[
 	cd .. && rm -fr tmp.$$.try_link
@@ -715,13 +715,13 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L715
 	  ], [
 	    CFLAGS="$CFLAGS -Werror -Wuninitialized"
 	  ])
-	  AC_TRY_COMPILE([@%:@include <math.h>
+	  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>
 	    int foo(double x)
 	    {
 	      int exp;
 	      frexp(x, &exp);
 	      return exp;
-	    }], [if (foo(0.0)) return 1;],
+	    }]], [[if (foo(0.0)) return 1;]])],
 	    [rb_cv_mingw64_broken_frexp_modf=no],
 	    [rb_cv_mingw64_broken_frexp_modf=yes])
 	  CFLAGS="$save_CFLAGS"
@@ -811,13 +811,13 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L811
 
 AS_CASE(["$target_cpu"], [[i[3-6]86*]], [
     AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [
-	AC_TRY_LINK([unsigned long atomic_var;],
-	    [__sync_val_compare_and_swap(&atomic_var, 0, 1);],
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned long atomic_var;]],
+	    [[__sync_val_compare_and_swap(&atomic_var, 0, 1);]])],
 	    [rb_cv_gcc_compiler_cas=yes],
 	    [
 	    save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -march=i486"
-	    AC_TRY_LINK([unsigned long atomic_var;],
-		[__sync_val_compare_and_swap(&atomic_var, 0, 1);],
+	    AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned long atomic_var;]],
+		[[__sync_val_compare_and_swap(&atomic_var, 0, 1);]])],
 		[rb_cv_gcc_compiler_cas=i486],
 		[rb_cv_gcc_compiler_cas=no])
 	    CFLAGS="$save_CFLAGS"
@@ -844,7 +844,7 @@ test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cx https://github.com/ruby/ruby/blob/trunk/configure.ac#L844
 
 AC_CACHE_CHECK([whether compiler has statement and declarations in expressions],
   rb_cv_have_stmt_and_decl_in_expr,
-  [AC_TRY_COMPILE([],[ __extension__ ({ int a = 0; a; }); ],
+  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ __extension__ ({ int a = 0; a; }); ]])],
   [rb_cv_have_stmt_and_decl_in_expr=yes],
   [rb_cv_have_stmt_and_decl_in_expr=no])])
 AS_IF([test "$rb_cv_have_stmt_and_decl_in_expr" = yes], [
@@ -865,12 +865,12 @@ AS_CASE(["$target_os"], https://github.com/ruby/ruby/blob/trunk/configure.ac#L865
 [freebsd*], [
   AC_CACHE_CHECK([whether pthread should be enabled by default],
     rb_cv_enable_pthread_default,
-    [AC_TRY_CPP([
+    [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
 #include <osreldate.h>
 #if __FreeBSD_version < 502102
 #error pthread should be disabled on this platform
 #endif
-      ],
+      ]])],
       rb_cv_enable_pthread_default=yes,
       rb_cv_enable_pthread_default=no)])
   enable_pthread=$rb_cv_enable_pthread_default
@@ -904,8 +904,8 @@ AS_CASE(["$target_os"], https://github.com/ruby/ruby/blob/trunk/configure.ac#L904
 		RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
 		AC_CACHE_CHECK([whether syscall(2) is deprecated], rb_cv_syscall_deprecated,
 		    [RUBY_WERROR_FLAG([
-			AC_TRY_COMPILE([@%:@include <unistd.h>],
-				       [if (syscall(0)) return 1;],
+			AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <unistd.h>]],
+							   [[if (syscall(0)) return 1;]])],
 			    [rb_cv_syscall_deprecated=no],
 			    [rb_cv_syscall_deprecated=yes])])])
 		AS_IF([test $rb_cv_syscall_deprecated = yes], [
@@ -932,7 +932,7 @@ AS_CASE(["$target_os"], https://github.com/ruby/ruby/blob/trunk/configure.ac#L932
 		])
 		with_setjmp_type=sigsetjmp # to hijack SIGCHLD handler
 		AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
-		    [AC_TRY_RUN([
+		    [AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <unistd.h>
 #include <string.h>
@@ -969,7 +969,7 @@ main() https://github.com/ruby/ruby/blob/trunk/configure.ac#L969
     }
     return 0;
 }
-],
+]])],
 		    rb_cv_broken_crypt=no,
 		    rb_cv_broken_crypt=yes,
 		    rb_cv_broken_crypt=yes)])
@@ -998,11 +998,11 @@ main() https://github.com/ruby/ruby/blob/trunk/configure.ac#L998
 [solaris*], [	LIBS="-lm $LIBS"
 		ac_cv_func_vfork=no
 		AC_MSG_CHECKING(whether _XOPEN_SOURCE is already given)
-		AC_TRY_COMPILE([#include <unistd.h>
+		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
 			#ifndef _XOPEN_SOURCE
 			#error _XOPEN_SOURCE is not defined
 			#endif
-			], [],
+			]], [[]])],
 		        [given_xopen_source=yes], [given_xopen_source=no])
 		AC_MSG_RESULT($given_xopen_source)
 		AS_IF([test $given_xopen_source = no], [
@@ -1012,13 +1012,13 @@ main() https://github.com/ruby/ruby/blob/trunk/configure.ac#L1012
 		    AS_IF([test x"$define_xopen_source" != x], [
 		      break
 		    ])
-		    RUBY_WERROR_FLAG([AC_TRY_COMPILE([
+		    RUBY_WERROR_FLAG([AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 			#define _XOPEN_SOURCE ${tmp_xpg}00
 			#include <unistd.h>
 			#ifndef _XPG${tmp_xpg}
 			#error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00
 			#endif
-			], [],
+			]], [[]])],
 			[define_xopen_source=${tmp_xpg}00], [])
 			])
 		  done
@@ -1136,7 +1136,8 @@ AS_IF([test -n "${rb_there_is_in_fact_no_gplusplus_but_autoconf_is_cheating_us}" https://github.com/ruby/ruby/blob/trunk/configure.ac#L1136
     RUBY_WERROR_FLAG([
         AC_MSG_CHECKING([whether CXXFLAGS is valid])
         AC_LANG_PUSH(C++)
-        AC_TRY_COMPILE([@%:@include <cstdio>], [], [AC_MSG_RESULT(yes)], [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <cstdio>]], [[]])],
+	    [AC_MSG_RESULT(yes)],[
             AC_MSG_RESULT(no)
             # The message mentions CXXFLAGS, but CPPFLAGS might also affects.
             AC_MSG_WARN([something wrong with CXXFLAGS="$CXXFLAGS"])
@@ -1335,8 +1336,8 @@ AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct, https://github.com/ruby/ruby/blob/trunk/configure.ac#L1336
 	"__pragma(pack(push, 1)) x __pragma(pack(pop))" \
 	"x __attribute__((packed))" \
 	; do
-	AC_TRY_COMPILE([@%:@define PACKED_STRUCT(x) $mac
-			PACKED_STRUCT(struct { int a; });], [],
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@define PACKED_STRUCT(x) $mac
+			PACKED_STRUCT(struct { int a; });]], [[]])],
 		[rb_cv_packed_struct=$mac; break])
     done])
 AS_IF([test "$rb_cv_packed_struct" != no], [
@@ -1379,10 +1380,10 @@ RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID, [@%:@ifdef HAVE_TIME_H https://github.com/ruby/ruby/blob/trunk/configure.ac#L1380
 # 2006). The check below is redundant and should always success.  Remain not
 # deleted for backward compat.
 AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro,
-  [AC_TRY_COMPILE([
+  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 int fo (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]