diff --git a/Makefile.in b/Makefile.in index 7cc7bc29e..668e601ce 100644 --- a/Makefile.in +++ b/Makefile.in @@ -166,7 +166,7 @@ else $(ENV_VVP) vvp/vvp -M- -M./vpi ./check.vvp | grep 'Hello, World' endif -check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py: +check-full check-vpi check-vvp check-vvp-py check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py: $(MAKE) -C ivtest $@ clean: @@ -411,4 +411,4 @@ uninstall: -include $(patsubst %.o, dep/%.d, $O) -.PHONY: check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py +.PHONY: check-full check-vpi check-vvp check-vvp-py check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py diff --git a/aclocal.m4 b/aclocal.m4 index 5f2a09eb8..628e0c380 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -17,6 +17,7 @@ m4_include([m4/ax_c99_strtod.m4]) m4_include([m4/ax_c_picflag.m4]) m4_include([m4/ax_c_underscores_leading.m4]) m4_include([m4/ax_c_underscores_trailing.m4]) +m4_include([m4/ax_configure_args_no_prefix.m4]) m4_include([m4/ax_cxx_compile_stdcxx.m4]) m4_include([m4/ax_enable_suffix.m4]) m4_include([m4/ax_ld_extralibs.m4]) diff --git a/configure.ac b/configure.ac index c8524f106..8342dfa55 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,9 @@ AC_CONFIG_HEADERS([tgt-vvp/vvp_config.h]) AC_CONFIG_HEADERS([tgt-vhdl/vhdl_config.h]) AC_CONFIG_HEADERS([tgt-pcb/pcb_config.h]) +dnl used by ivtest +AX_CONFIGURE_ARGS_NO_PREFIX + AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_CC diff --git a/ivtest/Makefile.in b/ivtest/Makefile.in index a68469b04..a7cac35d0 100644 --- a/ivtest/Makefile.in +++ b/ivtest/Makefile.in @@ -17,6 +17,8 @@ # SHELL = /bin/sh +abs_builddir=@abs_builddir@ +abs_top_srcdir=@abs_top_srcdir@ abs_srcdir=@abs_srcdir@ srcdir=@srcdir@ suffix = @install_suffix@ @@ -26,15 +28,34 @@ else opts = --suffix=$(suffix) endif +AX_CONFIGURE_ARGS_NO_PREFIX=@AX_CONFIGURE_ARGS_NO_PREFIX@ + all: check: +build/Makefile: + mkdir -p build + cd build && $(abs_top_srcdir)/configure $(AX_CONFIGURE_ARGS_NO_PREFIX) --prefix=$(abs_builddir)/install + $(MAKE) -C build install + +check-full: build/Makefile + make -C build/ivtest check-installed + +check-vpi: build/Makefile + make -C build/ivtest check-installed-vpi + +check-vvp: build/Makefile + make -C build/ivtest check-installed-vvp + +check-vvp-py: build/Makefile + make -C build/ivtest check-installed-vvp-py + check-installed: @status=0; \ + $(MAKE) check-installed-vpi || status=1; \ $(MAKE) check-installed-vvp || status=1; \ $(MAKE) check-installed-vvp-py || status=1; \ - $(MAKE) check-installed-vpi || status=1; \ exit $$status check-installed-vpi: @@ -56,6 +77,7 @@ check-installed-vvp-py: clean: rm -f $(srcdir)/*.vpi rm -rf $(srcdir)/log $(srcdir)/vpi_log $(srcdir)/work + rm -rf build install distclean: clean rm -f Makefile @@ -67,4 +89,4 @@ uninstall: Makefile: $(srcdir)/Makefile.in ../config.status cd ..; ./config.status --file=ivtest/$@ -.PHONY: check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py +.PHONY: check-full check-vpi check-vvp check-vvp-py check-installed check-installed-vpi check-installed-vvp check-installed-vvp-py diff --git a/m4/ax_configure_args_no_prefix.m4 b/m4/ax_configure_args_no_prefix.m4 new file mode 100644 index 000000000..e2c644bb3 --- /dev/null +++ b/m4/ax_configure_args_no_prefix.m4 @@ -0,0 +1,24 @@ +AC_DEFUN([AX_CONFIGURE_ARGS_NO_PREFIX],[ + ax_configure_args_no_prefix= + ax_skip_next=no + + for ac_arg in $(echo "$ac_configure_args" | sed "s,',,g"); do + if test "x$ax_skip_next" = "xyes"; then + ax_skip_next=no + continue + fi + + case $ac_arg in + --prefix) + ax_skip_next=yes + ;; + --prefix=*) + ;; + *) + ax_configure_args_no_prefix="$ax_configure_args_no_prefix '$ac_arg'" + ;; + esac + done + + AC_SUBST([AX_CONFIGURE_ARGS_NO_PREFIX], [$ax_configure_args_no_prefix]) +])