Switch build badge to github one
[jackdbus.git] / compat / wscript
blob1cd476fc1cd1a057e3ad4882b0c5169d9418cd10
1 #!/usr/bin/python3
2 # encoding: utf-8
4 # Copyright (C) 2018 Karl Linden <karl.j.linden@gmail.com>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 import os
23 def get_subdirs(ctx):
24     """
25     Get the compatibility module subirectories.
27     The compat modules are found dynamically so that this script does
28     not have to be modified if more modules are added.
30     :param ctx: the waf context
31     :type ctx: waflib.Context.Context
32     :returns: list of str -- the subdirectories
33     """
34     subdirs = []
35     for entry in ctx.path.listdir():
36         path = os.path.join(ctx.path.abspath(), entry)
37         if os.path.isdir(path) and not entry.startswith('.'):
38             subdirs.append(entry)
39     return subdirs
42 def recurse_into_subdirs(ctx):
43     """
44     Recurse into compatibility module subdirectories.
46     :param ctx: the waf context
47     :type ctx: waflib.Context.Context
48     """
49     for x in get_subdirs(ctx):
50         ctx.recurse(x)
53 def options(opt):
54     recurse_into_subdirs(opt)
57 def configure(conf):
58     recurse_into_subdirs(conf)
61 def build(bld):
62     recurse_into_subdirs(bld)