[SDL] SDL under Mac OS X

Bob Ippolito bob at redivi.com
Sun Jan 16 08:30:19 PST 2005


On Jan 16, 2005, at 2:27, Matthew Cox wrote:

> Bob Ippolito wrote:
>
>> On Jan 15, 2005, at 23:28, Matthew Cox wrote:
>>
>>> Olivier Fabre wrote:
>>>
>>>> I want to build my game for OS X. SDL shouldn't be statically linked
>>>> because my program isn't GPL. Should I use the "framework" or the
>>>> UNIX-style shared lib system ?
>>>>
>>>> I'd like to be able to keep SDL in my game's directory, too.
>>>>
>>>> I googled and looked at the os x faq on libsdl.org but didn't find 
>>>> the
>>>> answer.
>>>>
>>> It also works fine to include the shared library in the Frameworks 
>>> subtree of the bundle.
>>
>> Assuming it was linked as @executable_path relative, of course.  The 
>> "developer" framework available from libsdl.org is already linked in 
>> this manner so it's less of a hassle.
>
> Sure, I frameworks also have to be linked that way. You can either try 
> and see if you can bodge it with the install_name_tool, or you can 
> just build it from scratch passing that as a linker argument.
>
> I would tend to recommend bundling the library instead of the 
> framework. It seems wasteful to distribute the headers and versioning 
> stuff that a framework entails. No reason you couldn't remove the 
> headers and all that, it's just that at that point why bother with the 
> framework shells? Just my 20 millidollars.

Well, as I said, the prebuilt framework in the developer package is 
already linked as such.  You have to build a custom library in order to 
get that behavior.  The "versioning stuff" is a couple extra 
directories and a few symlinks, so that's really a non-issue.  
Including the headers by default isn't something to worry about either, 
they're not terribly big, they compress awfully well, and they're 
trivial to strip if you really want to take them out.

Frameworks have additional advantages, but SDL doesn't use any of them. 
  For example, SDL could include resources (nibs or plugins for example) 
and reference them relatively to the framework.  You can't do that 
(usefully) with a bare dylib.

I recommend frameworks because it's the easiest way to do it correctly.

-bob





More information about the SDL mailing list