def stage_platform_hpp(zmqroot):
 platform_hpp = pjoin(zmqroot, 'src', 'platform.hpp')
 if os.path.exists(platform_hpp):
  info('already have platform.hpp')
  return
 if (os.name == 'nt'):
  platform_dir = pjoin(zmqroot, 'builds', 'msvc')
 else:
  info('attempting ./configure to generate platform.hpp')
  p = Popen('./configure', cwd=zmqroot, shell=True, stdout=PIPE, stderr=PIPE)
  (o, e) = p.communicate()
  if p.returncode:
   warn(('failed to configure libzmq:\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)

def stage_platform_hpp ( zmqroot ) : platform_hpp = pjoin ( zmqroot , 'src' , 'platform.hpp' ) if os . path . exists ( platform_hpp ) : info ( 'already have platform.hpp' ) return if ( os . name == 'nt' ) : platform_dir = pjoin ( zmqroot , 'builds' , 'msvc' ) else : info ( 'attempting ./configure to generate platform.hpp' ) p = Popen ( './configure' , cwd = zmqroot , shell = True , stdout = PIPE , stderr = PIPE ) ( o , e ) = p . communicate ( ) if p . returncode : warn ( ( 'failed to configure libzmq:\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 )
stage platform .