mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-18 12:24:38 +08:00
f74dc26792
This patch proposes to require a C++17 compiler to build gdb / gdbsupport / gdbserver. Before this patch, GDB required a C++11 compiler. The general policy regarding bumping C++ language requirement in GDB (as stated in [1]) is: Our general policy is to wait until the oldest compiler that supports C++NN is at least 3 years old. Rationale: We want to ensure reasonably widespread compiler availability, to lower barrier of entry to GDB contributions, and to make it easy for users to easily build new GDB on currently supported stable distributions themselves. 3 years should be sufficient for latest stable releases of distributions to include a compiler for the standard, and/or for new compilers to appear as easily installable optional packages. Requiring everyone to build a compiler first before building GDB, which would happen if we required a too-new compiler, would cause too much inconvenience. See the policy proposal and discussion [here](https://sourceware.org/ml/gdb-patches/2016-10/msg00616.html). The first GCC release which with full C++17 support is GCC-9[2], released in 2019[3], which is over 4 years ago. Clang has had C++17 support since Clang-5[4] released in 2018[5]. A discussions with many distros showed that a C++17-able compiler is always available, meaning that this no hard requirement preventing us to require it going forward. [1] https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#When_is_GDB_going_to_start_requiring_C.2B-.2B-NN_.3F [2] https://gcc.gnu.org/projects/cxx-status.html#cxx17 [3] https://gcc.gnu.org/gcc-9/ [4] https://clang.llvm.org/cxx_status.html [5] https://releases.llvm.org/ Change-Id: Id596f5db17ea346e8a978668825787b3a9a443fd Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-By: Tom Tromey <tom@tromey.com> Approved-By: Pedro Alves <pedro@palves.net>
88 lines
2.4 KiB
Plaintext
88 lines
2.4 KiB
Plaintext
dnl Autoconf configure script for GDB support library
|
|
dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
|
|
dnl
|
|
dnl This program is free software; you can redistribute it and/or modify
|
|
dnl it under the terms of the GNU General Public License as published by
|
|
dnl the Free Software Foundation; either version 3 of the License, or
|
|
dnl (at your option) any later version.
|
|
dnl
|
|
dnl This program is distributed in the hope that it will be useful,
|
|
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
dnl GNU General Public License for more details.
|
|
dnl
|
|
dnl You should have received a copy of the GNU General Public License
|
|
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
AC_INIT([gdbsupport], 1.0)
|
|
AC_CONFIG_SRCDIR(common-defs.h)
|
|
AC_CONFIG_HEADER(config.h:config.in)
|
|
|
|
# Set build, build_cpu, build_vendor and build_os.
|
|
AC_CANONICAL_BUILD
|
|
|
|
# Set host, host_cpu, host_vendor, and host_os.
|
|
AC_CANONICAL_HOST
|
|
|
|
# Set target, target_cpu, target_vendor, and target_os.
|
|
AC_CANONICAL_TARGET
|
|
|
|
AM_MAINTAINER_MODE
|
|
AC_CONFIG_AUX_DIR(..)
|
|
AM_INIT_AUTOMAKE
|
|
AM_SILENT_RULES([yes])
|
|
|
|
AC_PROG_CC
|
|
AC_PROG_CXX
|
|
AC_PROG_RANLIB
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
ACX_LARGEFILE
|
|
|
|
# We require a C++17 compiler. Check if one is available, and if
|
|
# necessary, set CXX_DIALECT to some -std=xxx switch.
|
|
AX_CXX_COMPILE_STDCXX(17, , mandatory)
|
|
|
|
dnl Set up for gettext.
|
|
ZW_GNU_GETTEXT_SISTER_DIR
|
|
|
|
libiberty_INIT
|
|
GDB_AC_COMMON
|
|
GDB_AC_SELFTEST
|
|
AM_CONDITIONAL(SELFTEST, $enable_unittests)
|
|
|
|
AM_CONDITIONAL(HAVE_PIPE_OR_PIPE2,
|
|
[test x$ac_cv_func_pipe = xyes -o x$ac_cv_func_pipe2 = xyes ])
|
|
|
|
# Check the return and argument types of ptrace.
|
|
GDB_AC_PTRACE
|
|
|
|
# Detect support warning flags.
|
|
AM_GDB_COMPILER_TYPE
|
|
AM_GDB_WARNINGS
|
|
|
|
# Set the 'development' global.
|
|
. $srcdir/../bfd/development.sh
|
|
|
|
if test "$development" = true ; then
|
|
AC_DEFINE(DEVELOPMENT, 1,
|
|
[Define if development-mode features are enabled.])
|
|
fi
|
|
|
|
case ${host} in
|
|
*mingw32*)
|
|
AC_DEFINE(USE_WIN32API, 1,
|
|
[Define if we should use the Windows API, instead of the
|
|
POSIX API. On Windows, we use the Windows API when
|
|
building for MinGW, but the POSIX API when building
|
|
for Cygwin.])
|
|
;;
|
|
esac
|
|
|
|
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(srcdir)/../bfd/development.sh'])
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
AC_OUTPUT
|