> -----Original Message-----
> From: Andreas Schwab <sch...@suse.de>
> Sent: Tuesday, July 8, 2025 03:16
> To: Robert Dubner <rdub...@symas.com>
> Cc: Rainer Orth <r...@cebitec.uni-bielefeld.de>; gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] cobol: Implement CXXFLAGS_FOR_COBOL.
> 
> On Jul 07 2025, Robert Dubner wrote:
> 
> > Furthermore, even if this method did work, I need the
CXXFLAGS_FOR_COBOL
> > options to appear at the end of the list, not the beginning, since
they
> > may need to override what came before.
> 
> Why can't you use CXXFLAGS?

Because CXXFLAGS applies to everything.

Not long ago, we added code using std::size() to one of the gcc/cobol
files.  Jim and I both use GCC-11, which in its default configuration
provides C++17 features. But somebody compiling using GCC-9 reported that
it led to a failure.

So, in an attempt to find such things before committing them to
gcc/master, in my development environment I tried

        CXXFLAGS="-std-c++14" ../configure ...

That leads to a build failure of libcody, with the message to the effect
of "libcody requires C++11".

I have been unable to find any method of doing a complete build while
setting compilation options that apply only to the gcc/cobol files. So, I
did the investigation, and created the patch.

It operates as do some other flags, including CXXFLAGS:

        CXXFLAGS_FOR_COBOL=xxx ..configure ...

results in gcc/Makefile and gcc/cobol/Makefile that uses xxx for files in
gcc/cobol, and for no other source code trees, in all subsequent builds
unless overridden with

        make CXXFLAGS_FOR_COBOL=yyy

That's what we want.  I have found no other way of doing it.    

> 
> --
> Andreas Schwab, SUSE Labs, sch...@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."

Reply via email to