summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2020-05-11 20:50:02 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-05-12 08:53:12 +0200
commit98e5904165859679cd78825bcccb52306ee3bb66 (patch)
tree29882f61577e640f4c304d30cf0ef40c8901949c /configure.ac
parentad6416986755e417c66e2c646d532561b445a5b5 (diff)
downloadcurl-98e5904165859679cd78825bcccb52306ee3bb66.tar.gz
libcurl.pc: Merge Libs.private into Libs for static-only builds
A project being built entirely statically will call pkg-config with --static, which utilises the Libs.private field. Conversely it will not use --static when not being built entirely statically, even if there is only a static build of libcurl available. This will most likely cause the build to fail due to underlinking unless we merge the Libs fields. Consider that this is what the Meson build system does when it generates pkg-config files. I have also reflected this in the --libs argument of curl-config even though REQUIRE_LIB_DEPS always seems to be "yes" anyway. Closes #5373
Diffstat (limited to 'configure.ac')
-rwxr-xr-xconfigure.ac7
1 files changed, 7 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index aa79cfa42..6de818a3e 100755
--- a/configure.ac
+++ b/configure.ac
@@ -4727,6 +4727,13 @@ dnl to let curl-config output the static libraries correctly
ENABLE_STATIC="$enable_static"
AC_SUBST(ENABLE_STATIC)
+dnl merge the pkg-config Libs.private field into Libs when static-only
+if test "x$enable_shared" = "xno"; then
+ LIBCURL_NO_SHARED=$LIBCURL_LIBS
+else
+ LIBCURL_NO_SHARED=
+fi
+AC_SUBST(LIBCURL_NO_SHARED)
dnl
dnl For keeping supported features and protocols also in pkg-config file