summaryrefslogtreecommitdiff
path: root/scons
diff options
context:
space:
mode:
authorEric Engestrom <eric.engestrom@imgtec.com>2017-07-10 13:27:25 +0100
committerEric Engestrom <eric.engestrom@imgtec.com>2017-07-14 13:23:54 +0100
commitb50b4b6f84dc990b870d2f6cf59fd758c1607fa0 (patch)
tree58aef509af45ff6dcf144316ad3bbe8b86ccacfa /scons
parent5cd4ece34ebdc1383f1e2376c88097d06544e2f6 (diff)
scons: split out check_header() helper
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Diffstat (limited to 'scons')
-rwxr-xr-xscons/gallium.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/scons/gallium.py b/scons/gallium.py
index 61643a6d4f..c8e47a39db 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -145,6 +145,17 @@ def check_cc(env, cc, expr, cpp_opt = '-E'):
sys.stdout.write(' %s\n' % ['no', 'yes'][int(bool(result))])
return result
+def check_header(env, header):
+ '''Check if the header exist'''
+
+ conf = SCons.Script.Configure(env)
+ have_header = False
+
+ if conf.CheckHeader(header):
+ have_header = True
+
+ env = conf.Finish()
+ return have_header
def check_prog(env, prog):
"""Check whether this program exists."""
@@ -325,10 +336,8 @@ def generate(env):
'GLX_INDIRECT_RENDERING',
]
- conf = SCons.Script.Configure(env)
- if conf.CheckHeader('xlocale.h'):
+ if check_header(env, 'xlocale.h'):
cppdefines += ['HAVE_XLOCALE_H']
- env = conf.Finish()
if platform == 'windows':
cppdefines += [