Changeset 3143 for pjproject/trunk/tests/automated/configure.py
- Timestamp:
- Apr 20, 2010 10:05:09 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/tests/automated/configure.py
r3131 r3143 87 87 # Check that EPOCROOT is set 88 88 if not "EPOCROOT" in os.environ: 89 print "Error: EPOCROOT environment variable is not set"89 sys.stderr.write("Error: EPOCROOT environment variable is not set\n") 90 90 sys.exit(1) 91 91 epocroot = os.environ["EPOCROOT"] … … 108 108 109 109 if sdk1 != sdk2: 110 print "Error: default SDK in device doesn't match EPOCROOT"111 print "Default device SDK =", sdk2112 print "EPOCROOT SDK =", sdk1110 sys.stderr.write("Error: default SDK in device doesn't match EPOCROOT\n") 111 sys.stderr.write("Default device SDK = " + sdk2 + "\n") 112 sys.stderr.write("EPOCROOT SDK = " + sdk1 + "\n") 113 113 sys.exit(1) 114 114 … … 130 130 os_info = platform.release() + "-" + platform.version() + "-" + platform.win32_ver()[2] 131 131 elif platform.system().lower() == "linux": 132 os_info = +"-" + "-".join(platform.linux_distribution()[0:2])132 os_info = "-" + "-".join(platform.linux_distribution()[0:2]) 133 133 134 134 # vs_target … … 160 160 suffix = proc.stdout.readline().rstrip(" \r\n") 161 161 else: 162 sys.stderr.write("Error: unsupported buil t type " + build_type + "\n")162 sys.stderr.write("Error: unsupported build type '" + build_type + "'\n") 163 163 sys.exit(1) 164 164 … … 185 185 elif text.find("$(DISABLED)") >= 0: 186 186 text = text.replace("$(DISABLED)", "0") 187 elif text.find("$(IPPROOT)") >= 0: 188 if not os.environ.has_key("IPPROOT"): 189 sys.stderr.write("Error: environment variable IPPROOT is needed but not set\n") 190 sys.exit(1) 191 text = text.replace("$(IPPROOT)", os.environ["IPPROOT"]) 192 elif text.find("$(IPPSAMPLES)") >= 0: 193 if not os.environ.has_key("IPPSAMPLES"): 194 sys.stderr.write("Error: environment variable IPPSAMPLES is needed but not set\n") 195 sys.exit(1) 196 text = text.replace("$(IPPSAMPLES)", os.environ["IPPSAMPLES"]) 197 elif text.find("$(IPPARCH)") >= 0: 198 if not os.environ.has_key("IPPARCH"): 199 text = text.replace("$(IPPARCH)", "") 200 else: 201 text = text.replace("$(IPPARCH)", os.environ["IPPARCH"]) 187 202 elif text.find("$(OS)") >= 0: 188 203 text = text.replace("$(OS)", os_info) … … 202 217 def main(args): 203 218 global vs_target, s60_target, build_type 219 output = sys.stdout 204 220 usage = """Usage: configure.py [OPTIONS] scenario_template_file 205 221 206 222 Where OPTIONS: 207 - t TYPE Specify build type for Windows since we support both208 Visual Studio and Mingw. If not specified, it will be223 -o FILE Output to file, otherwise to stdout. 224 -t TYPE Specify build type. If not specified, it will be 209 225 asked if necessary. Values are: 210 226 vs: Visual Studio … … 226 242 args.pop(0) 227 243 while len(args): 228 if args[0]=='-vstarget': 244 if args[0]=='-o': 245 args.pop(0) 246 if len(args): 247 output = open(args[0], "wt") 248 args.pop(0) 249 else: 250 sys.stderr.write("Error: needs value for -o\n") 251 sys.exit(1) 252 elif args[0]=='-vstarget': 229 253 args.pop(0) 230 254 if len(args): … … 257 281 258 282 if len(args) != 1: 259 print usage283 sys.stderr.write(usage + "\n") 260 284 return 1 261 285 262 if not build_type and (platform.system().lower() == "windows" or platform.system().lower() == "microsoft"):286 if not build_type: 263 287 print "Enter the build type (values: vs, gnu, s60) [vs]: ", 264 288 build_type = sys.stdin.readline().replace("\n", "").replace("\r", "") … … 277 301 278 302 tpl = replace_vars(tpl) 279 print tpl 303 output.write(tpl) 304 if output != sys.stdout: 305 output.close() 280 306 return 0 281 307
Note: See TracChangeset
for help on using the changeset viewer.