]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - lfs/gcc
Make.sh gesplittet und maechtig ueberarbeitet.
[people/teissler/ipfire-2.x.git] / lfs / gcc
CommitLineData
cd1a2927
MT
1###############################################################################
2# This file is part of the IPCop Firewall. #
3# #
4# IPCop is free software; you can redistribute it and/or modify #
5# it under the terms of the GNU General Public License as published by #
6# the Free Software Foundation; either version 2 of the License, or #
7# (at your option) any later version. #
8# #
9# IPCop is distributed in the hope that it will be useful, #
10# but WITHOUT ANY WARRANTY; without even the implied warranty of #
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12# GNU General Public License for more details. #
13# #
14# You should have received a copy of the GNU General Public License #
15# along with IPCop; if not, write to the Free Software #
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
17# #
18# Makefiles are based on LFSMake, which is #
19# Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
20# #
cd1a2927
MT
21###############################################################################
22
23###############################################################################
24# Definitions
25###############################################################################
26
27include Config
28
dd714b8a 29VER = 4.0.3
cd1a2927
MT
30
31THISAPP = gcc-$(VER)
dd714b8a
MT
32DL_FILE = $(THISAPP).tar.bz2
33DL_FROM = $(URL_IPFIRE)
cd1a2927
MT
34DIR_APP = $(DIR_SRC)/$(THISAPP)
35CFLAGS =
36CXXFLAGS =
37
38# Normal build or /tools build.
39#
40ifeq "$(ROOT)" ""
41 TARGET = $(DIR_INFO)/$(THISAPP)
42 EXTRA_CONFIG = --prefix=/usr \
43 --enable-shared --enable-threads=posix \
44 --enable-__cxa_atexit --enable-clocale=gnu \
45 --enable-languages=c,c++ --disable-nls
46 EXTRA_MAKE =
47 EXTRA_INSTALL =
48else
15679d9f 49ifeq "$(PASS)" "1"
cd1a2927 50 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
dd714b8a
MT
51 EXTRA_CONFIG = --prefix=/tools \
52 --with-local-prefix=/tools --disable-nls --enable-shared \
53 --enable-languages=c
cd1a2927
MT
54 EXTRA_MAKE = BOOT_LDFLAGS="-static" bootstrap
55 EXTRA_INSTALL =
56else
57 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
dd714b8a
MT
58 EXTRA_CONFIG = --prefix=/tools \
59 --with-local-prefix=/tools --enable-clocale=gnu \
60 --enable-shared --enable-threads=posix \
61 --enable-__cxa_atexit --enable-languages=c,c++ \
62 --disable-libstdcxx-pch
cd1a2927
MT
63 EXTRA_MAKE =
64 EXTRA_INSTALL =
65endif
66endif
67
68###############################################################################
69# Top-level Rules
70###############################################################################
dd714b8a 71objects = $(DL_FILE)
cd1a2927
MT
72
73$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
cd1a2927 74
dd714b8a 75$(DL_FILE)_MD5 = 6ff1af12c53cbb3f79b27f2d6a9a3d50
cd1a2927
MT
76
77install : $(TARGET)
78
79check : $(patsubst %,$(DIR_CHK)/%,$(objects))
80
81download :$(patsubst %,$(DIR_DL)/%,$(objects))
82
83md5 : $(subst %,%_MD5,$(objects))
84
85###############################################################################
86# Downloading, checking, md5sum
87###############################################################################
88
89$(patsubst %,$(DIR_CHK)/%,$(objects)) :
90 @$(CHECK)
91
92$(patsubst %,$(DIR_DL)/%,$(objects)) :
93 @$(LOAD)
94
95$(subst %,%_MD5,$(objects)) :
96 @$(MD5)
97
98###############################################################################
99# Installation Details
100###############################################################################
101
102$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
103 @$(PREBUILD)
104 @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
dd714b8a 105 @mkdir $(DIR_SRC)/gcc-build
cd1a2927 106ifeq "$(ROOT)" ""
dd714b8a 107
cd1a2927 108else
15679d9f 109ifeq "$(PASS)" "1"
cd1a2927 110 cd $(DIR_SRC)/gcc-build && /bin/bash $(DIR_APP)/configure $(EXTRA_CONFIG)
dd714b8a 111 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
cd1a2927 112 cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
dd714b8a 113 ln -vs gcc /tools/bin/cc
cd1a2927 114else
dd714b8a
MT
115 cd $(DIR_APP) && cp -v gcc/Makefile.in{,.orig}
116 cd $(DIR_APP) && sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in
117 cd $(DIR_APP) && cp -v gcc/Makefile.in{,.tmp}
118 #cd $(DIR_APP) && sed 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp > gcc/Makefile.in
119 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/gcc-4.0.3-specs-1.patch
120 cd $(DIR_SRC)/gcc-build && /bin/bash $(DIR_APP)/configure $(EXTRA_CONFIG)
121 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
122 cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
cd1a2927 123endif
cd1a2927
MT
124endif
125 @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build
126 @$(POSTBUILD)