devel/bacnet-stack: Fix build on FreeBSD 13.x
PR: 287882 Reported by: Chad Jacob Milios <milios __at__ ccsys.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
PORTNAME= bacnet-stack
|
||||
PORTVERSION= 1.4.1
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= devel
|
||||
|
||||
MAINTAINER= acm@FreeBSD.org
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--- ports/bsd/bip6.c.orig 2025-06-28 19:56:23 UTC
|
||||
+++ ports/bsd/bip6.c
|
||||
@@ -22,8 +22,8 @@
|
||||
#endif
|
||||
#include "bacport.h"
|
||||
|
||||
-#if defined(__APPLE__) || defined(__darwin__)
|
||||
-/* OSX seems not to define these. */
|
||||
+#if defined(__APPLE__) || defined(__darwin__) || defined(__FreeBSD__)
|
||||
+/* FreeBSD 13.x and OSX seems not to define these. */
|
||||
#ifndef s6_addr16
|
||||
#define s6_addr16 __u6_addr.__u6_addr16
|
||||
#endif
|
||||
@@ -1,5 +1,6 @@
|
||||
PORTNAME= bacnet-stack
|
||||
PORTVERSION= 1.4.1
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= sysutils
|
||||
PKGNAMESUFFIX= -apps
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
--- CMakeLists.txt.orig 2025-06-23 23:19:03 UTC
|
||||
+++ CMakeLists.txt
|
||||
@@ -834,10 +834,40 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
|
||||
target_sources(${PROJECT_NAME} PRIVATE
|
||||
ports/bsd/bacport.h
|
||||
- ports/bsd/bip-init.c
|
||||
+ $<$<BOOL:${BACDL_BIP}>:ports/bsd/bip-init.c>
|
||||
+ $<$<BOOL:${BACDL_BIP6}>:ports/bsd/bip6.c>
|
||||
+ $<$<BOOL:${BACDL_MSTP}>:ports/bsd/rs485.c>
|
||||
+ $<$<BOOL:${BACDL_MSTP}>:ports/bsd/rs485.h>
|
||||
+ $<$<BOOL:${BACDL_MSTP}>:ports/bsd/dlmstp.c>
|
||||
ports/bsd/datetime-init.c
|
||||
ports/bsd/mstimer-init.c
|
||||
+ $<$<BOOL:${BACDL_BSC}>:ports/bsd/bsc-event.c>
|
||||
+ $<$<BOOL:${BACDL_BSC}>:ports/bsd/websocket-cli.c>
|
||||
+ $<$<BOOL:${BACDL_BSC}>:ports/bsd/websocket-srv.c>
|
||||
+ $<$<BOOL:${BACDL_BSC}>:ports/bsd/websocket-global.c>
|
||||
ports/bsd/stdbool.h)
|
||||
+
|
||||
+ if(BACDL_ETHERNET)
|
||||
+ FIND_PATH(PCAP_INCLUDE pcap.h)
|
||||
+ if(NOT PCAP_INCLUDE)
|
||||
+ message(WARNING "BACNET: pcap.h header file not found")
|
||||
+ else()
|
||||
+ message(STATUS "BACNET: pcap Include:...................\"${PCAP_INCLUDE}\"")
|
||||
+ endif()
|
||||
+ FIND_LIBRARY(PCAP_LIBRARIES NAMES pcap)
|
||||
+ if(NOT PCAP_LIBRARIES)
|
||||
+ message(WARNING "BACNET: libpcap not found")
|
||||
+ else()
|
||||
+ message(STATUS "BACNET: pcap Lib:.......................\"${PCAP_LIBRARIES}\"")
|
||||
+ endif()
|
||||
+ if(PCAP_INCLUDE AND PCAP_LIBRARIES)
|
||||
+ include_directories(${PCAP_INCLUDE})
|
||||
+ link_libraries(${PCAP_LIBRARIES})
|
||||
+ target_sources(${PROJECT_NAME} PRIVATE
|
||||
+ ports/bsd/ethernet.c
|
||||
+ )
|
||||
+ endif()
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||
@@ -0,0 +1,13 @@
|
||||
--- ports/bsd/bip6.c.orig 2025-06-28 19:56:23 UTC
|
||||
+++ ports/bsd/bip6.c
|
||||
@@ -22,8 +22,8 @@
|
||||
#endif
|
||||
#include "bacport.h"
|
||||
|
||||
-#if defined(__APPLE__) || defined(__darwin__)
|
||||
-/* OSX seems not to define these. */
|
||||
+#if defined(__APPLE__) || defined(__darwin__) || defined(__FreeBSD__)
|
||||
+/* FreeBSD 13.x and OSX seems not to define these. */
|
||||
#ifndef s6_addr16
|
||||
#define s6_addr16 __u6_addr.__u6_addr16
|
||||
#endif
|
||||
Reference in New Issue
Block a user