Building an updated GDC on Windows ================================== The procedures in this document are for setting up D 1.0 and have not been used for D 2.0. The build scripts included are modified from http://www.tdragon.net/recentgcc/ for gcc 4.3.1. pthreads and iconv support is not used. All GMP & MPFR build scripts have options (c)onfigure (m)ake (i)nstall. The GCC build script was slightly modified and has (c)onfigure (b)ootstrap (m)ake (i)nstall. The first run should use (b) not (m) any changes made to the source can use (m) after. The following setup is required to build GCC 4.3.1 and GDC trunk for windows. I recommned the automatic installers for simplicity and the automatic setup of shortcuts and environment variables. Feel free to do it how you like. Tools * TDM GCC 4.4.1 : http://sourceforge.net/projects/tdm-gcc/files/TDM-MinGW%20Installer/1.908.0/tdm-mingw-1.908.0-4.4.1-2.exe/download * MSYS-1.0.11 : http://sourceforge.net/projects/mingw/files/MSYS%20Base%20System/msys-1.0.11/MSYS-1.0.11.exe/download * MSYS updates. Required for an out of memory issue within msys. * * Wget from GnuWin32 : http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-bin.zip * LibIntl : http://gnuwin32.sourceforge.net/downlinks/libintl-bin-zip.php * OpenSSL required by wget : http://downloads.sourceforge.net/gnuwin32/openssl-0.9.8h-1-bin.zip Download the lastest gdc trunk. hg clone http://bitbucket.org/goshawk/gdc/ Apply some patches for windows ------------------------------ At this time, these patches are not part of repository but are required to get a working windows build. cd gdc wget http://bitbucket.org/m/attch/2010/02/fix_param_zu.patch patch -p1 < fix_param_zu.patch wget http://bitbucket.org/m/attch/2010/02/version_windows.patch patch -p1 < fix_param_zu.patch open d/dmd/root.c goto line 595 and delete the duplicate case '/': statement This is where binaries are stored. mkdir /build Compile GMP -------------------- mkdir -p dev/build/gmp cd dev wget ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.bz2 tar xvjf gmp-4.3.2.tar.bz2 cd build/gmp ../../gmp-build.sh c m i Compile MPFR ------------ cd ../.. wget http://www.mpfr.org/mpfr-current/mpfr-2.4.2.tar.bz2 tar xvjf mpfr-2.4.2.tar.bz2 mkdir build/mpfr cd build/mpfr ../../mpfr-build.sh c m i Compile GCC with c,d -------------------- C++ should work, but adds a considerable amount of time to the build so I ignored it for now. Ideally one would compile it too as a total replacement for Mingw. cd ../.. wget http://ftpmirror.gnu.org/gcc/gcc-4.3.1/gcc-4.3.1.tar.bz2 tar xvjf gcc-4.3.1.tar.bz2 cd gcc-4.3.1 cp -r ../../d gcc/d ./gcc/d/setup-gcc.sh --d-language-version=1 cd .. mkdir build/gcc cd build/gcc ../../gcc-build.sh c b i Finishing the build environment ------------------------------- If your brave enough to copy the newly compiled mingw over the installed one go for it. Otherwise you'll have to download some extra files and extract them the root directory of the gdc compiler. Building Tango 0.99.8 --------------------- I haven't had time to test the newest version of Tango, partly because there isn't much support for GDC as the last release was eons ago. Win32 files tango/sys/win32 Other Issues ------------ Variant/Traits error with arrays. GDC has specific code for dealing with static arrays that doesn't work phobos std/c/windows/com.d extern(Windows) fails.