root/branches/libffado-scons_porting_work/pkgconfig.py

Revision 519, 0.7 kB (checked in by arnonym, 15 years ago)

Add the first version of scons-support to ffado.

Everything seems to build correctly. Installing and library-versioning is not implemented yet.

[Hopefully this gets into the right branch.]

Line 
1 #!/usr/bin/python
2
3 #
4 # Taken from http://www.scons.org/wiki/UsingPkgConfig
5 #
6
7 def CheckForPKGConfig( context, version='0.0.0' ):
8         context.Message( "Checking for pkg-config (at least version %s)... " % version )
9         ret = context.TryAction( "pkg-config --atleast-pkgconfig-version=%s" %version )[0]
10         context.Result( ret )
11         return ret
12
13 def CheckForPKG( context, name, version="" ):
14         if version == "":
15                 context.Message( "Checking for %s... \t" % name )
16                 ret = context.TryAction( "pkg-config --exists '%s'" % name )[0]
17         else:
18                 context.Message( "Checking for %s (%s or higher)... \t" % (name,version) )
19                 ret = context.TryAction( "pkg-config --atleast-version=%s '%s'" % (version,name) )[0]
20         context.Result( ret )
21         return ret
22
Note: See TracBrowser for help on using the browser.