diff --git a/asio/INSTALL b/asio/INSTALL index b0204baa..b89e8d39 100644 --- a/asio/INSTALL +++ b/asio/INSTALL @@ -8,6 +8,7 @@ asio version 0.1.2 - Installation instructions 5.1. Building with MSVC 5.2. Building with Borland C++ 5.3. Building with MinGW +5.4. Building with MinGW and MSYS 1. Supported Platforms @@ -26,8 +27,9 @@ combinations: 2. Requirements =============== -The asio toolkit requires boost version 1.30.0. There is no need to build any -of the boost libraries to use asio, as only the header files are required. +The asio toolkit requires either of the boost versions 1.30.0 or 1.30.2. There +is no need to build any of the boost libraries to use asio, as only the header +files are required. 3. Before using asio @@ -38,19 +40,23 @@ build any libraries before using asio in your own applications. You simply need to add the following directories to your compiler include path: - asio's `include' directory - - the boost directory (i.e. the directory called boost_1_30_0) + - the boost directory (i.e. the one called boost-1.30.2 or boost_1_30_0) 4. Building the tests on Linux ============================== -If the boost directory (i.e. the directory called boost_1_30_0) is in the same -directory as the asio source kit, then you may configure asio by simply going: +If the boost directory (i.e. the directory called boost-1.30.2 or boost_1_30_0) +is in the same directory as the asio source kit, then you may configure asio by +simply going: ./configure -in the root directory of the asio source kit. If the boost directory is in some -other location, then you need to specify this directory when running configure: +in the root directory of the asio source kit. Note that configure will always +use 1.30.2 in preference to 1.30.0 if both versions are present. + +If the boost directory is in some other location, then you need to specify this +directory when running configure: ./configure --with-boost= @@ -63,14 +69,16 @@ To build, simply run `make' in the root directory of the asio source kit. 5. Building the tests on Win32 ============================== -To build with any of the supported Win32 compilers, the boost directory (i.e. -the directory called boost_1_30_0) must be in the same directory as the one -that contains the asio source kit. - 5.1. Building with MSVC To build using the MSVC 6 command line compiler, perform the following steps: + - If you are using a version of boost other than 1.30.2, or if the boost + directory (i.e. the directory called boost-1.30.2) is not in the same + directory as the asio source kit, then specify the location of boost by + running a command similar to `set BOOSTDIR=path_to_boost'. Ensure that + you specify an absolute path. + - Change to the asio `src' directory. - Execute the command `nmake -f Makefile.msc'. @@ -80,6 +88,12 @@ To build using the MSVC 6 command line compiler, perform the following steps: To build using the Borland C++ Builder 6 command line compiler, perform the following steps: + - If you are using a version of boost other than 1.30.2, or if the boost + directory (i.e. the directory called boost-1.30.2) is not in the same + directory as the asio source kit, then specify the location of boost by + running a command similar to `set BOOSTDIR=path_to_boost'. Ensure that + you specify an absolute path. + - Change to the asio `src' directory. - Execute the command `make -f Makefile.bor'. @@ -89,6 +103,33 @@ following steps: To build using the MinGW g++ compiler from the command line, perform the following steps: + - If you are using a version of boost other than 1.30.2, or if the boost + directory (i.e. the directory called boost-1.30.2) is not in the same + directory as the asio source kit, then specify the location of boost by + running a command similar to `set BOOSTDIR=path_to_boost'. Ensure that + you specify an absolute path. + - Change to the asio `src' directory. - Execute the command `mingw32-make -f Makefile.mgw'. + +5.4. Building with MinGW and MSYS + +If the boost directory (i.e. the directory called boost-1.30.2 or boost_1_30_0) +is in the same directory as the asio source kit, then you may configure asio by +simply going: + + sh configure + +in the root directory of the asio source kit. Note that configure will always +use 1.30.2 in preference to 1.30.0 if both versions are present. + +If the boost directory is in some other location, then you need to specify this +directory when running configure: + + sh configure --with-boost= + +When specifying the boost directory in this way you should ensure that you use +an absolute path in a UNIX-style format, e.g. `/c/mydir/boost-1.30.2'. + +To build, simply run `make' in the root directory of the asio source kit. diff --git a/asio/configure.in b/asio/configure.in index e7abd999..e81d7371 100644 --- a/asio/configure.in +++ b/asio/configure.in @@ -1,6 +1,7 @@ AC_INIT(include/asio.hpp) AM_INIT_AUTOMAKE(asio, 0.1.2) +AC_CANONICAL_HOST AM_PROG_CC_C_O AC_PROG_CXX AC_LANG(C++) @@ -12,13 +13,16 @@ AC_ARG_WITH(boost, AC_HELP_STRING([--with-boost=DIR],[location of boost distribution]), [ CPPFLAGS="$CPPFLAGS -I${withval}" - LDFLAGS="$LDFLAGS -L${withval}/libs/thread/build/bin-stage" ], [ - BOOSTDIR="`pwd`/../boost_1_30_0" + BOOSTDIR="`pwd`/../boost-1.30.2" if test -d "${BOOSTDIR}"; then CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}" - LDFLAGS="$LDFLAGS -L${BOOSTDIR}/libs/thread/build/bin-stage" + else + BOOSTDIR="`pwd`/../boost_1_30_0" + if test -d "${BOOSTDIR}"; then + CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}" + fi fi ]) @@ -29,6 +33,16 @@ AC_CHECK_HEADER([boost/noncopyable.hpp],, exit 1 ],[]) +case $host in + *-*-linux*) + CXXFLAGS="$CXXFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + ;; + *-*-mingw32*) + LIBS="$LIBS -lws2_32" + ;; +esac + if test "$GXX" = yes; then CXXFLAGS="$CXXFLAGS -ftemplate-depth-32" fi diff --git a/asio/src/Makefile.am b/asio/src/Makefile.am index d234727b..f62d6606 100644 --- a/asio/src/Makefile.am +++ b/asio/src/Makefile.am @@ -18,40 +18,30 @@ noinst_PROGRAMS = \ AM_CXXFLAGS = -I../include ___bin_dispatcher_test_SOURCES = tests/dispatcher_test.cpp -___bin_dispatcher_test_LDADD = -lpthread ___bin_dgram_echo_server_test_SOURCES = tests/dgram_echo_server_test.cpp -___bin_dgram_echo_server_test_LDADD = -lpthread ___bin_dgram_echo_client_test_SOURCES = tests/dgram_echo_client_test.cpp -___bin_dgram_echo_client_test_LDADD = -lpthread ___bin_echo_client_test_SOURCES = tests/echo_client_test.cpp -___bin_echo_client_test_LDADD = -lpthread ___bin_echo_server_test_SOURCES = tests/echo_server_test.cpp -___bin_echo_server_test_LDADD = -lpthread ___bin_socket_accept_test_SOURCES = tests/socket_accept_test.cpp -___bin_socket_accept_test_LDADD = -lpthread ___bin_timed_accept_test_SOURCES = tests/timed_accept_test.cpp -___bin_timed_accept_test_LDADD = -lpthread ___bin_timed_connect_test_SOURCES = tests/timed_connect_test.cpp -___bin_timed_connect_test_LDADD = -lpthread ___bin_timed_dgram_recv_test_SOURCES = tests/timed_dgram_recv_test.cpp -___bin_timed_dgram_recv_test_LDADD = -lpthread ___bin_timer_test_SOURCES = tests/timer_test.cpp -___bin_timer_test_LDADD = -lpthread ___bin_tpc_echo_server_test_SOURCES = tests/tpc_echo_server_test.cpp -___bin_tpc_echo_server_test_LDADD = -lpthread EXTRA_DIST = \ Makefile.bor \ + Makefile.mgw \ Makefile.msc MAINTAINERCLEANFILES = \ diff --git a/asio/src/Makefile.bor b/asio/src/Makefile.bor index 2695581a..6fed436d 100644 --- a/asio/src/Makefile.bor +++ b/asio/src/Makefile.bor @@ -1,5 +1,5 @@ !ifndef BOOSTDIR -BOOSTDIR = ../../boost_1_30_0 +BOOSTDIR = ../../boost-1.30.2 !endif CXXFLAGS = -q -O2 -v -vi -y -a8 -b -Ve- -Vx- -tWM -tWR -tWC -w-inl -w-par -I../include -I$(BOOSTDIR) diff --git a/asio/src/Makefile.mgw b/asio/src/Makefile.mgw index ef5f19f6..dc64f1c7 100644 --- a/asio/src/Makefile.mgw +++ b/asio/src/Makefile.mgw @@ -1,5 +1,5 @@ ifndef BOOSTDIR -BOOSTDIR = ../../boost_1_30_0 +BOOSTDIR = ../../boost-1.30.2 endif CXXFLAGS = -g -O3 -Wall -I../include -I$(BOOSTDIR) diff --git a/asio/src/Makefile.msc b/asio/src/Makefile.msc index 0ad5368b..a57bb37b 100644 --- a/asio/src/Makefile.msc +++ b/asio/src/Makefile.msc @@ -1,5 +1,5 @@ !ifndef BOOSTDIR -BOOSTDIR = ../../boost_1_30_0 +BOOSTDIR = ../../boost-1.30.2 !endif CXXFLAGS = -nologo -O2 -GX -GR -Zi -w -MD -I. -I../include -I$(BOOSTDIR)