user741819
user741819

Reputation: 161

can't find boost c++ using configure.ac

I wrote a configure.ac to find the path of boost c++ inlclude, but it could not find anything. If I specify the path, it can compile. Could anyone help me please? Here is my 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

Thanks a lot.

Upvotes: 1

Views: 2345

Answers (1)

Jack Kelly
Jack Kelly

Reputation: 18667

Just use AX_BOOST_BASE from the autoconf-archive.

If you're trying to AC_CHECK_HEADERS to verify the existence of boost headers, remember that you need to AC_LANG_PUSH([C++]) first, or you'll get "header present but cannot be compiled" errors.

Upvotes: 3

Related Questions