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 TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
38 TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
42 GROUP = Development/Tools
47 URL = http://www.gnu.org/software/binutils/
49 SHORT_DESC = The GNU Binutils are a collection of binary tools.
52 The GNU Binary Utilities, or binutils, is a collection of programming \
53 tools for the manipulation of object code in various object file formats.
56 ###############################################################################
58 ###############################################################################
60 objects = $(DL_FILE) \
61 $(THISAPP)-ld_makefile.patch \
62 $(THISAPP)-pt_pax-1.patch \
63 $(THISAPP)-lazy-1.patch \
64 $(THISAPP)-asprintf_fix.patch
76 ###############################################################################
77 # Installation Details
78 ###############################################################################
82 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE)
83 @rm -rf $(DIR_SRC)/binutils-build
84 -mkdir -v $(DIR_SRC)/binutils-build
86 # Add PT_PaX header marking support. These markings are using by the PaX
87 # kernel, and Pax-utils, to identify which programs need things like executable
88 # stack, etc. Without this patch the PaX kernel must use legacy mode, and this
89 # patch is greatly preferable:
90 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-pt_pax-1.patch
92 ifeq "$(STAGE)" "toolchain"
94 cd $(DIR_SRC)/binutils-build && \
95 CC="gcc -B/usr/bin/" \
96 ../$(THISAPP)/configure \
98 --target=$(IFS_TARGET) \
99 --prefix=$(TOOLS_DIR) \
102 cd $(DIR_SRC)/binutils-build && make $(PARALLELISMFLAGS)
103 cd $(DIR_SRC)/binutils-build && make install
105 for t in $$(ls $(TOOLS_DIR)/$(IFS_TARGET)/bin); do \
106 ln -sfv ../$(IFS_TARGET)/bin/$${t} $(TOOLS_DIR)/bin/$(IFS_TARGET)-$${t}; \
111 # Binutils libiberty has the same identical bug GCC has:
112 cd $(DIR_APP) && patch -Np0 -i $(DIR_PATCHES)/$(THISAPP)-asprintf_fix.patch
114 cd $(DIR_SRC)/binutils-build && \
115 ../$(THISAPP)/configure \
117 --target=$(IFS_TARGET) \
118 --prefix=$(TOOLS_DIR) \
119 --with-lib-path=$(TOOLS_DIR)/lib \
122 cd $(DIR_SRC)/binutils-build && make $(PARALLELISMFLAGS)
123 cd $(DIR_SRC)/binutils-build && make install
125 cd $(DIR_SRC)/binutils-build && make -C ld clean
126 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/lib:/usr/lib
127 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new $(TOOLS_DIR)/bin
131 ifeq "$(STAGE)" "base"
132 cd $(DIR_APP) && patch -Np0 -i $(DIR_PATCHES)/$(THISAPP)-asprintf_fix.patch
133 cd $(DIR_SRC)/binutils-build && \
134 CC="gcc -specs=$$(dirname $$(gcc --print-libgcc-file-name))/myspecs -B/usr/lib/ -B/usr/bin/" \
135 ../$(THISAPP)/configure \
140 cd $(DIR_SRC)/binutils-build && make tooldir=/usr $(PARALLELISMFLAGS)
141 cd $(DIR_SRC)/binutils-build && make tooldir=/usr install
143 cp -fv ../$(THISAPP)/include/libiberty.h /usr/include
146 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build