help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Specifying sysconfdir file path in config.h with autoconf?


From: Ian Zimmerman
Subject: Re: Specifying sysconfdir file path in config.h with autoconf?
Date: 04 Oct 2005 03:38:36 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Petr> Hi I want to have a configuration file in the sysconfdir for my
Petr> program, but if I put AC_DEFINE_UNQUOTED(CONFFILE,
Petr> "$sysconfdir/file.conf"), I end up with the path being
Petr> "${prefix}/etc/file.conf" which is pretty meaningless to C.  I've
Petr> seen people hack it by just saying "$prefix/etc/file.conf" in the
Petr> configure.in, but this doesn't seem to be the right thing to do.
Petr> Should I do that, or is there a way to use the sysconfdir?

You could do it in the Makefile.in instead of configure.in:


%.o : %.c
        $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) 
-DCONFFILE=\\\"$(sysconfdir)/file.conf\\\" -c

or something like that (caution: I have not counted the backslashes, wink)

cus

-- 
"It's not true or not."  A reality show producer (real quote)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]