Rewrite autotools build system (new configure.ac, changes for various

Makefile.am and fixed m4 scripts). Could still need some fixes.
This commit is contained in:
cristiangreco 2009-09-10 02:22:13 +00:00
parent 8e068cb801
commit 2fd925a4ae
34 changed files with 1977 additions and 2133 deletions

View File

@ -1,90 +1,99 @@
ACLOCAL_AMFLAGS = -I m4
#DISTCHECK_CONFIGURE_FLAGS = --enable-tests
SUBDIRS = include zlib src examples test bindings/python
EXTRA_DIST = autotool.sh docs/manual.html docs/manual.rst docs/extension_protocol.rst \
docs/extension_protocol.html \
docs/projects.rst docs/projects.html \
docs/building.rst docs/building.html \
docs/running_tests.rst docs/running_tests.html \
docs/index.rst docs/index.html \
docs/python_binding.rst docs/python_binding.html \
docs/udp_tracker_protocol.rst docs/udp_tracker_protocol.html \
docs/client_test.rst docs/client_test.html \
docs/dht_extensions.html docs/dht_extensions.rst \
docs/make_torrent.html docs/make_torrent.rst \
docs/examples.html docs/examples.rst \
docs/tuning.html docs/tuning.rst \
docs/features.html docs/features.rst \
docs/libtorrent_plugins.html docs/libtorrent_plugins.rst \
docs/arctic_thumb.png \
docs/fdm.png \
docs/tvitty.jpg \
docs/leechcraft.png \
docs/lince.png \
docs/fatrat.png \
docs/miro.jpg \
docs/bitbuddy_thumb.jpg \
docs/bitscast_thumb.png \
docs/bitslug_thumb.png \
docs/bitrocket_thumb.png \
docs/btg_thumb.jpg \
docs/bitfox.png \
docs/acquasition.jpg \
docs/im_thumb.jpg \
docs/Linkage.png \
docs/deluge.png \
docs/halite_thumb.png \
docs/electric_sheep_thumb.jpg \
docs/moopolice_thumb.gif \
docs/qbittorrent_thumb.jpg \
docs/ziptorrent_thumb.gif \
docs/flush.jpg \
docs/pump.png \
docs/bubba.png \
docs/firetorrent.png \
docs/read_disk_buffers.png \
docs/read_disk_buffers.graffle \
docs/write_disk_buffers.png \
docs/write_disk_buffers.graffle \
docs/disk_io.png \
docs/disk_access.png \
docs/storage.png \
docs/storage.graffle \
docs/disk_buffer.png \
docs/disk_buffer_sample.png \
docs/disk_buffer_before_optimization.png \
docs/session_stats_peers.png \
docs/unicode_support.png docs/client_test.png docs/style.css Jamfile project-root.jam \
libtorrent-rasterbar.pc \
bindings/README.txt \
bindings/python/Jamfile \
bindings/python/setup.py \
bindings/python/client.py \
bindings/python/simple_client.py \
bindings/python/src/alert.cpp \
bindings/python/src/big_number.cpp \
bindings/python/src/converters.cpp \
bindings/python/src/create_torrent.cpp \
bindings/python/src/datetime.cpp \
bindings/python/src/entry.cpp \
bindings/python/src/extensions.cpp \
bindings/python/src/filesystem.cpp \
bindings/python/src/fingerprint.cpp \
bindings/python/src/gil.hpp \
bindings/python/src/ip_filter.cpp \
bindings/python/src/magnet_uri.cpp \
bindings/python/src/module.cpp \
bindings/python/src/optional.hpp \
bindings/python/src/peer_info.cpp \
bindings/python/src/peer_plugin.cpp \
bindings/python/src/session.cpp \
bindings/python/src/session_settings.cpp \
bindings/python/src/torrent.cpp \
bindings/python/src/torrent_handle.cpp \
bindings/python/src/torrent_info.cpp \
bindings/python/src/torrent_status.cpp \
bindings/python/src/utility.cpp \
bindings/python/src/version.cpp
SUBDIRS = include/libtorrent zlib src examples test bindings
DOCS_IMAGES = \
docs/acquasition.jpg \
docs/arctic_thumb.png \
docs/bitbuddy_thumb.jpg \
docs/bitfox.png \
docs/bitrocket_thumb.png \
docs/bitscast_thumb.png \
docs/bitslug_thumb.png \
docs/btg_thumb.jpg \
docs/bubba.png \
docs/client_test.png \
docs/deluge.png \
docs/disk_access.png \
docs/disk_buffer_before_optimization.png \
docs/disk_buffer.png \
docs/disk_buffer_sample.png \
docs/disk_io.png \
docs/electric_sheep_thumb.jpg \
docs/fatrat.png \
docs/fdm.png \
docs/firetorrent.png \
docs/flush.jpg \
docs/halite_thumb.png \
docs/im_thumb.jpg \
docs/leechcraft.png \
docs/libtorrent_screen.png \
docs/limewire.png \
docs/lince.png \
docs/Linkage.png \
docs/merkle_tree.graffle \
docs/merkle_tree.png \
docs/miro.jpg \
docs/moopolice_thumb.gif \
docs/pump.png \
docs/qbittorrent_thumb.jpg \
docs/read_disk_buffers.dot \
docs/read_disk_buffers.graffle \
docs/read_disk_buffers.png \
docs/session_stats_peers.png \
docs/storage.graffle \
docs/storage.png \
docs/style.css \
docs/tvblob.jpg \
docs/tvitty.jpg \
docs/unicode_support.png \
docs/write_disk_buffers.dot \
docs/write_disk_buffers.graffle \
docs/write_disk_buffers.png \
docs/ziptorrent_thumb.gif
DOCS_PAGES = \
docs/building.html \
docs/building.rst \
docs/client_test.html \
docs/client_test.rst \
docs/dht_extensions.html \
docs/dht_extensions.rst \
docs/examples.html \
docs/examples.rst \
docs/extension_protocol.html \
docs/extension_protocol.rst \
docs/features.html \
docs/features.rst \
docs/index.html \
docs/index.rst \
docs/libtorrent_plugins.html \
docs/libtorrent_plugins.rst \
docs/make_torrent.html \
docs/make_torrent.rst \
docs/manual.html \
docs/manual.rst \
docs/projects.html \
docs/projects.rst \
docs/python_binding.html \
docs/python_binding.rst \
docs/running_tests.html \
docs/running_tests.rst \
docs/tuning.html \
docs/tuning.rst \
docs/udp_tracker_protocol.html \
docs/udp_tracker_protocol.rst
EXTRA_DIST = \
Jamfile \
project-root.jam \
CMakeLists.txt \
libtorrent-rasterbar.pc \
libtorrent-rasterbar-cmake.pc \
$(DOCS_PAGES) \
$(DOCS_IMAGES)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libtorrent-rasterbar.pc

View File

@ -2,12 +2,15 @@
# $Id$
# The result of using "autoreconf -fi" should be identical to using this
# script.
set -e
set -x
aclocal -I m4
libtoolize -c -f
automake -a -c -f
autoconf
rm -Rf config.cache autom4te.cache
#${AUTOPOINT:-autopoint} -f
${LIBTOOLIZE:-libtoolize} -c -f || glibtoolize -c -f
${ACLOCAL:-aclocal} -I m4
${AUTOCONF:-autoconf}
#${AUTOHEADER:-autoheader}
${AUTOMAKE:-automake} -acf --foreign

4
bindings/Makefile.am Normal file
View File

@ -0,0 +1,4 @@
SUBDIRS = python
EXTRA_DIST = README.txt

View File

@ -1,3 +1,34 @@
EXTRA_DIST = \
Jamfile \
setup.py \
client.py \
simple_client.py \
src/alert.cpp \
src/big_number.cpp \
src/converters.cpp \
src/create_torrent.cpp \
src/datetime.cpp \
src/entry.cpp \
src/extensions.cpp \
src/filesystem.cpp \
src/fingerprint.cpp \
src/gil.hpp \
src/ip_filter.cpp \
src/magnet_uri.cpp \
src/module.cpp \
src/optional.hpp \
src/peer_info.cpp \
src/peer_plugin.cpp \
src/session.cpp \
src/session_settings.cpp \
src/torrent.cpp \
src/torrent_handle.cpp \
src/torrent_info.cpp \
src/torrent_status.cpp \
src/utility.cpp \
src/version.cpp
if ENABLE_PYTHON_BINDING
all-local:

View File

@ -62,7 +62,7 @@ if "OPT" in config_vars and "-Wstrict-prototypes" in config_vars["OPT"]:
source_list = os.listdir(os.path.join(os.path.dirname(__file__), "src"))
source_list = [os.path.join("src", s) for s in source_list if s.endswith(".cpp")]
extra_cmd = '@COMPILETIME_OPTIONS@ @CPPFLAGS@ @LIBS@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LIBS@ @BOOST_SYSTEM_LIB@ @SSL_LDFLAGS@ @SSL_CXXFLAGS@'
extra_cmd = '@COMPILETIME_OPTIONS@ @CPPFLAGS@ @LIBS@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @BOOST_PYTHON_LIB@ @PTHREAD_LIBS@ @OPENSSL_LIBS@ @OPENSSL_LDFLAGS@ @OPENSSL_INCLUDES@'
setup( name='python-libtorrent',
version='@PACKAGE_VERSION@',
@ -76,9 +76,9 @@ setup( name='python-libtorrent',
ext_modules = [Extension('libtorrent',
sources = source_list,
language='c++',
include_dirs = ['@top_srcdir@/include','@top_srcdir@/include/libtorrent'] + parse_cmd(extra_cmd, '-I'),
include_dirs = ['@top_srcdir@/include'] + parse_cmd(extra_cmd, '-I'),
library_dirs = ['@top_builddir@/src/.libs'] + parse_cmd(extra_cmd, '-L'),
extra_link_args = '@LDFLAGS@'.split() + arch(),
extra_compile_args = parse_cmd(extra_cmd, '-D', True) + arch(),
libraries = ['torrent-rasterbar','@BOOST_PYTHON_LIB@'] + parse_cmd(extra_cmd, '-l'))],
libraries = ['torrent-rasterbar'] + parse_cmd(extra_cmd, '-l'))],
)

View File

@ -1,15 +1,11 @@
#!/bin/sh
rm -f config.cache
rm -fr autom4te.cache
rm -rf config.log
rm -rf Makefile
chmod a-x docs/*.rst docs/*.htm*
autoheader
aclocal -I m4
glibtoolize -f
automake -ac
autoconf
./configure --enable-python-binding --with-zlib=shipped --enable-examples=yes --enable-tests=yes --with-boost-system=mt --with-boost-python=mt --with-boost-thread=mt --with-boost-filesystem=mt --with-boost-regex=mt --with-boost-program-options=mt
rm -f config.log config.report configure
rm -f m4/libtool.m4 m4/lt~obsolete.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/ltoptions.m4
rm -fr autom4te.cache build-aux
find -name Makefile -o -name Makefile.in -exec rm '{}' \;
chmod a-x docs/*.rst docs/*.htm* src/*.cpp include/libtorrent/*.hpp
./autotool.sh
./configure --enable-python-binding --with-zlib=shipped --enable-examples=yes --enable-tests=yes --with-boost-system=mt --with-boost-python=mt --with-boost-thread=mt --with-boost-filesystem=mt
make -j 8 dist check

768
configure.ac Normal file
View File

@ -0,0 +1,768 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# $Id$
AC_PREREQ(2.64)
AC_INIT([libtorrent-rasterbar],[0.15.0],[arvid@cs.umu.se],[libtorrent-rasterbar],[http://www.libtorrent.org])
AC_CONFIG_SRCDIR([src/torrent.cpp])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
SVN_REVISION=`grep REVISION include/libtorrent/version.hpp | sed 's,.* \([[0-9]]*\) .*,\1,'`
###############################################################################
dnl ---------------------------------------------------------------------------
dnl interface version info
dnl ---------------------------------------------------------------------------
dnl Advanced information about versioning:
dnl * "Writing shared libraries" by Mike Hearn
dnl http://navi.cx/~mike/writing-shared-libraries.html
dnl * libtool.info chapter "Versioning"
dnl * libtool.info chapter "Updating library version information"
dnl ---------------------------------------------------------------------------
dnl Versioning:
dnl - CURRENT (Major): Increment if the interface has changes. AGE is always
dnl *changed* at the same time.
dnl - AGE (Micro): Increment if any interfaces have been added; set to 0
dnl if any interfaces have been removed. Removal has
dnl precedence over adding, so set to 0 if both happened.
dnl It denotes upward compatibility.
dnl - REVISION (Minor): Increment any time the source changes; set to
dnl 0 if you incremented CURRENT.
dnl
dnl To summarize. Any interface *change* increment CURRENT. If that interface
dnl change does not break upward compatibility (ie it is an addition),
dnl increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed,
dnl REVISION is set to 0, otherwise REVISION is incremented.
dnl ---------------------------------------------------------------------------
m4_define([VERSION_INFO_CURRENT],[6])
m4_define([VERSION_INFO_REVISION],[0])
m4_define([VERSION_INFO_AGE],[0])
INTERFACE_VERSION_INFO=VERSION_INFO_CURRENT:VERSION_INFO_REVISION:VERSION_INFO_AGE
AC_SUBST(INTERFACE_VERSION_INFO)
###############################################################################
###############################################################################
# Start
###############################################################################
AS_ECHO
AS_ECHO "Building $PACKAGE_STRING"
###############################################################################
# Performing some basic checks and initializing the build system
###############################################################################
AS_ECHO
AS_ECHO "Checking for a C/C++ compiler to use:"
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_CXX_C_O
AS_ECHO
AS_ECHO "Checking system type:"
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AS_ECHO
AS_ECHO "Initializing Automake:"
AM_INIT_AUTOMAKE(1.10 foreign)
AS_ECHO
AS_ECHO "Initializing Libtool:"
LT_PREREQ(2.2.6)
LT_INIT
###############################################################################
# Checking for needed base libraries
###############################################################################
AS_ECHO
AS_ECHO "Checking for posix thread support:"
AX_PTHREAD()
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
CC="$PTHREAD_CC"
AS_ECHO
AS_ECHO "Checking for boost libraries:"
AX_BOOST_BASE([1.36])
AX_BOOST_SYSTEM()
AS_IF([test -z "$BOOST_SYSTEM_LIB"],
[AC_MSG_ERROR(Boost.System library not found. Try using --with-boost-system=lib)])
AX_BOOST_FILESYSTEM()
AS_IF([test -z "$BOOST_FILESYSTEM_LIB"],
[AC_MSG_ERROR(Boost.Filesystem library not found. Try using --with-boost-filesystem=lib)])
AX_BOOST_THREAD()
AS_IF([test -z "$BOOST_THREAD_LIB"],
[AC_MSG_ERROR(Boost.Thread library not found. Try using --with-boost-thread=lib)])
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
###############################################################################
# Checking for functions and other stuffs
###############################################################################
AS_ECHO
AS_ECHO "Checking for pkg-config:"
PKG_PROG_PKG_CONFIG([0.20])
AS_ECHO
AS_ECHO "Checking for functions and headers:"
AC_SYS_LARGEFILE
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
# check for gethostbyname and gethostbyname_r (used in src/GeoIP.c)
AC_CHECK_FUNCS([gethostbyname], [],
[AC_CHECK_LIB([nsl], [gethostbyname], [],
[AC_CHECK_LIB([resolv], [gethostbyname], [],
[AC_CHECK_LIB([socket], [gethostbyname], [],
[AC_CHECK_LIB([ws2_32], [main],
[AC_CHECK_LIB([wsock32], [main],
[LIBS="-lws2_32 -lwsock32 $LIBS"],
[AC_MSG_ERROR([wsock32 function not found.])])],
[AC_MSG_ERROR([gethostbyname function not found.])])])])])]
)
AC_CHECK_FUNCS(gethostbyname_r, [
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
AC_EGREP_HEADER(int.*gethostbyname_r, netdb.h, [
AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT)])
])
AC_CHECK_FUNCS([clock_gettime], [],
[AC_CHECK_LIB([rt], [clock_gettime], [],
[AC_CHECK_LIB([posix4], [clock_gettime], [],
[AC_MSG_WARN([clock_gettime function not found.])])])]
)
dnl Pass some build options to setup.py and .pc file
COMPILETIME_OPTIONS=""
###############################################################################
# Setting configure options
###############################################################################
AC_ARG_ENABLE(
[logging],
[AS_HELP_STRING(
[--enable-logging],
[enable logging to disk (use value "verbose" to enable verbose peer wire logging or "errors" limit logging to errors ) [default=no]])],
[[ARG_ENABLE_LOGGING=$enableval]],
[[ARG_ENABLE_LOGGING=no]]
)
AC_ARG_ENABLE(
[debug],
[AS_HELP_STRING(
[--enable-debug],
[enable debug build [default=no]])],
[[ARG_ENABLE_DEBUG=$enableval]],
[[ARG_ENABLE_DEBUG=no
ac_arg_enable_debug=no]]
)
AC_ARG_ENABLE(
[dht],
[AS_HELP_STRING(
[--disable-dht],
[disable dht support (use value "logging" to add extra logging) [default=yes]])],
[[ARG_ENABLE_DHT=$enableval]],
[[ARG_ENABLE_DHT=yes]]
)
AC_ARG_ENABLE(
[encryption],
[AS_HELP_STRING(
[--disable-encryption],
[disable encryption support (requires OpenSSL to be installed on your system, you can use --with-openssl to set the path) [default=yes]])],
[[ARG_ENABLE_ENCRYPTION=$enableval]],
[[ARG_ENABLE_ENCRYPTION=yes]]
)
AC_ARG_ENABLE(
[pool-allocators],
[AS_HELP_STRING(
[--disable-pool-allocators],
[disable pool allocators for send buffers [default=yes]])],
[[ARG_ENABLE_POOL_ALLOC=$enableval]],
[[ARG_ENABLE_POOL_ALLOC=yes]]
)
AC_ARG_ENABLE(
[invariant-checks],
[AS_HELP_STRING(
[--enable-invariant-checks],
[enable invariant checks (use value "full" to turn on extra expensive invariant checks) @<:@default=yes if debug is enabled, no otherwhise@:>@])],
[[ARG_ENABLE_INVARIANT=$enableval]],
[[if test "x$ac_arg_enable_debug" = "xno" ; then ARG_ENABLE_INVARIANT=no ; else ARG_ENABLE_INVARIANT=yes ; fi]]
)
AC_ARG_ENABLE(
[deprecated-functions],
[AS_HELP_STRING(
[--disable-deprecated-functions],
[disable deprecated functions from the API [default=yes]])],
[[ARG_ENABLE_DEPRECATED=$enableval]],
[[ARG_ENABLE_DEPRECATED=yes]]
)
AC_ARG_ENABLE(
[statistics],
[AS_HELP_STRING(
[--enable-statistics],
[enable statistics logging feature [default=no]])],
[[ARG_ENABLE_STATS=$enableval]],
[[ARG_ENABLE_STATS=no]]
)
AC_ARG_ENABLE(
[disk-stats],
[AS_HELP_STRING(
[--enable-disk-stats],
[enable disk activity logging feature [default=no]])],
[[ARG_ENABLE_DISK_STATS=$enableval]],
[[ARG_ENABLE_DISK_STATS=no]]
)
AC_ARG_ENABLE(
[geoip],
[AS_HELP_STRING(
[--disable-geoip],
[disable geoip support (if enabled, you can use --with-libgeoip to choose whether to link against shipped or system library) [default=yes]])],
[[ARG_ENABLE_GEOIP=$enableval]],
[[ARG_ENABLE_GEOIP=yes
ac_arg_enable_geoip=yes]]
)
AC_ARG_ENABLE(
[examples],
[AS_HELP_STRING(
[--enable-examples],
[build example files [default=no]])],
[[ARG_ENABLE_EXAMPLES=$enableval]],
[[ARG_ENABLE_EXAMPLES=no]]
)
AC_ARG_ENABLE(
[tests],
[AS_HELP_STRING(
[--enable-tests],
[build test files [default=no]])],
[[ARG_ENABLE_TESTS=$enableval]],
[[ARG_ENABLE_TESTS=no]]
)
AC_ARG_ENABLE(
[python-binding],
[AS_HELP_STRING(
[--enable-python-binding],
[build python bindings [default=no]])],
[[ARG_ENABLE_PYTHON_BINDING=$enableval]],
[[ARG_ENABLE_PYTHON_BINDING=no]]
)
AC_ARG_WITH(
[zlib],
[AS_HELP_STRING(
[--without-zlib],
[disable linking against system zlib [default=system]])],
[[ARG_WITH_ZLIB=$withval]],
[[ARG_WITH_ZLIB=yes]]
)
AC_ARG_WITH(
[libgeoip],
[AS_HELP_STRING(
[--with-libgeoip],
[enable linking against system libgeoip [default=shipped]])],
[[ARG_WITH_LIBGEOIP=$withval]],
[[ARG_WITH_LIBGEOIP=no]]
)
###############################################################################
# Checking configure options
###############################################################################
AS_ECHO
AS_ECHO "Checking build options:"
AC_MSG_CHECKING([whether deprecated functions should be enabled])
AS_CASE(["$ARG_ENABLE_DEPRECATED"],
["yes"|"on"], [
AC_MSG_RESULT([yes])
],
["no"|"off"], [
AC_MSG_RESULT([no])
AC_DEFINE([TORRENT_NO_DEPRECATE],[1],[Define to exclude all deprecated functions from the API.])
],
[AC_MSG_RESULT([$ARG_ENABLE_DEPRECATED])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_DEPRECATED". Use either "yes" or "no".])]
)
AC_MSG_CHECKING([whether debug build should be enabled])
AS_CASE(["$ARG_ENABLE_DEBUG"],
["yes"], [
AC_MSG_RESULT([yes])
AC_DEFINE([TORRENT_DEBUG],[1],[Define to enable debug code.])
COMPILETIME_OPTIONS+="-DTORRENT_DEBUG "
DEBUGFLAGS="-g"
ac_arg_enable_debug=yes
],
["no"], [
AC_MSG_RESULT([no])
AC_DEFINE([NDEBUG],[1],[Define to disable debug code.])
#COMPILETIME_OPTIONS+="-DNDEBUG "
DEBUGFLAGS="-Os"
ac_arg_enable_debug=no
],
[AC_MSG_RESULT([$ARG_ENABLE_DEBUG])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_DEBUG". Use either "yes" or "no".])]
)
AC_MSG_CHECKING([whether invariant check should be enabled]) #depends: $ac_arg_enable_debug
AS_CASE(["$ARG_ENABLE_INVARIANT"],
["yes"|"on"], [
AC_MSG_RESULT([yes])
AS_IF([test "x$ac_arg_enable_debug" = "xno"],
[AC_MSG_ERROR([invariant-checks: this setting only affects debug build. Try using --enable-debug.])])
],
["no"|"off"], [
AC_MSG_RESULT([no])
AS_IF([test "x$ac_arg_enable_debug" = "xyes"],
[AC_DEFINE([TORRENT_DISABLE_INVARIANT_CHECKS],[1],[Define to disable internal invariant checks. Asserts are still enabled while debug is on.])])
],
["full"], [
AC_MSG_RESULT([full])
AS_IF([test "x$ac_arg_enable_debug" = "xyes"],
[AC_DEFINE([TORRENT_EXPENSIVE_INVARIANT_CHECKS],[1],[Define to enable extra expensive invariant checks.])],
[AC_MSG_ERROR([invariant-checks: this setting only affects debug build. Try using --enable-debug.])])
],
[AC_MSG_RESULT([$ARG_ENABLE_INVARIANT])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_INVARIANT". Use either "yes", "no" or "full".])]
)
AC_MSG_CHECKING([whether logging to disk should be enabled])
AS_CASE(["$ARG_ENABLE_LOGGING"],
["yes"|"default"], [
AC_MSG_RESULT([yes])
AC_DEFINE([TORRENT_LOGGING],[1],[Define to enable logging of the session events.])
COMPILETIME_OPTIONS+="-DTORRENT_LOGGING "
],
["no"|"none"], [
AC_MSG_RESULT([no])
],
["verbose"], [
AC_MSG_RESULT([verbose])
AC_DEFINE([TORRENT_VERBOSE_LOGGING],[1],[Define to enable logging of the session events and every peer connection.])
COMPILETIME_OPTIONS+="-DTORRENT_VERBOSE_LOGGING "
],
["errors"], [
AC_MSG_RESULT([errors])
AC_DEFINE([TORRENT_ERROR_LOGGING],[1],[Define to enable logging of the session events and every peer connection limited to errors.])
COMPILETIME_OPTIONS+="-DTORRENT_ERROR_LOGGING "
],
[AC_MSG_RESULT([$ARG_ENABLE_LOGGING])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_LOGGING". Use either "yes", "no", "verbose" or "errors".])]
)
AC_MSG_CHECKING([whether statistics logging should be enabled])
AS_CASE(["$ARG_ENABLE_STATS"],
["yes"|"on"], [
AC_MSG_RESULT([yes])
AC_DEFINE([TORRENT_STATS],[1],[Define to generate a log with statistics.])
],
["no"|"off"], [
AC_MSG_RESULT([no])
],
[AC_MSG_RESULT([$ARG_ENABLE_STATS])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_STATS". Use either "yes" or "no".])]
)
AC_MSG_CHECKING([whether disk activity logging should be enabled])
AS_CASE(["$ARG_ENABLE_DISK_STATS"],
["yes"|"on"], [
AC_MSG_RESULT([yes])
AC_DEFINE([TORRENT_DISK_STATS],[1],[Define to create a log of all disk activities.])
],
["no"|"off"], [
AC_MSG_RESULT([no])
],
[AC_MSG_RESULT([$ARG_ENABLE_DISK_STATS])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_DISK_STATS". Use either "yes" or "no".])]
)
AS_ECHO
AS_ECHO "Checking features to be enabled:"
AC_MSG_CHECKING([whether encryption support should be enabled])
AS_CASE(["$ARG_ENABLE_ENCRYPTION"],
["yes"|"on"], [
AC_MSG_RESULT([yes])
AC_MSG_NOTICE([encryption support: now checking for the OpenSSL library...])
AX_CHECK_OPENSSL([
AC_DEFINE([TORRENT_USE_OPENSSL],[1],[Define to use OpenSSL support.])
COMPILETIME_OPTIONS+="-DTORRENT_USE_OPENSSL "
], [
AC_MSG_ERROR([OpenSSL library not found. Try using --with-openssl=DIR or disabling encryption at all.])
])
],
["no"|"off"], [
AC_MSG_RESULT([no])
AC_DEFINE([TORRENT_DISABLE_ENCRYPTION],[1],[Define to disable any encryption support and avoid linking against OpenSSL.])
COMPILETIME_OPTIONS+="-DTORRENT_DISABLE_ENCRYPTION "
],
[AC_MSG_RESULT([$ARG_ENABLE_ENCRYPTION])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_ENCRYPTION". Use either "yes" or "no".])]
)
AC_MSG_CHECKING([whether geoip support should be enabled])
AS_CASE(["$ARG_ENABLE_GEOIP"],
["yes"], [
AC_MSG_RESULT([yes])
],
["no"], [
AC_MSG_RESULT([no])
AC_DEFINE([TORRENT_DISABLE_GEO_IP],[1],[Define to disable the GeoIP support and avoid linking against LGPLed code.])
ac_arg_enable_geoip="no"
],
[AC_MSG_RESULT([$ARG_ENABLE_GEOIP])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_GEOIP". Use either "yes" or "no".])]
)
AC_MSG_CHECKING([whether dht support should be enabled])
AS_CASE(["$ARG_ENABLE_DHT"],
["yes"|"on"], [
AC_MSG_RESULT([yes])
],
["no"|"off"], [
AC_MSG_RESULT([no])
AC_DEFINE([TORRENT_DISABLE_DHT],[1],[Define to disable the DHT support.])
COMPILETIME_OPTIONS+="-DTORRENT_DISABLE_DHT "
],
["logging"], [
AC_MSG_RESULT([logging])
AC_DEFINE([TORRENT_DHT_VERBOSE_LOGGING],[1],[Define to enable DHT support with verbose logging.])
COMPILETIME_OPTIONS+="-DTORRENT_DHT_VERBOSE_LOGGING "
],
[AC_MSG_RESULT([$ARG_ENABLE_DHT])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_DHT". Use either "yes", "no" or "logging".])]
)
AC_MSG_CHECKING([whether pool allocators should be enabled])
AS_CASE(["$ARG_ENABLE_POOL_ALLOC"],
["yes"|"on"], [
AC_MSG_RESULT([yes])
],
["no"|"off"], [
AC_MSG_RESULT([no])
AC_DEFINE([TORRENT_DISABLE_POOL_ALLOCATOR],[1],[Define to disable use of boost::pool for pool allocators.])
],
[AC_MSG_RESULT([$ARG_ENABLE_POOL_ALLOC])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_POOL_ALLOC". Use either "yes" or "no".])]
)
AS_ECHO
AS_ECHO "Checking for extra build files:"
AC_MSG_CHECKING([whether example files should be built])
AS_CASE(["$ARG_ENABLE_EXAMPLES"],
["yes"], [AC_MSG_RESULT([yes])],
["no"], [AC_MSG_RESULT([no])],
[AC_MSG_RESULT([$ARG_ENABLE_EXAMPLES])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_EXAMPLES". Use either "yes" or "no".])]
)
AC_MSG_CHECKING([whether test files should be built])
AS_CASE(["$ARG_ENABLE_TESTS"],
["yes"], [AC_MSG_RESULT([yes])],
["no"], [AC_MSG_RESULT([no])],
[AC_MSG_RESULT([$ARG_ENABLE_TESTS])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_TESTS". Use either "yes" or "no".])]
)
AC_MSG_CHECKING([whether python bindings should be built])
AS_CASE(["$ARG_ENABLE_PYTHON_BINDING"],
["yes"], [
AC_MSG_RESULT([yes])
AM_PATH_PYTHON([2.4], [], AC_MSG_ERROR([Python interpreter not found.]))
AX_PYTHON()
AX_BOOST_PYTHON()
AS_IF([test -z "$BOOST_PYTHON_LIB"],
[AC_MSG_ERROR([Boost.Python library not found. Try using --with-boost-python=lib.])])
],
["no"], [
AC_MSG_RESULT([no])
],
[AC_MSG_RESULT([$ARG_ENABLE_PYTHON_BINDING])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_PYTHON_BINDING". Use either "yes" or "no".])]
)
AS_ECHO
AS_ECHO "Checking for external libraries:"
AC_MSG_CHECKING([whether to link against system zlib])
AS_CASE(["$ARG_WITH_ZLIB"],
["yes"|"system"], [
AC_MSG_RESULT([yes])
AC_CHECK_HEADER([zlib.h], [
AC_CHECK_LIB([z], [main], [],
[AC_MSG_ERROR([zlib library not found. Try using --without-zlib to link against the shipped copy.])])],
[AC_MSG_ERROR([zlib header not found. Try using --without-zlib to link against the shipped copy.])])
],
["no"|"shipped"], [
AC_MSG_RESULT([no])
AC_MSG_NOTICE([zlib: linking against shipped zlib.])
#AC_SUBST([ZLIB], ["\$(top_builddir)/zlib/libzlib.la"])
#AC_SUBST([ZLIBINCL], ["-I\$(top_srcdir)/zlib"])
#AC_MSG_NOTICE([zlib= $ZLIB zlibincl= $ZLIBINCL])
ARG_WITH_ZLIB="no"
],
[AC_MSG_RESULT([$ARG_WITH_ZLIB])
AC_MSG_ERROR([Unknown option "$ARG_WITH_ZLIB". Use either "yes" or "no".])]
)
AC_MSG_CHECKING([whether to link against system libgeoip]) #depends: $ac_arg_enable_geoip
AS_CASE(["$ARG_WITH_LIBGEOIP"],
["yes"|"system"], [
AC_MSG_RESULT([yes])
AS_IF([test "x$ac_arg_enable_geoip" = "xno"],
[AC_MSG_ERROR([GeoIP support is disabled with this build configuration. Try using --enable-geoip.])])
AC_MSG_NOTICE([libgeoip: now checking for the libgeoip library...])
AC_CHECK_GEOIP([
LIBS="$GEOIP_LIBS $LIBS"
CFLAGS="$GEOIP_CFLAGS $CFLAGS"
],[
AC_MSG_ERROR([GeoIP library not found. Try using --without-libgeoip to link against the shipped copy.])
])
],
["no"|"shipped"], [
AS_IF([test "x$ac_arg_enable_geoip" = "xno"], [
# if geoip support is disabled via --disable-geoip,
# prevent from building/linking libgeoip at all
# (either system or shipped)
AC_MSG_RESULT([disabled])
ARG_WITH_LIBGEOIP="disabled"
], [
AC_MSG_RESULT([no])
ARG_WITH_LIBGEOIP="no"
])
],
[AC_MSG_RESULT([$ARG_WITH_LIBGEOIP])
AC_MSG_ERROR([Unknown option "$ARG_WITH_LIBGEOIP". Use either "yes" or "no".])]
)
###############################################################################
# Setting conditional variables for Makefiles
###############################################################################
AM_CONDITIONAL([ENABLE_DHT], [test "x$ARG_ENABLE_DHT" = "xyes"])
AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$ARG_ENABLE_EXAMPLES" = "xyes"])
AM_CONDITIONAL([ENABLE_TESTS], [test "x$ARG_ENABLE_TESTS" = "xyes"])
AM_CONDITIONAL([ENABLE_PYTHON_BINDING], [test "x$ARG_ENABLE_PYTHON_BINDING" = "xyes"])
AM_CONDITIONAL([WITH_SHIPPED_ZLIB], [test "x$ARG_WITH_ZLIB" = "xno" ])
AM_CONDITIONAL([WITH_SHIPPED_GEOIP], [test "x$ARG_WITH_LIBGEOIP" = "xno" ])
###############################################################################
#
###############################################################################
# this works around a bug in asio in boost-1.39
# see: https://svn.boost.org/trac/boost/ticket/3095
AC_DEFINE([BOOST_ASIO_HASH_MAP_BUCKETS],[1021],[Define to fix a wrong behavior in boost 1.39.])
COMPILETIME_OPTIONS+="-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 "
AC_DEFINE([BOOST_EXCEPTION_DISABLE],[1],[Define to disable the boost.exception features.])
COMPILETIME_OPTIONS+="-DBOOST_EXCEPTION_DISABLE "
dnl Use possibly specific python install params
AC_ARG_VAR([PYTHON_INSTALL_PARAMS], [Set specific install parameters for python bindings.])
AS_IF([test "x$PYTHON_INSTALL_PARAMS" = "x"],
[PYTHON_INSTALL_PARAMS='--prefix=$(DESTDIR)$(prefix)'])
dnl Set some defines if we are building a shared library
AS_IF([test "x$enable_shared" = "xyes"],
[AC_DEFINE([TORRENT_BUILDING_SHARED],[1],[Define to exports functions and classes with default visibility in GCC.])
COMPILETIME_OPTIONS+="-DTORRENT_LINKING_SHARED "])
AC_SUBST(DEBUGFLAGS)
AC_SUBST(PYTHON_INSTALL_PARAMS)
AC_SUBST(COMPILETIME_OPTIONS)
###############################################################################
# Generating Makefiles
###############################################################################
AS_ECHO
AS_ECHO "Generating Makefiles:"
AC_CONFIG_FILES(
[Makefile]
[src/Makefile]
[include/libtorrent/Makefile]
[examples/Makefile]
[test/Makefile]
[zlib/Makefile]
[bindings/Makefile]
[bindings/python/Makefile]
[bindings/python/setup.py]
[libtorrent-rasterbar.pc]
[libtorrent-rasterbar-cmake.pc]
)
AC_OUTPUT
###############################################################################
# Generating config.report
###############################################################################
AS_ECHO
AS_ECHO "Configure script has finished system check."
AS_ECHO
cat > config.report << END
Config results:
-=-=-=-=-=-=-=-=-
Package:
name: ${PACKAGE_NAME}
version: ${PACKAGE_VERSION}
svn revision: ${SVN_REVISION}
Build environment:
build system: ${build}
host system: ${host}
target system: ${target}
Compiler and linker flags:
CPPFlags: ${CPPFLAGS}
CFlags: ${CFLAGS}
CXXFlags: ${CXXFLAGS}
LDFlags: ${LDFLAGS}
Libs: ${LIBS}
Defs: ${DEFS}
Build options:
deprecated functions: ${ARG_ENABLE_DEPRECATED:-yes}
debug build: ${ARG_ENABLE_DEBUG:-no}
invariant checks: ${ARG_ENABLE_INVARIANT:-no}
logging support: ${ARG_ENABLE_LOGGING:-no}
statistics: ${ARG_ENABLE_STATS:-no}
disk statistics: ${ARG_ENABLE_DISK_STATS:-no}
Features:
encryption support: ${ARG_ENABLE_ENCRYPTION:-yes}
geoip support: ${ARG_ENABLE_GEOIP:-yes}
dht support: ${ARG_ENABLE_DHT:-yes}
pool allocators: ${ARG_ENABLE_POOL_ALLOC:-yes}
Extra builds:
examples: ${ARG_ENABLE_EXAMPLES:-no}
tests: ${ARG_ENABLE_TESTS:-no}
python bindings: ${ARG_ENABLE_PYTHON_BINDING:-no}
Pthread library:
CFlags: ${PTHREAD_CFLAGS}
Libs: ${PTHREAD_LIBS}
Boost libraries:
version: ${BOOST_VERSION}
CPPFlags: ${BOOST_CPPFLAGS}
LDFlags: ${BOOST_LDFLAGS}
boost.system: ${BOOST_SYSTEM_LIB}
boost.filesystem: ${BOOST_FILESYSTEM_LIB}
boost.thread: ${BOOST_THREAD_LIB}
END
AS_IF([test "x$ARG_ENABLE_PYTHON_BINDING" = "xyes"], [
cat >> config.report << END
boost.python: ${BOOST_PYTHON_LIB}
Python environment:
-automake-
binary: ${PYTHON}
version: ${PYTHON_VERSION}
platform: ${PYTHON_PLATFORM}
-m4-
binary: ${PYTHON_BIN}
library: ${PYTHON_LIB}
include dir: ${PYTHON_INCLUDE_DIR}
END
])
cat >> config.report << END
External libraries:
system zlib: ${ARG_WITH_ZLIB:-yes}
system libgeoip: ${ARG_WITH_LIBGEOIP:-no}
END
AS_IF([test "x$ARG_WITH_LIBGEOIP" = "xyes"], [
cat >> config.report << END
GeoIP library:
GeoIP CFlags: ${GEOIP_CFLAGS}
GeoIP Libs: ${GEOIP_LIBS}
END
])
AS_IF([test "x$ARG_ENABLE_ENCRYPTION" = "xyes"], [
cat >> config.report << END
OpenSSL library:
OpenSSL Libs: ${OPENSSL_LIBS}
OpenSSL LDFlags: ${OPENSSL_LDFLAGS}
OpenSSL Includes: ${OPENSSL_INCLUDES}
END
])
cat config.report
AS_ECHO
AS_ECHO "Type 'make' to compile $PACKAGE_STRING"
AS_ECHO "or type 'make V=1' for verbose compiling"
AS_ECHO "and then 'make install' to install it into $prefix"
AS_ECHO

View File

@ -1,460 +0,0 @@
AC_PREREQ(2.60)
AC_INIT([libtorrent-rasterbar], [0.15.0], [arvid@cs.umu.se])
AM_INIT_AUTOMAKE(foreign 1.10)
AC_CONFIG_SRCDIR([src/torrent.cpp])
dnl ---------------------------------------------------------------------------
dnl interface version info
dnl ---------------------------------------------------------------------------
dnl Advanced information about versioning:
dnl * "Writing shared libraries" by Mike Hearn
dnl http://navi.cx/~mike/writing-shared-libraries.html
dnl * libtool.info chapter "Versioning"
dnl * libtool.info chapter "Updating library version information"
dnl ---------------------------------------------------------------------------
dnl Versioning:
dnl - CURRENT (Major): Increment if the interface has changes. AGE is always
dnl *changed* at the same time.
dnl - AGE (Micro): Increment if any interfaces have been added; set to 0
dnl if any interfaces have been removed. Removal has
dnl precedence over adding, so set to 0 if both happened.
dnl It denotes upward compatibility.
dnl - REVISION (Minor): Increment any time the source changes; set to
dnl 0 if you incremented CURRENT.
dnl
dnl To summarize. Any interface *change* increment CURRENT. If that interface
dnl change does not break upward compatibility (ie it is an addition),
dnl increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed,
dnl REVISION is set to 0, otherwise REVISION is incremented.
dnl ---------------------------------------------------------------------------
VERSION_INFO_CURRENT=6
VERSION_INFO_REVISION=0
VERSION_INFO_AGE=0
INTERFACE_VERSION_INFO=$VERSION_INFO_CURRENT:$VERSION_INFO_REVISION:$VERSION_INFO_AGE
AC_SUBST(INTERFACE_VERSION_INFO)
dnl ---------------------------------------------------------------------------
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC
if test -z "$(which $CC)"; then
AC_MSG_ERROR([Unable to find a working C compiler, giving up.])
fi
AC_PROG_CPP
AC_PROG_CXX
if test -z "$(which $CXX)"; then
AC_MSG_ERROR([Unable to find a working C++ compiler, giving up.])
fi
AC_CACHE_SAVE
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
# AC_PROG_RANLIB is obsolete by AC_PROC_LIBTOOL
AC_SYS_LARGEFILE
dnl Check for pthreads.
ACX_PTHREAD
dnl Pass some build options to setup.py and .pc file
COMPILETIME_OPTIONS=""
AM_CONDITIONAL([ENABLE_SHIPPED_ASIO], false)
dnl Check for boost libraries.
AX_BOOST_BASE([1.35],[
AX_BOOST_SYSTEM
dnl check that Boost.System was found:
if test -z "$BOOST_SYSTEM_LIB"; then
AC_MSG_ERROR([unable to find Boost.System library, currently this is required.])
fi
AX_BOOST_ASIO
dnl check that Boost.Asio was found:
if test -z "$BOOST_ASIO_LIB"; then
AC_MSG_ERROR([Unable to find Boost.Asio library, currently this is required.])
fi
],[
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|your_path],
[Specify the Asio library to use, shipped or system. Default is to use shipped library. You can also specify a path for your system.]),
[[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=`dirname $0`/include/libtorrent/asio.hpp
ASIO_DIR=`dirname $0`/include/libtorrent/asio
AC_CHECK_FILES($ASIO_HPP $ASIO_DIR/ssl/stream.hpp $ASIO_DIR/ip/tcp.hpp,
enable_shipped_asio=yes,
AC_MSG_ERROR([libtorrent-rasterbar 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,
enable_shipped_asio=no,
AC_MSG_ERROR([libtorrent-rasterbar depends on Asio library but it was not found on your system.])
)
;;
*)
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,
enable_shipped_asio=no,
AC_MSG_ERROR([libtorrent-rasterbar depends on Asio library but it was not found in the path you specified.])
)
;;
esac
AM_CONDITIONAL([ENABLE_SHIPPED_ASIO], [test x$enable_shipped_asio = "xyes"])
])
])
AC_MSG_NOTICE([BOOST_CPPFLAGS=$BOOST_CPPFLAGS])
AC_MSG_NOTICE([BOOST_LDFLAGS=$BOOST_LDFLAGS])
AX_BOOST_FILESYSTEM
dnl check that Boost.Filesystem was found:
if test -z "$BOOST_FILESYSTEM_LIB"; then
AC_MSG_ERROR([Unable to find Boost.Filesystem library, currently this is required.])
fi
AX_BOOST_THREAD
dnl check that Boost.Thread was found:
if test -z "$BOOST_THREAD_LIB"; then
AC_MSG_ERROR([Unable to find Boost.Thread library, currently this is required.])
fi
AX_BOOST_REGEX
dnl check that Boost.Regex was found:
if test -z "$BOOST_REGEX_LIB"; then
AC_MSG_RESULT([Unable to find Boost.Regex library, example test_client will not be build.])
BUILD_TESTCLIENT=no;
fi
dnl Apply boost config.
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
if [[ "x$BUILD_TESTCLIENT" != "xno" ]]; then
CLIENT_TEST_BIN=client_test;
AC_SUBST(CLIENT_TEST_BIN)
fi
dnl try different ways of resolving gethostbyname
AC_CHECK_FUNC(gethostbyname, ,
AC_CHECK_LIB(resolv, gethostbyname, ,
AC_CHECK_LIB(nsl, gethostbyname, ,
AC_CHECK_LIB(ws2_32, main,
AC_CHECK_LIB(wsock32, main, [LIBS="$LIBS -lws2_32 -lwsock32";] ,
AC_MSG_ERROR([wsock32 not found. Stopped.])) ,
AC_MSG_ERROR([gethostbyname not found. Stopped.]))))
)
dnl find out what kind of logging to use
AC_ARG_WITH(
[logging],
AS_HELP_STRING([--with-logging=none|default|verbose],[Specify how much logging to use. Default is none.]),
[[logging=$withval]],
[[logging=none]]
)
# this works around a bug in asio in boost-1.39
# see: https://svn.boost.org/trac/boost/ticket/3095
AC_DEFINE(BOOST_ASIO_HASH_MAP_BUCKETS,1021,)
COMPILETIME_OPTIONS+="-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 "
dnl Check the value for the --with-logging switch
AC_MSG_CHECKING([what form of logging to use])
case "$logging" in
"none")
AC_MSG_RESULT(none)
;;
"default")
AC_MSG_RESULT(default)
AC_DEFINE(TORRENT_LOGGING,,[define to use some logging])
COMPILETIME_OPTIONS+="-DTORRENT_LOGGING "
;;
"verbose")
AC_MSG_RESULT(verbose)
AC_DEFINE(TORRENT_VERBOSE_LOGGING,,[define to use verbose logging])
COMPILETIME_OPTIONS+="-DTORRENT_VERBOSE_LOGGING "
;;
*)
AC_MSG_RESULT()
AC_MSG_ERROR([Unknown logging option "$logging". Use either "none", "default" or "verbose".])
;;
esac
dnl find out what kind of dht-support to use
AC_ARG_WITH(
[dht],
AS_HELP_STRING([--with-dht=on|off|logging],[Specify how to use DHT support. Option logging will add extra logging. Default is on.]),
[[dht=$withval]],
[[dht=on]]
)
dnl Check the value for the --with-dht switch
AC_MSG_CHECKING([how to use DHT])
case "$dht" in
"on")
AC_MSG_RESULT(on)
;;
"off")
AC_MSG_RESULT(off)
AC_DEFINE(TORRENT_DISABLE_DHT,,[define not to use DHT support])
COMPILETIME_OPTIONS+="-DTORRENT_DISABLE_DHT "
;;
"logging")
AC_MSG_RESULT(logging)
AC_DEFINE(TORRENT_DHT_VERBOSE_LOGGING,,[define to use DHT support with extra logging])
COMPILETIME_OPTIONS+="-DTORRENT_DHT_VERBOSE_LOGGING "
;;
*)
AC_MSG_RESULT()
AC_MSG_ERROR([Unknown dht option "$dht". Use either "on", "off" or "logging".])
;;
esac
AM_CONDITIONAL(USE_DHT, test "x$dht" != "xoff")
dnl encryption support.
AC_ARG_WITH(
[encryption],
AS_HELP_STRING([--with-encryption=on|off],[Specify how to use encryption support. Default is on.]),
[[encryption=$withval]],
[[encryption=on]]
)
dnl Check the value for the --with-encryption switch
AC_MSG_CHECKING([how to use encryption])
case "$encryption" in
"on")
AC_MSG_RESULT(on)
CHECK_SSL()
AC_DEFINE(TORRENT_USE_OPENSSL,,[define to use openssl with libtorrent-rasterbar])
COMPILETIME_OPTIONS+="-DTORRENT_USE_OPENSSL "
;;
"off")
AC_MSG_RESULT(off)
AC_DEFINE(TORRENT_DISABLE_ENCRYPTION,,[define not to use encryption support])
COMPILETIME_OPTIONS+="-DTORRENT_DISABLE_ENCRYPTION "
;;
*)
AC_MSG_RESULT()
AC_MSG_ERROR([Unknown encryption option "$encryption". Use either "on" or "off".])
;;
esac
AM_CONDITIONAL(USE_ENCRYPTION, test "x$encryption" != "xoff")
dnl the user can choose which zlib to use
AC_ARG_WITH(
[zlib],
AS_HELP_STRING([--with-zlib=shipped|system],[Specify the zlib to use, shipped or system. Default is to autodetect system and fallback to shipped.]),
[[zlib=$withval]],
[[zlib=detect]]
)
dnl Check the value for the --with-zlib switch
AC_MSG_CHECKING([which zlib implementation to use])
case "$zlib" in
"detect")
AC_MSG_RESULT([autodetect])
AC_CHECK_LIB(z, main, ,
[zlib="shipped"]
)
;;
"shipped")
AC_MSG_RESULT(shipped)
;;
"system")
AC_MSG_RESULT(system)
AC_CHECK_LIB(z, main, ,
AC_MSG_ERROR([libtorrent-rasterbar depends on zlib but zlib was not found on your system.])
)
;;
"no")
AC_MSG_RESULT()
AC_MSG_ERROR([libtorrent-rasterbar depends on zlib, you must specify either "system" or "shipped".])
;;
*)
AC_MSG_RESULT()
AC_MSG_ERROR([Unknown zlib option "$zlib". Use either "system" or "shipped".])
;;
esac
if [[ "$zlib" = "shipped" ]]; then
ZLIB="\$(top_builddir)/zlib/libzlib.la"
AM_CONDITIONAL([ENABLE_SHIPPED_ZLIB], true)
ZLIBINCL="-I\$(top_srcdir)/zlib"
elif [[ "$zlib" = "system" ]] || [[ "$zlib" = "detect" ]]; then
ZLIB="" # AC_CHECK_LIB will add -lz to @LIBS@ automatically
AM_CONDITIONAL([ENABLE_SHIPPED_ZLIB], false)
ZLIBINCL=""
fi
dnl make ZLIB and ZLIBDIR visible to Makefiles
AC_SUBST([ZLIB])
AC_SUBST([ZLIBINCL])
dnl Check whether python bindings should be build
AC_ARG_ENABLE(
[python-binding],
AS_HELP_STRING([--enable-python-binding],[Build python binding. Default is to not build them.]),
[[ac_python_binding=$enableval]],
[[ac_python_binding=no]]
)
AC_MSG_CHECKING([if python bindings should be build])
case "$ac_python_binding" in
"yes")
AC_MSG_RESULT(yes)
AM_PATH_PYTHON([2.4],,AC_MSG_ERROR([Python not found. Python is required to build python binding.]))
AX_BOOST_PYTHON
dnl check that Boost.Python was found:
if test -z "$BOOST_PYTHON_LIB"; then
AC_MSG_ERROR([Unable to find Boost.Python library, this is required to build python bindings.])
fi
AM_CONDITIONAL([ENABLE_PYTHON_BINDING],true)
;;
"no")
AC_MSG_RESULT(no)
AM_CONDITIONAL([ENABLE_PYTHON_BINDING],false)
;;
"")
AC_MSG_RESULT(no)
AM_CONDITIONAL([ENABLE_PYTHON_BINDING],false)
;;
*)
AC_MSG_RESULT()
AC_MSG_ERROR([Unknown --enable-python option "$python". Use either "yes" or "no".])
;;
esac
dnl Use possibly specific python install params
if [[ "x$PYTHON_INSTALL_PARAMS" == "x" ]]; then
PYTHON_INSTALL_PARAMS='--prefix=$(DESTDIR)$(prefix)'
fi
AC_SUBST(PYTHON_INSTALL_PARAMS)
dnl Check whether the examples should be build
AC_ARG_ENABLE(
[examples],
AS_HELP_STRING([--enable-examples],[Build the examples. Default is not to build them.]),
[[examples=$enableval]],
[[examples=no]]
)
dnl Check the value of the --with-examples switch
AC_MSG_CHECKING([if the examples should be build])
case "$examples" in
"yes")
AC_MSG_RESULT(yes)
AM_CONDITIONAL([ENABLE_EXAMPLES], true)
;;
"no")
AC_MSG_RESULT(no)
AM_CONDITIONAL([ENABLE_EXAMPLES], false)
;;
"")
AC_MSG_RESULT(yes (default))
AM_CONDITIONAL([ENABLE_EXAMPLES], true)
;;
*)
AC_MSG_RESULT()
AC_MSG_ERROR([Unknown --enable-examples option "$examples". Use either "yes" or "no".])
;;
esac
dnl Check whether the tests should be build
AC_ARG_ENABLE(
[tests],
AS_HELP_STRING([--enable-tests],[Build test files. Default is not to build them.]),
[[tests=$enableval]],
[[tests=no]]
)
dnl Check the value of the --with-tests switch
AC_MSG_CHECKING([if test files should be build])
case "$tests" in
"yes")
AC_MSG_RESULT(yes)
AM_CONDITIONAL([ENABLE_TESTS], true)
;;
"no")
AC_MSG_RESULT(no)
AM_CONDITIONAL([ENABLE_TESTS], false)
;;
"")
AC_MSG_RESULT(yes (default))
AM_CONDITIONAL([ENABLE_TESTS], true)
;;
*)
AC_MSG_RESULT()
AC_MSG_ERROR([Unknown --enable-tests option "$tests". Use either "yes" or "no".])
;;
esac
dnl Set some defines if we are building a shared library
if [[ "x$enable_shared" == "xyes" ]]; then
AC_DEFINE(TORRENT_BUILDING_SHARED,,[Make sure the functions and classes are exported.])
COMPILETIME_OPTIONS+="-DTORRENT_LINKING_SHARED "
fi
AC_DEFINE(BOOST_EXCEPTION_DISABLE,,[We do not need boost.exception features])
COMPILETIME_OPTIONS+="-DBOOST_EXCEPTION_DISABLE "
dnl want some debugging symbols with that?
AC_ARG_ENABLE(
[debug],
AS_HELP_STRING([--enable-debug],[Set compiler flags for debug symbols, default is no debugging.]),
[case "$enableval" in
no)
AC_DEFINE(NDEBUG,,[Define to disable debugging])
DEBUGFLAGS="-Os"
# COMPILETIME_OPTIONS+="-DNDEBUG "
;;
yes)
DEBUGFLAGS="-g"
COMPILETIME_OPTIONS+="-DTORRENT_DEBUG "
AC_DEFINE(TORRENT_DEBUG,,[Define to enable libtorrent debug build])
;;
*)
AC_MSG_RESULT()
AC_MSG_ERROR([Unknown --enable-debug option "$enableval". Use either "yes" or "no".])
;;
esac],
[DEBUGFLAGS="-Os"
AC_DEFINE(NDEBUG,,[Define to disable debugging])
# COMPILETIME_OPTIONS+="-DNDEBUG "
]
)
AC_SUBST(DEBUGFLAGS)
dnl Compile time options.
AC_SUBST(COMPILETIME_OPTIONS)
AC_OUTPUT([Makefile
src/Makefile
include/Makefile
zlib/Makefile
examples/Makefile
test/Makefile
bindings/python/Makefile
bindings/python/setup.py
libtorrent-rasterbar.pc])

View File

@ -1,25 +1,36 @@
example_programs = \
client_test \
dump_torrent \
enum_if \
make_torrent \
simple_client
if ENABLE_EXAMPLES
# no indent here! - BSD make issue
bin_PROGRAMS = @CLIENT_TEST_BIN@ dump_torrent make_torrent simple_client enum_if
bin_PROGRAMS = $(example_programs)
endif
EXTRA_PROGRAMS = client_test dump_torrent make_torrent simple_client enum_if
EXTRA_PROGRAMS = $(example_programs)
EXTRA_DIST = Jamfile
client_test_SOURCES = client_test.cpp
client_test_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la @BOOST_REGEX_LIB@
#client_test_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
dump_torrent_SOURCES = dump_torrent.cpp
dump_torrent_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
#dump_torrent_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
make_torrent_SOURCES = make_torrent.cpp
make_torrent_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
#make_torrent_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
simple_client_SOURCES = simple_client.cpp
simple_client_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
#simple_client_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
enum_if_SOURCES = enum_if.cpp
enum_if_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
#enum_if_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
AM_CXXFLAGS=-ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @DEBUGFLAGS@ @PTHREAD_CFLAGS@
LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
AM_LDFLAGS= ${LDLAGS} -L./ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LDFLAGS@ @SSL_LIBS@
AM_CPPFLAGS = -ftemplate-depth-50 -I$(top_srcdir)/include @DEBUGFLAGS@
#AM_LDFLAGS = ${LDLAGS} -L./ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@
#AM_LDFLAGS = $(LDFLAGS) @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@
#AM_LDFLAGS = @OPENSSL_LDFLAGS@

View File

@ -1,299 +0,0 @@
nobase_include_HEADERS = libtorrent/alert.hpp \
libtorrent/allocator.hpp \
libtorrent/alert_types.hpp \
libtorrent/assert.hpp \
libtorrent/alloca.hpp \
libtorrent/bandwidth_manager.hpp \
libtorrent/bandwidth_limit.hpp \
libtorrent/bandwidth_queue_entry.hpp \
libtorrent/bencode.hpp \
libtorrent/bitfield.hpp \
libtorrent/broadcast_socket.hpp \
libtorrent/buffer.hpp \
libtorrent/connection_queue.hpp \
libtorrent/create_torrent.hpp \
libtorrent/config.hpp \
libtorrent/ConvertUTF.h \
libtorrent/debug.hpp \
libtorrent/disk_buffer_holder.hpp \
libtorrent/disk_io_thread.hpp \
libtorrent/entry.hpp \
libtorrent/enum_net.hpp \
libtorrent/escape_string.hpp \
libtorrent/error_code.hpp \
libtorrent/extensions.hpp \
libtorrent/file.hpp \
libtorrent/file_pool.hpp \
libtorrent/file_storage.hpp \
libtorrent/fingerprint.hpp \
libtorrent/GeoIP.h \
libtorrent/gzip.hpp \
libtorrent/hasher.hpp \
libtorrent/http_connection.hpp \
libtorrent/http_stream.hpp \
libtorrent/http_parser.hpp \
libtorrent/http_tracker_connection.hpp \
libtorrent/i2p_stream.hpp \
libtorrent/identify_client.hpp \
libtorrent/instantiate_connection.hpp \
libtorrent/intrusive_ptr_base.hpp \
libtorrent/invariant_check.hpp \
libtorrent/io.hpp \
libtorrent/ip_filter.hpp \
libtorrent/chained_buffer.hpp \
libtorrent/lsd.hpp \
libtorrent/lazy_entry.hpp \
libtorrent/peer.hpp \
libtorrent/peer_connection.hpp \
libtorrent/bt_peer_connection.hpp \
libtorrent/web_peer_connection.hpp \
libtorrent/parse_url.hpp \
libtorrent/pe_crypto.hpp \
libtorrent/magnet_uri.hpp \
libtorrent/natpmp.hpp \
libtorrent/pch.hpp \
libtorrent/peer_id.hpp \
libtorrent/peer_info.hpp \
libtorrent/peer_request.hpp \
libtorrent/piece_block_progress.hpp \
libtorrent/piece_picker.hpp \
libtorrent/policy.hpp \
libtorrent/proxy_base.hpp \
libtorrent/random_sample.hpp \
libtorrent/session.hpp \
libtorrent/session_settings.hpp \
libtorrent/session_status.hpp \
libtorrent/size_type.hpp \
libtorrent/ssl_stream.hpp \
libtorrent/socket.hpp \
libtorrent/socket_type.hpp \
libtorrent/socks5_stream.hpp \
libtorrent/stat.hpp \
libtorrent/storage.hpp \
libtorrent/time.hpp \
libtorrent/torrent.hpp \
libtorrent/torrent_handle.hpp \
libtorrent/torrent_info.hpp \
libtorrent/tracker_manager.hpp \
libtorrent/udp_tracker_connection.hpp \
libtorrent/udp_socket.hpp \
libtorrent/utf8.hpp \
libtorrent/upnp.hpp \
libtorrent/xml_parse.hpp \
libtorrent/variant_stream.hpp \
libtorrent/version.hpp \
libtorrent/time.hpp \
libtorrent/aux_/session_impl.hpp \
libtorrent/extensions/metadata_transfer.hpp \
libtorrent/extensions/ut_pex.hpp \
libtorrent/extensions/ut_metadata.hpp \
libtorrent/extensions/lt_trackers.hpp \
libtorrent/extensions/logger.hpp \
libtorrent/extensions/smart_ban.hpp \
\
libtorrent/kademlia/closest_nodes.hpp \
libtorrent/kademlia/dht_tracker.hpp \
libtorrent/kademlia/find_data.hpp \
libtorrent/kademlia/logging.hpp \
libtorrent/kademlia/msg.hpp \
libtorrent/kademlia/node.hpp \
libtorrent/kademlia/node_entry.hpp \
libtorrent/kademlia/node_id.hpp \
libtorrent/kademlia/observer.hpp \
libtorrent/kademlia/refresh.hpp \
libtorrent/kademlia/routing_table.hpp \
libtorrent/kademlia/rpc_manager.hpp \
libtorrent/kademlia/traversal_algorithm.hpp
if ENABLE_SHIPPED_ASIO
nobase_include_HEADERS += \
libtorrent/asio.hpp \
libtorrent/asio/basic_datagram_socket.hpp \
libtorrent/asio/basic_deadline_timer.hpp \
libtorrent/asio/basic_io_object.hpp \
libtorrent/asio/basic_raw_socket.hpp \
libtorrent/asio/basic_serial_port.hpp \
libtorrent/asio/basic_socket.hpp \
libtorrent/asio/basic_socket_acceptor.hpp \
libtorrent/asio/basic_socket_iostream.hpp \
libtorrent/asio/basic_socket_streambuf.hpp \
libtorrent/asio/basic_stream_socket.hpp \
libtorrent/asio/basic_streambuf.hpp \
libtorrent/asio/buffer.hpp \
libtorrent/asio/buffered_read_stream.hpp \
libtorrent/asio/buffered_read_stream_fwd.hpp \
libtorrent/asio/buffered_stream.hpp \
libtorrent/asio/buffered_stream_fwd.hpp \
libtorrent/asio/buffered_write_stream.hpp \
libtorrent/asio/buffered_write_stream_fwd.hpp \
libtorrent/asio/buffers_iterator.hpp \
libtorrent/asio/completion_condition.hpp \
libtorrent/asio/datagram_socket_service.hpp \
libtorrent/asio/deadline_timer.hpp \
libtorrent/asio/deadline_timer_service.hpp \
libtorrent/asio/error.hpp \
libtorrent/asio/error_code.hpp \
libtorrent/asio/handler_alloc_hook.hpp \
libtorrent/asio/handler_invoke_hook.hpp \
libtorrent/asio/io_service.hpp \
libtorrent/asio/is_read_buffered.hpp \
libtorrent/asio/is_write_buffered.hpp \
libtorrent/asio/placeholders.hpp \
libtorrent/asio/raw_socket_service.hpp \
libtorrent/asio/read.hpp \
libtorrent/asio/read_at.hpp \
libtorrent/asio/read_until.hpp \
libtorrent/asio/serial_port.hpp \
libtorrent/asio/serial_port_base.hpp \
libtorrent/asio/serial_port_service.hpp \
libtorrent/asio/socket_acceptor_service.hpp \
libtorrent/asio/socket_base.hpp \
libtorrent/asio/ssl.hpp \
libtorrent/asio/strand.hpp \
libtorrent/asio/stream_socket_service.hpp \
libtorrent/asio/streambuf.hpp \
libtorrent/asio/system_error.hpp \
libtorrent/asio/thread.hpp \
libtorrent/asio/time_traits.hpp \
libtorrent/asio/version.hpp \
libtorrent/asio/write.hpp \
libtorrent/asio/write_at.hpp \
libtorrent/asio/detail/bind_handler.hpp \
libtorrent/asio/detail/buffer_resize_guard.hpp \
libtorrent/asio/detail/buffered_stream_storage.hpp \
libtorrent/asio/detail/call_stack.hpp \
libtorrent/asio/detail/const_buffers_iterator.hpp \
libtorrent/asio/detail/consuming_buffers.hpp \
libtorrent/asio/detail/deadline_timer_service.hpp \
libtorrent/asio/detail/descriptor_ops.hpp \
libtorrent/asio/detail/dev_poll_reactor.hpp \
libtorrent/asio/detail/dev_poll_reactor_fwd.hpp \
libtorrent/asio/detail/epoll_reactor.hpp \
libtorrent/asio/detail/epoll_reactor_fwd.hpp \
libtorrent/asio/detail/event.hpp \
libtorrent/asio/detail/fd_set_adapter.hpp \
libtorrent/asio/detail/handler_alloc_helpers.hpp \
libtorrent/asio/detail/handler_base_from_member.hpp \
libtorrent/asio/detail/handler_invoke_helpers.hpp \
libtorrent/asio/detail/handler_queue.hpp \
libtorrent/asio/detail/hash_map.hpp \
libtorrent/asio/detail/indirect_handler_queue.hpp \
libtorrent/asio/detail/io_control.hpp \
libtorrent/asio/detail/kqueue_reactor.hpp \
libtorrent/asio/detail/kqueue_reactor_fwd.hpp \
libtorrent/asio/detail/local_free_on_block_exit.hpp \
libtorrent/asio/detail/mutex.hpp \
libtorrent/asio/detail/noncopyable.hpp \
libtorrent/asio/detail/null_event.hpp \
libtorrent/asio/detail/null_mutex.hpp \
libtorrent/asio/detail/null_signal_blocker.hpp \
libtorrent/asio/detail/null_thread.hpp \
libtorrent/asio/detail/null_tss_ptr.hpp \
libtorrent/asio/detail/old_win_sdk_compat.hpp \
libtorrent/asio/detail/pipe_select_interrupter.hpp \
libtorrent/asio/detail/pop_options.hpp \
libtorrent/asio/detail/posix_event.hpp \
libtorrent/asio/detail/posix_fd_set_adapter.hpp \
libtorrent/asio/detail/posix_mutex.hpp \
libtorrent/asio/detail/posix_signal_blocker.hpp \
libtorrent/asio/detail/posix_thread.hpp \
libtorrent/asio/detail/posix_tss_ptr.hpp \
libtorrent/asio/detail/push_options.hpp \
libtorrent/asio/detail/reactive_descriptor_service.hpp \
libtorrent/asio/detail/reactive_serial_port_service.hpp \
libtorrent/asio/detail/reactive_socket_service.hpp \
libtorrent/asio/detail/reactor_op_queue.hpp \
libtorrent/asio/detail/resolver_service.hpp \
libtorrent/asio/detail/scoped_lock.hpp \
libtorrent/asio/detail/select_interrupter.hpp \
libtorrent/asio/detail/select_reactor.hpp \
libtorrent/asio/detail/select_reactor_fwd.hpp \
libtorrent/asio/detail/service_base.hpp \
libtorrent/asio/detail/service_id.hpp \
libtorrent/asio/detail/service_registry.hpp \
libtorrent/asio/detail/service_registry_fwd.hpp \
libtorrent/asio/detail/signal_blocker.hpp \
libtorrent/asio/detail/signal_init.hpp \
libtorrent/asio/detail/socket_holder.hpp \
libtorrent/asio/detail/socket_ops.hpp \
libtorrent/asio/detail/socket_option.hpp \
libtorrent/asio/detail/socket_select_interrupter.hpp \
libtorrent/asio/detail/socket_types.hpp \
libtorrent/asio/detail/strand_service.hpp \
libtorrent/asio/detail/task_io_service.hpp \
libtorrent/asio/detail/task_io_service_2lock.hpp \
libtorrent/asio/detail/task_io_service_fwd.hpp \
libtorrent/asio/detail/thread.hpp \
libtorrent/asio/detail/throw_error.hpp \
libtorrent/asio/detail/timer_queue.hpp \
libtorrent/asio/detail/timer_queue_base.hpp \
libtorrent/asio/detail/tss_ptr.hpp \
libtorrent/asio/detail/win_event.hpp \
libtorrent/asio/detail/win_fd_set_adapter.hpp \
libtorrent/asio/detail/win_iocp_handle_service.hpp \
libtorrent/asio/detail/win_iocp_io_service.hpp \
libtorrent/asio/detail/win_iocp_io_service_fwd.hpp \
libtorrent/asio/detail/win_iocp_serial_port_service.hpp \
libtorrent/asio/detail/win_iocp_socket_service.hpp \
libtorrent/asio/detail/win_mutex.hpp \
libtorrent/asio/detail/win_signal_blocker.hpp \
libtorrent/asio/detail/win_thread.hpp \
libtorrent/asio/detail/win_tss_ptr.hpp \
libtorrent/asio/detail/wince_thread.hpp \
libtorrent/asio/detail/winsock_init.hpp \
libtorrent/asio/detail/wrapped_handler.hpp \
libtorrent/asio/impl/error_code.ipp \
libtorrent/asio/impl/io_service.ipp \
libtorrent/asio/impl/read.ipp \
libtorrent/asio/impl/read_at.ipp \
libtorrent/asio/impl/read_until.ipp \
libtorrent/asio/impl/serial_port_base.ipp \
libtorrent/asio/impl/write.ipp \
libtorrent/asio/impl/write_at.ipp \
libtorrent/asio/ip/address.hpp \
libtorrent/asio/ip/address_v4.hpp \
libtorrent/asio/ip/address_v6.hpp \
libtorrent/asio/ip/basic_endpoint.hpp \
libtorrent/asio/ip/basic_resolver.hpp \
libtorrent/asio/ip/basic_resolver_entry.hpp \
libtorrent/asio/ip/basic_resolver_iterator.hpp \
libtorrent/asio/ip/basic_resolver_query.hpp \
libtorrent/asio/ip/host_name.hpp \
libtorrent/asio/ip/icmp.hpp \
libtorrent/asio/ip/multicast.hpp \
libtorrent/asio/ip/resolver_query_base.hpp \
libtorrent/asio/ip/resolver_service.hpp \
libtorrent/asio/ip/tcp.hpp \
libtorrent/asio/ip/udp.hpp \
libtorrent/asio/ip/unicast.hpp \
libtorrent/asio/ip/v6_only.hpp \
libtorrent/asio/ip/detail/socket_option.hpp \
libtorrent/asio/local/basic_endpoint.hpp \
libtorrent/asio/local/connect_pair.hpp \
libtorrent/asio/local/datagram_protocol.hpp \
libtorrent/asio/local/stream_protocol.hpp \
libtorrent/asio/posix/basic_descriptor.hpp \
libtorrent/asio/posix/basic_stream_descriptor.hpp \
libtorrent/asio/posix/descriptor_base.hpp \
libtorrent/asio/posix/stream_descriptor.hpp \
libtorrent/asio/posix/stream_descriptor_service.hpp \
libtorrent/asio/ssl/basic_context.hpp \
libtorrent/asio/ssl/context.hpp \
libtorrent/asio/ssl/context_base.hpp \
libtorrent/asio/ssl/context_service.hpp \
libtorrent/asio/ssl/stream.hpp \
libtorrent/asio/ssl/stream_base.hpp \
libtorrent/asio/ssl/stream_service.hpp \
libtorrent/asio/ssl/detail/openssl_context_service.hpp \
libtorrent/asio/ssl/detail/openssl_init.hpp \
libtorrent/asio/ssl/detail/openssl_operation.hpp \
libtorrent/asio/ssl/detail/openssl_stream_service.hpp \
libtorrent/asio/ssl/detail/openssl_types.hpp \
libtorrent/asio/windows/basic_handle.hpp \
libtorrent/asio/windows/basic_random_access_handle.hpp \
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
endif

View File

@ -1,13 +0,0 @@
#! /bin/sh
# $Id$
set -x
set -e
rm -Rf libtorrent/asio libtorrent/asio.hpp asio
#cvs -d :pserver:anonymous@asio.cvs.sourceforge.net:/cvsroot/asio login # uncomment this if you're the first time, use empty password
cvs -d :pserver:anonymous@asio.cvs.sourceforge.net:/cvsroot/asio export -r asio-1-2-0 asio/include/asio asio/include/asio.hpp
mv asio/include/asio libtorrent/
mv asio/include/asio.hpp libtorrent/

View File

@ -0,0 +1,109 @@
nobase_include_HEADERS = \
alert.hpp \
alert_types.hpp \
alloca.hpp \
allocator.hpp \
assert.hpp \
bandwidth_limit.hpp \
bandwidth_manager.hpp \
bandwidth_queue_entry.hpp \
bencode.hpp \
bitfield.hpp \
broadcast_socket.hpp \
bt_peer_connection.hpp \
buffer.hpp \
chained_buffer.hpp \
config.hpp \
connection_queue.hpp \
ConvertUTF.h \
create_torrent.hpp \
debug.hpp \
disk_buffer_holder.hpp \
disk_io_thread.hpp \
entry.hpp \
enum_net.hpp \
error_code.hpp \
escape_string.hpp \
extensions.hpp \
file.hpp \
file_pool.hpp \
file_storage.hpp \
fingerprint.hpp \
GeoIP.h \
gzip.hpp \
hasher.hpp \
http_connection.hpp \
http_parser.hpp \
http_seed_connection.hpp \
http_stream.hpp \
http_tracker_connection.hpp \
i2p_stream.hpp \
identify_client.hpp \
instantiate_connection.hpp \
intrusive_ptr_base.hpp \
invariant_check.hpp \
io.hpp \
ip_filter.hpp \
lazy_entry.hpp \
lsd.hpp \
magnet_uri.hpp \
natpmp.hpp \
parse_url.hpp \
pch.hpp \
pe_crypto.hpp \
peer_connection.hpp \
peer.hpp \
peer_id.hpp \
peer_info.hpp \
peer_request.hpp \
piece_block_progress.hpp \
piece_picker.hpp \
policy.hpp \
proxy_base.hpp \
random_sample.hpp \
session.hpp \
session_settings.hpp \
session_status.hpp \
size_type.hpp \
socket.hpp \
socket_type.hpp \
socks5_stream.hpp \
ssl_stream.hpp \
stat.hpp \
storage.hpp \
time.hpp \
torrent_handle.hpp \
torrent.hpp \
torrent_info.hpp \
tracker_manager.hpp \
udp_socket.hpp \
udp_tracker_connection.hpp \
upnp.hpp \
utf8.hpp \
variant_stream.hpp \
version.hpp \
web_peer_connection.hpp \
xml_parse.hpp \
\
aux_/session_impl.hpp \
\
extensions/logger.hpp \
extensions/lt_trackers.hpp \
extensions/metadata_transfer.hpp \
extensions/smart_ban.hpp \
extensions/ut_metadata.hpp \
extensions/ut_pex.hpp \
\
kademlia/closest_nodes.hpp \
kademlia/dht_tracker.hpp \
kademlia/find_data.hpp \
kademlia/logging.hpp \
kademlia/msg.hpp \
kademlia/node_entry.hpp \
kademlia/node.hpp \
kademlia/node_id.hpp \
kademlia/observer.hpp \
kademlia/refresh.hpp \
kademlia/routing_table.hpp \
kademlia/rpc_manager.hpp \
kademlia/traversal_algorithm.hpp

View File

@ -12,6 +12,5 @@ Name: libtorrent-rasterbar
Description: Bittorrent library.
Version: @VERSION@
Libs: -L${libdir} -ltorrent-rasterbar
Libs.private: @LIBS@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LIBS@ @ZLIB@
Cflags: -I${includedir} -I${includedir}/libtorrent @SSL_CXXFLAGS@ @COMPILETIME_OPTIONS@
Libs.private: @LIBS@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @OPENSSL_LIBS@
Cflags: -I${includedir} -I${includedir}/libtorrent @COMPILETIME_OPTIONS@

View File

@ -1,25 +0,0 @@
dnl @synopsis AC_CXX_NAMESPACES
dnl
dnl If the compiler can prevent names clashes using namespaces, define
dnl HAVE_NAMESPACES.
dnl
dnl @category Cxx
dnl @author Todd Veldhuizen
dnl @author Luc Maisonobe <luc@spaceroots.org>
dnl @version 2004-02-04
dnl @license AllPermissive
AC_DEFUN([AC_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
[using namespace Outer::Inner; return i;],
ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_namespaces" = yes; then
AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
fi
])

View File

@ -1,199 +0,0 @@
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
dnl
AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_SAVE
AC_LANG_C
acx_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
AC_MSG_RESULT($acx_pthread_ok)
if test x"$acx_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthread or
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
;;
esac
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
pthread-config)
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
if test x"$acx_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[acx_pthread_ok=yes])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($acx_pthread_ok)
if test "x$acx_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$acx_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: threads are created detached by default
# and the JOINABLE attribute has a nonstandard name (UNDETACHED).
AC_MSG_CHECKING([for joinable pthread attribute])
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_JOINABLE;],
ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
if test x"$ok" = xunknown; then
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_UNDETACHED;],
ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
fi
if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
[Define to the necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_RESULT(${ok})
if test x"$ok" = xunknown; then
AC_MSG_WARN([we do not know how to create joinable pthreads])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with cc_r
AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
acx_pthread_ok=no
$2
fi
AC_LANG_RESTORE
])dnl ACX_PTHREAD

View File

@ -1,111 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_asio.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_ASIO
#
# DESCRIPTION
#
# Test for Asio library from the Boost C++ libraries. The macro requires a
# preceding call to AX_BOOST_BASE. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_ASIO_LIB)
#
# And sets:
#
# HAVE_BOOST_ASIO
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Pete Greenwell <pete@mu.org>
# Copyright (c) 2008 Roman Rybalko <libtorrent@romanr.info> (using BOOST_SYSTEM_LIB)
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_BOOST_ASIO],
[
AC_ARG_WITH([boost-asio],
AS_HELP_STRING([--with-boost-asio@<:@=special-lib@:>@],
[use the ASIO library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-asio=boost_system-gcc41-mt-1_34 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_asio_lib=""
else
want_boost="yes"
ax_boost_user_asio_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::ASIO library is available,
ax_cv_boost_asio,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ @%:@include <boost/asio.hpp>
]],
[[
boost::asio::io_service io;
boost::system::error_code timer_result;
boost::asio::deadline_timer t(io);
t.cancel();
io.run_one();
return 0;
]]),
ax_cv_boost_asio=yes, ax_cv_boost_asio=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_asio" = "xyes"; then
AC_DEFINE(HAVE_BOOST_ASIO,,[define if the Boost::ASIO library is available])
BN=boost_system
BN2=`echo $BOOST_SYSTEM_LIB | sed 's/-l//'`
if test "x$ax_boost_user_asio_lib" = "x"; then
for ax_lib in $BN2 $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \
lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \
$BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do
AC_CHECK_LIB($ax_lib, main, [BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_thread="yes" break],
[link_thread="no"])
done
else
for ax_lib in $ax_boost_user_asio_lib $BN-$ax_boost_user_asio_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_asio="yes" break],
[link_asio="no"])
done
fi
if test "x$link_asio" = "xno"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

View File

@ -1,10 +1,10 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_base.html
# http://www.nongnu.org/autoconf-archive/ax_boost_base.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_BASE([MINIMUM-VERSION],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
# AX_BOOST_BASE([MINIMUM-VERSION])
#
# DESCRIPTION
#
@ -23,18 +23,13 @@
#
# HAVE_BOOST
#
# LAST MODIFICATION
# EDIT: 2009-09-07 Cristian Greco <cristian.debian@gmail.com>
# - Call AC_SUBST(BOOST_VERSION).
#
# 2008-04-12 - original
# 2008-06-13 - AIF/AINF parameters
#
# COPYLEFT
# LICENSE
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
#
# Copyright (c) 2008 Roman Rybalko <libtorrent@romanr.info> (under RbLibtorrent project)
# (ACTION-IF-FOUND/ACTION-IF-NOT-FOUND options, re-enterability fixes)
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
@ -44,9 +39,9 @@ AC_DEFUN([AX_BOOST_BASE],
AC_ARG_WITH([boost],
AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]),
[
if test "$withval" = "no"; then
if test "x$withval" = "xno"; then
want_boost="no"
elif test "$withval" = "yes"; then
elif test "x$withval" = "xyes"; then
want_boost="yes"
ac_boost_path=""
else
@ -87,7 +82,7 @@ if test "x$want_boost" = "xyes"; then
dnl first we check the system location for boost libraries
dnl this location ist chosen if boost libraries are installed with the --layout=system option
dnl or if you install boost with RPM
if test "$ac_boost_path" != ""; then
if test "x$ac_boost_path" != "x"; then
BOOST_LDFLAGS="-L$ac_boost_path/lib"
BOOST_CPPFLAGS="-I$ac_boost_path/include"
else
@ -95,6 +90,7 @@ if test "x$want_boost" = "xyes"; then
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
BOOST_VERSION=`grep "define BOOST_LIB_VERSION" $ac_boost_path_tmp/include/boost/version.hpp | sed 's,^.*\"\([[0-9]][[_0-9]]*\)\"$,\1, ; s,_0$,, ; s,_,.,'`
break;
fi
done
@ -102,7 +98,7 @@ if test "x$want_boost" = "xyes"; then
dnl overwrite ld flags if we have required special directory with
dnl --with-boost-libdir parameter
if test "$ac_boost_lib_path" != ""; then
if test "x$ac_boost_lib_path" != "x"; then
BOOST_LDFLAGS="-L$ac_boost_lib_path"
fi
@ -137,7 +133,7 @@ if test "x$want_boost" = "xyes"; then
dnl built and installed without the --layout=system option or for a staged(not installed) version
if test "x$succeeded" != "xyes"; then
_version=0
if test "$ac_boost_path" != ""; then
if test "x$ac_boost_path" != "x"; then
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
@ -165,7 +161,7 @@ if test "x$want_boost" = "xyes"; then
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
if test "$ac_boost_lib_path" = ""
if test "x$ac_boost_lib_path" = "x"
then
BOOST_LDFLAGS="-L$best_path/lib"
fi
@ -176,7 +172,7 @@ if test "x$want_boost" = "xyes"; then
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
V_CHECK=`expr $stage_version_shorten \>\= $_version`
if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
if test "$V_CHECK" = "1" -a "x$ac_boost_lib_path" = "x" ; then
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
BOOST_CPPFLAGS="-I$BOOST_ROOT"
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
@ -207,28 +203,22 @@ if test "x$want_boost" = "xyes"; then
])
AC_LANG_POP([C++])
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
unset ac_boost_path # re-enterability
if test "$succeeded" != "yes" ; then
ifelse([$3], ,[
if test "$_version" = "0" ; then
AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
else
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
fi
],[
AC_MSG_RESULT(no)
$3
])
if test "x$succeeded" != "xyes" ; then
if test "$_version" = "0" ; then
AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
else
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
fi
else
$2
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
AC_SUBST(BOOST_VERSION)
AC_DEFINE(HAVE_BOOST,[1],[define if the Boost library is available])
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

View File

@ -1,222 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_date_time.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_DATE_TIME
#
# DESCRIPTION
#
# Test for Date_Time library from the Boost C++ libraries. The macro
# requires a preceding call to AX_BOOST_BASE. Further documentation is
# available at <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_DATE_TIME_LIB)
#
# And sets:
#
# HAVE_BOOST_DATE_TIME
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Michael Tindal
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_BOOST_DATE_TIME],
[
AC_ARG_WITH([boost-date-time],
AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@],
[use the Date_Time library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_date_time_lib=""
else
want_boost="yes"
ax_boost_user_date_time_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::Date_Time library is available,
ax_cv_boost_date_time,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/date_time/gregorian/gregorian_types.hpp>]],
[[using namespace boost::gregorian; date d(2002,Jan,10);
return 0;
]]),
ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_date_time" = "xyes"; then
AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_date_time_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_date_time*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_date_time.*\)\.so.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
[link_date_time="no"])
done
if test "x$link_date_time" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_date_time*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_date_time.*\)\.dll.*$;\1;' -e 's;^\(boost_date_time.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
[link_date_time="no"])
done
fi
else
for ax_lib in $ax_boost_user_date_time_lib boost_date_time-$ax_boost_user_date_time_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
[link_date_time="no"])
done
fi
if test "x$link_date_time" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_date_time.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_DATE_TIME
#
# DESCRIPTION
#
# Test for Date_Time library from the Boost C++ libraries. The macro
# requires a preceding call to AX_BOOST_BASE. Further documentation is
# available at <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_DATE_TIME_LIB)
#
# And sets:
#
# HAVE_BOOST_DATE_TIME
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Michael Tindal
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_BOOST_DATE_TIME],
[
AC_ARG_WITH([boost-date-time],
AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@],
[use the Date_Time library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_date_time_lib=""
else
want_boost="yes"
ax_boost_user_date_time_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::Date_Time library is available,
ax_cv_boost_date_time,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/date_time/gregorian/gregorian_types.hpp>]],
[[using namespace boost::gregorian; date d(2002,Jan,10);
return 0;
]]),
ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_date_time" = "xyes"; then
AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_date_time_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_date_time*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_date_time.*\)\.so.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
[link_date_time="no"])
done
if test "x$link_date_time" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_date_time*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_date_time.*\)\.dll.*$;\1;' -e 's;^\(boost_date_time.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
[link_date_time="no"])
done
fi
else
for ax_lib in $ax_boost_user_date_time_lib boost_date_time-$ax_boost_user_date_time_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
[link_date_time="no"])
done
fi
if test "x$link_date_time" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

View File

@ -1,5 +1,5 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_filesystem.html
# http://www.nongnu.org/autoconf-archive/ax_boost_filesystem.html
# ===========================================================================
#
# SYNOPSIS
@ -20,15 +20,11 @@
#
# HAVE_BOOST_FILESYSTEM
#
# LAST MODIFICATION
# LICENSE
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Michael Tindal
# Copyright (c) 2008 Roman Rybalko <libtorrent@romanr.info> (using BOOST_SYSTEM_LIB)
# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2009 Michael Tindal
# Copyright (c) 2009 Roman Rybalko <libtorrent@romanr.info>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
@ -41,9 +37,9 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
[use the Filesystem library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
[
if test "$withval" = "no"; then
if test "x$withval" = "xno"; then
want_boost="no"
elif test "$withval" = "yes"; then
elif test "x$withval" = "xyes"; then
want_boost="yes"
ax_boost_user_filesystem_lib=""
else
@ -63,7 +59,7 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
LIBS_SAVED=$LIBS
LIBS="$LIBS $BOOST_SYSTEM_LIB"
export LIBS
@ -79,10 +75,10 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_filesystem" = "xyes"; then
AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
AC_DEFINE(HAVE_BOOST_FILESYSTEM,[1],[define if the Boost::Filesystem library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_filesystem_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_filesystem*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_filesystem.*\)\.so.*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.a*$;\1;'` ; do
for libextension in `ls $BOOSTLIBDIR/libboost_filesystem*.{so,dylib,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_filesystem.*\)\.so.*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.a*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.dylib$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],

View File

@ -1,114 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_iostreams.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_IOSTREAMS
#
# DESCRIPTION
#
# Test for IOStreams library from the Boost C++ libraries. The macro
# requires a preceding call to AX_BOOST_BASE. Further documentation is
# available at <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_IOSTREAMS_LIB)
#
# And sets:
#
# HAVE_BOOST_IOSTREAMS
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_BOOST_IOSTREAMS],
[
AC_ARG_WITH([boost-iostreams],
AS_HELP_STRING([--with-boost-iostreams@<:@=special-lib@:>@],
[use the IOStreams library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-iostreams=boost_iostreams-gcc-mt-d-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_iostreams_lib=""
else
want_boost="yes"
ax_boost_user_iostreams_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::IOStreams library is available,
ax_cv_boost_iostreams,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/iostreams/filtering_stream.hpp>
@%:@include <boost/range/iterator_range.hpp>
]],
[[std::string input = "Hello World!";
namespace io = boost::iostreams;
io::filtering_istream in(boost::make_iterator_range(input));
return 0;
]]),
ax_cv_boost_iostreams=yes, ax_cv_boost_iostreams=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_iostreams" = "xyes"; then
AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::IOStreams library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_iostreams_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_iostreams*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_iostreams.*\)\.so.*$;\1;' -e 's;^lib\(boost_iostreams.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
[link_iostreams="no"])
done
if test "x$link_iostreams" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_iostreams*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_iostreams.*\)\.dll.*$;\1;' -e 's;^\(boost_iostreams.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
[link_iostreams="no"])
done
fi
else
for ax_lib in $ax_boost_user_iostreams_lib boost_iostreams-$ax_boost_user_iostreams_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
[link_iostreams="no"])
done
fi
if test "x$link_iostreams" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

View File

@ -1,106 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_program_options.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_PROGRAM_OPTIONS
#
# DESCRIPTION
#
# Test for program options library from the Boost C++ libraries. The macro
# requires a preceding call to AX_BOOST_BASE. Further documentation is
# available at <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB)
#
# And sets:
#
# HAVE_BOOST_PROGRAM_OPTIONS
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
[
AC_ARG_WITH([boost-program-options],
AS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@],
[use the program options library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_program_options_lib=""
else
want_boost="yes"
ax_boost_user_program_options_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
export want_boost
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK([whether the Boost::Program_Options library is available],
ax_cv_boost_program_options,
[AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/program_options.hpp>
]],
[[boost::program_options::options_description generic("Generic options");
return 0;]]),
ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no)
AC_LANG_POP([C++])
])
if test "$ax_cv_boost_program_options" = yes; then
AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_program_options_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;' -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
[link_program_options="no"])
done
if test "x$link_program_options" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_program_options*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;' -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
[link_program_options="no"])
done
fi
else
for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
[link_program_options="no"])
done
fi
if test "x$link_program_options" != "xyes"; then
AC_MSG_ERROR([Could not link against [$ax_lib] !])
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

View File

@ -1,5 +1,5 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_python.html
# http://www.nongnu.org/autoconf-archive/ax_boost_python.html
# ===========================================================================
#
# SYNOPSIS
@ -21,11 +21,11 @@
# In order to ensure that the Python headers are specified on the include
# path, this macro requires AX_PYTHON to be called.
#
# LAST MODIFICATION
# EDIT: 2009-09-07 Cristian Greco <cristian.debian@gmail.com>
# - Prefix BOOST_PYTHON_LIB with a `-l` for consistency with other
# ax_boost_libname.m4 scripts.
#
# 2008-04-12
#
# COPYLEFT
# LICENSE
#
# Copyright (c) 2008 Michael Tindal
#
@ -51,9 +51,9 @@
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_BOOST_PYTHON],
[AC_REQUIRE([AX_PYTHON])dnl
@ -62,7 +62,7 @@ ac_cv_boost_python,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
CPPFLAGS_SAVE=$CPPFLAGS
if test x$PYTHON_INCLUDE_DIR != x; then
if test "x$PYTHON_INCLUDE_DIR" != "x"; then
CPPFLAGS="-I$PYTHON_INCLUDE_DIR $CPPFLAGS"
fi
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
@ -74,11 +74,11 @@ ac_cv_boost_python,
AC_LANG_RESTORE
CPPFLAGS=$CPPFLAGS_SAVE
])
if test "$ac_cv_boost_python" = "yes"; then
AC_DEFINE(HAVE_BOOST_PYTHON,,[define if the Boost::Python library is available])
if test "x$ac_cv_boost_python" = "xyes"; then
AC_DEFINE(HAVE_BOOST_PYTHON,[1],[define if the Boost::Python library is available])
dnl
LDFLAGS_SAVE=$LDFLAGS
if test x$PYTHON_LIB != x; then
if test "x$PYTHON_LIB" != "x"; then
LDFLAGS="$LDFLAGS -l$PYTHON_LIB"
fi
dnl
@ -89,7 +89,7 @@ if test "$ac_cv_boost_python" = "yes"; then
ax_boost_python_lib="boost_python-$with_boost_python"
fi])
for ax_lib in $ax_python_lib $ax_boost_python_lib boost_python; do
AC_CHECK_LIB($ax_lib, main, [BOOST_PYTHON_LIB=$ax_lib break])
AC_CHECK_LIB($ax_lib, main, [BOOST_PYTHON_LIB=-l$ax_lib break])
done
dnl
LDFLAGS=$LDFLAGS_SAVE

View File

@ -1,110 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_regex.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_REGEX
#
# DESCRIPTION
#
# Test for Regex library from the Boost C++ libraries. The macro requires
# a preceding call to AX_BOOST_BASE. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_REGEX_LIB)
#
# And sets:
#
# HAVE_BOOST_REGEX
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Michael Tindal
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_BOOST_REGEX],
[
AC_ARG_WITH([boost-regex],
AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@],
[use the Regex library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_regex_lib=""
else
want_boost="yes"
ax_boost_user_regex_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::Regex library is available,
ax_cv_boost_regex,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/regex.hpp>
]],
[[boost::regex r(); return 0;]]),
ax_cv_boost_regex=yes, ax_cv_boost_regex=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_regex" = "xyes"; then
AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_regex_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_regex*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
[link_regex="no"])
done
if test "x$link_regex" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_regex*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
[link_regex="no"])
done
fi
else
for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
[link_regex="no"])
done
fi
if test "x$link_regex" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

View File

@ -1,5 +1,5 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_system.html
# http://www.nongnu.org/autoconf-archive/ax_boost_system.html
# ===========================================================================
#
# SYNOPSIS
@ -20,11 +20,7 @@
#
# HAVE_BOOST_SYSTEM
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
# LICENSE
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Michael Tindal
@ -41,9 +37,9 @@ AC_DEFUN([AX_BOOST_SYSTEM],
[use the System library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-system=boost_system-gcc-mt ]),
[
if test "$withval" = "no"; then
if test "x$withval" = "xno"; then
want_boost="no"
elif test "$withval" = "yes"; then
elif test "x$withval" = "xyes"; then
want_boost="yes"
ax_boost_user_system_lib=""
else
@ -79,12 +75,12 @@ AC_DEFUN([AX_BOOST_SYSTEM],
if test "x$ax_cv_boost_system" = "xyes"; then
AC_SUBST(BOOST_CPPFLAGS)
AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])
AC_DEFINE(HAVE_BOOST_SYSTEM,[1],[define if the Boost::System library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
LDFLAGS_SAVE=$LDFLAGS
if test "x$ax_boost_user_system_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_system*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.a*$;\1;'` ; do
for libextension in `ls $BOOSTLIBDIR/libboost_system*.{so,dylib,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.a*$;\1;' -e 's;^lib\(boost_system.*\)\.dylib$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],

View File

@ -1,5 +1,5 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_thread.html
# http://www.nongnu.org/autoconf-archive/ax_boost_thread.html
# ===========================================================================
#
# SYNOPSIS
@ -20,14 +20,10 @@
#
# HAVE_BOOST_THREAD
#
# LAST MODIFICATION
# LICENSE
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Michael Tindal
# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2009 Michael Tindal
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
@ -40,9 +36,9 @@ AC_DEFUN([AX_BOOST_THREAD],
[use the Thread library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-thread=boost_thread-gcc-mt ]),
[
if test "$withval" = "no"; then
if test "x$withval" = "xno"; then
want_boost="no"
elif test "$withval" = "yes"; then
elif test "x$withval" = "xyes"; then
want_boost="yes"
ax_boost_user_thread_lib=""
else
@ -69,13 +65,13 @@ AC_DEFUN([AX_BOOST_THREAD],
[AC_LANG_PUSH([C++])
CXXFLAGS_SAVE=$CXXFLAGS
if test "x$build_os" = "xsolaris" ; then
CXXFLAGS="-pthreads $CXXFLAGS"
elif test "x$build_os" = "xming32" ; then
CXXFLAGS="-mthreads $CXXFLAGS"
else
CXXFLAGS="-pthread $CXXFLAGS"
fi
dnl if test "x$build_os" = "xsolaris" ; then
dnl CXXFLAGS="-pthreads $CXXFLAGS"
dnl elif test "x$build_os" = "xming32" ; then
dnl CXXFLAGS="-mthreads $CXXFLAGS"
dnl else
dnl CXXFLAGS="-pthread $CXXFLAGS"
dnl fi
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]],
[[boost::thread_group thrds;
return 0;]]),
@ -84,17 +80,17 @@ AC_DEFUN([AX_BOOST_THREAD],
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_thread" = "xyes"; then
if test "x$build_os" = "xsolaris" ; then
BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
elif test "x$build_os" = "xming32" ; then
BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
else
BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
fi
dnl if test "x$build_os" = "xsolaris" ; then
dnl BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
dnl elif test "x$build_os" = "xming32" ; then
dnl BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
dnl else
dnl BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
dnl fi
AC_SUBST(BOOST_CPPFLAGS)
AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available])
AC_DEFINE(HAVE_BOOST_THREAD,[1],[define if the Boost::Thread library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
LDFLAGS_SAVE=$LDFLAGS
@ -105,14 +101,14 @@ AC_DEFUN([AX_BOOST_THREAD],
;;
esac
if test "x$ax_boost_user_thread_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_thread*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;' -e 's;^lib\(boost_thread.*\)\.a*$;\1;'` ; do
for libextension in `ls $BOOSTLIBDIR/libboost_thread*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.a*$;\1;'`; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
[link_thread="no"])
done
if test "x$link_thread" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_thread*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;' -e 's;^\(boost_thread.*\)\.a*$;\1;'` ; do
for libextension in `ls $BOOSTLIBDIR/boost_thread*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],

95
m4/ax_check_geoip.m4 Normal file
View File

@ -0,0 +1,95 @@
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_GEOIP([action-if-found], [action-if-not-found])
#
# DESCRIPTION
#
# Tests for the GeoIP (libgeoip) library.
#
# This macro calls:
#
# AC_SUBST(GEOIP_CFLAGS) / AC_SUBST(GEOIP_LIBS)
#
# LAST MODIFICATION
#
# 2009-09-05
#
# LICENSE
#
# Copyright (c) 2009 Cristian Greco <cristian.debian@gmail.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AC_CHECK_GEOIP],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
ac_geoip_found="no"
AC_MSG_CHECKING([for libgeoip with pkg-config])
PKG_CHECK_EXISTS([geoip], [
AC_MSG_RESULT([yes])
PKG_CHECK_MODULES([GEOIP], [geoip], [
ac_geoip_found="yes"
], [
AC_MSG_WARN([pkg-config: geoip module not found])
])
], [
AC_MSG_RESULT([no])
CPPFLAGS_SAVED="$CPPFLAGS"
LDFLAGS_SAVED="$LDFLAGS"
CFLAGS_SAVED="$CFLAGS"
LIBS_SAVED="$LIBS"
AC_CHECK_HEADER([GeoIP.h], [
AC_CHECK_LIB([GeoIP], [GeoIP_new], [
GEOIP_CFLAGS=""
GEOIP_LIBS="-lGeoIP"
ac_geoip_found="yes"
], [
AC_MSG_WARN([libgeoip library not found])
])
], [
for ac_geoip_path in /usr /usr/local /opt /opt/local; do
AC_MSG_CHECKING([for GeoIP.h in $ac_geoip_path])
if test -d "$ac_geoip_path/include/" -a -r "$ac_geoip_path/include/GeoIP.h"; then
AC_MSG_RESULT([yes])
GEOIP_CFLAGS="-I$ac_geoip_path/include"
GEOIP_LIBS="-lGeoIP"
break;
else
AC_MSG_RESULT([no])
fi
done
CFLAGS="$GEOIP_CFLAGS $CFLAGS"
export CFLAGS
LIBS="$GEOIP_LIBS $LIBS"
export LIBS
AC_MSG_CHECKING([for GeoIP_new in -lGeoIP])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[ #include <GeoIP.h> ]], [[ GeoIP *g = GeoIP_new(GEOIP_STANDARD); ]])
], [
AC_MSG_RESULT([yes])
ac_geoip_found="yes"
], [
AC_MSG_RESULT([no])
])
])
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
CFLAGS="$CFLAGS_SAVED"
LIBS="$LIBS_SAVED"
])
AS_IF([ test "x$ac_geoip_found" != xno ], [$1], [$2])
AC_SUBST([GEOIP_CFLAGS])
AC_SUBST([GEOIP_LIBS])
])

123
m4/ax_check_openssl.m4 Normal file
View File

@ -0,0 +1,123 @@
# ===========================================================================
# http://www.nongnu.org/autoconf-archive/ax_check_openssl.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
#
# DESCRIPTION
#
# Look for OpenSSL in a number of default spots, or in a user-selected
# spot (via --with-openssl). Sets
#
# OPENSSL_INCLUDES to the include directives required
# OPENSSL_LIBS to the -l directives required
# OPENSSL_LDFLAGS to the -L or -R flags required
#
# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
#
# This macro sets OPENSSL_INCLUDES such that source files should use the
# openssl/ directory in include directives:
#
# #include <openssl/hmac.h>
#
# LICENSE
#
# Copyright (c) 2009 Zmanda Inc. <http://www.zmanda.com/>
# Copyright (c) 2009 Dustin J. Mitchell <dustin@zmanda.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
AC_DEFUN([AX_CHECK_OPENSSL],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
found=false
AC_ARG_WITH(openssl,
AS_HELP_STRING([--with-openssl@<:@=DIR@:>@],
[specify root directory for OpenSSL library]),
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([Invalid --with-openssl value])
;;
*) ssldirs="$withval"
;;
esac
], [
# if pkg-config is installed and openssl has installed a .pc file,
# then use that information and don't search ssldirs
# AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test "x$PKG_CONFIG" != "x"; then
OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
if test $? = 0; then
OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
found=true
fi
fi
# no such luck; use some default ssldirs
if ! $found; then
ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
fi
]
)
# note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
# an 'openssl' subdirectory
if ! $found; then
OPENSSL_INCLUDES=
for ssldir in $ssldirs; do
AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
if test -f "$ssldir/include/openssl/ssl.h"; then
OPENSSL_INCLUDES="-I$ssldir/include"
OPENSSL_LDFLAGS="-L $ssldir/lib"
OPENSSL_LIBS="-lssl -lcrypto"
found=true
AC_MSG_RESULT([yes])
break
else
AC_MSG_RESULT([no])
fi
done
# if the file wasn't found, well, go ahead and try the link anyway -- maybe
# it will just work!
fi
# try the preprocessor and linker with our new flags,
# being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
"OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
save_LIBS="$LIBS"
save_LDFLAGS="$LDFLAGS"
save_CPPFLAGS="$CPPFLAGS"
LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
LIBS="$OPENSSL_LIBS $LIBS"
CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
AC_LINK_IFELSE(
AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)]),
[
AC_MSG_RESULT([yes])
$1
], [
AC_MSG_RESULT([no])
$2
])
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
AC_SUBST([OPENSSL_INCLUDES])
AC_SUBST([OPENSSL_LIBS])
AC_SUBST([OPENSSL_LDFLAGS])
])

272
m4/ax_pthread.m4 Normal file
View File

@ -0,0 +1,272 @@
# ===========================================================================
# http://www.nongnu.org/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads. It
# sets the PTHREAD_LIBS output variable to the threads library and linker
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
# flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.)
#
# Also sets PTHREAD_CC to any special C compiler that is needed for
# multi-threaded programs (defaults to the value of CC otherwise). (This
# is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also link it with them as well. e.g. you should link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threads programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action
# will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_SAVE
AC_LANG_C
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test "x$PTHREAD_LIBS$PTHREAD_CFLAGS" != "x"; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
AC_MSG_RESULT($ax_pthread_ok)
if test "x$ax_pthread_ok" = "xno"; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -kthread lthread -lpthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
;;
esac
if test "x$ax_pthread_ok" = "xno"; then
for flag in $ax_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
pthread-config)
AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
if test "x$ax_pthread_config" = "xno"; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[ax_pthread_ok=yes])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($ax_pthread_ok)
if test "x$ax_pthread_ok" = "xyes"; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$ax_pthread_ok" = "xyes"; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
[attr_name=$attr; break])
done
AC_MSG_RESULT($attr_name)
if test "x$attr_name" != "xPTHREAD_CREATE_JOINABLE"; then
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != "xno"; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with xlc_r or cc_r
if test "x$GCC" != "xyes"; then
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
else
PTHREAD_CC=$CC
fi
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test "x$ax_pthread_ok" = "xyes"; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,[1],[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
ax_pthread_ok=no
$2
fi
AC_LANG_RESTORE
])dnl AX_PTHREAD

View File

@ -1,5 +1,5 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_python.html
# http://www.nongnu.org/autoconf-archive/ax_python.html
# ===========================================================================
#
# SYNOPSIS
@ -10,7 +10,7 @@
#
# This macro does a complete Python development environment check.
#
# It recurses through several python versions (from 2.1 to 2.5 in this
# It recurses through several python versions (from 2.1 to 2.6 in this
# version), looking for an executable. When it finds an executable, it
# looks to find the header files and library.
#
@ -21,11 +21,12 @@
# This macro calls AC_SUBST on PYTHON_BIN (via AC_CHECK_PROG),
# PYTHON_INCLUDE_DIR and PYTHON_LIB.
#
# LAST MODIFICATION
# EDIT: 2009.09.05 - Modified by Cristian Greco <cristian.debian@gmail.com>
# Dirty hack on the for loop in order to avoid problems with caching in
# AC_CHECK_ARGS, and a special test for ${host} in darwin (MacOS).
# Note that now the macro calls directly AC_SUBST on PYTHON_BIN.
#
# 2008-04-12
#
# COPYLEFT
# LICENSE
#
# Copyright (c) 2008 Michael Tindal
#
@ -51,53 +52,60 @@
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_PYTHON],
[AC_MSG_CHECKING(for python build information)
AC_MSG_RESULT([])
for python in python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do
# AC_CHECK_PROGS(PYTHON_BIN, [$python])
PYTHON_BIN=$python
ax_python_bin=$PYTHON_BIN
if test x$ax_python_bin != x; then
AC_CHECK_LIB($ax_python_bin, main, ax_python_lib=$ax_python_bin, ax_python_lib=no)
AC_CHECK_HEADER([$ax_python_bin/Python.h], ax_python_header=/usr/include/$ax_python_bin, ax_python_header=no)
if test $ax_python_lib != no; then
if test $ax_python_header != no; then
break;
fi
fi
AC_CHECK_HEADER([$ax_python_bin/Python.h], ax_python_header=/opt/local/include/$ax_python_bin, ax_python_header=no)
if test $ax_python_lib != no; then
if test $ax_python_header != no; then
break;
fi
fi
found="no"
m4_foreach_w([PYVER], [ 2_6 2_5 2_4 ], [
if test "x$found" != "xyes"; then
python="python`echo PYVER | sed -e 's/_/./'`"
AC_CHECK_PROGS(PYTHON_BIN_[]PYVER, [$python])
ax_python_bin=$PYTHON_BIN_[]PYVER
if test "x$ax_python_bin" != "x"; then
AC_CHECK_LIB($ax_python_bin, main, ax_python_lib=$ax_python_bin, ax_python_lib=no)
if test `echo ${host} | grep '.*-darwin.*'`; then
python_prefix=/System/Library/Frameworks/Python.framework/*/
fi
AC_CHECK_HEADER([$ax_python_bin/Python.h],
[[ax_python_header=`locate $python_prefix$ax_python_bin/Python.h | sed -e s,/Python.h,,`]],
[ax_python_header="no"])
if test "x$ax_python_lib" != "xno" -a "x$ax_python_header" != "xno"; then
found="yes";
fi
fi
fi
done
if test x$ax_python_bin = x; then
ax_python_bin=no
])
if test "x$ax_python_bin" = "x"; then
ax_python_bin="no"
fi
if test x$ax_python_header = x; then
ax_python_header=no
if test "x$ax_python_header" = "x"; then
ax_python_header="no"
fi
if test x$ax_python_lib = x; then
ax_python_lib=no
if test "x$ax_python_lib" = "x"; then
ax_python_lib="no"
fi
AC_MSG_RESULT([ results of the Python check:])
AC_MSG_RESULT([ Binary: $ax_python_bin])
AC_MSG_RESULT([ Library: $ax_python_lib])
AC_MSG_RESULT([ Include Dir: $ax_python_header])
#AC_MSG_RESULT([ results of the Python check:])
#AC_MSG_RESULT([ Binary: $ax_python_bin])
#AC_MSG_RESULT([ Library: $ax_python_lib])
#AC_MSG_RESULT([ Include Dir: $ax_python_header])
if test x$ax_python_header != xno; then
if test "x$ax_python_bin" != "xno"; then
PYTHON_BIN=$ax_python_bin
AC_SUBST(PYTHON_BIN)
fi
if test "x$ax_python_header" != "xno"; then
PYTHON_INCLUDE_DIR=$ax_python_header
AC_SUBST(PYTHON_INCLUDE_DIR)
fi
if test x$ax_python_lib != xno; then
if test "x$ax_python_lib" != "xno"; then
PYTHON_LIB=$ax_python_lib
AC_SUBST(PYTHON_LIB)
fi

View File

@ -1,82 +0,0 @@
##### http://autoconf-archive.cryp.to/check_ssl.html
#
# SYNOPSIS
#
# CHECK_SSL
#
# DESCRIPTION
#
# This macro will check various standard spots for OpenSSL including
# a user-supplied directory. The user uses '--with-ssl' or
# '--with-ssl=/path/to/ssl' as arguments to configure.
#
# If OpenSSL is found the include directory gets added to CFLAGS and
# CXXFLAGS as well as '-DHAVE_SSL', '-lssl' & '-lcrypto' get added to
# LIBS, and the libraries location gets added to LDFLAGS. Finally
# 'HAVE_SSL' gets set to 'yes' for use in your Makefile.in I use it
# like so (valid for gmake):
#
# HAVE_SSL = @HAVE_SSL@
# ifeq ($(HAVE_SSL),yes)
# SRCS+= @srcdir@/my_file_that_needs_ssl.c
# endif
#
# For bsd 'bmake' use:
#
# .if ${HAVE_SSL} == "yes"
# SRCS+= @srcdir@/my_file_that_needs_ssl.c
# .endif
#
# LAST MODIFICATION
#
# 2003-01-28
#
# COPYLEFT
#
# Copyright (c) 2003 Mark Ethan Trostler <trostler@juniper.net>
#
# Copying and distribution of this file, with or without
# modification, are permitted in any medium without royalty provided
# the copyright notice and this notice are preserved.
AC_DEFUN([CHECK_SSL],
[
dnl AC_MSG_CHECKING(if ssl is wanted)
AC_ARG_WITH(ssl,
[ --with-ssl enable ssl [will check /usr/local/ssl
/usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr ]
])
dnl [ AC_MSG_RESULT(yes)
for dir in $withval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do
ssldir="$dir"
if test -f "$dir/include/openssl/ssl.h"; then
found_ssl="yes";
SSL_CFLAGS="-I$ssldir/include/openssl -DHAVE_SSL";
SSL_CXXFLAGS="-I$ssldir/include/openssl -DHAVE_SSL";
break;
fi
if test -f "$dir/include/ssl.h"; then
found_ssl="yes";
SSL_CFLAGS="-I$ssldir/include/ -DHAVE_SSL";
SSL_CXXFLAGS="-I$ssldir/include/ -DHAVE_SSL";
break
fi
done
if test x_$found_ssl != x_yes; then
AC_MSG_ERROR(Cannot find ssl libraries)
else
printf "OpenSSL found in $ssldir\n";
SSL_LIBS="-lssl -lcrypto";
SSL_LDFLAGS="-L$ssldir/lib";
HAVE_SSL=yes
fi
AC_SUBST(SSL_CFLAGS)
AC_SUBST(SSL_CXXFLAGS)
AC_SUBST(SSL_LIBS)
AC_SUBST(SSL_LDFLAGS)
AC_SUBST(HAVE_SSL)
dnl ],
dnl [
dnl AC_MSG_RESULT(no)
dnl ])
])dnl

155
m4/pkgconfig.m4 Normal file
View File

@ -0,0 +1,155 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
#
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
# this or PKG_CHECK_MODULES is called, or make sure to call
# PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_ifval([$2], [$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
ifelse([$4], , [AC_MSG_ERROR(dnl
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT
])],
[AC_MSG_RESULT([no])
$4])
elif test $pkg_failed = untried; then
ifelse([$4], , [AC_MSG_FAILURE(dnl
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
[$4])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
ifelse([$3], , :, [$3])
fi[]dnl
])# PKG_CHECK_MODULES

View File

@ -1,119 +1,101 @@
lib_LTLIBRARIES = libtorrent-rasterbar.la
if USE_DHT
kademlia_sources = kademlia/closest_nodes.cpp \
kademlia/dht_tracker.cpp \
kademlia/find_data.cpp \
kademlia/node.cpp \
kademlia/node_id.cpp \
kademlia/refresh.cpp \
kademlia/routing_table.cpp \
kademlia/rpc_manager.cpp \
kademlia/traversal_algorithm.cpp
if ENABLE_DHT
KADEMLIA_SOURCES = \
kademlia/closest_nodes.cpp \
kademlia/dht_tracker.cpp \
kademlia/find_data.cpp \
kademlia/node.cpp \
kademlia/node_id.cpp \
kademlia/refresh.cpp \
kademlia/routing_table.cpp \
kademlia/rpc_manager.cpp \
kademlia/traversal_algorithm.cpp
endif
libtorrent_rasterbar_la_SOURCES = entry.cpp escape_string.cpp \
lazy_bdecode.cpp assert.cpp enum_net.cpp broadcast_socket.cpp \
peer_connection.cpp bt_peer_connection.cpp web_peer_connection.cpp \
http_seed_connection.cpp natpmp.cpp piece_picker.cpp policy.cpp \
session.cpp session_impl.cpp sha1.cpp stat.cpp storage.cpp torrent.cpp \
torrent_handle.cpp pe_crypto.cpp \
torrent_info.cpp tracker_manager.cpp http_connection.cpp \
http_tracker_connection.cpp udp_tracker_connection.cpp \
alert.cpp identify_client.cpp ip_filter.cpp file.cpp metadata_transfer.cpp \
logger.cpp file_pool.cpp ut_pex.cpp lsd.cpp upnp.cpp instantiate_connection.cpp \
socks5_stream.cpp http_stream.cpp connection_queue.cpp \
disk_io_thread.cpp ut_metadata.cpp lt_trackers.cpp magnet_uri.cpp udp_socket.cpp smart_ban.cpp \
http_parser.cpp gzip.cpp disk_buffer_holder.cpp create_torrent.cpp GeoIP.c \
parse_url.cpp file_storage.cpp error_code.cpp ConvertUTF.cpp \
allocator.cpp i2p_stream.cpp \
$(kademlia_sources)
if WITH_SHIPPED_GEOIP
GEOIP_SOURCES = GeoIP.c
endif
noinst_HEADERS = \
$(top_srcdir)/include/libtorrent/alert.hpp \
$(top_srcdir)/include/libtorrent/allocator.hpp \
$(top_srcdir)/include/libtorrent/alert_types.hpp \
$(top_srcdir)/include/libtorrent/assert.hpp \
$(top_srcdir)/include/libtorrent/alloca.hpp \
$(top_srcdir)/include/libtorrent/aux_/session_impl.hpp \
$(top_srcdir)/include/libtorrent/bandwidth_manager.hpp \
$(top_srcdir)/include/libtorrent/bandwidth_limit.hpp \
$(top_srcdir)/include/libtorrent/bandwidth_queue_entry.hpp \
$(top_srcdir)/include/libtorrent/bencode.hpp \
$(top_srcdir)/include/libtorrent/bitfield.hpp \
$(top_srcdir)/include/libtorrent/broadcast_socket.hpp \
$(top_srcdir)/include/libtorrent/buffer.hpp \
$(top_srcdir)/include/libtorrent/connection_queue.hpp \
$(top_srcdir)/include/libtorrent/create_torrent.hpp \
$(top_srcdir)/include/libtorrent/debug.hpp \
$(top_srcdir)/include/libtorrent/disk_io_thread.hpp \
$(top_srcdir)/include/libtorrent/entry.hpp \
$(top_srcdir)/include/libtorrent/enum_net.hpp \
$(top_srcdir)/include/libtorrent/escape_string.hpp \
$(top_srcdir)/include/libtorrent/error_code.hpp \
$(top_srcdir)/include/libtorrent/extensions.hpp \
$(top_srcdir)/include/libtorrent/extensions/metadata_transfer.hpp \
$(top_srcdir)/include/libtorrent/extensions/logger.hpp \
$(top_srcdir)/include/libtorrent/extensions/ut_pex.hpp \
$(top_srcdir)/include/libtorrent/file.hpp \
$(top_srcdir)/include/libtorrent/file_pool.hpp \
$(top_srcdir)/include/libtorrent/file_storage.hpp \
$(top_srcdir)/include/libtorrent/fingerprint.hpp \
$(top_srcdir)/include/libtorrent/gzip.hpp \
$(top_srcdir)/include/libtorrent/hasher.hpp \
$(top_srcdir)/include/libtorrent/http_connection.hpp \
$(top_srcdir)/include/libtorrent/http_seed_connection.hpp \
$(top_srcdir)/include/libtorrent/http_stream.hpp \
$(top_srcdir)/include/libtorrent/http_parser.hpp \
$(top_srcdir)/include/libtorrent/session_settings.hpp \
$(top_srcdir)/include/libtorrent/http_tracker_connection.hpp \
$(top_srcdir)/include/libtorrent/i2p_stream.hpp \
$(top_srcdir)/include/libtorrent/identify_client.hpp \
$(top_srcdir)/include/libtorrent/instantiate_connection.hpp \
$(top_srcdir)/include/libtorrent/intrusive_ptr_base.hpp \
$(top_srcdir)/include/libtorrent/invariant_check.hpp \
$(top_srcdir)/include/libtorrent/io.hpp \
$(top_srcdir)/include/libtorrent/ip_filter.hpp \
$(top_srcdir)/include/libtorrent/chained_buffer.hpp \
$(top_srcdir)/include/libtorrent/lsd.hpp \
$(top_srcdir)/include/libtorrent/peer.hpp \
$(top_srcdir)/include/libtorrent/peer_connection.hpp \
$(top_srcdir)/include/libtorrent/bt_peer_connection.hpp \
$(top_srcdir)/include/libtorrent/web_peer_connection.hpp \
$(top_srcdir)/include/libtorrent/parse_url.hpp \
$(top_srcdir)/include/libtorrent/pe_crypto.hpp \
$(top_srcdir)/include/libtorrent/natpmp.hpp \
$(top_srcdir)/include/libtorrent/pch.hpp \
$(top_srcdir)/include/libtorrent/peer_id.hpp \
$(top_srcdir)/include/libtorrent/peer_info.hpp \
$(top_srcdir)/include/libtorrent/peer_request.hpp \
$(top_srcdir)/include/libtorrent/piece_block_progress.hpp \
$(top_srcdir)/include/libtorrent/piece_picker.hpp \
$(top_srcdir)/include/libtorrent/policy.hpp \
$(top_srcdir)/include/libtorrent/session.hpp \
$(top_srcdir)/include/libtorrent/size_type.hpp \
$(top_srcdir)/include/libtorrent/socket.hpp \
$(top_srcdir)/include/libtorrent/socket_type.hpp \
$(top_srcdir)/include/libtorrent/socks5_stream.hpp \
$(top_srcdir)/include/libtorrent/stat.hpp \
$(top_srcdir)/include/libtorrent/storage.hpp \
$(top_srcdir)/include/libtorrent/time.hpp \
$(top_srcdir)/include/libtorrent/torrent.hpp \
$(top_srcdir)/include/libtorrent/torrent_handle.hpp \
$(top_srcdir)/include/libtorrent/torrent_info.hpp \
$(top_srcdir)/include/libtorrent/tracker_manager.hpp \
$(top_srcdir)/include/libtorrent/udp_tracker_connection.hpp \
$(top_srcdir)/include/libtorrent/utf8.hpp \
$(top_srcdir)/include/libtorrent/xml_parse.hpp \
$(top_srcdir)/include/libtorrent/variant_stream.hpp \
$(top_srcdir)/include/libtorrent/version.hpp \
$(top_srcdir)/include/libtorrent/ConvertUTF.h
libtorrent_rasterbar_la_SOURCES = \
alert.cpp \
allocator.cpp \
assert.cpp \
broadcast_socket.cpp \
bt_peer_connection.cpp \
connection_queue.cpp \
ConvertUTF.cpp \
create_torrent.cpp \
disk_buffer_holder.cpp \
disk_io_thread.cpp \
entry.cpp \
enum_net.cpp \
error_code.cpp \
escape_string.cpp \
file.cpp \
file_pool.cpp \
file_storage.cpp \
gzip.cpp \
http_connection.cpp \
http_parser.cpp \
http_seed_connection.cpp \
http_stream.cpp \
http_tracker_connection.cpp \
i2p_stream.cpp \
identify_client.cpp \
instantiate_connection.cpp \
ip_filter.cpp \
lazy_bdecode.cpp \
logger.cpp \
lsd.cpp \
lt_trackers.cpp \
magnet_uri.cpp \
metadata_transfer.cpp \
natpmp.cpp \
parse_url.cpp \
pe_crypto.cpp \
peer_connection.cpp \
piece_picker.cpp \
policy.cpp \
session.cpp \
session_impl.cpp \
sha1.cpp \
smart_ban.cpp \
socks5_stream.cpp \
stat.cpp \
storage.cpp \
torrent.cpp \
torrent_handle.cpp \
torrent_info.cpp \
tracker_manager.cpp \
udp_socket.cpp \
udp_tracker_connection.cpp \
upnp.cpp \
ut_metadata.cpp \
ut_pex.cpp \
web_peer_connection.cpp \
\
$(KADEMLIA_SOURCES) \
$(GEOIP_SOURCES)
libtorrent_rasterbar_la_LDFLAGS = $(LDFLAGS) -version-info $(INTERFACE_VERSION_INFO)
libtorrent_rasterbar_la_LIBADD = @ZLIB@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LIBS@
#libtorrent_rasterbar_la_LDFLAGS = $(LDFLAGS) -version-info $(INTERFACE_VERSION_INFO)
libtorrent_rasterbar_la_LDFLAGS = -version-info $(INTERFACE_VERSION_INFO)
AM_CXXFLAGS= -ftemplate-depth-100 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @ZLIBINCL@ @DEBUGFLAGS@ @PTHREAD_CFLAGS@ @SSL_CXXFLAGS@
AM_CFLAGS= -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @ZLIBINCL@ @DEBUGFLAGS@ @PTHREAD_CFLAGS@
AM_LDFLAGS= $(LDFLAGS) @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LDFLAGS@ @SSL_LIBS@
#libtorrent_rasterbar_la_LIBADD = @ZLIB@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @OPENSSL_LIBS@
libtorrent_rasterbar_la_LIBADD = @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @OPENSSL_LIBS@
#libtorrent_rasterbar_la_LIBADD = @ZLIB@
#AM_CXXFLAGS= -ftemplate-depth-100 -I$(top_srcdir)/include @ZLIBINCL@ @DEBUGFLAGS@ @OPENSSL_INCLUDES@
#AM_CPPFLAGS = -ftemplate-depth-100 -I$(top_srcdir)/include @ZLIBINCL@ @DEBUGFLAGS@ @OPENSSL_INCLUDES@
AM_CPPFLAGS = -ftemplate-depth-100 -I$(top_srcdir)/include @DEBUGFLAGS@ @OPENSSL_INCLUDES@
#AM_CFLAGS= -I$(top_srcdir)/include @ZLIBINCL@ @DEBUGFLAGS@
#AM_LDFLAGS = $(LDFLAGS) @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@
AM_LDFLAGS = @OPENSSL_LDFLAGS@
if WITH_SHIPPED_ZLIB
libtorrent_rasterbar_la_LIBADD += $(top_builddir)/zlib/libzlib.la
AM_CPPFLAGS += -I$(top_srcdir)/zlib
endif

View File

@ -1,13 +1,33 @@
test_programs = test_hasher test_bencoding test_ip_filter test_piece_picker \
test_storage test_metadata_extension test_buffer test_swarm test_pe_crypto test_primitives \
test_bandwidth_limiter test_fast_extension test_pex test_web_seed \
test_http_connection test_torrent test_transfer test_lsd
test_programs = \
test_auto_unchoke \
test_bandwidth_limiter \
test_bdecode_performance \
test_bencoding \
test_buffer \
test_fast_extension \
test_hasher \
test_http_connection \
test_ip_filter \
test_lsd \
test_metadata_extension \
test_natpmp \
test_pe_crypto \
test_pex \
test_piece_picker \
test_primitives \
test_storage \
test_swarm \
test_torrent \
test_trackers_extension \
test_transfer \
test_upnp \
test_web_seed
if ENABLE_TESTS
# no indent here! - BSD make issue
check_PROGRAMS = $(test_programs)
noinst_LTLIBRARIES = libtest.la
endif
TESTS = $(check_PROGRAMS)
EXTRA_DIST = Jamfile
@ -17,27 +37,33 @@ noinst_HEADERS = test.hpp setup_transfer.hpp
libtest_la_SOURCES = main.cpp setup_transfer.cpp
test_lsd_SOURCES = test_lsd.cpp
test_http_connection_SOURCES = test_http_connection.cpp
test_web_seed_SOURCES = test_web_seed.cpp
test_pex_SOURCES = test_pex.cpp
test_auto_unchoke_SOURCES = test_auto_unchoke.cpp
test_bandwidth_limiter_SOURCES = test_bandwidth_limiter.cpp
test_bdecode_performance_SOURCES = test_bdecode_performance.cpp
test_bencoding_SOURCES = test_bencoding.cpp
test_buffer_SOURCES = test_buffer.cpp
test_fast_extension_SOURCES = test_fast_extension.cpp
test_hasher_SOURCES = test_hasher.cpp
test_bencoding_SOURCES = test_bencoding.cpp
test_http_connection_SOURCES = test_http_connection.cpp
test_ip_filter_SOURCES = test_ip_filter.cpp
test_piece_picker_SOURCES = test_piece_picker.cpp
test_storage_SOURCES = test_storage.cpp
test_buffer_SOURCES = test_buffer.cpp
test_lsd_SOURCES = test_lsd.cpp
test_metadata_extension_SOURCES = test_metadata_extension.cpp
test_swarm_SOURCES = test_swarm.cpp
test_natpmp_SOURCES = test_natpmp.cpp
test_pe_crypto_SOURCES = test_pe_crypto.cpp
test_pex_SOURCES = test_pex.cpp
test_piece_picker_SOURCES = test_piece_picker.cpp
test_primitives_SOURCES = test_primitives.cpp
test_bandwidth_limiter_SOURCES = test_bandwidth_limiter.cpp
test_storage_SOURCES = test_storage.cpp
test_swarm_SOURCES = test_swarm.cpp
test_torrent_SOURCES = test_torrent.cpp
test_trackers_extension_SOURCES = test_trackers_extension.cpp
test_transfer_SOURCES = test_transfer.cpp
test_upnp_SOURCES = test_upnp.cpp
test_web_seed_SOURCES = test_web_seed.cpp
LDADD = $(top_builddir)/src/libtorrent-rasterbar.la libtest.la
AM_CXXFLAGS=-ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @DEBUGFLAGS@ @PTHREAD_CFLAGS@
AM_LDFLAGS= @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LDFLAGS@ @SSL_LIBS@
#AM_CXXFLAGS=-ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @DEBUGFLAGS@ @PTHREAD_CFLAGS@
AM_CPPFLAGS=-ftemplate-depth-50 -I$(top_srcdir)/include @DEBUGFLAGS@
#AM_LDFLAGS= @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LDFLAGS@ @SSL_LIBS@

View File

@ -1,13 +1,29 @@
if ENABLE_SHIPPED_ZLIB
# no indent here! - BSD make issue
if WITH_SHIPPED_ZLIB
noinst_LTLIBRARIES = libzlib.la
endif
libzlib_la_SOURCES = adler32.c compress.c crc32.c deflate.c \
gzio.c infback.c inffast.c inflate.c \
inftrees.c trees.c uncompr.c zutil.c
libzlib_la_SOURCES = \
adler32.c \
compress.c \
crc32.c \
deflate.c \
gzio.c \
infback.c \
inffast.c \
inflate.c \
inftrees.c \
trees.c \
uncompr.c \
zutil.c
noinst_HEADERS = \
crc32.h deflate.h inffast.h \
inffixed.h inflate.h inftrees.h \
trees.h zconf.h zlib.h zutil.h
crc32.h \
deflate.h \
inffast.h \
inffixed.h \
inflate.h \
inftrees.h \
trees.h \
zconf.h \
zlib.h \
zutil.h