[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to use variable with translit definitions
From: |
Andreas Schwab |
Subject: |
Re: how to use variable with translit definitions |
Date: |
Sun, 25 Mar 2007 12:29:06 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (gnu/linux) |
Vincent Torri <address@hidden> writes:
> Hey,
>
> I've written an m4 macro which is basically:
>
>
> AC_DEFUN([AC_CHECK_ECORE_MODULE],
> [
> pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
>
> ecore_]DOWN[_libs=""
>
> AC_SUBST(ecore_]DOWN[_libs)
>
> popdef([DOWN])
> ])
After AC_DEFUN has been executed the body of AC_CHECK_ECORE_MODULE
basically looks like this:
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
ecore_DOWN_libs=""
AC_SUBST(ecore_DOWN_libs)
popdef([DOWN])
Note that the outer level of quoting has been stripped at the time the
AC_DEFUN macro was expanded.
> But it seems that I do not use correctly the DOWN variable (ecore_***_libs
> is not subsituted). I have tried with DOWN instead of ]DOWN[ without
> success.
>
> Does someone know the correct syntax to do what I want ?
What you want is that the body of the macro looks like this:
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
ecore_[]DOWN[]_libs=""
AC_SUBST(ecore_[]DOWN[]_libs)
popdef([DOWN])
Now put a pair of quotes around it, and you get this:
AC_DEFUN([AC_CHECK_ECORE_MODULE],
[
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
ecore_[]DOWN[]_libs=""
AC_SUBST(ecore_[]DOWN[]_libs)
popdef([DOWN])
])
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."