Menu

#3 Set up a fallback if pkg-config fails

open
6
2011-11-02
2011-11-02
bluekirby0
No

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.

Discussion

  • bluekirby0

    bluekirby0 - 2011-11-05

    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.

     
  • bluekirby0

    bluekirby0 - 2011-11-05

    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.

     
  • BaSF

    BaSF - 2011-11-06

    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?

     
  • bluekirby0

    bluekirby0 - 2011-11-08

    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?

     
  • bluekirby0

    bluekirby0 - 2011-11-08

    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.

     

Log in to post a comment.