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
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)
@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
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}..."; \
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) \
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