project: move freestanding include headers

This is needed because in libucontext.h we include "libucontext/bits.h".
We therefore need to have bits.h in somepath/libucontext/bits.h. In the
Makefile, somepath/freestanding/bits.h was copied to the right path but
in the meson build system, the include copy happens at the end.
master
osy 2021-01-02 21:07:29 -08:00
parent f04d423e63
commit f3e1b876c7
13 changed files with 9 additions and 7 deletions

View File

@ -23,7 +23,7 @@ EXPORT_UNPREFIXED := yes
FREESTANDING := no
ifeq ($(FREESTANDING),yes)
CFLAGS += -DFREESTANDING -isystem arch/${ARCH}/freestanding
CFLAGS += -DFREESTANDING
EXPORT_UNPREFIXED = no
endif
@ -215,13 +215,13 @@ examples/cooperative_threading: examples/cooperative_threading.c ${LIBUCONTEXT_N
ifeq ($(FREESTANDING),no)
include/libucontext/bits.h: arch/common/bits.h
cp arch/common/bits.h $@
include/libucontext/bits.h: arch/common/include/libucontext/bits.h
cp $< $@
else
include/libucontext/bits.h: arch/${ARCH}/freestanding/bits.h
cp arch/${ARCH}/freestanding/bits.h $@
include/libucontext/bits.h: arch/${ARCH}/include/libucontext/bits.h
cp $< $@
endif

View File

@ -70,9 +70,11 @@ if freestanding
build_args += '-DFREESTANDING'
build_posix = false
export_unprefixed = false
project_headers += ['arch' / cpu / 'freestanding/bits.h']
project_headers += ['arch' / cpu / 'include/libucontext/bits.h']
project_includes += ['arch' / cpu / 'include']
else
project_headers += ['arch/common/bits.h']
project_headers += ['arch/common/include/libucontext/bits.h']
project_includes += ['arch/common/include']
endif
if export_unprefixed