https://wiki.dlang.org/?title=Developing_DMD_/_Phobos_on_Windows_8&feed=atom&action=history
Developing DMD / Phobos on Windows 8 - Revision history
2024-03-28T12:49:50Z
Revision history for this page on the wiki
MediaWiki 1.31.2
https://wiki.dlang.org/?title=Developing_DMD_/_Phobos_on_Windows_8&diff=5993&oldid=prev
O3o: Added category
2015-05-07T14:16:21Z
<p>Added category</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 14:16, 7 May 2015</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l146" >Line 146:</td>
<td colspan="2" class="diff-lineno">Line 146:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It is supposed to be run from git bash shell. ''build.sh fetch'' will clone repositories or update existing ones, ''build.sh build'' will build dmd, druntime and phobos in one go, taking care of all environment setup.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It is supposed to be run from git bash shell. ''build.sh fetch'' will clone repositories or update existing ones, ''build.sh build'' will build dmd, druntime and phobos in one go, taking care of all environment setup.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Windows]]</ins></div></td></tr>
</table>
O3o
https://wiki.dlang.org/?title=Developing_DMD_/_Phobos_on_Windows_8&diff=4589&oldid=prev
Dicebot at 02:46, 11 August 2014
2014-08-11T02:46:32Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 02:46, 11 August 2014</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l13" >Line 13:</td>
<td colspan="2" class="diff-lineno">Line 13:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This guide should be at least partially applicable to different versions of Visual Studio and Windows but you may need different download links</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This guide should be at least partially applicable to different versions of Visual Studio and Windows but you may need different download links</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">=== Helper Script ===</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">Easiest way to deal with all environment configuration and build routines is to use this script:</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><syntaxhighlight lang="Bash"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">#! /bin/bash</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">set -e</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></syntaxhighlight ></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Creating development environment ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Creating development environment ===</div></td></tr>
</table>
Dicebot
https://wiki.dlang.org/?title=Developing_DMD_/_Phobos_on_Windows_8&diff=4588&oldid=prev
Dicebot: Created page with "== WORK IN PROGRESS == NB! This guide is heavily biased towards those coming from Posix-like operating systems wanting to get a similar simple experience for testing code on ..."
2014-08-11T02:30:08Z
<p>Created page with "== WORK IN PROGRESS == NB! This guide is heavily biased towards those coming from Posix-like operating systems wanting to get a similar simple experience for testing code on ..."</p>
<p><b>New page</b></p><div>== WORK IN PROGRESS ==<br />
<br />
NB! This guide is heavily biased towards those coming from Posix-like operating systems wanting to get a similar simple experience for testing code on Windows. It may use very non-idiomatic solutions that will make any experienced Windows developer laugh. Development environment is based on Bash shell provided by Windows git distribution.<br />
<br />
Script itself is not very polished and is tuned to suit my personal needs.<br />
<br />
=== Installing prerequisites ===<br />
<br />
# Windows git distribution : http://msysgit.github.io <br />
# Free version of Visual C++ for non-commercial usage : http://www.visualstudio.com/en-US/products/visual-studio-express-vs<br />
# Windows SDK : http://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx<br />
# Digital Mars C Compiler & tool : (contains ''make'' binary)<br />
<br />
This guide should be at least partially applicable to different versions of Visual Studio and Windows but you may need different download links<br />
<br />
=== Helper Script ===<br />
<br />
Easiest way to deal with all environment configuration and build routines is to use this script:<br />
<br />
<syntaxhighlight lang="Bash"><br />
#! /bin/bash<br />
set -e<br />
</syntaxhighlight ><br />
<br />
=== Creating development environment ===<br />
<br />
==== Preparing folder layout ====<br />
<br />
# Create "dlang" folder somewhere which will contain all files related to D development. In my case it is ''C:\Users\Dicebot\Desktop\dlang''<br />
# Create "dlang/bin" folder that will contain all generated binaries and intermediate tools<br />
# Download Digital Mars C Compiler & tools distribution (http://downloads.dlang.org/other/dm857c.zip), copy ''dm\bin\make.exe'' to ''dlang\bin\make.exe''<br />
<br />
===== Setting PATH =====<br />
<br />
Create ''.bash_profile'' file in your user home folder (''C:\Users\<username>'') which contains single line:<br />
<syntaxhighlight lang="Bash"><br />
export $PATH=$PATH:<path to dlang/bin><br />
</syntaxhighlight><br />
In my case it was:<br />
<syntaxhighlight lang="Bash"><br />
export $PATH=$PATH:/C/Users/Mihails/Desktop/devel/dlang/bin<br />
</syntaxhighlight><br />
<br />
===== build.sh =====<br />
<br />
Put this script in your ''dlang/bin'' folder as ''build.sh'':<br />
<br />
<syntaxhighlight lang="Bash"><br />
#! /bin/bash<br />
set -e<br />
<br />
VCVARS='C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat'<br />
VSMODEL='x86_amd64'<br />
SLNFILE='dmd_msc_vs12.sln'<br />
<br />
function print_help() <br />
{<br />
echo "Takes one argument - action to perform. Always operates in current directory."<br />
echo<br />
echo "Available actions:"<br />
echo " fetch (get upstream dmd/druntime/phobos repositories)"<br />
echo " build (builds all projects)"<br />
}<br />
<br />
function clone_or_update()<br />
{<br />
local repo=$1<br />
<br />
if [ -z "$repo" ]<br />
then<br />
echo "clone_or_update must have one argument - repo name"<br />
fi<br />
<br />
if [ -d "./$repo" ]<br />
then<br />
echo "Updating / rebasing $repo"<br />
cd ./$repo<br />
git fetch origin<br />
git stash -q<br />
git rebase origin/master<br />
if [ $? -ne 0 ]<br />
then<br />
git rebase --abort<br />
echo "Can't rebase because of conflicts, please do it manually"<br />
exit 1<br />
fi<br />
git stash pop -q || echo "No local changes to restore from stash"<br />
cd -<br />
else<br />
git clone https://github.com/D-Programming-Language/$repo.git<br />
fi<br />
}<br />
<br />
function run_in_vsenv()<br />
{<br />
local command=$1<br />
<br />
if [ -z "$command" ]<br />
then<br />
echo "run_in_vsenv must have one argument - command to run"<br />
fi<br />
<br />
# Can't use && because env vars get expanded too early<br />
echo "call \"$VCVARS\" $VSMODEL" > ./_tmp.bat<br />
echo "$command" >> ./_tmp.bat<br />
cmd.exe "/Q /C _tmp.bat"<br />
rm ./_tmp.bat<br />
}<br />
<br />
function build_dmd()<br />
{ <br />
if [ -d "./dmd" ]<br />
then<br />
local slnpath="dmd\src\\$SLNFILE"<br />
run_in_vsenv "msbuild "$slnpath" /p:Configuration=Release /p:Platform=x64"<br />
cp dmd/src/vcbuild/x64/Release/dmd_msc12.exe bin/dmd.exe<br />
else<br />
echo "Run 'build.sh fetch' first"<br />
fi<br />
}<br />
<br />
function build_library()<br />
{ <br />
if [ -d "./$1" ]<br />
then<br />
cd $1 <br />
run_in_vsenv "make -f win64.mak DMD=dmd.exe CC=cl LD=link AR=lib"<br />
cd -<br />
else<br />
echo "Run 'build.sh fetch' first"<br />
fi<br />
}<br />
<br />
if [ -z $1 ]<br />
then<br />
print_help<br />
fi<br />
<br />
case $1 in<br />
fetch)<br />
clone_or_update "dmd"<br />
clone_or_update "druntime"<br />
clone_or_update "phobos"<br />
clone_or_update "tools"<br />
;;<br />
build)<br />
build_dmd<br />
build_library "druntime"<br />
build_library "phobos"<br />
;;<br />
esac<br />
<br />
echo "All done."<br />
</syntaxhighlight><br />
<br />
It is supposed to be run from git bash shell. ''build.sh fetch'' will clone repositories or update existing ones, ''build.sh build'' will build dmd, druntime and phobos in one go, taking care of all environment setup.</div>
Dicebot