Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make it so --with-boost does what you'd expect

and fix up a few boost things
  • Loading branch information...
commit 9bfff2f047a80adedbead48114579ddba5e4a83d 1 parent 62cfecc
@novas0x2a novas0x2a authored
Showing with 25 additions and 12 deletions.
  1. +10 −8 configure.ac
  2. +15 −4 m4/ax_pkg_boost.m4
View
18 configure.ac
@@ -164,17 +164,19 @@ AM_CONDITIONAL(DIST_REMOVE_MODULES, [test ! -z "$DIST_REMOVE_MODULES"])
AX_PKG_PTHREADS
AX_PKG_BOOST
-AX_PKG_BOOST_CHECK_VERSION([VW_])
+if test x"$HAVE_PKG_BOOST" == "xyes"; then
+ AX_PKG_BOOST_CHECK_VERSION([VW_])
+ AC_MSG_NOTICE([VW will be built using Boost version $BOOST_VERSION])
-AC_MSG_NOTICE([VW will be built using Boost version $BOOST_VERSION])
-AX_PKG_BOOST_LIB(PROGRAM_OPTIONS, [-lboost_program_options], [boost/program_options.hpp])
+ AX_PKG_BOOST_LIB(PROGRAM_OPTIONS, [-lboost_program_options], [boost/program_options.hpp])
-AX_PKG_ONE_OF(BOOST_FILESYSTEM,
- BOOST_FILESYSTEM_PRE_1_35, [AX_PKG_BOOST_LIB(FILESYSTEM_PRE_1_35, [-lboost_filesystem], [boost/filesystem/path.hpp])],
- BOOST_FILESYSTEM_POST_1_35, [AX_PKG_BOOST_LIB(FILESYSTEM_POST_1_35, [-lboost_filesystem -lboost_system], [boost/filesystem/path.hpp])])
+ AX_PKG_ONE_OF(BOOST_FILESYSTEM,
+ BOOST_FILESYSTEM_PRE_1_35, [AX_PKG_BOOST_LIB(FILESYSTEM_PRE_1_35, [-lboost_filesystem], [boost/filesystem/path.hpp])],
+ BOOST_FILESYSTEM_POST_1_35, [AX_PKG_BOOST_LIB(FILESYSTEM_POST_1_35, [-lboost_filesystem -lboost_system], [boost/filesystem/path.hpp])])
-AX_PKG_BOOST_LIB(THREAD, [-lboost_thread], [boost/thread/thread.hpp])
-AX_PKG_BOOST_LIB(IOSTREAMS, [-lboost_iostreams], [boost/iostreams/stream_buffer.hpp])
+ AX_PKG_BOOST_LIB(THREAD, [-lboost_thread], [boost/thread/thread.hpp])
+ AX_PKG_BOOST_LIB(IOSTREAMS, [-lboost_iostreams], [boost/iostreams/stream_buffer.hpp])
+fi
# This provides an easy way for users to override the threads options
# if they are replacing Boost threads with something else for their platform.
View
19 m4/ax_pkg_boost.m4
@@ -8,19 +8,30 @@ dnl __END_LICENSE__
# Usage: AX_PKG_BOOST
AC_DEFUN([AX_PKG_BOOST],
[
+ AC_ARG_WITH(boost,
+ AC_HELP_STRING([--with-boost], [enable searching for the boost package @<:@auto@:>@]),
+ [ HAVE_PKG_BOOST=$withval ]
+ )
+
AC_MSG_CHECKING(for package BOOST)
AC_LANG_ASSERT(C++)
if test -n "${HAVE_PKG_BOOST}" && test "${HAVE_PKG_BOOST}" != "yes" && test "${HAVE_PKG_BOOST}" != "no" && test x"${HAVE_PKG_BOOST#no:}" == "x$HAVE_PKG_BOOST"; then
PKG_PATHS_BOOST="${HAVE_PKG_BOOST}"
- unset HAVE_PKG_BOOST
else
PKG_PATHS_BOOST="${PKG_PATHS}"
fi
# Skip testing if the user has overridden
- if test -z ${HAVE_PKG_BOOST}; then
+ if test "no" = "$HAVE_PKG_BOOST"; then
+ AC_MSG_RESULT([no (disabled by user)])
+ elif test x"${HAVE_PKG_BOOST#no:}" != "x$HAVE_PKG_BOOST"; then # read as: if has_prefix(HAVE_PKG_BOOST, "no:")
+ dnl { and } break AC_MSG_RESULT
+ reason="${HAVE_PKG_BOOST#no:}"
+ AC_MSG_RESULT([no ($reason)])
+ HAVE_PKG_BOOST=no
+ else
PKG_BOOST_CPPFLAGS=
PKG_BOOST_LIBS=
@@ -90,9 +101,9 @@ AC_DEFUN([AX_PKG_BOOST],
CPPFLAGS="$ax_pkg_old_cppflags"
LDFLAGS="$ax_pkg_old_ldflags"
- fi
+ AC_MSG_RESULT([$HAVE_PKG_BOOST])
- AC_MSG_RESULT([$HAVE_PKG_BOOST])
+ fi
if test "${HAVE_PKG_BOOST}" = "yes" ; then
ax_have_pkg_bool=1
Please sign in to comment.
Something went wrong with that request. Please try again.