mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Merge pull request #7224 from mpsuzuki/pkg-config-static-link
Add "Libs.private: -m" to wolfssl.pc.in for a static linking
This commit is contained in:
@ -2582,6 +2582,16 @@ if(WOLFSSL_INSTALL)
|
||||
set(includedir "\${prefix}/include")
|
||||
set(VERSION ${PROJECT_VERSION})
|
||||
|
||||
# Setting libm in Libs.private of wolfssl.pc.
|
||||
# See "Link Libraries" in above about `m` insertion to LINK_LIBRARIES
|
||||
get_target_property(_wolfssl_dep_libs wolfssl LINK_LIBRARIES)
|
||||
list(FIND _wolfssl_dep_libs m _dep_libm)
|
||||
if ("${_dep_libm}" GREATER -1)
|
||||
set(LIBM -lm)
|
||||
else()
|
||||
set(LIBM)
|
||||
endif()
|
||||
|
||||
configure_file(support/wolfssl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
@ -9205,6 +9205,7 @@ AC_SUBST([AM_LDFLAGS])
|
||||
AC_SUBST([AM_CCASFLAGS])
|
||||
AC_SUBST([LIB_ADD])
|
||||
AC_SUBST([LIB_STATIC_ADD])
|
||||
AC_SUBST([LIBM])
|
||||
|
||||
# FINAL
|
||||
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
|
||||
|
@ -7,4 +7,5 @@ Name: wolfssl
|
||||
Description: wolfssl C library.
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lwolfssl
|
||||
Libs.private: @LIBM@
|
||||
Cflags: -I${includedir}
|
||||
|
Reference in New Issue
Block a user