[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#581601: Libraries linked into liboauth



Liboauth (certainly in 0.8.8) doesn't link in the full set of
libraries itself, but relies on the end user to do so, hence
dpkg-shlibdeps confusion. This is pretty silly, and also means we get
a large block of libs listed in oauth.pc, which is also annoying. The
attached patch fixes these issues with liboauth 0.8.8.

Tom Parker
diff --git a/oauth.pc.in b/oauth.pc.in
index 099c9f0..a7fb8ad 100644
--- a/oauth.pc.in
+++ b/oauth.pc.in
@@ -5,7 +5,8 @@ includedir=@includedir@
 
 Name: oauth
 Description: OAuth - server to server secure API authentication  
-Requires: @PC_REQ@
+Requires.private: @PC_REQ@
 Version: @VERSION@
-Libs: -L${libdir} -loauth -lm @PC_LIB@
+Libs: -L${libdir} -loauth
+Libs.private: -lm @PC_LIB@
 Cflags: -I${includedir} 
diff --git a/src/Makefile.am b/src/Makefile.am
index ebd6b61..da3d19c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,5 +3,5 @@ lib_LTLIBRARIES = liboauth.la
 include_HEADERS = oauth.h 
 
 liboauth_la_SOURCES=oauth.c config.h hash.c xmalloc.c xmalloc.h oauth_http.c
-liboauth_la_LDFLAGS=@LIBOAUTH_LDFLAGS@ -version-info @VERSION_INFO@
+liboauth_la_LDFLAGS=@LIBOAUTH_LDFLAGS@ -version-info @VERSION_INFO@ -Wl,--as-needed @PC_LIB@ @HASH_LIBS@
 liboauth_la_CFLAGS=@LIBOAUTH_CFLAGS@ @HASH_CFLAGS@ @CURL_CFLAGS@
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4607e03..d489853 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,7 +4,7 @@ ACLOCAL_AMFLAGS= -I m4
 OAUTHDIR =../src
 INCLUDES = -I$(srcdir)/$(OAUTHDIR)
 MYCFLAGS = @LIBOAUTH_CFLAGS@ @HASH_CFLAGS@ @CURL_CFLAGS@ 
-MYLDADD  = $(OAUTHDIR)/liboauth.la @HASH_LIBS@ @CURL_LIBS@
+MYLDADD  = $(OAUTHDIR)/liboauth.la
 
 tcwiki_SOURCES = selftest_wiki.c commontest.c commontest.h
 tcwiki_LDADD = $(MYLDADD)

Reply to: