configure.in
changeset 1133 609c060fd2a2
parent 1127 fb8818ee9112
child 1136 d16c010d5d98
     1.1 --- a/configure.in	Thu Aug 25 20:31:58 2005 +0000
     1.2 +++ b/configure.in	Thu Sep 08 06:16:14 2005 +0000
     1.3 @@ -742,6 +742,28 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +
     1.8 +dnl Check for X11 on Mac OS X / Darwin
     1.9 +CheckMacX11()
    1.10 +{
    1.11 +    AC_ARG_ENABLE(video-x11,
    1.12 +[  --enable-video-x11      use X11 video driver [default=no]],
    1.13 +                  , enable_video_x11=no)
    1.14 +    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
    1.15 +        AC_PATH_X
    1.16 +        AC_PATH_XTRA
    1.17 +        if test x$have_x = xyes; then
    1.18 +            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
    1.19 +            if test x$ac_cv_func_shmat != xyes; then
    1.20 +                CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
    1.21 +            fi
    1.22 +            SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
    1.23 +            VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
    1.24 +            VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
    1.25 +        fi
    1.26 +    fi
    1.27 +}
    1.28 +
    1.29  dnl Find the X11 DGA 2.0 include and library directories
    1.30  CheckDGA()
    1.31  {
    1.32 @@ -1128,7 +1150,9 @@
    1.33          CFLAGS="$CFLAGS -DHAVE_OPENGL"
    1.34          case "$target" in
    1.35              *-*-darwin*)
    1.36 -                SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL -framework AGL"
    1.37 +                SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL"
    1.38 +                # The following is probably not available in Darwin:
    1.39 +                SYSTEM_LIBS="$SYSTEM_LIBS -framework AGL"
    1.40          esac
    1.41      fi
    1.42  }
    1.43 @@ -1635,15 +1659,34 @@
    1.44  dnl Set up the Mac toolbox video driver for Mac OS 7-9
    1.45  CheckTOOLBOX()
    1.46  {
    1.47 +    CFLAGS="$CFLAGS -DENABLE_TOOLBOX -DENABLE_DRAWSPROCKET"
    1.48      VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
    1.49      VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
    1.50      VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
    1.51      VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
    1.52 +    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
    1.53 +    VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
    1.54  }
    1.55  
    1.56 -dnl Set up the Mac toolbox video driver for Mac OS X
    1.57 +dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
    1.58  CheckCARBON()
    1.59  {
    1.60 +    AC_ARG_ENABLE(video-carbon,
    1.61 +[  --enable-video-carbon   use Carbon/QuickDraw video driver [default=no]],
    1.62 +                  , enable_video_carbon=no)
    1.63 +  if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
    1.64 +    AC_MSG_CHECKING(for Carbon framework)
    1.65 +    have_carbon=no
    1.66 +    if test x$have_carbon != xyes; then
    1.67 +        AC_TRY_COMPILE([
    1.68 +          #include <Carbon/Carbon.h>
    1.69 +        ],[
    1.70 +        ],[
    1.71 +        have_carbon=yes
    1.72 +        ])
    1.73 +    fi
    1.74 +    AC_MSG_RESULT($have_carbon)
    1.75 +    if test x$have_carbon = xyes; then
    1.76      # "MACOSX" is not an official definition, but it's commonly
    1.77      # accepted as a way to differentiate between what runs on X
    1.78      # and what runs on older Macs - while in theory "Carbon" defns
    1.79 @@ -1656,11 +1699,35 @@
    1.80      VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
    1.81      VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
    1.82      VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
    1.83 +    #VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
    1.84 +    #VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
    1.85 +    fi
    1.86 +  fi
    1.87  }
    1.88  
    1.89 -dnl Set up the Mac toolbox video driver for Mac OS X
    1.90 -CheckQUARTZ()
    1.91 +dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
    1.92 +CheckCOCOA()
    1.93  {
    1.94 +    AC_ARG_ENABLE(video-cocoa,
    1.95 +[  --enable-video-cocoa    use Cocoa/Quartz video driver [default=yes]],
    1.96 +                  , enable_video_cocoa=yes)
    1.97 +  if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
    1.98 +    old_CFLAGS="$CFLAGS"
    1.99 +    dnl work around that we don't have Objective-C support in autoconf
   1.100 +    CFLAGS="$CFLAGS -x objective-c"
   1.101 +    AC_MSG_CHECKING(for Cocoa framework)
   1.102 +    have_cocoa=no
   1.103 +    if test x$have_cocoa != xyes; then
   1.104 +        AC_TRY_COMPILE([
   1.105 +          #import <Cocoa/Cocoa.h>
   1.106 +        ],[
   1.107 +        ],[
   1.108 +        have_cocoa=yes
   1.109 +        ])
   1.110 +    fi
   1.111 +    AC_MSG_RESULT($have_cocoa)
   1.112 +    CFLAGS="$old_CFLAGS"
   1.113 +    if test x$have_cocoa = xyes; then
   1.114      # "MACOSX" is not an official definition, but it's commonly
   1.115      # accepted as a way to differentiate between what runs on X
   1.116      # and what runs on older Macs - while in theory "Carbon" defns
   1.117 @@ -1672,6 +1739,8 @@
   1.118        -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
   1.119      VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
   1.120      VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
   1.121 +    fi
   1.122 +  fi
   1.123  }
   1.124  
   1.125  dnl Check for the dlfcn.h interface for dynamically loading objects
   1.126 @@ -2581,13 +2650,15 @@
   1.127          SDL_LIBS="-lSDLmain $SDL_LIBS"
   1.128          ;;
   1.129      *-*-darwin* )
   1.130 -        # Strictly speaking, we want "Mac OS X", not "Darwin", which is
   1.131 +        # This could be either full "Mac OS X", or plain "Darwin" which is
   1.132          # just the OS X kernel sans upper layers like Carbon and Cocoa.
   1.133 -        # But config.guess comes back with "darwin", so go with the flow.
   1.134 +        # Next line is broken, and a few files below require Mac OS X (full)
   1.135          ARCH=macosx
   1.136          CheckDummyVideo
   1.137          CheckDiskAudio
   1.138 -        CheckQUARTZ
   1.139 +        CheckCOCOA
   1.140 +        CheckCARBON
   1.141 +        CheckMacX11
   1.142          CheckMacGL
   1.143          CheckPTHREAD
   1.144          CheckSIGACTION
   1.145 @@ -2625,8 +2696,16 @@
   1.146          fi
   1.147          # The MacOS X platform requires special setup.
   1.148          SDL_LIBS="-lSDLmain $SDL_LIBS"
   1.149 -        # The Cocoa backend still needs Carbon, and the YUV code QuickTime
   1.150 -        SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa -framework Carbon -framework QuickTime"
   1.151 +        if test x$enable_video_cocoa = xyes; then
   1.152 +            SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa"
   1.153 +        fi
   1.154 +        if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
   1.155 +            # The Cocoa backend still needs Carbon, and the YUV code QuickTime
   1.156 +            SYSTEM_LIBS="$SYSTEM_LIBS -framework Carbon -framework QuickTime"
   1.157 +        fi
   1.158 +        #if test x$enable_video_carbon = xyes; then
   1.159 +        #    SYSTEM_LIBS="$SYSTEM_LIBS -framework DrawSprocket"
   1.160 +        #fi
   1.161          ;;
   1.162      *-*-mint*)
   1.163          ARCH=mint
   1.164 @@ -2746,6 +2825,8 @@
   1.165  AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
   1.166  AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
   1.167  AM_CONDITIONAL(HAVE_NASM, test x$use_nasm = xyes)
   1.168 +AM_CONDITIONAL(USE_COCOA, test x$enable_video_cocoa = xyes)
   1.169 +AM_CONDITIONAL(USE_CARBON, test x$enable_video_carbon = xyes)
   1.170  
   1.171  # Set conditional variables for shared and static library selection.
   1.172  # These are not used in any Makefile.am but in sdl-config.in.
   1.173 @@ -2773,7 +2854,13 @@
   1.174      SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
   1.175      ;;
   1.176    macosx)
   1.177 -    SHARED_SYSTEM_LIBS="-framework Cocoa"
   1.178 +    SHARED_SYSTEM_LIBS=""
   1.179 +    if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
   1.180 +      SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework Cocoa"
   1.181 +    fi
   1.182 +    if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
   1.183 +      SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework Carbon"
   1.184 +    fi
   1.185      if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
   1.186        SHARED_SYSTEM_LIBS="$SHARED_SYSTEM_LIBS -framework OpenGL"
   1.187      fi
   1.188 @@ -2874,6 +2961,7 @@
   1.189  include/Makefile
   1.190  src/Makefile
   1.191  src/main/Makefile
   1.192 +src/main/macos/Makefile
   1.193  src/main/macosx/Makefile
   1.194  src/main/macosx/Info.plist
   1.195  src/audio/Makefile