Bundle dependent frameworks into static library

Maybe somebody knows if it possible to somehow bundle dependent framework
into a static lib (libSDL_mixer.a) so I don’t need to link target
application that is using SDL_mixer to FLAC.framework, … So I want
libSDL_mixer.a behave just like SDL_mixer.framework because when I link to
framework version of SDL_mixer I don’t need to link to SDL_mixer’s
dependencies

Yes, you need to statically link all dependent frameworks into your
application.
So instead of having SDL_mixer.framework dynamically link FLAC.framework,
you’ll have your executable link with libsdl_mixer.a and libflac.a.
However I believe this is considered ‘bad practice’ as not only will make
your executable larger but you’ll have to link all the other libraries
brought in by (as in your example) both libsdl_mixer and libflac.

VittorioOn Tue, Nov 13, 2012 at 2:22 AM, Alexey Petruchik wrote:

Maybe somebody knows if it possible to somehow bundle dependent framework
into a static lib (libSDL_mixer.a) so I don’t need to link target
application that is using SDL_mixer to FLAC.framework, … So I want
libSDL_mixer.a behave just like SDL_mixer.framework because when I link to
framework version of SDL_mixer I don’t need to link to SDL_mixer’s
dependencies


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Vittorio Giovara wrote:

However I believe this is considered ‘bad practice’ as not only will make
your executable larger but you’ll have to link all the other libraries
brought in by (as in your example) both libsdl_mixer and libflac.

Depends on who you talk to as to whether it’s bad practice or not.
For distribution of games, it can certainly make things easier in some
cases. The people involved with suckless.org write “quality software
with a focus on simplicity, clarity, and frugality”. One of their
projects is sta.li (static linux). They’ve put together an
interesting FAQ on positive points of using static libraries:
http://sta.li/faq
Bedrock Linux is also using statically linked executables:
http://bedrocklinux.org/introduction.html#Statically-linked Executables

Alexey Petruchik wrote:

Maybe somebody knows if it possible to somehow bundle dependent framework
into a static lib (libSDL_mixer.a) so I don’t need to link target
application that is using SDL_mixer to FLAC.framework

The MXE project (MinGW cross compiler environment) originally used
only statically linked libraries but are now expanding to both static
and dynamic. You can check their build scripts for how they
statically built various SDL related libraries:
http://mxe.cc/

Typically, you’ll want to use --enable-static and/or --disable-shared
at the command line when running configure.

SIncerely,
Laura
http://www.distasis.com/cpp

I wonder if this whole topic is in regards to OSX (especially with the
term framework being used)? There you’re expected to provide
self-contained applications, not programs that have external
dependencies. But I believe you can just bundle the dynamic libraries
inside the bundle (much like how happens with most Windows programs)
and it’ll work just fine, making this a no-brainer. Somebody correct
me if I’m wrong.

2012/11/13 LM :> Vittorio Giovara wrote:

However I believe this is considered ‘bad practice’ as not only will make
your executable larger but you’ll have to link all the other libraries
brought in by (as in your example) both libsdl_mixer and libflac.

Depends on who you talk to as to whether it’s bad practice or not.
For distribution of games, it can certainly make things easier in some
cases. The people involved with suckless.org write “quality software
with a focus on simplicity, clarity, and frugality”. One of their
projects is sta.li (static linux). They’ve put together an
interesting FAQ on positive points of using static libraries:
http://sta.li/faq
Bedrock Linux is also using statically linked executables:
http://bedrocklinux.org/introduction.html#Statically-linked Executables

Alexey Petruchik wrote:

Maybe somebody knows if it possible to somehow bundle dependent framework
into a static lib (libSDL_mixer.a) so I don’t need to link target
application that is using SDL_mixer to FLAC.framework

The MXE project (MinGW cross compiler environment) originally used
only statically linked libraries but are now expanding to both static
and dynamic. You can check their build scripts for how they
statically built various SDL related libraries:
http://mxe.cc/
https://github.com/mxe/mxe/tree/master/src

Typically, you’ll want to use --enable-static and/or --disable-shared
at the command line when running configure.

SIncerely,
Laura
http://www.distasis.com/cpp


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Sik is correct. you are supposed to distribute the frameworks inside the Frameworks directory of the application bundle.
static linking is not the appropriate path on mac os x.

…unless you’re trying to target iOS with the same code base, in which
case, static linking is the only option.~
Doug.

On Mon, Nov 19, 2012 at 1:09 AM, brada wrote:

**
Sik is correct. you are supposed to distribute the frameworks inside the
Frameworks directory of the application bundle.
static linking is not the appropriate path on mac os x.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org