Keine Beschreibung

Makefile 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. # NB: GCC building is a bit special, you need to have the gcc build-deps installed on the build machine as well,
  9. # for instance mpfr, mpc and gmp development packages!
  10. #
  11. include $(TOPDIR)/rules.mk
  12. PKG_NAME:=gcc
  13. PKG_VERSION:=linaro-4.6-2013.05
  14. PKG_RELEASE:=1
  15. PKG_SOURCE_URL:=https://releases.linaro.org/13.05/components/toolchain/gcc-linaro/4.6/
  16. PKG_SOURCE:=gcc-$(PKG_VERSION).tar.bz2
  17. PKG_MD5SUM:=26b48802ae1203cd99415026fbf56ed7
  18. include $(INCLUDE_DIR)/package.mk
  19. SEP:=,
  20. TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)"
  21. EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-biarch --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc)
  22. define Package/gcc
  23. SECTION:=devel
  24. CATEGORY:=Development
  25. TITLE:=gcc
  26. DEPENDS:=@TARGET_x86 @NO_STRIP
  27. endef
  28. define Package/gcc/description
  29. build a native toolchain for compiling on target
  30. endef
  31. define Build/Prepare
  32. $(PKG_UNPACK)
  33. # we have to download additional stuff before patching
  34. (cd $(PKG_BUILD_DIR) && ./contrib/download_prerequisites)
  35. $(Build/Patch)
  36. $(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c
  37. $(SED) 's,\(bug_report_url.. = "\).*\(";\),\1<URL:https://dev.openwrt.org/>\2,' $(PKG_BUILD_DIR)/gcc/version.c
  38. endef
  39. define Build/Configure
  40. (cd $(PKG_BUILD_DIR); rm -f config.cache; \
  41. SHELL="$(BASH)" \
  42. $(TARGET_CONFIGURE_OPTS) \
  43. $(PKG_BUILD_DIR)/configure \
  44. $(TARGET_CONFIGURE_ARGS) \
  45. --build=$(GNU_HOST_NAME) \
  46. --host=$(REAL_GNU_TARGET_NAME) \
  47. --target=$(REAL_GNU_TARGET_NAME) \
  48. --enable-languages=$(TARGET_LANGUAGES) \
  49. --disable-__cxa_atexit \
  50. --enable-target-optspace \
  51. --with-gnu-ld \
  52. --disable-nls \
  53. --disable-libmudflap \
  54. --disable-multilib \
  55. --disable-libgomp \
  56. --disable-libquadmath \
  57. --disable-decimal-float \
  58. --with-host-libstdcxx=-lstdc++ \
  59. --disable-libstdcxx-pch \
  60. $(EXTRA_TARGET) \
  61. $(SOFT_FLOAT_CONFIG_OPTION) \
  62. $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
  63. $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \
  64. --with-abi=$(subst ",,$(CONFIG_MIPS64_ABI))) \
  65. );
  66. endef
  67. define Build/Compile
  68. export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  69. DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install
  70. # Set up the symlinks to enable lying about target name.
  71. set -e; \
  72. (cd $(TOOLCHAIN_DIR); \
  73. ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
  74. cd bin; \
  75. for app in $(REAL_GNU_TARGET_NAME)-* ; do \
  76. ln -sf $$$${app} \
  77. $(GNU_TARGET_NAME)$$$${app##$(REAL_GNU_TARGET_NAME)}; \
  78. done; \
  79. );
  80. endef
  81. define Package/gcc/install
  82. $(INSTALL_DIR) $(1)/usr/lib/
  83. cp -r $(PKG_INSTALL_DIR)/* $(1)
  84. cp -r $(TOOLCHAIN_DIR)/include $(1)/usr/
  85. cp $(TOOLCHAIN_DIR)/lib/crt* $(1)/usr/lib/
  86. cp $(TOOLCHAIN_DIR)/lib/libc.so $(1)/usr/lib/
  87. endef
  88. $(eval $(call BuildPackage,gcc))