Try finding SDL2 with pkg-config before sdl2-config
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
As discussed on IRC, pkg-config handles cross-compiling a lot better than sdl2-config does. I did not give SDL1 the same treatment because the logic around this seems much more complex and I don't really care about it anyway! The patch is actually simpler than it looks because it's mostly whitespace changes.
I think that you should remove the SDL2 prefix stuff -- it's pointless! VICE never will need a prefix!
sdl2.pcandsdl2-configalways point directly to the headers directory.I would agree but the MacOS case gets in the way. I'm not very familiar with the platform so I don't really know what this "framework" stuff is but if I change
<SDL2/SDL.h>to just<SDL.h>here then it won't work and I don't think-F$FW_DIR/SDL2will work either.Ping? Carrying this patch in Gentoo is annoying as we have to do an autoreconf and that's particularly awkward when there are multiple configure scripts. I know the issue above was not resolved but this is still an improvement regardless.
What exactly is the problem that is fixed here? I am using gentoo myself, and never had a problem building any of the ports shrug
As mentioned above, it helps with more exotic situations like cross-compiling. For example, if you use sdl2-config, it will add
-I/usr/include/SDL2instead of-I/path/to/cross/system/usr/include/SDL2. pkg-config is much smarter than this. I'm Gentoo's "cross guy" so I deal with this sort of thing a lot. I even had curl upstream admit that pkg-config should generally be used over their own curl-config script the other day.Last edit: James Le Cuirot 2020-09-10
I'd like to get this patch in before 3.5, but I cannot check if it breaks on MacOS. Perhaps @dqh can have a peek to see if there's any breakage to be expected on MacOS?
Have we had any progress on this?
so the patch appears to work fine on macOS + macports. I discovered that sdl2_image isn't being found when mac deps are installed using homebrew, but we also have this problem in the unpatched configure.ac so this patch isn't at fault.
The SDL2 folder prefix thing appears to be needed on macOS for both macports and homebrew.
actually nope. SDL2 prefix isn't needed on mac
Looks like this patch was implemented, more or less. The patch is against configure.proto, which doesn't exist anymore, but we do now using pkg-config for SDL2, the sdl2-config stuff has been removed in current configure.ac.
So can we close this as 'accepted', if only just for pointing us in the right direction?
Also, since I've added a dependency on SDL2_image, which needs to be checked for by pkg-config, not sdl2-config, the whole sdl2-config stuff seems moot.
I've seen the changes now and they look great but I haven't tried them yet. I trust they work though so please go ahead and close this.
Indeed this works for me on Linux, Windows and even Haiku. Closing.