exfat: fix build with musl
authorPeter Korsgaard <peter@korsgaard.com>
Mon, 31 Aug 2015 09:21:05 +0000 (11:21 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 31 Aug 2015 20:25:07 +0000 (22:25 +0200)
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>
package/exfat/exfat.mk

index 097c3acbe6031dbd2eb8ed2598137bf07b8c3ed9..5508ec3a5f908718838108279fea59b0164a946c 100644 (file)
@@ -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