Your macro isn't ignored, it just gets evaluated at a different time than you're expecting.
The M4sugar macros are evaluated when configure
is created. You seem to want to have the toupper function applied when configure
is run. You can do it at creation time by something like:
m4_define([thestring], [linux-gnu])dnl
m4_define([thexstring], [x])dnl
m4_append([thexstring], m4_toupper(thestring))dnl
foobar="thestring"
echo "${foobar}"
echo "thexstring"
echo "${foobar}"
but this won't help if foobar
is set up at runtime. Then you'll have to resort to one of the runtime techniques suggested by Fredrik Pihl (or something similar).
In any case, m4_toupper("x${foobar}")
is changed to "X${FOOBAR}"
so that's why it's not appearing, since ${FOOBAR}
is not defined in the environment.