Merge trunk-1.3-2 SDL-1.3
authorSam Lantinga <slouken@libsdl.org>
Fri, 28 Apr 2006 16:55:41 +0000
branchSDL-1.3
changeset 16575b0805ceb50f
parent 1656 96c2f89cc7e1
child 1658 e49147870aac
Merge trunk-1.3-2
build-scripts/fatbuild.sh
configure.in
include/SDL_config_macosx.h
src/video/x11/SDL_x11events.c
src/video/x11/SDL_x11mouse.c
     1.1 --- a/build-scripts/fatbuild.sh	Thu Apr 27 09:09:48 2006 +0000
     1.2 +++ b/build-scripts/fatbuild.sh	Fri Apr 28 16:55:41 2006 +0000
     1.3 @@ -2,9 +2,18 @@
     1.4  #
     1.5  # Build a fat binary on Mac OS X, thanks Ryan!
     1.6  
     1.7 +# Number of CPUs (for make -j)
     1.8 +NCPU=`sysctl -n hw.ncpu`
     1.9 +NJOB=$NCPU
    1.10 +#NJOB=`expr $NCPU + 1`
    1.11 +
    1.12 +# Generic, cross-platform CFLAGS you always want go here.
    1.13 +CFLAGS="-O3 -g -pipe"
    1.14 +
    1.15  # PowerPC compiler flags (10.2 runtime compatibility)
    1.16 -CC_PPC="gcc-3.3"
    1.17 -CFLAGS_PPC="-arch ppc"
    1.18 +CC_PPC="gcc-3.3 -arch ppc"
    1.19 +CXX_PPC="g++-3.3 -arch ppc"
    1.20 +CFLAGS_PPC=""
    1.21  CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \
    1.22  -nostdinc \
    1.23  -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
    1.24 @@ -18,8 +27,9 @@
    1.25  -Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk"
    1.26  
    1.27  # Intel compiler flags (10.4 runtime compatibility)
    1.28 -CC_X86="gcc-4.0"
    1.29 -CFLAGS_X86="-arch i386 -mmacosx-version-min=10.4"
    1.30 +CC_X86="gcc-4.0 -arch i386"
    1.31 +CXX_X86="g++-4.0 -arch i386"
    1.32 +CFLAGS_X86="-mmacosx-version-min=10.4"
    1.33  CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
    1.34  -nostdinc \
    1.35  -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
    1.36 @@ -44,6 +54,7 @@
    1.37  # configure, configure-ppc, configure-x86,
    1.38  # make, make-ppc, make-x86, merge
    1.39  # install
    1.40 +# clean
    1.41  if test x"$1" = x; then
    1.42      phase=all
    1.43  else
    1.44 @@ -103,8 +114,18 @@
    1.45      install-man)
    1.46          install_man="yes"
    1.47          ;;
    1.48 +    clean)
    1.49 +        clean_ppc="yes"
    1.50 +        clean_x86="yes"
    1.51 +        ;;
    1.52 +    clean-ppc)
    1.53 +        clean_ppc="yes"
    1.54 +        ;;
    1.55 +    clean-x86)
    1.56 +        clean_x86="yes"
    1.57 +        ;;
    1.58      *)
    1.59 -        echo "Usage: $0 [all|configure[-ppc|-x86]|make[-ppc|-x86]|merge]"
    1.60 +        echo "Usage: $0 [all|configure[-ppc|-x86]|make[-ppc|-x86]|merge|install|clean]"
    1.61          exit 1
    1.62          ;;
    1.63  esac
    1.64 @@ -137,10 +158,10 @@
    1.65  #
    1.66  if test x$configure_ppc = xyes; then
    1.67      (cd build/ppc && \
    1.68 -     sh ../../configure --build=`uname -p`-apple-darwin --host=powerpc-apple-darwin CC="$CC_PPC" CFLAGS="$CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || exit 2
    1.69 +     sh ../../configure --build=`uname -p`-apple-darwin --host=powerpc-apple-darwin CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || exit 2
    1.70  fi
    1.71  if test x$make_ppc = xyes; then
    1.72 -    (cd build/ppc && make) || exit 3
    1.73 +    (cd build/ppc && ls include && make -j$NJOB) || exit 3
    1.74  fi
    1.75  
    1.76  #
    1.77 @@ -148,10 +169,10 @@
    1.78  #
    1.79  if test x$configure_x86 = xyes; then
    1.80      (cd build/x86 && \
    1.81 -     sh ../../configure --build=`uname -p`-apple-darwin --host=i686-apple-darwin CC="$CC_X86" CFLAGS="$CFLAGS_X86" CPPFLAGS="$CPPFLAGS_X86" LDFLAGS="$LFLAGS_X86") || exit 2
    1.82 +     sh ../../configure --build=`uname -p`-apple-darwin --host=i386-apple-darwin CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $CFLAGS_X86" CPPFLAGS="$CPPFLAGS_X86" LDFLAGS="$LFLAGS_X86") || exit 2
    1.83  fi
    1.84  if test x$make_x86 = xyes; then
    1.85 -    (cd build/x86 && make) || exit 3
    1.86 +    (cd build/x86 && make -j$NJOB) || exit 3
    1.87  fi
    1.88  
    1.89  #
    1.90 @@ -233,3 +254,19 @@
    1.91          do_install /usr/bin/install -c -m 644 $src $mandir/man3/$file; \
    1.92      done
    1.93  fi
    1.94 +
    1.95 +#
    1.96 +# Clean up
    1.97 +#
    1.98 +do_clean()
    1.99 +{
   1.100 +    echo $*
   1.101 +    $* || exit 6
   1.102 +}
   1.103 +if test x$clean_x86 = xyes; then
   1.104 +    do_clean rm -r build/x86
   1.105 +fi
   1.106 +if test x$clean_ppc = xyes; then
   1.107 +    do_clean rm -r build/ppc
   1.108 +fi
   1.109 +
     2.1 --- a/configure.in	Thu Apr 27 09:09:48 2006 +0000
     2.2 +++ b/configure.in	Fri Apr 28 16:55:41 2006 +0000
     2.3 @@ -52,6 +52,11 @@
     2.4  dnl Set up the compiler and linker flags
     2.5  INCLUDE="-I$srcdir/include"
     2.6  if test x$srcdir != x.; then
     2.7 +    # Remove SDL_config.h from the source directory, since it's the
     2.8 +    # default one, and we want to include the one that we generate.
     2.9 +    if test -f $srcdir/include/SDL_config.h; then
    2.10 +        rm $srcdir/include/SDL_config.h
    2.11 +    fi
    2.12      INCLUDE="-Iinclude $INCLUDE"
    2.13  fi
    2.14  case "$host" in
    2.15 @@ -2332,6 +2337,7 @@
    2.16          # use here or in sdl-config. Hence we reset it.
    2.17          EXTRA_LDFLAGS=""
    2.18  
    2.19 +        CheckVisibilityHidden
    2.20          CheckDummyVideo
    2.21          CheckDiskAudio
    2.22          CheckDummyAudio
     3.1 --- a/include/SDL_config_macosx.h	Thu Apr 27 09:09:48 2006 +0000
     3.2 +++ b/include/SDL_config_macosx.h	Fri Apr 28 16:55:41 2006 +0000
     3.3 @@ -46,7 +46,12 @@
     3.4  #define HAVE_CALLOC	1
     3.5  #define HAVE_REALLOC	1
     3.6  #define HAVE_FREE	1
     3.7 +
     3.8 +/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */
     3.9 +#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) )
    3.10  #define HAVE_ALLOCA	1
    3.11 +#endif
    3.12 +
    3.13  #define HAVE_GETENV	1
    3.14  #define HAVE_PUTENV	1
    3.15  #define HAVE_UNSETENV	1
     4.1 --- a/src/video/x11/SDL_x11events.c	Thu Apr 27 09:09:48 2006 +0000
     4.2 +++ b/src/video/x11/SDL_x11events.c	Fri Apr 28 16:55:41 2006 +0000
     4.3 @@ -666,7 +666,7 @@
     4.4  			} else {
     4.5  				switch_time = now + 200;
     4.6  			}
     4.7 -		} else if ( now >= switch_time ) {
     4.8 +		} else if ( (int)(switch_time-now) <= 0 ) {
     4.9  			Uint32 go_fullscreen;
    4.10  
    4.11  			go_fullscreen = switch_waiting & SDL_FULLSCREEN;
     5.1 --- a/src/video/x11/SDL_x11mouse.c	Thu Apr 27 09:09:48 2006 +0000
     5.2 +++ b/src/video/x11/SDL_x11mouse.c	Fri Apr 28 16:55:41 2006 +0000
     5.3 @@ -226,6 +226,7 @@
     5.4  /* Check to see if we need to enter or leave mouse relative mode */
     5.5  void X11_CheckMouseModeNoLock(_THIS)
     5.6  {
     5.7 +	const Uint8 full_focus = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
     5.8  	char *env_override;
     5.9  	int enable_relative = 1;
    5.10  
    5.11 @@ -242,7 +243,7 @@
    5.12  	if ( enable_relative &&
    5.13  	     !(SDL_cursorstate & CURSOR_VISIBLE) &&
    5.14  	     (this->input_grab != SDL_GRAB_OFF) &&
    5.15 -             (SDL_GetAppState() & SDL_APPACTIVE) ) {
    5.16 +             (SDL_GetAppState() & full_focus) == full_focus ) {
    5.17  		if ( ! mouse_relative ) {
    5.18  			X11_EnableDGAMouse(this);
    5.19  			if ( ! (using_dga & DGA_MOUSE) ) {