[LLVMdev] Configuration Values

Alkis Evlogimenos alkis at cs.uiuc.edu
Fri Aug 20 00:39:30 PDT 2004


On Thu, 2004-08-19 at 21:37, Reid Spencer wrote:
> I'm soliciting an opinion on configuration data ..
> 
> In writing llvmc, I need to hard code the installation path of LLVM so
> that llvmc just knows where to look for the configuration data. This is
> a last resort after command line options, env vars, and "standard"
> places. 
> 
> So, somehow I need to get the value of the autoconf variable
> @sysconfdir@ into my program. There's a few ways to do this and since
> we're likely to eventually run into this again I'm trying to figure out
> what's best for LLVM:
> 
> 0. Pass -DCONFIG_SYSCONFDIR=$(sysconfdir) on the command line.
> 
> 1. Create include/Config/Values.h.in with something like:
> #define CONFIG_SYSCONFDIR "@sysconfdir@"
> 
> 2. Create lib/Support/ConfigValues.cpp.in with something like:
> namespace llvm {
>   const char Config_SysConfDir[] = "@sysconfdir@";
> }
> 
> 3 Create lib/Config/Values.cpp with same content as 2 (this done
>    so that libConfig is separate and only linked when needed.

You mean lib/Config/Values.cpp.in, right?

> 4. Do 3 but put the Values.cpp file in tools/llvmc so it is peculiar
>     to llvmc
> 
> Which way?

I would go with 3. 1 will cause recompiles and 2 will cause a lot of
relinks every time we run configure.

-- 

Alkis




More information about the llvm-dev mailing list