OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 ## | 2 ## |
3 ## Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 3 ## Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
4 ## | 4 ## |
5 ## Use of this source code is governed by a BSD-style license | 5 ## Use of this source code is governed by a BSD-style license |
6 ## that can be found in the LICENSE file in the root of the source | 6 ## that can be found in the LICENSE file in the root of the source |
7 ## tree. An additional intellectual property rights grant can be found | 7 ## tree. An additional intellectual property rights grant can be found |
8 ## in the file PATENTS. All contributing project authors may | 8 ## in the file PATENTS. All contributing project authors may |
9 ## be found in the AUTHORS file in the root of the source tree. | 9 ## be found in the AUTHORS file in the root of the source tree. |
10 ## | 10 ## |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 # save the project GUID to a varaible, normalizing to the basename of the | 66 # save the project GUID to a varaible, normalizing to the basename of the |
67 # vcproj file without the extension | 67 # vcproj file without the extension |
68 local var | 68 local var |
69 var=${file##*/} | 69 var=${file##*/} |
70 var=${var%%.${sfx}} | 70 var=${var%%.${sfx}} |
71 eval "${var}_file=\"$1\"" | 71 eval "${var}_file=\"$1\"" |
72 eval "${var}_name=$name" | 72 eval "${var}_name=$name" |
73 eval "${var}_guid=$guid" | 73 eval "${var}_guid=$guid" |
74 | 74 |
75 # assume that all projects have the same list of possible configurations, | |
76 # so overwriting old config_lists is not a problem | |
77 if [ "$sfx" = "vcproj" ]; then | 75 if [ "$sfx" = "vcproj" ]; then |
78 config_list=`grep -A1 '<Configuration' $file | | 76 cur_config_list=`grep -A1 '<Configuration' $file | |
79 grep Name | cut -d\" -f2` | 77 grep Name | cut -d\" -f2` |
80 else | 78 else |
81 config_list=`grep -B1 'Label="Configuration"' $file | | 79 cur_config_list=`grep -B1 'Label="Configuration"' $file | |
82 grep Condition | cut -d\' -f4` | 80 grep Condition | cut -d\' -f4` |
83 fi | 81 fi |
| 82 new_config_list=$(for i in $config_list $cur_config_list; do |
| 83 echo $i |
| 84 done | sort | uniq) |
| 85 if [ "$config_list" != "" ] && [ "$config_list" != "$new_config_list" ]; the
n |
| 86 mixed_platforms=1 |
| 87 fi |
| 88 config_list="$new_config_list" |
| 89 eval "${var}_config_list=\"$cur_config_list\"" |
84 proj_list="${proj_list} ${var}" | 90 proj_list="${proj_list} ${var}" |
85 } | 91 } |
86 | 92 |
87 process_project() { | 93 process_project() { |
88 eval "local file=\${$1_file}" | 94 eval "local file=\${$1_file}" |
89 eval "local name=\${$1_name}" | 95 eval "local name=\${$1_name}" |
90 eval "local guid=\${$1_guid}" | 96 eval "local guid=\${$1_guid}" |
91 | 97 |
92 # save the project GUID to a varaible, normalizing to the basename of the | 98 # save the project GUID to a varaible, normalizing to the basename of the |
93 # vcproj file without the extension | 99 # vcproj file without the extension |
(...skipping 29 matching lines...) Expand all Loading... |
123 echo "Global" | 129 echo "Global" |
124 indent_push | 130 indent_push |
125 | 131 |
126 # | 132 # |
127 # Solution Configuration Platforms | 133 # Solution Configuration Platforms |
128 # | 134 # |
129 echo "${indent}GlobalSection(SolutionConfigurationPlatforms) = preSolution" | 135 echo "${indent}GlobalSection(SolutionConfigurationPlatforms) = preSolution" |
130 indent_push | 136 indent_push |
131 IFS_bak=${IFS} | 137 IFS_bak=${IFS} |
132 IFS=$'\r'$'\n' | 138 IFS=$'\r'$'\n' |
| 139 if [ "$mixed_platforms" != "" ]; then |
| 140 config_list=" |
| 141 Release|Mixed Platforms |
| 142 Debug|Mixed Platforms" |
| 143 fi |
133 for config in ${config_list}; do | 144 for config in ${config_list}; do |
134 echo "${indent}$config = $config" | 145 echo "${indent}$config = $config" |
135 done | 146 done |
136 IFS=${IFS_bak} | 147 IFS=${IFS_bak} |
137 indent_pop | 148 indent_pop |
138 echo "${indent}EndGlobalSection" | 149 echo "${indent}EndGlobalSection" |
139 | 150 |
140 # | 151 # |
141 # Project Configuration Platforms | 152 # Project Configuration Platforms |
142 # | 153 # |
143 echo "${indent}GlobalSection(ProjectConfigurationPlatforms) = postSolution" | 154 echo "${indent}GlobalSection(ProjectConfigurationPlatforms) = postSolution" |
144 indent_push | 155 indent_push |
145 for proj in ${proj_list}; do | 156 for proj in ${proj_list}; do |
146 eval "local proj_guid=\${${proj}_guid}" | 157 eval "local proj_guid=\${${proj}_guid}" |
| 158 eval "local proj_config_list=\${${proj}_config_list}" |
147 IFS=$'\r'$'\n' | 159 IFS=$'\r'$'\n' |
148 for config in ${config_list}; do | 160 for config in ${proj_config_list}; do |
149 echo "${indent}${proj_guid}.${config}.ActiveCfg = ${config}" | 161 if [ "$mixed_platforms" != "" ]; then |
150 echo "${indent}${proj_guid}.${config}.Build.0 = ${config}" | 162 local c=${config%%|*} |
| 163 echo "${indent}${proj_guid}.${c}|Mixed Platforms.ActiveCfg = ${c
onfig}" |
| 164 echo "${indent}${proj_guid}.${c}|Mixed Platforms.Build.0 = ${con
fig}" |
| 165 else |
| 166 echo "${indent}${proj_guid}.${config}.ActiveCfg = ${config}" |
| 167 echo "${indent}${proj_guid}.${config}.Build.0 = ${config}" |
| 168 fi |
151 | 169 |
152 done | 170 done |
153 IFS=${IFS_bak} | 171 IFS=${IFS_bak} |
154 done | 172 done |
155 indent_pop | 173 indent_pop |
156 echo "${indent}EndGlobalSection" | 174 echo "${indent}EndGlobalSection" |
157 | 175 |
158 # | 176 # |
159 # Solution Properties | 177 # Solution Properties |
160 # | 178 # |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 done | 312 done |
295 cat >${outfile} <<EOF | 313 cat >${outfile} <<EOF |
296 Microsoft Visual Studio Solution File, Format Version $sln_vers${EOLDOS} | 314 Microsoft Visual Studio Solution File, Format Version $sln_vers${EOLDOS} |
297 # $sln_vers_str${EOLDOS} | 315 # $sln_vers_str${EOLDOS} |
298 EOF | 316 EOF |
299 for proj in ${proj_list}; do | 317 for proj in ${proj_list}; do |
300 process_project $proj >>${outfile} | 318 process_project $proj >>${outfile} |
301 done | 319 done |
302 process_global >>${outfile} | 320 process_global >>${outfile} |
303 process_makefile >${mkoutfile} | 321 process_makefile >${mkoutfile} |
OLD | NEW |