From f3e1b876c78eb8d8430a76ebe1a6ae5f6d97b958 Mon Sep 17 00:00:00 2001 From: osy <50960678+osy@users.noreply.github.com> Date: Sat, 2 Jan 2021 21:07:29 -0800 Subject: [PATCH] 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. --- Makefile | 10 +++++----- .../{freestanding => include/libucontext}/bits.h | 0 arch/arm/{freestanding => include/libucontext}/bits.h | 0 arch/common/{ => include/libucontext}/bits.h | 0 arch/m68k/{freestanding => include/libucontext}/bits.h | 0 arch/mips/{freestanding => include/libucontext}/bits.h | 0 .../{freestanding => include/libucontext}/bits.h | 0 .../{freestanding => include/libucontext}/bits.h | 0 .../s390x/{freestanding => include/libucontext}/bits.h | 0 arch/sh/{freestanding => include/libucontext}/bits.h | 0 arch/x86/{freestanding => include/libucontext}/bits.h | 0 .../{freestanding => include/libucontext}/bits.h | 0 meson.build | 6 ++++-- 13 files changed, 9 insertions(+), 7 deletions(-) rename arch/aarch64/{freestanding => include/libucontext}/bits.h (100%) rename arch/arm/{freestanding => include/libucontext}/bits.h (100%) rename arch/common/{ => include/libucontext}/bits.h (100%) rename arch/m68k/{freestanding => include/libucontext}/bits.h (100%) rename arch/mips/{freestanding => include/libucontext}/bits.h (100%) rename arch/mips64/{freestanding => include/libucontext}/bits.h (100%) rename arch/riscv64/{freestanding => include/libucontext}/bits.h (100%) rename arch/s390x/{freestanding => include/libucontext}/bits.h (100%) rename arch/sh/{freestanding => include/libucontext}/bits.h (100%) rename arch/x86/{freestanding => include/libucontext}/bits.h (100%) rename arch/x86_64/{freestanding => include/libucontext}/bits.h (100%) diff --git a/Makefile b/Makefile index c95d3ca..cce1686 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/arch/aarch64/freestanding/bits.h b/arch/aarch64/include/libucontext/bits.h similarity index 100% rename from arch/aarch64/freestanding/bits.h rename to arch/aarch64/include/libucontext/bits.h diff --git a/arch/arm/freestanding/bits.h b/arch/arm/include/libucontext/bits.h similarity index 100% rename from arch/arm/freestanding/bits.h rename to arch/arm/include/libucontext/bits.h diff --git a/arch/common/bits.h b/arch/common/include/libucontext/bits.h similarity index 100% rename from arch/common/bits.h rename to arch/common/include/libucontext/bits.h diff --git a/arch/m68k/freestanding/bits.h b/arch/m68k/include/libucontext/bits.h similarity index 100% rename from arch/m68k/freestanding/bits.h rename to arch/m68k/include/libucontext/bits.h diff --git a/arch/mips/freestanding/bits.h b/arch/mips/include/libucontext/bits.h similarity index 100% rename from arch/mips/freestanding/bits.h rename to arch/mips/include/libucontext/bits.h diff --git a/arch/mips64/freestanding/bits.h b/arch/mips64/include/libucontext/bits.h similarity index 100% rename from arch/mips64/freestanding/bits.h rename to arch/mips64/include/libucontext/bits.h diff --git a/arch/riscv64/freestanding/bits.h b/arch/riscv64/include/libucontext/bits.h similarity index 100% rename from arch/riscv64/freestanding/bits.h rename to arch/riscv64/include/libucontext/bits.h diff --git a/arch/s390x/freestanding/bits.h b/arch/s390x/include/libucontext/bits.h similarity index 100% rename from arch/s390x/freestanding/bits.h rename to arch/s390x/include/libucontext/bits.h diff --git a/arch/sh/freestanding/bits.h b/arch/sh/include/libucontext/bits.h similarity index 100% rename from arch/sh/freestanding/bits.h rename to arch/sh/include/libucontext/bits.h diff --git a/arch/x86/freestanding/bits.h b/arch/x86/include/libucontext/bits.h similarity index 100% rename from arch/x86/freestanding/bits.h rename to arch/x86/include/libucontext/bits.h diff --git a/arch/x86_64/freestanding/bits.h b/arch/x86_64/include/libucontext/bits.h similarity index 100% rename from arch/x86_64/freestanding/bits.h rename to arch/x86_64/include/libucontext/bits.h diff --git a/meson.build b/meson.build index 948b071..e863780 100644 --- a/meson.build +++ b/meson.build @@ -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