2012-11-24 04:02:29 +08:00
|
|
|
#
|
2013-07-05 05:26:01 +08:00
|
|
|
# Copyright (C) 2012-2013 OpenWrt.org
|
2012-11-24 04:02:29 +08:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/target.mk
|
|
|
|
|
|
|
|
PKG_NAME:=musl
|
|
|
|
PKG_VERSION:=$(call qstrip,$(CONFIG_MUSL_VERSION))
|
2014-02-25 05:10:11 +08:00
|
|
|
PKG_RELEASE=1
|
2012-11-24 04:02:29 +08:00
|
|
|
|
2016-07-13 18:24:34 +08:00
|
|
|
PKG_MD5SUM:=9590a9d47ee64f220b3c12f7afb864ca
|
2013-02-27 00:40:27 +08:00
|
|
|
|
2014-02-25 05:10:11 +08:00
|
|
|
PKG_SOURCE_URL:=http://www.musl-libc.org/releases
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
2012-11-24 04:02:29 +08:00
|
|
|
LIBC_SO_VERSION:=$(PKG_VERSION)
|
2014-05-21 22:09:58 +08:00
|
|
|
PATCH_DIR:=$(PATH_PREFIX)/patches
|
2012-11-24 04:02:29 +08:00
|
|
|
|
|
|
|
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/toolchain-build.mk
|
2015-06-21 01:37:25 +08:00
|
|
|
include $(INCLUDE_DIR)/hardening.mk
|
2012-11-24 04:02:29 +08:00
|
|
|
|
|
|
|
MUSL_CONFIGURE:= \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
|
|
$(HOST_BUILD_DIR)/configure \
|
|
|
|
--prefix=/ \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
2016-01-19 20:41:59 +08:00
|
|
|
--disable-gcc-wrapper \
|
|
|
|
--enable-debug
|
2012-11-24 04:02:29 +08:00
|
|
|
|
|
|
|
define Host/Prepare
|
|
|
|
$(call Host/Prepare/Default)
|
|
|
|
$(if $(strip $(QUILT)), \
|
|
|
|
cd $(HOST_BUILD_DIR); \
|
|
|
|
if $(QUILT_CMD) next >/dev/null 2>&1; then \
|
|
|
|
$(QUILT_CMD) push -a; \
|
|
|
|
fi
|
|
|
|
)
|
|
|
|
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Host/Configure
|
|
|
|
( cd $(HOST_BUILD_DIR); rm -f config.cache; \
|
|
|
|
$(MUSL_CONFIGURE) \
|
|
|
|
);
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Host/Clean
|
|
|
|
rm -rf \
|
|
|
|
$(HOST_BUILD_DIR) \
|
|
|
|
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
|
|
|
|
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev
|
|
|
|
endef
|