diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-07-04 18:02:44 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-07-04 18:02:44 +0300 |
commit | 65be7a9ab746285c41b7ff7b0744fdeda0b02f2b (patch) | |
tree | ed79fb757f9d9b30a83a0ab5be1bb383b906c5e1 /environment.py | |
parent | c0c2c35496f2832fee7623ec268e87e23b58a33f (diff) | |
download | meson-65be7a9ab746285c41b7ff7b0744fdeda0b02f2b.zip meson-65be7a9ab746285c41b7ff7b0744fdeda0b02f2b.tar.gz meson-65be7a9ab746285c41b7ff7b0744fdeda0b02f2b.tar.bz2 |
A few Fedora fixes.
Diffstat (limited to 'environment.py')
-rw-r--r-- | environment.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/environment.py b/environment.py index 3253295..f7f42e1 100644 --- a/environment.py +++ b/environment.py @@ -532,6 +532,26 @@ def is_osx(): def is_windows(): return platform.system().lower() == 'windows' +def is_debianlike(): + try: + open('/etc/debian_version', 'r') + return True + except FileNotFoundError: + return False + +def detect_ninja(): + for n in ['ninja', 'ninja-build']: + # Plain 'ninja' or 'ninja -h' yields an error + # code. Thanks a bunch, guys. + try: + p = subprocess.Popen([n, '-t', 'list'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + except FileNotFoundError: + continue + p.communicate() + if p.returncode == 0: + return n + + header_suffixes = ['h', 'hh', 'hpp', 'hxx', 'H'] cpp_suffixes = ['cc', 'cpp', 'cxx', 'hh', 'hpp', 'hxx'] c_suffixes = ['c'] |