- if env['platform'] in ('linux', 'freebsd'):
- cppdefines += ['HAVE_ALIAS']
- else:
- cppdefines += ['GLX_ALIAS_UNSUPPORTED']
- if env['platform'] == 'haiku':
- cppdefines += [
- 'HAVE_PTHREAD',
- 'HAVE_POSIX_MEMALIGN'
- ]
+
+ if check_header(env, 'xlocale.h'):
+ cppdefines += ['HAVE_XLOCALE_H']
+
+ if check_header(env, 'endian.h'):
+ cppdefines += ['HAVE_ENDIAN_H']
+
+ if check_functions(env, ['strtod_l', 'strtof_l']):
+ cppdefines += ['HAVE_STRTOD_L']
+
+ 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']
+
+ if check_functions(env, ['strtok_r']):
+ cppdefines += ['HAVE_STRTOK_R']
+
+ #FIXME: we should really be checking for the major()/minor()
+ # functions/macros in these headers, but check_functions()'s
+ # SConf.CheckFunc() doesn't seem to support macros.
+ if check_header(env, 'sys/mkdev.h'):
+ cppdefines += ['MAJOR_IN_MKDEV']
+ if check_header(env, 'sys/sysmacros.h'):
+ cppdefines += ['MAJOR_IN_SYSMACROS']
+