Skip to content
Permalink
Browse files

sdl static linking under OS X

  • Loading branch information...
miniupnp committed Jul 6, 2018
1 parent 3cdc8e1 commit 839bac6e02afad34156429333fcd8d943d56f805
Showing with 9 additions and 4 deletions.
  1. +9 −4 config.lib
@@ -1010,9 +1010,14 @@ make_cflags_and_ldflags() {
# SDL must not add _GNU_SOURCE as it breaks many platforms
CFLAGS="$CFLAGS `$sdl_config --cflags | sed 's@-D_GNU_SOURCE[^ ]*@@'`"
if [ "$enable_static" != "0" ]; then
LIBS="$LIBS `$sdl_config --static-libs`"
if [ "$os" = "OSX" ] ; then
libpath=`$sdl_config --static-libs | cut -d ' ' -f 1 | cut -c 3- `
LIBS="$LIBS `$sdl_config --static-libs | sed 's@ -l\([^ ]*\)@ '${libpath}'/lib\1.a@g' `"
else
LIBS="$LIBS `$sdl_config --static-libs`"
fi
if [ $with_sdlimage -gt 0 ]; then
if [ "$os" == "OSX" ] ; then
if [ "$os" = "OSX" ] ; then
LIBS="$LIBS $(pkg-config SDL_image --libs-only-L | cut -c 3- | tr -d ' ')/libSDL_image.a"
else
LIBS="$LIBS -lSDL_image"
@@ -1034,14 +1039,14 @@ make_cflags_and_ldflags() {
# SDL2 must not add _GNU_SOURCE as it breaks many platforms
CFLAGS="$CFLAGS `$sdl2_config --cflags | sed 's@-D_GNU_SOURCE[^ ]*@@'` -DSDL_FORCE_INLINE='static __inline'"
if [ "$enable_static" != "0" ]; then
if [ "$os" == "OSX" ] ; then
if [ "$os" = "OSX" ] ; then
libpath=`$sdl2_config --static-libs | cut -d ' ' -f 1 | cut -b 3- `
LIBS="$LIBS `$sdl2_config --static-libs | cut -d ' ' -f 2- | sed 's@-l\([^ ]*\)@'${libpath}'/lib\1.a@' `"
else
LIBS="$LIBS `$sdl2_config --static-libs`"
fi
if [ $with_sdl2image -gt 0 ]; then
if [ "$os" == "OSX" ] ; then
if [ "$os" = "OSX" ] ; then
LIBS="$LIBS $(pkg-config SDL2_image --libs-only-L | cut -c 3- | tr -d ' ')/libSDL2_image.a"
else
LIBS="$LIBS -lSDL2_image"

0 comments on commit 839bac6

Please sign in to comment.
You can’t perform that action at this time.