Too many flags in opensaml pkgconfig

Russ Allbery rra at debian.org
Sat Jan 28 03:09:23 UTC 2012


Hi Scott,

I'm getting our attribute release policy broadened so that I can file this
directly in JIRA, but wanted to send you a note as well just in case I
forget to file it later.

While building the new OpenSAML packages, I noticed that a bit more is
included in pkgconfig than you want:

Name: opensaml
Description: OpenSAML library
Version: 2.4.3
Requires: 
Libs: -L${libdir} -lxmltooling -lxml-security-c -lxerces-c -L/usr/lib -llog4cpp -lnsl -lz -lsaml
Cflags: -I${includedir} -pthread -g -Wall -O2 -O2 -DNDEBUG 

I see that this is generated from a macro that came from the Autoconf
archive, but I think it's not really correct.  I'm fairly sure that its
inclusion of @CFLAGS@ in Cflags is wrong (those optimization flags aren't
required for clients of the library), and its inclusion of @LDFLAGS@ in
Libs is probably also wrong.

I think this would be more correct:

diff --git a/m4/ax_create_pkgconfig_info.m4 b/m4/ax_create_pkgconfig_info.m4
index 60ac548..e64a19c 100644
--- a/m4/ax_create_pkgconfig_info.m4
+++ b/m4/ax_create_pkgconfig_info.m4
@@ -214,8 +214,8 @@ Name: @PACKAGE_NAME@
 Description: @PACKAGE_DESCRIPTION@
 Version: @PACKAGE_VERSION@
 Requires: @PACKAGE_REQUIRES@
-Libs: -L\${libdir} @LDFLAGS@ @LIBS@
-Cflags: -I\${includedir} @CPPFLAGS@
+Libs: -L\${libdir} @LIBS@
+Cflags: -I\${includedir}
 AXEOF
 fi # DONE generate $pkgconfig_generate.in
 AC_MSG_NOTICE(creating $pkgconfig_generate)

I suspect the motivation for including LDFLAGS and CPPFLAGS is the worry
that those flags may be required to pick up other libraries and headers,
but it looks like at least some of the library -L flags end up in LIBS
anyway, and the -L${libdir} and -I{includedir} will of course always take
care of finding OpenSAML's own libraries and headers.  Which I think is
all that you, as library provider, are really responsible for.

The only thing I'm not sure about is if -pthread is required for all
clients of the libsaml library (mostly because I've never been completely
clear on when that flag is required).

-- 
Russ Allbery (rra at debian.org)               <http://www.eyrie.org/~eagle/>



More information about the Pkg-shibboleth-devel mailing list