Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

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

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

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

name = hello

[hello.d]
target = hello
dsss build -dc=gdc-posix-tango

With Xcode.app

xcode settings for tango

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

Using Tangobos

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

Attachments

  • xcode-tango.png (43.8 kB) -xcode settings for tango, added by afb on 04/28/08 11:50:27.