diff --git a/scons/gallium.py b/scons/gallium.py index 03d11e440a1..63accb143a5 100755 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -340,6 +340,10 @@ def generate(env): cppdefines += ['NDEBUG'] if env['build'] == 'profile': cppdefines += ['PROFILE'] + + if check_functions(env, ['timespec_get']): + cppdefines += ['HAVE_TIMESPEC_GET'] + if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'): cppdefines += [ '_POSIX_SOURCE', @@ -374,9 +378,6 @@ def generate(env): if check_functions(env, ['random_r']): cppdefines += ['HAVE_RANDOM_R'] - if check_functions(env, ['timespec_get']): - cppdefines += ['HAVE_TIMESPEC_GET'] - if check_header(env, 'sys/shm.h'): cppdefines += ['HAVE_SYS_SHM_H']