]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame_incremental - lfs/gcc
Disabled core38 and 39 build.
[people/pmueller/ipfire-2.x.git] / lfs / gcc
... / ...
CommitLineData
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007 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
25include Config
26
27VER = 4.0.4
28
29THISAPP = gcc-$(VER)
30DL_FILE = $(THISAPP).tar.bz2
31DL_FROM = $(URL_IPFIRE)
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33CFLAGS =
34CXXFLAGS =
35TARGET_PATH = /opt/$(MACHINE)-uClibc/bin:$(PATH)
36
37# Normal build or /tools build.
38#
39ifeq "$(ROOT)" ""
40ifeq "$(INST)" "1"
41 TARGET = $(DIR_INFO)/$(THISAPP)-install1
42 EXTRA_CONFIG = --prefix=/opt/$(MACHINE)-uClibc \
43 --build=$(MACHINE)-pc-linux-gnu \
44 --host=$(MACHINE)-pc-linux-gnu \
45 --target=$(MACHINE)-linux-uclibc \
46 --enable-languages=c \
47 --with-sysroot=$(DIR_SRC)/uClibc_dev \
48 --disable-__cxa_atexit \
49 --enable-target-optspace \
50 --with-gnu-ld \
51 --disable-shared \
52 --enable-threads \
53 --enable-multilib \
54 --disable-nls
55 EXTRA_MAKE =
56 EXTRA_INSTALL =
57else
58ifeq "$(INST)" "2"
59 TARGET = $(DIR_INFO)/$(THISAPP)-install2
60 EXTRA_CONFIG = --prefix=/opt/$(MACHINE)-uClibc \
61 --build=$(MACHINE)-pc-linux-gnu \
62 --host=$(MACHINE)-pc-linux-gnu \
63 --target=$(MACHINE)-linux-uclibc \
64 --enable-languages=c,c++ \
65 --with-sysroot=$(DIR_SRC)/uClibc_dev \
66 --disable-__cxa_atexit \
67 --enable-target-optspace \
68 --with-gnu-ld \
69 --enable-shared \
70 --disable-nls \
71 --enable-threads \
72 --enable-multilib
73 EXTRA_MAKE =
74 EXTRA_INSTALL =
75else
76 TARGET = $(DIR_INFO)/$(THISAPP)
77 EXTRA_CONFIG = --prefix=/usr \
78 --libexecdir=/usr/lib \
79 --enable-shared \
80 --enable-threads=posix \
81 --enable-__cxa_atexit \
82 --enable-clocale=gnu \
83 --enable-languages=c,c++ \
84 --disable-nls
85 EXTRA_MAKE =
86 EXTRA_INSTALL =
87endif
88endif
89else
90ifeq "$(PASS)" "1"
91 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
92 EXTRA_CONFIG = --prefix=/tools \
93 --with-local-prefix=/tools \
94 --disable-nls \
95 --enable-shared \
96 --enable-languages=c
97 EXTRA_MAKE =
98 #bootstrap BOOT_LDFLAGS="-static"
99 EXTRA_INSTALL =
100else
101 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
102 EXTRA_CONFIG = --prefix=/tools \
103 --with-local-prefix=/tools \
104 --enable-clocale=gnu \
105 --enable-shared \
106 --enable-threads=posix \
107 --enable-__cxa_atexit \
108 --enable-languages=c,c++ \
109 --disable-libstdcxx-pch
110 EXTRA_MAKE =
111 EXTRA_INSTALL =
112endif
113endif
114
115###############################################################################
116# Top-level Rules
117###############################################################################
118objects = $(DL_FILE)
119
120$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
121
122$(DL_FILE)_MD5 = 8970debbc55bea85ee80961d733080f0
123
124install : $(TARGET)
125
126check : $(patsubst %,$(DIR_CHK)/%,$(objects))
127
128download :$(patsubst %,$(DIR_DL)/%,$(objects))
129
130md5 : $(subst %,%_MD5,$(objects))
131
132###############################################################################
133# Downloading, checking, md5sum
134###############################################################################
135
136$(patsubst %,$(DIR_CHK)/%,$(objects)) :
137 @$(CHECK)
138
139$(patsubst %,$(DIR_DL)/%,$(objects)) :
140 @$(LOAD)
141
142$(subst %,%_MD5,$(objects)) :
143 @$(MD5)
144
145###############################################################################
146# Installation Details
147###############################################################################
148
149$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
150 @$(PREBUILD)
151 @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
152 @mkdir $(DIR_SRC)/gcc-build
153ifeq "$(ROOT)" ""
154ifeq "$(INST)" "1"
155 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gcc-uclibc-conf.patch
156 cd $(DIR_SRC)/gcc-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
157 cd $(DIR_SRC)/gcc-build && PATH=$(TARGET_PATH) make $(MAKETUNING) all-gcc
158 cd $(DIR_SRC)/gcc-build && PATH=$(TARGET_PATH) make install-gcc
159 cd /opt/$(MACHINE)-uClibc/bin && for i in `ls -w1 $(MACHINE)-linux-uclibc-*`; do \
160 ln -svf $$i $(MACHINE)-linux-`echo $$i | cut -c 19-`; \
161 done
162 ln -svf $(MACHINE)-linux-uclibc /opt/$(MACHINE)-uClibc/$(MACHINE)-linux
163 ln -svf gcc /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/bin/cc
164else
165ifeq "$(INST)" "2"
166 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gcc-uclibc-conf.patch
167 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gcc-uclibc-locale.patch
168 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gcc-libstdc++-pic.patch
169 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gcc-sdk-libstdc++-includes.patch
170 ln -snf ../include /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/sys-include
171 cd $(DIR_SRC)/gcc-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
172 cd $(DIR_SRC)/gcc-build && PATH=$(TARGET_PATH) make $(MAKETUNING) $(EXTRA_MAKE)
173 cd $(DIR_SRC)/gcc-build && PATH=$(TARGET_PATH) make install $(EXTRA_INSTALL)
174 cp -f /opt/$(MACHINE)-uClibc/lib/libgcc_s.so /lib
175 cd /lib && ln -sf libgcc_s.so libgcc_s.so.1
176else
177 cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
178 cd $(DIR_APP) && sed -i 's/^XCFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in
179 cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
180 cd $(DIR_APP) && sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in
181
182 cd $(DIR_SRC)/gcc-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
183 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
184 cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
185 ln -sfv ../usr/bin/cpp /lib
186 ln -sfv gcc /usr/bin/cc
187endif
188endif
189else
190ifeq "$(PASS)" "1"
191 cd $(DIR_SRC)/gcc-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
192 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
193 cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
194 ln -sfv gcc /tools/bin/cc
195else
196 cd $(DIR_APP) && cp -v gcc/Makefile.in{,.orig}
197 cd $(DIR_APP) && sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in
198 cd $(DIR_APP) && cp -v gcc/Makefile.in{,.tmp}
199 cd $(DIR_APP) && sed 's/^XCFLAGS =$\/& -fomit-frame-pointer/' gcc/Makefile.in.tmp \
200 > gcc/Makefile.in
201 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-specs-1.patch
202 cd $(DIR_SRC)/gcc-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
203 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
204 cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
205endif
206endif
207 @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build
208 @$(POSTBUILD)