comparison configure.in @ 1931:103c6fec2a60

The Mac OS X Cocoa video driver is under construction... Note that SDLmain is no longer necessary on Mac OS X. :)
author Sam Lantinga <slouken@libsdl.org>
date Sun, 23 Jul 2006 09:11:10 +0000
parents c26194009c9c
children 37a7580357d1
comparison
equal deleted inserted replaced
1930:9483df98e011 1931:103c6fec2a60
1044 SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc" 1044 SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
1045 have_video=yes 1045 have_video=yes
1046 fi 1046 fi
1047 } 1047 }
1048 1048
1049 dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin) 1049 dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
1050 CheckCARBON()
1051 {
1052 AC_ARG_ENABLE(video-carbon,
1053 AC_HELP_STRING([--enable-video-carbon], [use Carbon/QuickDraw video driver [[default=no]]]),
1054 , enable_video_carbon=no)
1055 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
1056 AC_MSG_CHECKING(for Carbon framework)
1057 have_carbon=no
1058 AC_TRY_COMPILE([
1059 #include <Carbon/Carbon.h>
1060 ],[
1061 ],[
1062 have_carbon=yes
1063 ])
1064 AC_MSG_RESULT($have_carbon)
1065 if test x$have_carbon = xyes; then
1066 AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX)
1067 SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c"
1068 SOURCES="$SOURCES $srcdir/src/video/macrom/*.c"
1069 have_video=yes
1070 fi
1071 fi
1072 }
1073
1074 dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
1075 CheckCOCOA() 1050 CheckCOCOA()
1076 { 1051 {
1077 AC_ARG_ENABLE(video-cocoa, 1052 AC_ARG_ENABLE(video-cocoa,
1078 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa/Quartz video driver [[default=yes]]]), 1053 AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
1079 , enable_video_cocoa=yes) 1054 , enable_video_cocoa=yes)
1080 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then 1055 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
1081 save_CFLAGS="$CFLAGS" 1056 save_CFLAGS="$CFLAGS"
1082 dnl work around that we don't have Objective-C support in autoconf 1057 dnl work around that we don't have Objective-C support in autoconf
1083 CFLAGS="$CFLAGS -x objective-c" 1058 CFLAGS="$CFLAGS -x objective-c"
1090 have_cocoa=yes 1065 have_cocoa=yes
1091 ]) 1066 ])
1092 AC_MSG_RESULT($have_cocoa) 1067 AC_MSG_RESULT($have_cocoa)
1093 CFLAGS="$save_CFLAGS" 1068 CFLAGS="$save_CFLAGS"
1094 if test x$have_cocoa = xyes; then 1069 if test x$have_cocoa = xyes; then
1095 AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ) 1070 AC_DEFINE(SDL_VIDEO_DRIVER_COCOA)
1096 SOURCES="$SOURCES $srcdir/src/video/quartz/*.m" 1071 SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
1097 have_video=yes 1072 have_video=yes
1098 fi 1073 fi
1099 fi 1074 fi
1100 } 1075 }
1101 1076
1523 AC_DEFINE(SDL_VIDEO_OPENGL) 1498 AC_DEFINE(SDL_VIDEO_OPENGL)
1524 case "$host" in 1499 case "$host" in
1525 *-*-darwin*) 1500 *-*-darwin*)
1526 if test x$enable_video_cocoa = xyes; then 1501 if test x$enable_video_cocoa = xyes; then
1527 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL" 1502 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
1528 fi
1529 if test x$enable_video_carbon = xyes; then
1530 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AGL"
1531 fi 1503 fi
1532 esac 1504 esac
1533 fi 1505 fi
1534 } 1506 }
1535 1507
2451 SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c" 2423 SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
2452 have_loadso=yes 2424 have_loadso=yes
2453 fi 2425 fi
2454 2426
2455 CheckCOCOA 2427 CheckCOCOA
2456 CheckCARBON
2457 CheckX11 2428 CheckX11
2458 CheckMacGL 2429 CheckMacGL
2459 CheckOpenGLX11 2430 CheckOpenGLX11
2460 CheckglSDL 2431 CheckglSDL
2461 CheckPTHREAD 2432 CheckPTHREAD
2490 AC_DEFINE(SDL_TIMER_UNIX) 2461 AC_DEFINE(SDL_TIMER_UNIX)
2491 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" 2462 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
2492 have_timers=yes 2463 have_timers=yes
2493 fi 2464 fi
2494 # The Mac OS X platform requires special setup. 2465 # The Mac OS X platform requires special setup.
2495 SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m"
2496 EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" 2466 EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
2497 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa" 2467 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
2498 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" 2468 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
2499 SDL_LIBS="-lSDLmain $SDL_LIBS"
2500 # If either the audio or CD driver is used, add the AudioUnit framework 2469 # If either the audio or CD driver is used, add the AudioUnit framework
2501 if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then 2470 if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
2502 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" 2471 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
2503 fi 2472 fi
2504 ;; 2473 ;;
2621 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'` 2590 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
2622 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` 2591 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
2623 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'` 2592 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'`
2624 2593
2625 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'` 2594 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'`
2626 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.o,g'`
2627 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'` 2595 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
2628 2596
2629 # Set runtime shared library paths as needed 2597 # Set runtime shared library paths as needed
2630 2598
2631 if test "x$enable_rpath" = "xyes"; then 2599 if test "x$enable_rpath" = "xyes"; then
2640 fi 2608 fi
2641 2609
2642 case "$ARCH" in 2610 case "$ARCH" in
2643 macosx) 2611 macosx)
2644 SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa" 2612 SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
2645 # Is this still needed?
2646 #if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
2647 # SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
2648 #fi
2649 # Evil hack to allow static linking on Mac OS X 2613 # Evil hack to allow static linking on Mac OS X
2650 SDL_STATIC_LIBS="\${exec_prefix}/lib/libSDLmain.a \${exec_prefix}/lib/libSDL.a $EXTRA_LDFLAGS" 2614 SDL_STATIC_LIBS="\${exec_prefix}/lib/libSDL.a $EXTRA_LDFLAGS"
2651 ;; 2615 ;;
2652 *) 2616 *)
2653 SDL_STATIC_LIBS="$SDL_LIBS" 2617 SDL_STATIC_LIBS="$SDL_LIBS"
2654 ;; 2618 ;;
2655 esac 2619 esac