# Inspired by XWT's Makefile.upstream
-version_gcc = 3.3.3
+version_gcc = 3.3.6
-url_gcc-core = http://mirrors.kernel.org/gnu/gcc/releases/gcc-$(version_gcc)/gcc-core-$(version_gcc).tar.gz
-url_gcc-c++ = http://mirrors.kernel.org/gnu/gcc/releases/gcc-$(version_gcc)/gcc-g++-$(version_gcc).tar.gz
-url_gcc-g77 = http://mirrors.kernel.org/gnu/gcc/releases/gcc-$(version_gcc)/gcc-g77-$(version_gcc).tar.gz
+url_gcc-core = http://mirrors.kernel.org/gnu/gcc/gcc-$(version_gcc)/gcc-core-$(version_gcc).tar.gz
+url_gcc-c++ = http://mirrors.kernel.org/gnu/gcc/gcc-$(version_gcc)/gcc-g++-$(version_gcc).tar.gz
+url_gcc-g77 = http://mirrors.kernel.org/gnu/gcc/gcc-$(version_gcc)/gcc-g77-$(version_gcc).tar.gz
-patches_gcc = gcc-fixes.patch gcc-fdata-sections-bss.patch gcc-64bitclean.patch
+patches_gcc = gcc-fixes.patch gcc-fdata-sections-bss.patch gcc-64bitclean.patch gcc-3.3.6-fortran.patch
configure_gcc = --target=mips-unknown-elf --disable-threads --with-gnu-ld --with-gnu-as --with-newlib=yes --enable-sjlj-exceptions --enable-languages="c"
configure_gcc_step2 = $(configure_gcc) --enable-languages="c,c++,f77"
version_newlib = 1.11.0
url_newlib = ftp://sources.redhat.com/pub/newlib/newlib-$(version_newlib).tar.gz
-patches_newlib = newlib-mips.patch newlib-tzset.patch newlib-malloc.patch newlib-nomemcpy.patch newlib-unix.patch
+patches_newlib = newlib-mips.patch newlib-tzset.patch newlib-malloc.patch newlib-nomemcpy.patch newlib-unix.patch newlib-unistd.patch
configure_newlib = --enable-multilib --target=mips-unknown-elf
url_openbsdglob = http://www.brianweb.net/xwt/openbsdglob.tar.gz
url_regex = http://arglist.com/regex/regex3.8a.tar.gz
url_linpack = http://www.math.iastate.edu/burkardt/f_src/linpack_bench/linpack_bench.f
+version_zlib = 1.2.3
+url_zlib = http://www.zlib.net/zlib-$(version_zlib).tar.gz
+
+version_expat = 2.0.0
+url_expat = http://umn.dl.sourceforge.net/sourceforge/expat/expat-$(version_expat).tar.gz
+configure_expat = --host= --target=mips-unknown-elf
version_gmp = 4.1.4
url_gmp = ftp://ftp.gnu.org/gnu/gmp/gmp-$(version_gmp).tar.gz
$(MAKE) install
touch $@
+tasks/build_zlib: tasks/patch_zlib
+ mkdir -p $(usr)
+ cd build/zlib-$(version_zlib) && \
+ AR="mips-unknown-elf-ar rc" CC=mips-unknown-elf-gcc ./configure --prefix=$(usr) $(configure_$*) && \
+ $(MAKE) TARGET_CFLAGS="$(MIPS_CFLAGS)" && \
+ $(MAKE) install
+ touch $@
+
tasks/build_gcc_step2: tasks/patch_gcc tasks/build_libc
mkdir -p $(usr)
mkdir -p build/gcc-obj && cd build/gcc-obj && \