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 , 11 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 = ./ 35 35 36 36 ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh) 37 37 38 # SDK configuration 39 40 XCODE_TOOL_PATH ?= $(shell sh $(SRCDIR)/config-mac-xcode-tool-path.sh)/ 41 XCODE_SDK_NAME ?= MacOSX 42 XCODE_SDK ?= $(shell sh $(SRCDIR)/config-mac-xcode-sdk.sh $(XCODE_SDK_NAME)) 43 38 44 # commands 39 45 40 POSTINSTALL_PROGRAM = install_name_tool 46 C_COMPILER = $(XCODE_TOOL_PATH)gcc 47 LINKER = $(XCODE_TOOL_PATH)gcc 48 POSTINSTALL_PROGRAM = $(XCODE_TOOL_PATH)install_name_tool 41 49 42 50 # options 43 51 44 52 C_COMPILER_OPTIONS ?= -no-cpp-precomp -fno-strict-aliasing -fwrapv -fno-common -DHAVE_CHICKEN_CONFIG_H 45 53 ifdef DEBUGBUILD 54 46 55 C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused 47 56 else 48 57 ifdef OPTIMIZE_FOR_SPEED … … LINKER_LINK_SHARED_LIBRARY_OPTIONS = -dynamiclib -compatibility_version 1 -curre 55 64 POSTINSTALL_PROGRAM_FLAGS = -change lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO) $(LIBDIR)/lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO) 56 65 LIBRARIAN_OPTIONS = scru 57 66 LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -bundle -L. 58 ASSEMBLER_OPTIONS =59 67 60 68 # file extensions 61 69 … … LINKER_LINK_SHARED_DLOADABLE_OPTIONS += -Wl,-headerpad -Wl,128 77 85 else 78 86 79 87 ifeq ($(ARCH),universal) 80 C_COMPILER_OPTIONS += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk81 LINKER_OPTIONS += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk88 C_COMPILER_OPTIONS += -arch ppc -arch i386 89 LINKER_OPTIONS += -arch ppc -arch i386 82 90 endif 83 91 84 92 endif 85 93 94 ifneq ($(XCODE_SDK),) 95 C_COMPILER_EXTRA_OPTIONS = -isysroot $(XCODE_SDK) 96 LINKER_EXTRA_OPTIONS = -isysroot $(XCODE_SDK) -L$(XCODE_SDK)/usr/lib 97 endif 98 99 86 100 # select default and internal settings 87 101 88 102 include $(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 28 SDK_NAME="$1" 29 30 # uses lowest SDK version 31 echo `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 28 if test -d "/Applications/Xcode.app/Contents/Developer/usr/bin"; then 29 echo "/Applications/Xcode.app/Contents/Developer/usr/bin" 30 fi -
distribution/manifest
diff --git a/distribution/manifest b/distribution/manifest index 4d47e8a..e582671 100644
a b 1 1 ChangeLog 2 2 ChangeLog.20040412 3 3 ChangeLog.20070807 4 config-mac-xcode-sdk.sh 5 config-mac-xcode-tool-path.sh 4 6 INSTALL 5 7 LICENSE 6 8 NEWS