configure: fix 'arch support openvz kernel' test case
The file vzsyscalls.h has its constant definitions enclosed within
VZ_KERNEL_SUPPORTED. This has the desired effect of not including any
of those definitions - including the #error condition on non-suported
arches - during normal compilation.
When we compile test vzsyscalls.h, however, that constant is not yet
defined and we'll skip it all. As a side effect, the test will always
succeed.
This slip happened because I started writing those patches using
inverted logic: The file initially had #ifndef VZ_KERNEL_NOT_SUPPORTED,
that would be defined if the initial compilation failed. This logic was
changed in the published version, and the bug ended up appearing.
The fix is to temporarily define the constant during the compilation
of the test program. AC_DEFINE is usually used for this, but since there
is no AC_UNDEFINE, it is cleaner to just manually do it in the prologue
section of AC_LANG_PROGRAM.
Signed-off-by: Glauber Costa <glommer@parallels.com>
1 file changed