Please note:The SCons wiki is now restored from the attack in March 2013. All old passwords have been invalidated. Please reset your password if you have an account. If you note missing pages, please report them to webmaster@scons.org. Also, new account creation is currently disabled due to an ongoing spam flood (2013/08/27).
Differences between revisions 4 and 5
Revision 4 as of 2013-08-27 14:11:04
Size: 494
Editor: JasonT58
Comment:
Revision 5 as of 2013-08-28 20:45:37
Size: 3101
Comment: Spam
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Ordering DVD Movies online, free videos, online videos, download Movies and watch videos with full privacy of your home - whenever you wanted to watch them. Toy Story 3, when Andy goes off to college. Some of John Hughes' pictures I've liked, and Spielberg's. Born in 1904, he came from the distinguished Japanese film-maker Kon Ichikawa. As an entrepreneur you have to sleep in the washing machine.<<BR>>
<<BR>>
Feel free to visit my weblog: [[http://microadvert.net/node/385021|phim hay]]
Line 3: Imports the env from the parent script

Line 5&7: Sets up the C compiler to look in both the current directory and the include directory underneath the main directory in which SCons was started. Note the "#" in the "#include". This is important. That include directory contains a "config.h" file that almost all the C code references and it is not copied over to the build/etc/etc hierarchy.

Line 9: Gambit Scheme input files (sources)
Line 12: Extra input source files. This is here because these files have extra dependencies.

Line 16&17: Converts the Gambit Scheme input files into C output files (targets) via the GambitCompiler Builder defined in the top-level SConstruct. ie. _gsi.scm becomes _gsi.c. Note that I am saving the targets here for later reference.

Line 23,23,25,26,27: Lots of dependencies. Make the targets dependent upon libgambc. As the comment says, only the gsc executable is, strictly speaking, dependent upon libgambc. However, the easiest way to pick up the dependencies from lots of the source files to the lib files is to make the targets depend on the whole library. Yes, it's a bit of a hack which forces libgambc to build first.

Line 29: Gambit requires some extra link information to produce a stand-alone executable. This uses the GambitLinker Builder that was defined in the top-level SConstruct to produce that file. It demonstrates multiple sources compiling into one target.

Line 31: Invoke the normal SCons Program Builder to produce an executable and remember it

Line 33: Not used yet, but I send the reference to the executable back up to the SConstruct for later use, if required.

{{{
#!python
# -*-python-*-

Import(["env", "libgambc"])

cpppath = [".", "#include", "#lib"]

env.Replace(CPPPATH=cpppath)

gambitSourceFiles = ["_back.scm", "_env.scm", "_front.scm", "_gvm.scm", "_host.scm",
       "_parms.scm", "_prims.scm", "_ptree1.scm", "_ptree2.scm", "_source.scm",
       "_t-c-1.scm", "_t-c-2.scm", "_utils.scm"]
gambitGenericDependentSourceFiles = ["_t-c-3.scm", "_gsc.scm"]


# This "GenericDependent" contortion is because source files can't have dependencies
gambitTargetFiles = env.GambitCompiler(gambitSourceFiles)
gambitGenericDependentTargetFiles = env.GambitCompiler(gambitGenericDependentSourceFiles)


# The target files are not strictly dependent upon the entire
# libgambc but on some of the files generated during its build
env.Depends(gambitTargetFiles, libgambc)
env.Depends(gambitGenericDependentTargetFiles, libgambc)

env.Depends(gambitTargetFiles, ["fixnum.scm", "_envadt.scm", "_gvmadt.scm", "_ptreeadt.scm", "_sourceadt.scm"])
env.Depends(gambitGenericDependentTargetFiles, ["fixnum.scm", "_envadt.scm", "_gvmadt.scm", "_ptreeadt.scm", "_sourceadt.scm"])
env.Depends(gambitGenericDependentTargetFiles, ["generic.scm"])

gscLinkerFile = env.GambitLinker([gambitTargetFiles, gambitGenericDependentTargetFiles])

gsc = env.Program("gsc", [gambitTargetFiles, gambitGenericDependentTargetFiles,
                          gscLinkerFile, libgambc])
Return("gsc")
}}}

Line 3: Imports the env from the parent script

Line 5&7: Sets up the C compiler to look in both the current directory and the include directory underneath the main directory in which SCons was started. Note the "#" in the "#include". This is important. That include directory contains a "config.h" file that almost all the C code references and it is not copied over to the build/etc/etc hierarchy.

Line 9: Gambit Scheme input files (sources) Line 12: Extra input source files. This is here because these files have extra dependencies.

Line 16&17: Converts the Gambit Scheme input files into C output files (targets) via the GambitCompiler Builder defined in the top-level SConstruct. ie. _gsi.scm becomes _gsi.c. Note that I am saving the targets here for later reference.

Line 23,23,25,26,27: Lots of dependencies. Make the targets dependent upon libgambc. As the comment says, only the gsc executable is, strictly speaking, dependent upon libgambc. However, the easiest way to pick up the dependencies from lots of the source files to the lib files is to make the targets depend on the whole library. Yes, it's a bit of a hack which forces libgambc to build first.

Line 29: Gambit requires some extra link information to produce a stand-alone executable. This uses the GambitLinker Builder that was defined in the top-level SConstruct to produce that file. It demonstrates multiple sources compiling into one target.

Line 31: Invoke the normal SCons Program Builder to produce an executable and remember it

Line 33: Not used yet, but I send the reference to the executable back up to the SConstruct for later use, if required.

   1 # -*-python-*-
   2 
   3 Import(["env", "libgambc"])
   4 
   5 cpppath = [".", "#include", "#lib"]
   6 
   7 env.Replace(CPPPATH=cpppath)
   8 
   9 gambitSourceFiles = ["_back.scm", "_env.scm", "_front.scm", "_gvm.scm", "_host.scm",
  10                      "_parms.scm", "_prims.scm", "_ptree1.scm", "_ptree2.scm", "_source.scm",
  11                      "_t-c-1.scm", "_t-c-2.scm", "_utils.scm"]
  12 gambitGenericDependentSourceFiles = ["_t-c-3.scm", "_gsc.scm"]
  13 
  14 
  15 # This "GenericDependent" contortion is because source files can't have dependencies
  16 gambitTargetFiles = env.GambitCompiler(gambitSourceFiles)
  17 gambitGenericDependentTargetFiles = env.GambitCompiler(gambitGenericDependentSourceFiles)
  18 
  19 
  20 # The target files are not strictly dependent upon the entire
  21 # libgambc but on some of the files generated during its build
  22 env.Depends(gambitTargetFiles, libgambc)
  23 env.Depends(gambitGenericDependentTargetFiles, libgambc)
  24 
  25 env.Depends(gambitTargetFiles, ["fixnum.scm", "_envadt.scm", "_gvmadt.scm", "_ptreeadt.scm", "_sourceadt.scm"])
  26 env.Depends(gambitGenericDependentTargetFiles, ["fixnum.scm", "_envadt.scm", "_gvmadt.scm", "_ptreeadt.scm", "_sourceadt.scm"])
  27 env.Depends(gambitGenericDependentTargetFiles, ["generic.scm"])
  28 
  29 gscLinkerFile = env.GambitLinker([gambitTargetFiles, gambitGenericDependentTargetFiles])
  30 
  31 gsc = env.Program("gsc", [gambitTargetFiles, gambitGenericDependentTargetFiles,
  32                           gscLinkerFile, libgambc])
  33 Return("gsc")

APLSConscript01-gsc (last edited 2013-08-28 20:45:37 by WilliamDeegan)