Skip to content

Commit f10c00e

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

2 files changed

Lines changed: 16 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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ 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+
"${BUILDDIR}"
95+
}
96+
8597
config_meson_libdbus() {
8698
CC="${CC}" "${MESON}" setup \
8799
--werror \

0 commit comments

Comments
 (0)