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
13 PKG_SOURCE_SUBDIR
:=$(PKG_NAME
)-$(PKG_VERSION
)
14 PKG_SOURCE_VERSION
:=c9570bd2f54abb68e4e3c767aca3a54e05d2c7f6
15 PKG_MIRROR_HASH
:=32b77c2263a7f9b75a49633e5047c6a8e3ed19fe4bc5ac53e2328aa0dd852492
16 PKG_SOURCE_URL
:=https
://sourceware.org
/git
/glibc.git
17 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_SOURCE_VERSION
).
tar.xz
19 HOST_BUILD_DIR
:=$(BUILD_DIR_TOOLCHAIN
)/$(PKG_SOURCE_SUBDIR
)
20 CUR_BUILD_DIR
:=$(HOST_BUILD_DIR
)-$(VARIANT
)
21 PATCH_DIR
:=$(PATH_PREFIX
)/patches
23 include $(INCLUDE_DIR
)/toolchain-build.mk
25 HOST_STAMP_PREPARED
:=$(HOST_BUILD_DIR
)/.prepared
26 HOST_STAMP_CONFIGURED
:=$(CUR_BUILD_DIR
)/.configured
27 HOST_STAMP_BUILT
:=$(CUR_BUILD_DIR
)/.built
28 HOST_STAMP_INSTALLED
:=$(TOOLCHAIN_DIR
)/stamp
/.glibc_
$(VARIANT
)_installed
31 ifdef CONFIG_MIPS64_ABI_N64
32 TARGET_CFLAGS
+= -mabi
=64
34 ifdef CONFIG_MIPS64_ABI_N32
35 TARGET_CFLAGS
+= -mabi
=n32
37 ifdef CONFIG_MIPS64_ABI_O32
38 TARGET_CFLAGS
+= -mabi
=32
43 # -Os miscompiles w. 2.24 gcc5/gcc6
44 # only -O2 tested by upstream changeset
45 # "Optimize i386 syscall inlining for GCC 5"
47 unset LD_LIBRARY_PATH
; \
48 BUILD_CC
="$(HOSTCC)" \
49 $(TARGET_CONFIGURE_OPTS
) \
50 CFLAGS
="-O2 $(filter-out -Os,$(call qstrip,$(TARGET_CFLAGS)))" \
51 libc_cv_slibdir
="/lib" \
53 $(HOST_BUILD_DIR
)/$(GLIBC_PATH
)configure \
55 --build
=$(GNU_HOST_NAME
) \
56 --host
=$(REAL_GNU_TARGET_NAME
) \
57 --with-headers
=$(TOOLCHAIN_DIR
)/include \
63 --$(if
$(CONFIG_SOFT_FLOAT
),without
,with
)-fp
66 export libc_cv_ssp_strong
=no
67 export ac_cv_header_cpuid_h
=yes
68 export HOST_CFLAGS
:= $(HOST_CFLAGS
) -idirafter
$(CURDIR
)/$(PATH_PREFIX
)/include
70 define Host
/SetToolchainInfo
71 $(SED
) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR
)/info.mk
72 $(SED
) 's,^\(LIBC_URL\)=.*,\1=http://www.gnu.org/software/libc/,' $(TOOLCHAIN_DIR
)/info.mk
73 $(SED
) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR
)/info.mk
74 $(SED
) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR
)/info.mk
78 [ -f
$(HOST_BUILD_DIR
)/.autoconf
] ||
{ \
79 cd
$(HOST_BUILD_DIR
)/; \
81 touch
$(HOST_BUILD_DIR
)/.autoconf
; \
83 mkdir
-p
$(CUR_BUILD_DIR
)
84 ( cd
$(CUR_BUILD_DIR
); rm -f config.cache
; \
90 $(call Host
/Prepare
/Default
)
91 ln
-snf
$(PKG_SOURCE_SUBDIR
) $(BUILD_DIR_TOOLCHAIN
)/$(PKG_NAME
)
95 rm -rf
$(CUR_BUILD_DIR
)* \
96 $(BUILD_DIR_TOOLCHAIN
)/$(LIBC
)-dev \
97 $(BUILD_DIR_TOOLCHAIN
)/$(PKG_NAME
)