[llvm-commits] [PATCH] Splitting PACKAGE_VERSION and friends out of config.h

Frits van Bommel fvbommel at gmail.com
Sat Nov 20 07:44:53 PST 2010


On Sat, Nov 20, 2010 at 4:31 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:
> Right. I was thinking on removing that feature altogether. It was
> implemented on LLVM because clang already had it, but has two serious
> drawbacks:
>
>  1. As you say, too often causes a massive recompilation.
>
>  2. It is unreliable, on the sense that the reported svn/git revision id
>    is not necessarily the current one on the working copy, as it is
>    only updated when cmake runs, and that doesn't happen unless some
>    CMakeLists.txt file changed (or you explicitly invoke cmake).
>
> So I'm inclined to removing the feature, or making it optional
> defaulting to OFF. In that case we could solve problem #2 by calculating
> the revision id at build time, instead of config time.

That's fine with me too. Just trying to cut down on redundant compilation here.

>> Most of those files didn't use those particular macros, and it turned
>> out the ones that did didn't use the rest of config.h other than
>> PACKAGE_NAME (which isn't used together with any other macros from
>> config.h either).
>>
>> So I created the attached patches which move those three macros
>> (PACKAGE_NAME, PACKAGE_STRING and PACKAGE_VERSION) to
>> llvm/Config/version.h instead
>
> IIRC it is an standard practice to put those macros in config.h.

That doesn't mean it's the right thing to do, just that it's a
standard mistake ;).

>> 2) Before this is committed the autoconf build should work too so I
>> also made some changes related to that. However I'm completely
>> unfamiliar with how autoconf works, so I'm less sure whether those are
>> correct. Could someone check those for me? (And if something's wrong
>> tell me how to fix it? :) )
>
> This is very important. I don't want to introduce unnecessary
> differences between config.h.in and config.h.cmake.

I was about to say "That'd be why I also moved them from config.h.in
to version.h.in", but then I noticed I didn't actually remove them
from config.h.in. I accidentally only *copied* them to version.h.in.
Oops. (updated patch attached, just for completeness)
Not that it'd make any difference since nothing that #includes
config.h uses them anymore with this patch...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: svnversion-llvm.patch
Type: text/x-patch
Size: 6788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101120/34319365/attachment.bin>


More information about the llvm-commits mailing list