Нет описания

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #
  2. # Copyright (C) 2008 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=gcc
  10. PKG_VERSION:=4.8.3
  11. PKG_RELEASE:=1
  12. PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \
  13. http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \
  14. ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION)
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  16. PKG_MD5SUM:=7c60f24fab389f77af203d2516ee110f
  17. PKG_INSTALL:=1
  18. PKG_FIXUP:=libtool
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. TARGET_LANGUAGES:="c,c++"
  22. BUGURL=https://dev.openwrt.org/
  23. PKGVERSION=OpenWrt GCC $(PKG_VERSION)
  24. STRIP:=$(STAGING_DIR_HOST)/bin/sstrip
  25. RSTRIP:= \
  26. NM="$(TARGET_CROSS)nm" \
  27. STRIP="$(STRIP) --strip-debug" \
  28. STRIP_KMOD="$(TARGET_CROSS)strip --strip-debug" \
  29. $(SCRIPT_DIR)/rstrip.sh
  30. define Package/gcc
  31. SECTION:=devel
  32. CATEGORY:=Development
  33. TITLE:=gcc
  34. MAINTAINER:=Christian Beier <cb@shoutrlabs.com>
  35. DEPENDS:= +binutils +libstdcpp
  36. endef
  37. define Package/gcc/description
  38. build a native toolchain for compiling on target
  39. endef
  40. define Build/Prepare
  41. $(PKG_UNPACK)
  42. # we have to download additional stuff before patching
  43. (cd $(PKG_BUILD_DIR) && ./contrib/download_prerequisites)
  44. $(Build/Patch)
  45. endef
  46. define Build/Configure
  47. (cd $(PKG_BUILD_DIR); rm -f config.cache; \
  48. SHELL="$(BASH)" \
  49. $(TARGET_CONFIGURE_OPTS) \
  50. $(PKG_BUILD_DIR)/configure \
  51. $(CONFIGURE_ARGS) \
  52. --build=$(GNU_HOST_NAME) \
  53. --host=$(REAL_GNU_TARGET_NAME) \
  54. --target=$(REAL_GNU_TARGET_NAME) \
  55. --enable-languages=$(TARGET_LANGUAGES) \
  56. --with-bugurl=$(BUGURL) \
  57. --with-pkgversion="$(PKGVERSION)" \
  58. --enable-shared \
  59. --disable-__cxa_atexit \
  60. --enable-target-optspace \
  61. --with-gnu-ld \
  62. --disable-nls \
  63. --disable-libmudflap \
  64. --disable-multilib \
  65. --disable-libgomp \
  66. --disable-libquadmath \
  67. --disable-libssp \
  68. --disable-decimal-float \
  69. --disable-libstdcxx-pch \
  70. --with-host-libstdcxx=-lstdc++ \
  71. --prefix=/usr \
  72. --libexecdir=/usr/lib \
  73. $(SOFT_FLOAT_CONFIG_OPTION) \
  74. $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
  75. $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \
  76. --with-abi=$(subst ",,$(CONFIG_MIPS64_ABI))) \
  77. );
  78. endef
  79. define Build/Compile
  80. export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  81. DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install
  82. endef
  83. define Package/gcc/install
  84. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
  85. cp -ar $(PKG_INSTALL_DIR)/usr/include $(1)/usr
  86. cp -a $(PKG_INSTALL_DIR)/usr/bin/{$(REAL_GNU_TARGET_NAME)-{g++,gcc},cpp,gcov} $(1)/usr/bin
  87. ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/c++
  88. ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/g++
  89. ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-c++
  90. ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/gcc
  91. ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc-$(PKG_VERSION)
  92. cp -ar $(PKG_INSTALL_DIR)/usr/lib/gcc $(1)/usr/lib
  93. $(RM) $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/*.a
  94. cp -ar $(TOOLCHAIN_DIR)/include $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
  95. cp -a $(TOOLCHAIN_DIR)/lib/*.{o,so*} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
  96. cp -a $(TOOLCHAIN_DIR)/lib/*nonshared*.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
  97. endef
  98. $(eval $(call BuildPackage,gcc))