[LLVMdev] Configuration Values

Reid Spencer reid at x10sys.com
Thu Aug 19 19:37:35 PDT 2004


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.

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

Which way?

Reid.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040819/98f56069/attachment.sig>


More information about the llvm-dev mailing list