aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorJere Leppänen <jere.leppanen@nokia.com>2022-09-20 17:06:06 +0300
committerMatias Elo <matias.elo@nokia.com>2022-10-19 13:29:08 +0300
commitb0aac4a0fcb21a7ddaa7a3540857878df6197ecb (patch)
tree6e63a38f96ce908bd8030bf3efb966a32f2c2fbd /helper
parentcb13a1fe04a5b14af678db1bf5708f2389bb9e7d (diff)
helper: provide options to explicitly link static libodphelper via pkg-config --static
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 <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'helper')
-rw-r--r--helper/.gitignore1
-rw-r--r--helper/Makefile.am2
-rw-r--r--helper/libodphelper-internal.pc.in11
-rw-r--r--helper/libodphelper.pc.in4
-rw-r--r--helper/m4/configure.m41
5 files changed, 16 insertions, 3 deletions
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])