2 # Copyright (C) 2012-2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/target.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://musl.libc.org/releases/
16 PKG_HASH:=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
18 LIBC_SO_VERSION:=$(PKG_VERSION)
19 PATCH_DIR:=$(PATH_PREFIX)/patches
21 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
22 HOST_BUILD_PREFIX:=$(TOOLCHAIN_DIR)
23 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
25 include $(INCLUDE_DIR)/host-build.mk
26 include $(INCLUDE_DIR)/hardening.mk
28 TARGET_CFLAGS:= $(filter-out -O%,$(TARGET_CFLAGS))
29 TARGET_CFLAGS+= $(if $(CONFIG_MUSL_DISABLE_CRYPT_SIZE_HACK),,-DCRYPT_SIZE_HACK)
32 $(TARGET_CONFIGURE_OPTS) \
33 CFLAGS="$(TARGET_CFLAGS)" \
34 CROSS_COMPILE="$(TARGET_CROSS)" \
35 $(HOST_BUILD_DIR)/configure \
37 --host=$(GNU_HOST_NAME) \
38 --target=$(REAL_GNU_TARGET_NAME) \
39 --disable-gcc-wrapper \
44 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
45 ( cd $(HOST_BUILD_DIR); rm -f config.cache; \
53 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
54 $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev