Skip to content

Commit 0bbff88

Browse files
committed
build: add a musl build configuration
Signed-off-by: Michal Rábek <[email protected]>
1 parent c59a593 commit 0bbff88

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

libnvme/test/ioctl/mock.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,12 @@ int ioctl(int fd, int request, ...)
156156
real_ioctl = dlsym(RTLD_NEXT, "ioctl");
157157
if (!real_ioctl)
158158
fail("Error: dlsym failed to find original ioctl\n");
159-
#else
159+
#elif defined(HAVE_GLIBC_IOCTL) && HAVE_GLIBC_IOCTL == 1
160160
fprintf(stderr, "Warning: unhandled ioctl %lx\n", request);
161161
return -ENOTTY;
162+
#else
163+
fprintf(stderr, "Warning: unhandled ioctl %x\n", request);
164+
return -ENOTTY;
162165
#endif
163166
}
164167

scripts/build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,23 @@ config_meson_default() {
8282
"${BUILDDIR}"
8383
}
8484

85+
config_meson_musl() {
86+
local c_args="-U_GNU_SOURCE \
87+
-idirafter /usr/include -idirafter \
88+
/usr/include/x86_64-linux-gnu"
89+
90+
CC="${CC}" "${MESON}" setup \
91+
--werror \
92+
--buildtype="${BUILDTYPE}" \
93+
-Dc_args="${c_args}" \
94+
-Ddefault_library=static \
95+
-Djson-c=disabled \
96+
-Dopenssl=disabled \
97+
-Dkeyutils=disabled \
98+
-Dpython=disabled \
99+
"${BUILDDIR}"
100+
}
101+
85102
config_meson_libdbus() {
86103
CC="${CC}" "${MESON}" setup \
87104
--werror \

0 commit comments

Comments
 (0)