summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2025-08-07 19:06:36 +0300
committerDenys Fedoryshchenko <denys.f@collabora.com>2025-08-07 22:23:36 +0300
commit822575c6b15777da7c279596aa76ae9e8f392d73 (patch)
treeac7022098361aef17181c4e324c66d54c288ee1a /accel-pppd
parent7351d79ab52964bbf4185c14c458064180f756f9 (diff)
downloadaccel-ppp-822575c6b15777da7c279596aa76ae9e8f392d73.tar.gz
accel-ppp-822575c6b15777da7c279596aa76ae9e8f392d73.zip
feat(build): Add MUSL detection and conditional linking
This commit introduces the ability to detect if the project is being built with the MUSL C library. A new variable `MUSL` is set to `ON` if MUSL is detected, and `OFF` otherwise. This is achieved by checking the output of `ldd --version`. The `accel-pppd/ctrl/pppoe/CMakeLists.txt` file is updated to conditionally link the `connlimit` library only when building with MUSL. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ctrl/pppoe/CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/pppoe/CMakeLists.txt b/accel-pppd/ctrl/pppoe/CMakeLists.txt
index fd4f9a36..b6f4a98f 100644
--- a/accel-pppd/ctrl/pppoe/CMakeLists.txt
+++ b/accel-pppd/ctrl/pppoe/CMakeLists.txt
@@ -13,7 +13,12 @@ SET(sources ${sources} tr101.c)
ENDIF(RADIUS)
ADD_LIBRARY(pppoe SHARED ${sources})
-TARGET_LINK_LIBRARIES(pppoe vlan-mon connlimit)
+# if MUSL is set then we need to link with the connlimit library
+IF (MUSL)
+ TARGET_LINK_LIBRARIES(pppoe vlan-mon connlimit)
+ELSE (MUSL)
+ TARGET_LINK_LIBRARIES(pppoe vlan-mon)
+ENDIF (MUSL)
set_property(TARGET pppoe PROPERTY CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set_property(TARGET pppoe PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/accel-ppp)