我有一个已安装的库,我们称之为"custom_lib",我正在链接它.
我想检查该库是否安装了特定选项.
该库中的options.h头文件有一个预处理器宏列表,如下所示:
#undef THIS
#define THIS
#undef THAT
#define THAT
#undef WE_WANT_THIS_ONE
#define WE_WANT_THIS_ONE
Run Code Online (Sandbox Code Playgroud)
在我的configure.ac文件中的另一个项目中,这个测试:
OPTION_FOUND="no"
AC_CHECK_HEADERS(custom_lib/options.h)
AC_MSG_CHECKING([is libary configured with --enable-we_want_this_one])
#AC_EGREP_HEADER([ string to match ],
# [ header file ],
# [ action if found ],
# [ action if not found ])
AC_EGREP_HEADER([[WE_WANT_THIS_ONE]],
[custom_lib/options.h],
[OPTION_FOUND="yes"],
[OPTION_FOUND="no"])
if test "$OPTION_FOUND" = "yes"
then
# If we have WE_WANT_THIS_ONE check to see which compiler is being used
if test "$GCC" = "yes"
then
if test "$CC" != "icc" …Run Code Online (Sandbox Code Playgroud)