Allow the bootstrap to be verbose
authorBen Boeckel <mathstuf@gmail.com>
Fri, 30 Mar 2012 23:28:37 +0000 (19:28 -0400)
committerBen Boeckel <mathstuf@gmail.com>
Fri, 30 Mar 2012 23:38:04 +0000 (19:38 -0400)
bootstrap.py

index ca47b19..8c31dd7 100755 (executable)
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from optparse import OptionParser
 import sys
 import os
 import glob
@@ -20,6 +21,11 @@ import errno
 import shlex
 import subprocess
 
+parser = OptionParser()
+parser.add_option('--verbose', action='store_true',
+                  help='enable verbose build',)
+(options, conf_args) = parser.parse_args()
+
 def run(*args, **kwargs):
     try:
         subprocess.check_call(*args, **kwargs)
@@ -81,11 +87,19 @@ if vcdir:
     args.extend(['/link', '/out:' + binary])
 else:
     args.extend(['-o', binary])
+
+if options.verbose:
+    print ' '.join(args)
+
 run(args)
 
+verbose = []
+if options.verbose:
+    verbose = ['-v']
+
 print 'Building ninja using itself...'
-run([sys.executable, 'configure.py'] + sys.argv[1:])
-run(['./' + binary])
+run([sys.executable, 'configure.py'] + conf_args)
+run(['./' + binary] + verbose)
 os.unlink(binary)
 
 print 'Done!'