Skip to content

Commit 4c8c8cc

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 bdc1f89 commit 4c8c8cc

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
@@ -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"
@@ -10628,6 +10629,13 @@ case $host_os in
1062810629
MINGW_LIB_WARNING="yes"
1062910630
fi
1063010631
fi ;;
10632+
*darwin*)
10633+
# Add required frameworks for static linking on macOS
10634+
if test "$enable_shared" = "no"; then
10635+
if test "x$ENABLED_SYS_CA_CERTS" = "xyes"; then
10636+
PC_LIBS_PRIVATE="$PC_LIBS_PRIVATE -framework CoreFoundation -framework Security"
10637+
fi
10638+
fi ;;
1063110639
esac
1063210640
1063310641
if test "$enable_shared" = "no"; then
@@ -10927,6 +10935,7 @@ AC_SUBST([AM_CCASFLAGS])
1092710935
AC_SUBST([LIB_ADD])
1092810936
AC_SUBST([LIB_STATIC_ADD])
1092910937
AC_SUBST([LIBM])
10938+
AC_SUBST([PC_LIBS_PRIVATE])
1093010939
1093110940
# FINAL
1093210941
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)