aboutsummaryrefslogtreecommitdiffstats
path: root/dist
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-07-15 06:32:58 +0200
committerTristan Gingold <tgingold@free.fr>2016-07-16 15:06:44 +0200
commite35b24adbb1d0e76c076fe475c8442738b3378be (patch)
treeb65ad8fa33cfad1dbbff863561d6cb964f889801 /dist
parent0eadd36bc47b08ad552d325c54f9e3a305c6838c (diff)
downloadghdl-e35b24adbb1d0e76c076fe475c8442738b3378be.tar.gz
ghdl-e35b24adbb1d0e76c076fe475c8442738b3378be.tar.bz2
ghdl-e35b24adbb1d0e76c076fe475c8442738b3378be.zip
Rework gcc build procedure. Add vpi build command.
Diffstat (limited to 'dist')
-rw-r--r--dist/gcc/Make-lang.in75
-rw-r--r--dist/gcc/README40
-rw-r--r--dist/gcc/config-lang.in2
3 files changed, 29 insertions, 88 deletions
diff --git a/dist/gcc/Make-lang.in b/dist/gcc/Make-lang.in
index 8aa15e922..3316251d8 100644
--- a/dist/gcc/Make-lang.in
+++ b/dist/gcc/Make-lang.in
@@ -39,41 +39,17 @@
MV = mv
RM = rm -f
-GHDLLIB_CFLAGS=-O2 -g
-GHDLLIB_AFLAGS=-gnatpn
# 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)" \
- "GRT_FLAGS=$(GHDLLIB_CFLAGS)" \
- "GRT_ADAFLAGS=$(GHDLLIB_AFLAGS)" \
- "LIB_CFLAGS=$(GHDLLIB_CFLAGS)" \
- "GNATMAKE=$(GNATMAKE)" \
- "GNATBIND=$(GNATBIND)" \
- "CFLAGS=$(CFLAGS)" \
- "VHDL_LIB_DIR=$(VHDL_LIB_DIR)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
- "libexecsubdir=$(libexecsubdir)"
-
-# Command to run the Makefile in vhdl subdir. Don't forget the dependency on
-# vhdl/Makefile
-MAKE_IN_VHDL=$(MAKE) -C vhdl $(FLAGS_TO_PASS) $(VHDL_FLAGS_TO_PASS) ADAC="$(CC)" CC="$(CC)"
# Define the names for selecting vhdl in LANGUAGES.
-vhdl VHDL: ghdl1$(exeext) ghdl$(exeext) vhdl/libgrt.a ghdllib
+vhdl VHDL: ghdl1$(exeext) ghdl$(exeext)
# Tell GNU Make to ignore these, if they exist.
-.PHONY: vhdl VHDL ghdllib
-
-#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)
+.PHONY: vhdl VHDL
GHDL1_OBJS = attribs.o vhdl/ortho-lang.o
@@ -94,7 +70,23 @@ ghdl1$(exeext): force $(GHDL1_OBJS) $(BACKEND) $(LIBDEPS)
-bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \
-largs --LINK=$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GHDL1_OBJS) \
$(filter-out main.o,$(BACKEND)) $(LIBS) $(BACKENDLIBS)
- if test $@ -nt s-ghdllib; then $(RM) -f s-ghdllib; fi
+
+vhdl_target1:=$(subst -gnu,,$(target))
+vhdl_targ:=$(subst -, ,$(vhdl_target1))
+ifeq ($(words $(vhdl_targ)),2)
+ vhdl_osys:=$(word 2,$(vhdl_targ))
+else
+ vhdl_osys:=$(word 3,$(vhdl_targ))
+endif
+
+# Set target files.
+ifeq ($(filter-out mingw32 mingw64,$(vhdl_osys)),)
+ VHDL_SOEXT=.dll
+else ifeq ($(filter-out darwin%,$(vhdl_osys)),)
+ VHDL_SOEXT=.dylib
+else
+ VHDL_SOEXT=.so
+endif
vhdl/default_pathes.ads: Makefile
echo "-- DO NOT EDIT" > tmp-dpathes.ads
@@ -113,7 +105,9 @@ vhdl/default_pathes.ads: Makefile
echo " Compiler_Llvm : constant String := \"\";" >> tmp-dpathes.ads
echo " Post_Processor : constant String := \"\";" >> tmp-dpathes.ads
echo " Lib_Prefix : constant String :=">> tmp-dpathes.ads
- echo " \"lib/gcc/$(target_noncanonical)/$(version)/vhdl/\";" >> tmp-dpathes.ads
+ echo " \"lib/ghdl\";" >> tmp-dpathes.ads
+ echo " Shared_Library_Extension : constant String :=">> tmp-dpathes.ads
+ echo " \"$(VHDL_SOEXT)\";" >> tmp-dpathes.ads
echo "end Default_Pathes;" >> tmp-dpathes.ads
$(srcdir)/../move-if-change tmp-dpathes.ads $@
@@ -122,21 +116,6 @@ ghdl$(exeext): ghdl1$(exeext) vhdl/default_pathes.ads force
$(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aI$(srcdir)/vhdl/ghdldrv \
-aIvhdl -aOvhdl ghdl_gcc \
-bargs -E -cargs $(ADA_CFLAGS) $(GHDL_ADAFLAGS) -largs $(LIBS)
- if test $@ -nt s-ghdllib; then $(RM) -f s-ghdllib; fi
-
-# Ghdl libraries. Also depends on xgcc to build std_standard.o
-s-ghdllib: ghdl$(exeext) ghdl1$(exeext) $(GCC_PASSES)
- $(MAKE_IN_VHDL) ghdllib
- touch $@
-
-ghdllib: s-ghdllib
-
-vhdl/libgrt.a: vhdl/Makefile force
- $(MAKE_IN_VHDL) libgrt.a grt.lst
-
-vhdl/Makefile: config.status $(srcdir)/vhdl/Makefile.in
- CONFIG_HEADERS= CONFIG_LINKS= CONFIG_COMMANDS= \
- CONFIG_FILES=vhdl/Makefile $(SHELL) config.status
# Build hooks:
@@ -173,20 +152,18 @@ vhdl.install-normal:
vhdl.install-plugin:
# Install the driver program as ghdl.
-vhdl.install-common: ghdl$(exeext) s-ghdllib vhdl/Makefile
+vhdl.install-common: ghdl$(exeext) ghdl1$(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
+ -mkdir $(DESTDIR)$(libdir)
+ -mkdir $(DESTDIR)$(libdir)/ghdl
+ $(INSTALL_DATA) ../libbacktrace/.libs/libbacktrace.a $(DESTDIR)$(libdir)/ghdl
install-info:: $(DESTDIR)$(infodir)/ghdl.info
vhdl.install-info: $(DESTDIR)$(infodir)/ghdl.info
-install-ghdllib: ghdl$(exeext) ghdl1$(exeext) vhdl/Makefile s-ghdllib
- $(MAKE_IN_VHDL) install-ghdllib
-
vhdl.install-man: $(DESTDIR)$(man1dir)/ghdl$(man1ext)
$(DESTDIR)$(man1dir)/ghdl$(man1ext): $(srcdir)/vhdl/ghdl.1
diff --git a/dist/gcc/README b/dist/gcc/README
index 48aa84ba7..41357265b 100644
--- a/dist/gcc/README
+++ b/dist/gcc/README
@@ -1,6 +1,7 @@
This is the README from the source distribution of GHDL.
-To get the binary distribution or more information, go to http://ghdl.free.fr
+To get the binary distribution or more information, go to:
+ https://github.com/tgingold/ghdl
Copyright:
**********
@@ -26,42 +27,7 @@ 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 (GNAT GPL 2008 are known to work;
- Ada compilers in most Linux distributions are more or less buggy)
-* GNU/Linux for ix86 (pc systems) (porting is necessary for other systems)
-
-Procedure:
-* Check your Ada compiler. On some systems (or with some distribution), the
- GNAT compiler seems broken. Try this very simple example, using file
- example.adb
-<<<<<<<<<<<<<<<<<<
-procedure Example is
-begin
- null;
-end Example;
-<<<<<<<<<<<<<<<<<<
- Compile with
- $ gnatmake example
- It should create an executable, 'example'.
- If this doesn't work, your GNAT installation is broken. It may be a PATH
- problem or something else.
-* 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. Also you'd better to disable bootstraping using
- --disable-bootstrap.
- Refer to the gcc installation documentation.
-* compile gcc.
- 'make CFLAGS="-O"' is OK
-* install gcc. This installs the ghdl driver too.
- 'make install' is OK.
+See BUILD.txt
There is a mailing list for any questions. You can subscribe via:
https://mail.gna.org/listinfo/ghdl-discuss/
diff --git a/dist/gcc/config-lang.in b/dist/gcc/config-lang.in
index 7010b1127..3ce9851f3 100644
--- a/dist/gcc/config-lang.in
+++ b/dist/gcc/config-lang.in
@@ -33,6 +33,4 @@ compilers="ghdl1\$(exeext)"
stagestuff="ghdl\$(exeext) ghdl1\$(exeext)"
-outputs=vhdl/Makefile
-
gtfiles="\$(srcdir)/vhdl/ortho-lang.c"