]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - lfs/gcc
gcc: fix libstdc++ symbol versioning (wrong linker detection).
[people/pmueller/ipfire-2.x.git] / lfs / gcc
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
3f8c9dc5 4# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
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
3f8c9dc5 27VER = 4.1.2
cd1a2927
MT
28
29THISAPP = gcc-$(VER)
dd714b8a
MT
30DL_FILE = $(THISAPP).tar.bz2
31DL_FROM = $(URL_IPFIRE)
cd1a2927
MT
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33CFLAGS =
34CXXFLAGS =
35
36# Normal build or /tools build.
37#
38ifeq "$(ROOT)" ""
39 TARGET = $(DIR_INFO)/$(THISAPP)
40 EXTRA_CONFIG = --prefix=/usr \
a50d04ab
MT
41 --libexecdir=/usr/lib \
42 --enable-shared \
43 --enable-threads=posix \
44 --enable-__cxa_atexit \
45 --enable-clocale=gnu \
46 --enable-languages=c,c++ \
47 --disable-nls
857d9bf2
MT
48 EXTRA_MAKE =
49 EXTRA_INSTALL =
cd1a2927 50else
15679d9f 51ifeq "$(PASS)" "1"
cd1a2927 52 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
dd714b8a 53 EXTRA_CONFIG = --prefix=/tools \
a50d04ab
MT
54 --with-local-prefix=/tools \
55 --disable-nls \
56 --enable-shared \
57 --enable-languages=c
3f8c9dc5
AF
58 EXTRA_MAKE = bootstrap
59 # BOOT_LDFLAGS="-static"
cd1a2927
MT
60 EXTRA_INSTALL =
61else
62 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
dd714b8a 63 EXTRA_CONFIG = --prefix=/tools \
a50d04ab
MT
64 --with-local-prefix=/tools \
65 --enable-clocale=gnu \
66 --enable-shared \
67 --enable-threads=posix \
68 --enable-__cxa_atexit \
69 --enable-languages=c,c++ \
70 --disable-libstdcxx-pch
cd1a2927
MT
71 EXTRA_MAKE =
72 EXTRA_INSTALL =
73endif
74endif
75
76###############################################################################
77# Top-level Rules
78###############################################################################
dd714b8a 79objects = $(DL_FILE)
cd1a2927 80
41921bd9 81$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
cd1a2927 82
3f8c9dc5 83$(DL_FILE)_MD5 = a4a3eb15c96030906d8494959eeda23c
cd1a2927
MT
84
85install : $(TARGET)
86
87check : $(patsubst %,$(DIR_CHK)/%,$(objects))
88
89download :$(patsubst %,$(DIR_DL)/%,$(objects))
90
91md5 : $(subst %,%_MD5,$(objects))
92
93###############################################################################
94# Downloading, checking, md5sum
95###############################################################################
96
97$(patsubst %,$(DIR_CHK)/%,$(objects)) :
98 @$(CHECK)
99
100$(patsubst %,$(DIR_DL)/%,$(objects)) :
101 @$(LOAD)
102
103$(subst %,%_MD5,$(objects)) :
104 @$(MD5)
105
106###############################################################################
107# Installation Details
108###############################################################################
109
110$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
111 @$(PREBUILD)
112 @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
2b56ee99 113 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-fix_linker_version_detection.patch
dd714b8a 114 @mkdir $(DIR_SRC)/gcc-build
cd1a2927 115ifeq "$(ROOT)" ""
f97be0a6
MT
116 cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
117 cd $(DIR_APP) && sed -i 's/^XCFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in
9b0ff0a0
MT
118 cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
119 cd $(DIR_APP) && sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in
dd714b8a 120
f97be0a6
MT
121 cd $(DIR_SRC)/gcc-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
122 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
123 cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
9b0ff0a0
MT
124 ln -sfv ../usr/bin/cpp /lib
125 ln -sfv gcc /usr/bin/cc
cd1a2927 126else
15679d9f 127ifeq "$(PASS)" "1"
f97be0a6 128 cd $(DIR_SRC)/gcc-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
dd714b8a 129 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
cd1a2927 130 cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
9b0ff0a0 131 ln -sfv gcc /tools/bin/cc
cd1a2927 132else
dd714b8a
MT
133 cd $(DIR_APP) && cp -v gcc/Makefile.in{,.orig}
134 cd $(DIR_APP) && sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in
135 cd $(DIR_APP) && cp -v gcc/Makefile.in{,.tmp}
90d372c4
MT
136 cd $(DIR_APP) && sed 's/^XCFLAGS =$\/& -fomit-frame-pointer/' gcc/Makefile.in.tmp \
137 > gcc/Makefile.in
9b0ff0a0 138 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-specs-1.patch
f97be0a6 139 cd $(DIR_SRC)/gcc-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
dd714b8a
MT
140 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
141 cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
cd1a2927 142endif
cd1a2927
MT
143endif
144 @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build
145 @$(POSTBUILD)