From d14ef7bf8c94b4e164ae26954c4f737e2c3d655b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 5 Jul 2019 18:37:17 +0200 Subject: configure: add --enable-synth (off by default). --- Makefile.in | 5 +++-- configure | 15 ++++++++++++++- src/ghdldrv/ghdl_gcc.adb | 2 ++ src/ghdldrv/ghdl_jit.adb | 4 ++-- src/ghdldrv/ghdl_simul.adb | 4 ++-- src/ghdldrv/ghdlnull.ads | 21 +++++++++++++++++++++ 6 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 src/ghdldrv/ghdlnull.ads diff --git a/Makefile.in b/Makefile.in index 71420dd95..0e7bf20c2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -182,7 +182,7 @@ GHDL_MCODE_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir ghdl_mcode$(EXEEXT): GRT_FLAGS+=-DWITH_GNAT_RUN_TIME ghdl_mcode$(EXEEXT): $(GRT_ADD_OBJS) $(GRT_SRC_DEPS) $(ORTHO_DEPS) \ memsegs_c.o chkstk.o version.ads force - $(GNATMAKE) -o $@ $(GHDL_MCODE_INCFLAGS) $(GNATFLAGS) -gnatw.A ghdl_jit.adb $(GNAT_BARGS) -largs memsegs_c.o chkstk.o $(GRT_ADD_OBJS) $(LDFLAGS) $(GNAT_LARGS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB)) + $(GNATMAKE) -o $@ -gnat12 $(GHDL_MCODE_INCFLAGS) $(GNATFLAGS) -gnatw.A ghdl_jit.adb $(GNAT_BARGS) -largs memsegs_c.o chkstk.o $(GRT_ADD_OBJS) $(LDFLAGS) $(GNAT_LARGS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB)) memsegs_c.o: $(srcdir)/src/ortho/mcode/memsegs_c.c $(CC) -c $(OPT_FLAGS) -o $@ $< @@ -219,10 +219,11 @@ all.gcc: copy-sources.gcc: version.ads $(RM) -rf $(gcc_vhdl_dir) $(MKDIR) $(gcc_vhdl_dir) - $(CP) -p version.ads $(gcc_vhdl_dir) + $(CP) -p version.ads ghdlsynth_maybe.ads $(gcc_vhdl_dir) $(CP) -p $(srcdir)/src/*.ad? $(gcc_vhdl_dir) $(CP) -p $(srcdir)/src/vhdl/*.ad? $(gcc_vhdl_dir) $(CP) -p $(srcdir)/src/vhdl/translate/*.ad? $(gcc_vhdl_dir) + $(CP) -p $(srcdir)/src/synth/*.ad? $(gcc_vhdl_dir) $(CP) -p $(srcdir)/src/psl/*.ad? $(gcc_vhdl_dir) $(CP) -p $(srcdir)/src/grt/grt.ad? $(gcc_vhdl_dir) $(CP) -p $(srcdir)/src/grt/grt-types.ads $(gcc_vhdl_dir) diff --git a/configure b/configure index 3d74557da..306de394b 100755 --- a/configure +++ b/configure @@ -45,6 +45,7 @@ enable_werror=true enable_checks=true enable_openieee=unknown enable_libghdl=true +enable_synth=false default_pic=false EXEEXT= SOEXT=.so @@ -107,6 +108,8 @@ for opt do --disable-openieee) enable_openieee=false;; --enable-libghdl) enable_libghdl=true;; --disable-libghdl) enable_libghdl=false;; + --enable-synth) enable_synth=true;; + --disable-synth) enable_synth=false;; --default-pic) default_pic=true;; --enable-coverage) build_mode="coverage";; -h|-help|--help) show_help=yes;; @@ -128,7 +131,7 @@ Options [defaults in brackets]: --with-gcc=DIR use gcc backend from DIR --with-llvm-config=PATH use llvm from PATH (needs llvm 3.5 - 3.9) --with-backtrace-lib=LIB.a link with libbacktrace LIB.a to display a - backtrace on errors (only for llvm). + backtrace on errors (only for llvm). --disable-werror warnings don't stop build --disable-checks disable internal checks --disable-libghdl do not build libghdl shared library @@ -371,6 +374,16 @@ if test $backend = mcode; then } > elf_arch.ads fi +# Generate ghdlsynth_maybe.ads +echo "Generate ghdlsynth_maybe.ads" +if [ "$enable_synth" = "true" ]; then + pkg_synth=Ghdlsynth +else + pkg_synth=Ghdlnull +fi +echo "with $pkg_synth;" > ghdlsynth_maybe.ads +echo "package Ghdlsynth_Maybe renames $pkg_synth;" >> ghdlsynth_maybe.ads + # Generate default_paths.ads # Also update dist/windows/mcode/default_paths.ads if you change this # template. diff --git a/src/ghdldrv/ghdl_gcc.adb b/src/ghdldrv/ghdl_gcc.adb index c384222be..9077ca36b 100644 --- a/src/ghdldrv/ghdl_gcc.adb +++ b/src/ghdldrv/ghdl_gcc.adb @@ -21,6 +21,7 @@ with Ghdldrv; with Ghdlprint; with Ghdlvpi; with Ghdlxml; +with Ghdlsynth_Maybe; procedure Ghdl_Gcc is begin @@ -29,6 +30,7 @@ begin Ghdlmain.Version_String := new String'("GCC back-end code generator"); Ghdldrv.Backend := Ghdldrv.Backend_Gcc; Ghdldrv.Register_Commands; + Ghdlsynth_Maybe.Register_Commands; Ghdllocal.Register_Commands; Ghdlprint.Register_Commands; Ghdlvpi.Register_Commands; diff --git a/src/ghdldrv/ghdl_jit.adb b/src/ghdldrv/ghdl_jit.adb index 5da726e10..79d69c0e8 100644 --- a/src/ghdldrv/ghdl_jit.adb +++ b/src/ghdldrv/ghdl_jit.adb @@ -21,7 +21,7 @@ with Ghdlprint; with Ghdlrun; with Ghdlvpi; with Ghdlxml; --- with Ghdlsynth; +with Ghdlsynth_Maybe; with Ortho_Jit; procedure Ghdl_Jit is @@ -35,7 +35,7 @@ begin Ghdlprint.Register_Commands; Ghdlvpi.Register_Commands; Ghdlxml.Register_Commands; - -- Ghdlsynth.Register_Commands; + Ghdlsynth_Maybe.Register_Commands; Ghdlmain.Register_Commands; Ghdlmain.Main; end Ghdl_Jit; diff --git a/src/ghdldrv/ghdl_simul.adb b/src/ghdldrv/ghdl_simul.adb index d28be1167..fa95ac5cb 100644 --- a/src/ghdldrv/ghdl_simul.adb +++ b/src/ghdldrv/ghdl_simul.adb @@ -21,7 +21,7 @@ with Ghdlprint; with Ghdlxml; with Ghdlsimul; -with Ghdlsynth; +with Ghdlsynth_Maybe; procedure Ghdl_Simul is begin @@ -29,7 +29,7 @@ begin -- used to display help). Ghdlmain.Version_String := new String'("interpretation"); Ghdlsimul.Register_Commands; - Ghdlsynth.Register_Commands; + Ghdlsynth_Maybe.Register_Commands; Ghdllocal.Register_Commands; Ghdlprint.Register_Commands; Ghdlxml.Register_Commands; diff --git a/src/ghdldrv/ghdlnull.ads b/src/ghdldrv/ghdlnull.ads new file mode 100644 index 000000000..8a2e8e40c --- /dev/null +++ b/src/ghdldrv/ghdlnull.ads @@ -0,0 +1,21 @@ +-- Null GHDL driver, used to not use synthesis +-- Copyright (C) 2019 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. + +package Ghdlnull is + procedure Register_Commands is null; +end Ghdlnull; -- cgit v1.2.3