Skip to content

Commit 29244b7

Browse files
authored
Merge pull request #76 from DaanDeMeyer/build-posix
Add BUILD_POSIX option
2 parents 4b0b0c0 + 894655c commit 29244b7

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ else
3434
CPPFLAGS += -D_XOPEN_SOURCE
3535
endif
3636
FREESTANDING := no
37+
BUILD_POSIX := yes
3738

3839
ifeq ($(FREESTANDING),yes)
3940
CPPFLAGS += -DFREESTANDING -Iarch/${ARCH}/include
41+
BUILD_POSIX = no
4042
EXPORT_UNPREFIXED = no
4143
else
4244
CPPFLAGS += -Iarch/common/include
@@ -104,7 +106,7 @@ LIBUCONTEXT_POSIX_OBJ = ${LIBUCONTEXT_POSIX_C_SRC:.c=.o}
104106
LIBUCONTEXT_POSIX_PATH = ${shared_libdir}/${LIBUCONTEXT_POSIX_SONAME}
105107
LIBUCONTEXT_POSIX_STATIC_PATH = ${static_libdir}/${LIBUCONTEXT_POSIX_STATIC_NAME}
106108

107-
ifeq ($(FREESTANDING),yes)
109+
ifeq ($(BUILD_POSIX),no)
108110
LIBUCONTEXT_POSIX_NAME =
109111
LIBUCONTEXT_POSIX_STATIC_NAME =
110112
endif

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ There are a few options:
6262
systems, but you may wish to disable this when using `FREESTANDING` mode to avoid conflicts with
6363
the target's libc. Default is `yes`.
6464

65+
* `BUILD_POSIX`: If this is set to `yes`, the POSIX compatibility library libucontext_posix will be built.
66+
Default is `yes`.
67+
6568
* `DESTDIR`: If this variable is set, the installed files will be installed to the specified path instead
6669
of the system root.
6770

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ build_args = [
6868

6969
freestanding = get_option('freestanding')
7070
export_unprefixed = get_option('export_unprefixed')
71-
build_posix = true
71+
build_posix = get_option('build_posix')
7272

7373
if freestanding
7474
build_args += '-DFREESTANDING'

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ option('freestanding', type : 'boolean', value : false,
22
description: 'Do not use system headers')
33
option('export_unprefixed', type : 'boolean', value : true,
44
description: 'Export POSIX 2004 ucontext names as alises')
5+
option('build_posix', type : 'boolean', value : true,
6+
description: 'Build POSIX compatibility library')
57
option('cpu', type : 'string', value : '',
68
description: 'Target CPU architecture for cross compile')
79
option('docs', type : 'boolean', value : false,

0 commit comments

Comments
 (0)