Hmmm, I guess I might be a distribution maintainer that should say
something about this. So for Mac, we have quite a whirlwind of strange
options. All of them may involve developers to kind of know what’s
going on though. Since we use .frameworks on Mac, there is a built-in
versioning mechanism that kind-of-sort-of handles this case. Building
versioned frameworks is kind of a pain in the arse since there almost
no Xcode support for it. But once you have it, it actually might work.
If you look at the framework structure, there is a directory called
Versions inside which contains a subdirectory (usually named A) and a
symlink called Current. The idea is that you put multiple versions of
the actual library there. We might introduce a subdirectory called 1.3
which has all the 1.3 stuff. Leave A as 1.2 for backwards
compatibility.
Then there is a bunch of different layers of abstraction that kick in
if you built a Mac app correctly. For already built executables that
dynamically link, they know to use the full qualified/non-symlink path
to the library that was pointed to by Current when the executable was
built. So if you update the framework and the symlink changes, the
executable still safely links and invokes the legacy version avoiding
breakage.
But newly linked apps always pick the version linked to Current. So
generally they are required to use the new stuff.
It gets harder if developers want to build and link to the old version
of the framework. They must go into their frameworks and change the
symlinks themselves. And they must remember to change back the
symlinks themselves.
This technique also has the downside in code size. We would
effectively double the size of the framework we ship. End users are
free to purge the stuff they want themselves, but I expect most people
won’t feel comfortable enough to do so.
But I should also point out on the Mac that bundling the framework
inside your app (or library) is really the proper thing to do and
maybe we shouldn’t worry about this case at all. On Mac, developers
are expected to do this grunt work so end-users never have to deal
with DLL hell. So we could continue to name the framework “SDL” in
both cases, and force the developer to know which is which and how
their own SDL satellite libraries were compiled.
Also for SDL 1.3, I’m assuming we can drop 10.4 support which means we
can start using @rpath instead of @executable_path which makes it
easier to support embedding inside other libraries instead of just
applications. I have an example of this with the SDL_sound.framework I
built where I embedded an Ogg and Vorbis framework inside.
-EricOn 1/7/11, Nathaniel J Fries wrote:
Sam Lantinga wrote:
Yeah, I’m still mulling this over. The problem is not just SDL, it’s
also all the libraries that depend on SDL. For example, SDL_image at
the same version number can be built for both SDL 1.2 and SDL 1.3, and
I can see people wanting to install both simultaneously.
I sent e-mail to the distribution maintainers a year ago and never
heard anything back from them. Which unfortunately means I just have
to pick a method and watch people complain.
–
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/