OLD | NEW |
1 # | 1 # |
2 # Copyright 2008 Google Inc. Released under the GPL v2 | 2 # Copyright 2008 Google Inc. Released under the GPL v2 |
3 | 3 |
4 import os, pickle, random, re, resource, select, shutil, signal, StringIO | 4 import os, pickle, random, re, resource, select, shutil, signal, StringIO |
5 import socket, struct, subprocess, sys, time, textwrap, urlparse | 5 import socket, struct, subprocess, sys, time, textwrap, urlparse |
6 import warnings, smtplib, logging, urllib2 | 6 import warnings, smtplib, logging, urllib2 |
7 try: | 7 try: |
8 import hashlib | 8 import hashlib |
9 except ImportError: | 9 except ImportError: |
10 import md5, sha | 10 import md5, sha |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 quotes are NOT added and so should be added at some point by | 1240 quotes are NOT added and so should be added at some point by |
1241 the caller. | 1241 the caller. |
1242 | 1242 |
1243 See also: http://www.tldp.org/LDP/abs/html/escapingsection.html | 1243 See also: http://www.tldp.org/LDP/abs/html/escapingsection.html |
1244 """ | 1244 """ |
1245 command = command.replace("\\", "\\\\") | 1245 command = command.replace("\\", "\\\\") |
1246 command = command.replace("$", r'\$') | 1246 command = command.replace("$", r'\$') |
1247 command = command.replace('"', r'\"') | 1247 command = command.replace('"', r'\"') |
1248 command = command.replace('`', r'\`') | 1248 command = command.replace('`', r'\`') |
1249 return command | 1249 return command |
| 1250 |
| 1251 |
| 1252 def configure(extra=None, configure='./configure'): |
| 1253 """ |
| 1254 Run configure passing in the correct host, build, and target options. |
| 1255 |
| 1256 @param extra: extra command line arguments to pass to configure |
| 1257 @param configure: which configure script to use |
| 1258 """ |
| 1259 args = [] |
| 1260 if 'CHOST' in os.environ: |
| 1261 args.append('--host=' + os.environ['CHOST']) |
| 1262 if 'CBUILD' in os.environ: |
| 1263 args.append('--build=' + os.environ['CBUILD']) |
| 1264 if 'CTARGET' in os.environ: |
| 1265 args.append('--target=' + os.environ['CTARGET']) |
| 1266 if extra: |
| 1267 args.append(extra) |
| 1268 |
| 1269 system('%s %s' % (configure, ' '.join(args))) |
| 1270 |
OLD | NEW |