mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 19:28:52 +02:00
configure.ac: Fix CPPDEFINE error and improve boost check.
Require at least 1.56 for now... Testing of older versions is needed once librb is replaced and we know what's needed.
This commit is contained in:
parent
b17925378a
commit
7d3e1e49a5
2 changed files with 23 additions and 27 deletions
48
configure.ac
48
configure.ac
|
@ -150,7 +150,7 @@ AC_DEFUN([IRCD_DEFINE_UNQUOTED],
|
||||||
AC_DEFUN([CPPDEFINE],
|
AC_DEFUN([CPPDEFINE],
|
||||||
[
|
[
|
||||||
if [[ -z "$2" ]]; then
|
if [[ -z "$2" ]]; then
|
||||||
CPPFLAGS+="-D$1 $CPPFLAGS"
|
CPPFLAGS="-D$1 $CPPFLAGS"
|
||||||
else
|
else
|
||||||
CPPFLAGS="-D$1=$2 $CPPFLAGS"
|
CPPFLAGS="-D$1=$2 $CPPFLAGS"
|
||||||
fi
|
fi
|
||||||
|
@ -766,7 +766,9 @@ dnl
|
||||||
dnl boost support
|
dnl boost support
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to use boost sources included here])
|
BOOST_VERSION_MIN="1.56"
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether you asked to use boost sources included here])
|
||||||
AC_ARG_WITH(included-boost,
|
AC_ARG_WITH(included-boost,
|
||||||
AC_HELP_STRING([--with-included-boost[[[=shared]]]], [Use the boost sources from included submodule]),
|
AC_HELP_STRING([--with-included-boost[[[=shared]]]], [Use the boost sources from included submodule]),
|
||||||
[
|
[
|
||||||
|
@ -781,6 +783,16 @@ AC_HELP_STRING([--with-included-boost[[[=shared]]]], [Use the boost sources from
|
||||||
BTOOLSET=`echo $CXX | cut -d' ' -f1`
|
BTOOLSET=`echo $CXX | cut -d' ' -f1`
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether to use shared boost])
|
||||||
|
if [[ $withval = "shared" ]]; then
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
BOOST_LDFLAGS += " -Wl,-rpath -Wl,$boost_libdir"
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
withval="static"
|
||||||
|
fi
|
||||||
|
|
||||||
|
boost_linkage="$withval"
|
||||||
bash tools/boostrap.sh $BTOOLSET system release shared single
|
bash tools/boostrap.sh $BTOOLSET system release shared single
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
AC_MSG_ERROR([Failed to build included boost.])
|
AC_MSG_ERROR([Failed to build included boost.])
|
||||||
|
@ -796,29 +808,21 @@ AC_HELP_STRING([--with-included-boost[[[=shared]]]], [Use the boost sources from
|
||||||
AC_SUBST(BOOST_CPPFLAGS, ["-isystem $PWD/boost/include"])
|
AC_SUBST(BOOST_CPPFLAGS, ["-isystem $PWD/boost/include"])
|
||||||
AC_SUBST(BOOST_LDFLAGS, ["-L$boost_libdir"])
|
AC_SUBST(BOOST_LDFLAGS, ["-L$boost_libdir"])
|
||||||
|
|
||||||
boost_linkage="$withval"
|
|
||||||
AC_MSG_CHECKING([whether to use shared boost])
|
|
||||||
if [[ $withval = "shared" ]]; then
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
BOOST_LDFLAGS += " -Wl,-rpath -Wl,$boost_libdir"
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_DEFINE(HAVE_LIB_BOOST_SYSTEM, 1, [Define if you have boost_system])
|
AC_DEFINE(HAVE_LIB_BOOST_SYSTEM, 1, [Define if you have boost_system])
|
||||||
AC_MSG_NOTICE([Bootstrapping boost: done])
|
AC_MSG_NOTICE([Bootstrapping boost: done])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
|
AX_BOOST_BASE([$BOOST_VERSION_MIN],
|
||||||
with_included_boost="no"
|
[
|
||||||
AX_BOOST_BASE([1.60], [
|
with_included_boost="no"
|
||||||
AC_DEFINE(HAVE_LIB_BOOST_SYSTEM, 1, [Define if you have boost_system])
|
|
||||||
], [
|
], [
|
||||||
|
with_included_boost="yes"
|
||||||
AC_MSG_ERROR([Failed to find boost_system library. (try --with-included-boost)])
|
AC_MSG_ERROR([Failed to find boost_system library. (try --with-included-boost)])
|
||||||
])
|
])
|
||||||
boost_linkage="shared"
|
|
||||||
AX_BOOST_ASIO
|
AX_BOOST_ASIO
|
||||||
AX_BOOST_SYSTEM
|
AX_BOOST_SYSTEM
|
||||||
|
boost_linkage="shared"
|
||||||
])
|
])
|
||||||
|
|
||||||
if [[ "$boost_linkage" = "shared" ]]; then
|
if [[ "$boost_linkage" = "shared" ]]; then
|
||||||
|
@ -833,23 +837,15 @@ else
|
||||||
[
|
[
|
||||||
AC_SUBST(BOOST_LIBS, ["$boost_libdir/libboost_system-mgw53-1_61.dll.a"])
|
AC_SUBST(BOOST_LIBS, ["$boost_libdir/libboost_system-mgw53-1_61.dll.a"])
|
||||||
], [
|
], [
|
||||||
AC_SUBST(BOOST_LIBS, ["$boost_libdir/libboost_system.a"])
|
AC_SUBST(BOOST_LIBS, ["-Bstatic -lboost_system"])
|
||||||
|
dnl AC_SUBST(BOOST_LIBS, ["$boost_libdir/libboost_system.a"])
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_DEFINE([HAVE_BOOST_ASIO_HPP], [1], [ boost asio. ])
|
|
||||||
RB_DEFINE_UNQUOTED([INC_BOOST_ASIO_HPP], [boost/asio.hpp>], [ boost asio. ])
|
RB_DEFINE_UNQUOTED([INC_BOOST_ASIO_HPP], [boost/asio.hpp>], [ boost asio. ])
|
||||||
|
|
||||||
AC_DEFINE([HAVE_BOOST_CONTEXT_ALL_HPP], [1], [ boost context. ])
|
|
||||||
RB_DEFINE_UNQUOTED([INC_BOOST_CONTEXT_ALL_HPP], [boost/context/all.hpp>], [ boost context. ])
|
RB_DEFINE_UNQUOTED([INC_BOOST_CONTEXT_ALL_HPP], [boost/context/all.hpp>], [ boost context. ])
|
||||||
|
|
||||||
AC_DEFINE([HAVE_BOOST_ASIO_SPAWN_HPP], [1], [ boost asio spawn. ])
|
|
||||||
RB_DEFINE_UNQUOTED([INC_BOOST_ASIO_SPAWN_HPP], [boost/asio/spawn.hpp>], [ boost asio spawn. ])
|
RB_DEFINE_UNQUOTED([INC_BOOST_ASIO_SPAWN_HPP], [boost/asio/spawn.hpp>], [ boost asio spawn. ])
|
||||||
|
|
||||||
AC_DEFINE([HAVE_BOOST_LEXICAL_CAST_HPP], [1], [ boost asio. ])
|
|
||||||
RB_DEFINE_UNQUOTED([INC_BOOST_LEXICAL_CAST_HPP], [boost/lexical_cast.hpp>], [ boost lexical_cast. ])
|
RB_DEFINE_UNQUOTED([INC_BOOST_LEXICAL_CAST_HPP], [boost/lexical_cast.hpp>], [ boost lexical_cast. ])
|
||||||
|
|
||||||
AC_DEFINE([HAVE_BOOST_TOKENIZER_HPP], [1], [ boost tokenizer. ])
|
|
||||||
RB_DEFINE_UNQUOTED([INC_BOOST_TOKENIZER_HPP], [boost/tokenizer.hpp>], [ boost tokenizer. ])
|
RB_DEFINE_UNQUOTED([INC_BOOST_TOKENIZER_HPP], [boost/tokenizer.hpp>], [ boost tokenizer. ])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ rb.h.gch:
|
||||||
|
|
||||||
rb.pic.h.gch:
|
rb.pic.h.gch:
|
||||||
cp rb.h rb.pic.h
|
cp rb.h rb.pic.h
|
||||||
$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -fPIC -o rb.pic.h.gch $(DEFS) $(CPPFLAGS) $(AM_CPPFLAGS) rb.pic.h
|
$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -fPIC -o rb.pic.h.gch -DPIC $(DEFS) $(CPPFLAGS) $(AM_CPPFLAGS) rb.pic.h
|
||||||
|
|
||||||
clean-local:
|
clean-local:
|
||||||
rm -f rb.h.gch
|
rm -f rb.h.gch
|
||||||
|
|
Loading…
Reference in a new issue