[LLVMdev] llvm autoconf using LLVM_SRC_ROOT?

John Criswell criswell at uiuc.edu
Sat Nov 6 10:02:24 PDT 2010


  On 11/5/2010 3:52 PM, Eric Christopher wrote:
>
> On Nov 4, 2010, at 7:35 PM, Shaun savage wrote:
>
>> I am trying to create a new LLVM project that uses autoconf to 
>> configure it.
>>
>> the example requires me to define
>>
>> • LLVM_SRC_ROOT - The root of the LLVM source tree.
>> • LLVM_OBJ_ROOT - The root of the LLVM object tree
>> Is this required?  Why?  I just want to use the libraries that were 
>> installed using Ubuntu 10.04.
>
> Not unless you want to build it as part of the llvm sources.

This answer is sort of correct, so I'll elaborate.

The LLVM build system allows for external LLVM projects to re-use its 
Makefile infrastructure.  In short, it allows external projects (which 
are not part of the LLVM source tree) to build off of the LLVM build 
system; this allows external projects to write LLVM-style Makefiles that 
just specify the library or tool name to build, and the LLVM build 
system takes care of the rest (like linking in LLVM libraries, using 
pre-defined rules for compiling C++ code to object files, finding LLVM 
header files, etc).  This whole system is documented at 
http://llvm.org/docs/Projects.html.

If you've installed LLVM headers and libraries somewhere (such as in 
/usr/local/include and /usr/local/lib) and don't wish to reuse the LLVM 
build system, then you obviously don't need to worry about writing your 
autoconf scripts and Makefiles the LLVM way.  Instead, you would just 
use AC_CHECK_LIB to locate the LLVM libraries you need, as Eric has 
described.

-- John T.


>
> AC_CHECK_LIB is what you probably want.
>
> http://www.gnu.org/software/hello/manual/autoconf/Libraries.html
>
> -eric

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101106/949292e2/attachment.html>


More information about the llvm-dev mailing list