]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - pkgs/gcc/gcc.nm
PKG_GROUP -> PKG_GROUPS on all packages.
[people/ms/ipfire-3.x.git] / pkgs / gcc / gcc.nm
CommitLineData
166a6c21
MT
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007, 2008, 2009 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
a7c97434 25include $(PKGROOT)/Include
166a6c21
MT
26
27PKG_NAME = gcc
e1e6f5c8 28PKG_VER = 4.5.2
b415c6aa 29PKG_REL = 7
166a6c21
MT
30
31PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
bb7d617c 32PKG_GROUPS = Development/Compilers
166a6c21
MT
33PKG_URL = http://gcc.gnu.org/
34PKG_LICENSE = GPLv3+ and GPLv2+ with exceptions
35PKG_SUMMARY = Various compilers (C, C++, Objective-C, Java, ...).
36
37define PKG_DESCRIPTION
38 The gcc package contains the GNU Compiler Collection. \
39 You'll need this package in order to compile C code.
40endef
41
819979f7 42PKG_BUILD_DEPS+= autogen cloog-devel dejagnu elfutils-devel expect gmp-devel \
ea08336e 43 libffi-devel mpc-devel mpfr-devel pkg-config ppl-devel texinfo zlib-devel
819979f7 44PKG_DEPS-gcc += binutils libgcc-devel
166a6c21 45
e370ba51
MT
46# Make the GCC target platform
47GCC_TARGET_PLATFORM = $(subst -gnu,,$(DISTRO_MACHINE))
48
ea08336e
MT
49ifeq "$(DISTRO_ARCH)" "x86_64"
50 CONFIGURE_ARGS = --disable-multilib
166a6c21
MT
51endif
52
ea08336e
MT
53ifeq "$(DISTRO_ARCH)" "i686"
54 CONFIGURE_ARGS = --with-arch=$(DISTRO_ARCH) --with-tune=generic
166a6c21
MT
55endif
56
ea08336e
MT
57# Modify CFLAGS
58# Remove -m32 and -m64
59CFLAGS := $(subst -m32,,$(CFLAGS))
60CFLAGS := $(subst -m64,,$(CFLAGS))
61# Remove -march=i686
62CFLAGS := $(subst -march=i686,,$(CFLAGS))
63
64export CFLAGS
65export CXXFLAGS = $(subst -Wall,,$(CFLAGS))
66
1fdf0857 67PKG_TARBALL += $(THISAPP).tar.gz
166a6c21 68
819979f7
MT
69# A package for C++
70PKG_PACKAGES += $(PKG_NAME)-c++
71PKG_DEPS-$(PKG_NAME)-c++ = gcc libstdc++-devel
72define PKG_FILES-$(PKG_NAME)-c++
73 /usr/bin/*++
74 /usr/lib/gcc/*/*/cc1plus
75 /usr/share/man/man*/*++*
76endef
77
78# libgcc
79PKG_PACKAGES += libgcc
80define PKG_FILES-libgcc
4ea2e3d9 81 /lib/libgcc*.so.*
819979f7
MT
82endef
83
84PKG_PACKAGES += libgcc-devel
85define PKG_FILES-libgcc-devel
86 /usr/lib/libgcc*.so
87endef
88
89# libstdc++
90PKG_PACKAGES += libstdc++
91define PKG_FILES-libstdc++
92 /usr/lib/libstdc++*.so.*
93endef
94
95PKG_PACKAGES += libstdc++-devel
96define PKG_FILES-libstdc++-devel
97 /usr/include/c++
98 /usr/lib/libstdc++*.so
99endef
100
5146efdc
MT
101# libgomp
102PKG_PACKAGES += libgomp
103define PKG_FILES-libgomp
104 /usr/lib/libgomp*.so.*
105endef
106
107PKG_PACKAGES += libgomp-devel
108define PKG_FILES-libgomp-devel
109 /usr/lib/libgomp*.so
110endef
111
112# libmudflap
113PKG_PACKAGES += libmudflap
114define PKG_FILES-libmudflap
115 /usr/lib/libmudflap*.so.*
116endef
117
118PKG_PACKAGES += libmudflap-devel
119define PKG_FILES-libmudflap-devel
120 /usr/lib/libmudflap*.so
121endef
166a6c21 122
17c0ee8a 123define STAGE_PREPARE_CMDS
166a6c21
MT
124 -mkdir -v $(DIR_SRC)/gcc-build
125
166a6c21
MT
126 # Remove unneeded features that will save some compile time
127 rm -rf $(DIR_APP)/lib{gfortran,java,objc} \
128 $(DIR_APP)/gcc/{fortran,java,objc,objcp}
129
0ba3cc3e
MT
130 # Apply a sed substitution that will suppress the installation of
131 # libiberty.a. The version of libiberty.a provided by Binutils will be used
132 # instead:
133 cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
134
166a6c21 135 # Branding gcc
17c0ee8a 136 cd $(DIR_APP) && sed -e "s:PKGVERSION:\"(GCC for $(DISTRO_NAME)-$(DISTRO_VERSION)) \":" \
166a6c21
MT
137 -i gcc/version.c
138
139 # Libgomp uses -Werror regardless of --disable-werror, and this will cause a
140 # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
141 cd $(DIR_APP) && sed -e "s/-Werror//" -i libgomp/configure
0ba3cc3e
MT
142
143 # Apply the following sed to force the build to use the -fomit-frame-pointer
144 # compiler flag in order to ensure consistent compiler builds:
145 cd $(DIR_APP) && sed -i 's/^T_CFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in
146
147 # The fixincludes script is known to occasionally erroneously attempt to
148 # "fix" the system headers installed so far. As the headers up to this point
149 # are known to not require fixing, issue the following command to prevent
150 # the fixincludes script from running:
166a6c21 151 cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
ea08336e
MT
152
153 cd $(DIR_APP) && sed -i gcc/Makefile.in \
154 -e "s/-fno-exceptions/& -fno-asynchronous-unwind-tables/"
17c0ee8a 155endef
166a6c21 156
17c0ee8a 157define STAGE_BUILD
166a6c21 158 cd $(DIR_SRC)/gcc-build && \
ea08336e
MT
159 CFLAGS="$(CFLAGS)" \
160 CXXFLAGS="$(CXXFLAGS)" \
f23b0b6e
MT
161 XCFLAGS="$(CFLAGS)" \
162 TCFLAGS="$(CFLAGS)" \
166a6c21 163 ../$(THISAPP)/configure \
e370ba51 164 --build=$(GCC_TARGET_PLATFORM) \
166a6c21
MT
165 --prefix=/usr \
166 --libexecdir=/usr/lib \
107ed6ee 167 --mandir=/usr/share/man \
b8b873e7 168 --enable-esp \
166a6c21
MT
169 --enable-shared \
170 --enable-threads=posix \
171 --enable-__cxa_atexit \
172 --enable-clocale=gnu \
f23b0b6e
MT
173 --enable-languages=c,c++,lto \
174 --enable-bootstrap \
175 --enable-checking=release \
166a6c21
MT
176 --disable-werror \
177 --disable-libssp \
178 --disable-static \
f23b0b6e
MT
179 --with-system-zlib \
180 --with-bugurl=http://bugtracker.ipfire.org \
b415c6aa
MT
181 --disable-libunwind-exceptions \
182 --enable-gnu-unique-object \
183 --enable-linker-build-id \
166a6c21
MT
184 $(CONFIGURE_ARGS)
185
186 cd $(DIR_SRC)/gcc-build && make $(PARALLELISMFLAGS)
17c0ee8a 187endef
166a6c21 188
0ba3cc3e 189#define STAGE_TEST
cd5b2d3e 190# cd $(DIR_SRC)/gcc-build && make check
0ba3cc3e
MT
191# cd $(DIR_APP) && ./contrib/test_summary
192#endef
193
17c0ee8a 194define STAGE_INSTALL
166a6c21
MT
195 cd $(DIR_SRC)/gcc-build && make install DESTDIR=$(BUILDROOT)
196
1a9fda21
MT
197 -mkdir -pv $(BUILDROOT)/lib
198 ln -sfv ../usr/bin/cpp $(BUILDROOT)/lib/cpp
166a6c21 199 ln -sfv gcc $(BUILDROOT)/usr/bin/cc
53b9464e 200
4ea2e3d9
MT
201 # Move libgcc_s to /lib
202 mv -vf $(BUILDROOT)/usr/lib/libgcc_s.so.1 $(BUILDROOT)/lib/
203 ln -svf ../../lib/libgcc_s.so.1 $(BUILDROOT)/usr/lib/libgcc_s.so
204
53b9464e
MT
205 # Remove some GNU debugger stuff.
206 rm -vf $(BUILDROOT)/usr/lib/lib*.py
17c0ee8a 207endef