diff --git a/configure.ac b/configure.ac index c3e1a5bfb..5560dc981 100644 --- a/configure.ac +++ b/configure.ac @@ -98,6 +98,22 @@ AC_SUBST(EXEEXT) # Combined check for Microsoft-related bogosities; sets WIN32 if found AX_WIN32 +# detect msys shell +AC_MSG_CHECKING([whether the shell is an MSYS2 runtime shell]) + +AS_CASE([$host_os:$MSYSTEM], + [*mingw*:UCRT64|*mingw*:MINGW64|*mingw*:MINGW32|*mingw*:CLANG64], [ + MSYS_SHELL=true + msys_shell_result=yes + ], + [ + MSYS_SHELL=false + msys_shell_result=no + ] +) +AC_MSG_RESULT([$msys_shell_result]) +AC_SUBST([MSYS_SHELL]) + # Check to see if we are using the Sun compiler. If so then configure # some of the flags to match the Sun compiler syntax. This is also used # in the aclocal.m4 file to configure the flags used to build and link diff --git a/driver/Makefile.in b/driver/Makefile.in index f0c6831ce..36b9abcd2 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -17,12 +17,18 @@ # SHELL = /bin/sh +EXEEXT = @EXEEXT@ +ENV_VVP=@ENV_VVP@ +MSYS_SHELL=@MSYS_SHELL@ + suffix = @install_suffix@ prefix = @prefix@ exec_prefix = @exec_prefix@ srcdir = @srcdir@ datarootdir = @datarootdir@ +builddir=@builddir@ +top_builddir=@top_builddir@ VPATH = $(srcdir) @@ -58,11 +64,25 @@ O = main.o substit.o cflexor.o cfparse.o all: dep iverilog@EXEEXT@ iverilog.man check: all + @if $(MSYS_SHELL); then \ + echo "iverilog: execution from a build directory not suppported for this runtime"; \ + else \ + echo "iverilog: create .vpp from .v file and run it"; \ + $(builddir)/iverilog@EXEEXT@ \ + -B$(top_builddir)/tgt-vvp \ + -BI$(top_builddir) \ + -BM$(top_builddir)/vpi \ + -BP$(top_builddir)/ivlpp \ + -Bt$(top_builddir)/tgt-vvp \ + $(verbose) -o top.vvp -s top $(srcdir)/hello_world.v; \ + $(ENV_VVP) $(top_builddir)/vvp/vvp$(suffix)@EXEEXT@ top.vvp; \ + fi clean: rm -f *.o cflexor.c cfparse.c cfparse.h cfparse.output rm -f iverilog@EXEEXT@ iverilog.man iverilog.pdf iverilog.ps rm -rf dep + rm -f test.conf top.vvp distclean: clean rm -f Makefile config.log diff --git a/driver/hello_world.v b/driver/hello_world.v new file mode 100644 index 000000000..33ca7ea79 --- /dev/null +++ b/driver/hello_world.v @@ -0,0 +1,3 @@ +module top; + initial $display("Hello World!"); +endmodule