SDL2 and SDL2_image build incorrectly when using MSYS2

Hello, my software configuration is:

  • Windows 7 SP1
  • MSYS2 20161025:
  • 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 error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation. error: possibly undefined macro: AC_CHECK_DEFINE error: possibly undefined macro: AM_PATH_ALSA 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.