diff --git a/boards/native/Makefile b/boards/native/Makefile index 1f64a6ab76..4bd9762991 100644 --- a/boards/native/Makefile +++ b/boards/native/Makefile @@ -3,3 +3,5 @@ MODULE = board DIRS = drivers include $(RIOTBASE)/Makefile.base + +INCLUDES = $(NATIVEINCLUDES) diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index b2f60d5f85..30abef6e7c 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -1,7 +1,9 @@ -export CPU = native +export NATIVEINCLUDES += -DNATIVE_INCLUDES +export NATIVEINCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ +export NATIVEINCLUDES += -I$(RIOTBASE)/core/include/ +export NATIVEINCLUDES += -I$(RIOTBASE)/drivers/include/ -# Configuration for core/include/kernel_types.h -CFLAGS += -DNATIVE_INCLUDES +export CPU = native USEMODULE += native-drivers @@ -113,7 +115,7 @@ debug-valgrind-server: export VALGRIND_FLAGS ?= --vgdb=yes --vgdb-error=0 -v \ term-cachegrind: export CACHEGRIND_FLAGS += --tool=cachegrind term-gprof: export TERMPROG = GMON_OUT_PREFIX=gmon.out $(ELFFILE) all-valgrind: export CFLAGS += -DHAVE_VALGRIND_H -g -all-valgrind: export CFLAGS += $(shell pkg-config valgrind --cflags) +all-valgrind: export NATIVEINCLUDES += $(shell pkg-config valgrind --cflags) all-debug: export CFLAGS += -g all-cachegrind: export CFLAGS += -g all-gprof: export CFLAGS += -pg @@ -122,6 +124,8 @@ all-asan: export CFLAGS += -fsanitize=address -fno-omit-frame-pointer -g all-asan: export CFLAGS += -DNATIVE_IN_CALLOC all-asan: export LINKFLAGS += -fsanitize=address -fno-omit-frame-pointer -g +export INCLUDES += $(NATIVEINCLUDES) + export CFLAGS += -DDEBUG_ASSERT_VERBOSE # workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624 diff --git a/boards/native/drivers/Makefile b/boards/native/drivers/Makefile index e717c6fd8e..3aae3fd580 100644 --- a/boards/native/drivers/Makefile +++ b/boards/native/drivers/Makefile @@ -1,3 +1,5 @@ MODULE = native-drivers include $(RIOTBASE)/Makefile.base + +INCLUDES = $(NATIVEINCLUDES) diff --git a/cpu/native/Makefile b/cpu/native/Makefile index a3db928a08..9c2b87b709 100644 --- a/cpu/native/Makefile +++ b/cpu/native/Makefile @@ -27,3 +27,5 @@ ifneq (,$(filter trace,$(USEMODULE))) endif include $(RIOTBASE)/Makefile.base + +INCLUDES = $(NATIVEINCLUDES) diff --git a/cpu/native/Makefile.include b/cpu/native/Makefile.include index 07013f62cd..b02f64a1da 100644 --- a/cpu/native/Makefile.include +++ b/cpu/native/Makefile.include @@ -1,6 +1,8 @@ +export NATIVEINCLUDES += -I$(RIOTCPU)/native/include -I$(RIOTBASE)/sys/include + # Local include for OSX ifeq ($(BUILDOSXNATIVE),1) - INCLUDES += -I$(RIOTCPU)/native/osx-libc-extra + export NATIVEINCLUDES += -I$(RIOTCPU)/native/osx-libc-extra endif USEMODULE += periph diff --git a/cpu/native/mtd/Makefile b/cpu/native/mtd/Makefile index b7dc90ebfc..f0006b95d8 100644 --- a/cpu/native/mtd/Makefile +++ b/cpu/native/mtd/Makefile @@ -1,3 +1,5 @@ MODULE := mtd_native include $(RIOTBASE)/Makefile.base + +INCLUDES = $(NATIVEINCLUDES) diff --git a/cpu/native/netdev_tap/Makefile b/cpu/native/netdev_tap/Makefile index 48422e909a..7d178b6174 100644 --- a/cpu/native/netdev_tap/Makefile +++ b/cpu/native/netdev_tap/Makefile @@ -1 +1,3 @@ include $(RIOTBASE)/Makefile.base + +INCLUDES = $(NATIVEINCLUDES) diff --git a/cpu/native/socket_zep/Makefile b/cpu/native/socket_zep/Makefile index 48422e909a..7d178b6174 100644 --- a/cpu/native/socket_zep/Makefile +++ b/cpu/native/socket_zep/Makefile @@ -1 +1,3 @@ include $(RIOTBASE)/Makefile.base + +INCLUDES = $(NATIVEINCLUDES) diff --git a/sys/posix/include/sys/bytes.h b/sys/posix/include/sys/bytes.h index eeae510071..fbdef4f495 100644 --- a/sys/posix/include/sys/bytes.h +++ b/sys/posix/include/sys/bytes.h @@ -28,12 +28,7 @@ extern "C" { #endif -#ifndef __MACH__ typedef size_t socklen_t; /**< socket address length */ -#else -/* Defined for OSX with a different type */ -typedef __darwin_socklen_t socklen_t; /**< socket address length */ -#endif #ifdef __cplusplus } diff --git a/sys/posix/include/sys/socket.h b/sys/posix/include/sys/socket.h index d8207ccf3f..8bac3ce558 100644 --- a/sys/posix/include/sys/socket.h +++ b/sys/posix/include/sys/socket.h @@ -36,9 +36,6 @@ sa_family_t sa_prefix##family #define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) -#ifdef __MACH__ -#define AF_LINK (18) /* Link layer interface */ -#endif #endif #include