This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: Question about AC_CONFIG_FILES
- From: Ralf Corsepius <corsepiu at faw dot uni-ulm dot de>
- To: Patrick Guio <patrick dot guio at fys dot uio dot no>
- Cc: automake at gnu dot org
- Date: 09 Dec 2001 14:10:43 +0100
- Subject: Re: Question about AC_CONFIG_FILES
- References: <Pine.LNX.4.30.0112091211220.16694-100000@fyspc-rp18.uio.no>
Am Son, 2001-12-09 um 12.19 schrieb Patrick Guio:
> On 9 Dec 2001, Ralf Corsepius wrote:
>
> Thank you for your answer, I had also found out that I could use the shell
> syntax AC_CONFIG_FILES([class1.cpp:main.cpp.in])
> But the problem is now how to instantiate the variable class_name with
> different values. I tried
I missed this aspect of your question.
> AC_SUBST(class_name,"class1")
> AC_CONFIG_FILES([class1.cpp:main.cpp.in])
>
> AC_SUBST(class_name,"class2")
> AC_CONFIG_FILES([class2.cpp:main.cpp.in])
>
> Here both class2.cpp and class1.cpp will be instantiated with the same
> value "class2" (i.e. the last AC_SUBST for class_name in the
> configure.in file). Is there a way to solve this problem?
In this case AC_CONFIG_FILES probably will not help at all and you will
have to do it with normal make rules.
How about something like this:
Makefile.am-fragment:
..
xxx_SOURCES = class1.cpp class2.cpp
CLEANFILES = class1.cpp class2.cpp
class1.cpp: main.cpp.in
sed -e pattern1 < $(srcdir)/main.cpp.in > $@
class1.cpp: main.cpp.in
sed -e pattern2 < $(srcdir)/main.cpp.in > $@
You'd probably have to setup the sed patterns in your configure.ac,
then.
Ralf