]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blame - pkgs/core/gcc/gcc.nm
naoki: Initial checkin.
[people/stevee/ipfire-3.x.git] / pkgs / core / 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
25include ../../Config
26
27PKG_NAME = gcc
28PKG_VER = 4.4.1
29PKG_REL = 0
30
31PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
32PKG_GROUP = Development/Compilers
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
42PKG_BUILD_DEPS = binutils glibc
43
44CFLAGS = -D__USE_XOPEN2K8 -pipe
45CXXFLAGS =
46
47GMP = 4.3.1
48MPFR = 2.4.1
49
50ifeq "$(MACHINE)" "i586"
51 CONFIGURE_ARGS = --disable-decimal-float
52endif
53
54ifeq "$(MACHINE)" "x86_64"
55 CONFIGURE_ARGS = --without-cloog --without-ppl --disable-multilib
56else
57 CONFIG_CPU = --with-cpu=$(TARGET_MACHINE) --with-arch=$(TARGET_MACHINE)
58endif
59
60PKG_OBJECTS += $(THISAPP).tar.bz2
61PKG_OBJECTS += gmp-$(GMP).tar.bz2
62PKG_OBJECTS += mpfr-$(MPFR).tar.bz2
63
64PKG_PATCHES += $(THISAPP)-espf-1.patch \
65 $(THISAPP)-branch-startfiles-1.patch \
66 $(THISAPP)-asprintf_fix.patch
67
68include ../../Rules
69
70###############################################################################
71# Installation Details
72###############################################################################
73
74$(STAGE_PREPARE): $(OBJECTS)
75 @$(PRE_PREPARE)
76 @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && $(DO_EXTRACT) $(DIR_DL)/$(firstword $(PKG_OBJECTS))
77 -mkdir -v $(DIR_SRC)/gcc-build
78
79 # First, unpack gmp and mpfr.
80 # We use the build-"magic" of the gcc build system that we compile libgmp and
81 # libmpfr right (with -fPIC and so on).
82 cd $(DIR_APP) && $(DO_EXTRACT) $(DIR_DL)/gmp-$(GMP).tar.bz2
83 cd $(DIR_APP) && ln -svf gmp-* gmp
84 cd $(DIR_APP) && $(DO_EXTRACT) $(DIR_DL)/mpfr-$(MPFR).tar.bz2
85 cd $(DIR_APP) && ln -svf mpfr-* mpfr
86
87 # Remove unneeded features that will save some compile time
88 rm -rf $(DIR_APP)/lib{gfortran,java,objc} \
89 $(DIR_APP)/gcc/{fortran,java,objc,objcp}
90
91 # Branding gcc
92 cd $(DIR_APP) && sed -e "s:PKGVERSION:\"(GCC for $(NAME)-${VERSION}) \":" \
93 -i gcc/version.c
94
95 # Libgomp uses -Werror regardless of --disable-werror, and this will cause a
96 # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
97 cd $(DIR_APP) && sed -e "s/-Werror//" -i libgomp/configure
98
99 @$(POST_PREPARE)
100
101$(STAGE_BUILD): $(STAGE_PREPARE)
102 @$(PRE_BUILD)
103
104 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-espf-1.patch
105
106 cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
107 cd $(DIR_APP) && sed -i 's/^XCFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in
108 cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
109
110 # Libgomp uses -Werror regardless of --disable-werror, and this will cause a
111 # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
112 cd $(DIR_APP) && sed -e "s/-Werror//" -i libgomp/configure
113
114 cd $(DIR_SRC)/gcc-build && \
115 ../$(THISAPP)/configure \
116 $(CONFIGURE_ARCH) \
117 --target=$(TARGET) \
118 $(CONFIG_CPU) \
119 --prefix=/usr \
120 --libexecdir=/usr/lib \
121 --enable-espf \
122 --enable-shared \
123 --enable-threads=posix \
124 --enable-__cxa_atexit \
125 --enable-clocale=gnu \
126 --enable-languages=c,c++ \
127 --disable-bootstrap \
128 --disable-werror \
129 --disable-libssp \
130 --disable-static \
131 $(CONFIGURE_ARGS)
132
133 cd $(DIR_SRC)/gcc-build && make $(PARALLELISMFLAGS)
134
135 @$(POST_BUILD)
136
137$(STAGE_INSTALL): $(STAGE_BUILD)
138 @$(PRE_INSTALL)
139
140 cd $(DIR_SRC)/gcc-build && make install DESTDIR=$(BUILDROOT)
141
142 rm -vf $(BUILDROOT)/usr/lib/lib{ffi,gomp,mudflap{,th},stdc++,supc++}.la
143
144 ln -sfv ../usr/bin/cpp $(BUILDROOT)/lib
145 ln -sfv gcc $(BUILDROOT)/usr/bin/cc
146
147 @$(POST_INSTALL)