1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-23 12:05:11 -07:00

Add -pthread to pkgconfig's Libs.private if enabled

Allows static builds to correctly inherit the pthread dependency when
used with pkg-config --static --libs libsodium
This commit is contained in:
Luca Boccassi 2019-01-14 21:53:12 +00:00 committed by Frank Denis
parent b3725dc2c9
commit 3933a7402c
3 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,7 @@ AC_SUBST(DLL_VERSION)
AC_LANG_ASSERT(C) AC_LANG_ASSERT(C)
LX_CFLAGS=${CFLAGS-NONE} LX_CFLAGS=${CFLAGS-NONE}
PKGCONFIG_LIBS_PRIVATE=""
dnl Path check dnl Path check
@ -127,6 +128,7 @@ AS_IF([test "x$withval" = "xyes"], [
AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files]) AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files])
with_threads="yes" with_threads="yes"
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
PKGCONFIG_LIBS_PRIVATE="$PTHREAD_LIBS $PTHREAD_CFLAGS $PKGCONFIG_LIBS_PRIVATE"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"]) CC="$PTHREAD_CC"])
], [with_threads="no"]) ], [with_threads="no"])
@ -193,6 +195,7 @@ AC_ARG_ENABLE(opt,
]) ])
AC_SUBST([MAINT]) AC_SUBST([MAINT])
AC_SUBST(PKGCONFIG_LIBS_PRIVATE, $PKGCONFIG_LIBS_PRIVATE)
AX_VALGRIND_CHECK AX_VALGRIND_CHECK

View File

@ -3,4 +3,5 @@ Version: @PACKAGE_VERSION@
Description: A modern and easy-to-use crypto library Description: A modern and easy-to-use crypto library
Libs: -L${pcfiledir}/src/libsodium -lsodium Libs: -L${pcfiledir}/src/libsodium -lsodium
Libs.private: @PKGCONFIG_LIBS_PRIVATE@
Cflags: -I${pcfiledir}/src/libsodium/include -I@top_srcdir@/src/libsodium/include -I@top_srcdir@/src/libsodium/include/sodium Cflags: -I${pcfiledir}/src/libsodium/include -I@top_srcdir@/src/libsodium/include -I@top_srcdir@/src/libsodium/include/sodium

View File

@ -8,4 +8,5 @@ Version: @PACKAGE_VERSION@
Description: A modern and easy-to-use crypto library Description: A modern and easy-to-use crypto library
Libs: -L${libdir} -lsodium Libs: -L${libdir} -lsodium
Libs.private: @PKGCONFIG_LIBS_PRIVATE@
Cflags: -I${includedir} Cflags: -I${includedir}