我正在为 X 编写一个视频设备驱动程序,它需要 XFIXES 扩展提供的一些功能。现在,我很确定我所有的 X 服务器目标版本都至少安装了 XFIXES 版本 2,但我真的很想在我的 configure.ac 文件中测试它以警告用户是否尝试为真正旧版本的服务器或(出于某种原因)不包含 XFIXES 的服务器编译我的驱动程序。现在我只是这样做:
# Essentially this is just supposed to check if the server currently supports
# V2 or better of the XFIXES protocol, and to define XFIXES if it does.
AC_CHECK_HEADER(X11/extensions/Xfixes.h,
HAVE_XFIXES="yes";
AC_DEFINE([HAVE_XFIXES],[1],[XFixes Proto Found]),,
[#include <X11/Xlib.h>])
# should have a better test for this
if test "x${HAVE_XFIXES}" = "xyes"; then
AC_DEFINE([XFIXES],[1],[XFixes >= 2.0])
fi