Boost logo

Boost :

From: Thomas Porschberg (thomas.porschberg_at_[hidden])
Date: 2005-12-29 09:14:18

Thomas Porschberg <thomas.porschberg <at>> writes:

> But I note that a lot of software components come with a
> m4 macro to support the configuration process.
> I found a boost.m4 file at

I discovered which comes with
some m4 macros for boost too.
In the meanwhile I wrote a own m4 macro which does set
BOOST_LDFLAGS and BOOST_CPPFLAGS and checks a version number.
I call it with
in my
I post it here and hope it is not considered as spam.
If someone has improvements please let me know. How
I already mentioned I'm a GNU-build-tool-greenhorn by

        AC_MSG_CHECKING(for boostlib >= $BOOST_LIB_VERSION_REQ)

        AC_ARG_WITH(boost, [ --with-boost=DIR root directory for boost library ],
                if test "$withval" = "no"; then
                        AC_MSG_ERROR('You specified --with-boost=no.
                   Sorry we need boost. Please download from')
                elif test "$withval" = "yes"; then
                        AC_MSG_WARN('You did not specify a directory for the --with-
boost option. We try /usr/local.')

        if test "$ac_boost_path" != ""; then
                LDFLAGS="$LDFLAGS -L$ac_boost_path/lib"
                export LDFLAGS
                AC_SUBST(BOOST_LDFLAGS, [-L$ac_boost_path/lib])
                if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
                        for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`;
                                _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed
's/\/include\/boost-//' | sed 's/_/./'`
                                V_CHECK=`expr $_version_tmp \> $_version`
                                if test "$V_CHECK" = "1" ; then
                                VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
                        CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
                        export CPPFLAGS

        VERSION_CHECK=`expr $BOOST_LIB_VERSION_REQ \<\= "$_version"`
        if test "$VERSION_CHECK" = "1" ; then

        if test "$succeeded" = "yes" ; then
                AC_MSG_RESULT(yes (found version $_version))
                if test "$_version" = "0" ; then
                        AC_MSG_ERROR('We did not find a directory include/boost-
                   under $ac_boost_path.
                   This means we could not detect the boost libraries.
                   Sorry we need boost. Please download from')
                        AC_MSG_ERROR('Your boost libraries seems to old (version
                   We need at least $BOOST_LIB_VERSION_REQ')

Boost list run by bdawes at, gregod at, cpdaniel at, john at