From 9c195bf5d86d67ea5eb419ccf6e48dc153e57c68 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 4 Nov 2014 20:14:19 +0100 Subject: Move sources to src/ subdirectory. --- src/ortho/gcc/Makefile | 86 ++ src/ortho/gcc/Makefile.conf.linux | 4 + src/ortho/gcc/lang.opt | 96 ++ src/ortho/gcc/ortho-lang.c | 2191 +++++++++++++++++++++++++++++++++++ src/ortho/gcc/ortho_gcc-main.adb | 42 + src/ortho/gcc/ortho_gcc-main.ads | 1 + src/ortho/gcc/ortho_gcc.adb | 121 ++ src/ortho/gcc/ortho_gcc.ads | 701 +++++++++++ src/ortho/gcc/ortho_gcc.private.ads | 269 +++++ src/ortho/gcc/ortho_gcc_front.ads | 2 + src/ortho/gcc/ortho_ident.adb | 56 + src/ortho/gcc/ortho_ident.ads | 30 + src/ortho/gcc/ortho_nodes.ads | 3 + 13 files changed, 3602 insertions(+) create mode 100644 src/ortho/gcc/Makefile create mode 100644 src/ortho/gcc/Makefile.conf.linux create mode 100644 src/ortho/gcc/lang.opt create mode 100644 src/ortho/gcc/ortho-lang.c create mode 100644 src/ortho/gcc/ortho_gcc-main.adb create mode 100644 src/ortho/gcc/ortho_gcc-main.ads create mode 100644 src/ortho/gcc/ortho_gcc.adb create mode 100644 src/ortho/gcc/ortho_gcc.ads create mode 100644 src/ortho/gcc/ortho_gcc.private.ads create mode 100644 src/ortho/gcc/ortho_gcc_front.ads create mode 100644 src/ortho/gcc/ortho_ident.adb create mode 100644 src/ortho/gcc/ortho_ident.ads create mode 100644 src/ortho/gcc/ortho_nodes.ads (limited to 'src/ortho/gcc') diff --git a/src/ortho/gcc/Makefile b/src/ortho/gcc/Makefile new file mode 100644 index 000000000..5aafb31c7 --- /dev/null +++ b/src/ortho/gcc/Makefile @@ -0,0 +1,86 @@ +ortho_srcdir=.. +orthobe_srcdir=$(ortho_srcdir)/gcc +agcc_objdir=. +agcc_srcdir=$(ortho_srcdir)/gcc +SED=sed +BE=gcc +GNATMAKE=gnatmake +CC=gcc +CXX=g++ +COMPILER=$(CXX) +LINKER=$(CXX) + +# Modify AGCC_GCCSRC_DIR and AGCC_GCCOBJ_DIR for your environment +AGCC_GCCSRC_DIR:=$(HOME)/Projects/gcc4.9.2/source/gcc-4.9.2/ +AGCC_GCCOBJ_DIR:=$(HOME)/Projects/gcc4.9.2/build/ + +# Supplied by main GCC Makefile, copied here for compatibility with same +GMPLIBS = -L$(AGCC_GCCOBJ_DIR)./gmp/.libs -L$(AGCC_GCCOBJ_DIR)./mpfr/.libs \ + -L$(AGCC_GCCOBJ_DIR)./mpc/src/.libs -lmpc -lmpfr -lgmp +GMPINC = -I$(AGCC_GCCOBJ_DIR)./gmp -I$(AGCC_GCCSRC_DIR)/gmp \ + -I$(AGCC_GCCOBJ_DIR)./mpfr -I$(AGCC_GCCSRC_DIR)/mpfr \ + -I$(AGCC_GCCSRC_DIR)/mpc/src + +HOST_LIBS = +ZLIB=-lz + +# Override variables in Makefile.conf for your environment +-include $(orthobe_srcdir)/Makefile.conf + +all: $(ortho_exec) + +ORTHO_BASENAME=ortho_gcc +include $(ortho_srcdir)/Makefile.inc + +AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \ + -I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \ + -I$(AGCC_GCCSRC_DIR)/libcpp/include $(GMPINC) +AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) + +ortho-lang.o: $(agcc_srcdir)/ortho-lang.c \ + $(AGCC_GCCOBJ_DIR)gcc/gtype-vhdl.h \ + $(AGCC_GCCOBJ_DIR)gcc/gt-vhdl-ortho-lang.h + $(COMPILER) -c -o $@ $< $(AGCC_CFLAGS) $(INCLUDES) + +AGCC_LOCAL_OBJS=ortho-lang.o + +AGCC_DEPS := $(AGCC_LOCAL_OBJS) +AGCC_OBJS := $(AGCC_LOCAL_OBJS) \ + $(AGCC_GCCOBJ_DIR)gcc/attribs.o \ + $(AGCC_GCCOBJ_DIR)libcpp/libcpp.a \ + $(AGCC_GCCOBJ_DIR)libiberty/libiberty.a + +LIBBACKTRACE = $(AGCC_GCCOBJ_DIR)/libbacktrace/.libs/libbacktrace.a +LIBDECNUMBER = $(AGCC_GCCOBJ_DIR)/libdecnumber/libdecnumber.a +LIBIBERTY = $(AGCC_GCCOBJ_DIR)/libiberty/libiberty.a +CPPLIB= # Not needed for GHDL + +BACKEND = $(AGCC_GCCOBJ_DIR)/gcc/libbackend.a \ + $(AGCC_GCCOBJ_DIR)/gcc/libcommon-target.a + +BACKENDLIBS = $(CLOOGLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ + $(ZLIB) +LIBS = $(AGCC_GCCOBJ_DIR)/gcc/libcommon.a \ + $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \ + $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS) + +$(ortho_exec): $(AGCC_DEPS) $(orthobe_srcdir)/ortho_gcc.ads force + $(GNATMAKE) -m -o $@ -g -aI$(ortho_srcdir) \ + -aI$(ortho_srcdir)/gcc $(GNAT_FLAGS) ortho_gcc-main \ + -bargs -E -largs --LINK=$(LINKER) $(AGCC_OBJS) \ + $(BACKEND) $(LIBS) $(BACKENDLIBS) + +agcc-clean: force + $(RM) -f $(agcc_objdir)/*.o + $(RM) -f $(agcc_srcdir)/*~ + +clean: agcc-clean + $(RM) -f *.o *.ali ortho_nodes-main + $(RM) b~*.ad? *~ + +distclean: clean agcc-clean + + +force: + +.PHONY: force all clean agcc-clean diff --git a/src/ortho/gcc/Makefile.conf.linux b/src/ortho/gcc/Makefile.conf.linux new file mode 100644 index 000000000..00ea91728 --- /dev/null +++ b/src/ortho/gcc/Makefile.conf.linux @@ -0,0 +1,4 @@ +# Example Makefile.conf +# Copy this file to Makefile.conf and edit as necessary for your platform + +HOST_LIBS = -ldl -lstdc++ diff --git a/src/ortho/gcc/lang.opt b/src/ortho/gcc/lang.opt new file mode 100644 index 000000000..562fbe08d --- /dev/null +++ b/src/ortho/gcc/lang.opt @@ -0,0 +1,96 @@ +Language +vhdl + +-std= +vhdl Joined +Select the vhdl standard + +-compile-standard +vhdl +Used during compiler build to compile the std.standard package + +-bootstrap +vhdl +Used during compiler build to compile std packages + +-work= +vhdl Joined +Set the name of the work library + +-workdir= +vhdl Joined +Set the directory of the work library + +P +vhdl JoinedOrMissing +;-P Add to the end of the vhdl library path + +-elab +vhdl Separate +--elab Used internally during elaboration of + +-anaelab +vhdl Separate +--anaelab Used internally during elaboration of + +; -c is a driver option for gcc. --ghdl-source is used instead. +;c +;vhdl Separate +;-c Analyze for --anaelab + +;v +;vhdl +;Verbose + +-warn- +vhdl Joined +--warn- Warn about + +-ghdl +vhdl Joined +--ghdl-