OpenWrt packages
Sign in or create your account | Project List | Help
OpenWrt packages Git Source Tree
Root/
| 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 | include $(TOPDIR)/rules.mk |
| 8 | PKG_NAME:=gcc |
| 9 | #PKG_VERSION:=$(strip $(subst ",, $(CONFIG_GCC_VERSION)))#")) |
| 10 | PKG_VERSION:=4.3.3 |
| 11 | PKG_RELEASE:=1 |
| 12 | PATCH_DIR=$(TOPDIR)/toolchain/gcc/patches/$(PKG_VERSION) |
| 13 | PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \ |
| 14 | http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \ |
| 15 | ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION) |
| 16 | |
| 17 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 |
| 18 | PKG_MD5SUM:=354853e0b2da90c527e35aabb8d6f1e6 |
| 19 | PKG_INSTALL:=1 |
| 20 | PKG_FIXUP:=libtool |
| 21 | |
| 22 | include $(INCLUDE_DIR)/package.mk |
| 23 | |
| 24 | SEP:=, |
| 25 | TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)" |
| 26 | EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-biarch --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc) |
| 27 | |
| 28 | STRIP:=$(STAGING_DIR_HOST)/bin/sstrip |
| 29 | RSTRIP:= \ |
| 30 | NM="$(TARGET_CROSS)nm" \ |
| 31 | STRIP="$(STRIP)" \ |
| 32 | STRIP_KMOD="$(TARGET_CROSS)strip --strip-debug" \ |
| 33 | $(SCRIPT_DIR)/rstrip.sh |
| 34 | |
| 35 | define Package/gcc-mips |
| 36 | SECTION:=devel |
| 37 | CATEGORY:=Development |
| 38 | TITLE:=gcc-mips |
| 39 | DEPENDS:=@BROKEN +mpfr +binutils |
| 40 | endef |
| 41 | |
| 42 | define Package/gcc-mips/description |
| 43 | build a native toolchain for compiling on target |
| 44 | endef |
| 45 | |
| 46 | define Build/Prepare |
| 47 | $(call Build/Prepare/Default) |
| 48 | $(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c |
| 49 | $(SED) 's,\(bug_report_url.. = "\).*\(";\),\1<URL:https://dev.openwrt.org/>\2,' $(PKG_BUILD_DIR)/gcc/version.c |
| 50 | (cd $(PKG_BUILD_DIR)/libstdc++-v3; autoconf;); |
| 51 | $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(PKG_BUILD_DIR)/libstdc++-v3/configure |
| 52 | endef |
| 53 | |
| 54 | define Build/Configure |
| 55 | (cd $(PKG_BUILD_DIR); rm -f config.cache; \ |
| 56 | SHELL="$(BASH)" \ |
| 57 | $(TARGET_CONFIGURE_OPTS) \ |
| 58 | $(PKG_BUILD_DIR)/configure \ |
| 59 | $(TARGET_CONFIGURE_ARGS) \ |
| 60 | --build=$(GNU_HOST_NAME) \ |
| 61 | --host=$(REAL_GNU_TARGET_NAME) \ |
| 62 | --target=$(REAL_GNU_TARGET_NAME) \ |
| 63 | --enable-languages=$(TARGET_LANGUAGES) \ |
| 64 | --enable-shared \ |
| 65 | --disable-__cxa_atexit \ |
| 66 | --enable-target-optspace \ |
| 67 | --with-gnu-ld \ |
| 68 | --disable-nls \ |
| 69 | --disable-libmudflap \ |
| 70 | --disable-multilib \ |
| 71 | --with-gmp=$(STAGING_DIR)/usr \ |
| 72 | --with-mpfr=$(STAGING_DIR)/usr \ |
| 73 | --prefix=/usr \ |
| 74 | $(EXTRA_TARGET) \ |
| 75 | $(SOFT_FLOAT_CONFIG_OPTION) \ |
| 76 | $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \ |
| 77 | ); |
| 78 | endef |
| 79 | |
| 80 | define Build/Compile |
| 81 | export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \ |
| 82 | DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install |
| 83 | endef |
| 84 | |
| 85 | define Package/gcc-mips/install |
| 86 | $(INSTALL_DIR) $(1)/usr |
| 87 | cp -r $(PKG_INSTALL_DIR)/usr/{bin,include,lib,libexec} $(1)/usr |
| 88 | cp -rf $(TOOLCHAIN_DIR)/usr/include/* $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/include |
| 89 | cp -rf $(TOOLCHAIN_DIR)/usr/lib/*.{a,la,o} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) |
| 90 | cp -rf $(TOOLCHAIN_DIR)/lib/* $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) |
| 91 | endef |
| 92 | |
| 93 | $(eval $(call BuildPackage,gcc-mips)) |
| 94 |
