From eea263f1cf767bd9aca4aa8db69d3efdf2bf940d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20W=C3=A1gner?= Date: Sun, 9 Dec 2018 18:05:30 +0100 Subject: [PATCH] Add Pthreads (and possibly other) flags to the pkg-config file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Proper Libs.private enables linking applications statically against libqb: static archives (.a) don't carry their own dependency information, unlike shared libraries (.so). Modern libc versions include socket and RT functions, so socket_LIBS and rt_LIBS will be empty there, but we include them for strict correctness on older platforms; basically, we're matching libqb_la_LIBADD here. Consequently, nsl_LIBS and GLIB_LIBS don't enter this field, since they are only used in the examples and tests, not in the library proper. Cflags, on the other hand, is emitted all the time and (under GCC) propagates the -pthread option (which also affects the preprocessing stage) to all users of libqb even when compiling modules or linking everything dynamically. Signed-off-by: Ferenc Wágner --- lib/libqb.pc.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libqb.pc.in b/lib/libqb.pc.in index 3819b93fa..e562c6f6d 100644 --- a/lib/libqb.pc.in +++ b/lib/libqb.pc.in @@ -8,5 +8,5 @@ Version: @PACKAGE_VERSION@ Description: libqb Requires: Libs: -L${libdir} -lqb -Libs.private: @LIBS@ @SYSTEMD_LIBS@ -Cflags: -I${includedir} +Libs.private: @LIBS@ @dlopen_LIBS@ @PTHREAD_LIBS@ @socket_LIBS@ @rt_LIBS@ @SYSTEMD_LIBS@ +Cflags: -I${includedir} @PTHREAD_CFLAGS@