Update to use boost 1.30.2 by default, and use the -pthread compiler/linker
option when building on linux.
This commit is contained in:
parent
bdead8566a
commit
ccd16ff03d
63
asio/INSTALL
63
asio/INSTALL
@ -8,6 +8,7 @@ asio version 0.1.2 - Installation instructions
|
|||||||
5.1. Building with MSVC
|
5.1. Building with MSVC
|
||||||
5.2. Building with Borland C++
|
5.2. Building with Borland C++
|
||||||
5.3. Building with MinGW
|
5.3. Building with MinGW
|
||||||
|
5.4. Building with MinGW and MSYS
|
||||||
|
|
||||||
|
|
||||||
1. Supported Platforms
|
1. Supported Platforms
|
||||||
@ -26,8 +27,9 @@ combinations:
|
|||||||
2. Requirements
|
2. Requirements
|
||||||
===============
|
===============
|
||||||
|
|
||||||
The asio toolkit requires boost version 1.30.0. There is no need to build any
|
The asio toolkit requires either of the boost versions 1.30.0 or 1.30.2. There
|
||||||
of the boost libraries to use asio, as only the header files are required.
|
is no need to build any of the boost libraries to use asio, as only the header
|
||||||
|
files are required.
|
||||||
|
|
||||||
|
|
||||||
3. Before using asio
|
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:
|
to add the following directories to your compiler include path:
|
||||||
|
|
||||||
- asio's `include' directory
|
- 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
|
4. Building the tests on Linux
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
If the boost directory (i.e. the directory called boost_1_30_0) is in the same
|
If the boost directory (i.e. the directory called boost-1.30.2 or boost_1_30_0)
|
||||||
directory as the asio source kit, then you may configure asio by simply going:
|
is in the same directory as the asio source kit, then you may configure asio by
|
||||||
|
simply going:
|
||||||
|
|
||||||
./configure
|
./configure
|
||||||
|
|
||||||
in the root directory of the asio source kit. If the boost directory is in some
|
in the root directory of the asio source kit. Note that configure will always
|
||||||
other location, then you need to specify this directory when running configure:
|
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=<BOOSTDIR>
|
./configure --with-boost=<BOOSTDIR>
|
||||||
|
|
||||||
@ -63,14 +69,16 @@ To build, simply run `make' in the root directory of the asio source kit.
|
|||||||
5. Building the tests on Win32
|
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
|
5.1. Building with MSVC
|
||||||
|
|
||||||
To build using the MSVC 6 command line compiler, perform the following steps:
|
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.
|
- Change to the asio `src' directory.
|
||||||
|
|
||||||
- Execute the command `nmake -f Makefile.msc'.
|
- 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
|
To build using the Borland C++ Builder 6 command line compiler, perform the
|
||||||
following steps:
|
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.
|
- Change to the asio `src' directory.
|
||||||
|
|
||||||
- Execute the command `make -f Makefile.bor'.
|
- 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
|
To build using the MinGW g++ compiler from the command line, perform the
|
||||||
following steps:
|
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.
|
- Change to the asio `src' directory.
|
||||||
|
|
||||||
- Execute the command `mingw32-make -f Makefile.mgw'.
|
- 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=<BOOSTDIR>
|
||||||
|
|
||||||
|
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.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
AC_INIT(include/asio.hpp)
|
AC_INIT(include/asio.hpp)
|
||||||
AM_INIT_AUTOMAKE(asio, 0.1.2)
|
AM_INIT_AUTOMAKE(asio, 0.1.2)
|
||||||
|
|
||||||
|
AC_CANONICAL_HOST
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
AC_LANG(C++)
|
AC_LANG(C++)
|
||||||
@ -12,13 +13,16 @@ AC_ARG_WITH(boost,
|
|||||||
AC_HELP_STRING([--with-boost=DIR],[location of boost distribution]),
|
AC_HELP_STRING([--with-boost=DIR],[location of boost distribution]),
|
||||||
[
|
[
|
||||||
CPPFLAGS="$CPPFLAGS -I${withval}"
|
CPPFLAGS="$CPPFLAGS -I${withval}"
|
||||||
LDFLAGS="$LDFLAGS -L${withval}/libs/thread/build/bin-stage"
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
BOOSTDIR="`pwd`/../boost-1.30.2"
|
||||||
|
if test -d "${BOOSTDIR}"; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
|
||||||
|
else
|
||||||
BOOSTDIR="`pwd`/../boost_1_30_0"
|
BOOSTDIR="`pwd`/../boost_1_30_0"
|
||||||
if test -d "${BOOSTDIR}"; then
|
if test -d "${BOOSTDIR}"; then
|
||||||
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
|
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
|
||||||
LDFLAGS="$LDFLAGS -L${BOOSTDIR}/libs/thread/build/bin-stage"
|
fi
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -29,6 +33,16 @@ AC_CHECK_HEADER([boost/noncopyable.hpp],,
|
|||||||
exit 1
|
exit 1
|
||||||
],[])
|
],[])
|
||||||
|
|
||||||
|
case $host in
|
||||||
|
*-*-linux*)
|
||||||
|
CXXFLAGS="$CXXFLAGS -pthread"
|
||||||
|
LDFLAGS="$LDFLAGS -pthread"
|
||||||
|
;;
|
||||||
|
*-*-mingw32*)
|
||||||
|
LIBS="$LIBS -lws2_32"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if test "$GXX" = yes; then
|
if test "$GXX" = yes; then
|
||||||
CXXFLAGS="$CXXFLAGS -ftemplate-depth-32"
|
CXXFLAGS="$CXXFLAGS -ftemplate-depth-32"
|
||||||
fi
|
fi
|
||||||
|
@ -18,40 +18,30 @@ noinst_PROGRAMS = \
|
|||||||
AM_CXXFLAGS = -I../include
|
AM_CXXFLAGS = -I../include
|
||||||
|
|
||||||
___bin_dispatcher_test_SOURCES = tests/dispatcher_test.cpp
|
___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_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_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_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_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_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_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_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_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_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_SOURCES = tests/tpc_echo_server_test.cpp
|
||||||
___bin_tpc_echo_server_test_LDADD = -lpthread
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
Makefile.bor \
|
Makefile.bor \
|
||||||
|
Makefile.mgw \
|
||||||
Makefile.msc
|
Makefile.msc
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = \
|
MAINTAINERCLEANFILES = \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
!ifndef BOOSTDIR
|
!ifndef BOOSTDIR
|
||||||
BOOSTDIR = ../../boost_1_30_0
|
BOOSTDIR = ../../boost-1.30.2
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
CXXFLAGS = -q -O2 -v -vi -y -a8 -b -Ve- -Vx- -tWM -tWR -tWC -w-inl -w-par -I../include -I$(BOOSTDIR)
|
CXXFLAGS = -q -O2 -v -vi -y -a8 -b -Ve- -Vx- -tWM -tWR -tWC -w-inl -w-par -I../include -I$(BOOSTDIR)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
ifndef BOOSTDIR
|
ifndef BOOSTDIR
|
||||||
BOOSTDIR = ../../boost_1_30_0
|
BOOSTDIR = ../../boost-1.30.2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CXXFLAGS = -g -O3 -Wall -I../include -I$(BOOSTDIR)
|
CXXFLAGS = -g -O3 -Wall -I../include -I$(BOOSTDIR)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
!ifndef BOOSTDIR
|
!ifndef BOOSTDIR
|
||||||
BOOSTDIR = ../../boost_1_30_0
|
BOOSTDIR = ../../boost-1.30.2
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
CXXFLAGS = -nologo -O2 -GX -GR -Zi -w -MD -I. -I../include -I$(BOOSTDIR)
|
CXXFLAGS = -nologo -O2 -GX -GR -Zi -w -MD -I. -I../include -I$(BOOSTDIR)
|
||||||
|
Loading…
Reference in New Issue
Block a user