[LLVMdev] RFC: Timeline for deprecating the autoconf build system?

Dan Liew dan at su-root.co.uk
Tue Nov 4 13:17:16 PST 2014


On 4 November 2014 19:08, Brooks Davis <brooks at freebsd.org> wrote:
> On Sun, Nov 02, 2014 at 04:48:58PM +0000, David Chisnall wrote:
>> On 2 Nov 2014, at 14:17, Joerg Sonnenberger <joerg at britannica.bec.de> wrote:
>>
>> > Requiring cmake for NetBSD is not acceptable as it is almost as heavy as
>> > a C++ compiler itself. That said, I don't really care about the
>> > Makefiles, just about configure and the associated loggic to craete
>> > Config.h and friends. I would expect FreeBSD to have similar concerns.
>>
>> For the FreeBSD base system, we use a bmake-based build system for
>> LLVM, but that is based on the Makefiles generated by CMake.  I
>> believe that we're now using CMake for the version of LLVM in ports.
>
> For most versions we're using autoconf because it lets us build clang
> against an installed LLVM.  The autoconf build system almost supports this
> (you need to symlink a couple installed files into the build tree), but
> AFACT the cmake build system doesn't.
>
> It would be really useful if I could build clang against an installed LLVM
> and LLDB against an install clang and LLVM.

CMake can support this. We need to make use of the "exporting targets" feature
that CMake offers so that clients can build against LLVM libraries.
LLVM has actually been exporting this information for a while and it
is documented here [1].

To further complicate matters the clang CMake build system supports
two modes. In tree build (i.e. inside tools/clang) and an out of tree
build. The problem IIRC with the out of tree build is that the CMake
clang build system does not try to use this information at all and
instead tries to get its information from the llvm-config executable
which doesn't feel very clean.  I should warn that I've never tried
the "out of tree" build of clang so I don't know how well it works.


[1] http://llvm.org/docs/CMake.html#embedding-llvm-in-your-project



More information about the llvm-dev mailing list