Set up a fallback if pkg-config fails
Virtual machine implementation for visual novel games
Status: Beta
Brought to you by:
basftech
Currently, pkg-config is called for all supported libraries, and the checks for unsupported libraries are non-existent. Set up configure.ac to check if pkg-config is available on the system, and to use it if it exists. If not, fall back on libtool. If that fails, use the simple compiler tests of the pre-processor.
It should also be set so that if one individual check type fails on a library that should support that check, it will attempt the next one in order of priority. Priority should always be:
pkg-config->libtool->pre-processor
This way we can ensure that it will work quickly on "ideal" build environments, while still functioning as intended in more sparsely equipped systems.
Looks like libtool archives are slowly being deprecated, so I'll just focus on adding in the pre-processor compiled tests as the backup if pkg-config fails.
Honestly, because of how the pkg-config macros work, it is going to turn into a mess if I try to implement fallbacks...and the number of users that would be helpful to is pretty small.
There has been an issue with at least one distro's ubuntu package for SDL_ttf not having the .pc file included, but that can be solved either by compiling from source or hand-making the SDL_ttf.pc with the proper values.
I know it is a pain, but unless people really start wanting support for building on systems without pkg-config installed, it just isn't worth the mess it will make in the configure.ac script.
Sounds good, the .pc file seems to be an ubuntu-issue, so its out of our hands. But it might be nice to leave a copy of the file in an extras/build folder or something like that?
If we do that then we need to leave specific instructions how to edit it...though it should only require the prefix be changed for the majority of systems. Some systems use /usr while some use /usr/local and for mingw systems there isn't a standard prefix...but most people use /mingw on msys and cygwin...as for cross-compilers...well we'll assume anyone cross-compiling knows what they are doing. I could implement the check just for SDL_ttf without getting too ugly. Maybe I should submit a report to the maintainer?
Hmm...well it seems the problem is in the dated version of SDL_ttf in Ubuntu. As soon as the version gets updated to the current upstream the pkg-config files should be added as well. The version in the repositories is pretty dated, so hopefully they will update it soon.