Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Merge trunk-1.3-2
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Apr 28, 2006
1 parent 7d5ff1a commit 151966f
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 11 deletions.
55 changes: 46 additions & 9 deletions build-scripts/fatbuild.sh
Expand Up @@ -2,9 +2,18 @@
#
# Build a fat binary on Mac OS X, thanks Ryan!

# Number of CPUs (for make -j)
NCPU=`sysctl -n hw.ncpu`
NJOB=$NCPU
#NJOB=`expr $NCPU + 1`

# Generic, cross-platform CFLAGS you always want go here.
CFLAGS="-O3 -g -pipe"

# PowerPC compiler flags (10.2 runtime compatibility)
CC_PPC="gcc-3.3"
CFLAGS_PPC="-arch ppc"
CC_PPC="gcc-3.3 -arch ppc"
CXX_PPC="g++-3.3 -arch ppc"
CFLAGS_PPC=""
CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \
-nostdinc \
-F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
Expand All @@ -18,8 +27,9 @@ LFLAGS_PPC="-arch ppc \
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk"

# Intel compiler flags (10.4 runtime compatibility)
CC_X86="gcc-4.0"
CFLAGS_X86="-arch i386 -mmacosx-version-min=10.4"
CC_X86="gcc-4.0 -arch i386"
CXX_X86="g++-4.0 -arch i386"
CFLAGS_X86="-mmacosx-version-min=10.4"
CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
-nostdinc \
-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
Expand All @@ -44,6 +54,7 @@ cd $srcdir
# configure, configure-ppc, configure-x86,
# make, make-ppc, make-x86, merge
# install
# clean
if test x"$1" = x; then
phase=all
else
Expand Down Expand Up @@ -103,8 +114,18 @@ case $phase in
install-man)
install_man="yes"
;;
clean)
clean_ppc="yes"
clean_x86="yes"
;;
clean-ppc)
clean_ppc="yes"
;;
clean-x86)
clean_x86="yes"
;;
*)
echo "Usage: $0 [all|configure[-ppc|-x86]|make[-ppc|-x86]|merge]"
echo "Usage: $0 [all|configure[-ppc|-x86]|make[-ppc|-x86]|merge|install|clean]"
exit 1
;;
esac
Expand Down Expand Up @@ -137,21 +158,21 @@ done
#
if test x$configure_ppc = xyes; then
(cd build/ppc && \
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
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
fi
if test x$make_ppc = xyes; then
(cd build/ppc && make) || exit 3
(cd build/ppc && ls include && make -j$NJOB) || exit 3
fi

#
# Build the Intel binary
#
if test x$configure_x86 = xyes; then
(cd build/x86 && \
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
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
fi
if test x$make_x86 = xyes; then
(cd build/x86 && make) || exit 3
(cd build/x86 && make -j$NJOB) || exit 3
fi

#
Expand Down Expand Up @@ -233,3 +254,19 @@ if test x$install_man = xyes; then
do_install /usr/bin/install -c -m 644 $src $mandir/man3/$file; \
done
fi

#
# Clean up
#
do_clean()
{
echo $*
$* || exit 6
}
if test x$clean_x86 = xyes; then
do_clean rm -r build/x86
fi
if test x$clean_ppc = xyes; then
do_clean rm -r build/ppc
fi

6 changes: 6 additions & 0 deletions configure.in
Expand Up @@ -52,6 +52,11 @@ fi
dnl Set up the compiler and linker flags
INCLUDE="-I$srcdir/include"
if test x$srcdir != x.; then
# Remove SDL_config.h from the source directory, since it's the
# default one, and we want to include the one that we generate.
if test -f $srcdir/include/SDL_config.h; then
rm $srcdir/include/SDL_config.h
fi
INCLUDE="-Iinclude $INCLUDE"
fi
case "$host" in
Expand Down Expand Up @@ -2332,6 +2337,7 @@ case "$host" in
# use here or in sdl-config. Hence we reset it.
EXTRA_LDFLAGS=""

CheckVisibilityHidden
CheckDummyVideo
CheckDiskAudio
CheckDummyAudio
Expand Down
5 changes: 5 additions & 0 deletions include/SDL_config_macosx.h
Expand Up @@ -46,7 +46,12 @@
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1

/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */
#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) )
#define HAVE_ALLOCA 1
#endif

#define HAVE_GETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
Expand Down
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11events.c
Expand Up @@ -666,7 +666,7 @@ void X11_PumpEvents(_THIS)
} else {
switch_time = now + 200;
}
} else if ( now >= switch_time ) {
} else if ( (int)(switch_time-now) <= 0 ) {
Uint32 go_fullscreen;

go_fullscreen = switch_waiting & SDL_FULLSCREEN;
Expand Down
3 changes: 2 additions & 1 deletion src/video/x11/SDL_x11mouse.c
Expand Up @@ -226,6 +226,7 @@ static void SetMouseAccel(_THIS, const char *accel_param)
/* Check to see if we need to enter or leave mouse relative mode */
void X11_CheckMouseModeNoLock(_THIS)
{
const Uint8 full_focus = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
char *env_override;
int enable_relative = 1;

Expand All @@ -242,7 +243,7 @@ void X11_CheckMouseModeNoLock(_THIS)
if ( enable_relative &&
!(SDL_cursorstate & CURSOR_VISIBLE) &&
(this->input_grab != SDL_GRAB_OFF) &&
(SDL_GetAppState() & SDL_APPACTIVE) ) {
(SDL_GetAppState() & full_focus) == full_focus ) {
if ( ! mouse_relative ) {
X11_EnableDGAMouse(this);
if ( ! (using_dga & DGA_MOUSE) ) {
Expand Down

0 comments on commit 151966f

Please sign in to comment.