diff --git a/CMakeLists.txt b/CMakeLists.txt index 55fc44a1..a82f3764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ set (LWIP_DEFINITIONS LWIP_DEBUG=1) if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") add_subdirectory(${LWIP_DIR}/contrib/ports/win32/example_app) -elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") add_subdirectory(${LWIP_DIR}/contrib/ports/unix/example_app) else() message(WARNING "Host ${CMAKE_SYSTEM_NAME} is not supported to build example_app") diff --git a/contrib/ports/unix/port/include/arch/cc.h b/contrib/ports/unix/port/include/arch/cc.h index c4b51b67..a072f60f 100644 --- a/contrib/ports/unix/port/include/arch/cc.h +++ b/contrib/ports/unix/port/include/arch/cc.h @@ -41,6 +41,8 @@ #define LWIP_UNIX_MACH #elif defined __OpenBSD__ #define LWIP_UNIX_OPENBSD +#elif defined __FreeBSD__ +#define LWIP_UNIX_FREEBSD #elif defined __FreeBSD_kernel__ && __GLIBC__ #define LWIP_UNIX_KFREEBSD #elif defined __CYGWIN__ diff --git a/contrib/ports/unix/port/netif/sio.c b/contrib/ports/unix/port/netif/sio.c index a6560ba4..41bbba5d 100644 --- a/contrib/ports/unix/port/netif/sio.c +++ b/contrib/ports/unix/port/netif/sio.c @@ -1,7 +1,10 @@ /* Author: Magnus Ivarsson */ /* to get rid of implicit function declarations */ +#ifndef __FreeBSD__ +/* defining this on FreeBSD hides non-standard defines that sio.c depends on */ #define _XOPEN_SOURCE 600 +#endif #define _GNU_SOURCE /* build with Darwin C extensions not part of POSIX, i.e. FASYNC, SIGIO. @@ -37,6 +40,8 @@ #include #if defined(LWIP_UNIX_OPENBSD) || defined(LWIP_UNIX_MACH) #include +#elif defined(LWIP_UNIX_FREEBSD) +#include #endif #include #include