[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Handling of Makefile variables
From: |
LCID Fire |
Subject: |
Re: Handling of Makefile variables |
Date: |
Wed, 05 Nov 2008 10:36:30 +0100 |
User-agent: |
Thunderbird 2.0.0.17 (X11/20080925) |
Ralf Wildenhues wrote:
> * Bob Friesenhahn wrote on Wed, Nov 05, 2008 at 01:13:05AM CET:
>> On Tue, 4 Nov 2008, LCID Fire wrote:
>>
>>>> Correct. To set variables globally, AC_SUBST them from configure.ac.
>>> The thing I tried to achieve is to collect all the sourcefiles through
>>> the SUBDIRS structure downwards and then in some subdirectory build the
>>> SOURCES variable - and using AC_SUBST it complains that subst is not
>>> allowed to be used in SOURCES. What's the "correct" way to do this?
>
> Put
> AC_SUBST([variable], [value])
>
> or
> variable=value
> AC_SUBST([variable])
>
> in configure.ac. Enjoy using $(variable) in all Makefile.am files.
To be more clear:
I have a root directory with a Makefile.am recursing by:
SUBDIRS = . ui
The corresponding configure.ac contains:
AC_SUBST(CORE_SRC, test_call.c test4u.c blubz.c)
----------------------------------------
In the "ui" directory there is also a Makefile.am containing solely:
CORE_SRC += ui.c uie.c
SUBDIRS = sdl gtk
----------------------------------------
And finally in the "gtk" subdirectory there again is a Makefile.am:
bin_PROGRAMS = gtkapp
gtkapp_SOURCES = gtk_app.c gtk_interface.c $(CORE_SRC)
----------------------------------------
Having it this way it complains:
configure.in:28: `CORE_SRC' includes configure substitution address@hidden@'
configure.in:28: and is referred to from `gtkapp_SOURCES';
configure.in:28: configure substitutions are not allowed in _SOURCES
variables
Before someone asks why I'm not doing this "pragmatically" (AKA ugly) -
using the CORE_SRC variable this way would be the most elegant solution
because every layer just has to handle it's own mess.
But it seems like for some arbitrary reason autotools does not support
this, does it!?