Fixed bug #674
authorSam Lantinga <slouken@libsdl.org>
Mon, 21 Sep 2009 10:23:19 +0000
changeset 32930d60bdebed39
parent 3292 245a7d79577c
child 3294 470d0a416aa7
Fixed bug #674

Matej 2009-01-08 09:25:34 PST

Hello,
I maintain a cross-platform project that uses SDL.
One of the users who runs OSX has told me that he has problems with linking to
SDL due to missing -framework option.
I think that the problem is because of this:
'sdl-config --libs' outputs '-L/opt/local/lib -lSDLmain -lSDL
-Wl,-framework,Cocoa'
All the options are passed to the linker except the last one. I think that the
good output should be just:
'-L/opt/local/lib -lSDLmain -lSDL -framework Cocoa'
since those options (--libs) are passed to the linker, so the '-Wl' option is
redundant and possibly harmful in this very case
I use autotools with libtool to do the build...
Regards,
Matej
configure.in
test/configure.in
     1.1 --- a/configure.in	Mon Sep 21 09:21:00 2009 +0000
     1.2 +++ b/configure.in	Mon Sep 21 10:23:19 2009 +0000
     1.3 @@ -1644,7 +1644,7 @@
     1.4          case "$host" in
     1.5              *-*-darwin*)
     1.6                  if test x$enable_video_cocoa = xyes; then
     1.7 -                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
     1.8 +                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework OpenGL"
     1.9                  fi
    1.10          esac
    1.11      fi
    1.12 @@ -2657,7 +2657,7 @@
    1.13              AC_DEFINE(SDL_HAPTIC_IOKIT)
    1.14              SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
    1.15              have_haptic=yes
    1.16 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
    1.17 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework ForceFeedback"
    1.18          fi
    1.19          # Set up files for the power library
    1.20          if test x$enable_power = xyes; then
    1.21 @@ -2674,12 +2674,12 @@
    1.22          # The Mac OS X platform requires special setup.
    1.23          EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
    1.24          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
    1.25 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
    1.26 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
    1.27 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
    1.28 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework Cocoa"
    1.29 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework Carbon"
    1.30 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework IOKit"
    1.31          # If either the audio or CD driver is used, add the AudioUnit framework
    1.32          if test x$enable_audio = xyes; then
    1.33 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
    1.34 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework CoreAudio -framework AudioToolbox -framework AudioUnit"
    1.35          fi
    1.36          ;;
    1.37      *-riscos)
     2.1 --- a/test/configure.in	Mon Sep 21 09:21:00 2009 +0000
     2.2 +++ b/test/configure.in	Mon Sep 21 10:23:19 2009 +0000
     2.3 @@ -28,7 +28,7 @@
     2.4      *-*-darwin* )
     2.5          EXE=""
     2.6          MATHLIB=""
     2.7 -        SYS_GL_LIBS="-Wl,-framework,OpenGL"
     2.8 +        SYS_GL_LIBS="-framework OpenGL"
     2.9          ;;
    2.10      *-*-aix*)
    2.11          EXE=""