]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blob - lfs/binutils
c8ccbcdc0cd111be8762a5b22d422d421bd8f48a
[people/arne_f/ipfire-3.x.git] / lfs / binutils
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
5 # #
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. #
10 # #
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. #
15 # #
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/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 PKG_NAME = binutils
28 VER = 2.19.1
29 PKG_VER = 0
30
31 THISAPP = $(PKG_NAME)-$(VER)
32 DL_FILE = $(THISAPP).tar.bz2
33 DIR_APP = $(DIR_SRC)/$(THISAPP)
34
35 ifeq "$(STAGE)" "toolchain"
36 OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
37 else
38 OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
39 endif
40
41 MAINTAINER =
42 GROUP = Development/Tools
43 EXTRA = no
44 DEBUG = no
45
46 # Host system provides zlib.
47 ifneq "$(STAGE)" "toolchain"
48 DEPS = zlib
49 endif
50
51 URL = http://www.gnu.org/software/binutils/
52 LICENSE = GPLv2+
53 SHORT_DESC = The GNU Binutils are a collection of binary tools.
54
55 define LONG_DESC
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.
58 endef
59
60 ###############################################################################
61 # Top-level Rules
62 ###############################################################################
63
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
69
70 download: $(objects)
71
72 info:
73 $(DO_PKG_INFO)
74
75 install: $(OBJECT)
76
77 package:
78 @$(DO_PACKAGE)
79
80 $(objects):
81 @$(LOAD)
82
83 ###############################################################################
84 # Installation Details
85 ###############################################################################
86
87 $(OBJECT): $(objects)
88 @$(PREBUILD)
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
92
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
98
99 ifeq "$(STAGE)" "toolchain"
100 ifeq "$(PASS)" "1"
101 cd $(DIR_SRC)/binutils-build && \
102 CC="gcc -B/usr/bin/" \
103 ../$(THISAPP)/configure \
104 $(CONFIGURE_ARCH) \
105 --target=$(IFS_TARGET) \
106 --prefix=$(TOOLS_DIR) \
107 --disable-nls \
108 --disable-werror
109 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) $(PARALLELISMFLAGS)
110 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) install
111 endif
112
113 ifeq "$(PASS)" "2"
114 # Binutils libiberty has the same identical bug GCC has:
115 cd $(DIR_APP) && patch -Np0 -i $(DIR_PATCHES)/$(THISAPP)-asprintf_fix.patch
116
117 cd $(DIR_SRC)/binutils-build && \
118 ../$(THISAPP)/configure \
119 $(CONFIGURE_ARCH) \
120 --target=$(IFS_TARGET) \
121 --prefix=$(TOOLS_DIR) \
122 --with-lib-path=$(TOOLS_DIR)/lib \
123 --disable-nls \
124 --enable-shared \
125 --disable-werror
126 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) $(PARALLELISMFLAGS)
127 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) install
128
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
132 endif
133 endif
134
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 \
140 $(CONFIGURE_ARCH) \
141 --prefix=/usr \
142 --enable-shared \
143 --disable-nls \
144 --disable-werror \
145 --disable-static
146 cd $(DIR_SRC)/binutils-build && make tooldir=/usr $(PARALLELISMFLAGS)
147 cd $(DIR_SRC)/binutils-build && make tooldir=/usr install
148
149 cp -fv ../$(THISAPP)/include/libiberty.h /usr/include
150 endif
151
152 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
153 @$(POSTBUILD)