Closed dmitrysmagin closed 8 months ago
Can you please create some PRs?
update aclocal to use m4/ directory and put initial needed m4 files there, including pkg.m4
getopt.h getopt1.c should probably be updated to receive char *const argv[]
which is what GNU libc getopt_long() implementation expect, removing the need to that typecast
rename sdl.h to avoid name-clash (we can probably expect that different compilers to have different order of include directories)
Add support for SDL2.0 and fallback to SDL1.2. For audio I believe the API is identical, and perhaps fixes a couple of the issues.
Created PR: https://github.com/adplug/adplay-unix/pull/23
Hi. It's possible to compile a console application with mingw32, though you need some manual config
0) I needed to create a ./m4 subfolder and put pkg.m4 inside in order to configure properly. I used this https://github.com/pkgconf/pkgconf/blob/master/pkg.m4 and changed Makefile.am and configure.ac accordingly:
Only after that the command
autoreconf --install
finished successfully1) After that I was able to execute
./configure --prefix=/mingw CXXFLAGS=-fpermissive
. But before configuring it's better to fix SDL (below)2) SDL config problem. By default
sdl-config
script forces your application to be a windows app, not console, and it intercepts output to sderr and stdout and redirects it into files. I've found if you edit sdl-config the configure will fail (sdl won't be found) so I had to edit the resulting Makefile in the following way: removed-Dmain=SDL_main
and-lSDLmain
and changed-mwindows
into-mconsole
Another important thing: insert#undef main
in the adplug.cc right before the main().3) sdl.h header problem. As noted in another issue, windows fs is not case-sensitive, so
#include <SDL.h>
and#include "sdl.h"
are misinterpreted as 'include local sdl.h` by the compiler. To overcome this, better rename ./src/sdl.h into ./src/sdlx.h and change all #includes accordingly4) Strange typecast is needed in adplug.cc:
After all above the make will succeed and the resulting adplay.exe will show output in the console
https://github.com/dmitrysmagin/adplay-unix/commit/3f1135a2048c311a0afc819ee17ac3634930e4c9