hfsprogs: Fix build failures with external toolchains
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 3 Apr 2017 02:58:37 +0000 (19:58 -0700)
committerFlorian Fainelli <f.fainelli@gmail.com>
Mon, 3 Apr 2017 03:00:33 +0000 (20:00 -0700)
Several problems were found with building against an external toolchain:

* TARGET_CPPFLAGS was missing which would prevent finding the headers
* TARGET_LDFLAGS also was not passed correctly
* when building against glibc, since we use strlcpy() we need to link
  against libbsd

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
utils/hfsprogs/Makefile

index 9c44a35586dc2b26ac0cf97ed8b22d1f049a82a4..6b907523cf8f4fd43aaed353ea012fae6f0d42c7 100644 (file)
@@ -29,7 +29,7 @@ define Package/hfsprogs/Default
   SECTION:=utils
   CATEGORY:=Utilities
   SUBMENU:=Filesystem
-  DEPENDS:=+libopenssl
+  DEPENDS:=+libopenssl +USE_GLIBC:libbsd
 endef
 
 define Package/hfsfsck
@@ -59,7 +59,8 @@ define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                -f Makefile.lnx \
                $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS+="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1" \
+               CFLAGS+="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1" \
+               LDFLAGS+="$(TARGET_LDFLAGS) -lbsd" \
                all
 endef