common.mk 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #
  2. # Copyright (C) 2006-2016 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. MD5SUM_2.19 = 42dad4edd3bcb38006d13b5640b00b38
  9. REVISION_2.19 = 25243
  10. MD5SUM_2.21 = 76050a65c444d58b5c4aa0d6034736ed
  11. REVISION_2.21 = 16d0a0c
  12. MD5SUM_2.22 = b575850e77b37d70f96472285290b391
  13. REVISION_2.22 = b995d95
  14. PKG_NAME:=glibc
  15. PKG_VERSION:=$(call qstrip,$(CONFIG_GLIBC_VERSION))
  16. PKG_REVISION:=$(REVISION_$(PKG_VERSION))
  17. PKG_MIRROR_MD5SUM:=$(MD5SUM_$(PKG_VERSION))
  18. PKG_SOURCE_PROTO:=git
  19. PKG_SOURCE_URL:=git://sourceware.org/git/glibc.git
  20. PKG_SOURCE_VERSION:=$(PKG_REVISION)
  21. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REVISION)
  22. PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.bz2
  23. GLIBC_PATH:=
  24. PATCH_DIR:=$(PATH_PREFIX)/patches/$(PKG_VERSION)
  25. HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR)
  26. CUR_BUILD_DIR:=$(HOST_BUILD_DIR)-$(VARIANT)
  27. include $(INCLUDE_DIR)/toolchain-build.mk
  28. HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared
  29. HOST_STAMP_CONFIGURED:=$(CUR_BUILD_DIR)/.configured
  30. HOST_STAMP_BUILT:=$(CUR_BUILD_DIR)/.built
  31. HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.glibc_$(VARIANT)_installed
  32. ifeq ($(ARCH),mips64)
  33. ifdef CONFIG_MIPS64_ABI_N64
  34. TARGET_CFLAGS += -mabi=64
  35. endif
  36. ifdef CONFIG_MIPS64_ABI_N32
  37. TARGET_CFLAGS += -mabi=n32
  38. endif
  39. ifdef CONFIG_MIPS64_ABI_O32
  40. TARGET_CFLAGS += -mabi=32
  41. endif
  42. endif
  43. GLIBC_CONFIGURE:= \
  44. BUILD_CC="$(HOSTCC)" \
  45. $(TARGET_CONFIGURE_OPTS) \
  46. CFLAGS="$(TARGET_CFLAGS)" \
  47. libc_cv_slibdir="/lib" \
  48. use_ldconfig=no \
  49. $(HOST_BUILD_DIR)/$(GLIBC_PATH)configure \
  50. --prefix= \
  51. --build=$(GNU_HOST_NAME) \
  52. --host=$(REAL_GNU_TARGET_NAME) \
  53. --with-headers=$(TOOLCHAIN_DIR)/include \
  54. --disable-profile \
  55. --disable-werror \
  56. --without-gd \
  57. --without-cvs \
  58. --enable-add-ons \
  59. --$(if $(CONFIG_SOFT_FLOAT),without,with)-fp
  60. export libc_cv_ssp=no
  61. export ac_cv_header_cpuid_h=yes
  62. export HOST_CFLAGS := $(HOST_CFLAGS) -idirafter $(CURDIR)/$(PATH_PREFIX)/include
  63. define Host/SetToolchainInfo
  64. $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
  65. $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.gnu.org/software/libc/,' $(TOOLCHAIN_DIR)/info.mk
  66. $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
  67. $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
  68. endef
  69. define Host/Configure
  70. [ -f $(HOST_BUILD_DIR)/.autoconf ] || { \
  71. cd $(HOST_BUILD_DIR)/$(GLIBC_PATH); \
  72. autoconf --force && \
  73. touch $(HOST_BUILD_DIR)/.autoconf; \
  74. }
  75. mkdir -p $(CUR_BUILD_DIR)
  76. ( cd $(CUR_BUILD_DIR); rm -f config.cache; \
  77. $(GLIBC_CONFIGURE) \
  78. );
  79. endef
  80. define Host/Prepare
  81. $(call Host/Prepare/Default)
  82. ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  83. endef
  84. define Host/Clean
  85. rm -rf $(CUR_BUILD_DIR)* \
  86. $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \
  87. $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  88. endef