From 8f6c15972e95465e3dee4a318f73b662622fa4a8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Apr 2006 05:38:06 +0000 Subject: [PATCH] Fixed bug #206, fatbuild.sh works flawlessly on Intel Macs --- build-scripts/fatbuild.sh | 15 ++++++--------- configure.in | 6 ++++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/build-scripts/fatbuild.sh b/build-scripts/fatbuild.sh index c7da85cbe..3a6161747 100755 --- a/build-scripts/fatbuild.sh +++ b/build-scripts/fatbuild.sh @@ -3,16 +3,14 @@ # Build a fat binary on Mac OS X, thanks Ryan! # Number of CPUs (for make -j) -#NCPU=1 NCPU=`sysctl -n hw.ncpu` +NJOB=`expr $NCPU + 1` -# !!! FIXME: other CFLAGS? # 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 -arch ppc" -CXX_PPC="g++-3.3 -arch ppc" CFLAGS_PPC="" CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \ -nostdinc \ @@ -28,10 +26,9 @@ LFLAGS_PPC="-arch ppc \ # Intel compiler flags (10.4 runtime compatibility) 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 -fvisibility=hidden \ +-nostdinc \ -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include \ -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" @@ -158,10 +155,10 @@ 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" CXX="$CXX_PPC" CFLAGS="$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" CFLAGS="$CFLAGS $CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || exit 2 fi if test x$make_ppc = xyes; then - (cd build/ppc && make -j$NCPU) || exit 3 + (cd build/ppc && ls include && make -j$NJOB) || exit 3 fi # @@ -169,10 +166,10 @@ fi # if test x$configure_x86 = xyes; then (cd build/x86 && \ - sh ../../configure --build=`uname -p`-apple-darwin --host=i686-apple-darwin CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$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" CFLAGS="$CFLAGS $CFLAGS_X86" CPPFLAGS="$CPPFLAGS_X86" LDFLAGS="$LFLAGS_X86") || exit 2 fi if test x$make_x86 = xyes; then - (cd build/x86 && make -j$NCPU) || exit 3 + (cd build/x86 && make -j$NJOB) || exit 3 fi # diff --git a/configure.in b/configure.in index f6125ca75..0cbe850e7 100644 --- a/configure.in +++ b/configure.in @@ -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 @@ -2332,6 +2337,7 @@ case "$host" in # use here or in sdl-config. Hence we reset it. EXTRA_LDFLAGS="" + CheckVisibilityHidden CheckDummyVideo CheckDiskAudio CheckDummyAudio