Skip to content

Commit 4b38d8e

Browse files
author
night1rider
committed
Updating support/wolfssl.pc.in, CMakelist.txt, and configure.ac to track missing apple options in the resulting wolfssl.pc file by adding new PC_LIBS_PRIVATE to track options
1 parent cc2f792 commit 4b38d8e

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ set(WOLFSSL_DEFINITIONS)
6666
set(WOLFSSL_LINK_LIBS)
6767
set(WOLFSSL_INCLUDE_DIRS)
6868

69+
# Initialize pkg-config private variables
70+
set(PC_LIBS_PRIVATE "")
71+
6972
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
7073
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/functions.cmake)
7174

@@ -2926,6 +2929,16 @@ if(WOLFSSL_INSTALL)
29262929
endif()
29272930
endif()
29282931

2932+
# Add required frameworks for static linking on Apple platforms
2933+
if(APPLE AND NOT BUILD_SHARED_LIBS)
2934+
if(WOLFSSL_SYS_CA_CERTS)
2935+
list(APPEND PC_LIBS_PRIVATE "-framework CoreFoundation" "-framework Security")
2936+
endif()
2937+
endif()
2938+
2939+
# Convert lists to space-separated strings for pkg-config
2940+
string(JOIN " " PC_LIBS_PRIVATE ${PC_LIBS_PRIVATE})
2941+
29292942
configure_file(support/wolfssl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc @ONLY)
29302943
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc
29312944
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

configure.ac

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ OPTIMIZE_HUGE_CFLAGS="-funroll-loops -DTFM_SMALL_SET -DTFM_HUGE_SET"
196196
DEBUG_CFLAGS="-g -DDEBUG -DDEBUG_WOLFSSL"
197197
LIB_ADD=
198198
LIB_STATIC_ADD=
199+
PC_LIBS_PRIVATE=""
199200

200201
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS $EXTRA_OPTS_CFLAGS"
201202
OPTIMIZE_FAST_CFLAGS="$OPTIMIZE_FAST_CFLAGS $EXTRA_OPTS_CFLAGS"
@@ -10606,6 +10607,13 @@ case $host_os in
1060610607
MINGW_LIB_WARNING="yes"
1060710608
fi
1060810609
fi ;;
10610+
*darwin*)
10611+
# Add required frameworks for static linking on macOS
10612+
if test "$enable_shared" = "no"; then
10613+
if test "x$ENABLED_SYS_CA_CERTS" = "xyes"; then
10614+
PC_LIBS_PRIVATE="$PC_LIBS_PRIVATE -framework CoreFoundation -framework Security"
10615+
fi
10616+
fi ;;
1060910617
esac
1061010618
1061110619
if test "$enable_shared" = "no"; then
@@ -10905,6 +10913,7 @@ AC_SUBST([AM_CCASFLAGS])
1090510913
AC_SUBST([LIB_ADD])
1090610914
AC_SUBST([LIB_STATIC_ADD])
1090710915
AC_SUBST([LIBM])
10916+
AC_SUBST([PC_LIBS_PRIVATE])
1090810917
1090910918
# FINAL
1091010919
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])

support/wolfssl.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ Name: wolfssl
77
Description: wolfssl C library.
88
Version: @VERSION@
99
Libs: -L${libdir} -lwolfssl
10-
Libs.private: @LIBM@
10+
Libs.private: @LIBM@ @PC_LIBS_PRIVATE@
1111
Cflags: -I${includedir}

0 commit comments

Comments
 (0)