Skip to content

Commit da04a71

Browse files
author
Nick Beadman
committed
Added support for OS X 10.13 SDK use by Xcode 10
- Used same method as zettemaan used for 10.12 SDK using Xcode 9.4.1 as source - Incorporated jwhitlock's fix to use plutil to fix Xcode 10's use of binary MaxOSX.platform/Info.plist
1 parent 817eb01 commit da04a71

File tree

2 files changed

+54
-9
lines changed

2 files changed

+54
-9
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
XcodeLegacy
22
===========
33

4-
Legacy components for Xcode 4-8 (deprecated compilers and Mac OS X SDKs).
4+
Legacy components for Xcode 4-10 (deprecated compilers and Mac OS X SDKs).
55

66
Home page: https://github.com/devernay/xcodelegacy
77

@@ -10,12 +10,12 @@ Description
1010

1111
Many components were removed in recent versions of Xcode, the most notable being the Mac OS X 10.6 SDK, which is required to build software using the Carbon API (such as wxWidgets 2.8).
1212

13-
I made the script XcodeLegacy.sh to extract these components (the links work if you [sign in to Apple Developer](https://developer.apple.com/downloads/) first) from [Xcode 3.2.6](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_3.2.6_and_ios_sdk_4.3__final/xcode_3.2.6_and_ios_sdk_4.3.dmg) (10.4, 10.5 and 10.6 SDKs, PPC assembler, GCC 4.0 and 4.2, LLVM-GCC 4.2), [Xcode 4.6.3](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4.6.3/xcode4630916281a.dmg) (10.7 SDK), [Xcode 5.1.1](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_5.1.1/xcode_5.1.1.dmg) (10.8 SDK), [Xcode 6.4](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_6.4/Xcode_6.4.dmg) (10.9 and 10.10 SDKs), [Xcode 7.3.1](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg) (10.11 SDK) and install them in Xcode 4-8:
13+
I made the script XcodeLegacy.sh to extract these components (the links work if you [sign in to Apple Developer](https://developer.apple.com/downloads/) first) from [Xcode 3.2.6](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_3.2.6_and_ios_sdk_4.3__final/xcode_3.2.6_and_ios_sdk_4.3.dmg) (10.4, 10.5 and 10.6 SDKs, PPC assembler, GCC 4.0 and 4.2, LLVM-GCC 4.2), [Xcode 4.6.3](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4.6.3/xcode4630916281a.dmg) (10.7 SDK), [Xcode 5.1.1](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_5.1.1/xcode_5.1.1.dmg) (10.8 SDK), [Xcode 6.4](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_6.4/Xcode_6.4.dmg) (10.9 and 10.10 SDKs), [Xcode 7.3.1](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg) (10.11 SDK), [Xcode 8.3.3](https://download.developer.apple.com/Developer_Tools/Xcode_8.3.3/Xcode8.3.3.xip) (10.12 SDK), [Xcode 9.4.1](https://download.developer.apple.com/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip) (10.13 SDK) and install them in Xcode 4-10:
1414

1515
- GCC 4.0, GCC 4.2 and LLVM GCC 4.2 compilers
1616
- GCC 4.0, GCC 4.2 and LLVM GCC 4.2 Xcode plugins
1717
- PPC assembler
18-
- Mac OS X SDK 10.4u, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
18+
- Mac OS X SDK 10.4u, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 10.12, 10.13
1919

2020
The script also fixes a few known bugs in the 10.4, 10.5 and 10.6 SDK.
2121

@@ -35,7 +35,7 @@ Open a Terminal application, change to the directory where `XcodeLegacy.sh`, and
3535
cd path/to/xcodelegacy
3636
chmod +x XcodeLegacy.sh
3737
```
38-
Execute the script by typing `./XcodeLegacy.sh <arg>`. The script takes one argument, which can be "buildpackages" (to extract components from the legacy Xcode downloads to the current directory), "install" (to install the components in Xcode 4-8), "cleanpackages" (to delete the extracted components from the current directory), "uninstall" (to uninstall the components from Xcode 4-8).
38+
Execute the script by typing `./XcodeLegacy.sh <arg>`. The script takes one argument, which can be "buildpackages" (to extract components from the legacy Xcode downloads to the current directory), "install" (to install the components in Xcode 4-10), "cleanpackages" (to delete the extracted components from the current directory), "uninstall" (to uninstall the components from Xcode 4-10).
3939

4040
With the "install" or "uninstall" arguments, the script uses sudo to become root, and will thus ask for your password. Please check the script contents before executing it.
4141

@@ -51,6 +51,7 @@ Optionally, one of the following options can be passed as the *first* argument t
5151
* `-osx1010` : only install OSX 10.10 SDK
5252
* `-osx1011` : only install OSX 10.11 SDK
5353
* `-osx1012` : only install OSX 10.12 SDK
54+
* `-osx1013` : only install OSX 10.13 SDK
5455

5556

5657
Using the older SDKs
@@ -111,6 +112,7 @@ Here are the latest versions of Xcode that are known to /run/ on each OS X versi
111112
- [Xcode 7.2.1](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.2.1/Xcode_7.2.1.dmg) on OS X 10.10 (Yosemite)
112113
- [Xcode 7.3.1](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg) on OS X 10.11 (El Capitan), please see note on linking below. [Xcode 8.2.1](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_8.2.1/Xcode_8.2.1.xip) also runs on OS X 10.11, but can only compile for macOS 10.12.
113114
- [Xcode 8.3.3](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_8.3.3/Xcode8.3.3.xip) on macOS 10.12 (Sierra), please see note on linking below.
115+
- [Xcode 9.4.1](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip) on macOS 10.13 (High Sierra), please see note on linking below.
114116

115117
(*) These Xcode versions were released before 26.03.2012 and may cause an "An unknown installation error" during installation, which is due to an expired certificate. Installing these may require disabling network time sync and setting the date to 01.01.2012 before installing. Network time sync may be re-enabled after install. See [this stackexchange question](https://apple.stackexchange.com/questions/45841/xcode-4-2-snow-leopard-doesnt-install) for more details.
116118

@@ -207,4 +209,5 @@ History
207209
- 1.7 (05/04/2016): Xcode 7.3 disables support for older SDKs, fix that
208210
- 1.9 (16/09/2016): Xcode 8 dropped 10.11 SDK, get it from Xcode 7.3.1
209211
- 2.0 (02/05/2017): Xcode 8 cannot always link i386 for OS X 10.5, use the Xcode 3 linker for this arch too. Force use of legacy assembler with GCC 4.x.
210-
- 2.1 (17/01/2017): Xcode 9 dropped 10.12 SDK, get it from https://github.com/phracker/MacOSX-SDKs; fix compiling with GNU Ada, and many other fixes
212+
- 2.1 (17/01/2017): Xcode 9 dropped 10.12 SDK, get it from Xcode 8.3.3; fix compiling with GNU Ada, and many other fixes
213+
- 2.2 (10/01/2019): Xcode 10 dropped 10.13 SDK, get it from Xcode 9.4.1

XcodeLegacy.sh

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# - Eric Knibbe <EricFromCanada@github>
99
# - Chris Roueche <croueche@github>
1010
# - Kris Coppieters <zwettemaan@github>
11+
# - Nick Beadman <[email protected]> / <nbeadman@github>
1112
#
1213
# License: Creative Commons BY-NC-SA 3.0 http://creativecommons.org/licenses/by-nc-sa/3.0/
1314
#
@@ -24,6 +25,7 @@
2425
# 1.9 (16/09/2016): Xcode 8 dropped 10.11 SDK, get it from Xcode 7.3.1
2526
# 2.0 (02/05/2017): Xcode 8 cannot always link i386 for OS X 10.5, use the Xcode 3 linker for this arch too. Force use of legacy assembler with GCC 4.x.
2627
# 2.1KC (26/10/2017): Added support to extract OS X 10.12 from Xcode 8.2.1 for use on Xcode 9/OS X 10.13
28+
# 2.2NB (10/01/2019): Added support for using macOS High Sierra 10.13 SDK from Xcode 9.4.1 for use on Xcode 10/macOS 10.14 Mojave, also changed source of OS X 10.12 SDK to Xcode 8.3.3
2729

2830
#set -e # Exit immediately if a command exits with a non-zero status
2931
#set -u # Treat unset variables as an error when substituting.
@@ -39,6 +41,7 @@ osx109=0
3941
osx1010=0
4042
osx1011=0
4143
osx1012=0
44+
osx1013=0
4245
gotoption=0
4346
error=0
4447

@@ -95,6 +98,11 @@ while [[ $error = 0 ]] && [[ $# -gt 1 ]]; do
9598
gotoption=1
9699
shift
97100
;;
101+
-osx1013)
102+
osx1013=1
103+
gotoption=1
104+
shift
105+
;;
98106
*)
99107
# unknown option or spurious arg
100108
error=1
@@ -114,19 +122,20 @@ if [ $gotoption = 0 ]; then
114122
osx1010=1
115123
osx1011=1
116124
osx1012=1
125+
osx1013=1
117126
fi
118127

119128
if [ $# != 1 ]; then
120129
# ################################################################################ 80 cols
121-
echo "Usage: $0 [-compilers|-osx104|-osx105|-osx106|-osx107|-osx108|-osx109|-osx1010|-osx1011|-osx1012] buildpackages|install|installbeta|cleanpackages|uninstall|uninstallbeta"
130+
echo "Usage: $0 [-compilers|-osx104|-osx105|-osx106|-osx107|-osx108|-osx109|-osx1010|-osx1011|-osx1012|-osx1013] buildpackages|install|installbeta|cleanpackages|uninstall|uninstallbeta"
122131
echo ""
123132
echo "Description: Extracts / installs / cleans / uninstalls the following components"
124-
echo "from Xcode 3.2.6, Xcode 4.6.3, Xcode 5.1.1, Xcode 6.4, Xcode 7.3.1 and Xcode 8.2.1 which"
133+
echo "from Xcode 3.2.6, Xcode 4.6.3, Xcode 5.1.1, Xcode 6.4, Xcode 7.3.1, Xcode 8.3.3 and Xcode 9.4.1 which"
125134
echo "are not available in Xcode >= 4.2:"
126135
echo " - PPC assembler and linker"
127136
echo " - GCC 4.0 and 4.2 compilers and Xcode plugins"
128137
echo " - LLVM-GCC 4.2 compiler and Xcode plugin (Xcode >= 5)"
129-
echo " - Mac OS X SDK 10.4u, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 10.12"
138+
echo " - Mac OS X SDK 10.4u, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 10.12, 10.13"
130139
echo ""
131140
echo "An optional first argument may be provided to limit the operation (by default"
132141
echo "everything is done):"
@@ -141,6 +150,7 @@ if [ $# != 1 ]; then
141150
echo " -osx1010 : only install OSX 10.10 SDK"
142151
echo " -osx1011 : only install OSX 10.11 SDK"
143152
echo " -osx1012 : only install OSX 10.12 SDK"
153+
echo " -osx1013 : only install OSX 10.13 SDK"
144154
echo "Note that these can be combined. For example, to build and install the 10.9"
145155
echo "and 10.10 SDKs, one could execute:"
146156
echo " $ $0 -osx109 -osx1010 buildpackages"
@@ -201,6 +211,7 @@ xc5="$(( osx108 != 0 ))"
201211
xc6="$(( osx109 + osx1010 != 0 ))"
202212
xc7="$(( osx1011 != 0 ))"
203213
xc8="$(( osx1012 != 0 ))"
214+
xc9="$(( osx1013 != 0 ))"
204215

205216
# The sole argument is the macOS version (e.g. 10.12)
206217
installSDK() {
@@ -288,6 +299,14 @@ case $1 in
288299
echo "and then run this script from within the same directory as the downloaded file"
289300
missingdmg=1
290301
fi
302+
if [ "$xc9" = 1 ] && [ ! -f Xcode_9.4.1.xip ]; then
303+
echo "*** You should download Xcode 9.4.1. Login to:"
304+
echo " https://developer.apple.com/downloads/"
305+
echo "then download from:"
306+
echo " https://download.developer.apple.com/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip"
307+
echo "and then run this script from within the same directory as the downloaded file"
308+
missingdmg=1
309+
fi
291310
if [ "$missingdmg" = 1 ]; then
292311
echo "*** at least one Xcode distribution is missing, cannot build packages - exiting now"
293312
exit
@@ -566,7 +585,7 @@ EOF
566585
fi
567586
if [ "$xc8" = 1 ]; then
568587
if [ "$osx1012" = 1 ]; then
569-
echo "Extracting Mac OS X 10.12 from Xcode 8.3.3. Be patient - this will take some time"
588+
echo "Extracting Mac OS X 10.12 SDK from Xcode 8.3.3. Be patient - this will take some time"
570589
open Xcode8.3.3.xip
571590
while [ ! -d Xcode.app ]; do
572591
sleep 5
@@ -576,6 +595,18 @@ EOF
576595
rm -rf Xcode.app
577596
fi
578597
fi
598+
if [ "$xc9" = 1 ]; then
599+
if [ "$osx1013" = 1 ]; then
600+
echo "Extracting Mac OS X 10.13 SDK from Xcode 9.4.1. Be patient - this will take some time"
601+
open Xcode_9.4.1.xip
602+
while [ ! -d Xcode.app ]; do
603+
sleep 5
604+
done
605+
sleep 5
606+
( (cd "Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer" || exit; rm SDKs/MacOSX10.13.sdk; mv SDKs/MacOSX.sdk SDKs/MacOSX10.13.sdk; tar cf - SDKs/MacOSX10.13.sdk) | gzip -c > Xcode1013SDK.tar.gz) && echo "*** Created Xcode1013SDK.tar.gz in directory $(pwd)"
607+
rm -rf Xcode.app
608+
fi
609+
fi
579610
rmdir "$MNTDIR"
580611
;;
581612

@@ -982,6 +1013,10 @@ SPEC_EOF
9821013
installSDK 10.12
9831014
fi
9841015

1016+
if [ "$osx1013" = 1 ]; then
1017+
installSDK 10.13
1018+
fi
1019+
9851020
if [ "$compilers" = 1 ]; then
9861021
if [ -f /usr/bin/gcc-4.0 ]; then
9871022
#echo "*** Not installing xcode_3.2.6_gcc4.0.pkg (found installed in /usr/bin/gcc-4.0, uninstall first to force install)"
@@ -1110,6 +1145,9 @@ SPEC_EOF
11101145
if [ "$osx1012" = 1 ]; then
11111146
rm Xcode1012SDK.tar.gz 2>/dev/null
11121147
fi
1148+
if [ "$osx1012" = 1 ]; then
1149+
rm Xcode1013SDK.tar.gz 2>/dev/null
1150+
fi
11131151

11141152
;;
11151153

@@ -1218,6 +1256,10 @@ SPEC_EOF
12181256
i=10.12
12191257
[ -f "$SDKDIR/SDKs/MacOSX${i}.sdk/legacy" ] && rm -rf "$SDKDIR/SDKs/MacOSX${i}.sdk"
12201258
fi
1259+
if [ "$osx1013" = 1 ]; then
1260+
i=10.13
1261+
[ -f "$SDKDIR/SDKs/MacOSX${i}.sdk/legacy" ] && rm -rf "$SDKDIR/SDKs/MacOSX${i}.sdk"
1262+
fi
12211263

12221264
if [ "$compilers" = 1 ]; then
12231265
if [ "$GCCINSTALLDIR/usr/bin/gcc" -ef "$GCCINSTALLDIR/usr/bin/clang" ]; then

0 commit comments

Comments
 (0)