1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
31 THISAPP = $(PKG_NAME)-$(VER)
32 DL_FILE = $(THISAPP).tar.bz2
33 DIR_APP = $(DIR_SRC)/$(THISAPP)
35 ifeq "$(STAGE)" "toolchain"
36 OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
38 OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
42 GROUP = Development/Tools
46 # Host system provides zlib.
47 ifneq "$(STAGE)" "toolchain"
51 URL = http://www.gnu.org/software/binutils/
53 SHORT_DESC = The GNU Binutils are a collection of binary tools.
56 The GNU Binary Utilities, or binutils, is a collection of programming \
57 tools for the manipulation of object code in various object file formats.
60 ###############################################################################
62 ###############################################################################
64 objects = $(DL_FILE) \
65 $(THISAPP)-ld_makefile.patch \
66 $(THISAPP)-pt_pax-1.patch \
67 $(THISAPP)-lazy-1.patch \
68 $(THISAPP)-asprintf_fix.patch
83 ###############################################################################
84 # Installation Details
85 ###############################################################################
89 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE)
90 @rm -rf $(DIR_SRC)/binutils-build
91 -mkdir -v $(DIR_SRC)/binutils-build
93 # Add PT_PaX header marking support. These markings are using by the PaX
94 # kernel, and Pax-utils, to identify which programs need things like executable
95 # stack, etc. Without this patch the PaX kernel must use legacy mode, and this
96 # patch is greatly preferable:
97 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-pt_pax-1.patch
99 ifeq "$(STAGE)" "toolchain"
101 cd $(DIR_SRC)/binutils-build && \
102 CC="gcc -B/usr/bin/" \
103 ../$(THISAPP)/configure \
105 --target=$(IFS_TARGET) \
106 --prefix=$(TOOLS_DIR) \
109 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) $(PARALLELISMFLAGS)
110 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) install
114 # Binutils libiberty has the same identical bug GCC has:
115 cd $(DIR_APP) && patch -Np0 -i $(DIR_PATCHES)/$(THISAPP)-asprintf_fix.patch
117 cd $(DIR_SRC)/binutils-build && \
118 ../$(THISAPP)/configure \
120 --target=$(IFS_TARGET) \
121 --prefix=$(TOOLS_DIR) \
122 --with-lib-path=$(TOOLS_DIR)/lib \
126 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) $(PARALLELISMFLAGS)
127 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) install
129 cd $(DIR_SRC)/binutils-build && make -C ld clean
130 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/lib:/usr/lib
131 cd $(DIR_SRC)/binutils-build && cp -v ld/.libs/ld-new $(TOOLS_DIR)/bin
135 ifeq "$(STAGE)" "base"
136 cd $(DIR_APP) && patch -Np0 -i $(DIR_PATCHES)/$(THISAPP)-asprintf_fix.patch
137 cd $(DIR_SRC)/binutils-build && \
138 CC="gcc -specs=$$(dirname $$(gcc --print-libgcc-file-name))/myspecs -B/usr/lib/ -B/usr/bin/" \
139 ../$(THISAPP)/configure \
146 cd $(DIR_SRC)/binutils-build && make tooldir=/usr $(PARALLELISMFLAGS)
147 cd $(DIR_SRC)/binutils-build && make tooldir=/usr install
149 cp -fv ../$(THISAPP)/include/libiberty.h /usr/include
152 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build