Feature/router bsd (#821)

* fix router compile warnings declaration-after-statement overlength-strings

* router disable PRINT(debug_level)

* ports rename dlmstp_[linux|bsd] to dlmstp_port

* copy ports/linux/dlmstp_port.c ports/bsd/dlmstp_port.c

* copy ports/linux/dlmstp_port.c ports/bsd/dlmstp_port.c

* fix typedef in bip_get_local_address_ioctl

* copy ports/linux/dlmstp_port.c ports/bsd/dlmstp_port.c

* add bsd support for router app

* fix clang __attribute__ optimize dont work
clang O2/O3/Os are also not working

* fix pre-commit

* fix bsd SO_BINDTODEVICE is not available

* add brew install libconfig for app router and bsd

* fix BACDL_MSTP test on macOS

* remove old comments
This commit is contained in:
Patrick Grimm
2024-10-21 14:53:01 +02:00
committed by GitHub
parent 57c3b81bb1
commit b9de08cf60
18 changed files with 1127 additions and 103 deletions
+11 -10
View File
@@ -660,8 +660,6 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
$<$<BOOL:${BACDL_MSTP}>:ports/linux/rs485.c>
$<$<BOOL:${BACDL_MSTP}>:ports/linux/rs485.h>
$<$<BOOL:${BACDL_MSTP}>:ports/linux/dlmstp.c>
$<$<BOOL:${BACDL_MSTP}>:ports/linux/dlmstp_linux.c>
$<$<BOOL:${BACDL_MSTP}>:ports/linux/dlmstp_linux.h>
$<$<BOOL:${BACDL_ETHERNET}>:ports/linux/ethernet.c>
ports/linux/mstimer-init.c)
@@ -900,15 +898,16 @@ if(BACNET_STACK_BUILD_APPS)
add_executable(reinit apps/reinit/main.c)
target_link_libraries(reinit PRIVATE ${PROJECT_NAME})
if(BACDL_MSTP AND NOT WIN32)
if(BACDL_BIP AND BACDL_MSTP AND EXISTS ${BACNET_PORT_DIRECTORY_PATH}/dlmstp_port.c)
find_path(LIBCONFIG_INCLUDE_DIR libconfig.h)
find_library(LIBCONFIG_LIBRARIES NAMES config)
if(NOT LIBCONFIG_LIBRARIES)
message(WARNING "BACNET: Will not build apps/router as libconfig not found")
else()
add_executable(
router
ports/linux/dlmstp_linux.c
ports/linux/dlmstp_linux.h
${BACNET_PORT_DIRECTORY_PATH}/dlmstp_port.c
${BACNET_PORT_DIRECTORY_PATH}/dlmstp_port.h
apps/router/ipmodule.c
apps/router/ipmodule.h
apps/router/main.c
@@ -921,18 +920,20 @@ if(BACNET_STACK_BUILD_APPS)
apps/router/portthread.c
apps/router/portthread.h)
target_include_directories(
router
PRIVATE ${PROJECT_NAME}
${LIBCONFIG_INCLUDE_DIR})
target_link_libraries(
router
PRIVATE ${PROJECT_NAME}
# needs libconfig
-lconfig)
${LIBCONFIG_LIBRARIES})
target_compile_options(router PRIVATE
target_compile_options(router PRIVATE
# These make this example not totally C90 compatible but it is ok.
-Wno-declaration-after-statement
-Wno-overlength-strings
-Wno-variadic-macros
-O1
)
endif()
endif()