diff options
Diffstat (limited to 'platform/x11/detect.py')
-rw-r--r-- | platform/x11/detect.py | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 72139538b7..b5ad59e60a 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -2,7 +2,7 @@ import os import platform import sys from compat import decode_utf8 - +from methods import get_compiler_version, use_gcc def is_active(): return True @@ -20,12 +20,10 @@ def can_build(): # Check the minimal dependencies x11_error = os.system("pkg-config --version > /dev/null") if (x11_error): - print("pkg-config not found.. x11 disabled.") return False x11_error = os.system("pkg-config x11 --modversion > /dev/null ") if (x11_error): - print("X11 not found.. x11 disabled.") return False x11_error = os.system("pkg-config xcursor --modversion > /dev/null ") @@ -161,16 +159,10 @@ def configure(env): env.Append(CCFLAGS=['-pipe']) env.Append(LINKFLAGS=['-pipe']) - # Check for gcc version > 5 before adding -no-pie - import re - import subprocess - proc = subprocess.Popen([env['CXX'], '--version'], stdout=subprocess.PIPE) - (stdout, _) = proc.communicate() - stdout = decode_utf8(stdout) - match = re.search('[0-9][0-9.]*', stdout) - if match is not None: - version = match.group().split('.') - if (version[0] > '5'): + # Check for gcc version >= 6 before adding -no-pie + if use_gcc(env): + version = get_compiler_version(env) + if version != None and version[0] >= '6': env.Append(CCFLAGS=['-fpie']) env.Append(LINKFLAGS=['-no-pie']) |