Commit 1237375c authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #177

The attached patch changes configure.in to use "-framework FOO" instead of
"-Wl,-framework,FOO".

This avoid some issues with certain versions of libtool that do not handle
-framework properly.
Some versions of libtool will try to reorder the two parts of the option, or
render the 2nd part of the argument to the relative path of a non-existent
library.

Note: It is not enough if SDL uses a version of libtool that does this
correctly, because these -framework options show up in "sdl-config --libs".
Hence, some 3rd party apps which still ship with an old libtool have troubles
compiling under Mac OS X.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401618
parent fee38056
...@@ -1413,19 +1413,6 @@ EOF ...@@ -1413,19 +1413,6 @@ EOF
finalize_command="$finalize_command $qarg" finalize_command="$finalize_command $qarg"
continue continue
;; ;;
framework)
case $host in
*-*-darwin*)
case "$deplibs " in
*" $qarg.framework "*) ;;
*) deplibs="$deplibs $qarg.framework" # this is fixed later
;;
esac
;;
esac
prev=
continue
;;
shrext) shrext)
shrext_cmds="$arg" shrext_cmds="$arg"
prev= prev=
...@@ -1802,11 +1789,6 @@ EOF ...@@ -1802,11 +1789,6 @@ EOF
continue continue
;; ;;
-framework)
prev=framework
continue
;;
# Some other compiler flag. # Some other compiler flag.
-* | +*) -* | +*)
# Unknown arguments in both finalize_command and compile_command need # Unknown arguments in both finalize_command and compile_command need
...@@ -2190,18 +2172,6 @@ EOF ...@@ -2190,18 +2172,6 @@ EOF
fi fi
fi fi
;; # -l ;; # -l
*.framework)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
if test "$linkmode" = lib ; then
newdependency_libs="$deplib $newdependency_libs"
fi
fi
continue
;;
-L*) -L*)
case $linkmode in case $linkmode in
lib) lib)
...@@ -2347,13 +2317,6 @@ EOF ...@@ -2347,13 +2317,6 @@ EOF
*) . ./$lib ;; *) . ./$lib ;;
esac esac
case $host in
*-*-darwin*)
# Convert "-framework foo" to "foo.framework" in dependency_libs
test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'`
;;
esac
if test "$linkmode,$pass" = "lib,link" || if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" || test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then { test "$linkmode" != prog && test "$linkmode" != lib; }; then
...@@ -2974,13 +2937,6 @@ EOF ...@@ -2974,13 +2937,6 @@ EOF
done done
path="" path=""
;; ;;
*.framework)
case $host in
*-*-darwin*)
depdepl="$deplib"
;;
esac
;;
*) continue ;; *) continue ;;
esac esac
;; ;;
...@@ -3848,13 +3804,6 @@ EOF ...@@ -3848,13 +3804,6 @@ EOF
fi fi
fi fi
fi fi
# Time to change all our "foo.framework" stuff back to "-framework foo"
case $host in
*-*-darwin*)
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).framework%%g'`
;;
esac
# Done checking deplibs! # Done checking deplibs!
deplibs=$newdeplibs deplibs=$newdeplibs
fi fi
...@@ -4394,15 +4343,12 @@ EOF ...@@ -4394,15 +4343,12 @@ EOF
esac esac
case $host in case $host in
*-*-darwin*) *darwin*)
# Don't allow lazy linking, it breaks C++ global constructors # Don't allow lazy linking, it breaks C++ global constructors
if test "$tagname" = CXX ; then if test "$tagname" = CXX ; then
compile_command="$compile_command ${wl}-bind_at_load" compile_command="$compile_command ${wl}-bind_at_load"
finalize_command="$finalize_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load"
fi fi
# Time to change all our "foo.framework" stuff back to "-framework foo"
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
;; ;;
esac esac
......
...@@ -1444,9 +1444,9 @@ CheckMacGL() ...@@ -1444,9 +1444,9 @@ CheckMacGL()
AC_DEFINE(SDL_VIDEO_OPENGL) AC_DEFINE(SDL_VIDEO_OPENGL)
case "$host" in case "$host" in
*-*-darwin*) *-*-darwin*)
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework OpenGL" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
# The following is probably not available in Darwin: # The following is probably not available in Darwin:
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework AGL" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AGL"
esac esac
fi fi
} }
...@@ -2342,7 +2342,7 @@ case "$host" in ...@@ -2342,7 +2342,7 @@ case "$host" in
if test x$enable_joystick = xyes; then if test x$enable_joystick = xyes; then
AC_DEFINE(SDL_JOYSTICK_IOKIT) AC_DEFINE(SDL_JOYSTICK_IOKIT)
SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c" SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework IOKit" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
have_joystick=yes have_joystick=yes
fi fi
# Set up files for the cdrom library # Set up files for the cdrom library
...@@ -2368,16 +2368,16 @@ case "$host" in ...@@ -2368,16 +2368,16 @@ case "$host" in
EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
SDL_LIBS="-lSDLmain $SDL_LIBS" SDL_LIBS="-lSDLmain $SDL_LIBS"
if test x$enable_video_cocoa = xyes; then if test x$enable_video_cocoa = xyes; then
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework Cocoa" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
fi fi
if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
# The Cocoa backend still needs Carbon, and the YUV code QuickTime # The Cocoa backend still needs Carbon, and the YUV code QuickTime
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework QuickTime -framework ApplicationServices" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuickTime -Wl,-framework,ApplicationServices"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework Carbon" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
fi fi
# If either the audio or CD driver is used, add the AudioUnit framework # If either the audio or CD driver is used, add the AudioUnit framework
if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework AudioToolbox -framework AudioUnit" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
fi fi
;; ;;
*-*-mint*) *-*-mint*)
...@@ -2519,13 +2519,13 @@ fi ...@@ -2519,13 +2519,13 @@ fi
case "$ARCH" in case "$ARCH" in
macosx) macosx)
if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
SDL_LIBS="$SDL_LIBS -framework Cocoa" SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
fi fi
if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
SDL_LIBS="$SDL_LIBS -framework Carbon" SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
fi fi
if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
SDL_LIBS="$SDL_LIBS -framework OpenGL" SDL_LIBS="$SDL_LIBS -Wl,-framework,OpenGL"
fi fi
# Evil hack to allow static linking on Mac OS X # Evil hack to allow static linking on Mac OS X
SDL_STATIC_LIBS="\${exec_prefix}/lib/libSDLmain.a \${exec_prefix}/lib/libSDL.a" SDL_STATIC_LIBS="\${exec_prefix}/lib/libSDLmain.a \${exec_prefix}/lib/libSDL.a"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment