问题
The AC_ARG_VAR macro declares a variable precious which has certain cache-checking implications.
Some configure macros declare certain variables precious, and I would like to undo that. For example, AC_PROG_CC
will declare CFLAGS
as precious, and I need to make it non-precious.
Motivation
Doing this would allow me to modify CFLAGS
in a top-level configure and allow sub-package configures to execute without clashing with cached CFLAGS
value. See this question for more background.
回答1:
AC_DEFUN([AX_UNPRECIOUS], [
m4_define([_AC_PRECIOUS_VARS], m4_bpatsubst(_AC_PRECIOUS_VARS, [$1
], []))
])
AX_UNPRECIOUS([CFLAGS])
AX_UNPRECIOUS([CXXFLAGS])
...
来源:https://stackoverflow.com/questions/34257795/can-you-un-precious-a-configure-variable-inverse-of-ac-arg-var