我正在为我的项目使用GNU autotools。 configure.ac脚本具有以下片段。Autoconf没有正确定义变量
AC_ARG_WITH(chkhere,
AC_HELP_STRING([--without-chkhere], [do not compile]),
[ac_cv_chkhere=$withval], [ac_cv_chkhere=yes])
# Check if chkhere is available
if test "x$ac_cv_chkhere" = "xyes"
then
AC_DEFINE(HAVE_CHECKED)
echo "chkhere: enabled"
else
echo "chkhere: DISABLED"
fi
我正在检查C++代码中的变量HAVE_CHECKED。这适用于--without-chkhere选项。
当我给./configure --with-chkhere时,它会根据需要显示消息“chkhere:enabled”,但HAVE_CHECKED在C++代码中显示为undefined。
请提出我要出错的地方,或者如果我可以测试它不同?谢谢。
P.S .:我按照这个命令序列:automake; libtoolize; aclocal -I m4; autoconf的;
P.S.到你的P.S.你可以使用'autoreconf'而不是那个命令序列。 – ptomato 2010-09-26 14:01:13