[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Requiring C++11 in configure.ac
From: |
Rik |
Subject: |
Re: Requiring C++11 in configure.ac |
Date: |
Tue, 20 Jun 2017 18:10:48 -0700 |
On 06/20/2017 05:25 PM, Mike Miller wrote:
> On Tue, Jun 20, 2017 at 16:18:48 -0700, Mike Miller wrote:
>> The Autoconf manual explicitly documents the variables
>> ac_cv_prog_cxx_stdcxx and ac_cv_prog_cxx_cxx11, so I think it's safe to
>> depend on them.
> I'm testing the following change with gcc 6.3, 4.8, and 4.6. It should
> fail with 4.6 or older.
>
>
> diff --git a/configure.ac b/configure.ac
> --- a/configure.ac
> +++ b/configure.ac
> @@ -398,6 +398,12 @@ AC_PROG_CC
> AC_PROG_CPP
> AC_PROG_GCC_TRADITIONAL
>
> +## Ensure that the C++ compiler fully supports C++11.
> +
> +if test x"$ac_cv_prog_cxx_cxx11" = xno; then
> + AC_MSG_ERROR([a compiler that fully supports C++11 is required to build
> Octave])
> +fi
> +
> ## Save and restore CFLAGS and CXXFLAGS globally. These variables
> ## are for users, so we shouldn't be touching them. Instead, we should
> ## set the corresponding AM_ flags (currently by way of the XTRA_ variables).
>
>
Since ac_cv_prog_cxx_cxx11 will be unconditionally you won't need the
x"..." syntax.
For example, this snippet from configure.ac:
if test $ac_cv_f77_compiler_gnu = yes; then
--Rik