2009-01-08 03:49:11 +02:00
|
|
|
#
|
2011-07-07 12:42:47 +03:00
|
|
|
# Copyright (C) 2006-2011 OpenWrt.org
|
2009-01-08 03:49:11 +02: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-03 23:25:48 +02:00
|
|
|
|
2011-06-18 14:14:05 +03:00
|
|
|
ifneq ($(CONFIG_EGLIBC_VERSION_2_13),)
|
|
|
|
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_13
|
|
|
|
endif
|
2011-07-07 12:42:47 +03:00
|
|
|
ifneq ($(CONFIG_EGLIBC_VERSION_2_14),)
|
|
|
|
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_14
|
|
|
|
endif
|
2012-06-07 15:24:25 +03:00
|
|
|
ifneq ($(CONFIG_EGLIBC_VERSION_2_15),)
|
|
|
|
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_15
|
|
|
|
endif
|
2009-01-08 03:49:11 +02:00
|
|
|
|
|
|
|
PATCH_DIR:=./patches/$(PKG_VERSION)
|
|
|
|
|
2009-02-24 01:52:27 +02:00
|
|
|
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR)
|
2009-01-08 03:49:11 +02:00
|
|
|
|
2009-02-24 01:52:27 +02:00
|
|
|
include $(INCLUDE_DIR)/toolchain-build.mk
|
2009-01-08 03:49:11 +02:00
|
|
|
|
2009-03-13 14:50:23 +02:00
|
|
|
HOST_STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.eglibc_built
|
|
|
|
HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.eglibc_installed
|
2009-01-08 03:49:11 +02:00
|
|
|
|
2009-02-22 06:37:20 +02:00
|
|
|
HOST_BUILD_DIR1:=$(HOST_BUILD_DIR)-initial
|
|
|
|
HOST_BUILD_DIR2:=$(HOST_BUILD_DIR)-final
|
2009-01-08 03:49:11 +02:00
|
|
|
|
2011-06-27 00:47:14 +03:00
|
|
|
EGLIBC_CFLAGS:= \
|
|
|
|
$(TARGET_CFLAGS)
|
2011-06-20 14:12:46 +03:00
|
|
|
|
2009-01-08 03:49:11 +02:00
|
|
|
EGLIBC_CONFIGURE:= \
|
|
|
|
BUILD_CC="$(HOSTCC)" \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
CFLAGS="$(EGLIBC_CFLAGS)" \
|
2009-04-30 23:21:57 +03:00
|
|
|
libc_cv_slibdir="/lib" \
|
2011-06-18 20:53:41 +03:00
|
|
|
use_ldconfig=no \
|
2009-02-22 06:37:20 +02:00
|
|
|
$(HOST_BUILD_DIR)/libc/configure \
|
2010-08-19 15:49:51 +03:00
|
|
|
--prefix= \
|
2009-01-08 03:49:11 +02:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(REAL_GNU_TARGET_NAME) \
|
2010-08-19 15:49:51 +03:00
|
|
|
--with-headers=$(TOOLCHAIN_DIR)/include \
|
2009-01-08 03:49:11 +02:00
|
|
|
--disable-profile \
|
|
|
|
--without-gd \
|
|
|
|
--without-cvs \
|
|
|
|
--enable-add-ons \
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_SOFT_FLOAT),)
|
2009-02-03 23:25:48 +02:00
|
|
|
EGLIBC_CONFIGURE+= \
|
|
|
|
--with-fp
|
2009-01-08 03:49:11 +02:00
|
|
|
else
|
2009-02-03 23:25:48 +02:00
|
|
|
EGLIBC_CONFIGURE+= \
|
|
|
|
--without-fp
|
2009-01-08 03:49:11 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
EGLIBC_MAKE:= \
|
|
|
|
$(MAKE) \
|
|
|
|
|
2011-02-01 18:21:49 +02:00
|
|
|
export libc_cv_ssp=no
|
2009-01-08 03:49:11 +02:00
|
|
|
|
2009-02-22 06:37:20 +02:00
|
|
|
define Host/SetToolchainInfo
|
2009-01-08 03:49:11 +02: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 05:07:24 +03:00
|
|
|
$(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
|
2009-01-08 03:49:11 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage1/Configure
|
2009-02-22 06:37:20 +02: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 03:49:11 +02:00
|
|
|
$(EGLIBC_CONFIGURE) \
|
|
|
|
);
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage1/Compile
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage1/Install
|
2010-08-19 15:49:51 +03:00
|
|
|
mkdir -p $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/{include,lib}
|
2009-02-22 06:37:20 +02:00
|
|
|
$(EGLIBC_MAKE) -C $(HOST_BUILD_DIR1) \
|
2009-01-08 03:49:11 +02:00
|
|
|
install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \
|
|
|
|
install-bootstrap-headers=yes \
|
|
|
|
install-headers
|
2009-02-22 06:37:20 +02:00
|
|
|
$(EGLIBC_MAKE) -C $(HOST_BUILD_DIR1) \
|
2009-01-08 03:49:11 +02:00
|
|
|
csu/subdir_lib
|
2009-02-22 06:37:20 +02:00
|
|
|
( cd $(HOST_BUILD_DIR1); \
|
2010-08-19 15:49:51 +03:00
|
|
|
$(CP) csu/crt1.o csu/crti.o csu/crtn.o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/ \
|
2009-01-08 03:49:11 +02:00
|
|
|
)
|
|
|
|
$(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \
|
2010-08-19 15:49:51 +03:00
|
|
|
-o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/libc.so
|
2009-01-08 03:49:11 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage2/Configure
|
2009-02-22 06:37:20 +02: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 03:49:11 +02:00
|
|
|
$(EGLIBC_CONFIGURE) \
|
|
|
|
);
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage2/Compile
|
2009-02-22 06:37:20 +02:00
|
|
|
$(EGLIBC_MAKE) -C $(HOST_BUILD_DIR2) all
|
2009-01-08 03:49:11 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Stage2/Install
|
2009-02-22 06:37:20 +02:00
|
|
|
$(EGLIBC_MAKE) -C $(HOST_BUILD_DIR2) \
|
2009-01-08 03:49:11 +02: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 06:37:20 +02:00
|
|
|
define Host/Prepare
|
|
|
|
$(call Host/SetToolchainInfo)
|
|
|
|
$(call Host/Prepare/Default)
|
2009-01-08 03:49:11 +02:00
|
|
|
ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
2009-02-22 06:37:20 +02: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 03:49:11 +02:00
|
|
|
$(call Stage1/Configure)
|
|
|
|
$(call Stage1/Compile)
|
|
|
|
$(call Stage1/Install)
|
|
|
|
endef
|
|
|
|
|
2009-02-22 06:37:20 +02:00
|
|
|
define Host/Configure
|
2009-01-08 03:49:11 +02:00
|
|
|
endef
|
|
|
|
|
2009-02-22 06:37:20 +02:00
|
|
|
define Host/Compile
|
2009-01-08 03:49:11 +02:00
|
|
|
$(call Stage2/Configure)
|
|
|
|
$(call Stage2/Compile)
|
|
|
|
$(call Stage2/Install)
|
|
|
|
endef
|
|
|
|
|
2009-02-22 06:37:20 +02:00
|
|
|
define Host/Install
|
2009-01-08 03:49:11 +02:00
|
|
|
endef
|
|
|
|
|
2009-02-22 06:37:20 +02:00
|
|
|
define Host/Clean
|
|
|
|
rm -rf $(HOST_BUILD_DIR) $(HOST_BUILD_DIR1) $(HOST_BUILD_DIR2) \
|
2009-01-08 03:49:11 +02:00
|
|
|
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \
|
|
|
|
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call HostBuild))
|