You can use check the availability of a library with SCons as follows:
env = Environment()
conf = Configure(env)
if not conf.CheckLib('cilkrts'):
print 'Did not find libcilkrts.a, exiting!'
Exit(1)
else:
env.Prepend(CXXFLAGS = ['-fcilkplus'], LIBS = ['cilkrts'])
env = conf.Finish()
You could also check the availability of a header as follows:
env = Environment()
conf = Configure(env)
if conf.CheckCHeader('cilk/cilk.h'):
env.Prepend(CXXFLAGS = ['-fcilkplus'], LIBS = ['cilkrts'])
env = conf.Finish()
Update:
I just realized, you can access the environment on the Configure object as follows:
conf.env.Append(...)