3 def createConfig(target, source, values):
4 outFile = file(str(target), "w")
5 inFile = file(str(source), "r")
6 outFile.write(inFile.read() % values)
10 def generateConfig(target):
11 def getCommandOutput(command):
12 process = subprocess.Popen("getconf PAGESIZE", shell=True, stdout=subprocess.PIPE)
13 return process.stdout.read()
15 tf = file(target, "w")
16 tf.write("/* This file is automatically generated. Do not edit unless you know what you are doing. */\n\n")
17 tf.write("#define AesalonPageSize %s\n" % getCommandOutput("getconf PAGESIZE").strip())
20 config = file("config", "r")
21 buildConfig = eval(config.read())
24 createConfig("../include/Config.h", "templates/Config.h.in", buildConfig)
26 generateConfig("../include/Config.h.auto")