summaryrefslogtreecommitdiff
path: root/modules/dynamic_link/macros/windows/dlwSetEnvVc80.sci
blob: 2efc3a5775c6fb06460fa7434034d88f737fde3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) DIGITEO - 2010 - Allan CORNET
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution.  The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt

//=============================================================================
function bOK = dlwSetEnvVc80(msCompiler)
    bOK = %F;
    MSVSDir = "";
    select msCompiler
    case "msvc80pro"
        MSVSDir = dlwGetVc80ProPath();
    case "msvc80std"
        MSVSDir = dlwGetVc80StdPath();
    case "msvc80express"
        MSVSDir = dlwGetVc80ExpressPath();
    else
        return
    end

    // MS compiler path is wrong
    if MSVSDir == [] then
        return
    end

    PATH = getenv("PATH","ndef");
    if (PATH == "ndef") then
        bOK = %F;
        return
    end

    if ~setenv("VSINSTALLDIR", MSVSDir) then
        bOK = %F;
        return
    end

    MSVCDir = MSVSDir + "\VC";
    if ~setenv("VCINSTALLDIR", MSVCDir) then
        bOK = %F;
        return
    end

    DevEnvDir = MSVSDir + "\Common7\IDE";
    if ~setenv("DevEnvDir", DevEnvDir) then
        bOK = %F;
        return
    end

    err = addPathToEnv("PATH", DevEnvDir + pathsep() + ..
    MSVCDir + "\bin" + pathsep() + ..
    MSVSDir + "\Common7\Tools" + pathsep() + ..
    MSVSDir + "\SDK\v2.0\bin" + pathsep() + ..
    MSVCDir + "\VCPackages");
    if (err == %F) then
        bOK = %F;
        return
    end

    if (msCompiler == "msvc80express") then
        windowsSdkPath = dlwGetSdkPath();
        LIB = MSVCDir + "\lib" + pathsep() + ..
        MSVSDir + "\SDK\v2.0\lib" + pathsep() + ..
        windowsSdkPath + "\lib";

        include = MSVCDir + "\include" + pathsep() + ..
        windowsSdkPath + "\include";
    else
        LIB = MSVCDir + "\lib" + pathsep() + ..
        MSVSDir + "\SDK\v2.0\lib" + pathsep() + ..
        MSVSDir + "\VC\PlatformSDK\lib";

        include = MSVCDir + "\include" + pathsep() + ..
        MSVCDir + "\PlatformSDK\include" + pathsep() + ..
        MSVSDir + "\SDK\v2.0\include";
    end

    if ~addPathToEnv("LIB", LIB) then
        bOK = %F;
        return
    end

    if ~addPathToEnv("include", include) then
        bOK = %F;
        return
    end

    bOK = %T;
endfunction
//=============================================================================