Changed configure script to not to modify LIBS, when checking for dependencies. Changed libtorrent.pc.in again, since the libraries used were

wrong, because $LIBS was used. Corrected Makefile.am in test, examples and src.
This commit is contained in:
Michael Wojciechowski 2007-12-14 20:53:56 +00:00
parent ac28fa7b62
commit bce53063ab
6 changed files with 28 additions and 17 deletions

View File

@ -30,6 +30,8 @@ ASIO_DIR=$srcdir/include/libtorrent/asio
AC_CHECK_FILES([$ASIO_DIR/../asio.hpp $ASIO_DIR/ssl/stream.hpp $ASIO_DIR/ip/tcp.hpp ],,AC_MSG_ERROR([ ASIO header files not found. Get them from asio.sourceforge.net (use CVS head) and include or symlink them. Example: ln -s ../../../asio/include/asio.hpp include/libtorrent/asio.hpp && ln -s ../../../asio/include/asio include/libtorrent/asio ]) )
dnl check asio version
SAVED_LIBS="$LIBS"
dnl Check for pthreads and boost libraries.
ACX_PTHREAD
@ -76,6 +78,8 @@ if test -z "$BOOST_PROGRAM_OPTIONS_LIB"; then
BUILD_TESTCLIENT=no;
fi
LIBS="$SAVED_LIBS"
if [[ "x$BUILD_TESTCLIENT" != "xno" ]]; then
CLIENT_TEST_BIN=client_test;
AC_SUBST(CLIENT_TEST_BIN)
@ -158,7 +162,7 @@ AC_MSG_CHECKING([how to use encryption])
case "$encryption" in
"on")
AC_MSG_RESULT(on)
CHECK_SSL()
CHECK_SSL()
AC_DEFINE(TORRENT_USE_OPENSSL,,[define to use openssl with libtorrent])
;;

View File

@ -15,4 +15,5 @@ simple_client_SOURCES = simple_client.cpp
simple_client_LDADD = $(top_builddir)/src/libtorrent.la
AM_CXXFLAGS=-ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @DEBUGFLAGS@ @PTHREAD_CFLAGS@ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION
AM_LDFLAGS= ${LDLAGS} -L./ -l@BOOST_IOSTREAMS_LIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION
AM_LDFLAGS= ${LDLAGS} -L./ -l@BOOST_IOSTREAMS_LIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION @SSL_LDFLAGS@ @SSL_LIBS@

View File

@ -12,5 +12,5 @@ Name: libtorrent
Description: Bittorrent library.
Version: @VERSION@
Libs: -L${libdir} -ltorrent
Libs.private: @LIBS@
Libs.private: @LIBS@ -l@BOOST_IOSTREAMS_LIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LIBS@
Cflags: -I${includedir} -I${includedir}/libtorrent @CPPFLAGS@

View File

@ -42,23 +42,27 @@
AC_DEFUN([CHECK_SSL],
[
dnl AC_MSG_CHECKING(if ssl is wanted)
dnl AC_ARG_WITH(ssl,
dnl [ --with-ssl enable ssl [will check /usr/local/ssl
dnl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr ]
dnl ],
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";
CFLAGS="$CFLAGS -I$ssldir/include/openssl -DHAVE_SSL";
CXXFLAGS="$CXXFLAGS -I$ssldir/include/openssl -DHAVE_SSL";
SSL_CFLAGS="$CFLAGS -I$ssldir/include/openssl -DHAVE_SSL";
AC_SUBST(SSL_CFLAGS)
SSL_CXXFLAGS="$CXXFLAGS -I$ssldir/include/openssl -DHAVE_SSL";
AC_SUBST(SSL_CXXFLAGS)
break;
fi
if test -f "$dir/include/ssl.h"; then
found_ssl="yes";
CFLAGS="$CFLAGS -I$ssldir/include/ -DHAVE_SSL";
CXXFLAGS="$CXXFLAGS -I$ssldir/include/ -DHAVE_SSL";
SSL_CFLAGS="$CFLAGS -I$ssldir/include/ -DHAVE_SSL";
AC_SUBST(SSL_CFLAGS)
SSL_CXXFLAGS="$CXXFLAGS -I$ssldir/include/ -DHAVE_SSL";
AC_SUBST(SSL_CXXFLAGS)
break
fi
done
@ -66,8 +70,10 @@ dnl [ AC_MSG_RESULT(yes)
AC_MSG_ERROR(Cannot find ssl libraries)
else
printf "OpenSSL found in $ssldir\n";
LIBS="$LIBS -lssl -lcrypto";
LDFLAGS="$LDFLAGS -L$ssldir/lib";
SSL_LIBS="$LIBS -lssl -lcrypto";
AC_SUBST(SSL_LIBS)
SSL_LDFLAGS="$LDFLAGS -L$ssldir/lib";
AC_SUBST(SSL_LDFLAGS)
HAVE_SSL=yes
fi
AC_SUBST(HAVE_SSL)

View File

@ -94,8 +94,8 @@ $(top_srcdir)/include/libtorrent/version.hpp
libtorrent_la_LDFLAGS = $(LDFLAGS) -release @VERSION@
libtorrent_la_LIBADD = @ZLIB@ -l@BOOST_IOSTREAMS_LIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@
libtorrent_la_LIBADD = @ZLIB@ -l@BOOST_IOSTREAMS_LIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LIBS@
AM_CXXFLAGS= -ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @ZLIBINCL@ @DEBUGFLAGS@ @PTHREAD_CFLAGS@ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION
AM_LDFLAGS= $(LDFLAGS) -l@BOOST_IOSTREAMS_LIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@
AM_CXXFLAGS= -ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @ZLIBINCL@ @DEBUGFLAGS@ @PTHREAD_CFLAGS@ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION @SSL_CXXFLAGS@
AM_LDFLAGS= $(LDFLAGS) -l@BOOST_IOSTREAMS_LIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LDFLAGS@ @SSL_LIBS@

View File

@ -39,4 +39,4 @@ test_bandwidth_limiter_LDADD = $(top_builddir)/src/libtorrent.la
noinst_HEADERS = test.hpp setup_transfer.hpp
AM_CXXFLAGS=-ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @DEBUGFLAGS@ @PTHREAD_CFLAGS@ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION
AM_LDFLAGS= -l@BOOST_IOSTREAMS_LIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@
AM_LDFLAGS= -l@BOOST_IOSTREAMS_LIB@ -l@BOOST_DATE_TIME_LIB@ -l@BOOST_FILESYSTEM_LIB@ -l@BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LDFLAGS@ @SSL_LIBS@