[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make distcheck and the /etc dir
From: |
Daniel Leidert |
Subject: |
Re: make distcheck and the /etc dir |
Date: |
Tue, 05 Jun 2007 12:20:30 +0200 |
Am Montag, den 04.06.2007, 22:15 +0100 schrieb Noah Slater:
> > Sounds like my best solution would be to use the "sysconf_DATA" option.
> > Any ideas how to take 'sysconfdir' and somehow import it into my program
> > so it knows where the default configuration files are?
>
> Well, I use Python and I have a file called 'lib/foo/__init__.py.in'
> that is has the following lines:
[snip]
> Now, when ./configure is run this file is generated and placed at
> 'lib/foo/__init__.py' and hence is available to me a run-time with all
> the user configured paths.
>
> If you are using C I believe the recommended way is to use a header
> file with a bunch of defines that gets customised at ./configure time.
Well, that has some limitations. It's possible, that you need to
evaluate a variable with eval more than just once (e.g. $datadir needs
at least two eval calls). People often use a loop to do this. IMHO it's
easier to use DEFS instead here:
DEFS += -DSYSCONFDIR=\"$(sysconfdir)\" -DPKGDATADIR=\"$(pkgdatadir)\"
and don't use config.h for this.
Regards, Daniel