Skip to content

Commit

Permalink
Support FreeBSD in the default configuration
Browse files Browse the repository at this point in the history
FreeBSD support is basically just very small changes related to
some different includes and one define to not hide non-standard defines
like B115200.

Signed-off-by: Arne Schwabe <[email protected]>
  • Loading branch information
schwabe authored and yarrick committed Nov 26, 2024
1 parent 3cae475 commit c06cc76
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions contrib/ports/unix/port/include/arch/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
5 changes: 5 additions & 0 deletions contrib/ports/unix/port/netif/sio.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* Author: Magnus Ivarsson <[email protected]> */

/* 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.
Expand Down Expand Up @@ -37,6 +40,8 @@
#include <stdio.h>
#if defined(LWIP_UNIX_OPENBSD) || defined(LWIP_UNIX_MACH)
#include <util.h>
#elif defined(LWIP_UNIX_FREEBSD)
#include <libutil.h>
#endif
#include <termios.h>
#include <stdio.h>
Expand Down

0 comments on commit c06cc76

Please sign in to comment.