Libsdl static compiling under linux

Hi there.

short and simply question: which is the correct way to statically
compile libsd inside my application under Linux?

this is a standard way:
gcc sdl-config --cflags sdl-config --libs main.o -o d_sdl

I also tried with sdl-config --static-libs… before, after “-o”…
I already tried all the combinations.

Anyone can help me plz?
Tnx

Mario

? Thu, 18 Oct 2007 22:20:30 +0200
mario ??:

Hi there.

short and simply question: which is the correct way to statically
compile libsd inside my application under Linux?

this is a standard way:
gcc sdl-config --cflags sdl-config --libs main.o -o d_sdl

I also tried with sdl-config --static-libs… before, after “-o”…
I already tried all the combinations.

Anyone can help me plz?
Tnx

Mario

I don’t think it’s a good idea, SDL library still needs other, will you
complie this libraries in your application.

Regards!

/*
*Welcome to cocobear’s home!
*http://cocobear.cn
*/

yes… I know.
and I know that SDL needs a lot of other .so
that is the problem: I don’t know how to statically compile all of them.
I should list on the compile line all the -Xlib --phtheads -lalsa
-lframebuffer blablabla
I was looking for a simpler way.

The goal was to (g)profile my game.
gprof can’t profile shared library: so I need a static application.

Now I’m looking if is there another better profiler (under linux).
Tnx
MarioOn 10/19/07, cocobear <cocobear.cn at gmail.com> wrote:

short and simply question: which is the correct way to statically
compile libsd inside my application under Linux?

I don’t think it’s a good idea, SDL library still needs other, will you
complie this libraries in your application.

I’m statically compiling with the SDL Debian package using:
LIBS="-Wl,-Bstatic
-lSDL
-lvga -ldirectfb -ldirect -lfusion
-lcaca -lcucul -laa -lslang -lcurses
-laudio -lesd -lartsc -lasound -lgpm
-lm
-Wl,-Bdynamic -lX11 -ldl -lpthread -lstdc++"

I could not statically compile the last libraries (X11, dl, etc.), I
had to left them as dynamic. You may need less libraries if you’re
using your own SDL (with fewer backends enabled).

I think --static-libs should include that, alas this is not the case.On Fri, Oct 19, 2007 at 12:32:50PM +0200, mario wrote:

On 10/19/07, cocobear <cocobear.cn at gmail.com> wrote:

short and simply question: which is the correct way to statically
compile libsd inside my application under Linux?

I don’t think it’s a good idea, SDL library still needs other, will you
complie this libraries in your application.

yes… I know.
and I know that SDL needs a lot of other .so
that is the problem: I don’t know how to statically compile all of them.
I should list on the compile line all the -Xlib --phtheads -lalsa
-lframebuffer blablabla
I was looking for a simpler way.

The goal was to (g)profile my game.
gprof can’t profile shared library: so I need a static application.

Now I’m looking if is there another better profiler (under linux).
Tnx


Sylvain
Ref: http://git.sv.gnu.org/gitweb/?p=freedink.git;a=blob;f=doc/static-build.txt;h=aa464b4f6768b430268d56cc6f344a57568680eb