diff --git a/Makefile.include b/Makefile.include index 64ffb1941f..055968e430 100644 --- a/Makefile.include +++ b/Makefile.include @@ -205,10 +205,11 @@ include $(RIOTMAKE)/boards.inc.mk include $(RIOTMAKE)/dependencies_debug.inc.mk # Use TOOLCHAIN environment variable to select the toolchain to use. -# If native, TOOLCHAIN for OSX is llvm ifeq ($(BOARD),native) ifeq ($(OS),Darwin) - TOOLCHAIN ?= llvm + $(shell $(COLOR_ECHO) "$(COLOR_RED)"Buildin on macOS is not supported."\ + "We recommend vagrant for building:$(COLOR_RESET)"\ + "https://github.com/RIOT-OS/RIOT/blob/master/dist/tools/vagrant/README.md 1>&2) endif endif # Use override so that we can redefine a variable set on the command line (as diff --git a/README.md b/README.md index 9cc5de3aa2..af0dcafa77 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ but not limited to: * high resolution, long-term timers * support 100+ boards based on AVR, MSP430, ESP8266, ESP32, RISC-V, ARM7 and ARM Cortex-M -* the native port allows to run RIOT as-is on Linux, BSD, and MacOS. Multiple +* the native port allows to run RIOT as-is on Linux and BSD. Multiple instances of RIOT running on a single machine can also be interconnected via a simple virtual Ethernet bridge * IPv6 diff --git a/cpu/native/Kconfig b/cpu/native/Kconfig index 724d91286c..c3733c1007 100644 --- a/cpu/native/Kconfig +++ b/cpu/native/Kconfig @@ -38,7 +38,6 @@ config CPU_FAM_NATIVE config CPU_MODEL_NATIVE bool select CPU_FAM_NATIVE - select NATIVE_OS_DARWIN if "$(OS)" = "Darwin" select NATIVE_OS_LINUX if "$(OS)" = "Linux" select NATIVE_OS_FREEBSD if "$(OS)" = "FreeBSD" @@ -54,9 +53,6 @@ config HAS_CPU_NATIVE Indicates that the cpu being used is 'native'. ## OS Variants -config NATIVE_OS_DARWIN - bool - config NATIVE_OS_LINUX bool select HAS_PERIPH_CAN diff --git a/cpu/native/Makefile b/cpu/native/Makefile index 9f279f954a..08a4609946 100644 --- a/cpu/native/Makefile +++ b/cpu/native/Makefile @@ -6,10 +6,6 @@ ifneq (,$(filter native_vfs,$(USEMODULE))) DIRS += vfs endif -ifeq ($(OS),Darwin) - CFLAGS += -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE -endif - ifneq (,$(filter netdev_tap,$(USEMODULE))) DIRS += netdev_tap endif diff --git a/cpu/native/Makefile.include b/cpu/native/Makefile.include index 8791a735a4..5a18218c57 100644 --- a/cpu/native/Makefile.include +++ b/cpu/native/Makefile.include @@ -1,10 +1,5 @@ NATIVEINCLUDES += -I$(RIOTCPU)/native/include -I$(RIOTBASE)/sys/include -# Local include for OSX -ifeq ($(BUILDOSXNATIVE),1) - NATIVEINCLUDES += -I$(RIOTCPU)/native/osx-libc-extra -endif - ifneq (,$(filter periph_can,$(USEMODULE))) ifeq (,$(filter libsocketcan,$(USEPKG))) # link system libsocketcan if not using the provided package diff --git a/cpu/native/README.md b/cpu/native/README.md index aa4f939afb..f9e176e5f3 100644 --- a/cpu/native/README.md +++ b/cpu/native/README.md @@ -55,16 +55,10 @@ To create a bridge and two (or count at your option) tap interfaces: sudo ../../dist/tools/tapsetup/tapsetup [-c []] -On macOS you need to start the RIOT instance at some point during the script's -execution. The script will instruct you when to do that. - To delete the bridge and all tap interfaces: sudo ../../dist/tools/tapsetup/tapsetup -d -For macOS you **have** to run this after killing your RIOT instance and rerun -`sudo ../../dist/tools/tapsetup [-c []]` before restarting. - **Please note:** If you want to communicate between RIOT and your host operating system, you must not use the `tapsetup` script, but create and activate the tap interface manually. On Linux you can do so, by calling diff --git a/cpu/native/async_read.c b/cpu/native/async_read.c index 3cb0ac7640..085a6c87f0 100644 --- a/cpu/native/async_read.c +++ b/cpu/native/async_read.c @@ -85,11 +85,6 @@ void native_async_read_add_handler(int fd, void *arg, native_async_read_callback _add_handler(fd, arg, handler); - /* tuntap signalled IO is not working in macOS, - * * check http://sourceforge.net/p/tuntaposx/bugs/18/ */ -#ifdef __MACH__ - _sigio_child(_next_index); -#else /* configure fds to send signals on io */ if (real_fcntl(fd, F_SETOWN, _native_pid) == -1) { err(EXIT_FAILURE, "native_async_read_add_handler(): fcntl(F_SETOWN)"); @@ -98,7 +93,6 @@ void native_async_read_add_handler(int fd, void *arg, native_async_read_callback if (real_fcntl(fd, F_SETFL, O_NONBLOCK | O_ASYNC) == -1) { err(EXIT_FAILURE, "native_async_read_add_handler(): fcntl(F_SETFL)"); } -#endif /* not macOS */ _next_index++; } diff --git a/cpu/native/include/clang_compat.h b/cpu/native/include/clang_compat.h deleted file mode 100644 index 79c326ff62..0000000000 --- a/cpu/native/include/clang_compat.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * clang_compat.h Undefines macros of clang on macOS to use RIOT's macros - * - * Copyright (C) 2014 Thomas Eichinger - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -#ifndef CLANG_COMPAT_H -#define CLANG_COMPAT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#undef htons -#undef htonl -#undef htonll -#undef ntohs -#undef ntohl -#undef ntohll - -#ifdef __cplusplus -} -#endif - -#endif /* CLANG_COMPAT_H */ diff --git a/cpu/native/include/cpu_conf.h b/cpu/native/include/cpu_conf.h index a459462eae..e002f586b1 100644 --- a/cpu/native/include/cpu_conf.h +++ b/cpu/native/include/cpu_conf.h @@ -27,28 +27,6 @@ extern "C" { * * @{ */ -#ifdef __MACH__ /* macOS */ -#ifndef THREAD_STACKSIZE_DEFAULT -#define THREAD_STACKSIZE_DEFAULT (163840) -#endif -#ifndef THREAD_STACKSIZE_IDLE -#define THREAD_STACKSIZE_IDLE (THREAD_STACKSIZE_DEFAULT) -#endif -#ifndef THREAD_EXTRA_STACKSIZE_PRINTF -#define THREAD_EXTRA_STACKSIZE_PRINTF (81920) -#endif -#ifndef THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT -#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT (81920) -#endif -/* for core/include/thread.h */ -#ifndef THREAD_STACKSIZE_MINIMUM -#define THREAD_STACKSIZE_MINIMUM (THREAD_STACKSIZE_DEFAULT) -#endif -#ifndef ISR_STACKSIZE -#define ISR_STACKSIZE (THREAD_STACKSIZE_DEFAULT) -#endif - -#else /* Linux etc. */ #ifndef THREAD_STACKSIZE_DEFAULT #define THREAD_STACKSIZE_DEFAULT (8192) #endif @@ -69,7 +47,6 @@ extern "C" { #ifndef ISR_STACKSIZE #define ISR_STACKSIZE (THREAD_STACKSIZE_DEFAULT) #endif -#endif /* OS */ /** @} */ /** diff --git a/cpu/native/netdev_tap/netdev_tap.c b/cpu/native/netdev_tap/netdev_tap.c index 531e17e849..33d02305b2 100644 --- a/cpu/native/netdev_tap/netdev_tap.c +++ b/cpu/native/netdev_tap/netdev_tap.c @@ -340,10 +340,7 @@ static int _init(netdev_t *netdev) } char *name = dev->tap_name; -#ifdef __MACH__ /* macOS */ - char clonedev[255] = "/dev/"; /* XXX bad size */ - strncpy(clonedev + 5, name, 250); -#elif defined(__FreeBSD__) +#ifdef __FreeBSD__ char clonedev[255] = "/dev/"; /* XXX bad size */ strncpy(clonedev + 5, name, 250); #else /* Linux */ @@ -356,7 +353,7 @@ static int _init(netdev_t *netdev) if ((dev->tap_fd = real_open(clonedev, O_RDWR | O_NONBLOCK)) == -1) { err(EXIT_FAILURE, "open(%s)", clonedev); } -#if (defined(__MACH__) || defined(__FreeBSD__)) /* macOS/FreeBSD */ +#if __FreeBSD__ /* FreeBSD */ struct ifaddrs *iflist; if (real_getifaddrs(&iflist) == 0) { for (struct ifaddrs *cur = iflist; cur; cur = cur->ifa_next) { diff --git a/cpu/native/osx-libc-extra/malloc.h b/cpu/native/osx-libc-extra/malloc.h deleted file mode 100644 index dcaf2980db..0000000000 --- a/cpu/native/osx-libc-extra/malloc.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2015 James Hollister - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_native - * - * @brief Malloc header for use with native on macOS since there is no - * malloc.h file in the standard include path. - * - * @{ - * @file - * - * @author James Hollister - */ - -#ifndef MALLOC_H -#define MALLOC_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Allocate SIZE bytes of memory. - * @param[in] size Size of the block to allocate. - * @returns New memory block. NULL if failed to allocate. - */ -extern void *malloc (size_t size); - -/** - * @brief Allocate NMEMB elements of SIZE bytes each, all initialized to 0. - * @param[in] nmemb Number of elements to be allocated. - * @param[in] size Size of the block to allocate. - * @returns New memory block. NULL if failed to allocate. - */ -extern void *calloc (size_t nmemb, size_t size); - -/** - * @brief Re-allocate the previously allocated block in ptr, making the new - * block SIZE bytes long. - * @param[in] ptr Old memory block. - * @param[in] size Size of the new block to allocate. - * @returns New memory block. NULL if failed to allocate. - */ -extern void *realloc (void *ptr, size_t size); - -/** - * @brief Free a block allocated by `malloc', `realloc' or `calloc'. - * @param[in] ptr Memory block that was allocated with 'malloc, 'realloc, - * or 'calloc'. - */ -extern void free (void *ptr); - -#ifdef __cplusplus -} -#endif - -#endif /* MALLOC_H */ - -/** - * @} - */ diff --git a/cpu/native/periph/qdec.c b/cpu/native/periph/qdec.c index 10b5cdad41..c735d60cc5 100644 --- a/cpu/native/periph/qdec.c +++ b/cpu/native/periph/qdec.c @@ -19,15 +19,6 @@ * @} */ -#ifdef __MACH__ -#include -#include -#include -#include -/* Both macOS and RIOT typedef thread_t. timer.c does not use either thread_t. */ -#define thread_t riot_thread_t -#endif - #include #include #include diff --git a/cpu/native/periph/timer.c b/cpu/native/periph/timer.c index be79783f53..84e5d27072 100644 --- a/cpu/native/periph/timer.c +++ b/cpu/native/periph/timer.c @@ -26,15 +26,6 @@ * @} */ -#ifdef __MACH__ -#include -#include -#include -#include -/* Both macOS and RIOT typedef thread_t. timer.c does not use either thread_t. */ -#define thread_t riot_thread_t -#endif - #include #include #include diff --git a/doc/doxygen/src/getting-started.md b/doc/doxygen/src/getting-started.md index 82598b76b8..081aa8bcd8 100644 --- a/doc/doxygen/src/getting-started.md +++ b/doc/doxygen/src/getting-started.md @@ -29,14 +29,14 @@ A set of common tools and a toolchain for the hardware you target needs to be in ### Choosing an Operating System for the Development PC Most of the RIOT OS developers are using Linux on their development PCs, so you can expect the -most streamlined experience here. Other POSIX-compliant OSes such as current versions of macOS or -the various BSD flavours will also be fine - however, we rely on users to report bugs regarding -tooling incompatibilities here. So expect occasional issues for the development branch and please -help testing during the feature freeze period, if you develop on macOS or BSD. +most streamlined experience here. Other POSIX-compliant OSes such as the various BSD flavours +will also be fine - however, we rely on users to report bugs regarding tooling incompatibilities +here. So expect occasional issues for the development branch and please help testing during the +feature freeze period, if you develop on macOS or BSD. -Native development on Windows machines is not officially supported. What works well is using Linux -in a virtual machine, but at much lower performance than running Linux natively. For development -using the +Native development on Windows and macOS machines is not officially supported. What works well is using Linux +in a virtual machine, but at much lower performance than running Linux natively. We also offer Docker images. +For development on Windows, using the [Windows Subsystem for Linux (WSL)](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) is a good option ([installation instructions here](https://docs.microsoft.com/en-us/windows/wsl/install)), but it diff --git a/doc/doxygen/src/mainpage.md b/doc/doxygen/src/mainpage.md index cbb4bd637c..fcccf6d22b 100644 --- a/doc/doxygen/src/mainpage.md +++ b/doc/doxygen/src/mainpage.md @@ -50,7 +50,7 @@ RIOT is developed by an open community that anyone is welcome to join: The quickest start {#the-quickest-start} ================== You can run RIOT on most IoT devices, on open-access testbed hardware (e.g. -IoT-lab), and also directly as a process on your Linux/FreeBSD/macOS machine (we +IoT-lab), and also directly as a process on your Linux or FreeBSD machine (we call this the `native` port). Try it right now in your terminal window: ~~~~~~~{.sh}