diff --git a/Dockerfile.dev b/Dockerfile.dev index bdafe6102c..cff5ee2cc0 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -9,6 +9,9 @@ RUN apt-get install -y make autoconf automake libtool pkg-config # for cross-compiling RUN apt-get install -y mingw32 mingw-w64 libc6-dev-i386 +# for running cross-compiled tests +RUN dpkg --add-architecture i386 && apt-get update && apt-get install -y wine32 wine64 + # for check_yaml WORKDIR /root/src/ RUN apt-get install -y curl patch diff --git a/Makefile.am b/Makefile.am index ebdff8cc76..59b61a47d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,6 +23,7 @@ distwin32-dir : @if which i586-mingw32msvc-gcc >/dev/null; then \ ./configure --host i586-mingw32msvc --prefix=$(CURDIR)/liblouis-$(VERSION)-win32 && \ make LDFLAGS="$$LDFLAGS -avoid-version -Xcompiler -static-libgcc" && \ + make check && \ make install; \ elif which i686-w64-mingw32-gcc >/dev/null; then \ ./configure --host i686-w64-mingw32 --prefix=$(CURDIR)/liblouis-$(VERSION)-win32 && \ diff --git a/configure.ac b/configure.ac index 1e23b933e7..96d2a258b5 100644 --- a/configure.ac +++ b/configure.ac @@ -150,9 +150,12 @@ case $host in *mingw* | *cygwin*) CFLAGS="$CFLAGS -Wl,--add-stdcall-alias" LDFLAGS="$LDFLAGS -avoid-version" + mingw=yes ;; esac +AM_CONDITIONAL([MINGW], [test "$mingw" = yes]) + AC_CONFIG_FILES([ Makefile doc/Makefile diff --git a/tests/Makefile.am b/tests/Makefile.am index a6292cdf8c..a9b040767f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -95,12 +95,16 @@ program_TESTS = \ check_PROGRAMS = $(program_TESTS) -dist_check_SCRIPTS = \ +dist_check_SCRIPTS = + +if !MINGW +dist_check_SCRIPTS += \ check_all_tables.pl \ check_endless_loop.pl \ check_included_tables.sh \ multiple_table_path.pl \ ueb_test_data.pl +endif # The present_progressive should not really fail but for the moment # the issue doesn't seem to be critical enough that anybody has enough @@ -203,8 +207,8 @@ yaml/da-dk-g18-dictionary_harness.yaml \ yaml/vi-g1_harness.yaml \ yaml/zh-chn.yaml -TEST_EXTENSIONS = .yaml -YAML_LOG_COMPILER = $(top_builddir)/tools/lou_checkyaml +TEST_EXTENSIONS = .yaml .pl +YAML_LOG_COMPILER = $(top_builddir)/tools/lou_checkyaml$(EXEEXT) EXTRA_DIST = $(dist_yaml_TESTS) @@ -221,3 +225,9 @@ AM_TESTS_ENVIRONMENT = \ PYTHONPATH=$(top_builddir)/python:$$PYTHONPATH \ LD_LIBRARY_PATH=$(top_builddir)/liblouis/.libs:$$LD_LIBRARY_PATH \ PATH=$(top_builddir)/tools:$$PATH + +if MINGW +# FIXME: is there a way to prepend to LOG_COMPILE instead of to overwrite it? +LOG_COMPILE = wine32 $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +YAML_LOG_COMPILE = wine32 $(YAML_LOG_COMPILER) $(AM_YAML_LOG_FLAGS) $(YAML_LOG_FLAGS) +endif