[toolchain] libssp should also be configured in binutils
[openwrt.git] / toolchain / binutils / Makefile
1
2 # Copyright (C) 2006-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
9 PKG_NAME:=binutils
10 PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
11
12 PKG_SOURCE_URL:=@GNU/binutils/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
14
15 ifeq ($(PKG_VERSION),2.17)
16   PKG_MD5SUM:=e26e2e06b6e4bf3acf1dc8688a94c0d1
17 endif
18 ifeq ($(PKG_VERSION),2.18)
19   PKG_MD5SUM:=9d22ee4dafa3a194457caf4706f9cf01
20 endif
21 ifeq ($(PKG_VERSION),2.19)
22   PKG_MD5SUM:=17a52219dee5a76c1a9d9b0bfd337d66
23 endif
24
25 PATCH_DIR:=./patches/$(PKG_VERSION)
26
27 REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
28 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
29 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
30
31 override CONFIG_AUTOREBUILD=
32
33 include $(INCLUDE_DIR)/host-build.mk
34
35 EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX))
36
37 ifneq ($(CONFIG_SSP_SUPPORT),)
38         LIB_SSP:=--enable-libssp
39 else
40         LIB_SSP:=--disable-libssp
41 endif
42
43 define Build/Prepare
44         $(call Build/Prepare/Default)
45         ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
46         $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
47 endef
48
49 define Build/Configure
50         (cd $(PKG_BUILD_DIR); \
51                 ./configure \
52                 --prefix=$(TOOLCHAIN_DIR)/usr \
53                 --build=$(GNU_HOST_NAME) \
54                 --host=$(GNU_HOST_NAME) \
55                 --target=$(REAL_GNU_TARGET_NAME) \
56                 --with-sysroot=$(TOOLCHAIN_DIR) \
57                 --disable-multilib \
58                 --disable-werror \
59                 --disable-nls \
60                 $(LIB_SSP) \
61                 $(EXTRA_TARGET) \
62                 $(SOFT_FLOAT_CONFIG_OPTION) \
63                 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) \
64         );
65 endef
66
67 define Build/Compile
68         $(MAKE) -C $(PKG_BUILD_DIR) all
69 endef
70
71 define Build/Install
72         $(MAKE) -C $(PKG_BUILD_DIR) install
73         $(CP) $(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
74 endef
75
76 define Build/Clean
77         rm -rf \
78                 $(PKG_BUILD_DIR) \
79                 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
80 endef
81
82 $(eval $(call HostBuild))