Show
Ignore:
Timestamp:
08/25/07 11:53:43 (17 years ago)
Author:
arnonym
Message:

Add some help-texts and export the flags to the environment...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/admin/pkgconfig.py

    r521 r569  
    55# 
    66 
     7# 
     8# Checks for pkg-config 
     9# 
    710def CheckForPKGConfig( context, version='0.0.0' ): 
    811        context.Message( "Checking for pkg-config (at least version %s)... " % version ) 
     
    1114        return ret 
    1215 
     16# 
     17# Checks for the given package with an optional version-requirement 
     18# 
     19# The flags (which can be imported into the environment by env.MergeFlags(...) 
     20# are exported as env['NAME_FLAGS'] where name is built by removing all +,-,. 
     21# and upper-casing. 
     22# 
    1323def CheckForPKG( context, name, version="" ): 
     24        name2 = name.replace("+","").replace(".","").replace("-","") 
     25 
    1426        if version == "": 
    1527                context.Message( "Checking for %s... \t" % name ) 
     
    1830                context.Message( "Checking for %s (%s or higher)... \t" % (name,version) ) 
    1931                ret = context.TryAction( "pkg-config --atleast-version=%s '%s'" % (version,name) )[0] 
     32 
     33        if ret: 
     34                context.env['%s_FLAGS' % name2.upper()] = "!pkg-config --cflags --libs %s" % name 
     35 
    2036        context.Result( ret ) 
    2137        return ret