2 # Copyright (C) 2006-2016 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
10 MD5SUM_2.19 = 42dad4edd3bcb38006d13b5640b00b38
13 MD5SUM_2.21 = 76050a65c444d58b5c4aa0d6034736ed
14 REVISION_2.21 = 16d0a0c
16 MD5SUM_2.22 = b575850e77b37d70f96472285290b391
17 REVISION_2.22 = b995d95
21 PKG_VERSION:=$(call qstrip,$(CONFIG_GLIBC_VERSION))
23 PKG_REVISION:=$(REVISION_$(PKG_VERSION))
24 PKG_MIRROR_MD5SUM:=$(MD5SUM_$(PKG_VERSION))
27 PKG_SOURCE_URL:=git://sourceware.org/git/glibc.git
28 PKG_SOURCE_VERSION:=$(PKG_REVISION)
29 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REVISION)
30 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.bz2
34 PATCH_DIR:=$(PATH_PREFIX)/patches/$(PKG_VERSION)
36 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR)
37 CUR_BUILD_DIR:=$(HOST_BUILD_DIR)-$(VARIANT)
39 include $(INCLUDE_DIR)/toolchain-build.mk
41 HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared
42 HOST_STAMP_CONFIGURED:=$(CUR_BUILD_DIR)/.configured
43 HOST_STAMP_BUILT:=$(CUR_BUILD_DIR)/.built
44 HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.glibc_$(VARIANT)_installed
47 ifdef CONFIG_MIPS64_ABI_N64
48 TARGET_CFLAGS += -mabi=64
50 ifdef CONFIG_MIPS64_ABI_N32
51 TARGET_CFLAGS += -mabi=n32
53 ifdef CONFIG_MIPS64_ABI_O32
54 TARGET_CFLAGS += -mabi=32
59 BUILD_CC="$(HOSTCC)" \
60 $(TARGET_CONFIGURE_OPTS) \
61 CFLAGS="$(TARGET_CFLAGS)" \
62 libc_cv_slibdir="/lib" \
64 $(HOST_BUILD_DIR)/$(GLIBC_PATH)configure \
66 --build=$(GNU_HOST_NAME) \
67 --host=$(REAL_GNU_TARGET_NAME) \
68 --with-headers=$(TOOLCHAIN_DIR)/include \
74 --$(if $(CONFIG_SOFT_FLOAT),without,with)-fp
77 export ac_cv_header_cpuid_h=yes
78 export HOST_CFLAGS := $(HOST_CFLAGS) -idirafter $(CURDIR)/$(PATH_PREFIX)/include
80 define Host/SetToolchainInfo
81 $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
82 $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.gnu.org/software/libc/,' $(TOOLCHAIN_DIR)/info.mk
83 $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
84 $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
88 [ -f $(HOST_BUILD_DIR)/.autoconf ] || { \
89 cd $(HOST_BUILD_DIR)/$(GLIBC_PATH); \
91 touch $(HOST_BUILD_DIR)/.autoconf; \
93 mkdir -p $(CUR_BUILD_DIR)
94 ( cd $(CUR_BUILD_DIR); rm -f config.cache; \
100 $(call Host/Prepare/Default)
101 ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
105 rm -rf $(CUR_BUILD_DIR)* \
106 $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \
107 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)