]> git.ipfire.org Git - ipfire-2.x.git/blame_incremental - lfs/cleanup-toolchain
toolchain: glibc: Cross build package and import patches from RHEL6.
[ipfire-2.x.git] / lfs / cleanup-toolchain
... / ...
CommitLineData
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
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
25include Config
26
27VER = ipfire
28
29THISAPP = cleanup-toolchain
30TARGET = $(DIR_INFO)/$(THISAPP)-$(PASS)-tools
31
32GCC_VER = 4.1.2
33
34###############################################################################
35# Top-level Rules
36###############################################################################
37
38objects =
39
40install : $(TARGET)
41
42check :
43
44download :
45
46md5 :
47
48###############################################################################
49# Installation Details
50###############################################################################
51
52$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
53 @$(PREBUILD)
54ifeq "$(PASS)" "1"
55 mv -v /tools/bin/{ld,ld-old}
56 mv -v /tools/$(BUILDTARGET)/bin/{ld,ld-old}
57 cp -v /tools/bin/{ld-new,ld}
58 ln -sv /tools/bin/ld /tools/$(BUILDTARGET)/bin/ld
59 gcc -dumpspecs > /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/specs
60 sed 's@/lib/ld-linux.so@/tools&@g' /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/specs > tempspecfile
61 mv -vf tempspecfile /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/specs
62 find /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/include/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \;
63 rm -vf `grep -l "DO NOT EDIT THIS FILE" /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/include/*`
64endif
65ifeq "$(PASS)" "2"
66 -strip --strip-debug /tools/lib/*
67 -strip --strip-unneeded /tools/{,s}bin/*
68 rm -rfv /tools/{info,man} /usr/local/man
69 chown -R root:root /tools
70
71 # Install CPUID header.
72 install -m 644 -v $(DIR_SRC)/headers/cpuid.h /tools/include
73endif
74ifeq "$(PASS)" "3"
75 mv -v /tools/bin/{ld,ld-old}
76 mv -v /tools/$(BUILDTARGET)/bin/{ld,ld-old}
77 mv -v /tools/bin/{ld-new,ld}
78 ln -sv /tools/bin/ld /tools/$(BUILDTARGET)/bin/ld
79 gcc -dumpspecs | \
80 perl -p -e 's@/tools/lib/ld-linux.so@/lib/ld-linux.so@g;' \
81 -e 's@\*startfile_prefix_spec:\n@$$_/usr/lib/ @g;' > \
82 /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/specs
83endif
84 @$(POSTBUILD)