Skip to content

Commit

Permalink
Enabling the function to check if a Chicken program can be compiled.
Browse files Browse the repository at this point in the history
darcs-hash:20070113194617-de23e-c4b2f8e04c4832d29bc88ed7139055c2640aaac5.gz
  • Loading branch information
pupeno committed Jan 13, 2007
1 parent 2feb7f6 commit 956a58e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions chicken.py
Expand Up @@ -22,6 +22,7 @@ def generate(env):
#env["CHICKENREPOSITORY"] = strip(os.popen("chicken-setup -repository").read()) + "/" #env["CHICKENREPOSITORY"] = strip(os.popen("chicken-setup -repository").read()) + "/"
env["CHICKENCOM"] = "$CHICKEN $CHICKENFLAGS $SOURCE -output-file $TARGET" env["CHICKENCOM"] = "$CHICKEN $CHICKENFLAGS $SOURCE -output-file $TARGET"



ccflags = SCons.Util.CLVar(os.popen("csc -cflags").read()) ccflags = SCons.Util.CLVar(os.popen("csc -cflags").read())
linkflags = SCons.Util.CLVar(os.popen("csc -ldflags").read()) linkflags = SCons.Util.CLVar(os.popen("csc -ldflags").read())
libs = os.popen("csc -libs").read().strip().replace("-l", "").split() libs = os.popen("csc -libs").read().strip().replace("-l", "").split()
Expand All @@ -34,6 +35,7 @@ def generate(env):
c_file, cxx_file = SCons.Tool.createCFileBuilders(env) c_file, cxx_file = SCons.Tool.createCFileBuilders(env)
c_file.add_action(".scm", SCons.Action.Action(env["CHICKENCOM"])) c_file.add_action(".scm", SCons.Action.Action(env["CHICKENCOM"]))



#def includedFiles(node, env, path): #def includedFiles(node, env, path):
# for path in env["ENV"]["PATH"].split(":"): # for path in env["ENV"]["PATH"].split(":"):
# cil = path + "/" + "chicken-include-list" # cil = path + "/" + "chicken-include-list"
Expand Down Expand Up @@ -147,16 +149,17 @@ def generate(env):
#emitter = EmitEggContents, #emitter = EmitEggContents,
#suffix = ".egg") #suffix = ".egg")


#def CheckChickenProgram(context): def CheckChickenProgram(context):
#""" Check if a Chicken program can be built and run. If not, try adding the libraries. """ """ Check if a Chicken program can be built and run. If not, try adding the libraries. """
#context.Message("Checking for building Chicken programs... ") context.Message("Checking for building Chicken programs... ")
#result = context.TryRun("(display (+ 1 2))", ".scm") result = context.TryRun("(display (+ 1 2))", ".scm")
#if not result[0]: if not result[0]:
#context.env.ParseConfig("chicken-config -cflags -libs") #context.env.ParseConfig("chicken-config -cflags -libs")
#result = context.TryRun("(display (+ 1 2))", ".scm") result = context.TryRun("(display (+ 1 2))", ".scm")


#context.Result(result[0]) context.Result(result[0])
#return result[0] return result[0]
env.CheckChickenProgram = CheckChickenProgram


#def CheckChickenLibrary(context): #def CheckChickenLibrary(context):
#""" Check if a Chicken library can be built after adding the libraries. """ #""" Check if a Chicken library can be built after adding the libraries. """
Expand All @@ -166,9 +169,6 @@ def generate(env):
#result = context.TryBuild(context.env.SharedLibrary, "(display (+ 1 2))", ".scm") #result = context.TryBuild(context.env.SharedLibrary, "(display (+ 1 2))", ".scm")
#context.Result(result) #context.Result(result)
#return result #return result

## Export the checkers.
#env.CheckChickenProgram = CheckChickenProgram
#env.CheckChickenLibrary = CheckChickenLibrary #env.CheckChickenLibrary = CheckChickenLibrary


def exists(env): def exists(env):
Expand Down

0 comments on commit 956a58e

Please sign in to comment.