[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Order of AM_CPPFLAGS and other xxx_CFLAGS
From: |
Rik |
Subject: |
Re: Order of AM_CPPFLAGS and other xxx_CFLAGS |
Date: |
Sun, 17 Nov 2013 11:47:36 -0800 |
On 11/17/2013 09:45 AM, John W. Eaton wrote:
> On 11/17/2013 12:14 PM, Rik wrote:
>> On 11/14/2013 07:57 PM, Michael Goffioul wrote:
>>> Rik,
>>>
>>> This changeset breaks my compilation with MSVC:
>>>
>>> http://hg.savannah.gnu.org/hgweb/octave/rev/a230b996ae8a
>>>
>>> The problem is that compilation of (among others) __init_fltk__.cc uses
>>> now the following CPPFLAGS definition:
>>>
>>> $(GRAPHICS_CFLAGS) $(FT2_CPPFLAGS) $(FONTCONFIG_CPPFLAGS) $(AM_CPPFLAGS)
>>>
>>> The variable GRAPHICS_CFLAGS, pulled from fltk-config, contains a -Ixxx
>>> statement containing the base installation directory of my MXE system.
>>> The libgnu directory, on the other hand, is part of AM_CPPFLAGS. As a
>>> result, gnulib header substitution fails for some headers. A similar
>>> problem could also occur on Linux if any of the variables preceding
>>> AM_CPPFLAGS happen to contain -I/usr/include. I believe the libgnu
>>> directory should appear early in the include chain, otherwise it'll fail
>>> to override what it's supposed to override.
>>>
>> Ugh. This doesn't look like it is going to be fun to solve.
>
> fltk-config does this:
>
> if test "$includedir" != /usr/include; then
> includes=-I$includedir
> else
> includes=
> fi
>
> That seems wrong to me becuase it assumes that the only system include
> directory is always "/usr". Instead, I think it should not print
> fltk include directory if it is already searched by the compiler.
>
> Do any other config scripts do this sort of thing, or is it just
> fltk-config?
>
> If it is just fltk-config, then maybe it would be easier if we made
> mxe-octave patch fltk-config to not do this. Would that fix the
> problem?
>
> jwe
>
>
I think it is kind of dopey too, but it is more than just fltk-config.
Packages relying on pkg-config also express some of the same behavior,
depending in turn on how their .pc files are set up. So for
__init_fltk__.cc it is not only fltk, but also the FT2_CFLAGS variable that
has the unwanted include directory.
.../mxe-octave/usr/bin/pkg-config --cflags freetype2
-I/home/rik/wip/Projects_Mine/mxe-octave/usr/i686-pc-mingw32/include/freetype2
-I/home/rik/wip/Projects_Mine/mxe-octave/usr/i686-pc-mingw32/include
So, maybe option 3 using a sed command to strip out the unwanted directory
from botd FT2_CFLAGS and GRAPHICS_CFLAGS would work.
--Rik