On 03/25/2010 11:47 AM, ant1scene wrote: > Hello. > > I need lookup config's path in application. > Tried as is: > > --configure.in (fragment) > AC_DEFINE_UNQUOTED(PREFIX, $prefix, [Install prefix]) > AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${sysconfdir}/foo.conf", > [Location of the config file]) > -- > but, after running 'configure' I'm getting such config.h: > #define SERVER_CONFIG_FILE "${prefix}/etc/foo.conf" > #define PREFIX /usr > > what to do to retrieve ${prefix} in SERVER_CONFIG_FILE? Here's what the manuals have to say about it: http://www.gnu.org/software/autoconf/manual/autoconf.html#Installation-Directory-Variables Here's how gnulib does it: http://git.savannah.gnu.org/cgit/gnulib.git/tree/modules/configmake In short, _don't_ use AC_DEFINE_UNQUOTED. Doing it a configure time is too early, and does not have enough levels of expansion. Instead, use AC_SUBST, and modify your Makefile.{am,in} (depending on whether you use automake) to do the substitution at make time. -- Eric Blake eblake@xxxxxxxxxx +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf