【发布时间】:2011-09-01 01:32:18
【问题描述】:
我写了一个configure.ac来查找boost c++包含的路径,但是找不到任何东西。如果我指定路径,它可以编译。有人可以帮我吗? 这是我的configure.ac
AC_PREREQ([2.67])
AC_INIT(pkg, 1.1.01)
AC_PROG_CXX
AC_ARG_WITH(
[boost],
[AS_HELP_STRING(
[--with-boost=DIR],
[path to look for Boost])
],
[boostpath=$withval],
[boostpath=]
)
if test -n "$boostpath"; then
boostinc="-I$boostpath/include"
fi
CXXFLAGS="$CXXFLAGS ${boostinc}"
AC_SUBST([CXXFLAGS])
AC_CONFIG_FILES([Makevars])
AC_OUTPUT
非常感谢。
【问题讨论】:
-
-I 参数属于 CPPFLAGS,而不是 CXXFLAGS
-
你在哪里调用 AC_CHECK_HEADERS?标准用法是让您在 configure.ac 中调用 AC_CHECK_HEADERS,如果标头安装在非标准位置,请让用户在 CPPFLAGS 中指定位置:./configure CPPFLAGS=-I/p/a/t/h .
标签: c++ r boost package autoconf