wscript
changeset 4367 63c04791fae2
parent 4354 ded7c46b986b
child 4368 fc00cd53d37b
equal deleted inserted replaced
4366:1c3138bce75e 4367:63c04791fae2
   172     env = conf.env.copy()
   172     env = conf.env.copy()
   173     env.append_value('CXXFLAGS', flag)
   173     env.append_value('CXXFLAGS', flag)
   174     try:
   174     try:
   175         retval = conf.run_c_code(code='#include <stdio.h>\nint main() { return 0; }\n',
   175         retval = conf.run_c_code(code='#include <stdio.h>\nint main() { return 0; }\n',
   176                                  env=env, compile_filename='test.cc',
   176                                  env=env, compile_filename='test.cc',
   177                                  compile_mode='cxx',type='program', execute=False)
   177                                  compile_mode='cxx',type='cprogram', execute=False)
   178     except Configure.ConfigurationError:
   178     except Configure.ConfigurationError:
   179         ok = False
   179         ok = False
   180     else:
   180     else:
   181         ok = (retval == 0)
   181         ok = (retval == 0)
   182     conf.check_message_custom(flag, 'support', (ok and 'yes' or 'no'))
   182     conf.check_message_custom(flag, 'support', (ok and 'yes' or 'no'))
   294     """task that makes a binary Suid
   294     """task that makes a binary Suid
   295     """
   295     """
   296     after = 'cxx_link cc_link'
   296     after = 'cxx_link cc_link'
   297     maxjobs = 1
   297     maxjobs = 1
   298     def __init__(self, bld, program):
   298     def __init__(self, bld, program):
       
   299         self.bld = bld
   299         self.m_display = 'build-suid'
   300         self.m_display = 'build-suid'
   300         self.__program = program
   301         self.__program = program
   301         self.__env = bld.env.copy ()
   302         self.__env = bld.env.copy ()
   302         super(SuidBuildTask, self).__init__()
   303         super(SuidBuildTask, self).__init__(generator=self)
   303         try:
   304         try:
   304             program_obj = wutils.find_program(self.__program.target, self.__env)
   305             program_obj = wutils.find_program(self.__program.target, self.__env)
   305         except ValueError, ex:
   306         except ValueError, ex:
   306             raise Utils.WafError(str(ex))
   307             raise Utils.WafError(str(ex))
   307         program_node = program_obj.path.find_or_declare(ccroot.get_target_name(program_obj))
   308         program_node = program_obj.path.find_or_declare(ccroot.get_target_name(program_obj))