Ticket #1053: 0002-Detect-Xcode-sdk-and-toolchain-correctly-for-newer-x.patch

File 0002-Detect-Xcode-sdk-and-toolchain-correctly-for-newer-x.patch, 6.5 KB (added by felix winkelmann, 8 years ago)
  • Makefile.macosx

    From b8bb312199e6004bffca35fecdd5dac53ecad4fa Mon Sep 17 00:00:00 2001
    From: felix <felix@call-with-current-continuation.org>
    Date: Thu, 1 Aug 2013 17:14:45 +0200
    Subject: [PATCH 2/2] Detect Xcode sdk and toolchain correctly for newer xcode
     versions.
    
    ---
     Makefile.macosx               |   22 ++++++++++++++++++----
     config-mac-xcode-sdk.sh       |   31 +++++++++++++++++++++++++++++++
     config-mac-xcode-tool-path.sh |   30 ++++++++++++++++++++++++++++++
     distribution/manifest         |    2 ++
     4 files changed, 81 insertions(+), 4 deletions(-)
     create mode 100644 config-mac-xcode-sdk.sh
     create mode 100644 config-mac-xcode-tool-path.sh
    
    diff --git a/Makefile.macosx b/Makefile.macosx
    index 6137c96..6a57cc2 100644
    a b SRCDIR = ./ 
    3535
    3636ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh)
    3737
     38# SDK configuration
     39
     40XCODE_TOOL_PATH ?= $(shell sh $(SRCDIR)/config-mac-xcode-tool-path.sh)/
     41XCODE_SDK_NAME ?= MacOSX
     42XCODE_SDK ?= $(shell sh $(SRCDIR)/config-mac-xcode-sdk.sh $(XCODE_SDK_NAME))
     43
    3844# commands
    3945
    40 POSTINSTALL_PROGRAM = install_name_tool
     46C_COMPILER = $(XCODE_TOOL_PATH)gcc
     47LINKER = $(XCODE_TOOL_PATH)gcc
     48POSTINSTALL_PROGRAM = $(XCODE_TOOL_PATH)install_name_tool
    4149
    4250# options
    4351
    4452C_COMPILER_OPTIONS ?= -no-cpp-precomp -fno-strict-aliasing -fwrapv -fno-common -DHAVE_CHICKEN_CONFIG_H
    4553ifdef DEBUGBUILD
     54
    4655C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
    4756else
    4857ifdef OPTIMIZE_FOR_SPEED
    LINKER_LINK_SHARED_LIBRARY_OPTIONS = -dynamiclib -compatibility_version 1 -curre 
    5564POSTINSTALL_PROGRAM_FLAGS = -change lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO) $(LIBDIR)/lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)
    5665LIBRARIAN_OPTIONS = scru
    5766LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -bundle -L.
    58 ASSEMBLER_OPTIONS =
    5967
    6068# file extensions
    6169
    LINKER_LINK_SHARED_DLOADABLE_OPTIONS += -Wl,-headerpad -Wl,128 
    7785else
    7886
    7987ifeq ($(ARCH),universal)
    80 C_COMPILER_OPTIONS += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
    81 LINKER_OPTIONS += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
     88C_COMPILER_OPTIONS += -arch ppc -arch i386
     89LINKER_OPTIONS += -arch ppc -arch i386
    8290endif
    8391
    8492endif
    8593
     94ifneq ($(XCODE_SDK),)
     95C_COMPILER_EXTRA_OPTIONS = -isysroot $(XCODE_SDK)
     96LINKER_EXTRA_OPTIONS = -isysroot $(XCODE_SDK) -L$(XCODE_SDK)/usr/lib
     97endif
     98
     99
    86100# select default and internal settings
    87101
    88102include $(SRCDIR)/defaults.make
  • new file config-mac-xcode-sdk.sh

    diff --git a/config-mac-xcode-sdk.sh b/config-mac-xcode-sdk.sh
    new file mode 100644
    index 0000000..82b9a6c
    - +  
     1#!/bin/sh
     2# config-mac-xcode-sdk.sh - return path to Xcode SDK
     3#
     4# Copyright (c) 2008-2013, The Chicken Team
     5# All rights reserved.
     6#
     7# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
     8# conditions are met:
     9#
     10#   Redistributions of source code must retain the above copyright notice, this list of conditions and the following
     11#     disclaimer.
     12#   Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
     13#     disclaimer in the documentation and/or other materials provided with the distribution.
     14#   Neither the name of the author nor the names of its contributors may be used to endorse or promote
     15#     products derived from this software without specific prior written permission.
     16#
     17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
     18# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
     19# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
     20# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     22# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     24# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     25# POSSIBILITY OF SUCH DAMAGE.
     26
     27
     28SDK_NAME="$1"
     29
     30# uses lowest SDK version
     31echo `ls -Ad /Applications/Xcode.app/Contents/Developer/Platforms/${SDK_NAME}.platform/Developer/SDKs/* 2>/dev/null | head -n1`
  • new file config-mac-xcode-tool-path.sh

    diff --git a/config-mac-xcode-tool-path.sh b/config-mac-xcode-tool-path.sh
    new file mode 100644
    index 0000000..22e3270
    - +  
     1#!/bin/sh
     2# config-mac-xcode-tool-path.sh - return path to Xcode tools directory
     3#
     4# Copyright (c) 2008-2013, The Chicken Team
     5# All rights reserved.
     6#
     7# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
     8# conditions are met:
     9#
     10#   Redistributions of source code must retain the above copyright notice, this list of conditions and the following
     11#     disclaimer.
     12#   Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
     13#     disclaimer in the documentation and/or other materials provided with the distribution.
     14#   Neither the name of the author nor the names of its contributors may be used to endorse or promote
     15#     products derived from this software without specific prior written permission.
     16#
     17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
     18# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
     19# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
     20# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     22# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     24# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     25# POSSIBILITY OF SUCH DAMAGE.
     26
     27
     28if test -d "/Applications/Xcode.app/Contents/Developer/usr/bin"; then
     29    echo "/Applications/Xcode.app/Contents/Developer/usr/bin"
     30fi
  • distribution/manifest

    diff --git a/distribution/manifest b/distribution/manifest
    index 4d47e8a..e582671 100644
    a b  
    11ChangeLog
    22ChangeLog.20040412
    33ChangeLog.20070807
     4config-mac-xcode-sdk.sh
     5config-mac-xcode-tool-path.sh
    46INSTALL
    57LICENSE
    68NEWS