]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - lfs/gcc
firewall: Remove redundant rule.
[people/teissler/ipfire-2.x.git] / lfs / gcc
diff --git a/lfs/gcc b/lfs/gcc
index 5232df40848a7e369bd3770a3e9d0d7a90628f98..a9f124b8cee0a393baa355d5acec5d44fd53db51 100644 (file)
--- a/lfs/gcc
+++ b/lfs/gcc
@@ -34,18 +34,24 @@ DL_FILE    = $(THISAPP).tar.bz2
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 
+CFLAGS    := $(patsubst -march=%,,$(CFLAGS))
+CFLAGS    := $(patsubst -mtune=%,,$(CFLAGS))
+CFLAGS    := $(patsubst -mfloat-abi=%,,$(CFLAGS))
+
 # Normal build or /tools build.
 #
 ifeq "$(ROOT)" ""
   TARGET = $(DIR_INFO)/$(THISAPP)
-  EXTRA_CONFIG = --prefix=/usr \
-               --libexecdir=/usr/lib \
-               --enable-shared \
-               --enable-threads=posix \
-               --enable-__cxa_atexit \
-               --enable-clocale=gnu \
-               --enable-languages=c,c++ \
-               --disable-nls
+  EXTRA_CONFIG = \
+       --prefix=/usr \
+       --libexecdir=/usr/lib \
+       --enable-shared \
+       --enable-threads=posix \
+       --enable-__cxa_atexit \
+       --enable-clocale=gnu \
+       --enable-languages=c,c++ \
+       --disable-bootstrap \
+       --disable-nls
   EXTRA_MAKE =
   EXTRA_INSTALL =
 else
@@ -95,9 +101,21 @@ endif
 
 ifeq "$(MACHINE_TYPE)" "arm"
        EXTRA_CONFIG += \
-               --with-float=soft
+               --with-float=soft \
+               --disable-sjlj-exceptions
+endif
+
+ifeq "$(MACHINE)" "i586"
+       EXTRA_CONFIG += \
+               --with-arch=i586 \
+               --with-tune=generic
 endif
 
+EXTRA_CONFIG += \
+       --with-bugurl=http://bugtracker.ipfire.org \
+       --disable-libunwind-exceptions \
+       --enable-gnu-unique-object
+
 export XCFLAGS = $(CFLAGS)
 export TCFLAGS = $(CFLAGS)
 
@@ -147,6 +165,21 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
        @mkdir $(DIR_SRC)/gcc-build
 
+       # Apply patches.
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-build-id.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-c++-builtin-redecl.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-i386-libgomp.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-libtool-no-rpath.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-no-add-needed.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-pr33763.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-rh330771.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-rh533181.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-rh610785.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-unwind-debug-hook.patch
+
+       # texinfo 5 syntax-fixes
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gcc-4.4.7-texinfo-5.patch
+
 ifneq "$(ROOT)" ""
        # Build gmp and mpfr internally in toolchain.
        cd $(DIR_APP) && tar xfa $(DIR_DL)/gmp-$(GMP_VER).tar.bz2
@@ -163,10 +196,6 @@ endif
 ifeq    "$(PASS)" "2"
        cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/gcc-4.4.3-startfiles_fix-1.patch
 
-       cd $(DIR_APP) && sed -i gcc/Makefile.in \
-               -e 's@\./fixinc\.sh@-c true@' \
-               -e 's/^T_CFLAGS =$$/& -fomit-frame-pointer/'
-
        for file in $$(find $(DIR_APP)/gcc/config -name linux64.h -o -name linux.h \
                        -o -name sysv4.h -o -name linux-eabi.h -o -name linux-elf.h); do \
                echo "Processing $${file}..."; \
@@ -181,6 +210,11 @@ ifeq    "$(PASS)" "2"
 endif
 endif
 
+       cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
+       cd $(DIR_APP) && sed -i gcc/Makefile.in \
+               -e 's@\./fixinc\.sh@-c true@' \
+               -e 's/^T_CFLAGS =$$/& -fomit-frame-pointer/'
+
        # The actual build.
        cd $(DIR_SRC)/gcc-build && \
                $(EXTRA_ENV) \
@@ -189,7 +223,10 @@ endif
        cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
        cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
 
-ifneq "$(ROOT)" ""
+ifeq "$(ROOT)" ""
+       ln -svf ../usr/bin/cpp /lib
+       ln -svf gcc /usr/bin/cc
+else
 ifeq    "$(PASS)" "1"
        ln -svf libgcc.a $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/')
 else