+version_libpng = 1.5.10
+url_libpng = $(sourceforge)libpng/libpng-$(version_libpng).tar.gz
+configure_libpng = --disable-shared --host=mips-unknown-elf
+
+tasks/build_libpng: tasks/build_zlib tasks/patch_libpng tasks/build_libc
+ mkdir -p $(usr)
+ cd build/libpng-$(version_libpng) && \
+ CPPFLAGS=-I$(usr)/include LDFLAGS=-L$(usr)/lib ./configure --prefix=$(usr) $(configure_libpng) && \
+ $(MAKE) TARGET_CFLAGS="$(MIPS_CFLAGS)" && \
+ $(MAKE) install
+ touch $@
+
+## libiconv ##############################################################################
+
+version_libiconv = 1.14
+url_libiconv = http://ftp.gnu.org/gnu/libiconv/libiconv-$(version_libiconv).tar.gz
+configure_libiconv = --disable-shared --host=mips-unknown-elf
+
+tasks/build_libiconv: tasks/patch_libiconv tasks/build_libc
+ mkdir -p $(usr)
+ cd build/libiconv-$(version_libiconv) && \
+ ./configure --prefix=$(usr) $(configure_libiconv) && \
+ $(MAKE) TARGET_CFLAGS="$(MIPS_CFLAGS)" && \
+ $(MAKE) install
+ touch $@
+
+## gd ##############################################################################
+
+version_gd = 2.0.35
+url_gd = http://www.chipsnbytes.net/downloads/gd-$(version_gd).tar.gz
+configure_gd = --disable-shared --host=mips-unknown-elf
+
+tasks/build_gd: tasks/build_freetype tasks/patch_gd tasks/build_libc
+ mkdir -p $(usr)
+ cd build/gd-$(version_gd) && \
+ CPPFLAGS=-I$(usr)/include/freetype2 LDFLAGS=-L$(usr)/lib ./configure --prefix=$(usr) $(configure_gd) && \
+ $(MAKE) TARGET_CFLAGS="$(MIPS_CFLAGS)" && \
+ $(MAKE) install
+ touch $@
+
+
+## expat ##############################################################################
+
+version_expat = 2.0.0
+url_expat = $(sourceforge)expat/expat-$(version_expat).tar.gz
+configure_expat = --host= --target=mips-unknown-elf
+
+## gmp ##############################################################################
+
+version_gmp = 4.1.4
+url_gmp = ftp://ftp.gnu.org/gnu/gmp/gmp-$(version_gmp).tar.gz
+configure_gmp = --host=mips-unknown-elf
+
+tasks/build_gmp: tasks/patch_gmp tasks/build_libc
+ cd build/gmp && \
+ CFLAGS="$(MIPS_CFLAGS)" LDFLAGS="$(MIPS_LDFLAGS)" \
+ ./configure --prefix=$(usr) $(configure_gmp) && \
+ make && \
+ make install exec_prefix=$(usr)/mips-unknown-elf includedir=$(usr)/mips-unknown-elf/include
+ touch $@
+
+
+## nasm ##############################################################################
+
+version_nasm = 0.98.39
+url_nasm = $(sourceforge)nasm/nasm-$(version_nasm).tar.gz
+configure_nasm = --host=mips-unknown-elf
+
+
+# Add our support stuff to libc
+tasks/build_libc: tasks/build_newlib tasks/build_extraheaders tasks/build_regex tasks/build_openbsdglob misc/extraheaders.sh $(top_lev_stuff)
+ mips-unknown-elf-ar sr $(cross_root)/lib/libc.a $(patsubst %,../build/org/ibex/nestedvm/%.o, support support_aux)
+ mips-unknown-elf-ar sr $(cross_root)/lib/single-float/libc.a $(patsubst %,../build/org/ibex/nestedvm/%.o, support support_aux)
+ rm -f $(cross_root)/lib/crt0.o
+ cp $(root)/build/org/ibex/nestedvm/crt0.o $(cross_root)/lib/crt0.o
+
+ touch $@
+
+tasks/build_linker: tasks/build_binutils $(root)/src/org/ibex/nestedvm/linker.ld
+ cp $(root)/src/org/ibex/nestedvm/linker.ld $(cross_root)/lib/ldscripts/nestedvm.ld
+ for f in $(cross_root)/lib/ldscripts/elf32ebmip.*; do \
+ rm -f "$$f"; \
+ ln -s nestedvm.ld "$$f"; \
+ done
+ touch $@
+
+
+
+
+
+## libjpeg ##############################################################################
+
+version_libjpeg = 7
+url_libjpeg = http://www.ijg.org/files/jpegsrc.v$(version_libjpeg).tar.gz