Update various GNU configuration scripts to latest versions

See #18459
This commit is contained in:
Paul Cornett 2019-08-07 09:00:09 -07:00
parent 4c94ad69d8
commit b2d1343fbc
5 changed files with 1980 additions and 3431 deletions

View File

@ -33,19 +33,19 @@
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com> # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
# Copyright (c) 2015 Paul Norman <penorman@mac.com> # Copyright (c) 2015 Paul Norman <penorman@mac.com>
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu> # Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
# Copyright (c) 2016 Krzesimir Nowak <qdlacz@gmail.com> # Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
# Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
# #
# Copying and distribution of this file, with or without modification, are # Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice # permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 7 #serial 11
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13). dnl (serial version number 13).
AX_REQUIRE_DEFINED([AC_MSG_WARN])
AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
[$1], [14], [ax_cxx_compile_alternatives="14 1y"], [$1], [14], [ax_cxx_compile_alternatives="14 1y"],
@ -61,14 +61,6 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
[m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
AC_LANG_PUSH([C++])dnl AC_LANG_PUSH([C++])dnl
ac_success=no ac_success=no
AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
ax_cv_cxx_compile_cxx$1,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[ax_cv_cxx_compile_cxx$1=yes],
[ax_cv_cxx_compile_cxx$1=no])])
if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
ac_success=yes
fi
m4_if([$2], [noext], [], [dnl m4_if([$2], [noext], [], [dnl
if test x$ac_success = xno; then if test x$ac_success = xno; then
@ -139,7 +131,6 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
[define if the compiler supports basic C++$1 syntax]) [define if the compiler supports basic C++$1 syntax])
fi fi
AC_SUBST(HAVE_CXX$1) AC_SUBST(HAVE_CXX$1)
m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])])
]) ])
@ -199,11 +190,13 @@ namespace cxx11
struct Base struct Base
{ {
virtual ~Base() {}
virtual void f() {} virtual void f() {}
}; };
struct Derived : public Base struct Derived : public Base
{ {
virtual ~Derived() override {}
virtual void f() override {} virtual void f() override {}
}; };
@ -587,20 +580,12 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
#error "This is not a C++ compiler" #error "This is not a C++ compiler"
#elif __cplusplus <= 201402L #elif __cplusplus < 201703L
#error "This is not a C++17 compiler" #error "This is not a C++17 compiler"
#else #else
#if defined(__clang__)
#define REALLY_CLANG
#else
#if defined(__GNUC__)
#define REALLY_GCC
#endif
#endif
#include <initializer_list> #include <initializer_list>
#include <utility> #include <utility>
#include <type_traits> #include <type_traits>
@ -608,16 +593,12 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
namespace cxx17 namespace cxx17
{ {
#if !defined(REALLY_CLANG)
namespace test_constexpr_lambdas namespace test_constexpr_lambdas
{ {
// TODO: test it with clang++ from git
constexpr int foo = [](){return 42;}(); constexpr int foo = [](){return 42;}();
} }
#endif // !defined(REALLY_CLANG)
namespace test::nested_namespace::definitions namespace test::nested_namespace::definitions
{ {
@ -852,12 +833,9 @@ namespace cxx17
} }
#if !defined(REALLY_CLANG)
namespace test_template_argument_deduction_for_class_templates namespace test_template_argument_deduction_for_class_templates
{ {
// TODO: test it with clang++ from git
template <typename T1, typename T2> template <typename T1, typename T2>
struct pair struct pair
{ {
@ -876,7 +854,6 @@ namespace cxx17
} }
} }
#endif // !defined(REALLY_CLANG)
namespace test_non_type_auto_template_parameters namespace test_non_type_auto_template_parameters
{ {
@ -890,12 +867,9 @@ namespace cxx17
} }
#if !defined(REALLY_CLANG)
namespace test_structured_bindings namespace test_structured_bindings
{ {
// TODO: test it with clang++ from git
int arr[2] = { 1, 2 }; int arr[2] = { 1, 2 };
std::pair<int, int> pr = { 1, 2 }; std::pair<int, int> pr = { 1, 2 };
@ -927,14 +901,10 @@ namespace cxx17
const auto [ x3, y3 ] = f3(); const auto [ x3, y3 ] = f3();
} }
#endif // !defined(REALLY_CLANG)
#if !defined(REALLY_CLANG)
namespace test_exception_spec_type_system namespace test_exception_spec_type_system
{ {
// TODO: test it with clang++ from git
struct Good {}; struct Good {};
struct Bad {}; struct Bad {};
@ -952,7 +922,6 @@ namespace cxx17
static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
} }
#endif // !defined(REALLY_CLANG)
namespace test_inline_variables namespace test_inline_variables
{ {
@ -977,6 +946,6 @@ namespace cxx17
} // namespace cxx17 } // namespace cxx17
#endif // __cplusplus <= 201402L #endif // __cplusplus < 201703L
]]) ]])

View File

@ -1,35 +1,74 @@
dnl @synopsis AX_FUNC_WHICH_GETHOSTBYNAME_R # ==================================================================================
dnl # https://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html
dnl Determines which historical variant of the gethostbyname_r() call # ==================================================================================
dnl (taking three, five, or six arguments) is available on the system #
dnl and defines one of the following macros accordingly: # SYNOPSIS
dnl #
dnl HAVE_FUNC_GETHOSTBYNAME_R_6 # AX_FUNC_WHICH_GETHOSTBYNAME_R
dnl HAVE_FUNC_GETHOSTBYNAME_R_5 #
dnl HAVE_FUNC_GETHOSTBYNAME_R_3 # DESCRIPTION
dnl #
dnl If used in conjunction with gethostname.c, the API demonstrated in # Determines which historical variant of the gethostbyname_r() call
dnl test.c can be used regardless of which gethostbyname_r() is # (taking three, five, or six arguments) is available on the system and
dnl available. These example files can be found at # defines one of the following macros accordingly:
dnl http://www.csn.ul.ie/~caolan/publink/gethostbyname_r #
dnl # HAVE_FUNC_GETHOSTBYNAME_R_6
dnl based on David Arnold's autoconf suggestion in the threads faq # HAVE_FUNC_GETHOSTBYNAME_R_5
dnl # HAVE_FUNC_GETHOSTBYNAME_R_3
dnl Originally named "AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R". Rewritten #
dnl for Autoconf 2.5x by Daniel Richard G. # as well as
dnl #
dnl @category InstalledPackages # HAVE_GETHOSTBYNAME_R
dnl @author Caolan McNamara <caolan@skynet.ie> #
dnl @author Daniel Richard G. <skunk@iskunk.org> # If used in conjunction with gethostname.c, the API demonstrated in
dnl @version 2005-01-21 # test.c can be used regardless of which gethostbyname_r() is available.
dnl @license GPLWithACException # These example files can be found at
# http://www.csn.ul.ie/~caolan/publink/gethostbyname_r
#
# based on David Arnold's autoconf suggestion in the threads faq
#
# Originally named "AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R". Rewritten for
# Autoconf 2.5x, and updated for 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Caolan McNamara <caolan@skynet.ie>
# Copyright (c) 2008 Daniel Richard G. <skunk@iskunk.org>
#
# 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
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 8
AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [ AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [
AC_LANG_PUSH(C) AC_LANG_PUSH([C])
AC_MSG_CHECKING([how many arguments gethostbyname_r() takes]) AC_MSG_CHECKING([how many arguments gethostbyname_r() takes])
AC_CACHE_VAL(ac_cv_func_which_gethostbyname_r, [ AC_CACHE_VAL([ac_cv_func_which_gethostbyname_r], [
################################################################ ################################################################
@ -44,16 +83,12 @@ ac_cv_func_which_gethostbyname_r=unknown
# netdb.h is not declaring the function, and the compiler is thereby # netdb.h is not declaring the function, and the compiler is thereby
# assuming an implicit prototype. In which case, we're out of luck. # assuming an implicit prototype. In which case, we're out of luck.
# #
AC_COMPILE_IFELSE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
[AC_LANG_PROGRAM( [
[[#include <netdb.h>]],
[[
char *name = "www.gnu.org"; char *name = "www.gnu.org";
(void)gethostbyname_r(name) /* ; */ (void)gethostbyname_r(name) /* ; */
]] ])],
)], [ac_cv_func_which_gethostbyname_r=no])
ac_cv_func_which_gethostbyname_r=no
)
# #
# SIX ARGUMENTS # SIX ARGUMENTS
@ -62,20 +97,16 @@ AC_COMPILE_IFELSE(
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
AC_COMPILE_IFELSE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
[AC_LANG_PROGRAM( [
[[#include <netdb.h>]],
[[
char *name = "www.gnu.org"; char *name = "www.gnu.org";
struct hostent ret, *retp; struct hostent ret, *retp;
char buf@<:@1024@:>@; char buf@<:@1024@:>@;
int buflen = 1024; int buflen = 1024;
int my_h_errno; int my_h_errno;
(void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */ (void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */
]] ])],
)], [ac_cv_func_which_gethostbyname_r=six])
ac_cv_func_which_gethostbyname_r=six
)
fi fi
@ -86,20 +117,16 @@ fi
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
AC_COMPILE_IFELSE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
[AC_LANG_PROGRAM( [
[[#include <netdb.h>]],
[[
char *name = "www.gnu.org"; char *name = "www.gnu.org";
struct hostent ret; struct hostent ret;
char buf@<:@1024@:>@; char buf@<:@1024@:>@;
int buflen = 1024; int buflen = 1024;
int my_h_errno; int my_h_errno;
(void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */ (void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */
]] ])],
)], [ac_cv_func_which_gethostbyname_r=five])
ac_cv_func_which_gethostbyname_r=five
)
fi fi
@ -110,18 +137,14 @@ fi
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
AC_COMPILE_IFELSE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
[AC_LANG_PROGRAM( [
[[#include <netdb.h>]],
[[
char *name = "www.gnu.org"; char *name = "www.gnu.org";
struct hostent ret; struct hostent ret;
struct hostent_data data; struct hostent_data data;
(void)gethostbyname_r(name, &ret, &data) /* ; */ (void)gethostbyname_r(name, &ret, &data) /* ; */
]] ])],
)], [ac_cv_func_which_gethostbyname_r=three])
ac_cv_func_which_gethostbyname_r=three
)
fi fi
@ -129,20 +152,30 @@ fi
]) dnl end AC_CACHE_VAL ]) dnl end AC_CACHE_VAL
case "$ac_cv_func_which_gethostbyname_r" in
three|five|six)
AC_DEFINE([HAVE_GETHOSTBYNAME_R], [1],
[Define to 1 if you have some form of gethostbyname_r().])
;;
esac
case "$ac_cv_func_which_gethostbyname_r" in case "$ac_cv_func_which_gethostbyname_r" in
three) three)
AC_MSG_RESULT([three]) AC_MSG_RESULT([three])
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_3) AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_3], [1],
[Define to 1 if you have the three-argument form of gethostbyname_r().])
;; ;;
five) five)
AC_MSG_RESULT([five]) AC_MSG_RESULT([five])
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_5) AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_5], [1],
[Define to 1 if you have the five-argument form of gethostbyname_r().])
;; ;;
six) six)
AC_MSG_RESULT([six]) AC_MSG_RESULT([six])
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_6) AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_6], [1],
[Define to 1 if you have the six-argument form of gethostbyname_r().])
;; ;;
no) no)
@ -158,6 +191,6 @@ case "$ac_cv_func_which_gethostbyname_r" in
;; ;;
esac esac
AC_LANG_POP(C) AC_LANG_POP
]) dnl end AC_DEFUN ]) dnl end AC_DEFUN

789
config.guess vendored

File diff suppressed because it is too large Load Diff

2761
config.sub vendored

File diff suppressed because it is too large Load Diff

1657
configure vendored

File diff suppressed because it is too large Load Diff