On 21.12.2012 20:41, Daniel Shahaf wrote:
> Branko Čibej wrote on Fri, Dec 21, 2012 at 19:40:03 +0100:
>> On 21.12.2012 19:17, Philip Martin wrote:
>>> Branko Čibej <brane_at_wandisco.com> writes:
>>>> On 21.12.2012 18:30, Philip Martin wrote:
>>>>> Branko Čibej <brane_at_wandisco.com> writes:
>>>>>> Does "make EXTRA_CFLAGS=..." not give you exactly that?
>>>>> I want to set the flags at configure.
>>>> Sure, I understand that. But in order to do that, we'd have to introduce
>>>> another variable besides C(XX)FLAGS, because those override whatever
>>>> AC_PROG_CC would attempt to set, and always get used for bindings.
>>>> Internally, configure already uses C(XX)USERFLAGS that could be
>>>> repurposed for that kind of use, or even C(XX)MAINTAINERFLAGS, which
>>>> have the right properties in that they're not used to compile swig
>>>> wrappers and such.
>>>> Would that satisfy your requirements?
>>> I suppose I want to be able to specify an initial value for
>>> configure CMAINTAINERFLAGS=--something-special
>>> Then our code builds with --something-special, in addition to whatever
>>> configure chooses to add, while the generated code builds without my
>>> extra flag.
>>> I wouldn't hold up your branch for this, trunk doesn't support it
>> Sure. But this exact use is amazingly easy to support, given the
>> infrastructure already present on the branch. So I'll just make it work,
>> even without --maintainer-mode.
> Can someone spell out the conclusion please? How do I add something to
> CFLAGS at configure time --- by setting CMAINTAINERFLAGS? What if I set
> CFLAGS, would that append or replace to whatever configure things the
> flags should be?
It's all explained in the BRANCH-README, and here's how it works:
* The effect of ./configure C(XX)FLAGS=... did not change and is the
same as with any normal autoconf-driven build: explicit C(XX)FLAGS
override whatever default autoconf would set in AC_PROG_CC(XX)
(usually -g -O2) and these flags are used throughout the build.
* Our configury additionally tries to find the proper flags that put
the compiler into C90 and C++98 mode, and stores them in
C(XX)MODEFLAGS. These flags are used to build all Subversion
sources, but not, e.g., Swig-generated sources.
* If you run ./configure C(XX)USERFLAGS=..., these flags are
internally stored in C(XX)MAINTAINERFLAGS and are always used with
Subversion sources, but not with, e.g., Swig-generated sources.
* Maintainer-mode warnings etc. are prepended to C(XX)MAINTAINERFLAGS.
Additionally, the option --enable-optimize can be used to turn on our
default optimizations, which override autoconf's default -O2.
Furthermore, --enable-optimize works in conjunction with --enable-debug,
yielding -O1 -g3 (if, of course, the compiler supports these flags).
Eventually I'll make it so that CMODEFLAGS and CMAINTAINERFLAGS are not
used when compiling the amalgamated SQLite sources and any other
similarly incorporated 3rd-party sources. But to get there, I'll have to
change gen-make.py and friends.
Director of Subversion | WANdisco | www.wandisco.com
Received on 2012-12-21 23:06:00 CET