From b0aac4a0fcb21a7ddaa7a3540857878df6197ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Tue, 20 Sep 2022 17:06:06 +0300 Subject: helper: provide options to explicitly link static libodphelper via pkg-config --static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On some distros (Fedora), $CC -static doesn't work, because static system libraries are not available. Provide options to explicitly link static libodphelper via pkg-config --static, so that application can link libodphelper statically without the -static linker option. Signed-off-by: Jere Leppänen Reviewed-by: Tuomas Taipale Reviewed-by: Matias Elo --- helper/.gitignore | 1 + helper/Makefile.am | 2 +- helper/libodphelper-internal.pc.in | 11 +++++++++++ helper/libodphelper.pc.in | 4 ++-- helper/m4/configure.m4 | 1 + 5 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 helper/libodphelper-internal.pc.in (limited to 'helper') diff --git a/helper/.gitignore b/helper/.gitignore index edf7a0ba0..d63937fed 100644 --- a/helper/.gitignore +++ b/helper/.gitignore @@ -1 +1,2 @@ libodphelper.pc +libodphelper-internal.pc diff --git a/helper/Makefile.am b/helper/Makefile.am index 458a99f92..28a4b1a60 100644 --- a/helper/Makefile.am +++ b/helper/Makefile.am @@ -1,7 +1,7 @@ include $(top_srcdir)/Makefile.inc pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libodphelper.pc +pkgconfig_DATA = libodphelper.pc libodphelper-internal.pc AM_CPPFLAGS = \ $(ODP_INCLUDES) \ diff --git a/helper/libodphelper-internal.pc.in b/helper/libodphelper-internal.pc.in new file mode 100644 index 000000000..4890cf333 --- /dev/null +++ b/helper/libodphelper-internal.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libodphelper-internal +Description: ODP helper internal pkg-config file. Do not use directly, use libodphelper.pc instead. +Version: @PKGCONFIG_VERSION@ +Libs: -L${libdir} -Wl,--push-state,--as-needed,-lodphelper,--pop-state +Libs.private: @LIBCLI_LIBS@ +Cflags: -I${includedir} diff --git a/helper/libodphelper.pc.in b/helper/libodphelper.pc.in index be99eeefc..610b62f75 100644 --- a/helper/libodphelper.pc.in +++ b/helper/libodphelper.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: libodphelper Description: Helper for the ODP packet processing engine Version: @PKGCONFIG_VERSION@ -Libs: -L${libdir} -lodphelper -Libs.private: @LIBCLI_LIBS@ +Requires: libodphelper-internal +Libs.private: -L${libdir} -l:libodphelper.a Cflags: -I${includedir} diff --git a/helper/m4/configure.m4 b/helper/m4/configure.m4 index 2e1076172..d88aae430 100644 --- a/helper/m4/configure.m4 +++ b/helper/m4/configure.m4 @@ -60,4 +60,5 @@ AC_DEFINE_UNQUOTED([ODPH_DEPRECATED_API], [$ODPH_DEPRECATED_API], [Define to 1 to enable deprecated helper API definitions]) AC_CONFIG_FILES([helper/libodphelper.pc + helper/libodphelper-internal.pc helper/test/Makefile]) -- cgit v1.2.3