mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards/native: Remove macOS as native target
This commit is contained in:
parent
22c2e85f1d
commit
35a06c4806
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -55,16 +55,10 @@ To create a bridge and two (or count at your option) tap interfaces:
|
||||
|
||||
sudo ../../dist/tools/tapsetup/tapsetup [-c [<count>]]
|
||||
|
||||
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 [<count>]]` 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
|
||||
|
@ -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++;
|
||||
}
|
||||
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* clang_compat.h Undefines macros of clang on macOS to use RIOT's macros
|
||||
*
|
||||
* Copyright (C) 2014 Thomas Eichinger <thomas.eichinger@fu-berlin.de>
|
||||
*
|
||||
* 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 */
|
@ -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 */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -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) {
|
||||
|
@ -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 <jhollisterjr@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef MALLOC_H
|
||||
#define MALLOC_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#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 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
@ -19,15 +19,6 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __MACH__
|
||||
#include <mach/clock.h>
|
||||
#include <mach/mach_init.h>
|
||||
#include <mach/mach_port.h>
|
||||
#include <mach/mach_host.h>
|
||||
/* Both macOS and RIOT typedef thread_t. timer.c does not use either thread_t. */
|
||||
#define thread_t riot_thread_t
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <signal.h>
|
||||
|
@ -26,15 +26,6 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __MACH__
|
||||
#include <mach/clock.h>
|
||||
#include <mach/mach_init.h>
|
||||
#include <mach/mach_port.h>
|
||||
#include <mach/mach_host.h>
|
||||
/* Both macOS and RIOT typedef thread_t. timer.c does not use either thread_t. */
|
||||
#define thread_t riot_thread_t
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <signal.h>
|
||||
|
@ -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
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user