octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XTRA_CFLAGS


From: Rik
Subject: Re: XTRA_CFLAGS
Date: Sun, 7 Feb 2016 07:09:17 -0800

On 02/06/2016 11:25 PM, address@hidden wrote:
Subject:
having trouble with XTRA_CFLAGS showing up on AM_CXXFLAGS
From:
Carnë Draug <address@hidden>
Date:
02/06/2016 07:42 PM
To:
octave maintainers mailing list <address@hidden>
List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
quoted-printable
Precedence:
list
MIME-Version:
1.0
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=UTF-8
Message:
5

Hi

I've been playing around with our configure and I'm having a problem
that maybe someone can help me with.

I'm adding a flag to XTRA_CFLAGS in our configure script and it seems to
somehow be creeping into AM_CXXFLAGS.  The weird thing is that looking into
the generate Makefiled, it is not there.  However, when I run "make -n", I
see it showing up in AM_CXXFLAGS.

Here's what I've been doing.  I've been adding the following lines to
configure.ac:

    XTRA_CFLAGS="$XTRA_CFLAGS -std=c11"
    XTRA_CXXFLAGS="$XTRA_CXXFLAGS -std=c++11"
    CFLAGS="$CFLAGS -std=c11"
    CXXFLAGS="$CXXFLAGS -std=c++11"

After running configure, everything looks fine, the displayed resume
looks correct.  However, once the build actually starts I get warnings
like:

      GEN      libinterp/octave-value/ov-flt-re-mat.df
    cc1plus: warning: command line option ‘-std=c11’ is valid for
C/ObjC but not for C++

And indeed, running "make -n", I get g++ being called with -std=c11.  For
example, the recipe for octave-value/ov-flt-re-mat.df

    g++ -E -DHAVE_CONFIG_H -I. -I/home/carandraug/dev/octave  \
      -I. [....] \
      -std=c11 -pthread -fopenmp [...] \
      [...]
    mv libinterp/octave-value/ov-flt-re-mat.df-t
libinterp/octave-value/ov-flt-re-mat.df

Anyone can explain me what I'm doing wrong?

There is one other set of flags, CPPFLAGS, used by the C pre-processor.  It may be sneaking in there.

The rule in question is from libinterp/module.mk:

## Rule to build a DEF file from a .cc file
## See also module.mk files for overrides when speciall CPPFLAGS are needed.
## FIXME: Shouldn't the build stop if CPP fails here?  Yes (10/31/2013)
%.df: %.cc $(GENERATED_MAKE_BUILTINS_INCS)
    $(AM_V_GEN)rm -f address@hidden address@hidden $@ && \
    $(CXXCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
      $(libinterp_liboctinterp_la_CPPFLAGS) $(LLVM_CPPFLAGS) $(CPPFLAGS) \
      $(libinterp_liboctinterp_la_CXXFLAGS) $(CXXFLAGS) \
      -DMAKE_BUILTINS $< > address@hidden && \
    $(srcdir)/libinterp/mkdefs $(srcdir)/libinterp $< < address@hidden > address@hidden && \
    rm -f address@hidden && \
    mv address@hidden $@

As you can see, it runs the C++ pre-processor (g++ -E), to just process macros and includes.

I would check your Makefile to see what some of those variables in the rule expand out to.  Use grep '^CPPFLAGS', grep '^CXXFLAGS', etc.

--Rik

reply via email to

[Prev in Thread] Current Thread [Next in Thread]