Root/gcc-mips/Makefile

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#
7include $(TOPDIR)/rules.mk
8PKG_NAME:=gcc
9#PKG_VERSION:=$(strip $(subst ",, $(CONFIG_GCC_VERSION)))#"))
10PKG_VERSION:=4.3.3
11PKG_RELEASE:=3
12PATCH_DIR=$(TOPDIR)/toolchain/gcc/patches/$(PKG_VERSION)
13PKG_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
17PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
18PKG_MD5SUM:=354853e0b2da90c527e35aabb8d6f1e6
19PKG_INSTALL:=1
20PKG_FIXUP:=libtool
21
22include $(INCLUDE_DIR)/package.mk
23
24SEP:=,
25TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)"
26EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-biarch --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc)
27
28STRIP:=$(STAGING_DIR_HOST)/bin/sstrip
29RSTRIP:= \
30    NM="$(TARGET_CROSS)nm" \
31    STRIP="$(STRIP)" \
32    STRIP_KMOD="$(TARGET_CROSS)strip --strip-debug" \
33    $(SCRIPT_DIR)/rstrip.sh
34
35define Package/gcc-mips
36  SECTION:=devel
37  CATEGORY:=Development
38  TITLE:=gcc-mips
39  DEPENDS:=+mpfr +binutils
40endef
41
42define Package/gcc-mips/description
43    build a native toolchain for compiling on target
44endef
45
46define Build/Prepare
47    $(call Build/Prepare/Default)
48    ($(CP) ./patches $(PKG_BUILD_DIR); cd $(PKG_BUILD_DIR); patch -Np1 < ./patches/001-cache-amnesia.patch;);
49    (cd $(PKG_BUILD_DIR)/libstdc++-v3; \
50    $(SED) 's/m4_rename(/m4_rename_force(/' acinclude.m4;);
51endef
52
53define Build/Configure
54    $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(PKG_BUILD_DIR)/libstdc++-v3/configure
55    $(SED) 's/\"CFLAGS=/\"CFLAGS=$(FPIC) /' $(PKG_BUILD_DIR)/libstdc++-v3/Makefile.am
56    (cd $(PKG_BUILD_DIR); rm -f config.cache; \
57        SHELL="$(BASH)" \
58        $(TARGET_CONFIGURE_OPTS) \
59        $(PKG_BUILD_DIR)/configure \
60            $(TARGET_CONFIGURE_ARGS) \
61            --build=$(GNU_HOST_NAME) \
62            --host=$(REAL_GNU_TARGET_NAME) \
63            --target=$(REAL_GNU_TARGET_NAME) \
64            --enable-languages=$(TARGET_LANGUAGES) \
65            --enable-shared \
66            --disable-__cxa_atexit \
67            --enable-target-optspace \
68            --with-gnu-ld \
69            --disable-nls \
70            --disable-libmudflap \
71            --disable-multilib \
72            --with-gmp=$(STAGING_DIR)/usr \
73            --with-mpfr=$(STAGING_DIR)/usr \
74            --prefix=/usr \
75            $(EXTRA_TARGET) \
76            $(SOFT_FLOAT_CONFIG_OPTION) \
77            $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
78    );
79endef
80
81define Build/Compile
82    export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
83            DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install
84endef
85
86define Package/gcc-mips/install
87    $(INSTALL_DIR) $(1)/usr
88    cp -r $(PKG_INSTALL_DIR)/usr/{bin,include,lib,libexec} $(1)/usr
89    cp -rf $(TOOLCHAIN_DIR)/usr/include/* $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/include
90    cp -rf $(TOOLCHAIN_DIR)/usr/lib/*.{a,la,o} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
91    cp -rf $(TOOLCHAIN_DIR)/lib/* $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
92    rm -rf $(1)/usr/lib/libstdc++.so*
93endef
94
95$(eval $(call BuildPackage,gcc-mips))
96

Archive Download this file



interactive