Skip to content

Commit 4dfa75f

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 4ca5c31 commit 4dfa75f

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

@@ -2969,6 +2972,16 @@ if(WOLFSSL_INSTALL)
29692972
endif()
29702973
endif()
29712974

2975+
# Add required frameworks for static linking on Apple platforms
2976+
if(APPLE AND NOT BUILD_SHARED_LIBS)
2977+
if(WOLFSSL_SYS_CA_CERTS)
2978+
list(APPEND PC_LIBS_PRIVATE "-framework CoreFoundation" "-framework Security")
2979+
endif()
2980+
endif()
2981+
2982+
# Convert lists to space-separated strings for pkg-config
2983+
string(JOIN " " PC_LIBS_PRIVATE ${PC_LIBS_PRIVATE})
2984+
29722985
configure_file(support/wolfssl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc @ONLY)
29732986
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc
29742987
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

configure.ac

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ OPTIMIZE_HUGE_CFLAGS="-funroll-loops -DTFM_SMALL_SET -DTFM_HUGE_SET"
202202
DEBUG_CFLAGS="-g -DDEBUG -DDEBUG_WOLFSSL"
203203
LIB_ADD=
204204
LIB_STATIC_ADD=
205+
PC_LIBS_PRIVATE=""
205206

206207
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS $EXTRA_OPTS_CFLAGS"
207208
OPTIMIZE_FAST_CFLAGS="$OPTIMIZE_FAST_CFLAGS $EXTRA_OPTS_CFLAGS"
@@ -10642,6 +10643,13 @@ case $host_os in
1064210643
MINGW_LIB_WARNING="yes"
1064310644
fi
1064410645
fi ;;
10646+
*darwin*)
10647+
# Add required frameworks for static linking on macOS
10648+
if test "$enable_shared" = "no"; then
10649+
if test "x$ENABLED_SYS_CA_CERTS" = "xyes"; then
10650+
PC_LIBS_PRIVATE="$PC_LIBS_PRIVATE -framework CoreFoundation -framework Security"
10651+
fi
10652+
fi ;;
1064510653
esac
1064610654
1064710655
if test "$enable_shared" = "no"; then
@@ -10941,6 +10949,7 @@ AC_SUBST([AM_CCASFLAGS])
1094110949
AC_SUBST([LIB_ADD])
1094210950
AC_SUBST([LIB_STATIC_ADD])
1094310951
AC_SUBST([LIBM])
10952+
AC_SUBST([PC_LIBS_PRIVATE])
1094410953
1094510954
# FINAL
1094610955
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)