Unnecessary use of CPPFLAGS in libgui/Makefile.am

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Unnecessary use of CPPFLAGS in libgui/Makefile.am

siko1056
For my Octave builds I use customized CPPFLAGS like "-march=native -O3". Most of the GCC flags are not supported by MOC. This breaks my builds and makes using customized CPPFLAGS in general pointless, if they lead to a build error in libgui.

libgui/Makefile.am (Line 27):

MOC_OCTAVE_CPPFLAGS = $(filter-out -mieee, $(AM_CPPFLAGS) $(CPPFLAGS))

I assume the includes -I should be addressed with this line. Might there be a more elegant way to achieve this?

Regards,
Kai
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary use of CPPFLAGS in libgui/Makefile.am

Mike Miller
On Fri, Feb 13, 2015 at 01:59:37 -0800, siko1056 wrote:

> For my Octave builds I use customized CPPFLAGS like "-march=native -O3". Most
> of the GCC flags are not supported by MOC. This breaks my builds and makes
> using customized CPPFLAGS in general pointless, if they lead to a build
> error in libgui.
>
> libgui/Makefile.am (Line 27):
>
> MOC_OCTAVE_CPPFLAGS = $(filter-out -mieee, $(AM_CPPFLAGS) $(CPPFLAGS))
>
> I assume the includes -I should be addressed with this line. Might there be
> a more elegant way to achieve this?

Yes, don't put compiler flags into CPPFLAGS :) Neither "-march=native"
nor "-O3" are options understood by the preprocessor, which is what
CPPFLAGS is for.

That filter-out line is a workaround for a specific case in a gnulib
macro where a compiler flag is incorrectly put into CPPFLAGS.
Otherwise it would not be needed and moc would simply get
$(AM_CPPFLAGS) and $(CPPFLAGS).

--
mike

Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary use of CPPFLAGS in libgui/Makefile.am

Jordi Gutiérrez Hermoso-2
In reply to this post by siko1056
On Fri, 2015-02-13 at 01:59 -0800, siko1056 wrote:
> For my Octave builds I use customized CPPFLAGS like "-march=native -O3". Most
> of the GCC flags are not supported by MOC.

CPPFLAGS are for the C preprocessor. CXXFLAGS are for the C++
compiler.

- Jordi G. H.




Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary use of CPPFLAGS in libgui/Makefile.am

siko1056
In reply to this post by Mike Miller
Mike Miller wrote
Yes, don't put compiler flags into CPPFLAGS :) Neither "-march=native"
nor "-O3" are options understood by the preprocessor, which is what
CPPFLAGS is for.
Oh, my bad, but at least I don't seem to be the only one who got it wrong ^^ Thanks for your enlightenment.

Kai