aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Peter Korsgaard <peter@korsgaard.com>2015-08-31 11:21:05 +0200
committerGravatar Peter Korsgaard <peter@korsgaard.com>2015-08-31 22:25:07 +0200
commitd3e9159a935eebc9741d9224f6b4393451dbd7f4 (patch)
tree5339c8504a9646d05e449f1bde79140f8612e9e0
parentc559c0b55fd350de239fb01ac893d59ec7f64e4a (diff)
downloadbuildroot-d3e9159a935eebc9741d9224f6b4393451dbd7f4.tar.gz
buildroot-d3e9159a935eebc9741d9224f6b4393451dbd7f4.tar.bz2
exfat: fix build with musl
Fixes: http://autobuild.buildroot.net/results/e1d/e1db07f0ea1e70c62f3294016c1b3a094de71d12/ The endianness handling functions in platform.h are protected behind ifdef __GLIBC__ which musl doesn't define even though it does provide the endianness handling interface. Work around it by ensuring __GLIBC__ is defined. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/exfat/exfat.mk13
1 files changed, 11 insertions, 2 deletions
diff --git a/package/exfat/exfat.mk b/package/exfat/exfat.mk
index 097c3acbe6..5508ec3a5f 100644
--- a/package/exfat/exfat.mk
+++ b/package/exfat/exfat.mk
@@ -10,15 +10,24 @@ EXFAT_SOURCE = fuse-exfat-$(EXFAT_VERSION).tar.gz
EXFAT_DEPENDENCIES = host-scons libfuse
EXFAT_LICENSE = GPLv3+
EXFAT_LICENSE_FILES = COPYING
+EXFAT_CFLAGS = $(TARGET_CFLAGS) -std=c99
+
+# The endianness handling functions in platform.h are protected behind
+# ifdef __GLIBC__ which musl doesn't define even though it does
+# provide the endianness handling interface. Work around it by
+# ensuring __GLIBC__ is defined.
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+EXFAT_CFLAGS += -D__GLIBC__
+endif
define EXFAT_BUILD_CMDS
(cd $(@D); \
- $(TARGET_CONFIGURE_OPTS) CCFLAGS="$(TARGET_CFLAGS) -std=c99" $(SCONS))
+ $(TARGET_CONFIGURE_OPTS) CCFLAGS="$(EXFAT_CFLAGS)" $(SCONS))
endef
define EXFAT_INSTALL_TARGET_CMDS
(cd $(@D); \
- $(TARGET_CONFIGURE_OPTS) CCFLAGS="$(TARGET_CFLAGS) -std=c99" $(SCONS) \
+ $(TARGET_CONFIGURE_OPTS) CCFLAGS="$(EXFAT_CFLAGS)" $(SCONS) \
DESTDIR=$(TARGET_DIR)/usr/sbin install)
endef