drivers: ethernet: native: Fix compile issue in RedHat 7

Fix 2 compile issues in RedHat/CentOS 7 for the native
ethernet driver due to a oldish glibc, which does not include
by default the needed structures.
+
Separate the native ethernet driver into its own library,
and set NO_POSIX_CHEATS for it, in case the Zephyr POSIX
library would eventually add support for any of the host functions
used in this driver.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This commit is contained in:
Alberto Escolar Piedras 2018-09-25 16:52:27 +02:00 committed by Jukka Rissanen
parent 684f753fd4
commit c065ebdfc2
2 changed files with 12 additions and 4 deletions

View file

@ -8,7 +8,14 @@ zephyr_sources_ifdef(CONFIG_ETH_DW eth_dw.c)
zephyr_sources_ifdef(CONFIG_ETH_ENC28J60 eth_enc28j60.c)
zephyr_sources_ifdef(CONFIG_ETH_MCUX eth_mcux.c)
zephyr_sources_ifdef(CONFIG_ETH_STM32_HAL eth_stm32_hal.c)
zephyr_sources_ifdef(CONFIG_ETH_NATIVE_POSIX
eth_native_posix.c
eth_native_posix_adapt.c
)
if(CONFIG_ETH_NATIVE_POSIX)
zephyr_library()
zephyr_library_include_directories(${ZEPHYR_BASE}/subsys/net/l2)
zephyr_library_compile_definitions(NO_POSIX_CHEATS)
zephyr_library_compile_definitions(_BSD_SOURCE)
zephyr_library_sources(
eth_native_posix.c
eth_native_posix_adapt.c
)
endif()

View file

@ -24,6 +24,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <net/if.h>
#include <time.h>
#include "posix_trace.h"