From 4a8973e703ca096f35e23facd72745a53d176ad4 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 14 Jan 2018 13:48:37 +0300 Subject: [PATCH] Merge autoconf-archive macros from upstream. --- m4/ax_check_compile_flag.m4 | 8 ++++---- m4/ax_compiler_vendor.m4 | 6 +++--- m4/ax_gcc_archflag.m4 | 6 +++--- m4/ax_gcc_func_attribute.m4 | 25 ++++++++++++++++++++----- m4/ax_gcc_x86_cpuid.m4 | 6 +++--- m4/ax_tls.m4 | 30 +++++++----------------------- m4/sb_autoconf_compat.m4 | 14 ++++++++++++++ 7 files changed, 54 insertions(+), 41 deletions(-) diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 index 99a2220..dcabb92 100644 --- a/m4/ax_check_compile_flag.m4 +++ b/m4/ax_check_compile_flag.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS @@ -40,7 +40,7 @@ # Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program. If not, see . +# with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure @@ -55,10 +55,10 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 4 +#serial 5 AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[ +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4 index 39ca3c0..4ca8089 100644 --- a/m4/ax_compiler_vendor.m4 +++ b/m4/ax_compiler_vendor.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html +# https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html # =========================================================================== # # SYNOPSIS @@ -29,7 +29,7 @@ # Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program. If not, see . +# with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure @@ -44,7 +44,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 15 +#serial 16 AC_DEFUN([AX_COMPILER_VENDOR], [AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, diff --git a/m4/ax_gcc_archflag.m4 b/m4/ax_gcc_archflag.m4 index d4a37f8..39aaf91 100644 --- a/m4/ax_gcc_archflag.m4 +++ b/m4/ax_gcc_archflag.m4 @@ -37,7 +37,7 @@ # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2008 Matteo Frigo # Copyright (c) 2014 Tsukasa Oi -# Copyright (c) 2017 Alexey Kopytov +# Copyright (c) 2017-2018 Alexey Kopytov # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -65,7 +65,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 20 +#serial 21 AC_DEFUN([AX_GCC_ARCHFLAG], [AC_REQUIRE([AC_PROG_CC]) @@ -108,7 +108,7 @@ case $host_cpu in *2?6[[ad]]?:*:*:*) ax_gcc_arch="sandybridge corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *3?6[[ae]]?:*:*:*) ax_gcc_arch="ivybridge core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) ax_gcc_arch="haswell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; - *3?6d?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; + *3?6d?:*:*:*|*4?6[[7f]]?:*:*:*|*5?66?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *1?6c?:*:*:*|*2?6[[67]]?:*:*:*|*3?6[[56]]?:*:*:*) ax_gcc_arch="bonnell atom core2 pentium-m pentium3 pentiumpro" ;; *3?67?:*:*:*|*[[45]]?6[[ad]]?:*:*:*) ax_gcc_arch="silvermont atom core2 pentium-m pentium3 pentiumpro" ;; *000?f[[012]]?:*:*:*|?f[[012]]?:*:*:*|f[[012]]?:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; diff --git a/m4/ax_gcc_func_attribute.m4 b/m4/ax_gcc_func_attribute.m4 index c788ca9..098c9aa 100644 --- a/m4/ax_gcc_func_attribute.m4 +++ b/m4/ax_gcc_func_attribute.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html +# https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html # =========================================================================== # # SYNOPSIS @@ -38,6 +38,7 @@ # dllimport # error # externally_visible +# fallthrough # flatten # format # format_arg @@ -53,6 +54,8 @@ # nothrow # optimize # pure +# sentinel +# sentinel_position # unused # used # visibility @@ -61,9 +64,9 @@ # weak # weakref # -# Unsuppored function attributes will be tested with a prototype returning -# an int and not accepting any arguments and the result of the check might -# be wrong or meaningless so use with care. +# Unsupported function attributes will be tested with a prototype +# returning an int and not accepting any arguments and the result of the +# check might be wrong or meaningless so use with care. # # LICENSE # @@ -74,7 +77,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 3 +#serial 9 AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) @@ -128,6 +131,9 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ [externally_visible], [ int foo( void ) __attribute__(($1)); ], + [fallthrough], [ + int foo( void ) {switch (0) { case 1: __attribute__(($1)); case 2: break ; }}; + ], [flatten], [ int foo( void ) __attribute__(($1)); ], @@ -175,6 +181,15 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ [pure], [ int foo( void ) __attribute__(($1)); ], + [sentinel], [ + int foo(void *p, ...) __attribute__(($1)); + ], + [sentinel_position], [ + int foo(void *p, ...) __attribute__(($1(1))); + ], + [returns_nonnull], [ + void *foo( void ) __attribute__(($1)); + ], [unused], [ int foo( void ) __attribute__(($1)); ], diff --git a/m4/ax_gcc_x86_cpuid.m4 b/m4/ax_gcc_x86_cpuid.m4 index 578b3a3..df95465 100644 --- a/m4/ax_gcc_x86_cpuid.m4 +++ b/m4/ax_gcc_x86_cpuid.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html +# https://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html # =========================================================================== # # SYNOPSIS @@ -43,7 +43,7 @@ # Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program. If not, see . +# with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure @@ -58,7 +58,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 9 +#serial 10 AC_DEFUN([AX_GCC_X86_CPUID], [AX_GCC_X86_CPUID_COUNT($1, 0) diff --git a/m4/ax_tls.m4 b/m4/ax_tls.m4 index c3da0e4..51edee8 100644 --- a/m4/ax_tls.m4 +++ b/m4/ax_tls.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_tls.html +# https://www.gnu.org/software/autoconf-archive/ax_tls.html # =========================================================================== # # SYNOPSIS @@ -9,9 +9,9 @@ # DESCRIPTION # # Provides a test for the compiler support of thread local storage (TLS) -# extensions. Defines TLS if it is found. Currently knows about GCC/ICC -# and MSVC. I think SunPro uses the same as GCC, and Borland apparently -# supports either. +# extensions. Defines TLS if it is found. Currently knows about C++11, +# GCC/ICC, and MSVC. I think SunPro uses the same as GCC, and Borland +# apparently supports either. # # LICENSE # @@ -29,7 +29,7 @@ # Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program. If not, see . +# with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure @@ -44,28 +44,12 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 11 - -# Define m4_ifblank and m4_ifnblank macros from introduced in -# autotools 2.64 m4sugar.m4 if using an earlier autotools. - -ifdef([m4_ifblank], [], [ -m4_define([m4_ifblank], -[m4_if(m4_translit([[$1]], [ ][ ][ -]), [], [$2], [$3])]) -]) - - -ifdef([m4_ifnblank], [], [ -m4_define([m4_ifnblank], -[m4_if(m4_translit([[$1]], [ ][ ][ -]), [], [$3], [$2])]) -]) +#serial 14 AC_DEFUN([AX_TLS], [ AC_MSG_CHECKING([for thread local storage (TLS) class]) AC_CACHE_VAL([ac_cv_tls], - [for ax_tls_keyword in __thread '__declspec(thread)' none; do + [for ax_tls_keyword in thread_local _Thread_local __thread '__declspec(thread)' none; do AS_CASE([$ax_tls_keyword], [none], [ac_cv_tls=none ; break], [AC_TRY_COMPILE( diff --git a/m4/sb_autoconf_compat.m4 b/m4/sb_autoconf_compat.m4 index 00c4770..be73647 100644 --- a/m4/sb_autoconf_compat.m4 +++ b/m4/sb_autoconf_compat.m4 @@ -11,3 +11,17 @@ m4_ifdef([AS_VAR_IF],,m4_define([AS_VAR_IF], [[eval test \"x\$"$1"\" = x"_AS_ESCAPE([$2], [`], [\"$])"]], [[eval \${$1:+false} :]])]), [$3], [$4])]))dnl + +# Define m4_ifblank and m4_ifnblank macros from introduced in +# autotools 2.64 m4sugar.m4 if using an earlier autotools. +ifdef([m4_ifblank], [], [ +m4_define([m4_ifblank], +[m4_if(m4_translit([[$1]], [ ][ ][ +]), [], [$2], [$3])]) +]) + +ifdef([m4_ifnblank], [], [ +m4_define([m4_ifnblank], +[m4_if(m4_translit([[$1]], [ ][ ][ +]), [], [$3], [$2])]) +])