def test_compilation(cfile, compiler=None, **compiler_attrs):
 cc = get_compiler(compiler, **compiler_attrs)
 (efile, ext) = os.path.splitext(cfile)
 cpreargs = lpreargs = None
 if (sys.platform == 'darwin'):
  if (platform.architecture()[0] == '32bit'):
   if (platform.processor() == 'powerpc'):
    cpu = 'ppc'
   else:
    cpu = 'i386'
   cpreargs = ['-arch', cpu]
   lpreargs = ['-arch', cpu, '-undefined', 'dynamic_lookup']
  else:
   lpreargs = ['-undefined', 'dynamic_lookup']
 if (sys.platform == 'sunos5'):
  if (platform.architecture()[0] == '32bit'):
   lpreargs = ['-m32']
  else:
   lpreargs = ['-m64']
 extra = compiler_attrs.get('extra_compile_args', None)
 objs = cc.compile([cfile], extra_preargs=cpreargs, extra_postargs=extra)
 cc.link_executable(objs, efile, extra_preargs=lpreargs)
 return efile

def test_compilation ( cfile , compiler = None , ** compiler_attrs ) : cc = get_compiler ( compiler , ** compiler_attrs ) ( efile , ext ) = os . path . splitext ( cfile ) cpreargs = lpreargs = None if ( sys . platform == 'darwin' ) : if ( platform . architecture ( ) [ 0 ] == '32bit' ) : if ( platform . processor ( ) == 'powerpc' ) : cpu = 'ppc' else : cpu = 'i386' cpreargs = [ '-arch' , cpu ] lpreargs = [ '-arch' , cpu , '-undefined' , 'dynamic_lookup' ] else : lpreargs = [ '-undefined' , 'dynamic_lookup' ] if ( sys . platform == 'sunos5' ) : if ( platform . architecture ( ) [ 0 ] == '32bit' ) : lpreargs = [ '-m32' ] else : lpreargs = [ '-m64' ] extra = compiler_attrs . get ( 'extra_compile_args' , None ) objs = cc . compile ( [ cfile ] , extra_preargs = cpreargs , extra_postargs = extra ) cc . link_executable ( objs , efile , extra_preargs = lpreargs ) return efile
test simple compilation with given settings .