configure.in
changeset 158 4382c38dfbee
parent 153 2839f45bdba0
child 166 39877400bd1e
     1.1 --- a/configure.in	Mon Aug 20 04:41:49 2001 +0000
     1.2 +++ b/configure.in	Tue Aug 21 07:19:59 2001 +0000
     1.3 @@ -63,10 +63,6 @@
     1.4      *-*-linux*)
     1.5          AC_PROG_CXX
     1.6          ;;
     1.7 -    *-*-darwin*)
     1.8 -        OBJC="???"
     1.9 -        AC_SUBST(OBJC)
    1.10 -        ;;
    1.11  esac
    1.12  AC_PROG_INSTALL
    1.13  AC_FUNC_ALLOCA
    1.14 @@ -1192,6 +1188,21 @@
    1.15      VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
    1.16  }
    1.17  
    1.18 +dnl Set up the Mac toolbox video driver for Mac OS X
    1.19 +CheckQUARTZ()
    1.20 +{
    1.21 +    # "MACOSX" is not an official definition, but it's commonly
    1.22 +    # accepted as a way to differentiate between what runs on X
    1.23 +    # and what runs on older Macs - while in theory "Carbon" defns
    1.24 +    # are consistent between the two, in practice Carbon is still
    1.25 +    # changing. -sts Aug 2000
    1.26 +    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
    1.27 +      -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
    1.28 +      -DENABLE_QUARTZ -DMACOSX -DTARGET_API_MAC_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
    1.29 +    VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
    1.30 +    VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
    1.31 +}
    1.32 +
    1.33  dnl Set up the kernel statistics library for Solaris
    1.34  CheckKSTAT()
    1.35  {
    1.36 @@ -1994,17 +2005,17 @@
    1.37          ;;
    1.38      *-*-darwin* )
    1.39          # Strictly speaking, we want "Mac OS X", not "Darwin", which is
    1.40 -        # just the OS X kernel sans upper layers like Carbon.  But
    1.41 -        # config.guess comes back with "darwin", so go with the flow.
    1.42 -        ARCH=macos
    1.43 +        # just the OS X kernel sans upper layers like Carbon and Cocoa.
    1.44 +        # But config.guess comes back with "darwin", so go with the flow.
    1.45 +        ARCH=macosx
    1.46          CheckDummyVideo
    1.47          CheckDiskAudio
    1.48 -        CheckCARBON
    1.49 +        CheckQUARTZ
    1.50          CheckMacGL
    1.51          CheckPTHREAD
    1.52          # Set up files for the main() stub
    1.53 -        # COPY_ARCH_SRC(src/main, macos, SDL_main.c)
    1.54 -        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
    1.55 +        COPY_ARCH_SRC(src/main, macosx, SDLmain.m)
    1.56 +        COPY_ARCH_SRC(src/main, macosx, SDLmain.h)
    1.57          # Set up files for the audio library
    1.58          if test x$enable_audio = xyes; then
    1.59              AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
    1.60 @@ -2040,8 +2051,8 @@
    1.61              COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
    1.62          fi
    1.63          # The MacOS X platform requires special setup
    1.64 -        SDL_CFLAGS="$SDL_CFLAGS -F/System/Library/Frameworks/Carbon.framework"
    1.65 -        SDL_LIBS="-lSDLmain $SDL_LIBS -framework Carbon"
    1.66 +        SDL_CFLAGS="$SDL_CFLAGS -F/System/Library/Frameworks/Carbon.framework -F/System/Library/Frameworks/Cocoa.framework"
    1.67 +        SDL_LIBS="-lSDLmain $SDL_LIBS -framework Carbon -framework Cocoa"
    1.68          ;;
    1.69      *)
    1.70          AC_MSG_ERROR(Unsupported target:  Please add to configure.in)
    1.71 @@ -2061,6 +2072,7 @@
    1.72  AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
    1.73  AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
    1.74  AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
    1.75 +AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
    1.76  
    1.77  # Set conditional variables for shared and static library selection.
    1.78  # These are not used in any Makefile.am but in sdl-config.in.
    1.79 @@ -2122,6 +2134,18 @@
    1.80  CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
    1.81  CXXFLAGS="$CFLAGS"
    1.82  
    1.83 +
    1.84 +# Check for darwin at the very end and set up the Objective C compiler
    1.85 +# We do this here so that we get the full CFLAGS into OBJCFLAGS
    1.86 +case "$target" in
    1.87 +    *-*-darwin*)
    1.88 +        OBJC="cc"
    1.89 +        OBJCFLAGS="$CFLAGS"
    1.90 +        AC_SUBST(OBJC)
    1.91 +        AC_SUBST(OBJCFLAGS)
    1.92 +        ;;
    1.93 +esac
    1.94 +
    1.95  # Finally create all the generated files
    1.96  dnl Important: Any directory that you want to be in the distcheck should
    1.97  dnl            have a file listed here, so that configure generates the