MIPS_CC = mips-unknown-elf-gcc
MIPS_CXX = mips-unknown-elf-g++
MIPS_G77 = mips-unknown-elf-g77
+MIPS_PC = mips-unknown-elf-gpc
# Be VERY careful about changing any of these as they can break binary
# compatibility and create hard to find bugs
-freduce-all-givs
MIPS_CFLAGS = $(mips_optflags) $(flags) -I. -Wall -Wno-unused -Werror
+MIPS_CXXFLAGS = $(MIPS_CFLAGS)
+MIPS_PCFLAGS = $(MIPS_CFLAGS) --big-endian
MIPS_LD = mips-unknown-elf-gcc
MIPS_LDFLAGS= $(flags) --static -Wl,--gc-sections
MIPS_STRIP = mips-unknown-elf-strip
build/%.mips: src/%.cc $(tasks)/build_gcc_step2 $(tasks)/build_libc
@mkdir -p `dirname $@`
- $(MIPS_CXX) $(MIPS_CFLAGS) $($(notdir $*)_CFLAGS) $(MIPS_LDFLAGS) $($(notdir $*)_LDFLAGS) -o $@ $<
+ $(MIPS_CXX) $(MIPS_CXXFLAGS) $($(notdir $*)_CXXFLAGS) $(MIPS_LDFLAGS) $($(notdir $*)_LDFLAGS) -o $@ $<
+
+build/%.mips: src/%.pas $(tasks)/build_gpc
+ @mkdir -p `dirname $@`
+ $(MIPS_PC) $(MIPS_PCFLAGS) $($(notdir $*)_PCFLAGS) $(MIPS_LDFLAGS) $($(notdir $*)_LDFLAGS) -o $@ $<
build/%.mips.stripped: build/%.mips $(tasks)/build_linker
cp $< $@
fdtest: build/tests/FDTest.class
$(JAVA) -cp build tests.FDTest
+# Pascal Test
+pascaltest: build/tests/PascalHello.class
+ $(JAVA) -cp build tests.PascalHello
# Simple
Simple_LDFLAGS = -nostdlib
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++"
+version_gpc = 20030830
+url_gpc = http://www.gnu-pascal.de/alpha/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"
+
version_binutils = 2.14
url_binutils = ftp://ftp.gnu.org/gnu/binutils/binutils-$(version_binutils).tar.gz
patches_binutils = binutils-no64.patch binutils-nocompilein.patch
$(MAKE) install
touch $@
+tasks/extract_gpc: tasks/download_gcc tasks/download_gpc
+ mkdir -p build/gpc.extract
+ cd build/gpc.extract && \
+ gzip -dc ../../download/gcc-core-$(version_gcc).tar.gz | tar xf - && \
+ gzip -dc ../../download/gpc-$(version_gpc).tar.gz | tar xf - && \
+ test ! -e gcc-$(version_gcc)/gcc/p && \
+ mv gpc-$(version_gpc)/p gcc-$(version_gcc)/gcc/p
+ mv build/gpc.extract/gcc-$(version_gcc) build/gpc-$(version_gpc)
+ rm -rf build/gpc.extract
+ touch $@
+
+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
+ 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
+ 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
@mkdir -p $(usr)/mips-unknown-elf/{include,lib}
cd build && gzip -dc ../download/openbsdglob.tar.gz | tar xf -
--- /dev/null
+--- gcc/p/Make-lang.in.orig 2004-05-21 03:22:35.000000000 -0400
++++ gcc/p/Make-lang.in 2004-05-21 03:24:03.000000000 -0400
+@@ -374,8 +374,8 @@
+ MAKEINFO_ES=LANG=es_ES LC_ALL=es_ES $(MAKEINFO) $(MAKEINFOFLAGS) $(GPC_DOC_DIRS_ES)
+
+ # Define the names for selecting Pascal in LANGUAGES.
+-Pascal pascal: xgpc$(exeext) gpc1$(exeext) gpcpp$(exeext) gpc-run pascal.utils \
+- pascal.rts specs pascal.generated-files pascal.docdemos
++Pascal pascal: xgpc$(exeext) gpc1$(exeext) gpcpp$(exeext) gpc-run \
++ pascal.rts specs pascal.generated-files
+
+ # Tell GNU make to ignore these if they exist.
+ .PHONY: Pascal pascal
+@@ -1026,7 +1026,7 @@
+ fi; exit 0
+
+ pascal.install-normal: pascal.install-common pascal.install-compiler \
+- install-gpcpp pascal.install-utils pascal.install-lib pascal.install-man \
++ install-gpcpp pascal.install-lib pascal.install-man \
+ pascal.install-info pascal.install-units pascal.install-doc
+
+ # This target will install GPC into an existing GCC installation,
--- /dev/null
+--- gcc/p/diffs/gcc-3.3.diff~ 2004-05-21 02:17:02.000000000 -0400
++++ gcc/p/diffs/gcc-3.3.diff 2004-05-21 02:17:02.000000000 -0400
+@@ -727,22 +727,3 @@
+ abort ();
+ }
+
+-*** gcc/varasm.c Sat Aug 16 19:06:03 2003
+---- gcc/varasm.c Sat Aug 16 19:04:13 2003
+-***************
+-*** 2411,2417 ****
+- if (get_set_constructor_bytes (t2, tmp2, len) != NULL_TREE)
+- return 0;
+-
+-! return memcmp (tmp1, tmp2, len) != 0;
+- }
+- else
+- {
+---- 2411,2417 ----
+- if (get_set_constructor_bytes (t2, tmp2, len) != NULL_TREE)
+- return 0;
+-
+-! return memcmp (tmp1, tmp2, len) == 0;
+- }
+- else
+- {