annotate src/share/tools/ProjectCreator/ProjectCreator.java @ 12014:31f3b1e1c5e5

8016601: Unable to build hsx24 on Windows using project creator and Visual Studio Summary: ProjectCreator tool is modified to support two new options: '-relativeAltSrcInclude' and '-altRelativeInclude' which prevents IDE linker errors. Also fixed some cmd line build linker warnings. Misc cleanups. Reviewed-by: rdurbin, coleenp
author dcubed
date Thu, 08 Aug 2013 09:21:30 -0700
parents 7d42f3b08300
children 3cce976666d9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
12014
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 7456
diff changeset
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 public class ProjectCreator {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
26
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
27 public static void usage() {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
28 System.out.println("ProjectCreator options:");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
29 System.err.println("WinGammaPlatform platform-specific options:");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
30 System.err.println(" -sourceBase <path to directory (workspace) "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
31 + "containing source files; no trailing slash>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
32 System.err.println(" -dspFileName <full pathname to which .dsp file "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
33 + "will be written; all parent directories must "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
34 + "already exist>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
35 System.err.println(" -envVar <environment variable to be inserted "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
36 + "into .dsp file, substituting for path given in "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
37 + "-sourceBase. Example: HotSpotWorkSpace>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
38 System.err.println(" -dllLoc <path to directory in which to put "
7456
7d42f3b08300 8005044: remove crufty '_g' support from HS runtime code
dcubed
parents: 6842
diff changeset
39 + "jvm.dll; no trailing slash>");
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
40 System.err.println(" If any of the above are specified, "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
41 + "they must all be.");
12014
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 7456
diff changeset
42 System.err.println(" Note: if '-altRelativeInclude' option below is "
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 7456
diff changeset
43 + "used, then the '-relativeAltSrcInclude' option must be used "
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 7456
diff changeset
44 + "to specify the alternate source dir, e.g., 'src\\closed'");
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
45 System.err.println(" Additional, optional arguments, which can be "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
46 + "specified multiple times:");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
47 System.err.println(" -absoluteInclude <string containing absolute "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
48 + "path to include directory>");
12014
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 7456
diff changeset
49 System.err.println(" -altRelativeInclude <string containing "
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 7456
diff changeset
50 + "alternate include directory relative to -envVar>");
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
51 System.err.println(" -relativeInclude <string containing include "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
52 + "directory relative to -envVar>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
53 System.err.println(" -define <preprocessor flag to be #defined "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
54 + "(note: doesn't yet support " + "#define (flag) (value))>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
55 System.err.println(" -perFileLine <file> <line>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
56 System.err.println(" -conditionalPerFileLine <file> <line for "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
57 + "release build> <line for debug build>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
58 System.err.println(" (NOTE: To work around a bug in nmake, where "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
59 + "you can't have a '#' character in a quoted "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
60 + "string, all of the lines outputted have \"#\"" + "prepended)");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
61 System.err.println(" -startAt <subdir of sourceBase>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
62 System.err.println(" -ignoreFile <file which won't be able to be "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
63 + "found in the sourceBase because it's generated " + "later>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
64 System.err.println(" -additionalFile <file not in database but "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
65 + "which should show up in .dsp file>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
66 System.err
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
67 .println(" -additionalGeneratedFile <environment variable of "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
68 + "generated file's location> <relative path to "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
69 + "directory containing file; no trailing slash> "
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
70 + "<name of file generated later in the build process>");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
71 System.err.println(" -prelink <build> <desc> <cmds>:");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
72 System.err
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
73 .println(" Generate a set of prelink commands for the given BUILD");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
74 System.err
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
75 .println(" (\"Debug\" or \"Release\"). The prelink description and commands");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
76 System.err.println(" are both quoted strings.");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
77 System.err.println(" Default includes: \".\"");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
78 System.err
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
79 .println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
80 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
81
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
82 public static void main(String[] args) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
83 try {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
84 if (args.length < 3) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
85 usage();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
86 System.exit(1);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
87 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
88
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
89 String platformName = args[0];
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
90 Class platformClass = Class.forName(platformName);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
91 WinGammaPlatform platform = (WinGammaPlatform) platformClass
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
92 .newInstance();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
93
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
94 String[] platformArgs = new String[args.length - 1];
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
95 System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
96
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
97 // Allow the platform to write platform-specific files
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
98 platform.createVcproj(platformArgs);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
99 } catch (Exception e) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
100 e.printStackTrace();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
101 System.exit(1);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
102 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents: 1972
diff changeset
103 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
104 }