From 3ce23558b4768a29baac4651f13ced6b7a6a6c5b Mon Sep 17 00:00:00 2001 From: cg25 Date: Sun, 22 Jun 2008 20:51:26 +0000 Subject: [PATCH] Added "--with-asio" option to configure script to be able to choose between "system" and "shipped" asio when building against boost-1.34 --- configure.in | 44 +++++++++++++++++++++++++++++++++++++++++++- include/Makefile.am | 2 +- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index ee97d29dd..6e4201b49 100644 --- a/configure.in +++ b/configure.in @@ -48,7 +48,49 @@ AX_BOOST_BASE([1.35],[ AC_MSG_ERROR([Unable to find Boost.Asio library, currently this is required.]) fi ],[ - AX_BOOST_BASE([1.34]) + AX_BOOST_BASE([1.34],[ + + dnl the user can choose which Asio library to use + AC_ARG_WITH([asio], + AS_HELP_STRING([--with-asio=shipped|system], + [Specify the Asio library to use, shipped or system. Default is to autodetect system and fallback to shipped.]), + [[asio=$withval]], + [[asio=shipped]] + ) + + dnl Check the value for the --with-asio switch + AC_MSG_CHECKING([which Asio implementation to use]) + case "$asio" in + "shipped") + AC_MSG_RESULT(shipped) + ASIO_HPP=include/libtorrent/asio.hpp + ASIO_DIR=include/libtorrent/asio + AC_CHECK_FILES($ASIO_HPP $ASIO_DIR/ssl/stream.hpp $ASIO_DIR/ip/tcp.hpp,, + AC_MSG_ERROR([libtorrent depends on Asio library but it was not found.]) + ) + ;; + "system") + AC_MSG_RESULT(system) + ASIO_HPP=/usr/include/asio.hpp + ASIO_DIR=/usr/include/asio + AC_CHECK_FILES($ASIO_HPP $ASIO_DIR/ssl/stream.hpp $ASIO_DIR/ip/tcp.hpp,, + AC_MSG_ERROR([libtorrent depends on Asio library but it was not found on your system.]) + ) + ln -sf $ASIO_HPP include/libtorrent + ln -sf $ASIO_DIR include/libtorrent + ;; + *) + AC_MSG_RESULT(detect) + ASIO_HPP=$asio/../asio.hpp + ASIO_DIR=$asio + AC_CHECK_FILES($ASIO_HPP $ASIO_DIR/ssl/stream.hpp $ASIO_DIR/ip/tcp.hpp,, + AC_MSG_ERROR([libtorrent depends on Asio library but it was not found in the path you specified.]) + ) + ln -sf $ASIO_HPP include/libtorrent + ln -sf $ASIO_DIR include/libtorrent + ;; + esac +]) ]) AC_MSG_NOTICE([BOOST_CPPFLAGS=$BOOST_CPPFLAGS]) diff --git a/include/Makefile.am b/include/Makefile.am index 6f0744829..601575a80 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -287,4 +287,4 @@ libtorrent/asio/windows/basic_stream_handle.hpp \ libtorrent/asio/windows/random_access_handle.hpp \ libtorrent/asio/windows/random_access_handle_service.hpp \ libtorrent/asio/windows/stream_handle.hpp \ -libtorrent/asio/windows/stream_handle_service.hpp \ +libtorrent/asio/windows/stream_handle_service.hpp