]>
Commit | Line | Data |
---|---|---|
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 | ||
25 | include ../../Config | |
26 | ||
27 | PKG_NAME = gcc | |
28 | PKG_VER = 4.4.1 | |
29 | PKG_REL = 0 | |
30 | ||
31 | PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org> | |
32 | PKG_GROUP = Development/Compilers | |
33 | PKG_URL = http://gcc.gnu.org/ | |
34 | PKG_LICENSE = GPLv3+ and GPLv2+ with exceptions | |
35 | PKG_SUMMARY = Various compilers (C, C++, Objective-C, Java, ...). | |
36 | ||
37 | define PKG_DESCRIPTION | |
38 | The gcc package contains the GNU Compiler Collection. \ | |
39 | You'll need this package in order to compile C code. | |
40 | endef | |
41 | ||
17c0ee8a | 42 | PKG_BUILD_DEPS = binutils glibc kernel-headers |
166a6c21 MT |
43 | |
44 | CFLAGS = -D__USE_XOPEN2K8 -pipe | |
45 | CXXFLAGS = | |
46 | ||
47 | GMP = 4.3.1 | |
48 | MPFR = 2.4.1 | |
49 | ||
50 | ifeq "$(MACHINE)" "i586" | |
51 | CONFIGURE_ARGS = --disable-decimal-float | |
52 | endif | |
53 | ||
54 | ifeq "$(MACHINE)" "x86_64" | |
55 | CONFIGURE_ARGS = --without-cloog --without-ppl --disable-multilib | |
56 | else | |
57 | CONFIG_CPU = --with-cpu=$(TARGET_MACHINE) --with-arch=$(TARGET_MACHINE) | |
58 | endif | |
59 | ||
17c0ee8a | 60 | PKG_TARBALL += $(THISAPP).tar.bz2 |
166a6c21 MT |
61 | PKG_OBJECTS += gmp-$(GMP).tar.bz2 |
62 | PKG_OBJECTS += mpfr-$(MPFR).tar.bz2 | |
63 | ||
64 | PKG_PATCHES += $(THISAPP)-espf-1.patch \ | |
65 | $(THISAPP)-branch-startfiles-1.patch \ | |
66 | $(THISAPP)-asprintf_fix.patch | |
67 | ||
68 | include ../../Rules | |
69 | ||
17c0ee8a MT |
70 | export CPP = $(TOOLS_DIR)/bin/cpp |
71 | ||
166a6c21 MT |
72 | ############################################################################### |
73 | # Installation Details | |
74 | ############################################################################### | |
75 | ||
17c0ee8a | 76 | define STAGE_PREPARE_CMDS |
166a6c21 MT |
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 | |
17c0ee8a | 92 | cd $(DIR_APP) && sed -e "s:PKGVERSION:\"(GCC for $(DISTRO_NAME)-$(DISTRO_VERSION)) \":" \ |
166a6c21 MT |
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 | ||
166a6c21 MT |
99 | cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in |
100 | cd $(DIR_APP) && sed -i 's/^XCFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in | |
101 | cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in | |
17c0ee8a | 102 | endef |
166a6c21 | 103 | |
17c0ee8a | 104 | define STAGE_BUILD |
166a6c21 MT |
105 | cd $(DIR_SRC)/gcc-build && \ |
106 | ../$(THISAPP)/configure \ | |
107 | $(CONFIGURE_ARCH) \ | |
108 | --target=$(TARGET) \ | |
109 | $(CONFIG_CPU) \ | |
110 | --prefix=/usr \ | |
111 | --libexecdir=/usr/lib \ | |
112 | --enable-espf \ | |
113 | --enable-shared \ | |
114 | --enable-threads=posix \ | |
115 | --enable-__cxa_atexit \ | |
116 | --enable-clocale=gnu \ | |
117 | --enable-languages=c,c++ \ | |
118 | --disable-bootstrap \ | |
119 | --disable-werror \ | |
120 | --disable-libssp \ | |
121 | --disable-static \ | |
122 | $(CONFIGURE_ARGS) | |
123 | ||
124 | cd $(DIR_SRC)/gcc-build && make $(PARALLELISMFLAGS) | |
17c0ee8a | 125 | endef |
166a6c21 | 126 | |
17c0ee8a | 127 | define STAGE_INSTALL |
166a6c21 MT |
128 | cd $(DIR_SRC)/gcc-build && make install DESTDIR=$(BUILDROOT) |
129 | ||
166a6c21 MT |
130 | ln -sfv ../usr/bin/cpp $(BUILDROOT)/lib |
131 | ln -sfv gcc $(BUILDROOT)/usr/bin/cc | |
17c0ee8a | 132 | endef |