build-scripts/fatbuild.sh
branchSDL-1.3
changeset 1657 5b0805ceb50f
parent 1648 9f59d4c5aaea
child 1659 14717b52abc0
     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 +