Ticket #8705: fix-os-x-build-platform.patch

File fix-os-x-build-platform.patch, 2.7 KB (added by xyzzy, 12 years ago)

Patch to fix Mac OS X build platform

  • ReadMe

    From b738de2fe943e610467c99fac55cabb949a7da5a Mon Sep 17 00:00:00 2001
    From: Alex Smith <alex@alex-smith.me.uk>
    Date: Tue, 10 Jul 2012 10:22:07 +0100
    Subject: [PATCH] Fixed Mac OS X 10.7 as a build platform.
    
    * Use gcc and g++ rather than cc and c++, as the latter now point to
      clang with recent Xcode versions and compilation of the host tools
      fail for various reasons with it.
    * Replace the case-sensitive filesystem check with a more basic one,
      as diskutil no longer supports the behaviour of getting info for the
      volume that any path is on.
    * Updated ReadMe with a correct list of prerequisites for OS X.
    ---
     ReadMe               |    7 +++++++
     build/jam/BuildSetup |    7 +++++++
     configure            |   19 +++++++++++--------
     3 files changed, 25 insertions(+), 8 deletions(-)
    
    diff --git a/ReadMe b/ReadMe
    index 70ad15e..77ec0e9 100644
    a b The following darwin ports need to be installed:  
    7575 * libiconv
    7676 * gnuregex
    7777 * gsed
     78 * cdrtools
     79 * yasm
     80 * wget
     81 * less
     82 * mpfr
     83 * gmp
     84 * libmpc
    7885
    7986More information about individual distributions of Linux and BSD can be found
    8087at http://haiku-os.org/guides/building/pre-reqs
  • build/jam/BuildSetup

    diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup
    index dd4a91d..87129f4 100644
    a b if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd  
    609609    }
    610610}
    611611
     612# On recent versions of OS X cc and c++ point to clang, which fails to
     613# compile some of the host tools. As a workaround, force use of GCC.
     614if $(HOST_PLATFORM) = darwin {
     615    HOST_CC = gcc ;
     616    HOST_C++ = g++ ;
     617}
     618
    612619if $(HOST_PLATFORM) = cygwin {
    613620    HOST_LINKFLAGS += -Xlinker --allow-multiple-definition -Xlinker
    614621        --enable-auto-import ;
  • configure

    diff --git a/configure b/configure
    index 9d6ca5a..39d894c 100755
    a b for sfdiskDir in /sbin /usr/sbin /usr/local/sbin ; do  
    471471    fi
    472472done
    473473
    474 # check for case-sensitive filesystem if on darwin
    475 if [ $HOST_PLATFORM = "darwin" ]; then
    476     diskutil info $(pwd)/.. | grep -i "case-sensitive" > /dev/null
    477     if [ $? != 0 ]; then
    478         echo "You need a case-sensitive file-system to build Haiku."
    479         echo "Please see the following guide on how to set one up:"
    480         echo "http://haiku-os.org/documents/dev/how_to_build_haiku_on_mac_os_x"
    481         exit 1
     474# check for case-sensitive filesystem
     475mkdir haikuCaseTest 2>/dev/null
     476mkdir haikucasetest 2>/dev/null
     477caseInsensitive=$?
     478rm -df haikuCaseTest haikucasetest
     479if [ $caseInsensitive != 0 ]; then
     480    echo "You need a case-sensitive file-system to build Haiku."
     481    if [ $HOST_PLATFORM = "darwin" ]; then
     482        echo "You can create a case-sensitive disk image using Disk Utility and use"
     483        echo "it to store the Haiku sources on."
    482484    fi
     485    exit 1
    483486fi
    484487
    485488# create output directory