sys.stdout.write(x)
sys.stdout.flush()
LOG.write(x)
-
+
class IniParser:
def __init__(self, file):
self.__d = {}
self.buildorder = []
self.updatemodules(self.keys("modules"))
- self.selectlibs = {}
+ self.selectlibs = {}
for k, v in self.setdefault("selectlibs", {}).items():
self.selectlibs[k] = v.split()
if len(cantbuild) > 0:
lprint("configure: can't select: %s" % " ".join(cantbuild))
+validopts = {}
+
def usage():
print
print " Usage: %s [-h] [-v] [options]" % sys.argv[0]
print " Additional options are:"
for k, v in validopts.items():
print " --with-%s=[%s]" % (v[0], "|".join(v[1]))
-
- print " -L [additional lib dir]"
+ print " -L [additional lib dir]"
print " -I [additional include dir]"
print " -m [additional module]"
print " -v: verbose"
-def main(workspacesfile):
+def main():
global LOG, VERBOSE
- workspacesconfig = IniParser(open(workspacesfile, "r"))
+ files, workspaces = [], []
+ for root, _, file_list in os.walk("."):
+ if "configure.ini" not in file_list:
+ continue
- files = []
- workspaces = []
+ print "found workspace: %s" % root
+ workspaces.append(root)
- for workspace in ["."] + workspacesconfig["workspaces"].keys():
- path = workspace + "/configure.ini"
- if os.path.exists(path):
- print "found workspace: %s" % workspace
- workspaces.append(workspace)
- files.append( (workspace, open(path, "r")) )
+ path = os.path.join(root, "configure.ini")
+ files.append( (root, open(path, "r")) )
- local_path = workspace + "/configure.ini.local"
- if os.path.exists(local_path):
- files.append( (workspace, open(local_path, "r")) )
+ local_path = os.path.join(root, "configure.ini.local")
+ if os.path.exists(local_path):
+ files.append( (root, open(local_path, "r")) )
config = MultiConfigureIniParser(files)
mopts = []
- validopts = {}
+
for k, v in config.selectlibs.items():
mopts.append("with-%s=" % k)
validopts["--with-%s" % k] = (k, v)
configure(config, overrides, workspaces)
if __name__ == "__main__":
- main("workspaces.ini")
+ main()