autoconf
[Top][All Lists]
Advanced

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

How to correctly generate 'foobar.h' from 'foobar.h.in'


From: Tao Wang
Subject: How to correctly generate 'foobar.h' from 'foobar.h.in'
Date: Wed, 4 Aug 2010 15:36:34 +1000

Hi,

I'm new to autotools, I want to generate 'foobar.h' from 'configure'.

I created 'src/foobar.h.in' with following content:

=========
#define PATH_PREFIX    "@prefix@"
#define PATH_DATADIR    "@datadir@"
=========

And put 'src/foobar.h' in AC_CONFIG_FILES() in 'configure.ac'.

After I run 'autoreconf', the 'src/foobar.h' is generated, however, I got 2
problem for it.

First, the generated content is:
=========
#define PATH_PREFIX    "/home/tao/unstable/stardict"
#define PATH_DATADIR    "${prefix}/share"
=========

"${prefix}" is definitely not working as a C/C++ header. How can I replace
the ${prefix} with the real value?

Second, everytime I modified the file 'src/foobar.h.in', and run 'make all',
it cannot regenerate 'src/foobar.h'. Is there anything wrong? Why make
doesn't know the dependency?

Thanks.

-- 
Regards

Tao Wang


reply via email to

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