Coder Social home page Coder Social logo

jakirkham / xcodelegacy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devernay/xcodelegacy

0.0 3.0 0.0 121 KB

Legacy components for XCode 4-8 (deprecated compilers and Mac OS X SDKs)

Home Page: https://github.com/devernay/xcodelegacy

Shell 100.00%

xcodelegacy's Introduction

XcodeLegacy

Legacy components for XCode 4-8 (deprecated compilers and Mac OS X SDKs).

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

Description

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).

I made the script XcodeLegacy.sh to extract these components (the links work if you sign in to Apple Developer first) from Xcode 3.2.6 (10.4, 10.5 and 10.6 SDKs, PPC assembler, GCC 4.0 and 4.2, LLVM-GCC 4.2), Xcode 4.6.3 (10.7 SDK), Xcode 5.1.1 (10.8 SDK), Xcode 6.4 (10.9 and 10.10 SDKs), Xcode 7.3.1 (10.11 SDK) and install them in Xcode 4-8:

  • GCC 4.0, GCC 4.2 and LLVM GCC 4.2 compilers
  • GCC 4.0, GCC 4.2 and LLVM GCC 4.2 Xcode plugins
  • PPC assembler
  • Mac OS X SDK 10.4u, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11

Note: There may be similar tips to compile for older iOS (not Mac OS X) versions, but I don't develop for iOS. However, if you want to enhace the XcodeLegacy script to also include those components, I'll gladly integrate your modifications.

Download

XcodeLegacy.sh (previous versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9)

GitHub repository

Usage

Open a Terminal application, change to the directory where XcodeLegacy.sh, and make it executable, as in:

cd path/to/xcodelegacy
chmod +x XcodeLegacy.sh

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).

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.

Optionally, one of the following options can be passed as the first argument to XcodeLegacy.sh, to limit its operation:

  • -compilers : only install the gcc and llvm-gcc compilers, as well as the corresponding Xcode plugins
  • -osx104 : only install Mac OSX 10.4 SDK
  • -osx105 : only install Mac OSX 10.5 SDK
  • -osx106 : only install Mac OSX 10.6 SDK
  • -osx107 : only install Mac OSX 10.7 SDK
  • -osx108 : only install OSX 10.8 SDK
  • -osx109 : only install OSX 10.9 SDK
  • -osx1010 : only install OSX 10.10 SDK
  • -osx1011 : only install OSX 10.11 SDK

Using the older SDKs

To use any of the older SDKs, you should:

  • compile and link with the options -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
  • set the environment variable MACOSX_DEPLOYMENT_TARGET to the proper value (e.g. 10.5) - this should be redundant with the -mmacosx-version-mincompiler option, but older compilers do not seem to pass this option to the linker.

For example:

env MACOSX_DEPLOYMENT_TARGET=10.6 clang -arch i386 -arch x86_64 -mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk main.c -o main

Using the older compilers

Links to the compilers are installed in /usr/bin (or /usr/local/bin on OS X 10.11 El Capitan and later): gcc-4.0 g++-4.0 gcc-4.2 g++-4.2 llvm-cpp-4.2 llvm-g++-4.2 llvm-gcc-4.2.

GCC 4.0, GCC 4.2 and LLVM GCC 4.2 cannot compile for OS X 10.10 or newer.

PowerPC architectures (ppc, ppc7400, ppc970, ppc64) cannot be linked for OS X 10.7 or newer (they would be useless anyway, since PowerPC CPUs were only supported up to 10.5).

Note on Xcode versions

Here are the latest versions of Xcode that are known to /run/ on each OS X version (the links work if you sign in to Apple Developer first):

More information about the compilers included in each version of Xcode can be found on the MacPorts Wiki.

Linking on Xcode 7.3 and later

The following error may appear when linking a program using the older compilers from Xcode (command-line and Makefile-based builds should not be affected):

Running ld for ppc ...
ld: unknown option: -no_deduplicate

The reason is that the newer versions of the linker introduced the option -no_deduplicate, which Xcode adds by default. To disable this, add a User-Defined build setting in Xcode named LD_DONT_RUN_DEDUPLICATION and set its value to NO.

License

This script is distributed under the Creative Commons BY-NC-SA 3.0 license.

History

  • 1.0 (08/10/2012): First public version, supports Xcode up to version 4.6.3
  • 1.1 (20/09/2013): Xcode 5 removed llvm-gcc and 10.7 SDK support, grab them from Xcode 3 and 4
  • 1.2 (03/02/2014): Xcode 5 broke PPC assembly and linking; fix assembly and grab linker from Xcode 3
  • 1.3 (07/10/2014): Xcode 6 removed 10.8 SDK, grab it from Xcode 5.1.1
  • 1.4 (21/08/2015): Xcode 7 removed 10.9 and 10.10 SDKs, grab them from Xcode 6.4
  • 1.5 (15/10/2015): Fixes for OS X 10.11 El Capitan (nothing can be installed in /usr/bin because of the sandbox)
  • 1.6 (11/11/2015): Fix buildpackages, fix /usr/bin/gcc on recent OS X, fix download messages
  • 1.7 (05/04/2016): Xcode 7.3 disables support for older SDKs, fix that
  • 1.9 (16/09/2016): Xcode 8 dropped 10.11 SDK, get it from Xcode 7.3.1

xcodelegacy's People

Contributors

devernay avatar ericfromcanada avatar inspector-g avatar jaesgk avatar nickwww avatar raxoft avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.