automake
[Top][All Lists]
Advanced

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

Re: Question about AC_CONFIG_FILES


From: Ralf Corsepius
Subject: Re: Question about AC_CONFIG_FILES
Date: 09 Dec 2001 14:10:43 +0100

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





reply via email to

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