[SDL] libSDL2_image: configure behaves differently on Debian vs Ubuntu?
gberardi at gbgames.com
Mon Mar 13 04:42:35 PDT 2017
On 03/02/2017 10:34 PM, Gianfranco Berardi wrote:
> I could always using LD_LIBRARY_PATH or do what the README.txt says
> about setting environment variables myself, but I am curious why running
> configure on one system without doing those things results in behavior
> that is different from the other system.
For posterity's sake, I thought I would respond with the latest
information I have. Please correct me if I am wrong.
When I built the test code that configure was trying, I found that the
issue is with the difference in linkers.
Debian Wheezy is using gcc 4.7, and 4.7's linker seems to add
dependencies because you told it that it that a library should be linked
in. That is, if you tell it to link in SDL2, it will have a dependency
on libSDL2. configure fails because it builds a test program that fails
to find the dependency because the run-time linker doesn't know where to
Ubuntu 14.04 uses gcc 4.8, which has a linker that is smarter about
checking if your resulting binary actually uses anything in the library
before deciding if it is a dependency. If you tell it to link in SDL2,
but none of the SDL2 library is actually used, it won't have a a
dependency. configure passes because the test program doesn't have a
dependency on something in a weird place and so avoids the need to have
its run-time linker pointed in the right direction.
So, in the end, I updated my build scripts so they use LD_LIBRARY_PATH
to point to the lib directory of my custom libraries when running
configure, and it works on both older and newer systems.
Hopefully this information helps someone.
Creating entertainment that encourages curiosity, supports creativity,
and promotes continuous learning: http://www.GBGames.com/
Follow me on Twitter: http://www.twitter.com/GBGames
More information about the SDL