[phobos] win64 and visual studio path crap

Rainer Schuetze r.sagitario at gmx.de
Mon Sep 30 13:47:01 PDT 2013


On 28.09.2013 00:13, Brad Roberts wrote:
> I know this topic has come up in various forms, but no good resolution
> has yet been codified.  I need to reduce the amount of hand hacking done
> inside the auto-tester that's specific to visual studio paths and
> win64.  The local patches conflicted with a pull request that's also
> trying to do some cleanup in this area.  I just pulled that request and
> re-did my local changes, but I think the problem needs to be addressed.
> The paths wander from version to version, including the directory
> structure inside the compiler main directory.  IMHO, the makefiles need
> to stop trying to set the paths an instead pull them from the environment.
>
> What I've done with the auto-tester is:
>
> 1) set in the environment 4 variables:
>
>      export VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC"
>      export SDKDIR="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A"
>      export VCBIN_DIR="$VCDIR\bin\x86_amd64"
>      export INCLUDE="$VCDIR\include"
>
>
> 2) apply a set of patches to druntime/win64.mak, phobos/win64.mak,
> phobos/etc/c/zlib/win64.mak that look basically like:
>
> diff --git a/win64.mak b/win64.mak
> index daee7f6..b381a34 100644
> --- a/win64.mak
> +++ b/win64.mak
> @@ -2,14 +2,11 @@
>
>   MODEL=64
>
> -VCDIR=\Program Files (x86)\Microsoft Visual Studio 10.0\VC
> -SDKDIR=\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
> -
>   DMD=dmd
>
> -CC="$(VCDIR)\bin\amd64\cl"
> -LD="$(VCDIR)\bin\amd64\link"
> -LIB="$(VCDIR)\bin\amd64\lib"
> +CC="$(VCBIN_DIR)\cl"
> +LD="$(VCBIN_DIR)\link"
> +LIB="$(VCBIN_DIR)\lib"
>   CP=cp
>
>   DOCDIR=doc
>
>
> A similar one to use the env rather than a hardcoded value in
> dmd/test/d_do_test.d.
>
> I hate breaking changes, so any thoughts on how to make this suck less
> without breaking people building on win64?  Alternately, if you're among
> the probably relatively few people building on win64, would you object
> to this change?
>
> Thoughts?
>
> Thanks,
> Brad

What I do is to use the VS console and pass CC and AR on the command 
line as well:

set dm_make=c:\l\dmd2\windows\bin\make
set DMD=../windows/bin/dmd.exe
set cl64=c:\l\vs10\vc\bin\amd64\cl.exe
set ar64=c:/l/vs10/vc/bin/amd64/lib.exe

cd druntime
%dm_make% -f win64.mak DMD=%DMD% "CC=\"%cl64%\"" target
cd ..\phobos
%dm_make% -f win64.mak DMD=%DMD% "CC=\"%cl64%\"" MAKE=%dm_make% 
"AR=\"%ar64%\"" LIB=..\lib64\phobos64.lib

I'm not sure if the mix of forward and backward slashes is necessary. 
Probably not for win64.mak, but for posix.mak which I normally use under 
windows, too.



More information about the phobos mailing list