[[TOC()]] = Installation Guide for Tango used with GDC on Mac OS X = This page details ways of installing Tango for GDC on Mac OS X. == Install Packages == These packages are intended for Mac OS X 10.4 "Tiger", with Xcode Tools 2.4.1[[BR]] or Mac OS X 10.5 "Leopard", with Xcode Tools 3.1 ({{{gcc-5484}}}) or 3.0 ({{{gcc-5465}}}). Universal binaries are provided, meaning they work on both PowerPC and Intel.[[BR]] The compilers also have 32-bit and 64-bit support, for each of those architectures. The next major release, aimed at the illusive GDC 0.25, is scheduled to have[[BR]] support for Xcode 3.1.2 and the Apple {{{gcc-4.2}}} compiler (as opposed to {{{gcc-4.0}}}). The packages install under `/usr`, next to the regular GCC files from Xcode Tools.[[BR]] Uninstall programs are provided, to remove the files installed by the packages. === GDC === http://sourceforge.net/project/showfiles.php?group_id=135857&package_id=149174 gdc-trunk-!r229-mac-10.4.dmg (GDC.pkg) gdc-trunk-!r229-mac-10.5.dmg (GDC.pkg) ~~gdc-0.24-macosx-universal-gcc-5363.tar.bz2~~ (the 0.24 release doesn't work with Tango) === DSSS === http://svn.dsource.org/projects/dsss/downloads/ dsss-0.75-gdc-mac-10.4.dmg (DSSS.pkg) dsss-0.78-gdc-mac-10.4.dmg (DSSS.pkg) === Tango === http://dsource.org/projects/tango/wiki/GdcDownloads tango-0.99.7-mac-10.4.dmg (Tango.pkg) tango-0.99.8-mac-10.4.dmg (Tango.pkg) === Tangobos === ~~http://svn.dsource.org/projects/tangobos/downloads/~~ http://dsource.org/projects/tango/wiki/GdcDownloads tangobos-trunk-!r59-mac-10.4.dmg (Tangobos.pkg) == Using Tango == hello.d {{{ #!d import tango.io.Console; void main() { Cout ("Hello, sweetheart \u263a").newline; } }}} The default configuration of the Mac OS X Universal packages for GDC and DSSS will try to use Phobos, so there's some minor extra configuration parameters needed for them to use Tango instead. This is so that they set the Tango/Posix versions and to include the Tango library when not using "build". === With GDC === {{{ gdmd -version=Tango -version=Posix hello.d -L-lgtango }}} Makefile {{{ #!make all: hello %.o: %.d gdc -fversion=Tango -fversion=Posix -c -o $@ $< hello: hello.o gdc -o $@ $^ -lgtango clean: rm -f *.o hello }}} {{{ make }}} === With DSSS === {{{ rebuild -dc=gdc-posix-tango hello.d }}} dsss.conf {{{ #!ini name = hello [hello.d] target = hello }}} {{{ dsss build -dc=gdc-posix-tango }}} === With Xcode.app === [[Image(xcode-tango.png)]] The Xcode IDE has good support for D, when using the http://michelf.com/projects/d-for-xcode/ plugin. Note: Xcode will by default use `/usr/bin/gcc` to link (not gdc), so it needs an extra `-lgphobos` argument. === Other === * See [wiki:CodeBlocks Code::Blocks] for how to configure it for Tango. == Using Tangobos == hello.d {{{ #!d version(Tango) { import std.compat; } import std.stdio; void main() { writefln("Hello, World!"); } }}} To be able to compile code that uses Phobos with Tango, the [wiki:TangobosInfo Tangobos] library needs to be installed. When not using a build tool, you need to include the "gtangobos" library before the "gtango" library. {{{ gdmd -version=Tango -version=Posix hello.d -L-lgtangobos -L-lgtango }}} == Universal Binaries == If you are building for Intel on a PowerPC, so that the system doesn't have the required architecture without using a `-isysroot` parameter, then the easiest installation setup to be able to use D is to add symbolic links from the SDK to the regular libraries: {{{ sudo ln -s /usr/lib/libgphobos.a /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libgphobos.a sudo ln -s /usr/lib/libgtango.a /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libgtango.a }}} Then you should be able to build Universal Binaries with the usual `-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk` parameters to GCC/GDC. When building on Intel you only need this setup if cross-compiling.