Permalink
Browse files

Enabling the function to check if a Chicken program can be compiled.

darcs-hash:20070113194617-de23e-c4b2f8e04c4832d29bc88ed7139055c2640aaac5.gz
  • Loading branch information...
1 parent 2feb7f6 commit 956a58e7cd366810bbc9d62ffc7f2608f9a85388 @pupeno committed Jan 13, 2007
Showing with 11 additions and 11 deletions.
  1. +11 −11 chicken.py
View
@@ -22,6 +22,7 @@ def generate(env):
#env["CHICKENREPOSITORY"] = strip(os.popen("chicken-setup -repository").read()) + "/"
env["CHICKENCOM"] = "$CHICKEN $CHICKENFLAGS $SOURCE -output-file $TARGET"
+
ccflags = SCons.Util.CLVar(os.popen("csc -cflags").read())
linkflags = SCons.Util.CLVar(os.popen("csc -ldflags").read())
libs = os.popen("csc -libs").read().strip().replace("-l", "").split()
@@ -34,6 +35,7 @@ def generate(env):
c_file, cxx_file = SCons.Tool.createCFileBuilders(env)
c_file.add_action(".scm", SCons.Action.Action(env["CHICKENCOM"]))
+
#def includedFiles(node, env, path):
# for path in env["ENV"]["PATH"].split(":"):
# cil = path + "/" + "chicken-include-list"
@@ -147,16 +149,17 @@ def generate(env):
#emitter = EmitEggContents,
#suffix = ".egg")
- #def CheckChickenProgram(context):
- #""" Check if a Chicken program can be built and run. If not, try adding the libraries. """
- #context.Message("Checking for building Chicken programs... ")
- #result = context.TryRun("(display (+ 1 2))", ".scm")
- #if not result[0]:
+ def CheckChickenProgram(context):
+ """ Check if a Chicken program can be built and run. If not, try adding the libraries. """
+ context.Message("Checking for building Chicken programs... ")
+ result = context.TryRun("(display (+ 1 2))", ".scm")
+ if not result[0]:
#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])
- #return result[0]
+ context.Result(result[0])
+ return result[0]
+ env.CheckChickenProgram = CheckChickenProgram
#def CheckChickenLibrary(context):
#""" Check if a Chicken library can be built after adding the libraries. """
@@ -166,9 +169,6 @@ def generate(env):
#result = context.TryBuild(context.env.SharedLibrary, "(display (+ 1 2))", ".scm")
#context.Result(result)
#return result
-
- ## Export the checkers.
- #env.CheckChickenProgram = CheckChickenProgram
#env.CheckChickenLibrary = CheckChickenLibrary
def exists(env):

0 comments on commit 956a58e

Please sign in to comment.