Posted: 11/14/09 18:58:10
samsam698 wrote:
It would be much much grateful if you would like to write a short tutorial
So here is how I set up my tango workspace.
I don't think that it is "The Right Way" (TM) to do it, but "It Works For Me" (TM).
This is a looong post and I know that it doesn't really fit here.
@Moderators: Please feel free to move it to a better place (or delete it due to general lack of quality). But let samsam698 know where it was moved to ;-)
I installed digital mars C and D and tango to the root of drive d: resulting in two folders for all binaries and sources etc.:
d:\dm - Digital mars C
d:\dmd - Digital mars D and tango etc.
During installation I built everything in a folder d:\trunk.
When you use other locations you have to replace d:\ in the following examples with your locations.
1. digital mars c compiler
Get latest digital mars c compiler suite from
http://www.digitalmars.com/download/freecompiler.html
I use three parts:
Digital Mars C/C++ Compiler Version 8.50:
http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm850c.zip
Basic Utilities:
http://ftp.digitalmars.com/bup.zip
beta test C++ Compiler Version 8.51:
http://ftp.digitalmars.com/Digital_Mars_C++/Patch/beta.zip
Unzip all zip files to d:\
This will create a folder d:\dm
2. digital mars d 1.0
Get latest digital mars d 1.0 compiler from
http://www.digitalmars.com/d/1.0/index.html
or
http://www.digitalmars.com/d/1.0/changelog.html
Version D 1.052:
http://ftp.digitalmars.com/dmd.1.052.zip
Unzip to d:\
This will create a folder d:\dmd
Add (append)
;d:\dmd\windows\bin;d:\dm\bin
to your windows search path.
Important:
The first link.exe and make.exe found on your search path must be the digital mars link.exe and make.exe.
Verify that the programs can be found via your search path.
Open a command window (Start/Run - cmd) and type: link -h, then make -h and then dmd.
You should see something like:
D:\>link -h
OPTLINK (R) for Win32 Release 8.00.2
Copyright (C) Digital Mars 1989-2009 All rights reserved.
...
D:\>make -h
Digital Mars Make Version 5.05
Copyright (C) Digital Mars 1985-2004. All Rights Reserved.
Written by Walter Bright www.digitalmars.com
...
D:\trunk>dmd
Digital Mars D Compiler v1.052
Copyright (c) 1999-2009 by Digital Mars written by Walter Bright
...
Optional: Save a copy of the original d:\dmd\windows\bin\sc.ini as e.g. sc_dmd.ini
3. dsss/rebuild
Get latest dsss from
http://www.dsource.org/projects/dsss/browser/trunk
http://www.dsource.org/projects/dsss/changeset/945/trunk?old_path=%2F&format=zip
Unzip to d:\
This will create a folder d:\trunk
The makefile for dsss will fail unless there is a folder with the winbins.
So:
Create a new folder d:\trunk\winbins
Download all files from
http://www.dsource.org/projects/dsss/browser/winbins
into the folder d:\trunk\winbins
Now modify d:\trunk\Makefile.dmd.win
The first line reads
PREFIX=C:\\dsss
Change that to
PREFIX=D:\\dmd\\windows
Open a command window (Start/Run - cmd) and type:
d:
cd \trunk
make install -fMakefile.dmd.win
This should build and install dsss/rebuild to d:\dmd\windows\bin
Leave the command window open.
When you plan to use tango as your default environment:
Modify d:\dmd\windows\etc\rebuild\default
The first line reads
profile=dmd-win
Change that to
profile=dmd-win-tango
Delete everything in d:\trunk.
4. tango
Get latest tango from
http://www.dsource.org/projects/tango/browser/trunk
http://www.dsource.org/projects/tango/changeset/5148/trunk?old_path=%2F&format=zip
Unzip to d:\
In your still open command window type:
build\bin\win32\bob -vu -r=dmd -c=dmd -l=tango -p=windows -o="-release -O" .
This will build tango.lib, the release version of tango.
Now type:
build\bin\win32\bob -vu -r=dmd -c=dmd -l=tango-dbg -p=windows -o="-debug -g" .
This will build tango-dbg.lib, the debug version of tango.
Move d:\trunk\tango.lib and d:\trunk\tango-dbg.lib to d:\dmd\windows\lib
Create a new folder d:\dmd\windows\import
Move the files LICENSE.txt, object.di and README.txt from d:\trunk to d:\dmd\windows\import
Move the folders std and tango from d:\trunk to d:\dmd\windows\import
Modify d:\dmd\windows\bin\sc.ini:
The original version is:
[Version]
version=7.51 Build 020
[Environment]
LIB="%@P%\..\lib";\dm\lib
DFLAGS="-I%@P%\..\..\src\phobos"
LINKCMD=%@P%\link.exe
Change that to:
[Version]
version=7.51 Build 020
[Environment]
LIB="%@P%\..\lib";\dm\lib
DFLAGS="-I%@P%\..\import" -version=Tango -defaultlib=tango.lib -debuglib=tango-dbg.lib -L+tango.lib
LINKCMD=%@P%\link.exe
Optional: Save a copy of this d:\dmd\windows\bin\sc.ini as e.g. sc_tango.ini
Now you should be able to build apps with dmd (or dsss build) and tango.
Delete everything in d:\trunk.
5. tangobos
Get latest tangobos from
http://www.dsource.org/projects/tangobos/browser/trunk
http://www.dsource.org/projects/tangobos/changeset/65/trunk?old_path=%2F&format=zip
Unzip to d:\
Modify lines 47 and 48 of d:\trunk\std\c\stdlib.d:
Lines 47 and 48 read:
const int EXIT_SUCCESS = 0; ///
const int EXIT_FAILURE = 1; /// ditto
Change that to:
// const int EXIT_SUCCESS = 0; ///
// const int EXIT_FAILURE = 1; /// ditto
Modify lines 1006 and 1272 of d:\trunk\std\format.d:
Line 1006 reads:
s = tis.xtoString(argptr);
Change that to:
s = tis.xtoString();
Line 1272 reads:
s = tis.xtoString(p_args);
Change that to:
s = tis.xtoString();
In your still open command window type:
dsss build
This will build crc32.lib, tangobos-etc.lib and tangobos.lib.
Move d:\trunk\crc32.lib, d:\trunk\tangobos-etc.lib and d:\trunk\tangobos.lib to d:\dmd\windows\lib
Move the files crc32.d, phoboslicense.txt and README from d:\trunk to d:\dmd\windows\import
Move the folders etc and std from d:\trunk to d:\dmd\windows\import
Rename file D:\dmd\windows\import\std\intrinsic.di to D:\dmd\windows\import\std\_tango_intrinsic.di
Rename file D:\dmd\windows\import\std\stdarg.di to D:\dmd\windows\import\std\_tango_stdarg.di
Rename file D:\dmd\windows\import\std\c\stdarg.di to D:\dmd\windows\import\std\c\_tango_stdarg.di
Modify d:\dmd\windows\bin\sc.ini:
Line 6 reads:
DFLAGS="-I%@P%\..\import" -version=Tango -defaultlib=tango.lib -debuglib=tango-dbg.lib -L+tango.lib
Change that to:
DFLAGS="-I%@P%\..\import" -version=Tango -defaultlib=tango.lib -debuglib=tango-dbg.lib -L+tango.lib -L+tangobos.lib -L+tangobos-etc.lib
Optional: Save a copy of this d:\dmd\windows\bin\sc.ini as e.g. sc_tangobos.ini
Now you should be able to build apps with dsss and tango and (at least some parts of) phobos.
Delete everything in d:\trunk.
6. dwin
Get latest dwin from
http://www.dsource.org/projects/dwin/browser/trunk
http://www.dsource.org/projects/dwin/changeset/332/trunk?old_path=%2F&format=zip
Unzip to d:\
At the monent building dwin fails because there are some files missing.
But you can still use parts of dwin when you build your apps with dsss (or xfbuild).
So:
Rename d:\trunk\lib\Readme.txt to d:\trunk\lib\Readme_dwin.txt.
In d:\trunk\lib delete files gdi32.lib, Kernel32.Lib and user32.lib
Move all remaining files from d:\trunk\lib to d:\dmd\windows\lib
Delete folder d:\trunk\lib
Create a new folder d:\dmd\windows\import\dwin
Move all files and folders from d:\trunk to d:\dmd\windows\import\dwin
Now you should be able to build apps with dsss and tango and (at least some parts of) phobos and dwin.
7. minid
This is a bit hairy at the moment due to some breaking changes in current tango.
Expect that to become much easier in near future.
Get latest mango from
http://www.dsource.org/projects/mango/browser/trunk
http://www.dsource.org/projects/mango/changeset/1133/trunk?old_path=%2F&format=zip
Unzip to d:\
Current mango doesn't build with current tango.
So:
Create a new folder d:\dmd\windows\import\mango
Move folder d:\trunk\mango to d:\dmd\windows\import
Delete everything in d:\trunk.
Get latest minid from
http://www.dsource.org/projects/minid/browser/trunk
http://www.dsource.org/projects/minid/changeset/591/trunk?old_path=%2F&format=zip
Unzip to d:\
Modify line 31 of d:\trunk\minid\ex.d:
Line 31 reads:
import tango.io.protocol.Reader;
Change that to:
import mango.io.protocol.Reader;
Modify line 31 of d:\trunk\minid\moduleslib.d:
Line 31 reads:
import tango.io.protocol.Reader;
Change that to:
import mango.io.protocol.Reader;
Modify lines 30 and 31 of d:\trunk\minid\serialization.d:
Lines 30 and 31 read:
import tango.io.protocol.Reader;
import tango.io.protocol.Writer;
Change that to:
import mango.io.protocol.Reader;
import mango.io.protocol.Writer;
Modify line 28 of d:\trunk\minidc.d:
Line 28 reads:
import tango.io.protocol.Writer;
Change that to:
import mango.io.protocol.Writer;
Modify line 3 of d:\trunk\test.d:
Line 3 reads:
import tango.core.stacktrace.TraceExceptions;
Change that to:
import tango.core.tools.TraceExceptions;
Mango and all these changes to minid are due to breaking changes in tango.
Normally there should be no need for that.
Minid addons:
I use two addons to minid - net.d and pcre.d:
Get net.d, pcre.d and libpcre.dll from
http://www.dsource.org/projects/minid/browser/extra/minid/addons
Create a new folder d:\trunk\minid\addons
Move net.d and pcre.d into the new folder d:\trunk\minid\addons
Move libpcre.dll to d:\dmd\windows\bin
In your still open command window type:
dsss build -d
(You must use -d because some functions in tango are now deprecated).
This will build DD-minid.lib, mdcl.exe, mdtest.exe and minidc.exe.
Move d:\trunk\DD-minid.lib to d:\dmd\windows\lib
Move d:\trunk\mdcl.exe and d:\trunk\minidc.exe to d:\dmd\windows\bin
Move the folder minid from d:\trunk to d:\dmd\windows\import
Delete everything in d:\trunk.
8. Windows bindings
Get all bindings from
http://www.dsource.org/projects/bindings/browser/trunk
http://www.dsource.org/projects/bindings/changeset/331/trunk?old_path=%2F&format=zip
Unzip to d:\
I only use some bindings for windows.
So:
Move the folder win32 from d:\trunk to d:\dmd\windows\import
Delete everything in d:\trunk.
Have fun!