From c23fda2e2ab8e1777133cf8d2b982c47b91dbc6e Mon Sep 17 00:00:00 2001 From: cg25 Date: Mon, 6 Apr 2009 19:05:08 +0000 Subject: [PATCH] get rid of some duplicated flags during build and in pkg-config --- configure.in | 8 +++----- libtorrent-rasterbar.pc.in | 4 ++-- m4/check_ssl.m4 | 22 ++++++++++------------ 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/configure.in b/configure.in index 11e0f9dbd..6fa74b681 100644 --- a/configure.in +++ b/configure.in @@ -36,6 +36,8 @@ INTERFACE_VERSION_INFO=$VERSION_INFO_CURRENT:$VERSION_INFO_REVISION:$VERSION_INF AC_SUBST(INTERFACE_VERSION_INFO) dnl --------------------------------------------------------------------------- +AC_CONFIG_MACRO_DIR([m4]) + AC_PROG_CC if test -z "$(which $CC)"; then @@ -59,10 +61,6 @@ AC_SYS_LARGEFILE dnl Check for pthreads. ACX_PTHREAD -dnl Apply pthread config. -CC=$PTHREAD_CC -CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS" -LIBS="$LIBS $PTHREAD_LIBS" AM_CONDITIONAL([ENABLE_SHIPPED_ASIO], false) @@ -297,7 +295,7 @@ if [[ "$zlib" = "shipped" ]]; then AM_CONDITIONAL([ENABLE_SHIPPED_ZLIB], true) ZLIBINCL="-I\$(top_srcdir)/zlib" elif [[ "$zlib" = "system" ]]; then - ZLIB="-lz" + ZLIB="" # AC_CHECK_LIB will add -lz to @LIBS@ automatically AM_CONDITIONAL([ENABLE_SHIPPED_ZLIB], false) ZLIBINCL="" fi diff --git a/libtorrent-rasterbar.pc.in b/libtorrent-rasterbar.pc.in index 66201060f..beb4f9c9f 100644 --- a/libtorrent-rasterbar.pc.in +++ b/libtorrent-rasterbar.pc.in @@ -12,6 +12,6 @@ Name: libtorrent-rasterbar Description: Bittorrent library. Version: @VERSION@ Libs: -L${libdir} -ltorrent-rasterbar -Libs.private: @LIBS@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LIBS@ @BOOST_SYSTEM_LIB@ @SSL_LDFLAGS@ -Cflags: -I${includedir} -I${includedir}/libtorrent @COMPILETIME_OPTIONS@ @SSL_CXXFLAGS@ +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@ diff --git a/m4/check_ssl.m4 b/m4/check_ssl.m4 index bc1a3d0e4..6e0aa3a6b 100644 --- a/m4/check_ssl.m4 +++ b/m4/check_ssl.m4 @@ -51,18 +51,14 @@ dnl [ AC_MSG_RESULT(yes) ssldir="$dir" if test -f "$dir/include/openssl/ssl.h"; then found_ssl="yes"; - 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) + 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="$CFLAGS -I$ssldir/include/ -DHAVE_SSL"; - AC_SUBST(SSL_CFLAGS) - SSL_CXXFLAGS="$CXXFLAGS -I$ssldir/include/ -DHAVE_SSL"; - AC_SUBST(SSL_CXXFLAGS) + SSL_CFLAGS="-I$ssldir/include/ -DHAVE_SSL"; + SSL_CXXFLAGS="-I$ssldir/include/ -DHAVE_SSL"; break fi done @@ -70,12 +66,14 @@ dnl [ AC_MSG_RESULT(yes) AC_MSG_ERROR(Cannot find ssl libraries) else printf "OpenSSL found in $ssldir\n"; - SSL_LIBS="$LIBS -lssl -lcrypto"; - AC_SUBST(SSL_LIBS) - SSL_LDFLAGS="$LDFLAGS -L$ssldir/lib"; - AC_SUBST(SSL_LDFLAGS) + 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 [