[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Define a complete rule via autoconf (quoting issue, AC_SUBST)
From: |
Daniel Leidert |
Subject: |
Re: Define a complete rule via autoconf (quoting issue, AC_SUBST) |
Date: |
Sat, 01 Nov 2008 23:21:11 +0100 |
Am Dienstag, den 28.10.2008, 07:50 +0100 schrieb Ralf Wildenhues:
> Hi Daniel,
>
> * Daniel Leidert wrote on Mon, Oct 27, 2008 at 11:04:34PM CET:
> >
> > I want to place a rule in several Makefiles. So I thought about putting
> >
> > @DESKTOP_DATA_RULE@
> >
> > into every Makefile.am and define the rule via configure.ac. However, I
> > can't get it to work.
>
> Should be possible with recent Autoconf. If you also use Automake,
> however, you need to get it to not add
> DESKTOP_DATA_RULE = @DESKTOP_DATA_RULE@
>
> into the Makefile.in. Currently, that is only possible through an
> undocumented Automake macro, _AM_SUBST_NOTMAKE([DESKTOP_DATA_RULE]).
> The intention is to fix that for the next Automake release.
>
> If you still have problems after this, please show what you tried,
> and what's output, and the error.
I get errors running ./configure. I guess, this is, because of a problem
with the quotation. Doing a simple:
AC_SUBST([DESKTOP_DATA_RULE], [
target: requirements
@list=...
])
doesn't work. The rerrors are related to the variables contained in the
rule. But I did not find an example, how I need to escape special
characters in the rule (or at least: which characters I need to escape).
> Besides the workarounds already mentioned, other possibilities include
> Automake conditionals.
I now conditionally include a Makefile snippet, which contains the
rules.
> > $(desktop_DATA): $(desktop_in_files:.desktop.in=.desktop)
> > @list='$<'; for p in $$list; do \
>
> Please note that using $< outside of inference rules requires GNU make.
The build system already uses some GNU make extensions (especially the
gnome-doc-utils Makefile snippet requires GNU make), but I try to
minimize its usage. So many thanks for your hints.
But my Makefiles also require it, because the following works, but the
install rules fail:
schemas_DATA = `echo "$(schemas_in_files)" | sed
's/.schemas.in$$//;$(transform);s/$$/.schemas/'`
Running the install target fails, because the installation rules do not
expand this expression. Instead they try to install "`echo". So I need:
schemas_DATA = $(shell echo "$(schemas_in_files)" | sed
's/.schemas.in$$//;$(transform);s/$$/.schemas/')
and this works. Is there maybe a solution, which doesn't require GNU
make here?
Regards, Daniel
- Re: Define a complete rule via autoconf (quoting issue, AC_SUBST),
Daniel Leidert <=