code: def stage_platform_hpp(capnproot):
      
  
      platform_hpp = pjoin(capnproot, 'src', 'platform.hpp')
      if os.path.exists(platform_hpp):
          info("already have platform.hpp")
          return
      if os.name == 'nt':
          # stage msvc platform header
          platform_dir = pjoin(capnproot, 'builds', 'msvc')
      else:
          info("attempting ./configure to generate platform.hpp")
  
          p = Popen('./configure', cwd=capnproot, shell=True,
              stdout=PIPE, stderr=PIPE,
          )
          o,e = p.communicate()
          if p.returncode:
              warn("failed to configure libcapnp:\n%s" % e)
              if sys.platform == 'darwin':
                  platform_dir = pjoin(HERE, 'include_darwin')
              elif sys.platform.startswith('freebsd'):
                  platform_dir = pjoin(HERE, 'include_freebsd')
              elif sys.platform.startswith('linux-armv'):
                  platform_dir = pjoin(HERE, 'include_linux-armv')
              else:
                  platform_dir = pjoin(HERE, 'include_linux')
          else:
              return
  
      info("staging platform.hpp from: %s" % platform_dir)
      shutil.copy(pjoin(platform_dir, 'platform.hpp'), platform_hpp)
docs: stage platform.hpp into libcapnp sources
  
      Tries ./configure first (except on Windows),
      then falls back on included platform.hpp previously generated.