summaryrefslogtreecommitdiff
path: root/doc/SConscript
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-02-15 13:55:44 +0000
committerSteven Knight <knight@baldmt.com>2005-02-15 13:55:44 +0000
commitd809676c50c89f74f3210d4faf61c3f66a600777 (patch)
tree18a308eb5aa145b95de56c05aca90a609c3eaaf6 /doc/SConscript
parentf995934a8dca09977039d3a9bdb263805c1282b6 (diff)
downloadscons-d809676c50c89f74f3210d4faf61c3f66a600777.tar.gz
Accumulated documentation changes.
Diffstat (limited to 'doc/SConscript')
-rw-r--r--doc/SConscript126
1 files changed, 92 insertions, 34 deletions
diff --git a/doc/SConscript b/doc/SConscript
index 0dd41d1e..008f2058 100644
--- a/doc/SConscript
+++ b/doc/SConscript
@@ -31,6 +31,10 @@ import string
Import('env', 'whereis')
+env = env.Copy()
+
+env.TargetSignatures('content')
+
build = os.path.join('#build', 'doc')
#
@@ -97,8 +101,28 @@ def scansgml(node, env, target):
return includes
s = Scanner(name = 'sgml', function = scansgml, skeys = ['.sgml', '.mod'])
+
orig_env = env
-env = orig_env.Copy(SCANNERS = [s])
+env = orig_env.Copy(SCANNERS = [s],
+ SCONS_PROC_PY = File('#bin/scons-proc.py').rfile(),
+ SCONSOUTPUT_PY = File('#bin/sconsoutput.py').rfile())
+
+# Fetch the list of files in the build engine that contain
+# SCons documentation XML for processing.
+def chop(s): return s[:-1]
+
+# If we ever read doc from __scons_doc__ strings in *.py files again,
+# here's how it's done:
+#manifest_in = File('#src/engine/MANIFEST.in').rstr()
+#manifest_xml_in = File('#src/engine/MANIFEST-xml.in').rstr()
+#scons_doc_files = map(chop, open(manifest_in).readlines() +\
+# open(manifest_xml_in).readlines())
+#scons_doc_files = map(lambda x: '#src/engine/'+x, scons_doc_files)
+#manifest_in = File('#src/engine/MANIFEST.in').rstr()
+
+manifest_xml_in = File('#src/engine/MANIFEST-xml.in').rstr()
+scons_doc_files = map(chop, open(manifest_xml_in).readlines())
+scons_doc_files = map(lambda x: File('#src/engine/'+x).rstr(), scons_doc_files)
if jw:
#
@@ -127,6 +151,20 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY buildrevision "%s">
""" % (date, ver, rev))
+ builders_gen = os.path.join(build, 'user', 'builders.gen')
+ builders_mod = os.path.join(build, 'user', 'builders.mod')
+ tools_gen = os.path.join(build, 'user', 'tools.gen')
+ tools_mod = os.path.join(build, 'user', 'tools.mod')
+ variables_gen = os.path.join(build, 'user', 'variables.gen')
+ variables_mod = os.path.join(build, 'user', 'variables.mod')
+
+ b = env.Command([builders_gen, builders_mod,
+ tools_gen, tools_mod,
+ variables_gen, variables_mod],
+ scons_doc_files,
+ "python $SCONS_PROC_PY -b ${TARGETS[0]},${TARGETS[1]} -t ${TARGETS[2]},${TARGETS[3]} -v ${TARGETS[4]},${TARGETS[5]} $SOURCES")
+ env.Depends(b, "$SCONS_PROC_PY")
+
#
# Each document will live in its own subdirectory. List them here
# as hash keys, with a hash of the info to control its build.
@@ -138,21 +176,24 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
'pdf' : 1,
'text' : 0,
},
- 'python10' : {
- 'htmlindex' : 't1.html',
- 'html' : 1,
- 'ps' : 1,
- 'pdf' : 0,
- 'text' : 0,
- 'graphics' : [
- 'arch.fig',
- 'builder.fig',
- 'job-task.fig',
- 'node.fig',
- 'scanner.fig',
- 'sig.fig'
- ],
- },
+ # This doesn't build on all systems, and the document is old
+ # enough that there's reallyno need to build it every time any
+ # more, so just comment it out for now.
+ #'python10' : {
+ # 'htmlindex' : 't1.html',
+ # 'html' : 1,
+ # 'ps' : 1,
+ # 'pdf' : 0,
+ # 'text' : 0,
+ # 'graphics' : [
+ # 'arch.fig',
+ # 'builder.fig',
+ # 'job-task.fig',
+ # 'node.fig',
+ # 'scanner.fig',
+ # 'sig.fig'
+ # ],
+ #},
'reference' : {
'htmlindex' : 'book1.html',
'html' : 1,
@@ -172,6 +213,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
'SCons-win32-install-3.jpg',
'SCons-win32-install-4.jpg',
],
+ 'sconsoutput' : 1,
},
}
@@ -197,14 +239,20 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
manifest = File(os.path.join(doc, 'MANIFEST')).rstr()
src_files = map(lambda x: x[:-1],
open(manifest).readlines())
+ build_doc = docs[doc].get('sconsoutput') and int(ARGUMENTS.get('BUILDDOC', 0))
for s in src_files:
- base, ext = os.path.splitext(s)
+ doc_s = os.path.join(doc, s)
+ build_s = os.path.join(build, doc, s)
+ base, ext = os.path.splitext(doc_s)
if ext in ['.fig', '.jpg']:
- orig_env.Install(os.path.join(build, doc), os.path.join(doc, s))
+ orig_env.InstallAs(build_s, doc_s)
else:
- orig_env.SCons_revision(os.path.join(build, doc, s),
- os.path.join(doc, s))
- Local(os.path.join(build, doc, s))
+ if build_doc and ext == '.sgml':
+ env.Command(doc_s,
+ base + '.in',
+ "python $SCONSOUTPUT_PY $SOURCE > $TARGET")
+ orig_env.SCons_revision(build_s, doc_s)
+ Local(build_s)
main = os.path.join(build, doc, 'main.sgml')
out = 'main.out'
@@ -247,13 +295,18 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
tar_list.extend([html, htmldir])
for g in docs[doc].get('graphics', []):
- if g[-4:] == '.fig' and fig2dev:
- fig = os.path.join(build, doc, g)
- jpg = os.path.join(htmldir, g[:-4] + '.jpg')
- env.Command(jpg, fig,
- "%s -L jpeg -q 100 $SOURCES $TARGET" % fig2dev)
- env.Depends(html, jpg)
- Local(jpg)
+ base, ext = os.path.splitext(g)
+ if ext == '.fig':
+ jpg = base + '.jpg'
+ htmldir_jpg = os.path.join(htmldir, jpg)
+ if fig2dev:
+ fig = os.path.join(build, doc, g)
+ env.Command(htmldir_jpg, fig,
+ "%s -L jpeg -q 100 $SOURCES $TARGET" % fig2dev)
+ else:
+ env.InstallAs(htmldir_jpg, jpg)
+ env.Depends(html, htmldir_jpg)
+ Local(htmldir_jpg)
else:
src = os.path.join(build, doc, g)
Local(env.Install(htmldir, src))
@@ -273,12 +326,17 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
tar_list.append(ps)
for g in docs[doc].get('graphics', []):
- if g[-4:] == '.fig' and fig2dev:
- fig = os.path.join(build, doc, g)
- eps = os.path.join(build, 'PS', g[:-4] + '.eps')
- env.Command(eps, fig, "%s -L eps $SOURCES $TARGET" % fig2dev)
- env.Depends(ps, eps)
- Local(eps)
+ base, ext = os.path.splitext(g)
+ if ext == '.fig':
+ eps = base + '.eps'
+ build_eps = os.path.join(build, 'PS', eps)
+ if fig2dev:
+ fig = os.path.join(build, doc, g)
+ env.Command(build_eps, fig, "%s -L eps $SOURCES $TARGET" % fig2dev)
+ else:
+ env.InstallAs(build_eps, eps)
+ env.Depends(ps, build_eps)
+ Local(build_eps)
else:
src = os.path.join(build, doc, g)
Local(env.Install(htmldir, src))