hotspot/src/share/tools/ProjectCreator/BuildConfig.java
author mikael
Tue, 09 Oct 2012 10:09:34 -0700
changeset 13963 e5b53c306fb5
parent 13892 9ba13acea673
child 16447 234db5e2ae5e
permissions -rw-r--r--
7197424: update copyright year to match last edit in jdk8 hotspot repository Summary: Update copyright year to 2012 for relevant files Reviewed-by: dholmes, coleenp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
11642
26b87a113138 7140909: Visual Studio project builds broken: need to define INCLUDE_TRACE
brutisso
parents: 8303
diff changeset
     2
 * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    25
import java.util.Enumeration;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    26
import java.util.Hashtable;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    27
import java.util.Vector;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
class BuildConfig {
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
    30
    @SuppressWarnings("rawtypes")
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
    Hashtable vars;
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
    32
    Vector<String> basicNames, basicPaths;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
    String[] context;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
    static CompilerInterface ci;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
    static CompilerInterface getCI() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
        if (ci == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
            String comp = (String)getField(null, "CompilerVersion");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
            try {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
                ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
            } catch (Exception cnfe) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
                System.err.println("Cannot find support for compiler " + comp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
                throw new RuntimeException(cnfe.toString());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
        return ci;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
    49
    @SuppressWarnings("rawtypes")
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    protected void initNames(String flavour, String build, String outDll) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
        if (vars == null) vars = new Hashtable();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
        String flavourBuild =  flavour + "_" + build;
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
    54
        String platformName = getFieldString(null, "PlatformName");
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    55
        System.out.println();
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    56
        System.out.println(flavourBuild);
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    57
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
    58
        put("Name", getCI().makeCfgName(flavourBuild, platformName));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
        put("Flavour", flavour);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
        put("Build", build);
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
    61
        put("PlatformName", platformName);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
        // ones mentioned above were needed to expand format
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
        String buildBase = expandFormat(getFieldString(null, "BuildBase"));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
        String sourceBase = getFieldString(null, "SourceBase");
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
    66
        String buildSpace = getFieldString(null, "BuildSpace");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
        String outDir = buildBase;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
        put("Id", flavourBuild);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
        put("OutputDir", outDir);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
        put("SourceBase", sourceBase);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
        put("BuildBase", buildBase);
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
    73
        put("BuildSpace", buildSpace);
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    74
        put("OutputDll", outDir + Util.sep + outDll);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
        context = new String [] {flavourBuild, flavour, build, null};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
    79
    protected void init(Vector<String> includes, Vector<String> defines) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
        initDefaultDefines(defines);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
        initDefaultCompilerFlags(includes);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
        initDefaultLinkerFlags();
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
    83
        //handleDB();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
    87
    protected void initDefaultCompilerFlags(Vector<String> includes) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
        Vector compilerFlags = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
        compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
                                                          includes,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
                                                          get("OutputDir")));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
        put("CompilerFlags", compilerFlags);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
    protected void initDefaultLinkerFlags() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
        Vector linkerFlags = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   100
        linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName")));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
        put("LinkerFlags", linkerFlags);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   105
    public boolean matchesIgnoredPath(String path) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   106
        Vector<String> rv = new Vector<String>();
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   107
        collectRelevantVectors(rv, "IgnorePath");
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   108
        for (String pathPart : rv) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   109
            if (path.contains(pathPart))  {
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   110
                return true;
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   111
            }
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   112
        }
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   113
        return false;
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   114
    }
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   115
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   116
    public boolean matchesHidePath(String path) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   117
        Vector<String> rv = new Vector<String>();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   118
        collectRelevantVectors(rv, "HidePath");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   119
        for (String pathPart : rv) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   120
            if (path.contains(Util.normalize(pathPart)))  {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   121
                return true;
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   122
            }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   123
        }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   124
        return false;
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   125
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   126
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   127
   public Vector<String> matchesAdditionalGeneratedPath(String fullPath) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   128
        Vector<String> rv = new Vector<String>();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   129
        Hashtable<String, String> v = (Hashtable<String, String>)BuildConfig.getField(this.toString(), "AdditionalGeneratedFile");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   130
        if (v != null) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   131
            for (Enumeration<String> e=v.keys(); e.hasMoreElements(); ) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   132
                String key = e.nextElement();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   133
                String val = v.get(key);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   134
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   135
                if (fullPath.endsWith(expandFormat(key))) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   136
                    rv.add(expandFormat(val));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
        }
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   140
        return rv;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
    void addTo(Hashtable ht, String key, String value) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
        ht.put(expandFormat(key), expandFormat(value));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
    void initDefaultDefines(Vector defines) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
        Vector sysDefines = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
        sysDefines.add("WIN32");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
        sysDefines.add("_WINDOWS");
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   151
        sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\"");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
        sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
11642
26b87a113138 7140909: Visual Studio project builds broken: need to define INCLUDE_TRACE
brutisso
parents: 8303
diff changeset
   153
        sysDefines.add("INCLUDE_TRACE");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
        sysDefines.add("_JNI_IMPLEMENTATION_");
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   155
        if (vars.get("PlatformName").equals("Win32")) {
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   156
            sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   157
        } else {
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   158
            sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   159
        }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
        sysDefines.addAll(defines);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
        put("Define", sysDefines);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
    String get(String key) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
        return (String)vars.get(key);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
    Vector getV(String key) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
        return (Vector)vars.get(key);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
    Object getO(String key) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
        return vars.get(key);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
    Hashtable getH(String key) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
        return (Hashtable)vars.get(key);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
    Object getFieldInContext(String field) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
        for (int i=0; i<context.length; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
            Object rv = getField(context[i], field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
            if (rv != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
                return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
        return null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
    Object lookupHashFieldInContext(String field, String key) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
        for (int i=0; i<context.length; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
            Hashtable ht = (Hashtable)getField(context[i], field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
            if (ht != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
                Object rv = ht.get(key);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
                if (rv != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
                    return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
        return null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
    void put(String key, String value) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
        vars.put(key, value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
    void put(String key, Vector vvalue) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
        vars.put(key, vvalue);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
    void add(String key, Vector vvalue) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
        getV(key).addAll(vvalue);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
    String flavour() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
        return get("Flavour");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
    String build() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
        return get("Build");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
    Object getSpecificField(String field) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
        return getField(get("Id"), field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
    void putSpecificField(String field, Object value) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
        putField(get("Id"), field, value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
    void collectRelevantVectors(Vector rv, String field) {
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   234
        for (String ctx : context) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   235
            Vector<String> v = getFieldVector(ctx, field);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
            if (v != null) {
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   237
                for (String val : v) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   238
                    rv.add(expandFormat(val).replace('/', '\\'));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
    void collectRelevantHashes(Hashtable rv, String field) {
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   245
        for (String ctx : context) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   246
            Hashtable v = (Hashtable)getField(ctx, field);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
            if (v != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
                for (Enumeration e=v.keys(); e.hasMoreElements(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
                    String key = (String)e.nextElement();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
                    String val =  (String)v.get(key);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
                    addTo(rv, key, val);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
    Vector getDefines() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
        Vector rv = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
        collectRelevantVectors(rv, "Define");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
        return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
    Vector getIncludes() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
        Vector rv = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
        collectRelevantVectors(rv, "AbsoluteInclude");
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   267
        rv.addAll(getSourceIncludes());
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   268
        return rv;
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   269
    }
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   270
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   271
    private Vector getSourceIncludes() {
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   272
        Vector<String> rv = new Vector<String>();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   273
        Vector<String> ri = new Vector<String>();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
        String sourceBase = getFieldString(null, "SourceBase");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
        collectRelevantVectors(ri, "RelativeInclude");
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   276
        for (String f : ri) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
            rv.add(sourceBase + Util.sep + f);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
        return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
    static Hashtable cfgData = new Hashtable();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
    static Hashtable globalData = new Hashtable();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
    static boolean appliesToTieredBuild(String cfg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
        return (cfg != null &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
                (cfg.startsWith("compiler1") ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
                 cfg.startsWith("compiler2")));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   291
    // Filters out the IgnoreFile and IgnorePaths since they are
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   292
    // handled specially for tiered builds.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
    static boolean appliesToTieredBuild(String cfg, String key) {
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   294
        return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore"));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
    static String getTieredBuildCfg(String cfg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
        assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
        return "tiered" + cfg.substring(9);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
    static Object getField(String cfg, String field) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
        if (cfg == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
            return globalData.get(field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
        Hashtable ht =  (Hashtable)cfgData.get(cfg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
        return ht == null ? null : ht.get(field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
    static String getFieldString(String cfg, String field) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
        return (String)getField(cfg, field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
    static Vector getFieldVector(String cfg, String field) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
        return (Vector)getField(cfg, field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
    static void putField(String cfg, String field, Object value) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
        putFieldImpl(cfg, field, value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
        if (appliesToTieredBuild(cfg, field)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
            putFieldImpl(getTieredBuildCfg(cfg), field, value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
    private static void putFieldImpl(String cfg, String field, Object value) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
        if (cfg == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
            globalData.put(field, value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
            return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
        Hashtable ht = (Hashtable)cfgData.get(cfg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
        if (ht == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
            ht = new Hashtable();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
            cfgData.put(cfg, ht);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
        ht.put(field, value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
    static Object getFieldHash(String cfg, String field, String name) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
        Hashtable ht = (Hashtable)getField(cfg, field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
        return ht == null ? null : ht.get(name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
    static void putFieldHash(String cfg, String field, String name, Object val) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
        putFieldHashImpl(cfg, field, name, val);
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   349
        if (appliesToTieredBuild(cfg, field)) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
            putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
    private static void putFieldHashImpl(String cfg, String field, String name, Object val) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
        Hashtable ht = (Hashtable)getField(cfg, field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
        if (ht == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
            ht = new Hashtable();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
            putFieldImpl(cfg, field, ht);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
        ht.put(name, val);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
    static void addFieldVector(String cfg, String field, String element) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
        addFieldVectorImpl(cfg, field, element);
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   367
        if (appliesToTieredBuild(cfg, field)) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
            addFieldVectorImpl(getTieredBuildCfg(cfg), field, element);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
    private static void addFieldVectorImpl(String cfg, String field, String element) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
        Vector v = (Vector)getField(cfg, field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
        if (v == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
            v = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
            putFieldImpl(cfg, field, v);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
        v.add(element);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
    String expandFormat(String format) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
        if (format == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
            return null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
        if (format.indexOf('%') == -1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
            return format;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
        StringBuffer sb = new StringBuffer();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
        int len = format.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
        for (int i=0; i<len; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
            char ch = format.charAt(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
            if (ch == '%') {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
                char ch1 = format.charAt(i+1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
                switch (ch1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
                case '%':
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
                    sb.append(ch1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
                    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
                case 'b':
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
                    sb.append(build());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
                    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
                case 'f':
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
                    sb.append(flavour());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
                    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
                default:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
                    sb.append(ch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
                    sb.append(ch1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
                i++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
            } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
                sb.append(ch);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
        return sb.toString();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
abstract class GenericDebugConfig extends BuildConfig {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
    abstract String getOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
    protected void init(Vector includes, Vector defines) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
        defines.add("_DEBUG");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
        defines.add("ASSERT");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
        super.init(includes, defines);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
        getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
        getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   436
abstract class GenericDebugNonKernelConfig extends GenericDebugConfig {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   437
    protected void init(Vector includes, Vector defines) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   438
        super.init(includes, defines);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   439
        getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags"));
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   440
   }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   441
}
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   442
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   443
class C1DebugConfig extends GenericDebugNonKernelConfig {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
        return getCI().getNoOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
    C1DebugConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   449
        initNames("compiler1", "debug", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   454
class C1FastDebugConfig extends GenericDebugNonKernelConfig {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
        return getCI().getOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
    C1FastDebugConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   460
        initNames("compiler1", "fastdebug", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   465
class C2DebugConfig extends GenericDebugNonKernelConfig {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
        return getCI().getNoOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
    C2DebugConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   471
        initNames("compiler2", "debug", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   476
class C2FastDebugConfig extends GenericDebugNonKernelConfig {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
        return getCI().getOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
    C2FastDebugConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   482
        initNames("compiler2", "fastdebug", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   487
class TieredDebugConfig extends GenericDebugNonKernelConfig {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
        return getCI().getNoOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
    TieredDebugConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   493
        initNames("tiered", "debug", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   498
class TieredFastDebugConfig extends GenericDebugNonKernelConfig {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
        return getCI().getOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
    TieredFastDebugConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   504
        initNames("tiered", "fastdebug", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
abstract class ProductConfig extends BuildConfig {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
    protected void init(Vector includes, Vector defines) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
        defines.add("NDEBUG");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
        defines.add("PRODUCT");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
        super.init(includes, defines);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
        getV("CompilerFlags").addAll(getCI().getProductCompilerFlags());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
        getV("LinkerFlags").addAll(getCI().getProductLinkerFlags());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
class C1ProductConfig extends ProductConfig {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
    C1ProductConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   523
        initNames("compiler1", "product", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
class C2ProductConfig extends ProductConfig {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
    C2ProductConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   530
        initNames("compiler2", "product", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   534
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
class TieredProductConfig extends ProductConfig {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
    TieredProductConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   537
        initNames("tiered", "product", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   540
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   541
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   542
class CoreDebugConfig extends GenericDebugNonKernelConfig {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   543
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   544
        return getCI().getNoOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   545
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   546
489c9b5090e2 Initial load
duke
parents:
diff changeset
   547
    CoreDebugConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   548
        initNames("core", "debug", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   549
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   550
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   551
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   552
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   553
class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   554
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   555
        return getCI().getOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   556
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
    CoreFastDebugConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   559
        initNames("core", "fastdebug", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   560
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   562
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   563
489c9b5090e2 Initial load
duke
parents:
diff changeset
   564
class CoreProductConfig extends ProductConfig {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
    CoreProductConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   566
        initNames("core", "product", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   567
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   570
489c9b5090e2 Initial load
duke
parents:
diff changeset
   571
class KernelDebugConfig extends GenericDebugConfig {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   572
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   573
        return getCI().getNoOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   574
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   575
489c9b5090e2 Initial load
duke
parents:
diff changeset
   576
    KernelDebugConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   577
        initNames("kernel", "debug", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   578
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   579
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   580
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   581
489c9b5090e2 Initial load
duke
parents:
diff changeset
   582
489c9b5090e2 Initial load
duke
parents:
diff changeset
   583
class KernelFastDebugConfig extends GenericDebugConfig {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   584
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   585
        return getCI().getOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   586
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   587
489c9b5090e2 Initial load
duke
parents:
diff changeset
   588
    KernelFastDebugConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   589
        initNames("kernel", "fastdebug", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   590
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   591
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   592
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   593
489c9b5090e2 Initial load
duke
parents:
diff changeset
   594
489c9b5090e2 Initial load
duke
parents:
diff changeset
   595
class KernelProductConfig extends ProductConfig {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   596
    KernelProductConfig() {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   597
        initNames("kernel", "product", "jvm.dll");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   598
        init(getIncludes(), getDefines());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   599
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   600
}
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 11642
diff changeset
   601
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   602
abstract class CompilerInterface {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   603
    abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   604
    abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   605
    abstract Vector getDebugCompilerFlags(String opt);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   606
    abstract Vector getDebugLinkerFlags();
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   607
    abstract void   getAdditionalNonKernelLinkerFlags(Vector rv);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   608
    abstract Vector getProductCompilerFlags();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   609
    abstract Vector getProductLinkerFlags();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   610
    abstract String getOptFlag();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   611
    abstract String getNoOptFlag();
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   612
    abstract String makeCfgName(String flavourBuild, String platformName);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   613
489c9b5090e2 Initial load
duke
parents:
diff changeset
   614
    void addAttr(Vector receiver, String attr, String value) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   615
        receiver.add(attr); receiver.add(value);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   616
    }
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   617
    void extAttr(Vector receiver, String attr, String value) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   618
        int attr_pos=receiver.indexOf(attr) ;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   619
        if ( attr_pos == -1) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   620
          // If attr IS NOT present in the Vector - add it
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   621
          receiver.add(attr); receiver.add(value);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   622
        } else {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   623
          // If attr IS present in the Vector - append value to it
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   624
          receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   625
        }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   626
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   627
}