build: handle CC env var with spaces
authorGabriel <g2p.code@gmail.com>
Tue, 26 Jun 2012 17:45:13 +0000 (19:45 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Wed, 27 Jun 2012 17:52:01 +0000 (19:52 +0200)
For example:

    CC='ccache gcc' ./configure

configure

index 8dd68847dd3d572f5a09f01139e306934b2cc093..df18ba5e31b95d893ec9678bb17af1e93ac58a68 100755 (executable)
--- a/configure
+++ b/configure
@@ -241,7 +241,7 @@ def target_arch():
 
 def compiler_version():
   try:
-    proc = subprocess.Popen([CC, '-v'], stderr=subprocess.PIPE)
+    proc = subprocess.Popen(CC.split() + ['-v'], stderr=subprocess.PIPE)
   except OSError:
     return (False, False, None)
   lines = proc.communicate()[1].split('\n')