Passing variables verbatim from autoconf.ac to automake.am
How can I pass a string 开发者_Go百科verbatim from autoconf.ac to automake.am.
Example, in autoconf.ac
, I'd like to give MYPATH = "-I$MYENVPATH -I$SOMEOTHERPATH"
and subsequently, get MYPATH
exactly as I gave, inside automake.am
AC_SUBST
is trying to deference and cause issues.
To prevent the shell from evaluating variables inside strings (if that is whay you meant by "AC_SUBST
is trying to dereference"), use simple quotes:
AC_SUBST([MYPATH], ['-I$MYENVPATH -I$SOMEOTHERPATH'])
This should output the following line in Makefile
:
MYPATH = -I$MYENVPATH -I$SOMEOTHERPATH
However this does not make a lot of sense to me: make
needs variable names to be enclosed in braces or parentheses (when their name has more than one letter). Probably what you really want is something like:
AC_SUBST([MYPATH], ['-I${MYENVPATH} -I${SOMEOTHERPATH}'])
精彩评论