On 05/15/2010 06:57 AM, Daniel Leidert wrote: > Hi, Hello, and thanks for the query, > > For a project I would like to get defines for every supported languages. > The ALL_LINGUAS variable contains alist of language codes. Now I would > like to get > > HAVE_LINGUA_$lang > > for every languages code in the variable. What you are attempting doesn't make much sense to me yet. The whole point of i18n is that the translation files can be maintained independently of the executable, and that a person can install a subset of the compiled .mo files according to their needs. Therefore, any compile-time test that sets a variable HAVE_LINGUA_foo in relation to the languages on the compilation machine will most likely be out-of-date when you copy the executable but not the translation file to a user's machine. Conversely, a translation language not available at configure time might later be written and installed, at which point your executable is already hard-coded not to use it. > I tried this piece of code: > >> AS_FOR( >> [AC_lingua], >> [ac_lingua], >> [$ALL_LINGUAS], >> [ >> AC_MSG_NOTICE([Having lingua ]AC_lingua) >> AH_TEMPLATE(AS_TR_CPP([HAVE_LINGUA_]AC_lingua), [Define to 1 for <AC_lingua> lingua support.]) >> AC_DEFINE(AS_TR_CPP([HAVE_LINGUA_]AC_lingua)) >> ] >> ) AS_FOR is not (yet) documented; therefore, it is an internal macro, with an interface that is subject to change. You may be better off just writing a normal shell loop rather than trying to use AS_FOR; at any rate, going with a hand-written shell loop will reduce the complexity of understanding whether m4 constructs are being applied correctly. Beyond that, I'm not sure what you were expecting in the resulting configure file. It may be a case of under- or over-quoting some of your m4 constructs, but without knowing your end goal or why you thought it necessary to use an undocumented AS_FOR, I'm not sure what to suggest for fixing it. -- Eric Blake eblake@xxxxxxxxxx +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf