Merge pull request #840 from cjkoenig/update_liburcu
[feed/packages.git] / devel / gcc / 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 #
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=gcc
12 PKG_VERSION:=4.8.3
13 PKG_RELEASE:=1
14 PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \
15 http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \
16 ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION)
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
19 PKG_MD5SUM:=7c60f24fab389f77af203d2516ee110f
20 PKG_INSTALL:=1
21 PKG_FIXUP:=libtool
22 PKG_BUILD_PARALLEL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 TARGET_LANGUAGES:="c,c++"
27 BUGURL=https://dev.openwrt.org/
28 PKGVERSION=OpenWrt GCC $(PKG_VERSION)
29
30 # not using sstrip here as this fucks up the .so's somehow
31 STRIP:=$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)strip
32 RSTRIP:= \
33 NM="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)nm" \
34 STRIP="$(STRIP)" \
35 STRIP_KMOD="$(STRIP) --strip-debug" \
36 $(SCRIPT_DIR)/rstrip.sh
37
38
39 define Package/gcc
40 SECTION:=devel
41 CATEGORY:=Development
42 TITLE:=gcc
43 MAINTAINER:=Christian Beier <cb@shoutrlabs.com>
44 DEPENDS:= +binutils +libstdcpp
45 endef
46
47 define Package/gcc/description
48 build a native toolchain for compiling on target
49 endef
50
51
52 define Build/Prepare
53 $(PKG_UNPACK)
54 # we have to download additional stuff before patching
55 (cd $(PKG_BUILD_DIR) && ./contrib/download_prerequisites)
56 $(Build/Patch)
57 endef
58
59
60 define Build/Configure
61 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
62 SHELL="$(BASH)" \
63 $(TARGET_CONFIGURE_OPTS) \
64 $(PKG_BUILD_DIR)/configure \
65 $(CONFIGURE_ARGS) \
66 --build=$(GNU_HOST_NAME) \
67 --host=$(REAL_GNU_TARGET_NAME) \
68 --target=$(REAL_GNU_TARGET_NAME) \
69 --enable-languages=$(TARGET_LANGUAGES) \
70 --with-bugurl=$(BUGURL) \
71 --with-pkgversion="$(PKGVERSION)" \
72 --enable-shared \
73 --disable-__cxa_atexit \
74 --enable-target-optspace \
75 --with-gnu-ld \
76 --disable-nls \
77 --disable-libmudflap \
78 --disable-multilib \
79 --disable-libgomp \
80 --disable-libquadmath \
81 --disable-libssp \
82 --disable-decimal-float \
83 --disable-libstdcxx-pch \
84 --with-host-libstdcxx=-lstdc++ \
85 --prefix=/usr \
86 --libexecdir=/usr/lib \
87 $(SOFT_FLOAT_CONFIG_OPTION) \
88 $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
89 $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \
90 --with-abi=$(subst ",,$(CONFIG_MIPS64_ABI))) \
91 );
92 endef
93
94 define Build/Compile
95 export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
96 DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install
97 endef
98
99 define Package/gcc/install
100 $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
101 cp -ar $(PKG_INSTALL_DIR)/usr/include $(1)/usr
102 cp -a $(PKG_INSTALL_DIR)/usr/bin/{$(REAL_GNU_TARGET_NAME)-{g++,gcc},cpp,gcov} $(1)/usr/bin
103 ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/c++
104 ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/g++
105 ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-c++
106 ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/gcc
107 ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc-$(PKG_VERSION)
108 cp -ar $(PKG_INSTALL_DIR)/usr/lib/gcc $(1)/usr/lib
109 $(RM) $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/*.a
110 cp -ar $(TOOLCHAIN_DIR)/include $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
111 cp -a $(TOOLCHAIN_DIR)/lib/*.{o,so*} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
112 cp -a $(TOOLCHAIN_DIR)/lib/*nonshared*.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
113 grep "GROUP.*-lgcc" $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/libgcc_s.so && cp -a $(PKG_INSTALL_DIR)/usr/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/libgcc.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/ ; true
114 endef
115
116 $(eval $(call BuildPackage,gcc))