Fix binaries incorrectly detected as shared libraries on some linux distros

This commit is contained in:
Marcelo Fernandez 2018-11-05 21:34:36 -03:00
parent 3cf3c4137a
commit 34e2d2f4f7

View File

@ -149,6 +149,18 @@ def configure(env):
env.Append(CCFLAGS=['-pipe'])
env.Append(LINKFLAGS=['-pipe'])
# Check for gcc version > 4 before adding -no-pie
import re
import subprocess
proc = subprocess.Popen([env['CXX'], '--version'], stdout=subprocess.PIPE)
(stdout, _) = proc.communicate()
match = re.search('[0-9][0-9.]*', stdout)
if match is not None:
version = match.group().split('.')
if (version[0] > '4'):
env.Append(CCFLAGS=['-fpie'])
env.Append(LINKFLAGS=['-no-pie'])
## Dependencies
env.ParseConfig('pkg-config x11 --cflags --libs')