The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
OS X and sdl2-config --static-libs
Dominus


Joined: 13 Oct 2009
Posts: 127
Hi all,

I'm used to building some project snapshots with static libs and used to get those for SDL 1.2x via "sdl-config --static-libs".

Now that one of them has been partially ported to SDL2 I found that "sdl2-config --static-libs" does NOT return the static libs of SDL2.

When I compared the two configs I found that

- sdl-config --static-libs has the lines
Code:
--static-libs)
#    --libs|--static-libs)
      echo -L${exec_prefix}/lib  ${libdir}/libSDL.a  -lm -liconv -Wl,manyframeworks


- sdl2-config --static-libs has the lines
Code:
--static-libs)
#    --libs|--static-libs)
      echo -L${exec_prefix}/lib  ${libdir}/libSDLmain.a ${libdir}/libSDL.a  -Wl,manyframeworks


Further digging led me to configure.in which is missing the special OS X case that SDL 1.2x had:
Code:
case "$ARCH" in
  macosx)
    if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
      SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
    fi
    if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
      SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
    fi
    # Evil hack to allow static linking on Mac OS X
    SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
    ;;
  *)
    SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
    ;;
esac


Then traced it back to revison Revision: 6303 and bug https://bugzilla.libsdl.org/show_bug.cgi?id=1429
I would still like to build statically with this option. I mean, I can just manually edit sdl2-config but I want to understand why you removed it.
As per the bug report I don't understand how --libs could be affected by this. But then I hardly understand everything around code Smile
Re: OS X and sdl2-config --static-libs
Dominus


Joined: 13 Oct 2009
Posts: 127
Dominus wrote:
Hi all,

I'm used to building some project snapshots with static libs and used to get those for SDL 1.2x via "sdl-config --static-libs".

Now that one of them has been partially ported to SDL2 I found that "sdl2-config --static-libs" does NOT return the static libs of SDL2.

When I compared the two configs I found that

- sdl-config --static-libs has the lines
Code:
--static-libs)
#    --libs|--static-libs)
      echo -L${exec_prefix}/lib  ${libdir}/libSDL.a  -lm -liconv -Wl,manyframeworks


- sdl2-config --static-libs has the lines
Code:
--static-libs)
#    --libs|--static-libs)
      echo -L${exec_prefix}/lib  ${libdir}/libSDLmain.a ${libdir}/libSDL.a  -Wl,manyframeworks


Further digging led me to configure.in which is missing the special OS X case that SDL 1.2x had:
Code:
case "$ARCH" in
  macosx)
    if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
      SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
    fi
    if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
      SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
    fi
    # Evil hack to allow static linking on Mac OS X
    SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
    ;;
  *)
    SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
    ;;
esac


Then traced it back to revison Revision: 6303 and bug https://bugzilla.libsdl.org/show_bug.cgi?id=1429
I would still like to build statically with this option. I mean, I can just manually edit sdl2-config but I want to understand why you removed it.
As per the bug report I don't understand how --libs could be affected by this. But then I hardly understand everything around code Smile


Also you might need to change docs/README-macosx.md accordingly.
OS X and sdl2-config --static-libs
Joseph Carter


Joined: 20 Sep 2013
Posts: 279
On Sat, Jan 10, 2015 at 11:44:03PM +0000, Dominus wrote:
Quote:

Dominus wrote:
Quote:
Hi all,

I'm used to building some project snapshots with static libs and used to get those for SDL 1.2x via "sdl-config --static-libs".

Now that one of them has been partially ported to SDL2 I found that "sdl2-config --static-libs" does NOT return the static libs of SDL2.

When I compared the two configs I found that

- sdl-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDL.a -lm -liconv -Wl,manyframeworks



- sdl2-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDLmain.a ${libdir}/libSDL.a -Wl,manyframeworks



Further digging led me to configure.in which is missing the special OS X case that SDL 1.2x had:

Code:
case "$ARCH" in
macosx)
if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
fi
if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
fi
# Evil hack to allow static linking on Mac OS X
SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
;;
*)
SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
;;
esac



Then traced it back to revison Revision: 6303 and bug https://bugzilla.libsdl.org/show_bug.cgi?id=1429
I would still like to build statically with this option. I mean, I can just manually edit sdl2-config but I want to understand why you removed it.
As per the bug report I don't understand how --libs could be affected by this. But then I hardly understand everything around code Smile


Also you might need to change docs/README-macosx.md accordingly.

And Cocoa only. No carbon anymore.

Joseph


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: OS X and sdl2-config --static-libs
Dominus


Joined: 13 Oct 2009
Posts: 127
Joseph Carter wrote:
On Sat, Jan 10, 2015 at 11:44:03PM +0000, Dominus wrote:
Quote:

Dominus wrote:
Quote:
Hi all,

I'm used to building some project snapshots with static libs and used to get those for SDL 1.2x via "sdl-config --static-libs".

Now that one of them has been partially ported to SDL2 I found that "sdl2-config --static-libs" does NOT return the static libs of SDL2.

When I compared the two configs I found that

- sdl-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDL.a -lm -liconv -Wl,manyframeworks



- sdl2-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDLmain.a ${libdir}/libSDL.a -Wl,manyframeworks



Further digging led me to configure.in which is missing the special OS X case that SDL 1.2x had:

Code:
case "$ARCH" in
macosx)
if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
fi
if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
fi
# Evil hack to allow static linking on Mac OS X
SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
;;
*)
SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
;;
esac



Then traced it back to revison Revision: 6303 and bug https://bugzilla.libsdl.org/show_bug.cgi?id=1429
I would still like to build statically with this option. I mean, I can just manually edit sdl2-config but I want to understand why you removed it.
As per the bug report I don't understand how --libs could be affected by this. But then I hardly understand everything around code Smile


Also you might need to change docs/README-macosx.md accordingly.

And Cocoa only. No carbon anymore.

Joseph

It's set somewhere else in configure.in these days, as the carbon framework is still needed (SDL_cocoakeyboards.m and SDL_cocoamodes.m).
OS X and sdl2-config --static-libs
John
Guest

It works if you built the static libs when you built SDL, and the shared libs
are not present in that dir. Roughly,

## build SDL2 like this
$ ./configure --disable-shared --prefix=foo

## link your app with this
$ foo/bin/sdl2-config --static-libs










On 01/12/2015 07:45 PM, Dominus wrote:
Quote:

Joseph Carter wrote:
Quote:
On Sat, Jan 10, 2015 at 11:44:03PM +0000, Dominus wrote:

Quote:

Dominus wrote:

Quote:
Hi all,

I'm used to building some project snapshots with static libs and used to get those for SDL 1.2x via "sdl-config --static-libs".

Now that one of them has been partially ported to SDL2 I found that "sdl2-config --static-libs" does NOT return the static libs of SDL2.

When I compared the two configs I found that

- sdl-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDL.a -lm -liconv -Wl,manyframeworks



- sdl2-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDLmain.a ${libdir}/libSDL.a -Wl,manyframeworks



Further digging led me to configure.in which is missing the special OS X case that SDL 1.2x had:

Code:
case "$ARCH" in
macosx)
if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
fi
if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
fi
# Evil hack to allow static linking on Mac OS X
SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
;;
*)
SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
;;
esac



Then traced it back to revison Revision: 6303 and bug https://bugzilla.libsdl.org/show_bug.cgi?id=1429
I would still like to build statically with this option. I mean, I can just manually edit sdl2-config but I want to understand why you removed it.
As per the bug report I don't understand how --libs could be affected by this. But then I hardly understand everything around code Smile



Also you might need to change docs/README-macosx.md accordingly.


And Cocoa only. No carbon anymore.

Joseph


It's set somewhere else in configure.in these days, as the carbon framework is still needed (SDL_cocoakeyboards.m and SDL_cocoamodes.m).







_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: OS X and sdl2-config --static-libs
Dominus


Joined: 13 Oct 2009
Posts: 127
Yes, that should work, but it's not practical to not have the shared lib files Sad

John wrote:
It works if you built the static libs when you built SDL, and the shared libs
are not present in that dir. Roughly,

## build SDL2 like this
$ ./configure --disable-shared --prefix=foo

## link your app with this
$ foo/bin/sdl2-config --static-libs










On 01/12/2015 07:45 PM, Dominus wrote:
Quote:

Joseph Carter wrote:
Quote:
On Sat, Jan 10, 2015 at 11:44:03PM +0000, Dominus wrote:

Quote:

Dominus wrote:

Quote:
Hi all,

I'm used to building some project snapshots with static libs and used to get those for SDL 1.2x via "sdl-config --static-libs".

Now that one of them has been partially ported to SDL2 I found that "sdl2-config --static-libs" does NOT return the static libs of SDL2.

When I compared the two configs I found that

- sdl-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDL.a -lm -liconv -Wl,manyframeworks



- sdl2-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDLmain.a ${libdir}/libSDL.a -Wl,manyframeworks



Further digging led me to configure.in which is missing the special OS X case that SDL 1.2x had:

Code:
case "$ARCH" in
macosx)
if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
fi
if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
fi
# Evil hack to allow static linking on Mac OS X
SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
;;
*)
SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
;;
esac



Then traced it back to revison Revision: 6303 and bug https://bugzilla.libsdl.org/show_bug.cgi?id=1429
I would still like to build statically with this option. I mean, I can just manually edit sdl2-config but I want to understand why you removed it.
As per the bug report I don't understand how --libs could be affected by this. But then I hardly understand everything around code Smile



Also you might need to change docs/README-macosx.md accordingly.


And Cocoa only. No carbon anymore.

Joseph


It's set somewhere else in configure.in these days, as the carbon framework is still needed (SDL_cocoakeyboards.m and SDL_cocoamodes.m).







_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: OS X and sdl2-config --static-libs
Dominus


Joined: 13 Oct 2009
Posts: 127
Yes, that should work, but it's not practical to not have the shared lib files Sad

John wrote:
It works if you built the static libs when you built SDL, and the shared libs
are not present in that dir. Roughly,

## build SDL2 like this
$ ./configure --disable-shared --prefix=foo

## link your app with this
$ foo/bin/sdl2-config --static-libs










On 01/12/2015 07:45 PM, Dominus wrote:
Quote:

Joseph Carter wrote:
Quote:
On Sat, Jan 10, 2015 at 11:44:03PM +0000, Dominus wrote:

Quote:

Dominus wrote:

Quote:
Hi all,

I'm used to building some project snapshots with static libs and used to get those for SDL 1.2x via "sdl-config --static-libs".

Now that one of them has been partially ported to SDL2 I found that "sdl2-config --static-libs" does NOT return the static libs of SDL2.

When I compared the two configs I found that

- sdl-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDL.a -lm -liconv -Wl,manyframeworks



- sdl2-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDLmain.a ${libdir}/libSDL.a -Wl,manyframeworks



Further digging led me to configure.in which is missing the special OS X case that SDL 1.2x had:

Code:
case "$ARCH" in
macosx)
if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
fi
if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
fi
# Evil hack to allow static linking on Mac OS X
SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
;;
*)
SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
;;
esac



Then traced it back to revison Revision: 6303 and bug https://bugzilla.libsdl.org/show_bug.cgi?id=1429
I would still like to build statically with this option. I mean, I can just manually edit sdl2-config but I want to understand why you removed it.
As per the bug report I don't understand how --libs could be affected by this. But then I hardly understand everything around code Smile



Also you might need to change docs/README-macosx.md accordingly.


And Cocoa only. No carbon anymore.

Joseph


It's set somewhere else in configure.in these days, as the carbon framework is still needed (SDL_cocoakeyboards.m and SDL_cocoamodes.m).







_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
OS X and sdl2-config --static-libs
John
Guest

A simple fix is to cut out the middlemen (sdl2-config and autoconf) from your
build, and just link directly to /prefix/lib/libSDL.a or libSDL.so as you like.

Anotehr simple fix is to post-process the output of `sdl2-config` to replace
-lSDL2 with /prefix/lib/SDL2.a as needed.



On 01/14/2015 04:26 AM, Dominus wrote:
Quote:
Yes, that should work, but it's not practical to not have the shared lib files Sad


John wrote:
Quote:
It works if you built the static libs when you built SDL, and the shared libs
are not present in that dir. Roughly,

## build SDL2 like this
$ ./configure --disable-shared --prefix=foo

## link your app with this
$ foo/bin/sdl2-config --static-libs










On 01/12/2015 07:45 PM, Dominus wrote:

Quote:

Joseph Carter wrote:

Quote:
On Sat, Jan 10, 2015 at 11:44:03PM +0000, Dominus wrote:


Quote:

Dominus wrote:


Quote:
Hi all,

I'm used to building some project snapshots with static libs and used to get those for SDL 1.2x via "sdl-config --static-libs".

Now that one of them has been partially ported to SDL2 I found that "sdl2-config --static-libs" does NOT return the static libs of SDL2.

When I compared the two configs I found that

- sdl-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDL.a -lm -liconv -Wl,manyframeworks



- sdl2-config --static-libs has the lines

Code:
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib ${libdir}/libSDLmain.a ${libdir}/libSDL.a -Wl,manyframeworks



Further digging led me to configure.in which is missing the special OS X case that SDL 1.2x had:

Code:
case "$ARCH" in
macosx)
if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
fi
if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
fi
# Evil hack to allow static linking on Mac OS X
SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
;;
*)
SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
;;
esac



Then traced it back to revison Revision: 6303 and bug https://bugzilla.libsdl.org/show_bug.cgi?id=1429
I would still like to build statically with this option. I mean, I can just manually edit sdl2-config but I want to understand why you removed it.
As per the bug report I don't understand how --libs could be affected by this. But then I hardly understand everything around code Smile




Also you might need to change docs/README-macosx.md accordingly.



And Cocoa only. No carbon anymore.

Joseph



It's set somewhere else in configure.in these days, as the carbon framework is still needed (SDL_cocoakeyboards.m and SDL_cocoamodes.m).







_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org








_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org