Mercurial > hg > truffle
annotate make/windows/get_msc_ver.sh @ 686:a9d9d7e06593
Merge
author | trims |
---|---|
date | Thu, 02 Apr 2009 17:01:00 -0700 |
parents | c3a720eefe82 |
children | bd02caa94611 |
rev | line source |
---|---|
0 | 1 # |
196 | 2 # Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. |
0 | 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # | |
5 # This code is free software; you can redistribute it and/or modify it | |
6 # under the terms of the GNU General Public License version 2 only, as | |
7 # published by the Free Software Foundation. | |
8 # | |
9 # This code is distributed in the hope that it will be useful, but WITHOUT | |
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 # version 2 for more details (a copy is included in the LICENSE file that | |
13 # accompanied this code). | |
14 # | |
15 # You should have received a copy of the GNU General Public License version | |
16 # 2 along with this work; if not, write to the Free Software Foundation, | |
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 # | |
19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
20 # CA 95054 USA or visit www.sun.com if you need additional information or | |
21 # have any questions. | |
22 # | |
23 # | |
24 | |
25 # This shell script echoes "MSC_VER=<munged version of cl>" | |
26 # It ignores the micro version component. | |
27 # Examples: | |
28 # cl version 12.00.8804 returns "MSC_VER=1200" | |
29 # cl version 13.10.3077 returns "MSC_VER=1310" | |
30 # cl version 14.00.30701 returns "MSC_VER=1399" (OLD_MSSDK version) | |
31 # cl version 14.00.40310.41 returns "MSC_VER=1400" | |
645
c3a720eefe82
6816308: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
kvn
parents:
196
diff
changeset
|
32 # cl version 15.00.21022.8 returns "MSC_VER=1500" |
0 | 33 |
34 # Note that we currently do not have a way to set HotSpotMksHome in | |
35 # the batch build, but so far this has not seemed to be a problem. The | |
36 # reason this environment variable is necessary is that it seems that | |
37 # Windows truncates very long PATHs when executing shells like MKS's | |
38 # sh, and it has been found that sometimes `which sh` fails. | |
39 | |
40 if [ "x$HotSpotMksHome" != "x" ]; then | |
41 MKS_HOME="$HotSpotMksHome" | |
42 else | |
43 SH=`which sh` | |
44 MKS_HOME=`dirname "$SH"` | |
45 fi | |
46 | |
47 HEAD="$MKS_HOME/head" | |
48 ECHO="$MKS_HOME/echo" | |
49 EXPR="$MKS_HOME/expr" | |
50 CUT="$MKS_HOME/cut" | |
51 SED="$MKS_HOME/sed" | |
52 | |
53 if [ "x$FORCE_MSC_VER" != "x" ]; then | |
54 echo "MSC_VER=$FORCE_MSC_VER" | |
55 else | |
56 MSC_VER_RAW=`cl 2>&1 | "$HEAD" -n 1 | "$SED" 's/.*Version[\ ]*\([0-9][0-9.]*\).*/\1/'` | |
57 MSC_VER_MAJOR=`"$ECHO" $MSC_VER_RAW | "$CUT" -d'.' -f1` | |
58 MSC_VER_MINOR=`"$ECHO" $MSC_VER_RAW | "$CUT" -d'.' -f2` | |
59 MSC_VER_MICRO=`"$ECHO" $MSC_VER_RAW | "$CUT" -d'.' -f3` | |
60 if [ "${MSC_VER_MAJOR}" -eq 14 -a "${MSC_VER_MINOR}" -eq 0 -a "${MSC_VER_MICRO}" -eq 30701 ] ; then | |
61 # This said 1400 but it was really more like VS2003 (VC7) in terms of options | |
62 MSC_VER=1399 | |
63 else | |
64 MSC_VER=`"$EXPR" $MSC_VER_MAJOR \* 100 + $MSC_VER_MINOR` | |
65 fi | |
66 echo "MSC_VER=$MSC_VER" | |
67 echo "MSC_VER_RAW=$MSC_VER_RAW" | |
68 fi | |
69 | |
70 if [ "x$FORCE_LINK_VER" != "x" ]; then | |
71 echo "LINK_VER=$FORCE_LINK_VER" | |
72 else | |
73 LINK_VER_RAW=`link 2>&1 | "$HEAD" -n 1 | "$SED" 's/.*Version[\ ]*\([0-9][0-9.]*\).*/\1/'` | |
74 LINK_VER_MAJOR=`"$ECHO" $LINK_VER_RAW | "$CUT" -d'.' -f1` | |
75 LINK_VER_MINOR=`"$ECHO" $LINK_VER_RAW | "$CUT" -d'.' -f2` | |
76 LINK_VER_MICRO=`"$ECHO" $LINK_VER_RAW | "$CUT" -d'.' -f3` | |
77 LINK_VER=`"$EXPR" $LINK_VER_MAJOR \* 100 + $LINK_VER_MINOR` | |
78 echo "LINK_VER=$LINK_VER" | |
79 echo "LINK_VER_RAW=$LINK_VER_RAW" | |
80 fi |