Build Instructions using Tango trunk on Linux/OSX/FreeBSD/Solaris
After LDC has been build, we can now set up a working LDC/Tango setup.
- Install LDC to /opt/ldc
mkdir /opt/ldc mkdir /opt/ldc/bin mkdir /opt/ldc/import mkdir /opt/ldc/lib cd ../ldc/bin cp ldc ldmd ldc.conf /opt/ldc/bin
- Fetch&Compile Tango
export PATH=/opt/ldc/bin:$PATH svn co http://svn.dsource.org/projects/tango/trunk cd trunk ./build/script/bob.rb -vu -r ldc -c ldc . cp libtango.a /opt/ldc/lib cp -r object.di tango /opt/ldc/import/
- Change the contents of /opt/ldc/bin/ldc.conf to:
default: { switches = [ "-I%%ldcbinarypath%%/../import", "-I%%ldcbinarypath%%/../import/tango/core/vendor", "-L-L%%ldcbinarypath%%/../lib", "-d-version=Tango", "-defaultlib=tango", "-debuglib=tango" ]; };
- Done! :D
Notes:
- "object.d: Error: module object cannot read file 'object.d'"; This error indicates that your ldc.conf is wrong; you may have a stale ldc.conf around that is used by ldc instead.
To check for other ldc.conf files on your system you can do "find / -iname "ldc.conf"". Or put a syntax error into ldc.conf; if ldc isn't complaining, it's using a different ldc.conf file.
- Instead of the bob.rb (a Ruby script) you can also use ./build/bin/<arch>/bob.
- You can install ldc in some other directory, of course, but you need to adjust some paths!
Playtime
- Create a file called main.d:
import tango.io.Stdout; void main() { Stdout("Hello World!").nl; }
- Compile it to verify that LDC with Tango is working:
ldc main.d ./main