It becomes increasingly hard to find libraries that can only be built with Autotools and don't support more modern build system.
But every once in a while you'll find one. Or you'll find one that can be built with both, but with broken CMake support.
I'll be using FreeType for this demonstration, since OpenAL that I've used for the CMake demo doesn't support Autotools.
Download the source code from the link above (click Download, then click on the latest version, e.g. freetype-2.13.3.tar.gz at the time of writing).
.tar.gz is an archive format, not unlike .zip. Modern Windows should be able to work with it by default; if not, install 7zip.
pacman -S make(Note that we're installing make and not mingw-w64-clang-x86_64-make, though the latter could work too, and having both isn't a problem.)
For example, I unzipped the source to C:\code\freetype-2.13.3, created an empty directory at C:\code\freetype_build, and cded to it.
cd /c/code
mkdir freetype_build
cd freetype_buildThis needs to be done in the MSYS2 terminal (or at least in some form of Bash).
From the build directory (without cding to the source directory), run
path/to/configure --prefix=MyInstallDir
Where MyInstallDir is the desired installation directory.
E.g. I ran ../freetype-2.13.3/configure --prefix=/c/code/freetype_install. (Here .. refers to the parent directory, so this is equivalent to /c/code/freetype-2.13.3/configure --prefix=/c/code/freetype_install.)
You'll often see people not create a separate build directory, and run ./configure directly from the source directory. This works, but then you'll have the temporary build files all over the source code, which can be then hard to clean up.
To compile the library, run make -j`nproc` and wait.
-j... has the same meaning as with CMake, but in Make it defaults to -j1, so we need to manually pass a larger number. `nproc` expands to the number of CPU cores (it runs the program called nproc and pastes its output).
Like with CMake, there's an optional (but recommended) installation step after building the library.
Run make install, and everything should be installed to the directory that you passed to --prefix=....
You can delete the build directory, as it shouldn't be needed anymore. And the source directory too, if you want.
For using the resulting library, proceed back to this.
If you now try to look at the library source code, you might see some red squiggles.
Normally this is solved by generating a file called compile_commands.json, but in this case we're out of luck because the tool used to generate it for Autotools (bear) only works on Linux, and MSYS2 doesn't have a port of it.
You can try making a small program that generates one based on the output of make (look at what CMake generates for inspiration). Since Autotools is so rarely used nowadays, this is left as an exercise to the reader.