# Inspired by XWT's Makefile.upstream
-version_gcc = 3.3.3
+sourceforge = http://softlayer.dl.sourceforge.net/sourceforge/
-url_gcc-core = http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(version_gcc)/gcc-core-$(version_gcc).tar.gz
-url_gcc-c++ = http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(version_gcc)/gcc-g++-$(version_gcc).tar.gz
-url_gcc-g77 = http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(version_gcc)/gcc-g77-$(version_gcc).tar.gz
+version_gcc = 3.3.6
-patches_gcc = gcc-fixes.patch gcc-fdata-sections-bss.patch
+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 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_gpc = 20030830
-url_gpc = http://www.gnu-pascal.de/alpha/gpc-$(version_gpc).tar.gz
+#url_gpc = http://www.gnu-pascal.de/alpha/gpc-$(version_gpc).tar.gz
+url_gpc = http://www.megacz.com/upstream/gpc-$(version_gpc).tar.gz
patches_gpc = $(patches_gcc) gpc-with-3.3.3.patch gpc-noutils.patch
configure_gpc = $(configure_gcc) --enable-languages="pascal"
configure_binutils = --target=mips-unknown-elf
version_newlib = 1.11.0
-url_newlib = http://mirrors.rcn.net/pub/sourceware/newlib/newlib-$(version_newlib).tar.gz
-patches_newlib = newlib-mips.patch newlib-tzset.patch newlib-malloc.patch newlib-vasprintf.patch newlib-nomemcpy.patch
+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 newlib-unistd.patch newlib-nestedvm-define.patch
configure_newlib = --enable-multilib --target=mips-unknown-elf
url_openbsdglob = http://www.brianweb.net/xwt/openbsdglob.tar.gz
-url_regex = ftp://ftp.zoo.toronto.edu/pub/regex.shar
+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 = $(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
+configure_gmp = --host=mips-unknown-elf
+
darcs_gcclass = http://darcs.brianweb.net/gcclass
darcs_classgen = http://darcs.brianweb.net/classgen
tasks/download_%:
if [ -z "$(url_$*)" ]; then echo "No url for $*" >&2; false; fi
mkdir -p download
- cd download && wget --passive-ftp -N $(url_$*)
+ cd download && curl -O $(url_$*)
touch $@
tasks/extract_%: tasks/download_%
- @[ -e $@ ] && echo "$@ already exists... something isn't right"
+ if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi
mkdir -p build
cd build && \
gzip -dc ../download/$*-$(version_$*).tar.gz | $(TAR) -xf - && \
touch $@
tasks/extract_darcs_%:
- @[ -e $@ ] && echo "$@ already exists... something isn't right"
+ if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi
mkdir -p build
if [ -z "$(darcs_$*)" ]; then echo "No darcs url for $*" >&2; false; fi
if [ -d "$(root)/_darcs" ]; then \
else \
cd "build/$*" && wget -np -nH --cut-dirs=1 -rl 16 -N -X _darcs $(darcs_$*); \
fi
- rm "tasks/build_darcs_$*" # to force a rebuild
+ rm -f "tasks/build_darcs_$*" # to force a rebuild
tasks/build_darcs_%: tasks/extract_darcs_%
cd "build/$*" && $(MAKE)
touch $@
+# Add extra nestedvm specific headers to include
tasks/build_extraheaders: $(upstream)/misc/extraheaders.sh tasks/build_newlib
- # Add extra nestedvm specific headers to include
+
cd $(cross_root)/include && sh $<
touch $@
top_lev_stuff := $(patsubst %,../build/org/ibex/nestedvm/%.o, crt0 support support_aux)
+# HACK: Get the top level makefile to build the support stuff
$(top_lev_stuff):
- # HACK: Get the top level makefile to build the support stuff
$(MAKE) -C .. $(top_lev_stuff:../%=%)
+# 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)
- # Add our support stuff to libc
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
touch $@
tasks/extract_gcc: tasks/download_gcc
- @[ -e $@ ] && echo "$@ already exists... something isn't right"
+ if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi
mkdir -p build
cd build && gzip -dc ../download/gcc-core-$(version_gcc).tar.gz | $(TAR) -xf -
cd build && gzip -dc ../download/gcc-g++-$(version_gcc).tar.gz | $(TAR) -xf -
touch $@
tasks/patch_%: tasks/extract_%
- @[ -e $@ ] && echo "$@ already exists... something isn't right"
+ if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi
cd build/$*-$(version_$*) && \
for p in $(patches_$*) end; do \
- [ "$$p" = "end" ] || $(PATCH) -p0 < ../../patches/$$p || exit 1; \
+ [ "$$p" = "end" ] || $(PATCH) -p0 -l < ../../patches/$$p || exit 1; \
done
touch $@
$(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 && \
touch $@
tasks/extract_gpc: tasks/download_gcc tasks/download_gpc
- @[ -e $@ ] && echo "$@ already exists... something isn't right"
+ if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi
mkdir -p build/gpc.extract
cd build/gpc.extract && \
gzip -dc ../../download/gcc-core-$(version_gcc).tar.gz | $(TAR) -xf - && \
tasks/build_gpc: tasks/patch_gpc tasks/build_libc
mkdir -p $(usr)
- # We need to preapply this patch because gpc's configury doesn't like 3.3.3
+ # We need to preapply this patch because gpc's configury doesn't like 3.3.3
cd build/gpc-$(version_gpc) && cat gcc/version.c | grep -q GPC || $(PATCH) -p0 < gcc/p/diffs/gcc-3.3.diff
-
- # echo | is to dismiss the gcc version warning
+
+ # echo | is to dismiss the gcc version warning
mkdir -p build/gpc-obj && cd build/gpc-obj && \
echo | ../gpc-$(version_gpc)/configure --prefix=$(usr) $(configure_gpc) && \
$(MAKE) TARGET_CFLAGS="$(MIPS_CFLAGS)" && \
cd gcc && $(MAKE) pascal.install
-
+
touch $@
tasks/build_openbsdglob: tasks/download_openbsdglob tasks/build_newlib
tasks/build_regex: tasks/download_regex tasks/build_newlib
@mkdir -p $(usr)/mips-unknown-elf/{include,lib}
mkdir -p build/regex build/regex/fake
- cd build/regex && \
- sh ../../download/regex.shar && \
+ cd build && \
+ tar xvzf ../download/regex3.8a.tar.gz && cd regex && \
make CC=mips-unknown-elf-gcc CFLAGS="-I. $(MIPS_CFLAGS)" regcomp.o regexec.o regerror.o regfree.o && \
mips-unknown-elf-ar cr libregex.a regcomp.o regexec.o regerror.o regfree.o && \
mips-unknown-elf-ranlib libregex.a && \
cp libregex.a $(usr)/mips-unknown-elf/lib
touch $@
+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 $@
#
# Tests
patches_libmspack = libmspack.patch
version_freetype = 2.1.4
-url_freetype = http://umn.dl.sourceforge.net/sourceforge/freetype/freetype-$(version_freetype).tar.gz
+url_freetype = $(sourceforge)freetype/freetype-$(version_freetype).tar.gz
patches_freetype = freetype.patch ft-nostdio.patch
version_boehmgc = 6.3alpha2
-url_boehmgc = http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc$(version_boehmgc).tar.gz
+#url_boehmgc = http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc$(version_boehmgc).tar.gz
+url_boehmgc = http://www.brianweb.net/misc/gc$(version_boehmgc).tar.gz
patches_boehmgc = boehm-gc.patch
version_busybox = 1.00-pre9
version_texinputs = 1.0
url_texinputs = http://www.megacz.com/tmp/texinputs-$(version_texinputs).tgz
+version_samba = 3.0.4
+url_samba = http://us4.samba.org/samba/ftp/samba-$(version_samba).tar.gz
+patches_samba = samba.patch
+
tasks/extract_libjpeg: tasks/download_libjpeg
mkdir -p build
cd build && \
tasks/extract_tex_tangle:
@mkdir -p build/tex
- cd build/tex && \
- curl -o tex.web http://www.math.uni.wroc.pl/~hebisch/tex_p/tex.web && \
- curl http://www.gnu-pascal.de/crystal/gpc/en/attachments/5593/tangle.p.gz | zcat > tangle.p
+ cd build/tex && curl -o tex.web http://www.math.uni.wroc.pl/~hebisch/tex_p/tex.web
touch $@
tasks/build_tex_tangle: tasks/extract_tex_tangle tasks/build_gpc
tasks/build_tex: tasks/build_tex_tangle tasks/build_gpc tasks/download_texinputs
@mkdir -p build/tex
-
- # HACK: Build Tangel.class
+
+ # HACK: Build Tangel.class
make -C $(root) build/tests/Tangle.class
-
+
rm -f build/tex/tex.p build/tex/tex.pool
cp misc/tex.ch build/tex/tex.ch
cd build/tex && \
&& \
mips-unknown-elf-gpc $(MIPS_PCFLAGS) tex.p $(MIPS_LDFLAGS) -o tex.mips
touch $@
+
+tasks/build_samba: tasks/patch_samba
+ cd build/samba-$(version_samba)/source && \
+ test -e config.status || ./configure --host=mips-unknown-elf && \
+ fgrep -q '#define HAVE_GETTIMEOFDAY_TZ' include/config.h || \
+ echo '#define HAVE_GETTIMEOFDAY_TZ 1' >> include/config.h && \
+ make LIBS="-lglob" CFLAGS="$(MIPS_CFLAGS)" LDFLAGS="$(MIPS_LDFLAGS)" \
+ CONFIGFILE="smb.conf" proto_exists bin/ntlm_auth
+ touch $@