comparison site_scons/site_tools/cpython/doc/reference.html @ 11:4706e0194af3

Various improvements to the build process including support for self-contained builds. * Note that despite all of these changes PARPG still does not run because asset paths are not standardized, * Modified the SCons script so that by default running `scons` with no arguments creates a self-contained "build" under a build subdirectory to make in-source testing easier. To install PARPG, use `scons install` instead. * Got rid of the binary launcher and replaced it with a shell script for unix and a batch script for Windows (batch script is untested). The binary turned out to be too much trouble to maintain. * Modified the parpg.settings module and parpg.main entry script so that PARPG searches through several default search paths for configuration file(s). PARPG thus no longer crashes if it can't find a configuration file in any particular search path, but will crash it if can't find any configuration files. * Paths supplied to parpg.main are now appended as search paths for the configuration file(s). * Changed the default configuration file name to "parpg.cfg" to simplify searches. * Created the site_scons directory tree where SCons extensions and tools should be placed. * Created a new SCons builder, CopyRecurse, which can copy only certain files and folders from a directory tree using filters (files and folders that start with a leading dot "." e.g. ".svn" are ignored by default). * Added the CPython SCons tool (stands for Compile-Python - I didn't name it!), which provides the InstallPython builder for pre-compiling python sources before they are installed. However, it is currently broken and only installs the python sources.
author M. George Hansen <technopolitica@gmail.com>
date Tue, 31 May 2011 02:46:20 -0700
parents
children
comparison
equal deleted inserted replaced
10:5deaf494934a 11:4706e0194af3
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >SCons tool cpython - Reference</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"></HEAD
9 ><BODY
10 CLASS="article"
11 BGCOLOR="#FFFFFF"
12 TEXT="#000000"
13 LINK="#0000FF"
14 VLINK="#840084"
15 ALINK="#0000FF"
16 ><DIV
17 CLASS="ARTICLE"
18 ><DIV
19 CLASS="TITLEPAGE"
20 ><H1
21 CLASS="title"
22 ><A
23 NAME="AEN2"
24 >SCons tool <SPAN
25 CLASS="QUOTE"
26 >"cpython"</SPAN
27 > - Reference</A
28 ></H1
29 ><H3
30 CLASS="author"
31 ><A
32 NAME="AEN5"
33 >Dirk Baechle</A
34 ></H3
35 ><P
36 CLASS="pubdate"
37 >2010-07-28<BR></P
38 ><HR></DIV
39 ><DIV
40 CLASS="TOC"
41 ><DL
42 ><DT
43 ><B
44 >Table of Contents</B
45 ></DT
46 ><DT
47 >1. <A
48 HREF="#interna"
49 >Interna</A
50 ></DT
51 ><DT
52 >2. <A
53 HREF="#AEN20"
54 >Builders</A
55 ></DT
56 ><DD
57 ><DL
58 ><DT
59 >2.1. <A
60 HREF="#AEN22"
61 >InstallPython</A
62 ></DT
63 ></DL
64 ></DD
65 ><DT
66 >3. <A
67 HREF="#AEN33"
68 >Variables</A
69 ></DT
70 ></DL
71 ></DIV
72 ><BLOCKQUOTE
73 CLASS="ABSTRACT"
74 ><DIV
75 CLASS="abstract"
76 ><P
77 ></P
78 ><A
79 NAME="AEN9"
80 ></A
81 ><P
82 >This reference lists all the variables that are used within the
83 <SPAN
84 CLASS="QUOTE"
85 >"cpython"</SPAN
86 > tool, and the available builders. It is intended
87 for SCons tool developers and core programmers, as a normal user you
88 should read the manual instead.</P
89 ><P
90 ></P
91 ></DIV
92 ></BLOCKQUOTE
93 ><DIV
94 CLASS="section"
95 ><HR><H2
96 CLASS="section"
97 ><A
98 NAME="interna"
99 >1. Interna</A
100 ></H2
101 ><P
102 >Internally, the builder is based on the
103 <TT
104 CLASS="literal"
105 >Install</TT
106 >/<TT
107 CLASS="literal"
108 >InstallAs</TT
109 > methods from
110 <TT
111 CLASS="literal"
112 >SCons.Tool.install</TT
113 >. It makes use of the basic builder's
114 functions: <TT
115 CLASS="literal"
116 >installFunc()</TT
117 >, and
118 <TT
119 CLASS="literal"
120 >add_targets_to_INSTALLED_FILES()</TT
121 >.</P
122 ></DIV
123 ><DIV
124 CLASS="section"
125 ><HR><H2
126 CLASS="section"
127 ><A
128 NAME="AEN20"
129 >2. Builders</A
130 ></H2
131 ><DIV
132 CLASS="section"
133 ><H3
134 CLASS="section"
135 ><A
136 NAME="AEN22"
137 >2.1. InstallPython</A
138 ></H3
139 ><P
140 >The <SPAN
141 CLASS="QUOTE"
142 >"<TT
143 CLASS="literal"
144 >InstallPython</TT
145 >"</SPAN
146 > method creates
147 <TT
148 CLASS="literal"
149 >.pyc</TT
150 > or <TT
151 CLASS="literal"
152 >.pyo</TT
153 > files for
154 <TT
155 CLASS="literal"
156 >.py</TT
157 > source files and adds them to the list of targets
158 along with the source files. They are later copied to the destination
159 (target) directory.</P
160 ><P
161 >Example:</P
162 ><P
163 ><PRE
164 CLASS="screen"
165 >env = Environment()
166 hello = File('hello.py')
167 env.InstallPython('/usr/local/bin/', hello)
168 env.Alias('install', '/usr/local/bin/')
169 </PRE
170 ></P
171 ></DIV
172 ></DIV
173 ><DIV
174 CLASS="section"
175 ><HR><H2
176 CLASS="section"
177 ><A
178 NAME="AEN33"
179 >3. Variables</A
180 ></H2
181 ><P
182 ><P
183 ></P
184 ><DIV
185 CLASS="variablelist"
186 ><DL
187 ><DT
188 >CPYTHON_PYC</DT
189 ><DD
190 ><P
191 >Default value is <TT
192 CLASS="literal"
193 >1</TT
194 >, which means that the
195 Python source files get compiled to <TT
196 CLASS="literal"
197 >.pyc</TT
198 > files.
199 Set this variable to <TT
200 CLASS="literal"
201 >0</TT
202 > in order to get
203 optimized <TT
204 CLASS="literal"
205 >.pyo</TT
206 > files, parallel to your
207 installed sources.</P
208 ></DD
209 ><DT
210 >CPYTHON_EXE</DT
211 ><DD
212 ><P
213 >The path to the external Python executable, used for
214 creating optimized <TT
215 CLASS="literal"
216 >.pyo</TT
217 > files. Default value is
218 '<TT
219 CLASS="literal"
220 >python</TT
221 >'.</P
222 ></DD
223 ><DT
224 >CPYTHON_PYO_FLAGS</DT
225 ><DD
226 ><P
227 >Additional flags for compiling optimized Python files
228 (<TT
229 CLASS="literal"
230 >.pyo</TT
231 >). The default is
232 '<TT
233 CLASS="literal"
234 >-O</TT
235 >'.</P
236 ></DD
237 ><DT
238 >CPYTHON_PYO_CMD</DT
239 ><DD
240 ><P
241 >The command arguments for compiling optimized Python files
242 (<TT
243 CLASS="literal"
244 >.pyo</TT
245 >). The default value is '<TT
246 CLASS="literal"
247 >-c
248 'import sys,py_compile; [py_compile.compile(i) for i in
249 sys.argv[1:]]'</TT
250 >'.</P
251 ></DD
252 ><DT
253 >CPYTHON_PYCOM</DT
254 ><DD
255 ><P
256 >The command line for compiling optimized Python files
257 (<TT
258 CLASS="literal"
259 >.pyo</TT
260 >). Default is '<TT
261 CLASS="literal"
262 >$CPYTHON_EXE
263 $CPYTHON_PYO_FLAGS $CPYTHON_PYO_CMD</TT
264 >'.</P
265 ></DD
266 ><DT
267 >CPYTHON_PYCOMSTR</DT
268 ><DD
269 ><P
270 >The message string for the
271 '<TT
272 CLASS="literal"
273 >CPYTHON_PYCOM</TT
274 >' command. Default is
275 '<TT
276 CLASS="literal"
277 >Install file: "$SOURCE" as "$TARGET"</TT
278 >'.</P
279 ></DD
280 ><DT
281 >CPYTHON_SUFFIX</DT
282 ><DD
283 ><P
284 >Default value is '.py'. The suffix for Python source
285 files.</P
286 ></DD
287 ></DL
288 ></DIV
289 ></P
290 ></DIV
291 ></DIV
292 ></BODY
293 ></HTML
294 >