SCons User Guide 2.0.0.final.0 | ||
---|---|---|
Prev | Chapter 24. Multi-Platform Configuration (Autoconf Functionality) | Next |
Check for the availability of a typedef
by using the CheckType
method:
env = Environment() conf = Configure(env) if not conf.CheckType('off_t'): print 'Did not find off_t typedef, assuming int' conf.env.Append(CCFLAGS = '-Doff_t=int') env = conf.Finish()
You can also add a string that will be placed at the beginning of the test file that will be used to check for the typedef. This provide a way to specify files that must be included to find the typedef:
env = Environment() conf = Configure(env) if not conf.CheckType('off_t', '#include <sys/types.h>\n'): print 'Did not find off_t typedef, assuming int' conf.env.Append(CCFLAGS = '-Doff_t=int') env = conf.Finish()