2 # Copyright (C) 2006-2009 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
10 PKG_VERSION
:=$(call qstrip
,$(CONFIG_BINUTILS_VERSION
))
12 PKG_SOURCE_URL
:=@GNU
/binutils
/
13 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
15 ifeq ($(PKG_VERSION
),2.18)
16 PKG_MD5SUM
:=9d22ee4dafa3a194457caf4706f9cf01
18 ifeq ($(PKG_VERSION
),2.19.1)
19 PKG_MD5SUM
:=09a8c5821a2dfdbb20665bc0bd680791
22 PATCH_DIR
:=.
/patches
/$(PKG_VERSION
)
24 REAL_STAGING_DIR_HOST
:=$(STAGING_DIR_HOST
)
26 include $(INCLUDE_DIR
)/toolchain-build.mk
28 BINUTILS_CONFIGURE
:= \
30 --prefix=$(TOOLCHAIN_DIR
)/usr \
31 --build
=$(GNU_HOST_NAME
) \
32 --host
=$(GNU_HOST_NAME
) \
33 --target
=$(REAL_GNU_TARGET_NAME
) \
34 --with-sysroot
=$(TOOLCHAIN_DIR
) \
38 $(SOFT_FLOAT_CONFIG_OPTION
) \
39 $(call qstrip
,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS
)) \
41 ifneq ($(CONFIG_SSP_SUPPORT
),)
42 BINUTILS_CONFIGURE
+= \
45 BINUTILS_CONFIGURE
+= \
49 ifneq ($(CONFIG_EXTRA_TARGET_ARCH
),)
50 BINUTILS_CONFIGURE
+= \
51 --enable-targets
=$(call qstrip
,$(CONFIG_EXTRA_TARGET_ARCH_NAME
))-linux-
$(TARGET_SUFFIX
)
55 $(call Host
/Prepare
/Default
)
56 ln
-snf
$(PKG_NAME
)-$(PKG_VERSION
) $(BUILD_DIR_TOOLCHAIN
)/$(PKG_NAME
)
57 $(CP
) $(SCRIPT_DIR
)/config.
{guess
,sub
} $(HOST_BUILD_DIR
)/
61 (cd
$(HOST_BUILD_DIR
); \
62 $(BINUTILS_CONFIGURE
) \
67 $(MAKE
) -C
$(HOST_BUILD_DIR
) all
71 $(MAKE
) -C
$(HOST_BUILD_DIR
) install
72 $(CP
) $(TOOLCHAIN_DIR
)/usr
/bin
/$(REAL_GNU_TARGET_NAME
)-readelf
$(REAL_STAGING_DIR_HOST
)/bin
/readelf
78 $(BUILD_DIR_TOOLCHAIN
)/$(PKG_NAME
)
81 $(eval
$(call HostBuild
))