Options included in CC/CXX vs. in gb_CFLAGS/gb_CXXFLAGS

Michael Stahl mstahl at redhat.com
Thu Sep 20 04:49:00 PDT 2012


On 20/09/12 09:08, Stephan Bergmann wrote:
> On 09/20/2012 08:48 AM, Tor Lillqvist wrote:
>> I think there is some fuzziness about what compiler options should be
>> part of the CC/CXX variables and what should be in
>> gb_CFLAGS/gb_CXXFLAGS.
>>
>> In some cases, like my Mac build tree that uses the 10.4 SDK, from
>> Xcode 3 installed in /Xcode3, gb_CXXFLAGS contains at least one flag
>> that apparently *must* be used for also external projects (well,
>> liborcus in particular) to compile successfully.  This is the
>> -isysroot from solenv/gbuild/platform/macosx.mk.
> [...]
>>
>> In other cases ("normal" Linuxes?) gb_CXXFLAGS contains just optional
>> flags that will in fact hurt an external project that isn't prepared
>> for them, like -Werror.

agree, there is some distinction to be made between "mandatory" flags
that must be used for everything like sysroot and flags that are just
intended for LO code.

>> Should the -isysroot flag actually be part ot CC/CXX, not gb_CXXFLAGS?
>> Should configure.in and macosx.mk be modified thusly?
> 
> I think there has traditionally not been much consistency in this area 
> in OOo.  Originally, I think this was exclusively handled via "flags 
> variables" (and re-crafting similar such variables for passing to 
> external projects, with values more or less similar to the primary OOo 
> variables).  Much cruft here also stems from the fact that Sun's 
> internal OOo build environment required lots of overrides (as builds on 
> arbitrary machines used a centralized toolchain instead of a local one), 
> and this was typically achieved with ad-hoc fixes instead of a truly 
> principled approach.
> 
> That said, your rule of when to put something into CC/CXX vs. 
> gb_CXXFLAGS etc. sounds good to me.

i didn't quite get what tml's rule is exactly :)

but anyway there are basically 2 options for getting "mandatory" flags
like -isysroot used everywhere: either include them in CC/CXX, or manage
some additional gb_MANDATORY_CFLAGS or whatever that are passed as
CFLAGS="$(gb_MANDATORY_CFLAGS) $(CFLAGS)" to all invoked external
configure etc. scripts or makefiles.  i think the CC/CXX apporach is
harder to get wrong.

btw, why doesn't macosx.mk use --sysroot, which is much better than
-isysroot because it mangles the library search path as well?  is the
gcc too old for it?



More information about the LibreOffice mailing list