SDL2 and SDL2_image build incorrectly when using MSYS2

Hello, my software configuration is:

  • Windows 7 SP1
  • MSYS2 20161025: http://www.msys2.org/
  • GCC 7.2.0 (Rev1, Built by MSYS2 project)
  • SDL2 2.0.7
  • SDL2_image 2.0.2

The problem: when using the configure script there is no way to specify the “msys2” host, and if “mingw32” (or no host) is specified then the script checks for the mingw32 library (see have_mingw32 test), which doesn’t exist, and defaults to adding a Cygwin dependency -lcygwin (!!!), which results in SDL2_image being unable to build (with a misleading error message about not finding SDL 2, no less).

CMake can be used to build SDL2 however SDL2_image doesn’t have any CMake files and its configure script it will complain about not finding the bin/sdl2-config script which SDL2’s CMake doesn’t generate in the first place, and also the output filenames are different (SDL2.dll vs libSDL2.dll etc.)

I’d appreciate it if you could provide for me the CMake files for SDL2_image, then you could add them to its future 2.0.3 release.

Otherwise could you give me the command line for using autoconf (2.69) to regenerate the configure script? Simply running it as-is on the unmodified configure_in gives this output and produces a configure script with syntax errors:

$ autoconf
configure.in:53: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.in:243: error: possibly undefined macro: AC_CHECK_DEFINE
configure.in:813: error: possibly undefined macro: AM_PATH_ALSA
configure.in:909: error: possibly undefined macro: AM_PATH_ESD

In conclusion, please help me in one (or both) of the following ways:

  1. Provide CMakeLists.txt and other relevant CMake files for SDL2_image.
  2. Guide me how to use autoconf correctly to regenerate configure after fixing the have_mingw32 portion in configure_in.

Thank you.