]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blame - lfs/binutils
Changed name to IPFire-3.0-alpha1 (Lechery).
[people/arne_f/ipfire-3.x.git] / lfs / binutils
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
e72822e6 4# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
70df8302
MT
5# #
6# This program is free software: you can redistribute it and/or modify #
cd1a2927 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
cd1a2927
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
cd1a2927
MT
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 #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
cd1a2927 18# #
cd1a2927
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
be472d5a 27PKG_NAME = binutils
8985a698
MT
28PKG_VER = 2.19.1
29PKG_REL = 0
cd1a2927 30
8985a698 31THISAPP = $(PKG_NAME)-$(PKG_VER)
cd1a2927 32DL_FILE = $(THISAPP).tar.bz2
cd1a2927
MT
33DIR_APP = $(DIR_SRC)/$(THISAPP)
34
be472d5a 35ifeq "$(STAGE)" "toolchain"
c4032324 36 OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
bc9f0c12 37else
c4032324 38 OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
cd1a2927
MT
39endif
40
e72822e6
MT
41MAINTAINER =
42GROUP = Development/Tools
43EXTRA = no
44DEBUG = no
d4f7df8c
MT
45
46# Host system provides zlib.
47ifneq "$(STAGE)" "toolchain"
48 DEPS = zlib
49endif
e72822e6
MT
50
51URL = http://www.gnu.org/software/binutils/
52LICENSE = GPLv2+
53SHORT_DESC = The GNU Binutils are a collection of binary tools.
54
55define 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.
58endef
59
cd1a2927
MT
60###############################################################################
61# Top-level Rules
62###############################################################################
63
e72822e6 64objects = $(DL_FILE) \
13770435 65 $(THISAPP)-ld_makefile.patch \
15bf4b58 66 $(THISAPP)-pt_pax-1.patch \
88068980
MT
67 $(THISAPP)-lazy-1.patch \
68 $(THISAPP)-asprintf_fix.patch
cd1a2927 69
e72822e6
MT
70download: $(objects)
71
790bc8ce
MT
72info:
73 $(DO_PKG_INFO)
74
6679675b 75install: $(OBJECT)
cd1a2927 76
e72822e6
MT
77package:
78 @$(DO_PACKAGE)
cd1a2927 79
e72822e6 80$(objects):
cd1a2927
MT
81 @$(LOAD)
82
cd1a2927
MT
83###############################################################################
84# Installation Details
85###############################################################################
86
6679675b 87$(OBJECT): $(objects)
cd1a2927 88 @$(PREBUILD)
e72822e6
MT
89 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE)
90 @rm -rf $(DIR_SRC)/binutils-build
be472d5a
MT
91 -mkdir -v $(DIR_SRC)/binutils-build
92
88068980
MT
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
10f9531b 99ifeq "$(STAGE)" "toolchain"
15679d9f 100ifeq "$(PASS)" "1"
15bf4b58 101 cd $(DIR_SRC)/binutils-build && \
88068980 102 CC="gcc -B/usr/bin/" \
15bf4b58 103 ../$(THISAPP)/configure \
88068980 104 $(CONFIGURE_ARCH) \
15bf4b58
MT
105 --target=$(IFS_TARGET) \
106 --prefix=$(TOOLS_DIR) \
107 --disable-nls \
108 --disable-werror
65b4759e
MT
109 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) $(PARALLELISMFLAGS)
110 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) install
be472d5a
MT
111endif
112
113ifeq "$(PASS)" "2"
88068980
MT
114 # Binutils libiberty has the same identical bug GCC has:
115 cd $(DIR_APP) && patch -Np0 -i $(DIR_PATCHES)/$(THISAPP)-asprintf_fix.patch
116
15bf4b58 117 cd $(DIR_SRC)/binutils-build && \
15bf4b58 118 ../$(THISAPP)/configure \
88068980 119 $(CONFIGURE_ARCH) \
cd564211 120 --target=$(IFS_TARGET) \
15bf4b58 121 --prefix=$(TOOLS_DIR) \
ba950bae 122 --with-lib-path=$(TOOLS_DIR)/lib \
88068980 123 --disable-nls \
32d39039 124 --enable-shared \
88068980 125 --disable-werror
65b4759e
MT
126 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) $(PARALLELISMFLAGS)
127 cd $(DIR_SRC)/binutils-build && make tooldir=$(TOOLS_DIR) install
15bf4b58 128
90d372c4 129 cd $(DIR_SRC)/binutils-build && make -C ld clean
ba950bae 130 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/lib:/usr/lib
8e11cceb 131 cd $(DIR_SRC)/binutils-build && cp -v ld/.libs/ld-new $(TOOLS_DIR)/bin
cd1a2927 132endif
15bf4b58 133endif
3888140c
MT
134
135ifeq "$(STAGE)" "base"
88068980 136 cd $(DIR_APP) && patch -Np0 -i $(DIR_PATCHES)/$(THISAPP)-asprintf_fix.patch
15bf4b58
MT
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 \
95d4aa0f 140 $(CONFIGURE_ARCH) \
15bf4b58
MT
141 --prefix=/usr \
142 --enable-shared \
f05b5010 143 --disable-nls \
81bc99ba
MT
144 --disable-werror \
145 --disable-static
13770435 146 cd $(DIR_SRC)/binutils-build && make tooldir=/usr $(PARALLELISMFLAGS)
3888140c 147 cd $(DIR_SRC)/binutils-build && make tooldir=/usr install
acef7362 148
15bf4b58 149 cp -fv ../$(THISAPP)/include/libiberty.h /usr/include
acef7362 150endif
10f9531b 151
cd1a2927
MT
152 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
153 @$(POSTBUILD)