LibSDL_Mixer - static lib is linked to dynamic libs
Dominik Reichardt
domiman at gmail.com
Tue Mar 2 03:49:30 PST 2010
I have to apologize, I seem to have had a bad case of thinking :)
With the ./configure options
--disable-music-mp3-shared \
--disable-music-ogg-shared \
--disable-music-flac-shared
libsdl_mixer gets correctly build, meaning the static lib is not linked against the dynamic libs of its dependencies. So wherever you want to link statically to sdl_mixer you need to add the static libs of sdl_mixer's dependencies.
As dynamic linking still works with these ./configure options, I *think* it should be safe to add these options to the portfile.
I'll add this to the ticket I posted.
Take care,
Dom
Am 01.03.2010 um 16:53 schrieb Dominik Reichardt:
>
> As the SDL forum is taking a special stand against spam, I have to wait a bit before posting there. So I post an additional finding here.
>
> ./configure of libsdl_mixer gives the options:
> --disable-music-mp3-shared \
> --disable-music-ogg-shared \
> --disable-music-flac-shared
>
> which sound like the correct way to do this, unfortunately, doing that does not link either mp3/ogg/flac to the static file, neither dylib or static...
> Probably Apple throwing stones in the way...
>
>
>>>>>
>>>>> I'm struggling with building our game engine (Exult) statically, since we want to have it ready for a possible release soon. After messing around with the hurdles of building programs static, I had been almost successful, only to be plagued by libsdl_mixer. It's static file is dynamic linked to other libs (libvorbis, libogg, libflac) which IMHO defeats the purpose of having a static lib.
>>>>
>>>> That sounds like a valid complaint. For the benefit of those of us not familiar, how do you determine that the static lib is dynamically linked to other libs?
>>>>
>>>
>>> I have no real idea how to tell that. otool does not print out any dylib, though when I look at libsdl_mixer.a directly, I see the references to the dylib files. Also it was clear when Exult was running in the "Activity Monitor.app" that the dylibs were used, even though Exult doesn't link them and libsdl_mixer.a was linked in the exult binary.
>>>
>>>>
>>>>> I'm not sure if that is a ticketable issue or if there is any way to hack around that static/dynamic issue that Apple produced.
>>>>
>>>> Sounds like a valid thing to open a ticket for. Though the libsdl_mixer portfile doesn't appear to do anything special, so a plain from-source build outside of MacPorts would probably also exhibit this problem, so it's probably an upstream problem and should probably be reported there.
>>>>
>>>>
>>>
>>> Yes, building directly from source was not successful as well, and I couldn't "hack" the makefile similar to how I "hacked" the exult makefile to link to the static libs :(
>>> So, this is most likely an upstream problem.
>>>
>>>>> So, again, any way to hack the build of libsdl_mixer to link the libs statically?
>>>>
>>>> I have no idea how to fix this problem. Contacting the developers of this software may be your best bet.
>>>
>>>
>>> I'll try my best, though I fear I know the response already (use the precompiled framework!) :)
>>>
>>> So, I'll open a ticket here and will contact the SDL devs on their forum/ML.
>
> --
> Take care
> Dominik Reichardt
> http://beam.to/Dominik
>
> ""Was hast Du auf der Müllkippe gemacht?"
> "Geatmet."
> "Geatmet?"
> "Hm-Hmh. Geatmet. Und Du?"
> "Nachgedacht."
> "Über was bestimmtes?"
> "Nur daß ich nicht in der gleichen Welt leben möchte, wie die World Wrestling Federation und der Tele-Shop Kanal."
> "Nett.""
> Death - The time of your Live
>
> Ich hörte gerade -
>
--
Take care
Dominik Reichardt
http://beam.to/Dominik
"On the road that I have taken,
one day, walking, I awaken,
amazed to see where I have come,
where I'm going, where I'm from.
This is not the path I thought.
This is not the place I sought.
This is not he dream I bought,
just a fever of fate I caught."
Dean R. Koontz
Ich hörte gerade -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20100302/d1c19b40/attachment.html>
More information about the macports-users
mailing list