comparison configure.in @ 1133:609c060fd2a2

The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails: To: SDL Developers <sdl@libsdl.org> From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se> Date: Mon, 30 May 2005 23:29:04 +0200 Subject: [SDL] Mac OS X Video Drivers [patch] I've updated/added the Carbon and X11 video drivers to the Mac OS X port of SDL 1.2 (the CVS version), and made the Cocoa driver and runtime *optional*. The default is still Cocoa, and the "Quartz" driver. But you can now also use "toolbox" for Carbon, and "x11" for running with Apple's (or other) X11 server: export SDL_VIDEODRIVER=x11 export SDL_VIDEO_GL_DRIVER=/usr/X11R6/lib/libGL.dylib It also checks if the frameworks are available, by a: #include <Carbon/Carbon.h> or #import <Cocoa/Cocoa.h> (this should make it configure on plain Darwin as well?) Here are the new configure targets: --enable-video-cocoa use Cocoa/Quartz video driver default=yes --enable-video-carbon use Carbon/QuickDraw video driver default=yes --enable-video-x11 use X11 video driver default=no ./configure --enable-video-cocoa --enable-video-carbon --enable-video-x11 \ --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib The Carbon version is just an updated version of the old SDL driver for Mac OS 9, and could probably be improved... (but it does work, including the Carbon version of SDLmain) If you disable cocoa, you can run with -framework Carbon only, and the C version of SDL_main.c. And if you disable carbon too, you can still use the X11 version which doesn't require SDLmain. I updated the DrawSprocket version, but did not include it. (no blitters or VRAM GWorlds etc. available on OS X anyway) Besides for Mac OS 9, I don't think there's any use for it ? And note that any performance on Mac OS X equals OpenGL anyway... You can get "fair" software SDL results on captured CG displays, but for decent frame rates you need to be using GL for rendering. Finally, here is the patch itself: http://www.algonet.se/~afb/SDL-12CVS-macvideo.patch --anders PS. It says "video", but as usual it applies to mouse/keyboard too. ------ To: A list for developers using the SDL library <sdl@libsdl.org> From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se> Date: Sun, 4 Sep 2005 10:02:15 +0200 Subject: [SDL] Updated Mac patch Updated the previous Mac patch to disable Carbon by default. Also "fixed" the SDL.spec again, so that it builds on Darwin. http://www.algonet.se/~afb/SDL-1.2.9-mac.patch Also applied fine to SDL12 CVS, when I tried it.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 08 Sep 2005 06:16:14 +0000
parents fb8818ee9112
children d16c010d5d98
comparison
equal deleted inserted replaced
1132:a0d3514c04b2 1133:609c060fd2a2
740 fi 740 fi
741 fi 741 fi
742 fi 742 fi
743 } 743 }
744 744
745
746 dnl Check for X11 on Mac OS X / Darwin
747 CheckMacX11()
748 {
749 AC_ARG_ENABLE(video-x11,
750 [ --enable-video-x11 use X11 video driver [default=no]],
751 , enable_video_x11=no)
752 if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
753 AC_PATH_X
754 AC_PATH_XTRA
755 if test x$have_x = xyes; then
756 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
757 if test x$ac_cv_func_shmat != xyes; then
758 CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
759 fi
760 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
761 VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
762 VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
763 fi
764 fi
765 }
766
745 dnl Find the X11 DGA 2.0 include and library directories 767 dnl Find the X11 DGA 2.0 include and library directories
746 CheckDGA() 768 CheckDGA()
747 { 769 {
748 AC_ARG_ENABLE(video-dga, 770 AC_ARG_ENABLE(video-dga,
749 [ --enable-video-dga use DGA 2.0 video driver [default=yes]], 771 [ --enable-video-dga use DGA 2.0 video driver [default=yes]],
1126 { 1148 {
1127 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then 1149 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1128 CFLAGS="$CFLAGS -DHAVE_OPENGL" 1150 CFLAGS="$CFLAGS -DHAVE_OPENGL"
1129 case "$target" in 1151 case "$target" in
1130 *-*-darwin*) 1152 *-*-darwin*)
1131 SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL -framework AGL" 1153 SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL"
1154 # The following is probably not available in Darwin:
1155 SYSTEM_LIBS="$SYSTEM_LIBS -framework AGL"
1132 esac 1156 esac
1133 fi 1157 fi
1134 } 1158 }
1135 1159
1136 dnl Check for Mesa offscreen rendering 1160 dnl Check for Mesa offscreen rendering
1633 } 1657 }
1634 1658
1635 dnl Set up the Mac toolbox video driver for Mac OS 7-9 1659 dnl Set up the Mac toolbox video driver for Mac OS 7-9
1636 CheckTOOLBOX() 1660 CheckTOOLBOX()
1637 { 1661 {
1662 CFLAGS="$CFLAGS -DENABLE_TOOLBOX -DENABLE_DRAWSPROCKET"
1638 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon" 1663 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
1639 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la" 1664 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1640 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom" 1665 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1641 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la" 1666 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1642 } 1667 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
1643 1668 VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
1644 dnl Set up the Mac toolbox video driver for Mac OS X 1669 }
1670
1671 dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
1645 CheckCARBON() 1672 CheckCARBON()
1646 { 1673 {
1674 AC_ARG_ENABLE(video-carbon,
1675 [ --enable-video-carbon use Carbon/QuickDraw video driver [default=no]],
1676 , enable_video_carbon=no)
1677 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
1678 AC_MSG_CHECKING(for Carbon framework)
1679 have_carbon=no
1680 if test x$have_carbon != xyes; then
1681 AC_TRY_COMPILE([
1682 #include <Carbon/Carbon.h>
1683 ],[
1684 ],[
1685 have_carbon=yes
1686 ])
1687 fi
1688 AC_MSG_RESULT($have_carbon)
1689 if test x$have_carbon = xyes; then
1647 # "MACOSX" is not an official definition, but it's commonly 1690 # "MACOSX" is not an official definition, but it's commonly
1648 # accepted as a way to differentiate between what runs on X 1691 # accepted as a way to differentiate between what runs on X
1649 # and what runs on older Macs - while in theory "Carbon" defns 1692 # and what runs on older Macs - while in theory "Carbon" defns
1650 # are consistent between the two, in practice Carbon is still 1693 # are consistent between the two, in practice Carbon is still
1651 # changing. -sts Aug 2000 1694 # changing. -sts Aug 2000
1654 -fpascal-strings -DENABLE_TOOLBOX -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/maccommon -I\$(top_srcdir)/src/video/macrom -I\$(top_srcdir)/src/video/macdsp" 1697 -fpascal-strings -DENABLE_TOOLBOX -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/maccommon -I\$(top_srcdir)/src/video/macrom -I\$(top_srcdir)/src/video/macdsp"
1655 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon" 1698 VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
1656 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la" 1699 VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
1657 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom" 1700 VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
1658 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la" 1701 VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
1659 } 1702 #VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
1660 1703 #VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
1661 dnl Set up the Mac toolbox video driver for Mac OS X 1704 fi
1662 CheckQUARTZ() 1705 fi
1663 { 1706 }
1707
1708 dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
1709 CheckCOCOA()
1710 {
1711 AC_ARG_ENABLE(video-cocoa,
1712 [ --enable-video-cocoa use Cocoa/Quartz video driver [default=yes]],
1713 , enable_video_cocoa=yes)
1714 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
1715 old_CFLAGS="$CFLAGS"
1716 dnl work around that we don't have Objective-C support in autoconf
1717 CFLAGS="$CFLAGS -x objective-c"
1718 AC_MSG_CHECKING(for Cocoa framework)
1719 have_cocoa=no
1720 if test x$have_cocoa != xyes; then
1721 AC_TRY_COMPILE([
1722 #import <Cocoa/Cocoa.h>
1723 ],[
1724 ],[
1725 have_cocoa=yes
1726 ])
1727 fi
1728 AC_MSG_RESULT($have_cocoa)
1729 CFLAGS="$old_CFLAGS"
1730 if test x$have_cocoa = xyes; then
1664 # "MACOSX" is not an official definition, but it's commonly 1731 # "MACOSX" is not an official definition, but it's commonly
1665 # accepted as a way to differentiate between what runs on X 1732 # accepted as a way to differentiate between what runs on X
1666 # and what runs on older Macs - while in theory "Carbon" defns 1733 # and what runs on older Macs - while in theory "Carbon" defns
1667 # are consistent between the two, in practice Carbon is still 1734 # are consistent between the two, in practice Carbon is still
1668 # changing. -sts Aug 2000 1735 # changing. -sts Aug 2000
1670 CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \ 1737 CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
1671 -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \ 1738 -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
1672 -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz" 1739 -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
1673 VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz" 1740 VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
1674 VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la" 1741 VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
1742 fi
1743 fi
1675 } 1744 }
1676 1745
1677 dnl Check for the dlfcn.h interface for dynamically loading objects 1746 dnl Check for the dlfcn.h interface for dynamically loading objects
1678 CheckDLOPEN() 1747 CheckDLOPEN()
1679 { 1748 {
2579 # The MacOS platform requires special setup 2648 # The MacOS platform requires special setup
2580 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" 2649 SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
2581 SDL_LIBS="-lSDLmain $SDL_LIBS" 2650 SDL_LIBS="-lSDLmain $SDL_LIBS"
2582 ;; 2651 ;;
2583 *-*-darwin* ) 2652 *-*-darwin* )
2584 # Strictly speaking, we want "Mac OS X", not "Darwin", which is 2653 # This could be either full "Mac OS X", or plain "Darwin" which is
2585 # just the OS X kernel sans upper layers like Carbon and Cocoa. 2654 # just the OS X kernel sans upper layers like Carbon and Cocoa.
2586 # But config.guess comes back with "darwin", so go with the flow. 2655 # Next line is broken, and a few files below require Mac OS X (full)
2587 ARCH=macosx 2656 ARCH=macosx
2588 CheckDummyVideo 2657 CheckDummyVideo
2589 CheckDiskAudio 2658 CheckDiskAudio
2590 CheckQUARTZ 2659 CheckCOCOA
2660 CheckCARBON
2661 CheckMacX11
2591 CheckMacGL 2662 CheckMacGL
2592 CheckPTHREAD 2663 CheckPTHREAD
2593 CheckSIGACTION 2664 CheckSIGACTION
2594 CheckAltivec 2665 CheckAltivec
2595 # If either the audio or CD driver is used, add the AudioUnit framework 2666 # If either the audio or CD driver is used, add the AudioUnit framework
2623 if test x$enable_timers = xyes; then 2694 if test x$enable_timers = xyes; then
2624 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) 2695 COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
2625 fi 2696 fi
2626 # The MacOS X platform requires special setup. 2697 # The MacOS X platform requires special setup.
2627 SDL_LIBS="-lSDLmain $SDL_LIBS" 2698 SDL_LIBS="-lSDLmain $SDL_LIBS"
2628 # The Cocoa backend still needs Carbon, and the YUV code QuickTime 2699 if test x$enable_video_cocoa = xyes; then
2629 SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa -framework Carbon -framework QuickTime" 2700 SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa"
2701 fi
2702 if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
2703 # The Cocoa backend still needs Carbon, and the YUV code QuickTime
2704 SYSTEM_LIBS="$SYSTEM_LIBS -framework Carbon -framework QuickTime"
2705 fi
2706 #if test x$enable_video_carbon = xyes; then
2707 # SYSTEM_LIBS="$SYSTEM_LIBS -framework DrawSprocket"
2708 #fi
2630 ;; 2709 ;;
2631 *-*-mint*) 2710 *-*-mint*)
2632 ARCH=mint 2711 ARCH=mint
2633 CheckDummyVideo 2712 CheckDummyVideo
2634 CheckDiskAudio 2713 CheckDiskAudio
2744 2823
2745 # More automake conditionals 2824 # More automake conditionals
2746 AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes) 2825 AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
2747 AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes) 2826 AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
2748 AM_CONDITIONAL(HAVE_NASM, test x$use_nasm = xyes) 2827 AM_CONDITIONAL(HAVE_NASM, test x$use_nasm = xyes)
2828 AM_CONDITIONAL(USE_COCOA, test x$enable_video_cocoa = xyes)
2829 AM_CONDITIONAL(USE_CARBON, test x$enable_video_carbon = xyes)
2749 2830
2750 # Set conditional variables for shared and static library selection. 2831 # Set conditional variables for shared and static library selection.
2751 # These are not used in any Makefile.am but in sdl-config.in. 2832 # These are not used in any Makefile.am but in sdl-config.in.
2752 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes]) 2833 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
2753 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes]) 2834 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
2771 ;; 2852 ;;
2772 qnx) 2853 qnx)
2773 SHARED_SYSTEM_LIBS="$SYSTEM_LIBS" 2854 SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
2774 ;; 2855 ;;
2775 macosx) 2856 macosx)
2776 SHARED_SYSTEM_LIBS="-framework Cocoa" 2857 SHARED_SYSTEM_LIBS=""
2858 if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
2859 SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework Cocoa"
2860 fi
2861 if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
2862 SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework Carbon"
2863 fi
2777 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then 2864 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
2778 SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework OpenGL" 2865 SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework OpenGL"
2779 fi 2866 fi
2780 ;; 2867 ;;
2781 *) 2868 *)
2872 docs/html/Makefile 2959 docs/html/Makefile
2873 docs/man3/Makefile 2960 docs/man3/Makefile
2874 include/Makefile 2961 include/Makefile
2875 src/Makefile 2962 src/Makefile
2876 src/main/Makefile 2963 src/main/Makefile
2964 src/main/macos/Makefile
2877 src/main/macosx/Makefile 2965 src/main/macosx/Makefile
2878 src/main/macosx/Info.plist 2966 src/main/macosx/Info.plist
2879 src/audio/Makefile 2967 src/audio/Makefile
2880 src/audio/alsa/Makefile 2968 src/audio/alsa/Makefile
2881 src/audio/arts/Makefile 2969 src/audio/arts/Makefile