kernel: update 3.10.36->3.10.44
[openwrt/openwrt.git] / toolchain / eglibc / common.mk
1 #
2 # Copyright (C) 2006-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=eglibc
10 PKG_VERSION:=$(call qstrip,$(CONFIG_EGLIBC_VERSION))
11 PKG_REVISION:=$(call qstrip,$(CONFIG_EGLIBC_REVISION))
12
13 PKG_SOURCE_PROTO:=svn
14 PKG_SOURCE_VERSION:=$(PKG_REVISION)
15 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-r$(PKG_REVISION)
16 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.bz2
17
18 ifneq ($(CONFIG_EGLIBC_VERSION_2_15),)
19 PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_15
20 endif
21 ifneq ($(CONFIG_EGLIBC_VERSION_2_19),)
22 PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_19
23 endif
24
25 PATCH_DIR:=$(PATH_PREFIX)/patches/$(PKG_VERSION)
26
27 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR)
28 CUR_BUILD_DIR:=$(HOST_BUILD_DIR)-$(VARIANT)
29
30 include $(INCLUDE_DIR)/toolchain-build.mk
31
32 HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared
33 HOST_STAMP_CONFIGURED:=$(CUR_BUILD_DIR)/.configured
34 HOST_STAMP_BUILT:=$(CUR_BUILD_DIR)/.built
35 HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.eglibc_$(VARIANT)_installed
36
37 ifeq ($(ARCH),mips64)
38 ifdef CONFIG_MIPS64_ABI_N64
39 TARGET_CFLAGS += -mabi=64
40 endif
41 ifdef CONFIG_MIPS64_ABI_N32
42 TARGET_CFLAGS += -mabi=n32
43 endif
44 ifdef CONFIG_MIPS64_ABI_O32
45 TARGET_CFLAGS += -mabi=32
46 endif
47 endif
48
49 EGLIBC_CONFIGURE:= \
50 BUILD_CC="$(HOSTCC)" \
51 $(TARGET_CONFIGURE_OPTS) \
52 CFLAGS="$(TARGET_CFLAGS)" \
53 libc_cv_slibdir="/lib" \
54 use_ldconfig=no \
55 $(HOST_BUILD_DIR)/libc/configure \
56 --prefix= \
57 --build=$(GNU_HOST_NAME) \
58 --host=$(REAL_GNU_TARGET_NAME) \
59 --with-headers=$(TOOLCHAIN_DIR)/include \
60 --disable-profile \
61 --without-gd \
62 --without-cvs \
63 --enable-add-ons \
64 --$(if $(CONFIG_SOFT_FLOAT),without,with)-fp
65
66 export libc_cv_ssp=no
67 export ac_cv_header_cpuid_h=yes
68 export HOST_CFLAGS := $(HOST_CFLAGS) -idirafter $(CURDIR)/$(PATH_PREFIX)/include
69
70 define Host/SetToolchainInfo
71 $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
72 $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.eglibc.org/,' $(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
75 endef
76
77 define Host/Configure
78 [ -f $(HOST_BUILD_DIR)/.autoconf ] || { \
79 cd $(HOST_BUILD_DIR)/libc; \
80 autoconf --force && \
81 touch $(HOST_BUILD_DIR)/.autoconf; \
82 }
83 mkdir -p $(CUR_BUILD_DIR)
84 grep 'CONFIG_EGLIBC_OPTION_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_EGLIBC_\\(.*\\),\\1\\2,g" > $(CUR_BUILD_DIR)/option-groups.config
85 ( cd $(CUR_BUILD_DIR); rm -f config.cache; \
86 $(EGLIBC_CONFIGURE) \
87 );
88 endef
89
90 define Host/Prepare
91 $(call Host/Prepare/Default)
92 ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
93 $(SED) 's,y,n,' $(HOST_BUILD_DIR)/libc/option-groups.defaults
94 ifneq ($(CONFIG_EGLIBC_VERSION_2_15),)
95 ln -sf ../ports $(HOST_BUILD_DIR)/libc/
96 endif
97 endef
98
99 define Host/Clean
100 rm -rf $(CUR_BUILD_DIR)* \
101 $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \
102 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
103 endef