2009-01-08 09:49:11 +08:00
|
|
|
#
|
2011-07-07 17:42:47 +08:00
|
|
|
# Copyright (C) 2006-2011 OpenWrt.org
|
2009-01-08 09:49:11 +08:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=eglibc
|
|
|
|
PKG_VERSION:=$(call qstrip,$(CONFIG_EGLIBC_VERSION))
|
|
|
|
PKG_REVISION:=$(call qstrip,$(CONFIG_EGLIBC_REVISION))
|
|
|
|
|
|
|
|
PKG_SOURCE_PROTO:=svn
|
|
|
|
PKG_SOURCE_VERSION:=$(PKG_REVISION)
|
|
|
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-r$(PKG_REVISION)
|
|
|
|
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.bz2
|
2009-02-04 05:25:48 +08:00
|
|
|
|
2011-06-18 19:14:05 +08:00
|
|
|
ifneq ($(CONFIG_EGLIBC_VERSION_2_13),)
|
|
|
|
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_13
|
|
|
|
endif
|
2011-07-07 17:42:47 +08:00
|
|
|
ifneq ($(CONFIG_EGLIBC_VERSION_2_14),)
|
|
|
|
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_14
|
|
|
|
endif
|
2012-06-07 20:24:25 +08:00
|
|
|
ifneq ($(CONFIG_EGLIBC_VERSION_2_15),)
|
|
|
|
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_15
|
|
|
|
endif
|
2009-01-08 09:49:11 +08:00
|
|
|
|
|
|
|
PATCH_DIR:=./patches/$(PKG_VERSION)
|
|
|
|
|
2009-02-24 07:52:27 +08:00
|
|
|
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR)
|
2009-01-08 09:49:11 +08:00
|
|
|
|
2009-02-24 07:52:27 +08:00
|
|
|
include $(INCLUDE_DIR)/toolchain-build.mk
|
2009-01-08 09:49:11 +08:00
|
|
|
|
2009-03-13 20:50:23 +08:00
|
|
|
HOST_STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.eglibc_built
|
|
|
|
HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.eglibc_installed
|
2009-01-08 09:49:11 +08:00
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
HOST_BUILD_DIR1:=$(HOST_BUILD_DIR)-initial
|
|
|
|
HOST_BUILD_DIR2:=$(HOST_BUILD_DIR)-final
|
2009-01-08 09:49:11 +08:00
|
|
|
|
2011-06-27 05:47:14 +08:00
|
|
|
EGLIBC_CFLAGS:= \
|
|
|
|
$(TARGET_CFLAGS)
|
2011-06-20 19:12:46 +08:00
|
|
|
|
2009-01-08 09:49:11 +08:00
|
|
|
EGLIBC_CONFIGURE:= \
|
|
|
|
BUILD_CC="$(HOSTCC)" \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
CFLAGS="$(EGLIBC_CFLAGS)" \
|
2009-05-01 04:21:57 +08:00
|
|
|
libc_cv_slibdir="/lib" \
|
2011-06-19 01:53:41 +08:00
|
|
|
use_ldconfig=no \
|
2009-02-22 12:37:20 +08:00
|
|
|
$(HOST_BUILD_DIR)/libc/configure \
|
2010-08-19 20:49:51 +08:00
|
|
|
--prefix= \
|
2009-01-08 09:49:11 +08:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(REAL_GNU_TARGET_NAME) \
|
2010-08-19 20:49:51 +08:00
|
|
|
--with-headers=$(TOOLCHAIN_DIR)/include \
|
2009-01-08 09:49:11 +08:00
|
|
|
--disable-profile \
|
|
|
|
--without-gd \
|
|
|
|
--without-cvs \
|
|
|
|
--enable-add-ons \
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_SOFT_FLOAT),)
|
2009-02-04 05:25:48 +08:00
|
|
|
EGLIBC_CONFIGURE+= \
|
|
|
|
--with-fp
|
2009-01-08 09:49:11 +08:00
|
|
|
else
|
2009-02-04 05:25:48 +08:00
|
|
|
EGLIBC_CONFIGURE+= \
|
|
|
|
--without-fp
|
2009-01-08 09:49:11 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
EGLIBC_MAKE:= \
|
|
|
|
$(MAKE) \
|
|
|
|
|
2011-02-02 00:21:49 +08:00
|
|
|
export libc_cv_ssp=no
|
2012-06-30 00:19:48 +08:00
|
|
|
export ac_cv_header_cpuid_h=yes
|
2009-01-08 09:49:11 +08:00
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/SetToolchainInfo
|
2009-01-08 09:49:11 +08:00
|
|
|
$(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
|
|
|
|
$(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.eglibc.org/,' $(TOOLCHAIN_DIR)/info.mk
|
|
|
|
$(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
|
2009-04-24 10:07:24 +08:00
|
|
|
$(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
|
2009-01-08 09:49:11 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage1/Configure
|
2009-02-22 12:37:20 +08:00
|
|
|
mkdir -p $(HOST_BUILD_DIR1)
|
|
|
|
$(CP) $(HOST_BUILD_DIR)/libc/option-groups.config $(HOST_BUILD_DIR1)/
|
|
|
|
( cd $(HOST_BUILD_DIR1); rm -f config.cache; \
|
2009-01-08 09:49:11 +08:00
|
|
|
$(EGLIBC_CONFIGURE) \
|
|
|
|
);
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage1/Compile
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage1/Install
|
2010-08-19 20:49:51 +08:00
|
|
|
mkdir -p $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/{include,lib}
|
2009-02-22 12:37:20 +08:00
|
|
|
$(EGLIBC_MAKE) -C $(HOST_BUILD_DIR1) \
|
2009-01-08 09:49:11 +08:00
|
|
|
install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \
|
|
|
|
install-bootstrap-headers=yes \
|
|
|
|
install-headers
|
2009-02-22 12:37:20 +08:00
|
|
|
$(EGLIBC_MAKE) -C $(HOST_BUILD_DIR1) \
|
2009-01-08 09:49:11 +08:00
|
|
|
csu/subdir_lib
|
2009-02-22 12:37:20 +08:00
|
|
|
( cd $(HOST_BUILD_DIR1); \
|
2010-08-19 20:49:51 +08:00
|
|
|
$(CP) csu/crt1.o csu/crti.o csu/crtn.o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/ \
|
2009-01-08 09:49:11 +08:00
|
|
|
)
|
|
|
|
$(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \
|
2010-08-19 20:49:51 +08:00
|
|
|
-o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/libc.so
|
2009-01-08 09:49:11 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage2/Configure
|
2009-02-22 12:37:20 +08:00
|
|
|
mkdir -p $(HOST_BUILD_DIR2)
|
|
|
|
$(CP) $(HOST_BUILD_DIR)/libc/option-groups.config $(HOST_BUILD_DIR2)/
|
|
|
|
( cd $(HOST_BUILD_DIR2); rm -f config.cache; \
|
2009-01-08 09:49:11 +08:00
|
|
|
$(EGLIBC_CONFIGURE) \
|
|
|
|
);
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage2/Compile
|
2009-02-22 12:37:20 +08:00
|
|
|
$(EGLIBC_MAKE) -C $(HOST_BUILD_DIR2) all
|
2009-01-08 09:49:11 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage2/Install
|
2009-02-22 12:37:20 +08:00
|
|
|
$(EGLIBC_MAKE) -C $(HOST_BUILD_DIR2) \
|
2009-01-08 09:49:11 +08:00
|
|
|
install_root="$(TOOLCHAIN_DIR)" \
|
|
|
|
install
|
|
|
|
( cd $(TOOLCHAIN_DIR) ; \
|
|
|
|
for d in lib usr/lib ; do \
|
|
|
|
for f in libc.so libpthread.so libgcc_s.so ; do \
|
|
|
|
if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \
|
|
|
|
$(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \
|
|
|
|
fi \
|
|
|
|
done \
|
|
|
|
done \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Prepare
|
|
|
|
$(call Host/SetToolchainInfo)
|
|
|
|
$(call Host/Prepare/Default)
|
2009-01-08 09:49:11 +08:00
|
|
|
ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
2009-02-22 12:37:20 +08:00
|
|
|
$(SED) 's,y,n,' $(HOST_BUILD_DIR)/libc/option-groups.defaults
|
|
|
|
grep 'CONFIG_EGLIBC_OPTION_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_EGLIBC_\\(.*\\),\\1\\2,g" > $(HOST_BUILD_DIR)/libc/option-groups.config
|
|
|
|
ln -sf ../ports $(HOST_BUILD_DIR)/libc/
|
|
|
|
( cd $(HOST_BUILD_DIR)/libc; autoconf --force )
|
2009-01-08 09:49:11 +08:00
|
|
|
$(call Stage1/Configure)
|
|
|
|
$(call Stage1/Compile)
|
|
|
|
$(call Stage1/Install)
|
|
|
|
endef
|
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Configure
|
2009-01-08 09:49:11 +08:00
|
|
|
endef
|
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Compile
|
2009-01-08 09:49:11 +08:00
|
|
|
$(call Stage2/Configure)
|
|
|
|
$(call Stage2/Compile)
|
|
|
|
$(call Stage2/Install)
|
|
|
|
endef
|
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Install
|
2009-01-08 09:49:11 +08:00
|
|
|
endef
|
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Clean
|
|
|
|
rm -rf $(HOST_BUILD_DIR) $(HOST_BUILD_DIR1) $(HOST_BUILD_DIR2) \
|
2009-01-08 09:49:11 +08:00
|
|
|
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \
|
|
|
|
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call HostBuild))
|