scons: Check for xlocale.h before defining HAVE_XLOCALE_H.

Don't assume the header is present on some platforms - use the more
robust CheckHeader() instead.

glibc 2.26 removed xlocale.h.
https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27

Fix this build error with glibc 2.26.

  Compiling src/util/strtod.c ...
src/util/strtod.c:32:10: fatal error: xlocale.h: No such file or directory
 #include <xlocale.h>
          ^~~~~~~~~~~

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101657
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Tested-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
Vinson Lee 2017-07-05 14:16:11 -07:00
parent a6c2001ace
commit c5d0dc7fa5
1 changed files with 3 additions and 1 deletions

View File

@ -325,8 +325,10 @@ def generate(env):
'GLX_INDIRECT_RENDERING',
]
if env['platform'] in ('linux', 'darwin'):
conf = SCons.Script.Configure(env)
if conf.CheckHeader('xlocale.h'):
cppdefines += ['HAVE_XLOCALE_H']
env = conf.Finish()
if platform == 'windows':
cppdefines += [