2008-11-17 12:46:04 +01:00
|
|
|
AC_PREREQ(2.60)
|
2005-08-17 02:24:41 +02:00
|
|
|
|
2009-01-29 01:35:57 +01:00
|
|
|
AC_INIT([libtorrent-rasterbar], [0.15.0], [arvid@cs.umu.se])
|
2008-11-17 12:46:04 +01:00
|
|
|
AM_INIT_AUTOMAKE(foreign 1.10)
|
|
|
|
AC_CONFIG_SRCDIR([src/torrent.cpp])
|
2008-06-23 02:09:12 +02:00
|
|
|
|
2008-11-17 12:46:04 +01:00
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
2008-06-23 02:09:12 +02:00
|
|
|
dnl interface version info
|
2008-11-17 12:46:04 +01:00
|
|
|
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 ---------------------------------------------------------------------------
|
2009-06-22 10:53:46 +02:00
|
|
|
VERSION_INFO_CURRENT=6
|
2009-04-08 00:07:45 +02:00
|
|
|
VERSION_INFO_REVISION=0
|
2008-06-23 02:09:12 +02:00
|
|
|
VERSION_INFO_AGE=0
|
|
|
|
INTERFACE_VERSION_INFO=$VERSION_INFO_CURRENT:$VERSION_INFO_REVISION:$VERSION_INFO_AGE
|
|
|
|
AC_SUBST(INTERFACE_VERSION_INFO)
|
2008-11-17 12:46:04 +01:00
|
|
|
dnl ---------------------------------------------------------------------------
|
2005-08-17 02:24:41 +02:00
|
|
|
|
2009-04-06 21:05:08 +02:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
2005-08-17 02:24:41 +02:00
|
|
|
AC_PROG_CC
|
2007-01-13 20:09:21 +01:00
|
|
|
|
|
|
|
if test -z "$(which $CC)"; then
|
|
|
|
AC_MSG_ERROR([Unable to find a working C compiler, giving up.])
|
|
|
|
fi
|
|
|
|
|
2005-08-17 02:24:41 +02:00
|
|
|
AC_PROG_CPP
|
2007-02-09 20:56:16 +01:00
|
|
|
AC_PROG_CXX
|
2007-01-13 20:09:21 +01:00
|
|
|
|
|
|
|
if test -z "$(which $CXX)"; then
|
|
|
|
AC_MSG_ERROR([Unable to find a working C++ compiler, giving up.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CACHE_SAVE
|
2005-08-17 02:24:41 +02:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
# AC_PROG_RANLIB is obsolete by AC_PROC_LIBTOOL
|
|
|
|
|
2008-04-22 18:22:51 +02:00
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
2008-06-13 14:20:55 +02:00
|
|
|
dnl Check for pthreads.
|
2005-08-17 02:24:41 +02:00
|
|
|
ACX_PTHREAD
|
2008-06-13 14:20:55 +02:00
|
|
|
|
2008-06-24 00:42:18 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_SHIPPED_ASIO], false)
|
|
|
|
|
2008-06-13 14:20:55 +02:00
|
|
|
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
|
|
|
|
],[
|
2008-06-22 22:51:26 +02:00
|
|
|
AX_BOOST_BASE([1.34],[
|
|
|
|
|
|
|
|
dnl the user can choose which Asio library to use
|
|
|
|
AC_ARG_WITH([asio],
|
2008-06-23 02:09:12 +02:00
|
|
|
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.]),
|
2008-06-22 22:51:26 +02:00
|
|
|
[[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)
|
2008-09-01 11:22:01 +02:00
|
|
|
ASIO_HPP=`dirname $0`/include/libtorrent/asio.hpp
|
|
|
|
ASIO_DIR=`dirname $0`/include/libtorrent/asio
|
2008-06-23 02:09:12 +02:00
|
|
|
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.])
|
2008-06-22 22:51:26 +02:00
|
|
|
)
|
|
|
|
;;
|
|
|
|
"system")
|
|
|
|
AC_MSG_RESULT(system)
|
|
|
|
ASIO_HPP=/usr/include/asio.hpp
|
|
|
|
ASIO_DIR=/usr/include/asio
|
2008-06-23 02:09:12 +02:00
|
|
|
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.])
|
2008-06-22 22:51:26 +02:00
|
|
|
)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(detect)
|
|
|
|
ASIO_HPP=$asio/../asio.hpp
|
|
|
|
ASIO_DIR=$asio
|
2008-06-23 02:09:12 +02:00
|
|
|
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.])
|
2008-06-22 22:51:26 +02:00
|
|
|
)
|
|
|
|
;;
|
|
|
|
esac
|
2008-06-23 02:09:12 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_SHIPPED_ASIO], [test x$enable_shipped_asio = "xyes"])
|
2008-06-22 22:51:26 +02:00
|
|
|
])
|
2008-06-13 14:20:55 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_MSG_NOTICE([BOOST_CPPFLAGS=$BOOST_CPPFLAGS])
|
|
|
|
AC_MSG_NOTICE([BOOST_LDFLAGS=$BOOST_LDFLAGS])
|
2008-05-12 00:43:44 +02:00
|
|
|
|
2005-08-17 02:24:41 +02:00
|
|
|
AX_BOOST_FILESYSTEM
|
|
|
|
dnl check that Boost.Filesystem was found:
|
|
|
|
if test -z "$BOOST_FILESYSTEM_LIB"; then
|
2006-11-19 16:24:30 +01:00
|
|
|
AC_MSG_ERROR([Unable to find Boost.Filesystem library, currently this is required.])
|
2005-08-17 02:24:41 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
AX_BOOST_THREAD
|
|
|
|
dnl check that Boost.Thread was found:
|
|
|
|
if test -z "$BOOST_THREAD_LIB"; then
|
2006-11-19 16:24:30 +01:00
|
|
|
AC_MSG_ERROR([Unable to find Boost.Thread library, currently this is required.])
|
2005-08-17 02:24:41 +02:00
|
|
|
fi
|
|
|
|
|
2005-10-16 21:13:54 +02:00
|
|
|
AX_BOOST_REGEX
|
|
|
|
dnl check that Boost.Regex was found:
|
|
|
|
if test -z "$BOOST_REGEX_LIB"; then
|
2006-11-19 16:24:30 +01:00
|
|
|
AC_MSG_RESULT([Unable to find Boost.Regex library, example test_client will not be build.])
|
2005-10-16 21:13:54 +02:00
|
|
|
BUILD_TESTCLIENT=no;
|
|
|
|
fi
|
|
|
|
|
2008-06-13 14:20:55 +02:00
|
|
|
dnl Apply boost config.
|
|
|
|
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
2007-12-14 21:53:56 +01:00
|
|
|
|
2005-10-16 21:13:54 +02:00
|
|
|
if [[ "x$BUILD_TESTCLIENT" != "xno" ]]; then
|
|
|
|
CLIENT_TEST_BIN=client_test;
|
|
|
|
AC_SUBST(CLIENT_TEST_BIN)
|
|
|
|
fi
|
|
|
|
|
2005-08-17 02:24:41 +02:00
|
|
|
dnl try different ways of resolving gethostbyname
|
|
|
|
AC_CHECK_FUNC(gethostbyname, ,
|
|
|
|
AC_CHECK_LIB(resolv, gethostbyname, ,
|
|
|
|
AC_CHECK_LIB(nsl, gethostbyname, ,
|
2008-04-28 01:19:42 +02:00
|
|
|
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.]))))
|
2005-08-17 02:24:41 +02:00
|
|
|
)
|
|
|
|
|
2006-11-19 16:24:30 +01:00
|
|
|
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]]
|
|
|
|
)
|
2008-05-15 02:08:33 +02:00
|
|
|
|
2009-06-27 21:30:15 +02:00
|
|
|
# this works around a bug in asio in boost-1.39
|
|
|
|
COMPILETIME_OPTIONS="-DBOOST_ASIO_HASH_MAP_BUCKETS=1024"
|
|
|
|
|
2006-11-19 16:24:30 +01:00
|
|
|
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])
|
2008-05-15 02:08:33 +02:00
|
|
|
COMPILETIME_OPTIONS+="-DTORRENT_LOGGING "
|
2006-11-19 16:24:30 +01:00
|
|
|
;;
|
|
|
|
"verbose")
|
|
|
|
AC_MSG_RESULT(verbose)
|
|
|
|
AC_DEFINE(TORRENT_VERBOSE_LOGGING,,[define to use verbose logging])
|
2008-05-15 02:08:33 +02:00
|
|
|
COMPILETIME_OPTIONS+="-DTORRENT_VERBOSE_LOGGING "
|
2006-11-19 16:24:30 +01:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
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(
|
2007-03-16 14:40:49 +01:00
|
|
|
[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]]
|
2006-11-19 16:24:30 +01:00
|
|
|
)
|
2007-04-13 21:28:00 +02:00
|
|
|
dnl Check the value for the --with-dht switch
|
2006-11-19 16:24:30 +01:00
|
|
|
AC_MSG_CHECKING([how to use DHT])
|
2007-03-16 14:40:49 +01:00
|
|
|
case "$dht" in
|
2006-11-19 16:24:30 +01:00
|
|
|
"on")
|
|
|
|
AC_MSG_RESULT(on)
|
|
|
|
;;
|
|
|
|
"off")
|
|
|
|
AC_MSG_RESULT(off)
|
|
|
|
AC_DEFINE(TORRENT_DISABLE_DHT,,[define not to use DHT support])
|
2008-05-15 02:08:33 +02:00
|
|
|
COMPILETIME_OPTIONS+="-DTORRENT_DISABLE_DHT "
|
2006-11-19 16:24:30 +01:00
|
|
|
;;
|
|
|
|
"logging")
|
|
|
|
AC_MSG_RESULT(logging)
|
|
|
|
AC_DEFINE(TORRENT_DHT_VERBOSE_LOGGING,,[define to use DHT support with extra logging])
|
2008-05-15 02:08:33 +02:00
|
|
|
COMPILETIME_OPTIONS+="-DTORRENT_DHT_VERBOSE_LOGGING "
|
2006-11-19 16:24:30 +01:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT()
|
2007-04-13 21:28:00 +02:00
|
|
|
AC_MSG_ERROR([Unknown dht option "$dht". Use either "on", "off" or "logging".])
|
2006-11-19 16:24:30 +01:00
|
|
|
;;
|
|
|
|
esac
|
2007-04-13 18:11:11 +02:00
|
|
|
AM_CONDITIONAL(USE_DHT, test "x$dht" != "xoff")
|
2006-11-19 16:24:30 +01:00
|
|
|
|
2007-06-09 00:55:33 +02:00
|
|
|
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)
|
2007-12-14 21:53:56 +01:00
|
|
|
CHECK_SSL()
|
2008-06-23 02:09:12 +02:00
|
|
|
AC_DEFINE(TORRENT_USE_OPENSSL,,[define to use openssl with libtorrent-rasterbar])
|
2008-10-20 00:38:25 +02:00
|
|
|
COMPILETIME_OPTIONS+="-DTORRENT_USE_OPENSSL "
|
2007-06-09 00:55:33 +02:00
|
|
|
|
|
|
|
;;
|
|
|
|
"off")
|
|
|
|
AC_MSG_RESULT(off)
|
|
|
|
AC_DEFINE(TORRENT_DISABLE_ENCRYPTION,,[define not to use encryption support])
|
2008-10-20 00:38:25 +02:00
|
|
|
COMPILETIME_OPTIONS+="-DTORRENT_DISABLE_ENCRYPTION "
|
2007-06-09 00:55:33 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_ERROR([Unknown encryption option "$encryption". Use either "on" or "off".])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AM_CONDITIONAL(USE_ENCRYPTION, test "x$encryption" != "xoff")
|
|
|
|
|
2005-08-17 02:24:41 +02:00
|
|
|
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])
|
2009-05-06 21:51:03 +02:00
|
|
|
AC_CHECK_LIB(z, main, ,
|
2005-08-17 02:24:41 +02:00
|
|
|
[zlib="shipped"]
|
|
|
|
)
|
|
|
|
;;
|
|
|
|
"shipped")
|
|
|
|
AC_MSG_RESULT(shipped)
|
|
|
|
;;
|
|
|
|
"system")
|
|
|
|
AC_MSG_RESULT(system)
|
|
|
|
AC_CHECK_LIB(z, main, ,
|
2008-06-23 02:09:12 +02:00
|
|
|
AC_MSG_ERROR([libtorrent-rasterbar depends on zlib but zlib was not found on your system.])
|
2005-08-17 02:24:41 +02:00
|
|
|
)
|
|
|
|
;;
|
|
|
|
"no")
|
|
|
|
AC_MSG_RESULT()
|
2008-06-23 02:09:12 +02:00
|
|
|
AC_MSG_ERROR([libtorrent-rasterbar depends on zlib, you must specify either "system" or "shipped".])
|
2005-08-17 02:24:41 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_ERROR([Unknown zlib option "$zlib". Use either "system" or "shipped".])
|
2006-11-19 16:24:30 +01:00
|
|
|
;;
|
2005-08-17 02:24:41 +02:00
|
|
|
esac
|
|
|
|
if [[ "$zlib" = "shipped" ]]; then
|
|
|
|
ZLIB="\$(top_builddir)/zlib/libzlib.la"
|
2008-09-02 13:14:10 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_SHIPPED_ZLIB], true)
|
2005-08-27 19:02:43 +02:00
|
|
|
ZLIBINCL="-I\$(top_srcdir)/zlib"
|
2009-05-06 21:51:03 +02:00
|
|
|
elif [[ "$zlib" = "system" ]] || [[ "$zlib" = "detect" ]]; then
|
2009-04-06 21:05:08 +02:00
|
|
|
ZLIB="" # AC_CHECK_LIB will add -lz to @LIBS@ automatically
|
2008-09-02 13:14:10 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_SHIPPED_ZLIB], false)
|
2005-08-17 02:24:41 +02:00
|
|
|
ZLIBINCL=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl make ZLIB and ZLIBDIR visible to Makefiles
|
|
|
|
AC_SUBST([ZLIB])
|
|
|
|
AC_SUBST([ZLIBINCL])
|
|
|
|
|
2008-11-21 05:09:34 +01:00
|
|
|
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)
|
|
|
|
|
2008-11-25 16:12:42 +01:00
|
|
|
AM_PATH_PYTHON([2.4],,AC_MSG_ERROR([Python not found. Python is required to build python binding.]))
|
2008-11-21 05:09:34 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2009-04-12 12:54:12 +02:00
|
|
|
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)
|
|
|
|
|
2006-08-27 20:47:02 +02:00
|
|
|
dnl Check whether the examples should be build
|
|
|
|
AC_ARG_ENABLE(
|
|
|
|
[examples],
|
2006-09-27 22:04:49 +02:00
|
|
|
AS_HELP_STRING([--enable-examples],[Build the examples. Default is not to build them.]),
|
2006-08-27 20:47:02 +02:00
|
|
|
[[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)
|
2008-09-02 13:14:10 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_EXAMPLES], true)
|
2006-08-27 20:47:02 +02:00
|
|
|
;;
|
|
|
|
"no")
|
|
|
|
AC_MSG_RESULT(no)
|
2008-09-02 13:14:10 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_EXAMPLES], false)
|
2006-08-27 20:47:02 +02:00
|
|
|
;;
|
|
|
|
"")
|
|
|
|
AC_MSG_RESULT(yes (default))
|
2008-09-02 13:14:10 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_EXAMPLES], true)
|
2006-08-27 20:47:02 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_ERROR([Unknown --enable-examples option "$examples". Use either "yes" or "no".])
|
2006-11-19 16:24:30 +01:00
|
|
|
;;
|
2006-08-27 20:47:02 +02:00
|
|
|
esac
|
|
|
|
|
2008-07-03 01:23:55 +02:00
|
|
|
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)
|
2008-09-02 13:14:10 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_TESTS], true)
|
2008-07-03 01:23:55 +02:00
|
|
|
;;
|
|
|
|
"no")
|
|
|
|
AC_MSG_RESULT(no)
|
2008-09-02 13:14:10 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_TESTS], false)
|
2008-07-03 01:23:55 +02:00
|
|
|
;;
|
|
|
|
"")
|
|
|
|
AC_MSG_RESULT(yes (default))
|
2008-09-02 13:14:10 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_TESTS], true)
|
2008-07-03 01:23:55 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT()
|
2008-11-17 12:46:04 +01:00
|
|
|
AC_MSG_ERROR([Unknown --enable-tests option "$tests". Use either "yes" or "no".])
|
2008-07-03 01:23:55 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2006-11-19 16:24:30 +01:00
|
|
|
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.])
|
2008-11-29 22:33:21 +01:00
|
|
|
COMPILETIME_OPTIONS+="-DTORRENT_LINKING_SHARED "
|
2006-11-19 16:24:30 +01:00
|
|
|
fi
|
|
|
|
|
2009-01-07 02:58:43 +01:00
|
|
|
AC_DEFINE(BOOST_EXCEPTION_DISABLE,,[We don't need boost.exception features])
|
|
|
|
COMPILETIME_OPTIONS+="-DBOOST_EXCEPTION_DISABLE "
|
|
|
|
|
2005-08-17 02:24:41 +02:00
|
|
|
dnl want some debugging symbols with that?
|
|
|
|
AC_ARG_ENABLE(
|
|
|
|
[debug],
|
2006-11-19 16:24:30 +01:00
|
|
|
AS_HELP_STRING([--enable-debug],[Set compiler flags for debug symbols, default is no debugging.]),
|
2005-08-17 02:24:41 +02:00
|
|
|
[case "$enableval" in
|
|
|
|
no)
|
2006-11-19 16:24:30 +01:00
|
|
|
AC_DEFINE(NDEBUG,,[Define to disable debugging])
|
2008-11-29 22:33:21 +01:00
|
|
|
DEBUGFLAGS="-Os"
|
|
|
|
# COMPILETIME_OPTIONS+="-DNDEBUG "
|
2005-08-17 02:24:41 +02:00
|
|
|
;;
|
|
|
|
yes)
|
|
|
|
DEBUGFLAGS="-g"
|
2008-11-29 22:33:21 +01:00
|
|
|
COMPILETIME_OPTIONS+="-DTORRENT_DEBUG "
|
|
|
|
AC_DEFINE(TORRENT_DEBUG,,[Define to enable libtorrent debug build])
|
2005-08-17 02:24:41 +02:00
|
|
|
;;
|
|
|
|
*)
|
2008-11-29 22:33:21 +01:00
|
|
|
AC_MSG_RESULT()
|
|
|
|
AC_MSG_ERROR([Unknown --enable-debug option "$enableval". Use either "yes" or "no".])
|
2005-08-17 02:24:41 +02:00
|
|
|
;;
|
|
|
|
esac],
|
2008-11-29 22:33:21 +01:00
|
|
|
[DEBUGFLAGS="-Os"
|
|
|
|
AC_DEFINE(NDEBUG,,[Define to disable debugging])
|
|
|
|
# COMPILETIME_OPTIONS+="-DNDEBUG "
|
|
|
|
]
|
2005-08-17 02:24:41 +02:00
|
|
|
)
|
|
|
|
AC_SUBST(DEBUGFLAGS)
|
|
|
|
|
2008-05-15 02:08:33 +02:00
|
|
|
dnl Compile time options.
|
|
|
|
AC_SUBST(COMPILETIME_OPTIONS)
|
|
|
|
|
2008-11-21 05:09:34 +01:00
|
|
|
AC_OUTPUT([Makefile
|
|
|
|
src/Makefile
|
|
|
|
include/Makefile
|
|
|
|
zlib/Makefile
|
|
|
|
examples/Makefile
|
|
|
|
test/Makefile
|
|
|
|
bindings/python/Makefile
|
|
|
|
bindings/python/setup.py
|
|
|
|
libtorrent-rasterbar.pc])
|