Merge pull request #1226 from gladiac/cflags

Honor CFLAGS
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2014-12-11 21:27:05 +03:00
commit f34ab66ea2
1 changed files with 5 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import os
import sys
import subprocess
import logging
import shlex
from setuptools import setup, find_packages
@ -27,7 +28,10 @@ def compile_client():
else:
from distutils.ccompiler import new_compiler
compiler = new_compiler().compiler
subprocess.check_call(compiler + ['-O3', 'client/powerline.c', '-o', 'scripts/powerline'])
cflags = os.environ.get('CFLAGS', '-O3')
# A normal split would do a split on each space which might be incorrect. The
# shlex will not split if a space occurs in an arguments value.
subprocess.check_call(compiler + shlex.split(cflags) + ['client/powerline.c', '-o', 'scripts/powerline'])
try:
compile_client()