aboutsummaryrefslogtreecommitdiffstats
path: root/translate/gcc
diff options
context:
space:
mode:
authorgingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2005-09-24 05:10:24 +0000
committergingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2005-09-24 05:10:24 +0000
commit977ff5e02c6d2f9bfdabcf8b4e98b81e2d83e849 (patch)
tree7bcf8e7aff40a8b54d4af83e90cccd73568e77bb /translate/gcc
downloadghdl-977ff5e02c6d2f9bfdabcf8b4e98b81e2d83e849.tar.gz
ghdl-977ff5e02c6d2f9bfdabcf8b4e98b81e2d83e849.tar.bz2
ghdl-977ff5e02c6d2f9bfdabcf8b4e98b81e2d83e849.zip
First import from sources
Diffstat (limited to 'translate/gcc')
-rw-r--r--translate/gcc/ANNOUNCE21
-rw-r--r--translate/gcc/Make-lang.in182
-rw-r--r--translate/gcc/Makefile.in275
-rw-r--r--translate/gcc/README54
-rw-r--r--translate/gcc/config-lang.in38
-rwxr-xr-xtranslate/gcc/dist.sh670
-rw-r--r--translate/gcc/lang-options.h29
-rw-r--r--translate/gcc/lang-specs.h28
8 files changed, 1297 insertions, 0 deletions
diff --git a/translate/gcc/ANNOUNCE b/translate/gcc/ANNOUNCE
new file mode 100644
index 000000000..7b1060e20
--- /dev/null
+++ b/translate/gcc/ANNOUNCE
@@ -0,0 +1,21 @@
+I am happy to introduce GHDL.
+
+GHDL is a GCC front-end for the VHDL (IEEE 1076) language, an hardware design
+language.
+
+Currently, GHDL implements most of VHDL-1987 and some features of
+VHDL-1993. It is mature enough to compile and run some complex design (such
+as a DLX processor and leon1, a SPARCv7 processor)
+
+GHDL has been developped on a GNU/Linux x86 system, and only this configuration
+has been tested (porting to other processor or system should not be an hard
+task, but there are system dependent files in the run time).
+
+GHDL is written in Ada95 (using GNAT) and relies on agcc, an Ada
+binding for GCC. It also includes a run-time library (written in Ada), named
+grt. The front-end and the library are both distributed under the GPL licence.
+
+For sources, binary tarballs, or for more information, go to
+http://ghdl.free.fr
+
+Tristan Gingold.
diff --git a/translate/gcc/Make-lang.in b/translate/gcc/Make-lang.in
new file mode 100644
index 000000000..2aa27a1e0
--- /dev/null
+++ b/translate/gcc/Make-lang.in
@@ -0,0 +1,182 @@
+# Top level -*- makefile -*- fragment for vhdl (GHDL).
+# Copyright (C) 2002
+# Free Software Foundation, Inc.
+
+#This file is part of GNU CC.
+
+#GNU CC is free software; you can redistribute it and/or modify
+#it under the terms of the GNU General Public License as published by
+#the Free Software Foundation; either version 2, or (at your option)
+#any later version.
+
+#GNU CC is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#GNU General Public License for more details.
+
+#You should have received a copy of the GNU General Public License
+#along with GNU CC; see the file COPYING. If not, write to
+#the Free Software Foundation, 59 Temple Place - Suite 330,
+#Boston, MA 02111-1307, USA.
+
+# This file provides the language dependent support in the main Makefile.
+# Each language makefile fragment must provide the following targets:
+#
+# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
+# foo.info, foo.dvi,
+# foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
+# foo.uninstall, foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
+# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
+#
+# where `foo' is the name of the language.
+#
+# It should also provide rules for:
+#
+# - making any compiler driver (eg: g++)
+# - the compiler proper (eg: cc1plus)
+# - define the names for selecting the language in LANGUAGES.
+# tool definitions
+MV = mv
+RM = rm -f
+
+# Extra flags to pass to recursive makes.
+GHDL_ADAFLAGS= -Wall -gnata
+VHDL_LIB_DIR=$(libsubdir)/vhdl
+GNATBIND = gnatbind
+GNATMAKE = gnatmake
+VHDL_FLAGS_TO_PASS = \
+ "GHDL_ADAFLAGS=$(GHDL_ADAFLAGS)" \
+ "GNATMAKE=$(GNATMAKE)" \
+ "GNATBIND=$(GNATBIND)" \
+ "CFLAGS=$(CFLAGS)" \
+ "VHDL_LIB_DIR=$(VHDL_LIB_DIR)" \
+ "INSTALL_DATA=$(INSTALL_DATA)" \
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+ "libexecsubdir=$(libexecsubdir)"
+
+MAKE_IN_VHDL=$(MAKE) -C vhdl $(FLAGS_TO_PASS) $(VHDL_FLAGS_TO_PASS)
+
+# Define the names for selecting vhdl in LANGUAGES.
+vhdl VHDL: ghdl1$(exeext) ghdl$(exeext) ghdllib
+
+# Tell GNU Make to ignore these, if they exist.
+.PHONY: vhdl VHDL ghdllib
+
+agcc_srcdir=$(srcdir)/vhdl
+agcc_objdir=.
+
+AGCC_GCCSRC_DIR=$(srcdir)/..
+AGCC_GCCOBJ_DIR=..
+
+####agcc Makefile.inc
+
+# The compiler proper.
+# It is compiled into the vhdl/ subdirectory to avoid file name clashes but
+# linked in in gcc directory to be able to access to gcc object files.
+ghdl1$(exeext): $(AGCC_OBJS) $(AGCC_DEPS) force
+ CURDIR=`pwd`; cd $(srcdir)/vhdl; VHDLSRCDIR=`pwd`; cd $$CURDIR/vhdl; \
+ $(GNATMAKE) -c -aI$$VHDLSRCDIR ortho_gcc-main \
+ -cargs $(CFLAGS) $(GHDL_ADAFLAGS)
+ $(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aOvhdl ortho_gcc-main \
+ -bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \
+ -largs $(AGCC_OBJS) $(LIBS)
+
+# The driver for ghdl.
+ghdl$(exeext): force
+ $(MAKE_IN_VHDL) ../ghdl$(exeext)
+
+# Ghdl libraries.
+ghdllib: ghdl$(exeext) $(GCC_PASSES) force
+ $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib
+
+# Build hooks:
+
+vhdl.all.build:
+
+vhdl.all.cross:
+ @echo "No support for building vhdl cross-compiler"
+ exit 1
+
+vhdl.start.encap:
+vhdl.rest.encap:
+
+# Documentation hooks
+doc/ghdl.info: vhdl/ghdl.texi
+ -rm -f doc/ghdl.info*
+ $(MAKEINFO) $(MAKEINFOFLAGS) -o $@ $<
+
+doc/ghdl.dvi: vhdl/ghdl.texi
+ $(TEXI2DVI) -o $@ $<
+
+vhdl.info: doc/ghdl.info
+
+vhdl.man:
+
+vhdl.dvi: doc/ghdl.dvi
+
+vhdl.generated-manpages:
+
+# Install hooks:
+# ghdl1 is installed elsewhere as part of $(COMPILERS).
+
+vhdl.install-normal:
+
+# Install the driver program as ghdl.
+vhdl.install-common: ghdl$(exeext)
+ -mkdir $(DESTDIR)$(bindir)
+ -$(RM) $(DESTDIR)$(bindir)/ghdl$(exeext)
+ $(INSTALL_PROGRAM) ghdl$(exeext) $(DESTDIR)$(bindir)/ghdl$(exeext)
+# Install the library
+ $(MAKE_IN_VHDL) install-ghdllib
+
+install-info:: $(DESTDIR)$(infodir)/ghdl.info
+
+vhdl.install-info: ghdl.info
+ -rm -rf $(infodir)/ghdl.info*
+ $(INSTALL_DATA) ghdl.info* $(DESTDIR)$(infodir)
+ -chmod a-x $(DESTDIR)$(infodir)/ghdl.info*
+
+install-ghdllib:
+ $(MAKE) -f vhdl/Makefile $(FLAGS_TO_PASS) $(VHDL_FLAGS_TO_PASS) install-ghdllib
+
+vhdl.install-man:
+
+vhdl.uninstall:
+ -$(RM) $(DESTDIR)$(bindir)/ghdl$(exeext)
+
+
+# Clean hooks:
+# A lot of the ancillary files are deleted by the main makefile.
+# We just have to delete files specific to us.
+
+vhdl.mostlyclean:
+ -$(RM) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c
+vhdl.clean: agcc-clean
+vhdl.distclean:
+ -$(RM) vhdl/Makefile
+ -$(RM) ghdl$(exeext)
+vhdl.extraclean:
+
+vhdl.maintainer-clean:
+ $(RM) $(agcc_srcdir)/agcc-trees.ads $(agcc_srcdir)/agcc-hwint.ads
+ $(RM) $(agcc_srcdir)/agcc-hwint.ads $(agcc_srcdir)/agcc-gconfig.ads
+ $(RM) $(agcc_srcdir)/agcc-real.ads $(agcc_srcdir)/agcc-machmode.ads
+ $(RM) $(agcc_srcdir)/agcc-tm.ads
+ $(RM) $(agcc_exedir)/gen_tree.o $(agcc_exedir)/gen_tree
+
+
+# Stage hooks:
+# The main makefile has already created stage?/vhdl
+
+vhdl.stage1:
+ -$(MV) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c stage1/vhdl
+ -$(MV) vhdl/stamp-* stage1/vhdl
+vhdl.stage2:
+ -$(MV) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c stage2/vhdl
+ -$(MV) vhdl/stamp-* stage2/vhdl
+vhdl.stage3:
+ -$(MV) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c stage3/vhdl
+ -$(MV) vhdl/stamp-* stage3/vhdl
+vhdl.stage4:
+ -$(MV) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c stage4/vhdl
+ -$(MV) vhdl/stamp-* stage4/vhdl
diff --git a/translate/gcc/Makefile.in b/translate/gcc/Makefile.in
new file mode 100644
index 000000000..f459e6a09
--- /dev/null
+++ b/translate/gcc/Makefile.in
@@ -0,0 +1,275 @@
+# Makefile for GNU vhdl Compiler (GHDL).
+# Copyright (C) 2002 Free Software Foundation, Inc.
+
+#This file is part of GNU CC.
+
+#GNU CC is free software; you can redistribute it and/or modify
+#it under the terms of the GNU General Public License as published by
+#the Free Software Foundation; either version 2, or (at your option)
+#any later version.
+
+#GNU CC is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#GNU General Public License for more details.
+
+#You should have received a copy of the GNU General Public License
+#along with GNU CC; see the file COPYING. If not, write to
+#the Free Software Foundation, 59 Temple Place - Suite 330,
+#Boston, MA 02111-1307, USA.
+
+# The makefile built from this file lives in the language subdirectory.
+# It's purpose is to provide support for:
+#
+# 1) recursion where necessary, and only then (building .o's), and
+# 2) building and debugging cc1 from the language subdirectory, and
+# 3) nothing else.
+#
+# The parent makefile handles all other chores, with help from the
+# language makefile fragment, of course.
+#
+# The targets for external use are:
+# all, TAGS, ???mostlyclean, ???clean.
+
+# This makefile will only work with Gnu make.
+# The rules are written assuming a minimum subset of tools are available:
+#
+# Required:
+# MAKE: Only Gnu make will work.
+# MV: Must accept (at least) one, maybe wildcard, source argument,
+# a file or directory destination, and support creation/
+# modification date preservation. Gnu mv -f works.
+# RM: Must accept an arbitrary number of space separated file
+# arguments, or one wildcard argument. Gnu rm works.
+# RMDIR: Must delete a directory and all its contents. Gnu rm -rf works.
+# ECHO: Must support command line redirection. Any Unix-like
+# shell will typically provide this, otherwise a custom version
+# is trivial to write.
+# LN: ln -s works, cp should work bu was not tested.
+# CP: GNU cp -p works.
+# AR: Gnu ar works.
+# MKDIR: Gnu mkdir works.
+# CHMOD: Gnu chmod works.
+# true: Does nothing and returns a normal successful return code.
+# pwd: Prints the current directory on stdout.
+# cd: Change directory.
+
+# Tell GNU make 3.79 not to run this directory in parallel.
+# Not all of the required dependencies are present.
+.NOTPARALLEL:
+
+# Variables that exist for you to override.
+# See below for how to change them for certain systems.
+
+ALLOCA =
+# Various ways of specifying flags for compilations:
+# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
+# BOOT_CFLAGS is the value of CFLAGS to pass
+# to the stage2 and stage3 compilations
+# XCFLAGS is used for most compilations but not when using the GCC just built.
+XCFLAGS =
+CFLAGS = -g
+BOOT_CFLAGS = -O $(CFLAGS)
+# These exists to be overridden by the x-* and t-* files, respectively.
+X_CFLAGS =
+T_CFLAGS =
+
+X_CPPFLAGS =
+T_CPPFLAGS =
+
+X_ADAFLAGS =
+T_ADAFLAGS =
+
+CC = cc
+ADAC = $(CC)
+
+ECHO = echo
+CHMOD = chmod
+CP = cp -p
+MV = mv -f
+RM = rm -f
+RMDIR = rm -rf
+MKDIR = mkdir -p
+LN = ln -s
+AR = ar
+# How to invoke ranlib.
+RANLIB = ranlib
+# Test to use to see whether ranlib exists on the system.
+RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
+SHELL = /bin/sh
+INSTALL_DATA = install -m 644
+MAKEINFO = makeinfo
+TEXI2DVI = texi2dvi
+GNATBIND = gnatbind
+GNATMAKE = gnatmake
+ADA_CFLAGS = $(CFLAGS)
+GHDL_ADAFLAGS = -Wall -gnata
+
+objext = .o
+exeext =
+arext = .a
+soext = .so
+shext =
+
+HOST_CC=$(CC)
+HOST_CFLAGS=$(ALL_CFLAGS)
+HOST_CLIB=$(CLIB)
+HOST_LDFLAGS=$(LDFLAGS)
+HOST_CPPFLAGS=$(ALL_CPPFLAGS)
+HOST_ALLOCA=$(ALLOCA)
+HOST_MALLOC=$(MALLOC)
+HOST_OBSTACK=$(OBSTACK)
+
+# We don't use cross-make. Instead we use the tools from the build tree,
+# if they are available.
+# program_transform_name and objdir are set by configure.in.
+program_transform_name =
+objdir = .
+
+target=@target@
+target_alias=@target_alias@
+xmake_file=@dep_host_xmake_file@
+tmake_file=@dep_tmake_file@
+#version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
+#mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
+
+# Directory where sources are, from where we are.
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+# Top build directory, relative to here.
+top_builddir = ..
+
+# End of variables for you to override.
+
+# Definition of `all' is here so that new rules inserted by sed
+# do not specify the default target.
+all: all.indirect
+
+# This tells GNU Make version 3 not to put all variables in the environment.
+.NOEXPORT:
+
+# Now figure out from those variables how to compile and link.
+
+all.indirect: Makefile
+
+# This tells GNU make version 3 not to export all the variables
+# defined in this file into the environment.
+.NOEXPORT:
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
+ cd ..; $(SHELL) config.status
+
+force:
+
+SED=sed
+
+drvdir/default_pathes.ads: drvdir Makefile
+ echo "-- DO NOT EDIT" > tmp-dpathes.ads
+ echo "-- This file is created by Makefile" >> tmp-dpathes.ads
+ echo "package Default_Pathes is" >> tmp-dpathes.ads
+ echo " Compiler_Gcc : constant String :=" >> tmp-dpathes.ads
+ echo " \"$(libexecsubdir)/ghdl1$(exeext)\";" >> tmp-dpathes.ads
+ echo " Compiler_Debug : constant String :=\"\";" >> tmp-dpathes.ads
+ echo " Compiler_Mcode : constant String :=\"\";" >> tmp-dpathes.ads
+ echo " Post_Processor : constant String :=\"\";" >> tmp-dpathes.ads
+ echo " Prefix : constant String :=">> tmp-dpathes.ads
+ echo " \"$(libsubdir)/vhdl/lib/\";" >> tmp-dpathes.ads
+ echo "end Default_Pathes;" >> tmp-dpathes.ads
+ $(srcdir)/../move-if-change tmp-dpathes.ads $@
+
+../ghdl$(exeext): drvdir drvdir/default_pathes.ads force
+ CURDIR=`pwd`; cd $(srcdir); SRCDIR=`pwd`; cd $$CURDIR/drvdir; \
+ $(GNATMAKE) -o ../$@ -aI$$SRCDIR/ghdldrv -aI$$SRCDIR -aO.. ghdl_gcc \
+ -bargs -E -cargs $(ADA_CFLAGS) $(GHDL_ADAFLAGS) -largs $(LIBS)
+
+drvdir:
+ mkdir $@
+
+clean: grt-clean ghdllibs-clean force
+ $(RM) *.o *.ali
+ $(RM) default_pathes.ads
+
+# Additionnal rules
+
+LIB93_DIR:=./lib/v93
+LIB87_DIR:=./lib/v87
+LIBSRC_DIR:=$(srcdir)/libraries
+ANALYZE=../ghdl -a --GHDL1=../ghdl1 --ieee=none
+
+$(LIB93_DIR) $(LIB87_DIR):
+ $(srcdir)/../../mkinstalldirs $@
+
+####libraries Makefile.inc
+
+std87_standard.o: $(GHDL1)
+ $(GHDL1) --std=87 -quiet -o std_standard.s --compile-standard
+ ../xgcc -c -o std_standard.o std_standard.s
+ $(MV) std_standard.o $@
+
+std93_standard.o: $(GHDL1)
+ $(GHDL1) --std=93 -quiet -o std_standard.s --compile-standard
+ ../xgcc -c -o std_standard.o std_standard.s
+ $(MV) std_standard.o $@
+
+ghdllib: std87_standard.o std93_standard.o libgrt.a
+
+ghdllibs-clean: force
+ $(RM) -rf $(LIB87_DIR) $(LIB93_DIR)
+
+PHONY: ghdllib ghdllibs-clean
+
+GHDL1=../ghdl1
+GRTSRCDIR=$(srcdir)/grt
+GRT_RANLIB=$(RANLIB)
+
+####grt Makefile.inc
+
+install-ghdllib: ghdllib grt.lst $(STD93_SRCS) $(STD87_SRCS) \
+ $(IEEE93_SRCS) $(IEEE87_SRCS) $(SYNOPSYS_SRCS)
+ $(RM) -rf $(DESTDIR)$(VHDL_LIB_DIR)
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)
+# Install libgrt
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/lib
+ $(INSTALL_DATA) libgrt.a $(DESTDIR)$(VHDL_LIB_DIR)/lib/libgrt.a
+ $(INSTALL_DATA) grt.lst $(DESTDIR)$(VHDL_LIB_DIR)/lib/grt.lst
+# Install VHDL sources.
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/std
+ for i in $(STD93_SRCS) $(STD87_SRCS); do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/std; \
+ done
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee
+ for i in $(IEEE93_SRCS) $(IEEE87_SRCS); do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee; \
+ done
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/vital95
+ for i in $(VITAL95_SRCS); do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/vital95; \
+ done
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/vital2000
+ for i in $(VITAL2000_SRCS); do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/vital2000; \
+ done
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/synopsys
+ for i in $(SYNOPSYS_SRCS); do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/synopsys; \
+ done
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/mentor
+ for i in $(MENTOR93_SRCS); do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/mentor; \
+ done
+# Create library dirs
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/lib/v93
+ $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/lib/v87
+# Compile in place.
+ PDIR=`pwd` && cd $(DESTDIR)$(VHDL_LIB_DIR) && \
+ $(MAKE) -f $$PDIR/Makefile REL_DIR=../../.. \
+ LIBSRC_DIR="src" LIB93_DIR=lib/v93 LIB87_DIR=lib/v87 \
+ ANALYZE="$$PDIR/../ghdl -a --GHDL1=$$PDIR/../ghdl1 --ieee=none" \
+ std.v93 std.v87 ieee.v93 ieee.v87 synopsys.v93 synopsys.v87 mentor.v93
+# Copy std_standard (this is done after libraries, since they remove dirs).
+ $(INSTALL_DATA) std87_standard.o \
+ $(DESTDIR)$(VHDL_LIB_DIR)/lib/v87/std/std_standard.o
+ $(INSTALL_DATA) std93_standard.o \
+ $(DESTDIR)$(VHDL_LIB_DIR)/lib/v93/std/std_standard.o
diff --git a/translate/gcc/README b/translate/gcc/README
new file mode 100644
index 000000000..a3df511af
--- /dev/null
+++ b/translate/gcc/README
@@ -0,0 +1,54 @@
+This is the README from the source distribution of GHDL.
+
+To get the binary distribution or more information, go to http://ghdl.free.fr
+
+Copyright:
+**********
+GHDL is copyright (c) 2002, 2003, 2004, 2005 Tristan Gingold.
+See the GHDL manual for more details.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+
+Building GHDL from sources:
+***************************
+
+Required:
+* the sources of @GCCVERSION@ (at least the core part).
+ Note: other versions of gcc sources have not been tested.
+* the Ada95 GNAT compiler (only GNAT v3.15p is known to work).
+* GNU/Linux for ix86 (pc systems) (porting is necessary for other systems)
+
+Procedure:
+* untar the gcc tarball
+* untar the ghdl tarball (this sould have been done, since you are reading a
+ file from it).
+* move or copy the vhdl directory of ghdl into the gcc subdirectory of
+ the gcc distribution.
+ You should have a @GCCVERSION@/gcc/vhdl directory.
+* configure gcc with the --enable-languages=vhdl option. You may of course
+ add other languages.
+ Refer to the gcc installation documentation.
+* compile gcc.
+ 'make CFLAGS="-O"' is OK (gcc 2.8.1 bugs with -O2 on some files).
+* install gcc. This installs the ghdl driver too.
+ 'make install' is OK.
+
+Send bugs and comments to ghdl@free.fr.
+If you cannot compile, please report the gcc version, GNAT version and gcc
+source version.
+
+Tristan Gingold.
diff --git a/translate/gcc/config-lang.in b/translate/gcc/config-lang.in
new file mode 100644
index 000000000..393d2277f
--- /dev/null
+++ b/translate/gcc/config-lang.in
@@ -0,0 +1,38 @@
+# Top level configure fragment for GNU vhdl (GHDL).
+# Copyright (C) 1994-2001 Free Software Foundation, Inc.
+
+#This file is part of GNU CC.
+
+#GNU CC is free software; you can redistribute it and/or modify
+#it under the terms of the GNU General Public License as published by
+#the Free Software Foundation; either version 2, or (at your option)
+#any later version.
+
+#GNU CC is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#GNU General Public License for more details.
+
+#You should have received a copy of the GNU General Public License
+#along with GNU CC; see the file COPYING. If not, write to
+#the Free Software Foundation, 59 Temple Place - Suite 330,
+#Boston, MA 02111-1307, USA.
+
+# Configure looks for the existence of this file to auto-config each language.
+# We define several parameters used by configure:
+#
+# language - name of language as it would appear in $(LANGUAGES)
+# boot_language - "yes" if we need to build this language in stage1
+# compilers - value to add to $(COMPILERS)
+# stagestuff - files to add to $(STAGESTUFF)
+
+language="vhdl"
+boot_language=no
+
+compilers="ghdl1\$(exeext)"
+
+stagestuff="ghdl\$(exeext) ghdl1\$(exeext)"
+
+outputs=vhdl/Makefile
+
+gtfiles="\$(srcdir)/vhdl/agcc-bindings.c"
diff --git a/translate/gcc/dist.sh b/translate/gcc/dist.sh
new file mode 100755
index 000000000..a946e4602
--- /dev/null
+++ b/translate/gcc/dist.sh
@@ -0,0 +1,670 @@
+#!/bin/sh
+
+# Script used to create tar balls.
+# Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# Building a distribution:
+# * update the 'version' variable in ../../Makefile
+# * Regenerate version.ads: make -f ../../Makefile version.ads
+# * Check NEWS, README and INSTALL files.
+# * Check version and copyright years in doc/ghdl.texi, ghdlmain.adb
+# * Check GCCVERSION below.
+# * Check lists of exported files in this file.
+# * Create source tar and build binaries: ./dist.sh dist_phase1
+# * su root
+# * Build binary tar: ./dist.sh dist_phase2
+# * Run the testsuites: GHDL=ghdl ./testsuite.sh
+# * Update website/index.html (./dist.sh website helps, rename .new)
+# * upload (./dist upload)
+# * CVS commit, tag + cd image.
+# * remove previous version in /usr/local
+
+## DO NOT MODIFY this file while it is running...
+
+set -e
+
+VERSION=`sed -n -e 's/.*GHDL \([0-9.]*\) (.*/\1/p' ../../version.ads`
+
+CWD=`pwd`
+
+distdir=ghdl-$VERSION
+tarfile=$distdir.tar
+
+GCCVERSION=3.4.3
+DISTDIR=/home/gingold/dist
+GCCDIST=$DISTDIR/gcc-$GCCVERSION
+GCCDISTOBJ=$GCCDIST-objs
+PREFIX=/usr/local
+GCCLIBDIR=$PREFIX/lib/gcc/i686-pc-linux-gnu/$GCCVERSION
+GCCLIBEXECDIR=$PREFIX/libexec/gcc/i686-pc-linux-gnu/$GCCVERSION
+bindirname=ghdl-$VERSION-i686-pc-linux
+TARINSTALL=$DISTDIR/$bindirname.tar.bz2
+VHDLDIR=$distdir/vhdl
+DOWNLOAD_HTML=../../website/download.html
+DESTDIR=$CWD/
+UNSTRIPDIR=${distdir}-unstripped
+
+PATH=/usr/gnat/bin:$PATH
+
+do_clean ()
+{
+ rm -rf $VHDLDIR
+ mkdir $VHDLDIR
+ mkdir $VHDLDIR/ghdldrv
+ mkdir $VHDLDIR/libraries
+ mkdir $VHDLDIR/libraries/std $VHDLDIR/libraries/ieee
+ mkdir $VHDLDIR/libraries/vital95 $VHDLDIR/libraries/vital2000
+ mkdir $VHDLDIR/libraries/synopsys $VHDLDIR/libraries/mentor
+ mkdir $VHDLDIR/grt
+ mkdir $VHDLDIR/grt/config
+}
+
+# Build Makefile
+do_Makefile ()
+{
+ sed -e "/^####libraries Makefile.inc/r ../../libraries/Makefile.inc" \
+ -e "/^####grt Makefile.inc/r ../grt/Makefile.inc" \
+ < Makefile.in > $VHDLDIR/Makefile.in
+ sed -e "/^####agcc Makefile.inc/r ../../ortho/agcc/Makefile.inc" \
+ < Make-lang.in > $VHDLDIR/Make-lang.in
+}
+
+# Copy (or link) sources files into $VHDLDIR
+do_files ()
+{
+# Local files
+lfiles="config-lang.in lang-options.h lang-specs.h"
+for i in $lfiles; do ln -sf $CWD/$i $VHDLDIR/$i; done
+
+# ghdl core files
+cfiles="
+evaluation.adb
+evaluation.ads
+scan.ads
+scan.adb
+scan-scan_literal.adb
+back_end.ads
+back_end.adb
+files_map.adb
+files_map.ads
+sem.adb
+sem.ads
+sem_expr.adb
+sem_expr.ads
+sem_names.adb
+sem_names.ads
+sem_scopes.adb
+sem_scopes.ads
+sem_decls.ads
+sem_decls.adb
+sem_specs.ads
+sem_specs.adb
+sem_stmts.ads
+sem_stmts.adb
+sem_types.ads
+sem_types.adb
+sem_assocs.ads
+sem_assocs.adb
+canon.adb
+canon.ads
+flags.adb
+flags.ads
+configuration.adb
+configuration.ads
+nodes.ads
+nodes.adb
+lists.ads
+lists.adb
+iirs.adb
+iirs.ads
+iir_chains.ads
+iir_chains.adb
+iir_chain_handling.ads
+iir_chain_handling.adb
+std_names.adb
+std_names.ads
+disp_tree.adb
+disp_tree.ads
+iirs_utils.adb
+iirs_utils.ads
+std_package.adb
+std_package.ads
+disp_vhdl.adb
+disp_vhdl.ads
+libraries.adb
+libraries.ads
+tokens.adb
+tokens.ads
+name_table.adb
+name_table.ads
+str_table.ads
+str_table.adb
+types.ads
+version.ads
+errorout.adb
+errorout.ads
+parse.adb
+parse.ads
+post_sems.ads
+post_sems.adb
+ieee.ads
+ieee-std_logic_1164.ads
+ieee-std_logic_1164.adb
+ieee-vital_timing.ads
+ieee-vital_timing.adb
+xrefs.ads
+xrefs.adb
+bug.ads
+bug.adb
+"
+
+for i in $cfiles; do ln -sf $CWD/../../$i $VHDLDIR/$i; done
+
+ln -sf $CWD/../../doc/ghdl.texi $VHDLDIR/ghdl.texi
+
+# translation file
+tfiles="
+translation.adb
+ortho_front.adb
+translation.ads
+trans_decls.ads
+trans_be.ads
+trans_be.adb"
+
+for i in $tfiles; do ln -sf $CWD/../$i $VHDLDIR/$i; done
+
+ortho_files="
+ortho_front.ads"
+
+for i in $ortho_files; do ln -sf $CWD/../../ortho/$i $VHDLDIR/$i; done
+
+ortho_gcc_files="
+agcc-fe.adb
+lang.opt
+ortho_ident.adb
+ortho_ident.ads
+ortho_gcc_front.ads
+ortho_nodes.ads
+ortho_gcc-main.adb
+ortho_gcc-main.ads
+ortho_gcc.ads
+ortho_gcc.adb"
+
+for i in $ortho_gcc_files; do
+ ln -sf $CWD/../../ortho/gcc/$i $VHDLDIR/$i
+done
+
+agcc_files="
+agcc-autils.adb
+agcc-autils.ads
+agcc-convert.ads
+agcc-fe.ads
+agcc-ggc.ads
+agcc-output.ads
+agcc-rtl.ads
+agcc-stor_layout.ads
+agcc-toplev.ads
+agcc-trees.adb
+agcc-diagnostic.ads
+agcc-libiberty.ads
+agcc.ads
+agcc.adb
+c.adb
+c.ads
+agcc-hconfig.ads.in
+agcc-hwint.ads.in
+agcc-machmode.ads.in
+agcc-real.ads.in
+agcc-tm.ads.in
+agcc-trees.ads.in
+agcc-options.ads.in
+agcc-input.ads
+agcc-bindings.c
+agcc-ghdl.c
+gen_tree.c"
+
+
+for i in $agcc_files; do
+ ln -sf $CWD/../../ortho/agcc/$i $VHDLDIR/$i
+done
+
+ghdl_files="
+ghdl_gcc.adb
+ghdldrv.ads
+ghdldrv.adb
+ghdlprint.ads
+ghdlprint.adb
+ghdllocal.ads
+ghdllocal.adb
+ghdlmain.ads
+ghdlmain.adb
+"
+
+for i in $ghdl_files; do
+ ln -sf $CWD/../ghdldrv/$i $VHDLDIR/ghdldrv/$i
+done
+
+libraries_files="
+std/textio.vhdl
+std/textio_body.vhdl
+ieee/numeric_bit-body.vhdl
+ieee/numeric_bit.vhdl
+ieee/numeric_std-body.vhdl
+ieee/numeric_std.vhdl
+ieee/std_logic_1164.vhdl
+ieee/std_logic_1164_body.vhdl
+ieee/math_real.vhdl
+ieee/math_real-body.vhdl
+ieee/math_complex.vhdl
+ieee/math_complex-body.vhdl
+vital95/vital_primitives.vhdl
+vital95/vital_primitives_body.vhdl
+vital95/vital_timing.vhdl
+vital95/vital_timing_body.vhdl
+vital2000/memory_b.vhdl
+vital2000/memory_p.vhdl
+vital2000/prmtvs_b.vhdl
+vital2000/prmtvs_p.vhdl
+vital2000/timing_b.vhdl
+vital2000/timing_p.vhdl
+synopsys/std_logic_arith.vhdl
+synopsys/std_logic_misc.vhdl
+synopsys/std_logic_misc-body.vhdl
+synopsys/std_logic_signed.vhdl
+synopsys/std_logic_textio.vhdl
+synopsys/std_logic_unsigned.vhdl
+mentor/std_logic_arith.vhdl
+mentor/std_logic_arith_body.vhdl
+"
+
+for i in $libraries_files; do
+ echo "adding $i"
+ ln -sf $CWD/../../libraries/$i $VHDLDIR/libraries/$i
+done
+
+grt_files="
+grt-cbinding.c
+grt-cvpi.c
+grt.adc
+grt-avhpi.adb
+grt-avhpi.ads
+grt-disp.adb
+grt-disp.ads
+grt-disp_rti.adb
+grt-disp_rti.ads
+grt-disp_signals.adb
+grt-disp_signals.ads
+grt-errors.adb
+grt-errors.ads
+grt-files.adb
+grt-files.ads
+grt-hooks.adb
+grt-hooks.ads
+grt-images.adb
+grt-images.ads
+grt-values.adb
+grt-values.ads
+grt-lib.adb
+grt-lib.ads
+grt-main.adb
+grt-main.ads
+grt-names.adb
+grt-names.ads
+grt-options.adb
+grt-options.ads
+grt-processes.adb
+grt-processes.ads
+grt-rtis.ads
+grt-rtis_addr.adb
+grt-rtis_addr.ads
+grt-rtis_utils.adb
+grt-rtis_utils.ads
+grt-rtis_binding.ads
+grt-rtis_types.ads
+grt-rtis_types.adb
+grt-sdf.adb
+grt-sdf.ads
+grt-shadow_ieee.ads
+grt-shadow_ieee.adb
+grt-signals.adb
+grt-signals.ads
+grt-stack2.adb
+grt-stack2.ads
+grt-stacks.adb
+grt-stacks.ads
+grt-stdio.ads
+grt-astdio.ads
+grt-astdio.adb
+grt-types.ads
+grt-vcd.adb
+grt-vcd.ads
+grt-vital_annotate.adb
+grt-vital_annotate.ads
+grt-vpi.adb
+grt-vpi.ads
+grt-vstrings.adb
+grt-vstrings.ads
+grt-stats.ads
+grt-stats.adb
+grt-waves.ads
+grt-waves.adb
+grt-avls.ads
+grt-avls.adb
+grt.ads
+main.adb
+main.ads
+ghdl_main.ads
+ghdl_main.adb
+ghwlib.h
+ghwlib.c
+ghwdump.c
+"
+
+for i in $grt_files; do
+ echo "adding $i"
+ ln -sf $CWD/../grt/$i $VHDLDIR/grt/$i
+done
+
+grt_config_files="
+i386.S
+sparc.S
+ppc.S
+times.c
+clock.c
+linux.c
+pthread.c
+win32.c"
+
+for i in $grt_config_files; do
+ echo "adding $i"
+ ln -sf $CWD/../grt/config/$i $VHDLDIR/grt/config/$i
+done
+
+}
+
+# Create the tar of sources.
+do_sources ()
+{
+ \rm -rf $distdir
+ mkdir $distdir
+ VHDLDIR=$distdir/vhdl
+ do_clean $VHDLDIR
+ do_Makefile
+ do_files
+ ln -sf ../../../COPYING $distdir
+ sed -e "s/@GCCVERSION@/gcc-$GCCVERSION/g" < README > $distdir/README
+ tar cvhf $tarfile $distdir
+ bzip2 -f $tarfile
+ rm -rf $distdir
+}
+
+# Put GHDL sources in GCC.
+do_update_gcc_sources ()
+{
+ set -x
+
+ cd $GCCDIST/..
+ tar jxvf $CWD/$tarfile.bz2
+ rm -rf $GCCDIST/gcc/vhdl
+ mv $distdir/vhdl $GCCDIST/gcc
+}
+
+# Extract the source, configure and make.
+do_compile ()
+{
+ set -x
+
+ do_update_gcc_sources;
+
+ rm -rf $GCCDISTOBJ
+ mkdir $GCCDISTOBJ
+ cd $GCCDISTOBJ
+ ../gcc-$GCCVERSION/configure --enable-languages=vhdl --prefix=$PREFIX
+ make CFLAGS="-O -g"
+ make -C gcc vhdl.info
+ cd $CWD
+}
+
+check_root ()
+{
+ if [ $UID -ne 0 ]; then
+ echo "$0: you must be root";
+ exit 1;
+ fi
+}
+
+# Do a make install
+do_compile2 ()
+{
+# check_root;
+ PATH=/usr/gnat/bin:$PATH
+ set -x
+ cd $GCCDISTOBJ
+ # Check the info file is not empty.
+ if [ -s gcc/doc/ghdl.info ]; then
+ echo "info file found"
+ else
+ echo "Error: ghdl.info not found".
+ exit 1;
+ fi
+ mkdir -p $DESTDIR/usr/local || true
+ make DESTDIR=$DESTDIR install
+ cd $CWD
+ if [ -d $UNSTRIPDIR ]; then
+ rm -rf $UNSTRIPDIR
+ fi
+ mkdir $UNSTRIPDIR
+ cp ${DESTDIR}${GCCLIBEXECDIR}/ghdl1 ${DESTDIR}${PREFIX}/bin/ghdl $UNSTRIPDIR
+ chmod -w $UNSTRIPDIR/*
+ strip ${DESTDIR}${GCCLIBEXECDIR}/ghdl1 ${DESTDIR}${PREFIX}/bin/ghdl
+}
+
+# Create the tar file from the current installation.
+do_tar_install ()
+{
+ tar -C $DESTDIR -jcvf $TARINSTALL \
+ ./$PREFIX/bin/ghdl ./$PREFIX/info/ghdl.info \
+ ./$GCCLIBDIR/vhdl \
+ ./$GCCLIBEXECDIR/ghdl1
+}
+
+do_extract_tar_install ()
+{
+ check_root;
+ cd /
+ tar jxvf $TARINSTALL
+ cd $CWD
+}
+
+# Create the tar file to be distributed.
+do_tar_dist ()
+{
+ rm -rf $bindirname
+ mkdir $bindirname
+ sed -e "s/@TARFILE@/$dir.tar/" < INSTALL > $bindirname/INSTALL
+ ln COPYING $bindirname
+ ln $TARINSTALL $bindirname
+ tar cvf $bindirname.tar $bindirname
+}
+
+# Remove the non-ghdl files of gcc in the current installation.
+do_distclean_gcc ()
+{
+ set -x
+ rm -f ${DESTDIR}${PREFIX}/bin/cpp ${DESTDIR}${PREFIX}/bin/gcc
+ rm -f ${DESTDIR}${PREFIX}/bin/gccbug ${DESTDIR}${PREFIX}/bin/gcov
+ rm -f ${DESTDIR}${PREFIX}/bin/i686-pc-linux-gnu-gcc*
+ rm -f ${DESTDIR}${PREFIX}/info/cpp.info*
+ rm -f ${DESTDIR}${PREFIX}/info/cppinternals.info*
+ rm -f ${DESTDIR}${PREFIX}/info/gcc.info*
+ rm -f ${DESTDIR}${PREFIX}/info/gccinstall.info*
+ rm -f ${DESTDIR}${PREFIX}/info/gccint.info*
+ rm -f ${DESTDIR}${PREFIX}/lib/*.a ${DESTDIR}${PREFIX}/lib/*.so*
+ rm -rf ${DESTDIR}${PREFIX}/share
+ rm -rf ${DESTDIR}${PREFIX}/man
+ rm -rf ${DESTDIR}${PREFIX}/include
+ rm -f ${DESTDIR}${GCCLIBEXECDIR}/cc1 ${DESTDIR}${GCCLIBEXECDIR}/collect2
+ rm -f ${DESTDIR}${GCCLIBEXECDIR}/cpp0 ${DESTDIR}${GCCLIBEXECDIR}/tradcpp0
+ rm -f ${DESTDIR}${GCCLIBDIR}/*.o ${DESTDIR}$GCCLIBDIR/*.a
+ rm -f ${DESTDIR}${GCCLIBDIR}/specs
+ rm -rf ${DESTDIR}${GCCLIBDIR}/include
+ rm -rf ${DESTDIR}${GCCLIBDIR}/install-tools
+ rm -rf ${DESTDIR}${GCCLIBEXECDIR}/install-tools
+}
+
+# Remove ghdl files in the current installation.
+do_distclean_ghdl ()
+{
+ check_root;
+ set -x
+ rm -f $PREFIX/bin/ghdl
+ rm -f $PREFIX/info/ghdl.info*
+ rm -f $GCCLIBEXECDIR/ghdl1
+ rm -rf $GCCLIBDIR/vhdl
+}
+
+# Build the source tar, and build the binaries.
+do_dist_phase1 ()
+{
+ do_sources;
+ do_compile;
+ do_compile2;
+ do_distclean_gcc;
+ do_tar_install;
+ do_tar_dist;
+ rm -rf ./$PREFIX
+}
+
+# Install the binaries and create the binary tar.
+do_dist_phase2 ()
+{
+ check_root;
+ do_distclean_ghdl;
+ do_extract_tar_install;
+ echo "dist_phase2 success"
+}
+
+# Update the index.html
+# Update the doc
+do_website ()
+{
+ sed -e "
+/SRC-HREF/ s/href=\".*\"/href=\"$tarfile.bz2\"/
+/BIN-HREF/ s/href=\".*\"/href=\"$bindirname.tar\"/
+/HISTORY/ a \\
+ <tr>\\
+ <td>$VERSION</td>\\
+ <td>`date +'%b %e %Y'`</td>\\
+ <td>$GCCVERSION</td>\\
+ <td><a href=\"$tarfile.bz2\">$tarfile.bz2</a></td>\\
+ <td><a href=\"$bindirname.tar\">\\
+ $bindirname.tar</a></td>\\
+ </tr>
+" < $DOWNLOAD_HTML > "$DOWNLOAD_HTML".new
+ dir=../../website/ghdl
+ echo "Updating $dir"
+ rm -rf $dir
+ makeinfo --html -o $dir ../../doc/ghdl.texi
+}
+
+# Do ftp commands to upload
+do_upload ()
+{
+if tty -s; then
+ echo -n "Please, enter password: "
+ stty -echo
+ read pass
+ stty echo
+ echo
+else
+ echo "$0: upload must be done from a tty"
+ exit 1;
+fi
+ftp -n <<EOF
+open ftpperso.free.fr
+user ghdl $pass
+prompt
+hash
+bin
+passive
+put $tarfile.bz2
+put $bindirname.tar
+put INSTALL
+lcd ../../website
+put NEWS
+put index.html
+put download.html
+put features.html
+put roadmap.html
+put manual.html
+put more.html
+put links.html
+put bug.html
+put waveform.html
+put gtkwave-patch.tgz
+put favicon.ico
+lcd ghdl
+cd ghdl
+mput \*
+bye
+EOF
+}
+
+if [ $# -eq 0 ]; then
+ do_Makefile;
+else
+ for i ; do
+ case $i in
+ Makefile|makefile)
+ do_Makefile ;;
+ files)
+ do_files ;;
+ sources)
+ do_sources ;;
+ compile)
+ do_compile;;
+ update_gcc)
+ do_update_gcc_sources;;
+ compile2)
+ do_compile2;;
+ tar_install)
+ do_tar_install;;
+ tar_dist)
+ do_tar_dist;;
+ -v | --version | version)
+ echo $VERSION
+ exit 0
+ ;;
+ website)
+ do_website;;
+ upload)
+ do_upload;;
+ distclean_gcc)
+ do_distclean_gcc;;
+ distclean_ghdl)
+ do_distclean_ghdl;;
+ dist_phase1)
+ do_dist_phase1;;
+ dist_phase2)
+ do_dist_phase2;;
+ *)
+ echo "usage: $0 clean|Makefile|files|all"
+ exit 1 ;;
+ esac
+ done
+fi
diff --git a/translate/gcc/lang-options.h b/translate/gcc/lang-options.h
new file mode 100644
index 000000000..c92b12132
--- /dev/null
+++ b/translate/gcc/lang-options.h
@@ -0,0 +1,29 @@
+/* Definitions for switches for vhdl.
+ Copyright (C) 2002
+ Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+DEFINE_LANG_NAME ("vhdl")
+
+/* This is the contribution to the `lang_options' array in gcc.c for ghdl. */
+
+ {"--ghdl-", "Specify options to GHDL"},
+
+
+
diff --git a/translate/gcc/lang-specs.h b/translate/gcc/lang-specs.h
new file mode 100644
index 000000000..e8e79a2a8
--- /dev/null
+++ b/translate/gcc/lang-specs.h
@@ -0,0 +1,28 @@
+/* Definitions for specs for vhdl.
+ Copyright (C) 2002
+ Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* This is the contribution to the `default_compilers' array in gcc.c for
+ GHDL. */
+
+ {".vhd", "@vhdl", 0},
+ {".vhdl", "@vhdl", 0},
+ {"@vhdl",
+ "ghdl1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}", 0},