Hi Robert,

> I have elsewhere described my frustration in trying, during development,
> to set more stringent error-finding and warning-generating compilation
> options.  But they seem to require the use of CXXFLAGS, which in at least
> the case of trying to set -std=c++14, causes libcody's compilation to
> fail, since it wants, specifically c++11.
>
> So, I dove in and figured out how to implement CXXFLAGS_FOR_COBOL.  This
> new flag applies only to compilations of c++ programs in the gcc/cobol
> source code tree.
>
> These changes were tested with a bootstrap build of
> --enable-languages=c,c++,fortran,cobol.
>
> Is this okay for trunk?

I think there's a far easier way which doesn't require any patch.  Have
a look at toplevel configure.ac:

# When bootstrapping with GCC, build stage 1 in C++14 mode to ensure that a
# C++14 compiler can still start the bootstrap.  Otherwise, if building GCC,
# require C++14 (or higher).
if test "$enable_bootstrap:$GXX" = "yes:yes"; then
  CXX="$CXX -std=c++14"
elif test "$have_compiler" = yes; then
  AX_CXX_COMPILE_STDCXX(14)

  if test "${build}" != "${host}"; then 
    AX_CXX_COMPILE_STDCXX(14, [], [], [_FOR_BUILD])
  fi
fi

You should be able to achieve what you want by building with CXX='g++
-std=c++14', just as one can build a 32-bit gcc with a 64-bit host
compiler using CXX='g++ -m32'.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to