github.com/hwaf/hwaf@v0.0.0-20140814122253-5465f73b20f1/py-hwaftools/find_pthread.py (about)

     1  # -*- python -*-
     2  
     3  # stdlib imports ---
     4  import os
     5  import os.path as osp
     6  
     7  # waf imports ---
     8  import waflib.Utils
     9  import waflib.Logs as msg
    10  from waflib.Configure import conf
    11  
    12  #
    13  _heptooldir = osp.dirname(osp.abspath(__file__))
    14  
    15  def options(ctx):
    16      ctx.load('hwaf-base', tooldir=_heptooldir)
    17      return
    18  
    19  def configure(ctx):
    20      ctx.load('hwaf-base', tooldir=_heptooldir)
    21      return
    22  
    23  @conf
    24  def find_pthread(ctx, **kwargs):
    25      
    26      ctx.load('hwaf-base', tooldir=_heptooldir)
    27  
    28      if not ctx.env.HWAF_FOUND_C_COMPILER:
    29          ctx.fatal('load a C compiler first')
    30          pass
    31  
    32      # find pthread
    33      ctx.check_with(
    34          ctx.check,
    35          "pthread",
    36          features='c cprogram',
    37          lib='pthread',
    38          uselib_store='pthread',
    39          **kwargs
    40          )
    41  
    42      ctx.env.HWAF_FOUND_PTHREAD = 1
    43      return
    44  
    45  ## EOF ##