scons-src-3.0.0/0000775000175000017500000000000013160023050013452 5ustar bdbaddogbdbaddogscons-src-3.0.0/bin/0000775000175000017500000000000013160023037014227 5ustar bdbaddogbdbaddogscons-src-3.0.0/bin/timebuild0000664000175000017500000000316013160023037016130 0ustar bdbaddogbdbaddog#!/bin/sh # # Profile running SCons to build itself from the current package. # # This runs "aegis -build" to build a current scons-src-*.tar.gz # package, unpacks it in the supplied directory name, and then # starts a profiled run of an SCons build, followed by another. # This results in two profiles: # # NAME/NAME-0.prof # profile of a build-everything run # # NAME/NAME-1.prof # profile of an all-up-to-date run # # This also copies the build scons-src-*.tar.gz file to the NAME # subdirectory, and tars up everything under src/ as NAME/src.tar.gz, # so that repeated runs with different in-progress changes can serve # as their own crude version control, so you don't lose that exact # combination of features which performed best. if test X$1 = X; then echo "Must supply name!" >&2 exit 1 fi VERSION=0.90 DIR=$1 SRC="scons-src-$VERSION" SRC_TAR_GZ="${SRC}.tar.gz" B_D_SRC_TAR_GZ="build/dist/${SRC_TAR_GZ}" echo "Building ${B_D_SRC_TAR_GZ}: " `date` aegis -build ${B_D_SRC_TAR_GZ} echo "mkdir ${DIR}: " `date` mkdir ${DIR} echo "cp ${B_D_SRC_TAR_GZ} ${DIR}: " `date` cp ${B_D_SRC_TAR_GZ} ${DIR} echo "tar cf ${DIR}/src.tar.gz: " `date` tar cf ${DIR}/src.tar.gz src cd ${DIR} echo "tar zxf ${SRC_TAR_GZ}: " `date` tar zxf ${SRC_TAR_GZ} cd ${SRC} SCRIPT="src/script/scons.py" ARGS="version=$VERSION" export SCONS_LIB_DIR=`pwd`/src/engine echo "Build run starting: " `date` python $SCRIPT --profile=../$DIR-0.prof $ARGS > ../$DIR-0.log 2>&1 echo "Up-to-date run starting: " `date` python $SCRIPT --profile=../$DIR-1.prof $ARGS > ../$DIR-1.log 2>&1 echo "Finished $DIR at: " `date` scons-src-3.0.0/bin/xml_export0000664000175000017500000002071013160023037016353 0ustar bdbaddogbdbaddog#!/usr/bin/perl -w # # xml_export - Retrieve data from the SF.net XML export for project data # # Copyright (C) 2002 Open Source Development Network, Inc. ("OSDN") # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the license details found # below in the section marked "$LICENSE_TEXT". # # SCons: modified the following RCS Id line so it won't expand during # our checkins. # # $_Id: adocman,v 1.51 2002/06/07 18:56:35 moorman Exp _$ # # Written by Nate Oostendorp # and Jacob Moorman ########################################################################### use strict; use Alexandria::Client; use HTTP::Request::Common; my $client = new Alexandria::Client; util_verifyvariables("groupid"); my $res = $ua->simple_request(GET "$config{hosturl}/export/xml_export.php?group_id=$config{groupid}"); if (not $res->is_success()) { die "Failed to connect: ".$res->as_string(); } print $res->content; ########################################################################### __END__ =head1 NAME xml_export - Retrieve data for a project via the SF.net XML export facility =head1 DESCRIPTION B provides a simple mechanism to download data from the XML data export facility on SourceForge.net. This utility is needed (in place of a downloader like wget or curl) since authentication by a project administrator is required to access the XML export facility. =head1 SYNOPSIS xml_export [options] > output_file OPTIONS --login Login to the SourceForge.net site --logout Logout of the SourceForge.net site --groupid=GROUPID Group ID of the project whose data you wish to export =head1 ERROR LEVELS The following error levels are returned upon exit of this program: 0 success 1 failure: general (requested DocManager operation failed) 2 failure: authentication failure 3 failure: must --login before performing this operation 4 failure: bad command-line option specified or variable setting problem 5 failure: error in accessing/creating a file or directory 6 failure: failed to enter requested input before timeout expired =head1 AUTHORITATIVE SOURCE The original version of B may be found in the materials provided from the SourceForge.net Site Documentation project (sitedocs) on the SourceForge.net site. The latest version of this program may be found in the CVS repository for the sitedocs project on SourceForge.net. The sitedocs project pages may be accessed at: http://sourceforge.net/projects/sitedocs =head1 SECURITY For security-related information for this application, please review the documentation provided for the adocman utility. =head1 EXAMPLES The following are examples for using this program to export project data via the XML data export facility on SourceForge.net. It is presumed that you have a valid SourceForge.net user account, which is listed as a project administrator on the project in question. This tool will only work for project administrators. The group ID for the project may be derived from the URL for the Admin page for the project, or by viewing the Project Admin page for the project (look for the text "Your Group ID is: xxxxxx"). To login to the SourceForge.net site via the command-line: adocman --username=myusername --password=mypassword --login \ --groupid=8675309 To login to the SourceForge.net site, and be prompted to enter your password interactively: adocman --username=myusername --interactive --login --groupid=8675309 To perform an export (after logging-in): xml_export --groupid=8675309 > output.xml To logout of SourceForge.net: adocman --logout Additional capabilities (including the use of configuration files to specify information that would otherwise be provided interactively or on the command-line) are detailed in the documentation provided for the adocman utility. To obtain output for debugging a problem, perform the same command as originally tested, but first add the --verbose flag, and determine whether you are able to solve the issue on your own. If the problem persists, see the "SUPPORT AND BUGS" section, below. =head1 SUPPORT AND BUGS This program was written by a member of the SourceForge.net staff team. This software has been released under an Open Source license, for the greater benefit of the SourceForge.net developer community. The SourceForge.net Site Documentation project is the caretaker of this software. Issues related to the use of this program, or bugs found in using this program, may be reported to the SourceForge.net Site Documentation project using their Support Request Tracker at: https://sourceforge.net/tracker/?func=add&group_id=52614&atid=467457 Any support that is provided for this program is provided as to further enhance the stability and functionality of this program for SourceForge.net users. The SourceForge.net Site Documentation project makes use of this software for its own internal purposes, in managing the Site Documentation collection for the SourceForge.net site. =head1 AUTHOR Nathan Oostendorp and Jacob Moorman =head1 PREREQUISITES C, C, C, C, C These prerequisites may be installed in an interactive, but automated fashion through the use of perl's CPAN module, invoked as: perl -MCPAN -e shell; =head1 LICENSE Copyright (c) 2002 Open Source Development Network, Inc. ("OSDN") Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 2. Neither the names of VA Software Corporation, OSDN, SourceForge.net, the SourceForge.net Site Documentation project, nor the names of its contributors may be used to endorse or promote products derived from the Software without specific prior written permission of OSDN. 3. The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the Software without specific, written prior permission. Title to copyright in the Software and any associated documentation will at all times remain with copyright holders. 4. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. We recommend that you provide URLs to the location from which the code is derived. 5. Altered versions of the Software must be plainly marked as such, and must not be misrepresented as being the original Software. 6. The origin of the Software must not be misrepresented; you must not claim that you wrote the original Software. If you use the Software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 7. The data files supplied as input to, or produced as output from, the programs of the Software do not automatically fall under the copyright of the Software, but belong to whomever generated them, and may be sold commercially, and may be aggregated with the Software. 8. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE OR DOCUMENTATION. This Software consists of contributions made by OSDN and many individuals on behalf of OSDN. Specific attributions are listed in the accompanying credits file. =head1 HISTORY B<2002-12-03> Completed version 0.10 - move to classes, added POD =cut scons-src-3.0.0/bin/xmlagenda.py0000775000175000017500000000722513160023037016552 0ustar bdbaddogbdbaddog#!/usr/bin/env python # Query the scons.tigris.org database for the issues of interest. # The typical triage query is found on http://www.scons.org/wiki/BugParty # Download the issues from Issuezilla as XML; this creates a file # named 'issues.xml'. Run this script in the dir containing # issues.xml (or pass full path as arg to this script) to translate # 'issues.xml' into a CSV file named 'editlist.csv'. Upload the CSV # into a Google spreadsheet. # In the spreadsheet: # Select all the columns and pick "align-->top" # Select the ID and votes columns and pick "align-->right" # Select the priority column and pick "align-->center" # Select the first row and click on the "bold" button # Grab the lines between the column headers to adjust the column widths # Grab the sort bar on the far left (just above the "1" for row one) # and move it down one row. (Row one becomes a floating header) # Voila! from __future__ import print_function # The team members # FIXME: These names really should be external to this script team = sorted('Steven Gary Greg Ken Jim Bill Jason Dirk Anatoly'.split()) # The elements to be picked out of the issue PickList = [ # sort key -- these are used to sort the entry 'target_milestone', 'priority', 'votes_desc', 'creation_ts', # payload -- these are displayed 'issue_id', 'votes', 'issue_type', 'target_milestone', 'priority', 'assigned_to', 'short_desc', ] # Conbert a leaf element into its value as a text string # We assume it's "short enough" that there's only one substring def Value(element): v = element.firstChild if v is None: return '' return v.nodeValue # Parse the XML issues file and produce a DOM for it import sys if len(sys.argv) > 1: xml = sys.argv[1] else: xml = 'issues.xml' from xml.dom.minidom import parse xml = parse(xml) # Go through the issues in the DOM, pick out the elements we want, # and put them in our list of issues. issues = [] for issuezilla in xml.childNodes: # The Issuezilla element contains the issues if issuezilla.nodeType != issuezilla.ELEMENT_NODE: continue for issue in issuezilla.childNodes: # The issue elements contain the info for an issue if issue.nodeType != issue.ELEMENT_NODE: continue # Accumulate the pieces we want to include d = {} for element in issue.childNodes: if element.nodeName in PickList: d[element.nodeName] = Value(element) # convert 'votes' to numeric, ascending and descending try: v = int('0' + d['votes']) except KeyError: pass else: d['votes_desc'] = -v d['votes'] = v # Marshal the elements and add them to the list issues.append([ d[ix] for ix in PickList ]) issues.sort() # Transcribe the issues into comma-separated values. # FIXME: parameterize the output file name import csv writer = csv.writer(open('editlist.csv', 'w')) # header writer.writerow(['ID', 'Votes', 'Type/Member', 'Milestone', 'Pri', 'Owner', 'Summary/Comments']) for issue in issues: row = issue[4:] # strip off sort key #row[0] = """=hyperlink("http://scons.tigris.org/issues/show_bug.cgi?id=%s","%s")""" % (row[0],row[0]) if row[3] == '-unspecified-': row[3] = 'triage' writer.writerow(['','','','','','','']) writer.writerow(row) writer.writerow(['','','consensus','','','','']) writer.writerow(['','','','','','','']) for member in team: writer.writerow(['','',member,'','','','']) print("Exported %d issues to editlist.csv. Ready to upload to Google."%len(issues)) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/objcounts.py0000664000175000017500000000577013160023037016620 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2005 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function import re import sys filenames = sys.argv[1:] if len(sys.argv) != 3: print("""Usage: objcounts.py file1 file2 Compare the --debug=object counts from two build logs. """) sys.exit(0) def fetch_counts(fname): contents = open(fname).read() m = re.search('\nObject counts:(\n\s[^\n]*)*', contents, re.S) lines = m.group().split('\n') list = [l.split() for l in lines if re.match('\s+\d', l)] d = {} for l in list: d[l[-1]] = list(map(int, l[:-1])) return d c1 = fetch_counts(sys.argv[1]) c2 = fetch_counts(sys.argv[2]) common = {} for k in list(c1.keys()): try: common[k] = (c1[k], c2[k]) except KeyError: # Transition: we added the module to the names of a bunch of # the logged objects. Assume that c1 might be from an older log # without the modules in the names, and look for an equivalent # in c2. if not '.' in k: s = '.'+k l = len(s) for k2 in list(c2.keys()): if k2[-l:] == s: common[k2] = (c1[k], c2[k2]) del c1[k] del c2[k2] break else: del c1[k] del c2[k] def diffstr(c1, c2): try: d = c2 - c1 except TypeError: d = '' else: if d: d = '[%+d]' % d else: d = '' return " %5s/%-5s %-8s" % (c1, c2, d) def printline(c1, c2, classname): print(diffstr(c1[2], c2[2]) + \ diffstr(c1[3], c2[3]) + \ ' ' + classname) for k in sorted(common.keys()): c = common[k] printline(c[0], c[1], k) for k in sorted(list(c1.keys())): printline(c1[k], ['--']*4, k) for k in sorted(list(c2.keys())): printline(['--']*4, c2[k], k) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/SConsDoc.py0000664000175000017500000006624513160023037016271 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # # Module for handling SCons documentation processing. # from __future__ import print_function __doc__ = """ This module parses home-brew XML files that document various things in SCons. Right now, it handles Builders, functions, construction variables, and Tools, but we expect it to get extended in the future. In general, you can use any DocBook tag in the input, and this module just adds processing various home-brew tags to try to make life a little easier. Builder example: This is the summary description of an SCons Builder. It will get placed in the man page, and in the appropriate User's Guide appendix. The name of any builder may be interpolated anywhere in the document by specifying the &b-BUILDER; element. It need not be on a line by itself. Unlike normal XML, blank lines are significant in these descriptions and serve to separate paragraphs. They'll get replaced in DocBook output with appropriate tags to indicate a new paragraph. print("this is example code, it will be offset and indented") Function example: (arg1, arg2, key=value) This is the summary description of an SCons function. It will get placed in the man page, and in the appropriate User's Guide appendix. The name of any builder may be interpolated anywhere in the document by specifying the &f-FUNCTION; element. It need not be on a line by itself. print("this is example code, it will be offset and indented") Construction variable example: This is the summary description of a construction variable. It will get placed in the man page, and in the appropriate User's Guide appendix. The name of any construction variable may be interpolated anywhere in the document by specifying the &t-VARIABLE; element. It need not be on a line by itself. print("this is example code, it will be offset and indented") Tool example: This is the summary description of an SCons Tool. It will get placed in the man page, and in the appropriate User's Guide appendix. The name of any tool may be interpolated anywhere in the document by specifying the &t-TOOL; element. It need not be on a line by itself. print("this is example code, it will be offset and indented") """ import imp import os.path import re import sys import copy # Do we have libxml2/libxslt/lxml? has_libxml2 = True try: import libxml2 import libxslt except: has_libxml2 = False try: import lxml except: raise ImportError("Failed to import either libxml2/libxslt or lxml") has_etree = False if not has_libxml2: try: from lxml import etree has_etree = True except ImportError: pass if not has_etree: try: # Python 2.5 import xml.etree.cElementTree as etree except ImportError: try: # Python 2.5 import xml.etree.ElementTree as etree except ImportError: try: # normal cElementTree install import cElementTree as etree except ImportError: try: # normal ElementTree install import elementtree.ElementTree as etree except ImportError: raise ImportError("Failed to import ElementTree from any known place") re_entity = re.compile("\&([^;]+);") re_entity_header = re.compile("") # Namespace for the SCons Docbook XSD dbxsd="http://www.scons.org/dbxsd/v1.0" # Namespace map identifier for the SCons Docbook XSD dbxid="dbx" # Namespace for schema instances xsi = "http://www.w3.org/2001/XMLSchema-instance" # Header comment with copyright copyright_comment = """ Copyright (c) 2001 - 2017 The SCons Foundation This file is processed by the bin/SConsDoc.py module. See its __doc__ string for a discussion of the format. """ def isSConsXml(fpath): """ Check whether the given file is a SCons XML file, i.e. it contains the default target namespace definition. """ try: f = open(fpath,'r') content = f.read() f.close() if content.find('xmlns="%s"' % dbxsd) >= 0: return True except: pass return False def remove_entities(content): # Cut out entity inclusions content = re_entity_header.sub("", content, re.M) # Cut out entities themselves content = re_entity.sub(lambda match: match.group(1), content) return content default_xsd = os.path.join('doc','xsd','scons.xsd') ARG = "dbscons" class Libxml2ValidityHandler: def __init__(self): self.errors = [] self.warnings = [] def error(self, msg, data): if data != ARG: raise Exception("Error handler did not receive correct argument") self.errors.append(msg) def warning(self, msg, data): if data != ARG: raise Exception("Warning handler did not receive correct argument") self.warnings.append(msg) class DoctypeEntity: def __init__(self, name_, uri_): self.name = name_ self.uri = uri_ def getEntityString(self): txt = """ %(perc)s%(name)s; """ % {'perc' : perc, 'name' : self.name, 'uri' : self.uri} return txt class DoctypeDeclaration: def __init__(self, name_=None): self.name = name_ self.entries = [] if self.name is None: # Add default entries self.name = "sconsdoc" self.addEntity("scons", "../scons.mod") self.addEntity("builders-mod", "builders.mod") self.addEntity("functions-mod", "functions.mod") self.addEntity("tools-mod", "tools.mod") self.addEntity("variables-mod", "variables.mod") def addEntity(self, name, uri): self.entries.append(DoctypeEntity(name, uri)) def createDoctype(self): content = '\n' return content if not has_libxml2: class TreeFactory: def __init__(self): pass def newNode(self, tag): return etree.Element(tag) def newEtreeNode(self, tag, init_ns=False): if init_ns: NSMAP = {None: dbxsd, 'xsi' : xsi} return etree.Element(tag, nsmap=NSMAP) return etree.Element(tag) def copyNode(self, node): return copy.deepcopy(node) def appendNode(self, parent, child): parent.append(child) def hasAttribute(self, node, att): return att in node.attrib def getAttribute(self, node, att): return node.attrib[att] def setAttribute(self, node, att, value): node.attrib[att] = value def getText(self, root): return root.text def setText(self, root, txt): root.text = txt def writeGenTree(self, root, fp): dt = DoctypeDeclaration() fp.write(etree.tostring(root, xml_declaration=True, encoding="UTF-8", pretty_print=True, doctype=dt.createDoctype())) def writeTree(self, root, fpath): fp = open(fpath, 'w') fp.write(etree.tostring(root, xml_declaration=True, encoding="UTF-8", pretty_print=True)) fp.close() def prettyPrintFile(self, fpath): fin = open(fpath,'r') tree = etree.parse(fin) pretty_content = etree.tostring(tree, pretty_print=True) fin.close() fout = open(fpath,'w') fout.write(pretty_content) fout.close() def decorateWithHeader(self, root): root.attrib["{"+xsi+"}schemaLocation"] = "%s %s/scons.xsd" % (dbxsd, dbxsd) return root def newXmlTree(self, root): """ Return a XML file tree with the correct namespaces set, the element root as top entry and the given header comment. """ NSMAP = {None: dbxsd, 'xsi' : xsi} t = etree.Element(root, nsmap=NSMAP) return self.decorateWithHeader(t) def validateXml(self, fpath, xmlschema_context): # Use lxml xmlschema = etree.XMLSchema(xmlschema_context) try: doc = etree.parse(fpath) except Exception as e: print("ERROR: %s fails to parse:"%fpath) print(e) return False doc.xinclude() try: xmlschema.assertValid(doc) except Exception as e: print("ERROR: %s fails to validate:" % fpath) print(e) return False return True def findAll(self, root, tag, ns=None, xp_ctxt=None, nsmap=None): expression = ".//{%s}%s" % (nsmap[ns], tag) if not ns or not nsmap: expression = ".//%s" % tag return root.findall(expression) def findAllChildrenOf(self, root, tag, ns=None, xp_ctxt=None, nsmap=None): expression = "./{%s}%s/*" % (nsmap[ns], tag) if not ns or not nsmap: expression = "./%s/*" % tag return root.findall(expression) def convertElementTree(self, root): """ Convert the given tree of etree.Element entries to a list of tree nodes for the current XML toolkit. """ return [root] else: class TreeFactory: def __init__(self): pass def newNode(self, tag): return libxml2.newNode(tag) def newEtreeNode(self, tag, init_ns=False): return etree.Element(tag) def copyNode(self, node): return node.copyNode(1) def appendNode(self, parent, child): if hasattr(parent, 'addChild'): parent.addChild(child) else: parent.append(child) def hasAttribute(self, node, att): if hasattr(node, 'hasProp'): return node.hasProp(att) return att in node.attrib def getAttribute(self, node, att): if hasattr(node, 'prop'): return node.prop(att) return node.attrib[att] def setAttribute(self, node, att, value): if hasattr(node, 'setProp'): node.setProp(att, value) else: node.attrib[att] = value def getText(self, root): if hasattr(root, 'getContent'): return root.getContent() return root.text def setText(self, root, txt): if hasattr(root, 'setContent'): root.setContent(txt) else: root.text = txt def writeGenTree(self, root, fp): doc = libxml2.newDoc('1.0') dtd = doc.newDtd("sconsdoc", None, None) doc.addChild(dtd) doc.setRootElement(root) content = doc.serialize("UTF-8", 1) dt = DoctypeDeclaration() # This is clearly a hack, but unfortunately libxml2 # doesn't support writing PERs (Parsed Entity References). # So, we simply replace the empty doctype with the # text we need... content = content.replace("", dt.createDoctype()) fp.write(content) doc.freeDoc() def writeTree(self, root, fpath): fp = open(fpath, 'w') doc = libxml2.newDoc('1.0') doc.setRootElement(root) fp.write(doc.serialize("UTF-8", 1)) doc.freeDoc() fp.close() def prettyPrintFile(self, fpath): # Read file and resolve entities doc = libxml2.readFile(fpath, None, libxml2d.XML_PARSE_NOENT) fp = open(fpath, 'w') # Prettyprint fp.write(doc.serialize("UTF-8", 1)) fp.close() # Cleanup doc.freeDoc() def decorateWithHeader(self, root): # Register the namespaces ns = root.newNs(dbxsd, None) xi = root.newNs(xsi, 'xsi') root.setNs(ns) #put this node in the target namespace root.setNsProp(xi, 'schemaLocation', "%s %s/scons.xsd" % (dbxsd, dbxsd)) return root def newXmlTree(self, root): """ Return a XML file tree with the correct namespaces set, the element root as top entry and the given header comment. """ t = libxml2.newNode(root) return self.decorateWithHeader(t) def validateXml(self, fpath, xmlschema_context): # Create validation context validation_context = xmlschema_context.schemaNewValidCtxt() # Set error/warning handlers eh = Libxml2ValidityHandler() validation_context.setValidityErrorHandler(eh.error, eh.warning, ARG) # Read file and resolve entities doc = libxml2.readFile(fpath, None, libxml2.XML_PARSE_NOENT) doc.xincludeProcessFlags(libxml2.XML_PARSE_NOENT) err = validation_context.schemaValidateDoc(doc) # Cleanup doc.freeDoc() del validation_context if err or eh.errors: for e in eh.errors: print(e.rstrip("\n")) print("%s fails to validate" % fpath) return False return True def findAll(self, root, tag, ns=None, xpath_context=None, nsmap=None): if hasattr(root, 'xpathEval') and xpath_context: # Use the xpath context xpath_context.setContextNode(root) expression = ".//%s" % tag if ns: expression = ".//%s:%s" % (ns, tag) return xpath_context.xpathEval(expression) else: expression = ".//{%s}%s" % (nsmap[ns], tag) if not ns or not nsmap: expression = ".//%s" % tag return root.findall(expression) def findAllChildrenOf(self, root, tag, ns=None, xpath_context=None, nsmap=None): if hasattr(root, 'xpathEval') and xpath_context: # Use the xpath context xpath_context.setContextNode(root) expression = "./%s/node()" % tag if ns: expression = "./%s:%s/node()" % (ns, tag) return xpath_context.xpathEval(expression) else: expression = "./{%s}%s/node()" % (nsmap[ns], tag) if not ns or not nsmap: expression = "./%s/node()" % tag return root.findall(expression) def expandChildElements(self, child): """ Helper function for convertElementTree, converts a single child recursively. """ nchild = self.newNode(child.tag) # Copy attributes for key, val in child.attrib: self.setAttribute(nchild, key, val) elements = [] # Add text if child.text: t = libxml2.newText(child.text) self.appendNode(nchild, t) # Add children for c in child: for n in self.expandChildElements(c): self.appendNode(nchild, n) elements.append(nchild) # Add tail if child.tail: tail = libxml2.newText(child.tail) elements.append(tail) return elements def convertElementTree(self, root): """ Convert the given tree of etree.Element entries to a list of tree nodes for the current XML toolkit. """ nroot = self.newNode(root.tag) # Copy attributes for key, val in root.attrib: self.setAttribute(nroot, key, val) elements = [] # Add text if root.text: t = libxml2.newText(root.text) self.appendNode(nroot, t) # Add children for c in root: for n in self.expandChildElements(c): self.appendNode(nroot, n) elements.append(nroot) # Add tail if root.tail: tail = libxml2.newText(root.tail) elements.append(tail) return elements tf = TreeFactory() class SConsDocTree: def __init__(self): self.nsmap = {'dbx' : dbxsd} self.doc = None self.root = None self.xpath_context = None def parseContent(self, content, include_entities=True): """ Parses the given content as XML file. This method is used when we generate the basic lists of entities for the builders, tools and functions. So we usually don't bother about namespaces and resolving entities here...this is handled in parseXmlFile below (step 2 of the overall process). """ if not include_entities: content = remove_entities(content) # Create domtree from given content string self.root = etree.fromstring(content) def parseXmlFile(self, fpath): nsmap = {'dbx' : dbxsd} if not has_libxml2: # Create domtree from file domtree = etree.parse(fpath) self.root = domtree.getroot() else: # Read file and resolve entities self.doc = libxml2.readFile(fpath, None, libxml2.XML_PARSE_NOENT) self.root = self.doc.getRootElement() # Create xpath context self.xpath_context = self.doc.xpathNewContext() # Register namespaces for key, val in self.nsmap.items(): self.xpath_context.xpathRegisterNs(key, val) def __del__(self): if self.doc is not None: self.doc.freeDoc() if self.xpath_context is not None: self.xpath_context.xpathFreeContext() perc="%" def validate_all_xml(dpaths, xsdfile=default_xsd): xmlschema_context = None if not has_libxml2: # Use lxml xmlschema_context = etree.parse(xsdfile) else: # Use libxml2 and prepare the schema validation context ctxt = libxml2.schemaNewParserCtxt(xsdfile) xmlschema_context = ctxt.schemaParse() del ctxt fpaths = [] for dp in dpaths: if dp.endswith('.xml') and isSConsXml(dp): path='.' fpaths.append(dp) else: for path, dirs, files in os.walk(dp): for f in files: if f.endswith('.xml'): fp = os.path.join(path, f) if isSConsXml(fp): fpaths.append(fp) fails = [] for idx, fp in enumerate(fpaths): fpath = os.path.join(path, fp) print("%.2f%s (%d/%d) %s" % (float(idx+1)*100.0/float(len(fpaths)), perc, idx+1, len(fpaths),fp)) if not tf.validateXml(fp, xmlschema_context): fails.append(fp) continue if has_libxml2: # Cleanup del xmlschema_context if fails: return False return True class Item(object): def __init__(self, name): self.name = name self.sort_name = name.lower() if self.sort_name[0] == '_': self.sort_name = self.sort_name[1:] self.sets = [] self.uses = [] self.summary = None self.arguments = None def cmp_name(self, name): if name[0] == '_': name = name[1:] return name.lower() def __eq__(self, other): return self.sort_name == other.sort_name def __lt__(self, other): return self.sort_name < other.sort_name class Builder(Item): pass class Function(Item): def __init__(self, name): super(Function, self).__init__(name) class Tool(Item): def __init__(self, name): Item.__init__(self, name) self.entity = self.name.replace('+', 'X') class ConstructionVariable(Item): pass class Arguments(object): def __init__(self, signature, body=None): if not body: body = [] self.body = body self.signature = signature def __str__(self): s = ''.join(self.body).strip() result = [] for m in re.findall('([a-zA-Z/_]+|[^a-zA-Z/_]+)', s): if ' ' in m: m = '"%s"' % m result.append(m) return ' '.join(result) def append(self, data): self.body.append(data) class SConsDocHandler(object): def __init__(self): self.builders = {} self.functions = {} self.tools = {} self.cvars = {} def parseItems(self, domelem, xpath_context, nsmap): items = [] for i in tf.findAll(domelem, "item", dbxid, xpath_context, nsmap): txt = tf.getText(i) if txt is not None: txt = txt.strip() if len(txt): items.append(txt.strip()) return items def parseUsesSets(self, domelem, xpath_context, nsmap): uses = [] sets = [] for u in tf.findAll(domelem, "uses", dbxid, xpath_context, nsmap): uses.extend(self.parseItems(u, xpath_context, nsmap)) for s in tf.findAll(domelem, "sets", dbxid, xpath_context, nsmap): sets.extend(self.parseItems(s, xpath_context, nsmap)) return sorted(uses), sorted(sets) def parseInstance(self, domelem, map, Class, xpath_context, nsmap, include_entities=True): name = 'unknown' if tf.hasAttribute(domelem, 'name'): name = tf.getAttribute(domelem, 'name') try: instance = map[name] except KeyError: instance = Class(name) map[name] = instance uses, sets = self.parseUsesSets(domelem, xpath_context, nsmap) instance.uses.extend(uses) instance.sets.extend(sets) if include_entities: # Parse summary and function arguments for s in tf.findAllChildrenOf(domelem, "summary", dbxid, xpath_context, nsmap): if instance.summary is None: instance.summary = [] instance.summary.append(tf.copyNode(s)) for a in tf.findAll(domelem, "arguments", dbxid, xpath_context, nsmap): if instance.arguments is None: instance.arguments = [] instance.arguments.append(tf.copyNode(a)) def parseDomtree(self, root, xpath_context=None, nsmap=None, include_entities=True): # Process Builders for b in tf.findAll(root, "builder", dbxid, xpath_context, nsmap): self.parseInstance(b, self.builders, Builder, xpath_context, nsmap, include_entities) # Process Functions for f in tf.findAll(root, "scons_function", dbxid, xpath_context, nsmap): self.parseInstance(f, self.functions, Function, xpath_context, nsmap, include_entities) # Process Tools for t in tf.findAll(root, "tool", dbxid, xpath_context, nsmap): self.parseInstance(t, self.tools, Tool, xpath_context, nsmap, include_entities) # Process CVars for c in tf.findAll(root, "cvar", dbxid, xpath_context, nsmap): self.parseInstance(c, self.cvars, ConstructionVariable, xpath_context, nsmap, include_entities) def parseContent(self, content, include_entities=True): """ Parses the given content as XML file. This method is used when we generate the basic lists of entities for the builders, tools and functions. So we usually don't bother about namespaces and resolving entities here...this is handled in parseXmlFile below (step 2 of the overall process). """ # Create doctree t = SConsDocTree() t.parseContent(content, include_entities) # Parse it self.parseDomtree(t.root, t.xpath_context, t.nsmap, include_entities) def parseXmlFile(self, fpath): # Create doctree t = SConsDocTree() t.parseXmlFile(fpath) # Parse it self.parseDomtree(t.root, t.xpath_context, t.nsmap) # lifted from Ka-Ping Yee's way cool pydoc module. def importfile(path): """Import a Python source file or compiled file given its path.""" magic = imp.get_magic() file = open(path, 'r') if file.read(len(magic)) == magic: kind = imp.PY_COMPILED else: kind = imp.PY_SOURCE file.close() filename = os.path.basename(path) name, ext = os.path.splitext(filename) file = open(path, 'r') try: module = imp.load_module(name, file, path, (ext, 'r', kind)) except ImportError as e: sys.stderr.write("Could not import %s: %s\n" % (path, e)) return None file.close() return module # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/scons-cdist0000664000175000017500000001716313160023037016413 0ustar bdbaddogbdbaddog#!/bin/sh # # Copyright (c) 2005 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PROG=`basename $0` NOARGFLAGS="afhlnqrstz" ARGFLAGS="p:" ALLFLAGS="${NOARGFLAGS}${ARGFLAGS}" USAGE="Usage: ${PROG} [-${NOARGFLAGS}] [-p project] change" HELP="$USAGE -a Update the latest Aegis baseline (aedist) file. -f Force update, skipping up-front sanity check. -h Print this help message and exit. -l Update the local CVS repository. -n Don't execute, just echo commands. -p project Set the Aegis project. -q Quiet, don't print commands before executing them. -r Rsync the Aegis repository to SourceForge. -s Update the sourceforge.net CVS repository. -t Update the tigris.org CVS repository. -z Update the latest .tar.gz and .zip files. " DO="" PRINT="echo" EXECUTE="eval" SANITY_CHECK="yes" while getopts $ALLFLAGS FLAG; do case $FLAG in a | l | r | s | t | z ) DO="${DO}${FLAG}" ;; f ) SANITY_CHECK="no" ;; h ) echo "${HELP}" exit 0 ;; n ) EXECUTE=":" ;; p ) AEGIS_PROJECT="${OPTARG}" ;; q ) PRINT=":" ;; * ) echo "FLAG = ${FLAG}" >&2 echo "${USAGE}" >&2 exit 1 ;; esac done shift `expr ${OPTIND} - 1` if test "X$1" = "X"; then echo "${USAGE}" >&2 exit 1 fi if test "X${AEGIS_PROJECT}" = "X"; then echo "$PROG: No AEGIS_PROJECT set." >&2 echo "${USAGE}" >&2 exit 1 fi if test "X$DO" = "X"; then DO="alrstz" fi cmd() { $PRINT "$*" $EXECUTE "$*" } CHANGE=$1 if test "X${SANITY_CHECK}" = "Xyes"; then SCM="cvs" SCMROOT="/home/scons/CVSROOT/scons" DELTA=`aegis -l -ter cd ${CHANGE} | sed -n 's/.*, Delta \([0-9]*\)\./\1/p'` if test "x${DELTA}" = "x"; then echo "${PROG}: Could not find delta for change ${CHANGE}." >&2 echo "Has this finished integrating? Change ${CHANGE} not distributed." >&2 exit 1 fi PREV_DELTA=`expr ${DELTA} - 1` COMMAND="scons-scmcheck -D ${PREV_DELTA} -d q -p ${AEGIS_PROJECT} -s ${SCM} ${SCMROOT}" $PRINT "${COMMAND}" OUTPUT=`${COMMAND}` if test "X${OUTPUT}" != "X"; then echo "${PROG}: ${SCMROOT} is not up to date:" >&2 echo "${OUTPUT}" >& 2 echo "Did you skip any changes? Change ${CHANGE} not distributed." >&2 exit 1 fi fi if test X$EXECUTE != "X:" -a "X$SSH_AGENT_PID" = "X"; then eval `ssh-agent` ssh-add trap 'eval `ssh-agent -k`; exit' 0 1 2 3 15 fi cd BASELINE=`aesub -p ${AEGIS_PROJECT} -c ${CHANGE} '${Project trunk_name}'` TMPBLAE="/tmp/${BASELINE}.ae" TMPCAE="/tmp/${AEGIS_PROJECT}.C${CHANGE}.ae" # Original values for SourceForge. #SFLOGIN="stevenknight" #SFHOST="scons.sourceforge.net" #SFDEST="/home/groups/s/sc/scons/htdocs" SCONSLOGIN="scons" SCONSHOST="manam.pair.com" #SCONSDEST="public_html/production" SCONSDEST="public_ftp" # # Copy the baseline .ae to the constant location on SourceForge. # case "${DO}" in *a* ) cmd "aedist -s -bl -p ${AEGIS_PROJECT} > ${TMPBLAE}" cmd "scp ${TMPBLAE} ${SCONSLOGIN}@${SCONSHOST}:${SCONSDEST}/${BASELINE}.ae" cmd "rm ${TMPBLAE}" ;; esac # # Copy the latest .tar.gz and .zip files to the constant location on # SourceForge. # case "${DO}" in *z* ) BUILD_DIST=`aegis -p ${AEGIS_PROJECT} -cd -bl`/build/dist SCONS_SRC_TAR_GZ=`echo ${AEGIS_PROJECT} | sed 's/scons./scons-src-/'`*.tar.gz SCONS_SRC_ZIP=`echo ${AEGIS_PROJECT} | sed 's/scons./scons-src-/'`*.zip cmd "scp ${BUILD_DIST}/${SCONS_SRC_TAR_GZ} ${SCONSLOGIN}@${SCONSHOST}:${SCONSDEST}/scons-src-latest.tar.gz" cmd "scp ${BUILD_DIST}/${SCONS_SRC_ZIP} ${SCONSLOGIN}@${SCONSHOST}:${SCONSDEST}/scons-src-latest.zip" esac # # Sync Aegis tree with SourceForge. # # Cribbed and modified from Peter Miller's same-named script in # /home/groups/a/ae/aegis/aegis at SourceForge. # # Guide to what this does with rsync: # # --rsh=ssh use ssh for the transfer # -l copy symlinks as symlinks # -p preserve permissions # -r recursive # -t preserve times # -z compress data # --stats file transfer statistics # --exclude exclude files matching the pattern # --delete delete files that don't exist locally # --delete-excluded delete files that match the --exclude patterns # --progress show progress during the transfer # -v verbose # # We no longer use the --stats option. # case "${DO}" in *r* ) LOCAL=/home/scons/scons REMOTE=/home/groups/s/sc/scons/scons cmd "/usr/bin/rsync --rsh='ssh -l stevenknight' \ -l -p -r -t -z \ --exclude build \ --exclude '*,D' \ --exclude '*.pyc' \ --exclude aegis.log \ --exclude '.sconsign*' \ --delete --delete-excluded \ --progress -v \ ${LOCAL}/. scons.sourceforge.net:${REMOTE}/." ;; esac # # Sync the CVS tree with the local repository. # case "${DO}" in *l* ) ( export CVSROOT=/home/scons/CVSROOT/scons #cmd "ae2cvs -X -aegis -p ${AEGIS_PROJECT} -c ${CHANGE} -u $HOME/SCons/baldmt.com/scons" cmd "ae-cvs-ci ${AEGIS_PROJECT} ${CHANGE}" ) ;; esac # # Sync the Subversion tree with Tigris.org. # case "${DO}" in *t* ) ( SVN=http://scons.tigris.org/svn/scons case ${AEGIS_PROJECT} in scons.0.96 ) SVN_URL=${SVN}/branches/core ;; scons.0.96.513 ) SVN_URL=${SVN}/branches/sigrefactor ;; * ) echo "$PROG: Don't know SVN branch for '${AEGIS_PROJECT}'" >&2 exit 1 ;; esac SVN_CO_FLAGS="--username stevenknight" #cmd "ae2cvs -X -aegis -p ${AEGIS_PROJECT} -c ${CHANGE} -u $HOME/SCons/tigris.org/scons" cmd "ae-svn-ci ${AEGIS_PROJECT} ${CHANGE} ${SVN_URL} ${SVN_CO_FLAGS}" ) ;; esac # # Sync the CVS tree with SourceForge. # case "${DO}" in *s* ) ( export CVS_RSH=ssh export CVSROOT=:ext:stevenknight@scons.cvs.sourceforge.net:/cvsroot/scons #cmd "ae2cvs -X -aegis -p ${AEGIS_PROJECT} -c ${CHANGE} -u $HOME/SCons/sourceforge.net/scons" cmd "ae-cvs-ci ${AEGIS_PROJECT} ${CHANGE}" ) ;; esac # # Send the change .ae to the scons-aedist mailing list # # The subject requires editing by hand... # #aedist -s -p ${AEGIS_PROJECT} ${CHANGE} > ${TMPCAE} #aegis -l -p ${AEGIS_PROJECT} -c ${CHANGE} cd | # pine -attach_and_delete ${TMPCAE} scons-aedist@lists.sourceforge.net scons-src-3.0.0/bin/files0000664000175000017500000000451213160023037015256 0ustar bdbaddogbdbaddog./SCons/Action.py ./SCons/Builder.py ./SCons/Conftest.py ./SCons/Debug.py ./SCons/Defaults.py ./SCons/Environment.py ./SCons/Errors.py ./SCons/Executor.py ./SCons/Job.py ./SCons/Node/Alias.py ./SCons/Node/FS.py ./SCons/Node/Python.py ./SCons/Node/__init__.py ./SCons/Options/__init__.py ./SCons/Options/BoolOption.py ./SCons/Options/EnumOption.py ./SCons/Options/ListOption.py ./SCons/Options/PackageOption.py ./SCons/Options/PathOption.py ./SCons/Platform/__init__.py ./SCons/Platform/aix.py ./SCons/Platform/cygwin.py ./SCons/Platform/hpux.py ./SCons/Platform/irix.py ./SCons/Platform/os2.py ./SCons/Platform/posix.py ./SCons/Platform/sunos.py ./SCons/Platform/win32.py ./SCons/Scanner/C.py ./SCons/Scanner/D.py ./SCons/Scanner/Fortran.py ./SCons/Scanner/IDL.py ./SCons/Scanner/Prog.py ./SCons/Scanner/__init__.py ./SCons/Script/SConscript.py ./SCons/Script/__init__.py ./SCons/Sig/MD5.py ./SCons/Sig/TimeStamp.py ./SCons/Sig/__init__.py ./SCons/Taskmaster.py ./SCons/Tool/__init__.py ./SCons/Tool/aixc++.py ./SCons/Tool/aixcc.py ./SCons/Tool/aixf77.py ./SCons/Tool/aixlink.py ./SCons/Tool/ar.py ./SCons/Tool/as.py ./SCons/Tool/bcc32.py ./SCons/Tool/c++.py ./SCons/Tool/cc.py ./SCons/Tool/CVS.py ./SCons/Tool/dmd.py ./SCons/Tool/default.py ./SCons/Tool/dvipdf.py ./SCons/Tool/dvips.py ./SCons/Tool/f77.py ./SCons/Tool/g++.py ./SCons/Tool/g77.py ./SCons/Tool/gas.py ./SCons/Tool/gcc.py ./SCons/Tool/gnulink.py ./SCons/Tool/hpc++.py ./SCons/Tool/hpcc.py ./SCons/Tool/hplink.py ./SCons/Tool/icc.py ./SCons/Tool/icl.py ./SCons/Tool/ifl.py ./SCons/Tool/ilink.py ./SCons/Tool/ilink32.py ./SCons/Tool/jar.py ./SCons/Tool/javac.py ./SCons/Tool/JavaCommon.py ./SCons/Tool/javah.py ./SCons/Tool/latex.py ./SCons/Tool/lex.py ./SCons/Tool/link.py ./SCons/Tool/m4.py ./SCons/Tool/masm.py ./SCons/Tool/midl.py ./SCons/Tool/mingw.py ./SCons/Tool/mslib.py ./SCons/Tool/mslink.py ./SCons/Tool/msvc.py ./SCons/Tool/msvs.py ./SCons/Tool/nasm.py ./SCons/Tool/pdflatex.py ./SCons/Tool/pdftex.py ./SCons/Tool/qt.py ./SCons/Tool/rmic.py ./SCons/Tool/sgiar.py ./SCons/Tool/sgic++.py ./SCons/Tool/sgicc.py ./SCons/Tool/sgilink.py ./SCons/Tool/sunar.py ./SCons/Tool/sunc++.py ./SCons/Tool/suncc.py ./SCons/Tool/sunlink.py ./SCons/Tool/swig.py ./SCons/Tool/tar.py ./SCons/Tool/tex.py ./SCons/Tool/tlib.py ./SCons/Tool/yacc.py ./SCons/Util.py ./SCons/Warnings.py ./SCons/__init__.py ./SCons/exitfuncs.py scons-src-3.0.0/bin/docs-validate.py0000664000175000017500000000211013160023037017312 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Searches through the whole source tree and validates all # documentation files against our own XSD in docs/xsd. # from __future__ import print_function import sys,os import SConsDoc if __name__ == "__main__": if len(sys.argv)>1: if SConsDoc.validate_all_xml((sys.argv[1],)): print("OK") else: print("Validation failed! Please correct the errors above and try again.") else: if SConsDoc.validate_all_xml(['src', os.path.join('doc','design'), os.path.join('doc','developer'), os.path.join('doc','man'), os.path.join('doc','python10'), os.path.join('doc','reference'), os.path.join('doc','user') ]): print("OK") else: print("Validation failed! Please correct the errors above and try again.") sys.exit(1) scons-src-3.0.0/bin/update-release-info.py0000664000175000017500000003024413160023037020435 0ustar bdbaddogbdbaddog#!/usr/bin/env python """ This program takes information about a release in the ReleaseConfig file and inserts the information in various files. It helps to keep the files in sync because it never forgets which files need to be updated, nor what information should be inserted in each file. It takes one parameter that says what the mode of update should be, which may be one of 'develop', 'release', or 'post'. In 'develop' mode, which is what someone would use as part of their own development practices, the release type is forced to be 'alpha' and the patch level is the string 'yyyymmdd'. Otherwise, it's the same as the 'release' mode. In 'release' mode, the release type is taken from ReleaseConfig and the patch level is calculated from the release date for non-final runs and taken from the version tuple for final runs. It then inserts information in various files: - The RELEASE header line in src/CHANGES.txt and src/Announce.txt. - The version string at the top of src/RELEASE.txt. - The version string in the 'default_version' variable in SConstruct and QMTest/TestSCons.py. - The copyright years in SConstruct and QMTest/TestSCons.py. - The month and year (used for documentation) in SConstruct. - The unsupported and deprecated Python floors in QMTest/TestSCons.py and src/engine/SCons/Script/Main.py - The version string in the filenames in README. In 'post' mode, files are prepared for the next release cycle: - In ReleaseConfig, the version tuple is updated for the next release by incrementing the release number (either minor or micro, depending on the branch) and resetting release type to 'alpha'. - A blank template replaces src/RELEASE.txt. - A new section to accumulate changes is added to src/CHANGES.txt and src/Announce.txt. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function __revision__ = "bin/update-release-info.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import sys import time import re DEBUG = os.environ.get('DEBUG', 0) # Evaluate parameter if len(sys.argv) < 2: mode = 'develop' else: mode = sys.argv[1] if mode not in ['develop', 'release', 'post']: print(("""ERROR: `%s' as a parameter is invalid; it must be one of \tdevelop, release, or post. The default is develop.""" % mode)) sys.exit(1) # Get configuration information config = dict() exec(open('ReleaseConfig').read(), globals(), config) try: version_tuple = config['version_tuple'] unsupported_version = config['unsupported_python_version'] deprecated_version = config['deprecated_python_version'] except KeyError: print('''ERROR: Config file must contain at least version_tuple, \tunsupported_python_version, and deprecated_python_version.''') sys.exit(1) if DEBUG: print('version tuple', version_tuple) if DEBUG: print('unsupported Python version', unsupported_version) if DEBUG: print('deprecated Python version', deprecated_version) try: release_date = config['release_date'] except KeyError: release_date = time.localtime()[:6] else: if len(release_date) == 3: release_date = release_date + time.localtime()[3:6] if len(release_date) != 6: print('''ERROR: Invalid release date''', release_date) sys.exit(1) if DEBUG: print('release date', release_date) if mode == 'develop' and version_tuple[3] != 'alpha': version_tuple == version_tuple[:3] + ('alpha', 0) if len(version_tuple) > 3 and version_tuple[3] != 'final': if mode == 'develop': version_tuple = version_tuple[:4] + ('yyyymmdd',) else: yyyy,mm,dd,_,_,_ = release_date version_tuple = version_tuple[:4] + ((yyyy*100 + mm)*100 + dd,) version_string = '.'.join(map(str, version_tuple)) if len(version_tuple) > 3: version_type = version_tuple[3] else: version_type = 'final' if DEBUG: print('version string', version_string) if version_type not in ['alpha', 'beta', 'candidate', 'final']: print(("""ERROR: `%s' is not a valid release type in version tuple; \tit must be one of alpha, beta, candidate, or final""" % version_type)) sys.exit(1) try: month_year = config['month_year'] except KeyError: if version_type == 'alpha': month_year = 'MONTH YEAR' else: month_year = time.strftime('%B %Y', release_date + (0,0,0)) if DEBUG: print('month year', month_year) try: copyright_years = config['copyright_years'] except KeyError: copyright_years = '2001 - %d'%(release_date[0] + 1) if DEBUG: print('copyright years', copyright_years) class UpdateFile(object): """ XXX """ def __init__(self, file, orig = None): ''' ''' if orig is None: orig = file try: self.content = open(orig, 'r').read() except IOError: # Couldn't open file; don't try to write anything in __del__ self.file = None raise else: self.file = file if file == orig: # so we can see if it changed self.orig = self.content else: # pretend file changed self.orig = '' def sub(self, pattern, replacement, count = 1): ''' XXX ''' self.content = re.sub(pattern, replacement, self.content, count) def replace_assign(self, name, replacement, count = 1): ''' XXX ''' self.sub('\n' + name + ' = .*', '\n' + name + ' = ' + replacement) # Determine the pattern to match a version _rel_types = '(alpha|beta|candidate|final)' match_pat = '\d+\.\d+\.\d+\.' + _rel_types + '\.(\d+|yyyymmdd)' match_rel = re.compile(match_pat) def replace_version(self, replacement = version_string, count = 1): ''' XXX ''' self.content = self.match_rel.sub(replacement, self.content, count) # Determine the release date and the pattern to match a date # Mon, 05 Jun 2010 21:17:15 -0700 # NEW DATE WILL BE INSERTED HERE if mode == 'develop': new_date = 'NEW DATE WILL BE INSERTED HERE' else: min = (time.daylight and time.altzone or time.timezone)//60 hr = min//60 min = -(min%60 + hr*100) new_date = (time.strftime('%a, %d %b %Y %X', release_date + (0,0,0)) + ' %+.4d' % min) _days = '(Sun|Mon|Tue|Wed|Thu|Fri|Sat)' _months = '(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oce|Nov|Dec)' match_date = _days+', \d\d '+_months+' \d\d\d\d \d\d:\d\d:\d\d [+-]\d\d\d\d' match_date = re.compile(match_date) def replace_date(self, replacement = new_date, count = 1): ''' XXX ''' self.content = self.match_date.sub(replacement, self.content, count) def __del__(self): ''' XXX ''' if self.file is not None and self.content != self.orig: print('Updating ' + self.file + '...') open(self.file, 'w').write(self.content) if mode == 'post': # Set up for the next release series. if version_tuple[2]: # micro release, increment micro value minor = version_tuple[1] micro = version_tuple[2] + 1 else: # minor release, increment minor value minor = version_tuple[1] + 1 micro = 0 new_tuple = (version_tuple[0], minor, micro, 'alpha', 0) new_version = '.'.join(map(str, new_tuple[:4])) + '.yyyymmdd' # Update ReleaseConfig t = UpdateFile('ReleaseConfig') if DEBUG: t.file = '/tmp/ReleaseConfig' t.replace_assign('version_tuple', str(new_tuple)) # Update src/CHANGES.txt t = UpdateFile(os.path.join('src', 'CHANGES.txt')) if DEBUG: t.file = '/tmp/CHANGES.txt' t.sub('(\nRELEASE .*)', r"""\nRELEASE VERSION/DATE TO BE FILLED IN LATER\n From John Doe:\n - Whatever John Doe did.\n \1""") # Update src/RELEASE.txt t = UpdateFile(os.path.join('src', 'RELEASE.txt'), os.path.join('template', 'RELEASE.txt')) if DEBUG: t.file = '/tmp/RELEASE.txt' t.replace_version(new_version) # Update src/Announce.txt t = UpdateFile(os.path.join('src', 'Announce.txt')) if DEBUG: t.file = '/tmp/Announce.txt' t.sub('\nRELEASE .*', '\nRELEASE VERSION/DATE TO BE FILLED IN LATER') announce_pattern = """( Please note the following important changes scheduled for the next release: )""" announce_replace = (r"""\1 -- FEATURE THAT WILL CHANGE\n Please note the following important changes since release """ + '.'.join(map(str, version_tuple[:3])) + ':\n') t.sub(announce_pattern, announce_replace) # Write out the last update and exit t = None sys.exit() # Update src/CHANGES.txt t = UpdateFile(os.path.join('src', 'CHANGES.txt')) if DEBUG: t.file = '/tmp/CHANGES.txt' t.sub('\nRELEASE .*', '\nRELEASE ' + version_string + ' - ' + t.new_date) # Update src/RELEASE.txt t = UpdateFile(os.path.join('src', 'RELEASE.txt')) if DEBUG: t.file = '/tmp/RELEASE.txt' t.replace_version() # Update src/Announce.txt t = UpdateFile(os.path.join('src', 'Announce.txt')) if DEBUG: t.file = '/tmp/Announce.txt' t.sub('\nRELEASE .*', '\nRELEASE ' + version_string + ' - ' + t.new_date) # Update SConstruct t = UpdateFile('SConstruct') if DEBUG: t.file = '/tmp/SConstruct' t.replace_assign('month_year', repr(month_year)) t.replace_assign('copyright_years', repr(copyright_years)) t.replace_assign('default_version', repr(version_string)) # Update README t = UpdateFile('README.rst') if DEBUG: t.file = '/tmp/README.rst' t.sub('-' + t.match_pat + '\.', '-' + version_string + '.', count = 0) for suf in ['tar', 'win32', 'zip', 'rpm', 'exe', 'deb']: t.sub('-(\d+\.\d+\.\d+)\.%s' % suf, '-%s.%s' % (version_string, suf), count = 0) # Update QMTest/TestSCons.py t = UpdateFile(os.path.join('QMTest', 'TestSCons.py')) if DEBUG: t.file = '/tmp/TestSCons.py' t.replace_assign('copyright_years', repr(copyright_years)) t.replace_assign('default_version', repr(version_string)) #??? t.replace_assign('SConsVersion', repr(version_string)) t.replace_assign('python_version_unsupported', str(unsupported_version)) t.replace_assign('python_version_deprecated', str(deprecated_version)) # Update Script/Main.py t = UpdateFile(os.path.join('src', 'engine', 'SCons', 'Script', 'Main.py')) if DEBUG: t.file = '/tmp/Main.py' t.replace_assign('unsupported_python_version', str(unsupported_version)) t.replace_assign('deprecated_python_version', str(deprecated_version)) # Update doc/user/main.{in,xml} docyears = '2004 - %d' % release_date[0] if os.path.exists(os.path.join('doc', 'user', 'main.in')): # this is no longer used as of Dec 2013 t = UpdateFile(os.path.join('doc', 'user', 'main.in')) if DEBUG: t.file = '/tmp/main.in' ## TODO debug these #t.sub('[^<]*', '' + docyears + '') #t.sub('[^<]*', '' + docyears + '') t = UpdateFile(os.path.join('doc', 'user', 'main.xml')) if DEBUG: t.file = '/tmp/main.xml' t.sub('[^<]*', '' + docyears + '') t.sub('[^<]*', '' + docyears + '') # Write out the last update t = None # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/scons-proc.py0000664000175000017500000002662513160023037016702 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Process a list of Python and/or XML files containing SCons documentation. # # This script creates formatted lists of the Builders, functions, Tools # or construction variables documented in the specified XML files. # # Depending on the options, the lists are output in either # DocBook-formatted generated XML files containing the summary text # and/or .mod files containing the ENTITY definitions for each item. # from __future__ import print_function import getopt import os import re import string import sys from io import StringIO # usable as of 2.6; takes unicode only import SConsDoc from SConsDoc import tf as stf base_sys_path = [os.getcwd() + '/build/test-tar-gz/lib/scons'] + sys.path helpstr = """\ Usage: scons-proc.py [-b file(s)] [-f file(s)] [-t file(s)] [-v file(s)] [infile ...] Options: -b file(s) dump builder information to the specified file(s) -f file(s) dump function information to the specified file(s) -t file(s) dump tool information to the specified file(s) -v file(s) dump variable information to the specified file(s) Regard that each -[btv] argument is a pair of comma-separated .gen,.mod file names. """ opts, args = getopt.getopt(sys.argv[1:], "b:f:ht:v:", ['builders=', 'help', 'tools=', 'variables=']) buildersfiles = None functionsfiles = None toolsfiles = None variablesfiles = None for o, a in opts: if o in ['-b', '--builders']: buildersfiles = a elif o in ['-f', '--functions']: functionsfiles = a elif o in ['-h', '--help']: sys.stdout.write(helpstr) sys.exit(0) elif o in ['-t', '--tools']: toolsfiles = a elif o in ['-v', '--variables']: variablesfiles = a def parse_docs(args, include_entities=True): h = SConsDoc.SConsDocHandler() for f in args: if include_entities: try: h.parseXmlFile(f) except: sys.stderr.write("error in %s\n" % f) raise else: content = open(f).read() if content: try: h.parseContent(content, include_entities) except: sys.stderr.write("error in %s\n" % f) raise return h Warning = """\ """ Regular_Entities_Header = """\ """ Link_Entities_Header = """\ """ class SCons_XML(object): def __init__(self, entries, **kw): self.values = entries for k, v in kw.items(): setattr(self, k, v) def fopen(self, name): if name == '-': return sys.stdout return open(name, 'w') def write(self, files): gen, mod = files.split(',') self.write_gen(gen) self.write_mod(mod) def write_gen(self, filename): if not filename: return # Try to split off .gen filename if filename.count(','): fl = filename.split(',') filename = fl[0] # Start new XML file root = stf.newXmlTree("variablelist") for v in self.values: ve = stf.newNode("varlistentry") stf.setAttribute(ve, 'id', '%s%s' % (v.prefix, v.idfunc())) for t in v.xml_terms(): stf.appendNode(ve, t) vl = stf.newNode("listitem") added = False if v.summary is not None: for s in v.summary: added = True stf.appendNode(vl, stf.copyNode(s)) if len(v.sets): added = True vp = stf.newNode("para") s = ['&cv-link-%s;' % x for x in v.sets] stf.setText(vp, 'Sets: ' + ', '.join(s) + '.') stf.appendNode(vl, vp) if len(v.uses): added = True vp = stf.newNode("para") u = ['&cv-link-%s;' % x for x in v.uses] stf.setText(vp, 'Uses: ' + ', '.join(u) + '.') stf.appendNode(vl, vp) # Still nothing added to this list item? if not added: # Append an empty para vp = stf.newNode("para") stf.appendNode(vl, vp) stf.appendNode(ve, vl) stf.appendNode(root, ve) # Write file f = self.fopen(filename) stf.writeGenTree(root, f) def write_mod(self, filename): try: description = self.values[0].description except: description = "" if not filename: return # Try to split off .mod filename if filename.count(','): fl = filename.split(',') filename = fl[1] f = self.fopen(filename) f.write(Warning) f.write('\n') f.write(Regular_Entities_Header % description) f.write('\n') for v in self.values: f.write('%s">\n' % (v.prefix, v.idfunc(), v.tag, SConsDoc.dbxsd, v.entityfunc(), v.tag)) if self.env_signatures: f.write('\n') for v in self.values: f.write('env.%s">\n' % (v.prefix, v.idfunc(), v.tag, SConsDoc.dbxsd, v.entityfunc(), v.tag)) f.write('\n') f.write(Warning) f.write('\n') f.write(Link_Entities_Header % description) f.write('\n') for v in self.values: f.write('<%s>%s">\n' % (v.prefix, v.idfunc(), v.prefix, v.idfunc(), SConsDoc.dbxsd, v.tag, v.entityfunc(), v.tag)) if self.env_signatures: f.write('\n') for v in self.values: f.write('<%s>env.%s">\n' % (v.prefix, v.idfunc(), v.prefix, v.idfunc(), SConsDoc.dbxsd, v.tag, v.entityfunc(), v.tag)) f.write('\n') f.write(Warning) class Proxy(object): def __init__(self, subject): """Wrap an object as a Proxy object""" self.__subject = subject def __getattr__(self, name): """Retrieve an attribute from the wrapped object. If the named attribute doesn't exist, AttributeError is raised""" return getattr(self.__subject, name) def get(self): """Retrieve the entire wrapped object""" return self.__subject def __eq__(self, other): if issubclass(other.__class__, self.__subject.__class__): return self.__subject == other return self.__dict__ == other.__dict__ ## def __lt__(self, other): ## if issubclass(other.__class__, self.__subject.__class__): ## return self.__subject < other ## return self.__dict__ < other.__dict__ class SConsThing(Proxy): def idfunc(self): return self.name def xml_terms(self): e = stf.newNode("term") stf.setText(e, self.name) return [e] class Builder(SConsThing): description = 'builder' prefix = 'b-' tag = 'function' def xml_terms(self): ta = stf.newNode("term") b = stf.newNode(self.tag) stf.setText(b, self.name+'()') stf.appendNode(ta, b) tb = stf.newNode("term") b = stf.newNode(self.tag) stf.setText(b, 'env.'+self.name+'()') stf.appendNode(tb, b) return [ta, tb] def entityfunc(self): return self.name class Function(SConsThing): description = 'function' prefix = 'f-' tag = 'function' def xml_terms(self): if self.arguments is None: a = stf.newNode("arguments") stf.setText(a, '()') arguments = [a] else: arguments = self.arguments tlist = [] for arg in arguments: signature = 'both' if stf.hasAttribute(arg, 'signature'): signature = stf.getAttribute(arg, 'signature') s = stf.getText(arg).strip() if signature in ('both', 'global'): t = stf.newNode("term") syn = stf.newNode("literal") stf.setText(syn, '%s%s' % (self.name, s)) stf.appendNode(t, syn) tlist.append(t) if signature in ('both', 'env'): t = stf.newNode("term") syn = stf.newNode("literal") stf.setText(syn, 'env.%s%s' % (self.name, s)) stf.appendNode(t, syn) tlist.append(t) if not tlist: tlist.append(stf.newNode("term")) return tlist def entityfunc(self): return self.name class Tool(SConsThing): description = 'tool' prefix = 't-' tag = 'literal' def idfunc(self): return self.name.replace('+', 'X') def entityfunc(self): return self.name class Variable(SConsThing): description = 'construction variable' prefix = 'cv-' tag = 'envar' def entityfunc(self): return '$' + self.name def write_output_files(h, buildersfiles, functionsfiles, toolsfiles, variablesfiles, write_func): if buildersfiles: g = processor_class([ Builder(b) for b in sorted(h.builders.values()) ], env_signatures=True) write_func(g, buildersfiles) if functionsfiles: g = processor_class([ Function(b) for b in sorted(h.functions.values()) ], env_signatures=True) write_func(g, functionsfiles) if toolsfiles: g = processor_class([ Tool(t) for t in sorted(h.tools.values()) ], env_signatures=False) write_func(g, toolsfiles) if variablesfiles: g = processor_class([ Variable(v) for v in sorted(h.cvars.values()) ], env_signatures=False) write_func(g, variablesfiles) processor_class = SCons_XML # Step 1: Creating entity files for builders, functions,... print("Generating entity files...") h = parse_docs(args, False) write_output_files(h, buildersfiles, functionsfiles, toolsfiles, variablesfiles, SCons_XML.write_mod) # Step 2: Validating all input files print("Validating files against SCons XSD...") if SConsDoc.validate_all_xml(['src']): print("OK") else: print("Validation failed! Please correct the errors above and try again.") # Step 3: Creating actual documentation snippets, using the # fully resolved and updated entities from the *.mod files. print("Updating documentation for builders, tools and functions...") h = parse_docs(args, True) write_output_files(h, buildersfiles, functionsfiles, toolsfiles, variablesfiles, SCons_XML.write) print("Done") # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/scp-sourceforge0000775000175000017500000000220413160023037017261 0ustar bdbaddogbdbaddog#!/bin/bash set -x set -e if [ -z "$1" ]; then echo usage: $0 SourceForgeUserName exit fi SF_USER=$1 rm -rf sf for p in scons scons-src scons-local do mkdir -p sf/$p/$VERSION cp -p src/Announce.txt \ build/scons/CHANGES.txt \ build/scons/RELEASE.txt \ sf/$p/$VERSION done cp -p build/scons/README.txt \ sf/. cp -p build/dist/scons-$VERSION-1.noarch.rpm \ build/dist/scons-$VERSION-1.src.rpm \ build/dist/scons-$VERSION.tar.gz \ build/dist/scons-$VERSION.win32.exe \ build/dist/scons-$VERSION.win-amd64.exe \ build/dist/scons-$VERSION.zip \ sf/scons/$VERSION cp -p build/dist/scons-local-$VERSION.tar.gz \ build/dist/scons-local-$VERSION.zip \ sf/scons-src/$VERSION cp -p build/dist/scons-src-$VERSION.tar.gz \ build/dist/scons-src-$VERSION.zip \ sf/scons-local/$VERSION # Transmit them in this order, since the most-recent is displayed at the top scp -r sf/scons-local/ sf/scons-src/ sf/scons/ \ $SF_USER,scons@frs.sourceforge.net:/home/pfs/project/s/sc/scons scp sf/README.txt \ $SF_USER,scons@frs.sourceforge.net:/home/pfs/project/s/sc/scons rm -rf sf scons-src-3.0.0/bin/xml_export-README0000664000175000017500000000414313160023037017310 0ustar bdbaddogbdbaddogThis copy of xml_export was snarfed from adocman-0.10 from SourceForge. We're checking in a copy as a convenience for any future SCons project administrator who may need to download exported XML data. The original, unmodified contents of the README file for that release of adocman are as follows: adocman - Automation tool for SourceForge.net DocManager handling Copyright (C) 2002 Open Source Development Network, Inc. ("OSDN") File manifest: Alexandria perl-based API for performing operations against the SourceForge.net site, currently including basic Client operations (i.e. login/logout) and DocManager operations adocman The adocman program, providing the means to perform DocManager operations from the command-line or scripts (by project developers or admins listed as DocManager Editors) xml_export The xml_export program, providing the means to automate downloads of data from the XML data export facility on SourceForge.net (by project administrators) adocman.html Manual for adocman, including background information, command-line options detail, etc. xml_export.html Manual for xml_export, including basic info about command-line options. See adocman.html for additional information. LICENSE License terms for adocman README This file TODO List of ongoing work in improving adocman. NOTE: Please contact the maintainer before starting any effort to improve this code. We have significantly modified the structure and design of this program for the next release; structure and command-line interface are subject to change without notice. A list of the prerequisites required to execute 'adocman' may be found at in the PREREQUISITES section of the adocman manual (adocman.html). Though not listed, a recent installation of 'perl' is also a prerequisite. Support for this program may be obtained as per the SUPPORT AND BUGS section of the adocman.html manual. Any questions or concerns regarding this software should be escalated as per the SUPPORT AND BUGS section of the provided manual. The authoritative source of this software is: https://sourceforge.net/projects/sitedocs scons-src-3.0.0/bin/import-test.py0000664000175000017500000000515513160023037017076 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2001 - 2017 The SCons Foundation # # tree2test.py - turn a directory tree into TestSCons code # # A quick script for importing directory hierarchies containing test # cases that people supply (typically in a .zip or .tar.gz file) into a # TestSCons.py script. No error checking or options yet, it just walks # the first command-line argument (assumed to be the directory containing # the test case) and spits out code looking like the following: # # test.subdir(['sub1'], # ['sub1', 'sub2']) # # test.write(['sub1', 'file1'], """\ # contents of file1 # """) # # test.write(['sub1', 'sub2', 'file2'], """\ # contents of file2 # """) # # There's no massaging of contents, so any files that themselves contain # """ triple-quotes will need to have their contents edited by hand. # __revision__ = "bin/import-test.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import sys directory = sys.argv[1] Top = None TopPath = None class Dir(object): def __init__(self, path): self.path = path self.entries = {} def call_for_each_entry(self, func): for name in sorted(self.entries.keys()): func(name, self.entries[name]) def lookup(dirname): global Top, TopPath if not Top: Top = Dir([]) TopPath = dirname + os.sep return Top dirname = dirname.replace(TopPath, '') dirs = dirname.split(os.sep) t = Top for d in dirs[:-1]: t = t.entries[d] node = t.entries[dirs[-1]] = Dir(dirs) return node def collect_dirs(l, dir): if dir.path: l.append(dir.path) def recurse(n, d): if d: collect_dirs(l, d) dir.call_for_each_entry(recurse) def print_files(dir): def print_a_file(n, d): if not d: l = dir.path + [n] sys.stdout.write('\ntest.write(%s, """\\\n' % l) p = os.path.join(directory, *l) sys.stdout.write(open(p, 'r').read()) sys.stdout.write('""")\n') dir.call_for_each_entry(print_a_file) def recurse(n, d): if d: print_files(d) dir.call_for_each_entry(recurse) for dirpath, dirnames, filenames in os.walk(directory): dir = lookup(dirpath) for f in fnames: dir.entries[f] = None subdir_list = [] collect_dirs(subdir_list, Top) subdir_list = [ str(l) for l in subdir_list ] sys.stdout.write('test.subdir(' + ',\n '.join(subdir_list) + ')\n') print_files(Top) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/docs-update-generated.py0000664000175000017500000000330513160023037020746 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Searches through the whole source tree and updates # the generated *.gen/*.mod files in the docs folder, keeping all # documentation for the tools, builders and functions... # as well as the entity declarations for them. # Uses scons-proc.py under the hood... # from __future__ import print_function import os import sys import SConsDoc # Directory where all generated files are stored gen_folder = os.path.join('doc','generated') def argpair(key): """ Return the argument pair *.gen,*.mod for the given key. """ arg = '%s,%s' % (os.path.join(gen_folder,'%s.gen' % key), os.path.join(gen_folder,'%s.mod' % key)) return arg def generate_all(): """ Scan for XML files in the src directory and call scons-proc.py to generate the *.gen/*.mod files from it. """ flist = [] for path, dirs, files in os.walk('src'): for f in files: if f.endswith('.xml'): fpath = os.path.join(path, f) if SConsDoc.isSConsXml(fpath): flist.append(fpath) if flist: # Does the destination folder exist if not os.path.isdir(gen_folder): try: os.makedirs(gen_folder) except: print("Couldn't create destination folder %s! Exiting..." % gen_folder) return # Call scons-proc.py os.system('%s %s -b %s -f %s -t %s -v %s %s' % (sys.executable, os.path.join('bin','scons-proc.py'), argpair('builders'), argpair('functions'), argpair('tools'), argpair('variables'), ' '.join(flist))) if __name__ == "__main__": generate_all() scons-src-3.0.0/bin/time-scons.py0000664000175000017500000003007213160023037016664 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # time-scons.py: a wrapper script for running SCons timings # # This script exists to: # # 1) Wrap the invocation of runtest.py to run the actual TimeSCons # timings consistently. It does this specifically by building # SCons first, so .pyc compilation is not part of the timing. # # 2) Provide an interface for running TimeSCons timings against # earlier revisions, before the whole TimeSCons infrastructure # was "frozen" to provide consistent timings. This is done # by updating the specific pieces containing the TimeSCons # infrastructure to the earliest revision at which those pieces # were "stable enough." # # By encapsulating all the logic in this script, our Buildbot # infrastructure only needs to call this script, and we should be able # to change what we need to in this script and have it affect the build # automatically when the source code is updated, without having to # restart either master or slave. import optparse import os import shutil import subprocess import sys import tempfile import xml.sax.handler SubversionURL = 'http://scons.tigris.org/svn/scons' # This is the baseline revision when the TimeSCons scripts first # stabilized and collected "real," consistent timings. If we're timing # a revision prior to this, we'll forcibly update the TimeSCons pieces # of the tree to this revision to collect consistent timings for earlier # revisions. TimeSCons_revision = 4569 # The pieces of the TimeSCons infrastructure that are necessary to # produce consistent timings, even when the rest of the tree is from # an earlier revision that doesn't have these pieces. TimeSCons_pieces = ['QMTest', 'timings', 'runtest.py'] class CommandRunner(object): """ Executor class for commands, including "commands" implemented by Python functions. """ verbose = True active = True def __init__(self, dictionary={}): self.subst_dictionary(dictionary) def subst_dictionary(self, dictionary): self._subst_dictionary = dictionary def subst(self, string, dictionary=None): """ Substitutes (via the format operator) the values in the specified dictionary into the specified command. The command can be an (action, string) tuple. In all cases, we perform substitution on strings and don't worry if something isn't a string. (It's probably a Python function to be executed.) """ if dictionary is None: dictionary = self._subst_dictionary if dictionary: try: string = string % dictionary except TypeError: pass return string def display(self, command, stdout=None, stderr=None): if not self.verbose: return if isinstance(command, tuple): func = command[0] args = command[1:] s = '%s(%s)' % (func.__name__, ', '.join(map(repr, args))) if isinstance(command, list): # TODO: quote arguments containing spaces # TODO: handle meta characters? s = ' '.join(command) else: s = self.subst(command) if not s.endswith('\n'): s += '\n' sys.stdout.write(s) sys.stdout.flush() def execute(self, command, stdout=None, stderr=None): """ Executes a single command. """ if not self.active: return 0 if isinstance(command, str): command = self.subst(command) cmdargs = shlex.split(command) if cmdargs[0] == 'cd': command = (os.chdir,) + tuple(cmdargs[1:]) if isinstance(command, tuple): func = command[0] args = command[1:] return func(*args) else: if stdout is sys.stdout: # Same as passing sys.stdout, except works with python2.4. subout = None elif stdout is None: # Open pipe for anything else so Popen works on python2.4. subout = subprocess.PIPE else: subout = stdout if stderr is sys.stderr: # Same as passing sys.stdout, except works with python2.4. suberr = None elif stderr is None: # Merge with stdout if stderr isn't specified. suberr = subprocess.STDOUT else: suberr = stderr p = subprocess.Popen(command, shell=(sys.platform == 'win32'), stdout=subout, stderr=suberr) p.wait() return p.returncode def run(self, command, display=None, stdout=None, stderr=None): """ Runs a single command, displaying it first. """ if display is None: display = command self.display(display) return self.execute(command, stdout, stderr) def run_list(self, command_list, **kw): """ Runs a list of commands, stopping with the first error. Returns the exit status of the first failed command, or 0 on success. """ status = 0 for command in command_list: s = self.run(command, **kw) if s and status == 0: status = s return 0 def get_svn_revisions(branch, revisions=None): """ Fetch the actual SVN revisions for the given branch querying "svn log." A string specifying a range of revisions can be supplied to restrict the output to a subset of the entire log. """ command = ['svn', 'log', '--xml'] if revisions: command.extend(['-r', revisions]) command.append(branch) p = subprocess.Popen(command, stdout=subprocess.PIPE) class SVNLogHandler(xml.sax.handler.ContentHandler): def __init__(self): self.revisions = [] def startElement(self, name, attributes): if name == 'logentry': self.revisions.append(int(attributes['revision'])) parser = xml.sax.make_parser() handler = SVNLogHandler() parser.setContentHandler(handler) parser.parse(p.stdout) return sorted(handler.revisions) def prepare_commands(): """ Returns a list of the commands to be executed to prepare the tree for testing. This involves building SCons, specifically the build/scons subdirectory where our packaging build is staged, and then running setup.py to create a local installed copy with compiled *.pyc files. The build directory gets removed first. """ commands = [] if os.path.exists('build'): commands.extend([ ['mv', 'build', 'build.OLD'], ['rm', '-rf', 'build.OLD'], ]) commands.append([sys.executable, 'bootstrap.py', 'build/scons']) commands.append([sys.executable, 'build/scons/setup.py', 'install', '--prefix=' + os.path.abspath('build/usr')]) return commands def script_command(script): """Returns the command to actually invoke the specified timing script using our "built" scons.""" return [sys.executable, 'runtest.py', '-x', 'build/usr/bin/scons', script] def do_revisions(cr, opts, branch, revisions, scripts): """ Time the SCons branch specified scripts through a list of revisions. We assume we're in a (temporary) directory in which we can check out the source for the specified revisions. """ stdout = sys.stdout stderr = sys.stderr status = 0 if opts.logsdir and not opts.no_exec and len(scripts) > 1: for script in scripts: subdir = os.path.basename(os.path.dirname(script)) logsubdir = os.path.join(opts.origin, opts.logsdir, subdir) if not os.path.exists(logsubdir): os.makedirs(logsubdir) for this_revision in revisions: if opts.logsdir and not opts.no_exec: log_name = '%s.log' % this_revision log_file = os.path.join(opts.origin, opts.logsdir, log_name) stdout = open(log_file, 'w') stderr = None commands = [ ['svn', 'co', '-q', '-r', str(this_revision), branch, '.'], ] if int(this_revision) < int(TimeSCons_revision): commands.append(['svn', 'up', '-q', '-r', str(TimeSCons_revision)] + TimeSCons_pieces) commands.extend(prepare_commands()) s = cr.run_list(commands, stdout=stdout, stderr=stderr) if s: if status == 0: status = s continue for script in scripts: if opts.logsdir and not opts.no_exec and len(scripts) > 1: subdir = os.path.basename(os.path.dirname(script)) lf = os.path.join(opts.origin, opts.logsdir, subdir, log_name) out = open(lf, 'w') err = None close_out = True else: out = stdout err = stderr close_out = False s = cr.run(script_command(script), stdout=out, stderr=err) if s and status == 0: status = s if close_out: out.close() out = None if int(this_revision) < int(TimeSCons_revision): # "Revert" the pieces that we previously updated to the # TimeSCons_revision, so the update to the next revision # works cleanly. command = (['svn', 'up', '-q', '-r', str(this_revision)] + TimeSCons_pieces) s = cr.run(command, stdout=stdout, stderr=stderr) if s: if status == 0: status = s continue if stdout not in (sys.stdout, None): stdout.close() stdout = None return status Usage = """\ time-scons.py [-hnq] [-r REVISION ...] [--branch BRANCH] [--logsdir DIR] [--svn] SCRIPT ...""" def main(argv=None): if argv is None: argv = sys.argv parser = optparse.OptionParser(usage=Usage) parser.add_option("--branch", metavar="BRANCH", default="trunk", help="time revision on BRANCH") parser.add_option("--logsdir", metavar="DIR", default='.', help="generate separate log files for each revision") parser.add_option("-n", "--no-exec", action="store_true", help="no execute, just print the command line") parser.add_option("-q", "--quiet", action="store_true", help="quiet, don't print the command line") parser.add_option("-r", "--revision", metavar="REVISION", help="time specified revisions") parser.add_option("--svn", action="store_true", help="fetch actual revisions for BRANCH") opts, scripts = parser.parse_args(argv[1:]) if not scripts: sys.stderr.write('No scripts specified.\n') sys.exit(1) CommandRunner.verbose = not opts.quiet CommandRunner.active = not opts.no_exec cr = CommandRunner() os.environ['TESTSCONS_SCONSFLAGS'] = '' branch = SubversionURL + '/' + opts.branch if opts.svn: revisions = get_svn_revisions(branch, opts.revision) elif opts.revision: # TODO(sgk): parse this for SVN-style revision strings revisions = [opts.revision] else: revisions = None if opts.logsdir and not os.path.exists(opts.logsdir): os.makedirs(opts.logsdir) if revisions: opts.origin = os.getcwd() tempdir = tempfile.mkdtemp(prefix='time-scons-') try: os.chdir(tempdir) status = do_revisions(cr, opts, branch, revisions, scripts) finally: os.chdir(opts.origin) shutil.rmtree(tempdir) else: commands = prepare_commands() commands.extend([ script_command(script) for script in scripts ]) status = cr.run_list(commands, stdout=sys.stdout, stderr=sys.stderr) return status if __name__ == "__main__": sys.exit(main()) scons-src-3.0.0/bin/scons-test.py0000664000175000017500000001651313160023037016711 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # A script that takes an scons-src-{version}.zip file, unwraps it in # a temporary location, and calls runtest.py to execute one or more of # its tests. # # The default is to download the latest scons-src archive from the SCons # web site, and to execute all of the tests. # # With a little more work, this will become the basis of an automated # testing and reporting system that anyone will be able to use to # participate in testing SCons on their system and regularly reporting # back the results. A --xml option is a stab at gathering a lot of # relevant information about the system, the Python version, etc., # so that problems on different platforms can be identified sooner. # from __future__ import print_function import atexit import getopt import imp import os import os.path import sys import tempfile import time import zipfile try: # try Python 3.x style from urllib.request import urlretrieve except ImportError: # nope, must be 2.x; this hack is equivalent import imp # protect import from fixer urlretrieve = imp.load_module('urllib', *imp.find_module('urllib')).urlretrieve helpstr = """\ Usage: scons-test.py [-f zipfile] [-o outdir] [-v] [--xml] [runtest arguments] Options: -f FILE Specify input .zip FILE name -o DIR, --out DIR Change output directory name to DIR -v, --verbose Print file names when extracting --xml XML output """ opts, args = getopt.getopt(sys.argv[1:], "f:o:v", ['file=', 'out=', 'verbose', 'xml']) format = None outdir = None printname = lambda x: x inputfile = 'http://scons.sourceforge.net/scons-src-latest.zip' for o, a in opts: if o == '-f' or o == '--file': inputfile = a elif o == '-o' or o == '--out': outdir = a elif o == '-v' or o == '--verbose': def printname(x): print(x) elif o == '--xml': format = o startdir = os.getcwd() tempfile.template = 'scons-test.' tempdir = tempfile.mktemp() if not os.path.exists(tempdir): os.mkdir(tempdir) def cleanup(tempdir=tempdir): import shutil os.chdir(startdir) shutil.rmtree(tempdir) atexit.register(cleanup) # Fetch the input file if it happens to be across a network somewhere. # Ohmigod, does Python make this simple... inputfile, headers = urlretrieve(inputfile) # Unzip the header file in the output directory. We use our own code # (lifted from scons-unzip.py) to make the output subdirectory name # match the basename of the .zip file. zf = zipfile.ZipFile(inputfile, 'r') if outdir is None: name, _ = os.path.splitext(os.path.basename(inputfile)) outdir = os.path.join(tempdir, name) def outname(n, outdir=outdir): l = [] while True: n, tail = os.path.split(n) if not n: break l.append(tail) l.append(outdir) l.reverse() return os.path.join(*l) for name in zf.namelist(): dest = outname(name) dir = os.path.dirname(dest) try: os.makedirs(dir) except: pass printname(dest) # if the file exists, then delete it before writing # to it so that we don't end up trying to write to a symlink: if os.path.isfile(dest) or os.path.islink(dest): os.unlink(dest) if not os.path.isdir(dest): open(dest, 'w').write(zf.read(name)) os.chdir(outdir) # Load (by hand) the SCons modules we just unwrapped so we can # extract their version information. Note that we have to override # SCons.Script.main() with a do_nothing() function, because loading up # the 'scons' script will actually try to execute SCons... src_script = os.path.join(outdir, 'src', 'script') src_engine = os.path.join(outdir, 'src', 'engine') src_engine_SCons = os.path.join(src_engine, 'SCons') fp, pname, desc = imp.find_module('SCons', [src_engine]) SCons = imp.load_module('SCons', fp, pname, desc) fp, pname, desc = imp.find_module('Script', [src_engine_SCons]) SCons.Script = imp.load_module('Script', fp, pname, desc) def do_nothing(): pass SCons.Script.main = do_nothing fp, pname, desc = imp.find_module('scons', [src_script]) scons = imp.load_module('scons', fp, pname, desc) fp.close() # Default is to run all the tests by passing the -a flags to runtest.py. if not args: runtest_args = '-a' else: runtest_args = ' '.join(args) if format == '--xml': print("") print(" ") sys_keys = ['byteorder', 'exec_prefix', 'executable', 'maxint', 'maxunicode', 'platform', 'prefix', 'version', 'version_info'] for k in sys_keys: print(" <%s>%s" % (k, sys.__dict__[k], k)) print(" ") fmt = '%a %b %d %H:%M:%S %Y' print(" ") print(" %s" % tempdir) def print_version_info(tag, module): print(" <%s>" % tag) print(" %s" % module.__version__) print(" %s" % module.__build__) print(" %s" % module.__buildsys__) print(" %s" % module.__date__) print(" %s" % module.__developer__) print(" " % tag) print(" ") print_version_info("script", scons) print_version_info("engine", SCons) print(" ") environ_keys = [ 'PATH', 'SCONSFLAGS', 'SCONS_LIB_DIR', 'PYTHON_ROOT', 'QTDIR', 'COMSPEC', 'INTEL_LICENSE_FILE', 'INCLUDE', 'LIB', 'MSDEVDIR', 'OS', 'PATHEXT', 'SystemRoot', 'TEMP', 'TMP', 'USERNAME', 'VXDOMNTOOLS', 'WINDIR', 'XYZZY' 'ENV', 'HOME', 'LANG', 'LANGUAGE', 'LOGNAME', 'MACHINE', 'OLDPWD', 'PWD', 'OPSYS', 'SHELL', 'TMPDIR', 'USER', ] print(" ") for key in sorted(environ_keys): value = os.environ.get(key) if value: print(" ") print(" %s" % key) print(" %s" % value) print(" ") print(" ") command = '"%s" runtest.py -q -o - --xml %s' % (sys.executable, runtest_args) #print(command) os.system(command) print("") else: def print_version_info(tag, module): print("\t%s: v%s.%s, %s, by %s on %s" % (tag, module.__version__, module.__build__, module.__date__, module.__developer__, module.__buildsys__)) print("SCons by Steven Knight et al.:") print_version_info("script", scons) print_version_info("engine", SCons) command = '"%s" runtest.py %s' % (sys.executable, runtest_args) #print(command) os.system(command) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/xml_export-LICENSE0000664000175000017500000000523413160023037017437 0ustar bdbaddogbdbaddogCopyright (c) 2002 Open Source Development Network, Inc. ("OSDN") Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 2. Neither the names of VA Software Corporation, OSDN, SourceForge.net, the SourceForge.net Site Documentation project, nor the names of its contributors may be used to endorse or promote products derived from the Software without specific prior written permission of OSDN. 3. The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the Software without specific, written prior permission. Title to copyright in the Software and any associated documentation will at all times remain with copyright holders. 4. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. We recommend that you provide URLs to the location from which the code is derived. 5. Altered versions of the Software must be plainly marked as such, and must not be misrepresented as being the original Software. 6. The origin of the Software must not be misrepresented; you must not claim that you wrote the original Software. If you use the Software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 7. The data files supplied as input to, or produced as output from, the programs of the Software do not automatically fall under the copyright of the Software, but belong to whomever generated them, and may be sold commercially, and may be aggregated with the Software. 8. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE OR DOCUMENTATION. This Software consists of contributions made by OSDN and many individuals on behalf of OSDN. Specific attributions are listed in the accompanying credits file. scons-src-3.0.0/bin/calibrate.py0000664000175000017500000000621313160023037016531 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import division, print_function import optparse import os import re import subprocess import sys variable_re = re.compile('^VARIABLE: (.*)$', re.M) elapsed_re = re.compile('^ELAPSED: (.*)$', re.M) def main(argv=None): if argv is None: argv = sys.argv parser = optparse.OptionParser(usage="calibrate.py [-h] [-p PACKAGE], [--min time] [--max time] timings/*/*-run.py") parser.add_option('--min', type='float', default=9.5, help="minimum acceptable execution time (default 9.5)") parser.add_option('--max', type='float', default=10.00, help="maximum acceptable execution time (default 10.00)") parser.add_option('-p', '--package', type="string", help="package type") opts, args = parser.parse_args(argv[1:]) os.environ['TIMESCONS_CALIBRATE'] = '1' for arg in args: if len(args) > 1: print(arg + ':') command = [sys.executable, 'runtest.py'] if opts.package: command.extend(['-p', opts.package]) command.append(arg) run = 1 good = 0 while good < 3: p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = p.communicate()[0] vm = variable_re.search(output) em = elapsed_re.search(output) try: elapsed = float(em.group(1)) except AttributeError: print(output) raise print("run %3d: %7.3f: %s" % (run, elapsed, ' '.join(vm.groups()))) if opts.min < elapsed and elapsed < opts.max: good += 1 else: good = 0 for v in vm.groups(): var, value = v.split('=', 1) value = int((int(value) * opts.max) // elapsed) os.environ[var] = str(value) run += 1 return 0 if __name__ == "__main__": sys.exit(main()) scons-src-3.0.0/bin/rsync-sourceforge0000664000175000017500000000206313160023037017632 0ustar bdbaddogbdbaddog#!/bin/sh # # Sync this directory tree with sourceforge. # # Cribbed and modified from Peter Miller's same-named script in # /home/groups/a/ae/aegis/aegis at SourceForge. # # Guide to what this does with rsync: # # --rsh=ssh use ssh for the transfer # -l copy symlinks as symlinks # -p preserve permissions # -r recursive # -t preserve times # -z compress data # --stats file transfer statistics # --exclude exclude files matching the pattern # --delete delete files that don't exist locally # --delete-excluded delete files that match the --exclude patterns # --progress show progress during the transfer # -v verbose # LOCAL=/home/scons/scons REMOTE=/home/groups/s/sc/scons/scons /usr/bin/rsync --rsh=ssh -l -p -r -t -z --stats \ --exclude build \ --exclude "*,D" \ --exclude "*.pyc" \ --exclude aegis.log \ --delete --delete-excluded \ --progress -v \ ${LOCAL}/. scons.sourceforge.net:${REMOTE}/. scons-src-3.0.0/bin/docs-create-example-outputs.py0000664000175000017500000000113713160023037022146 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Searches through the whole doc/user tree and creates # all output files for the single examples. # from __future__ import print_function import os import sys import SConsExamples if __name__ == "__main__": print("Checking whether all example names are unique...") if SConsExamples.exampleNamesAreUnique(os.path.join('doc','user')): print("OK") else: print("Not all example names and suffixes are unique! Please correct the errors listed above and try again.") sys.exit(1) SConsExamples.createAllExampleOutputs(os.path.join('doc','user')) scons-src-3.0.0/bin/scons-unzip.py0000664000175000017500000000363313160023037017076 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # A quick script to unzip a .zip archive and put the files in a # subdirectory that matches the basename of the .zip file. # # This is actually generic functionality, it's not SCons-specific, but # I'm using this to make it more convenient to manage working on multiple # changes on Windows, where I don't have access to my Aegis tools. # from __future__ import print_function import getopt import os.path import sys import zipfile helpstr = """\ Usage: scons-unzip.py [-o outdir] zipfile Options: -o DIR, --out DIR Change output directory name to DIR -v, --verbose Print file names when extracting """ opts, args = getopt.getopt(sys.argv[1:], "o:v", ['out=', 'verbose']) outdir = None printname = lambda x: x for o, a in opts: if o == '-o' or o == '--out': outdir = a elif o == '-v' or o == '--verbose': def printname(x): print(x) if len(args) != 1: sys.stderr.write("scons-unzip.py: \n") sys.exit(1) zf = zipfile.ZipFile(str(args[0]), 'r') if outdir is None: outdir, _ = os.path.splitext(os.path.basename(args[0])) def outname(n, outdir=outdir): l = [] while True: n, tail = os.path.split(n) if not n: break l.append(tail) l.append(outdir) l.reverse() return os.path.join(*l) for name in zf.namelist(): dest = outname(name) dir = os.path.dirname(dest) try: os.makedirs(dir) except: pass printname(dest) # if the file exists, then delete it before writing # to it so that we don't end up trying to write to a symlink: if os.path.isfile(dest) or os.path.islink(dest): os.unlink(dest) if not os.path.isdir(dest): open(dest, 'w').write(zf.read(name)) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/scons-review.sh0000775000175000017500000000114413160023037017212 0ustar bdbaddogbdbaddog#!/bin/sh case "$1" in '') exec svn diff --diff-cmd diff -x -c $* ;; -m) svn diff --diff-cmd diff -x -c $* | alpine scons-dev ;; *) echo "Error: unknown option '$1"; exit 1 ;; esac # OLD CODE FOR USE WITH AEGIS # #if test $# -ne 1; then # echo "Usage: scons-review change#" >&2 # exit 1 #fi #if test "X$AEGIS_PROJECT" = "X"; then # echo "scons-review: AEGIS_PROJECT is not set" >&2 # exit 1 #fi #DIR=`aegis -cd -dd $*` #if test "X${DIR}" = "X"; then # echo "scons-review: No Aegis directory for '$*'" >&2 # exit 1 #fi #(cd ${DIR} && find * -name '*,D' | sort | xargs cat) | pine scons-dev scons-src-3.0.0/bin/SConsExamples.py0000664000175000017500000007605513160023037017342 0ustar bdbaddogbdbaddog# !/usr/bin/env python # # Copyright (c) 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # # This script looks for some XML tags that describe SCons example # configurations and commands to execute in those configurations, and # uses TestCmd.py to execute the commands and insert the output from # those commands into the XML that we output. This way, we can run a # script and update all of our example documentation output without # a lot of laborious by-hand checking. # # An "SCons example" looks like this, and essentially describes a set of # input files (program source files as well as SConscript files): # # # # env = Environment() # env.Program('foo') # # # int main() { printf("foo.c\n"); } # # # # The contents within the tag will get written # into a temporary directory whenever example output needs to be # generated. By default, the contents are not inserted into text # directly, unless you set the "printme" attribute on one or more files, # in which case they will get inserted within a tag. # This makes it easy to define the example at the appropriate # point in the text where you intend to show the SConstruct file. # # Note that you should usually give the a "name" # attribute so that you can refer to the example configuration later to # run SCons and generate output. # # If you just want to show a file's contents without worry about running # SCons, there's a shorter tag: # # # env = Environment() # env.Program('foo') # # # This is essentially equivalent to , # but it's more straightforward. # # SCons output is generated from the following sort of tag: # # # scons -Q foo # scons -Q foo # # # You tell it which example to use with the "example" attribute, and then # give it a list of tags to execute. You can also # supply an "os" tag, which specifies the type of operating system this # example is intended to show; if you omit this, default value is "posix". # # The generated XML will show the command line (with the appropriate # command-line prompt for the operating system), execute the command in # a temporary directory with the example files, capture the standard # output from SCons, and insert it into the text as appropriate. # Error output gets passed through to your error output so you # can see if there are any problems executing the command. # from __future__ import print_function import os import re import sys import time import SConsDoc from SConsDoc import tf as stf # # The available types for ExampleFile entries # FT_FILE = 0 # a physical file (=) FT_FILEREF = 1 # a reference (=) class ExampleFile: def __init__(self, type_=FT_FILE): self.type = type_ self.name = '' self.content = '' self.chmod = '' def isFileRef(self): return self.type == FT_FILEREF class ExampleFolder: def __init__(self): self.name = '' self.chmod = '' class ExampleCommand: def __init__(self): self.edit = None self.environment = '' self.output = '' self.cmd = '' class ExampleOutput: def __init__(self): self.name = '' self.tools = '' self.os = 'posix' self.preserve = None self.suffix = '' self.commands = [] class ExampleInfo: def __init__(self): self.name = '' self.files = [] self.folders = [] self.outputs = [] def getFileContents(self, fname): for f in self.files: if fname == f.name and not f.isFileRef(): return f.content return '' def readExampleInfos(fpath, examples): """ Add the example infos for the file fpath to the global dictionary examples. """ # Create doctree t = SConsDoc.SConsDocTree() t.parseXmlFile(fpath) # Parse scons_examples for e in stf.findAll(t.root, "scons_example", SConsDoc.dbxid, t.xpath_context, t.nsmap): n = '' if stf.hasAttribute(e, 'name'): n = stf.getAttribute(e, 'name') if n and n not in examples: i = ExampleInfo() i.name = n examples[n] = i # Parse file and directory entries for f in stf.findAll(e, "file", SConsDoc.dbxid, t.xpath_context, t.nsmap): fi = ExampleFile() if stf.hasAttribute(f, 'name'): fi.name = stf.getAttribute(f, 'name') if stf.hasAttribute(f, 'chmod'): fi.chmod = stf.getAttribute(f, 'chmod') fi.content = stf.getText(f) examples[n].files.append(fi) for d in stf.findAll(e, "directory", SConsDoc.dbxid, t.xpath_context, t.nsmap): di = ExampleFolder() if stf.hasAttribute(d, 'name'): di.name = stf.getAttribute(d, 'name') if stf.hasAttribute(d, 'chmod'): di.chmod = stf.getAttribute(d, 'chmod') examples[n].folders.append(di) # Parse scons_example_files for f in stf.findAll(t.root, "scons_example_file", SConsDoc.dbxid, t.xpath_context, t.nsmap): if stf.hasAttribute(f, 'example'): e = stf.getAttribute(f, 'example') else: continue fi = ExampleFile(FT_FILEREF) if stf.hasAttribute(f, 'name'): fi.name = stf.getAttribute(f, 'name') if stf.hasAttribute(f, 'chmod'): fi.chmod = stf.getAttribute(f, 'chmod') fi.content = stf.getText(f) examples[e].files.append(fi) # Parse scons_output for o in stf.findAll(t.root, "scons_output", SConsDoc.dbxid, t.xpath_context, t.nsmap): if stf.hasAttribute(o, 'example'): n = stf.getAttribute(o, 'example') else: continue eout = ExampleOutput() if stf.hasAttribute(o, 'name'): eout.name = stf.getAttribute(o, 'name') if stf.hasAttribute(o, 'tools'): eout.tools = stf.getAttribute(o, 'tools') if stf.hasAttribute(o, 'os'): eout.os = stf.getAttribute(o, 'os') if stf.hasAttribute(o, 'suffix'): eout.suffix = stf.getAttribute(o, 'suffix') for c in stf.findAll(o, "scons_output_command", SConsDoc.dbxid, t.xpath_context, t.nsmap): oc = ExampleCommand() if stf.hasAttribute(c, 'edit'): oc.edit = stf.getAttribute(c, 'edit') if stf.hasAttribute(c, 'environment'): oc.environment = stf.getAttribute(c, 'environment') if stf.hasAttribute(c, 'output'): oc.output = stf.getAttribute(c, 'output') if stf.hasAttribute(c, 'cmd'): oc.cmd = stf.getAttribute(c, 'cmd') else: oc.cmd = stf.getText(c) eout.commands.append(oc) examples[n].outputs.append(eout) def readAllExampleInfos(dpath): """ Scan for XML files in the given directory and collect together all relevant infos (files/folders, output commands) in a map, which gets returned. """ examples = {} for path, dirs, files in os.walk(dpath): for f in files: if f.endswith('.xml'): fpath = os.path.join(path, f) if SConsDoc.isSConsXml(fpath): readExampleInfos(fpath, examples) return examples generated_examples = os.path.join('doc', 'generated', 'examples') def ensureExampleOutputsExist(dpath): """ Scan for XML files in the given directory and ensure that for every example output we have a corresponding output file in the 'generated/examples' folder. """ # Ensure that the output folder exists if not os.path.isdir(generated_examples): os.mkdir(generated_examples) examples = readAllExampleInfos(dpath) for key, value in examples.items(): # Process all scons_output tags for o in value.outputs: cpath = os.path.join(generated_examples, key + '_' + o.suffix + '.xml') if not os.path.isfile(cpath): # Start new XML file s = stf.newXmlTree("screen") stf.setText(s, "NO OUTPUT YET! Run the script to generate/update all examples.") # Write file stf.writeTree(s, cpath) # Process all scons_example_file tags for r in value.files: if r.isFileRef(): # Get file's content content = value.getFileContents(r.name) fpath = os.path.join(generated_examples, key + '_' + r.name.replace("/", "_")) # Write file f = open(fpath, 'w') f.write("%s\n" % content) f.close() perc = "%" def createAllExampleOutputs(dpath): """ Scan for XML files in the given directory and creates all output files for every example in the 'generated/examples' folder. """ # Ensure that the output folder exists if not os.path.isdir(generated_examples): os.mkdir(generated_examples) examples = readAllExampleInfos(dpath) total = len(examples) idx = 0 for key, value in examples.items(): # Process all scons_output tags print("%.2f%s (%d/%d) %s" % (float(idx + 1) * 100.0 / float(total), perc, idx + 1, total, key)) create_scons_output(value) # Process all scons_example_file tags for r in value.files: if r.isFileRef(): # Get file's content content = value.getFileContents(r.name) fpath = os.path.join(generated_examples, key + '_' + r.name.replace("/", "_")) # Write file f = open(fpath, 'w') f.write("%s\n" % content) f.close() idx += 1 def collectSConsExampleNames(fpath): """ Return a set() of example names, used in the given file fpath. """ names = set() suffixes = {} failed_suffixes = False # Create doctree t = SConsDoc.SConsDocTree() t.parseXmlFile(fpath) # Parse it for e in stf.findAll(t.root, "scons_example", SConsDoc.dbxid, t.xpath_context, t.nsmap): n = '' if stf.hasAttribute(e, 'name'): n = stf.getAttribute(e, 'name') if n: names.add(n) if n not in suffixes: suffixes[n] = [] else: print("Error: Example in file '%s' is missing a name!" % fpath) failed_suffixes = True for o in stf.findAll(t.root, "scons_output", SConsDoc.dbxid, t.xpath_context, t.nsmap): n = '' if stf.hasAttribute(o, 'example'): n = stf.getAttribute(o, 'example') else: print("Error: scons_output in file '%s' is missing an example name!" % fpath) failed_suffixes = True if n not in suffixes: print("Error: scons_output in file '%s' is referencing non-existent example '%s'!" % (fpath, n)) failed_suffixes = True continue s = '' if stf.hasAttribute(o, 'suffix'): s = stf.getAttribute(o, 'suffix') else: print("Error: scons_output in file '%s' (example '%s') is missing a suffix!" % (fpath, n)) failed_suffixes = True if s not in suffixes[n]: suffixes[n].append(s) else: print("Error: scons_output in file '%s' (example '%s') is using a duplicate suffix '%s'!" % (fpath, n, s)) failed_suffixes = True return names, failed_suffixes def exampleNamesAreUnique(dpath): """ Scan for XML files in the given directory and check whether the scons_example names are unique. """ unique = True allnames = set() for path, dirs, files in os.walk(dpath): for f in files: if f.endswith('.xml'): fpath = os.path.join(path, f) if SConsDoc.isSConsXml(fpath): names, failed_suffixes = collectSConsExampleNames(fpath) if failed_suffixes: unique = False i = allnames.intersection(names) if i: print("Not unique in %s are: %s" % (fpath, ', '.join(i))) unique = False allnames |= names return unique # ############################################################### # # In the second half of this module (starting here) # we define the variables and functions that are required # to actually run the examples, collect their output and # write it into the files in doc/generated/examples... # which then get included by our UserGuide. # # ############################################################### sys.path.append(os.path.join(os.getcwd(), 'QMTest')) sys.path.append(os.path.join(os.getcwd(), 'build', 'QMTest')) scons_py = os.path.join('bootstrap', 'src', 'script', 'scons.py') if not os.path.exists(scons_py): scons_py = os.path.join('src', 'script', 'scons.py') scons_py = os.path.join(os.getcwd(), scons_py) scons_lib_dir = os.path.join(os.getcwd(), 'bootstrap', 'src', 'engine') if not os.path.exists(scons_lib_dir): scons_lib_dir = os.path.join(os.getcwd(), 'src', 'engine') os.environ['SCONS_LIB_DIR'] = scons_lib_dir import TestCmd Prompt = { 'posix' : '% ', 'win32' : 'C:\\>' } # The magick SCons hackery that makes this work. # # So that our examples can still use the default SConstruct file, we # actually feed the following into SCons via stdin and then have it # SConscript() the SConstruct file. This stdin wrapper creates a set # of ToolSurrogates for the tools for the appropriate platform. These # Surrogates print output like the real tools and behave like them # without actually having to be on the right platform or have the right # tool installed. # # The upshot: The wrapper transparently changes the world out from # under the top-level SConstruct file in an example just so we can get # the command output. Stdin = """\ import os import re import SCons.Action import SCons.Defaults import SCons.Node.FS platform = '%(osname)s' Sep = { 'posix' : '/', 'win32' : '\\\\', }[platform] # Slip our own __str__() method into the EntryProxy class used to expand # $TARGET{S} and $SOURCE{S} to translate the path-name separators from # what's appropriate for the system we're running on to what's appropriate # for the example system. orig = SCons.Node.FS.EntryProxy class MyEntryProxy(orig): def __str__(self): return str(self._subject).replace(os.sep, Sep) SCons.Node.FS.EntryProxy = MyEntryProxy # Slip our own RDirs() method into the Node.FS.File class so that the # expansions of $_{CPPINC,F77INC,LIBDIR}FLAGS will have the path-name # separators translated from what's appropriate for the system we're # running on to what's appropriate for the example system. orig_RDirs = SCons.Node.FS.File.RDirs def my_RDirs(self, pathlist, orig_RDirs=orig_RDirs): return [str(x).replace(os.sep, Sep) for x in orig_RDirs(self, pathlist)] SCons.Node.FS.File.RDirs = my_RDirs class Curry(object): def __init__(self, fun, *args, **kwargs): self.fun = fun self.pending = args[:] self.kwargs = kwargs.copy() def __call__(self, *args, **kwargs): if kwargs and self.kwargs: kw = self.kwargs.copy() kw.update(kwargs) else: kw = kwargs or self.kwargs return self.fun(*self.pending + args, **kw) def Str(target, source, env, cmd=""): result = [] for cmd in env.subst_list(cmd, target=target, source=source): result.append(' '.join(map(str, cmd))) return '\\n'.join(result) class ToolSurrogate(object): def __init__(self, tool, variable, func, varlist): self.tool = tool if not isinstance(variable, list): variable = [variable] self.variable = variable self.func = func self.varlist = varlist def __call__(self, env): t = Tool(self.tool) t.generate(env) for v in self.variable: orig = env[v] try: strfunction = orig.strfunction except AttributeError: strfunction = Curry(Str, cmd=orig) # Don't call Action() through its global function name, because # that leads to infinite recursion in trying to initialize the # Default Environment. env[v] = SCons.Action.Action(self.func, strfunction=strfunction, varlist=self.varlist) def __repr__(self): # This is for the benefit of printing the 'TOOLS' # variable through env.Dump(). return repr(self.tool) def Null(target, source, env): pass def Cat(target, source, env): target = str(target[0]) f = open(target, "wb") for src in map(str, source): f.write(open(src, "rb").read()) f.close() def CCCom(target, source, env): target = str(target[0]) fp = open(target, "wb") def process(source_file, fp=fp): for line in open(source_file, "rb").readlines(): m = re.match(r'#include\s[<"]([^<"]+)[>"]', line) if m: include = m.group(1) for d in [str(env.Dir('$CPPPATH')), '.']: f = os.path.join(d, include) if os.path.exists(f): process(f) break elif line[:11] != "STRIP CCCOM": fp.write(line) for src in map(str, source): process(src) fp.write('debug = ' + ARGUMENTS.get('debug', '0') + '\\n') fp.close() public_class_re = re.compile('^public class (\S+)', re.MULTILINE) def JavaCCom(target, source, env): # This is a fake Java compiler that just looks for # public class FooBar # lines in the source file(s) and spits those out # to .class files named after the class. tlist = list(map(str, target)) not_copied = {} for t in tlist: not_copied[t] = 1 for src in map(str, source): contents = open(src, "rb").read() classes = public_class_re.findall(contents) for c in classes: for t in [x for x in tlist if x.find(c) != -1]: open(t, "wb").write(contents) del not_copied[t] for t in not_copied.keys(): open(t, "wb").write("\\n") def JavaHCom(target, source, env): tlist = map(str, target) slist = map(str, source) for t, s in zip(tlist, slist): open(t, "wb").write(open(s, "rb").read()) def JarCom(target, source, env): target = str(target[0]) class_files = [] for src in map(str, source): for dirpath, dirnames, filenames in os.walk(src): class_files.extend([ os.path.join(dirpath, f) for f in filenames if f.endswith('.class') ]) f = open(target, "wb") for cf in class_files: f.write(open(cf, "rb").read()) f.close() # XXX Adding COLOR, COLORS and PACKAGE to the 'cc' varlist(s) by hand # here is bogus. It's for the benefit of doc/user/command-line.in, which # uses examples that want to rebuild based on changes to these variables. # It would be better to figure out a way to do it based on the content of # the generated command-line, or else find a way to let the example markup # language in doc/user/command-line.in tell this script what variables to # add, but that's more difficult than I want to figure out how to do right # now, so let's just use the simple brute force approach for the moment. ToolList = { 'posix' : [('cc', ['CCCOM', 'SHCCCOM'], CCCom, ['CCFLAGS', 'CPPDEFINES', 'COLOR', 'COLORS', 'PACKAGE']), ('link', ['LINKCOM', 'SHLINKCOM'], Cat, []), ('ar', ['ARCOM', 'RANLIBCOM'], Cat, []), ('tar', 'TARCOM', Null, []), ('zip', 'ZIPCOM', Null, []), ('javac', 'JAVACCOM', JavaCCom, []), ('javah', 'JAVAHCOM', JavaHCom, []), ('jar', 'JARCOM', JarCom, []), ('rmic', 'RMICCOM', Cat, []), ], 'win32' : [('msvc', ['CCCOM', 'SHCCCOM', 'RCCOM'], CCCom, ['CCFLAGS', 'CPPDEFINES', 'COLOR', 'COLORS', 'PACKAGE']), ('mslink', ['LINKCOM', 'SHLINKCOM'], Cat, []), ('mslib', 'ARCOM', Cat, []), ('tar', 'TARCOM', Null, []), ('zip', 'ZIPCOM', Null, []), ('javac', 'JAVACCOM', JavaCCom, []), ('javah', 'JAVAHCOM', JavaHCom, []), ('jar', 'JARCOM', JarCom, []), ('rmic', 'RMICCOM', Cat, []), ], } toollist = ToolList[platform] filter_tools = '%(tools)s'.split() if filter_tools: toollist = [x for x in toollist if x[0] in filter_tools] toollist = [ToolSurrogate(*t) for t in toollist] toollist.append('install') def surrogate_spawn(sh, escape, cmd, args, env): pass def surrogate_pspawn(sh, escape, cmd, args, env, stdout, stderr): pass SCons.Defaults.ConstructionEnvironment.update({ 'PLATFORM' : platform, 'TOOLS' : toollist, 'SPAWN' : surrogate_spawn, 'PSPAWN' : surrogate_pspawn, }) SConscript('SConstruct') """ # "Commands" that we will execute in our examples. def command_scons(args, c, test, dict): save_vals = {} delete_keys = [] try: ce = c.environment except AttributeError: pass else: for arg in c.environment.split(): key, val = arg.split('=') try: save_vals[key] = os.environ[key] except KeyError: delete_keys.append(key) os.environ[key] = val test.run(interpreter=sys.executable, program=scons_py, # We use ToolSurrogates to capture win32 output by "building" # examples using a fake win32 tool chain. Suppress the # warnings that come from the new revamped VS support so # we can build doc on (Linux) systems that don't have # Visual C installed. arguments='--warn=no-visual-c-missing -f - ' + ' '.join(args), chdir=test.workpath('WORK'), stdin=Stdin % dict) os.environ.update(save_vals) for key in delete_keys: del(os.environ[key]) out = test.stdout() out = out.replace(test.workpath('ROOT'), '') out = out.replace(test.workpath('WORK/SConstruct'), '/home/my/project/SConstruct') lines = out.split('\n') if lines: while lines[-1] == '': lines = lines[:-1] # err = test.stderr() # if err: # sys.stderr.write(err) return lines def command_touch(args, c, test, dict): if args[0] == '-t': t = int(time.mktime(time.strptime(args[1], '%Y%m%d%H%M'))) times = (t, t) args = args[2:] else: time.sleep(1) times = None for file in args: if not os.path.isabs(file): file = os.path.join(test.workpath('WORK'), file) if not os.path.exists(file): open(file, 'wb') os.utime(file, times) return [] def command_edit(args, c, test, dict): if c.edit is None: add_string = 'void edit(void) { ; }\n' else: add_string = c.edit[:] if add_string[-1] != '\n': add_string = add_string + '\n' for file in args: if not os.path.isabs(file): file = os.path.join(test.workpath('WORK'), file) contents = open(file, 'rb').read() open(file, 'wb').write(contents + add_string) return [] def command_ls(args, c, test, dict): def ls(a): try: return [' '.join(sorted([x for x in os.listdir(a) if x[0] != '.']))] except OSError as e: # This should never happen. Pop into debugger import pdb; pdb.set_trace() if args: l = [] for a in args: l.extend(ls(test.workpath('WORK', a))) return l else: return ls(test.workpath('WORK')) def command_sleep(args, c, test, dict): time.sleep(int(args[0])) CommandDict = { 'scons' : command_scons, 'touch' : command_touch, 'edit' : command_edit, 'ls' : command_ls, 'sleep' : command_sleep, } def ExecuteCommand(args, c, t, dict): try: func = CommandDict[args[0]] except KeyError: func = lambda args, c, t, dict: [] return func(args[1:], c, t, dict) def create_scons_output(e): # The real raison d'etre for this script, this is where we # actually execute SCons to fetch the output. # Loop over all outputs for the example for o in e.outputs: # Create new test directory t = TestCmd.TestCmd(workdir='', combine=1) if o.preserve: t.preserve() t.subdir('ROOT', 'WORK') t.rootpath = t.workpath('ROOT').replace('\\', '\\\\') for d in e.folders: dir = t.workpath('WORK', d.name) if not os.path.exists(dir): os.makedirs(dir) for f in e.files: if f.isFileRef(): continue # # Left-align file's contents, starting on the first # non-empty line # data = f.content.split('\n') i = 0 # Skip empty lines while data[i] == '': i = i + 1 lines = data[i:] i = 0 # Scan first line for the number of spaces # that this block is indented while lines[0][i] == ' ': i = i + 1 # Left-align block lines = [l[i:] for l in lines] path = f.name.replace('__ROOT__', t.rootpath) if not os.path.isabs(path): path = t.workpath('WORK', path) dir, name = os.path.split(path) if dir and not os.path.exists(dir): os.makedirs(dir) content = '\n'.join(lines) content = content.replace('__ROOT__', t.rootpath) path = t.workpath('WORK', path) t.write(path, content) if hasattr(f, 'chmod'): if len(f.chmod): os.chmod(path, int(f.chmod, 0)) # Regular expressions for making the doc output consistent, # regardless of reported addresses or Python version. # Massage addresses in object repr strings to a constant. address_re = re.compile(r' at 0x[0-9a-fA-F]*\>') # Massage file names in stack traces (sometimes reported as absolute # paths) to a consistent relative path. engine_re = re.compile(r' File ".*/src/engine/SCons/') # Python 2.5 changed the stack trace when the module is read # from standard input from read "... line 7, in ?" to # "... line 7, in ". file_re = re.compile(r'^( *File ".*", line \d+, in) \?$', re.M) # Python 2.6 made UserList a new-style class, which changes the # AttributeError message generated by our NodeList subclass. nodelist_re = re.compile(r'(AttributeError:) NodeList instance (has no attribute \S+)') # Root element for our subtree sroot = stf.newEtreeNode("screen", True) curchild = None content = "" for c in o.commands: content += Prompt[o.os] if curchild is not None: if not c.output: # Append content as tail curchild.tail = content content = "\n" # Add new child for userinput tag curchild = stf.newEtreeNode("userinput") d = c.cmd.replace('__ROOT__', '') curchild.text = d sroot.append(curchild) else: content += c.output + '\n' else: if not c.output: # Add first text to root sroot.text = content content = "\n" # Add new child for userinput tag curchild = stf.newEtreeNode("userinput") d = c.cmd.replace('__ROOT__', '') curchild.text = d sroot.append(curchild) else: content += c.output + '\n' # Execute command and capture its output cmd_work = c.cmd.replace('__ROOT__', t.workpath('ROOT')) args = cmd_work.split() lines = ExecuteCommand(args, c, t, {'osname':o.os, 'tools':o.tools}) if not c.output and lines: ncontent = '\n'.join(lines) ncontent = address_re.sub(r' at 0x700000>', ncontent) ncontent = engine_re.sub(r' File "bootstrap/src/engine/SCons/', ncontent) ncontent = file_re.sub(r'\1 ', ncontent) ncontent = nodelist_re.sub(r"\1 'NodeList' object \2", ncontent) ncontent = ncontent.replace('__ROOT__', '') content += ncontent + '\n' # Add last piece of content if len(content): if curchild is not None: curchild.tail = content else: sroot.text = content # Construct filename fpath = os.path.join(generated_examples, e.name + '_' + o.suffix + '.xml') # Expand Element tree s = stf.decorateWithHeader(stf.convertElementTree(sroot)[0]) # Write it to file stf.writeTree(s, fpath) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/linecount.py0000664000175000017500000001020213160023037016574 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2001 - 2017 The SCons Foundation # # Count statistics about SCons test and source files. This must be run # against a fully-populated tree (for example, one that's been freshly # checked out). # # A test file is anything under the src/ directory that begins with # 'test_' or ends in 'Tests.py', or anything under the test/ directory # that ends in '.py'. Note that runtest.py script does *not*, by default, # consider the files that begin with 'test_' to be tests, because they're # tests of SCons packaging and installation, not functional tests of # SCons code. # # A source file is anything under the src/engine/ or src/script/ # directories that ends in '.py' but does NOT begin with 'test_' # or end in 'Tests.py'. # # We report the number of tests and sources, the total number of lines # in each category, the number of non-blank lines, and the number of # non-comment lines. The last figure (non-comment) lines is the most # interesting one for most purposes. from __future__ import division, print_function __revision__ = "bin/linecount.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path fmt = "%-16s %5s %7s %9s %11s %11s" class Collection(object): def __init__(self, name, files=None, pred=None): self._name = name if files is None: files = [] self.files = files if pred is None: pred = lambda x: True self.pred = pred def __call__(self, fname): return self.pred(fname) def __len__(self): return len(self.files) def collect(self, directory): for dirpath, dirnames, filenames in os.walk(directory): try: dirnames.remove('.svn') except ValueError: pass self.files.extend([ os.path.join(dirpath, f) for f in filenames if self.pred(f) ]) def lines(self): try: return self._lines except AttributeError: self._lines = lines = [] for file in self.files: file_lines = open(file).readlines() lines.extend([s.lstrip() for s in file_lines]) return lines def non_blank(self): return [s for s in self.lines() if s != ''] def non_comment(self): return [s for s in self.lines() if s == '' or s[0] != '#'] def non_blank_non_comment(self): return [s for s in self.lines() if s != '' and s[0] != '#'] def printables(self): return (self._name + ':', len(self.files), len(self.lines()), len(self.non_blank()), len(self.non_comment()), len(self.non_blank_non_comment())) def is_Tests_py(x): return x[-8:] == 'Tests.py' def is_test_(x): return x[:5] == 'test_' def is_python(x): return x[-3:] == '.py' def is_source(x): return is_python(x) and not is_Tests_py(x) and not is_test_(x) src_Tests_py_tests = Collection('src/ *Tests.py', pred=is_Tests_py) src_test_tests = Collection('src/ test_*.py', pred=is_test_) test_tests = Collection('test/ tests', pred=is_python) sources = Collection('sources', pred=is_source) src_Tests_py_tests.collect('src') src_test_tests.collect('src') test_tests.collect('test') sources.collect('src/engine') sources.collect('src/script') src_tests = Collection('src/ tests', src_Tests_py_tests.files + src_test_tests.files) all_tests = Collection('all tests', src_tests.files + test_tests.files) def ratio(over, under): return "%.2f" % (float(len(over)) / float(len(under))) print(fmt % ('', '', '', '', '', 'non-blank')) print(fmt % ('', 'files', 'lines', 'non-blank', 'non-comment', 'non-comment')) print() print(fmt % src_Tests_py_tests.printables()) print(fmt % src_test_tests.printables()) print() print(fmt % src_tests.printables()) print(fmt % test_tests.printables()) print() print(fmt % all_tests.printables()) print(fmt % sources.printables()) print() print(fmt % ('ratio:', ratio(all_tests, sources), ratio(all_tests.lines(), sources.lines()), ratio(all_tests.non_blank(), sources.non_blank()), ratio(all_tests.non_comment(), sources.non_comment()), ratio(all_tests.non_blank_non_comment(), sources.non_blank_non_comment()) )) scons-src-3.0.0/bin/scons-diff.py0000664000175000017500000001363513160023037016644 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # scons-diff.py - diff-like utility for comparing SCons trees # # This supports most common diff options (with some quirks, like you can't # just say -c and have it use a default value), but canonicalizes the # various version strings within the file like __revision__, __build__, # etc. so that you can diff trees without having to ignore changes in # version lines. # from __future__ import print_function import difflib import getopt import os.path import re import sys Usage = """\ Usage: scons-diff.py [OPTIONS] dir1 dir2 Options: -c NUM, --context=NUM Print NUM lines of copied context. -h, --help Print this message and exit. -n Don't canonicalize SCons lines. -q, --quiet Print only whether files differ. -r, --recursive Recursively compare found subdirectories. -s Report when two files are the same. -u NUM, --unified=NUM Print NUM lines of unified context. """ opts, args = getopt.getopt(sys.argv[1:], 'c:dhnqrsu:', ['context=', 'help', 'recursive', 'unified=']) diff_type = None edit_type = None context = 2 recursive = False report_same = False diff_options = [] def diff_line(left, right): if diff_options: opts = ' ' + ' '.join(diff_options) else: opts = '' print('diff%s %s %s' % (opts, left, right)) for o, a in opts: if o in ('-c', '-u'): diff_type = o context = int(a) diff_options.append(o) elif o in ('-h', '--help'): print(Usage) sys.exit(0) elif o in ('-n'): diff_options.append(o) edit_type = o elif o in ('-q'): diff_type = o diff_line = lambda l, r: None elif o in ('-r', '--recursive'): recursive = True diff_options.append(o) elif o in ('-s'): report_same = True try: left, right = args except ValueError: sys.stderr.write(Usage) sys.exit(1) def quiet_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'): """ A function with the same calling signature as difflib.context_diff (diff -c) and difflib.unified_diff (diff -u) but which prints output like the simple, unadorned 'diff" command. """ if a == b: return [] else: return ['Files %s and %s differ\n' % (fromfile, tofile)] def simple_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'): """ A function with the same calling signature as difflib.context_diff (diff -c) and difflib.unified_diff (diff -u) but which prints output like the simple, unadorned 'diff" command. """ sm = difflib.SequenceMatcher(None, a, b) def comma(x1, x2): return x1+1 == x2 and str(x2) or '%s,%s' % (x1+1, x2) result = [] for op, a1, a2, b1, b2 in sm.get_opcodes(): if op == 'delete': result.append("%sd%d\n" % (comma(a1, a2), b1)) result.extend(['< ' + l for l in a[a1:a2]]) elif op == 'insert': result.append("%da%s\n" % (a1, comma(b1, b2))) result.extend(['> ' + l for l in b[b1:b2]]) elif op == 'replace': result.append("%sc%s\n" % (comma(a1, a2), comma(b1, b2))) result.extend(['< ' + l for l in a[a1:a2]]) result.append('---\n') result.extend(['> ' + l for l in b[b1:b2]]) return result diff_map = { '-c' : difflib.context_diff, '-q' : quiet_diff, '-u' : difflib.unified_diff, } diff_function = diff_map.get(diff_type, simple_diff) baseline_re = re.compile('(# |@REM )/home/\S+/baseline/') comment_rev_re = re.compile('(# |@REM )(\S+) 0.96.[CD]\d+ \S+ \S+( knight)') revision_re = re.compile('__revision__ = "[^"]*"') build_re = re.compile('__build__ = "[^"]*"') date_re = re.compile('__date__ = "[^"]*"') def lines_read(file): return open(file).readlines() def lines_massage(file): text = open(file).read() text = baseline_re.sub('\\1', text) text = comment_rev_re.sub('\\1\\2\\3', text) text = revision_re.sub('__revision__ = "bin/scons-diff.py"', text) text = build_re.sub('__build__ = "0.96.92.DXXX"', text) text = date_re.sub('__date__ = "2006/08/25 02:59:00"', text) return text.splitlines(1) lines_map = { '-n' : lines_read, } lines_function = lines_map.get(edit_type, lines_massage) def do_diff(left, right, diff_subdirs): if os.path.isfile(left) and os.path.isfile(right): diff_file(left, right) elif not os.path.isdir(left): diff_file(left, os.path.join(right, os.path.split(left)[1])) elif not os.path.isdir(right): diff_file(os.path.join(left, os.path.split(right)[1]), right) elif diff_subdirs: diff_dir(left, right) def diff_file(left, right): l = lines_function(left) r = lines_function(right) d = diff_function(l, r, left, right, context) try: text = ''.join(d) except IndexError: sys.stderr.write('IndexError diffing %s and %s\n' % (left, right)) else: if text: diff_line(left, right) print(text) elif report_same: print('Files %s and %s are identical' % (left, right)) def diff_dir(left, right): llist = os.listdir(left) rlist = os.listdir(right) u = {} for l in llist: u[l] = 1 for r in rlist: u[r] = 1 for x in sorted([ x for x in list(u.keys()) if x[-4:] != '.pyc' ]): if x in llist: if x in rlist: do_diff(os.path.join(left, x), os.path.join(right, x), recursive) else: print('Only in %s: %s' % (left, x)) else: print('Only in %s: %s' % (right, x)) do_diff(left, right, True) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/svn-bisect.py0000775000175000017500000000417313160023037016666 0ustar bdbaddogbdbaddog#!/usr/bin/env python # -*- Python -*- from __future__ import division, print_function import sys from math import log, ceil from optparse import OptionParser import subprocess # crack the command line parser = OptionParser( usage="%prog lower-revision upper-revision test_script [arg1 ...]", description="Binary search for a bug in a SVN checkout") (options,script_args) = parser.parse_args() # make sure we have sufficient parameters if len(script_args) < 1: parser.error("Need a lower revision") elif len(script_args) < 2: parser.error("Need an upper revision") elif len(script_args) < 3: parser.error("Need a script to run") # extract our starting values lower = int(script_args[0]) upper = int(script_args[1]) script = script_args[2:] # print an error message and quit def error(s): print("******", s, "******", file=sys.stderr) sys.exit(1) # update to the specified version and run test def testfail(revision): "Return true if test fails" print("Updating to revision", revision) if subprocess.call(["svn","up","-qr",str(revision)]) != 0: m = "SVN did not update properly to revision %d" raise RuntimeError(m % revision) return subprocess.call(script,shell=False) != 0 # confirm that the endpoints are different print("****** Checking upper bracket", upper) upperfails = testfail(upper) print("****** Checking lower bracket", lower) lowerfails = testfail(lower) if upperfails == lowerfails: error("Upper and lower revisions must bracket the failure") # binary search for transition msg = "****** max %d revisions to test (bug bracketed by [%d,%d])" while upper-lower > 1: print(msg % (ceil(log(upper-lower,2)), lower, upper)) mid = (lower + upper)//2 midfails = testfail(mid) if midfails == lowerfails: lower = mid lowerfails = midfails else: upper = mid upperfails = midfails # show which revision was first to fail if upperfails != lowerfails: lower = upper print("The error was caused by revision", lower) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/sfsum0000664000175000017500000001140213160023037015305 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # sfsum.py: A script for parsing XML data exported from # SourceForge projects. # # Right now, this is hard-coded to generate a summary of open bugs. # # XML data for SourceForge project is available for download by project # administrators. Because it's intended for backup purposes, you have # to slurp the whole set of data, including info about all of the closed # items, the feature requests, etc., so it can get big. # # You can do this by hand (if you're an administrator) with a URL like # this (where 30337 is the group_id for SCons): # # http://sourceforge.net/export/xml_export.php?group_id=30337 # # They also have a Perl script, called xml_export, available as part # of a set of utilities called "adocman" which automate dealing with # SourceForge document management from the command line. "adocman" # is available at: # # https://sourceforge.net/projects/sitedocs/ # from __future__ import print_function import xml.sax import xml.sax.saxutils import sys SFName = { 'Unassigned' : 'nobody', 'Chad Austin' : 'aegis', 'Charle Crain' : 'diewarzau', 'Steven Knight' : 'stevenknight', 'Steve Leblanc' : 'stevenleblanc', 'Jeff Petkau' : 'jpet', 'Anthony Roach' : 'anthonyroach', 'Steven Shaw' : 'steven_shaw', 'Terrel Shumway' : 'terrelshumway', 'Greg Spencer' : 'greg_spencer', 'Christoph Wiedemann' : 'wiedeman', } class Artifact(object): """Just a place to hold attributes that we find in the XML.""" pass Artifacts = {} def nws(text): """Normalize white space. This will become important if/when we enhance this to search for arbitrary fields.""" return ' '.join(text.split()) class ClassifyArtifacts(xml.sax.saxutils.DefaultHandler): """ Simple SAX subclass to classify the artifacts in SourceForge XML output. This reads up the fields in an XML description and turns the field descriptions into attributes of an Artificat object, on the fly. Artifacts are of the following types: Bugs Feature Requests Patches Support Requests We could, if we choose to, add additional types in the future by creating additional trackers. This class loses some info right now because we don't pay attention to the tag in the output, which contains a list of items that have tags in them. Right now, these just overwrite each other in the Arifact object we create. We also don't pay attention to any attributes of a tag other than the "name" attribute. We'll need to extend this class if we ever want to pay attention to those attributes. """ def __init__(self): self.artifact = None def startElement(self, name, attrs): self.text = "" if name == 'artifact': self.artifact = Artifact() elif not self.artifact is None and name == 'field': self.fname = attrs.get('name', None) def characters(self, ch): if not self.artifact is None: self.text = self.text + ch def endElement(self, name): global Artifacts if name == 'artifact': type = self.artifact.artifact_type try: list = Artifacts[type] except KeyError: Artifacts[type] = list = [] list.append(self.artifact) self.artifact = None elif not self.artifact is None and name == 'field': setattr(self.artifact, self.fname, self.text) if __name__ == '__main__': # Create a parser. parser = xml.sax.make_parser() # Tell the parser we are not interested in XML namespaces. parser.setFeature(xml.sax.handler.feature_namespaces, 0) # Instantiate our handler and tell the parser to use it. parser.setContentHandler(ClassifyArtifacts()) # Parse the input. parser.parse(sys.argv[1]) # Hard-coded search for 'Open' bugs. This should be easily # generalized once we figure out other things for this script to do. bugs = [x for x in Artifacts['Bugs'] if x.status == 'Open'] print(list(Artifacts.keys())) print("%d open bugs" % len(bugs)) # Sort them into a separate list for each assignee. Assigned = {} for bug in bugs: a = bug.assigned_to try: list = Assigned[a] except KeyError: Assigned[a] = list = [] list.append(bug) for a in SFName.keys(): try: b = Assigned[SFName[a]] except KeyError: pass else: print(" %s" % a) b.sort(key=lambda x, y: (x.artifact_id, y.artifact_id)) for bug in b: print(" %-6s %s" % (bug.artifact_id, bug.summary)) scons-src-3.0.0/bin/caller-tree.py0000664000175000017500000000623213160023037017003 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Quick script to process the *summary* output from SCons.Debug.caller() # and print indented calling trees with call counts. # # The way to use this is to add something like the following to a function # for which you want information about who calls it and how many times: # # from SCons.Debug import caller # caller(0, 1, 2, 3, 4, 5) # # Each integer represents how many stack frames back SCons will go # and capture the calling information, so in the above example it will # capture the calls six levels up the stack in a central dictionary. # # At the end of any run where SCons.Debug.caller() is used, SCons will # print a summary of the calls and counts that looks like the following: # # Callers of Node/__init__.py:629(calc_signature): # 1 Node/__init__.py:683(calc_signature) # Callers of Node/__init__.py:676(gen_binfo): # 6 Node/FS.py:2035(current) # 1 Node/__init__.py:722(get_bsig) # # If you cut-and-paste that summary output and feed it to this script # on standard input, it will figure out how these entries hook up and # print a calling tree for each one looking something like: # # Node/__init__.py:676(gen_binfo) # Node/FS.py:2035(current) 6 # Taskmaster.py:253(make_ready_current) 18 # Script/Main.py:201(make_ready) 18 # # Note that you should *not* look at the call-count numbers in the right # hand column as the actual number of times each line *was called by* # the function on the next line. Rather, it's the *total* number # of times each function was found in the call chain for any of the # calls to SCons.Debug.caller(). If you're looking at more than one # function at the same time, for example, their counts will intermix. # So use this to get a *general* idea of who's calling what, not for # fine-grained performance tuning. from __future__ import print_function import sys class Entry(object): def __init__(self, file_line_func): self.file_line_func = file_line_func self.called_by = [] self.calls = [] AllCalls = {} def get_call(flf): try: e = AllCalls[flf] except KeyError: e = AllCalls[flf] = Entry(flf) return e prefix = 'Callers of ' c = None for line in sys.stdin.readlines(): if line[0] == '#': pass elif line[:len(prefix)] == prefix: c = get_call(line[len(prefix):-2]) else: num_calls, flf = line.strip().split() e = get_call(flf) c.called_by.append((e, num_calls)) e.calls.append(c) stack = [] def print_entry(e, level, calls): print('%-72s%6s' % ((' '*2*level) + e.file_line_func, calls)) if e in stack: print((' '*2*(level+1))+'RECURSION') print() elif e.called_by: stack.append(e) for c in e.called_by: print_entry(c[0], level+1, c[1]) stack.pop() else: print() for e in [ e for e in list(AllCalls.values()) if not e.calls ]: print_entry(e, 0, '') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/upload-release-files.sh0000775000175000017500000000422213160023037020570 0ustar bdbaddogbdbaddog#!/bin/sh set -e set -x if [ $# -lt 2 ]; then echo Usage: $0 VERSION SF_USERNAME exit 1 fi VERSION=$1; shift SF_USER=$1; shift RSYNC='rsync' RSYNCOPTS='-v -e ssh' SF_MACHINE='frs.sourceforge.net' SF_TOPDIR='/home/frs/project/scons' # the build products are here: cd build/dist cp -f ../../src/CHANGES.txt ../../src/RELEASE.txt ../../src/Announce.txt ../../src/README.txt . cp scons-$VERSION.win32.exe scons-$VERSION-setup.exe cp scons-$VERSION.win-amd64.exe scons-$VERSION-amd64-setup.exe set -x # Upload main scons release files: $RSYNC $RSYNCOPTS \ scons-$VERSION-1.noarch.rpm \ scons-$VERSION-1.src.rpm \ scons-$VERSION-setup.exe \ scons-$VERSION-amd64-setup.exe \ scons-$VERSION.tar.gz \ scons-$VERSION.zip \ Announce.txt CHANGES.txt RELEASE.txt \ $SF_USER@$SF_MACHINE:$SF_TOPDIR/scons/$VERSION/ # Local packages: $RSYNC $RSYNCOPTS \ scons-local-$VERSION.tar.gz \ scons-local-$VERSION.zip \ Announce.txt CHANGES.txt RELEASE.txt \ $SF_USER@$SF_MACHINE:$SF_TOPDIR/scons-local/$VERSION/ # Source packages: $RSYNC $RSYNCOPTS \ scons-src-$VERSION.tar.gz \ scons-src-$VERSION.zip \ Announce.txt CHANGES.txt RELEASE.txt \ $SF_USER@$SF_MACHINE:$SF_TOPDIR/scons-src/$VERSION/ # Readme $RSYNC $RSYNCOPTS \ README.txt \ $SF_USER@$SF_MACHINE:$SF_TOPDIR/ # # scons.org stuff: # # Doc: copy the doc tgz over; we'll unpack later $RSYNC $RSYNCOPTS \ scons-doc-$VERSION.tar.gz \ scons@scons.org:public_html/production/doc/$VERSION/ # Copy the changelog $RSYNC $RSYNCOPTS \ CHANGES.txt \ scons@scons.org:public_html/production/ # Note that Announce.txt gets copied over to RELEASE.txt. # This should be fixed at some point. $RSYNC $RSYNCOPTS \ Announce.txt \ scons@scons.org:public_html/production/RELEASE.txt # Unpack the doc and repoint doc symlinks: ssh scons@scons.org " cd public_html/production/doc cd $VERSION tar xvf scons-doc-$VERSION.tar.gz cd .. rm latest; ln -s $VERSION latest rm production; ln -s $VERSION production for f in HTML PDF EPUB PS TEXT; do rm \$f; ln -s $VERSION/\$f \$f; done " echo '*****' echo '***** Now manually update index.php, includes/versions.php and news-raw.xhtml on scons.org.' echo '*****' scons-src-3.0.0/bin/install_scons.py0000664000175000017500000001642013160023037017457 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # A script for unpacking and installing different historic versions of # SCons in a consistent manner for side-by-side development testing. # # This abstracts the changes we've made to the SCons setup.py scripts in # different versions so that, no matter what version is specified, it ends # up installing the necessary script(s) and library into version-specific # names that won't interfere with other things. # # By default, we expect to extract the .tar.gz files from a Downloads # subdirectory in the current directory. # # Note that this script cleans up after itself, removing the extracted # directory in which we do the build. # # This was written for a Linux system (specifically Ubuntu) but should # be reasonably generic to any POSIX-style system with a /usr/local # hierarchy. from __future__ import print_function import getopt import os import shutil import sys import tarfile from urllib import urlretrieve from Command import CommandRunner, Usage all_versions = [ '0.01', '0.02', '0.03', '0.04', '0.05', '0.06', '0.07', '0.08', '0.09', '0.10', '0.11', '0.12', '0.13', '0.14', '0.90', '0.91', '0.92', '0.93', '0.94', #'0.94.1', '0.95', #'0.95.1', '0.96', '0.96.1', '0.96.90', '0.96.91', '0.96.92', '0.96.93', '0.96.94', '0.96.95', '0.96.96', '0.97', '0.97.0d20070809', '0.97.0d20070918', '0.97.0d20071212', '0.98.0', '0.98.1', '0.98.2', '0.98.3', '0.98.4', '0.98.5', '1.0.0', '1.0.0.d20080826', '1.0.1', '1.0.1.d20080915', '1.0.1.d20081001', '1.1.0', '1.1.0.d20081104', '1.1.0.d20081125', '1.1.0.d20081207', '1.2.0', '1.2.0.d20090113', '1.2.0.d20090223', '1.2.0.d20090905', '1.2.0.d20090919', '1.2.0.d20091224', '1.2.0.d20100117', '1.2.0.d20100306', '1.3.0', '1.3.0.d20100404', '1.3.0.d20100501', '1.3.0.d20100523', '1.3.0.d20100606', '2.0.0.alpha.20100508', '2.0.0.beta.20100531', '2.0.0.beta.20100605', '2.0.0.final.0', ] def main(argv=None): if argv is None: argv = sys.argv all = False downloads_dir = 'Downloads' downloads_url = 'http://downloads.sourceforge.net/scons' if sys.platform == 'win32': sudo = '' prefix = sys.prefix else: sudo = 'sudo' prefix = '/usr/local' python = sys.executable short_options = 'ad:hnp:q' long_options = ['all', 'help', 'no-exec', 'prefix=', 'quiet'] helpstr = """\ Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...] -a, --all Install all SCons versions. -d DIR, --downloads=DIR Downloads directory. -h, --help Print this help and exit -n, --no-exec No execute, just print command lines -p PREFIX, --prefix=PREFIX Installation prefix. -q, --quiet Quiet, don't print command lines """ try: try: opts, args = getopt.getopt(argv[1:], short_options, long_options) except getopt.error as msg: raise Usage(msg) for o, a in opts: if o in ('-a', '--all'): all = True elif o in ('-d', '--downloads'): downloads_dir = a elif o in ('-h', '--help'): print(helpstr) sys.exit(0) elif o in ('-n', '--no-exec'): CommandRunner.execute = CommandRunner.do_not_execute elif o in ('-p', '--prefix'): prefix = a elif o in ('-q', '--quiet'): CommandRunner.display = CommandRunner.do_not_display except Usage as err: sys.stderr.write(str(err.msg) + '\n') sys.stderr.write('use -h to get help\n') return 2 if all: if args: msg = 'install-scons.py: -a and version arguments both specified' sys.stderr.write(msg) sys.exit(1) args = all_versions cmd = CommandRunner() for version in args: scons = 'scons-' + version tar_gz = os.path.join(downloads_dir, scons + '.tar.gz') tar_gz_url = "%s/%s.tar.gz" % (downloads_url, scons) cmd.subst_dictionary(locals()) if not os.path.exists(tar_gz): if not os.path.exists(downloads_dir): cmd.run('mkdir %(downloads_dir)s') cmd.run((urlretrieve, tar_gz_url, tar_gz), 'wget -O %(tar_gz)s %(tar_gz_url)s') def extract(tar_gz): tarfile.open(tar_gz, "r:gz").extractall() cmd.run((extract, tar_gz), 'tar zxf %(tar_gz)s') cmd.run('cd %(scons)s') if version in ('0.01', '0.02', '0.03', '0.04', '0.05', '0.06', '0.07', '0.08', '0.09', '0.10'): # 0.01 through 0.10 install /usr/local/bin/scons and # /usr/local/lib/scons. The "scons" script knows how to # look up the library in a version-specific directory, but # we have to move both it and the library directory into # the right version-specific name by hand. cmd.run('%(python)s setup.py build') cmd.run('%(sudo)s %(python)s setup.py install --prefix=%(prefix)s') cmd.run('%(sudo)s mv %(prefix)s/bin/scons %(prefix)s/bin/scons-%(version)s') cmd.run('%(sudo)s mv %(prefix)s/lib/scons %(prefix)s/lib/scons-%(version)s') elif version in ('0.11', '0.12', '0.13', '0.14', '0.90'): # 0.11 through 0.90 install /usr/local/bin/scons and # /usr/local/lib/scons-%(version)s. We just need to move # the script to a version-specific name. cmd.run('%(python)s setup.py build') cmd.run('%(sudo)s %(python)s setup.py install --prefix=%(prefix)s') cmd.run('%(sudo)s mv %(prefix)s/bin/scons %(prefix)s/bin/scons-%(version)s') elif version in ('0.91', '0.92', '0.93', '0.94', '0.94.1', '0.95', '0.95.1', '0.96', '0.96.1', '0.96.90'): # 0.91 through 0.96.90 install /usr/local/bin/scons, # /usr/local/bin/sconsign and /usr/local/lib/scons-%(version)s. # We need to move both scripts to version-specific names. cmd.run('%(python)s setup.py build') cmd.run('%(sudo)s %(python)s setup.py install --prefix=%(prefix)s') cmd.run('%(sudo)s mv %(prefix)s/bin/scons %(prefix)s/bin/scons-%(version)s') cmd.run('%(sudo)s mv %(prefix)s/bin/sconsign %(prefix)s/bin/sconsign-%(version)s') lib_scons = os.path.join(prefix, 'lib', 'scons') if os.path.isdir(lib_scons): cmd.run('%(sudo)s mv %(prefix)s/lib/scons %(prefix)s/lib/scons-%(version)s') else: # Versions from 0.96.91 and later support what we want # with a --no-scons-script option. cmd.run('%(python)s setup.py build') cmd.run('%(sudo)s %(python)s setup.py install --prefix=%(prefix)s --no-scons-script') cmd.run('cd ..') cmd.run((shutil.rmtree, scons), 'rm -rf %(scons)s') if __name__ == "__main__": sys.exit(main()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/Command.py0000664000175000017500000000753413160023037016170 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # XXX Python script template # # XXX Describe what the script does here. # from __future__ import print_function import getopt import os import shlex import sys class Usage(Exception): def __init__(self, msg): self.msg = msg class CommandRunner(object): """ Representation of a command to be executed. """ def __init__(self, dictionary={}): self.subst_dictionary(dictionary) def subst_dictionary(self, dictionary): self._subst_dictionary = dictionary def subst(self, string, dictionary=None): """ Substitutes (via the format operator) the values in the specified dictionary into the specified command. The command can be an (action, string) tuple. In all cases, we perform substitution on strings and don't worry if something isn't a string. (It's probably a Python function to be executed.) """ if dictionary is None: dictionary = self._subst_dictionary if dictionary: try: string = string % dictionary except TypeError: pass return string def do_display(self, string): if isinstance(string, tuple): func = string[0] args = string[1:] s = '%s(%s)' % (func.__name__, ', '.join(map(repr, args))) else: s = self.subst(string) if not s.endswith('\n'): s += '\n' sys.stdout.write(s) sys.stdout.flush() def do_not_display(self, string): pass def do_execute(self, command): if isinstance(command, str): command = self.subst(command) cmdargs = shlex.split(command) if cmdargs[0] == 'cd': command = (os.chdir,) + tuple(cmdargs[1:]) elif cmdargs[0] == 'mkdir': command = (os.mkdir,) + tuple(cmdargs[1:]) if isinstance(command, tuple): func = command[0] args = command[1:] return func(*args) else: return os.system(command) def do_not_execute(self, command): pass display = do_display execute = do_execute def run(self, command, display=None): """ Runs this command, displaying it first. The actual display() and execute() methods we call may be overridden if we're printing but not executing, or vice versa. """ if display is None: display = command self.display(display) return self.execute(command) def main(argv=None): if argv is None: argv = sys.argv short_options = 'hnq' long_options = ['help', 'no-exec', 'quiet'] helpstr = """\ Usage: script-template.py [-hnq] -h, --help Print this help and exit -n, --no-exec No execute, just print command lines -q, --quiet Quiet, don't print command lines """ try: try: opts, args = getopt.getopt(argv[1:], short_options, long_options) except getopt.error as msg: raise Usage(msg) for o, a in opts: if o in ('-h', '--help'): print(helpstr) sys.exit(0) elif o in ('-n', '--no-exec'): Command.execute = Command.do_not_execute elif o in ('-q', '--quiet'): Command.display = Command.do_not_display except Usage as err: sys.stderr.write(err.msg) sys.stderr.write('use -h to get help') return 2 commands = [ ] for command in [ Command(c) for c in commands ]: status = command.run(command) if status: sys.exit(status) if __name__ == "__main__": sys.exit(main()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/makedocs0000664000175000017500000000062013160023037015736 0ustar bdbaddogbdbaddog#! /bin/sh # This script uses HappyDoc to create the HTML class documentation for # SCons. It must be run from the src/engine directory. base=`basename $PWD` if [ "$base" != "engine" ]; then echo "You must run this script from the engine directory." exit fi DEVDIR=../../doc/developer if [ ! -d $DEVDIR ]; then mkdir $DEVDIR fi SRCFILE=../../bin/files happydoc -d $DEVDIR `cat $SRCFILE` scons-src-3.0.0/bin/memoicmp.py0000664000175000017500000000471713160023037016420 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # A script to compare the --debug=memoizer output found in # two different files. from __future__ import print_function import sys def memoize_output(fname): mout = {} #lines=filter(lambda words: # len(words) == 5 and # words[1] == 'hits' and words[3] == 'misses', # map(string.split, open(fname,'r').readlines())) #for line in lines: # mout[line[-1]] = ( int(line[0]), int(line[2]) ) for line in open(fname,'r').readlines(): words = line.split() if len(words) == 5 and words[1] == 'hits' and words[3] == 'misses': mout[words[-1]] = ( int(words[0]), int(words[2]) ) return mout def memoize_cmp(filea, fileb): ma = memoize_output(filea) mb = memoize_output(fileb) print('All output: %s / %s [delta]'%(filea, fileb)) print('----------HITS---------- ---------MISSES---------') cfmt='%7d/%-7d [%d]' ma_o = [] mb_o = [] mab = [] for k in list(ma.keys()): if k in list(mb.keys()): if k not in mab: mab.append(k) else: ma_o.append(k) for k in list(mb.keys()): if k in list(ma.keys()): if k not in mab: mab.append(k) else: mb_o.append(k) mab.sort() ma_o.sort() mb_o.sort() for k in mab: hits = cfmt%(ma[k][0], mb[k][0], mb[k][0]-ma[k][0]) miss = cfmt%(ma[k][1], mb[k][1], mb[k][1]-ma[k][1]) print('%-24s %-24s %s'%(hits, miss, k)) for k in ma_o: hits = '%7d/ --'%(ma[k][0]) miss = '%7d/ --'%(ma[k][1]) print('%-24s %-24s %s'%(hits, miss, k)) for k in mb_o: hits = ' -- /%-7d'%(mb[k][0]) miss = ' -- /%-7d'%(mb[k][1]) print('%-24s %-24s %s'%(hits, miss, k)) print('-'*(24+24+1+20)) if __name__ == "__main__": if len(sys.argv) != 3: print("""Usage: %s file1 file2 Compares --debug=memomize output from file1 against file2."""%sys.argv[0]) sys.exit(1) memoize_cmp(sys.argv[1], sys.argv[2]) sys.exit(0) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/memlogs.py0000664000175000017500000000333513160023037016250 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2005 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function import getopt import sys filenames = sys.argv[1:] if not filenames: print("""Usage: memlogs.py file [...] Summarizes the --debug=memory numbers from one or more build logs. """) sys.exit(0) fmt = "%12s %12s %12s %12s %s" print(fmt % ("pre-read", "post-read", "pre-build", "post-build", "")) for fname in sys.argv[1:]: lines = [l for l in open(fname).readlines() if l[:7] == 'Memory '] t = tuple([l.split()[-1] for l in lines]) + (fname,) print(fmt % t) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/install_python.py0000664000175000017500000000651213160023037017654 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # A script for unpacking and installing different historic versions of # Python in a consistent manner for side-by-side development testing. # # This was written for a Linux system (specifically Ubuntu) but should # be reasonably generic to any POSIX-style system with a /usr/local # hierarchy. from __future__ import print_function import getopt import os import shutil import sys from Command import CommandRunner, Usage all_versions = [ '2.3.7', '2.4.5', #'2.5.2', '2.6', ] def main(argv=None): if argv is None: argv = sys.argv all = False downloads_dir = 'Downloads' downloads_url = 'http://www.python.org/ftp/python' sudo = 'sudo' prefix = '/usr/local' short_options = 'ad:hnp:q' long_options = ['all', 'help', 'no-exec', 'prefix=', 'quiet'] helpstr = """\ Usage: install_python.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...] -a, --all Install all SCons versions. -d DIR, --downloads=DIR Downloads directory. -h, --help Print this help and exit -n, --no-exec No execute, just print command lines -p PREFIX, --prefix=PREFIX Installation prefix. -q, --quiet Quiet, don't print command lines """ try: try: opts, args = getopt.getopt(argv[1:], short_options, long_options) except getopt.error as msg: raise Usage(msg) for o, a in opts: if o in ('-a', '--all'): all = True elif o in ('-d', '--downloads'): downloads_dir = a elif o in ('-h', '--help'): print(helpstr) sys.exit(0) elif o in ('-n', '--no-exec'): CommandRunner.execute = CommandRunner.do_not_execute elif o in ('-p', '--prefix'): prefix = a elif o in ('-q', '--quiet'): CommandRunner.display = CommandRunner.do_not_display except Usage as err: sys.stderr.write(str(err.msg) + '\n') sys.stderr.write('use -h to get help\n') return 2 if all: if args: msg = 'install-scons.py: -a and version arguments both specified' sys.stderr.write(msg) sys.exit(1) args = all_versions cmd = CommandRunner() for version in args: python = 'Python-' + version tar_gz = os.path.join(downloads_dir, python + '.tgz') tar_gz_url = os.path.join(downloads_url, version, python + '.tgz') cmd.subst_dictionary(locals()) if not os.path.exists(tar_gz): if not os.path.exists(downloads_dir): cmd.run('mkdir %(downloads_dir)s') cmd.run('wget -O %(tar_gz)s %(tar_gz_url)s') cmd.run('tar zxf %(tar_gz)s') cmd.run('cd %(python)s') cmd.run('./configure --prefix=%(prefix)s %(configureflags)s 2>&1 | tee configure.out') cmd.run('make 2>&1 | tee make.out') cmd.run('%(sudo)s make install') cmd.run('%(sudo)s rm -f %(prefix)s/bin/{idle,pydoc,python,python-config,smtpd.py}') cmd.run('cd ..') cmd.run((shutil.rmtree, python), 'rm -rf %(python)s') if __name__ == "__main__": sys.exit(main()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/scons_dev_master.py0000664000175000017500000001362713160023037020150 0ustar bdbaddogbdbaddog#!/bin/sh # # A script for turning a generic Ubuntu system into a master for # SCons development. from __future__ import print_function import getopt import sys from Command import CommandRunner, Usage INITIAL_PACKAGES = [ 'mercurial', ] INSTALL_PACKAGES = [ 'wget', ] PYTHON_PACKAGES = [ 'g++', 'gcc', 'make', 'zlib1g-dev', 'libreadline-gplv2-dev', 'libncursesw5-dev', 'libssl-dev', 'libsqlite3-dev', 'tk-dev', 'libgdbm-dev', 'libc6-dev', 'libbz2-dev' ] BUILDING_PACKAGES = [ 'python-libxml2', 'python-libxslt1', 'fop', 'python-dev', 'python-epydoc', 'rpm', 'tar', # additional packages that Bill Deegan's web page suggests #'docbook-to-man', #'docbook-xsl', #'docbook2x', #'tetex-bin', #'tetex-latex', # for ubuntu 9.10 # 'texlive-lang-french' ] DOCUMENTATION_PACKAGES = [ 'docbook-doc', 'epydoc-doc', 'gcc-doc', 'pkg-config', 'python-doc', 'sun-java5-doc', 'sun-java6-doc', 'swig-doc', 'texlive-doc', ] TESTING_PACKAGES = [ 'bison', 'cssc', 'cvs', 'flex', 'g++', 'gcc', 'gcj', 'ghostscript', # 'libgcj7-dev', 'm4', 'openssh-client', 'openssh-server', 'python-profiler', 'python-all-dev', 'rcs', 'rpm', # 'sun-java5-jdk', 'sun-java6-jdk', 'swig', 'texlive-base-bin', 'texlive-extra-utils', 'texlive-latex-base', 'texlive-latex-extra', 'zip', ] BUILDBOT_PACKAGES = [ 'buildbot-worker', 'cron', ] default_args = [ 'upgrade', 'checkout', 'building', 'testing', 'python-versions', 'scons-versions', ] def main(argv=None): if argv is None: argv = sys.argv short_options = 'hnqy' long_options = ['help', 'no-exec', 'password=', 'quiet', 'username=', 'yes', 'assume-yes'] helpstr = """\ Usage: scons_dev_master.py [-hnqy] [--password PASSWORD] [--username USER] [ACTIONS ...] ACTIONS (in default order): upgrade Upgrade the system checkout Check out SCons building Install packages for building SCons testing Install packages for testing SCons scons-versions Install versions of SCons python-versions Install versions of Python ACTIONS (optional): buildbot Install packages for running BuildBot """ scons_url = 'https://bdbaddog@bitbucket.org/scons/scons' sudo = 'sudo' password = '""' username = 'guest' yesflag = '' try: try: opts, args = getopt.getopt(argv[1:], short_options, long_options) except getopt.error as msg: raise Usage(msg) for o, a in opts: if o in ('-h', '--help'): print(helpstr) sys.exit(0) elif o in ('-n', '--no-exec'): CommandRunner.execute = CommandRunner.do_not_execute elif o in ('--password'): password = a elif o in ('-q', '--quiet'): CommandRunner.display = CommandRunner.do_not_display elif o in ('--username'): username = a elif o in ('-y', '--yes', '--assume-yes'): yesflag = o except Usage as err: sys.stderr.write(str(err.msg) + '\n') sys.stderr.write('use -h to get help\n') return 2 if not args: args = default_args initial_packages = ' '.join(INITIAL_PACKAGES) install_packages = ' '.join(INSTALL_PACKAGES) building_packages = ' '.join(BUILDING_PACKAGES) testing_packages = ' '.join(TESTING_PACKAGES) buildbot_packages = ' '.join(BUILDBOT_PACKAGES) python_packages = ' '.join(PYTHON_PACKAGES) doc_packages = ' '.join(DOCUMENTATION_PACKAGES) cmd = CommandRunner(locals()) for arg in args: if arg == 'upgrade': cmd.run('%(sudo)s apt-get %(yesflag)s upgrade') elif arg == 'checkout': cmd.run('%(sudo)s apt-get %(yesflag)s install %(initial_packages)s') cmd.run('hg clone" %(scons_url)s') elif arg == 'building': cmd.run('%(sudo)s apt-get %(yesflag)s install %(building_packages)s') elif arg == 'docs': cmd.run('%(sudo)s apt-get %(yesflag)s install %(doc_packages)s') elif arg == 'testing': cmd.run('%(sudo)s apt-get %(yesflag)s install %(testing_packages)s') elif arg == 'buildbot': cmd.run('%(sudo)s apt-get %(yesflag)s install %(buildbot_packages)s') elif arg == 'python-versions': if install_packages: cmd.run('%(sudo)s apt-get %(yesflag)s install %(install_packages)s') install_packages = None cmd.run('%(sudo)s apt-get %(yesflag)s install %(python_packages)s') try: import install_python except ImportError: msg = 'Could not import install_python; skipping python-versions.\n' sys.stderr.write(msg) else: install_python.main(['install_python.py', '-a']) elif arg == 'scons-versions': if install_packages: cmd.run('%(sudo)s apt-get %(yesflag)s install %(install_packages)s') install_packages = None try: import install_scons except ImportError: msg = 'Could not import install_scons; skipping scons-versions.\n' sys.stderr.write(msg) else: install_scons.main(['install_scons.py', '-a']) else: msg = '%s: unknown argument %s\n' sys.stderr.write(msg % (argv[0], repr(arg))) sys.exit(1) if __name__ == "__main__": sys.exit(main()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/bin/restore.sh0000664000175000017500000000412513160023037016250 0ustar bdbaddogbdbaddog#!/usr/bin/env sh # # Simple hack script to restore __revision__, __COPYRIGHT_, 3.0.0 # and other similar variables to what gets checked in to source. This # comes in handy when people send in diffs based on the released source. # if test "X$*" = "X"; then DIRS="src test" else DIRS="$*" fi SEPARATOR="================================================================================" header() { arg_space="$1 " dots=`echo "$arg_space" | sed 's/./\./g'` echo "$SEPARATOR" | sed "s;$dots;$arg_space;" } for i in `find $DIRS -name '*.py'`; do header $i ed $i <= 3 and isinstance(val, bytes): # This is a dirty hack for py 2/3 compatibility. csig is a bytes object # in Python3 while Python2 bytes are str. Hence, we decode the csig to a # Python3 string val = val.decode() return str(val) def map_action(entry, name): try: bact = entry.bact bactsig = entry.bactsig except AttributeError: return None return '%s [%s]' % (bactsig, bact) def map_timestamp(entry, name): try: timestamp = entry.timestamp except AttributeError: timestamp = None if Readable and timestamp: return "'" + time.ctime(timestamp) + "'" else: return str(timestamp) def map_bkids(entry, name): try: bkids = entry.bsources + entry.bdepends + entry.bimplicit bkidsigs = entry.bsourcesigs + entry.bdependsigs + entry.bimplicitsigs except AttributeError: return None result = [] for i in range(len(bkids)): result.append(nodeinfo_string(bkids[i], bkidsigs[i], " ")) if result == []: return None return "\n ".join(result) map_field = { 'action' : map_action, 'timestamp' : map_timestamp, 'bkids' : map_bkids, } map_name = { 'implicit' : 'bkids', } def field(name, entry, verbose=Verbose): if not Print_Flags[name]: return None fieldname = map_name.get(name, name) mapper = map_field.get(fieldname, default_mapper) val = mapper(entry, name) if verbose: val = name + ": " + val return val def nodeinfo_raw(name, ninfo, prefix=""): # This just formats the dictionary, which we would normally use str() # to do, except that we want the keys sorted for deterministic output. d = ninfo.__getstate__() try: keys = ninfo.field_list + ['_version_id'] except AttributeError: keys = sorted(d.keys()) l = [] for k in keys: l.append('%s: %s' % (repr(k), repr(d.get(k)))) if '\n' in name: name = repr(name) return name + ': {' + ', '.join(l) + '}' def nodeinfo_cooked(name, ninfo, prefix=""): try: field_list = ninfo.field_list except AttributeError: field_list = [] if '\n' in name: name = repr(name) outlist = [name+':'] + [_f for _f in [field(x, ninfo, Verbose) for x in field_list] if _f] if Verbose: sep = '\n ' + prefix else: sep = ' ' return sep.join(outlist) nodeinfo_string = nodeinfo_cooked def printfield(name, entry, prefix=""): outlist = field("implicit", entry, 0) if outlist: if Verbose: print(" implicit:") print(" " + outlist) outact = field("action", entry, 0) if outact: if Verbose: print(" action: " + outact) else: print(" " + outact) def printentries(entries, location): if Print_Entries: for name in Print_Entries: try: entry = entries[name] except KeyError: sys.stderr.write("sconsign: no entry `%s' in `%s'\n" % (name, location)) else: try: ninfo = entry.ninfo except AttributeError: print(name + ":") else: print(nodeinfo_string(name, entry.ninfo)) printfield(name, entry.binfo) else: for name in sorted(entries.keys()): entry = entries[name] try: ninfo = entry.ninfo except AttributeError: print(name + ":") else: print(nodeinfo_string(name, entry.ninfo)) printfield(name, entry.binfo) class Do_SConsignDB(object): def __init__(self, dbm_name, dbm): self.dbm_name = dbm_name self.dbm = dbm def __call__(self, fname): # The *dbm modules stick their own file suffixes on the names # that are passed in. This is causes us to jump through some # hoops here to be able to allow the user try: # Try opening the specified file name. Example: # SPECIFIED OPENED BY self.dbm.open() # --------- ------------------------- # .sconsign => .sconsign.dblite # .sconsign.dblite => .sconsign.dblite.dblite db = self.dbm.open(fname, "r") except (IOError, OSError) as e: print_e = e try: # That didn't work, so try opening the base name, # so that if the actually passed in 'sconsign.dblite' # (for example), the dbm module will put the suffix back # on for us and open it anyway. db = self.dbm.open(os.path.splitext(fname)[0], "r") except (IOError, OSError): # That didn't work either. See if the file name # they specified just exists (independent of the dbm # suffix-mangling). try: open(fname, "r") except (IOError, OSError) as e: # Nope, that file doesn't even exist, so report that # fact back. print_e = e sys.stderr.write("sconsign: %s\n" % (print_e)) return except KeyboardInterrupt: raise except pickle.UnpicklingError: sys.stderr.write("sconsign: ignoring invalid `%s' file `%s'\n" % (self.dbm_name, fname)) return except Exception as e: sys.stderr.write("sconsign: ignoring invalid `%s' file `%s': %s\n" % (self.dbm_name, fname, e)) return if Print_Directories: for dir in Print_Directories: try: val = db[dir] except KeyError: sys.stderr.write("sconsign: no dir `%s' in `%s'\n" % (dir, args[0])) else: self.printentries(dir, val) else: for dir in sorted(db.keys()): self.printentries(dir, db[dir]) def printentries(self, dir, val): print('=== ' + dir + ':') printentries(pickle.loads(val), dir) def Do_SConsignDir(name): try: fp = open(name, 'rb') except (IOError, OSError) as e: sys.stderr.write("sconsign: %s\n" % (e)) return try: sconsign = SCons.SConsign.Dir(fp) except KeyboardInterrupt: raise except pickle.UnpicklingError: sys.stderr.write("sconsign: ignoring invalid .sconsign file `%s'\n" % (name)) return except Exception as e: sys.stderr.write("sconsign: ignoring invalid .sconsign file `%s': %s\n" % (name, e)) return printentries(sconsign.entries, args[0]) ############################################################################## import getopt helpstr = """\ Usage: sconsign [OPTIONS] FILE [...] Options: -a, --act, --action Print build action information. -c, --csig Print content signature information. -d DIR, --dir=DIR Print only info about DIR. -e ENTRY, --entry=ENTRY Print only info about ENTRY. -f FORMAT, --format=FORMAT FILE is in the specified FORMAT. -h, --help Print this message and exit. -i, --implicit Print implicit dependency information. -r, --readable Print timestamps in human-readable form. --raw Print raw Python object representations. -s, --size Print file sizes. -t, --timestamp Print timestamp information. -v, --verbose Verbose, describe each field. """ opts, args = getopt.getopt(sys.argv[1:], "acd:e:f:hirstv", ['act', 'action', 'csig', 'dir=', 'entry=', 'format=', 'help', 'implicit', 'raw', 'readable', 'size', 'timestamp', 'verbose']) for o, a in opts: if o in ('-a', '--act', '--action'): Print_Flags['action'] = 1 elif o in ('-c', '--csig'): Print_Flags['csig'] = 1 elif o in ('-d', '--dir'): Print_Directories.append(a) elif o in ('-e', '--entry'): Print_Entries.append(a) elif o in ('-f', '--format'): # Try to map the given DB format to a known module # name, that we can then try to import... Module_Map = {'dblite' : 'SCons.dblite', 'sconsign' : None} dbm_name = Module_Map.get(a, a) if dbm_name: try: if dbm_name != "SCons.dblite": dbm = my_import(dbm_name) else: import SCons.dblite dbm = SCons.dblite # Ensure that we don't ignore corrupt DB files, # this was handled by calling my_import('SCons.dblite') # again in earlier versions... SCons.dblite.ignore_corrupt_dbfiles = 0 except: sys.stderr.write("sconsign: illegal file format `%s'\n" % a) print(helpstr) sys.exit(2) Do_Call = Do_SConsignDB(a, dbm) else: Do_Call = Do_SConsignDir elif o in ('-h', '--help'): print(helpstr) sys.exit(0) elif o in ('-i', '--implicit'): Print_Flags['implicit'] = 1 elif o in ('--raw',): nodeinfo_string = nodeinfo_raw elif o in ('-r', '--readable'): Readable = 1 elif o in ('-s', '--size'): Print_Flags['size'] = 1 elif o in ('-t', '--timestamp'): Print_Flags['timestamp'] = 1 elif o in ('-v', '--verbose'): Verbose = 1 if Do_Call: for a in args: Do_Call(a) else: for a in args: dbm_name = whichdb(a) if dbm_name: Map_Module = {'SCons.dblite' : 'dblite'} if dbm_name != "SCons.dblite": dbm = my_import(dbm_name) else: import SCons.dblite dbm = SCons.dblite # Ensure that we don't ignore corrupt DB files, # this was handled by calling my_import('SCons.dblite') # again in earlier versions... SCons.dblite.ignore_corrupt_dbfiles = 0 Do_SConsignDB(Map_Module.get(dbm_name, dbm_name), dbm)(a) else: Do_SConsignDir(a) sys.exit(0) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/script/scons.py0000664000175000017500000001556013160023045017257 0ustar bdbaddogbdbaddog#! /usr/bin/env python # # SCons - a Software Constructor # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function __revision__ = "src/script/scons.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __version__ = "3.0.0" __build__ = "rel_3.0.0:4395:8972f6a2f699" __buildsys__ = "ubuntu-16" __date__ = "2017/09/18 12:59:24" __developer__ = "bdbaddog" import os import sys ############################################################################## # BEGIN STANDARD SCons SCRIPT HEADER # # This is the cut-and-paste logic so that a self-contained script can # interoperate correctly with different SCons versions and installation # locations for the engine. If you modify anything in this section, you # should also change other scripts that use this same header. ############################################################################## # Strip the script directory from sys.path() so on case-insensitive # (WIN32) systems Python doesn't think that the "scons" script is the # "SCons" package. Replace it with our own library directories # (version-specific first, in case they installed by hand there, # followed by generic) so we pick up the right version of the build # engine modules if they're in either directory. if (3,0,0) < sys.version_info < (3,5,0) or sys.version_info < (2,7,0): msg = "scons: *** SCons version %s does not run under Python version %s.\n\ Python < 3.5 is not yet supported.\n" sys.stderr.write(msg % (__version__, sys.version.split()[0])) sys.exit(1) script_dir = sys.path[0] if script_dir in sys.path: sys.path.remove(script_dir) libs = [] if "SCONS_LIB_DIR" in os.environ: libs.append(os.environ["SCONS_LIB_DIR"]) # - running from source takes priority (since 2.3.2), excluding SCONS_LIB_DIR settings script_path = os.path.abspath(os.path.dirname(__file__)) source_path = os.path.join(script_path, '..', 'engine') libs.append(source_path) local_version = 'scons-local-' + __version__ local = 'scons-local' if script_dir: local_version = os.path.join(script_dir, local_version) local = os.path.join(script_dir, local) libs.append(os.path.abspath(local_version)) libs.append(os.path.abspath(local)) scons_version = 'scons-%s' % __version__ # preferred order of scons lookup paths prefs = [] # - running from egg check try: import pkg_resources except ImportError: pass else: # when running from an egg add the egg's directory try: d = pkg_resources.get_distribution('scons') except pkg_resources.DistributionNotFound: pass else: prefs.append(d.location) if sys.platform == 'win32': # sys.prefix is (likely) C:\Python*; # check only C:\Python*. prefs.append(sys.prefix) prefs.append(os.path.join(sys.prefix, 'Lib', 'site-packages')) else: # On other (POSIX) platforms, things are more complicated due to # the variety of path names and library locations. Try to be smart # about it. if script_dir == 'bin': # script_dir is `pwd`/bin; # check `pwd`/lib/scons*. prefs.append(os.getcwd()) else: if script_dir == '.' or script_dir == '': script_dir = os.getcwd() head, tail = os.path.split(script_dir) if tail == "bin": # script_dir is /foo/bin; # check /foo/lib/scons*. prefs.append(head) head, tail = os.path.split(sys.prefix) if tail == "usr": # sys.prefix is /foo/usr; # check /foo/usr/lib/scons* first, # then /foo/usr/local/lib/scons*. prefs.append(sys.prefix) prefs.append(os.path.join(sys.prefix, "local")) elif tail == "local": h, t = os.path.split(head) if t == "usr": # sys.prefix is /foo/usr/local; # check /foo/usr/local/lib/scons* first, # then /foo/usr/lib/scons*. prefs.append(sys.prefix) prefs.append(head) else: # sys.prefix is /foo/local; # check only /foo/local/lib/scons*. prefs.append(sys.prefix) else: # sys.prefix is /foo (ends in neither /usr or /local); # check only /foo/lib/scons*. prefs.append(sys.prefix) temp = [os.path.join(x, 'lib') for x in prefs] temp.extend([os.path.join(x, 'lib', 'python' + sys.version[:3], 'site-packages') for x in prefs]) prefs = temp # Add the parent directory of the current python's library to the # preferences. On SuSE-91/AMD64, for example, this is /usr/lib64, # not /usr/lib. try: libpath = os.__file__ except AttributeError: pass else: # Split /usr/libfoo/python*/os.py to /usr/libfoo/python*. libpath, tail = os.path.split(libpath) # Split /usr/libfoo/python* to /usr/libfoo libpath, tail = os.path.split(libpath) # Check /usr/libfoo/scons*. prefs.append(libpath) # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. libs.extend([os.path.join(x, scons_version) for x in prefs]) libs.extend([os.path.join(x, 'scons') for x in prefs]) sys.path = libs + sys.path ############################################################################## # END STANDARD SCons SCRIPT HEADER ############################################################################## if __name__ == "__main__": try: import SCons.Script except ImportError: print("SCons import failed. Unable to find engine files in:") for path in libs: print(" {}".format(path)) raise # this does all the work, and calls sys.exit # with the proper exit status when done. SCons.Script.main() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/script/scons.bat0000664000175000017500000000277413160023045017400 0ustar bdbaddogbdbaddog@REM Copyright (c) 2001 - 2017 The SCons Foundation @REM src/script/scons.bat rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog @echo off set SCONS_ERRORLEVEL= if "%OS%" == "Windows_NT" goto WinNT @REM for 9x/Me you better not have more than 9 args python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.0.0'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.0.0'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 @REM no way to set exit status of this script for 9x/Me goto endscons @REM Credit where credit is due: we return the exit code despite our @REM use of setlocal+endlocal using a technique from Bear's Journal: @REM http://code-bear.com/bearlog/2007/06/01/getting-the-exit-code-from-a-batch-file-that-is-run-from-a-python-program/ :WinNT setlocal @REM ensure the script will be executed with the Python it was installed for set path=%~dp0;%~dp0..;%path% @REM try the script named as the .bat file in current dir, then in Scripts subdir set scriptname=%~dp0%~n0.py if not exist "%scriptname%" set scriptname=%~dp0Scripts\%~n0.py python "%scriptname%" %* endlocal & set SCONS_ERRORLEVEL=%ERRORLEVEL% if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode if errorlevel 9009 echo you do not have python in your PATH goto endscons :returncode exit /B %SCONS_ERRORLEVEL% :endscons call :returncode %SCONS_ERRORLEVEL% scons-src-3.0.0/src/script/MANIFEST.in0000664000175000017500000000006013160023045017303 0ustar bdbaddogbdbaddogscons sconsign scons-time scons-configure-cache scons-src-3.0.0/src/script/scons-time.py0000664000175000017500000013731213160023045020213 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # scons-time - run SCons timings and collect statistics # # A script for running a configuration through SCons with a standard # set of invocations to collect timing and memory statistics and to # capture the results in a consistent set of output files for display # and analysis. # # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import division, print_function __revision__ = "src/script/scons-time.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import getopt import glob import os import re import shutil import sys import tempfile import time def make_temp_file(**kw): try: result = tempfile.mktemp(**kw) result = os.path.realpath(result) except TypeError: try: save_template = tempfile.template prefix = kw['prefix'] del kw['prefix'] tempfile.template = prefix result = tempfile.mktemp(**kw) finally: tempfile.template = save_template return result def HACK_for_exec(cmd, *args): ''' For some reason, Python won't allow an exec() within a function that also declares an internal function (including lambda functions). This function is a hack that calls exec() in a function with no internal functions. ''' if not args: exec(cmd) elif len(args) == 1: exec(cmd, args[0]) else: exec(cmd, args[0], args[1]) class Plotter(object): def increment_size(self, largest): """ Return the size of each horizontal increment line for a specified maximum value. This returns a value that will provide somewhere between 5 and 9 horizontal lines on the graph, on some set of boundaries that are multiples of 10/100/1000/etc. """ i = largest // 5 if not i: return largest multiplier = 1 while i >= 10: i = i // 10 multiplier = multiplier * 10 return i * multiplier def max_graph_value(self, largest): # Round up to next integer. largest = int(largest) + 1 increment = self.increment_size(largest) return ((largest + increment - 1) // increment) * increment class Line(object): def __init__(self, points, type, title, label, comment, fmt="%s %s"): self.points = points self.type = type self.title = title self.label = label self.comment = comment self.fmt = fmt def print_label(self, inx, x, y): if self.label: print('set label %s "%s" at %0.1f,%0.1f right' % (inx, self.label, x, y)) def plot_string(self): if self.title: title_string = 'title "%s"' % self.title else: title_string = 'notitle' return "'-' %s with lines lt %s" % (title_string, self.type) def print_points(self, fmt=None): if fmt is None: fmt = self.fmt if self.comment: print('# %s' % self.comment) for x, y in self.points: # If y is None, it usually represents some kind of break # in the line's index number. We might want to represent # this some way rather than just drawing the line straight # between the two points on either side. if not y is None: print(fmt % (x, y)) print('e') def get_x_values(self): return [ p[0] for p in self.points ] def get_y_values(self): return [ p[1] for p in self.points ] class Gnuplotter(Plotter): def __init__(self, title, key_location): self.lines = [] self.title = title self.key_location = key_location def line(self, points, type, title=None, label=None, comment=None, fmt='%s %s'): if points: line = Line(points, type, title, label, comment, fmt) self.lines.append(line) def plot_string(self, line): return line.plot_string() def vertical_bar(self, x, type, label, comment): if self.get_min_x() <= x and x <= self.get_max_x(): points = [(x, 0), (x, self.max_graph_value(self.get_max_y()))] self.line(points, type, label, comment) def get_all_x_values(self): result = [] for line in self.lines: result.extend(line.get_x_values()) return [r for r in result if not r is None] def get_all_y_values(self): result = [] for line in self.lines: result.extend(line.get_y_values()) return [r for r in result if not r is None] def get_min_x(self): try: return self.min_x except AttributeError: try: self.min_x = min(self.get_all_x_values()) except ValueError: self.min_x = 0 return self.min_x def get_max_x(self): try: return self.max_x except AttributeError: try: self.max_x = max(self.get_all_x_values()) except ValueError: self.max_x = 0 return self.max_x def get_min_y(self): try: return self.min_y except AttributeError: try: self.min_y = min(self.get_all_y_values()) except ValueError: self.min_y = 0 return self.min_y def get_max_y(self): try: return self.max_y except AttributeError: try: self.max_y = max(self.get_all_y_values()) except ValueError: self.max_y = 0 return self.max_y def draw(self): if not self.lines: return if self.title: print('set title "%s"' % self.title) print('set key %s' % self.key_location) min_y = self.get_min_y() max_y = self.max_graph_value(self.get_max_y()) incr = (max_y - min_y) / 10.0 start = min_y + (max_y / 2.0) + (2.0 * incr) position = [ start - (i * incr) for i in range(5) ] inx = 1 for line in self.lines: line.print_label(inx, line.points[0][0]-1, position[(inx-1) % len(position)]) inx += 1 plot_strings = [ self.plot_string(l) for l in self.lines ] print('plot ' + ', \\\n '.join(plot_strings)) for line in self.lines: line.print_points() def untar(fname): import tarfile tar = tarfile.open(name=fname, mode='r') for tarinfo in tar: tar.extract(tarinfo) tar.close() def unzip(fname): import zipfile zf = zipfile.ZipFile(fname, 'r') for name in zf.namelist(): dir = os.path.dirname(name) try: os.makedirs(dir) except: pass open(name, 'wb').write(zf.read(name)) def read_tree(dir): for dirpath, dirnames, filenames in os.walk(dir): for fn in filenames: fn = os.path.join(dirpath, fn) if os.path.isfile(fn): open(fn, 'rb').read() def redirect_to_file(command, log): return '%s > %s 2>&1' % (command, log) def tee_to_file(command, log): return '%s 2>&1 | tee %s' % (command, log) class SConsTimer(object): """ Usage: scons-time SUBCOMMAND [ARGUMENTS] Type "scons-time help SUBCOMMAND" for help on a specific subcommand. Available subcommands: func Extract test-run data for a function help Provides help mem Extract --debug=memory data from test runs obj Extract --debug=count data from test runs time Extract --debug=time data from test runs run Runs a test configuration """ name = 'scons-time' name_spaces = ' '*len(name) def makedict(**kw): return kw default_settings = makedict( aegis = 'aegis', aegis_project = None, chdir = None, config_file = None, initial_commands = [], key_location = 'bottom left', orig_cwd = os.getcwd(), outdir = None, prefix = '', python = '"%s"' % sys.executable, redirect = redirect_to_file, scons = None, scons_flags = '--debug=count --debug=memory --debug=time --debug=memoizer', scons_lib_dir = None, scons_wrapper = None, startup_targets = '--help', subdir = None, subversion_url = None, svn = 'svn', svn_co_flag = '-q', tar = 'tar', targets = '', targets0 = None, targets1 = None, targets2 = None, title = None, unzip = 'unzip', verbose = False, vertical_bars = [], unpack_map = { '.tar.gz' : (untar, '%(tar)s xzf %%s'), '.tgz' : (untar, '%(tar)s xzf %%s'), '.tar' : (untar, '%(tar)s xf %%s'), '.zip' : (unzip, '%(unzip)s %%s'), }, ) run_titles = [ 'Startup', 'Full build', 'Up-to-date build', ] run_commands = [ '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof0)s %(targets0)s', '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof1)s %(targets1)s', '%(python)s %(scons_wrapper)s %(scons_flags)s --profile=%(prof2)s %(targets2)s', ] stages = [ 'pre-read', 'post-read', 'pre-build', 'post-build', ] stage_strings = { 'pre-read' : 'Memory before reading SConscript files:', 'post-read' : 'Memory after reading SConscript files:', 'pre-build' : 'Memory before building targets:', 'post-build' : 'Memory after building targets:', } memory_string_all = 'Memory ' default_stage = stages[-1] time_strings = { 'total' : 'Total build time', 'SConscripts' : 'Total SConscript file execution time', 'SCons' : 'Total SCons execution time', 'commands' : 'Total command execution time', } time_string_all = 'Total .* time' # def __init__(self): self.__dict__.update(self.default_settings) # Functions for displaying and executing commands. def subst(self, x, dictionary): try: return x % dictionary except TypeError: # x isn't a string (it's probably a Python function), # so just return it. return x def subst_variables(self, command, dictionary): """ Substitutes (via the format operator) the values in the specified dictionary into the specified command. The command can be an (action, string) tuple. In all cases, we perform substitution on strings and don't worry if something isn't a string. (It's probably a Python function to be executed.) """ try: command + '' except TypeError: action = command[0] string = command[1] args = command[2:] else: action = command string = action args = (()) action = self.subst(action, dictionary) string = self.subst(string, dictionary) return (action, string, args) def _do_not_display(self, msg, *args): pass def display(self, msg, *args): """ Displays the specified message. Each message is prepended with a standard prefix of our name plus the time. """ if callable(msg): msg = msg(*args) else: msg = msg % args if msg is None: return fmt = '%s[%s]: %s\n' sys.stdout.write(fmt % (self.name, time.strftime('%H:%M:%S'), msg)) def _do_not_execute(self, action, *args): pass def execute(self, action, *args): """ Executes the specified action. The action is called if it's a callable Python function, and otherwise passed to os.system(). """ if callable(action): action(*args) else: os.system(action % args) def run_command_list(self, commands, dict): """ Executes a list of commands, substituting values from the specified dictionary. """ commands = [ self.subst_variables(c, dict) for c in commands ] for action, string, args in commands: self.display(string, *args) sys.stdout.flush() status = self.execute(action, *args) if status: sys.exit(status) def log_display(self, command, log): command = self.subst(command, self.__dict__) if log: command = self.redirect(command, log) return command def log_execute(self, command, log): command = self.subst(command, self.__dict__) output = os.popen(command).read() if self.verbose: sys.stdout.write(output) # TODO: Figure out # Not sure we need to write binary here open(log, 'w').write(output) # def archive_splitext(self, path): """ Splits an archive name into a filename base and extension. This is like os.path.splitext() (which it calls) except that it also looks for '.tar.gz' and treats it as an atomic extensions. """ if path.endswith('.tar.gz'): return path[:-7], path[-7:] else: return os.path.splitext(path) def args_to_files(self, args, tail=None): """ Takes a list of arguments, expands any glob patterns, and returns the last "tail" files from the list. """ files = [] for a in args: files.extend(sorted(glob.glob(a))) if tail: files = files[-tail:] return files def ascii_table(self, files, columns, line_function, file_function=lambda x: x, *args, **kw): header_fmt = ' '.join(['%12s'] * len(columns)) line_fmt = header_fmt + ' %s' print(header_fmt % columns) for file in files: t = line_function(file, *args, **kw) if t is None: t = [] diff = len(columns) - len(t) if diff > 0: t += [''] * diff t.append(file_function(file)) print(line_fmt % tuple(t)) def collect_results(self, files, function, *args, **kw): results = {} for file in files: base = os.path.splitext(file)[0] run, index = base.split('-')[-2:] run = int(run) index = int(index) value = function(file, *args, **kw) try: r = results[index] except KeyError: r = [] results[index] = r r.append((run, value)) return results def doc_to_help(self, obj): """ Translates an object's __doc__ string into help text. This strips a consistent number of spaces from each line in the help text, essentially "outdenting" the text to the left-most column. """ doc = obj.__doc__ if doc is None: return '' return self.outdent(doc) def find_next_run_number(self, dir, prefix): """ Returns the next run number in a directory for the specified prefix. Examines the contents the specified directory for files with the specified prefix, extracts the run numbers from each file name, and returns the next run number after the largest it finds. """ x = re.compile(re.escape(prefix) + '-([0-9]+).*') matches = [x.match(e) for e in os.listdir(dir)] matches = [_f for _f in matches if _f] if not matches: return 0 run_numbers = [int(m.group(1)) for m in matches] return int(max(run_numbers)) + 1 def gnuplot_results(self, results, fmt='%s %.3f'): """ Prints out a set of results in Gnuplot format. """ gp = Gnuplotter(self.title, self.key_location) for i in sorted(results.keys()): try: t = self.run_titles[i] except IndexError: t = '??? %s ???' % i results[i].sort() gp.line(results[i], i+1, t, None, t, fmt=fmt) for bar_tuple in self.vertical_bars: try: x, type, label, comment = bar_tuple except ValueError: x, type, label = bar_tuple comment = label gp.vertical_bar(x, type, label, comment) gp.draw() def logfile_name(self, invocation): """ Returns the absolute path of a log file for the specificed invocation number. """ name = self.prefix_run + '-%d.log' % invocation return os.path.join(self.outdir, name) def outdent(self, s): """ Strip as many spaces from each line as are found at the beginning of the first line in the list. """ lines = s.split('\n') if lines[0] == '': lines = lines[1:] spaces = re.match(' *', lines[0]).group(0) def strip_initial_spaces(l, s=spaces): if l.startswith(spaces): l = l[len(spaces):] return l return '\n'.join([ strip_initial_spaces(l) for l in lines ]) + '\n' def profile_name(self, invocation): """ Returns the absolute path of a profile file for the specified invocation number. """ name = self.prefix_run + '-%d.prof' % invocation return os.path.join(self.outdir, name) def set_env(self, key, value): os.environ[key] = value # def get_debug_times(self, file, time_string=None): """ Fetch times from the --debug=time strings in the specified file. """ if time_string is None: search_string = self.time_string_all else: search_string = time_string contents = open(file).read() if not contents: sys.stderr.write('file %s has no contents!\n' % repr(file)) return None result = re.findall(r'%s: ([\d\.]*)' % search_string, contents)[-4:] result = [ float(r) for r in result ] if not time_string is None: try: result = result[0] except IndexError: sys.stderr.write('file %s has no results!\n' % repr(file)) return None return result def get_function_profile(self, file, function): """ Returns the file, line number, function name, and cumulative time. """ try: import pstats except ImportError as e: sys.stderr.write('%s: func: %s\n' % (self.name, e)) sys.stderr.write('%s This version of Python is missing the profiler.\n' % self.name_spaces) sys.stderr.write('%s Cannot use the "func" subcommand.\n' % self.name_spaces) sys.exit(1) statistics = pstats.Stats(file).stats matches = [ e for e in statistics.items() if e[0][2] == function ] r = matches[0] return r[0][0], r[0][1], r[0][2], r[1][3] def get_function_time(self, file, function): """ Returns just the cumulative time for the specified function. """ return self.get_function_profile(file, function)[3] def get_memory(self, file, memory_string=None): """ Returns a list of integers of the amount of memory used. The default behavior is to return all the stages. """ if memory_string is None: search_string = self.memory_string_all else: search_string = memory_string lines = open(file).readlines() lines = [ l for l in lines if l.startswith(search_string) ][-4:] result = [ int(l.split()[-1]) for l in lines[-4:] ] if len(result) == 1: result = result[0] return result def get_object_counts(self, file, object_name, index=None): """ Returns the counts of the specified object_name. """ object_string = ' ' + object_name + '\n' lines = open(file).readlines() line = [ l for l in lines if l.endswith(object_string) ][0] result = [ int(field) for field in line.split()[:4] ] if index is not None: result = result[index] return result # command_alias = {} def execute_subcommand(self, argv): """ Executes the do_*() function for the specified subcommand (argv[0]). """ if not argv: return cmdName = self.command_alias.get(argv[0], argv[0]) try: func = getattr(self, 'do_' + cmdName) except AttributeError: return self.default(argv) try: return func(argv) except TypeError as e: sys.stderr.write("%s %s: %s\n" % (self.name, cmdName, e)) import traceback traceback.print_exc(file=sys.stderr) sys.stderr.write("Try '%s help %s'\n" % (self.name, cmdName)) def default(self, argv): """ The default behavior for an unknown subcommand. Prints an error message and exits. """ sys.stderr.write('%s: Unknown subcommand "%s".\n' % (self.name, argv[0])) sys.stderr.write('Type "%s help" for usage.\n' % self.name) sys.exit(1) # def do_help(self, argv): """ """ if argv[1:]: for arg in argv[1:]: try: func = getattr(self, 'do_' + arg) except AttributeError: sys.stderr.write('%s: No help for "%s"\n' % (self.name, arg)) else: try: help = getattr(self, 'help_' + arg) except AttributeError: sys.stdout.write(self.doc_to_help(func)) sys.stdout.flush() else: help() else: doc = self.doc_to_help(self.__class__) if doc: sys.stdout.write(doc) sys.stdout.flush() return None # def help_func(self): help = """\ Usage: scons-time func [OPTIONS] FILE [...] -C DIR, --chdir=DIR Change to DIR before looking for files -f FILE, --file=FILE Read configuration from specified FILE --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT --func=NAME, --function=NAME Report time for function NAME -h, --help Print this help and exit -p STRING, --prefix=STRING Use STRING as log file/profile prefix -t NUMBER, --tail=NUMBER Only report the last NUMBER files --title=TITLE Specify the output plot TITLE """ sys.stdout.write(self.outdent(help)) sys.stdout.flush() def do_func(self, argv): """ """ format = 'ascii' function_name = '_main' tail = None short_opts = '?C:f:hp:t:' long_opts = [ 'chdir=', 'file=', 'fmt=', 'format=', 'func=', 'function=', 'help', 'prefix=', 'tail=', 'title=', ] opts, args = getopt.getopt(argv[1:], short_opts, long_opts) for o, a in opts: if o in ('-C', '--chdir'): self.chdir = a elif o in ('-f', '--file'): self.config_file = a elif o in ('--fmt', '--format'): format = a elif o in ('--func', '--function'): function_name = a elif o in ('-?', '-h', '--help'): self.do_help(['help', 'func']) sys.exit(0) elif o in ('--max',): max_time = int(a) elif o in ('-p', '--prefix'): self.prefix = a elif o in ('-t', '--tail'): tail = int(a) elif o in ('--title',): self.title = a if self.config_file: exec(open(self.config_file, 'r').read(), self.__dict__) if self.chdir: os.chdir(self.chdir) if not args: pattern = '%s*.prof' % self.prefix args = self.args_to_files([pattern], tail) if not args: if self.chdir: directory = self.chdir else: directory = os.getcwd() sys.stderr.write('%s: func: No arguments specified.\n' % self.name) sys.stderr.write('%s No %s*.prof files found in "%s".\n' % (self.name_spaces, self.prefix, directory)) sys.stderr.write('%s Type "%s help func" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) else: args = self.args_to_files(args, tail) cwd_ = os.getcwd() + os.sep if format == 'ascii': for file in args: try: f, line, func, time = \ self.get_function_profile(file, function_name) except ValueError as e: sys.stderr.write("%s: func: %s: %s\n" % (self.name, file, e)) else: if f.startswith(cwd_): f = f[len(cwd_):] print("%.3f %s:%d(%s)" % (time, f, line, func)) elif format == 'gnuplot': results = self.collect_results(args, self.get_function_time, function_name) self.gnuplot_results(results) else: sys.stderr.write('%s: func: Unknown format "%s".\n' % (self.name, format)) sys.exit(1) # def help_mem(self): help = """\ Usage: scons-time mem [OPTIONS] FILE [...] -C DIR, --chdir=DIR Change to DIR before looking for files -f FILE, --file=FILE Read configuration from specified FILE --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT -h, --help Print this help and exit -p STRING, --prefix=STRING Use STRING as log file/profile prefix --stage=STAGE Plot memory at the specified stage: pre-read, post-read, pre-build, post-build (default: post-build) -t NUMBER, --tail=NUMBER Only report the last NUMBER files --title=TITLE Specify the output plot TITLE """ sys.stdout.write(self.outdent(help)) sys.stdout.flush() def do_mem(self, argv): format = 'ascii' logfile_path = lambda x: x stage = self.default_stage tail = None short_opts = '?C:f:hp:t:' long_opts = [ 'chdir=', 'file=', 'fmt=', 'format=', 'help', 'prefix=', 'stage=', 'tail=', 'title=', ] opts, args = getopt.getopt(argv[1:], short_opts, long_opts) for o, a in opts: if o in ('-C', '--chdir'): self.chdir = a elif o in ('-f', '--file'): self.config_file = a elif o in ('--fmt', '--format'): format = a elif o in ('-?', '-h', '--help'): self.do_help(['help', 'mem']) sys.exit(0) elif o in ('-p', '--prefix'): self.prefix = a elif o in ('--stage',): if not a in self.stages: sys.stderr.write('%s: mem: Unrecognized stage "%s".\n' % (self.name, a)) sys.exit(1) stage = a elif o in ('-t', '--tail'): tail = int(a) elif o in ('--title',): self.title = a if self.config_file: HACK_for_exec(open(self.config_file, 'r').read(), self.__dict__) if self.chdir: os.chdir(self.chdir) logfile_path = lambda x: os.path.join(self.chdir, x) if not args: pattern = '%s*.log' % self.prefix args = self.args_to_files([pattern], tail) if not args: if self.chdir: directory = self.chdir else: directory = os.getcwd() sys.stderr.write('%s: mem: No arguments specified.\n' % self.name) sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory)) sys.stderr.write('%s Type "%s help mem" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) else: args = self.args_to_files(args, tail) cwd_ = os.getcwd() + os.sep if format == 'ascii': self.ascii_table(args, tuple(self.stages), self.get_memory, logfile_path) elif format == 'gnuplot': results = self.collect_results(args, self.get_memory, self.stage_strings[stage]) self.gnuplot_results(results) else: sys.stderr.write('%s: mem: Unknown format "%s".\n' % (self.name, format)) sys.exit(1) return 0 # def help_obj(self): help = """\ Usage: scons-time obj [OPTIONS] OBJECT FILE [...] -C DIR, --chdir=DIR Change to DIR before looking for files -f FILE, --file=FILE Read configuration from specified FILE --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT -h, --help Print this help and exit -p STRING, --prefix=STRING Use STRING as log file/profile prefix --stage=STAGE Plot memory at the specified stage: pre-read, post-read, pre-build, post-build (default: post-build) -t NUMBER, --tail=NUMBER Only report the last NUMBER files --title=TITLE Specify the output plot TITLE """ sys.stdout.write(self.outdent(help)) sys.stdout.flush() def do_obj(self, argv): format = 'ascii' logfile_path = lambda x: x stage = self.default_stage tail = None short_opts = '?C:f:hp:t:' long_opts = [ 'chdir=', 'file=', 'fmt=', 'format=', 'help', 'prefix=', 'stage=', 'tail=', 'title=', ] opts, args = getopt.getopt(argv[1:], short_opts, long_opts) for o, a in opts: if o in ('-C', '--chdir'): self.chdir = a elif o in ('-f', '--file'): self.config_file = a elif o in ('--fmt', '--format'): format = a elif o in ('-?', '-h', '--help'): self.do_help(['help', 'obj']) sys.exit(0) elif o in ('-p', '--prefix'): self.prefix = a elif o in ('--stage',): if not a in self.stages: sys.stderr.write('%s: obj: Unrecognized stage "%s".\n' % (self.name, a)) sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) stage = a elif o in ('-t', '--tail'): tail = int(a) elif o in ('--title',): self.title = a if not args: sys.stderr.write('%s: obj: Must specify an object name.\n' % self.name) sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) object_name = args.pop(0) if self.config_file: HACK_for_exec(open(self.config_file, 'r').read(), self.__dict__) if self.chdir: os.chdir(self.chdir) logfile_path = lambda x: os.path.join(self.chdir, x) if not args: pattern = '%s*.log' % self.prefix args = self.args_to_files([pattern], tail) if not args: if self.chdir: directory = self.chdir else: directory = os.getcwd() sys.stderr.write('%s: obj: No arguments specified.\n' % self.name) sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory)) sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) else: args = self.args_to_files(args, tail) cwd_ = os.getcwd() + os.sep if format == 'ascii': self.ascii_table(args, tuple(self.stages), self.get_object_counts, logfile_path, object_name) elif format == 'gnuplot': stage_index = 0 for s in self.stages: if stage == s: break stage_index = stage_index + 1 results = self.collect_results(args, self.get_object_counts, object_name, stage_index) self.gnuplot_results(results) else: sys.stderr.write('%s: obj: Unknown format "%s".\n' % (self.name, format)) sys.exit(1) return 0 # def help_run(self): help = """\ Usage: scons-time run [OPTIONS] [FILE ...] --aegis=PROJECT Use SCons from the Aegis PROJECT --chdir=DIR Name of unpacked directory for chdir -f FILE, --file=FILE Read configuration from specified FILE -h, --help Print this help and exit -n, --no-exec No execute, just print command lines --number=NUMBER Put output in files for run NUMBER --outdir=OUTDIR Put output files in OUTDIR -p STRING, --prefix=STRING Use STRING as log file/profile prefix --python=PYTHON Time using the specified PYTHON -q, --quiet Don't print command lines --scons=SCONS Time using the specified SCONS --svn=URL, --subversion=URL Use SCons from Subversion URL -v, --verbose Display output of commands """ sys.stdout.write(self.outdent(help)) sys.stdout.flush() def do_run(self, argv): """ """ run_number_list = [None] short_opts = '?f:hnp:qs:v' long_opts = [ 'aegis=', 'file=', 'help', 'no-exec', 'number=', 'outdir=', 'prefix=', 'python=', 'quiet', 'scons=', 'svn=', 'subdir=', 'subversion=', 'verbose', ] opts, args = getopt.getopt(argv[1:], short_opts, long_opts) for o, a in opts: if o in ('--aegis',): self.aegis_project = a elif o in ('-f', '--file'): self.config_file = a elif o in ('-?', '-h', '--help'): self.do_help(['help', 'run']) sys.exit(0) elif o in ('-n', '--no-exec'): self.execute = self._do_not_execute elif o in ('--number',): run_number_list = self.split_run_numbers(a) elif o in ('--outdir',): self.outdir = a elif o in ('-p', '--prefix'): self.prefix = a elif o in ('--python',): self.python = a elif o in ('-q', '--quiet'): self.display = self._do_not_display elif o in ('-s', '--subdir'): self.subdir = a elif o in ('--scons',): self.scons = a elif o in ('--svn', '--subversion'): self.subversion_url = a elif o in ('-v', '--verbose'): self.redirect = tee_to_file self.verbose = True self.svn_co_flag = '' if not args and not self.config_file: sys.stderr.write('%s: run: No arguments or -f config file specified.\n' % self.name) sys.stderr.write('%s Type "%s help run" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) if self.config_file: exec(open(self.config_file, 'r').read(), self.__dict__) if args: self.archive_list = args archive_file_name = os.path.split(self.archive_list[0])[1] if not self.subdir: self.subdir = self.archive_splitext(archive_file_name)[0] if not self.prefix: self.prefix = self.archive_splitext(archive_file_name)[0] prepare = None if self.subversion_url: prepare = self.prep_subversion_run elif self.aegis_project: prepare = self.prep_aegis_run for run_number in run_number_list: self.individual_run(run_number, self.archive_list, prepare) def split_run_numbers(self, s): result = [] for n in s.split(','): try: x, y = n.split('-') except ValueError: result.append(int(n)) else: result.extend(list(range(int(x), int(y)+1))) return result def scons_path(self, dir): return os.path.join(dir, 'src', 'script', 'scons.py') def scons_lib_dir_path(self, dir): return os.path.join(dir, 'src', 'engine') def prep_aegis_run(self, commands, removals): self.aegis_tmpdir = make_temp_file(prefix = self.name + '-aegis-') removals.append((shutil.rmtree, 'rm -rf %%s', self.aegis_tmpdir)) self.aegis_parent_project = os.path.splitext(self.aegis_project)[0] self.scons = self.scons_path(self.aegis_tmpdir) self.scons_lib_dir = self.scons_lib_dir_path(self.aegis_tmpdir) commands.extend([ 'mkdir %(aegis_tmpdir)s', (lambda: os.chdir(self.aegis_tmpdir), 'cd %(aegis_tmpdir)s'), '%(aegis)s -cp -ind -p %(aegis_parent_project)s .', '%(aegis)s -cp -ind -p %(aegis_project)s -delta %(run_number)s .', ]) def prep_subversion_run(self, commands, removals): self.svn_tmpdir = make_temp_file(prefix = self.name + '-svn-') removals.append((shutil.rmtree, 'rm -rf %%s', self.svn_tmpdir)) self.scons = self.scons_path(self.svn_tmpdir) self.scons_lib_dir = self.scons_lib_dir_path(self.svn_tmpdir) commands.extend([ 'mkdir %(svn_tmpdir)s', '%(svn)s co %(svn_co_flag)s -r %(run_number)s %(subversion_url)s %(svn_tmpdir)s', ]) def individual_run(self, run_number, archive_list, prepare=None): """ Performs an individual run of the default SCons invocations. """ commands = [] removals = [] if prepare: prepare(commands, removals) save_scons = self.scons save_scons_wrapper = self.scons_wrapper save_scons_lib_dir = self.scons_lib_dir if self.outdir is None: self.outdir = self.orig_cwd elif not os.path.isabs(self.outdir): self.outdir = os.path.join(self.orig_cwd, self.outdir) if self.scons is None: self.scons = self.scons_path(self.orig_cwd) if self.scons_lib_dir is None: self.scons_lib_dir = self.scons_lib_dir_path(self.orig_cwd) if self.scons_wrapper is None: self.scons_wrapper = self.scons if not run_number: run_number = self.find_next_run_number(self.outdir, self.prefix) self.run_number = str(run_number) self.prefix_run = self.prefix + '-%03d' % run_number if self.targets0 is None: self.targets0 = self.startup_targets if self.targets1 is None: self.targets1 = self.targets if self.targets2 is None: self.targets2 = self.targets self.tmpdir = make_temp_file(prefix = self.name + '-') commands.extend([ 'mkdir %(tmpdir)s', (os.chdir, 'cd %%s', self.tmpdir), ]) for archive in archive_list: if not os.path.isabs(archive): archive = os.path.join(self.orig_cwd, archive) if os.path.isdir(archive): dest = os.path.split(archive)[1] commands.append((shutil.copytree, 'cp -r %%s %%s', archive, dest)) else: suffix = self.archive_splitext(archive)[1] unpack_command = self.unpack_map.get(suffix) if not unpack_command: dest = os.path.split(archive)[1] commands.append((shutil.copyfile, 'cp %%s %%s', archive, dest)) else: commands.append(unpack_command + (archive,)) commands.extend([ (os.chdir, 'cd %%s', self.subdir), ]) commands.extend(self.initial_commands) commands.extend([ (lambda: read_tree('.'), 'find * -type f | xargs cat > /dev/null'), (self.set_env, 'export %%s=%%s', 'SCONS_LIB_DIR', self.scons_lib_dir), '%(python)s %(scons_wrapper)s --version', ]) index = 0 for run_command in self.run_commands: setattr(self, 'prof%d' % index, self.profile_name(index)) c = ( self.log_execute, self.log_display, run_command, self.logfile_name(index), ) commands.append(c) index = index + 1 commands.extend([ (os.chdir, 'cd %%s', self.orig_cwd), ]) if not os.environ.get('PRESERVE'): commands.extend(removals) commands.append((shutil.rmtree, 'rm -rf %%s', self.tmpdir)) self.run_command_list(commands, self.__dict__) self.scons = save_scons self.scons_lib_dir = save_scons_lib_dir self.scons_wrapper = save_scons_wrapper # def help_time(self): help = """\ Usage: scons-time time [OPTIONS] FILE [...] -C DIR, --chdir=DIR Change to DIR before looking for files -f FILE, --file=FILE Read configuration from specified FILE --fmt=FORMAT, --format=FORMAT Print data in specified FORMAT -h, --help Print this help and exit -p STRING, --prefix=STRING Use STRING as log file/profile prefix -t NUMBER, --tail=NUMBER Only report the last NUMBER files --which=TIMER Plot timings for TIMER: total, SConscripts, SCons, commands. """ sys.stdout.write(self.outdent(help)) sys.stdout.flush() def do_time(self, argv): format = 'ascii' logfile_path = lambda x: x tail = None which = 'total' short_opts = '?C:f:hp:t:' long_opts = [ 'chdir=', 'file=', 'fmt=', 'format=', 'help', 'prefix=', 'tail=', 'title=', 'which=', ] opts, args = getopt.getopt(argv[1:], short_opts, long_opts) for o, a in opts: if o in ('-C', '--chdir'): self.chdir = a elif o in ('-f', '--file'): self.config_file = a elif o in ('--fmt', '--format'): format = a elif o in ('-?', '-h', '--help'): self.do_help(['help', 'time']) sys.exit(0) elif o in ('-p', '--prefix'): self.prefix = a elif o in ('-t', '--tail'): tail = int(a) elif o in ('--title',): self.title = a elif o in ('--which',): if not a in list(self.time_strings.keys()): sys.stderr.write('%s: time: Unrecognized timer "%s".\n' % (self.name, a)) sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) which = a if self.config_file: HACK_for_exec(open(self.config_file, 'r').read(), self.__dict__) if self.chdir: os.chdir(self.chdir) logfile_path = lambda x: os.path.join(self.chdir, x) if not args: pattern = '%s*.log' % self.prefix args = self.args_to_files([pattern], tail) if not args: if self.chdir: directory = self.chdir else: directory = os.getcwd() sys.stderr.write('%s: time: No arguments specified.\n' % self.name) sys.stderr.write('%s No %s*.log files found in "%s".\n' % (self.name_spaces, self.prefix, directory)) sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) else: args = self.args_to_files(args, tail) cwd_ = os.getcwd() + os.sep if format == 'ascii': columns = ("Total", "SConscripts", "SCons", "commands") self.ascii_table(args, columns, self.get_debug_times, logfile_path) elif format == 'gnuplot': results = self.collect_results(args, self.get_debug_times, self.time_strings[which]) self.gnuplot_results(results, fmt='%s %.6f') else: sys.stderr.write('%s: time: Unknown format "%s".\n' % (self.name, format)) sys.exit(1) if __name__ == '__main__': opts, args = getopt.getopt(sys.argv[1:], 'h?V', ['help', 'version']) ST = SConsTimer() for o, a in opts: if o in ('-?', '-h', '--help'): ST.do_help(['help']) sys.exit(0) elif o in ('-V', '--version'): sys.stdout.write('scons-time version\n') sys.exit(0) if not args: sys.stderr.write('Type "%s help" for usage.\n' % ST.name) sys.exit(1) ST.execute_subcommand(args) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/script/scons-configure-cache.py0000664000175000017500000001232013160023045022266 0ustar bdbaddogbdbaddog#! /usr/bin/env python # # SCons - a Software Constructor # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function __revision__ = "src/script/scons-configure-cache.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __version__ = "3.0.0" __build__ = "rel_3.0.0:4395:8972f6a2f699" __buildsys__ = "ubuntu-16" __date__ = "2017/09/18 12:59:24" __developer__ = "bdbaddog" import argparse import glob import json import os def rearrange_cache_entries(current_prefix_len, new_prefix_len): print('Changing prefix length from', current_prefix_len, 'to', new_prefix_len) dirs = set() old_dirs = set() for file in glob.iglob(os.path.join('*', '*')): name = os.path.basename(file) dir = name[:current_prefix_len].upper() if dir not in old_dirs: print('Migrating', dir) old_dirs.add(dir) dir = name[:new_prefix_len].upper() if dir not in dirs: os.mkdir(dir) dirs.add(dir) os.rename(file, os.path.join(dir, name)) # Now delete the original directories for dir in old_dirs: os.rmdir(dir) # This dictionary should have one entry per entry in the cache config # Each entry should have the following: # implicit - (optional) This is to allow adding a new config entry and also # changing the behaviour of the system at the same time. This # indicates the value the config entry would have had if it had been # specified. # default - The value the config entry should have if it wasn't previously # specified # command-line - parameters to pass to ArgumentParser.add_argument # converter - (optional) Function to call if it's necessary to do some work # if this configuration entry changes config_entries = { 'prefix_len' : { 'implicit' : 1, 'default' : 2 , 'command-line' : { 'help' : 'Length of cache file name used as subdirectory prefix', 'metavar' : '', 'type' : int }, 'converter' : rearrange_cache_entries } } parser = argparse.ArgumentParser( description = 'Modify the configuration of an scons cache directory', epilog = ''' Unless you specify an option, it will not be changed (if it is already set in the cache config), or changed to an appropriate default (it it is not set). ''' ) parser.add_argument('cache-dir', help='Path to scons cache directory') for param in config_entries: parser.add_argument('--' + param.replace('_', '-'), **config_entries[param]['command-line']) parser.add_argument('--version', action='version', version='%(prog)s 1.0') # Get the command line as a dict without any of the unspecified entries. args = dict([x for x in vars(parser.parse_args()).items() if x[1]]) # It seems somewhat strange to me, but positional arguments don't get the - # in the name changed to _, whereas optional arguments do... os.chdir(args['cache-dir']) del args['cache-dir'] if not os.path.exists('config'): # Validate the only files in the directory are directories 0-9, a-f expected = [ '{:X}'.format(x) for x in range(0, 16) ] if not set(os.listdir('.')).issubset(expected): raise RuntimeError("This doesn't look like a version 1 cache directory") config = dict() else: with open('config') as conf: config = json.load(conf) # Find any keys that aren't currently set but should be for key in config_entries: if key not in config: if 'implicit' in config_entries[key]: config[key] = config_entries[key]['implicit'] else: config[key] = config_entries[key]['default'] if key not in args: args[key] = config_entries[key]['default'] #Now we go through each entry in args to see if it changes an existing config #setting. for key in args: if args[key] != config[key]: if 'converter' in config_entries[key]: config_entries[key]['converter'](config[key], args[key]) config[key] = args[key] # and write the updated config file with open('config', 'w') as conf: json.dump(config, conf) scons-src-3.0.0/src/test_files.py0000664000175000017500000000605013160023045016761 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/test_files.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" """ Verify that we have certain important files in our distribution packages. Note that this is a packaging test, not a functional test, so the name of this script doesn't end in *Tests.py. """ import os import os.path import re import TestSCons test = TestSCons.TestSCons() try: cwd = os.environ['SCONS_CWD'] except KeyError: cwd = os.getcwd() def build_path(*args): return os.path.join(cwd, 'build', *args) build_scons_tar_gz = build_path('unpack-tar-gz', 'scons-'+test.scons_version) build_scons_zip = build_path('unpack-zip', 'scons-'+test.scons_version) build_local_tar_gz = build_path('test-local-tar-gz') build_local_zip = build_path('test-local-zip') scons_files = [ 'CHANGES.txt', 'LICENSE.txt', 'README.txt', 'RELEASE.txt', ] local_files = [ 'scons-LICENSE', 'scons-README', ] # Map each directory to search (dictionary keys) to a list of its # subsidiary files and directories to exclude from copyright checks. check = { build_scons_tar_gz : scons_files, build_scons_zip : scons_files, build_local_tar_gz : local_files, build_local_zip : local_files, } missing = [] no_result = [] for directory, check_list in check.items(): if os.path.exists(directory): for c in check_list: f = os.path.join(directory, c) if not os.path.isfile(f): missing.append(f) else: no_result.append(directory) if missing: print("Missing the following files:\n") print("\t" + "\n\t".join(missing)) test.fail_test(1) if no_result: print("Cannot check files, the following have apparently not been built:") print("\t" + "\n\t".join(no_result)) test.no_result(1) test.pass_test() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/test_pychecker.py0000664000175000017500000001053213160023045017634 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function __revision__ = "src/test_pychecker.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" """ Use pychecker to catch various Python coding errors. """ import os import os.path import sys import TestSCons test = TestSCons.TestSCons() test.skip_test('Not ready for clean pychecker output; skipping test.\n') try: import pychecker except ImportError: pychecker = test.where_is('pychecker') if not pychecker: test.skip_test("Could not find 'pychecker'; skipping test(s).\n") program = pychecker default_arguments = [] else: pychecker = os.path.join(os.path.split(pychecker.__file__)[0], 'checker.py') program = sys.executable default_arguments = [pychecker] try: cwd = os.environ['SCONS_CWD'] except KeyError: src_engine = os.environ['SCONS_LIB_DIR'] else: src_engine = os.path.join(cwd, 'build', 'scons-src', 'src', 'engine') if not os.path.exists(src_engine): src_engine = os.path.join(cwd, 'src', 'engine') src_engine_ = os.path.join(src_engine, '') MANIFEST = os.path.join(src_engine, 'MANIFEST.in') files = open(MANIFEST).read().split() files = [f for f in files if f[-3:] == '.py'] ignore = [ 'SCons/compat/__init__.py', 'SCons/compat/_scons_UserString.py', 'SCons/compat/_scons_hashlib.py', 'SCons/compat/_scons_sets.py', 'SCons/compat/_scons_subprocess.py', 'SCons/compat/builtins.py', ] u = {} for file in files: u[file] = 1 for file in ignore: try: del u[file] except KeyError: pass files = sorted(u.keys()) mismatches = [] default_arguments.extend([ '--quiet', '--limit=1000', # Suppress warnings about unused arguments to functions and methods. # We have too many wrapper functions that intentionally only use some # of their arguments. '--no-argsused', ]) if sys.platform == 'win32': default_arguments.extend([ '--blacklist', '"pywintypes,pywintypes.error"', ]) per_file_arguments = { #'SCons/__init__.py' : [ # '--varlist', # '"__revision__,__version__,__build__,__buildsys__,__date__,__developer__"', #], } pywintypes_warning = "warning: couldn't find real module for class pywintypes.error (module name: pywintypes)\n" os.environ['PYTHONPATH'] = src_engine for file in files: args = (default_arguments + per_file_arguments.get(file, []) + [os.path.join(src_engine, file)]) test.run(program=program, arguments=args, status=None, stderr=None) stdout = test.stdout() stdout = stdout.replace(src_engine_, '') stderr = test.stderr() stderr = stderr.replace(src_engine_, '') stderr = stderr.replace(pywintypes_warning, '') if test.status or stdout or stderr: mismatches.append('\n') mismatches.append(' '.join([program] + args) + '\n') mismatches.append('STDOUT =====================================\n') mismatches.append(stdout) if stderr: mismatches.append('STDERR =====================================\n') mismatches.append(stderr) if mismatches: print(''.join(mismatches[1:])) test.fail_test() test.pass_test() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/LICENSE.txt0000664000175000017500000000205713160023040016067 0ustar bdbaddogbdbaddogCopyright (c) 2001 - 2017 The SCons Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. scons-src-3.0.0/src/engine/0000775000175000017500000000000013160023040015505 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/0000775000175000017500000000000013160023045016537 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/PathListTests.py0000664000175000017500000001401413160023041021660 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/PathListTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestUnit import SCons.PathList class subst_pathTestCase(unittest.TestCase): def setUp(self): class FakeEnvironment(object): def __init__(self, **kw): self.kw = kw def subst(self, s, target=None, source=None, conv=lambda x: x): if s[0] == '$': s = s[1:] if s == 'target': s = target elif s == 'source': s = source else: s = self.kw[s] return s self.env = FakeEnvironment(AAA = 'aaa', NULL = '') from SCons.Environment import Environment self.env = Environment(AAA = 'aaa', NULL = '') def test_node(self): """Test the subst_path() method on a Node """ import SCons.Node class A(object): pass n = SCons.Node.Node() pl = SCons.PathList.PathList((n,)) result = pl.subst_path(self.env, 'y', 'z') assert result == (n,), result def test_object(self): """Test the subst_path() method on a non-Node object """ class A(object): def __str__(self): return '' a = A() pl = SCons.PathList.PathList((a,)) result = pl.subst_path(self.env, 'y', 'z') assert result == ('',), result def test_object_get(self): """Test the subst_path() method on an object with a get() method """ class B(object): def get(self): return 'b' b = B() pl = SCons.PathList.PathList((b,)) result = pl.subst_path(self.env, 'y', 'z') assert result == ('b',), result def test_string(self): """Test the subst_path() method on a non-substitution string """ self.env.subst = lambda s, target, source, conv: 'NOT THIS STRING' pl = SCons.PathList.PathList(('x')) result = pl.subst_path(self.env, 'y', 'z') assert result == ('x',), result def test_subst(self): """Test the subst_path() method on substitution strings """ pl = SCons.PathList.PathList(('$AAA', '$NULL')) result = pl.subst_path(self.env, 'y', 'z') assert result == ('aaa',), result def test_list_of_lists(self): """Test the subst_path() method on substitution of nested lists. """ pl = SCons.PathList.PathList((['$AAA', '$AAA'], '$NULL')) result = pl.subst_path(self.env, 'y', 'z') assert result == ('aaa', 'aaa'), result def test_subst_nested(self): """Test the subst_path() method on nested substitution of strings. """ self.env.Append(L1 = ['a', 'b'], L2 = ['c', 'd'], L3 = ['$L2']) pl = SCons.PathList.PathList(['$L1']) result = pl.subst_path(self.env, 'y', 'z') assert result == ('a', 'b'), result self.env.Append(L1 = ['$L2']) pl = SCons.PathList.PathList(['$L1']) result = pl.subst_path(self.env, 'y', 'z') assert result == ('a', 'b', 'c', 'd'), result self.env.Append(L1 = ['$L3']) pl = SCons.PathList.PathList(['$L1']) result = pl.subst_path(self.env, 'y', 'z') assert result == ('a', 'b', 'c', 'd', 'c', 'd'), result def test_another_env(self): """Test the subst_path does lazy evaluation. """ pl = SCons.PathList.PathList(('$AAA', '$NULL')) result = pl.subst_path(self.env, 'y', 'z') assert result == ('aaa',), result e = self.env.Clone(AAA = 'bbb') result = pl.subst_path(e, 'y', 'z') assert result == ('bbb',), result class PathListCacheTestCase(unittest.TestCase): def test_no_PathListCache(self): """Make sure the PathListCache class is not visible """ try: SCons.PathList.PathListCache except AttributeError: pass else: self.fail("Found PathListCache unexpectedly\n") class PathListTestCase(unittest.TestCase): def test_PathList(self): """Test the PathList() entry point """ x1 = SCons.PathList.PathList(('x',)) x2 = SCons.PathList.PathList(['x',]) assert x1 is x2, (x1, x2) x3 = SCons.PathList.PathList('x') assert not x1 is x3, (x1, x3) if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ subst_pathTestCase, PathListCacheTestCase, PathListTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/ActionTests.py0000664000175000017500000023345413160023040021357 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/ActionTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" # Define a null function and a null class for use as builder actions. # Where these are defined in the file seems to affect their byte-code # contents, so try to minimize changes by defining them here, before we # even import anything. def GlobalFunc(): pass class GlobalActFunc(object): def __call__(self): pass import collections import io import os import re import sys import types import unittest import SCons.Action import SCons.Environment import SCons.Errors import TestCmd import TestUnit # Initial setup of the common environment for all tests, # a temporary working directory containing a # script for writing arguments to an output file. # # We don't do this as a setUp() method because it's # unnecessary to create a separate directory and script # for each test, they can just use the one. test = TestCmd.TestCmd(workdir = '') test.write('act.py', """\ import os, string, sys f = open(sys.argv[1], 'w') f.write("act.py: '" + "' '".join(sys.argv[2:]) + "'\\n") try: if sys.argv[3]: f.write("act.py: '" + os.environ[sys.argv[3]] + "'\\n") except: pass f.close() if 'ACTPY_PIPE' in os.environ: if 'PIPE_STDOUT_FILE' in os.environ: stdout_msg = open(os.environ['PIPE_STDOUT_FILE'], 'r').read() else: stdout_msg = "act.py: stdout: executed act.py %s\\n" % ' '.join(sys.argv[1:]) sys.stdout.write( stdout_msg ) if 'PIPE_STDERR_FILE' in os.environ: stderr_msg = open(os.environ['PIPE_STDERR_FILE'], 'r').read() else: stderr_msg = "act.py: stderr: executed act.py %s\\n" % ' '.join(sys.argv[1:]) sys.stderr.write( stderr_msg ) sys.exit(0) """) test.write('exit.py', """\ import sys sys.exit(int(sys.argv[1])) """) act_py = test.workpath('act.py') exit_py = test.workpath('exit.py') outfile = test.workpath('outfile') outfile2 = test.workpath('outfile2') pipe_file = test.workpath('pipe.out') scons_env = SCons.Environment.Environment() # Capture all the stuff the Actions will print, # so it doesn't clutter the output. sys.stdout = io.StringIO() class CmdStringHolder(object): def __init__(self, cmd, literal=None): self.data = str(cmd) self.literal = literal def is_literal(self): return self.literal def escape(self, escape_func): """Escape the string with the supplied function. The function is expected to take an arbitrary string, then return it with all special characters escaped and ready for passing to the command interpreter. After calling this function, the next call to str() will return the escaped string. """ if self.is_literal(): return escape_func(self.data) elif ' ' in self.data or '\t' in self.data: return '"%s"' % self.data else: return self.data class Environment(object): def __init__(self, **kw): self.d = {} self.d['SHELL'] = scons_env['SHELL'] self.d['SPAWN'] = scons_env['SPAWN'] self.d['PSPAWN'] = scons_env['PSPAWN'] self.d['ESCAPE'] = scons_env['ESCAPE'] for k, v in kw.items(): self.d[k] = v # Just use the underlying scons_subst*() utility methods. def subst(self, strSubst, raw=0, target=[], source=[], conv=None): return SCons.Subst.scons_subst(strSubst, self, raw, target, source, self.d, conv=conv) subst_target_source = subst def subst_list(self, strSubst, raw=0, target=[], source=[], conv=None): return SCons.Subst.scons_subst_list(strSubst, self, raw, target, source, self.d, conv=conv) def __getitem__(self, item): return self.d[item] def __setitem__(self, item, value): self.d[item] = value def has_key(self, item): return item in self.d def get(self, key, value=None): return self.d.get(key, value) def items(self): return list(self.d.items()) def Dictionary(self): return self.d def Clone(self, **kw): res = Environment() res.d = SCons.Util.semi_deepcopy(self.d) for k, v in kw.items(): res.d[k] = v return res def sig_dict(self): d = {} for k,v in self.items(): d[k] = v d['TARGETS'] = ['__t1__', '__t2__', '__t3__', '__t4__', '__t5__', '__t6__'] d['TARGET'] = d['TARGETS'][0] d['SOURCES'] = ['__s1__', '__s2__', '__s3__', '__s4__', '__s5__', '__s6__'] d['SOURCE'] = d['SOURCES'][0] return d class DummyNode(object): def __init__(self, name): self.name = name def str_for_display(self): return '"' + self.name + '"' def __str__(self): return self.name def rfile(self): return self def get_subst_proxy(self): return self if os.name == 'java': python = os.path.join(sys.prefix, 'jython') else: python = os.environ.get('python_executable', sys.executable) _python_ = test.escape(python) _null = SCons.Action._null def test_varlist(pos_call, str_call, cmd, cmdstrfunc, **kw): def call_action(a, pos_call=pos_call, str_call=str_call, kw=kw): a = SCons.Action.Action(*a, **kw) # returned object must provide these entry points assert hasattr(a, '__call__') assert hasattr(a, 'get_contents') assert hasattr(a, 'genstring') pos_call(a) str_call(a) return a a = call_action((cmd, cmdstrfunc)) assert a.varlist == (), a.varlist a = call_action((cmd, cmdstrfunc, 'foo')) assert a.varlist == ('foo',), a.varlist a = call_action((cmd, cmdstrfunc, 'a', 'b', 'c')) assert a.varlist == ('a', 'b', 'c'), a.varlist a = call_action((cmd, cmdstrfunc, ['a', 'b', 'c'])) assert a.varlist == ('a', 'b', 'c'), a.varlist kw['varlist'] = 'foo' a = call_action((cmd, cmdstrfunc)) assert a.varlist == ('foo',), a.varlist kw['varlist'] = ['x', 'y', 'z'] a = call_action((cmd, cmdstrfunc)) assert a.varlist == ('x', 'y', 'z'), a.varlist a = call_action((cmd, cmdstrfunc, 'foo')) assert a.varlist == ('foo', 'x', 'y', 'z'), a.varlist a = call_action((cmd, cmdstrfunc, 'a', 'b', 'c')) assert a.varlist == ('a', 'b', 'c', 'x', 'y', 'z'), a.varlist def test_positional_args(pos_callback, cmd, **kw): """Test that Action() returns the expected type and that positional args work. """ act = SCons.Action.Action(cmd, **kw) pos_callback(act) assert act.varlist == (), act.varlist if not isinstance(act, SCons.Action._ActionAction): # only valid cmdstrfunc is None def none(a): pass test_varlist(pos_callback, none, cmd, None, **kw) else: # _ActionAction should have set these assert hasattr(act, 'strfunction') assert act.cmdstr is _null, act.cmdstr assert act.presub is _null, act.presub assert act.chdir is None, act.chdir assert act.exitstatfunc is SCons.Action.default_exitstatfunc, \ act.exitstatfunc def cmdstr(a): assert hasattr(a, 'strfunction') assert a.cmdstr == 'cmdstr', a.cmdstr test_varlist(pos_callback, cmdstr, cmd, 'cmdstr', **kw) def fun(): pass def strfun(a, fun=fun): assert a.strfunction is fun, a.strfunction assert a.cmdstr == _null, a.cmdstr test_varlist(pos_callback, strfun, cmd, fun, **kw) def none(a): assert hasattr(a, 'strfunction') assert a.cmdstr is None, a.cmdstr test_varlist(pos_callback, none, cmd, None, **kw) """Test handling of bad cmdstrfunc arguments """ try: a = SCons.Action.Action(cmd, [], **kw) except SCons.Errors.UserError as e: s = str(e) m = 'Invalid command display variable' assert s.find(m) != -1, 'Unexpected string: %s' % s else: raise Exception("did not catch expected UserError") return act class ActionTestCase(unittest.TestCase): """Test the Action() factory function""" def test_FunctionAction(self): """Test the Action() factory's creation of FunctionAction objects """ def foo(): pass def func_action(a, foo=foo): assert isinstance(a, SCons.Action.FunctionAction), a assert a.execfunction == foo, a.execfunction test_positional_args(func_action, foo) # a singleton list returns the contained action test_positional_args(func_action, [foo]) def test_CommandAction(self): """Test the Action() factory's creation of CommandAction objects """ def cmd_action(a): assert isinstance(a, SCons.Action.CommandAction), a assert a.cmd_list == "string", a.cmd_list test_positional_args(cmd_action, "string") # a singleton list returns the contained action test_positional_args(cmd_action, ["string"]) try: unicode except NameError: pass else: a2 = eval("SCons.Action.Action(u'string')") assert isinstance(a2, SCons.Action.CommandAction), a2 def line_action(a): assert isinstance(a, SCons.Action.CommandAction), a assert a.cmd_list == [ "explicit", "command", "line" ], a.cmd_list test_positional_args(line_action, [[ "explicit", "command", "line" ]]) def test_ListAction(self): """Test the Action() factory's creation of ListAction objects """ a1 = SCons.Action.Action(["x", "y", "z", [ "a", "b", "c"]]) assert isinstance(a1, SCons.Action.ListAction), a1 assert a1.varlist == (), a1.varlist assert isinstance(a1.list[0], SCons.Action.CommandAction), a1.list[0] assert a1.list[0].cmd_list == "x", a1.list[0].cmd_list assert isinstance(a1.list[1], SCons.Action.CommandAction), a1.list[1] assert a1.list[1].cmd_list == "y", a1.list[1].cmd_list assert isinstance(a1.list[2], SCons.Action.CommandAction), a1.list[2] assert a1.list[2].cmd_list == "z", a1.list[2].cmd_list assert isinstance(a1.list[3], SCons.Action.CommandAction), a1.list[3] assert a1.list[3].cmd_list == [ "a", "b", "c" ], a1.list[3].cmd_list a2 = SCons.Action.Action("x\ny\nz") assert isinstance(a2, SCons.Action.ListAction), a2 assert a2.varlist == (), a2.varlist assert isinstance(a2.list[0], SCons.Action.CommandAction), a2.list[0] assert a2.list[0].cmd_list == "x", a2.list[0].cmd_list assert isinstance(a2.list[1], SCons.Action.CommandAction), a2.list[1] assert a2.list[1].cmd_list == "y", a2.list[1].cmd_list assert isinstance(a2.list[2], SCons.Action.CommandAction), a2.list[2] assert a2.list[2].cmd_list == "z", a2.list[2].cmd_list def foo(): pass a3 = SCons.Action.Action(["x", foo, "z"]) assert isinstance(a3, SCons.Action.ListAction), a3 assert a3.varlist == (), a3.varlist assert isinstance(a3.list[0], SCons.Action.CommandAction), a3.list[0] assert a3.list[0].cmd_list == "x", a3.list[0].cmd_list assert isinstance(a3.list[1], SCons.Action.FunctionAction), a3.list[1] assert a3.list[1].execfunction == foo, a3.list[1].execfunction assert isinstance(a3.list[2], SCons.Action.CommandAction), a3.list[2] assert a3.list[2].cmd_list == "z", a3.list[2].cmd_list a4 = SCons.Action.Action(["x", "y"], strfunction=foo) assert isinstance(a4, SCons.Action.ListAction), a4 assert a4.varlist == (), a4.varlist assert isinstance(a4.list[0], SCons.Action.CommandAction), a4.list[0] assert a4.list[0].cmd_list == "x", a4.list[0].cmd_list assert a4.list[0].strfunction == foo, a4.list[0].strfunction assert isinstance(a4.list[1], SCons.Action.CommandAction), a4.list[1] assert a4.list[1].cmd_list == "y", a4.list[1].cmd_list assert a4.list[1].strfunction == foo, a4.list[1].strfunction a5 = SCons.Action.Action("x\ny", strfunction=foo) assert isinstance(a5, SCons.Action.ListAction), a5 assert a5.varlist == (), a5.varlist assert isinstance(a5.list[0], SCons.Action.CommandAction), a5.list[0] assert a5.list[0].cmd_list == "x", a5.list[0].cmd_list assert a5.list[0].strfunction == foo, a5.list[0].strfunction assert isinstance(a5.list[1], SCons.Action.CommandAction), a5.list[1] assert a5.list[1].cmd_list == "y", a5.list[1].cmd_list assert a5.list[1].strfunction == foo, a5.list[1].strfunction def test_CommandGeneratorAction(self): """Test the Action() factory's creation of CommandGeneratorAction objects """ def foo(): pass def gen_action(a, foo=foo): assert isinstance(a, SCons.Action.CommandGeneratorAction), a assert a.generator is foo, a.generator test_positional_args(gen_action, foo, generator=1) def test_LazyCmdGeneratorAction(self): """Test the Action() factory's creation of lazy CommandGeneratorAction objects """ def lazy_action(a): assert isinstance(a, SCons.Action.LazyAction), a assert a.var == "FOO", a.var assert a.cmd_list == "${FOO}", a.cmd_list test_positional_args(lazy_action, "$FOO") test_positional_args(lazy_action, "${FOO}") def test_no_action(self): """Test when the Action() factory can't create an action object """ try: a5 = SCons.Action.Action(1) except TypeError: pass else: assert 0, "Should have thrown a TypeError creating Action from an int." def test_reentrance(self): """Test the Action() factory when the action is already an Action object """ a1 = SCons.Action.Action("foo") a2 = SCons.Action.Action(a1) assert a2 is a1, a2 class _ActionActionTestCase(unittest.TestCase): def test__init__(self): """Test creation of _ActionAction objects """ def func1(): pass def func2(): pass def func3(): pass a = SCons.Action._ActionAction() assert not hasattr(a, 'strfunction') assert a.cmdstr is _null, a.cmdstr assert a.varlist == (), a.varlist assert a.presub is _null, a.presub assert a.chdir is None, a.chdir assert a.exitstatfunc is SCons.Action.default_exitstatfunc, a.exitstatfunc assert SCons.Action._ActionAction(kwarg = 1) assert not hasattr(a, 'kwarg') assert not hasattr(a, 'strfunction') assert a.cmdstr is _null, a.cmdstr assert a.varlist == (), a.varlist assert a.presub is _null, a.presub assert a.chdir is None, a.chdir assert a.exitstatfunc is SCons.Action.default_exitstatfunc, a.exitstatfunc a = SCons.Action._ActionAction(strfunction=func1) assert a.strfunction is func1, a.strfunction a = SCons.Action._ActionAction(strfunction=None) assert not hasattr(a, 'strfunction') assert a.cmdstr is None, a.cmdstr a = SCons.Action._ActionAction(cmdstr='cmdstr') assert not hasattr(a, 'strfunction') assert a.cmdstr is 'cmdstr', a.cmdstr a = SCons.Action._ActionAction(cmdstr=None) assert not hasattr(a, 'strfunction') assert a.cmdstr is None, a.cmdstr t = ('a','b','c') a = SCons.Action._ActionAction(varlist=t) assert a.varlist == t, a.varlist a = SCons.Action._ActionAction(presub=func1) assert a.presub is func1, a.presub a = SCons.Action._ActionAction(chdir=1) assert a.chdir is 1, a.chdir a = SCons.Action._ActionAction(exitstatfunc=func1) assert a.exitstatfunc is func1, a.exitstatfunc a = SCons.Action._ActionAction( # alphabetical order ... chdir='x', cmdstr='cmdstr', exitstatfunc=func3, presub=func2, strfunction=func1, varlist=t, ) assert a.chdir is 'x', a.chdir assert a.cmdstr is 'cmdstr', a.cmdstr assert a.exitstatfunc is func3, a.exitstatfunc assert a.presub is func2, a.presub assert a.strfunction is func1, a.strfunction assert a.varlist is t, a.varlist def test_dup_keywords(self): """Test handling of both cmdstr and strfunction arguments """ def func(): pass try: a = SCons.Action.Action('foo', cmdstr='string', strfunction=func) except SCons.Errors.UserError as e: s = str(e) m = 'Cannot have both strfunction and cmdstr args to Action()' assert s.find(m) != -1, 'Unexpected string: %s' % s else: raise Exception("did not catch expected UserError") def test___cmp__(self): """Test Action comparison """ a1 = SCons.Action.Action("x") a2 = SCons.Action.Action("x") assert a1 == a2 a3 = SCons.Action.Action("y") assert a1 != a3 assert a2 != a3 def test_print_cmd_lines(self): """Test the print_cmd_lines() method """ save_stdout = sys.stdout try: def execfunc(target, source, env): pass a = SCons.Action.Action(execfunc) sio = io.StringIO() sys.stdout = sio a.print_cmd_line("foo bar", None, None, None) s = sio.getvalue() assert s == "foo bar\n", s finally: sys.stdout = save_stdout def test___call__(self): """Test calling an Action """ save_stdout = sys.stdout save_print_actions = SCons.Action.print_actions save_print_actions_presub = SCons.Action.print_actions_presub save_execute_actions = SCons.Action.execute_actions #SCons.Action.print_actions = 0 test = TestCmd.TestCmd(workdir = '') test.subdir('sub', 'xyz') os.chdir(test.workpath()) try: env = Environment() def execfunc(target, source, env): assert isinstance(target, list), type(target) assert isinstance(source, list), type(source) return 7 a = SCons.Action.Action(execfunc) def firstfunc(target, source, env): assert isinstance(target, list), type(target) assert isinstance(source, list), type(source) return 0 def lastfunc(target, source, env): assert isinstance(target, list), type(target) assert isinstance(source, list), type(source) return 9 b = SCons.Action.Action([firstfunc, execfunc, lastfunc]) sio = io.StringIO() sys.stdout = sio result = a("out", "in", env) assert result.status == 7, result s = sio.getvalue() assert s == "execfunc(['out'], ['in'])\n", s a.chdir = 'xyz' expect = "os.chdir(%s)\nexecfunc(['out'], ['in'])\nos.chdir(%s)\n" sio = io.StringIO() sys.stdout = sio result = a("out", "in", env) assert result.status == 7, result.status s = sio.getvalue() assert s == expect % (repr('xyz'), repr(test.workpath())), s sio = io.StringIO() sys.stdout = sio result = a("out", "in", env, chdir='sub') assert result.status == 7, result.status s = sio.getvalue() assert s == expect % (repr('sub'), repr(test.workpath())), s a.chdir = None sio = io.StringIO() sys.stdout = sio result = b("out", "in", env) assert result.status == 7, result.status s = sio.getvalue() assert s == "firstfunc(['out'], ['in'])\nexecfunc(['out'], ['in'])\n", s SCons.Action.execute_actions = 0 sio = io.StringIO() sys.stdout = sio result = a("out", "in", env) assert result == 0, result s = sio.getvalue() assert s == "execfunc(['out'], ['in'])\n", s sio = io.StringIO() sys.stdout = sio result = b("out", "in", env) assert result == 0, result s = sio.getvalue() assert s == "firstfunc(['out'], ['in'])\nexecfunc(['out'], ['in'])\nlastfunc(['out'], ['in'])\n", s SCons.Action.print_actions_presub = 1 SCons.Action.execute_actions = 1 sio = io.StringIO() sys.stdout = sio result = a("out", "in", env) assert result.status == 7, result.status s = sio.getvalue() assert s == "Building out with action:\n execfunc(target, source, env)\nexecfunc(['out'], ['in'])\n", s sio = io.StringIO() sys.stdout = sio result = a("out", "in", env, presub=0) assert result.status == 7, result.status s = sio.getvalue() assert s == "execfunc(['out'], ['in'])\n", s sio = io.StringIO() sys.stdout = sio result = a("out", "in", env, presub=1) assert result.status == 7, result.status s = sio.getvalue() assert s == "Building out with action:\n execfunc(target, source, env)\nexecfunc(['out'], ['in'])\n", s sio = io.StringIO() sys.stdout = sio result = b(["out"], "in", env, presub=1) assert result.status == 7, result.status s = sio.getvalue() assert s == "Building out with action:\n firstfunc(target, source, env)\nfirstfunc(['out'], ['in'])\nBuilding out with action:\n execfunc(target, source, env)\nexecfunc(['out'], ['in'])\n", s sio = io.StringIO() sys.stdout = sio result = b(["out", "list"], "in", env, presub=1) assert result.status == 7, result.status s = sio.getvalue() assert s == "Building out and list with action:\n firstfunc(target, source, env)\nfirstfunc(['out', 'list'], ['in'])\nBuilding out and list with action:\n execfunc(target, source, env)\nexecfunc(['out', 'list'], ['in'])\n", s a2 = SCons.Action.Action(execfunc) sio = io.StringIO() sys.stdout = sio result = a2("out", "in", env) assert result.status == 7, result.status s = sio.getvalue() assert s == "Building out with action:\n execfunc(target, source, env)\nexecfunc(['out'], ['in'])\n", s sio = io.StringIO() sys.stdout = sio result = a2("out", "in", env, presub=0) assert result.status == 7, result.status s = sio.getvalue() assert s == "execfunc(['out'], ['in'])\n", s SCons.Action.execute_actions = 0 sio = io.StringIO() sys.stdout = sio result = a2("out", "in", env, presub=0) assert result == 0, result s = sio.getvalue() assert s == "execfunc(['out'], ['in'])\n", s sio = io.StringIO() sys.stdout = sio result = a("out", "in", env, presub=0, execute=1, show=0) assert result.status == 7, result.status s = sio.getvalue() assert s == '', s sys.stdout = save_stdout exitstatfunc_result = [] def exitstatfunc(stat, result=exitstatfunc_result): result.append(stat) return stat result = a("out", "in", env, exitstatfunc=exitstatfunc) assert result == 0, result assert exitstatfunc_result == [], exitstatfunc_result result = a("out", "in", env, execute=1, exitstatfunc=exitstatfunc) assert result.status == 7, result.status assert exitstatfunc_result == [7], exitstatfunc_result SCons.Action.execute_actions = 1 result = [] def my_print_cmd_line(s, target, source, env, result=result): result.append(s) env['PRINT_CMD_LINE_FUNC'] = my_print_cmd_line a("output", "input", env) assert result == ["execfunc(['output'], ['input'])"], result finally: sys.stdout = save_stdout SCons.Action.print_actions = save_print_actions SCons.Action.print_actions_presub = save_print_actions_presub SCons.Action.execute_actions = save_execute_actions def test_presub_lines(self): """Test the presub_lines() method """ env = Environment() a = SCons.Action.Action("x") s = a.presub_lines(env) assert s == ['x'], s a = SCons.Action.Action(["y", "z"]) s = a.presub_lines(env) assert s == ['y', 'z'], s def func(): pass a = SCons.Action.Action(func) s = a.presub_lines(env) assert s == ["func(target, source, env)"], s def gen(target, source, env, for_signature): return 'generat' + env.get('GEN', 'or') a = SCons.Action.Action(gen, generator=1) s = a.presub_lines(env) assert s == ["generator"], s s = a.presub_lines(Environment(GEN = 'ed')) assert s == ["generated"], s a = SCons.Action.Action("$ACT") s = a.presub_lines(env) assert s == [''], s s = a.presub_lines(Environment(ACT = 'expanded action')) assert s == ['expanded action'], s def test_add(self): """Test adding Actions to stuff.""" # Adding actions to other Actions or to stuff that can # be converted into an Action should produce a ListAction # containing all the Actions. def bar(): return None baz = SCons.Action.Action(bar, generator=1) act1 = SCons.Action.Action('foo bar') act2 = SCons.Action.Action([ 'foo', bar ]) sum = act1 + act2 assert isinstance(sum, SCons.Action.ListAction), str(sum) assert len(sum.list) == 3, len(sum.list) assert [isinstance(x, SCons.Action.ActionBase) for x in sum.list] == [ 1, 1, 1 ] sum = act1 + act1 assert isinstance(sum, SCons.Action.ListAction), str(sum) assert len(sum.list) == 2, len(sum.list) sum = act2 + act2 assert isinstance(sum, SCons.Action.ListAction), str(sum) assert len(sum.list) == 4, len(sum.list) # Should also be able to add command generators to each other # or to actions sum = baz + baz assert isinstance(sum, SCons.Action.ListAction), str(sum) assert len(sum.list) == 2, len(sum.list) sum = baz + act1 assert isinstance(sum, SCons.Action.ListAction), str(sum) assert len(sum.list) == 2, len(sum.list) sum = act2 + baz assert isinstance(sum, SCons.Action.ListAction), str(sum) assert len(sum.list) == 3, len(sum.list) # Also should be able to add Actions to anything that can # be converted into an action. sum = act1 + bar assert isinstance(sum, SCons.Action.ListAction), str(sum) assert len(sum.list) == 2, len(sum.list) assert isinstance(sum.list[1], SCons.Action.FunctionAction) sum = 'foo bar' + act2 assert isinstance(sum, SCons.Action.ListAction), str(sum) assert len(sum.list) == 3, len(sum.list) assert isinstance(sum.list[0], SCons.Action.CommandAction) sum = [ 'foo', 'bar' ] + act1 assert isinstance(sum, SCons.Action.ListAction), str(sum) assert len(sum.list) == 3, sum.list assert isinstance(sum.list[0], SCons.Action.CommandAction) assert isinstance(sum.list[1], SCons.Action.CommandAction) sum = act2 + [ baz, bar ] assert isinstance(sum, SCons.Action.ListAction), str(sum) assert len(sum.list) == 4, len(sum.list) assert isinstance(sum.list[2], SCons.Action.CommandGeneratorAction) assert isinstance(sum.list[3], SCons.Action.FunctionAction) # OK to add None on either side (should be ignored) sum = act1 + None assert sum == act1 sum = None + act1 assert sum == act1 try: sum = act2 + 1 except TypeError: pass else: assert 0, "Should have thrown a TypeError adding to an int." try: sum = 1 + act2 except TypeError: pass else: assert 0, "Should have thrown a TypeError adding to an int." class CommandActionTestCase(unittest.TestCase): def test___init__(self): """Test creation of a command Action """ a = SCons.Action.CommandAction(["xyzzy"]) assert a.cmd_list == [ "xyzzy" ], a.cmd_list assert a.cmdstr is _null, a.cmdstr a = SCons.Action.CommandAction(["abra"], cmdstr="cadabra") assert a.cmd_list == [ "abra" ], a.cmd_list assert a.cmdstr == "cadabra", a.cmdstr def test___str__(self): """Test fetching the pre-substitution string for command Actions """ env = Environment() act = SCons.Action.CommandAction('xyzzy $TARGET $SOURCE') s = str(act) assert s == 'xyzzy $TARGET $SOURCE', s act = SCons.Action.CommandAction(['xyzzy', '$TARGET', '$SOURCE', '$TARGETS', '$SOURCES']) s = str(act) assert s == "xyzzy $TARGET $SOURCE $TARGETS $SOURCES", s def test_genstring(self): """Test the genstring() method for command Actions """ env = Environment() t1 = DummyNode('t1') t2 = DummyNode('t2') s1 = DummyNode('s1') s2 = DummyNode('s2') act = SCons.Action.CommandAction('xyzzy $TARGET $SOURCE') expect = 'xyzzy $TARGET $SOURCE' s = act.genstring([], [], env) assert s == expect, s s = act.genstring([t1], [s1], env) assert s == expect, s s = act.genstring([t1, t2], [s1, s2], env) assert s == expect, s act = SCons.Action.CommandAction('xyzzy $TARGETS $SOURCES') expect = 'xyzzy $TARGETS $SOURCES' s = act.genstring([], [], env) assert s == expect, s s = act.genstring([t1], [s1], env) assert s == expect, s s = act.genstring([t1, t2], [s1, s2], env) assert s == expect, s act = SCons.Action.CommandAction(['xyzzy', '$TARGET', '$SOURCE', '$TARGETS', '$SOURCES']) expect = "xyzzy $TARGET $SOURCE $TARGETS $SOURCES" s = act.genstring([], [], env) assert s == expect, s s = act.genstring([t1], [s1], env) assert s == expect, s s = act.genstring([t1, t2], [s1, s2], env) assert s == expect, s def test_strfunction(self): """Test fetching the string representation of command Actions """ env = Environment() t1 = DummyNode('t1') t2 = DummyNode('t2') s1 = DummyNode('s1') s2 = DummyNode('s2') act = SCons.Action.CommandAction('xyzzy $TARGET $SOURCE') s = act.strfunction([], [], env) assert s == 'xyzzy', s s = act.strfunction([t1], [s1], env) assert s == 'xyzzy t1 s1', s s = act.strfunction([t1, t2], [s1, s2], env) assert s == 'xyzzy t1 s1', s act = SCons.Action.CommandAction('xyzzy $TARGET $SOURCE', cmdstr='cmdstr - $SOURCE - $TARGET -') s = act.strfunction([], [], env) assert s == 'cmdstr - - -', s s = act.strfunction([t1], [s1], env) assert s == 'cmdstr - s1 - t1 -', s s = act.strfunction([t1, t2], [s1, s2], env) assert s == 'cmdstr - s1 - t1 -', s act = SCons.Action.CommandAction('xyzzy $TARGETS $SOURCES') s = act.strfunction([], [], env) assert s == 'xyzzy', s s = act.strfunction([t1], [s1], env) assert s == 'xyzzy t1 s1', s s = act.strfunction([t1, t2], [s1, s2], env) assert s == 'xyzzy t1 t2 s1 s2', s act = SCons.Action.CommandAction('xyzzy $TARGETS $SOURCES', cmdstr='cmdstr = $SOURCES = $TARGETS =') s = act.strfunction([], [], env) assert s == 'cmdstr = = =', s s = act.strfunction([t1], [s1], env) assert s == 'cmdstr = s1 = t1 =', s s = act.strfunction([t1, t2], [s1, s2], env) assert s == 'cmdstr = s1 s2 = t1 t2 =', s act = SCons.Action.CommandAction(['xyzzy', '$TARGET', '$SOURCE', '$TARGETS', '$SOURCES']) s = act.strfunction([], [], env) assert s == 'xyzzy', s s = act.strfunction([t1], [s1], env) assert s == 'xyzzy t1 s1 t1 s1', s s = act.strfunction([t1, t2], [s1, s2], env) assert s == 'xyzzy t1 s1 t1 t2 s1 s2', s act = SCons.Action.CommandAction('xyzzy $TARGETS $SOURCES', cmdstr='cmdstr\t$TARGETS\n$SOURCES ') s = act.strfunction([], [], env) assert s == 'cmdstr\t\n ', s s = act.strfunction([t1], [s1], env) assert s == 'cmdstr\tt1\ns1 ', s s = act.strfunction([t1, t2], [s1, s2], env) assert s == 'cmdstr\tt1 t2\ns1 s2 ', s def sf(target, source, env): return "sf was called" act = SCons.Action.CommandAction('foo', strfunction=sf) s = act.strfunction([], [], env) assert s == "sf was called", s class actclass1(object): def __init__(self, targets, sources, env): pass def __call__(self): return 1 class actclass2(object): def __init__(self, targets, sources, env): self.strfunction = 5 def __call__(self): return 2 class actclass3(object): def __init__(self, targets, sources, env): pass def __call__(self): return 3 def strfunction(self, targets, sources, env): return 'actclass3 on %s to get %s'%(str(sources[0]), str(targets[0])) class actclass4(object): def __init__(self, targets, sources, env): pass def __call__(self): return 4 strfunction = None act1 = SCons.Action.Action(actclass1([t1], [s1], env)) s = act1.strfunction([t1], [s1], env) assert s == 'actclass1(["t1"], ["s1"])', s act2 = SCons.Action.Action(actclass2([t1], [s1], env)) s = act2.strfunction([t1], [s1], env) assert s == 'actclass2(["t1"], ["s1"])', s act3 = SCons.Action.Action(actclass3([t1], [s1], env)) s = act3.strfunction([t1], [s1], env) assert s == 'actclass3 on s1 to get t1', s act4 = SCons.Action.Action(actclass4([t1], [s1], env)) s = act4.strfunction([t1], [s1], env) assert s is None, s act = SCons.Action.CommandAction("@foo bar") s = act.strfunction([], [], env) assert s == "", s act = SCons.Action.CommandAction("@-foo bar") s = act.strfunction([], [], env) assert s == "", s act = SCons.Action.CommandAction("-@foo bar") s = act.strfunction([], [], env) assert s == "", s act = SCons.Action.CommandAction("-foo bar") s = act.strfunction([], [], env) assert s == "foo bar", s act = SCons.Action.CommandAction("@ foo bar") s = act.strfunction([], [], env) assert s == "", s act = SCons.Action.CommandAction("@- foo bar") s = act.strfunction([], [], env) assert s == "", s act = SCons.Action.CommandAction("-@ foo bar") s = act.strfunction([], [], env) assert s == "", s act = SCons.Action.CommandAction("- foo bar") s = act.strfunction([], [], env) assert s == "foo bar", s def test_execute(self): """Test execution of command Actions """ try: env = self.env except AttributeError: env = Environment() cmd1 = r'%s %s %s xyzzy' % (_python_, act_py, outfile) act = SCons.Action.CommandAction(cmd1) r = act([], [], env.Clone()) assert r == 0 c = test.read(outfile, 'r') assert c == "act.py: 'xyzzy'\n", c cmd2 = r'%s %s %s $TARGET' % (_python_, act_py, outfile) act = SCons.Action.CommandAction(cmd2) r = act(DummyNode('foo'), [], env.Clone()) assert r == 0 c = test.read(outfile, 'r') assert c == "act.py: 'foo'\n", c cmd3 = r'%s %s %s ${TARGETS}' % (_python_, act_py, outfile) act = SCons.Action.CommandAction(cmd3) r = act(list(map(DummyNode, ['aaa', 'bbb'])), [], env.Clone()) assert r == 0 c = test.read(outfile, 'r') assert c == "act.py: 'aaa' 'bbb'\n", c cmd4 = r'%s %s %s $SOURCES' % (_python_, act_py, outfile) act = SCons.Action.CommandAction(cmd4) r = act([], [DummyNode('one'), DummyNode('two')], env.Clone()) assert r == 0 c = test.read(outfile, 'r') assert c == "act.py: 'one' 'two'\n", c cmd4 = r'%s %s %s ${SOURCES[:2]}' % (_python_, act_py, outfile) act = SCons.Action.CommandAction(cmd4) sources = [DummyNode('three'), DummyNode('four'), DummyNode('five')] env2 = env.Clone() r = act([], source = sources, env = env2) assert r == 0 c = test.read(outfile, 'r') assert c == "act.py: 'three' 'four'\n", c cmd5 = r'%s %s %s $TARGET XYZZY' % (_python_, act_py, outfile) act = SCons.Action.CommandAction(cmd5) env5 = Environment() if 'ENV' in scons_env: env5['ENV'] = scons_env['ENV'] PATH = scons_env['ENV'].get('PATH', '') else: env5['ENV'] = {} PATH = '' env5['ENV']['XYZZY'] = 'xyzzy' r = act(target = DummyNode('out5'), source = [], env = env5) act = SCons.Action.CommandAction(cmd5) r = act(target = DummyNode('out5'), source = [], env = env.Clone(ENV = {'XYZZY' : 'xyzzy5', 'PATH' : PATH})) assert r == 0 c = test.read(outfile, 'r') assert c == "act.py: 'out5' 'XYZZY'\nact.py: 'xyzzy5'\n", c class Obj(object): def __init__(self, str): self._str = str def __str__(self): return self._str def rfile(self): return self def get_subst_proxy(self): return self cmd6 = r'%s %s %s ${TARGETS[1]} $TARGET ${SOURCES[:2]}' % (_python_, act_py, outfile) act = SCons.Action.CommandAction(cmd6) r = act(target = [Obj('111'), Obj('222')], source = [Obj('333'), Obj('444'), Obj('555')], env = env.Clone()) assert r == 0 c = test.read(outfile, 'r') assert c == "act.py: '222' '111' '333' '444'\n", c if os.name == 'nt': # NT treats execs of directories and non-executable files # as "file not found" errors expect_nonexistent = 1 expect_nonexecutable_file = 1 expect_nonexecutable_dir = 1 elif sys.platform == 'cygwin': expect_nonexistent = 127 # Newer cygwin seems to return 126 for following expect_nonexecutable_file = 126 expect_nonexecutable_dir = 127 elif sys.platform.find('sunos') != -1: expect_nonexistent = 1 expect_nonexecutable_file = 1 expect_nonexecutable_dir = 1 else: expect_nonexistent = 127 expect_nonexecutable_file = 126 expect_nonexecutable_dir = 126 # Test that a nonexistent command returns 127 act = SCons.Action.CommandAction(python + "_no_such_command_") r = act([], [], env.Clone(out = outfile)) assert r.status == expect_nonexistent, r.status # Test that trying to execute a directory returns 126 dir, tail = os.path.split(python) act = SCons.Action.CommandAction(dir) r = act([], [], env.Clone(out = outfile)) assert r.status == expect_nonexecutable_file, r.status # Test that trying to execute a non-executable file returns 126 act = SCons.Action.CommandAction(outfile) r = act([], [], env.Clone(out = outfile)) assert r.status == expect_nonexecutable_dir, r.status act = SCons.Action.CommandAction('%s %s 1' % (_python_, exit_py)) r = act([], [], env) assert r.status == 1, r.status act = SCons.Action.CommandAction('@%s %s 1' % (_python_, exit_py)) r = act([], [], env) assert r.status == 1, r.status act = SCons.Action.CommandAction('@-%s %s 1' % (_python_, exit_py)) r = act([], [], env) assert r == 0, r act = SCons.Action.CommandAction('-%s %s 1' % (_python_, exit_py)) r = act([], [], env) assert r == 0, r act = SCons.Action.CommandAction('@ %s %s 1' % (_python_, exit_py)) r = act([], [], env) assert r.status == 1, r.status act = SCons.Action.CommandAction('@- %s %s 1' % (_python_, exit_py)) r = act([], [], env) assert r == 0, r act = SCons.Action.CommandAction('- %s %s 1' % (_python_, exit_py)) r = act([], [], env) assert r == 0, r def test_set_handler(self): """Test setting the command handler... """ class Test(object): def __init__(self): self.executed = 0 t=Test() def func(sh, escape, cmd, args, env, test=t): test.executed = args test.shell = sh return 0 def escape_func(cmd): return '**' + cmd + '**' class LiteralStr(object): def __init__(self, x): self.data = x def __str__(self): return self.data def escape(self, escape_func): return escape_func(self.data) def is_literal(self): return 1 a = SCons.Action.CommandAction(["xyzzy"]) e = Environment(SPAWN = func) a([], [], e) assert t.executed == [ 'xyzzy' ], t.executed a = SCons.Action.CommandAction(["xyzzy"]) e = Environment(SPAWN = '$FUNC', FUNC = func) a([], [], e) assert t.executed == [ 'xyzzy' ], t.executed a = SCons.Action.CommandAction(["xyzzy"]) e = Environment(SPAWN = func, SHELL = 'fake shell') a([], [], e) assert t.executed == [ 'xyzzy' ], t.executed assert t.shell == 'fake shell', t.shell a = SCons.Action.CommandAction([ LiteralStr("xyzzy") ]) e = Environment(SPAWN = func, ESCAPE = escape_func) a([], [], e) assert t.executed == [ '**xyzzy**' ], t.executed def test_get_contents(self): """Test fetching the contents of a command Action """ def CmdGen(target, source, env, for_signature): assert for_signature return "%s %s" % \ (env["foo"], env["bar"]) # The number 1 is there to make sure all args get converted to strings. a = SCons.Action.CommandAction(["|", "$(", "$foo", "|", "$(", "$bar", "$)", "stuff", "$)", "|", "$baz", 1]) c = a.get_contents(target=[], source=[], env=Environment(foo = 'FFF', bar = 'BBB', baz = CmdGen)) assert c == b"| | FFF BBB 1", c # Make sure that CommandActions use an Environment's # subst_target_source() method for substitution. class SpecialEnvironment(Environment): def subst_target_source(self, strSubst, raw=0, target=[], source=[]): return 'subst_target_source: ' + strSubst c = a.get_contents(target=DummyNode('ttt'), source = DummyNode('sss'), env=SpecialEnvironment(foo = 'GGG', bar = 'CCC', baz = 'ZZZ')) assert c == b'subst_target_source: | $( $foo | $( $bar $) stuff $) | $baz 1', c # We've discussed using the real target and source names in a # CommandAction's signature contents. This would have have the # advantage of recompiling when a file's name changes (keeping # debug info current), but it would currently break repository # logic that will change the file name based on whether the # files come from a repository or locally. If we ever move to # that scheme, then all of the '__t1__' and '__s6__' file names # in the asserts below would change to 't1' and 's6' and the # like. t = list(map(DummyNode, ['t1', 't2', 't3', 't4', 't5', 't6'])) s = list(map(DummyNode, ['s1', 's2', 's3', 's4', 's5', 's6'])) env = Environment() a = SCons.Action.CommandAction(["$TARGET"]) c = a.get_contents(target=t, source=s, env=env) assert c == b"t1", c a = SCons.Action.CommandAction(["$TARGETS"]) c = a.get_contents(target=t, source=s, env=env) assert c == b"t1 t2 t3 t4 t5 t6", c a = SCons.Action.CommandAction(["${TARGETS[2]}"]) c = a.get_contents(target=t, source=s, env=env) assert c == b"t3", c a = SCons.Action.CommandAction(["${TARGETS[3:5]}"]) c = a.get_contents(target=t, source=s, env=env) assert c == b"t4 t5", c a = SCons.Action.CommandAction(["$SOURCE"]) c = a.get_contents(target=t, source=s, env=env) assert c == b"s1", c a = SCons.Action.CommandAction(["$SOURCES"]) c = a.get_contents(target=t, source=s, env=env) assert c == b"s1 s2 s3 s4 s5 s6", c a = SCons.Action.CommandAction(["${SOURCES[2]}"]) c = a.get_contents(target=t, source=s, env=env) assert c == b"s3", c a = SCons.Action.CommandAction(["${SOURCES[3:5]}"]) c = a.get_contents(target=t, source=s, env=env) assert c == b"s4 s5", c class CommandGeneratorActionTestCase(unittest.TestCase): def factory(self, act, **kw): """Pass any keywords as a dict""" return SCons.Action.CommandGeneratorAction(act, kw) def test___init__(self): """Test creation of a command generator Action """ def f(target, source, env): pass a = self.factory(f) assert a.generator == f def test___str__(self): """Test the pre-substitution strings for command generator Actions """ def f(target, source, env, for_signature, self=self): # See if "env" is really a construction environment (or # looks like one) by accessing the FindIxes attribute. # (The Tool/mingw.py module has a generator that uses this, # and the __str__() method used to cause problems by passing # us a regular dictionary as a fallback.) env.FindIxes return "FOO" a = self.factory(f) s = str(a) assert s == 'FOO', s def test_genstring(self): """Test the command generator Action genstring() method """ def f(target, source, env, for_signature, self=self): dummy = env['dummy'] self.dummy = dummy return "$FOO $TARGET $SOURCE $TARGETS $SOURCES" a = self.factory(f) self.dummy = 0 s = a.genstring([], [], env=Environment(FOO='xyzzy', dummy=1)) assert self.dummy == 1, self.dummy assert s == "$FOO $TARGET $SOURCE $TARGETS $SOURCES", s def test_execute(self): """Test executing a command generator Action """ def f(target, source, env, for_signature, self=self): dummy = env['dummy'] self.dummy = dummy s = env.subst("$FOO") assert s == 'foo baz\nbar ack', s return "$FOO" def func_action(target, source, env, self=self): dummy=env['dummy'] s = env.subst('$foo') assert s == 'bar', s self.dummy=dummy def f2(target, source, env, for_signature, f=func_action): return f def ch(sh, escape, cmd, args, env, self=self): self.cmd.append(cmd) self.args.append(args) a = self.factory(f) self.dummy = 0 self.cmd = [] self.args = [] a([], [], env=Environment(FOO = 'foo baz\nbar ack', dummy = 1, SPAWN = ch)) assert self.dummy == 1, self.dummy assert self.cmd == ['foo', 'bar'], self.cmd assert self.args == [[ 'foo', 'baz' ], [ 'bar', 'ack' ]], self.args b = self.factory(f2) self.dummy = 0 b(target=[], source=[], env=Environment(foo = 'bar', dummy = 2 )) assert self.dummy==2, self.dummy del self.dummy class DummyFile(object): def __init__(self, t): self.t = t def rfile(self): self.t.rfile_called = 1 return self def get_subst_proxy(self): return self def f3(target, source, env, for_signature): return '' c = self.factory(f3) c(target=[], source=DummyFile(self), env=Environment()) assert self.rfile_called def test_get_contents(self): """Test fetching the contents of a command generator Action """ def f(target, source, env, for_signature): foo = env['foo'] bar = env['bar'] assert for_signature, for_signature return [["guux", foo, "$(", "$ignore", "$)", bar, '${test("$( foo $bar $)")}' ]] def test(mystr): assert mystr == "$( foo $bar $)", mystr return "test" env = Environment(foo = 'FFF', bar = 'BBB', ignore = 'foo', test=test) a = self.factory(f) c = a.get_contents(target=[], source=[], env=env) assert c == b"guux FFF BBB test", c def test_get_contents_of_function_action(self): """Test contents of a CommandGeneratorAction-generated FunctionAction """ def LocalFunc(): pass # Since the python bytecode has per version differences, we need different expected results per version func_matches = { (2,7) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), (3,5) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), (3,6) : bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), } meth_matches = [ b"1, 1, 0, 0,(),(),(d\000\000S),(),()", b"1, 1, 0, 0,(),(),(d\x00\x00S),(),()", ] def f_global(target, source, env, for_signature): return SCons.Action.Action(GlobalFunc) def f_local(target, source, env, for_signature): return SCons.Action.Action(LocalFunc) env = Environment(XYZ = 'foo') a = self.factory(f_global) c = a.get_contents(target=[], source=[], env=env) assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+repr(func_matches[sys.version_info[:2]]) a = self.factory(f_local) c = a.get_contents(target=[], source=[], env=env) assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+repr(func_matches[sys.version_info[:2]]) def f_global(target, source, env, for_signature): return SCons.Action.Action(GlobalFunc, varlist=['XYZ']) def f_local(target, source, env, for_signature): return SCons.Action.Action(LocalFunc, varlist=['XYZ']) matches_foo = func_matches[sys.version_info[:2]] + b'foo' a = self.factory(f_global) c = a.get_contents(target=[], source=[], env=env) assert c in matches_foo, repr(c) a = self.factory(f_local) c = a.get_contents(target=[], source=[], env=env) assert c in matches_foo, repr(c) class FunctionActionTestCase(unittest.TestCase): def test___init__(self): """Test creation of a function Action """ def func1(): pass def func2(): pass def func3(): pass def func4(): pass a = SCons.Action.FunctionAction(func1, {}) assert a.execfunction == func1, a.execfunction assert isinstance(a.strfunction, types.MethodType), type(a.strfunction) a = SCons.Action.FunctionAction(func2, { 'strfunction' : func3 }) assert a.execfunction == func2, a.execfunction assert a.strfunction == func3, a.strfunction def test___str__(self): """Test the __str__() method for function Actions """ def func1(): pass a = SCons.Action.FunctionAction(func1, {}) s = str(a) assert s == "func1(target, source, env)", s class class1(object): def __call__(self): pass a = SCons.Action.FunctionAction(class1(), {}) s = str(a) assert s == "class1(target, source, env)", s def test_execute(self): """Test executing a function Action """ self.inc = 0 def f(target, source, env): s = env['s'] s.inc = s.inc + 1 s.target = target s.source=source assert env.subst("$BAR") == 'foo bar', env.subst("$BAR") return 0 a = SCons.Action.FunctionAction(f, {}) a(target=1, source=2, env=Environment(BAR = 'foo bar', s = self)) assert self.inc == 1, self.inc assert self.source == [2], self.source assert self.target == [1], self.target global count count = 0 def function1(target, source, env): global count count = count + 1 for t in target: with open(t, 'w') as f: f.write("function1\n") return 1 act = SCons.Action.FunctionAction(function1, {}) r = act(target = [outfile, outfile2], source=[], env=Environment()) assert r.status == 1, r.status assert count == 1, count c = test.read(outfile, 'r') assert c == "function1\n", c c = test.read(outfile2, 'r') assert c == "function1\n", c class class1a(object): def __init__(self, target, source, env): with open(env['out'], 'w') as f: f.write("class1a\n") act = SCons.Action.FunctionAction(class1a, {}) r = act([], [], Environment(out = outfile)) assert isinstance(r.status, class1a), r.status c = test.read(outfile, 'r') assert c == "class1a\n", c class class1b(object): def __call__(self, target, source, env): with open(env['out'], 'w') as f: f.write("class1b\n") return 2 act = SCons.Action.FunctionAction(class1b(), {}) r = act([], [], Environment(out = outfile)) assert r.status == 2, r.status c = test.read(outfile, 'r') assert c == "class1b\n", c def build_it(target, source, env, executor=None, self=self): self.build_it = 1 return 0 def string_it(target, source, env, executor=None, self=self): self.string_it = 1 return None act = SCons.Action.FunctionAction(build_it, { 'strfunction' : string_it }) r = act([], [], Environment()) assert r == 0, r assert self.build_it assert self.string_it def test_get_contents(self): """Test fetching the contents of a function Action """ def LocalFunc(): pass func_matches = { (2,7) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), (3,5) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), (3,6) : bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), } meth_matches = { (2,7) : bytearray(b'1, 1, 0, 0,(),(),(d\x00\x00S),(),()'), (3,5) : bytearray(b'1, 1, 0, 0,(),(),(d\x00\x00S),(),()'), (3,6) : bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'), } def factory(act, **kw): return SCons.Action.FunctionAction(act, kw) a = factory(GlobalFunc) c = a.get_contents(target=[], source=[], env=Environment()) assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]]) a = factory(LocalFunc) c = a.get_contents(target=[], source=[], env=Environment()) assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]]) matches_foo = func_matches[sys.version_info[:2]] + b'foo' a = factory(GlobalFunc, varlist=['XYZ']) c = a.get_contents(target=[], source=[], env=Environment()) assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]]) # assert c in func_matches, repr(c) c = a.get_contents(target=[], source=[], env=Environment(XYZ='foo')) assert c == matches_foo, repr(c) ##TODO: is this set of tests still needed? # Make sure a bare string varlist works a = factory(GlobalFunc, varlist='XYZ') c = a.get_contents(target=[], source=[], env=Environment()) # assert c in func_matches, repr(c) assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]]) c = a.get_contents(target=[], source=[], env=Environment(XYZ='foo')) assert c in matches_foo, repr(c) class Foo(object): def get_contents(self, target, source, env): return b'xyzzy' a = factory(Foo()) c = a.get_contents(target=[], source=[], env=Environment()) assert c == b'xyzzy', repr(c) class LocalClass(object): def LocalMethod(self): pass lc = LocalClass() a = factory(lc.LocalMethod) c = a.get_contents(target=[], source=[], env=Environment()) assert c == meth_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(meth_matches[sys.version_info[:2]]) def test_strfunction(self): """Test the FunctionAction.strfunction() method """ def func(): pass def factory(act, **kw): return SCons.Action.FunctionAction(act, kw) a = factory(func) s = a.strfunction(target=[], source=[], env=Environment()) assert s == 'func([], [])', s a = factory(func, strfunction=None) s = a.strfunction(target=[], source=[], env=Environment()) assert s is None, s a = factory(func, cmdstr='function') s = a.strfunction(target=[], source=[], env=Environment()) assert s == 'function', s class ListActionTestCase(unittest.TestCase): def test___init__(self): """Test creation of a list of subsidiary Actions """ def func(): pass a = SCons.Action.ListAction(["x", func, ["y", "z"]]) assert isinstance(a.list[0], SCons.Action.CommandAction) assert isinstance(a.list[1], SCons.Action.FunctionAction) assert isinstance(a.list[2], SCons.Action.ListAction) assert a.list[2].list[0].cmd_list == 'y' def test___str__(self): """Test the __str__() method for a list of subsidiary Actions """ def f(target,source,env): pass def g(target,source,env): pass a = SCons.Action.ListAction([f, g, "XXX", f]) s = str(a) assert s == "f(target, source, env)\ng(target, source, env)\nXXX\nf(target, source, env)", s def test_genstring(self): """Test the genstring() method for a list of subsidiary Actions """ def f(target,source,env): pass def g(target,source,env,for_signature): return 'generated %s %s' % (target[0], source[0]) g = SCons.Action.Action(g, generator=1) a = SCons.Action.ListAction([f, g, "XXX", f]) s = a.genstring(['foo.x'], ['bar.y'], Environment()) assert s == "f(target, source, env)\ngenerated foo.x bar.y\nXXX\nf(target, source, env)", s def test_execute(self): """Test executing a list of subsidiary Actions """ self.inc = 0 def f(target,source,env): s = env['s'] s.inc = s.inc + 1 a = SCons.Action.ListAction([f, f, f]) a([], [], Environment(s = self)) assert self.inc == 3, self.inc cmd2 = r'%s %s %s syzygy' % (_python_, act_py, outfile) def function2(target, source, env): with open(env['out'], 'a') as f: f.write("function2\n") return 0 class class2a(object): def __call__(self, target, source, env): with open(env['out'], 'a') as f: f.write("class2a\n") return 0 class class2b(object): def __init__(self, target, source, env): with open(env['out'], 'a') as f: f.write("class2b\n") act = SCons.Action.ListAction([cmd2, function2, class2a(), class2b]) r = act([], [], Environment(out = outfile)) assert isinstance(r.status, class2b), r.status c = test.read(outfile, 'r') assert c == "act.py: 'syzygy'\nfunction2\nclass2a\nclass2b\n", c def test_get_contents(self): """Test fetching the contents of a list of subsidiary Actions """ self.foo=0 def gen(target, source, env, for_signature): s = env['s'] s.foo=1 return "y" a = SCons.Action.ListAction(["x", SCons.Action.Action(gen, generator=1), "z"]) c = a.get_contents(target=[], source=[], env=Environment(s = self)) assert self.foo==1, self.foo assert c == b"xyz", c class LazyActionTestCase(unittest.TestCase): def test___init__(self): """Test creation of a lazy-evaluation Action """ # Environment variable references should create a special type # of LazyAction that lazily evaluates the variable for whether # it's a string or something else before doing anything. a9 = SCons.Action.Action('$FOO') assert isinstance(a9, SCons.Action.LazyAction), a9 assert a9.var == 'FOO', a9.var a10 = SCons.Action.Action('${FOO}') assert isinstance(a10, SCons.Action.LazyAction), a10 assert a10.var == 'FOO', a10.var def test_genstring(self): """Test the lazy-evaluation Action genstring() method """ def f(target, source, env): pass a = SCons.Action.Action('$BAR') env1 = Environment(BAR=f, s=self) env2 = Environment(BAR='xxx', s=self) s = a.genstring([], [], env=env1) assert s == "f(target, source, env)", s s = a.genstring([], [], env=env2) assert s == 'xxx', s def test_execute(self): """Test executing a lazy-evaluation Action """ def f(target, source, env): s = env['s'] s.test=1 return 0 a = SCons.Action.Action('$BAR') a([], [], env=Environment(BAR = f, s = self)) assert self.test == 1, self.test cmd = r'%s %s %s lazy' % (_python_, act_py, outfile) a([], [], env=Environment(BAR = cmd, s = self)) c = test.read(outfile, 'r') assert c == "act.py: 'lazy'\n", c def test_get_contents(self): """Test fetching the contents of a lazy-evaluation Action """ a = SCons.Action.Action("${FOO}") env = Environment(FOO = [["This", "is", "a", "test"]]) c = a.get_contents(target=[], source=[], env=env) assert c == b"This is a test", c def test_get_contents_of_function_action(self): """Test fetching the contents of a lazy-evaluation FunctionAction """ def LocalFunc(): pass func_matches = { (2,7) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), (3,5) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), (3,6) : bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), } meth_matches = [ b"1, 1, 0, 0,(),(),(d\000\000S),(),()", b"1, 1, 0, 0,(),(),(d\x00\x00S),(),()", ] def factory(act, **kw): return SCons.Action.FunctionAction(act, kw) a = SCons.Action.Action("${FOO}") env = Environment(FOO = factory(GlobalFunc)) c = a.get_contents(target=[], source=[], env=env) # assert c in func_matches, "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(f) for f in func_matches]) assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]]) env = Environment(FOO = factory(LocalFunc)) c = a.get_contents(target=[], source=[], env=env) assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]]) # matches_foo = [x + b"foo" for x in func_matches] matches_foo = func_matches[sys.version_info[:2]] + b'foo' env = Environment(FOO = factory(GlobalFunc, varlist=['XYZ'])) c = a.get_contents(target=[], source=[], env=env) assert c == func_matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(func_matches[sys.version_info[:2]]) env['XYZ'] = 'foo' c = a.get_contents(target=[], source=[], env=env) assert c in matches_foo, repr(c) class ActionCallerTestCase(unittest.TestCase): def test___init__(self): """Test creation of an ActionCaller""" ac = SCons.Action.ActionCaller(1, [2, 3], {'FOO' : 4, 'BAR' : 5}) assert ac.parent == 1, ac.parent assert ac.args == [2, 3], ac.args assert ac.kw == {'FOO' : 4, 'BAR' : 5}, ac.kw def test_get_contents(self): """Test fetching the contents of an ActionCaller""" def strfunc(): pass def LocalFunc(): pass matches = { (2,7) : b'd\x00\x00S', (3,5) : b'd\x00\x00S', (3,6) : b'd\x00S\x00', } af = SCons.Action.ActionFactory(GlobalFunc, strfunc) ac = SCons.Action.ActionCaller(af, [], {}) c = ac.get_contents([], [], Environment()) assert c == matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(matches[sys.version_info[:2]]) af = SCons.Action.ActionFactory(LocalFunc, strfunc) ac = SCons.Action.ActionCaller(af, [], {}) c = ac.get_contents([], [], Environment()) assert c == matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(matches[sys.version_info[:2]]) class LocalActFunc(object): def __call__(self): pass af = SCons.Action.ActionFactory(GlobalActFunc(), strfunc) ac = SCons.Action.ActionCaller(af, [], {}) c = ac.get_contents([], [], Environment()) assert c == matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(matches[sys.version_info[:2]]) af = SCons.Action.ActionFactory(LocalActFunc(), strfunc) ac = SCons.Action.ActionCaller(af, [], {}) c = ac.get_contents([], [], Environment()) assert c == matches[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected one of \n"+repr(matches[sys.version_info[:2]]) matches = [ b"", b"", ] af = SCons.Action.ActionFactory(str, strfunc) ac = SCons.Action.ActionCaller(af, [], {}) c = ac.get_contents([], [], Environment()) assert c == "" or \ c == "" or \ c == "", repr(c) # ^^ class str for python3 def test___call__(self): """Test calling an ActionCaller""" actfunc_args = [] def actfunc(a1, a2, a3, args=actfunc_args): args.extend([a1, a2, a3]) def strfunc(a1, a2, a3): pass e = Environment(FOO = 2, BAR = 5) af = SCons.Action.ActionFactory(actfunc, strfunc) ac = SCons.Action.ActionCaller(af, ['$__env__', '$FOO', 3], {}) ac([], [], e) assert actfunc_args[0] is e, actfunc_args assert actfunc_args[1] == '2', actfunc_args assert actfunc_args[2] == 3, actfunc_args del actfunc_args[:] ac = SCons.Action.ActionCaller(af, [], {'a3' : '$__env__', 'a2' : '$BAR', 'a1' : 4}) ac([], [], e) assert actfunc_args[0] == 4, actfunc_args assert actfunc_args[1] == '5', actfunc_args assert actfunc_args[2] is e, actfunc_args del actfunc_args[:] def test_strfunction(self): """Test calling the ActionCaller strfunction() method""" strfunc_args = [] def actfunc(a1, a2, a3, a4): pass def strfunc(a1, a2, a3, a4, args=strfunc_args): args.extend([a1, a2, a3, a4]) af = SCons.Action.ActionFactory(actfunc, strfunc) ac = SCons.Action.ActionCaller(af, [1, '$FOO', 3, '$WS'], {}) ac.strfunction([], [], Environment(FOO = 2, WS='white space')) assert strfunc_args == [1, '2', 3, 'white space'], strfunc_args del strfunc_args[:] d = {'a3' : 6, 'a2' : '$BAR', 'a1' : 4, 'a4' : '$WS'} ac = SCons.Action.ActionCaller(af, [], d) ac.strfunction([], [], Environment(BAR = 5, WS='w s')) assert strfunc_args == [4, '5', 6, 'w s'], strfunc_args class ActionFactoryTestCase(unittest.TestCase): def test___init__(self): """Test creation of an ActionFactory""" def actfunc(): pass def strfunc(): pass ac = SCons.Action.ActionFactory(actfunc, strfunc) assert ac.actfunc is actfunc, ac.actfunc assert ac.strfunc is strfunc, ac.strfunc def test___call__(self): """Test calling whatever's returned from an ActionFactory""" actfunc_args = [] strfunc_args = [] def actfunc(a1, a2, a3, args=actfunc_args): args.extend([a1, a2, a3]) def strfunc(a1, a2, a3, args=strfunc_args): args.extend([a1, a2, a3]) af = SCons.Action.ActionFactory(actfunc, strfunc) af(3, 6, 9)([], [], Environment()) assert actfunc_args == [3, 6, 9], actfunc_args assert strfunc_args == [3, 6, 9], strfunc_args class ActionCompareTestCase(unittest.TestCase): def test_1_solo_name(self): """Test Lazy Cmd Generator Action get_name alone. Basically ensures we can locate the builder, comparing it to itself along the way.""" bar = SCons.Builder.Builder(action = {}) env = Environment( BUILDERS = {'BAR' : bar} ) name = bar.get_name(env) assert name == 'BAR', name def test_2_multi_name(self): """Test LazyCmdGenerator Action get_name multi builders. Ensure that we can compare builders (and thereby actions) to each other safely.""" foo = SCons.Builder.Builder(action = '$FOO', suffix = '.foo') bar = SCons.Builder.Builder(action = {}) assert foo != bar assert foo.action != bar.action env = Environment( BUILDERS = {'FOO' : foo, 'BAR' : bar} ) name = foo.get_name(env) assert name == 'FOO', name name = bar.get_name(env) assert name == 'BAR', name def test_3_dict_names(self): """Test Action/Suffix dicts with get_name. Verifies that Action/Suffix dictionaries work correctly, especially two builders that can generate the same suffix, where one of the builders has a suffix dictionary with a None key.""" foo = SCons.Builder.Builder(action = '$FOO', suffix = '.foo') bar = SCons.Builder.Builder(action = {}, suffix={None:'.bar'}) bar.add_action('.cow', "$MOO") dog = SCons.Builder.Builder(suffix = '.bar') env = Environment( BUILDERS = {'FOO' : foo, 'BAR' : bar, 'DOG' : dog} ) assert foo.get_name(env) == 'FOO', foo.get_name(env) assert bar.get_name(env) == 'BAR', bar.get_name(env) assert dog.get_name(env) == 'DOG', dog.get_name(env) class TestClass(object): """A test class used by ObjectContentsTestCase.test_object_contents""" def __init__(self): self.a = "a" self.b = "b" def method(self, arg): pass class ObjectContentsTestCase(unittest.TestCase): def test_function_contents(self): """Test that Action._function_contents works""" def func1(a, b, c): """A test function""" return a # Since the python bytecode has per version differences, we need different expected results per version expected = { (2,7) : bytearray(b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()'), (3,5) : bytearray(b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()'), (3,6) : bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'), } c = SCons.Action._function_contents(func1) assert c == expected[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+"\n"+repr(expected[sys.version_info[:2]]) def test_object_contents(self): """Test that Action._object_contents works""" # See definition above o = TestClass() c = SCons.Action._object_contents(o) # c = SCons.Action._object_instance_content(o) # Since the python bytecode has per version differences, we need different expected results per version expected = { (2,7): bytearray(b"{TestClass:__main__}[[[(, ()), [(, (,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01\x00|\x00\x00_\x00\x00d\x02\x00|\x00\x00_\x01\x00d\x00\x00S),(),(),2, 2, 0, 0,(),(),(d\x00\x00S),(),()}}{{{a=a,b=b}}}"), (3,5): bytearray(b"{TestClass:__main__}[[[(, ()), [(, (,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01\x00|\x00\x00_\x00\x00d\x02\x00|\x00\x00_\x01\x00d\x00\x00S),(),(),2, 2, 0, 0,(),(),(d\x00\x00S),(),()}}{{{a=a,b=b}}}"), (3,6): bytearray(b"{TestClass:__main__}[[[(, ()), [(, (,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01|\x00_\x00d\x02|\x00_\x01d\x00S\x00),(),(),2, 2, 0, 0,(),(),(d\x00S\x00),(),()}}{{{a=a,b=b}}}"), } assert c == expected[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+"\n"+repr(expected[sys.version_info[:2]]) def test_code_contents(self): """Test that Action._code_contents works""" code = compile("print('Hello, World!')", '', 'exec') c = SCons.Action._code_contents(code) # Since the python bytecode has per version differences, we need different expected results per version expected = { (2,7) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00\x00GHd\x01\x00S)'), (3,5) : bytearray(b'0, 0, 0, 0,(N.),(print),(e\x00\x00d\x00\x00\x83\x01\x00\x01d\x01\x00S)'), (3,6) : bytearray(b'0, 0, 0, 0,(N.),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)'), } assert c == expected[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+"\n"+expected[sys.version_info[:2]] if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ _ActionActionTestCase, ActionTestCase, CommandActionTestCase, CommandGeneratorActionTestCase, FunctionActionTestCase, ListActionTestCase, LazyActionTestCase, ActionCallerTestCase, ActionFactoryTestCase, ActionCompareTestCase, ObjectContentsTestCase ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Swap this for above to debug otherwise you can't run individual tests as TestUnit is swallowing arguments # unittest.main() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Subst.xml0000664000175000017500000000371213160023041020360 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> ([exception, ...]) Specifies the exceptions that will be allowed when expanding construction variables. By default, any construction variable expansions that generate a NameError or IndexError exception will expand to a '' (a null string) and not cause scons to fail. All exceptions not in the specified list will generate an error message and terminate processing. If &f-AllowSubstExceptions; is called multiple times, each call completely overwrites the previous list of allowed exceptions. Example: # Requires that all construction variable names exist. # (You may wish to do this if you want to enforce strictly # that all construction variables must be defined before use.) AllowSubstExceptions() # Also allow a string containing a zero-division expansion # like '${1 / 0}' to evalute to ''. AllowSubstExceptions(IndexError, NameError, ZeroDivisionError) scons-src-3.0.0/src/engine/SCons/Debug.py0000664000175000017500000001654113160023040020141 0ustar bdbaddogbdbaddog"""SCons.Debug Code for debugging SCons internal things. Shouldn't be needed by most users. Quick shortcuts: from SCons.Debug import caller_trace caller_trace() """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Debug.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import sys import time import weakref import inspect # Global variable that gets set to 'True' by the Main script, # when the creation of class instances should get tracked. track_instances = False # List of currently tracked classes tracked_classes = {} def logInstanceCreation(instance, name=None): if name is None: name = instance.__class__.__name__ if name not in tracked_classes: tracked_classes[name] = [] if hasattr(instance, '__dict__'): tracked_classes[name].append(weakref.ref(instance)) else: # weakref doesn't seem to work when the instance # contains only slots... tracked_classes[name].append(instance) def string_to_classes(s): if s == '*': return sorted(tracked_classes.keys()) else: return s.split() def fetchLoggedInstances(classes="*"): classnames = string_to_classes(classes) return [(cn, len(tracked_classes[cn])) for cn in classnames] def countLoggedInstances(classes, file=sys.stdout): for classname in string_to_classes(classes): file.write("%s: %d\n" % (classname, len(tracked_classes[classname]))) def listLoggedInstances(classes, file=sys.stdout): for classname in string_to_classes(classes): file.write('\n%s:\n' % classname) for ref in tracked_classes[classname]: if inspect.isclass(ref): obj = ref() else: obj = ref if obj is not None: file.write(' %s\n' % repr(obj)) def dumpLoggedInstances(classes, file=sys.stdout): for classname in string_to_classes(classes): file.write('\n%s:\n' % classname) for ref in tracked_classes[classname]: obj = ref() if obj is not None: file.write(' %s:\n' % obj) for key, value in obj.__dict__.items(): file.write(' %20s : %s\n' % (key, value)) if sys.platform[:5] == "linux": # Linux doesn't actually support memory usage stats from getrusage(). def memory(): with open('/proc/self/stat') as f: mstr = f.read() mstr = mstr.split()[22] return int(mstr) elif sys.platform[:6] == 'darwin': #TODO really get memory stats for OS X def memory(): return 0 else: try: import resource except ImportError: try: import win32process import win32api except ImportError: def memory(): return 0 else: def memory(): process_handle = win32api.GetCurrentProcess() memory_info = win32process.GetProcessMemoryInfo( process_handle ) return memory_info['PeakWorkingSetSize'] else: def memory(): res = resource.getrusage(resource.RUSAGE_SELF) return res[4] # returns caller's stack def caller_stack(): import traceback tb = traceback.extract_stack() # strip itself and the caller from the output tb = tb[:-2] result = [] for back in tb: # (filename, line number, function name, text) key = back[:3] result.append('%s:%d(%s)' % func_shorten(key)) return result caller_bases = {} caller_dicts = {} def caller_trace(back=0): """ Trace caller stack and save info into global dicts, which are printed automatically at the end of SCons execution. """ global caller_bases, caller_dicts import traceback tb = traceback.extract_stack(limit=3+back) tb.reverse() callee = tb[1][:3] caller_bases[callee] = caller_bases.get(callee, 0) + 1 for caller in tb[2:]: caller = callee + caller[:3] try: entry = caller_dicts[callee] except KeyError: caller_dicts[callee] = entry = {} entry[caller] = entry.get(caller, 0) + 1 callee = caller # print a single caller and its callers, if any def _dump_one_caller(key, file, level=0): leader = ' '*level for v,c in sorted([(-v,c) for c,v in caller_dicts[key].items()]): file.write("%s %6d %s:%d(%s)\n" % ((leader,-v) + func_shorten(c[-3:]))) if c in caller_dicts: _dump_one_caller(c, file, level+1) # print each call tree def dump_caller_counts(file=sys.stdout): for k in sorted(caller_bases.keys()): file.write("Callers of %s:%d(%s), %d calls:\n" % (func_shorten(k) + (caller_bases[k],))) _dump_one_caller(k, file) shorten_list = [ ( '/scons/SCons/', 1), ( '/src/engine/SCons/', 1), ( '/usr/lib/python', 0), ] if os.sep != '/': shorten_list = [(t[0].replace('/', os.sep), t[1]) for t in shorten_list] def func_shorten(func_tuple): f = func_tuple[0] for t in shorten_list: i = f.find(t[0]) if i >= 0: if t[1]: i = i + len(t[0]) return (f[i:],)+func_tuple[1:] return func_tuple TraceFP = {} if sys.platform == 'win32': TraceDefault = 'con' else: TraceDefault = '/dev/tty' TimeStampDefault = None StartTime = time.time() PreviousTime = StartTime def Trace(msg, file=None, mode='w', tstamp=None): """Write a trace message to a file. Whenever a file is specified, it becomes the default for the next call to Trace().""" global TraceDefault global TimeStampDefault global PreviousTime if file is None: file = TraceDefault else: TraceDefault = file if tstamp is None: tstamp = TimeStampDefault else: TimeStampDefault = tstamp try: fp = TraceFP[file] except KeyError: try: fp = TraceFP[file] = open(file, mode) except TypeError: # Assume we were passed an open file pointer. fp = file if tstamp: now = time.time() fp.write('%8.4f %8.4f: ' % (now - StartTime, now - PreviousTime)) PreviousTime = now fp.write(msg) fp.flush() fp.close() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/CacheDirTests.py0000664000175000017500000002316413160023040021577 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/CacheDirTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import shutil import sys import unittest from TestCmd import TestCmd import TestUnit import SCons.CacheDir built_it = None class Action(object): def __call__(self, targets, sources, env, **kw): global built_it if kw.get('execute', 1): built_it = 1 return 0 def genstring(self, target, source, env): return str(self) def get_contents(self, target, source, env): return bytearray('','utf-8') class Builder(object): def __init__(self, environment, action): self.env = environment self.action = action self.overrides = {} self.source_scanner = None self.target_scanner = None class Environment(object): def __init__(self, cachedir): self.cachedir = cachedir def Override(self, overrides): return self def get_CacheDir(self): return self.cachedir class BaseTestCase(unittest.TestCase): """ Base fixtures common to our other unittest classes. """ def setUp(self): self.test = TestCmd(workdir='') import SCons.Node.FS self.fs = SCons.Node.FS.FS() self._CacheDir = SCons.CacheDir.CacheDir('cache') def File(self, name, bsig=None, action=Action()): node = self.fs.File(name) node.builder_set(Builder(Environment(self._CacheDir), action)) if bsig: node.cachesig = bsig #node.binfo = node.BuildInfo(node) #node.binfo.ninfo.bsig = bsig return node def tearDown(self): os.remove(os.path.join(self._CacheDir.path, 'config')) os.rmdir(self._CacheDir.path) # Should that be shutil.rmtree? class CacheDirTestCase(BaseTestCase): """ Test calling CacheDir code directly. """ def test_cachepath(self): """Test the cachepath() method""" # Verify how the cachepath() method determines the name # of the file in cache. def my_collect(list): return list[0] save_collect = SCons.Util.MD5collect SCons.Util.MD5collect = my_collect try: name = 'a_fake_bsig' f5 = self.File("cd.f5", name) result = self._CacheDir.cachepath(f5) len = self._CacheDir.config['prefix_len'] dirname = os.path.join('cache', name.upper()[:len]) filename = os.path.join(dirname, name) assert result == (dirname, filename), result finally: SCons.Util.MD5collect = save_collect class FileTestCase(BaseTestCase): """ Test calling CacheDir code through Node.FS.File interfaces. """ # These tests were originally in Nodes/FSTests.py and got moved # when the CacheDir support was refactored into its own module. # Look in the history for Node/FSTests.py if any of this needs # to be re-examined. def retrieve_succeed(self, target, source, env, execute=1): self.retrieved.append(target) return 0 def retrieve_fail(self, target, source, env, execute=1): self.retrieved.append(target) return 1 def push(self, target, source, env): self.pushed.append(target) return 0 def test_CacheRetrieve(self): """Test the CacheRetrieve() function""" save_CacheRetrieve = SCons.CacheDir.CacheRetrieve self.retrieved = [] f1 = self.File("cd.f1") try: SCons.CacheDir.CacheRetrieve = self.retrieve_succeed self.retrieved = [] built_it = None r = f1.retrieve_from_cache() assert r == 1, r assert self.retrieved == [f1], self.retrieved assert built_it is None, built_it SCons.CacheDir.CacheRetrieve = self.retrieve_fail self.retrieved = [] built_it = None r = f1.retrieve_from_cache() assert not r, r assert self.retrieved == [f1], self.retrieved assert built_it is None, built_it finally: SCons.CacheDir.CacheRetrieve = save_CacheRetrieve def test_CacheRetrieveSilent(self): """Test the CacheRetrieveSilent() function""" save_CacheRetrieveSilent = SCons.CacheDir.CacheRetrieveSilent SCons.CacheDir.cache_show = 1 f2 = self.File("cd.f2", 'f2_bsig') try: SCons.CacheDir.CacheRetrieveSilent = self.retrieve_succeed self.retrieved = [] built_it = None r = f2.retrieve_from_cache() assert r == 1, r assert self.retrieved == [f2], self.retrieved assert built_it is None, built_it SCons.CacheDir.CacheRetrieveSilent = self.retrieve_fail self.retrieved = [] built_it = None r = f2.retrieve_from_cache() assert r is False, r assert self.retrieved == [f2], self.retrieved assert built_it is None, built_it finally: SCons.CacheDir.CacheRetrieveSilent = save_CacheRetrieveSilent def test_CachePush(self): """Test the CachePush() function""" save_CachePush = SCons.CacheDir.CachePush SCons.CacheDir.CachePush = self.push try: self.pushed = [] cd_f3 = self.test.workpath("cd.f3") f3 = self.File(cd_f3) f3.push_to_cache() assert self.pushed == [], self.pushed self.test.write(cd_f3, "cd.f3\n") f3.push_to_cache() assert self.pushed == [f3], self.pushed self.pushed = [] cd_f4 = self.test.workpath("cd.f4") f4 = self.File(cd_f4) f4.visited() assert self.pushed == [], self.pushed self.test.write(cd_f4, "cd.f4\n") f4.clear() f4.visited() assert self.pushed == [], self.pushed SCons.CacheDir.cache_force = 1 f4.clear() f4.visited() assert self.pushed == [f4], self.pushed finally: SCons.CacheDir.CachePush = save_CachePush def test_warning(self): """Test raising a warning if we can't copy a file to cache.""" test = TestCmd(workdir='') save_copy2 = shutil.copy2 def copy2(src, dst): raise OSError shutil.copy2 = copy2 save_mkdir = os.mkdir def mkdir(dir, mode=0): pass os.mkdir = mkdir old_warn_exceptions = SCons.Warnings.warningAsException(1) SCons.Warnings.enableWarningClass(SCons.Warnings.CacheWriteErrorWarning) try: cd_f7 = self.test.workpath("cd.f7") self.test.write(cd_f7, "cd.f7\n") f7 = self.File(cd_f7, 'f7_bsig') warn_caught = 0 try: f7.push_to_cache() except SCons.Errors.BuildError as e: assert e.exc_info[0] == SCons.Warnings.CacheWriteErrorWarning warn_caught = 1 assert warn_caught finally: shutil.copy2 = save_copy2 os.mkdir = save_mkdir SCons.Warnings.warningAsException(old_warn_exceptions) SCons.Warnings.suppressWarningClass(SCons.Warnings.CacheWriteErrorWarning) def test_no_strfunction(self): """Test handling no strfunction() for an action.""" save_CacheRetrieveSilent = SCons.CacheDir.CacheRetrieveSilent f8 = self.File("cd.f8", 'f8_bsig') try: SCons.CacheDir.CacheRetrieveSilent = self.retrieve_succeed self.retrieved = [] built_it = None r = f8.retrieve_from_cache() assert r == 1, r assert self.retrieved == [f8], self.retrieved assert built_it is None, built_it SCons.CacheDir.CacheRetrieveSilent = self.retrieve_fail self.retrieved = [] built_it = None r = f8.retrieve_from_cache() assert r is False, r assert self.retrieved == [f8], self.retrieved assert built_it is None, built_it finally: SCons.CacheDir.CacheRetrieveSilent = save_CacheRetrieveSilent if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ CacheDirTestCase, FileTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/0000775000175000017500000000000013160023045020447 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Variables/BoolVariable.py0000664000175000017500000000575413160023045023375 0ustar bdbaddogbdbaddog"""engine.SCons.Variables.BoolVariable This file defines the option type for SCons implementing true/false values. Usage example:: opts = Variables() opts.Add(BoolVariable('embedded', 'build for an embedded system', 0)) ... if env['embedded'] == 1: ... """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Variables/BoolVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __all__ = ['BoolVariable',] import SCons.Errors __true_strings = ('y', 'yes', 'true', 't', '1', 'on' , 'all' ) __false_strings = ('n', 'no', 'false', 'f', '0', 'off', 'none') def _text2bool(val): """ Converts strings to True/False depending on the 'truth' expressed by the string. If the string can't be converted, the original value will be returned. See '__true_strings' and '__false_strings' for values considered 'true' or 'false respectively. This is usable as 'converter' for SCons' Variables. """ lval = val.lower() if lval in __true_strings: return True if lval in __false_strings: return False raise ValueError("Invalid value for boolean option: %s" % val) def _validator(key, val, env): """ Validates the given value to be either '0' or '1'. This is usable as 'validator' for SCons' Variables. """ if not env[key] in (True, False): raise SCons.Errors.UserError( 'Invalid value for boolean option %s: %s' % (key, env[key])) def BoolVariable(key, help, default): """ The input parameters describe a boolean option, thus they are returned with the correct converter and validator appended. The 'help' text will by appended by '(yes|no) to show the valid valued. The result is usable for input to opts.Add(). """ return (key, '%s (yes|no)' % help, default, _validator, _text2bool) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/PackageVariableTests.py0000664000175000017500000001043213160023045025045 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Variables/PackageVariableTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import SCons.Errors import SCons.Variables import TestCmd import TestUnit class PackageVariableTestCase(unittest.TestCase): def test_PackageVariable(self): """Test PackageVariable creation""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PackageVariable('test', 'test option help', '/default/path')) o = opts.options[0] assert o.key == 'test', o.key assert o.help == 'test option help\n ( yes | no | /path/to/test )', repr(o.help) assert o.default == '/default/path', o.default assert o.validator is not None, o.validator assert o.converter is not None, o.converter def test_converter(self): """Test the PackageVariable converter""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PackageVariable('test', 'test option help', '/default/path')) o = opts.options[0] true_values = [ 'yes', 'YES', 'true', 'TRUE', 'on', 'ON', 'enable', 'ENABLE', 'search', 'SEARCH', ] false_values = [ 'no', 'NO', 'false', 'FALSE', 'off', 'OFF', 'disable', 'DISABLE', ] for t in true_values: x = o.converter(t) assert x, "converter returned false for '%s'" % t for f in false_values: x = o.converter(f) assert not x, "converter returned true for '%s'" % f x = o.converter('/explicit/path') assert x == '/explicit/path', x # Make sure the converter returns True if we give it str(True) and # False when we give it str(False). This assures consistent operation # through a cycle of Variables.Save() -> Variables(). x = o.converter(str(True)) assert x == True, "converter returned a string when given str(True)" x = o.converter(str(False)) assert x == False, "converter returned a string when given str(False)" def test_validator(self): """Test the PackageVariable validator""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PackageVariable('test', 'test option help', '/default/path')) test = TestCmd.TestCmd(workdir='') test.write('exists', 'exists\n') o = opts.options[0] env = {'F':False, 'T':True, 'X':'x'} exists = test.workpath('exists') does_not_exist = test.workpath('does_not_exist') o.validator('F', '/path', env) o.validator('T', '/path', env) o.validator('X', exists, env) caught = None try: o.validator('X', does_not_exist, env) except SCons.Errors.UserError: caught = 1 assert caught, "did not catch expected UserError" if __name__ == "__main__": suite = unittest.makeSuite(PackageVariableTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/PackageVariable.py0000664000175000017500000000705713160023045024033 0ustar bdbaddogbdbaddog"""engine.SCons.Variables.PackageVariable This file defines the option type for SCons implementing 'package activation'. To be used whenever a 'package' may be enabled/disabled and the package path may be specified. Usage example: Examples: x11=no (disables X11 support) x11=yes (will search for the package installation dir) x11=/usr/local/X11 (will check this path for existence) To replace autoconf's --with-xxx=yyy :: opts = Variables() opts.Add(PackageVariable('x11', 'use X11 installed here (yes = search some places', 'yes')) ... if env['x11'] == True: dir = ... search X11 in some standard places ... env['x11'] = dir if env['x11']: ... build with x11 ... """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Variables/PackageVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __all__ = ['PackageVariable',] import SCons.Errors __enable_strings = ('1', 'yes', 'true', 'on', 'enable', 'search') __disable_strings = ('0', 'no', 'false', 'off', 'disable') def _converter(val): """ """ lval = val.lower() if lval in __enable_strings: return True if lval in __disable_strings: return False #raise ValueError("Invalid value for boolean option: %s" % val) return val def _validator(key, val, env, searchfunc): # NB: searchfunc is currently undocumented and unsupported """ """ # TODO write validator, check for path import os if env[key] is True: if searchfunc: env[key] = searchfunc(key, val) elif env[key] and not os.path.exists(val): raise SCons.Errors.UserError( 'Path does not exist for option %s: %s' % (key, val)) def PackageVariable(key, help, default, searchfunc=None): # NB: searchfunc is currently undocumented and unsupported """ The input parameters describe a 'package list' option, thus they are returned with the correct converter and validator appended. The result is usable for input to opts.Add() . A 'package list' option may either be 'all', 'none' or a list of package names (separated by space). """ help = '\n '.join( (help, '( yes | no | /path/to/%s )' % key)) return (key, help, default, lambda k, v, e: _validator(k,v,e,searchfunc), _converter) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/__init__.py0000664000175000017500000002605513160023045022570 0ustar bdbaddogbdbaddog"""engine.SCons.Variables This file defines the Variables class that is used to add user-friendly customizable variables to an SCons build. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Variables/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import sys import SCons.Environment import SCons.Errors import SCons.Util import SCons.Warnings from .BoolVariable import BoolVariable # okay from .EnumVariable import EnumVariable # okay from .ListVariable import ListVariable # naja from .PackageVariable import PackageVariable # naja from .PathVariable import PathVariable # okay class Variables(object): instance=None """ Holds all the options, updates the environment with the variables, and renders the help text. """ def __init__(self, files=None, args=None, is_global=1): """ files - [optional] List of option configuration files to load (backward compatibility) If a single string is passed it is automatically placed in a file list """ # initialize arguments if files is None: files = [] if args is None: args = {} self.options = [] self.args = args if not SCons.Util.is_List(files): if files: files = [ files ] else: files = [] self.files = files self.unknown = {} # create the singleton instance if is_global: self=Variables.instance if not Variables.instance: Variables.instance=self def _do_add(self, key, help="", default=None, validator=None, converter=None): class Variable(object): pass option = Variable() # if we get a list or a tuple, we take the first element as the # option key and store the remaining in aliases. if SCons.Util.is_List(key) or SCons.Util.is_Tuple(key): option.key = key[0] option.aliases = key[1:] else: option.key = key option.aliases = [ key ] option.help = help option.default = default option.validator = validator option.converter = converter self.options.append(option) # options might be added after the 'unknown' dict has been set up, # so we remove the key and all its aliases from that dict for alias in list(option.aliases) + [ option.key ]: if alias in self.unknown: del self.unknown[alias] def keys(self): """ Returns the keywords for the options """ return [o.key for o in self.options] def Add(self, key, help="", default=None, validator=None, converter=None, **kw): """ Add an option. @param key: the name of the variable, or a list or tuple of arguments @param help: optional help text for the options @param default: optional default value @param validator: optional function that is called to validate the option's value @type validator: Called with (key, value, environment) @param converter: optional function that is called to convert the option's value before putting it in the environment. """ if SCons.Util.is_List(key) or isinstance(key, tuple): self._do_add(*key) return if not SCons.Util.is_String(key) or \ not SCons.Environment.is_valid_construction_var(key): raise SCons.Errors.UserError("Illegal Variables.Add() key `%s'" % str(key)) self._do_add(key, help, default, validator, converter) def AddVariables(self, *optlist): """ Add a list of options. Each list element is a tuple/list of arguments to be passed on to the underlying method for adding options. Example:: opt.AddVariables( ('debug', '', 0), ('CC', 'The C compiler'), ('VALIDATE', 'An option for testing validation', 'notset', validator, None), ) """ for o in optlist: self._do_add(*o) def Update(self, env, args=None): """ Update an environment with the option variables. env - the environment to update. """ values = {} # first set the defaults: for option in self.options: if not option.default is None: values[option.key] = option.default # next set the value specified in the options file for filename in self.files: if os.path.exists(filename): dir = os.path.split(os.path.abspath(filename))[0] if dir: sys.path.insert(0, dir) try: values['__name__'] = filename with open(filename, 'r') as f: contents = f.read() exec(contents, {}, values) finally: if dir: del sys.path[0] del values['__name__'] # set the values specified on the command line if args is None: args = self.args for arg, value in args.items(): added = False for option in self.options: if arg in list(option.aliases) + [ option.key ]: values[option.key] = value added = True if not added: self.unknown[arg] = value # put the variables in the environment: # (don't copy over variables that are not declared as options) for option in self.options: try: env[option.key] = values[option.key] except KeyError: pass # Call the convert functions: for option in self.options: if option.converter and option.key in values: value = env.subst('${%s}'%option.key) try: try: env[option.key] = option.converter(value) except TypeError: env[option.key] = option.converter(value, env) except ValueError as x: raise SCons.Errors.UserError('Error converting option: %s\n%s'%(option.key, x)) # Finally validate the values: for option in self.options: if option.validator and option.key in values: option.validator(option.key, env.subst('${%s}'%option.key), env) def UnknownVariables(self): """ Returns any options in the specified arguments lists that were not known, declared options in this object. """ return self.unknown def Save(self, filename, env): """ Saves all the options in the given file. This file can then be used to load the options next run. This can be used to create an option cache file. filename - Name of the file to save into env - the environment get the option values from """ # Create the file and write out the header try: fh = open(filename, 'w') try: # Make an assignment in the file for each option # within the environment that was assigned a value # other than the default. for option in self.options: try: value = env[option.key] try: prepare = value.prepare_to_store except AttributeError: try: eval(repr(value)) except KeyboardInterrupt: raise except: # Convert stuff that has a repr() that # cannot be evaluated into a string value = SCons.Util.to_String(value) else: value = prepare() defaultVal = env.subst(SCons.Util.to_String(option.default)) if option.converter: defaultVal = option.converter(defaultVal) if str(env.subst('${%s}' % option.key)) != str(defaultVal): fh.write('%s = %s\n' % (option.key, repr(value))) except KeyError: pass finally: fh.close() except IOError as x: raise SCons.Errors.UserError('Error writing options to file: %s\n%s' % (filename, x)) def GenerateHelpText(self, env, sort=None): """ Generate the help text for the options. env - an environment that is used to get the current values of the options. """ if sort: options = sorted(self.options, key=lambda x: x.key) else: options = self.options def format(opt, self=self, env=env): if opt.key in env: actual = env.subst('${%s}' % opt.key) else: actual = None return self.FormatVariableHelpText(env, opt.key, opt.help, opt.default, actual, opt.aliases) lines = [_f for _f in map(format, options) if _f] return ''.join(lines) format = '\n%s: %s\n default: %s\n actual: %s\n' format_ = '\n%s: %s\n default: %s\n actual: %s\n aliases: %s\n' def FormatVariableHelpText(self, env, key, help, default, actual, aliases=[]): # Don't display the key name itself as an alias. aliases = [a for a in aliases if a != key] if len(aliases)==0: return self.format % (key, help, default, actual) else: return self.format_ % (key, help, default, actual, aliases) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/BoolVariableTests.py0000664000175000017500000000763113160023045024414 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Variables/BoolVariableTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestUnit import SCons.Errors import SCons.Variables class BoolVariableTestCase(unittest.TestCase): def test_BoolVariable(self): """Test BoolVariable creation""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.BoolVariable('test', 'test option help', 0)) o = opts.options[0] assert o.key == 'test', o.key assert o.help == 'test option help (yes|no)', o.help assert o.default == 0, o.default assert o.validator is not None, o.validator assert o.converter is not None, o.converter def test_converter(self): """Test the BoolVariable converter""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.BoolVariable('test', 'test option help', 0)) o = opts.options[0] true_values = [ 'y', 'Y', 'yes', 'YES', 't', 'T', 'true', 'TRUE', 'on', 'ON', 'all', 'ALL', '1', ] false_values = [ 'n', 'N', 'no', 'NO', 'f', 'F', 'false', 'FALSE', 'off', 'OFF', 'none', 'NONE', '0', ] for t in true_values: x = o.converter(t) assert x, "converter returned false for '%s'" % t for f in false_values: x = o.converter(f) assert not x, "converter returned true for '%s'" % f caught = None try: o.converter('x') except ValueError: caught = 1 assert caught, "did not catch expected ValueError" def test_validator(self): """Test the BoolVariable validator""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.BoolVariable('test', 'test option help', 0)) o = opts.options[0] env = { 'T' : True, 'F' : False, 'N' : 'xyzzy', } o.validator('T', 0, env) o.validator('F', 0, env) caught = None try: o.validator('N', 0, env) except SCons.Errors.UserError: caught = 1 assert caught, "did not catch expected UserError for N" caught = None try: o.validator('NOSUCHKEY', 0, env) except KeyError: caught = 1 assert caught, "did not catch expected KeyError for NOSUCHKEY" if __name__ == "__main__": suite = unittest.makeSuite(BoolVariableTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/PathVariable.py0000664000175000017500000001267713160023045023400 0ustar bdbaddogbdbaddog"""SCons.Variables.PathVariable This file defines an option type for SCons implementing path settings. To be used whenever a user-specified path override should be allowed. Arguments to PathVariable are: option-name = name of this option on the command line (e.g. "prefix") option-help = help string for option option-dflt = default value for this option validator = [optional] validator for option value. Predefined validators are: PathAccept -- accepts any path setting; no validation PathIsDir -- path must be an existing directory PathIsDirCreate -- path must be a dir; will create PathIsFile -- path must be a file PathExists -- path must exist (any type) [default] The validator is a function that is called and which should return True or False to indicate if the path is valid. The arguments to the validator function are: (key, val, env). The key is the name of the option, the val is the path specified for the option, and the env is the env to which the Options have been added. Usage example:: Examples: prefix=/usr/local opts = Variables() opts = Variables() opts.Add(PathVariable('qtdir', 'where the root of Qt is installed', qtdir, PathIsDir)) opts.Add(PathVariable('qt_includes', 'where the Qt includes are installed', '$qtdir/includes', PathIsDirCreate)) opts.Add(PathVariable('qt_libraries', 'where the Qt library is installed', '$qtdir/lib')) """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Variables/PathVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __all__ = ['PathVariable',] import os import os.path import SCons.Errors class _PathVariableClass(object): def PathAccept(self, key, val, env): """Accepts any path, no checking done.""" pass def PathIsDir(self, key, val, env): """Validator to check if Path is a directory.""" if not os.path.isdir(val): if os.path.isfile(val): m = 'Directory path for option %s is a file: %s' else: m = 'Directory path for option %s does not exist: %s' raise SCons.Errors.UserError(m % (key, val)) def PathIsDirCreate(self, key, val, env): """Validator to check if Path is a directory, creating it if it does not exist.""" if os.path.isfile(val): m = 'Path for option %s is a file, not a directory: %s' raise SCons.Errors.UserError(m % (key, val)) if not os.path.isdir(val): os.makedirs(val) def PathIsFile(self, key, val, env): """Validator to check if Path is a file""" if not os.path.isfile(val): if os.path.isdir(val): m = 'File path for option %s is a directory: %s' else: m = 'File path for option %s does not exist: %s' raise SCons.Errors.UserError(m % (key, val)) def PathExists(self, key, val, env): """Validator to check if Path exists""" if not os.path.exists(val): m = 'Path for option %s does not exist: %s' raise SCons.Errors.UserError(m % (key, val)) def __call__(self, key, help, default, validator=None): """ The input parameters describe a 'path list' option, thus they are returned with the correct converter and validator appended. The result is usable for input to opts.Add() . The 'default' option specifies the default path to use if the user does not specify an override with this option. validator is a validator, see this file for examples """ if validator is None: validator = self.PathExists if SCons.Util.is_List(key) or SCons.Util.is_Tuple(key): return (key, '%s ( /path/to/%s )' % (help, key[0]), default, validator, None) else: return (key, '%s ( /path/to/%s )' % (help, key), default, validator, None) PathVariable = _PathVariableClass() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/ListVariable.py0000664000175000017500000001053713160023045023410 0ustar bdbaddogbdbaddog"""engine.SCons.Variables.ListVariable This file defines the option type for SCons implementing 'lists'. A 'list' option may either be 'all', 'none' or a list of names separated by comma. After the option has been processed, the option value holds either the named list elements, all list elements or no list elements at all. Usage example:: list_of_libs = Split('x11 gl qt ical') opts = Variables() opts.Add(ListVariable('shared', 'libraries to build as shared libraries', 'all', elems = list_of_libs)) ... for lib in list_of_libs: if lib in env['shared']: env.SharedObject(...) else: env.Object(...) """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Variables/ListVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" # Known Bug: This should behave like a Set-Type, but does not really, # since elements can occur twice. __all__ = ['ListVariable',] import collections import SCons.Util class _ListVariable(collections.UserList): def __init__(self, initlist=[], allowedElems=[]): collections.UserList.__init__(self, [_f for _f in initlist if _f]) self.allowedElems = sorted(allowedElems) def __cmp__(self, other): raise NotImplementedError def __eq__(self, other): raise NotImplementedError def __ge__(self, other): raise NotImplementedError def __gt__(self, other): raise NotImplementedError def __le__(self, other): raise NotImplementedError def __lt__(self, other): raise NotImplementedError def __str__(self): if len(self) == 0: return 'none' self.data.sort() if self.data == self.allowedElems: return 'all' else: return ','.join(self) def prepare_to_store(self): return self.__str__() def _converter(val, allowedElems, mapdict): """ """ if val == 'none': val = [] elif val == 'all': val = allowedElems else: val = [_f for _f in val.split(',') if _f] val = [mapdict.get(v, v) for v in val] notAllowed = [v for v in val if not v in allowedElems] if notAllowed: raise ValueError("Invalid value(s) for option: %s" % ','.join(notAllowed)) return _ListVariable(val, allowedElems) ## def _validator(key, val, env): ## """ ## """ ## # todo: write validator for pgk list ## return 1 def ListVariable(key, help, default, names, map={}): """ The input parameters describe a 'package list' option, thus they are returned with the correct converter and validator appended. The result is usable for input to opts.Add() . A 'package list' option may either be 'all', 'none' or a list of package names (separated by space). """ names_str = 'allowed names: %s' % ' '.join(names) if SCons.Util.is_List(default): default = ','.join(default) help = '\n '.join( (help, '(all|none|comma-separated list of names)', names_str)) return (key, help, default, None, #_validator, lambda val: _converter(val, names, map)) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/EnumVariable.py0000664000175000017500000000733613160023045023404 0ustar bdbaddogbdbaddog"""engine.SCons.Variables.EnumVariable This file defines the option type for SCons allowing only specified input-values. Usage example:: opts = Variables() opts.Add(EnumVariable('debug', 'debug output and symbols', 'no', allowed_values=('yes', 'no', 'full'), map={}, ignorecase=2)) ... if env['debug'] == 'full': ... """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Variables/EnumVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __all__ = ['EnumVariable',] import SCons.Errors def _validator(key, val, env, vals): if not val in vals: raise SCons.Errors.UserError( 'Invalid value for option %s: %s. Valid values are: %s' % (key, val, vals)) def EnumVariable(key, help, default, allowed_values, map={}, ignorecase=0): """ The input parameters describe an option with only certain values allowed. They are returned with an appropriate converter and validator appended. The result is usable for input to Variables.Add(). 'key' and 'default' are the values to be passed on to Variables.Add(). 'help' will be appended by the allowed values automatically 'allowed_values' is a list of strings, which are allowed as values for this option. The 'map'-dictionary may be used for converting the input value into canonical values (e.g. for aliases). 'ignorecase' defines the behaviour of the validator: If ignorecase == 0, the validator/converter are case-sensitive. If ignorecase == 1, the validator/converter are case-insensitive. If ignorecase == 2, the validator/converter is case-insensitive and the converted value will always be lower-case. The 'validator' tests whether the value is in the list of allowed values. The 'converter' converts input values according to the given 'map'-dictionary (unmapped input values are returned unchanged). """ help = '%s (%s)' % (help, '|'.join(allowed_values)) # define validator if ignorecase >= 1: validator = lambda key, val, env: \ _validator(key, val.lower(), env, allowed_values) else: validator = lambda key, val, env: \ _validator(key, val, env, allowed_values) # define converter if ignorecase == 2: converter = lambda val: map.get(val.lower(), val).lower() elif ignorecase == 1: converter = lambda val: map.get(val.lower(), val) else: converter = lambda val: map.get(val, val) return (key, help, default, validator, converter) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/ListVariableTests.py0000664000175000017500000001101613160023045024424 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Variables/ListVariableTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import copy import sys import unittest import TestUnit import SCons.Errors import SCons.Variables class ListVariableTestCase(unittest.TestCase): def test_ListVariable(self): """Test ListVariable creation""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.ListVariable('test', 'test option help', 'all', ['one', 'two', 'three'])) o = opts.options[0] assert o.key == 'test', o.key assert o.help == 'test option help\n (all|none|comma-separated list of names)\n allowed names: one two three', repr(o.help) assert o.default == 'all', o.default assert o.validator is None, o.validator assert not o.converter is None, o.converter opts = SCons.Variables.Variables() opts.Add(SCons.Variables.ListVariable('test2', 'test2 help', ['one', 'three'], ['one', 'two', 'three'])) o = opts.options[0] assert o.default == 'one,three' def test_converter(self): """Test the ListVariable converter""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.ListVariable('test', 'test option help', 'all', ['one', 'two', 'three'], {'ONE':'one', 'TWO':'two'})) o = opts.options[0] x = o.converter('all') assert str(x) == 'all', x x = o.converter('none') assert str(x) == 'none', x x = o.converter('one') assert str(x) == 'one', x x = o.converter('ONE') assert str(x) == 'one', x x = o.converter('two') assert str(x) == 'two', x x = o.converter('TWO') assert str(x) == 'two', x x = o.converter('three') assert str(x) == 'three', x x = o.converter('one,two') assert str(x) == 'one,two', x x = o.converter('two,one') assert str(x) == 'one,two', x x = o.converter('one,three') assert str(x) == 'one,three', x x = o.converter('three,one') assert str(x) == 'one,three', x x = o.converter('two,three') assert str(x) == 'three,two', x x = o.converter('three,two') assert str(x) == 'three,two', x x = o.converter('one,two,three') assert str(x) == 'all', x x = o.converter('three,two,one') assert str(x) == 'all', x x = o.converter('three,ONE,TWO') assert str(x) == 'all', x caught = None try: x = o.converter('no_match') except ValueError: caught = 1 assert caught, "did not catch expected ValueError" def test_copy(self): """Test copying a ListVariable like an Environment would""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.ListVariable('test', 'test option help', 'all', ['one', 'two', 'three'])) o = opts.options[0] l = o.converter('all') n = l.__class__(copy.copy(l)) if __name__ == "__main__": suite = unittest.makeSuite(ListVariableTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/VariablesTests.py0000664000175000017500000005055613160023045023767 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Variables/VariablesTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestSCons import TestUnit import SCons.Variables import SCons.Subst import SCons.Warnings class Environment(object): def __init__(self): self.dict = {} def subst(self, x): return SCons.Subst.scons_subst(x, self, gvars=self.dict) def __setitem__(self, key, value): self.dict[key] = value def __getitem__(self, key): return self.dict[key] def __contains__(self, key): return self.dict.__contains__(key) def has_key(self, key): return key in self.dict def cmp(a, b): """ Define cmp because it's no longer available in python3 Works under python 2 as well """ return (a > b) - (a < b) def check(key, value, env): assert int(value) == 6 * 9, "key %s = %s" % (key, repr(value)) # Check saved option file by executing and comparing against # the expected dictionary def checkSave(file, expected): gdict = {} ldict = {} exec(open(file, 'r').read(), gdict, ldict) assert expected == ldict, "%s\n...not equal to...\n%s" % (expected, ldict) class VariablesTestCase(unittest.TestCase): def test_keys(self): """Test the Variables.keys() method""" opts = SCons.Variables.Variables() opts.Add('VAR1') opts.Add('VAR2', 'THE answer to THE question', "42", check, lambda x: int(x) + 12) keys = list(opts.keys()) assert keys == ['VAR1', 'VAR2'], keys def test_Add(self): """Test adding to a Variables object""" opts = SCons.Variables.Variables() opts.Add('VAR') opts.Add('ANSWER', 'THE answer to THE question', "42", check, lambda x: int(x) + 12) o = opts.options[0] assert o.key == 'VAR' assert o.help == '' assert o.default is None assert o.validator is None assert o.converter is None o = opts.options[1] assert o.key == 'ANSWER' assert o.help == 'THE answer to THE question' assert o.default == "42" o.validator(o.key, o.converter(o.default), {}) def test_it(var, opts=opts): exc_caught = None try: opts.Add(var) except SCons.Errors.UserError: exc_caught = 1 assert exc_caught, "did not catch UserError for '%s'" % var test_it('foo/bar') test_it('foo-bar') test_it('foo.bar') def test_AddVariables(self): """Test adding a list of options to a Variables object""" opts = SCons.Variables.Variables() opts.AddVariables(('VAR2',), ('ANSWER2', 'THE answer to THE question', "42", check, lambda x: int(x) + 12)) o = opts.options[0] assert o.key == 'VAR2', o.key assert o.help == '', o.help assert o.default is None, o.default assert o.validator is None, o.validator assert o.converter is None, o.converter o = opts.options[1] assert o.key == 'ANSWER2', o.key assert o.help == 'THE answer to THE question', o.help assert o.default == "42", o.default o.validator(o.key, o.converter(o.default), {}) def test_Update(self): """Test updating an Environment""" # Test that a default value is validated correctly. test = TestSCons.TestSCons() file = test.workpath('custom.py') opts = SCons.Variables.Variables(file) opts.Add('ANSWER', 'THE answer to THE question', "42", check, lambda x: int(x) + 12) env = Environment() opts.Update(env) assert env['ANSWER'] == 54 env = Environment() opts.Update(env, {}) assert env['ANSWER'] == 54 # Test that a bad value from the file is used and # validation fails correctly. test = TestSCons.TestSCons() file = test.workpath('custom.py') test.write('custom.py', 'ANSWER=54') opts = SCons.Variables.Variables(file) opts.Add('ANSWER', 'THE answer to THE question', "42", check, lambda x: int(x) + 12) env = Environment() exc_caught = None try: opts.Update(env) except AssertionError: exc_caught = 1 assert exc_caught, "did not catch expected assertion" env = Environment() exc_caught = None try: opts.Update(env, {}) except AssertionError: exc_caught = 1 assert exc_caught, "did not catch expected assertion" # Test that a good value from the file is used and validated. test = TestSCons.TestSCons() file = test.workpath('custom.py') test.write('custom.py', 'ANSWER=42') opts = SCons.Variables.Variables(file) opts.Add('ANSWER', 'THE answer to THE question', "10", check, lambda x: int(x) + 12) env = Environment() opts.Update(env) assert env['ANSWER'] == 54 env = Environment() opts.Update(env, {}) assert env['ANSWER'] == 54 # Test that a bad value from an args dictionary passed to # Update() is used and validation fails correctly. test = TestSCons.TestSCons() file = test.workpath('custom.py') test.write('custom.py', 'ANSWER=10') opts = SCons.Variables.Variables(file) opts.Add('ANSWER', 'THE answer to THE question', "12", check, lambda x: int(x) + 12) env = Environment() exc_caught = None try: opts.Update(env, {'ANSWER':'54'}) except AssertionError: exc_caught = 1 assert exc_caught, "did not catch expected assertion" # Test that a good value from an args dictionary # passed to Update() is used and validated. test = TestSCons.TestSCons() file = test.workpath('custom.py') test.write('custom.py', 'ANSWER=10') opts = SCons.Variables.Variables(file) opts.Add('ANSWER', 'THE answer to THE question', "12", check, lambda x: int(x) + 12) env = Environment() opts.Update(env, {'ANSWER':'42'}) assert env['ANSWER'] == 54 # Test against a former bug. If we supply a converter, # but no default, the value should *not* appear in the # Environment if no value is specified in the options file # or args. test = TestSCons.TestSCons() file = test.workpath('custom.py') opts = SCons.Variables.Variables(file) opts.Add('ANSWER', help='THE answer to THE question', converter=str) env = Environment() opts.Update(env, {}) assert 'ANSWER' not in env # Test that a default value of None is all right. test = TestSCons.TestSCons() file = test.workpath('custom.py') opts = SCons.Variables.Variables(file) opts.Add('ANSWER', "This is the answer", None, check) env = Environment() opts.Update(env, {}) assert 'ANSWER' not in env def test_noaggregation(self): """Test that the 'files' and 'args' attributes of the Variables class don't aggregate entries from one instance to another. This used to be a bug in SCons version 2.4.1 and earlier. """ opts = SCons.Variables.Variables() opts.files.append('custom.py') opts.args['ANSWER'] = 54 nopts = SCons.Variables.Variables() # Ensure that both attributes are initialized to # an empty list and dict, respectively. assert len(nopts.files) == 0 assert len(nopts.args) == 0 def test_args(self): """Test updating an Environment with arguments overridden""" # Test that a bad (command-line) argument is used # and the validation fails correctly. test = TestSCons.TestSCons() file = test.workpath('custom.py') test.write('custom.py', 'ANSWER=42') opts = SCons.Variables.Variables(file, {'ANSWER':54}) opts.Add('ANSWER', 'THE answer to THE question', "42", check, lambda x: int(x) + 12) env = Environment() exc_caught = None try: opts.Update(env) except AssertionError: exc_caught = 1 assert exc_caught, "did not catch expected assertion" # Test that a good (command-line) argument is used and validated. test = TestSCons.TestSCons() file = test.workpath('custom.py') test.write('custom.py', 'ANSWER=54') opts = SCons.Variables.Variables(file, {'ANSWER':42}) opts.Add('ANSWER', 'THE answer to THE question', "54", check, lambda x: int(x) + 12) env = Environment() opts.Update(env) assert env['ANSWER'] == 54 # Test that a (command-line) argument is overridden by a dictionary # supplied to Update() and the dictionary value is validated correctly. test = TestSCons.TestSCons() file = test.workpath('custom.py') test.write('custom.py', 'ANSWER=54') opts = SCons.Variables.Variables(file, {'ANSWER':54}) opts.Add('ANSWER', 'THE answer to THE question', "54", check, lambda x: int(x) + 12) env = Environment() opts.Update(env, {'ANSWER':42}) assert env['ANSWER'] == 54 def test_Save(self): """Testing saving Variables""" test = TestSCons.TestSCons() cache_file = test.workpath('cached.options') opts = SCons.Variables.Variables() def bool_converter(val): if val in [1, 'y']: val = 1 if val in [0, 'n']: val = 0 return val # test saving out empty file opts.Add('OPT_VAL', 'An option to test', 21, None, None) opts.Add('OPT_VAL_2', default='foo') opts.Add('OPT_VAL_3', default=1) opts.Add('OPT_BOOL_0', default='n', converter=bool_converter) opts.Add('OPT_BOOL_1', default='y', converter=bool_converter) opts.Add('OPT_BOOL_2', default=0, converter=bool_converter) env = Environment() opts.Update(env, {'OPT_VAL_3' : 2}) assert env['OPT_VAL'] == 21, env['OPT_VAL'] assert env['OPT_VAL_2'] == 'foo', env['OPT_VAL_2'] assert env['OPT_VAL_3'] == 2, env['OPT_VAL_3'] assert env['OPT_BOOL_0'] == 0, env['OPT_BOOL_0'] assert env['OPT_BOOL_1'] == 1, env['OPT_BOOL_1'] assert env['OPT_BOOL_2'] == '0', env['OPT_BOOL_2'] env['OPT_VAL_2'] = 'bar' env['OPT_BOOL_0'] = 0 env['OPT_BOOL_1'] = 1 env['OPT_BOOL_2'] = 2 opts.Save(cache_file, env) checkSave(cache_file, { 'OPT_VAL_2' : 'bar', 'OPT_VAL_3' : 2, 'OPT_BOOL_2' : 2}) # Test against some old bugs class Foo(object): def __init__(self, x): self.x = x def __str__(self): return self.x test = TestSCons.TestSCons() cache_file = test.workpath('cached.options') opts = SCons.Variables.Variables() opts.Add('THIS_USED_TO_BREAK', 'An option to test', "Default") opts.Add('THIS_ALSO_BROKE', 'An option to test', "Default2") opts.Add('THIS_SHOULD_WORK', 'An option to test', Foo('bar')) env = Environment() opts.Update(env, { 'THIS_USED_TO_BREAK' : "Single'Quotes'In'String", 'THIS_ALSO_BROKE' : "\\Escape\nSequences\t", 'THIS_SHOULD_WORK' : Foo('baz') }) opts.Save(cache_file, env) checkSave(cache_file, { 'THIS_USED_TO_BREAK' : "Single'Quotes'In'String", 'THIS_ALSO_BROKE' : "\\Escape\nSequences\t", 'THIS_SHOULD_WORK' : 'baz' }) def test_GenerateHelpText(self): """Test generating the default format help text""" opts = SCons.Variables.Variables() opts.Add('ANSWER', 'THE answer to THE question', "42", check, lambda x: int(x) + 12) opts.Add('B', 'b - alpha test', "42", check, lambda x: int(x) + 12) opts.Add('A', 'a - alpha test', "42", check, lambda x: int(x) + 12) env = Environment() opts.Update(env, {}) expect = """ ANSWER: THE answer to THE question default: 42 actual: 54 B: b - alpha test default: 42 actual: 54 A: a - alpha test default: 42 actual: 54 """ text = opts.GenerateHelpText(env) assert text == expect, text expectAlpha = """ A: a - alpha test default: 42 actual: 54 ANSWER: THE answer to THE question default: 42 actual: 54 B: b - alpha test default: 42 actual: 54 """ text = opts.GenerateHelpText(env, sort=cmp) assert text == expectAlpha, text def test_FormatVariableHelpText(self): """Test generating custom format help text""" opts = SCons.Variables.Variables() def my_format(env, opt, help, default, actual, aliases): return '%s %s %s %s %s\n' % (opt, default, actual, help, aliases) opts.FormatVariableHelpText = my_format opts.Add('ANSWER', 'THE answer to THE question', "42", check, lambda x: int(x) + 12) opts.Add('B', 'b - alpha test', "42", check, lambda x: int(x) + 12) opts.Add('A', 'a - alpha test', "42", check, lambda x: int(x) + 12) env = Environment() opts.Update(env, {}) expect = """\ ANSWER 42 54 THE answer to THE question ['ANSWER'] B 42 54 b - alpha test ['B'] A 42 54 a - alpha test ['A'] """ text = opts.GenerateHelpText(env) assert text == expect, text expectAlpha = """\ A 42 54 a - alpha test ['A'] ANSWER 42 54 THE answer to THE question ['ANSWER'] B 42 54 b - alpha test ['B'] """ text = opts.GenerateHelpText(env, sort=cmp) assert text == expectAlpha, text def test_Aliases(self): """Test option aliases""" # test alias as a tuple opts = SCons.Variables.Variables() opts.AddVariables( (('ANSWER', 'ANSWERALIAS'), 'THE answer to THE question', "42"), ) env = Environment() opts.Update(env, {'ANSWER' : 'answer'}) assert 'ANSWER' in env env = Environment() opts.Update(env, {'ANSWERALIAS' : 'answer'}) assert 'ANSWER' in env and 'ANSWERALIAS' not in env # test alias as a list opts = SCons.Variables.Variables() opts.AddVariables( (['ANSWER', 'ANSWERALIAS'], 'THE answer to THE question', "42"), ) env = Environment() opts.Update(env, {'ANSWER' : 'answer'}) assert 'ANSWER' in env env = Environment() opts.Update(env, {'ANSWERALIAS' : 'answer'}) assert 'ANSWER' in env and 'ANSWERALIAS' not in env class UnknownVariablesTestCase(unittest.TestCase): def test_unknown(self): """Test the UnknownVariables() method""" opts = SCons.Variables.Variables() opts.Add('ANSWER', 'THE answer to THE question', "42") args = { 'ANSWER' : 'answer', 'UNKNOWN' : 'unknown', } env = Environment() opts.Update(env, args) r = opts.UnknownVariables() assert r == {'UNKNOWN' : 'unknown'}, r assert env['ANSWER'] == 'answer', env['ANSWER'] def test_AddOptionUpdatesUnknown(self): """Test updating of the 'unknown' dict""" opts = SCons.Variables.Variables() opts.Add('A', 'A test variable', "1") args = { 'A' : 'a', 'ADDEDLATER' : 'notaddedyet', } env = Environment() opts.Update(env,args) r = opts.UnknownVariables() assert r == {'ADDEDLATER' : 'notaddedyet'}, r assert env['A'] == 'a', env['A'] opts.Add('ADDEDLATER', 'An option not present initially', "1") args = { 'A' : 'a', 'ADDEDLATER' : 'added', } opts.Update(env, args) r = opts.UnknownVariables() assert len(r) == 0, r assert env['ADDEDLATER'] == 'added', env['ADDEDLATER'] def test_AddOptionWithAliasUpdatesUnknown(self): """Test updating of the 'unknown' dict (with aliases)""" opts = SCons.Variables.Variables() opts.Add('A', 'A test variable', "1") args = { 'A' : 'a', 'ADDEDLATERALIAS' : 'notaddedyet', } env = Environment() opts.Update(env,args) r = opts.UnknownVariables() assert r == {'ADDEDLATERALIAS' : 'notaddedyet'}, r assert env['A'] == 'a', env['A'] opts.AddVariables( (('ADDEDLATER', 'ADDEDLATERALIAS'), 'An option not present initially', "1"), ) args['ADDEDLATERALIAS'] = 'added' opts.Update(env, args) r = opts.UnknownVariables() assert len(r) == 0, r assert env['ADDEDLATER'] == 'added', env['ADDEDLATER'] if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ VariablesTestCase, UnknownVariablesTestCase ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/EnumVariableTests.py0000664000175000017500000002020013160023045024410 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Variables/EnumVariableTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestUnit import SCons.Errors import SCons.Variables class EnumVariableTestCase(unittest.TestCase): def test_EnumVariable(self): """Test EnumVariable creation""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.EnumVariable('test', 'test option help', 0, ['one', 'two', 'three'], {})) o = opts.options[0] assert o.key == 'test', o.key assert o.help == 'test option help (one|two|three)', o.help assert o.default == 0, o.default assert o.validator is not None, o.validator assert o.converter is not None, o.converter def test_converter(self): """Test the EnumVariable converter""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.EnumVariable('test', 'test option help', 0, ['one', 'two', 'three'])) o = opts.options[0] for a in ['one', 'two', 'three', 'no_match']: x = o.converter(a) assert x == a, x opts = SCons.Variables.Variables() opts.Add(SCons.Variables.EnumVariable('test', 'test option help', 0, ['one', 'two', 'three'], {'1' : 'one', '2' : 'two', '3' : 'three'})) o = opts.options[0] x = o.converter('one') assert x == 'one', x x = o.converter('1') assert x == 'one', x x = o.converter('two') assert x == 'two', x x = o.converter('2') assert x == 'two', x x = o.converter('three') assert x == 'three', x x = o.converter('3') assert x == 'three', x opts = SCons.Variables.Variables() opts.Add(SCons.Variables.EnumVariable('test0', 'test option help', 0, ['one', 'two', 'three'], {'a' : 'one', 'b' : 'two', 'c' : 'three'}, ignorecase=0)) opts.Add(SCons.Variables.EnumVariable('test1', 'test option help', 0, ['one', 'two', 'three'], {'a' : 'one', 'b' : 'two', 'c' : 'three'}, ignorecase=1)) opts.Add(SCons.Variables.EnumVariable('test2', 'test option help', 0, ['one', 'two', 'three'], {'a' : 'one', 'b' : 'two', 'c' : 'three'}, ignorecase=2)) o0 = opts.options[0] o1 = opts.options[1] o2 = opts.options[2] table = { 'one' : ['one', 'one', 'one'], 'One' : ['One', 'One', 'one'], 'ONE' : ['ONE', 'ONE', 'one'], 'two' : ['two', 'two', 'two'], 'twO' : ['twO', 'twO', 'two'], 'TWO' : ['TWO', 'TWO', 'two'], 'three' : ['three', 'three', 'three'], 'thRee' : ['thRee', 'thRee', 'three'], 'THREE' : ['THREE', 'THREE', 'three'], 'a' : ['one', 'one', 'one'], 'A' : ['A', 'one', 'one'], 'b' : ['two', 'two', 'two'], 'B' : ['B', 'two', 'two'], 'c' : ['three', 'three', 'three'], 'C' : ['C', 'three', 'three'], } for k, l in table.items(): x = o0.converter(k) assert x == l[0], "o0 got %s, expected %s" % (x, l[0]) x = o1.converter(k) assert x == l[1], "o1 got %s, expected %s" % (x, l[1]) x = o2.converter(k) assert x == l[2], "o2 got %s, expected %s" % (x, l[2]) def test_validator(self): """Test the EnumVariable validator""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.EnumVariable('test0', 'test option help', 0, ['one', 'two', 'three'], {'a' : 'one', 'b' : 'two', 'c' : 'three'}, ignorecase=0)) opts.Add(SCons.Variables.EnumVariable('test1', 'test option help', 0, ['one', 'two', 'three'], {'a' : 'one', 'b' : 'two', 'c' : 'three'}, ignorecase=1)) opts.Add(SCons.Variables.EnumVariable('test2', 'test option help', 0, ['one', 'two', 'three'], {'a' : 'one', 'b' : 'two', 'c' : 'three'}, ignorecase=2)) o0 = opts.options[0] o1 = opts.options[1] o2 = opts.options[2] def valid(o, v): o.validator('X', v, {}) def invalid(o, v): caught = None try: o.validator('X', v, {}) except SCons.Errors.UserError: caught = 1 assert caught, "did not catch expected UserError for o = %s, v = %s" % (o.key, v) table = { 'one' : [ valid, valid, valid], 'One' : [invalid, valid, valid], 'ONE' : [invalid, valid, valid], 'two' : [ valid, valid, valid], 'twO' : [invalid, valid, valid], 'TWO' : [invalid, valid, valid], 'three' : [ valid, valid, valid], 'thRee' : [invalid, valid, valid], 'THREE' : [invalid, valid, valid], 'a' : [invalid, invalid, invalid], 'A' : [invalid, invalid, invalid], 'b' : [invalid, invalid, invalid], 'B' : [invalid, invalid, invalid], 'c' : [invalid, invalid, invalid], 'C' : [invalid, invalid, invalid], 'no_v' : [invalid, invalid, invalid], } for v, l in table.items(): l[0](o0, v) l[1](o1, v) l[2](o2, v) if __name__ == "__main__": suite = unittest.makeSuite(EnumVariableTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Variables/PathVariableTests.py0000664000175000017500000002044013160023045024406 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Variables/PathVariableTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import sys import unittest import SCons.Errors import SCons.Variables import TestCmd import TestUnit class PathVariableTestCase(unittest.TestCase): def test_PathVariable(self): """Test PathVariable creation""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PathVariable('test', 'test option help', '/default/path')) o = opts.options[0] assert o.key == 'test', o.key assert o.help == 'test option help ( /path/to/test )', repr(o.help) assert o.default == '/default/path', o.default assert o.validator is not None, o.validator assert o.converter is None, o.converter def test_PathExists(self): """Test the PathExists validator""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PathVariable('test', 'test option help', '/default/path', SCons.Variables.PathVariable.PathExists)) test = TestCmd.TestCmd(workdir='') test.write('exists', 'exists\n') o = opts.options[0] o.validator('X', test.workpath('exists'), {}) dne = test.workpath('does_not_exist') try: o.validator('X', dne, {}) except SCons.Errors.UserError as e: assert str(e) == 'Path for option X does not exist: %s' % dne, e except: raise Exception("did not catch expected UserError") def test_PathIsDir(self): """Test the PathIsDir validator""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PathVariable('test', 'test option help', '/default/path', SCons.Variables.PathVariable.PathIsDir)) test = TestCmd.TestCmd(workdir='') test.subdir('dir') test.write('file', "file\n") o = opts.options[0] o.validator('X', test.workpath('dir'), {}) f = test.workpath('file') try: o.validator('X', f, {}) except SCons.Errors.UserError as e: assert str(e) == 'Directory path for option X is a file: %s' % f, e except: raise Exception("did not catch expected UserError") dne = test.workpath('does_not_exist') try: o.validator('X', dne, {}) except SCons.Errors.UserError as e: assert str(e) == 'Directory path for option X does not exist: %s' % dne, e except: raise Exception("did not catch expected UserError") def test_PathIsDirCreate(self): """Test the PathIsDirCreate validator""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PathVariable('test', 'test option help', '/default/path', SCons.Variables.PathVariable.PathIsDirCreate)) test = TestCmd.TestCmd(workdir='') test.write('file', "file\n") o = opts.options[0] d = test.workpath('dir') o.validator('X', d, {}) assert os.path.isdir(d) f = test.workpath('file') try: o.validator('X', f, {}) except SCons.Errors.UserError as e: assert str(e) == 'Path for option X is a file, not a directory: %s' % f, e except: raise Exception("did not catch expected UserError") def test_PathIsFile(self): """Test the PathIsFile validator""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PathVariable('test', 'test option help', '/default/path', SCons.Variables.PathVariable.PathIsFile)) test = TestCmd.TestCmd(workdir='') test.subdir('dir') test.write('file', "file\n") o = opts.options[0] o.validator('X', test.workpath('file'), {}) d = test.workpath('d') try: o.validator('X', d, {}) except SCons.Errors.UserError as e: assert str(e) == 'File path for option X does not exist: %s' % d, e except: raise Exception("did not catch expected UserError") dne = test.workpath('does_not_exist') try: o.validator('X', dne, {}) except SCons.Errors.UserError as e: assert str(e) == 'File path for option X does not exist: %s' % dne, e except: raise Exception("did not catch expected UserError") def test_PathAccept(self): """Test the PathAccept validator""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PathVariable('test', 'test option help', '/default/path', SCons.Variables.PathVariable.PathAccept)) test = TestCmd.TestCmd(workdir='') test.subdir('dir') test.write('file', "file\n") o = opts.options[0] o.validator('X', test.workpath('file'), {}) d = test.workpath('d') o.validator('X', d, {}) dne = test.workpath('does_not_exist') o.validator('X', dne, {}) def test_validator(self): """Test the PathVariable validator argument""" opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PathVariable('test', 'test option help', '/default/path')) test = TestCmd.TestCmd(workdir='') test.write('exists', 'exists\n') o = opts.options[0] o.validator('X', test.workpath('exists'), {}) dne = test.workpath('does_not_exist') try: o.validator('X', dne, {}) except SCons.Errors.UserError as e: expect = 'Path for option X does not exist: %s' % dne assert str(e) == expect, e else: raise Exception("did not catch expected UserError") def my_validator(key, val, env): raise Exception("my_validator() got called for %s, %s!" % (key, val)) opts = SCons.Variables.Variables() opts.Add(SCons.Variables.PathVariable('test2', 'more help', '/default/path/again', my_validator)) o = opts.options[0] try: o.validator('Y', 'value', {}) except Exception as e: assert str(e) == 'my_validator() got called for Y, value!', e else: raise Exception("did not catch expected exception from my_validator()") if __name__ == "__main__": suite = unittest.makeSuite(PathVariableTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Errors.py0000664000175000017500000001703513160023041020367 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # """SCons.Errors This file contains the exception classes used to handle internal and user errors in SCons. """ __revision__ = "src/engine/SCons/Errors.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import shutil import SCons.Util class BuildError(Exception): """ Errors occurring while building. BuildError have the following attributes: ========================================= Information about the cause of the build error: ----------------------------------------------- errstr : a description of the error message status : the return code of the action that caused the build error. Must be set to a non-zero value even if the build error is not due to an action returning a non-zero returned code. exitstatus : SCons exit status due to this build error. Must be nonzero unless due to an explicit Exit() call. Not always the same as status, since actions return a status code that should be respected, but SCons typically exits with 2 irrespective of the return value of the failed action. filename : The name of the file or directory that caused the build error. Set to None if no files are associated with this error. This might be different from the target being built. For example, failure to create the directory in which the target file will appear. It can be None if the error is not due to a particular filename. exc_info : Info about exception that caused the build error. Set to (None, None, None) if this build error is not due to an exception. Information about the cause of the location of the error: --------------------------------------------------------- node : the error occured while building this target node(s) executor : the executor that caused the build to fail (might be None if the build failures is not due to the executor failing) action : the action that caused the build to fail (might be None if the build failures is not due to the an action failure) command : the command line for the action that caused the build to fail (might be None if the build failures is not due to the an action failure) """ def __init__(self, node=None, errstr="Unknown error", status=2, exitstatus=2, filename=None, executor=None, action=None, command=None, exc_info=(None, None, None)): # py3: errstr should be string and not bytes. self.errstr = SCons.Util.to_str(errstr) self.status = status self.exitstatus = exitstatus self.filename = filename self.exc_info = exc_info self.node = node self.executor = executor self.action = action self.command = command Exception.__init__(self, node, errstr, status, exitstatus, filename, executor, action, command, exc_info) def __str__(self): if self.filename: return self.filename + ': ' + self.errstr else: return self.errstr class InternalError(Exception): pass class UserError(Exception): pass class StopError(Exception): pass class EnvironmentError(Exception): pass class MSVCError(IOError): pass class ExplicitExit(Exception): def __init__(self, node=None, status=None, *args): self.node = node self.status = status self.exitstatus = status Exception.__init__(self, *args) def convert_to_BuildError(status, exc_info=None): """ Convert any return code a BuildError Exception. :Parameters: - `status`: can either be a return code or an Exception. The buildError.status we set here will normally be used as the exit status of the "scons" process. """ if not exc_info and isinstance(status, Exception): exc_info = (status.__class__, status, None) if isinstance(status, BuildError): buildError = status buildError.exitstatus = 2 # always exit with 2 on build errors elif isinstance(status, ExplicitExit): status = status.status errstr = 'Explicit exit, status %s' % status buildError = BuildError( errstr=errstr, status=status, # might be 0, OK here exitstatus=status, # might be 0, OK here exc_info=exc_info) elif isinstance(status, (StopError, UserError)): buildError = BuildError( errstr=str(status), status=2, exitstatus=2, exc_info=exc_info) elif isinstance(status, shutil.SameFileError): # PY3 has a exception for when copying file to itself # It's object provides info differently than below try: filename = status.filename except AttributeError: filename = None buildError = BuildError( errstr=status.args[0], status=status.errno, exitstatus=2, filename=filename, exc_info=exc_info) elif isinstance(status, (EnvironmentError, OSError, IOError)): # If an IOError/OSError happens, raise a BuildError. # Report the name of the file or directory that caused the # error, which might be different from the target being built # (for example, failure to create the directory in which the # target file will appear). try: filename = status.filename except AttributeError: filename = None buildError = BuildError( errstr=status.strerror, status=status.errno, exitstatus=2, filename=filename, exc_info=exc_info) elif isinstance(status, Exception): buildError = BuildError( errstr='%s : %s' % (status.__class__.__name__, status), status=2, exitstatus=2, exc_info=exc_info) elif SCons.Util.is_String(status): buildError = BuildError( errstr=status, status=2, exitstatus=2) else: buildError = BuildError( errstr="Error %s" % status, status=status, exitstatus=2) #import sys #sys.stderr.write("convert_to_BuildError: status %s => (errstr %s, status %s)\n"%(status,buildError.errstr, buildError.status)) return buildError # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Defaults.xml0000664000175000017500000003440513160023040021031 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> A function used to produce variables like &cv-_CPPINCFLAGS;. It takes four or five arguments: a prefix to concatenate onto each element, a list of elements, a suffix to concatenate onto each element, an environment for variable interpolation, and an optional function that will be called to transform the list before concatenation. env['_CPPINCFLAGS'] = '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs)} $)', The name of the directory in which Configure context test files are written. The default is .sconf_temp in the top-level directory containing the SConstruct file. The name of the Configure context log file. The default is config.log in the top-level directory containing the SConstruct file. An automatically-generated construction variable containing the C preprocessor command-line options to define values. The value of &cv-_CPPDEFFLAGS; is created by appending &cv-CPPDEFPREFIX; and &cv-CPPDEFSUFFIX; to the beginning and end of each definition in &cv-CPPDEFINES;. A platform independent specification of C preprocessor definitions. The definitions will be added to command lines through the automatically-generated &cv-_CPPDEFFLAGS; construction variable (see above), which is constructed according to the type of value of &cv-CPPDEFINES;: If &cv-CPPDEFINES; is a string, the values of the &cv-CPPDEFPREFIX; and &cv-CPPDEFSUFFIX; construction variables will be added to the beginning and end. # Will add -Dxyz to POSIX compiler command lines, # and /Dxyz to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES='xyz') If &cv-CPPDEFINES; is a list, the values of the &cv-CPPDEFPREFIX; and &cv-CPPDEFSUFFIX; construction variables will be appended to the beginning and end of each element in the list. If any element is a list or tuple, then the first item is the name being defined and the second item is its value: # Will add -DB=2 -DA to POSIX compiler command lines, # and /DB=2 /DA to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES=[('B', 2), 'A']) If &cv-CPPDEFINES; is a dictionary, the values of the &cv-CPPDEFPREFIX; and &cv-CPPDEFSUFFIX; construction variables will be appended to the beginning and end of each item from the dictionary. The key of each dictionary item is a name being defined to the dictionary item's corresponding value; if the value is None, then the name is defined without an explicit value. Note that the resulting flags are sorted by keyword to ensure that the order of the options on the command line is consistent each time &scons; is run. # Will add -DA -DB=2 to POSIX compiler command lines, # and /DA /DB=2 to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES={'B':2, 'A':None}) The prefix used to specify preprocessor definitions on the C compiler command line. This will be appended to the beginning of each definition in the &cv-CPPDEFINES; construction variable when the &cv-_CPPDEFFLAGS; variable is automatically generated. The suffix used to specify preprocessor definitions on the C compiler command line. This will be appended to the end of each definition in the &cv-CPPDEFINES; construction variable when the &cv-_CPPDEFFLAGS; variable is automatically generated. An automatically-generated construction variable containing the C preprocessor command-line options for specifying directories to be searched for include files. The value of &cv-_CPPINCFLAGS; is created by appending &cv-INCPREFIX; and &cv-INCSUFFIX; to the beginning and end of each directory in &cv-CPPPATH;. The list of directories that the C preprocessor will search for include directories. The C/C++ implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in CCFLAGS or CXXFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in CPPPATH will be looked-up relative to the SConscript directory when they are used in a command. To force &scons; to look-up a directory relative to the root of the source tree use #: env = Environment(CPPPATH='#/include') The directory look-up can also be forced using the &Dir;() function: include = Dir('include') env = Environment(CPPPATH=include) The directory list will be added to command lines through the automatically-generated &cv-_CPPINCFLAGS; construction variable, which is constructed by appending the values of the &cv-INCPREFIX; and &cv-INCSUFFIX; construction variables to the beginning and end of each directory in &cv-CPPPATH;. Any command lines you define that need the CPPPATH directory list should include &cv-_CPPINCFLAGS;: env = Environment(CCCOM="my_compiler $_CPPINCFLAGS -c -o $TARGET $SOURCE") A function that converts a string into a Dir instance relative to the target being built. A function that converts a list of strings into a list of Dir instances relative to the target being built. The list of suffixes of files that will be scanned for imported D package files. The default list is: ['.d'] A function that converts a string into a File instance relative to the target being built. The list of suffixes of files that will be scanned for IDL implicit dependencies (#include or import lines). The default list is: [".idl", ".IDL"] The prefix used to specify an include directory on the C compiler command line. This will be appended to the beginning of each directory in the &cv-CPPPATH; and &cv-FORTRANPATH; construction variables when the &cv-_CPPINCFLAGS; and &cv-_FORTRANINCFLAGS; variables are automatically generated. The suffix used to specify an include directory on the C compiler command line. This will be appended to the end of each directory in the &cv-CPPPATH; and &cv-FORTRANPATH; construction variables when the &cv-_CPPINCFLAGS; and &cv-_FORTRANINCFLAGS; variables are automatically generated. A function to be called to install a file into a destination file name. The default function copies the file into the destination (and sets the destination file's mode and permission bits to match the source file's). The function takes the following arguments: def install(dest, source, env): dest is the path name of the destination file. source is the path name of the source file. env is the construction environment (a dictionary of construction values) in force for this file installation. The string displayed when a file is installed into a destination file name. The default is: Install file: "$SOURCE" as "$TARGET" The list of suffixes of files that will be scanned for LaTeX implicit dependencies (\include or \import files). The default list is: [".tex", ".ltx", ".latex"] An automatically-generated construction variable containing the linker command-line options for specifying directories to be searched for library. The value of &cv-_LIBDIRFLAGS; is created by appending &cv-LIBDIRPREFIX; and &cv-LIBDIRSUFFIX; to the beginning and end of each directory in &cv-LIBPATH;. The prefix used to specify a library directory on the linker command line. This will be appended to the beginning of each directory in the &cv-LIBPATH; construction variable when the &cv-_LIBDIRFLAGS; variable is automatically generated. The suffix used to specify a library directory on the linker command line. This will be appended to the end of each directory in the &cv-LIBPATH; construction variable when the &cv-_LIBDIRFLAGS; variable is automatically generated. An automatically-generated construction variable containing the linker command-line options for specifying libraries to be linked with the resulting target. The value of &cv-_LIBFLAGS; is created by appending &cv-LIBLINKPREFIX; and &cv-LIBLINKSUFFIX; to the beginning and end of each filename in &cv-LIBS;. The prefix used to specify a library to link on the linker command line. This will be appended to the beginning of each library in the &cv-LIBS; construction variable when the &cv-_LIBFLAGS; variable is automatically generated. The suffix used to specify a library to link on the linker command line. This will be appended to the end of each library in the &cv-LIBS; construction variable when the &cv-_LIBFLAGS; variable is automatically generated. The list of directories that will be searched for libraries. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in &cv-LINKFLAGS; or &cv-SHLINKFLAGS; because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in LIBPATH will be looked-up relative to the SConscript directory when they are used in a command. To force &scons; to look-up a directory relative to the root of the source tree use #: env = Environment(LIBPATH='#/libs') The directory look-up can also be forced using the &Dir;() function: libs = Dir('libs') env = Environment(LIBPATH=libs) The directory list will be added to command lines through the automatically-generated &cv-_LIBDIRFLAGS; construction variable, which is constructed by appending the values of the &cv-LIBDIRPREFIX; and &cv-LIBDIRSUFFIX; construction variables to the beginning and end of each directory in &cv-LIBPATH;. Any command lines you define that need the LIBPATH directory list should include &cv-_LIBDIRFLAGS;: env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE") A list of one or more libraries that will be linked with any executable programs created by this environment. The library list will be added to command lines through the automatically-generated &cv-_LIBFLAGS; construction variable, which is constructed by appending the values of the &cv-LIBLINKPREFIX; and &cv-LIBLINKSUFFIX; construction variables to the beginning and end of each filename in &cv-LIBS;. Any command lines you define that need the LIBS library list should include &cv-_LIBFLAGS;: env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE") If you add a File object to the &cv-LIBS; list, the name of that file will be added to &cv-_LIBFLAGS;, and thus the link line, as is, without &cv-LIBLINKPREFIX; or &cv-LIBLINKSUFFIX;. For example: env.Append(LIBS=File('/tmp/mylib.so')) In all cases, scons will add dependencies from the executable program to all the libraries in this list. A function that converts a string into a list of Dir instances by searching the repositories. ([args]) Creates and returns a default construction environment object. This construction environment is used internally by SCons in order to execute many of the global functions in this list, and to fetch source files transparently from source code management systems. scons-src-3.0.0/src/engine/SCons/MemoizeTests.py0000664000175000017500000001053713160023041021543 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/MemoizeTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestUnit import SCons.Memoize # Enable memoization counting SCons.Memoize.EnableMemoization() class FakeObject(object): def __init__(self): self._memo = {} def _dict_key(self, argument): return argument @SCons.Memoize.CountDictCall(_dict_key) def dict(self, argument): memo_key = argument try: memo_dict = self._memo['dict'] except KeyError: memo_dict = {} self._memo['dict'] = memo_dict else: try: return memo_dict[memo_key] except KeyError: pass result = self.compute_dict(argument) memo_dict[memo_key] = result return result @SCons.Memoize.CountMethodCall def value(self): try: return self._memo['value'] except KeyError: pass result = self.compute_value() self._memo['value'] = result return result def get_memoizer_counter(self, name): return SCons.Memoize.CounterList.get(self.__class__.__name__+'.'+name, None) class Returner(object): def __init__(self, result): self.result = result self.calls = 0 def __call__(self, *args, **kw): self.calls = self.calls + 1 return self.result class CountDictTestCase(unittest.TestCase): def test___call__(self): """Calling a Memoized dict method """ obj = FakeObject() called = [] fd1 = Returner(1) fd2 = Returner(2) obj.compute_dict = fd1 r = obj.dict(11) assert r == 1, r obj.compute_dict = fd2 r = obj.dict(12) assert r == 2, r r = obj.dict(11) assert r == 1, r obj.compute_dict = fd1 r = obj.dict(11) assert r == 1, r r = obj.dict(12) assert r == 2, r assert fd1.calls == 1, fd1.calls assert fd2.calls == 1, fd2.calls c = obj.get_memoizer_counter('dict') assert c.hit == 3, c.hit assert c.miss == 2, c.miss class CountValueTestCase(unittest.TestCase): def test___call__(self): """Calling a Memoized value method """ obj = FakeObject() called = [] fv1 = Returner(1) fv2 = Returner(2) obj.compute_value = fv1 r = obj.value() assert r == 1, r r = obj.value() assert r == 1, r obj.compute_value = fv2 r = obj.value() assert r == 1, r r = obj.value() assert r == 1, r assert fv1.calls == 1, fv1.calls assert fv2.calls == 0, fv2.calls c = obj.get_memoizer_counter('value') assert c.hit == 3, c.hit assert c.miss == 1, c.miss if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ CountDictTestCase, CountValueTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Action.py0000664000175000017500000014765513160023040020343 0ustar bdbaddogbdbaddog"""SCons.Action This encapsulates information about executing any sort of action that can build one or more target Nodes (typically files) from one or more source Nodes (also typically files) given a specific Environment. The base class here is ActionBase. The base class supplies just a few OO utility methods and some generic methods for displaying information about an Action in response to the various commands that control printing. A second-level base class is _ActionAction. This extends ActionBase by providing the methods that can be used to show and perform an action. True Action objects will subclass _ActionAction; Action factory class objects will subclass ActionBase. The heavy lifting is handled by subclasses for the different types of actions we might execute: CommandAction CommandGeneratorAction FunctionAction ListAction The subclasses supply the following public interface methods used by other modules: __call__() THE public interface, "calling" an Action object executes the command or Python function. This also takes care of printing a pre-substitution command for debugging purposes. get_contents() Fetches the "contents" of an Action for signature calculation plus the varlist. This is what gets MD5 checksummed to decide if a target needs to be rebuilt because its action changed. genstring() Returns a string representation of the Action *without* command substitution, but allows a CommandGeneratorAction to generate the right action based on the specified target, source and env. This is used by the Signature subsystem (through the Executor) to obtain an (imprecise) representation of the Action operation for informative purposes. Subclasses also supply the following methods for internal use within this module: __str__() Returns a string approximation of the Action; no variable substitution is performed. execute() The internal method that really, truly, actually handles the execution of a command or Python function. This is used so that the __call__() methods can take care of displaying any pre-substitution representations, and *then* execute an action without worrying about the specific Actions involved. get_presig() Fetches the "contents" of a subclass for signature calculation. The varlist is added to this to produce the Action's contents. TODO(?): Change this to always return ascii/bytes and not unicode (or py3 strings) strfunction() Returns a substituted string representation of the Action. This is used by the _ActionAction.show() command to display the command/function that will be executed to generate the target(s). There is a related independent ActionCaller class that looks like a regular Action, and which serves as a wrapper for arbitrary functions that we want to let the user specify the arguments to now, but actually execute later (when an out-of-date check determines that it's needed to be executed, for example). Objects of this class are returned by an ActionFactory class that provides a __call__() method as a convenient way for wrapping up the functions. """ # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Action.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import pickle import re import sys import subprocess import itertools import inspect import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Errors import SCons.Util import SCons.Subst # we use these a lot, so try to optimize them is_String = SCons.Util.is_String is_List = SCons.Util.is_List class _null(object): pass print_actions = 1 execute_actions = 1 print_actions_presub = 0 # Use pickle protocol 1 when pickling functions for signature # otherwise python3 and python2 will yield different pickles # for the same object. # This is due to default being 1 for python 2.7, and 3 for 3.x # TODO: We can roll this forward to 2 (if it has value), but not # before a deprecation cycle as the sconsigns will change ACTION_SIGNATURE_PICKLE_PROTOCOL = 1 def rfile(n): try: return n.rfile() except AttributeError: return n def default_exitstatfunc(s): return s strip_quotes = re.compile('^[\'"](.*)[\'"]$') def _callable_contents(obj): """Return the signature contents of a callable Python object. """ try: # Test if obj is a method. return _function_contents(obj.__func__) except AttributeError: try: # Test if obj is a callable object. return _function_contents(obj.__call__.__func__) except AttributeError: try: # Test if obj is a code object. return _code_contents(obj) except AttributeError: # Test if obj is a function object. return _function_contents(obj) def _object_contents(obj): """Return the signature contents of any Python object. We have to handle the case where object contains a code object since it can be pickled directly. """ try: # Test if obj is a method. return _function_contents(obj.__func__) except AttributeError: try: # Test if obj is a callable object. return _function_contents(obj.__call__.__func__) except AttributeError: try: # Test if obj is a code object. return _code_contents(obj) except AttributeError: try: # Test if obj is a function object. return _function_contents(obj) except AttributeError as ae: # Should be a pickle-able Python object. try: return _object_instance_content(obj) # pickling an Action instance or object doesn't yield a stable # content as instance property may be dumped in different orders # return pickle.dumps(obj, ACTION_SIGNATURE_PICKLE_PROTOCOL) except (pickle.PicklingError, TypeError, AttributeError) as ex: # This is weird, but it seems that nested classes # are unpickable. The Python docs say it should # always be a PicklingError, but some Python # versions seem to return TypeError. Just do # the best we can. return bytearray(repr(obj), 'utf-8') def _code_contents(code, docstring=None): """Return the signature contents of a code object. By providing direct access to the code object of the function, Python makes this extremely easy. Hooray! Unfortunately, older versions of Python include line number indications in the compiled byte code. Boo! So we remove the line number byte codes to prevent recompilations from moving a Python function. See: - https://docs.python.org/2/library/inspect.html - http://python-reference.readthedocs.io/en/latest/docs/code/index.html For info on what each co\_ variable provides The signature is as follows (should be byte/chars): co_argcount, len(co_varnames), len(co_cellvars), len(co_freevars), ( comma separated signature for each object in co_consts ), ( comma separated signature for each object in co_names ), ( The bytecode with line number bytecodes removed from co_code ) co_argcount - Returns the number of positional arguments (including arguments with default values). co_varnames - Returns a tuple containing the names of the local variables (starting with the argument names). co_cellvars - Returns a tuple containing the names of local variables that are referenced by nested functions. co_freevars - Returns a tuple containing the names of free variables. (?) co_consts - Returns a tuple containing the literals used by the bytecode. co_names - Returns a tuple containing the names used by the bytecode. co_code - Returns a string representing the sequence of bytecode instructions. """ # contents = [] # The code contents depends on the number of local variables # but not their actual names. contents = bytearray("{}, {}".format(code.co_argcount, len(code.co_varnames)), 'utf-8') contents.extend(b", ") contents.extend(bytearray(str(len(code.co_cellvars)), 'utf-8')) contents.extend(b", ") contents.extend(bytearray(str(len(code.co_freevars)), 'utf-8')) # The code contents depends on any constants accessed by the # function. Note that we have to call _object_contents on each # constants because the code object of nested functions can # show-up among the constants. z = [_object_contents(cc) for cc in code.co_consts[1:]] contents.extend(b',(') contents.extend(bytearray(',', 'utf-8').join(z)) contents.extend(b')') # The code contents depends on the variable names used to # accessed global variable, as changing the variable name changes # the variable actually accessed and therefore changes the # function result. z= [bytearray(_object_contents(cc)) for cc in code.co_names] contents.extend(b',(') contents.extend(bytearray(',','utf-8').join(z)) contents.extend(b')') # The code contents depends on its actual code!!! contents.extend(b',(') contents.extend(code.co_code) contents.extend(b')') return contents def _function_contents(func): """ The signature is as follows (should be byte/chars): < _code_contents (see above) from func.__code__ > ,( comma separated _object_contents for function argument defaults) ,( comma separated _object_contents for any closure contents ) See also: https://docs.python.org/3/reference/datamodel.html - func.__code__ - The code object representing the compiled function body. - func.__defaults__ - A tuple containing default argument values for those arguments that have defaults, or None if no arguments have a default value - func.__closure__ - None or a tuple of cells that contain bindings for the function's free variables. :Returns: Signature contents of a function. (in bytes) """ contents = [_code_contents(func.__code__, func.__doc__)] # The function contents depends on the value of defaults arguments if func.__defaults__: function_defaults_contents = [_object_contents(cc) for cc in func.__defaults__] defaults = bytearray(b',(') defaults.extend(bytearray(b',').join(function_defaults_contents)) defaults.extend(b')') contents.append(defaults) else: contents.append(b',()') # The function contents depends on the closure captured cell values. closure = func.__closure__ or [] try: closure_contents = [_object_contents(x.cell_contents) for x in closure] except AttributeError: closure_contents = [] contents.append(b',(') contents.append(bytearray(b',').join(closure_contents)) contents.append(b')') retval = bytearray(b'').join(contents) return retval def _object_instance_content(obj): """ Returns consistant content for a action class or an instance thereof :Parameters: - `obj` Should be either and action class or an instance thereof :Returns: bytearray or bytes representing the obj suitable for generating a signature from. """ retval = bytearray() if obj is None: return b'N.' if isinstance(obj, SCons.Util.BaseStringTypes): return SCons.Util.to_bytes(obj) inst_class = obj.__class__ inst_class_name = bytearray(obj.__class__.__name__,'utf-8') inst_class_module = bytearray(obj.__class__.__module__,'utf-8') inst_class_hierarchy = bytearray(repr(inspect.getclasstree([obj.__class__,])),'utf-8') # print("ICH:%s : %s"%(inst_class_hierarchy, repr(obj))) properties = [(p, getattr(obj, p, "None")) for p in dir(obj) if not (p[:2] == '__' or inspect.ismethod(getattr(obj, p)) or inspect.isbuiltin(getattr(obj,p))) ] properties.sort() properties_str = ','.join(["%s=%s"%(p[0],p[1]) for p in properties]) properties_bytes = bytearray(properties_str,'utf-8') methods = [p for p in dir(obj) if inspect.ismethod(getattr(obj, p))] methods.sort() method_contents = [] for m in methods: # print("Method:%s"%m) v = _function_contents(getattr(obj, m)) # print("[%s->]V:%s [%s]"%(m,v,type(v))) method_contents.append(v) retval = bytearray(b'{') retval.extend(inst_class_name) retval.extend(b":") retval.extend(inst_class_module) retval.extend(b'}[[') retval.extend(inst_class_hierarchy) retval.extend(b']]{{') retval.extend(bytearray(b",").join(method_contents)) retval.extend(b"}}{{{") retval.extend(properties_bytes) retval.extend(b'}}}') return retval # print("class :%s"%inst_class) # print("class_name :%s"%inst_class_name) # print("class_module :%s"%inst_class_module) # print("Class hier :\n%s"%pp.pformat(inst_class_hierarchy)) # print("Inst Properties:\n%s"%pp.pformat(properties)) # print("Inst Methods :\n%s"%pp.pformat(methods)) def _actionAppend(act1, act2): # This function knows how to slap two actions together. # Mainly, it handles ListActions by concatenating into # a single ListAction. a1 = Action(act1) a2 = Action(act2) if a1 is None: return a2 if a2 is None: return a1 if isinstance(a1, ListAction): if isinstance(a2, ListAction): return ListAction(a1.list + a2.list) else: return ListAction(a1.list + [ a2 ]) else: if isinstance(a2, ListAction): return ListAction([ a1 ] + a2.list) else: return ListAction([ a1, a2 ]) def _do_create_keywords(args, kw): """This converts any arguments after the action argument into their equivalent keywords and adds them to the kw argument. """ v = kw.get('varlist', ()) # prevent varlist="FOO" from being interpreted as ['F', 'O', 'O'] if is_String(v): v = (v,) kw['varlist'] = tuple(v) if args: # turn positional args into equivalent keywords cmdstrfunc = args[0] if cmdstrfunc is None or is_String(cmdstrfunc): kw['cmdstr'] = cmdstrfunc elif callable(cmdstrfunc): kw['strfunction'] = cmdstrfunc else: raise SCons.Errors.UserError( 'Invalid command display variable type. ' 'You must either pass a string or a callback which ' 'accepts (target, source, env) as parameters.') if len(args) > 1: kw['varlist'] = tuple(SCons.Util.flatten(args[1:])) + kw['varlist'] if kw.get('strfunction', _null) is not _null \ and kw.get('cmdstr', _null) is not _null: raise SCons.Errors.UserError( 'Cannot have both strfunction and cmdstr args to Action()') def _do_create_action(act, kw): """This is the actual "implementation" for the Action factory method, below. This handles the fact that passing lists to Action() itself has different semantics than passing lists as elements of lists. The former will create a ListAction, the latter will create a CommandAction by converting the inner list elements to strings.""" if isinstance(act, ActionBase): return act if is_String(act): var=SCons.Util.get_environment_var(act) if var: # This looks like a string that is purely an Environment # variable reference, like "$FOO" or "${FOO}". We do # something special here...we lazily evaluate the contents # of that Environment variable, so a user could put something # like a function or a CommandGenerator in that variable # instead of a string. return LazyAction(var, kw) commands = str(act).split('\n') if len(commands) == 1: return CommandAction(commands[0], **kw) # The list of string commands may include a LazyAction, so we # reprocess them via _do_create_list_action. return _do_create_list_action(commands, kw) if is_List(act): return CommandAction(act, **kw) if callable(act): try: gen = kw['generator'] del kw['generator'] except KeyError: gen = 0 if gen: action_type = CommandGeneratorAction else: action_type = FunctionAction return action_type(act, kw) # Catch a common error case with a nice message: if isinstance(act, int) or isinstance(act, float): raise TypeError("Don't know how to create an Action from a number (%s)"%act) # Else fail silently (???) return None def _do_create_list_action(act, kw): """A factory for list actions. Convert the input list into Actions and then wrap them in a ListAction.""" acts = [] for a in act: aa = _do_create_action(a, kw) if aa is not None: acts.append(aa) if not acts: return ListAction([]) elif len(acts) == 1: return acts[0] else: return ListAction(acts) def Action(act, *args, **kw): """A factory for action objects.""" # Really simple: the _do_create_* routines do the heavy lifting. _do_create_keywords(args, kw) if is_List(act): return _do_create_list_action(act, kw) return _do_create_action(act, kw) class ActionBase(object): """Base class for all types of action objects that can be held by other objects (Builders, Executors, etc.) This provides the common methods for manipulating and combining those actions.""" def __eq__(self, other): return self.__dict__ == other def no_batch_key(self, env, target, source): return None batch_key = no_batch_key def genstring(self, target, source, env): return str(self) def get_contents(self, target, source, env): result = self.get_presig(target, source, env) if not isinstance(result,(bytes, bytearray)): result = bytearray("",'utf-8').join([ SCons.Util.to_bytes(r) for r in result ]) else: # Make a copy and put in bytearray, without this the contents returned by get_presig # can be changed by the logic below, appending with each call and causing very # hard to track down issues... result = bytearray(result) # At this point everything should be a bytearray # This should never happen, as the Action() factory should wrap # the varlist, but just in case an action is created directly, # we duplicate this check here. vl = self.get_varlist(target, source, env) if is_String(vl): vl = (vl,) for v in vl: # do the subst this way to ignore $(...$) parts: if isinstance(result, bytearray): result.extend(SCons.Util.to_bytes(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source))) else: raise Exception("WE SHOULD NEVER GET HERE result should be bytearray not:%s"%type(result)) # result.append(SCons.Util.to_bytes(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source))) if isinstance(result, (bytes,bytearray)): return result else: raise Exception("WE SHOULD NEVER GET HERE - #2 result should be bytearray not:%s" % type(result)) # return b''.join(result) def __add__(self, other): return _actionAppend(self, other) def __radd__(self, other): return _actionAppend(other, self) def presub_lines(self, env): # CommandGeneratorAction needs a real environment # in order to return the proper string here, since # it may call LazyAction, which looks up a key # in that env. So we temporarily remember the env here, # and CommandGeneratorAction will use this env # when it calls its _generate method. self.presub_env = env lines = str(self).split('\n') self.presub_env = None # don't need this any more return lines def get_varlist(self, target, source, env, executor=None): return self.varlist def get_targets(self, env, executor): """ Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used by this action. """ return self.targets class _ActionAction(ActionBase): """Base class for actions that create output objects.""" def __init__(self, cmdstr=_null, strfunction=_null, varlist=(), presub=_null, chdir=None, exitstatfunc=None, batch_key=None, targets='$TARGETS', **kw): self.cmdstr = cmdstr if strfunction is not _null: if strfunction is None: self.cmdstr = None else: self.strfunction = strfunction self.varlist = varlist self.presub = presub self.chdir = chdir if not exitstatfunc: exitstatfunc = default_exitstatfunc self.exitstatfunc = exitstatfunc self.targets = targets if batch_key: if not callable(batch_key): # They have set batch_key, but not to their own # callable. The default behavior here will batch # *all* targets+sources using this action, separated # for each construction environment. def default_batch_key(self, env, target, source): return (id(self), id(env)) batch_key = default_batch_key SCons.Util.AddMethod(self, batch_key, 'batch_key') def print_cmd_line(self, s, target, source, env): """ In python 3, and in some of our tests, sys.stdout is a String io object, and it takes unicode strings only In other cases it's a regular Python 2.x file object which takes strings (bytes), and if you pass those a unicode object they try to decode with 'ascii' codec which fails if the cmd line has any hi-bit-set chars. This code assumes s is a regular string, but should work if it's unicode too. """ try: sys.stdout.write(s + u"\n") except UnicodeDecodeError: sys.stdout.write(s + "\n") def __call__(self, target, source, env, exitstatfunc=_null, presub=_null, show=_null, execute=_null, chdir=_null, executor=None): if not is_List(target): target = [target] if not is_List(source): source = [source] if presub is _null: presub = self.presub if presub is _null: presub = print_actions_presub if exitstatfunc is _null: exitstatfunc = self.exitstatfunc if show is _null: show = print_actions if execute is _null: execute = execute_actions if chdir is _null: chdir = self.chdir save_cwd = None if chdir: save_cwd = os.getcwd() try: chdir = str(chdir.get_abspath()) except AttributeError: if not is_String(chdir): if executor: chdir = str(executor.batches[0].targets[0].dir) else: chdir = str(target[0].dir) if presub: if executor: target = executor.get_all_targets() source = executor.get_all_sources() t = ' and '.join(map(str, target)) l = '\n '.join(self.presub_lines(env)) out = u"Building %s with action:\n %s\n" % (t, l) sys.stdout.write(out) cmd = None if show and self.strfunction: if executor: target = executor.get_all_targets() source = executor.get_all_sources() try: cmd = self.strfunction(target, source, env, executor) except TypeError: cmd = self.strfunction(target, source, env) if cmd: if chdir: cmd = ('os.chdir(%s)\n' % repr(chdir)) + cmd try: get = env.get except AttributeError: print_func = self.print_cmd_line else: print_func = get('PRINT_CMD_LINE_FUNC') if not print_func: print_func = self.print_cmd_line print_func(cmd, target, source, env) stat = 0 if execute: if chdir: os.chdir(chdir) try: stat = self.execute(target, source, env, executor=executor) if isinstance(stat, SCons.Errors.BuildError): s = exitstatfunc(stat.status) if s: stat.status = s else: stat = s else: stat = exitstatfunc(stat) finally: if save_cwd: os.chdir(save_cwd) if cmd and save_cwd: print_func('os.chdir(%s)' % repr(save_cwd), target, source, env) return stat def _string_from_cmd_list(cmd_list): """Takes a list of command line arguments and returns a pretty representation for printing.""" cl = [] for arg in map(str, cmd_list): if ' ' in arg or '\t' in arg: arg = '"' + arg + '"' cl.append(arg) return ' '.join(cl) default_ENV = None def get_default_ENV(env): """ A fiddlin' little function that has an 'import SCons.Environment' which can't be moved to the top level without creating an import loop. Since this import creates a local variable named 'SCons', it blocks access to the global variable, so we move it here to prevent complaints about local variables being used uninitialized. """ global default_ENV try: return env['ENV'] except KeyError: if not default_ENV: import SCons.Environment # This is a hideously expensive way to get a default shell # environment. What it really should do is run the platform # setup to get the default ENV. Fortunately, it's incredibly # rare for an Environment not to have a shell environment, so # we're not going to worry about it overmuch. default_ENV = SCons.Environment.Environment()['ENV'] return default_ENV def _subproc(scons_env, cmd, error = 'ignore', **kw): """Do common setup for a subprocess.Popen() call This function is still in draft mode. We're going to need something like it in the long run as more and more places use subprocess, but I'm sure it'll have to be tweaked to get the full desired functionality. one special arg (so far?), 'error', to tell what to do with exceptions. """ # allow std{in,out,err} to be "'devnull'" io = kw.get('stdin') if is_String(io) and io == 'devnull': kw['stdin'] = open(os.devnull) io = kw.get('stdout') if is_String(io) and io == 'devnull': kw['stdout'] = open(os.devnull, 'w') io = kw.get('stderr') if is_String(io) and io == 'devnull': kw['stderr'] = open(os.devnull, 'w') # Figure out what shell environment to use ENV = kw.get('env', None) if ENV is None: ENV = get_default_ENV(scons_env) # Ensure that the ENV values are all strings: new_env = {} for key, value in ENV.items(): if is_List(value): # If the value is a list, then we assume it is a path list, # because that's a pretty common list-like value to stick # in an environment variable: value = SCons.Util.flatten_sequence(value) new_env[key] = os.pathsep.join(map(str, value)) else: # It's either a string or something else. If it's a string, # we still want to call str() because it might be a *Unicode* # string, which makes subprocess.Popen() gag. If it isn't a # string or a list, then we just coerce it to a string, which # is the proper way to handle Dir and File instances and will # produce something reasonable for just about everything else: new_env[key] = str(value) kw['env'] = new_env try: return subprocess.Popen(cmd, **kw) except EnvironmentError as e: if error == 'raise': raise # return a dummy Popen instance that only returns error class dummyPopen(object): def __init__(self, e): self.exception = e def communicate(self, input=None): return ('', '') def wait(self): return -self.exception.errno stdin = None class f(object): def read(self): return '' def readline(self): return '' def __iter__(self): return iter(()) stdout = stderr = f() return dummyPopen(e) class CommandAction(_ActionAction): """Class for command-execution actions.""" def __init__(self, cmd, **kw): # Cmd can actually be a list or a single item; if it's a # single item it should be the command string to execute; if a # list then it should be the words of the command string to # execute. Only a single command should be executed by this # object; lists of commands should be handled by embedding # these objects in a ListAction object (which the Action() # factory above does). cmd will be passed to # Environment.subst_list() for substituting environment # variables. if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandAction') _ActionAction.__init__(self, **kw) if is_List(cmd): if [c for c in cmd if is_List(c)]: raise TypeError("CommandAction should be given only " \ "a single command") self.cmd_list = cmd def __str__(self): if is_List(self.cmd_list): return ' '.join(map(str, self.cmd_list)) return str(self.cmd_list) def process(self, target, source, env, executor=None): if executor: result = env.subst_list(self.cmd_list, 0, executor=executor) else: result = env.subst_list(self.cmd_list, 0, target, source) silent = None ignore = None while True: try: c = result[0][0][0] except IndexError: c = None if c == '@': silent = 1 elif c == '-': ignore = 1 else: break result[0][0] = result[0][0][1:] try: if not result[0][0]: result[0] = result[0][1:] except IndexError: pass return result, ignore, silent def strfunction(self, target, source, env, executor=None): if self.cmdstr is None: return None if self.cmdstr is not _null: from SCons.Subst import SUBST_RAW if executor: c = env.subst(self.cmdstr, SUBST_RAW, executor=executor) else: c = env.subst(self.cmdstr, SUBST_RAW, target, source) if c: return c cmd_list, ignore, silent = self.process(target, source, env, executor) if silent: return '' return _string_from_cmd_list(cmd_list[0]) def execute(self, target, source, env, executor=None): """Execute a command action. This will handle lists of commands as well as individual commands, because construction variable substitution may turn a single "command" into a list. This means that this class can actually handle lists of commands, even though that's not how we use it externally. """ escape_list = SCons.Subst.escape_list flatten_sequence = SCons.Util.flatten_sequence try: shell = env['SHELL'] except KeyError: raise SCons.Errors.UserError('Missing SHELL construction variable.') try: spawn = env['SPAWN'] except KeyError: raise SCons.Errors.UserError('Missing SPAWN construction variable.') else: if is_String(spawn): spawn = env.subst(spawn, raw=1, conv=lambda x: x) escape = env.get('ESCAPE', lambda x: x) ENV = get_default_ENV(env) # Ensure that the ENV values are all strings: for key, value in ENV.items(): if not is_String(value): if is_List(value): # If the value is a list, then we assume it is a # path list, because that's a pretty common list-like # value to stick in an environment variable: value = flatten_sequence(value) ENV[key] = os.pathsep.join(map(str, value)) else: # If it isn't a string or a list, then we just coerce # it to a string, which is the proper way to handle # Dir and File instances and will produce something # reasonable for just about everything else: ENV[key] = str(value) if executor: target = executor.get_all_targets() source = executor.get_all_sources() cmd_list, ignore, silent = self.process(target, list(map(rfile, source)), env, executor) # Use len() to filter out any "command" that's zero-length. for cmd_line in filter(len, cmd_list): # Escape the command line for the interpreter we are using. cmd_line = escape_list(cmd_line, escape) result = spawn(shell, escape, cmd_line[0], cmd_line, ENV) if not ignore and result: msg = "Error %s" % result return SCons.Errors.BuildError(errstr=msg, status=result, action=self, command=cmd_line) return 0 def get_presig(self, target, source, env, executor=None): """Return the signature contents of this action's command line. This strips $(-$) and everything in between the string, since those parts don't affect signatures. """ from SCons.Subst import SUBST_SIG cmd = self.cmd_list if is_List(cmd): cmd = ' '.join(map(str, cmd)) else: cmd = str(cmd) if executor: return env.subst_target_source(cmd, SUBST_SIG, executor=executor) else: return env.subst_target_source(cmd, SUBST_SIG, target, source) def get_implicit_deps(self, target, source, env, executor=None): icd = env.get('IMPLICIT_COMMAND_DEPENDENCIES', True) if is_String(icd) and icd[:1] == '$': icd = env.subst(icd) if not icd or icd in ('0', 'None'): return [] from SCons.Subst import SUBST_SIG if executor: cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, executor=executor) else: cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, target, source) res = [] for cmd_line in cmd_list: if cmd_line: d = str(cmd_line[0]) m = strip_quotes.match(d) if m: d = m.group(1) d = env.WhereIs(d) if d: res.append(env.fs.File(d)) return res class CommandGeneratorAction(ActionBase): """Class for command-generator actions.""" def __init__(self, generator, kw): if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandGeneratorAction') self.generator = generator self.gen_kw = kw self.varlist = kw.get('varlist', ()) self.targets = kw.get('targets', '$TARGETS') def _generate(self, target, source, env, for_signature, executor=None): # ensure that target is a list, to make it easier to write # generator functions: if not is_List(target): target = [target] if executor: target = executor.get_all_targets() source = executor.get_all_sources() ret = self.generator(target=target, source=source, env=env, for_signature=for_signature) gen_cmd = Action(ret, **self.gen_kw) if not gen_cmd: raise SCons.Errors.UserError("Object returned from command generator: %s cannot be used to create an Action." % repr(ret)) return gen_cmd def __str__(self): try: env = self.presub_env except AttributeError: env = None if env is None: env = SCons.Defaults.DefaultEnvironment() act = self._generate([], [], env, 1) return str(act) def batch_key(self, env, target, source): return self._generate(target, source, env, 1).batch_key(env, target, source) def genstring(self, target, source, env, executor=None): return self._generate(target, source, env, 1, executor).genstring(target, source, env) def __call__(self, target, source, env, exitstatfunc=_null, presub=_null, show=_null, execute=_null, chdir=_null, executor=None): act = self._generate(target, source, env, 0, executor) if act is None: raise SCons.Errors.UserError("While building `%s': " "Cannot deduce file extension from source files: %s" % (repr(list(map(str, target))), repr(list(map(str, source))))) return act(target, source, env, exitstatfunc, presub, show, execute, chdir, executor) def get_presig(self, target, source, env, executor=None): """Return the signature contents of this action's command line. This strips $(-$) and everything in between the string, since those parts don't affect signatures. """ return self._generate(target, source, env, 1, executor).get_presig(target, source, env) def get_implicit_deps(self, target, source, env, executor=None): return self._generate(target, source, env, 1, executor).get_implicit_deps(target, source, env) def get_varlist(self, target, source, env, executor=None): return self._generate(target, source, env, 1, executor).get_varlist(target, source, env, executor) def get_targets(self, env, executor): return self._generate(None, None, env, 1, executor).get_targets(env, executor) class LazyAction(CommandGeneratorAction, CommandAction): """ A LazyAction is a kind of hybrid generator and command action for strings of the form "$VAR". These strings normally expand to other strings (think "$CCCOM" to "$CC -c -o $TARGET $SOURCE"), but we also want to be able to replace them with functions in the construction environment. Consequently, we want lazy evaluation and creation of an Action in the case of the function, but that's overkill in the more normal case of expansion to other strings. So we do this with a subclass that's both a generator *and* a command action. The overridden methods all do a quick check of the construction variable, and if it's a string we just call the corresponding CommandAction method to do the heavy lifting. If not, then we call the same-named CommandGeneratorAction method. The CommandGeneratorAction methods work by using the overridden _generate() method, that is, our own way of handling "generation" of an action based on what's in the construction variable. """ def __init__(self, var, kw): if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.LazyAction') CommandAction.__init__(self, '${'+var+'}', **kw) self.var = SCons.Util.to_String(var) self.gen_kw = kw def get_parent_class(self, env): c = env.get(self.var) if is_String(c) and not '\n' in c: return CommandAction return CommandGeneratorAction def _generate_cache(self, env): if env: c = env.get(self.var, '') else: c = '' gen_cmd = Action(c, **self.gen_kw) if not gen_cmd: raise SCons.Errors.UserError("$%s value %s cannot be used to create an Action." % (self.var, repr(c))) return gen_cmd def _generate(self, target, source, env, for_signature, executor=None): return self._generate_cache(env) def __call__(self, target, source, env, *args, **kw): c = self.get_parent_class(env) return c.__call__(self, target, source, env, *args, **kw) def get_presig(self, target, source, env): c = self.get_parent_class(env) return c.get_presig(self, target, source, env) def get_varlist(self, target, source, env, executor=None): c = self.get_parent_class(env) return c.get_varlist(self, target, source, env, executor) class FunctionAction(_ActionAction): """Class for Python function actions.""" def __init__(self, execfunction, kw): if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.FunctionAction') self.execfunction = execfunction try: self.funccontents = _callable_contents(execfunction) except AttributeError: try: # See if execfunction will do the heavy lifting for us. self.gc = execfunction.get_contents except AttributeError: # This is weird, just do the best we can. self.funccontents = _object_contents(execfunction) _ActionAction.__init__(self, **kw) def function_name(self): try: return self.execfunction.__name__ except AttributeError: try: return self.execfunction.__class__.__name__ except AttributeError: return "unknown_python_function" def strfunction(self, target, source, env, executor=None): if self.cmdstr is None: return None if self.cmdstr is not _null: from SCons.Subst import SUBST_RAW if executor: c = env.subst(self.cmdstr, SUBST_RAW, executor=executor) else: c = env.subst(self.cmdstr, SUBST_RAW, target, source) if c: return c def array(a): def quote(s): try: str_for_display = s.str_for_display except AttributeError: s = repr(s) else: s = str_for_display() return s return '[' + ", ".join(map(quote, a)) + ']' try: strfunc = self.execfunction.strfunction except AttributeError: pass else: if strfunc is None: return None if callable(strfunc): return strfunc(target, source, env) name = self.function_name() tstr = array(target) sstr = array(source) return "%s(%s, %s)" % (name, tstr, sstr) def __str__(self): name = self.function_name() if name == 'ActionCaller': return str(self.execfunction) return "%s(target, source, env)" % name def execute(self, target, source, env, executor=None): exc_info = (None,None,None) try: if executor: target = executor.get_all_targets() source = executor.get_all_sources() rsources = list(map(rfile, source)) try: result = self.execfunction(target=target, source=rsources, env=env) except KeyboardInterrupt as e: raise except SystemExit as e: raise except Exception as e: result = e exc_info = sys.exc_info() if result: result = SCons.Errors.convert_to_BuildError(result, exc_info) result.node=target result.action=self try: result.command=self.strfunction(target, source, env, executor) except TypeError: result.command=self.strfunction(target, source, env) # FIXME: This maintains backward compatibility with respect to # which type of exceptions were returned by raising an # exception and which ones were returned by value. It would # probably be best to always return them by value here, but # some codes do not check the return value of Actions and I do # not have the time to modify them at this point. if (exc_info[1] and not isinstance(exc_info[1],EnvironmentError)): raise result return result finally: # Break the cycle between the traceback object and this # function stack frame. See the sys.exc_info() doc info for # more information about this issue. del exc_info def get_presig(self, target, source, env): """Return the signature contents of this callable action.""" try: return self.gc(target, source, env) except AttributeError: return self.funccontents def get_implicit_deps(self, target, source, env): return [] class ListAction(ActionBase): """Class for lists of other actions.""" def __init__(self, actionlist): if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.ListAction') def list_of_actions(x): if isinstance(x, ActionBase): return x return Action(x) self.list = list(map(list_of_actions, actionlist)) # our children will have had any varlist # applied; we don't need to do it again self.varlist = () self.targets = '$TARGETS' def genstring(self, target, source, env): return '\n'.join([a.genstring(target, source, env) for a in self.list]) def __str__(self): return '\n'.join(map(str, self.list)) def presub_lines(self, env): return SCons.Util.flatten_sequence( [a.presub_lines(env) for a in self.list]) def get_presig(self, target, source, env): """Return the signature contents of this action list. Simple concatenation of the signatures of the elements. """ return b"".join([bytes(x.get_contents(target, source, env)) for x in self.list]) def __call__(self, target, source, env, exitstatfunc=_null, presub=_null, show=_null, execute=_null, chdir=_null, executor=None): if executor: target = executor.get_all_targets() source = executor.get_all_sources() for act in self.list: stat = act(target, source, env, exitstatfunc, presub, show, execute, chdir, executor) if stat: return stat return 0 def get_implicit_deps(self, target, source, env): result = [] for act in self.list: result.extend(act.get_implicit_deps(target, source, env)) return result def get_varlist(self, target, source, env, executor=None): result = SCons.Util.OrderedDict() for act in self.list: for var in act.get_varlist(target, source, env, executor): result[var] = True return list(result.keys()) class ActionCaller(object): """A class for delaying calling an Action function with specific (positional and keyword) arguments until the Action is actually executed. This class looks to the rest of the world like a normal Action object, but what it's really doing is hanging on to the arguments until we have a target, source and env to use for the expansion. """ def __init__(self, parent, args, kw): self.parent = parent self.args = args self.kw = kw def get_contents(self, target, source, env): actfunc = self.parent.actfunc try: # "self.actfunc" is a function. contents = actfunc.__code__.co_code except AttributeError: # "self.actfunc" is a callable object. try: contents = actfunc.__call__.__func__.__code__.co_code except AttributeError: # No __call__() method, so it might be a builtin # or something like that. Do the best we can. contents = repr(actfunc) return contents def subst(self, s, target, source, env): # If s is a list, recursively apply subst() # to every element in the list if is_List(s): result = [] for elem in s: result.append(self.subst(elem, target, source, env)) return self.parent.convert(result) # Special-case hack: Let a custom function wrapped in an # ActionCaller get at the environment through which the action # was called by using this hard-coded value as a special return. if s == '$__env__': return env elif is_String(s): return env.subst(s, 1, target, source) return self.parent.convert(s) def subst_args(self, target, source, env): return [self.subst(x, target, source, env) for x in self.args] def subst_kw(self, target, source, env): kw = {} for key in list(self.kw.keys()): kw[key] = self.subst(self.kw[key], target, source, env) return kw def __call__(self, target, source, env, executor=None): args = self.subst_args(target, source, env) kw = self.subst_kw(target, source, env) return self.parent.actfunc(*args, **kw) def strfunction(self, target, source, env): args = self.subst_args(target, source, env) kw = self.subst_kw(target, source, env) return self.parent.strfunc(*args, **kw) def __str__(self): return self.parent.strfunc(*self.args, **self.kw) class ActionFactory(object): """A factory class that will wrap up an arbitrary function as an SCons-executable Action object. The real heavy lifting here is done by the ActionCaller class. We just collect the (positional and keyword) arguments that we're called with and give them to the ActionCaller object we create, so it can hang onto them until it needs them. """ def __init__(self, actfunc, strfunc, convert=lambda x: x): self.actfunc = actfunc self.strfunc = strfunc self.convert = convert def __call__(self, *args, **kw): ac = ActionCaller(self, args, kw) action = Action(ac, strfunction=ac.strfunction) return action # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/cpp.py0000664000175000017500000004636113160023045017705 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/cpp.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """ SCons C Pre-Processor module """ import SCons.compat import os import re # # First "subsystem" of regular expressions that we set up: # # Stuff to turn the C preprocessor directives in a file's contents into # a list of tuples that we can process easily. # # A table of regular expressions that fetch the arguments from the rest of # a C preprocessor line. Different directives have different arguments # that we want to fetch, using the regular expressions to which the lists # of preprocessor directives map. cpp_lines_dict = { # Fetch the rest of a #if/#elif/#ifdef/#ifndef as one argument, # separated from the keyword by white space. ('if', 'elif', 'ifdef', 'ifndef',) : '\s+(.+)', # Fetch the rest of a #import/#include/#include_next line as one # argument, with white space optional. ('import', 'include', 'include_next',) : '\s*(.+)', # We don't care what comes after a #else or #endif line. ('else', 'endif',) : '', # Fetch three arguments from a #define line: # 1) The #defined keyword. # 2) The optional parentheses and arguments (if it's a function-like # macro, '' if it's not). # 3) The expansion value. ('define',) : '\s+([_A-Za-z][_A-Za-z0-9_]*)(\([^)]*\))?\s*(.*)', # Fetch the #undefed keyword from a #undef line. ('undef',) : '\s+([_A-Za-z][A-Za-z0-9_]*)', } # Create a table that maps each individual C preprocessor directive to # the corresponding compiled regular expression that fetches the arguments # we care about. Table = {} for op_list, expr in cpp_lines_dict.items(): e = re.compile(expr) for op in op_list: Table[op] = e del e del op del op_list # Create a list of the expressions we'll use to match all of the # preprocessor directives. These are the same as the directives # themselves *except* that we must use a negative lookahead assertion # when matching "if" so it doesn't match the "if" in "ifdef." override = { 'if' : 'if(?!def)', } l = [override.get(x, x) for x in list(Table.keys())] # Turn the list of expressions into one big honkin' regular expression # that will match all the preprocessor lines at once. This will return # a list of tuples, one for each preprocessor line. The preprocessor # directive will be the first element in each tuple, and the rest of # the line will be the second element. e = '^\s*#\s*(' + '|'.join(l) + ')(.*)$' # And last but not least, compile the expression. CPP_Expression = re.compile(e, re.M) # # Second "subsystem" of regular expressions that we set up: # # Stuff to translate a C preprocessor expression (as found on a #if or # #elif line) into an equivalent Python expression that we can eval(). # # A dictionary that maps the C representation of Boolean operators # to their Python equivalents. CPP_to_Python_Ops_Dict = { '!' : ' not ', '!=' : ' != ', '&&' : ' and ', '||' : ' or ', '?' : ' and ', ':' : ' or ', '\r' : '', } CPP_to_Python_Ops_Sub = lambda m: CPP_to_Python_Ops_Dict[m.group(0)] # We have to sort the keys by length so that longer expressions # come *before* shorter expressions--in particular, "!=" must # come before "!" in the alternation. Without this, the Python # re module, as late as version 2.2.2, empirically matches the # "!" in "!=" first, instead of finding the longest match. # What's up with that? l = sorted(list(CPP_to_Python_Ops_Dict.keys()), key=lambda a: len(a), reverse=True) # Turn the list of keys into one regular expression that will allow us # to substitute all of the operators at once. expr = '|'.join(map(re.escape, l)) # ...and compile the expression. CPP_to_Python_Ops_Expression = re.compile(expr) # A separate list of expressions to be evaluated and substituted # sequentially, not all at once. CPP_to_Python_Eval_List = [ ['defined\s+(\w+)', '"\\1" in __dict__'], ['defined\s*\((\w+)\)', '"\\1" in __dict__'], ['/\*.*\*/', ''], ['/\*.*', ''], ['//.*', ''], ['(0x[0-9A-Fa-f]*)[UL]+', '\\1'], ] # Replace the string representations of the regular expressions in the # list with compiled versions. for l in CPP_to_Python_Eval_List: l[0] = re.compile(l[0]) # Wrap up all of the above into a handy function. def CPP_to_Python(s): """ Converts a C pre-processor expression into an equivalent Python expression that can be evaluated. """ s = CPP_to_Python_Ops_Expression.sub(CPP_to_Python_Ops_Sub, s) for expr, repl in CPP_to_Python_Eval_List: s = expr.sub(repl, s) return s del expr del l del override class FunctionEvaluator(object): """ Handles delayed evaluation of a #define function call. """ def __init__(self, name, args, expansion): """ Squirrels away the arguments and expansion value of a #define macro function for later evaluation when we must actually expand a value that uses it. """ self.name = name self.args = function_arg_separator.split(args) try: expansion = expansion.split('##') except AttributeError: pass self.expansion = expansion def __call__(self, *values): """ Evaluates the expansion of a #define macro function called with the specified values. """ if len(self.args) != len(values): raise ValueError("Incorrect number of arguments to `%s'" % self.name) # Create a dictionary that maps the macro arguments to the # corresponding values in this "call." We'll use this when we # eval() the expansion so that arguments will get expanded to # the right values. locals = {} for k, v in zip(self.args, values): locals[k] = v parts = [] for s in self.expansion: if not s in self.args: s = repr(s) parts.append(s) statement = ' + '.join(parts) return eval(statement, globals(), locals) # Find line continuations. line_continuations = re.compile('\\\\\r?\n') # Search for a "function call" macro on an expansion. Returns the # two-tuple of the "function" name itself, and a string containing the # arguments within the call parentheses. function_name = re.compile('(\S+)\(([^)]*)\)') # Split a string containing comma-separated function call arguments into # the separate arguments. function_arg_separator = re.compile(',\s*') class PreProcessor(object): """ The main workhorse class for handling C pre-processing. """ def __init__(self, current=os.curdir, cpppath=(), dict={}, all=0): global Table cpppath = tuple(cpppath) self.searchpath = { '"' : (current,) + cpppath, '<' : cpppath + (current,), } # Initialize our C preprocessor namespace for tracking the # values of #defined keywords. We use this namespace to look # for keywords on #ifdef/#ifndef lines, and to eval() the # expressions on #if/#elif lines (after massaging them from C to # Python). self.cpp_namespace = dict.copy() self.cpp_namespace['__dict__'] = self.cpp_namespace if all: self.do_include = self.all_include # For efficiency, a dispatch table maps each C preprocessor # directive (#if, #define, etc.) to the method that should be # called when we see it. We accomodate state changes (#if, # #ifdef, #ifndef) by pushing the current dispatch table on a # stack and changing what method gets called for each relevant # directive we might see next at this level (#else, #elif). # #endif will simply pop the stack. d = { 'scons_current_file' : self.scons_current_file } for op in list(Table.keys()): d[op] = getattr(self, 'do_' + op) self.default_table = d # Controlling methods. def tupleize(self, contents): """ Turns the contents of a file into a list of easily-processed tuples describing the CPP lines in the file. The first element of each tuple is the line's preprocessor directive (#if, #include, #define, etc., minus the initial '#'). The remaining elements are specific to the type of directive, as pulled apart by the regular expression. """ global CPP_Expression, Table contents = line_continuations.sub('', contents) cpp_tuples = CPP_Expression.findall(contents) return [(m[0],) + Table[m[0]].match(m[1]).groups() for m in cpp_tuples] def __call__(self, file): """ Pre-processes a file. This is the main public entry point. """ self.current_file = file return self.process_contents(self.read_file(file), file) def process_contents(self, contents, fname=None): """ Pre-processes a file contents. This is the main internal entry point. """ self.stack = [] self.dispatch_table = self.default_table.copy() self.current_file = fname self.tuples = self.tupleize(contents) self.initialize_result(fname) while self.tuples: t = self.tuples.pop(0) # Uncomment to see the list of tuples being processed (e.g., # to validate the CPP lines are being translated correctly). #print(t) self.dispatch_table[t[0]](t) return self.finalize_result(fname) # Dispatch table stack manipulation methods. def save(self): """ Pushes the current dispatch table on the stack and re-initializes the current dispatch table to the default. """ self.stack.append(self.dispatch_table) self.dispatch_table = self.default_table.copy() def restore(self): """ Pops the previous dispatch table off the stack and makes it the current one. """ try: self.dispatch_table = self.stack.pop() except IndexError: pass # Utility methods. def do_nothing(self, t): """ Null method for when we explicitly want the action for a specific preprocessor directive to do nothing. """ pass def scons_current_file(self, t): self.current_file = t[1] def eval_expression(self, t): """ Evaluates a C preprocessor expression. This is done by converting it to a Python equivalent and eval()ing it in the C preprocessor namespace we use to track #define values. """ t = CPP_to_Python(' '.join(t[1:])) try: return eval(t, self.cpp_namespace) except (NameError, TypeError): return 0 def initialize_result(self, fname): self.result = [fname] def finalize_result(self, fname): return self.result[1:] def find_include_file(self, t): """ Finds the #include file for a given preprocessor tuple. """ fname = t[2] for d in self.searchpath[t[1]]: if d == os.curdir: f = fname else: f = os.path.join(d, fname) if os.path.isfile(f): return f return None def read_file(self, file): with open(file) as f: return f.read() # Start and stop processing include lines. def start_handling_includes(self, t=None): """ Causes the PreProcessor object to start processing #import, #include and #include_next lines. This method will be called when a #if, #ifdef, #ifndef or #elif evaluates True, or when we reach the #else in a #if, #ifdef, #ifndef or #elif block where a condition already evaluated False. """ d = self.dispatch_table p = self.stack[-1] if self.stack else self.default_table for k in ('import', 'include', 'include_next'): d[k] = p[k] def stop_handling_includes(self, t=None): """ Causes the PreProcessor object to stop processing #import, #include and #include_next lines. This method will be called when a #if, #ifdef, #ifndef or #elif evaluates False, or when we reach the #else in a #if, #ifdef, #ifndef or #elif block where a condition already evaluated True. """ d = self.dispatch_table d['import'] = self.do_nothing d['include'] = self.do_nothing d['include_next'] = self.do_nothing # Default methods for handling all of the preprocessor directives. # (Note that what actually gets called for a given directive at any # point in time is really controlled by the dispatch_table.) def _do_if_else_condition(self, condition): """ Common logic for evaluating the conditions on #if, #ifdef and #ifndef lines. """ self.save() d = self.dispatch_table if condition: self.start_handling_includes() d['elif'] = self.stop_handling_includes d['else'] = self.stop_handling_includes else: self.stop_handling_includes() d['elif'] = self.do_elif d['else'] = self.start_handling_includes def do_ifdef(self, t): """ Default handling of a #ifdef line. """ self._do_if_else_condition(t[1] in self.cpp_namespace) def do_ifndef(self, t): """ Default handling of a #ifndef line. """ self._do_if_else_condition(t[1] not in self.cpp_namespace) def do_if(self, t): """ Default handling of a #if line. """ self._do_if_else_condition(self.eval_expression(t)) def do_elif(self, t): """ Default handling of a #elif line. """ d = self.dispatch_table if self.eval_expression(t): self.start_handling_includes() d['elif'] = self.stop_handling_includes d['else'] = self.stop_handling_includes def do_else(self, t): """ Default handling of a #else line. """ pass def do_endif(self, t): """ Default handling of a #endif line. """ self.restore() def do_define(self, t): """ Default handling of a #define line. """ _, name, args, expansion = t try: expansion = int(expansion) except (TypeError, ValueError): pass if args: evaluator = FunctionEvaluator(name, args[1:-1], expansion) self.cpp_namespace[name] = evaluator else: self.cpp_namespace[name] = expansion def do_undef(self, t): """ Default handling of a #undef line. """ try: del self.cpp_namespace[t[1]] except KeyError: pass def do_import(self, t): """ Default handling of a #import line. """ # XXX finish this -- maybe borrow/share logic from do_include()...? pass def do_include(self, t): """ Default handling of a #include line. """ t = self.resolve_include(t) include_file = self.find_include_file(t) if include_file: #print("include_file =", include_file) self.result.append(include_file) contents = self.read_file(include_file) new_tuples = [('scons_current_file', include_file)] + \ self.tupleize(contents) + \ [('scons_current_file', self.current_file)] self.tuples[:] = new_tuples + self.tuples # Date: Tue, 22 Nov 2005 20:26:09 -0500 # From: Stefan Seefeld # # By the way, #include_next is not the same as #include. The difference # being that #include_next starts its search in the path following the # path that let to the including file. In other words, if your system # include paths are ['/foo', '/bar'], and you are looking at a header # '/foo/baz.h', it might issue an '#include_next ' which would # correctly resolve to '/bar/baz.h' (if that exists), but *not* see # '/foo/baz.h' again. See http://www.delorie.com/gnu/docs/gcc/cpp_11.html # for more reasoning. # # I have no idea in what context 'import' might be used. # XXX is #include_next really the same as #include ? do_include_next = do_include # Utility methods for handling resolution of include files. def resolve_include(self, t): """Resolve a tuple-ized #include line. This handles recursive expansion of values without "" or <> surrounding the name until an initial " or < is found, to handle #include FILE where FILE is a #define somewhere else.""" s = t[1] while not s[0] in '<"': #print("s =", s) try: s = self.cpp_namespace[s] except KeyError: m = function_name.search(s) s = self.cpp_namespace[m.group(1)] if callable(s): args = function_arg_separator.split(m.group(2)) s = s(*args) if not s: return None return (t[0], s[0], s[1:-1]) def all_include(self, t): """ """ self.result.append(self.resolve_include(t)) class DumbPreProcessor(PreProcessor): """A preprocessor that ignores all #if/#elif/#else/#endif directives and just reports back *all* of the #include files (like the classic SCons scanner did). This is functionally equivalent to using a regular expression to find all of the #include lines, only slower. It exists mainly as an example of how the main PreProcessor class can be sub-classed to tailor its behavior. """ def __init__(self, *args, **kw): PreProcessor.__init__(self, *args, **kw) d = self.default_table for func in ['if', 'elif', 'else', 'endif', 'ifdef', 'ifndef']: d[func] = d[func] = self.do_nothing del __revision__ # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Taskmaster.py0000664000175000017500000012112413160023041021224 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function import sys __doc__ = """ Generic Taskmaster module for the SCons build engine. ===================================================== This module contains the primary interface(s) between a wrapping user interface and the SCons build engine. There are two key classes here: Taskmaster ---------- This is the main engine for walking the dependency graph and calling things to decide what does or doesn't need to be built. Task ---- This is the base class for allowing a wrapping interface to decide what does or doesn't actually need to be done. The intention is for a wrapping interface to subclass this as appropriate for different types of behavior it may need. The canonical example is the SCons native Python interface, which has Task subclasses that handle its specific behavior, like printing "'foo' is up to date" when a top-level target doesn't need to be built, and handling the -c option by removing targets as its "build" action. There is also a separate subclass for suppressing this output when the -q option is used. The Taskmaster instantiates a Task object for each (set of) target(s) that it decides need to be evaluated and/or built. """ __revision__ = "src/engine/SCons/Taskmaster.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from itertools import chain import operator import sys import traceback import SCons.Errors import SCons.Node import SCons.Warnings StateString = SCons.Node.StateString NODE_NO_STATE = SCons.Node.no_state NODE_PENDING = SCons.Node.pending NODE_EXECUTING = SCons.Node.executing NODE_UP_TO_DATE = SCons.Node.up_to_date NODE_EXECUTED = SCons.Node.executed NODE_FAILED = SCons.Node.failed print_prepare = 0 # set by option --debug=prepare # A subsystem for recording stats about how different Nodes are handled by # the main Taskmaster loop. There's no external control here (no need for # a --debug= option); enable it by changing the value of CollectStats. CollectStats = None class Stats(object): """ A simple class for holding statistics about the disposition of a Node by the Taskmaster. If we're collecting statistics, each Node processed by the Taskmaster gets one of these attached, in which case the Taskmaster records its decision each time it processes the Node. (Ideally, that's just once per Node.) """ def __init__(self): """ Instantiates a Taskmaster.Stats object, initializing all appropriate counters to zero. """ self.considered = 0 self.already_handled = 0 self.problem = 0 self.child_failed = 0 self.not_built = 0 self.side_effects = 0 self.build = 0 StatsNodes = [] fmt = "%(considered)3d "\ "%(already_handled)3d " \ "%(problem)3d " \ "%(child_failed)3d " \ "%(not_built)3d " \ "%(side_effects)3d " \ "%(build)3d " def dump_stats(): for n in sorted(StatsNodes, key=lambda a: str(a)): print((fmt % n.attributes.stats.__dict__) + str(n)) class Task(object): """ Default SCons build engine task. This controls the interaction of the actual building of node and the rest of the engine. This is expected to handle all of the normally-customizable aspects of controlling a build, so any given application *should* be able to do what it wants by sub-classing this class and overriding methods as appropriate. If an application needs to customize something by sub-classing Taskmaster (or some other build engine class), we should first try to migrate that functionality into this class. Note that it's generally a good idea for sub-classes to call these methods explicitly to update state, etc., rather than roll their own interaction with Taskmaster from scratch. """ def __init__(self, tm, targets, top, node): self.tm = tm self.targets = targets self.top = top self.node = node self.exc_clear() def trace_message(self, method, node, description='node'): fmt = '%-20s %s %s\n' return fmt % (method + ':', description, self.tm.trace_node(node)) def display(self, message): """ Hook to allow the calling interface to display a message. This hook gets called as part of preparing a task for execution (that is, a Node to be built). As part of figuring out what Node should be built next, the actual target list may be altered, along with a message describing the alteration. The calling interface can subclass Task and provide a concrete implementation of this method to see those messages. """ pass def prepare(self): """ Called just before the task is executed. This is mainly intended to give the target Nodes a chance to unlink underlying files and make all necessary directories before the Action is actually called to build the targets. """ global print_prepare T = self.tm.trace if T: T.write(self.trace_message(u'Task.prepare()', self.node)) # Now that it's the appropriate time, give the TaskMaster a # chance to raise any exceptions it encountered while preparing # this task. self.exception_raise() if self.tm.message: self.display(self.tm.message) self.tm.message = None # Let the targets take care of any necessary preparations. # This includes verifying that all of the necessary sources # and dependencies exist, removing the target file(s), etc. # # As of April 2008, the get_executor().prepare() method makes # sure that all of the aggregate sources necessary to build this # Task's target(s) exist in one up-front check. The individual # target t.prepare() methods check that each target's explicit # or implicit dependencies exists, and also initialize the # .sconsign info. executor = self.targets[0].get_executor() if executor is None: return executor.prepare() for t in executor.get_action_targets(): if print_prepare: print("Preparing target %s..."%t) for s in t.side_effects: print("...with side-effect %s..."%s) t.prepare() for s in t.side_effects: if print_prepare: print("...Preparing side-effect %s..."%s) s.prepare() def get_target(self): """Fetch the target being built or updated by this task. """ return self.node def needs_execute(self): # TODO(deprecate): "return True" is the old default behavior; # change it to NotImplementedError (after running through the # Deprecation Cycle) so the desired behavior is explicitly # determined by which concrete subclass is used. #raise NotImplementedError msg = ('Taskmaster.Task is an abstract base class; instead of\n' '\tusing it directly, ' 'derive from it and override the abstract methods.') SCons.Warnings.warn(SCons.Warnings.TaskmasterNeedsExecuteWarning, msg) return True def execute(self): """ Called to execute the task. This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in prepare(), executed() or failed(). """ T = self.tm.trace if T: T.write(self.trace_message(u'Task.execute()', self.node)) try: cached_targets = [] for t in self.targets: if not t.retrieve_from_cache(): break cached_targets.append(t) if len(cached_targets) < len(self.targets): # Remove targets before building. It's possible that we # partially retrieved targets from the cache, leaving # them in read-only mode. That might cause the command # to fail. # for t in cached_targets: try: t.fs.unlink(t.get_internal_path()) except (IOError, OSError): pass self.targets[0].build() else: for t in cached_targets: t.cached = 1 except SystemExit: exc_value = sys.exc_info()[1] raise SCons.Errors.ExplicitExit(self.targets[0], exc_value.code) except SCons.Errors.UserError: raise except SCons.Errors.BuildError: raise except Exception as e: buildError = SCons.Errors.convert_to_BuildError(e) buildError.node = self.targets[0] buildError.exc_info = sys.exc_info() raise buildError def executed_without_callbacks(self): """ Called when the task has been successfully executed and the Taskmaster instance doesn't want to call the Node's callback methods. """ T = self.tm.trace if T: T.write(self.trace_message('Task.executed_without_callbacks()', self.node)) for t in self.targets: if t.get_state() == NODE_EXECUTING: for side_effect in t.side_effects: side_effect.set_state(NODE_NO_STATE) t.set_state(NODE_EXECUTED) def executed_with_callbacks(self): """ Called when the task has been successfully executed and the Taskmaster instance wants to call the Node's callback methods. This may have been a do-nothing operation (to preserve build order), so we must check the node's state before deciding whether it was "built", in which case we call the appropriate Node method. In any event, we always call "visited()", which will handle any post-visit actions that must take place regardless of whether or not the target was an actual built target or a source Node. """ global print_prepare T = self.tm.trace if T: T.write(self.trace_message('Task.executed_with_callbacks()', self.node)) for t in self.targets: if t.get_state() == NODE_EXECUTING: for side_effect in t.side_effects: side_effect.set_state(NODE_NO_STATE) t.set_state(NODE_EXECUTED) if not t.cached: t.push_to_cache() t.built() t.visited() if (not print_prepare and (not hasattr(self, 'options') or not self.options.debug_includes)): t.release_target_info() else: t.visited() executed = executed_with_callbacks def failed(self): """ Default action when a task fails: stop the build. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure(). """ self.fail_stop() def fail_stop(self): """ Explicit stop-the-build failure. This sets failure status on the target nodes and all of their dependent parent nodes. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure(). """ T = self.tm.trace if T: T.write(self.trace_message('Task.failed_stop()', self.node)) # Invoke will_not_build() to clean-up the pending children # list. self.tm.will_not_build(self.targets, lambda n: n.set_state(NODE_FAILED)) # Tell the taskmaster to not start any new tasks self.tm.stop() # We're stopping because of a build failure, but give the # calling Task class a chance to postprocess() the top-level # target under which the build failure occurred. self.targets = [self.tm.current_top] self.top = 1 def fail_continue(self): """ Explicit continue-the-build failure. This sets failure status on the target nodes and all of their dependent parent nodes. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure(). """ T = self.tm.trace if T: T.write(self.trace_message('Task.failed_continue()', self.node)) self.tm.will_not_build(self.targets, lambda n: n.set_state(NODE_FAILED)) def make_ready_all(self): """ Marks all targets in a task ready for execution. This is used when the interface needs every target Node to be visited--the canonical example being the "scons -c" option. """ T = self.tm.trace if T: T.write(self.trace_message('Task.make_ready_all()', self.node)) self.out_of_date = self.targets[:] for t in self.targets: t.disambiguate().set_state(NODE_EXECUTING) for s in t.side_effects: # add disambiguate here to mirror the call on targets above s.disambiguate().set_state(NODE_EXECUTING) def make_ready_current(self): """ Marks all targets in a task ready for execution if any target is not current. This is the default behavior for building only what's necessary. """ global print_prepare T = self.tm.trace if T: T.write(self.trace_message(u'Task.make_ready_current()', self.node)) self.out_of_date = [] needs_executing = False for t in self.targets: try: t.disambiguate().make_ready() is_up_to_date = not t.has_builder() or \ (not t.always_build and t.is_up_to_date()) except EnvironmentError as e: raise SCons.Errors.BuildError(node=t, errstr=e.strerror, filename=e.filename) if not is_up_to_date: self.out_of_date.append(t) needs_executing = True if needs_executing: for t in self.targets: t.set_state(NODE_EXECUTING) for s in t.side_effects: # add disambiguate here to mirror the call on targets in first loop above s.disambiguate().set_state(NODE_EXECUTING) else: for t in self.targets: # We must invoke visited() to ensure that the node # information has been computed before allowing the # parent nodes to execute. (That could occur in a # parallel build...) t.visited() t.set_state(NODE_UP_TO_DATE) if (not print_prepare and (not hasattr(self, 'options') or not self.options.debug_includes)): t.release_target_info() make_ready = make_ready_current def postprocess(self): """ Post-processes a task after it's been executed. This examines all the targets just built (or not, we don't care if the build was successful, or even if there was no build because everything was up-to-date) to see if they have any waiting parent Nodes, or Nodes waiting on a common side effect, that can be put back on the candidates list. """ T = self.tm.trace if T: T.write(self.trace_message(u'Task.postprocess()', self.node)) # We may have built multiple targets, some of which may have # common parents waiting for this build. Count up how many # targets each parent was waiting for so we can subtract the # values later, and so we *don't* put waiting side-effect Nodes # back on the candidates list if the Node is also a waiting # parent. targets = set(self.targets) pending_children = self.tm.pending_children parents = {} for t in targets: # A node can only be in the pending_children set if it has # some waiting_parents. if t.waiting_parents: if T: T.write(self.trace_message(u'Task.postprocess()', t, 'removing')) pending_children.discard(t) for p in t.waiting_parents: parents[p] = parents.get(p, 0) + 1 for t in targets: if t.side_effects is not None: for s in t.side_effects: if s.get_state() == NODE_EXECUTING: s.set_state(NODE_NO_STATE) for p in s.waiting_parents: parents[p] = parents.get(p, 0) + 1 for p in s.waiting_s_e: if p.ref_count == 0: self.tm.candidates.append(p) for p, subtract in parents.items(): p.ref_count = p.ref_count - subtract if T: T.write(self.trace_message(u'Task.postprocess()', p, 'adjusted parent ref count')) if p.ref_count == 0: self.tm.candidates.append(p) for t in targets: t.postprocess() # Exception handling subsystem. # # Exceptions that occur while walking the DAG or examining Nodes # must be raised, but must be raised at an appropriate time and in # a controlled manner so we can, if necessary, recover gracefully, # possibly write out signature information for Nodes we've updated, # etc. This is done by having the Taskmaster tell us about the # exception, and letting def exc_info(self): """ Returns info about a recorded exception. """ return self.exception def exc_clear(self): """ Clears any recorded exception. This also changes the "exception_raise" attribute to point to the appropriate do-nothing method. """ self.exception = (None, None, None) self.exception_raise = self._no_exception_to_raise def exception_set(self, exception=None): """ Records an exception to be raised at the appropriate time. This also changes the "exception_raise" attribute to point to the method that will, in fact """ if not exception: exception = sys.exc_info() self.exception = exception self.exception_raise = self._exception_raise def _no_exception_to_raise(self): pass def _exception_raise(self): """ Raises a pending exception that was recorded while getting a Task ready for execution. """ exc = self.exc_info()[:] try: exc_type, exc_value, exc_traceback = exc except ValueError: exc_type, exc_value = exc exc_traceback = None # raise exc_type(exc_value).with_traceback(exc_traceback) if sys.version_info[0] == 2: exec("raise exc_type, exc_value, exc_traceback") else: # sys.version_info[0] == 3: if isinstance(exc_value, Exception): #hasattr(exc_value, 'with_traceback'): # If exc_value is an exception, then just reraise exec("raise exc_value.with_traceback(exc_traceback)") else: # else we'll create an exception using the value and raise that exec("raise exc_type(exc_value).with_traceback(exc_traceback)") # raise e.__class__, e.__class__(e), sys.exc_info()[2] # exec("raise exc_type(exc_value).with_traceback(exc_traceback)") class AlwaysTask(Task): def needs_execute(self): """ Always returns True (indicating this Task should always be executed). Subclasses that need this behavior (as opposed to the default of only executing Nodes that are out of date w.r.t. their dependencies) can use this as follows: class MyTaskSubclass(SCons.Taskmaster.Task): needs_execute = SCons.Taskmaster.Task.execute_always """ return True class OutOfDateTask(Task): def needs_execute(self): """ Returns True (indicating this Task should be executed) if this Task's target state indicates it needs executing, which has already been determined by an earlier up-to-date check. """ return self.targets[0].get_state() == SCons.Node.executing def find_cycle(stack, visited): if stack[-1] in visited: return None visited.add(stack[-1]) for n in stack[-1].waiting_parents: stack.append(n) if stack[0] == stack[-1]: return stack if find_cycle(stack, visited): return stack stack.pop() return None class Taskmaster(object): """ The Taskmaster for walking the dependency DAG. """ def __init__(self, targets=[], tasker=None, order=None, trace=None): self.original_top = targets self.top_targets_left = targets[:] self.top_targets_left.reverse() self.candidates = [] if tasker is None: tasker = OutOfDateTask self.tasker = tasker if not order: order = lambda l: l self.order = order self.message = None self.trace = trace self.next_candidate = self.find_next_candidate self.pending_children = set() def find_next_candidate(self): """ Returns the next candidate Node for (potential) evaluation. The candidate list (really a stack) initially consists of all of the top-level (command line) targets provided when the Taskmaster was initialized. While we walk the DAG, visiting Nodes, all the children that haven't finished processing get pushed on to the candidate list. Each child can then be popped and examined in turn for whether *their* children are all up-to-date, in which case a Task will be created for their actual evaluation and potential building. Here is where we also allow candidate Nodes to alter the list of Nodes that should be examined. This is used, for example, when invoking SCons in a source directory. A source directory Node can return its corresponding build directory Node, essentially saying, "Hey, you really need to build this thing over here instead." """ try: return self.candidates.pop() except IndexError: pass try: node = self.top_targets_left.pop() except IndexError: return None self.current_top = node alt, message = node.alter_targets() if alt: self.message = message self.candidates.append(node) self.candidates.extend(self.order(alt)) node = self.candidates.pop() return node def no_next_candidate(self): """ Stops Taskmaster processing by not returning a next candidate. Note that we have to clean-up the Taskmaster candidate list because the cycle detection depends on the fact all nodes have been processed somehow. """ while self.candidates: candidates = self.candidates self.candidates = [] self.will_not_build(candidates) return None def _validate_pending_children(self): """ Validate the content of the pending_children set. Assert if an internal error is found. This function is used strictly for debugging the taskmaster by checking that no invariants are violated. It is not used in normal operation. The pending_children set is used to detect cycles in the dependency graph. We call a "pending child" a child that is found in the "pending" state when checking the dependencies of its parent node. A pending child can occur when the Taskmaster completes a loop through a cycle. For example, let's imagine a graph made of three nodes (A, B and C) making a cycle. The evaluation starts at node A. The Taskmaster first considers whether node A's child B is up-to-date. Then, recursively, node B needs to check whether node C is up-to-date. This leaves us with a dependency graph looking like:: Next candidate \ \ Node A (Pending) --> Node B(Pending) --> Node C (NoState) ^ | | | +-------------------------------------+ Now, when the Taskmaster examines the Node C's child Node A, it finds that Node A is in the "pending" state. Therefore, Node A is a pending child of node C. Pending children indicate that the Taskmaster has potentially loop back through a cycle. We say potentially because it could also occur when a DAG is evaluated in parallel. For example, consider the following graph:: Node A (Pending) --> Node B(Pending) --> Node C (Pending) --> ... | ^ | | +----------> Node D (NoState) --------+ / Next candidate / The Taskmaster first evaluates the nodes A, B, and C and starts building some children of node C. Assuming, that the maximum parallel level has not been reached, the Taskmaster will examine Node D. It will find that Node C is a pending child of Node D. In summary, evaluating a graph with a cycle will always involve a pending child at one point. A pending child might indicate either a cycle or a diamond-shaped DAG. Only a fraction of the nodes ends-up being a "pending child" of another node. This keeps the pending_children set small in practice. We can differentiate between the two cases if we wait until the end of the build. At this point, all the pending children nodes due to a diamond-shaped DAG will have been properly built (or will have failed to build). But, the pending children involved in a cycle will still be in the pending state. The taskmaster removes nodes from the pending_children set as soon as a pending_children node moves out of the pending state. This also helps to keep the pending_children set small. """ for n in self.pending_children: assert n.state in (NODE_PENDING, NODE_EXECUTING), \ (str(n), StateString[n.state]) assert len(n.waiting_parents) != 0, (str(n), len(n.waiting_parents)) for p in n.waiting_parents: assert p.ref_count > 0, (str(n), str(p), p.ref_count) def trace_message(self, message): return 'Taskmaster: %s\n' % message def trace_node(self, node): return '<%-10s %-3s %s>' % (StateString[node.get_state()], node.ref_count, repr(str(node))) def _find_next_ready_node(self): """ Finds the next node that is ready to be built. This is *the* main guts of the DAG walk. We loop through the list of candidates, looking for something that has no un-built children (i.e., that is a leaf Node or has dependencies that are all leaf Nodes or up-to-date). Candidate Nodes are re-scanned (both the target Node itself and its sources, which are always scanned in the context of a given target) to discover implicit dependencies. A Node that must wait for some children to be built will be put back on the candidates list after the children have finished building. A Node that has been put back on the candidates list in this way may have itself (or its sources) re-scanned, in order to handle generated header files (e.g.) and the implicit dependencies therein. Note that this method does not do any signature calculation or up-to-date check itself. All of that is handled by the Task class. This is purely concerned with the dependency graph walk. """ self.ready_exc = None T = self.trace if T: T.write(SCons.Util.UnicodeType('\n') + self.trace_message('Looking for a node to evaluate')) while True: node = self.next_candidate() if node is None: if T: T.write(self.trace_message('No candidate anymore.') + u'\n') return None node = node.disambiguate() state = node.get_state() # For debugging only: # # try: # self._validate_pending_children() # except: # self.ready_exc = sys.exc_info() # return node if CollectStats: if not hasattr(node.attributes, 'stats'): node.attributes.stats = Stats() StatsNodes.append(node) S = node.attributes.stats S.considered = S.considered + 1 else: S = None if T: T.write(self.trace_message(u' Considering node %s and its children:' % self.trace_node(node))) if state == NODE_NO_STATE: # Mark this node as being on the execution stack: node.set_state(NODE_PENDING) elif state > NODE_PENDING: # Skip this node if it has already been evaluated: if S: S.already_handled = S.already_handled + 1 if T: T.write(self.trace_message(u' already handled (executed)')) continue executor = node.get_executor() try: children = executor.get_all_children() except SystemExit: exc_value = sys.exc_info()[1] e = SCons.Errors.ExplicitExit(node, exc_value.code) self.ready_exc = (SCons.Errors.ExplicitExit, e) if T: T.write(self.trace_message(' SystemExit')) return node except Exception as e: # We had a problem just trying to figure out the # children (like a child couldn't be linked in to a # VariantDir, or a Scanner threw something). Arrange to # raise the exception when the Task is "executed." self.ready_exc = sys.exc_info() if S: S.problem = S.problem + 1 if T: T.write(self.trace_message(' exception %s while scanning children.\n' % e)) return node children_not_visited = [] children_pending = set() children_not_ready = [] children_failed = False for child in chain(executor.get_all_prerequisites(), children): childstate = child.get_state() if T: T.write(self.trace_message(u' ' + self.trace_node(child))) if childstate == NODE_NO_STATE: children_not_visited.append(child) elif childstate == NODE_PENDING: children_pending.add(child) elif childstate == NODE_FAILED: children_failed = True if childstate <= NODE_EXECUTING: children_not_ready.append(child) # These nodes have not even been visited yet. Add # them to the list so that on some next pass we can # take a stab at evaluating them (or their children). children_not_visited.reverse() self.candidates.extend(self.order(children_not_visited)) # if T and children_not_visited: # T.write(self.trace_message(' adding to candidates: %s' % map(str, children_not_visited))) # T.write(self.trace_message(' candidates now: %s\n' % map(str, self.candidates))) # Skip this node if any of its children have failed. # # This catches the case where we're descending a top-level # target and one of our children failed while trying to be # built by a *previous* descent of an earlier top-level # target. # # It can also occur if a node is reused in multiple # targets. One first descends though the one of the # target, the next time occurs through the other target. # # Note that we can only have failed_children if the # --keep-going flag was used, because without it the build # will stop before diving in the other branch. # # Note that even if one of the children fails, we still # added the other children to the list of candidate nodes # to keep on building (--keep-going). if children_failed: for n in executor.get_action_targets(): n.set_state(NODE_FAILED) if S: S.child_failed = S.child_failed + 1 if T: T.write(self.trace_message('****** %s\n' % self.trace_node(node))) continue if children_not_ready: for child in children_not_ready: # We're waiting on one or more derived targets # that have not yet finished building. if S: S.not_built = S.not_built + 1 # Add this node to the waiting parents lists of # anything we're waiting on, with a reference # count so we can be put back on the list for # re-evaluation when they've all finished. node.ref_count = node.ref_count + child.add_to_waiting_parents(node) if T: T.write(self.trace_message(u' adjusted ref count: %s, child %s' % (self.trace_node(node), repr(str(child))))) if T: for pc in children_pending: T.write(self.trace_message(' adding %s to the pending children set\n' % self.trace_node(pc))) self.pending_children = self.pending_children | children_pending continue # Skip this node if it has side-effects that are # currently being built: wait_side_effects = False for se in executor.get_action_side_effects(): if se.get_state() == NODE_EXECUTING: se.add_to_waiting_s_e(node) wait_side_effects = True if wait_side_effects: if S: S.side_effects = S.side_effects + 1 continue # The default when we've gotten through all of the checks above: # this node is ready to be built. if S: S.build = S.build + 1 if T: T.write(self.trace_message(u'Evaluating %s\n' % self.trace_node(node))) # For debugging only: # # try: # self._validate_pending_children() # except: # self.ready_exc = sys.exc_info() # return node return node return None def next_task(self): """ Returns the next task to be executed. This simply asks for the next Node to be evaluated, and then wraps it in the specific Task subclass with which we were initialized. """ node = self._find_next_ready_node() if node is None: return None executor = node.get_executor() if executor is None: return None tlist = executor.get_all_targets() task = self.tasker(self, tlist, node in self.original_top, node) try: task.make_ready() except Exception as e : # We had a problem just trying to get this task ready (like # a child couldn't be linked to a VariantDir when deciding # whether this node is current). Arrange to raise the # exception when the Task is "executed." self.ready_exc = sys.exc_info() if self.ready_exc: task.exception_set(self.ready_exc) self.ready_exc = None return task def will_not_build(self, nodes, node_func=lambda n: None): """ Perform clean-up about nodes that will never be built. Invokes a user defined function on all of these nodes (including all of their parents). """ T = self.trace pending_children = self.pending_children to_visit = set(nodes) pending_children = pending_children - to_visit if T: for n in nodes: T.write(self.trace_message(' removing node %s from the pending children set\n' % self.trace_node(n))) try: while len(to_visit): node = to_visit.pop() node_func(node) # Prune recursion by flushing the waiting children # list immediately. parents = node.waiting_parents node.waiting_parents = set() to_visit = to_visit | parents pending_children = pending_children - parents for p in parents: p.ref_count = p.ref_count - 1 if T: T.write(self.trace_message(' removing parent %s from the pending children set\n' % self.trace_node(p))) except KeyError: # The container to_visit has been emptied. pass # We have the stick back the pending_children list into the # taskmaster because the python 1.5.2 compatibility does not # allow us to use in-place updates self.pending_children = pending_children def stop(self): """ Stops the current build completely. """ self.next_candidate = self.no_next_candidate def cleanup(self): """ Check for dependency cycles. """ if not self.pending_children: return nclist = [(n, find_cycle([n], set())) for n in self.pending_children] genuine_cycles = [ node for node,cycle in nclist if cycle or node.get_state() != NODE_EXECUTED ] if not genuine_cycles: # All of the "cycles" found were single nodes in EXECUTED state, # which is to say, they really weren't cycles. Just return. return desc = 'Found dependency cycle(s):\n' for node, cycle in nclist: if cycle: desc = desc + " " + " -> ".join(map(str, cycle)) + "\n" else: desc = desc + \ " Internal Error: no cycle found for node %s (%s) in state %s\n" % \ (node, repr(node), StateString[node.get_state()]) raise SCons.Errors.UserError(desc) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/BuilderTests.py0000664000175000017500000020234213160023040021520 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/BuilderTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat # Define a null function for use as a builder action. # Where this is defined in the file seems to affect its # byte-code contents, so try to minimize changes by # defining it here, before we even import anything. def Func(): pass import collections import io import os.path import re import sys import unittest import TestCmd import TestUnit import SCons.Action import SCons.Builder import SCons.Environment import SCons.Errors import SCons.Subst import SCons.Util sys.stdout = io.StringIO() # Initial setup of the common environment for all tests, # a temporary working directory containing a # script for writing arguments to an output file. # # We don't do this as a setUp() method because it's # unnecessary to create a separate directory and script # for each test, they can just use the one. test = TestCmd.TestCmd(workdir = '') outfile = test.workpath('outfile') outfile2 = test.workpath('outfile2') infile = test.workpath('infile') test.write(infile, "infile\n") show_string = None scons_env = SCons.Environment.Environment() env_arg2nodes_called = None class Environment(object): def __init__(self, **kw): self.d = {} self.d['SHELL'] = scons_env['SHELL'] self.d['SPAWN'] = scons_env['SPAWN'] self.d['ESCAPE'] = scons_env['ESCAPE'] for k, v in kw.items(): self.d[k] = v global env_arg2nodes_called env_arg2nodes_called = None self.scanner = None self.fs = SCons.Node.FS.FS() def subst(self, s): if not SCons.Util.is_String(s): return s def substitute(m, d=self.d): return d.get(m.group(1), '') return re.sub(r'\$(\w+)', substitute, s) def subst_target_source(self, string, raw=0, target=None, source=None, dict=None, conv=None): return SCons.Subst.scons_subst(string, self, raw, target, source, dict, conv) def subst_list(self, string, raw=0, target=None, source=None, conv=None): return SCons.Subst.scons_subst_list(string, self, raw, target, source, {}, {}, conv) def arg2nodes(self, args, factory, **kw): global env_arg2nodes_called env_arg2nodes_called = 1 if not SCons.Util.is_List(args): args = [args] list = [] for a in args: if SCons.Util.is_String(a): a = factory(self.subst(a)) list.append(a) return list def get_factory(self, factory): return factory or self.fs.File def get_scanner(self, ext): return self.scanner def Dictionary(self): return {} def autogenerate(self, dir=''): return {} def __setitem__(self, item, var): self.d[item] = var def __getitem__(self, item): return self.d[item] def __contains__(self, item): return self.d.__contains__(item) def has_key(self, item): return item in self.d def keys(self): return list(self.d.keys()) def get(self, key, value=None): return self.d.get(key, value) def Override(self, overrides): env = Environment(**self.d) env.d.update(overrides) env.scanner = self.scanner return env def _update(self, dict): self.d.update(dict) def items(self): return list(self.d.items()) def sig_dict(self): d = {} for k,v in self.items(): d[k] = v d['TARGETS'] = ['__t1__', '__t2__', '__t3__', '__t4__', '__t5__', '__t6__'] d['TARGET'] = d['TARGETS'][0] d['SOURCES'] = ['__s1__', '__s2__', '__s3__', '__s4__', '__s5__', '__s6__'] d['SOURCE'] = d['SOURCES'][0] return d def __eq__(self, other): return self.scanner == other.scanner or self.d == other.d class MyAction(object): def __init__(self, action): self.action = action def __call__(self, *args, **kw): pass def get_executor(self, env, overrides, tlist, slist, executor_kw): return ['executor'] + [self.action] class MyNode_without_target_from_source(object): def __init__(self, name): self.name = name self.sources = [] self.builder = None self.is_explicit = None self.side_effect = 0 def get_suffix(self): return os.path.splitext(self.name)[1] def disambiguate(self): return self def __str__(self): return self.name def builder_set(self, builder): self.builder = builder def has_builder(self): return not self.builder is None def set_explicit(self, is_explicit): self.is_explicit = is_explicit def has_explicit_builder(self): return self.is_explicit def env_set(self, env, safe=0): self.env = env def add_source(self, source): self.sources.extend(source) def scanner_key(self): return self.name def is_derived(self): return self.has_builder() def generate_build_env(self, env): return env def get_build_env(self): return self.executor.get_build_env() def set_executor(self, executor): self.executor = executor def get_executor(self, create=1): return self.executor class MyNode(MyNode_without_target_from_source): def target_from_source(self, prefix, suffix, stripext): return MyNode(prefix + stripext(str(self))[0] + suffix) class BuilderTestCase(unittest.TestCase): def test__init__(self): """Test simple Builder creation """ builder = SCons.Builder.Builder(action="foo") assert not builder is None, builder builder = SCons.Builder.Builder(action="foo", OVERRIDE='x') x = builder.overrides['OVERRIDE'] assert x == 'x', x def test__nonzero__(self): """Test a builder raising an exception when __nonzero__ is called """ builder = SCons.Builder.Builder(action="foo") exc_caught = None try: builder.__nonzero__() except SCons.Errors.InternalError: exc_caught = 1 assert exc_caught, "did not catch expected InternalError exception" class Node(object): pass n = Node() n.builder = builder exc_caught = None try: if n.builder: pass except SCons.Errors.InternalError: exc_caught = 1 assert exc_caught, "did not catch expected InternalError exception" def test__call__(self): """Test calling a builder to establish source dependencies """ env = Environment() builder = SCons.Builder.Builder(action="foo", target_factory=MyNode, source_factory=MyNode) tgt = builder(env, source=[]) assert tgt == [], tgt n1 = MyNode("n1") n2 = MyNode("n2") builder(env, target = n1, source = n2) assert env_arg2nodes_called assert n1.env == env, n1.env assert n1.builder == builder, n1.builder assert n1.sources == [n2], n1.sources assert n1.executor, "no executor found" assert not hasattr(n2, 'env') l = [1] ul = collections.UserList([2]) try: l.extend(ul) except TypeError: def mystr(l): return str(list(map(str, l))) else: mystr = str nnn1 = MyNode("nnn1") nnn2 = MyNode("nnn2") tlist = builder(env, target = [nnn1, nnn2], source = []) s = mystr(tlist) assert s == "['nnn1', 'nnn2']", s l = list(map(str, tlist)) assert l == ['nnn1', 'nnn2'], l tlist = builder(env, target = 'n3', source = 'n4') s = mystr(tlist) assert s == "['n3']", s target = tlist[0] l = list(map(str, tlist)) assert l == ['n3'], l assert target.name == 'n3' assert target.sources[0].name == 'n4' tlist = builder(env, target = 'n4 n5', source = ['n6 n7']) s = mystr(tlist) assert s == "['n4 n5']", s l = list(map(str, tlist)) assert l == ['n4 n5'], l target = tlist[0] assert target.name == 'n4 n5' assert target.sources[0].name == 'n6 n7' tlist = builder(env, target = ['n8 n9'], source = 'n10 n11') s = mystr(tlist) assert s == "['n8 n9']", s l = list(map(str, tlist)) assert l == ['n8 n9'], l target = tlist[0] assert target.name == 'n8 n9' assert target.sources[0].name == 'n10 n11' # A test to be uncommented when we freeze the environment # as part of calling the builder. #env1 = Environment(VAR='foo') #target = builder(env1, target = 'n12', source = 'n13') #env1['VAR'] = 'bar' #be = target.get_build_env() #assert be['VAR'] == 'foo', be['VAR'] try: unicode except NameError: uni = str else: uni = unicode target = builder(env, target = uni('n12 n13'), source = [uni('n14 n15')])[0] assert target.name == uni('n12 n13') assert target.sources[0].name == uni('n14 n15') target = builder(env, target = [uni('n16 n17')], source = uni('n18 n19'))[0] assert target.name == uni('n16 n17') assert target.sources[0].name == uni('n18 n19') n20 = MyNode_without_target_from_source('n20') flag = 0 try: target = builder(env, None, source=n20) except SCons.Errors.UserError as e: flag = 1 assert flag, "UserError should be thrown if a source node can't create a target." builder = SCons.Builder.Builder(action="foo", target_factory=MyNode, source_factory=MyNode, prefix='p-', suffix='.s') target = builder(env, None, source='n21')[0] assert target.name == 'p-n21.s', target builder = SCons.Builder.Builder(misspelled_action="foo", suffix = '.s') try: builder(env, target = 'n22', source = 'n22') except SCons.Errors.UserError as e: pass else: raise Exception("Did not catch expected UserError.") builder = SCons.Builder.Builder(action="foo") target = builder(env, None, source='n22', srcdir='src_dir')[0] p = target.sources[0].get_internal_path() assert p == os.path.join('src_dir', 'n22'), p def test_mistaken_variables(self): """Test keyword arguments that are often mistakes """ import SCons.Warnings env = Environment() builder = SCons.Builder.Builder(action="foo") save_warn = SCons.Warnings.warn warned = [] def my_warn(exception, warning, warned=warned): warned.append(warning) SCons.Warnings.warn = my_warn try: target = builder(env, 'mistaken1', sources='mistaken1.c') assert warned == ["Did you mean to use `source' instead of `sources'?"], warned del warned[:] target = builder(env, 'mistaken2', targets='mistaken2.c') assert warned == ["Did you mean to use `target' instead of `targets'?"], warned del warned[:] target = builder(env, 'mistaken3', targets='mistaken3', sources='mistaken3.c') assert "Did you mean to use `source' instead of `sources'?" in warned, warned assert "Did you mean to use `target' instead of `targets'?" in warned, warned del warned[:] finally: SCons.Warnings.warn = save_warn def test_action(self): """Test Builder creation Verify that we can retrieve the supplied action attribute. """ builder = SCons.Builder.Builder(action="foo") assert builder.action.cmd_list == "foo" def func(): pass builder = SCons.Builder.Builder(action=func) assert isinstance(builder.action, SCons.Action.FunctionAction) # Preserve the following so that the baseline test will fail. # Remove it in favor of the previous test at some convenient # point in the future. assert builder.action.execfunction == func def test_generator(self): """Test Builder creation given a generator function.""" def generator(): pass builder = SCons.Builder.Builder(generator=generator) assert builder.action.generator == generator def test_get_name(self): """Test the get_name() method """ def test_cmp(self): """Test simple comparisons of Builder objects """ b1 = SCons.Builder.Builder(src_suffix = '.o') b2 = SCons.Builder.Builder(src_suffix = '.o') assert b1 == b2 b3 = SCons.Builder.Builder(src_suffix = '.x') assert b1 != b3 assert b2 != b3 def test_target_factory(self): """Test a Builder that creates target nodes of a specified class """ class Foo(object): pass def FooFactory(target): global Foo return Foo(target) builder = SCons.Builder.Builder(target_factory = FooFactory) assert builder.target_factory is FooFactory assert not builder.source_factory is FooFactory def test_source_factory(self): """Test a Builder that creates source nodes of a specified class """ class Foo(object): pass def FooFactory(source): global Foo return Foo(source) builder = SCons.Builder.Builder(source_factory = FooFactory) assert not builder.target_factory is FooFactory assert builder.source_factory is FooFactory def test_splitext(self): """Test the splitext() method attached to a Builder.""" b = SCons.Builder.Builder() assert b.splitext('foo') == ('foo','') assert b.splitext('foo.bar') == ('foo','.bar') assert b.splitext(os.path.join('foo.bar', 'blat')) == (os.path.join('foo.bar', 'blat'),'') class MyBuilder(SCons.Builder.BuilderBase): def splitext(self, path): return "called splitext()" b = MyBuilder() ret = b.splitext('xyz.c') assert ret == "called splitext()", ret def test_adjust_suffix(self): """Test how a Builder adjusts file suffixes """ b = SCons.Builder.Builder() assert b.adjust_suffix('.foo') == '.foo' assert b.adjust_suffix('foo') == '.foo' assert b.adjust_suffix('$foo') == '$foo' class MyBuilder(SCons.Builder.BuilderBase): def adjust_suffix(self, suff): return "called adjust_suffix()" b = MyBuilder() ret = b.adjust_suffix('.foo') assert ret == "called adjust_suffix()", ret def test_prefix(self): """Test Builder creation with a specified target prefix Make sure that there is no '.' separator appended. """ env = Environment() builder = SCons.Builder.Builder(prefix = 'lib.') assert builder.get_prefix(env) == 'lib.' builder = SCons.Builder.Builder(prefix = 'lib', action='') assert builder.get_prefix(env) == 'lib' tgt = builder(env, target = 'tgt1', source = 'src1')[0] assert tgt.get_internal_path() == 'libtgt1', \ "Target has unexpected name: %s" % tgt.get_internal_path() tgt = builder(env, target = 'tgt2a tgt2b', source = 'src2')[0] assert tgt.get_internal_path() == 'libtgt2a tgt2b', \ "Target has unexpected name: %s" % tgt.get_internal_path() tgt = builder(env, target = None, source = 'src3')[0] assert tgt.get_internal_path() == 'libsrc3', \ "Target has unexpected name: %s" % tgt.get_internal_path() tgt = builder(env, target = None, source = 'lib/src4')[0] assert tgt.get_internal_path() == os.path.join('lib', 'libsrc4'), \ "Target has unexpected name: %s" % tgt.get_internal_path() tgt = builder(env, target = 'lib/tgt5', source = 'lib/src5')[0] assert tgt.get_internal_path() == os.path.join('lib', 'libtgt5'), \ "Target has unexpected name: %s" % tgt.get_internal_path() def gen_prefix(env, sources): return "gen_prefix() says " + env['FOO'] my_env = Environment(FOO = 'xyzzy') builder = SCons.Builder.Builder(prefix = gen_prefix) assert builder.get_prefix(my_env) == "gen_prefix() says xyzzy" my_env['FOO'] = 'abracadabra' assert builder.get_prefix(my_env) == "gen_prefix() says abracadabra" def my_emit(env, sources): return env.subst('$EMIT') my_env = Environment(FOO = '.foo', EMIT = 'emit-') builder = SCons.Builder.Builder(prefix = {None : 'default-', '.in' : 'out-', '.x' : 'y-', '$FOO' : 'foo-', '.zzz' : my_emit}, action = '') tgt = builder(my_env, target = None, source = 'f1')[0] assert tgt.get_internal_path() == 'default-f1', tgt.get_internal_path() tgt = builder(my_env, target = None, source = 'f2.c')[0] assert tgt.get_internal_path() == 'default-f2', tgt.get_internal_path() tgt = builder(my_env, target = None, source = 'f3.in')[0] assert tgt.get_internal_path() == 'out-f3', tgt.get_internal_path() tgt = builder(my_env, target = None, source = 'f4.x')[0] assert tgt.get_internal_path() == 'y-f4', tgt.get_internal_path() tgt = builder(my_env, target = None, source = 'f5.foo')[0] assert tgt.get_internal_path() == 'foo-f5', tgt.get_internal_path() tgt = builder(my_env, target = None, source = 'f6.zzz')[0] assert tgt.get_internal_path() == 'emit-f6', tgt.get_internal_path() def test_set_suffix(self): """Test the set_suffix() method""" b = SCons.Builder.Builder(action='') env = Environment(XSUFFIX = '.x') s = b.get_suffix(env) assert s == '', s b.set_suffix('.foo') s = b.get_suffix(env) assert s == '.foo', s b.set_suffix('$XSUFFIX') s = b.get_suffix(env) assert s == '.x', s def test_src_suffix(self): """Test Builder creation with a specified source file suffix Make sure that the '.' separator is appended to the beginning if it isn't already present. """ env = Environment(XSUFFIX = '.x', YSUFFIX = '.y') b1 = SCons.Builder.Builder(src_suffix = '.c', action='') assert b1.src_suffixes(env) == ['.c'], b1.src_suffixes(env) tgt = b1(env, target = 'tgt2', source = 'src2')[0] assert tgt.sources[0].get_internal_path() == 'src2.c', \ "Source has unexpected name: %s" % tgt.sources[0].get_internal_path() tgt = b1(env, target = 'tgt3', source = 'src3a src3b')[0] assert len(tgt.sources) == 1 assert tgt.sources[0].get_internal_path() == 'src3a src3b.c', \ "Unexpected tgt.sources[0] name: %s" % tgt.sources[0].get_internal_path() b2 = SCons.Builder.Builder(src_suffix = '.2', src_builder = b1) r = sorted(b2.src_suffixes(env)) assert r == ['.2', '.c'], r b3 = SCons.Builder.Builder(action = {'.3a' : '', '.3b' : ''}) s = sorted(b3.src_suffixes(env)) assert s == ['.3a', '.3b'], s b4 = SCons.Builder.Builder(src_suffix = '$XSUFFIX') assert b4.src_suffixes(env) == ['.x'], b4.src_suffixes(env) b5 = SCons.Builder.Builder(action = { '.y' : ''}) assert b5.src_suffixes(env) == ['.y'], b5.src_suffixes(env) def test_srcsuffix_nonext(self): "Test target generation from non-extension source suffixes" env = Environment() b6 = SCons.Builder.Builder(action = '', src_suffix='_src.a', suffix='.b') tgt = b6(env, target=None, source='foo_src.a') assert str(tgt[0]) == 'foo.b', str(tgt[0]) b7 = SCons.Builder.Builder(action = '', src_suffix='_source.a', suffix='_obj.b') b8 = SCons.Builder.Builder(action = '', src_builder=b7, suffix='.c') tgt = b8(env, target=None, source='foo_source.a') assert str(tgt[0]) == 'foo_obj.c', str(tgt[0]) src = env.fs.File('foo_source.a') tgt = b8(env, target=None, source=src) assert str(tgt[0]) == 'foo_obj.c', str(tgt[0]) b9 = SCons.Builder.Builder(action={'_src.a' : 'srcaction'}, suffix='.c') b9.add_action('_altsrc.b', 'altaction') tgt = b9(env, target=None, source='foo_altsrc.b') assert str(tgt[0]) == 'foo.c', str(tgt[0]) def test_src_suffix_expansion(self): """Test handling source suffixes when an expansion is involved""" env = Environment(OBJSUFFIX = '.obj') b1 = SCons.Builder.Builder(action = '', src_suffix='.c', suffix='.obj') b2 = SCons.Builder.Builder(action = '', src_builder=b1, src_suffix='.obj', suffix='.exe') tgt = b2(env, target=None, source=['foo$OBJSUFFIX']) s = list(map(str, tgt[0].sources)) assert s == ['foo.obj'], s def test_suffix(self): """Test Builder creation with a specified target suffix Make sure that the '.' separator is appended to the beginning if it isn't already present. """ env = Environment() builder = SCons.Builder.Builder(suffix = '.o') assert builder.get_suffix(env) == '.o', builder.get_suffix(env) builder = SCons.Builder.Builder(suffix = 'o', action='') assert builder.get_suffix(env) == '.o', builder.get_suffix(env) tgt = builder(env, target = 'tgt3', source = 'src3')[0] assert tgt.get_internal_path() == 'tgt3.o', \ "Target has unexpected name: %s" % tgt.get_internal_path() tgt = builder(env, target = 'tgt4a tgt4b', source = 'src4')[0] assert tgt.get_internal_path() == 'tgt4a tgt4b.o', \ "Target has unexpected name: %s" % tgt.get_internal_path() tgt = builder(env, target = None, source = 'src5')[0] assert tgt.get_internal_path() == 'src5.o', \ "Target has unexpected name: %s" % tgt.get_internal_path() def gen_suffix(env, sources): return "gen_suffix() says " + env['BAR'] my_env = Environment(BAR = 'hocus pocus') builder = SCons.Builder.Builder(suffix = gen_suffix) assert builder.get_suffix(my_env) == "gen_suffix() says hocus pocus", builder.get_suffix(my_env) my_env['BAR'] = 'presto chango' assert builder.get_suffix(my_env) == "gen_suffix() says presto chango" def my_emit(env, sources): return env.subst('$EMIT') my_env = Environment(BAR = '.bar', EMIT = '.emit') builder = SCons.Builder.Builder(suffix = {None : '.default', '.in' : '.out', '.x' : '.y', '$BAR' : '.new', '.zzz' : my_emit}, action='') tgt = builder(my_env, target = None, source = 'f1')[0] assert tgt.get_internal_path() == 'f1.default', tgt.get_internal_path() tgt = builder(my_env, target = None, source = 'f2.c')[0] assert tgt.get_internal_path() == 'f2.default', tgt.get_internal_path() tgt = builder(my_env, target = None, source = 'f3.in')[0] assert tgt.get_internal_path() == 'f3.out', tgt.get_internal_path() tgt = builder(my_env, target = None, source = 'f4.x')[0] assert tgt.get_internal_path() == 'f4.y', tgt.get_internal_path() tgt = builder(my_env, target = None, source = 'f5.bar')[0] assert tgt.get_internal_path() == 'f5.new', tgt.get_internal_path() tgt = builder(my_env, target = None, source = 'f6.zzz')[0] assert tgt.get_internal_path() == 'f6.emit', tgt.get_internal_path() def test_single_source(self): """Test Builder with single_source flag set""" def func(target, source, env): open(str(target[0]), "w") if (len(source) == 1 and len(target) == 1): env['CNT'][0] = env['CNT'][0] + 1 env = Environment() infiles = [] outfiles = [] for i in range(10): infiles.append(test.workpath('%d.in' % i)) outfiles.append(test.workpath('%d.out' % i)) test.write(infiles[-1], "\n") builder = SCons.Builder.Builder(action=SCons.Action.Action(func,None), single_source = 1, suffix='.out') env['CNT'] = [0] tgt = builder(env, target=outfiles[0], source=infiles[0])[0] s = str(tgt) t = os.path.normcase(test.workpath('0.out')) assert os.path.normcase(s) == t, s tgt.prepare() tgt.build() assert env['CNT'][0] == 1, env['CNT'][0] tgt = builder(env, outfiles[1], infiles[1])[0] s = str(tgt) t = os.path.normcase(test.workpath('1.out')) assert os.path.normcase(s) == t, s tgt.prepare() tgt.build() assert env['CNT'][0] == 2 tgts = builder(env, None, infiles[2:4]) s = list(map(str, tgts)) expect = [test.workpath('2.out'), test.workpath('3.out')] expect = list(map(os.path.normcase, expect)) assert list(map(os.path.normcase, s)) == expect, s for t in tgts: t.prepare() tgts[0].build() tgts[1].build() assert env['CNT'][0] == 4 try: tgt = builder(env, outfiles[4], infiles[4:6]) except SCons.Errors.UserError: pass else: assert 0 try: # The builder may output more than one target per input file. tgt = builder(env, outfiles[4:6], infiles[4:6]) except SCons.Errors.UserError: pass else: assert 0 def test_lists(self): """Testing handling lists of targets and source""" def function2(target, source, env, tlist = [outfile, outfile2], **kw): for t in target: open(str(t), 'w').write("function2\n") for t in tlist: if not t in list(map(str, target)): open(t, 'w').write("function2\n") return 1 env = Environment() builder = SCons.Builder.Builder(action = function2) tgts = builder(env, source=[]) assert tgts == [], tgts tgts = builder(env, target = [outfile, outfile2], source = infile) for t in tgts: t.prepare() try: tgts[0].build() except SCons.Errors.BuildError: pass c = test.read(outfile, 'r') assert c == "function2\n", c c = test.read(outfile2, 'r') assert c == "function2\n", c sub1_out = test.workpath('sub1', 'out') sub2_out = test.workpath('sub2', 'out') def function3(target, source, env, tlist = [sub1_out, sub2_out]): for t in target: open(str(t), 'w').write("function3\n") for t in tlist: if not t in list(map(str, target)): open(t, 'w').write("function3\n") return 1 builder = SCons.Builder.Builder(action = function3) tgts = builder(env, target = [sub1_out, sub2_out], source = infile) for t in tgts: t.prepare() try: tgts[0].build() except SCons.Errors.BuildError: pass c = test.read(sub1_out, 'r') assert c == "function3\n", c c = test.read(sub2_out, 'r') assert c == "function3\n", c assert os.path.exists(test.workpath('sub1')) assert os.path.exists(test.workpath('sub2')) def test_src_builder(self): """Testing Builders with src_builder""" # These used to be MultiStepBuilder objects until we # eliminated it as a separate class env = Environment() builder1 = SCons.Builder.Builder(action='foo', src_suffix='.bar', suffix='.foo') builder2 = SCons.Builder.Builder(action=MyAction('act'), src_builder = builder1, src_suffix = '.foo') tgt = builder2(env, source=[]) assert tgt == [], tgt sources = ['test.bar', 'test2.foo', 'test3.txt', 'test4'] tgt = builder2(env, target='baz', source=sources)[0] s = str(tgt) assert s == 'baz', s s = list(map(str, tgt.sources)) assert s == ['test.foo', 'test2.foo', 'test3.txt', 'test4.foo'], s s = list(map(str, tgt.sources[0].sources)) assert s == ['test.bar'], s tgt = builder2(env, None, 'aaa.bar')[0] s = str(tgt) assert s == 'aaa', s s = list(map(str, tgt.sources)) assert s == ['aaa.foo'], s s = list(map(str, tgt.sources[0].sources)) assert s == ['aaa.bar'], s builder3 = SCons.Builder.Builder(action='bld3') assert not builder3.src_builder is builder1.src_builder builder4 = SCons.Builder.Builder(action='bld4', src_suffix='.i', suffix='_wrap.c') builder5 = SCons.Builder.Builder(action=MyAction('act'), src_builder=builder4, suffix='.obj', src_suffix='.c') builder6 = SCons.Builder.Builder(action=MyAction('act'), src_builder=builder5, suffix='.exe', src_suffix='.obj') tgt = builder6(env, 'test', 'test.i')[0] s = str(tgt) assert s == 'test.exe', s s = list(map(str, tgt.sources)) assert s == ['test_wrap.obj'], s s = list(map(str, tgt.sources[0].sources)) assert s == ['test_wrap.c'], s s = list(map(str, tgt.sources[0].sources[0].sources)) assert s == ['test.i'], s def test_target_scanner(self): """Testing ability to set target and source scanners through a builder.""" global instanced class TestScanner(object): pass tscan = TestScanner() sscan = TestScanner() env = Environment() builder = SCons.Builder.Builder(target_scanner=tscan, source_scanner=sscan, action='') tgt = builder(env, target='foo2', source='bar')[0] assert tgt.builder.target_scanner == tscan, tgt.builder.target_scanner assert tgt.builder.source_scanner == sscan, tgt.builder.source_scanner builder1 = SCons.Builder.Builder(action='foo', src_suffix='.bar', suffix='.foo') builder2 = SCons.Builder.Builder(action='foo', src_builder = builder1, target_scanner = tscan, source_scanner = tscan) tgt = builder2(env, target='baz2', source='test.bar test2.foo test3.txt')[0] assert tgt.builder.target_scanner == tscan, tgt.builder.target_scanner assert tgt.builder.source_scanner == tscan, tgt.builder.source_scanner def test_actual_scanner(self): """Test usage of actual Scanner objects.""" import SCons.Scanner def func(self): pass scanner = SCons.Scanner.Base(func, name='fooscan') b1 = SCons.Builder.Builder(action='bld', target_scanner=scanner) b2 = SCons.Builder.Builder(action='bld', target_scanner=scanner) b3 = SCons.Builder.Builder(action='bld') assert b1 == b2 assert b1 != b3 def test_src_scanner(slf): """Testing ability to set a source file scanner through a builder.""" class TestScanner(object): def key(self, env): return 'TestScannerkey' def instance(self, env): return self def select(self, node): return self name = 'TestScanner' def __str__(self): return self.name scanner = TestScanner() builder = SCons.Builder.Builder(action='action') # With no scanner specified, source_scanner and # backup_source_scanner are None. bar_y = MyNode('bar.y') env1 = Environment() tgt = builder(env1, target='foo1.x', source='bar.y')[0] src = tgt.sources[0] assert tgt.builder.target_scanner != scanner, tgt.builder.target_scanner assert tgt.builder.source_scanner is None, tgt.builder.source_scanner assert tgt.get_source_scanner(bar_y) is None, tgt.get_source_scanner(bar_y) assert not src.has_builder(), src.has_builder() s = src.get_source_scanner(bar_y) assert isinstance(s, SCons.Util.Null), repr(s) # An Environment that has suffix-specified SCANNERS should # provide a source scanner to the target. class EnvTestScanner(object): def key(self, env): return '.y' def instance(self, env): return self name = 'EnvTestScanner' def __str__(self): return self.name def select(self, node): return self def path(self, env, dir=None): return () def __call__(self, node, env, path): return [] env3 = Environment(SCANNERS = [EnvTestScanner()]) env3.scanner = EnvTestScanner() # test env's version of SCANNERS tgt = builder(env3, target='foo2.x', source='bar.y')[0] src = tgt.sources[0] assert tgt.builder.target_scanner != scanner, tgt.builder.target_scanner assert not tgt.builder.source_scanner, tgt.builder.source_scanner assert tgt.get_source_scanner(bar_y), tgt.get_source_scanner(bar_y) assert str(tgt.get_source_scanner(bar_y)) == 'EnvTestScanner', tgt.get_source_scanner(bar_y) assert not src.has_builder(), src.has_builder() s = src.get_source_scanner(bar_y) assert isinstance(s, SCons.Util.Null), repr(s) # Can't simply specify the scanner as a builder argument; it's # global to all invocations of this builder. tgt = builder(env3, target='foo3.x', source='bar.y', source_scanner = scanner)[0] src = tgt.sources[0] assert tgt.builder.target_scanner != scanner, tgt.builder.target_scanner assert not tgt.builder.source_scanner, tgt.builder.source_scanner assert tgt.get_source_scanner(bar_y), tgt.get_source_scanner(bar_y) assert str(tgt.get_source_scanner(bar_y)) == 'EnvTestScanner', tgt.get_source_scanner(bar_y) assert not src.has_builder(), src.has_builder() s = src.get_source_scanner(bar_y) assert isinstance(s, SCons.Util.Null), s # Now use a builder that actually has scanners and ensure that # the target is set accordingly (using the specified scanner # instead of the Environment's scanner) builder = SCons.Builder.Builder(action='action', source_scanner=scanner, target_scanner=scanner) tgt = builder(env3, target='foo4.x', source='bar.y')[0] src = tgt.sources[0] assert tgt.builder.target_scanner == scanner, tgt.builder.target_scanner assert tgt.builder.source_scanner, tgt.builder.source_scanner assert tgt.builder.source_scanner == scanner, tgt.builder.source_scanner assert str(tgt.builder.source_scanner) == 'TestScanner', str(tgt.builder.source_scanner) assert tgt.get_source_scanner(bar_y), tgt.get_source_scanner(bar_y) assert tgt.get_source_scanner(bar_y) == scanner, tgt.get_source_scanner(bar_y) assert str(tgt.get_source_scanner(bar_y)) == 'TestScanner', tgt.get_source_scanner(bar_y) assert not src.has_builder(), src.has_builder() s = src.get_source_scanner(bar_y) assert isinstance(s, SCons.Util.Null), s def test_Builder_API(self): """Test Builder interface. Some of this is tested elsewhere in this file, but this is a quick collection of common operations on builders with various forms of component specifications.""" builder = SCons.Builder.Builder() env = Environment(BUILDERS={'Bld':builder}) r = builder.get_name(env) assert r == 'Bld', r r = builder.get_prefix(env) assert r == '', r r = builder.get_suffix(env) assert r == '', r r = builder.get_src_suffix(env) assert r == '', r r = builder.src_suffixes(env) assert r == [], r # src_suffix can be a single string or a list of strings # src_suffixes() caches its return value, so we use a new # Builder each time we do any of these tests bld = SCons.Builder.Builder() env = Environment(BUILDERS={'Bld':bld}) bld.set_src_suffix('.foo') r = bld.get_src_suffix(env) assert r == '.foo', r r = bld.src_suffixes(env) assert r == ['.foo'], r bld = SCons.Builder.Builder() env = Environment(BUILDERS={'Bld':bld}) bld.set_src_suffix(['.foo', '.bar']) r = bld.get_src_suffix(env) assert r == '.foo', r r = bld.src_suffixes(env) assert r == ['.foo', '.bar'], r bld = SCons.Builder.Builder() env = Environment(BUILDERS={'Bld':bld}) bld.set_src_suffix(['.bar', '.foo']) r = bld.get_src_suffix(env) assert r == '.bar', r r = sorted(bld.src_suffixes(env)) assert r == ['.bar', '.foo'], r # adjust_suffix normalizes the suffix, adding a `.' if needed r = builder.adjust_suffix('.foo') assert r == '.foo', r r = builder.adjust_suffix('_foo') assert r == '_foo', r r = builder.adjust_suffix('$foo') assert r == '$foo', r r = builder.adjust_suffix('foo') assert r == '.foo', r r = builder.adjust_suffix('f._$oo') assert r == '.f._$oo', r # prefix and suffix can be one of: # 1. a string (adjusted and env variables substituted), # 2. a function (passed (env,sources), returns suffix string) # 3. a dict of src_suffix:suffix settings, key==None is # default suffix (special case of #2, so adjust_suffix # not applied) builder = SCons.Builder.Builder(prefix='lib', suffix='foo') env = Environment(BUILDERS={'Bld':builder}) r = builder.get_name(env) assert r == 'Bld', r r = builder.get_prefix(env) assert r == 'lib', r r = builder.get_suffix(env) assert r == '.foo', r mkpref = lambda env,sources: 'Lib' mksuff = lambda env,sources: '.Foo' builder = SCons.Builder.Builder(prefix=mkpref, suffix=mksuff) env = Environment(BUILDERS={'Bld':builder}) r = builder.get_name(env) assert r == 'Bld', r r = builder.get_prefix(env) assert r == 'Lib', r r = builder.get_suffix(env) assert r == '.Foo', r builder = SCons.Builder.Builder(prefix='$PREF', suffix='$SUFF') env = Environment(BUILDERS={'Bld':builder},PREF="LIB",SUFF=".FOO") r = builder.get_name(env) assert r == 'Bld', r r = builder.get_prefix(env) assert r == 'LIB', r r = builder.get_suffix(env) assert r == '.FOO', r builder = SCons.Builder.Builder(prefix={None:'A_', '.C':'E_'}, suffix={None:'.B', '.C':'.D'}) env = Environment(BUILDERS={'Bld':builder}) r = builder.get_name(env) assert r == 'Bld', r r = builder.get_prefix(env) assert r == 'A_', r r = builder.get_suffix(env) assert r == '.B', r r = builder.get_prefix(env, [MyNode('X.C')]) assert r == 'E_', r r = builder.get_suffix(env, [MyNode('X.C')]) assert r == '.D', r builder = SCons.Builder.Builder(prefix='A_', suffix={}, action={}) env = Environment(BUILDERS={'Bld':builder}) r = builder.get_name(env) assert r == 'Bld', r r = builder.get_prefix(env) assert r == 'A_', r r = builder.get_suffix(env) assert r is None, r r = builder.get_src_suffix(env) assert r == '', r r = builder.src_suffixes(env) assert r == [], r # Builder actions can be a string, a list, or a dictionary # whose keys are the source suffix. The add_action() # specifies a new source suffix/action binding. builder = SCons.Builder.Builder(prefix='A_', suffix={}, action={}) env = Environment(BUILDERS={'Bld':builder}) builder.add_action('.src_sfx1', 'FOO') r = builder.get_name(env) assert r == 'Bld', r r = builder.get_prefix(env) assert r == 'A_', r r = builder.get_suffix(env) assert r is None, r r = builder.get_suffix(env, [MyNode('X.src_sfx1')]) assert r is None, r r = builder.get_src_suffix(env) assert r == '.src_sfx1', r r = builder.src_suffixes(env) assert r == ['.src_sfx1'], r builder = SCons.Builder.Builder(prefix='A_', suffix={}, action={}) env = Environment(BUILDERS={'Bld':builder}) builder.add_action('.src_sfx1', 'FOO') builder.add_action('.src_sfx2', 'BAR') r = builder.get_name(env) assert r == 'Bld', r r = builder.get_prefix(env) assert r == 'A_', r r = builder.get_suffix(env) assert r is None, r r = builder.get_src_suffix(env) assert r == '.src_sfx1', r r = sorted(builder.src_suffixes(env)) assert r == ['.src_sfx1', '.src_sfx2'], r def test_Builder_Args(self): """Testing passing extra args to a builder.""" def buildFunc(target, source, env, s=self): s.foo=env['foo'] s.bar=env['bar'] assert env['CC'] == 'mycc' env=Environment(CC='cc') builder = SCons.Builder.Builder(action=buildFunc) tgt = builder(env, target='foo', source='bar', foo=1, bar=2, CC='mycc')[0] tgt.build() assert self.foo == 1, self.foo assert self.bar == 2, self.bar def test_emitter(self): """Test emitter functions.""" def emit(target, source, env): foo = env.get('foo', 0) bar = env.get('bar', 0) for t in target: assert isinstance(t, MyNode) assert t.has_builder() for s in source: assert isinstance(s, MyNode) if foo: target.append("bar%d"%foo) if bar: source.append("baz") return ( target, source ) env = Environment() builder = SCons.Builder.Builder(action='foo', emitter=emit, target_factory=MyNode, source_factory=MyNode) tgt = builder(env, target='foo2', source='bar')[0] assert str(tgt) == 'foo2', str(tgt) assert str(tgt.sources[0]) == 'bar', str(tgt.sources[0]) tgt = builder(env, target='foo3', source='bar', foo=1) assert len(tgt) == 2, len(tgt) assert 'foo3' in list(map(str, tgt)), list(map(str, tgt)) assert 'bar1' in list(map(str, tgt)), list(map(str, tgt)) tgt = builder(env, target='foo4', source='bar', bar=1)[0] assert str(tgt) == 'foo4', str(tgt) assert len(tgt.sources) == 2, len(tgt.sources) assert 'baz' in list(map(str, tgt.sources)), list(map(str, tgt.sources)) assert 'bar' in list(map(str, tgt.sources)), list(map(str, tgt.sources)) env2=Environment(FOO=emit) builder2=SCons.Builder.Builder(action='foo', emitter="$FOO", target_factory=MyNode, source_factory=MyNode) builder2a=SCons.Builder.Builder(action='foo', emitter="$FOO", target_factory=MyNode, source_factory=MyNode) assert builder2 == builder2a, repr(builder2.__dict__) + "\n" + repr(builder2a.__dict__) tgt = builder2(env2, target='foo5', source='bar')[0] assert str(tgt) == 'foo5', str(tgt) assert str(tgt.sources[0]) == 'bar', str(tgt.sources[0]) tgt = builder2(env2, target='foo6', source='bar', foo=2) assert len(tgt) == 2, len(tgt) assert 'foo6' in list(map(str, tgt)), list(map(str, tgt)) assert 'bar2' in list(map(str, tgt)), list(map(str, tgt)) tgt = builder2(env2, target='foo7', source='bar', bar=1)[0] assert str(tgt) == 'foo7', str(tgt) assert len(tgt.sources) == 2, len(tgt.sources) assert 'baz' in list(map(str, tgt.sources)), list(map(str, tgt.sources)) assert 'bar' in list(map(str, tgt.sources)), list(map(str, tgt.sources)) def test_emitter_preserve_builder(self): """Test an emitter not overwriting a newly-set builder""" env = Environment() new_builder = SCons.Builder.Builder(action='new') node = MyNode('foo8') new_node = MyNode('foo8.new') def emit(target, source, env, nb=new_builder, nn=new_node): for t in target: t.builder = nb return [nn], source builder=SCons.Builder.Builder(action='foo', emitter=emit, target_factory=MyNode, source_factory=MyNode) tgt = builder(env, target=node, source='bar')[0] assert tgt is new_node, tgt assert tgt.builder is builder, tgt.builder assert node.builder is new_builder, node.builder def test_emitter_suffix_map(self): """Test mapping file suffixes to emitter functions""" env = Environment() def emit4a(target, source, env): source = list(map(str, source)) target = ['emit4a-' + x[:-3] for x in source] return (target, source) def emit4b(target, source, env): source = list(map(str, source)) target = ['emit4b-' + x[:-3] for x in source] return (target, source) builder = SCons.Builder.Builder(action='foo', emitter={'.4a':emit4a, '.4b':emit4b}, target_factory=MyNode, source_factory=MyNode) tgt = builder(env, None, source='aaa.4a')[0] assert str(tgt) == 'emit4a-aaa', str(tgt) tgt = builder(env, None, source='bbb.4b')[0] assert str(tgt) == 'emit4b-bbb', str(tgt) tgt = builder(env, None, source='ccc.4c')[0] assert str(tgt) == 'ccc', str(tgt) def emit4c(target, source, env): source = list(map(str, source)) target = ['emit4c-' + x[:-3] for x in source] return (target, source) builder.add_emitter('.4c', emit4c) tgt = builder(env, None, source='ccc.4c')[0] assert str(tgt) == 'emit4c-ccc', str(tgt) def test_emitter_function_list(self): """Test lists of emitter functions""" env = Environment() def emit1a(target, source, env): source = list(map(str, source)) target = target + ['emit1a-' + x[:-2] for x in source] return (target, source) def emit1b(target, source, env): source = list(map(str, source)) target = target + ['emit1b-' + x[:-2] for x in source] return (target, source) builder1 = SCons.Builder.Builder(action='foo', emitter=[emit1a, emit1b], node_factory=MyNode) tgts = builder1(env, target='target-1', source='aaa.1') tgts = list(map(str, tgts)) assert tgts == ['target-1', 'emit1a-aaa', 'emit1b-aaa'], tgts # Test a list of emitter functions through the environment. def emit2a(target, source, env): source = list(map(str, source)) target = target + ['emit2a-' + x[:-2] for x in source] return (target, source) def emit2b(target, source, env): source = list(map(str, source)) target = target + ['emit2b-' + x[:-2] for x in source] return (target, source) builder2 = SCons.Builder.Builder(action='foo', emitter='$EMITTERLIST', node_factory=MyNode) env = Environment(EMITTERLIST = [emit2a, emit2b]) tgts = builder2(env, target='target-2', source='aaa.2') tgts = list(map(str, tgts)) assert tgts == ['target-2', 'emit2a-aaa', 'emit2b-aaa'], tgts def test_emitter_TARGET_SOURCE(self): """Test use of $TARGET and $SOURCE in emitter results""" env = SCons.Environment.Environment() def emit(target, source, env): return (target + ['${SOURCE}.s1', '${TARGET}.t1'], source + ['${TARGET}.t2', '${SOURCE}.s2']) builder = SCons.Builder.Builder(action='foo', emitter = emit, node_factory = MyNode) targets = builder(env, target = 'TTT', source ='SSS') sources = targets[0].sources targets = list(map(str, targets)) sources = list(map(str, sources)) assert targets == ['TTT', 'SSS.s1', 'TTT.t1'], targets assert sources == ['SSS', 'TTT.t2', 'SSS.s2'], targets def test_no_target(self): """Test deducing the target from the source.""" env = Environment() b = SCons.Builder.Builder(action='foo', suffix='.o') tgt = b(env, None, 'aaa')[0] assert str(tgt) == 'aaa.o', str(tgt) assert len(tgt.sources) == 1, list(map(str, tgt.sources)) assert str(tgt.sources[0]) == 'aaa', list(map(str, tgt.sources)) tgt = b(env, None, 'bbb.c')[0] assert str(tgt) == 'bbb.o', str(tgt) assert len(tgt.sources) == 1, list(map(str, tgt.sources)) assert str(tgt.sources[0]) == 'bbb.c', list(map(str, tgt.sources)) tgt = b(env, None, 'ccc.x.c')[0] assert str(tgt) == 'ccc.x.o', str(tgt) assert len(tgt.sources) == 1, list(map(str, tgt.sources)) assert str(tgt.sources[0]) == 'ccc.x.c', list(map(str, tgt.sources)) tgt = b(env, None, ['d0.c', 'd1.c'])[0] assert str(tgt) == 'd0.o', str(tgt) assert len(tgt.sources) == 2, list(map(str, tgt.sources)) assert str(tgt.sources[0]) == 'd0.c', list(map(str, tgt.sources)) assert str(tgt.sources[1]) == 'd1.c', list(map(str, tgt.sources)) tgt = b(env, target = None, source='eee')[0] assert str(tgt) == 'eee.o', str(tgt) assert len(tgt.sources) == 1, list(map(str, tgt.sources)) assert str(tgt.sources[0]) == 'eee', list(map(str, tgt.sources)) tgt = b(env, target = None, source='fff.c')[0] assert str(tgt) == 'fff.o', str(tgt) assert len(tgt.sources) == 1, list(map(str, tgt.sources)) assert str(tgt.sources[0]) == 'fff.c', list(map(str, tgt.sources)) tgt = b(env, target = None, source='ggg.x.c')[0] assert str(tgt) == 'ggg.x.o', str(tgt) assert len(tgt.sources) == 1, list(map(str, tgt.sources)) assert str(tgt.sources[0]) == 'ggg.x.c', list(map(str, tgt.sources)) tgt = b(env, target = None, source=['h0.c', 'h1.c'])[0] assert str(tgt) == 'h0.o', str(tgt) assert len(tgt.sources) == 2, list(map(str, tgt.sources)) assert str(tgt.sources[0]) == 'h0.c', list(map(str, tgt.sources)) assert str(tgt.sources[1]) == 'h1.c', list(map(str, tgt.sources)) w = b(env, target='i0.w', source=['i0.x'])[0] y = b(env, target='i1.y', source=['i1.z'])[0] tgt = b(env, None, source=[w, y])[0] assert str(tgt) == 'i0.o', str(tgt) assert len(tgt.sources) == 2, list(map(str, tgt.sources)) assert str(tgt.sources[0]) == 'i0.w', list(map(str, tgt.sources)) assert str(tgt.sources[1]) == 'i1.y', list(map(str, tgt.sources)) def test_get_name(self): """Test getting name of builder. Each type of builder should return its environment-specific name when queried appropriately. """ b1 = SCons.Builder.Builder(action='foo', suffix='.o') b2 = SCons.Builder.Builder(action='foo', suffix='.c') b3 = SCons.Builder.Builder(action='bar', src_suffix = '.foo', src_builder = b1) b4 = SCons.Builder.Builder(action={}) b5 = SCons.Builder.Builder(action='foo', name='builder5') b6 = SCons.Builder.Builder(action='foo') assert isinstance(b4, SCons.Builder.CompositeBuilder) assert isinstance(b4.action, SCons.Action.CommandGeneratorAction) env = Environment(BUILDERS={'bldr1': b1, 'bldr2': b2, 'bldr3': b3, 'bldr4': b4}) env2 = Environment(BUILDERS={'B1': b1, 'B2': b2, 'B3': b3, 'B4': b4}) # With no name, get_name will return the class. Allow # for caching... b6_names = [ 'SCons.Builder.BuilderBase', "", 'SCons.Memoize.BuilderBase', "", ] assert b1.get_name(env) == 'bldr1', b1.get_name(env) assert b2.get_name(env) == 'bldr2', b2.get_name(env) assert b3.get_name(env) == 'bldr3', b3.get_name(env) assert b4.get_name(env) == 'bldr4', b4.get_name(env) assert b5.get_name(env) == 'builder5', b5.get_name(env) assert b6.get_name(env) in b6_names, b6.get_name(env) assert b1.get_name(env2) == 'B1', b1.get_name(env2) assert b2.get_name(env2) == 'B2', b2.get_name(env2) assert b3.get_name(env2) == 'B3', b3.get_name(env2) assert b4.get_name(env2) == 'B4', b4.get_name(env2) assert b5.get_name(env2) == 'builder5', b5.get_name(env2) assert b6.get_name(env2) in b6_names, b6.get_name(env2) assert b5.get_name(None) == 'builder5', b5.get_name(None) assert b6.get_name(None) in b6_names, b6.get_name(None) # This test worked before adding batch builders, but we must now # be able to disambiguate a CompositeAction into a more specific # action based on file suffix at call time. Leave this commented # out (for now) in case this reflects a real-world use case that # we must accomodate and we want to resurrect this test. #tgt = b4(env, target = 'moo', source='cow') #assert tgt[0].builder.get_name(env) == 'bldr4' class CompositeBuilderTestCase(unittest.TestCase): def setUp(self): def func_action(target, source, env): return 0 builder = SCons.Builder.Builder(action={ '.foo' : func_action, '.bar' : func_action}) self.func_action = func_action self.builder = builder def test___init__(self): """Test CompositeBuilder creation""" env = Environment() builder = SCons.Builder.Builder(action={}) tgt = builder(env, source=[]) assert tgt == [], tgt assert isinstance(builder, SCons.Builder.CompositeBuilder) assert isinstance(builder.action, SCons.Action.CommandGeneratorAction) def test_target_action(self): """Test CompositeBuilder setting of target builder actions""" env = Environment() builder = self.builder tgt = builder(env, target='test1', source='test1.foo')[0] assert isinstance(tgt.builder, SCons.Builder.BuilderBase) assert tgt.builder.action is builder.action tgt = builder(env, target='test2', source='test1.bar')[0] assert isinstance(tgt.builder, SCons.Builder.BuilderBase) assert tgt.builder.action is builder.action def test_multiple_suffix_error(self): """Test the CompositeBuilder multiple-source-suffix error""" env = Environment() builder = self.builder flag = 0 try: builder(env, target='test3', source=['test2.bar', 'test1.foo'])[0] except SCons.Errors.UserError as e: flag = 1 err = e assert flag, "UserError should be thrown when we call a builder with files of different suffixes." expect = "While building `['test3']' from `test1.foo': Cannot build multiple sources with different extensions: .bar, .foo" assert str(err) == expect, err def test_source_ext_match(self): """Test the CompositeBuilder source_ext_match argument""" env = Environment() func_action = self.func_action builder = SCons.Builder.Builder(action={ '.foo' : func_action, '.bar' : func_action}, source_ext_match = None) tgt = builder(env, target='test3', source=['test2.bar', 'test1.foo'])[0] tgt.build() def test_suffix_variable(self): """Test CompositeBuilder defining action suffixes through a variable""" env = Environment(BAR_SUFFIX = '.BAR2', FOO_SUFFIX = '.FOO2') func_action = self.func_action builder = SCons.Builder.Builder(action={ '.foo' : func_action, '.bar' : func_action, '$BAR_SUFFIX' : func_action, '$FOO_SUFFIX' : func_action }) tgt = builder(env, target='test4', source=['test4.BAR2'])[0] assert isinstance(tgt.builder, SCons.Builder.BuilderBase) try: tgt.build() flag = 1 except SCons.Errors.UserError as e: print(e) flag = 0 assert flag, "It should be possible to define actions in composite builders using variables." env['FOO_SUFFIX'] = '.BAR2' builder.add_action('$NEW_SUFFIX', func_action) flag = 0 try: builder(env, target='test5', source=['test5.BAR2'])[0] except SCons.Errors.UserError: flag = 1 assert flag, "UserError should be thrown when we call a builder with ambigous suffixes." def test_src_builder(self): """Test CompositeBuilder's use of a src_builder""" env = Environment() foo_bld = SCons.Builder.Builder(action = 'a-foo', src_suffix = '.ina', suffix = '.foo') assert isinstance(foo_bld, SCons.Builder.BuilderBase) builder = SCons.Builder.Builder(action = { '.foo' : 'foo', '.bar' : 'bar' }, src_builder = foo_bld) assert isinstance(builder, SCons.Builder.CompositeBuilder) assert isinstance(builder.action, SCons.Action.CommandGeneratorAction) tgt = builder(env, target='t1', source='t1a.ina t1b.ina')[0] assert isinstance(tgt.builder, SCons.Builder.BuilderBase) tgt = builder(env, target='t2', source='t2a.foo t2b.ina')[0] assert isinstance(tgt.builder, SCons.Builder.BuilderBase), tgt.builder.__dict__ bar_bld = SCons.Builder.Builder(action = 'a-bar', src_suffix = '.inb', suffix = '.bar') assert isinstance(bar_bld, SCons.Builder.BuilderBase) builder = SCons.Builder.Builder(action = { '.foo' : 'foo'}, src_builder = [foo_bld, bar_bld]) assert isinstance(builder, SCons.Builder.CompositeBuilder) assert isinstance(builder.action, SCons.Action.CommandGeneratorAction) builder.add_action('.bar', 'bar') tgt = builder(env, target='t3-foo', source='t3a.foo t3b.ina')[0] assert isinstance(tgt.builder, SCons.Builder.BuilderBase) tgt = builder(env, target='t3-bar', source='t3a.bar t3b.inb')[0] assert isinstance(tgt.builder, SCons.Builder.BuilderBase) flag = 0 try: builder(env, target='t5', source=['test5a.foo', 'test5b.inb'])[0] except SCons.Errors.UserError as e: flag = 1 err = e assert flag, "UserError should be thrown when we call a builder with files of different suffixes." expect = "While building `['t5']' from `test5b.bar': Cannot build multiple sources with different extensions: .foo, .bar" assert str(err) == expect, err flag = 0 try: builder(env, target='t6', source=['test6a.bar', 'test6b.ina'])[0] except SCons.Errors.UserError as e: flag = 1 err = e assert flag, "UserError should be thrown when we call a builder with files of different suffixes." expect = "While building `['t6']' from `test6b.foo': Cannot build multiple sources with different extensions: .bar, .foo" assert str(err) == expect, err flag = 0 try: builder(env, target='t4', source=['test4a.ina', 'test4b.inb'])[0] except SCons.Errors.UserError as e: flag = 1 err = e assert flag, "UserError should be thrown when we call a builder with files of different suffixes." expect = "While building `['t4']' from `test4b.bar': Cannot build multiple sources with different extensions: .foo, .bar" assert str(err) == expect, err flag = 0 try: builder(env, target='t7', source=[env.fs.File('test7')])[0] except SCons.Errors.UserError as e: flag = 1 err = e assert flag, "UserError should be thrown when we call a builder with files of different suffixes." expect = "While building `['t7']': Cannot deduce file extension from source files: ['test7']" assert str(err) == expect, err flag = 0 try: builder(env, target='t8', source=['test8.unknown'])[0] except SCons.Errors.UserError as e: flag = 1 err = e assert flag, "UserError should be thrown when we call a builder target with an unknown suffix." expect = "While building `['t8']' from `['test8.unknown']': Don't know how to build from a source file with suffix `.unknown'. Expected a suffix in this list: ['.foo', '.bar']." assert str(err) == expect, err if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ BuilderTestCase, CompositeBuilderTestCase ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Job.py0000664000175000017500000003734413160023041017632 0ustar bdbaddogbdbaddog"""SCons.Job This module defines the Serial and Parallel classes that execute tasks to complete a build. The Jobs class provides a higher level interface to start, stop, and wait on jobs. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Job.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import os import signal import SCons.Errors # The default stack size (in kilobytes) of the threads used to execute # jobs in parallel. # # We use a stack size of 256 kilobytes. The default on some platforms # is too large and prevents us from creating enough threads to fully # parallelized the build. For example, the default stack size on linux # is 8 MBytes. explicit_stack_size = None default_stack_size = 256 interrupt_msg = 'Build interrupted.' class InterruptState(object): def __init__(self): self.interrupted = False def set(self): self.interrupted = True def __call__(self): return self.interrupted class Jobs(object): """An instance of this class initializes N jobs, and provides methods for starting, stopping, and waiting on all N jobs. """ def __init__(self, num, taskmaster): """ Create 'num' jobs using the given taskmaster. If 'num' is 1 or less, then a serial job will be used, otherwise a parallel job with 'num' worker threads will be used. The 'num_jobs' attribute will be set to the actual number of jobs allocated. If more than one job is requested but the Parallel class can't do it, it gets reset to 1. Wrapping interfaces that care should check the value of 'num_jobs' after initialization. """ self.job = None if num > 1: stack_size = explicit_stack_size if stack_size is None: stack_size = default_stack_size try: self.job = Parallel(taskmaster, num, stack_size) self.num_jobs = num except NameError: pass if self.job is None: self.job = Serial(taskmaster) self.num_jobs = 1 def run(self, postfunc=lambda: None): """Run the jobs. postfunc() will be invoked after the jobs has run. It will be invoked even if the jobs are interrupted by a keyboard interrupt (well, in fact by a signal such as either SIGINT, SIGTERM or SIGHUP). The execution of postfunc() is protected against keyboard interrupts and is guaranteed to run to completion.""" self._setup_sig_handler() try: self.job.start() finally: postfunc() self._reset_sig_handler() def were_interrupted(self): """Returns whether the jobs were interrupted by a signal.""" return self.job.interrupted() def _setup_sig_handler(self): """Setup an interrupt handler so that SCons can shutdown cleanly in various conditions: a) SIGINT: Keyboard interrupt b) SIGTERM: kill or system shutdown c) SIGHUP: Controlling shell exiting We handle all of these cases by stopping the taskmaster. It turns out that it's very difficult to stop the build process by throwing asynchronously an exception such as KeyboardInterrupt. For example, the python Condition variables (threading.Condition) and queues do not seem to be asynchronous-exception-safe. It would require adding a whole bunch of try/finally block and except KeyboardInterrupt all over the place. Note also that we have to be careful to handle the case when SCons forks before executing another process. In that case, we want the child to exit immediately. """ def handler(signum, stack, self=self, parentpid=os.getpid()): if os.getpid() == parentpid: self.job.taskmaster.stop() self.job.interrupted.set() else: os._exit(2) self.old_sigint = signal.signal(signal.SIGINT, handler) self.old_sigterm = signal.signal(signal.SIGTERM, handler) try: self.old_sighup = signal.signal(signal.SIGHUP, handler) except AttributeError: pass def _reset_sig_handler(self): """Restore the signal handlers to their previous state (before the call to _setup_sig_handler().""" signal.signal(signal.SIGINT, self.old_sigint) signal.signal(signal.SIGTERM, self.old_sigterm) try: signal.signal(signal.SIGHUP, self.old_sighup) except AttributeError: pass class Serial(object): """This class is used to execute tasks in series, and is more efficient than Parallel, but is only appropriate for non-parallel builds. Only one instance of this class should be in existence at a time. This class is not thread safe. """ def __init__(self, taskmaster): """Create a new serial job given a taskmaster. The taskmaster's next_task() method should return the next task that needs to be executed, or None if there are no more tasks. The taskmaster's executed() method will be called for each task when it is successfully executed, or failed() will be called if it failed to execute (e.g. execute() raised an exception).""" self.taskmaster = taskmaster self.interrupted = InterruptState() def start(self): """Start the job. This will begin pulling tasks from the taskmaster and executing them, and return when there are no more tasks. If a task fails to execute (i.e. execute() raises an exception), then the job will stop.""" while True: task = self.taskmaster.next_task() if task is None: break try: task.prepare() if task.needs_execute(): task.execute() except: if self.interrupted(): try: raise SCons.Errors.BuildError( task.targets[0], errstr=interrupt_msg) except: task.exception_set() else: task.exception_set() # Let the failed() callback function arrange for the # build to stop if that's appropriate. task.failed() else: task.executed() task.postprocess() self.taskmaster.cleanup() # Trap import failure so that everything in the Job module but the # Parallel class (and its dependent classes) will work if the interpreter # doesn't support threads. try: import queue import threading except ImportError: pass else: class Worker(threading.Thread): """A worker thread waits on a task to be posted to its request queue, dequeues the task, executes it, and posts a tuple including the task and a boolean indicating whether the task executed successfully. """ def __init__(self, requestQueue, resultsQueue, interrupted): threading.Thread.__init__(self) self.setDaemon(1) self.requestQueue = requestQueue self.resultsQueue = resultsQueue self.interrupted = interrupted self.start() def run(self): while True: task = self.requestQueue.get() if task is None: # The "None" value is used as a sentinel by # ThreadPool.cleanup(). This indicates that there # are no more tasks, so we should quit. break try: if self.interrupted(): raise SCons.Errors.BuildError( task.targets[0], errstr=interrupt_msg) task.execute() except: task.exception_set() ok = False else: ok = True self.resultsQueue.put((task, ok)) class ThreadPool(object): """This class is responsible for spawning and managing worker threads.""" def __init__(self, num, stack_size, interrupted): """Create the request and reply queues, and 'num' worker threads. One must specify the stack size of the worker threads. The stack size is specified in kilobytes. """ self.requestQueue = queue.Queue(0) self.resultsQueue = queue.Queue(0) try: prev_size = threading.stack_size(stack_size*1024) except AttributeError as e: # Only print a warning if the stack size has been # explicitly set. if not explicit_stack_size is None: msg = "Setting stack size is unsupported by this version of Python:\n " + \ e.args[0] SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg) except ValueError as e: msg = "Setting stack size failed:\n " + str(e) SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg) # Create worker threads self.workers = [] for _ in range(num): worker = Worker(self.requestQueue, self.resultsQueue, interrupted) self.workers.append(worker) if 'prev_size' in locals(): threading.stack_size(prev_size) def put(self, task): """Put task into request queue.""" self.requestQueue.put(task) def get(self): """Remove and return a result tuple from the results queue.""" return self.resultsQueue.get() def preparation_failed(self, task): self.resultsQueue.put((task, False)) def cleanup(self): """ Shuts down the thread pool, giving each worker thread a chance to shut down gracefully. """ # For each worker thread, put a sentinel "None" value # on the requestQueue (indicating that there's no work # to be done) so that each worker thread will get one and # terminate gracefully. for _ in self.workers: self.requestQueue.put(None) # Wait for all of the workers to terminate. # # If we don't do this, later Python versions (2.4, 2.5) often # seem to raise exceptions during shutdown. This happens # in requestQueue.get(), as an assertion failure that # requestQueue.not_full is notified while not acquired, # seemingly because the main thread has shut down (or is # in the process of doing so) while the workers are still # trying to pull sentinels off the requestQueue. # # Normally these terminations should happen fairly quickly, # but we'll stick a one-second timeout on here just in case # someone gets hung. for worker in self.workers: worker.join(1.0) self.workers = [] class Parallel(object): """This class is used to execute tasks in parallel, and is somewhat less efficient than Serial, but is appropriate for parallel builds. This class is thread safe. """ def __init__(self, taskmaster, num, stack_size): """Create a new parallel job given a taskmaster. The taskmaster's next_task() method should return the next task that needs to be executed, or None if there are no more tasks. The taskmaster's executed() method will be called for each task when it is successfully executed, or failed() will be called if the task failed to execute (i.e. execute() raised an exception). Note: calls to taskmaster are serialized, but calls to execute() on distinct tasks are not serialized, because that is the whole point of parallel jobs: they can execute multiple tasks simultaneously. """ self.taskmaster = taskmaster self.interrupted = InterruptState() self.tp = ThreadPool(num, stack_size, self.interrupted) self.maxjobs = num def start(self): """Start the job. This will begin pulling tasks from the taskmaster and executing them, and return when there are no more tasks. If a task fails to execute (i.e. execute() raises an exception), then the job will stop.""" jobs = 0 while True: # Start up as many available tasks as we're # allowed to. while jobs < self.maxjobs: task = self.taskmaster.next_task() if task is None: break try: # prepare task for execution task.prepare() except: task.exception_set() task.failed() task.postprocess() else: if task.needs_execute(): # dispatch task self.tp.put(task) jobs = jobs + 1 else: task.executed() task.postprocess() if not task and not jobs: break # Let any/all completed tasks finish up before we go # back and put the next batch of tasks on the queue. while True: task, ok = self.tp.get() jobs = jobs - 1 if ok: task.executed() else: if self.interrupted(): try: raise SCons.Errors.BuildError( task.targets[0], errstr=interrupt_msg) except: task.exception_set() # Let the failed() callback function arrange # for the build to stop if that's appropriate. task.failed() task.postprocess() if self.tp.resultsQueue.empty(): break self.tp.cleanup() self.taskmaster.cleanup() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Executor.py0000664000175000017500000005341613160023041020714 0ustar bdbaddogbdbaddog"""SCons.Executor A module for executing actions with specific lists of target and source Nodes. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function __revision__ = "src/engine/SCons/Executor.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import collections import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Errors import SCons.Memoize from SCons.compat import with_metaclass, NoSlotsPyPy class Batch(object): """Remembers exact association between targets and sources of executor.""" __slots__ = ('targets', 'sources') def __init__(self, targets=[], sources=[]): self.targets = targets self.sources = sources class TSList(collections.UserList): """A class that implements $TARGETS or $SOURCES expansions by wrapping an executor Method. This class is used in the Executor.lvars() to delay creation of NodeList objects until they're needed. Note that we subclass collections.UserList purely so that the is_Sequence() function will identify an object of this class as a list during variable expansion. We're not really using any collections.UserList methods in practice. """ def __init__(self, func): self.func = func def __getattr__(self, attr): nl = self.func() return getattr(nl, attr) def __getitem__(self, i): nl = self.func() return nl[i] def __getslice__(self, i, j): nl = self.func() i = max(i, 0); j = max(j, 0) return nl[i:j] def __str__(self): nl = self.func() return str(nl) def __repr__(self): nl = self.func() return repr(nl) class TSObject(object): """A class that implements $TARGET or $SOURCE expansions by wrapping an Executor method. """ def __init__(self, func): self.func = func def __getattr__(self, attr): n = self.func() return getattr(n, attr) def __str__(self): n = self.func() if n: return str(n) return '' def __repr__(self): n = self.func() if n: return repr(n) return '' def rfile(node): """ A function to return the results of a Node's rfile() method, if it exists, and the Node itself otherwise (if it's a Value Node, e.g.). """ try: rfile = node.rfile except AttributeError: return node else: return rfile() def execute_nothing(obj, target, kw): return 0 def execute_action_list(obj, target, kw): """Actually execute the action list.""" env = obj.get_build_env() kw = obj.get_kw(kw) status = 0 for act in obj.get_action_list(): args = ([], [], env) status = act(*args, **kw) if isinstance(status, SCons.Errors.BuildError): status.executor = obj raise status elif status: msg = "Error %s" % status raise SCons.Errors.BuildError( errstr=msg, node=obj.batches[0].targets, executor=obj, action=act) return status _do_execute_map = {0 : execute_nothing, 1 : execute_action_list} def execute_actions_str(obj): env = obj.get_build_env() return "\n".join([action.genstring(obj.get_all_targets(), obj.get_all_sources(), env) for action in obj.get_action_list()]) def execute_null_str(obj): return '' _execute_str_map = {0 : execute_null_str, 1 : execute_actions_str} class Executor(object, with_metaclass(NoSlotsPyPy)): """A class for controlling instances of executing an action. This largely exists to hold a single association of an action, environment, list of environment override dictionaries, targets and sources for later processing as needed. """ __slots__ = ('pre_actions', 'post_actions', 'env', 'overridelist', 'batches', 'builder_kw', '_memo', 'lvars', '_changed_sources_list', '_changed_targets_list', '_unchanged_sources_list', '_unchanged_targets_list', 'action_list', '_do_execute', '_execute_str') def __init__(self, action, env=None, overridelist=[{}], targets=[], sources=[], builder_kw={}): if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Executor') self.set_action_list(action) self.pre_actions = [] self.post_actions = [] self.env = env self.overridelist = overridelist if targets or sources: self.batches = [Batch(targets[:], sources[:])] else: self.batches = [] self.builder_kw = builder_kw self._do_execute = 1 self._execute_str = 1 self._memo = {} def get_lvars(self): try: return self.lvars except AttributeError: self.lvars = { 'CHANGED_SOURCES' : TSList(self._get_changed_sources), 'CHANGED_TARGETS' : TSList(self._get_changed_targets), 'SOURCE' : TSObject(self._get_source), 'SOURCES' : TSList(self._get_sources), 'TARGET' : TSObject(self._get_target), 'TARGETS' : TSList(self._get_targets), 'UNCHANGED_SOURCES' : TSList(self._get_unchanged_sources), 'UNCHANGED_TARGETS' : TSList(self._get_unchanged_targets), } return self.lvars def _get_changes(self): cs = [] ct = [] us = [] ut = [] for b in self.batches: # don't add targets marked always build to unchanged lists # add to changed list as they always need to build if not b.targets[0].always_build and b.targets[0].is_up_to_date(): us.extend(list(map(rfile, b.sources))) ut.extend(b.targets) else: cs.extend(list(map(rfile, b.sources))) ct.extend(b.targets) self._changed_sources_list = SCons.Util.NodeList(cs) self._changed_targets_list = SCons.Util.NodeList(ct) self._unchanged_sources_list = SCons.Util.NodeList(us) self._unchanged_targets_list = SCons.Util.NodeList(ut) def _get_changed_sources(self, *args, **kw): try: return self._changed_sources_list except AttributeError: self._get_changes() return self._changed_sources_list def _get_changed_targets(self, *args, **kw): try: return self._changed_targets_list except AttributeError: self._get_changes() return self._changed_targets_list def _get_source(self, *args, **kw): return rfile(self.batches[0].sources[0]).get_subst_proxy() def _get_sources(self, *args, **kw): return SCons.Util.NodeList([rfile(n).get_subst_proxy() for n in self.get_all_sources()]) def _get_target(self, *args, **kw): return self.batches[0].targets[0].get_subst_proxy() def _get_targets(self, *args, **kw): return SCons.Util.NodeList([n.get_subst_proxy() for n in self.get_all_targets()]) def _get_unchanged_sources(self, *args, **kw): try: return self._unchanged_sources_list except AttributeError: self._get_changes() return self._unchanged_sources_list def _get_unchanged_targets(self, *args, **kw): try: return self._unchanged_targets_list except AttributeError: self._get_changes() return self._unchanged_targets_list def get_action_targets(self): if not self.action_list: return [] targets_string = self.action_list[0].get_targets(self.env, self) if targets_string[0] == '$': targets_string = targets_string[1:] return self.get_lvars()[targets_string] def set_action_list(self, action): import SCons.Util if not SCons.Util.is_List(action): if not action: import SCons.Errors raise SCons.Errors.UserError("Executor must have an action.") action = [action] self.action_list = action def get_action_list(self): if self.action_list is None: return [] return self.pre_actions + self.action_list + self.post_actions def get_all_targets(self): """Returns all targets for all batches of this Executor.""" result = [] for batch in self.batches: result.extend(batch.targets) return result def get_all_sources(self): """Returns all sources for all batches of this Executor.""" result = [] for batch in self.batches: result.extend(batch.sources) return result def get_all_children(self): """Returns all unique children (dependencies) for all batches of this Executor. The Taskmaster can recognize when it's already evaluated a Node, so we don't have to make this list unique for its intended canonical use case, but we expect there to be a lot of redundancy (long lists of batched .cc files #including the same .h files over and over), so removing the duplicates once up front should save the Taskmaster a lot of work. """ result = SCons.Util.UniqueList([]) for target in self.get_all_targets(): result.extend(target.children()) return result def get_all_prerequisites(self): """Returns all unique (order-only) prerequisites for all batches of this Executor. """ result = SCons.Util.UniqueList([]) for target in self.get_all_targets(): if target.prerequisites is not None: result.extend(target.prerequisites) return result def get_action_side_effects(self): """Returns all side effects for all batches of this Executor used by the underlying Action. """ result = SCons.Util.UniqueList([]) for target in self.get_action_targets(): result.extend(target.side_effects) return result @SCons.Memoize.CountMethodCall def get_build_env(self): """Fetch or create the appropriate build Environment for this Executor. """ try: return self._memo['get_build_env'] except KeyError: pass # Create the build environment instance with appropriate # overrides. These get evaluated against the current # environment's construction variables so that users can # add to existing values by referencing the variable in # the expansion. overrides = {} for odict in self.overridelist: overrides.update(odict) import SCons.Defaults env = self.env or SCons.Defaults.DefaultEnvironment() build_env = env.Override(overrides) self._memo['get_build_env'] = build_env return build_env def get_build_scanner_path(self, scanner): """Fetch the scanner path for this executor's targets and sources. """ env = self.get_build_env() try: cwd = self.batches[0].targets[0].cwd except (IndexError, AttributeError): cwd = None return scanner.path(env, cwd, self.get_all_targets(), self.get_all_sources()) def get_kw(self, kw={}): result = self.builder_kw.copy() result.update(kw) result['executor'] = self return result # use extra indirection because with new-style objects (Python 2.2 # and above) we can't override special methods, and nullify() needs # to be able to do this. def __call__(self, target, **kw): return _do_execute_map[self._do_execute](self, target, kw) def cleanup(self): self._memo = {} def add_sources(self, sources): """Add source files to this Executor's list. This is necessary for "multi" Builders that can be called repeatedly to build up a source file list for a given target.""" # TODO(batch): extend to multiple batches assert (len(self.batches) == 1) # TODO(batch): remove duplicates? sources = [x for x in sources if x not in self.batches[0].sources] self.batches[0].sources.extend(sources) def get_sources(self): return self.batches[0].sources def add_batch(self, targets, sources): """Add pair of associated target and source to this Executor's list. This is necessary for "batch" Builders that can be called repeatedly to build up a list of matching target and source files that will be used in order to update multiple target files at once from multiple corresponding source files, for tools like MSVC that support it.""" self.batches.append(Batch(targets, sources)) def prepare(self): """ Preparatory checks for whether this Executor can go ahead and (try to) build its targets. """ for s in self.get_all_sources(): if s.missing(): msg = "Source `%s' not found, needed by target `%s'." raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0])) def add_pre_action(self, action): self.pre_actions.append(action) def add_post_action(self, action): self.post_actions.append(action) # another extra indirection for new-style objects and nullify... def __str__(self): return _execute_str_map[self._execute_str](self) def nullify(self): self.cleanup() self._do_execute = 0 self._execute_str = 0 @SCons.Memoize.CountMethodCall def get_contents(self): """Fetch the signature contents. This is the main reason this class exists, so we can compute this once and cache it regardless of how many target or source Nodes there are. """ try: return self._memo['get_contents'] except KeyError: pass env = self.get_build_env() action_list = self.get_action_list() all_targets = self.get_all_targets() all_sources = self.get_all_sources() result = bytearray("",'utf-8').join([action.get_contents(all_targets, all_sources, env) for action in action_list]) self._memo['get_contents'] = result return result def get_timestamp(self): """Fetch a time stamp for this Executor. We don't have one, of course (only files do), but this is the interface used by the timestamp module. """ return 0 def scan_targets(self, scanner): # TODO(batch): scan by batches self.scan(scanner, self.get_all_targets()) def scan_sources(self, scanner): # TODO(batch): scan by batches if self.batches[0].sources: self.scan(scanner, self.get_all_sources()) def scan(self, scanner, node_list): """Scan a list of this Executor's files (targets or sources) for implicit dependencies and update all of the targets with them. This essentially short-circuits an N*M scan of the sources for each individual target, which is a hell of a lot more efficient. """ env = self.get_build_env() path = self.get_build_scanner_path kw = self.get_kw() # TODO(batch): scan by batches) deps = [] for node in node_list: node.disambiguate() deps.extend(node.get_implicit_deps(env, scanner, path, kw)) deps.extend(self.get_implicit_deps()) for tgt in self.get_all_targets(): tgt.add_to_implicit(deps) def _get_unignored_sources_key(self, node, ignore=()): return (node,) + tuple(ignore) @SCons.Memoize.CountDictCall(_get_unignored_sources_key) def get_unignored_sources(self, node, ignore=()): key = (node,) + tuple(ignore) try: memo_dict = self._memo['get_unignored_sources'] except KeyError: memo_dict = {} self._memo['get_unignored_sources'] = memo_dict else: try: return memo_dict[key] except KeyError: pass if node: # TODO: better way to do this (it's a linear search, # but it may not be critical path)? sourcelist = [] for b in self.batches: if node in b.targets: sourcelist = b.sources break else: sourcelist = self.get_all_sources() if ignore: idict = {} for i in ignore: idict[i] = 1 sourcelist = [s for s in sourcelist if s not in idict] memo_dict[key] = sourcelist return sourcelist def get_implicit_deps(self): """Return the executor's implicit dependencies, i.e. the nodes of the commands to be executed.""" result = [] build_env = self.get_build_env() for act in self.get_action_list(): deps = act.get_implicit_deps(self.get_all_targets(), self.get_all_sources(), build_env) result.extend(deps) return result _batch_executors = {} def GetBatchExecutor(key): return _batch_executors[key] def AddBatchExecutor(key, executor): assert key not in _batch_executors _batch_executors[key] = executor nullenv = None import SCons.Util class NullEnvironment(SCons.Util.Null): import SCons.CacheDir _CacheDir_path = None _CacheDir = SCons.CacheDir.CacheDir(None) def get_CacheDir(self): return self._CacheDir def get_NullEnvironment(): """Use singleton pattern for Null Environments.""" global nullenv if nullenv is None: nullenv = NullEnvironment() return nullenv class Null(object, with_metaclass(NoSlotsPyPy)): """A null Executor, with a null build Environment, that does nothing when the rest of the methods call it. This might be able to disappear when we refactor things to disassociate Builders from Nodes entirely, so we're not going to worry about unit tests for this--at least for now. """ __slots__ = ('pre_actions', 'post_actions', 'env', 'overridelist', 'batches', 'builder_kw', '_memo', 'lvars', '_changed_sources_list', '_changed_targets_list', '_unchanged_sources_list', '_unchanged_targets_list', 'action_list', '_do_execute', '_execute_str') def __init__(self, *args, **kw): if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Null') self.batches = [Batch(kw['targets'][:], [])] def get_build_env(self): return get_NullEnvironment() def get_build_scanner_path(self): return None def cleanup(self): pass def prepare(self): pass def get_unignored_sources(self, *args, **kw): return tuple(()) def get_action_targets(self): return [] def get_action_list(self): return [] def get_all_targets(self): return self.batches[0].targets def get_all_sources(self): return self.batches[0].targets[0].sources def get_all_children(self): return self.batches[0].targets[0].children() def get_all_prerequisites(self): return [] def get_action_side_effects(self): return [] def __call__(self, *args, **kw): return 0 def get_contents(self): return '' def _morph(self): """Morph this Null executor to a real Executor object.""" batches = self.batches self.__class__ = Executor self.__init__([]) self.batches = batches # The following methods require morphing this Null Executor to a # real Executor object. def add_pre_action(self, action): self._morph() self.add_pre_action(action) def add_post_action(self, action): self._morph() self.add_post_action(action) def set_action_list(self, action): self._morph() self.set_action_list(action) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/0000775000175000017500000000000013160023041020124 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Scanner/FortranTests.py0000664000175000017500000004246213160023041023144 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/FortranTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import sys import unittest import SCons.Scanner.Fortran import SCons.Node.FS import SCons.Warnings import TestCmd import TestUnit original = os.getcwd() test = TestCmd.TestCmd(workdir = '') os.chdir(test.workpath('')) # create some source files and headers: test.write('fff1.f',""" PROGRAM FOO INCLUDE 'f1.f' include 'f2.f' STOP END """) test.write('fff2.f',""" PROGRAM FOO INCLUDE 'f2.f' include 'd1/f2.f' INCLUDE 'd2/f2.f' STOP END """) test.write('fff3.f',""" PROGRAM FOO INCLUDE 'f3.f' ; INCLUDE\t'd1/f3.f' STOP END """) # for Emacs -> " test.subdir('d1', ['d1', 'd2']) headers = ['fi.f', 'never.f', 'd1/f1.f', 'd1/f2.f', 'd1/f3.f', 'd1/fi.f', 'd1/d2/f1.f', 'd1/d2/f2.f', 'd1/d2/f3.f', 'd1/d2/f4.f', 'd1/d2/fi.f'] for h in headers: test.write(h, "\n") test.subdir('include', 'subdir', ['subdir', 'include']) test.write('fff4.f',""" PROGRAM FOO INCLUDE 'f4.f' STOP END """) test.write('include/f4.f', "\n") test.write('subdir/include/f4.f', "\n") test.write('fff5.f',""" PROGRAM FOO INCLUDE 'f5.f' INCLUDE 'not_there.f' STOP END """) test.write('f5.f', "\n") test.subdir('repository', ['repository', 'include'], [ 'repository', 'src' ]) test.subdir('work', ['work', 'src']) test.write(['repository', 'include', 'iii.f'], "\n") test.write(['work', 'src', 'fff.f'], """ PROGRAM FOO INCLUDE 'iii.f' INCLUDE 'jjj.f' STOP END """) test.write([ 'work', 'src', 'aaa.f'], """ PROGRAM FOO INCLUDE 'bbb.f' STOP END """) test.write([ 'work', 'src', 'bbb.f'], "\n") test.write([ 'repository', 'src', 'ccc.f'], """ PROGRAM FOO INCLUDE 'ddd.f' STOP END """) test.write([ 'repository', 'src', 'ddd.f'], "\n") test.write('fff90a.f90',""" PROGRAM FOO ! Test comments - these includes should NOT be picked up C INCLUDE 'fi.f' # INCLUDE 'fi.f' ! INCLUDE 'fi.f' INCLUDE 'f1.f' ! in-line comments are valid syntax INCLUDE"fi.f" ! space is significant - this should be ignored INCLUDE ! Absoft compiler allows greater than/less than delimiters ! ! Allow kind type parameters INCLUDE kindType_"f3.f" INCLUDE kind_Type_"f4.f" ! ! Test multiple statements per line - use various spacings between semicolons incLUDE 'f5.f';include "f6.f" ; include ; include 'f8.f' ;include kindType_'f9.f' ! ! Test various USE statement syntaxes ! USE Mod01 use mod02 use use USE mOD03, ONLY : someVar USE MOD04 ,only:someVar USE Mod05 , ONLY: someVar ! in-line comment USE Mod06,ONLY :someVar,someOtherVar USE mod07;USE mod08; USE mod09 ;USE mod10 ; USE mod11 ! Test various semicolon placements use mod12 ;use mod13! Test comment at end of line ! USE modi ! USE modia ; use modib ! Scanner regexp will only ignore the first - this is a deficiency in the regexp ! USE modic ; ! use modid ! Scanner regexp should ignore both modules USE mod14 !; USE modi ! Only ignore the second USE mod15!;USE modi USE mod16 ! ; USE modi ! Test semicolon syntax - use various spacings USE :: mod17 USE::mod18 USE ::mod19 ; USE:: mod20 use, non_intrinsic :: mod21, ONLY : someVar ; use,intrinsic:: mod22 USE, NON_INTRINSIC::mod23 ; USE ,INTRINSIC ::mod24 USE mod25 ! Test USE statement at the beginning of line ; USE modi ! Scanner should ignore this since it isn't valid syntax USEmodi ! No space in between USE and module name - ignore it USE mod01 ! This one is a duplicate - there should only be one dependency to it. STOP END """) modules = ['mod01.mod', 'mod02.mod', 'mod03.mod', 'mod04.mod', 'mod05.mod', 'mod06.mod', 'mod07.mod', 'mod08.mod', 'mod09.mod', 'mod10.mod', 'mod11.mod', 'mod12.mod', 'mod13.mod', 'mod14.mod', 'mod15.mod', 'mod16.mod', 'mod17.mod', 'mod18.mod', 'mod19.mod', 'mod20.mod', 'mod21.mod', 'mod22.mod', 'mod23.mod', 'mod24.mod', 'mod25.mod'] for m in modules: test.write(m, "\n") test.subdir('modules') test.write(['modules', 'use.mod'], "\n") # define some helpers: class DummyEnvironment(object): def __init__(self, listCppPath): self.path = listCppPath self.fs = SCons.Node.FS.FS(test.workpath('')) def Dictionary(self, *args): if not args: return { 'FORTRANPATH': self.path, 'FORTRANMODSUFFIX' : ".mod" } elif len(args) == 1 and args[0] == 'FORTRANPATH': return self.path else: raise KeyError("Dummy environment only has FORTRANPATH attribute.") def has_key(self, key): return key in self.Dictionary() def __getitem__(self,key): return self.Dictionary()[key] def __setitem__(self,key,value): self.Dictionary()[key] = value def __delitem__(self,key): del self.Dictionary()[key] def subst(self, arg, target=None, source=None, conv=None): if arg[0] == '$': return self[arg[1:]] return arg def subst_path(self, path, target=None, source=None, conv=None): if not isinstance(path, list): path = [path] return list(map(self.subst, path)) def get_calculator(self): return None def get_factory(self, factory): return factory or self.fs.File def Dir(self, filename): return self.fs.Dir(filename) def File(self, filename): return self.fs.File(filename) def deps_match(self, deps, headers): scanned = list(map(os.path.normpath, list(map(str, deps)))) expect = list(map(os.path.normpath, headers)) self.failUnless(scanned == expect, "expect %s != scanned %s" % (expect, scanned)) # define some tests: class FortranScannerTestCase1(unittest.TestCase): def runTest(self): test.write('f1.f', "\n") test.write('f2.f', " INCLUDE 'fi.f'\n") env = DummyEnvironment([]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff1.f'), env, path) headers = ['f1.f', 'f2.f'] deps_match(self, deps, headers) test.unlink('f1.f') test.unlink('f2.f') class FortranScannerTestCase2(unittest.TestCase): def runTest(self): test.write('f1.f', "\n") test.write('f2.f', " INCLUDE 'fi.f'\n") env = DummyEnvironment([test.workpath("d1")]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff1.f'), env, path) headers = ['f1.f', 'f2.f'] deps_match(self, deps, headers) test.unlink('f1.f') test.unlink('f2.f') class FortranScannerTestCase3(unittest.TestCase): def runTest(self): env = DummyEnvironment([test.workpath("d1")]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff1.f'), env, path) headers = ['d1/f1.f', 'd1/f2.f'] deps_match(self, deps, headers) class FortranScannerTestCase4(unittest.TestCase): def runTest(self): test.write(['d1', 'f2.f'], " INCLUDE 'fi.f'\n") env = DummyEnvironment([test.workpath("d1")]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff1.f'), env, path) headers = ['d1/f1.f', 'd1/f2.f'] deps_match(self, deps, headers) test.write(['d1', 'f2.f'], "\n") class FortranScannerTestCase5(unittest.TestCase): def runTest(self): env = DummyEnvironment([test.workpath("d1")]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff2.f'), env, path) headers = ['d1/f2.f', 'd1/d2/f2.f', 'd1/f2.f'] deps_match(self, deps, headers) class FortranScannerTestCase6(unittest.TestCase): def runTest(self): test.write('f2.f', "\n") env = DummyEnvironment([test.workpath("d1")]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff2.f'), env, path) headers = ['d1/f2.f', 'd1/d2/f2.f', 'f2.f'] deps_match(self, deps, headers) test.unlink('f2.f') class FortranScannerTestCase7(unittest.TestCase): def runTest(self): env = DummyEnvironment([test.workpath("d1/d2"), test.workpath("d1")]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff2.f'), env, path) headers = ['d1/f2.f', 'd1/d2/f2.f', 'd1/d2/f2.f'] deps_match(self, deps, headers) class FortranScannerTestCase8(unittest.TestCase): def runTest(self): test.write('f2.f', "\n") env = DummyEnvironment([test.workpath("d1/d2"), test.workpath("d1")]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff2.f'), env, path) headers = ['d1/f2.f', 'd1/d2/f2.f', 'f2.f'] deps_match(self, deps, headers) test.unlink('f2.f') class FortranScannerTestCase9(unittest.TestCase): def runTest(self): test.write('f3.f', "\n") env = DummyEnvironment([]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) n = env.File('fff3.f') def my_rexists(s): s.Tag('rexists_called', 1) return SCons.Node._rexists_map[s.GetTag('old_rexists')](s) n.Tag('old_rexists', n._func_rexists) SCons.Node._rexists_map[3] = my_rexists n._func_rexists = 3 deps = s(n, env, path) # Make sure rexists() got called on the file node being # scanned, essential for cooperation with VariantDir functionality. assert n.GetTag('rexists_called') headers = ['d1/f3.f', 'f3.f'] deps_match(self, deps, headers) test.unlink('f3.f') class FortranScannerTestCase10(unittest.TestCase): def runTest(self): env = DummyEnvironment(["include"]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps1 = s(env.File('fff4.f'), env, path) env.fs.chdir(env.Dir('subdir')) dir = env.fs.getcwd() env.fs.chdir(env.Dir('')) path = s.path(env, dir) deps2 = s(env.File('#fff4.f'), env, path) headers1 = list(map(test.workpath, ['include/f4.f'])) headers2 = ['include/f4.f'] deps_match(self, deps1, headers1) deps_match(self, deps2, headers2) class FortranScannerTestCase11(unittest.TestCase): def runTest(self): SCons.Warnings.enableWarningClass(SCons.Warnings.DependencyWarning) class TestOut(object): def __call__(self, x): self.out = x to = TestOut() to.out = None SCons.Warnings._warningOut = to env = DummyEnvironment([]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff5.f'), env, path) # Did we catch the warning from not finding not_there.f? assert to.out deps_match(self, deps, [ 'f5.f' ]) class FortranScannerTestCase12(unittest.TestCase): def runTest(self): env = DummyEnvironment([]) env.fs.chdir(env.Dir('include')) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) test.write('include/fff4.f', test.read('fff4.f')) deps = s(env.File('#include/fff4.f'), env, path) env.fs.chdir(env.Dir('')) deps_match(self, deps, ['f4.f']) test.unlink('include/fff4.f') class FortranScannerTestCase13(unittest.TestCase): def runTest(self): os.chdir(test.workpath('work')) fs = SCons.Node.FS.FS(test.workpath('work')) fs.Repository(test.workpath('repository')) # Create a derived file in a directory that does not exist yet. # This was a bug at one time. f1=fs.File('include2/jjj.f') f1.builder=1 env = DummyEnvironment(['include','include2']) env.fs = fs s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(fs.File('src/fff.f'), env, path) deps_match(self, deps, [test.workpath('repository/include/iii.f'), 'include2/jjj.f']) os.chdir(test.workpath('')) class FortranScannerTestCase14(unittest.TestCase): def runTest(self): os.chdir(test.workpath('work')) fs = SCons.Node.FS.FS(test.workpath('work')) fs.VariantDir('build1', 'src', 1) fs.VariantDir('build2', 'src', 0) fs.Repository(test.workpath('repository')) env = DummyEnvironment([]) env.fs = fs s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps1 = s(fs.File('build1/aaa.f'), env, path) deps_match(self, deps1, [ 'build1/bbb.f' ]) deps2 = s(fs.File('build2/aaa.f'), env, path) deps_match(self, deps2, [ 'src/bbb.f' ]) deps3 = s(fs.File('build1/ccc.f'), env, path) deps_match(self, deps3, [ 'build1/ddd.f' ]) deps4 = s(fs.File('build2/ccc.f'), env, path) deps_match(self, deps4, [ test.workpath('repository/src/ddd.f') ]) os.chdir(test.workpath('')) class FortranScannerTestCase15(unittest.TestCase): def runTest(self): class SubstEnvironment(DummyEnvironment): def subst(self, arg, target=None, source=None, conv=None, test=test): if arg == "$junk": return test.workpath("d1") else: return arg test.write(['d1', 'f2.f'], " INCLUDE 'fi.f'\n") env = SubstEnvironment(["$junk"]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff1.f'), env, path) headers = ['d1/f1.f', 'd1/f2.f'] deps_match(self, deps, headers) test.write(['d1', 'f2.f'], "\n") class FortranScannerTestCase16(unittest.TestCase): def runTest(self): test.write('f1.f', "\n") test.write('f2.f', "\n") test.write('f3.f', "\n") test.write('f4.f', "\n") test.write('f5.f', "\n") test.write('f6.f', "\n") test.write('f7.f', "\n") test.write('f8.f', "\n") test.write('f9.f', "\n") test.write('f10.f', "\n") env = DummyEnvironment([test.workpath('modules')]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff90a.f90'), env, path) headers = ['f1.f', 'f2.f', 'f3.f', 'f4.f', 'f5.f', 'f6.f', 'f7.f', 'f8.f', 'f9.f'] modules = ['mod01.mod', 'mod02.mod', 'mod03.mod', 'mod04.mod', 'mod05.mod', 'mod06.mod', 'mod07.mod', 'mod08.mod', 'mod09.mod', 'mod10.mod', 'mod11.mod', 'mod12.mod', 'mod13.mod', 'mod14.mod', 'mod15.mod', 'mod16.mod', 'mod17.mod', 'mod18.mod', 'mod19.mod', 'mod20.mod', 'mod21.mod', 'mod22.mod', 'mod23.mod', 'mod24.mod', 'mod25.mod', 'modules/use.mod'] deps_expected = headers + modules deps_match(self, deps, deps_expected) test.unlink('f1.f') test.unlink('f2.f') test.unlink('f3.f') test.unlink('f4.f') test.unlink('f5.f') test.unlink('f6.f') test.unlink('f7.f') test.unlink('f8.f') test.unlink('f9.f') test.unlink('f10.f') def suite(): suite = unittest.TestSuite() suite.addTest(FortranScannerTestCase1()) suite.addTest(FortranScannerTestCase2()) suite.addTest(FortranScannerTestCase3()) suite.addTest(FortranScannerTestCase4()) suite.addTest(FortranScannerTestCase5()) suite.addTest(FortranScannerTestCase6()) suite.addTest(FortranScannerTestCase7()) suite.addTest(FortranScannerTestCase8()) suite.addTest(FortranScannerTestCase9()) suite.addTest(FortranScannerTestCase10()) suite.addTest(FortranScannerTestCase11()) suite.addTest(FortranScannerTestCase12()) suite.addTest(FortranScannerTestCase13()) suite.addTest(FortranScannerTestCase14()) suite.addTest(FortranScannerTestCase15()) suite.addTest(FortranScannerTestCase16()) return suite if __name__ == "__main__": TestUnit.run(suite()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/RC.py0000664000175000017500000000441113160023041021002 0ustar bdbaddogbdbaddog"""SCons.Scanner.RC This module implements the dependency scanner for RC (Interface Definition Language) files. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/RC.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import re import SCons.Node.FS import SCons.Scanner def no_tlb(nodes): """ Filter out .tlb files as they are binary and shouldn't be scanned """ # print("Nodes:%s"%[str(n) for n in nodes]) return [n for n in nodes if str(n)[-4:] != '.tlb'] def RCScan(): """Return a prototype Scanner instance for scanning RC source files""" res_re= r'^(?:\s*#\s*(?:include)|' \ '.*?\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \ '\s*.*?)' \ '\s*(<|"| )([^>"\s]+)(?:[>"\s])*$' resScanner = SCons.Scanner.ClassicCPP("ResourceScanner", "$RCSUFFIXES", "CPPPATH", res_re, recursive=no_tlb) return resScanner # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/__init__.py0000664000175000017500000003530113160023041022237 0ustar bdbaddogbdbaddog"""SCons.Scanner The Scanner package for the SCons software construction utility. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import re import SCons.Node.FS import SCons.Util class _Null(object): pass # This is used instead of None as a default argument value so None can be # used as an actual argument value. _null = _Null def Scanner(function, *args, **kw): """ Public interface factory function for creating different types of Scanners based on the different types of "functions" that may be supplied. TODO: Deprecate this some day. We've moved the functionality inside the Base class and really don't need this factory function any more. It was, however, used by some of our Tool modules, so the call probably ended up in various people's custom modules patterned on SCons code. """ if SCons.Util.is_Dict(function): return Selector(function, *args, **kw) else: return Base(function, *args, **kw) class FindPathDirs(object): """ A class to bind a specific E{*}PATH variable name to a function that will return all of the E{*}path directories. """ def __init__(self, variable): self.variable = variable def __call__(self, env, dir=None, target=None, source=None, argument=None): import SCons.PathList try: path = env[self.variable] except KeyError: return () dir = dir or env.fs._cwd path = SCons.PathList.PathList(path).subst_path(env, target, source) return tuple(dir.Rfindalldirs(path)) class Base(object): """ The base class for dependency scanners. This implements straightforward, single-pass scanning of a single file. """ def __init__(self, function, name = "NONE", argument = _null, skeys = _null, path_function = None, # Node.FS.Base so that, by default, it's okay for a # scanner to return a Dir, File or Entry. node_class = SCons.Node.FS.Base, node_factory = None, scan_check = None, recursive = None): """ Construct a new scanner object given a scanner function. 'function' - a scanner function taking two or three arguments and returning a list of strings. 'name' - a name for identifying this scanner object. 'argument' - an optional argument that, if specified, will be passed to both the scanner function and the path_function. 'skeys' - an optional list argument that can be used to determine which scanner should be used for a given Node. In the case of File nodes, for example, the 'skeys' would be file suffixes. 'path_function' - a function that takes four or five arguments (a construction environment, Node for the directory containing the SConscript file that defined the primary target, list of target nodes, list of source nodes, and optional argument for this instance) and returns a tuple of the directories that can be searched for implicit dependency files. May also return a callable() which is called with no args and returns the tuple (supporting Bindable class). 'node_class' - the class of Nodes which this scan will return. If node_class is None, then this scanner will not enforce any Node conversion and will return the raw results from the underlying scanner function. 'node_factory' - the factory function to be called to translate the raw results returned by the scanner function into the expected node_class objects. 'scan_check' - a function to be called to first check whether this node really needs to be scanned. 'recursive' - specifies that this scanner should be invoked recursively on all of the implicit dependencies it returns (the canonical example being #include lines in C source files). May be a callable, which will be called to filter the list of nodes found to select a subset for recursive scanning (the canonical example being only recursively scanning subdirectories within a directory). The scanner function's first argument will be a Node that should be scanned for dependencies, the second argument will be an Environment object, the third argument will be the tuple of paths returned by the path_function, and the fourth argument will be the value passed into 'argument', and the returned list should contain the Nodes for all the direct dependencies of the file. Examples: s = Scanner(my_scanner_function) s = Scanner(function = my_scanner_function) s = Scanner(function = my_scanner_function, argument = 'foo') """ # Note: this class could easily work with scanner functions that take # something other than a filename as an argument (e.g. a database # node) and a dependencies list that aren't file names. All that # would need to be changed is the documentation. self.function = function self.path_function = path_function self.name = name self.argument = argument if skeys is _null: if SCons.Util.is_Dict(function): skeys = list(function.keys()) else: skeys = [] self.skeys = skeys self.node_class = node_class self.node_factory = node_factory self.scan_check = scan_check if callable(recursive): self.recurse_nodes = recursive elif recursive: self.recurse_nodes = self._recurse_all_nodes else: self.recurse_nodes = self._recurse_no_nodes def path(self, env, dir=None, target=None, source=None): if not self.path_function: return () if self.argument is not _null: return self.path_function(env, dir, target, source, self.argument) else: return self.path_function(env, dir, target, source) def __call__(self, node, env, path=()): """ This method scans a single object. 'node' is the node that will be passed to the scanner function, and 'env' is the environment that will be passed to the scanner function. A list of direct dependency nodes for the specified node will be returned. """ if self.scan_check and not self.scan_check(node, env): return [] self = self.select(node) if not self.argument is _null: node_list = self.function(node, env, path, self.argument) else: node_list = self.function(node, env, path) kw = {} if hasattr(node, 'dir'): kw['directory'] = node.dir node_factory = env.get_factory(self.node_factory) nodes = [] for l in node_list: if self.node_class and not isinstance(l, self.node_class): l = node_factory(l, **kw) nodes.append(l) return nodes def __eq__(self, other): try: return self.__dict__ == other.__dict__ except AttributeError: # other probably doesn't have a __dict__ return self.__dict__ == other def __hash__(self): return id(self) def __str__(self): return self.name def add_skey(self, skey): """Add a skey to the list of skeys""" self.skeys.append(skey) def get_skeys(self, env=None): if env and SCons.Util.is_String(self.skeys): return env.subst_list(self.skeys)[0] return self.skeys def select(self, node): if SCons.Util.is_Dict(self.function): key = node.scanner_key() try: return self.function[key] except KeyError: return None else: return self def _recurse_all_nodes(self, nodes): return nodes def _recurse_no_nodes(self, nodes): return [] # recurse_nodes = _recurse_no_nodes def add_scanner(self, skey, scanner): self.function[skey] = scanner self.add_skey(skey) class Selector(Base): """ A class for selecting a more specific scanner based on the scanner_key() (suffix) for a specific Node. TODO: This functionality has been moved into the inner workings of the Base class, and this class will be deprecated at some point. (It was never exposed directly as part of the public interface, although it is used by the Scanner() factory function that was used by various Tool modules and therefore was likely a template for custom modules that may be out there.) """ def __init__(self, dict, *args, **kw): Base.__init__(self, None, *args, **kw) self.dict = dict self.skeys = list(dict.keys()) def __call__(self, node, env, path=()): return self.select(node)(node, env, path) def select(self, node): try: return self.dict[node.scanner_key()] except KeyError: return None def add_scanner(self, skey, scanner): self.dict[skey] = scanner self.add_skey(skey) class Current(Base): """ A class for scanning files that are source files (have no builder) or are derived files and are current (which implies that they exist, either locally or in a repository). """ def __init__(self, *args, **kw): def current_check(node, env): return not node.has_builder() or node.is_up_to_date() kw['scan_check'] = current_check Base.__init__(self, *args, **kw) class Classic(Current): """ A Scanner subclass to contain the common logic for classic CPP-style include scanning, but which can be customized to use different regular expressions to find the includes. Note that in order for this to work "out of the box" (without overriding the find_include() and sort_key() methods), the regular expression passed to the constructor must return the name of the include file in group 0. """ def __init__(self, name, suffixes, path_variable, regex, *args, **kw): self.cre = re.compile(regex, re.M) def _scan(node, _, path=(), self=self): node = node.rfile() if not node.exists(): return [] return self.scan(node, path) kw['function'] = _scan kw['path_function'] = FindPathDirs(path_variable) # Allow recursive to propagate if child class specifies. # In this case resource scanner needs to specify a filter on which files # get recursively processed. Previously was hardcoded to 1 instead of # defaulted to 1. kw['recursive'] = kw.get('recursive', 1) kw['skeys'] = suffixes kw['name'] = name Current.__init__(self, *args, **kw) def find_include(self, include, source_dir, path): n = SCons.Node.FS.find_file(include, (source_dir,) + tuple(path)) return n, include def sort_key(self, include): return SCons.Node.FS._my_normcase(include) def find_include_names(self, node): return self.cre.findall(node.get_text_contents()) def scan(self, node, path=()): # cache the includes list in node so we only scan it once: if node.includes is not None: includes = node.includes else: includes = self.find_include_names(node) # Intern the names of the include files. Saves some memory # if the same header is included many times. node.includes = list(map(SCons.Util.silent_intern, includes)) # This is a hand-coded DSU (decorate-sort-undecorate, or # Schwartzian transform) pattern. The sort key is the raw name # of the file as specifed on the #include line (including the # " or <, since that may affect what file is found), which lets # us keep the sort order constant regardless of whether the file # is actually found in a Repository or locally. nodes = [] source_dir = node.get_dir() if callable(path): path = path() for include in includes: n, i = self.find_include(include, source_dir, path) if n is None: SCons.Warnings.warn(SCons.Warnings.DependencyWarning, "No dependency generated for file: %s (included from: %s) -- file not found" % (i, node)) else: nodes.append((self.sort_key(include), n)) return [pair[1] for pair in sorted(nodes)] class ClassicCPP(Classic): """ A Classic Scanner subclass which takes into account the type of bracketing used to include the file, and uses classic CPP rules for searching for the files based on the bracketing. Note that in order for this to work, the regular expression passed to the constructor must return the leading bracket in group 0, and the contained filename in group 1. """ def find_include(self, include, source_dir, path): include = list(map(SCons.Util.to_str, include)) if include[0] == '"': paths = (source_dir,) + tuple(path) else: paths = tuple(path) + (source_dir,) n = SCons.Node.FS.find_file(include[1], paths) i = SCons.Util.silent_intern(include[1]) return n, i def sort_key(self, include): return SCons.Node.FS._my_normcase(' '.join(include)) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/LaTeX.py0000664000175000017500000004230613160023041021460 0ustar bdbaddogbdbaddog"""SCons.Scanner.LaTeX This module implements the dependency scanner for LaTeX code. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/LaTeX.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import re import SCons.Scanner import SCons.Util # list of graphics file extensions for TeX and LaTeX TexGraphics = ['.eps', '.ps'] #LatexGraphics = ['.pdf', '.png', '.jpg', '.gif', '.tif'] LatexGraphics = [ '.png', '.jpg', '.gif', '.tif'] # Used as a return value of modify_env_var if the variable is not set. class _Null(object): pass _null = _Null # The user specifies the paths in env[variable], similar to other builders. # They may be relative and must be converted to absolute, as expected # by LaTeX and Co. The environment may already have some paths in # env['ENV'][var]. These paths are honored, but the env[var] paths have # higher precedence. All changes are un-done on exit. def modify_env_var(env, var, abspath): try: save = env['ENV'][var] except KeyError: save = _null env.PrependENVPath(var, abspath) try: if SCons.Util.is_List(env[var]): env.PrependENVPath(var, [os.path.abspath(str(p)) for p in env[var]]) else: # Split at os.pathsep to convert into absolute path env.PrependENVPath(var, [os.path.abspath(p) for p in str(env[var]).split(os.pathsep)]) except KeyError: pass # Convert into a string explicitly to append ":" (without which it won't search system # paths as well). The problem is that env.AppendENVPath(var, ":") # does not work, refuses to append ":" (os.pathsep). if SCons.Util.is_List(env['ENV'][var]): env['ENV'][var] = os.pathsep.join(env['ENV'][var]) # Append the trailing os.pathsep character here to catch the case with no env[var] env['ENV'][var] = env['ENV'][var] + os.pathsep return save class FindENVPathDirs(object): """ A class to bind a specific E{*}PATH variable name to a function that will return all of the E{*}path directories. """ def __init__(self, variable): self.variable = variable def __call__(self, env, dir=None, target=None, source=None, argument=None): import SCons.PathList try: path = env['ENV'][self.variable] except KeyError: return () dir = dir or env.fs._cwd path = SCons.PathList.PathList(path).subst_path(env, target, source) return tuple(dir.Rfindalldirs(path)) def LaTeXScanner(): """ Return a prototype Scanner instance for scanning LaTeX source files when built with latex. """ ds = LaTeX(name = "LaTeXScanner", suffixes = '$LATEXSUFFIXES', # in the search order, see below in LaTeX class docstring graphics_extensions = TexGraphics, recursive = 0) return ds def PDFLaTeXScanner(): """ Return a prototype Scanner instance for scanning LaTeX source files when built with pdflatex. """ ds = LaTeX(name = "PDFLaTeXScanner", suffixes = '$LATEXSUFFIXES', # in the search order, see below in LaTeX class docstring graphics_extensions = LatexGraphics, recursive = 0) return ds class LaTeX(SCons.Scanner.Base): """ Class for scanning LaTeX files for included files. Unlike most scanners, which use regular expressions that just return the included file name, this returns a tuple consisting of the keyword for the inclusion ("include", "includegraphics", "input", or "bibliography"), and then the file name itself. Based on a quick look at LaTeX documentation, it seems that we should append .tex suffix for the "include" keywords, append .tex if there is no extension for the "input" keyword, and need to add .bib for the "bibliography" keyword that does not accept extensions by itself. Finally, if there is no extension for an "includegraphics" keyword latex will append .ps or .eps to find the file, while pdftex may use .pdf, .jpg, .tif, .mps, or .png. The actual subset and search order may be altered by DeclareGraphicsExtensions command. This complication is ignored. The default order corresponds to experimentation with teTeX:: $ latex --version pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4) kpathsea version 3.5.4 The order is: ['.eps', '.ps'] for latex ['.png', '.pdf', '.jpg', '.tif']. Another difference is that the search path is determined by the type of the file being searched: env['TEXINPUTS'] for "input" and "include" keywords env['TEXINPUTS'] for "includegraphics" keyword env['TEXINPUTS'] for "lstinputlisting" keyword env['BIBINPUTS'] for "bibliography" keyword env['BSTINPUTS'] for "bibliographystyle" keyword env['INDEXSTYLE'] for "makeindex" keyword, no scanning support needed just allows user to set it if needed. FIXME: also look for the class or style in document[class|style]{} FIXME: also look for the argument of bibliographystyle{} """ keyword_paths = {'include': 'TEXINPUTS', 'input': 'TEXINPUTS', 'includegraphics': 'TEXINPUTS', 'bibliography': 'BIBINPUTS', 'bibliographystyle': 'BSTINPUTS', 'addbibresource': 'BIBINPUTS', 'addglobalbib': 'BIBINPUTS', 'addsectionbib': 'BIBINPUTS', 'makeindex': 'INDEXSTYLE', 'usepackage': 'TEXINPUTS', 'lstinputlisting': 'TEXINPUTS'} env_variables = SCons.Util.unique(list(keyword_paths.values())) two_arg_commands = ['import', 'subimport', 'includefrom', 'subincludefrom', 'inputfrom', 'subinputfrom'] def __init__(self, name, suffixes, graphics_extensions, *args, **kw): # We have to include \n with the % we exclude from the first part # part of the regex because the expression is compiled with re.M. # Without the \n, the ^ could match the beginning of a *previous* # line followed by one or more newline characters (i.e. blank # lines), interfering with a match on the next line. # add option for whitespace before the '[options]' or the '{filename}' regex = r''' ^[^%\n]* \\( include | includegraphics(?:\s*\[[^\]]+\])? | lstinputlisting(?:\[[^\]]+\])? | input | import | subimport | includefrom | subincludefrom | inputfrom | subinputfrom | bibliography | addbibresource | addglobalbib | addsectionbib | usepackage ) \s*{([^}]*)} # first arg (?: \s*{([^}]*)} )? # maybe another arg ''' self.cre = re.compile(regex, re.M | re.X) self.comment_re = re.compile(r'^((?:(?:\\%)|[^%\n])*)(.*)$', re.M) self.graphics_extensions = graphics_extensions def _scan(node, env, path=(), self=self): node = node.rfile() if not node.exists(): return [] return self.scan_recurse(node, path) class FindMultiPathDirs(object): """The stock FindPathDirs function has the wrong granularity: it is called once per target, while we need the path that depends on what kind of included files is being searched. This wrapper hides multiple instances of FindPathDirs, one per the LaTeX path variable in the environment. When invoked, the function calculates and returns all the required paths as a dictionary (converted into a tuple to become hashable). Then the scan function converts it back and uses a dictionary of tuples rather than a single tuple of paths. """ def __init__(self, dictionary): self.dictionary = {} for k,n in dictionary.items(): self.dictionary[k] = ( SCons.Scanner.FindPathDirs(n), FindENVPathDirs(n) ) def __call__(self, env, dir=None, target=None, source=None, argument=None): di = {} for k,(c,cENV) in self.dictionary.items(): di[k] = ( c(env, dir=None, target=None, source=None, argument=None) , cENV(env, dir=None, target=None, source=None, argument=None) ) # To prevent "dict is not hashable error" return tuple(di.items()) class LaTeXScanCheck(object): """Skip all but LaTeX source files, i.e., do not scan *.eps, *.pdf, *.jpg, etc. """ def __init__(self, suffixes): self.suffixes = suffixes def __call__(self, node, env): current = not node.has_builder() or node.is_up_to_date() scannable = node.get_suffix() in env.subst_list(self.suffixes)[0] # Returning false means that the file is not scanned. return scannable and current kw['function'] = _scan kw['path_function'] = FindMultiPathDirs(LaTeX.keyword_paths) kw['recursive'] = 0 kw['skeys'] = suffixes kw['scan_check'] = LaTeXScanCheck(suffixes) kw['name'] = name SCons.Scanner.Base.__init__(self, *args, **kw) def _latex_names(self, include_type, filename): if include_type == 'input': base, ext = os.path.splitext( filename ) if ext == "": return [filename + '.tex'] if include_type in ('include', 'import', 'subimport', 'includefrom', 'subincludefrom', 'inputfrom', 'subinputfrom'): base, ext = os.path.splitext( filename ) if ext == "": return [filename + '.tex'] if include_type == 'bibliography': base, ext = os.path.splitext( filename ) if ext == "": return [filename + '.bib'] if include_type == 'usepackage': base, ext = os.path.splitext( filename ) if ext == "": return [filename + '.sty'] if include_type == 'includegraphics': base, ext = os.path.splitext( filename ) if ext == "": #return [filename+e for e in self.graphics_extensions + TexGraphics] # use the line above to find dependencies for the PDF builder # when only an .eps figure is present. Since it will be found # if the user tells scons how to make the pdf figure, leave # it out for now. return [filename+e for e in self.graphics_extensions] return [filename] def sort_key(self, include): return SCons.Node.FS._my_normcase(str(include)) def find_include(self, include, source_dir, path): inc_type, inc_subdir, inc_filename = include try: sub_paths = path[inc_type] except (IndexError, KeyError): sub_paths = ((), ()) try_names = self._latex_names(inc_type, inc_filename) # There are three search paths to try: # 1. current directory "source_dir" # 2. env[var] # 3. env['ENV'][var] search_paths = [(source_dir,)] + list(sub_paths) for n in try_names: for search_path in search_paths: paths = tuple([d.Dir(inc_subdir) for d in search_path]) i = SCons.Node.FS.find_file(n, paths) if i: return i, include return None, include def canonical_text(self, text): """Standardize an input TeX-file contents. Currently: * removes comments, unwrapping comment-wrapped lines. """ out = [] line_continues_a_comment = False for line in text.splitlines(): line,comment = self.comment_re.findall(line)[0] if line_continues_a_comment == True: out[-1] = out[-1] + line.lstrip() else: out.append(line) line_continues_a_comment = len(comment) > 0 return '\n'.join(out).rstrip()+'\n' def scan(self, node, subdir='.'): # Modify the default scan function to allow for the regular # expression to return a comma separated list of file names # as can be the case with the bibliography keyword. # Cache the includes list in node so we only scan it once: # path_dict = dict(list(path)) # add option for whitespace (\s) before the '[' noopt_cre = re.compile('\s*\[.*$') if node.includes != None: includes = node.includes else: text = self.canonical_text(node.get_text_contents()) includes = self.cre.findall(text) # 1. Split comma-separated lines, e.g. # ('bibliography', 'phys,comp') # should become two entries # ('bibliography', 'phys') # ('bibliography', 'comp') # 2. Remove the options, e.g., such as # ('includegraphics[clip,width=0.7\\linewidth]', 'picture.eps') # should become # ('includegraphics', 'picture.eps') split_includes = [] for include in includes: inc_type = noopt_cre.sub('', include[0]) inc_subdir = subdir if inc_type in self.two_arg_commands: inc_subdir = os.path.join(subdir, include[1]) inc_list = include[2].split(',') else: inc_list = include[1].split(',') for j in range(len(inc_list)): split_includes.append( (inc_type, inc_subdir, inc_list[j]) ) # includes = split_includes node.includes = includes return includes def scan_recurse(self, node, path=()): """ do a recursive scan of the top level target file This lets us search for included files based on the directory of the main file just as latex does""" path_dict = dict(list(path)) queue = [] queue.extend( self.scan(node) ) seen = {} # This is a hand-coded DSU (decorate-sort-undecorate, or # Schwartzian transform) pattern. The sort key is the raw name # of the file as specifed on the \include, \input, etc. line. # TODO: what about the comment in the original Classic scanner: # """which lets # us keep the sort order constant regardless of whether the file # is actually found in a Repository or locally.""" nodes = [] source_dir = node.get_dir() #for include in includes: while queue: include = queue.pop() inc_type, inc_subdir, inc_filename = include try: if seen[inc_filename] == 1: continue except KeyError: seen[inc_filename] = 1 # # Handle multiple filenames in include[1] # n, i = self.find_include(include, source_dir, path_dict) if n is None: # Do not bother with 'usepackage' warnings, as they most # likely refer to system-level files if inc_type != 'usepackage': SCons.Warnings.warn(SCons.Warnings.DependencyWarning, "No dependency generated for file: %s (included from: %s) -- file not found" % (i, node)) else: sortkey = self.sort_key(n) nodes.append((sortkey, n)) # recurse down queue.extend( self.scan(n, inc_subdir) ) return [pair[1] for pair in sorted(nodes)] # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/ScannerTests.py0000664000175000017500000005404013160023041023115 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Scanner/ScannerTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import collections import sys import unittest import TestUnit import SCons.Scanner class DummyFS(object): def File(self, name): return DummyNode(name) class DummyEnvironment(collections.UserDict): def __init__(self, dict=None, **kw): collections.UserDict.__init__(self, dict) self.data.update(kw) self.fs = DummyFS() def subst(self, strSubst, target=None, source=None, conv=None): if strSubst[0] == '$': return self.data[strSubst[1:]] return strSubst def subst_list(self, strSubst, target=None, source=None, conv=None): if strSubst[0] == '$': return [self.data[strSubst[1:]]] return [[strSubst]] def subst_path(self, path, target=None, source=None, conv=None): if not isinstance(path, list): path = [path] return list(map(self.subst, path)) def get_factory(self, factory): return factory or self.fs.File class DummyNode(object): def __init__(self, name, search_result=()): self.name = name self.search_result = tuple(search_result) def rexists(self): return 1 def __str__(self): return self.name def Rfindalldirs(self, pathlist): return self.search_result + pathlist class FindPathDirsTestCase(unittest.TestCase): def test_FindPathDirs(self): """Test the FindPathDirs callable class""" env = DummyEnvironment(LIBPATH = [ 'foo' ]) env.fs = DummyFS() env.fs._cwd = DummyNode('cwd') dir = DummyNode('dir', ['xxx']) fpd = SCons.Scanner.FindPathDirs('LIBPATH') result = fpd(env) assert str(result) == "('foo',)", result result = fpd(env, dir) assert str(result) == "('xxx', 'foo')", result class ScannerTestCase(unittest.TestCase): def test_creation(self): """Test creation of Scanner objects""" def func(self): pass s = SCons.Scanner.Base(func) assert isinstance(s, SCons.Scanner.Base), s s = SCons.Scanner.Base({}) assert isinstance(s, SCons.Scanner.Base), s s = SCons.Scanner.Base(func, name='fooscan') assert str(s) == 'fooscan', str(s) s = SCons.Scanner.Base({}, name='barscan') assert str(s) == 'barscan', str(s) s = SCons.Scanner.Base(func, name='fooscan', argument=9) assert str(s) == 'fooscan', str(s) assert s.argument == 9, s.argument s = SCons.Scanner.Base({}, name='fooscan', argument=888) assert str(s) == 'fooscan', str(s) assert s.argument == 888, s.argument class BaseTestCase(unittest.TestCase): class skey_node(object): def __init__(self, key): self.key = key def scanner_key(self): return self.key def rexists(self): return 1 def func(self, filename, env, target, *args): self.filename = filename self.env = env self.target = target if len(args) > 0: self.arg = args[0] return self.deps def test(self, scanner, env, filename, deps, *args): self.deps = deps path = scanner.path(env) scanned = scanner(filename, env, path) scanned_strs = [str(x) for x in scanned] self.failUnless(self.filename == filename, "the filename was passed incorrectly") self.failUnless(self.env == env, "the environment was passed incorrectly") self.failUnless(scanned_strs == deps, "the dependencies were returned incorrectly") for d in scanned: self.failUnless(not isinstance(d, str), "got a string in the dependencies") if len(args) > 0: self.failUnless(self.arg == args[0], "the argument was passed incorrectly") else: self.failIf(hasattr(self, "arg"), "an argument was given when it shouldn't have been") def test___call__dict(self): """Test calling Scanner.Base objects with a dictionary""" called = [] def s1func(node, env, path, called=called): called.append('s1func') called.append(node) return [] def s2func(node, env, path, called=called): called.append('s2func') called.append(node) return [] s1 = SCons.Scanner.Base(s1func) s2 = SCons.Scanner.Base(s2func) selector = SCons.Scanner.Base({'.x' : s1, '.y' : s2}) nx = self.skey_node('.x') env = DummyEnvironment() selector(nx, env, []) assert called == ['s1func', nx], called del called[:] ny = self.skey_node('.y') selector(ny, env, []) assert called == ['s2func', ny], called def test_path(self): """Test the Scanner.Base path() method""" def pf(env, cwd, target, source, argument=None): return "pf: %s %s %s %s %s" % \ (env.VARIABLE, cwd, target[0], source[0], argument) env = DummyEnvironment() env.VARIABLE = 'v1' target = DummyNode('target') source = DummyNode('source') s = SCons.Scanner.Base(self.func, path_function=pf) p = s.path(env, 'here', [target], [source]) assert p == "pf: v1 here target source None", p s = SCons.Scanner.Base(self.func, path_function=pf, argument="xyz") p = s.path(env, 'here', [target], [source]) assert p == "pf: v1 here target source xyz", p def test_positional(self): """Test the Scanner.Base class using positional arguments""" s = SCons.Scanner.Base(self.func, "Pos") env = DummyEnvironment() env.VARIABLE = "var1" self.test(s, env, DummyNode('f1.cpp'), ['f1.h', 'f1.hpp']) env = DummyEnvironment() env.VARIABLE = "i1" self.test(s, env, DummyNode('i1.cpp'), ['i1.h', 'i1.hpp']) def test_keywords(self): """Test the Scanner.Base class using keyword arguments""" s = SCons.Scanner.Base(function = self.func, name = "Key") env = DummyEnvironment() env.VARIABLE = "var2" self.test(s, env, DummyNode('f2.cpp'), ['f2.h', 'f2.hpp']) env = DummyEnvironment() env.VARIABLE = "i2" self.test(s, env, DummyNode('i2.cpp'), ['i2.h', 'i2.hpp']) def test_pos_opt(self): """Test the Scanner.Base class using both position and optional arguments""" arg = "this is the argument" s = SCons.Scanner.Base(self.func, "PosArg", arg) env = DummyEnvironment() env.VARIABLE = "var3" self.test(s, env, DummyNode('f3.cpp'), ['f3.h', 'f3.hpp'], arg) env = DummyEnvironment() env.VARIABLE = "i3" self.test(s, env, DummyNode('i3.cpp'), ['i3.h', 'i3.hpp'], arg) def test_key_opt(self): """Test the Scanner.Base class using both keyword and optional arguments""" arg = "this is another argument" s = SCons.Scanner.Base(function = self.func, name = "KeyArg", argument = arg) env = DummyEnvironment() env.VARIABLE = "var4" self.test(s, env, DummyNode('f4.cpp'), ['f4.h', 'f4.hpp'], arg) env = DummyEnvironment() env.VARIABLE = "i4" self.test(s, env, DummyNode('i4.cpp'), ['i4.h', 'i4.hpp'], arg) def test___cmp__(self): """Test the Scanner.Base class __cmp__() method""" s = SCons.Scanner.Base(self.func, "Cmp") assert s != None def test_hash(self): """Test the Scanner.Base class __hash__() method""" s = SCons.Scanner.Base(self.func, "Hash") dict = {} dict[s] = 777 i = hash(id(s)) h = hash(list(dict.keys())[0]) self.failUnless(h == i, "hash Scanner base class expected %s, got %s" % (i, h)) def test_scan_check(self): """Test the Scanner.Base class scan_check() method""" def my_scan(filename, env, target, *args): return [] def check(node, env, s=self): s.checked[str(node)] = 1 return 1 env = DummyEnvironment() s = SCons.Scanner.Base(my_scan, "Check", scan_check = check) self.checked = {} path = s.path(env) scanned = s(DummyNode('x'), env, path) self.failUnless(self.checked['x'] == 1, "did not call check function") def test_recursive(self): """Test the Scanner.Base class recursive flag""" nodes = [1, 2, 3, 4] s = SCons.Scanner.Base(function = self.func) n = s.recurse_nodes(nodes) self.failUnless(n == [], "default behavior returned nodes: %s" % n) s = SCons.Scanner.Base(function = self.func, recursive = None) n = s.recurse_nodes(nodes) self.failUnless(n == [], "recursive = None returned nodes: %s" % n) s = SCons.Scanner.Base(function = self.func, recursive = 1) n = s.recurse_nodes(nodes) self.failUnless(n == n, "recursive = 1 didn't return all nodes: %s" % n) def odd_only(nodes): return [n for n in nodes if n % 2] s = SCons.Scanner.Base(function = self.func, recursive = odd_only) n = s.recurse_nodes(nodes) self.failUnless(n == [1, 3], "recursive = 1 didn't return all nodes: %s" % n) def test_get_skeys(self): """Test the Scanner.Base get_skeys() method""" s = SCons.Scanner.Base(function = self.func) sk = s.get_skeys() self.failUnless(sk == [], "did not initialize to expected []") s = SCons.Scanner.Base(function = self.func, skeys = ['.1', '.2']) sk = s.get_skeys() self.failUnless(sk == ['.1', '.2'], "sk was %s, not ['.1', '.2']") s = SCons.Scanner.Base(function = self.func, skeys = '$LIST') env = DummyEnvironment(LIST = ['.3', '.4']) sk = s.get_skeys(env) self.failUnless(sk == ['.3', '.4'], "sk was %s, not ['.3', '.4']") def test_select(self): """Test the Scanner.Base select() method""" scanner = SCons.Scanner.Base(function = self.func) s = scanner.select('.x') assert s is scanner, s selector = SCons.Scanner.Base({'.x' : 1, '.y' : 2}) s = selector.select(self.skey_node('.x')) assert s == 1, s s = selector.select(self.skey_node('.y')) assert s == 2, s s = selector.select(self.skey_node('.z')) assert s is None, s def test_add_scanner(self): """Test the Scanner.Base add_scanner() method""" selector = SCons.Scanner.Base({'.x' : 1, '.y' : 2}) s = selector.select(self.skey_node('.z')) assert s is None, s selector.add_scanner('.z', 3) s = selector.select(self.skey_node('.z')) assert s == 3, s def test___str__(self): """Test the Scanner.Base __str__() method""" scanner = SCons.Scanner.Base(function = self.func) s = str(scanner) assert s == 'NONE', s scanner = SCons.Scanner.Base(function = self.func, name = 'xyzzy') s = str(scanner) assert s == 'xyzzy', s class SelectorTestCase(unittest.TestCase): class skey_node(object): def __init__(self, key): self.key = key def scanner_key(self): return self.key def rexists(self): return 1 def test___init__(self): """Test creation of Scanner.Selector object""" s = SCons.Scanner.Selector({}) assert isinstance(s, SCons.Scanner.Selector), s assert s.dict == {}, s.dict def test___call__(self): """Test calling Scanner.Selector objects""" called = [] def s1func(node, env, path, called=called): called.append('s1func') called.append(node) return [] def s2func(node, env, path, called=called): called.append('s2func') called.append(node) return [] s1 = SCons.Scanner.Base(s1func) s2 = SCons.Scanner.Base(s2func) selector = SCons.Scanner.Selector({'.x' : s1, '.y' : s2}) nx = self.skey_node('.x') env = DummyEnvironment() selector(nx, env, []) assert called == ['s1func', nx], called del called[:] ny = self.skey_node('.y') selector(ny, env, []) assert called == ['s2func', ny], called def test_select(self): """Test the Scanner.Selector select() method""" selector = SCons.Scanner.Selector({'.x' : 1, '.y' : 2}) s = selector.select(self.skey_node('.x')) assert s == 1, s s = selector.select(self.skey_node('.y')) assert s == 2, s s = selector.select(self.skey_node('.z')) assert s is None, s def test_add_scanner(self): """Test the Scanner.Selector add_scanner() method""" selector = SCons.Scanner.Selector({'.x' : 1, '.y' : 2}) s = selector.select(self.skey_node('.z')) assert s is None, s selector.add_scanner('.z', 3) s = selector.select(self.skey_node('.z')) assert s == 3, s class CurrentTestCase(unittest.TestCase): def test_class(self): """Test the Scanner.Current class""" class MyNode(object): def __init__(self): self.called_has_builder = None self.called_is_up_to_date = None self.func_called = None def rexists(self): return 1 class HasNoBuilder(MyNode): def has_builder(self): self.called_has_builder = 1 return None class IsNotCurrent(MyNode): def has_builder(self): self.called_has_builder = 1 return 1 def is_up_to_date(self): self.called_is_up_to_date = 1 return None class IsCurrent(MyNode): def has_builder(self): self.called_has_builder = 1 return 1 def is_up_to_date(self): self.called_is_up_to_date = 1 return 1 def func(node, env, path): node.func_called = 1 return [] env = DummyEnvironment() s = SCons.Scanner.Current(func) path = s.path(env) hnb = HasNoBuilder() s(hnb, env, path) self.failUnless(hnb.called_has_builder, "did not call has_builder()") self.failUnless(not hnb.called_is_up_to_date, "did call is_up_to_date()") self.failUnless(hnb.func_called, "did not call func()") inc = IsNotCurrent() s(inc, env, path) self.failUnless(inc.called_has_builder, "did not call has_builder()") self.failUnless(inc.called_is_up_to_date, "did not call is_up_to_date()") self.failUnless(not inc.func_called, "did call func()") ic = IsCurrent() s(ic, env, path) self.failUnless(ic.called_has_builder, "did not call has_builder()") self.failUnless(ic.called_is_up_to_date, "did not call is_up_to_date()") self.failUnless(ic.func_called, "did not call func()") class ClassicTestCase(unittest.TestCase): def func(self, filename, env, target, *args): self.filename = filename self.env = env self.target = target if len(args) > 0: self.arg = args[0] return self.deps def test_find_include(self): """Test the Scanner.Classic find_include() method""" env = DummyEnvironment() s = SCons.Scanner.Classic("t", ['.suf'], 'MYPATH', '^my_inc (\S+)') def _find_file(filename, paths): return paths[0]+'/'+filename save = SCons.Node.FS.find_file SCons.Node.FS.find_file = _find_file try: n, i = s.find_include('aaa', 'foo', ('path',)) assert n == 'foo/aaa', n assert i == 'aaa', i finally: SCons.Node.FS.find_file = save def test_name(self): """Test setting the Scanner.Classic name""" s = SCons.Scanner.Classic("my_name", ['.s'], 'MYPATH', '^my_inc (\S+)') assert s.name == "my_name", s.name def test_scan(self): """Test the Scanner.Classic scan() method""" class MyNode(object): def __init__(self, name): self.name = name self._rfile = self self.includes = None def rfile(self): return self._rfile def exists(self): return self._exists def get_contents(self): return self._contents def get_text_contents(self): return self._contents def get_dir(self): return self._dir class MyScanner(SCons.Scanner.Classic): def find_include(self, include, source_dir, path): return include, include env = DummyEnvironment() s = MyScanner("t", ['.suf'], 'MYPATH', '^my_inc (\S+)') # This set of tests is intended to test the scanning operation # of the Classic scanner. # Note that caching has been added for not just the includes # but the entire scan call. The caching is based on the # arguments, so we will fiddle with the path parameter to # defeat this caching for the purposes of these tests. # If the node doesn't exist, scanning turns up nothing. n1 = MyNode("n1") n1._exists = None ret = s.function(n1, env) assert ret == [], ret # Verify that it finds includes from the contents. n = MyNode("n") n._exists = 1 n._dir = MyNode("n._dir") n._contents = 'my_inc abc\n' ret = s.function(n, env, ('foo',)) assert ret == ['abc'], ret # Verify that it uses the cached include info. n._contents = 'my_inc def\n' ret = s.function(n, env, ('foo2',)) assert ret == ['abc'], ret # Verify that if we wipe the cache, it uses the new contents. n.includes = None ret = s.function(n, env, ('foo3',)) assert ret == ['def'], ret # We no longer cache overall scan results, which would be returned # if individual results are de-cached. If we ever restore that # functionality, this test goes back here. #ret = s.function(n, env, ('foo2',)) #assert ret == ['abc'], 'caching inactive; got: %s'%ret # Verify that it sorts what it finds. n.includes = ['xyz', 'uvw'] ret = s.function(n, env, ('foo4',)) assert ret == ['uvw', 'xyz'], ret # Verify that we use the rfile() node. nr = MyNode("nr") nr._exists = 1 nr._dir = MyNode("nr._dir") nr.includes = ['jkl', 'mno'] n._rfile = nr ret = s.function(n, env, ('foo5',)) assert ret == ['jkl', 'mno'], ret def test_recursive(self): """Test the Scanner.Classic class recursive flag""" nodes = [1, 2, 3, 4] s = SCons.Scanner.Classic("Test", [], None, "", function=self.func, recursive=1) n = s.recurse_nodes(nodes) self.failUnless(n == n, "recursive = 1 didn't return all nodes: %s" % n) def odd_only(nodes): return [n for n in nodes if n % 2] s = SCons.Scanner.Classic("Test", [], None, "", function=self.func, recursive=odd_only) n = s.recurse_nodes(nodes) self.failUnless(n == [1, 3], "recursive = 1 didn't return all nodes: %s" % n) class ClassicCPPTestCase(unittest.TestCase): def test_find_include(self): """Test the Scanner.ClassicCPP find_include() method""" env = DummyEnvironment() s = SCons.Scanner.ClassicCPP("Test", [], None, "") def _find_file(filename, paths): return paths[0]+'/'+filename save = SCons.Node.FS.find_file SCons.Node.FS.find_file = _find_file try: n, i = s.find_include(('"', 'aaa'), 'foo', ('path',)) assert n == 'foo/aaa', n assert i == 'aaa', i n, i = s.find_include(('<', 'bbb'), 'foo', ('path',)) assert n == 'path/bbb', n assert i == 'bbb', i n, i = s.find_include(('<', u'ccc'), 'foo', ('path',)) assert n == 'path/ccc', n assert i == 'ccc', i finally: SCons.Node.FS.find_file = save def suite(): suite = unittest.TestSuite() tclasses = [ FindPathDirsTestCase, ScannerTestCase, BaseTestCase, SelectorTestCase, CurrentTestCase, ClassicTestCase, ClassicCPPTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) return suite if __name__ == "__main__": TestUnit.run(suite()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/Fortran.py0000664000175000017500000003376413160023041022126 0ustar bdbaddogbdbaddog"""SCons.Scanner.Fortran This module implements the dependency scanner for Fortran code. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Scanner/Fortran.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import re import SCons.Node import SCons.Node.FS import SCons.Scanner import SCons.Util import SCons.Warnings class F90Scanner(SCons.Scanner.Classic): """ A Classic Scanner subclass for Fortran source files which takes into account both USE and INCLUDE statements. This scanner will work for both F77 and F90 (and beyond) compilers. Currently, this scanner assumes that the include files do not contain USE statements. To enable the ability to deal with USE statements in include files, add logic right after the module names are found to loop over each include file, search for and locate each USE statement, and append each module name to the list of dependencies. Caching the search results in a common dictionary somewhere so that the same include file is not searched multiple times would be a smart thing to do. """ def __init__(self, name, suffixes, path_variable, use_regex, incl_regex, def_regex, *args, **kw): self.cre_use = re.compile(use_regex, re.M) self.cre_incl = re.compile(incl_regex, re.M) self.cre_def = re.compile(def_regex, re.M) def _scan(node, env, path, self=self): node = node.rfile() if not node.exists(): return [] return self.scan(node, env, path) kw['function'] = _scan kw['path_function'] = SCons.Scanner.FindPathDirs(path_variable) kw['recursive'] = 1 kw['skeys'] = suffixes kw['name'] = name SCons.Scanner.Current.__init__(self, *args, **kw) def scan(self, node, env, path=()): # cache the includes list in node so we only scan it once: if node.includes != None: mods_and_includes = node.includes else: # retrieve all included filenames includes = self.cre_incl.findall(node.get_text_contents()) # retrieve all USE'd module names modules = self.cre_use.findall(node.get_text_contents()) # retrieve all defined module names defmodules = self.cre_def.findall(node.get_text_contents()) # Remove all USE'd module names that are defined in the same file # (case-insensitively) d = {} for m in defmodules: d[m.lower()] = 1 modules = [m for m in modules if m.lower() not in d] # Convert module name to a .mod filename suffix = env.subst('$FORTRANMODSUFFIX') modules = [x.lower() + suffix for x in modules] # Remove unique items from the list mods_and_includes = SCons.Util.unique(includes+modules) node.includes = mods_and_includes # This is a hand-coded DSU (decorate-sort-undecorate, or # Schwartzian transform) pattern. The sort key is the raw name # of the file as specifed on the USE or INCLUDE line, which lets # us keep the sort order constant regardless of whether the file # is actually found in a Repository or locally. nodes = [] source_dir = node.get_dir() if callable(path): path = path() for dep in mods_and_includes: n, i = self.find_include(dep, source_dir, path) if n is None: SCons.Warnings.warn(SCons.Warnings.DependencyWarning, "No dependency generated for file: %s (referenced by: %s) -- file not found" % (i, node)) else: sortkey = self.sort_key(dep) nodes.append((sortkey, n)) return [pair[1] for pair in sorted(nodes)] def FortranScan(path_variable="FORTRANPATH"): """Return a prototype Scanner instance for scanning source files for Fortran USE & INCLUDE statements""" # The USE statement regex matches the following: # # USE module_name # USE :: module_name # USE, INTRINSIC :: module_name # USE, NON_INTRINSIC :: module_name # # Limitations # # -- While the regex can handle multiple USE statements on one line, # it cannot properly handle them if they are commented out. # In either of the following cases: # # ! USE mod_a ; USE mod_b [entire line is commented out] # USE mod_a ! ; USE mod_b [in-line comment of second USE statement] # # the second module name (mod_b) will be picked up as a dependency # even though it should be ignored. The only way I can see # to rectify this would be to modify the scanner to eliminate # the call to re.findall, read in the contents of the file, # treating the comment character as an end-of-line character # in addition to the normal linefeed, loop over each line, # weeding out the comments, and looking for the USE statements. # One advantage to this is that the regex passed to the scanner # would no longer need to match a semicolon. # # -- I question whether or not we need to detect dependencies to # INTRINSIC modules because these are built-in to the compiler. # If we consider them a dependency, will SCons look for them, not # find them, and kill the build? Or will we there be standard # compiler-specific directories we will need to point to so the # compiler and SCons can locate the proper object and mod files? # Here is a breakdown of the regex: # # (?i) : regex is case insensitive # ^ : start of line # (?: : group a collection of regex symbols without saving the match as a "group" # ^|; : matches either the start of the line or a semicolon - semicolon # ) : end the unsaved grouping # \s* : any amount of white space # USE : match the string USE, case insensitive # (?: : group a collection of regex symbols without saving the match as a "group" # \s+| : match one or more whitespace OR .... (the next entire grouped set of regex symbols) # (?: : group a collection of regex symbols without saving the match as a "group" # (?: : establish another unsaved grouping of regex symbols # \s* : any amount of white space # , : match a comma # \s* : any amount of white space # (?:NON_)? : optionally match the prefix NON_, case insensitive # INTRINSIC : match the string INTRINSIC, case insensitive # )? : optionally match the ", INTRINSIC/NON_INTRINSIC" grouped expression # \s* : any amount of white space # :: : match a double colon that must appear after the INTRINSIC/NON_INTRINSIC attribute # ) : end the unsaved grouping # ) : end the unsaved grouping # \s* : match any amount of white space # (\w+) : match the module name that is being USE'd # # use_regex = "(?i)(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)" # The INCLUDE statement regex matches the following: # # INCLUDE 'some_Text' # INCLUDE "some_Text" # INCLUDE "some_Text" ; INCLUDE "some_Text" # INCLUDE kind_"some_Text" # INCLUDE kind_'some_Text" # # where some_Text can include any alphanumeric and/or special character # as defined by the Fortran 2003 standard. # # Limitations: # # -- The Fortran standard dictates that a " or ' in the INCLUDE'd # string must be represented as a "" or '', if the quotes that wrap # the entire string are either a ' or ", respectively. While the # regular expression below can detect the ' or " characters just fine, # the scanning logic, presently is unable to detect them and reduce # them to a single instance. This probably isn't an issue since, # in practice, ' or " are not generally used in filenames. # # -- This regex will not properly deal with multiple INCLUDE statements # when the entire line has been commented out, ala # # ! INCLUDE 'some_file' ; INCLUDE 'some_file' # # In such cases, it will properly ignore the first INCLUDE file, # but will actually still pick up the second. Interestingly enough, # the regex will properly deal with these cases: # # INCLUDE 'some_file' # INCLUDE 'some_file' !; INCLUDE 'some_file' # # To get around the above limitation, the FORTRAN programmer could # simply comment each INCLUDE statement separately, like this # # ! INCLUDE 'some_file' !; INCLUDE 'some_file' # # The way I see it, the only way to get around this limitation would # be to modify the scanning logic to replace the calls to re.findall # with a custom loop that processes each line separately, throwing # away fully commented out lines before attempting to match against # the INCLUDE syntax. # # Here is a breakdown of the regex: # # (?i) : regex is case insensitive # (?: : begin a non-saving group that matches the following: # ^ : either the start of the line # | : or # ['">]\s*; : a semicolon that follows a single quote, # double quote or greater than symbol (with any # amount of whitespace in between). This will # allow the regex to match multiple INCLUDE # statements per line (although it also requires # the positive lookahead assertion that is # used below). It will even properly deal with # (i.e. ignore) cases in which the additional # INCLUDES are part of an in-line comment, ala # " INCLUDE 'someFile' ! ; INCLUDE 'someFile2' " # ) : end of non-saving group # \s* : any amount of white space # INCLUDE : match the string INCLUDE, case insensitive # \s+ : match one or more white space characters # (?\w+_)? : match the optional "kind-param _" prefix allowed by the standard # [<"'] : match the include delimiter - an apostrophe, double quote, or less than symbol # (.+?) : match one or more characters that make up # the included path and file name and save it # in a group. The Fortran standard allows for # any non-control character to be used. The dot # operator will pick up any character, including # control codes, but I can't conceive of anyone # putting control codes in their file names. # The question mark indicates it is non-greedy so # that regex will match only up to the next quote, # double quote, or greater than symbol # (?=["'>]) : positive lookahead assertion to match the include # delimiter - an apostrophe, double quote, or # greater than symbol. This level of complexity # is required so that the include delimiter is # not consumed by the match, thus allowing the # sub-regex discussed above to uniquely match a # set of semicolon-separated INCLUDE statements # (as allowed by the F2003 standard) include_regex = """(?i)(?:^|['">]\s*;)\s*INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])""" # The MODULE statement regex finds module definitions by matching # the following: # # MODULE module_name # # but *not* the following: # # MODULE PROCEDURE procedure_name # # Here is a breakdown of the regex: # # (?i) : regex is case insensitive # ^\s* : any amount of white space # MODULE : match the string MODULE, case insensitive # \s+ : match one or more white space characters # (?!PROCEDURE) : but *don't* match if the next word matches # PROCEDURE (negative lookahead assertion), # case insensitive # (\w+) : match one or more alphanumeric characters # that make up the defined module name and # save it in a group def_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)""" scanner = F90Scanner("FortranScan", "$FORTRANSUFFIXES", path_variable, use_regex, include_regex, def_regex) return scanner # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/LaTeXTests.py0000664000175000017500000001254113160023041022501 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/LaTeXTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import collections import os import sys import unittest import TestCmd import TestUnit import SCons.Node.FS import SCons.Scanner.LaTeX test = TestCmd.TestCmd(workdir = '') test.write('test1.latex',""" \include{inc1} \input{inc2} include{incNO} %\include{incNO} xyzzy \include{inc6} \subimport{subdir}{inc3} \import{subdir}{inc3a} \includefrom{subdir}{inc3b} \subincludefrom{subdir}{inc3c} \inputfrom{subdir}{inc3d} \subinputfrom{subdir}{inc3e} """) test.write('test2.latex',""" \include{inc1} \include{inc3} """) test.write('test3.latex',""" \includegraphics{inc4.eps} \includegraphics[width=60mm]{inc5.xyz} """) test.subdir('subdir') test.write('inc1.tex',"\n") test.write('inc2.tex',"\n") test.write(['subdir', 'inc3.tex'], "\n") for suffix in 'abcde': test.write(['subdir', 'inc3%s.tex' % suffix], "\n") test.write(['subdir', 'inc3b.tex'], "\n") test.write(['subdir', 'inc3c.tex'], "\n") test.write(['subdir', 'inc4.eps'], "\n") test.write('inc5.xyz', "\n") test.write('inc6.tex', "\n") test.write('incNO.tex', "\n") # define some helpers: # copied from CTest.py class DummyEnvironment(collections.UserDict): def __init__(self, **kw): collections.UserDict.__init__(self) self.data.update(kw) self.fs = SCons.Node.FS.FS(test.workpath('')) def Dictionary(self, *args): return self.data def subst(self, strSubst, target=None, source=None, conv=None): if strSubst[0] == '$': return self.data[strSubst[1:]] return strSubst def subst_list(self, strSubst, target=None, source=None, conv=None): if strSubst[0] == '$': return [self.data[strSubst[1:]]] return [[strSubst]] def subst_path(self, path, target=None, source=None, conv=None): if not isinstance(path, list): path = [path] return list(map(self.subst, path)) def get_calculator(self): return None def get_factory(self, factory): return factory or self.fs.File def Dir(self, filename): return self.fs.Dir(filename) def File(self, filename): return self.fs.File(filename) if os.path.normcase('foo') == os.path.normcase('FOO'): my_normpath = os.path.normcase else: my_normpath = os.path.normpath def deps_match(self, deps, headers): global my_normpath scanned = list(map(my_normpath, list(map(str, deps)))) expect = list(map(my_normpath, headers)) self.failUnless(scanned == expect, "expect %s != scanned %s" % (expect, scanned)) class LaTeXScannerTestCase1(unittest.TestCase): def runTest(self): env = DummyEnvironment(LATEXSUFFIXES = [".tex", ".ltx", ".latex"]) s = SCons.Scanner.LaTeX.LaTeXScanner() path = s.path(env) deps = s(env.File('test1.latex'), env, path) headers = ['inc1.tex', 'inc2.tex', 'inc6.tex', 'subdir/inc3.tex', 'subdir/inc3a.tex', 'subdir/inc3b.tex', 'subdir/inc3c.tex', 'subdir/inc3d.tex', 'subdir/inc3e.tex'] deps_match(self, deps, headers) class LaTeXScannerTestCase2(unittest.TestCase): def runTest(self): env = DummyEnvironment(TEXINPUTS=[test.workpath("subdir")],LATEXSUFFIXES = [".tex", ".ltx", ".latex"]) s = SCons.Scanner.LaTeX.LaTeXScanner() path = s.path(env) deps = s(env.File('test2.latex'), env, path) headers = ['inc1.tex', 'subdir/inc3.tex'] deps_match(self, deps, headers) class LaTeXScannerTestCase3(unittest.TestCase): def runTest(self): env = DummyEnvironment(TEXINPUTS=[test.workpath("subdir")],LATEXSUFFIXES = [".tex", ".ltx", ".latex"]) s = SCons.Scanner.LaTeX.LaTeXScanner() path = s.path(env) deps = s(env.File('test3.latex'), env, path) files = ['inc5.xyz', 'subdir/inc4.eps'] deps_match(self, deps, files) def suite(): suite = unittest.TestSuite() suite.addTest(LaTeXScannerTestCase1()) suite.addTest(LaTeXScannerTestCase2()) suite.addTest(LaTeXScannerTestCase3()) return suite if __name__ == "__main__": TestUnit.run(suite()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/DirTests.py0000664000175000017500000001143313160023041022241 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/DirTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import sys import unittest import TestCmd import TestUnit import SCons.Node.FS import SCons.Scanner.Dir #class DummyNode: # def __init__(self, name, fs): # self.name = name # self.abspath = test.workpath(name) # self.fs = fs # def __str__(self): # return self.name # def Entry(self, name): # return self.fs.Entry(name) class DummyEnvironment(object): def __init__(self, root): self.fs = SCons.Node.FS.FS(root) def Dir(self, name): return self.fs.Dir(name) def Entry(self, name): return self.fs.Entry(name) def File(self, name): return self.fs.File(name) def get_factory(self, factory): return factory or self.fs.Entry class DirScannerTestBase(unittest.TestCase): def setUp(self): self.test = TestCmd.TestCmd(workdir = '') self.test.subdir('dir', ['dir', 'sub']) self.test.write(['dir', 'f1'], "dir/f1\n") self.test.write(['dir', 'f2'], "dir/f2\n") self.test.write(['dir', '.sconsign'], "dir/.sconsign\n") self.test.write(['dir', '.sconsign.bak'], "dir/.sconsign.bak\n") self.test.write(['dir', '.sconsign.dat'], "dir/.sconsign.dat\n") self.test.write(['dir', '.sconsign.db'], "dir/.sconsign.db\n") self.test.write(['dir', '.sconsign.dblite'], "dir/.sconsign.dblite\n") self.test.write(['dir', '.sconsign.dir'], "dir/.sconsign.dir\n") self.test.write(['dir', '.sconsign.pag'], "dir/.sconsign.pag\n") self.test.write(['dir', 'sub', 'f3'], "dir/sub/f3\n") self.test.write(['dir', 'sub', 'f4'], "dir/sub/f4\n") self.test.write(['dir', 'sub', '.sconsign'], "dir/.sconsign\n") self.test.write(['dir', 'sub', '.sconsign.bak'], "dir/.sconsign.bak\n") self.test.write(['dir', 'sub', '.sconsign.dat'], "dir/.sconsign.dat\n") self.test.write(['dir', 'sub', '.sconsign.dblite'], "dir/.sconsign.dblite\n") self.test.write(['dir', 'sub', '.sconsign.dir'], "dir/.sconsign.dir\n") self.test.write(['dir', 'sub', '.sconsign.pag'], "dir/.sconsign.pag\n") class DirScannerTestCase(DirScannerTestBase): def runTest(self): env = DummyEnvironment(self.test.workpath()) s = SCons.Scanner.Dir.DirScanner() expect = [ os.path.join('dir', 'f1'), os.path.join('dir', 'f2'), os.path.join('dir', 'sub'), ] deps = s(env.Dir('dir'), env, ()) sss = list(map(str, deps)) assert sss == expect, sss expect = [ os.path.join('dir', 'sub', 'f3'), os.path.join('dir', 'sub', 'f4'), ] deps = s(env.Dir('dir/sub'), env, ()) sss = list(map(str, deps)) assert sss == expect, sss class DirEntryScannerTestCase(DirScannerTestBase): def runTest(self): env = DummyEnvironment(self.test.workpath()) s = SCons.Scanner.Dir.DirEntryScanner() deps = s(env.Dir('dir'), env, ()) sss = list(map(str, deps)) assert sss == [], sss deps = s(env.Dir('dir/sub'), env, ()) sss = list(map(str, deps)) assert sss == [], sss # Make sure we don't blow up if handed a non-Dir node. deps = s(env.File('dir/f1'), env, ()) sss = list(map(str, deps)) assert sss == [], sss def suite(): suite = unittest.TestSuite() suite.addTest(DirScannerTestCase()) suite.addTest(DirEntryScannerTestCase()) return suite if __name__ == "__main__": TestUnit.run(suite()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/RCTests.py0000664000175000017500000001234413160023041022031 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/RCTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import unittest import sys import collections import os import TestCmd import TestUnit import SCons.Scanner.RC import SCons.Node.FS import SCons.Warnings test = TestCmd.TestCmd(workdir = '') os.chdir(test.workpath('')) # create some source files and headers: test.write('t1.rc',''' #include "t1.h" ''') test.write('t2.rc',""" #include "t1.h" ICO_TEST ICON DISCARDABLE "abc.ico" BMP_TEST BITMAP DISCARDABLE "def.bmp" cursor1 CURSOR "bullseye.cur" ID_RESPONSE_ERROR_PAGE HTML "responseerrorpage.htm" 5 FONT "cmroman.fnt" 1 MESSAGETABLE "MSG00409.bin" 1 MESSAGETABLE MSG00410.bin 1 TYPELIB "testtypelib.tlb" TEST_REGIS REGISTRY MOVEABLE PURE "testregis.rgs" TEST_D3DFX D3DFX DISCARDABLE "testEffect.fx" """) test.write('t3.rc','#include "t1.h"\r\n') # Create dummy include files headers = ['t1.h', 'abc.ico','def.bmp','bullseye.cur','responseerrorpage.htm','cmroman.fnt', 'testEffect.fx', 'MSG00409.bin','MSG00410.bin','testtypelib.tlb','testregis.rgs'] for h in headers: test.write(h, " ") # define some helpers: class DummyEnvironment(collections.UserDict): def __init__(self,**kw): collections.UserDict.__init__(self) self.data.update(kw) self.fs = SCons.Node.FS.FS(test.workpath('')) def Dictionary(self, *args): return self.data def subst(self, arg, target=None, source=None, conv=None): if strSubst[0] == '$': return self.data[strSubst[1:]] return strSubst def subst_path(self, path, target=None, source=None, conv=None): if not isinstance(path, list): path = [path] return list(map(self.subst, path)) def has_key(self, key): return key in self.Dictionary() def get_calculator(self): return None def get_factory(self, factory): return factory or self.fs.File def Dir(self, filename): return self.fs.Dir(filename) def File(self, filename): return self.fs.File(filename) global my_normpath my_normpath = os.path.normpath if os.path.normcase('foo') == os.path.normcase('FOO'): my_normpath = os.path.normcase def deps_match(self, deps, headers): scanned = sorted(map(my_normpath, list(map(str, deps)))) expect = sorted(map(my_normpath, headers)) self.failUnless(scanned == expect, "expect %s != scanned %s" % (expect, scanned)) # define some tests: class RCScannerTestCase1(unittest.TestCase): def runTest(self): path = [] env = DummyEnvironment(RCSUFFIXES=['.rc','.rc2'], CPPPATH=path) s = SCons.Scanner.RC.RCScan() deps = s(env.File('t1.rc'), env, path) headers = ['t1.h'] deps_match(self, deps, headers) class RCScannerTestCase2(unittest.TestCase): def runTest(self): path = [] env = DummyEnvironment(RCSUFFIXES=['.rc','.rc2'], CPPPATH=path) s = SCons.Scanner.RC.RCScan() deps = s(env.File('t2.rc'), env, path) headers = ['MSG00410.bin', 'abc.ico','bullseye.cur', 'cmroman.fnt','def.bmp', 'MSG00409.bin', 'responseerrorpage.htm', 't1.h', 'testEffect.fx', 'testregis.rgs','testtypelib.tlb'] deps_match(self, deps, headers) class RCScannerTestCase3(unittest.TestCase): def runTest(self): path = [] env = DummyEnvironment(RCSUFFIXES=['.rc','.rc2'], CPPPATH=path) s = SCons.Scanner.RC.RCScan() deps = s(env.File('t3.rc'), env, path) headers = ['t1.h'] deps_match(self, deps, headers) def suite(): suite = unittest.TestSuite() suite.addTest(RCScannerTestCase1()) suite.addTest(RCScannerTestCase2()) suite.addTest(RCScannerTestCase3()) return suite if __name__ == "__main__": TestUnit.run(suite()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/DTests.py0000664000175000017500000001430313160023041021705 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/DTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import unittest import TestCmd import TestUnit import SCons.Scanner.D test = TestCmd.TestCmd(workdir = '') import collections import os class DummyEnvironment(collections.UserDict): def __init__(self, **kw): collections.UserDict.__init__(self) self.data.update(kw) self.fs = SCons.Node.FS.FS(test.workpath('')) def Dictionary(self, *args): return self.data def subst(self, strSubst, target=None, source=None, conv=None): if strSubst[0] == '$': return self.data[strSubst[1:]] return strSubst def subst_list(self, strSubst, target=None, source=None, conv=None): if strSubst[0] == '$': return [self.data[strSubst[1:]]] return [[strSubst]] def subst_path(self, path, target=None, source=None, conv=None): if not isinstance(path, list): path = [path] return list(map(self.subst, path)) def get_calculator(self): return None def get_factory(self, factory): return factory or self.fs.File def Dir(self, filename): return self.fs.Dir(filename) def File(self, filename): return self.fs.File(filename) if os.path.normcase('foo') == os.path.normcase('FOO'): my_normpath = os.path.normcase else: my_normpath = os.path.normpath def deps_match(self, deps, headers): global my_normpath scanned = list(map(my_normpath, list(map(str, deps)))) expect = list(map(my_normpath, headers)) self.failUnless(scanned == expect, "expect %s != scanned %s" % (expect, scanned)) """ Examples from https://dlang.org/spec/module.html D Language: 2.071.1 Accessed: 11 August 2016 """ # Regular import test.write('basic.d',""" import A; void main() {} """) # Static import test.write('static.d',""" static import A; void main() { std.stdio.writeln("hello!"); // ok, writeln is fully qualified } """) # Public import test.write('public.d',""" public import A; void main() {} """) # Renamed import test.write('rename.d',""" import B = A; void main() { io.writeln("hello!"); // ok, calls std.stdio.writeln } """) # Selective import test.write('selective.d',""" import A : B, C; void main() { writeln("hello!"); // ok, writeln bound into current namespace foo("world"); // ok, calls std.stdio.write() } """) # Renamed and Selective import test.write('renameAndSelective.d',""" import B = A : C = D; void main() { } """) # Scoped import test.write('scoped.d',""" void main() { import A; } """) # Combinatorial import test.write('combinatorial.d',""" import A, B, CCC = C, DDD = D : EEE = FFF; void main() { } """) # Subdirs import test.write('subdirs.d',""" import X.Y, X.Z, X.X.X; void main() {} """) # Multiple import test.write('multiple.d',""" public import B; static import C; import X = X.Y : Q, R, S, T = U; void main() { import A; } """) # Multiline import test.write('multiline.d',""" import A; void main() {} """) test.write('A.d',""" module A; void main() {} """) test.write('B.d',""" module B; void main() {} """) test.write('C.d',""" module C; void main() {} """) test.write('D.d',""" module D; void main() {} """) test.subdir('X', os.path.join('X','X')) test.write(os.path.join('X','Y.d'),""" module Y; void main() {} """) test.write(os.path.join('X','Z.d'),""" module Z; void main() {} """) test.write(os.path.join('X','X','X.d'),""" module X; void main() {} """) class DScannerTestCase(unittest.TestCase): def helper(self, filename, headers): env = DummyEnvironment() s = SCons.Scanner.D.DScanner() path = s.path(env) deps = s(env.File(filename), env, path) deps_match(self, deps, headers) def test_BasicImport(self): self.helper('basic.d', ['A.d']) def test_StaticImport(self): self.helper('static.d', ['A.d']) def test_publicImport(self): self.helper('public.d', ['A.d']) def test_RenameImport(self): self.helper('rename.d', ['A.d']) def test_SelectiveImport(self): self.helper('selective.d', ['A.d']) def test_RenameAndSelectiveImport(self): self.helper('renameAndSelective.d', ['A.d']) def test_ScopedImport(self): self.helper('scoped.d', ['A.d']) def test_CombinatorialImport(self): self.helper('combinatorial.d', ['A.d', 'B.d', 'C.d', 'D.d']) def test_SubdirsImport(self): self.helper('subdirs.d', [os.path.join('X','X','X.d'), os.path.join('X','Y.d'), os.path.join('X','Z.d')]) def test_MultipleImport(self): self.helper('multiple.d', ['A.d', 'B.d', 'C.d', os.path.join('X','Y.d')]) def test_MultilineImport(self): self.helper('multiline.d', ['A.d']) if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ DScannerTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/C.py0000664000175000017500000001135113160023041020661 0ustar bdbaddogbdbaddog"""SCons.Scanner.C This module implements the dependency scanner for C/C++ code. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/C.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Node.FS import SCons.Scanner import SCons.Util import SCons.cpp class SConsCPPScanner(SCons.cpp.PreProcessor): """ SCons-specific subclass of the cpp.py module's processing. We subclass this so that: 1) we can deal with files represented by Nodes, not strings; 2) we can keep track of the files that are missing. """ def __init__(self, *args, **kw): SCons.cpp.PreProcessor.__init__(self, *args, **kw) self.missing = [] def initialize_result(self, fname): self.result = SCons.Util.UniqueList([fname]) def finalize_result(self, fname): return self.result[1:] def find_include_file(self, t): keyword, quote, fname = t result = SCons.Node.FS.find_file(fname, self.searchpath[quote]) if not result: self.missing.append((fname, self.current_file)) return result def read_file(self, file): try: with open(str(file.rfile())) as fp: return fp.read() except EnvironmentError as e: self.missing.append((file, self.current_file)) return '' def dictify_CPPDEFINES(env): cppdefines = env.get('CPPDEFINES', {}) if cppdefines is None: return {} if SCons.Util.is_Sequence(cppdefines): result = {} for c in cppdefines: if SCons.Util.is_Sequence(c): result[c[0]] = c[1] else: result[c] = None return result if not SCons.Util.is_Dict(cppdefines): return {cppdefines : None} return cppdefines class SConsCPPScannerWrapper(object): """ The SCons wrapper around a cpp.py scanner. This is the actual glue between the calling conventions of generic SCons scanners, and the (subclass of) cpp.py class that knows how to look for #include lines with reasonably real C-preprocessor-like evaluation of #if/#ifdef/#else/#elif lines. """ def __init__(self, name, variable): self.name = name self.path = SCons.Scanner.FindPathDirs(variable) def __call__(self, node, env, path = ()): cpp = SConsCPPScanner(current = node.get_dir(), cpppath = path, dict = dictify_CPPDEFINES(env)) result = cpp(node) for included, includer in cpp.missing: fmt = "No dependency generated for file: %s (included from: %s) -- file not found" SCons.Warnings.warn(SCons.Warnings.DependencyWarning, fmt % (included, includer)) return result def recurse_nodes(self, nodes): return nodes def select(self, node): return self def CScanner(): """Return a prototype Scanner instance for scanning source files that use the C pre-processor""" # Here's how we would (or might) use the CPP scanner code above that # knows how to evaluate #if/#ifdef/#else/#elif lines when searching # for #includes. This is commented out for now until we add the # right configurability to let users pick between the scanners. #return SConsCPPScannerWrapper("CScanner", "CPPPATH") cs = SCons.Scanner.ClassicCPP("CScanner", "$CPPSUFFIXES", "CPPPATH", '^[ \t]*#[ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")') return cs # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/IDL.py0000664000175000017500000000345613160023041021116 0ustar bdbaddogbdbaddog"""SCons.Scanner.IDL This module implements the dependency scanner for IDL (Interface Definition Language) files. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/IDL.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Node.FS import SCons.Scanner def IDLScan(): """Return a prototype Scanner instance for scanning IDL source files""" cs = SCons.Scanner.ClassicCPP("IDLScan", "$IDLSUFFIXES", "CPPPATH", '^[ \t]*(?:#[ \t]*include|[ \t]*import)[ \t]+(<|")([^>"]+)(>|")') return cs # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/CTests.py0000664000175000017500000003403313160023041021706 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/CTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import collections import os import sys import unittest import TestCmd import TestUnit import SCons.Node.FS import SCons.Warnings import SCons.Scanner.C test = TestCmd.TestCmd(workdir = '') os.chdir(test.workpath('')) # create some source files and headers: test.write('f1.cpp',""" #include \"f1.h\" #include int main() { return 0; } """) test.write('f2.cpp',""" #include \"d1/f1.h\" #include #include \"f1.h\" #import int main() { return 0; } """) test.write('f3.cpp',""" #include \t "f1.h" \t #include "f2.h" # \t include "f3-test.h" #include \t \t #include # \t include // #include "never.h" const char* x = "#include " int main() { return 0; } """) # for Emacs -> " test.subdir('d1', ['d1', 'd2']) headers = ['f1.h','f2.h', 'f3-test.h', 'fi.h', 'fj.h', 'never.h', 'd1/f1.h', 'd1/f2.h', 'd1/f3-test.h', 'd1/fi.h', 'd1/fj.h', 'd1/d2/f1.h', 'd1/d2/f2.h', 'd1/d2/f3-test.h', 'd1/d2/f4.h', 'd1/d2/fi.h', 'd1/d2/fj.h'] for h in headers: test.write(h, " ") test.write('f2.h',""" #include "fi.h" """) test.write('f3-test.h',""" #include """) test.subdir('include', 'subdir', ['subdir', 'include']) test.write('fa.cpp',""" #include \"fa.h\" #include int main() { return 0; } """) test.write(['include', 'fa.h'], "\n") test.write(['include', 'fb.h'], "\n") test.write(['subdir', 'include', 'fa.h'], "\n") test.write(['subdir', 'include', 'fb.h'], "\n") test.subdir('repository', ['repository', 'include'], ['repository', 'src' ]) test.subdir('work', ['work', 'src']) test.write(['repository', 'include', 'iii.h'], "\n") test.write(['work', 'src', 'fff.c'], """ #include #include int main() { return 0; } """) test.write([ 'work', 'src', 'aaa.c'], """ #include "bbb.h" int main() { return 0; } """) test.write([ 'work', 'src', 'bbb.h'], "\n") test.write([ 'repository', 'src', 'ccc.c'], """ #include "ddd.h" int main() { return 0; } """) test.write([ 'repository', 'src', 'ddd.h'], "\n") test.write('f5.c', """\ #include\"f5a.h\" #include """) test.write("f5a.h", "\n") test.write("f5b.h", "\n") # define some helpers: class DummyEnvironment(collections.UserDict): def __init__(self, **kw): collections.UserDict.__init__(self) self.data.update(kw) self.fs = SCons.Node.FS.FS(test.workpath('')) def Dictionary(self, *args): return self.data def subst(self, strSubst, target=None, source=None, conv=None): if strSubst[0] == '$': return self.data[strSubst[1:]] return strSubst def subst_list(self, strSubst, target=None, source=None, conv=None): if strSubst[0] == '$': return [self.data[strSubst[1:]]] return [[strSubst]] def subst_path(self, path, target=None, source=None, conv=None): if not isinstance(path, list): path = [path] return list(map(self.subst, path)) def get_calculator(self): return None def get_factory(self, factory): return factory or self.fs.File def Dir(self, filename): return self.fs.Dir(filename) def File(self, filename): return self.fs.File(filename) if os.path.normcase('foo') == os.path.normcase('FOO'): my_normpath = os.path.normcase else: my_normpath = os.path.normpath def deps_match(self, deps, headers): global my_normpath scanned = list(map(my_normpath, list(map(str, deps)))) expect = list(map(my_normpath, headers)) self.failUnless(scanned == expect, "expect %s != scanned %s" % (expect, scanned)) # define some tests: class CScannerTestCase1(unittest.TestCase): def runTest(self): """Find local files with no CPPPATH""" env = DummyEnvironment(CPPPATH=[]) s = SCons.Scanner.C.CScanner() path = s.path(env) deps = s(env.File('f1.cpp'), env, path) headers = ['f1.h', 'f2.h'] deps_match(self, deps, headers) class CScannerTestCase2(unittest.TestCase): def runTest(self): """Find a file in a CPPPATH directory""" env = DummyEnvironment(CPPPATH=[test.workpath("d1")]) s = SCons.Scanner.C.CScanner() path = s.path(env) deps = s(env.File('f1.cpp'), env, path) headers = ['f1.h', 'd1/f2.h'] deps_match(self, deps, headers) class CScannerTestCase3(unittest.TestCase): def runTest(self): """Find files in explicit subdirectories, ignore missing file""" env = DummyEnvironment(CPPPATH=[test.workpath("d1")]) s = SCons.Scanner.C.CScanner() path = s.path(env) deps = s(env.File('f2.cpp'), env, path) headers = ['d1/f1.h', 'f1.h', 'd1/d2/f1.h'] deps_match(self, deps, headers) class CScannerTestCase4(unittest.TestCase): def runTest(self): """Find files in explicit subdirectories""" env = DummyEnvironment(CPPPATH=[test.workpath("d1"), test.workpath("d1/d2")]) s = SCons.Scanner.C.CScanner() path = s.path(env) deps = s(env.File('f2.cpp'), env, path) headers = ['d1/f1.h', 'f1.h', 'd1/d2/f1.h', 'd1/d2/f4.h'] deps_match(self, deps, headers) class CScannerTestCase5(unittest.TestCase): def runTest(self): """Make sure files in repositories will get scanned""" env = DummyEnvironment(CPPPATH=[]) s = SCons.Scanner.C.CScanner() path = s.path(env) n = env.File('f3.cpp') def my_rexists(s): s.Tag('rexists_called', 1) return SCons.Node._rexists_map[s.GetTag('old_rexists')](s) n.Tag('old_rexists', n._func_rexists) SCons.Node._rexists_map[3] = my_rexists n._func_rexists = 3 deps = s(n, env, path) # Make sure rexists() got called on the file node being # scanned, essential for cooperation with VariantDir functionality. assert n.GetTag('rexists_called') headers = ['f1.h', 'f2.h', 'f3-test.h', 'd1/f1.h', 'd1/f2.h', 'd1/f3-test.h'] deps_match(self, deps, headers) class CScannerTestCase6(unittest.TestCase): def runTest(self): """Find a same-named file in different directories when CPPPATH changes""" env1 = DummyEnvironment(CPPPATH=[test.workpath("d1")]) env2 = DummyEnvironment(CPPPATH=[test.workpath("d1/d2")]) s = SCons.Scanner.C.CScanner() path1 = s.path(env1) path2 = s.path(env2) deps1 = s(env1.File('f1.cpp'), env1, path1) deps2 = s(env2.File('f1.cpp'), env2, path2) headers1 = ['f1.h', 'd1/f2.h'] headers2 = ['f1.h', 'd1/d2/f2.h'] deps_match(self, deps1, headers1) deps_match(self, deps2, headers2) class CScannerTestCase8(unittest.TestCase): def runTest(self): """Find files in a subdirectory relative to the current directory""" env = DummyEnvironment(CPPPATH=["include"]) s = SCons.Scanner.C.CScanner() path = s.path(env) deps1 = s(env.File('fa.cpp'), env, path) env.fs.chdir(env.Dir('subdir')) dir = env.fs.getcwd() env.fs.chdir(env.Dir('')) path = s.path(env, dir) deps2 = s(env.File('#fa.cpp'), env, path) headers1 = list(map(test.workpath, ['include/fa.h', 'include/fb.h'])) headers2 = ['include/fa.h', 'include/fb.h'] deps_match(self, deps1, headers1) deps_match(self, deps2, headers2) class CScannerTestCase9(unittest.TestCase): def runTest(self): """Generate a warning when we can't find a #included file""" SCons.Warnings.enableWarningClass(SCons.Warnings.DependencyWarning) class TestOut(object): def __call__(self, x): self.out = x to = TestOut() to.out = None SCons.Warnings._warningOut = to test.write('fa.h','\n') fs = SCons.Node.FS.FS(test.workpath('')) env = DummyEnvironment(CPPPATH=[]) env.fs = fs s = SCons.Scanner.C.CScanner() path = s.path(env) deps = s(fs.File('fa.cpp'), env, path) # Did we catch the warning associated with not finding fb.h? assert to.out deps_match(self, deps, [ 'fa.h' ]) test.unlink('fa.h') class CScannerTestCase10(unittest.TestCase): def runTest(self): """Find files in the local directory when the scanned file is elsewhere""" fs = SCons.Node.FS.FS(test.workpath('')) fs.chdir(fs.Dir('include')) env = DummyEnvironment(CPPPATH=[]) env.fs = fs s = SCons.Scanner.C.CScanner() path = s.path(env) test.write('include/fa.cpp', test.read('fa.cpp')) fs.chdir(fs.Dir('..')) deps = s(fs.File('#include/fa.cpp'), env, path) deps_match(self, deps, [ 'include/fa.h', 'include/fb.h' ]) test.unlink('include/fa.cpp') class CScannerTestCase11(unittest.TestCase): def runTest(self): """Handle dependencies on a derived .h file in a non-existent directory""" os.chdir(test.workpath('work')) fs = SCons.Node.FS.FS(test.workpath('work')) fs.Repository(test.workpath('repository')) # Create a derived file in a directory that does not exist yet. # This was a bug at one time. f1=fs.File('include2/jjj.h') f1.builder=1 env = DummyEnvironment(CPPPATH=['include', 'include2']) env.fs = fs s = SCons.Scanner.C.CScanner() path = s.path(env) deps = s(fs.File('src/fff.c'), env, path) deps_match(self, deps, [ test.workpath('repository/include/iii.h'), 'include2/jjj.h' ]) os.chdir(test.workpath('')) class CScannerTestCase12(unittest.TestCase): def runTest(self): """Find files in VariantDir() directories""" os.chdir(test.workpath('work')) fs = SCons.Node.FS.FS(test.workpath('work')) fs.VariantDir('build1', 'src', 1) fs.VariantDir('build2', 'src', 0) fs.Repository(test.workpath('repository')) env = DummyEnvironment(CPPPATH=[]) env.fs = fs s = SCons.Scanner.C.CScanner() path = s.path(env) deps1 = s(fs.File('build1/aaa.c'), env, path) deps_match(self, deps1, [ 'build1/bbb.h' ]) deps2 = s(fs.File('build2/aaa.c'), env, path) deps_match(self, deps2, [ 'src/bbb.h' ]) deps3 = s(fs.File('build1/ccc.c'), env, path) deps_match(self, deps3, [ 'build1/ddd.h' ]) deps4 = s(fs.File('build2/ccc.c'), env, path) deps_match(self, deps4, [ test.workpath('repository/src/ddd.h') ]) os.chdir(test.workpath('')) class CScannerTestCase13(unittest.TestCase): def runTest(self): """Find files in directories named in a substituted environment variable""" class SubstEnvironment(DummyEnvironment): def subst(self, arg, target=None, source=None, conv=None, test=test): if arg == "$blah": return test.workpath("d1") else: return arg env = SubstEnvironment(CPPPATH=["$blah"]) s = SCons.Scanner.C.CScanner() path = s.path(env) deps = s(env.File('f1.cpp'), env, path) headers = ['f1.h', 'd1/f2.h'] deps_match(self, deps, headers) class CScannerTestCase14(unittest.TestCase): def runTest(self): """Find files when there's no space between "#include" and the name""" env = DummyEnvironment(CPPPATH=[]) s = SCons.Scanner.C.CScanner() path = s.path(env) deps = s(env.File('f5.c'), env, path) headers = ['f5a.h', 'f5b.h'] deps_match(self, deps, headers) class CScannerTestCase15(unittest.TestCase): def runTest(self): """Verify scanner initialization with the suffixes in $CPPSUFFIXES""" suffixes = [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", ".h", ".H", ".hxx", ".hpp", ".hh", ".F", ".fpp", ".FPP", ".S", ".spp", ".SPP"] env = DummyEnvironment(CPPSUFFIXES = suffixes) s = SCons.Scanner.C.CScanner() for suffix in suffixes: assert suffix in s.get_skeys(env), "%s not in skeys" % suffix def suite(): suite = unittest.TestSuite() suite.addTest(CScannerTestCase1()) suite.addTest(CScannerTestCase2()) suite.addTest(CScannerTestCase3()) suite.addTest(CScannerTestCase4()) suite.addTest(CScannerTestCase5()) suite.addTest(CScannerTestCase6()) suite.addTest(CScannerTestCase8()) suite.addTest(CScannerTestCase9()) suite.addTest(CScannerTestCase10()) suite.addTest(CScannerTestCase11()) suite.addTest(CScannerTestCase12()) suite.addTest(CScannerTestCase13()) suite.addTest(CScannerTestCase14()) suite.addTest(CScannerTestCase15()) return suite if __name__ == "__main__": TestUnit.run(suite()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/IDLTests.py0000664000175000017500000003226213160023041022136 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/IDLTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import unittest import sys import os import os.path import TestCmd import TestUnit import SCons.Scanner.IDL import SCons.Node.FS import SCons.Warnings test = TestCmd.TestCmd(workdir = '') os.chdir(test.workpath('')) # create some source files and headers: test.write('t1.idl',''' #include "f1.idl" #include import "f3.idl"; [ object, uuid(22995106-CE26-4561-AF1B-C71C6934B840), dual, helpstring("IBarObject Interface"), pointer_default(unique) ] interface IBarObject : IDispatch { }; ''') test.write('t2.idl',""" #include \"d1/f1.idl\" #include #include \"f1.idl\" import ; [ object, uuid(22995106-CE26-4561-AF1B-C71C6934B840), dual, helpstring(\"IBarObject Interface\"), pointer_default(unique) ] interface IBarObject : IDispatch { }; """) test.write('t3.idl',""" #include \t \"f1.idl\" \t #include \"f2.idl\" # \t include \"f3-test.idl\" #include \t \t #include # \t include import \t \"d1/f1.idl\" \t import \"d1/f2.idl\" include \t \"never.idl\" \t include \"never.idl\" // #include \"never.idl\" const char* x = \"#include \" [ object, uuid(22995106-CE26-4561-AF1B-C71C6934B840), dual, helpstring(\"IBarObject Interface\"), pointer_default(unique) ] interface IBarObject : IDispatch { }; """) test.subdir('d1', ['d1', 'd2']) headers = ['f1.idl','f2.idl', 'f3.idl', 'f3-test.idl', 'fi.idl', 'fj.idl', 'never.idl', 'd1/f1.idl', 'd1/f2.idl', 'd1/f3-test.idl', 'd1/fi.idl', 'd1/fj.idl', 'd1/d2/f1.idl', 'd1/d2/f2.idl', 'd1/d2/f3-test.idl', 'd1/d2/f4.idl', 'd1/d2/fi.idl', 'd1/d2/fj.idl'] for h in headers: test.write(h, " ") test.write('f2.idl',""" #include "fi.idl" """) test.write('f3-test.idl',""" #include """) test.subdir('include', 'subdir', ['subdir', 'include']) test.write('t4.idl',""" #include \"fa.idl\" #include [ object, uuid(22995106-CE26-4561-AF1B-C71C6934B840), dual, helpstring(\"IBarObject Interface\"), pointer_default(unique) ] interface IBarObject : IDispatch { }; """) test.write(['include', 'fa.idl'], "\n") test.write(['include', 'fb.idl'], "\n") test.write(['subdir', 'include', 'fa.idl'], "\n") test.write(['subdir', 'include', 'fb.idl'], "\n") test.subdir('repository', ['repository', 'include'], ['repository', 'src' ]) test.subdir('work', ['work', 'src']) test.write(['repository', 'include', 'iii.idl'], "\n") test.write(['work', 'src', 'fff.c'], """ #include #include int main() { return 0; } """) test.write([ 'work', 'src', 'aaa.c'], """ #include "bbb.idl" int main() { return 0; } """) test.write([ 'work', 'src', 'bbb.idl'], "\n") test.write([ 'repository', 'src', 'ccc.c'], """ #include "ddd.idl" int main() { return 0; } """) test.write([ 'repository', 'src', 'ddd.idl'], "\n") # define some helpers: class DummyEnvironment(object): def __init__(self, listCppPath): self.path = listCppPath self.fs = SCons.Node.FS.FS(test.workpath('')) def Dictionary(self, *args): if not args: return { 'CPPPATH': self.path } elif len(args) == 1 and args[0] == 'CPPPATH': return self.path else: raise KeyError("Dummy environment only has CPPPATH attribute.") def subst(self, arg, target=None, source=None, conv=None): return arg def subst_path(self, path, target=None, source=None, conv=None): if not isinstance(path, list): path = [path] return list(map(self.subst, path)) def has_key(self, key): return key in self.Dictionary() def __getitem__(self,key): return self.Dictionary()[key] def __setitem__(self,key,value): self.Dictionary()[key] = value def __delitem__(self,key): del self.Dictionary()[key] def get_calculator(self): return None def get_factory(self, factory): return factory or self.fs.File def Dir(self, filename): return self.fs.Dir(filename) def File(self, filename): return self.fs.File(filename) global my_normpath my_normpath = os.path.normpath if os.path.normcase('foo') == os.path.normcase('FOO'): my_normpath = os.path.normcase def deps_match(self, deps, headers): scanned = list(map(my_normpath, list(map(str, deps)))) expect = list(map(my_normpath, headers)) self.failUnless(scanned == expect, "expect %s != scanned %s" % (expect, scanned)) # define some tests: class IDLScannerTestCase1(unittest.TestCase): def runTest(self): env = DummyEnvironment([]) s = SCons.Scanner.IDL.IDLScan() path = s.path(env) deps = s(env.File('t1.idl'), env, path) headers = ['f1.idl', 'f3.idl', 'f2.idl'] deps_match(self, deps, headers) class IDLScannerTestCase2(unittest.TestCase): def runTest(self): env = DummyEnvironment([test.workpath("d1")]) s = SCons.Scanner.IDL.IDLScan() path = s.path(env) deps = s(env.File('t1.idl'), env, path) headers = ['f1.idl', 'f3.idl', 'd1/f2.idl'] deps_match(self, deps, headers) class IDLScannerTestCase3(unittest.TestCase): def runTest(self): env = DummyEnvironment([test.workpath("d1")]) s = SCons.Scanner.IDL.IDLScan() path = s.path(env) deps = s(env.File('t2.idl'), env, path) headers = ['d1/f1.idl', 'f1.idl', 'd1/d2/f1.idl', 'f3.idl'] deps_match(self, deps, headers) class IDLScannerTestCase4(unittest.TestCase): def runTest(self): env = DummyEnvironment([test.workpath("d1"), test.workpath("d1/d2")]) s = SCons.Scanner.IDL.IDLScan() path = s.path(env) deps = s(env.File('t2.idl'), env, path) headers = ['d1/f1.idl', 'f1.idl', 'd1/d2/f1.idl', 'f3.idl'] deps_match(self, deps, headers) class IDLScannerTestCase5(unittest.TestCase): def runTest(self): env = DummyEnvironment([]) s = SCons.Scanner.IDL.IDLScan() path = s.path(env) n = env.File('t3.idl') def my_rexists(s): s.Tag('rexists_called', 1) return SCons.Node._rexists_map[s.GetTag('old_rexists')](s) n.Tag('old_rexists', n._func_rexists) SCons.Node._rexists_map[3] = my_rexists n._func_rexists = 3 deps = s(n, env, path) # Make sure rexists() got called on the file node being # scanned, essential for cooperation with VariantDir functionality. assert n.GetTag('rexists_called') headers = ['d1/f1.idl', 'd1/f2.idl', 'f1.idl', 'f2.idl', 'f3-test.idl', 'd1/f1.idl', 'd1/f2.idl', 'd1/f3-test.idl'] deps_match(self, deps, headers) class IDLScannerTestCase6(unittest.TestCase): def runTest(self): env1 = DummyEnvironment([test.workpath("d1")]) env2 = DummyEnvironment([test.workpath("d1/d2")]) s = SCons.Scanner.IDL.IDLScan() path1 = s.path(env1) path2 = s.path(env2) deps1 = s(env1.File('t1.idl'), env1, path1) deps2 = s(env2.File('t1.idl'), env2, path2) headers1 = ['f1.idl', 'f3.idl', 'd1/f2.idl'] headers2 = ['f1.idl', 'f3.idl', 'd1/d2/f2.idl'] deps_match(self, deps1, headers1) deps_match(self, deps2, headers2) class IDLScannerTestCase7(unittest.TestCase): def runTest(self): env = DummyEnvironment(["include"]) s = SCons.Scanner.IDL.IDLScan() path = s.path(env) deps1 = s(env.File('t4.idl'), env, path) env.fs.chdir(env.Dir('subdir')) dir = env.fs.getcwd() env.fs.chdir(env.Dir('')) path = s.path(env, dir) deps2 = s(env.File('#t4.idl'), env, path) headers1 = list(map(test.workpath, ['include/fa.idl', 'include/fb.idl'])) headers2 = ['include/fa.idl', 'include/fb.idl'] deps_match(self, deps1, headers1) deps_match(self, deps2, headers2) class IDLScannerTestCase8(unittest.TestCase): def runTest(self): SCons.Warnings.enableWarningClass(SCons.Warnings.DependencyWarning) class TestOut(object): def __call__(self, x): self.out = x to = TestOut() to.out = None SCons.Warnings._warningOut = to test.write('fa.idl','\n') env = DummyEnvironment([]) s = SCons.Scanner.IDL.IDLScan() path = s.path(env) deps = s(env.File('t4.idl'), env, path) # Did we catch the warning associated with not finding fb.idl? assert to.out deps_match(self, deps, [ 'fa.idl' ]) test.unlink('fa.idl') class IDLScannerTestCase9(unittest.TestCase): def runTest(self): env = DummyEnvironment([]) env.fs.chdir(env.Dir('include')) s = SCons.Scanner.IDL.IDLScan() path = s.path(env) test.write('include/t4.idl', test.read('t4.idl')) deps = s(env.File('#include/t4.idl'), env, path) env.fs.chdir(env.Dir('')) deps_match(self, deps, [ 'fa.idl', 'fb.idl' ]) test.unlink('include/t4.idl') class IDLScannerTestCase10(unittest.TestCase): def runTest(self): os.chdir(test.workpath('work')) fs = SCons.Node.FS.FS(test.workpath('work')) fs.Repository(test.workpath('repository')) # Create a derived file in a directory that does not exist yet. # This was a bug at one time. env = DummyEnvironment(['include', 'include2']) env.fs = fs f1 = fs.File('include2/jjj.idl') f1.builder = 1 s = SCons.Scanner.IDL.IDLScan() path = s.path(env) deps = s(fs.File('src/fff.c'), env, path) deps_match(self, deps, [ test.workpath('repository/include/iii.idl'), 'include2/jjj.idl' ]) os.chdir(test.workpath('')) class IDLScannerTestCase11(unittest.TestCase): def runTest(self): os.chdir(test.workpath('work')) fs = SCons.Node.FS.FS(test.workpath('work')) fs.VariantDir('build1', 'src', 1) fs.VariantDir('build2', 'src', 0) fs.Repository(test.workpath('repository')) env = DummyEnvironment([]) env.fs = fs s = SCons.Scanner.IDL.IDLScan() path = s.path(env) deps1 = s(fs.File('build1/aaa.c'), env, path) deps_match(self, deps1, [ 'build1/bbb.idl' ]) deps2 = s(fs.File('build2/aaa.c'), env, path) deps_match(self, deps2, [ 'src/bbb.idl' ]) deps3 = s(fs.File('build1/ccc.c'), env, path) deps_match(self, deps3, [ 'build1/ddd.idl' ]) deps4 = s(fs.File('build2/ccc.c'), env, path) deps_match(self, deps4, [ test.workpath('repository/src/ddd.idl') ]) os.chdir(test.workpath('')) class IDLScannerTestCase12(unittest.TestCase): def runTest(self): class SubstEnvironment(DummyEnvironment): def subst(self, arg, target=None, source=None, conv=None, test=test): if arg == "$blah": return test.workpath("d1") else: return arg env = SubstEnvironment(["$blah"]) s = SCons.Scanner.IDL.IDLScan() path = s.path(env) deps = s(env.File('t1.idl'), env, path) headers = ['f1.idl', 'f3.idl', 'd1/f2.idl'] deps_match(self, deps, headers) def suite(): suite = unittest.TestSuite() suite.addTest(IDLScannerTestCase1()) suite.addTest(IDLScannerTestCase2()) suite.addTest(IDLScannerTestCase3()) suite.addTest(IDLScannerTestCase4()) suite.addTest(IDLScannerTestCase5()) suite.addTest(IDLScannerTestCase6()) suite.addTest(IDLScannerTestCase7()) suite.addTest(IDLScannerTestCase8()) suite.addTest(IDLScannerTestCase9()) suite.addTest(IDLScannerTestCase10()) suite.addTest(IDLScannerTestCase11()) suite.addTest(IDLScannerTestCase12()) return suite if __name__ == "__main__": TestUnit.run(suite()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/Prog.py0000664000175000017500000000705713160023041021416 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/Prog.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Node import SCons.Node.FS import SCons.Scanner import SCons.Util # global, set by --debug=findlibs print_find_libs = None def ProgramScanner(**kw): """Return a prototype Scanner instance for scanning executable files for static-lib dependencies""" kw['path_function'] = SCons.Scanner.FindPathDirs('LIBPATH') ps = SCons.Scanner.Base(scan, "ProgramScanner", **kw) return ps def _subst_libs(env, libs): """ Substitute environment variables and split into list. """ if SCons.Util.is_String(libs): libs = env.subst(libs) if SCons.Util.is_String(libs): libs = libs.split() elif SCons.Util.is_Sequence(libs): _libs = [] for l in libs: _libs += _subst_libs(env, l) libs = _libs else: # libs is an object (Node, for example) libs = [libs] return libs def scan(node, env, libpath = ()): """ This scanner scans program files for static-library dependencies. It will search the LIBPATH environment variable for libraries specified in the LIBS variable, returning any files it finds as dependencies. """ try: libs = env['LIBS'] except KeyError: # There are no LIBS in this environment, so just return a null list: return [] libs = _subst_libs(env, libs) try: prefix = env['LIBPREFIXES'] if not SCons.Util.is_List(prefix): prefix = [ prefix ] except KeyError: prefix = [ '' ] try: suffix = env['LIBSUFFIXES'] if not SCons.Util.is_List(suffix): suffix = [ suffix ] except KeyError: suffix = [ '' ] pairs = [] for suf in map(env.subst, suffix): for pref in map(env.subst, prefix): pairs.append((pref, suf)) result = [] if callable(libpath): libpath = libpath() find_file = SCons.Node.FS.find_file adjustixes = SCons.Util.adjustixes for lib in libs: if SCons.Util.is_String(lib): for pref, suf in pairs: l = adjustixes(lib, pref, suf) l = find_file(l, libpath, verbose=print_find_libs) if l: result.append(l) else: result.append(lib) return result # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/__init__.xml0000664000175000017500000000435313160023041022412 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> (variable) Returns a function (actually a callable Python object) intended to be used as the path_function of a Scanner object. The returned object will look up the specified variable in a construction environment and treat the construction variable's value as a list of directory paths that should be searched (like &cv-link-CPPPATH;, &cv-link-LIBPATH;, etc.). Note that use of &f-FindPathDirs; is generally preferable to writing your own path_function for the following reasons: 1) The returned list will contain all appropriate directories found in source trees (when &f-link-VariantDir; is used) or in code repositories (when &f-Repository; or the option are used). 2) scons will identify expansions of variable that evaluate to the same list of directories as, in fact, the same list, and avoid re-scanning the directories for files, when possible. Example: def my_scan(node, env, path, arg): # Code to scan file contents goes here... return include_files scanner = Scanner(name = 'myscanner', function = my_scan, path_function = FindPathDirs('MYPATH')) scons-src-3.0.0/src/engine/SCons/Scanner/D.py0000664000175000017500000000471413160023041020667 0ustar bdbaddogbdbaddog"""SCons.Scanner.D Scanner for the Digital Mars "D" programming language. Coded by Andy Friesen 17 Nov 2003 """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/D.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Scanner def DScanner(): """Return a prototype Scanner instance for scanning D source files""" ds = D() return ds class D(SCons.Scanner.Classic): def __init__ (self): SCons.Scanner.Classic.__init__ ( self, name = "DScanner", suffixes = '$DSUFFIXES', path_variable = 'DPATH', regex = '(?:import\s+)([\w\s=,.]+)(?:\s*:[\s\w,=]+)?(?:;)' ) def find_include(self, include, source_dir, path): # translate dots (package separators) to slashes inc = include.replace('.', '/') i = SCons.Node.FS.find_file(inc + '.d', (source_dir,) + path) if i is None: i = SCons.Node.FS.find_file (inc + '.di', (source_dir,) + path) return i, include def find_include_names(self, node): includes = [] for iii in self.cre.findall(node.get_text_contents()): for jjj in iii.split(','): kkk = jjj.split('=')[-1] includes.append(kkk.strip()) return includes # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/Dir.py0000664000175000017500000000733013160023041021217 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Scanner/Dir.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Node.FS import SCons.Scanner def only_dirs(nodes): is_Dir = lambda n: isinstance(n.disambiguate(), SCons.Node.FS.Dir) return [node for node in nodes if is_Dir(node)] def DirScanner(**kw): """Return a prototype Scanner instance for scanning directories for on-disk files""" kw['node_factory'] = SCons.Node.FS.Entry kw['recursive'] = only_dirs return SCons.Scanner.Base(scan_on_disk, "DirScanner", **kw) def DirEntryScanner(**kw): """Return a prototype Scanner instance for "scanning" directory Nodes for their in-memory entries""" kw['node_factory'] = SCons.Node.FS.Entry kw['recursive'] = None return SCons.Scanner.Base(scan_in_memory, "DirEntryScanner", **kw) skip_entry = {} skip_entry_list = [ '.', '..', '.sconsign', # Used by the native dblite.py module. '.sconsign.dblite', # Used by dbm and dumbdbm. '.sconsign.dir', # Used by dbm. '.sconsign.pag', # Used by dumbdbm. '.sconsign.dat', '.sconsign.bak', # Used by some dbm emulations using Berkeley DB. '.sconsign.db', ] for skip in skip_entry_list: skip_entry[skip] = 1 skip_entry[SCons.Node.FS._my_normcase(skip)] = 1 do_not_scan = lambda k: k not in skip_entry def scan_on_disk(node, env, path=()): """ Scans a directory for on-disk files and directories therein. Looking up the entries will add these to the in-memory Node tree representation of the file system, so all we have to do is just that and then call the in-memory scanning function. """ try: flist = node.fs.listdir(node.get_abspath()) except (IOError, OSError): return [] e = node.Entry for f in filter(do_not_scan, flist): # Add ./ to the beginning of the file name so if it begins with a # '#' we don't look it up relative to the top-level directory. e('./' + f) return scan_in_memory(node, env, path) def scan_in_memory(node, env, path=()): """ "Scans" a Node.FS.Dir for its in-memory entries. """ try: entries = node.entries except AttributeError: # It's not a Node.FS.Dir (or doesn't look enough like one for # our purposes), which can happen if a target list containing # mixed Node types (Dirs and Files, for example) has a Dir as # the first entry. return [] entry_list = sorted(filter(do_not_scan, list(entries.keys()))) return [entries[n] for n in entry_list] # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/SWIG.py0000664000175000017500000000320313160023041021245 0ustar bdbaddogbdbaddog"""SCons.Scanner.SWIG This module implements the dependency scanner for SWIG code. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/SWIG.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Scanner SWIGSuffixes = [ '.i' ] def SWIGScanner(): expr = '^[ \t]*%[ \t]*(?:include|import|extern)[ \t]*(<|"?)([^>\s"]+)(?:>|"?)' scanner = SCons.Scanner.ClassicCPP("SWIGScanner", ".i", "SWIGPATH", expr) return scanner # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Scanner/ProgTests.py0000664000175000017500000002522313160023041022434 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Scanner/ProgTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import sys import unittest import TestCmd import TestUnit import SCons.Node.FS import SCons.Scanner.Prog import SCons.Subst test = TestCmd.TestCmd(workdir = '') test.subdir('d1', ['d1', 'd2'], 'dir', ['dir', 'sub']) libs = [ 'l1.lib', 'd1/l2.lib', 'd1/d2/l3.lib', 'dir/libfoo.a', 'dir/sub/libbar.a', 'dir/libxyz.other'] for h in libs: test.write(h, "\n") # define some helpers: class DummyEnvironment(object): def __init__(self, **kw): self._dict = {'LIBSUFFIXES' : '.lib'} self._dict.update(kw) self.fs = SCons.Node.FS.FS(test.workpath('')) def Dictionary(self, *args): if not args: return self._dict elif len(args) == 1: return self._dict[args[0]] else: return [self._dict[x] for x in args] def has_key(self, key): return key in self.Dictionary() def __getitem__(self,key): return self.Dictionary()[key] def __setitem__(self,key,value): self.Dictionary()[key] = value def __delitem__(self,key): del self.Dictionary()[key] def subst(self, s, target=None, source=None, conv=None): return SCons.Subst.scons_subst(s, self, gvars=self._dict, lvars=self._dict) def subst_path(self, path, target=None, source=None, conv=None): if not isinstance(path, list): path = [path] return list(map(self.subst, path)) def get_factory(self, factory): return factory or self.fs.File def Dir(self, filename): return self.fs.Dir(test.workpath(filename)) def File(self, filename): return self.fs.File(test.workpath(filename)) class DummyNode(object): def __init__(self, name): self.name = name def rexists(self): return 1 def __str__(self): return self.name def deps_match(deps, libs): deps=sorted(map(str, deps)) libs.sort() return list(map(os.path.normpath, deps)) == list(map(os.path.normpath, libs)) # define some tests: class ProgramScannerTestCase1(unittest.TestCase): def runTest(self): env = DummyEnvironment(LIBPATH=[ test.workpath("") ], LIBS=[ 'l1', 'l2', 'l3' ]) s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps_match(deps, ['l1.lib']), list(map(str, deps)) env = DummyEnvironment(LIBPATH=[ test.workpath("") ], LIBS='l1') s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps_match(deps, ['l1.lib']), list(map(str, deps)) f1 = env.fs.File(test.workpath('f1')) env = DummyEnvironment(LIBPATH=[ test.workpath("") ], LIBS=[f1]) s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps[0] is f1, deps f2 = env.fs.File(test.workpath('f1')) env = DummyEnvironment(LIBPATH=[ test.workpath("") ], LIBS=f2) s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps[0] is f2, deps class ProgramScannerTestCase2(unittest.TestCase): def runTest(self): env = DummyEnvironment(LIBPATH=list(map(test.workpath, ["", "d1", "d1/d2" ])), LIBS=[ 'l1', 'l2', 'l3' ]) s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps_match(deps, ['l1.lib', 'd1/l2.lib', 'd1/d2/l3.lib' ]), list(map(str, deps)) class ProgramScannerTestCase3(unittest.TestCase): def runTest(self): env = DummyEnvironment(LIBPATH=[test.workpath("d1/d2"), test.workpath("d1")], LIBS='l2 l3'.split()) s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps_match(deps, ['d1/l2.lib', 'd1/d2/l3.lib']), list(map(str, deps)) class ProgramScannerTestCase5(unittest.TestCase): def runTest(self): class SubstEnvironment(DummyEnvironment): def subst(self, arg, target=None, source=None, conv=None, path=test.workpath("d1")): if arg == "$blah": return test.workpath("d1") else: return arg env = SubstEnvironment(LIBPATH=[ "$blah" ], LIBS='l2 l3'.split()) s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps_match(deps, [ 'd1/l2.lib' ]), list(map(str, deps)) class ProgramScannerTestCase6(unittest.TestCase): def runTest(self): env = DummyEnvironment(LIBPATH=[ test.workpath("dir") ], LIBS=['foo', 'sub/libbar', 'xyz.other'], LIBPREFIXES=['lib'], LIBSUFFIXES=['.a']) s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps_match(deps, ['dir/libfoo.a', 'dir/sub/libbar.a', 'dir/libxyz.other']), list(map(str, deps)) class ProgramScannerTestCase7(unittest.TestCase): def runTest(self): env = DummyEnvironment(LIBPATH=[ test.workpath("dir") ], LIBS=['foo', '$LIBBAR', '$XYZ'], LIBPREFIXES=['lib'], LIBSUFFIXES=['.a'], LIBBAR='sub/libbar', XYZ='xyz.other') s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps_match(deps, ['dir/libfoo.a', 'dir/sub/libbar.a', 'dir/libxyz.other']), list(map(str, deps)) class ProgramScannerTestCase8(unittest.TestCase): def runTest(self): n1 = DummyNode('n1') env = DummyEnvironment(LIBPATH=[ test.workpath("dir") ], LIBS=[n1], LIBPREFIXES=['p1-', 'p2-'], LIBSUFFIXES=['.1', '2']) s = SCons.Scanner.Prog.ProgramScanner(node_class = DummyNode) path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps == [n1], deps n2 = DummyNode('n2') env = DummyEnvironment(LIBPATH=[ test.workpath("dir") ], LIBS=[n1, [n2]], LIBPREFIXES=['p1-', 'p2-'], LIBSUFFIXES=['.1', '2']) s = SCons.Scanner.Prog.ProgramScanner(node_class = DummyNode) path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps == [n1, n2], deps class ProgramScannerTestCase9(unittest.TestCase): def runTest(self): env = DummyEnvironment(LIBPATH=[ test.workpath("dir") ], LIBS=['foo', '$LIBBAR'], LIBPREFIXES=['lib'], LIBSUFFIXES=['.a'], LIBBAR=['sub/libbar', 'xyz.other']) s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps_match(deps, ['dir/libfoo.a', 'dir/sub/libbar.a', 'dir/libxyz.other']), list(map(str, deps)) class ProgramScannerTestCase10(unittest.TestCase): def runTest(self): env = DummyEnvironment(LIBPATH=[ test.workpath("dir") ], LIBS=['foo', '$LIBBAR'], LIBPREFIXES=['lib'], LIBSUFFIXES=['.a'], LIBBAR='sub/libbar $LIBBAR2', LIBBAR2=['xyz.other']) s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps_match(deps, ['dir/libfoo.a', 'dir/sub/libbar.a', 'dir/libxyz.other']), list(map(str, deps)) def suite(): suite = unittest.TestSuite() suite.addTest(ProgramScannerTestCase1()) suite.addTest(ProgramScannerTestCase2()) suite.addTest(ProgramScannerTestCase3()) suite.addTest(ProgramScannerTestCase5()) suite.addTest(ProgramScannerTestCase6()) suite.addTest(ProgramScannerTestCase7()) suite.addTest(ProgramScannerTestCase8()) suite.addTest(ProgramScannerTestCase9()) suite.addTest(ProgramScannerTestCase10()) try: unicode except NameError: pass else: code = """if 1: class ProgramScannerTestCase4(unittest.TestCase): def runTest(self): env = DummyEnvironment(LIBPATH=[test.workpath("d1/d2"), test.workpath("d1")], LIBS=u'l2 l3'.split()) s = SCons.Scanner.Prog.ProgramScanner() path = s.path(env) deps = s(DummyNode('dummy'), env, path) assert deps_match(deps, ['d1/l2.lib', 'd1/d2/l3.lib']), map(str, deps) suite.addTest(ProgramScannerTestCase4()) \n""" exec(code) return suite if __name__ == "__main__": TestUnit.run(suite()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Defaults.py0000664000175000017500000005100513160023040020654 0ustar bdbaddogbdbaddog"""SCons.Defaults Builders and other things for the local site. Here's where we'll duplicate the functionality of autoconf until we move it into the installation procedure or use something like qmconf. The code that reads the registry to find MSVC components was borrowed from distutils.msvccompiler. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import division __revision__ = "src/engine/SCons/Defaults.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import errno import shutil import stat import time import sys import SCons.Action import SCons.Builder import SCons.CacheDir import SCons.Environment import SCons.PathList import SCons.Subst import SCons.Tool # A placeholder for a default Environment (for fetching source files # from source code management systems and the like). This must be # initialized later, after the top-level directory is set by the calling # interface. _default_env = None # Lazily instantiate the default environment so the overhead of creating # it doesn't apply when it's not needed. def _fetch_DefaultEnvironment(*args, **kw): """ Returns the already-created default construction environment. """ global _default_env return _default_env def DefaultEnvironment(*args, **kw): """ Initial public entry point for creating the default construction Environment. After creating the environment, we overwrite our name (DefaultEnvironment) with the _fetch_DefaultEnvironment() function, which more efficiently returns the initialized default construction environment without checking for its existence. (This function still exists with its _default_check because someone else (*cough* Script/__init__.py *cough*) may keep a reference to this function. So we can't use the fully functional idiom of having the name originally be a something that *only* creates the construction environment and then overwrites the name.) """ global _default_env if not _default_env: import SCons.Util _default_env = SCons.Environment.Environment(*args, **kw) if SCons.Util.md5: _default_env.Decider('MD5') else: _default_env.Decider('timestamp-match') global DefaultEnvironment DefaultEnvironment = _fetch_DefaultEnvironment _default_env._CacheDir_path = None return _default_env # Emitters for setting the shared attribute on object files, # and an action for checking that all of the source files # going into a shared library are, in fact, shared. def StaticObjectEmitter(target, source, env): for tgt in target: tgt.attributes.shared = None return (target, source) def SharedObjectEmitter(target, source, env): for tgt in target: tgt.attributes.shared = 1 return (target, source) def SharedFlagChecker(source, target, env): same = env.subst('$STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME') if same == '0' or same == '' or same == 'False': for src in source: try: shared = src.attributes.shared except AttributeError: shared = None if not shared: raise SCons.Errors.UserError("Source file: %s is static and is not compatible with shared target: %s" % (src, target[0])) SharedCheck = SCons.Action.Action(SharedFlagChecker, None) # Some people were using these variable name before we made # SourceFileScanner part of the public interface. Don't break their # SConscript files until we've given them some fair warning and a # transition period. CScan = SCons.Tool.CScanner DScan = SCons.Tool.DScanner LaTeXScan = SCons.Tool.LaTeXScanner ObjSourceScan = SCons.Tool.SourceFileScanner ProgScan = SCons.Tool.ProgramScanner # These aren't really tool scanners, so they don't quite belong with # the rest of those in Tool/__init__.py, but I'm not sure where else # they should go. Leave them here for now. import SCons.Scanner.Dir DirScanner = SCons.Scanner.Dir.DirScanner() DirEntryScanner = SCons.Scanner.Dir.DirEntryScanner() # Actions for common languages. CAction = SCons.Action.Action("$CCCOM", "$CCCOMSTR") ShCAction = SCons.Action.Action("$SHCCCOM", "$SHCCCOMSTR") CXXAction = SCons.Action.Action("$CXXCOM", "$CXXCOMSTR") ShCXXAction = SCons.Action.Action("$SHCXXCOM", "$SHCXXCOMSTR") DAction = SCons.Action.Action("$DCOM", "$DCOMSTR") ShDAction = SCons.Action.Action("$SHDCOM", "$SHDCOMSTR") ASAction = SCons.Action.Action("$ASCOM", "$ASCOMSTR") ASPPAction = SCons.Action.Action("$ASPPCOM", "$ASPPCOMSTR") LinkAction = SCons.Action.Action("$LINKCOM", "$LINKCOMSTR") ShLinkAction = SCons.Action.Action("$SHLINKCOM", "$SHLINKCOMSTR") LdModuleLinkAction = SCons.Action.Action("$LDMODULECOM", "$LDMODULECOMSTR") # Common tasks that we allow users to perform in platform-independent # ways by creating ActionFactory instances. ActionFactory = SCons.Action.ActionFactory def get_paths_str(dest): # If dest is a list, we need to manually call str() on each element if SCons.Util.is_List(dest): elem_strs = [] for element in dest: elem_strs.append('"' + str(element) + '"') return '[' + ', '.join(elem_strs) + ']' else: return '"' + str(dest) + '"' permission_dic = { 'u':{ 'r':stat.S_IRUSR, 'w':stat.S_IWUSR, 'x':stat.S_IXUSR }, 'g':{ 'r':stat.S_IRGRP, 'w':stat.S_IWGRP, 'x':stat.S_IXGRP }, 'o':{ 'r':stat.S_IROTH, 'w':stat.S_IWOTH, 'x':stat.S_IXOTH } } def chmod_func(dest, mode): import SCons.Util from string import digits SCons.Node.FS.invalidate_node_memos(dest) if not SCons.Util.is_List(dest): dest = [dest] if SCons.Util.is_String(mode) and not 0 in [i in digits for i in mode]: mode = int(mode, 8) if not SCons.Util.is_String(mode): for element in dest: os.chmod(str(element), mode) else: mode = str(mode) for operation in mode.split(","): if "=" in operation: operator = "=" elif "+" in operation: operator = "+" elif "-" in operation: operator = "-" else: raise SyntaxError("Could not find +, - or =") operation_list = operation.split(operator) if len(operation_list) is not 2: raise SyntaxError("More than one operator found") user = operation_list[0].strip().replace("a", "ugo") permission = operation_list[1].strip() new_perm = 0 for u in user: for p in permission: try: new_perm = new_perm | permission_dic[u][p] except KeyError: raise SyntaxError("Unrecognized user or permission format") for element in dest: curr_perm = os.stat(str(element)).st_mode if operator == "=": os.chmod(str(element), new_perm) elif operator == "+": os.chmod(str(element), curr_perm | new_perm) elif operator == "-": os.chmod(str(element), curr_perm & ~new_perm) def chmod_strfunc(dest, mode): import SCons.Util if not SCons.Util.is_String(mode): return 'Chmod(%s, 0%o)' % (get_paths_str(dest), mode) else: return 'Chmod(%s, "%s")' % (get_paths_str(dest), str(mode)) Chmod = ActionFactory(chmod_func, chmod_strfunc) def copy_func(dest, src, symlinks=True): """ If symlinks (is true), then a symbolic link will be shallow copied and recreated as a symbolic link; otherwise, copying a symbolic link will be equivalent to copying the symbolic link's final target regardless of symbolic link depth. """ dest = str(dest) src = str(src) SCons.Node.FS.invalidate_node_memos(dest) if SCons.Util.is_List(src) and os.path.isdir(dest): for file in src: shutil.copy2(file, dest) return 0 elif os.path.islink(src): if symlinks: return os.symlink(os.readlink(src), dest) else: return copy_func(dest, os.path.realpath(src)) elif os.path.isfile(src): shutil.copy2(src, dest) return 0 else: shutil.copytree(src, dest, symlinks) # copytree returns None in python2 and destination string in python3 # A error is raised in both cases, so we can just return 0 for success return 0 Copy = ActionFactory( copy_func, lambda dest, src, symlinks=True: 'Copy("%s", "%s")' % (dest, src) ) def delete_func(dest, must_exist=0): SCons.Node.FS.invalidate_node_memos(dest) if not SCons.Util.is_List(dest): dest = [dest] for entry in dest: entry = str(entry) # os.path.exists returns False with broken links that exist entry_exists = os.path.exists(entry) or os.path.islink(entry) if not entry_exists and not must_exist: continue # os.path.isdir returns True when entry is a link to a dir if os.path.isdir(entry) and not os.path.islink(entry): shutil.rmtree(entry, 1) continue os.unlink(entry) def delete_strfunc(dest, must_exist=0): return 'Delete(%s)' % get_paths_str(dest) Delete = ActionFactory(delete_func, delete_strfunc) def mkdir_func(dest): SCons.Node.FS.invalidate_node_memos(dest) if not SCons.Util.is_List(dest): dest = [dest] for entry in dest: try: os.makedirs(str(entry)) except os.error as e: p = str(entry) if (e.args[0] == errno.EEXIST or (sys.platform=='win32' and e.args[0]==183)) \ and os.path.isdir(str(entry)): pass # not an error if already exists else: raise Mkdir = ActionFactory(mkdir_func, lambda dir: 'Mkdir(%s)' % get_paths_str(dir)) def move_func(dest, src): SCons.Node.FS.invalidate_node_memos(dest) SCons.Node.FS.invalidate_node_memos(src) shutil.move(src, dest) Move = ActionFactory(move_func, lambda dest, src: 'Move("%s", "%s")' % (dest, src), convert=str) def touch_func(dest): SCons.Node.FS.invalidate_node_memos(dest) if not SCons.Util.is_List(dest): dest = [dest] for file in dest: file = str(file) mtime = int(time.time()) if os.path.exists(file): atime = os.path.getatime(file) else: open(file, 'w') atime = mtime os.utime(file, (atime, mtime)) Touch = ActionFactory(touch_func, lambda file: 'Touch(%s)' % get_paths_str(file)) # Internal utility functions def _concat(prefix, list, suffix, env, f=lambda x: x, target=None, source=None): """ Creates a new list from 'list' by first interpolating each element in the list using the 'env' dictionary and then calling f on the list, and finally calling _concat_ixes to concatenate 'prefix' and 'suffix' onto each element of the list. """ if not list: return list l = f(SCons.PathList.PathList(list).subst_path(env, target, source)) if l is not None: list = l return _concat_ixes(prefix, list, suffix, env) def _concat_ixes(prefix, list, suffix, env): """ Creates a new list from 'list' by concatenating the 'prefix' and 'suffix' arguments onto each element of the list. A trailing space on 'prefix' or leading space on 'suffix' will cause them to be put into separate list elements rather than being concatenated. """ result = [] # ensure that prefix and suffix are strings prefix = str(env.subst(prefix, SCons.Subst.SUBST_RAW)) suffix = str(env.subst(suffix, SCons.Subst.SUBST_RAW)) for x in list: if isinstance(x, SCons.Node.FS.File): result.append(x) continue x = str(x) if x: if prefix: if prefix[-1] == ' ': result.append(prefix[:-1]) elif x[:len(prefix)] != prefix: x = prefix + x result.append(x) if suffix: if suffix[0] == ' ': result.append(suffix[1:]) elif x[-len(suffix):] != suffix: result[-1] = result[-1]+suffix return result def _stripixes(prefix, itms, suffix, stripprefixes, stripsuffixes, env, c=None): """ This is a wrapper around _concat()/_concat_ixes() that checks for the existence of prefixes or suffixes on list items and strips them where it finds them. This is used by tools (like the GNU linker) that need to turn something like 'libfoo.a' into '-lfoo'. """ if not itms: return itms if not callable(c): env_c = env['_concat'] if env_c != _concat and callable(env_c): # There's a custom _concat() method in the construction # environment, and we've allowed people to set that in # the past (see test/custom-concat.py), so preserve the # backwards compatibility. c = env_c else: c = _concat_ixes stripprefixes = list(map(env.subst, SCons.Util.flatten(stripprefixes))) stripsuffixes = list(map(env.subst, SCons.Util.flatten(stripsuffixes))) stripped = [] for l in SCons.PathList.PathList(itms).subst_path(env, None, None): if isinstance(l, SCons.Node.FS.File): stripped.append(l) continue if not SCons.Util.is_String(l): l = str(l) for stripprefix in stripprefixes: lsp = len(stripprefix) if l[:lsp] == stripprefix: l = l[lsp:] # Do not strip more than one prefix break for stripsuffix in stripsuffixes: lss = len(stripsuffix) if l[-lss:] == stripsuffix: l = l[:-lss] # Do not strip more than one suffix break stripped.append(l) return c(prefix, stripped, suffix, env) def processDefines(defs): """process defines, resolving strings, lists, dictionaries, into a list of strings """ if SCons.Util.is_List(defs): l = [] for d in defs: if d is None: continue elif SCons.Util.is_List(d) or isinstance(d, tuple): if len(d) >= 2: l.append(str(d[0]) + '=' + str(d[1])) else: l.append(str(d[0])) elif SCons.Util.is_Dict(d): for macro,value in d.items(): if value is not None: l.append(str(macro) + '=' + str(value)) else: l.append(str(macro)) elif SCons.Util.is_String(d): l.append(str(d)) else: raise SCons.Errors.UserError("DEFINE %s is not a list, dict, string or None."%repr(d)) elif SCons.Util.is_Dict(defs): # The items in a dictionary are stored in random order, but # if the order of the command-line options changes from # invocation to invocation, then the signature of the command # line will change and we'll get random unnecessary rebuilds. # Consequently, we have to sort the keys to ensure a # consistent order... l = [] for k,v in sorted(defs.items()): if v is None: l.append(str(k)) else: l.append(str(k) + '=' + str(v)) else: l = [str(defs)] return l def _defines(prefix, defs, suffix, env, c=_concat_ixes): """A wrapper around _concat_ixes that turns a list or string into a list of C preprocessor command-line definitions. """ return c(prefix, env.subst_path(processDefines(defs)), suffix, env) class NullCmdGenerator(object): """This is a callable class that can be used in place of other command generators if you don't want them to do anything. The __call__ method for this class simply returns the thing you instantiated it with. Example usage: env["DO_NOTHING"] = NullCmdGenerator env["LINKCOM"] = "${DO_NOTHING('$LINK $SOURCES $TARGET')}" """ def __init__(self, cmd): self.cmd = cmd def __call__(self, target, source, env, for_signature=None): return self.cmd class Variable_Method_Caller(object): """A class for finding a construction variable on the stack and calling one of its methods. We use this to support "construction variables" in our string eval()s that actually stand in for methods--specifically, use of "RDirs" in call to _concat that should actually execute the "TARGET.RDirs" method. (We used to support this by creating a little "build dictionary" that mapped RDirs to the method, but this got in the way of Memoizing construction environments, because we had to create new environment objects to hold the variables.) """ def __init__(self, variable, method): self.variable = variable self.method = method def __call__(self, *args, **kw): try: 1//0 except ZeroDivisionError: # Don't start iterating with the current stack-frame to # prevent creating reference cycles (f_back is safe). frame = sys.exc_info()[2].tb_frame.f_back variable = self.variable while frame: if variable in frame.f_locals: v = frame.f_locals[variable] if v: method = getattr(v, self.method) return method(*args, **kw) frame = frame.f_back return None # if $version_var is not empty, returns env[flags_var], otherwise returns None def __libversionflags(env, version_var, flags_var): try: if env.subst('$'+version_var): return env[flags_var] except KeyError: pass return None ConstructionEnvironment = { 'BUILDERS' : {}, 'SCANNERS' : [ SCons.Tool.SourceFileScanner ], 'CONFIGUREDIR' : '#/.sconf_temp', 'CONFIGURELOG' : '#/config.log', 'CPPSUFFIXES' : SCons.Tool.CSuffixes, 'DSUFFIXES' : SCons.Tool.DSuffixes, 'ENV' : {}, 'IDLSUFFIXES' : SCons.Tool.IDLSuffixes, # 'LATEXSUFFIXES' : SCons.Tool.LaTeXSuffixes, # moved to the TeX tools generate functions '_concat' : _concat, '_defines' : _defines, '_stripixes' : _stripixes, '_LIBFLAGS' : '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}', '_LIBDIRFLAGS' : '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)', '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)', '_CPPDEFFLAGS' : '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env__)}', '__libversionflags' : __libversionflags, '__SHLIBVERSIONFLAGS' : '${__libversionflags(__env__,"SHLIBVERSION","_SHLIBVERSIONFLAGS")}', '__LDMODULEVERSIONFLAGS' : '${__libversionflags(__env__,"LDMODULEVERSION","_LDMODULEVERSIONFLAGS")}', '__DSHLIBVERSIONFLAGS' : '${__libversionflags(__env__,"DSHLIBVERSION","_DSHLIBVERSIONFLAGS")}', 'TEMPFILE' : NullCmdGenerator, 'Dir' : Variable_Method_Caller('TARGET', 'Dir'), 'Dirs' : Variable_Method_Caller('TARGET', 'Dirs'), 'File' : Variable_Method_Caller('TARGET', 'File'), 'RDirs' : Variable_Method_Caller('TARGET', 'RDirs'), } # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/__init__.py0000664000175000017500000000313113160023045020646 0ustar bdbaddogbdbaddog"""SCons The main package for the SCons software construction utility. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __version__ = "3.0.0" __build__ = "rel_3.0.0:4395:8972f6a2f699" __buildsys__ = "ubuntu-16" __date__ = "2017/09/18 12:59:24" __developer__ = "bdbaddog" # make sure compatibility is always in place import SCons.compat # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Script/0000775000175000017500000000000013160023041017777 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Script/__init__.py0000664000175000017500000003421213160023041022112 0ustar bdbaddogbdbaddog"""SCons.Script This file implements the main() function used by the scons script. Architecturally, this *is* the scons script, and will likely only be called from the external "scons" wrapper. Consequently, anything here should not be, or be considered, part of the build engine. If it's something that we expect other software to want to use, it should go in some other module. If it's specific to the "scons" script invocation, it goes here. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Script/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import time start_time = time.time() import collections import os try: from StringIO import StringIO except ImportError: from io import StringIO import sys # Special chicken-and-egg handling of the "--debug=memoizer" flag: # # SCons.Memoize contains a metaclass implementation that affects how # the other classes are instantiated. The Memoizer may add shim methods # to classes that have methods that cache computed values in order to # count and report the hits and misses. # # If we wait to enable the Memoization until after we've parsed the # command line options normally, it will be too late, because the Memoizer # will have already analyzed the classes that it's Memoizing and decided # to not add the shims. So we use a special-case, up-front check for # the "--debug=memoizer" flag and enable Memoizer before we import any # of the other modules that use it. _args = sys.argv + os.environ.get('SCONSFLAGS', '').split() if "--debug=memoizer" in _args: import SCons.Memoize import SCons.Warnings try: SCons.Memoize.EnableMemoization() except SCons.Warnings.Warning: # Some warning was thrown. Arrange for it to be displayed # or not after warnings are configured. from . import Main exc_type, exc_value, tb = sys.exc_info() Main.delayed_warnings.append((exc_type, exc_value)) del _args import SCons.Action import SCons.Builder import SCons.Environment import SCons.Node.FS import SCons.Options import SCons.Platform import SCons.Scanner import SCons.SConf import SCons.Subst import SCons.Tool import SCons.Util import SCons.Variables import SCons.Defaults from . import Main main = Main.main # The following are global class definitions and variables that used to # live directly in this module back before 0.96.90, when it contained # a lot of code. Some SConscript files in widely-distributed packages # (Blender is the specific example) actually reached into SCons.Script # directly to use some of these. Rather than break those SConscript # files, we're going to propagate these names into the SCons.Script # namespace here. # # Some of these are commented out because it's *really* unlikely anyone # used them, but we're going to leave the comment here to try to make # it obvious what to do if the situation arises. BuildTask = Main.BuildTask CleanTask = Main.CleanTask QuestionTask = Main.QuestionTask #PrintHelp = Main.PrintHelp #SConscriptSettableOptions = Main.SConscriptSettableOptions AddOption = Main.AddOption PrintHelp = Main.PrintHelp GetOption = Main.GetOption SetOption = Main.SetOption Progress = Main.Progress GetBuildFailures = Main.GetBuildFailures #keep_going_on_error = Main.keep_going_on_error #print_dtree = Main.print_dtree #print_explanations = Main.print_explanations #print_includes = Main.print_includes #print_objects = Main.print_objects #print_time = Main.print_time #print_tree = Main.print_tree #memory_stats = Main.memory_stats #ignore_errors = Main.ignore_errors #sconscript_time = Main.sconscript_time #command_time = Main.command_time #exit_status = Main.exit_status #profiling = Main.profiling #repositories = Main.repositories # from . import SConscript _SConscript = SConscript call_stack = _SConscript.call_stack # Action = SCons.Action.Action AddMethod = SCons.Util.AddMethod AllowSubstExceptions = SCons.Subst.SetAllowableExceptions Builder = SCons.Builder.Builder Configure = _SConscript.Configure Environment = SCons.Environment.Environment #OptParser = SCons.SConsOptions.OptParser FindPathDirs = SCons.Scanner.FindPathDirs Platform = SCons.Platform.Platform Return = _SConscript.Return Scanner = SCons.Scanner.Base Tool = SCons.Tool.Tool WhereIs = SCons.Util.WhereIs # BoolVariable = SCons.Variables.BoolVariable EnumVariable = SCons.Variables.EnumVariable ListVariable = SCons.Variables.ListVariable PackageVariable = SCons.Variables.PackageVariable PathVariable = SCons.Variables.PathVariable # Deprecated names that will go away some day. BoolOption = SCons.Options.BoolOption EnumOption = SCons.Options.EnumOption ListOption = SCons.Options.ListOption PackageOption = SCons.Options.PackageOption PathOption = SCons.Options.PathOption # Action factories. Chmod = SCons.Defaults.Chmod Copy = SCons.Defaults.Copy Delete = SCons.Defaults.Delete Mkdir = SCons.Defaults.Mkdir Move = SCons.Defaults.Move Touch = SCons.Defaults.Touch # Pre-made, public scanners. CScanner = SCons.Tool.CScanner DScanner = SCons.Tool.DScanner DirScanner = SCons.Defaults.DirScanner ProgramScanner = SCons.Tool.ProgramScanner SourceFileScanner = SCons.Tool.SourceFileScanner # Functions we might still convert to Environment methods. CScan = SCons.Defaults.CScan DefaultEnvironment = SCons.Defaults.DefaultEnvironment # Other variables we provide. class TargetList(collections.UserList): def _do_nothing(self, *args, **kw): pass def _add_Default(self, list): self.extend(list) def _clear(self): del self[:] ARGUMENTS = {} ARGLIST = [] BUILD_TARGETS = TargetList() COMMAND_LINE_TARGETS = [] DEFAULT_TARGETS = [] # BUILD_TARGETS can be modified in the SConscript files. If so, we # want to treat the modified BUILD_TARGETS list as if they specified # targets on the command line. To do that, though, we need to know if # BUILD_TARGETS was modified through "official" APIs or by hand. We do # this by updating two lists in parallel, the documented BUILD_TARGETS # list, above, and this internal _build_plus_default targets list which # should only have "official" API changes. Then Script/Main.py can # compare these two afterwards to figure out if the user added their # own targets to BUILD_TARGETS. _build_plus_default = TargetList() def _Add_Arguments(alist): for arg in alist: a, b = arg.split('=', 1) ARGUMENTS[a] = b ARGLIST.append((a, b)) def _Add_Targets(tlist): if tlist: COMMAND_LINE_TARGETS.extend(tlist) BUILD_TARGETS.extend(tlist) BUILD_TARGETS._add_Default = BUILD_TARGETS._do_nothing BUILD_TARGETS._clear = BUILD_TARGETS._do_nothing _build_plus_default.extend(tlist) _build_plus_default._add_Default = _build_plus_default._do_nothing _build_plus_default._clear = _build_plus_default._do_nothing def _Set_Default_Targets_Has_Been_Called(d, fs): return DEFAULT_TARGETS def _Set_Default_Targets_Has_Not_Been_Called(d, fs): if d is None: d = [fs.Dir('.')] return d _Get_Default_Targets = _Set_Default_Targets_Has_Not_Been_Called def _Set_Default_Targets(env, tlist): global DEFAULT_TARGETS global _Get_Default_Targets _Get_Default_Targets = _Set_Default_Targets_Has_Been_Called for t in tlist: if t is None: # Delete the elements from the list in-place, don't # reassign an empty list to DEFAULT_TARGETS, so that the # variables will still point to the same object we point to. del DEFAULT_TARGETS[:] BUILD_TARGETS._clear() _build_plus_default._clear() elif isinstance(t, SCons.Node.Node): DEFAULT_TARGETS.append(t) BUILD_TARGETS._add_Default([t]) _build_plus_default._add_Default([t]) else: nodes = env.arg2nodes(t, env.fs.Entry) DEFAULT_TARGETS.extend(nodes) BUILD_TARGETS._add_Default(nodes) _build_plus_default._add_Default(nodes) # help_text = None def HelpFunction(text, append=False): global help_text if help_text is None: if append: s = StringIO() PrintHelp(s) help_text = s.getvalue() s.close() else: help_text = "" help_text= help_text + text # # Will be non-zero if we are reading an SConscript file. sconscript_reading = 0 # def Variables(files=[], args=ARGUMENTS): return SCons.Variables.Variables(files, args) def Options(files=[], args=ARGUMENTS): return SCons.Options.Options(files, args) # The list of global functions to add to the SConscript name space # that end up calling corresponding methods or Builders in the # DefaultEnvironment(). GlobalDefaultEnvironmentFunctions = [ # Methods from the SConsEnvironment class, above. 'Default', 'EnsurePythonVersion', 'EnsureSConsVersion', 'Exit', 'Export', 'GetLaunchDir', 'Help', 'Import', #'SConscript', is handled separately, below. 'SConscriptChdir', # Methods from the Environment.Base class. 'AddPostAction', 'AddPreAction', 'Alias', 'AlwaysBuild', 'BuildDir', 'CacheDir', 'Clean', #The Command() method is handled separately, below. 'Decider', 'Depends', 'Dir', 'NoClean', 'NoCache', 'Entry', 'Execute', 'File', 'FindFile', 'FindInstalledFiles', 'FindSourceFiles', 'Flatten', 'GetBuildPath', 'Glob', 'Ignore', 'Install', 'InstallAs', 'InstallVersionedLib', 'Literal', 'Local', 'ParseDepends', 'Precious', 'PyPackageDir', 'Repository', 'Requires', 'SConsignFile', 'SideEffect', 'SourceCode', 'SourceSignatures', 'Split', 'Tag', 'TargetSignatures', 'Value', 'VariantDir', ] GlobalDefaultBuilders = [ # Supported builders. 'CFile', 'CXXFile', 'DVI', 'Jar', 'Java', 'JavaH', 'Library', 'LoadableModule', 'M4', 'MSVSProject', 'Object', 'PCH', 'PDF', 'PostScript', 'Program', 'RES', 'RMIC', 'SharedLibrary', 'SharedObject', 'StaticLibrary', 'StaticObject', 'Tar', 'TypeLibrary', 'Zip', 'Package', ] for name in GlobalDefaultEnvironmentFunctions + GlobalDefaultBuilders: exec ("%s = _SConscript.DefaultEnvironmentCall(%s)" % (name, repr(name))) del name # There are a handful of variables that used to live in the # Script/SConscript.py module that some SConscript files out there were # accessing directly as SCons.Script.SConscript.*. The problem is that # "SConscript" in this namespace is no longer a module, it's a global # function call--or more precisely, an object that implements a global # function call through the default Environment. Nevertheless, we can # maintain backwards compatibility for SConscripts that were reaching in # this way by hanging some attributes off the "SConscript" object here. SConscript = _SConscript.DefaultEnvironmentCall('SConscript') # Make SConscript look enough like the module it used to be so # that pychecker doesn't barf. SConscript.__name__ = 'SConscript' SConscript.Arguments = ARGUMENTS SConscript.ArgList = ARGLIST SConscript.BuildTargets = BUILD_TARGETS SConscript.CommandLineTargets = COMMAND_LINE_TARGETS SConscript.DefaultTargets = DEFAULT_TARGETS # The global Command() function must be handled differently than the # global functions for other construction environment methods because # we want people to be able to use Actions that must expand $TARGET # and $SOURCE later, when (and if) the Action is invoked to build # the target(s). We do this with the subst=1 argument, which creates # a DefaultEnvironmentCall instance that wraps up a normal default # construction environment that performs variable substitution, not a # proxy that doesn't. # # There's a flaw here, though, because any other $-variables on a command # line will *also* be expanded, each to a null string, but that should # only be a problem in the unusual case where someone was passing a '$' # on a command line and *expected* the $ to get through to the shell # because they were calling Command() and not env.Command()... This is # unlikely enough that we're going to leave this as is and cross that # bridge if someone actually comes to it. Command = _SConscript.DefaultEnvironmentCall('Command', subst=1) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Script/SConsOptions.py0000664000175000017500000011522213160023041022755 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Script/SConsOptions.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import optparse import re import sys import textwrap no_hyphen_re = re.compile(r'(\s+|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') try: from gettext import gettext except ImportError: def gettext(message): return message _ = gettext import SCons.Node.FS import SCons.Warnings OptionValueError = optparse.OptionValueError SUPPRESS_HELP = optparse.SUPPRESS_HELP diskcheck_all = SCons.Node.FS.diskcheck_types() def diskcheck_convert(value): if value is None: return [] if not SCons.Util.is_List(value): value = value.split(',') result = [] for v in value: v = v.lower() if v == 'all': result = diskcheck_all elif v == 'none': result = [] elif v in diskcheck_all: result.append(v) else: raise ValueError(v) return result class SConsValues(optparse.Values): """ Holder class for uniform access to SCons options, regardless of whether or not they can be set on the command line or in the SConscript files (using the SetOption() function). A SCons option value can originate three different ways: 1) set on the command line; 2) set in an SConscript file; 3) the default setting (from the the op.add_option() calls in the Parser() function, below). The command line always overrides a value set in a SConscript file, which in turn always overrides default settings. Because we want to support user-specified options in the SConscript file itself, though, we may not know about all of the options when the command line is first parsed, so we can't make all the necessary precedence decisions at the time the option is configured. The solution implemented in this class is to keep these different sets of settings separate (command line, SConscript file, and default) and to override the __getattr__() method to check them in turn. This should allow the rest of the code to just fetch values as attributes of an instance of this class, without having to worry about where they came from. Note that not all command line options are settable from SConscript files, and the ones that are must be explicitly added to the "settable" list in this class, and optionally validated and coerced in the set_option() method. """ def __init__(self, defaults): self.__dict__['__defaults__'] = defaults self.__dict__['__SConscript_settings__'] = {} def __getattr__(self, attr): """ Fetches an options value, checking first for explicit settings from the command line (which are direct attributes), then the SConscript file settings, then the default values. """ try: return self.__dict__[attr] except KeyError: try: return self.__dict__['__SConscript_settings__'][attr] except KeyError: try: return getattr(self.__dict__['__defaults__'], attr) except KeyError: # Added because with py3 this is a new class, # not a classic class, and due to the way # In that case it will create an object without # __defaults__, and then query for __setstate__ # which will throw an exception of KeyError # deepcopy() is expecting AttributeError if __setstate__ # is not available. raise AttributeError(attr) settable = [ 'clean', 'diskcheck', 'duplicate', 'help', 'implicit_cache', 'max_drift', 'md5_chunksize', 'no_exec', 'num_jobs', 'random', 'stack_size', 'warn', 'silent' ] def set_option(self, name, value): """ Sets an option from an SConscript file. """ if not name in self.settable: raise SCons.Errors.UserError("This option is not settable from a SConscript file: %s"%name) if name == 'num_jobs': try: value = int(value) if value < 1: raise ValueError except ValueError: raise SCons.Errors.UserError("A positive integer is required: %s"%repr(value)) elif name == 'max_drift': try: value = int(value) except ValueError: raise SCons.Errors.UserError("An integer is required: %s"%repr(value)) elif name == 'duplicate': try: value = str(value) except ValueError: raise SCons.Errors.UserError("A string is required: %s"%repr(value)) if not value in SCons.Node.FS.Valid_Duplicates: raise SCons.Errors.UserError("Not a valid duplication style: %s" % value) # Set the duplicate style right away so it can affect linking # of SConscript files. SCons.Node.FS.set_duplicate(value) elif name == 'diskcheck': try: value = diskcheck_convert(value) except ValueError as v: raise SCons.Errors.UserError("Not a valid diskcheck value: %s"%v) if 'diskcheck' not in self.__dict__: # No --diskcheck= option was specified on the command line. # Set this right away so it can affect the rest of the # file/Node lookups while processing the SConscript files. SCons.Node.FS.set_diskcheck(value) elif name == 'stack_size': try: value = int(value) except ValueError: raise SCons.Errors.UserError("An integer is required: %s"%repr(value)) elif name == 'md5_chunksize': try: value = int(value) except ValueError: raise SCons.Errors.UserError("An integer is required: %s"%repr(value)) elif name == 'warn': if SCons.Util.is_String(value): value = [value] value = self.__SConscript_settings__.get(name, []) + value SCons.Warnings.process_warn_strings(value) self.__SConscript_settings__[name] = value class SConsOption(optparse.Option): def convert_value(self, opt, value): if value is not None: if self.nargs in (1, '?'): return self.check_value(opt, value) else: return tuple([self.check_value(opt, v) for v in value]) def process(self, opt, value, values, parser): # First, convert the value(s) to the right type. Howl if any # value(s) are bogus. value = self.convert_value(opt, value) # And then take whatever action is expected of us. # This is a separate method to make life easier for # subclasses to add new actions. return self.take_action( self.action, self.dest, opt, value, values, parser) def _check_nargs_optional(self): if self.nargs == '?' and self._short_opts: fmt = "option %s: nargs='?' is incompatible with short options" raise SCons.Errors.UserError(fmt % self._short_opts[0]) try: _orig_CONST_ACTIONS = optparse.Option.CONST_ACTIONS _orig_CHECK_METHODS = optparse.Option.CHECK_METHODS except AttributeError: # optparse.Option had no CONST_ACTIONS before Python 2.5. _orig_CONST_ACTIONS = ("store_const",) def _check_const(self): if self.action not in self.CONST_ACTIONS and self.const is not None: raise OptionError( "'const' must not be supplied for action %r" % self.action, self) # optparse.Option collects its list of unbound check functions # up front. This sucks because it means we can't just override # the _check_const() function like a normal method, we have to # actually replace it in the list. This seems to be the most # straightforward way to do that. _orig_CHECK_METHODS = [optparse.Option._check_action, optparse.Option._check_type, optparse.Option._check_choice, optparse.Option._check_dest, _check_const, optparse.Option._check_nargs, optparse.Option._check_callback] CHECK_METHODS = _orig_CHECK_METHODS + [_check_nargs_optional] CONST_ACTIONS = _orig_CONST_ACTIONS + optparse.Option.TYPED_ACTIONS class SConsOptionGroup(optparse.OptionGroup): """ A subclass for SCons-specific option groups. The only difference between this and the base class is that we print the group's help text flush left, underneath their own title but lined up with the normal "SCons Options". """ def format_help(self, formatter): """ Format an option group's help text, outdenting the title so it's flush with the "SCons Options" title we print at the top. """ formatter.dedent() result = formatter.format_heading(self.title) formatter.indent() result = result + optparse.OptionContainer.format_help(self, formatter) return result class SConsOptionParser(optparse.OptionParser): preserve_unknown_options = False def error(self, msg): # overridden OptionValueError exception handler self.print_usage(sys.stderr) sys.stderr.write("SCons Error: %s\n" % msg) sys.exit(2) def _process_long_opt(self, rargs, values): """ SCons-specific processing of long options. This is copied directly from the normal optparse._process_long_opt() method, except that, if configured to do so, we catch the exception thrown when an unknown option is encountered and just stick it back on the "leftover" arguments for later (re-)processing. """ arg = rargs.pop(0) # Value explicitly attached to arg? Pretend it's the next # argument. if "=" in arg: (opt, next_arg) = arg.split("=", 1) rargs.insert(0, next_arg) had_explicit_value = True else: opt = arg had_explicit_value = False try: opt = self._match_long_opt(opt) except optparse.BadOptionError: if self.preserve_unknown_options: # SCons-specific: if requested, add unknown options to # the "leftover arguments" list for later processing. self.largs.append(arg) if had_explicit_value: # The unknown option will be re-processed later, # so undo the insertion of the explicit value. rargs.pop(0) return raise option = self._long_opt[opt] if option.takes_value(): nargs = option.nargs if nargs == '?': if had_explicit_value: value = rargs.pop(0) else: value = option.const elif len(rargs) < nargs: if nargs == 1: if not option.choices: self.error(_("%s option requires an argument") % opt) else: msg = _("%s option requires an argument " % opt) msg += _("(choose from %s)" % ', '.join(option.choices)) self.error(msg) else: self.error(_("%s option requires %d arguments") % (opt, nargs)) elif nargs == 1: value = rargs.pop(0) else: value = tuple(rargs[0:nargs]) del rargs[0:nargs] elif had_explicit_value: self.error(_("%s option does not take a value") % opt) else: value = None option.process(opt, value, values, self) def reparse_local_options(self): """ Re-parse the leftover command-line options stored in self.largs, so that any value overridden on the command line is immediately available if the user turns around and does a GetOption() right away. We mimic the processing of the single args in the original OptionParser._process_args(), but here we allow exact matches for long-opts only (no partial argument names!). Else, this would lead to problems in add_local_option() below. When called from there, we try to reparse the command-line arguments that 1. haven't been processed so far (self.largs), but 2. are possibly not added to the list of options yet. So, when we only have a value for "--myargument" yet, a command-line argument of "--myarg=test" would set it. Responsible for this behaviour is the method _match_long_opt(), which allows for partial matches of the option name, as long as the common prefix appears to be unique. This would lead to further confusion, because we might want to add another option "--myarg" later on (see issue #2929). """ rargs = [] largs_restore = [] # Loop over all remaining arguments skip = False for l in self.largs: if skip: # Accept all remaining arguments as they are largs_restore.append(l) else: if len(l) > 2 and l[0:2] == "--": # Check long option lopt = (l,) if "=" in l: # Split into option and value lopt = l.split("=", 1) if lopt[0] in self._long_opt: # Argument is already known rargs.append('='.join(lopt)) else: # Not known yet, so reject for now largs_restore.append('='.join(lopt)) else: if l == "--" or l == "-": # Stop normal processing and don't # process the rest of the command-line opts largs_restore.append(l) skip = True else: rargs.append(l) # Parse the filtered list self.parse_args(rargs, self.values) # Restore the list of remaining arguments for the # next call of AddOption/add_local_option... self.largs = self.largs + largs_restore def add_local_option(self, *args, **kw): """ Adds a local option to the parser. This is initiated by a SetOption() call to add a user-defined command-line option. We add the option to a separate option group for the local options, creating the group if necessary. """ try: group = self.local_option_group except AttributeError: group = SConsOptionGroup(self, 'Local Options') group = self.add_option_group(group) self.local_option_group = group result = group.add_option(*args, **kw) if result: # The option was added successfully. We now have to add the # default value to our object that holds the default values # (so that an attempt to fetch the option's attribute will # yield the default value when not overridden) and then # we re-parse the leftover command-line options, so that # any value overridden on the command line is immediately # available if the user turns around and does a GetOption() # right away. setattr(self.values.__defaults__, result.dest, result.default) self.reparse_local_options() return result class SConsIndentedHelpFormatter(optparse.IndentedHelpFormatter): def format_usage(self, usage): return "usage: %s\n" % usage def format_heading(self, heading): """ This translates any heading of "options" or "Options" into "SCons Options." Unfortunately, we have to do this here, because those titles are hard-coded in the optparse calls. """ if heading == 'Options': heading = "SCons Options" return optparse.IndentedHelpFormatter.format_heading(self, heading) def format_option(self, option): """ A copy of the normal optparse.IndentedHelpFormatter.format_option() method. This has been snarfed so we can modify text wrapping to out liking: -- add our own regular expression that doesn't break on hyphens (so things like --no-print-directory don't get broken); -- wrap the list of options themselves when it's too long (the wrapper.fill(opts) call below); -- set the subsequent_indent when wrapping the help_text. """ # The help for each option consists of two parts: # * the opt strings and metavars # eg. ("-x", or "-fFILENAME, --file=FILENAME") # * the user-supplied help string # eg. ("turn on expert mode", "read data from FILENAME") # # If possible, we write both of these on the same line: # -x turn on expert mode # # But if the opt string list is too long, we put the help # string on a second line, indented to the same column it would # start in if it fit on the first line. # -fFILENAME, --file=FILENAME # read data from FILENAME result = [] opts = self.option_strings[option] opt_width = self.help_position - self.current_indent - 2 if len(opts) > opt_width: wrapper = textwrap.TextWrapper(width=self.width, initial_indent = ' ', subsequent_indent = ' ') wrapper.wordsep_re = no_hyphen_re opts = wrapper.fill(opts) + '\n' indent_first = self.help_position else: # start help on same line as opts opts = "%*s%-*s " % (self.current_indent, "", opt_width, opts) indent_first = 0 result.append(opts) if option.help: help_text = self.expand_default(option) # SCons: indent every line of the help text but the first. wrapper = textwrap.TextWrapper(width=self.help_width, subsequent_indent = ' ') wrapper.wordsep_re = no_hyphen_re help_lines = wrapper.wrap(help_text) result.append("%*s%s\n" % (indent_first, "", help_lines[0])) for line in help_lines[1:]: result.append("%*s%s\n" % (self.help_position, "", line)) elif opts[-1] != "\n": result.append("\n") return "".join(result) def Parser(version): """ Returns an options parser object initialized with the standard SCons options. """ formatter = SConsIndentedHelpFormatter(max_help_position=30) op = SConsOptionParser(option_class=SConsOption, add_help_option=False, formatter=formatter, usage="usage: scons [OPTION] [TARGET] ...",) op.preserve_unknown_options = True op.version = version # Add the options to the parser we just created. # # These are in the order we want them to show up in the -H help # text, basically alphabetical. Each op.add_option() call below # should have a consistent format: # # op.add_option("-L", "--long-option-name", # nargs=1, type="string", # dest="long_option_name", default='foo', # action="callback", callback=opt_long_option, # help="help text goes here", # metavar="VAR") # # Even though the optparse module constructs reasonable default # destination names from the long option names, we're going to be # explicit about each one for easier readability and so this code # will at least show up when grepping the source for option attribute # names, or otherwise browsing the source code. # options ignored for compatibility def opt_ignore(option, opt, value, parser): sys.stderr.write("Warning: ignoring %s option\n" % opt) op.add_option("-b", "-d", "-e", "-m", "-S", "-t", "-w", "--environment-overrides", "--no-keep-going", "--no-print-directory", "--print-directory", "--stop", "--touch", action="callback", callback=opt_ignore, help="Ignored for compatibility.") op.add_option('-c', '--clean', '--remove', dest="clean", default=False, action="store_true", help="Remove specified targets and dependencies.") op.add_option('-C', '--directory', nargs=1, type="string", dest="directory", default=[], action="append", help="Change to DIR before doing anything.", metavar="DIR") op.add_option('--cache-debug', nargs=1, dest="cache_debug", default=None, action="store", help="Print CacheDir debug info to FILE.", metavar="FILE") op.add_option('--cache-disable', '--no-cache', dest='cache_disable', default=False, action="store_true", help="Do not retrieve built targets from CacheDir.") op.add_option('--cache-force', '--cache-populate', dest='cache_force', default=False, action="store_true", help="Copy already-built targets into the CacheDir.") op.add_option('--cache-readonly', dest='cache_readonly', default=False, action="store_true", help="Do not update CacheDir with built targets.") op.add_option('--cache-show', dest='cache_show', default=False, action="store_true", help="Print build actions for files from CacheDir.") def opt_invalid(group, value, options): errmsg = "`%s' is not a valid %s option type, try:\n" % (value, group) return errmsg + " %s" % ", ".join(options) config_options = ["auto", "force" ,"cache"] opt_config_help = "Controls Configure subsystem: %s." \ % ", ".join(config_options) op.add_option('--config', nargs=1, choices=config_options, dest="config", default="auto", help = opt_config_help, metavar="MODE") op.add_option('-D', dest="climb_up", default=None, action="store_const", const=2, help="Search up directory tree for SConstruct, " "build all Default() targets.") deprecated_debug_options = { "dtree" : '; please use --tree=derived instead', "nomemoizer" : ' and has no effect', "stree" : '; please use --tree=all,status instead', "tree" : '; please use --tree=all instead', } debug_options = ["count", "duplicate", "explain", "findlibs", "includes", "memoizer", "memory", "objects", "pdb", "prepare", "presub", "stacktrace", "time"] def opt_debug(option, opt, value__, parser, debug_options=debug_options, deprecated_debug_options=deprecated_debug_options): for value in value__.split(','): if value in debug_options: parser.values.debug.append(value) elif value in list(deprecated_debug_options.keys()): parser.values.debug.append(value) try: parser.values.delayed_warnings except AttributeError: parser.values.delayed_warnings = [] msg = deprecated_debug_options[value] w = "The --debug=%s option is deprecated%s." % (value, msg) t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w) parser.values.delayed_warnings.append(t) else: raise OptionValueError(opt_invalid('debug', value, debug_options)) opt_debug_help = "Print various types of debugging information: %s." \ % ", ".join(debug_options) op.add_option('--debug', nargs=1, type="string", dest="debug", default=[], action="callback", callback=opt_debug, help=opt_debug_help, metavar="TYPE") def opt_diskcheck(option, opt, value, parser): try: diskcheck_value = diskcheck_convert(value) except ValueError as e: raise OptionValueError("`%s' is not a valid diskcheck type" % e) setattr(parser.values, option.dest, diskcheck_value) op.add_option('--diskcheck', nargs=1, type="string", dest='diskcheck', default=None, action="callback", callback=opt_diskcheck, help="Enable specific on-disk checks.", metavar="TYPE") def opt_duplicate(option, opt, value, parser): if not value in SCons.Node.FS.Valid_Duplicates: raise OptionValueError(opt_invalid('duplication', value, SCons.Node.FS.Valid_Duplicates)) setattr(parser.values, option.dest, value) # Set the duplicate style right away so it can affect linking # of SConscript files. SCons.Node.FS.set_duplicate(value) opt_duplicate_help = "Set the preferred duplication methods. Must be one of " \ + ", ".join(SCons.Node.FS.Valid_Duplicates) op.add_option('--duplicate', nargs=1, type="string", dest="duplicate", default='hard-soft-copy', action="callback", callback=opt_duplicate, help=opt_duplicate_help) op.add_option('-f', '--file', '--makefile', '--sconstruct', nargs=1, type="string", dest="file", default=[], action="append", help="Read FILE as the top-level SConstruct file.") op.add_option('-h', '--help', dest="help", default=False, action="store_true", help="Print defined help message, or this one.") op.add_option("-H", "--help-options", action="help", help="Print this message and exit.") op.add_option('-i', '--ignore-errors', dest='ignore_errors', default=False, action="store_true", help="Ignore errors from build actions.") op.add_option('-I', '--include-dir', nargs=1, dest='include_dir', default=[], action="append", help="Search DIR for imported Python modules.", metavar="DIR") op.add_option('--implicit-cache', dest='implicit_cache', default=False, action="store_true", help="Cache implicit dependencies") def opt_implicit_deps(option, opt, value, parser): setattr(parser.values, 'implicit_cache', True) setattr(parser.values, option.dest, True) op.add_option('--implicit-deps-changed', dest="implicit_deps_changed", default=False, action="callback", callback=opt_implicit_deps, help="Ignore cached implicit dependencies.") op.add_option('--implicit-deps-unchanged', dest="implicit_deps_unchanged", default=False, action="callback", callback=opt_implicit_deps, help="Ignore changes in implicit dependencies.") op.add_option('--interact', '--interactive', dest='interactive', default=False, action="store_true", help="Run in interactive mode.") op.add_option('-j', '--jobs', nargs=1, type="int", dest="num_jobs", default=1, action="store", help="Allow N jobs at once.", metavar="N") op.add_option('-k', '--keep-going', dest='keep_going', default=False, action="store_true", help="Keep going when a target can't be made.") op.add_option('--max-drift', nargs=1, type="int", dest='max_drift', default=SCons.Node.FS.default_max_drift, action="store", help="Set maximum system clock drift to N seconds.", metavar="N") op.add_option('--md5-chunksize', nargs=1, type="int", dest='md5_chunksize', default=SCons.Node.FS.File.md5_chunksize, action="store", help="Set chunk-size for MD5 signature computation to N kilobytes.", metavar="N") op.add_option('-n', '--no-exec', '--just-print', '--dry-run', '--recon', dest='no_exec', default=False, action="store_true", help="Don't build; just print commands.") op.add_option('--no-site-dir', dest='no_site_dir', default=False, action="store_true", help="Don't search or use the usual site_scons dir.") op.add_option('--profile', nargs=1, dest="profile_file", default=None, action="store", help="Profile SCons and put results in FILE.", metavar="FILE") op.add_option('-q', '--question', dest="question", default=False, action="store_true", help="Don't build; exit status says if up to date.") op.add_option('-Q', dest='no_progress', default=False, action="store_true", help="Suppress \"Reading/Building\" progress messages.") op.add_option('--random', dest="random", default=False, action="store_true", help="Build dependencies in random order.") op.add_option('-s', '--silent', '--quiet', dest="silent", default=False, action="store_true", help="Don't print commands.") op.add_option('--site-dir', nargs=1, dest='site_dir', default=None, action="store", help="Use DIR instead of the usual site_scons dir.", metavar="DIR") op.add_option('--stack-size', nargs=1, type="int", dest='stack_size', action="store", help="Set the stack size of the threads used to run jobs to N kilobytes.", metavar="N") op.add_option('--taskmastertrace', nargs=1, dest="taskmastertrace_file", default=None, action="store", help="Trace Node evaluation to FILE.", metavar="FILE") tree_options = ["all", "derived", "prune", "status"] def opt_tree(option, opt, value, parser, tree_options=tree_options): from . import Main tp = Main.TreePrinter() for o in value.split(','): if o == 'all': tp.derived = False elif o == 'derived': tp.derived = True elif o == 'prune': tp.prune = True elif o == 'status': tp.status = True else: raise OptionValueError(opt_invalid('--tree', o, tree_options)) parser.values.tree_printers.append(tp) opt_tree_help = "Print a dependency tree in various formats: %s." \ % ", ".join(tree_options) op.add_option('--tree', nargs=1, type="string", dest="tree_printers", default=[], action="callback", callback=opt_tree, help=opt_tree_help, metavar="OPTIONS") op.add_option('-u', '--up', '--search-up', dest="climb_up", default=0, action="store_const", const=1, help="Search up directory tree for SConstruct, " "build targets at or below current directory.") op.add_option('-U', dest="climb_up", default=0, action="store_const", const=3, help="Search up directory tree for SConstruct, " "build Default() targets from local SConscript.") def opt_version(option, opt, value, parser): sys.stdout.write(parser.version + '\n') sys.exit(0) op.add_option("-v", "--version", action="callback", callback=opt_version, help="Print the SCons version number and exit.") def opt_warn(option, opt, value, parser, tree_options=tree_options): if SCons.Util.is_String(value): value = value.split(',') parser.values.warn.extend(value) op.add_option('--warn', '--warning', nargs=1, type="string", dest="warn", default=[], action="callback", callback=opt_warn, help="Enable or disable warnings.", metavar="WARNING-SPEC") op.add_option('-Y', '--repository', '--srcdir', nargs=1, dest="repository", default=[], action="append", help="Search REPOSITORY for source and target files.") # Options from Make and Cons classic that we do not yet support, # but which we may support someday and whose (potential) meanings # we don't want to change. These all get a "the -X option is not # yet implemented" message and don't show up in the help output. def opt_not_yet(option, opt, value, parser): msg = "Warning: the %s option is not yet implemented\n" % opt sys.stderr.write(msg) op.add_option('-l', '--load-average', '--max-load', nargs=1, type="float", dest="load_average", default=0, action="callback", callback=opt_not_yet, # action="store", # help="Don't start multiple jobs unless load is below " # "LOAD-AVERAGE." help=SUPPRESS_HELP) op.add_option('--list-actions', dest="list_actions", action="callback", callback=opt_not_yet, # help="Don't build; list files and build actions." help=SUPPRESS_HELP) op.add_option('--list-derived', dest="list_derived", action="callback", callback=opt_not_yet, # help="Don't build; list files that would be built." help=SUPPRESS_HELP) op.add_option('--list-where', dest="list_where", action="callback", callback=opt_not_yet, # help="Don't build; list files and where defined." help=SUPPRESS_HELP) op.add_option('-o', '--old-file', '--assume-old', nargs=1, type="string", dest="old_file", default=[], action="callback", callback=opt_not_yet, # action="append", # help = "Consider FILE to be old; don't rebuild it." help=SUPPRESS_HELP) op.add_option('--override', nargs=1, type="string", action="callback", callback=opt_not_yet, dest="override", # help="Override variables as specified in FILE." help=SUPPRESS_HELP) op.add_option('-p', action="callback", callback=opt_not_yet, dest="p", # help="Print internal environments/objects." help=SUPPRESS_HELP) op.add_option('-r', '-R', '--no-builtin-rules', '--no-builtin-variables', action="callback", callback=opt_not_yet, dest="no_builtin_rules", # help="Clear default environments and variables." help=SUPPRESS_HELP) op.add_option('--write-filenames', nargs=1, type="string", dest="write_filenames", action="callback", callback=opt_not_yet, # help="Write all filenames examined into FILE." help=SUPPRESS_HELP) op.add_option('-W', '--new-file', '--assume-new', '--what-if', nargs=1, type="string", dest="new_file", action="callback", callback=opt_not_yet, # help="Consider FILE to be changed." help=SUPPRESS_HELP) op.add_option('--warn-undefined-variables', dest="warn_undefined_variables", action="callback", callback=opt_not_yet, # help="Warn when an undefined variable is referenced." help=SUPPRESS_HELP) return op # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Script/MainTests.py0000664000175000017500000000401113160023041022254 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Script/MainTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import unittest import TestUnit import SCons.Errors import SCons.Script.Main # Unit tests of various classes within SCons.Script.Main.py. # # Most of the tests of this functionality are actually end-to-end scripts # in the test/ hierarchy. # # This module is for specific bits of functionality that we can test # more effectively here, instead of in an end-to-end test that would # have to reach into SCons.Script.Main for various classes or other bits # of private functionality. if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Script/Main.py0000664000175000017500000014567013160023041021252 0ustar bdbaddogbdbaddog"""SCons.Script This file implements the main() function used by the scons script. Architecturally, this *is* the scons script, and will likely only be called from the external "scons" wrapper. Consequently, anything here should not be, or be considered, part of the build engine. If it's something that we expect other software to want to use, it should go in some other module. If it's specific to the "scons" script invocation, it goes here. """ from __future__ import print_function unsupported_python_version = (2, 6, 0) deprecated_python_version = (2, 7, 0) # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Script/Main.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import os import sys import time import traceback import sysconfig import SCons.CacheDir import SCons.Debug import SCons.Defaults import SCons.Environment import SCons.Errors import SCons.Job import SCons.Node import SCons.Node.FS import SCons.Platform import SCons.SConf import SCons.Script import SCons.Taskmaster import SCons.Util import SCons.Warnings import SCons.Script.Interactive def fetch_win32_parallel_msg(): # A subsidiary function that exists solely to isolate this import # so we don't have to pull it in on all platforms, and so that an # in-line "import" statement in the _main() function below doesn't # cause warnings about local names shadowing use of the 'SCons' # global in nest scopes and UnboundLocalErrors and the like in some # versions (2.1) of Python. import SCons.Platform.win32 return SCons.Platform.win32.parallel_msg def revert_io(): # This call is added to revert stderr and stdout to the original # ones just in case some build rule or something else in the system # has redirected them elsewhere. sys.stderr = sys.__stderr__ sys.stdout = sys.__stdout__ class SConsPrintHelpException(Exception): pass display = SCons.Util.display progress_display = SCons.Util.DisplayEngine() first_command_start = None last_command_end = None class Progressor(object): prev = '' count = 0 target_string = '$TARGET' def __init__(self, obj, interval=1, file=None, overwrite=False): if file is None: file = sys.stdout self.obj = obj self.file = file self.interval = interval self.overwrite = overwrite if callable(obj): self.func = obj elif SCons.Util.is_List(obj): self.func = self.spinner elif obj.find(self.target_string) != -1: self.func = self.replace_string else: self.func = self.string def write(self, s): self.file.write(s) self.file.flush() self.prev = s def erase_previous(self): if self.prev: length = len(self.prev) if self.prev[-1] in ('\n', '\r'): length = length - 1 self.write(' ' * length + '\r') self.prev = '' def spinner(self, node): self.write(self.obj[self.count % len(self.obj)]) def string(self, node): self.write(self.obj) def replace_string(self, node): self.write(self.obj.replace(self.target_string, str(node))) def __call__(self, node): self.count = self.count + 1 if (self.count % self.interval) == 0: if self.overwrite: self.erase_previous() self.func(node) ProgressObject = SCons.Util.Null() def Progress(*args, **kw): global ProgressObject ProgressObject = Progressor(*args, **kw) # Task control. # _BuildFailures = [] def GetBuildFailures(): return _BuildFailures class BuildTask(SCons.Taskmaster.OutOfDateTask): """An SCons build task.""" progress = ProgressObject def display(self, message): display('scons: ' + message) def prepare(self): self.progress(self.targets[0]) return SCons.Taskmaster.OutOfDateTask.prepare(self) def needs_execute(self): if SCons.Taskmaster.OutOfDateTask.needs_execute(self): return True if self.top and self.targets[0].has_builder(): display("scons: `%s' is up to date." % str(self.node)) return False def execute(self): if print_time: start_time = time.time() global first_command_start if first_command_start is None: first_command_start = start_time SCons.Taskmaster.OutOfDateTask.execute(self) if print_time: global cumulative_command_time global last_command_end finish_time = time.time() last_command_end = finish_time cumulative_command_time = cumulative_command_time+finish_time-start_time sys.stdout.write("Command execution time: %s: %f seconds\n"%(str(self.node), finish_time-start_time)) def do_failed(self, status=2): _BuildFailures.append(self.exception[1]) global exit_status global this_build_status if self.options.ignore_errors: SCons.Taskmaster.OutOfDateTask.executed(self) elif self.options.keep_going: SCons.Taskmaster.OutOfDateTask.fail_continue(self) exit_status = status this_build_status = status else: SCons.Taskmaster.OutOfDateTask.fail_stop(self) exit_status = status this_build_status = status def executed(self): t = self.targets[0] if self.top and not t.has_builder() and not t.side_effect: if not t.exists(): if t.__class__.__name__ in ('File', 'Dir', 'Entry'): errstr="Do not know how to make %s target `%s' (%s)." % (t.__class__.__name__, t, t.get_abspath()) else: # Alias or Python or ... errstr="Do not know how to make %s target `%s'." % (t.__class__.__name__, t) sys.stderr.write("scons: *** " + errstr) if not self.options.keep_going: sys.stderr.write(" Stop.") sys.stderr.write("\n") try: raise SCons.Errors.BuildError(t, errstr) except KeyboardInterrupt: raise except: self.exception_set() self.do_failed() else: print("scons: Nothing to be done for `%s'." % t) SCons.Taskmaster.OutOfDateTask.executed(self) else: SCons.Taskmaster.OutOfDateTask.executed(self) def failed(self): # Handle the failure of a build task. The primary purpose here # is to display the various types of Errors and Exceptions # appropriately. exc_info = self.exc_info() try: t, e, tb = exc_info except ValueError: t, e = exc_info tb = None if t is None: # The Taskmaster didn't record an exception for this Task; # see if the sys module has one. try: t, e, tb = sys.exc_info()[:] except ValueError: t, e = exc_info tb = None # Deprecated string exceptions will have their string stored # in the first entry of the tuple. if e is None: e = t buildError = SCons.Errors.convert_to_BuildError(e) if not buildError.node: buildError.node = self.node node = buildError.node if not SCons.Util.is_List(node): node = [ node ] nodename = ', '.join(map(str, node)) errfmt = "scons: *** [%s] %s\n" sys.stderr.write(errfmt % (nodename, buildError)) if (buildError.exc_info[2] and buildError.exc_info[1] and not isinstance( buildError.exc_info[1], (EnvironmentError, SCons.Errors.StopError, SCons.Errors.UserError))): type, value, trace = buildError.exc_info if tb and print_stacktrace: sys.stderr.write("scons: internal stack trace:\n") traceback.print_tb(tb, file=sys.stderr) traceback.print_exception(type, value, trace) elif tb and print_stacktrace: sys.stderr.write("scons: internal stack trace:\n") traceback.print_tb(tb, file=sys.stderr) self.exception = (e, buildError, tb) # type, value, traceback self.do_failed(buildError.exitstatus) self.exc_clear() def postprocess(self): if self.top: t = self.targets[0] for tp in self.options.tree_printers: tp.display(t) if self.options.debug_includes: tree = t.render_include_tree() if tree: print() print(tree) SCons.Taskmaster.OutOfDateTask.postprocess(self) def make_ready(self): """Make a task ready for execution""" SCons.Taskmaster.OutOfDateTask.make_ready(self) if self.out_of_date and self.options.debug_explain: explanation = self.out_of_date[0].explain() if explanation: sys.stdout.write("scons: " + explanation) class CleanTask(SCons.Taskmaster.AlwaysTask): """An SCons clean task.""" def fs_delete(self, path, pathstr, remove=True): try: if os.path.lexists(path): if os.path.isfile(path) or os.path.islink(path): if remove: os.unlink(path) display("Removed " + pathstr) elif os.path.isdir(path) and not os.path.islink(path): # delete everything in the dir for e in sorted(os.listdir(path)): p = os.path.join(path, e) s = os.path.join(pathstr, e) if os.path.isfile(p): if remove: os.unlink(p) display("Removed " + s) else: self.fs_delete(p, s, remove) # then delete dir itself if remove: os.rmdir(path) display("Removed directory " + pathstr) else: errstr = "Path '%s' exists but isn't a file or directory." raise SCons.Errors.UserError(errstr % (pathstr)) except SCons.Errors.UserError as e: print(e) except (IOError, OSError) as e: print("scons: Could not remove '%s':" % pathstr, e.strerror) def _get_files_to_clean(self): result = [] target = self.targets[0] if target.has_builder() or target.side_effect: result = [t for t in self.targets if not t.noclean] return result def _clean_targets(self, remove=True): target = self.targets[0] if target in SCons.Environment.CleanTargets: files = SCons.Environment.CleanTargets[target] for f in files: self.fs_delete(f.get_abspath(), str(f), remove) def show(self): for t in self._get_files_to_clean(): if not t.isdir(): display("Removed " + str(t)) self._clean_targets(remove=False) def remove(self): for t in self._get_files_to_clean(): try: removed = t.remove() except OSError as e: # An OSError may indicate something like a permissions # issue, an IOError would indicate something like # the file not existing. In either case, print a # message and keep going to try to remove as many # targets as possible. print("scons: Could not remove '{0}'".format(str(t)), e.strerror) else: if removed: display("Removed " + str(t)) self._clean_targets(remove=True) execute = remove # We want the Taskmaster to update the Node states (and therefore # handle reference counts, etc.), but we don't want to call # back to the Node's post-build methods, which would do things # we don't want, like store .sconsign information. executed = SCons.Taskmaster.Task.executed_without_callbacks # Have the Taskmaster arrange to "execute" all of the targets, because # we'll figure out ourselves (in remove() or show() above) whether # anything really needs to be done. make_ready = SCons.Taskmaster.Task.make_ready_all def prepare(self): pass class QuestionTask(SCons.Taskmaster.AlwaysTask): """An SCons task for the -q (question) option.""" def prepare(self): pass def execute(self): if self.targets[0].get_state() != SCons.Node.up_to_date or \ (self.top and not self.targets[0].exists()): global exit_status global this_build_status exit_status = 1 this_build_status = 1 self.tm.stop() def executed(self): pass class TreePrinter(object): def __init__(self, derived=False, prune=False, status=False): self.derived = derived self.prune = prune self.status = status def get_all_children(self, node): return node.all_children() def get_derived_children(self, node): children = node.all_children(None) return [x for x in children if x.has_builder()] def display(self, t): if self.derived: func = self.get_derived_children else: func = self.get_all_children s = self.status and 2 or 0 SCons.Util.print_tree(t, func, prune=self.prune, showtags=s) def python_version_string(): return sys.version.split()[0] def python_version_unsupported(version=sys.version_info): return version < unsupported_python_version def python_version_deprecated(version=sys.version_info): return version < deprecated_python_version # Global variables print_objects = 0 print_memoizer = 0 print_stacktrace = 0 print_time = 0 sconscript_time = 0 cumulative_command_time = 0 exit_status = 0 # final exit status, assume success by default this_build_status = 0 # "exit status" of an individual build num_jobs = None delayed_warnings = [] class FakeOptionParser(object): """ A do-nothing option parser, used for the initial OptionsParser variable. During normal SCons operation, the OptionsParser is created right away by the main() function. Certain tests scripts however, can introspect on different Tool modules, the initialization of which can try to add a new, local option to an otherwise uninitialized OptionsParser object. This allows that introspection to happen without blowing up. """ class FakeOptionValues(object): def __getattr__(self, attr): return None values = FakeOptionValues() def add_local_option(self, *args, **kw): pass OptionsParser = FakeOptionParser() def AddOption(*args, **kw): if 'default' not in kw: kw['default'] = None result = OptionsParser.add_local_option(*args, **kw) return result def GetOption(name): return getattr(OptionsParser.values, name) def SetOption(name, value): return OptionsParser.values.set_option(name, value) def PrintHelp(file=None): OptionsParser.print_help(file=file) class Stats(object): def __init__(self): self.stats = [] self.labels = [] self.append = self.do_nothing self.print_stats = self.do_nothing def enable(self, outfp): self.outfp = outfp self.append = self.do_append self.print_stats = self.do_print def do_nothing(self, *args, **kw): pass class CountStats(Stats): def do_append(self, label): self.labels.append(label) self.stats.append(SCons.Debug.fetchLoggedInstances()) def do_print(self): stats_table = {} for s in self.stats: for n in [t[0] for t in s]: stats_table[n] = [0, 0, 0, 0] i = 0 for s in self.stats: for n, c in s: stats_table[n][i] = c i = i + 1 self.outfp.write("Object counts:\n") pre = [" "] post = [" %s\n"] l = len(self.stats) fmt1 = ''.join(pre + [' %7s']*l + post) fmt2 = ''.join(pre + [' %7d']*l + post) labels = self.labels[:l] labels.append(("", "Class")) self.outfp.write(fmt1 % tuple([x[0] for x in labels])) self.outfp.write(fmt1 % tuple([x[1] for x in labels])) for k in sorted(stats_table.keys()): r = stats_table[k][:l] + [k] self.outfp.write(fmt2 % tuple(r)) count_stats = CountStats() class MemStats(Stats): def do_append(self, label): self.labels.append(label) self.stats.append(SCons.Debug.memory()) def do_print(self): fmt = 'Memory %-32s %12d\n' for label, stats in zip(self.labels, self.stats): self.outfp.write(fmt % (label, stats)) memory_stats = MemStats() # utility functions def _scons_syntax_error(e): """Handle syntax errors. Print out a message and show where the error occurred. """ etype, value, tb = sys.exc_info() lines = traceback.format_exception_only(etype, value) for line in lines: sys.stderr.write(line+'\n') sys.exit(2) def find_deepest_user_frame(tb): """ Find the deepest stack frame that is not part of SCons. Input is a "pre-processed" stack trace in the form returned by traceback.extract_tb() or traceback.extract_stack() """ tb.reverse() # find the deepest traceback frame that is not part # of SCons: for frame in tb: filename = frame[0] if filename.find(os.sep+'SCons'+os.sep) == -1: return frame return tb[0] def _scons_user_error(e): """Handle user errors. Print out a message and a description of the error, along with the line number and routine where it occured. The file and line number will be the deepest stack frame that is not part of SCons itself. """ global print_stacktrace etype, value, tb = sys.exc_info() if print_stacktrace: traceback.print_exception(etype, value, tb) filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb)) sys.stderr.write("\nscons: *** %s\n" % value) sys.stderr.write('File "%s", line %d, in %s\n' % (filename, lineno, routine)) sys.exit(2) def _scons_user_warning(e): """Handle user warnings. Print out a message and a description of the warning, along with the line number and routine where it occured. The file and line number will be the deepest stack frame that is not part of SCons itself. """ etype, value, tb = sys.exc_info() filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb)) sys.stderr.write("\nscons: warning: %s\n" % e) sys.stderr.write('File "%s", line %d, in %s\n' % (filename, lineno, routine)) def _scons_internal_warning(e): """Slightly different from _scons_user_warning in that we use the *current call stack* rather than sys.exc_info() to get our stack trace. This is used by the warnings framework to print warnings.""" filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_stack()) sys.stderr.write("\nscons: warning: %s\n" % e.args[0]) sys.stderr.write('File "%s", line %d, in %s\n' % (filename, lineno, routine)) def _scons_internal_error(): """Handle all errors but user errors. Print out a message telling the user what to do in this case and print a normal trace. """ print('internal error') traceback.print_exc() sys.exit(2) def _SConstruct_exists(dirname='', repositories=[], filelist=None): """This function checks that an SConstruct file exists in a directory. If so, it returns the path of the file. By default, it checks the current directory. """ if not filelist: filelist = ['SConstruct', 'Sconstruct', 'sconstruct'] for file in filelist: sfile = os.path.join(dirname, file) if os.path.isfile(sfile): return sfile if not os.path.isabs(sfile): for rep in repositories: if os.path.isfile(os.path.join(rep, sfile)): return sfile return None def _set_debug_values(options): global print_memoizer, print_objects, print_stacktrace, print_time debug_values = options.debug if "count" in debug_values: # All of the object counts are within "if track_instances:" blocks, # which get stripped when running optimized (with python -O or # from compiled *.pyo files). Provide a warning if __debug__ is # stripped, so it doesn't just look like --debug=count is broken. enable_count = False if __debug__: enable_count = True if enable_count: count_stats.enable(sys.stdout) SCons.Debug.track_instances = True else: msg = "--debug=count is not supported when running SCons\n" + \ "\twith the python -O option or optimized (.pyo) modules." SCons.Warnings.warn(SCons.Warnings.NoObjectCountWarning, msg) if "dtree" in debug_values: options.tree_printers.append(TreePrinter(derived=True)) options.debug_explain = ("explain" in debug_values) if "findlibs" in debug_values: SCons.Scanner.Prog.print_find_libs = "findlibs" options.debug_includes = ("includes" in debug_values) print_memoizer = ("memoizer" in debug_values) if "memory" in debug_values: memory_stats.enable(sys.stdout) print_objects = ("objects" in debug_values) if print_objects: SCons.Debug.track_instances = True if "presub" in debug_values: SCons.Action.print_actions_presub = 1 if "stacktrace" in debug_values: print_stacktrace = 1 if "stree" in debug_values: options.tree_printers.append(TreePrinter(status=True)) if "time" in debug_values: print_time = 1 if "tree" in debug_values: options.tree_printers.append(TreePrinter()) if "prepare" in debug_values: SCons.Taskmaster.print_prepare = 1 if "duplicate" in debug_values: SCons.Node.print_duplicate = 1 def _create_path(plist): path = '.' for d in plist: if os.path.isabs(d): path = d else: path = path + '/' + d return path def _load_site_scons_dir(topdir, site_dir_name=None): """Load the site_scons dir under topdir. Prepends site_scons to sys.path, imports site_scons/site_init.py, and prepends site_scons/site_tools to default toolpath.""" if site_dir_name: err_if_not_found = True # user specified: err if missing else: site_dir_name = "site_scons" err_if_not_found = False site_dir = os.path.join(topdir, site_dir_name) if not os.path.exists(site_dir): if err_if_not_found: raise SCons.Errors.UserError("site dir %s not found."%site_dir) return site_init_filename = "site_init.py" site_init_modname = "site_init" site_tools_dirname = "site_tools" # prepend to sys.path sys.path = [os.path.abspath(site_dir)] + sys.path site_init_file = os.path.join(site_dir, site_init_filename) site_tools_dir = os.path.join(site_dir, site_tools_dirname) if os.path.exists(site_init_file): import imp, re try: try: fp, pathname, description = imp.find_module(site_init_modname, [site_dir]) # Load the file into SCons.Script namespace. This is # opaque and clever; m is the module object for the # SCons.Script module, and the exec ... in call executes a # file (or string containing code) in the context of the # module's dictionary, so anything that code defines ends # up adding to that module. This is really short, but all # the error checking makes it longer. try: m = sys.modules['SCons.Script'] except Exception as e: fmt = 'cannot import site_init.py: missing SCons.Script module %s' raise SCons.Errors.InternalError(fmt % repr(e)) try: sfx = description[0] modname = os.path.basename(pathname)[:-len(sfx)] site_m = {"__file__": pathname, "__name__": modname, "__doc__": None} re_special = re.compile("__[^_]+__") for k in list(m.__dict__.keys()): if not re_special.match(k): site_m[k] = m.__dict__[k] # This is the magic. exec(compile(fp.read(), fp.name, 'exec'), site_m) except KeyboardInterrupt: raise except Exception as e: fmt = '*** Error loading site_init file %s:\n' sys.stderr.write(fmt % repr(site_init_file)) raise else: for k in site_m: if not re_special.match(k): m.__dict__[k] = site_m[k] except KeyboardInterrupt: raise except ImportError as e: fmt = '*** cannot import site init file %s:\n' sys.stderr.write(fmt % repr(site_init_file)) raise finally: if fp: fp.close() if os.path.exists(site_tools_dir): # prepend to DefaultToolpath SCons.Tool.DefaultToolpath.insert(0, os.path.abspath(site_tools_dir)) def _load_all_site_scons_dirs(topdir, verbose=None): """Load all of the predefined site_scons dir. Order is significant; we load them in order from most generic (machine-wide) to most specific (topdir). The verbose argument is only for testing. """ platform = SCons.Platform.platform_default() def homedir(d): return os.path.expanduser('~/'+d) if platform == 'win32' or platform == 'cygwin': # Note we use $ here instead of %...% because older # pythons (prior to 2.6?) didn't expand %...% on Windows. # This set of dirs should work on XP, Vista, 7 and later. sysdirs=[ os.path.expandvars('$ALLUSERSPROFILE\\Application Data\\scons'), os.path.expandvars('$USERPROFILE\\Local Settings\\Application Data\\scons')] appdatadir = os.path.expandvars('$APPDATA\\scons') if appdatadir not in sysdirs: sysdirs.append(appdatadir) sysdirs.append(homedir('.scons')) elif platform == 'darwin': # MacOS X sysdirs=['/Library/Application Support/SCons', '/opt/local/share/scons', # (for MacPorts) '/sw/share/scons', # (for Fink) homedir('Library/Application Support/SCons'), homedir('.scons')] elif platform == 'sunos': # Solaris sysdirs=['/opt/sfw/scons', '/usr/share/scons', homedir('.scons')] else: # Linux, HPUX, etc. # assume posix-like, i.e. platform == 'posix' sysdirs=['/usr/share/scons', homedir('.scons')] dirs=sysdirs + [topdir] for d in dirs: if verbose: # this is used by unit tests. print("Loading site dir ", d) _load_site_scons_dir(d) def test_load_all_site_scons_dirs(d): _load_all_site_scons_dirs(d, True) def version_string(label, module): version = module.__version__ build = module.__build__ if build: if build[0] != '.': build = '.' + build version = version + build fmt = "\t%s: v%s, %s, by %s on %s\n" return fmt % (label, version, module.__date__, module.__developer__, module.__buildsys__) def path_string(label, module): path = module.__path__ return "\t%s path: %s\n"%(label,path) def _main(parser): global exit_status global this_build_status options = parser.values # Here's where everything really happens. # First order of business: set up default warnings and then # handle the user's warning options, so that we can issue (or # suppress) appropriate warnings about anything that might happen, # as configured by the user. default_warnings = [ SCons.Warnings.WarningOnByDefault, SCons.Warnings.DeprecatedWarning, ] for warning in default_warnings: SCons.Warnings.enableWarningClass(warning) SCons.Warnings._warningOut = _scons_internal_warning SCons.Warnings.process_warn_strings(options.warn) # Now that we have the warnings configuration set up, we can actually # issue (or suppress) any warnings about warning-worthy things that # occurred while the command-line options were getting parsed. try: dw = options.delayed_warnings except AttributeError: pass else: delayed_warnings.extend(dw) for warning_type, message in delayed_warnings: SCons.Warnings.warn(warning_type, message) if options.diskcheck: SCons.Node.FS.set_diskcheck(options.diskcheck) # Next, we want to create the FS object that represents the outside # world's file system, as that's central to a lot of initialization. # To do this, however, we need to be in the directory from which we # want to start everything, which means first handling any relevant # options that might cause us to chdir somewhere (-C, -D, -U, -u). if options.directory: script_dir = os.path.abspath(_create_path(options.directory)) else: script_dir = os.getcwd() target_top = None if options.climb_up: target_top = '.' # directory to prepend to targets while script_dir and not _SConstruct_exists(script_dir, options.repository, options.file): script_dir, last_part = os.path.split(script_dir) if last_part: target_top = os.path.join(last_part, target_top) else: script_dir = '' if script_dir and script_dir != os.getcwd(): if not options.silent: display("scons: Entering directory `%s'" % script_dir) try: os.chdir(script_dir) except OSError: sys.stderr.write("Could not change directory to %s\n" % script_dir) # Now that we're in the top-level SConstruct directory, go ahead # and initialize the FS object that represents the file system, # and make it the build engine default. fs = SCons.Node.FS.get_default_fs() for rep in options.repository: fs.Repository(rep) # Now that we have the FS object, the next order of business is to # check for an SConstruct file (or other specified config file). # If there isn't one, we can bail before doing any more work. scripts = [] if options.file: scripts.extend(options.file) if not scripts: sfile = _SConstruct_exists(repositories=options.repository, filelist=options.file) if sfile: scripts.append(sfile) if not scripts: if options.help: # There's no SConstruct, but they specified -h. # Give them the options usage now, before we fail # trying to read a non-existent SConstruct file. raise SConsPrintHelpException raise SCons.Errors.UserError("No SConstruct file found.") if scripts[0] == "-": d = fs.getcwd() else: d = fs.File(scripts[0]).dir fs.set_SConstruct_dir(d) _set_debug_values(options) SCons.Node.implicit_cache = options.implicit_cache SCons.Node.implicit_deps_changed = options.implicit_deps_changed SCons.Node.implicit_deps_unchanged = options.implicit_deps_unchanged if options.no_exec: SCons.SConf.dryrun = 1 SCons.Action.execute_actions = None if options.question: SCons.SConf.dryrun = 1 if options.clean: SCons.SConf.SetBuildType('clean') if options.help: SCons.SConf.SetBuildType('help') SCons.SConf.SetCacheMode(options.config) SCons.SConf.SetProgressDisplay(progress_display) if options.no_progress or options.silent: progress_display.set_mode(0) if options.site_dir: _load_site_scons_dir(d.get_internal_path(), options.site_dir) elif not options.no_site_dir: _load_all_site_scons_dirs(d.get_internal_path()) if options.include_dir: sys.path = options.include_dir + sys.path # If we're about to start SCons in the interactive mode, # inform the FS about this right here. Else, the release_target_info # method could get called on some nodes, like the used "gcc" compiler, # when using the Configure methods within the SConscripts. # This would then cause subtle bugs, as already happened in #2971. if options.interactive: SCons.Node.interactive = True # That should cover (most of) the options. Next, set up the variables # that hold command-line arguments, so the SConscript files that we # read and execute have access to them. targets = [] xmit_args = [] for a in parser.largs: if a[:1] == '-': continue if '=' in a: xmit_args.append(a) else: targets.append(a) SCons.Script._Add_Targets(targets + parser.rargs) SCons.Script._Add_Arguments(xmit_args) # If stdout is not a tty, replace it with a wrapper object to call flush # after every write. # # Tty devices automatically flush after every newline, so the replacement # isn't necessary. Furthermore, if we replace sys.stdout, the readline # module will no longer work. This affects the behavior during # --interactive mode. --interactive should only be used when stdin and # stdout refer to a tty. if not hasattr(sys.stdout, 'isatty') or not sys.stdout.isatty(): sys.stdout = SCons.Util.Unbuffered(sys.stdout) if not hasattr(sys.stderr, 'isatty') or not sys.stderr.isatty(): sys.stderr = SCons.Util.Unbuffered(sys.stderr) memory_stats.append('before reading SConscript files:') count_stats.append(('pre-', 'read')) # And here's where we (finally) read the SConscript files. progress_display("scons: Reading SConscript files ...") start_time = time.time() try: for script in scripts: SCons.Script._SConscript._SConscript(fs, script) except SCons.Errors.StopError as e: # We had problems reading an SConscript file, such as it # couldn't be copied in to the VariantDir. Since we're just # reading SConscript files and haven't started building # things yet, stop regardless of whether they used -i or -k # or anything else. revert_io() sys.stderr.write("scons: *** %s Stop.\n" % e) sys.exit(2) global sconscript_time sconscript_time = time.time() - start_time progress_display("scons: done reading SConscript files.") memory_stats.append('after reading SConscript files:') count_stats.append(('post-', 'read')) # Re-{enable,disable} warnings in case they disabled some in # the SConscript file. # # We delay enabling the PythonVersionWarning class until here so that, # if they explicitly disabled it in either in the command line or in # $SCONSFLAGS, or in the SConscript file, then the search through # the list of deprecated warning classes will find that disabling # first and not issue the warning. #SCons.Warnings.enableWarningClass(SCons.Warnings.PythonVersionWarning) SCons.Warnings.process_warn_strings(options.warn) # Now that we've read the SConscript files, we can check for the # warning about deprecated Python versions--delayed until here # in case they disabled the warning in the SConscript files. if python_version_deprecated(): msg = "Support for pre-%s Python version (%s) is deprecated.\n" + \ " If this will cause hardship, contact scons-dev@scons.org" deprecated_version_string = ".".join(map(str, deprecated_python_version)) SCons.Warnings.warn(SCons.Warnings.PythonVersionWarning, msg % (deprecated_version_string, python_version_string())) if not options.help: # [ ] Clarify why we need to create Builder here at all, and # why it is created in DefaultEnvironment # https://bitbucket.org/scons/scons/commits/d27a548aeee8ad5e67ea75c2d19a7d305f784e30 if SCons.SConf.NeedConfigHBuilder(): SCons.SConf.CreateConfigHBuilder(SCons.Defaults.DefaultEnvironment()) # Now re-parse the command-line options (any to the left of a '--' # argument, that is) with any user-defined command-line options that # the SConscript files may have added to the parser object. This will # emit the appropriate error message and exit if any unknown option # was specified on the command line. parser.preserve_unknown_options = False parser.parse_args(parser.largs, options) if options.help: help_text = SCons.Script.help_text if help_text is None: # They specified -h, but there was no Help() inside the # SConscript files. Give them the options usage. raise SConsPrintHelpException else: print(help_text) print("Use scons -H for help about command-line options.") exit_status = 0 return # Change directory to the top-level SConstruct directory, then tell # the Node.FS subsystem that we're all done reading the SConscript # files and calling Repository() and VariantDir() and changing # directories and the like, so it can go ahead and start memoizing # the string values of file system nodes. fs.chdir(fs.Top) SCons.Node.FS.save_strings(1) # Now that we've read the SConscripts we can set the options # that are SConscript settable: SCons.Node.implicit_cache = options.implicit_cache SCons.Node.FS.set_duplicate(options.duplicate) fs.set_max_drift(options.max_drift) SCons.Job.explicit_stack_size = options.stack_size if options.md5_chunksize: SCons.Node.FS.File.md5_chunksize = options.md5_chunksize platform = SCons.Platform.platform_module() if options.interactive: SCons.Script.Interactive.interact(fs, OptionsParser, options, targets, target_top) else: # Build the targets nodes = _build_targets(fs, options, targets, target_top) if not nodes: revert_io() print('Found nothing to build') exit_status = 2 def _build_targets(fs, options, targets, target_top): global this_build_status this_build_status = 0 progress_display.set_mode(not (options.no_progress or options.silent)) display.set_mode(not options.silent) SCons.Action.print_actions = not options.silent SCons.Action.execute_actions = not options.no_exec SCons.Node.do_store_info = not options.no_exec SCons.SConf.dryrun = options.no_exec if options.diskcheck: SCons.Node.FS.set_diskcheck(options.diskcheck) SCons.CacheDir.cache_enabled = not options.cache_disable SCons.CacheDir.cache_readonly = options.cache_readonly SCons.CacheDir.cache_debug = options.cache_debug SCons.CacheDir.cache_force = options.cache_force SCons.CacheDir.cache_show = options.cache_show if options.no_exec: CleanTask.execute = CleanTask.show else: CleanTask.execute = CleanTask.remove lookup_top = None if targets or SCons.Script.BUILD_TARGETS != SCons.Script._build_plus_default: # They specified targets on the command line or modified # BUILD_TARGETS in the SConscript file(s), so if they used -u, # -U or -D, we have to look up targets relative to the top, # but we build whatever they specified. if target_top: lookup_top = fs.Dir(target_top) target_top = None targets = SCons.Script.BUILD_TARGETS else: # There are no targets specified on the command line, # so if they used -u, -U or -D, we may have to restrict # what actually gets built. d = None if target_top: if options.climb_up == 1: # -u, local directory and below target_top = fs.Dir(target_top) lookup_top = target_top elif options.climb_up == 2: # -D, all Default() targets target_top = None lookup_top = None elif options.climb_up == 3: # -U, local SConscript Default() targets target_top = fs.Dir(target_top) def check_dir(x, target_top=target_top): if hasattr(x, 'cwd') and not x.cwd is None: cwd = x.cwd.srcnode() return cwd == target_top else: # x doesn't have a cwd, so it's either not a target, # or not a file, so go ahead and keep it as a default # target and let the engine sort it out: return 1 d = [tgt for tgt in SCons.Script.DEFAULT_TARGETS if check_dir(tgt)] SCons.Script.DEFAULT_TARGETS[:] = d target_top = None lookup_top = None targets = SCons.Script._Get_Default_Targets(d, fs) if not targets: sys.stderr.write("scons: *** No targets specified and no Default() targets found. Stop.\n") return None def Entry(x, ltop=lookup_top, ttop=target_top, fs=fs): if isinstance(x, SCons.Node.Node): node = x else: node = None # Why would ltop be None? Unfortunately this happens. if ltop is None: ltop = '' # Curdir becomes important when SCons is called with -u, -C, # or similar option that changes directory, and so the paths # of targets given on the command line need to be adjusted. curdir = os.path.join(os.getcwd(), str(ltop)) for lookup in SCons.Node.arg2nodes_lookups: node = lookup(x, curdir=curdir) if node is not None: break if node is None: node = fs.Entry(x, directory=ltop, create=1) if ttop and not node.is_under(ttop): if isinstance(node, SCons.Node.FS.Dir) and ttop.is_under(node): node = ttop else: node = None return node nodes = [_f for _f in map(Entry, targets) if _f] task_class = BuildTask # default action is to build targets opening_message = "Building targets ..." closing_message = "done building targets." if options.keep_going: failure_message = "done building targets (errors occurred during build)." else: failure_message = "building terminated because of errors." if options.question: task_class = QuestionTask try: if options.clean: task_class = CleanTask opening_message = "Cleaning targets ..." closing_message = "done cleaning targets." if options.keep_going: failure_message = "done cleaning targets (errors occurred during clean)." else: failure_message = "cleaning terminated because of errors." except AttributeError: pass task_class.progress = ProgressObject if options.random: def order(dependencies): """Randomize the dependencies.""" import random random.shuffle(dependencies) return dependencies else: def order(dependencies): """Leave the order of dependencies alone.""" return dependencies if options.taskmastertrace_file == '-': tmtrace = sys.stdout elif options.taskmastertrace_file: tmtrace = open(options.taskmastertrace_file, 'w') else: tmtrace = None taskmaster = SCons.Taskmaster.Taskmaster(nodes, task_class, order, tmtrace) # Let the BuildTask objects get at the options to respond to the # various print_* settings, tree_printer list, etc. BuildTask.options = options python_has_threads = sysconfig.get_config_var('WITH_THREAD') # to check if python configured with threads. global num_jobs num_jobs = options.num_jobs jobs = SCons.Job.Jobs(num_jobs, taskmaster) if num_jobs > 1: msg = None if sys.platform == 'win32': msg = fetch_win32_parallel_msg() elif jobs.num_jobs == 1 or not python_has_threads: msg = "parallel builds are unsupported by this version of Python;\n" + \ "\tignoring -j or num_jobs option.\n" if msg: SCons.Warnings.warn(SCons.Warnings.NoParallelSupportWarning, msg) memory_stats.append('before building targets:') count_stats.append(('pre-', 'build')) def jobs_postfunc( jobs=jobs, options=options, closing_message=closing_message, failure_message=failure_message ): if jobs.were_interrupted(): if not options.no_progress and not options.silent: sys.stderr.write("scons: Build interrupted.\n") global exit_status global this_build_status exit_status = 2 this_build_status = 2 if this_build_status: progress_display("scons: " + failure_message) else: progress_display("scons: " + closing_message) if not options.no_exec: if jobs.were_interrupted(): progress_display("scons: writing .sconsign file.") SCons.SConsign.write() progress_display("scons: " + opening_message) jobs.run(postfunc = jobs_postfunc) memory_stats.append('after building targets:') count_stats.append(('post-', 'build')) return nodes def _exec_main(parser, values): sconsflags = os.environ.get('SCONSFLAGS', '') all_args = sconsflags.split() + sys.argv[1:] options, args = parser.parse_args(all_args, values) if isinstance(options.debug, list) and "pdb" in options.debug: import pdb pdb.Pdb().runcall(_main, parser) elif options.profile_file: # compat layer imports "cProfile" for us if it's available. from profile import Profile prof = Profile() try: prof.runcall(_main, parser) finally: prof.dump_stats(options.profile_file) else: _main(parser) def main(): global OptionsParser global exit_status global first_command_start # Check up front for a Python version we do not support. We # delay the check for deprecated Python versions until later, # after the SConscript files have been read, in case they # disable that warning. if python_version_unsupported(): msg = "scons: *** SCons version %s does not run under Python version %s.\n" sys.stderr.write(msg % (SCons.__version__, python_version_string())) sys.exit(1) parts = ["SCons by Steven Knight et al.:\n"] try: import __main__ parts.append(version_string("script", __main__)) except (ImportError, AttributeError): # On Windows there is no scons.py, so there is no # __main__.__version__, hence there is no script version. pass parts.append(version_string("engine", SCons)) parts.append(path_string("engine", SCons)) parts.append("Copyright (c) 2001 - 2017 The SCons Foundation") version = ''.join(parts) from . import SConsOptions parser = SConsOptions.Parser(version) values = SConsOptions.SConsValues(parser.get_default_values()) OptionsParser = parser try: try: _exec_main(parser, values) finally: revert_io() except SystemExit as s: if s: exit_status = s except KeyboardInterrupt: print("scons: Build interrupted.") sys.exit(2) except SyntaxError as e: _scons_syntax_error(e) except SCons.Errors.InternalError: _scons_internal_error() except SCons.Errors.UserError as e: _scons_user_error(e) except SConsPrintHelpException: parser.print_help() exit_status = 0 except SCons.Errors.BuildError as e: print(e) exit_status = e.exitstatus except: # An exception here is likely a builtin Python exception Python # code in an SConscript file. Show them precisely what the # problem was and where it happened. SCons.Script._SConscript.SConscript_exception() sys.exit(2) memory_stats.print_stats() count_stats.print_stats() if print_objects: SCons.Debug.listLoggedInstances('*') #SCons.Debug.dumpLoggedInstances('*') if print_memoizer: SCons.Memoize.Dump("Memoizer (memory cache) hits and misses:") # Dump any development debug info that may have been enabled. # These are purely for internal debugging during development, so # there's no need to control them with --debug= options; they're # controlled by changing the source code. SCons.Debug.dump_caller_counts() SCons.Taskmaster.dump_stats() if print_time: total_time = time.time() - SCons.Script.start_time if num_jobs == 1: ct = cumulative_command_time else: if last_command_end is None or first_command_start is None: ct = 0.0 else: ct = last_command_end - first_command_start scons_time = total_time - sconscript_time - ct print("Total build time: %f seconds"%total_time) print("Total SConscript file execution time: %f seconds"%sconscript_time) print("Total SCons execution time: %f seconds"%scons_time) print("Total command execution time: %f seconds"%ct) sys.exit(exit_status) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Script/SConscript.py0000664000175000017500000005733513160023041022455 0ustar bdbaddogbdbaddog"""SCons.Script.SConscript This module defines the Python API provided to SConscript and SConstruct files. """ from __future__ import print_function # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Script/SConscript.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons import SCons.Action import SCons.Builder import SCons.Defaults import SCons.Environment import SCons.Errors import SCons.Node import SCons.Node.Alias import SCons.Node.FS import SCons.Platform import SCons.SConf import SCons.Script.Main import SCons.Tool import SCons.Util import collections import os import os.path import re import sys import traceback class SConscriptReturn(Exception): pass launch_dir = os.path.abspath(os.curdir) GlobalDict = None # global exports set by Export(): global_exports = {} # chdir flag sconscript_chdir = 1 def get_calling_namespaces(): """Return the locals and globals for the function that called into this module in the current call stack.""" try: 1//0 except ZeroDivisionError: # Don't start iterating with the current stack-frame to # prevent creating reference cycles (f_back is safe). frame = sys.exc_info()[2].tb_frame.f_back # Find the first frame that *isn't* from this file. This means # that we expect all of the SCons frames that implement an Export() # or SConscript() call to be in this file, so that we can identify # the first non-Script.SConscript frame as the user's local calling # environment, and the locals and globals dictionaries from that # frame as the calling namespaces. See the comment below preceding # the DefaultEnvironmentCall block for even more explanation. while frame.f_globals.get("__name__") == __name__: frame = frame.f_back return frame.f_locals, frame.f_globals def compute_exports(exports): """Compute a dictionary of exports given one of the parameters to the Export() function or the exports argument to SConscript().""" loc, glob = get_calling_namespaces() retval = {} try: for export in exports: if SCons.Util.is_Dict(export): retval.update(export) else: try: retval[export] = loc[export] except KeyError: retval[export] = glob[export] except KeyError as x: raise SCons.Errors.UserError("Export of non-existent variable '%s'"%x) return retval class Frame(object): """A frame on the SConstruct/SConscript call stack""" def __init__(self, fs, exports, sconscript): self.globals = BuildDefaultGlobals() self.retval = None self.prev_dir = fs.getcwd() self.exports = compute_exports(exports) # exports from the calling SConscript # make sure the sconscript attr is a Node. if isinstance(sconscript, SCons.Node.Node): self.sconscript = sconscript elif sconscript == '-': self.sconscript = None else: self.sconscript = fs.File(str(sconscript)) # the SConstruct/SConscript call stack: call_stack = [] # For documentation on the methods in this file, see the scons man-page def Return(*vars, **kw): retval = [] try: fvars = SCons.Util.flatten(vars) for var in fvars: for v in var.split(): retval.append(call_stack[-1].globals[v]) except KeyError as x: raise SCons.Errors.UserError("Return of non-existent variable '%s'"%x) if len(retval) == 1: call_stack[-1].retval = retval[0] else: call_stack[-1].retval = tuple(retval) stop = kw.get('stop', True) if stop: raise SConscriptReturn stack_bottom = '% Stack boTTom %' # hard to define a variable w/this name :) def _SConscript(fs, *files, **kw): top = fs.Top sd = fs.SConstruct_dir.rdir() exports = kw.get('exports', []) # evaluate each SConscript file results = [] for fn in files: call_stack.append(Frame(fs, exports, fn)) old_sys_path = sys.path try: SCons.Script.sconscript_reading = SCons.Script.sconscript_reading + 1 if fn == "-": exec(sys.stdin.read(), call_stack[-1].globals) else: if isinstance(fn, SCons.Node.Node): f = fn else: f = fs.File(str(fn)) _file_ = None # Change directory to the top of the source # tree to make sure the os's cwd and the cwd of # fs match so we can open the SConscript. fs.chdir(top, change_os_dir=1) if f.rexists(): actual = f.rfile() _file_ = open(actual.get_abspath(), "rb") elif f.srcnode().rexists(): actual = f.srcnode().rfile() _file_ = open(actual.get_abspath(), "rb") elif f.has_src_builder(): # The SConscript file apparently exists in a source # code management system. Build it, but then clear # the builder so that it doesn't get built *again* # during the actual build phase. f.build() f.built() f.builder_set(None) if f.exists(): _file_ = open(f.get_abspath(), "rb") if _file_: # Chdir to the SConscript directory. Use a path # name relative to the SConstruct file so that if # we're using the -f option, we're essentially # creating a parallel SConscript directory structure # in our local directory tree. # # XXX This is broken for multiple-repository cases # where the SConstruct and SConscript files might be # in different Repositories. For now, cross that # bridge when someone comes to it. try: src_dir = kw['src_dir'] except KeyError: ldir = fs.Dir(f.dir.get_path(sd)) else: ldir = fs.Dir(src_dir) if not ldir.is_under(f.dir): # They specified a source directory, but # it's above the SConscript directory. # Do the sensible thing and just use the # SConcript directory. ldir = fs.Dir(f.dir.get_path(sd)) try: fs.chdir(ldir, change_os_dir=sconscript_chdir) except OSError: # There was no local directory, so we should be # able to chdir to the Repository directory. # Note that we do this directly, not through # fs.chdir(), because we still need to # interpret the stuff within the SConscript file # relative to where we are logically. fs.chdir(ldir, change_os_dir=0) os.chdir(actual.dir.get_abspath()) # Append the SConscript directory to the beginning # of sys.path so Python modules in the SConscript # directory can be easily imported. sys.path = [ f.dir.get_abspath() ] + sys.path # This is the magic line that actually reads up # and executes the stuff in the SConscript file. # The locals for this frame contain the special # bottom-of-the-stack marker so that any # exceptions that occur when processing this # SConscript can base the printed frames at this # level and not show SCons internals as well. call_stack[-1].globals.update({stack_bottom:1}) old_file = call_stack[-1].globals.get('__file__') try: del call_stack[-1].globals['__file__'] except KeyError: pass try: try: # _file_ = SCons.Util.to_str(_file_) exec(compile(_file_.read(), _file_.name, 'exec'), call_stack[-1].globals) except SConscriptReturn: pass finally: if old_file is not None: call_stack[-1].globals.update({__file__:old_file}) else: SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, "Ignoring missing SConscript '%s'" % f.get_internal_path()) finally: SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1 sys.path = old_sys_path frame = call_stack.pop() try: fs.chdir(frame.prev_dir, change_os_dir=sconscript_chdir) except OSError: # There was no local directory, so chdir to the # Repository directory. Like above, we do this # directly. fs.chdir(frame.prev_dir, change_os_dir=0) rdir = frame.prev_dir.rdir() rdir._create() # Make sure there's a directory there. try: os.chdir(rdir.get_abspath()) except OSError as e: # We still couldn't chdir there, so raise the error, # but only if actions are being executed. # # If the -n option was used, the directory would *not* # have been created and we should just carry on and # let things muddle through. This isn't guaranteed # to work if the SConscript files are reading things # from disk (for example), but it should work well # enough for most configurations. if SCons.Action.execute_actions: raise e results.append(frame.retval) # if we only have one script, don't return a tuple if len(results) == 1: return results[0] else: return tuple(results) def SConscript_exception(file=sys.stderr): """Print an exception stack trace just for the SConscript file(s). This will show users who have Python errors where the problem is, without cluttering the output with all of the internal calls leading up to where we exec the SConscript.""" exc_type, exc_value, exc_tb = sys.exc_info() tb = exc_tb while tb and stack_bottom not in tb.tb_frame.f_locals: tb = tb.tb_next if not tb: # We did not find our exec statement, so this was actually a bug # in SCons itself. Show the whole stack. tb = exc_tb stack = traceback.extract_tb(tb) try: type = exc_type.__name__ except AttributeError: type = str(exc_type) if type[:11] == "exceptions.": type = type[11:] file.write('%s: %s:\n' % (type, exc_value)) for fname, line, func, text in stack: file.write(' File "%s", line %d:\n' % (fname, line)) file.write(' %s\n' % text) def annotate(node): """Annotate a node with the stack frame describing the SConscript file and line number that created it.""" tb = sys.exc_info()[2] while tb and stack_bottom not in tb.tb_frame.f_locals: tb = tb.tb_next if not tb: # We did not find any exec of an SConscript file: what?! raise SCons.Errors.InternalError("could not find SConscript stack frame") node.creator = traceback.extract_stack(tb)[0] # The following line would cause each Node to be annotated using the # above function. Unfortunately, this is a *huge* performance hit, so # leave this disabled until we find a more efficient mechanism. #SCons.Node.Annotate = annotate class SConsEnvironment(SCons.Environment.Base): """An Environment subclass that contains all of the methods that are particular to the wrapper SCons interface and which aren't (or shouldn't be) part of the build engine itself. Note that not all of the methods of this class have corresponding global functions, there are some private methods. """ # # Private methods of an SConsEnvironment. # def _exceeds_version(self, major, minor, v_major, v_minor): """Return 1 if 'major' and 'minor' are greater than the version in 'v_major' and 'v_minor', and 0 otherwise.""" return (major > v_major or (major == v_major and minor > v_minor)) def _get_major_minor_revision(self, version_string): """Split a version string into major, minor and (optionally) revision parts. This is complicated by the fact that a version string can be something like 3.2b1.""" version = version_string.split(' ')[0].split('.') v_major = int(version[0]) v_minor = int(re.match('\d+', version[1]).group()) if len(version) >= 3: v_revision = int(re.match('\d+', version[2]).group()) else: v_revision = 0 return v_major, v_minor, v_revision def _get_SConscript_filenames(self, ls, kw): """ Convert the parameters passed to SConscript() calls into a list of files and export variables. If the parameters are invalid, throws SCons.Errors.UserError. Returns a tuple (l, e) where l is a list of SConscript filenames and e is a list of exports. """ exports = [] if len(ls) == 0: try: dirs = kw["dirs"] except KeyError: raise SCons.Errors.UserError("Invalid SConscript usage - no parameters") if not SCons.Util.is_List(dirs): dirs = [ dirs ] dirs = list(map(str, dirs)) name = kw.get('name', 'SConscript') files = [os.path.join(n, name) for n in dirs] elif len(ls) == 1: files = ls[0] elif len(ls) == 2: files = ls[0] exports = self.Split(ls[1]) else: raise SCons.Errors.UserError("Invalid SConscript() usage - too many arguments") if not SCons.Util.is_List(files): files = [ files ] if kw.get('exports'): exports.extend(self.Split(kw['exports'])) variant_dir = kw.get('variant_dir') or kw.get('build_dir') if variant_dir: if len(files) != 1: raise SCons.Errors.UserError("Invalid SConscript() usage - can only specify one SConscript with a variant_dir") duplicate = kw.get('duplicate', 1) src_dir = kw.get('src_dir') if not src_dir: src_dir, fname = os.path.split(str(files[0])) files = [os.path.join(str(variant_dir), fname)] else: if not isinstance(src_dir, SCons.Node.Node): src_dir = self.fs.Dir(src_dir) fn = files[0] if not isinstance(fn, SCons.Node.Node): fn = self.fs.File(fn) if fn.is_under(src_dir): # Get path relative to the source directory. fname = fn.get_path(src_dir) files = [os.path.join(str(variant_dir), fname)] else: files = [fn.get_abspath()] kw['src_dir'] = variant_dir self.fs.VariantDir(variant_dir, src_dir, duplicate) return (files, exports) # # Public methods of an SConsEnvironment. These get # entry points in the global namespace so they can be called # as global functions. # def Configure(self, *args, **kw): if not SCons.Script.sconscript_reading: raise SCons.Errors.UserError("Calling Configure from Builders is not supported.") kw['_depth'] = kw.get('_depth', 0) + 1 return SCons.Environment.Base.Configure(self, *args, **kw) def Default(self, *targets): SCons.Script._Set_Default_Targets(self, targets) def EnsureSConsVersion(self, major, minor, revision=0): """Exit abnormally if the SCons version is not late enough.""" # split string to avoid replacement during build process if SCons.__version__ == '__' + 'VERSION__': SCons.Warnings.warn(SCons.Warnings.DevelopmentVersionWarning, "EnsureSConsVersion is ignored for development version") return scons_ver = self._get_major_minor_revision(SCons.__version__) if scons_ver < (major, minor, revision): if revision: scons_ver_string = '%d.%d.%d' % (major, minor, revision) else: scons_ver_string = '%d.%d' % (major, minor) print("SCons %s or greater required, but you have SCons %s" % \ (scons_ver_string, SCons.__version__)) sys.exit(2) def EnsurePythonVersion(self, major, minor): """Exit abnormally if the Python version is not late enough.""" if sys.version_info < (major, minor): v = sys.version.split()[0] print("Python %d.%d or greater required, but you have Python %s" %(major,minor,v)) sys.exit(2) def Exit(self, value=0): sys.exit(value) def Export(self, *vars, **kw): for var in vars: global_exports.update(compute_exports(self.Split(var))) global_exports.update(kw) def GetLaunchDir(self): global launch_dir return launch_dir def GetOption(self, name): name = self.subst(name) return SCons.Script.Main.GetOption(name) def Help(self, text, append=False): text = self.subst(text, raw=1) SCons.Script.HelpFunction(text, append=append) def Import(self, *vars): try: frame = call_stack[-1] globals = frame.globals exports = frame.exports for var in vars: var = self.Split(var) for v in var: if v == '*': globals.update(global_exports) globals.update(exports) else: if v in exports: globals[v] = exports[v] else: globals[v] = global_exports[v] except KeyError as x: raise SCons.Errors.UserError("Import of non-existent variable '%s'"%x) def SConscript(self, *ls, **kw): if 'build_dir' in kw: msg = """The build_dir keyword has been deprecated; use the variant_dir keyword instead.""" SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg) def subst_element(x, subst=self.subst): if SCons.Util.is_List(x): x = list(map(subst, x)) else: x = subst(x) return x ls = list(map(subst_element, ls)) subst_kw = {} for key, val in kw.items(): if SCons.Util.is_String(val): val = self.subst(val) elif SCons.Util.is_List(val): result = [] for v in val: if SCons.Util.is_String(v): v = self.subst(v) result.append(v) val = result subst_kw[key] = val files, exports = self._get_SConscript_filenames(ls, subst_kw) subst_kw['exports'] = exports return _SConscript(self.fs, *files, **subst_kw) def SConscriptChdir(self, flag): global sconscript_chdir sconscript_chdir = flag def SetOption(self, name, value): name = self.subst(name) SCons.Script.Main.SetOption(name, value) # # # SCons.Environment.Environment = SConsEnvironment def Configure(*args, **kw): if not SCons.Script.sconscript_reading: raise SCons.Errors.UserError("Calling Configure from Builders is not supported.") kw['_depth'] = 1 return SCons.SConf.SConf(*args, **kw) # It's very important that the DefaultEnvironmentCall() class stay in this # file, with the get_calling_namespaces() function, the compute_exports() # function, the Frame class and the SConsEnvironment.Export() method. # These things make up the calling stack leading up to the actual global # Export() or SConscript() call that the user issued. We want to allow # users to export local variables that they define, like so: # # def func(): # x = 1 # Export('x') # # To support this, the get_calling_namespaces() function assumes that # the *first* stack frame that's not from this file is the local frame # for the Export() or SConscript() call. _DefaultEnvironmentProxy = None def get_DefaultEnvironmentProxy(): global _DefaultEnvironmentProxy if not _DefaultEnvironmentProxy: default_env = SCons.Defaults.DefaultEnvironment() _DefaultEnvironmentProxy = SCons.Environment.NoSubstitutionProxy(default_env) return _DefaultEnvironmentProxy class DefaultEnvironmentCall(object): """A class that implements "global function" calls of Environment methods by fetching the specified method from the DefaultEnvironment's class. Note that this uses an intermediate proxy class instead of calling the DefaultEnvironment method directly so that the proxy can override the subst() method and thereby prevent expansion of construction variables (since from the user's point of view this was called as a global function, with no associated construction environment).""" def __init__(self, method_name, subst=0): self.method_name = method_name if subst: self.factory = SCons.Defaults.DefaultEnvironment else: self.factory = get_DefaultEnvironmentProxy def __call__(self, *args, **kw): env = self.factory() method = getattr(env, self.method_name) return method(*args, **kw) def BuildDefaultGlobals(): """ Create a dictionary containing all the default globals for SConstruct and SConscript files. """ global GlobalDict if GlobalDict is None: GlobalDict = {} import SCons.Script d = SCons.Script.__dict__ def not_a_module(m, d=d, mtype=type(SCons.Script)): return not isinstance(d[m], mtype) for m in filter(not_a_module, dir(SCons.Script)): GlobalDict[m] = d[m] return GlobalDict.copy() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Script/SConscriptTests.py0000664000175000017500000000263013160023041023464 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Script/SConscriptTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Script.SConscript # all of the SConscript.py tests are in test/SConscript.py # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Script/Main.xml0000664000175000017500000004201713160023041021411 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> (arguments) This function adds a new command-line option to be recognized. The specified arguments are the same as supported by the standard Python optparse.add_option() method (with a few additional capabilities noted below); see the documentation for optparse for a thorough discussion of its option-processing capabities. In addition to the arguments and values supported by the optparse.add_option() method, the SCons &f-AddOption; function allows you to set the nargs keyword value to '?' (a string with just the question mark) to indicate that the specified long option(s) take(s) an optional argument. When nargs = '?' is passed to the &f-AddOption; function, the const keyword argument may be used to supply the "default" value that should be used when the option is specified on the command line without an explicit argument. If no default= keyword argument is supplied when calling &f-AddOption;, the option will have a default value of None. Once a new command-line option has been added with &f-AddOption;, the option value may be accessed using &f-GetOption; or env.GetOption(). The value may also be set, using &f-SetOption; or env.SetOption(), if conditions in a &SConscript; require overriding any default value. Note, however, that a value specified on the command line will always override a value set by any SConscript file. Any specified help= strings for the new option(s) will be displayed by the or options (the latter only if no other help text is specified in the SConscript files). The help text for the local options specified by &f-AddOption; will appear below the SCons options themselves, under a separate Local Options heading. The options will appear in the help text in the order in which the &f-AddOption; calls occur. Example: AddOption('--prefix', dest='prefix', nargs=1, type='string', action='store', metavar='DIR', help='installation prefix') env = Environment(PREFIX = GetOption('prefix')) () Returns a list of exceptions for the actions that failed while attempting to build targets. Each element in the returned list is a BuildError object with the following attributes that record various aspects of the build failure: .node The node that was being built when the build failure occurred. .status The numeric exit status returned by the command or Python function that failed when trying to build the specified Node. .errstr The SCons error string describing the build failure. (This is often a generic message like "Error 2" to indicate that an executed command exited with a status of 2.) .filename The name of the file or directory that actually caused the failure. This may be different from the .node attribute. For example, if an attempt to build a target named sub/dir/target fails because the sub/dir directory could not be created, then the .node attribute will be sub/dir/target but the .filename attribute will be sub/dir. .executor The SCons Executor object for the target Node being built. This can be used to retrieve the construction environment used for the failed action. .action The actual SCons Action object that failed. This will be one specific action out of the possible list of actions that would have been executed to build the target. .command The actual expanded command that was executed and failed, after expansion of &cv-link-TARGET;, &cv-link-SOURCE;, and other construction variables. Note that the &f-GetBuildFailures; function will always return an empty list until any build failure has occurred, which means that &f-GetBuildFailures; will always return an empty list while the &SConscript; files are being read. Its primary intended use is for functions that will be executed before SCons exits by passing them to the standard Python atexit.register() function. Example: import atexit def print_build_failures(): from SCons.Script import GetBuildFailures for bf in GetBuildFailures(): print("%s failed: %s" % (bf.node, bf.errstr)) atexit.register(print_build_failures) (name) This function provides a way to query the value of SCons options set on scons command line (or set using the &f-link-SetOption; function). The options supported are: cache_debug which corresponds to --cache-debug; cache_disable which corresponds to --cache-disable; cache_force which corresponds to --cache-force; cache_show which corresponds to --cache-show; clean which corresponds to -c, --clean and --remove; config which corresponds to --config; directory which corresponds to -C and --directory; diskcheck which corresponds to --diskcheck duplicate which corresponds to --duplicate; file which corresponds to -f, --file, --makefile and --sconstruct; help which corresponds to -h and --help; ignore_errors which corresponds to --ignore-errors; implicit_cache which corresponds to --implicit-cache; implicit_deps_changed which corresponds to --implicit-deps-changed; implicit_deps_unchanged which corresponds to --implicit-deps-unchanged; interactive which corresponds to --interact and --interactive; keep_going which corresponds to -k and --keep-going; max_drift which corresponds to --max-drift; no_exec which corresponds to -n, --no-exec, --just-print, --dry-run and --recon; no_site_dir which corresponds to --no-site-dir; num_jobs which corresponds to -j and --jobs; profile_file which corresponds to --profile; question which corresponds to -q and --question; random which corresponds to --random; repository which corresponds to -Y, --repository and --srcdir; silent which corresponds to -s, --silent and --quiet; site_dir which corresponds to --site-dir; stack_size which corresponds to --stack-size; taskmastertrace_file which corresponds to --taskmastertrace; and warn which corresponds to --warn and --warning. See the documentation for the corresponding command line object for information about each specific option. (callable, [interval]) (string, [interval, file, overwrite]) (list_of_strings, [interval, file, overwrite]) Allows SCons to show progress made during the build by displaying a string or calling a function while evaluating Nodes (e.g. files). If the first specified argument is a Python callable (a function or an object that has a __call__() method), the function will be called once every interval times a Node is evaluated. The callable will be passed the evaluated Node as its only argument. (For future compatibility, it's a good idea to also add *args and **kw as arguments to your function or method. This will prevent the code from breaking if SCons ever changes the interface to call the function with additional arguments in the future.) An example of a simple custom progress function that prints a string containing the Node name every 10 Nodes: def my_progress_function(node, *args, **kw): print('Evaluating node %s!' % node) Progress(my_progress_function, interval=10) A more complicated example of a custom progress display object that prints a string containing a count every 100 evaluated Nodes. Note the use of \r (a carriage return) at the end so that the string will overwrite itself on a display: import sys class ProgressCounter(object): count = 0 def __call__(self, node, *args, **kw): self.count += 100 sys.stderr.write('Evaluated %s nodes\r' % self.count) Progress(ProgressCounter(), interval=100) If the first argument &f-link-Progress; is a string, the string will be displayed every interval evaluated Nodes. The default is to print the string on standard output; an alternate output stream may be specified with the file= argument. The following will print a series of dots on the error output, one dot for every 100 evaluated Nodes: import sys Progress('.', interval=100, file=sys.stderr) If the string contains the verbatim substring &cv-TARGET;, it will be replaced with the Node. Note that, for performance reasons, this is not a regular SCons variable substition, so you can not use other variables or use curly braces. The following example will print the name of every evaluated Node, using a \r (carriage return) to cause each line to overwritten by the next line, and the overwrite= keyword argument to make sure the previously-printed file name is overwritten with blank spaces: import sys Progress('$TARGET\r', overwrite=True) If the first argument to &f-Progress; is a list of strings, then each string in the list will be displayed in rotating fashion every interval evaluated Nodes. This can be used to implement a "spinner" on the user's screen as follows: Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5) (target, ...) Marks each given target as precious so it is not deleted before it is rebuilt. Normally &scons; deletes a target before building it. Multiple targets can be passed in to a single call to &f-Precious;. (target, ...) This indicates that each given target should not be created by the build rule, and if the target is created, an error will be generated. This is similar to the gnu make .PHONY target. However, in the vast majority of cases, an &f-Alias; is more appropriate. Multiple targets can be passed in to a single call to &f-Pseudo;. (name, value) This function provides a way to set a select subset of the scons command line options from a SConscript file. The options supported are: clean which corresponds to -c, --clean and --remove; duplicate which corresponds to --duplicate; help which corresponds to -h and --help; implicit_cache which corresponds to --implicit-cache; max_drift which corresponds to --max-drift; no_exec which corresponds to -n, --no-exec, --just-print, --dry-run and --recon; num_jobs which corresponds to -j and --jobs; random which corresponds to --random; and silent which corresponds to --silent. stack_size which corresponds to --stack-size. See the documentation for the corresponding command line object for information about each specific option. Example: SetOption('max_drift', 1) scons-src-3.0.0/src/engine/SCons/Script/SConscript.xml0000664000175000017500000003325413160023041022617 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> (targets) This specifies a list of default targets, which will be built by &scons; if no explicit targets are given on the command line. Multiple calls to &f-Default; are legal, and add to the list of default targets. Multiple targets should be specified as separate arguments to the &f-Default; method, or as a list. &f-Default; will also accept the Node returned by any of a construction environment's builder methods. Examples: Default('foo', 'bar', 'baz') env.Default(['a', 'b', 'c']) hello = env.Program('hello', 'hello.c') env.Default(hello) An argument to &f-Default; of None will clear all default targets. Later calls to &f-Default; will add to the (now empty) default-target list like normal. The current list of targets added using the &f-Default; function or method is available in the DEFAULT_TARGETS list; see below. (major, minor) Ensure that the Python version is at least major.minor. This function will print out an error message and exit SCons with a non-zero exit code if the actual Python version is not late enough. Example: EnsurePythonVersion(2,2) (major, minor, [revision]) Ensure that the SCons version is at least major.minor, or major.minor.revision. if revision is specified. This function will print out an error message and exit SCons with a non-zero exit code if the actual SCons version is not late enough. Examples: EnsureSConsVersion(0,14) EnsureSConsVersion(0,96,90) ([value]) This tells &scons; to exit immediately with the specified value. A default exit value of 0 (zero) is used if no value is specified. (vars) This tells &scons; to export a list of variables from the current SConscript file to all other SConscript files. The exported variables are kept in a global collection, so subsequent calls to &f-Export; will over-write previous exports that have the same name. Multiple variable names can be passed to &f-Export; as separate arguments or as a list. Keyword arguments can be used to provide names and their values. A dictionary can be used to map variables to a different name when exported. Both local variables and global variables can be exported. Examples: env = Environment() # Make env available for all SConscript files to Import(). Export("env") package = 'my_name' # Make env and package available for all SConscript files:. Export("env", "package") # Make env and package available for all SConscript files: Export(["env", "package"]) # Make env available using the name debug: Export(debug = env) # Make env available using the name debug: Export({"debug":env}) Note that the &f-SConscript; function supports an exports argument that makes it easier to to export a variable or set of variables to a single SConscript file. See the description of the &f-SConscript; function, below. () Returns the absolute path name of the directory from which &scons; was initially invoked. This can be useful when using the , or options, which internally change to the directory in which the &SConstruct; file is found. (text, append=False) This specifies help text to be printed if the argument is given to &scons;. If &f-Help; is called multiple times, the text is appended together in the order that &f-Help; is called. With append set to False, any &f-Help; text generated with &f-AddOption; is clobbered. If append is True, the AddOption help is prepended to the help string, thus preserving the message. (vars) This tells &scons; to import a list of variables into the current SConscript file. This will import variables that were exported with &f-Export; or in the exports argument to &f-link-SConscript;. Variables exported by &f-SConscript; have precedence. Multiple variable names can be passed to &f-Import; as separate arguments or as a list. The variable "*" can be used to import all variables. Examples: Import("env") Import("env", "variable") Import(["env", "variable"]) Import("*") ([vars..., stop=]) By default, this stops processing the current SConscript file and returns to the calling SConscript file the values of the variables named in the vars string arguments. Multiple strings contaning variable names may be passed to &f-Return;. Any strings that contain white space The optional stop= keyword argument may be set to a false value to continue processing the rest of the SConscript file after the &f-Return; call. This was the default behavior prior to SCons 0.98. However, the values returned are still the values of the variables in the named vars at the point &f-Return; is called. Examples: # Returns without returning a value. Return() # Returns the value of the 'foo' Python variable. Return("foo") # Returns the values of the Python variables 'foo' and 'bar'. Return("foo", "bar") # Returns the values of Python variables 'val1' and 'val2'. Return('val1 val2') (scripts, [exports, variant_dir, duplicate]) (dirs=subdirs, [name=script, exports, variant_dir, duplicate]) This tells &scons; to execute one or more subsidiary SConscript (configuration) files. Any variables returned by a called script using &f-link-Return; will be returned by the call to &f-SConscript;. There are two ways to call the &f-SConscript; function. The first way you can call &f-SConscript; is to explicitly specify one or more scripts as the first argument. A single script may be specified as a string; multiple scripts must be specified as a list (either explicitly or as created by a function like &f-Split;). Examples: SConscript('SConscript') # run SConscript in the current directory SConscript('src/SConscript') # run SConscript in the src directory SConscript(['src/SConscript', 'doc/SConscript']) config = SConscript('MyConfig.py') The second way you can call &f-SConscript; is to specify a list of (sub)directory names as a dirs=subdirs keyword argument. In this case, &scons; will, by default, execute a subsidiary configuration file named &SConscript; in each of the specified directories. You may specify a name other than &SConscript; by supplying an optional name=script keyword argument. The first three examples below have the same effect as the first three examples above: SConscript(dirs='.') # run SConscript in the current directory SConscript(dirs='src') # run SConscript in the src directory SConscript(dirs=['src', 'doc']) SConscript(dirs=['sub1', 'sub2'], name='MySConscript') The optional exports argument provides a list of variable names or a dictionary of named values to export to the script(s). These variables are locally exported only to the specified script(s), and do not affect the global pool of variables used by the &f-Export; function. The subsidiary script(s) must use the &f-link-Import; function to import the variables. Examples: foo = SConscript('sub/SConscript', exports='env') SConscript('dir/SConscript', exports=['env', 'variable']) SConscript(dirs='subdir', exports='env variable') SConscript(dirs=['one', 'two', 'three'], exports='shared_info') If the optional variant_dir argument is present, it causes an effect equivalent to the &f-link-VariantDir; method described below. (If variant_dir is not present, the duplicate argument is ignored.) The variant_dir argument is interpreted relative to the directory of the calling &SConscript; file. See the description of the &f-VariantDir; function below for additional details and restrictions. If variant_dir is present, the source directory is the directory in which the &SConscript; file resides and the &SConscript; file is evaluated as if it were in the variant_dir directory: SConscript('src/SConscript', variant_dir = 'build') is equivalent to VariantDir('build', 'src') SConscript('build/SConscript') This later paradigm is often used when the sources are in the same directory as the &SConstruct;: SConscript('SConscript', variant_dir = 'build') is equivalent to VariantDir('build', '.') SConscript('build/SConscript') Here are some composite examples: # collect the configuration information and use it to build src and doc shared_info = SConscript('MyConfig.py') SConscript('src/SConscript', exports='shared_info') SConscript('doc/SConscript', exports='shared_info') # build debugging and production versions. SConscript # can use Dir('.').path to determine variant. SConscript('SConscript', variant_dir='debug', duplicate=0) SConscript('SConscript', variant_dir='prod', duplicate=0) # build debugging and production versions. SConscript # is passed flags to use. opts = { 'CPPDEFINES' : ['DEBUG'], 'CCFLAGS' : '-pgdb' } SConscript('SConscript', variant_dir='debug', duplicate=0, exports=opts) opts = { 'CPPDEFINES' : ['NODEBUG'], 'CCFLAGS' : '-O' } SConscript('SConscript', variant_dir='prod', duplicate=0, exports=opts) # build common documentation and compile for different architectures SConscript('doc/SConscript', variant_dir='build/doc', duplicate=0) SConscript('src/SConscript', variant_dir='build/x86', duplicate=0) SConscript('src/SConscript', variant_dir='build/ppc', duplicate=0) scons-src-3.0.0/src/engine/SCons/Script/Interactive.py0000664000175000017500000003270713160023041022637 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function __revision__ = "src/engine/SCons/Script/Interactive.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """ SCons interactive mode """ # TODO: # # This has the potential to grow into something with a really big life # of its own, which might or might not be a good thing. Nevertheless, # here are some enhancements that will probably be requested some day # and are worth keeping in mind (assuming this takes off): # # - A command to re-read / re-load the SConscript files. This may # involve allowing people to specify command-line options (e.g. -f, # -I, --no-site-dir) that affect how the SConscript files are read. # # - Additional command-line options on the "build" command. # # Of the supported options that seemed to make sense (after a quick # pass through the list), the ones that seemed likely enough to be # used are listed in the man page and have explicit test scripts. # # These had code changed in Script/Main.py to support them, but didn't # seem likely to be used regularly, so had no test scripts added: # # build --diskcheck=* # build --implicit-cache=* # build --implicit-deps-changed=* # build --implicit-deps-unchanged=* # # These look like they should "just work" with no changes to the # existing code, but like those above, look unlikely to be used and # therefore had no test scripts added: # # build --random # # These I'm not sure about. They might be useful for individual # "build" commands, and may even work, but they seem unlikely enough # that we'll wait until they're requested before spending any time on # writing test scripts for them, or investigating whether they work. # # build -q [??? is there a useful analog to the exit status?] # build --duplicate= # build --profile= # build --max-drift= # build --warn=* # build --Y # # - Most of the SCons command-line options that the "build" command # supports should be settable as default options that apply to all # subsequent "build" commands. Maybe a "set {option}" command that # maps to "SetOption('{option}')". # # - Need something in the 'help' command that prints the -h output. # # - A command to run the configure subsystem separately (must see how # this interacts with the new automake model). # # - Command-line completion of target names; maybe even of SCons options? # Completion is something that's supported by the Python cmd module, # so this should be doable without too much trouble. # import cmd import copy import os import re import shlex import sys try: import readline except ImportError: pass class SConsInteractiveCmd(cmd.Cmd): """\ build [TARGETS] Build the specified TARGETS and their dependencies. 'b' is a synonym. clean [TARGETS] Clean (remove) the specified TARGETS and their dependencies. 'c' is a synonym. exit Exit SCons interactive mode. help [COMMAND] Prints help for the specified COMMAND. 'h' and '?' are synonyms. shell [COMMANDLINE] Execute COMMANDLINE in a subshell. 'sh' and '!' are synonyms. version Prints SCons version information. """ synonyms = { 'b' : 'build', 'c' : 'clean', 'h' : 'help', 'scons' : 'build', 'sh' : 'shell', } def __init__(self, **kw): cmd.Cmd.__init__(self) for key, val in kw.items(): setattr(self, key, val) if sys.platform == 'win32': self.shell_variable = 'COMSPEC' else: self.shell_variable = 'SHELL' def default(self, argv): print("*** Unknown command: %s" % argv[0]) def onecmd(self, line): line = line.strip() if not line: print(self.lastcmd) return self.emptyline() self.lastcmd = line if line[0] == '!': line = 'shell ' + line[1:] elif line[0] == '?': line = 'help ' + line[1:] if os.sep == '\\': line = line.replace('\\', '\\\\') argv = shlex.split(line) argv[0] = self.synonyms.get(argv[0], argv[0]) if not argv[0]: return self.default(line) else: try: func = getattr(self, 'do_' + argv[0]) except AttributeError: return self.default(argv) return func(argv) def do_build(self, argv): """\ build [TARGETS] Build the specified TARGETS and their dependencies. 'b' is a synonym. """ import SCons.Node import SCons.SConsign import SCons.Script.Main options = copy.deepcopy(self.options) options, targets = self.parser.parse_args(argv[1:], values=options) SCons.Script.COMMAND_LINE_TARGETS = targets if targets: SCons.Script.BUILD_TARGETS = targets else: # If the user didn't specify any targets on the command line, # use the list of default targets. SCons.Script.BUILD_TARGETS = SCons.Script._build_plus_default nodes = SCons.Script.Main._build_targets(self.fs, options, targets, self.target_top) if not nodes: return # Call each of the Node's alter_targets() methods, which may # provide additional targets that ended up as part of the build # (the canonical example being a VariantDir() when we're building # from a source directory) and which we therefore need their # state cleared, too. x = [] for n in nodes: x.extend(n.alter_targets()[0]) nodes.extend(x) # Clean up so that we can perform the next build correctly. # # We do this by walking over all the children of the targets, # and clearing their state. # # We currently have to re-scan each node to find their # children, because built nodes have already been partially # cleared and don't remember their children. (In scons # 0.96.1 and earlier, this wasn't the case, and we didn't # have to re-scan the nodes.) # # Because we have to re-scan each node, we can't clear the # nodes as we walk over them, because we may end up rescanning # a cleared node as we scan a later node. Therefore, only # store the list of nodes that need to be cleared as we walk # the tree, and clear them in a separate pass. # # XXX: Someone more familiar with the inner workings of scons # may be able to point out a more efficient way to do this. SCons.Script.Main.progress_display("scons: Clearing cached node information ...") seen_nodes = {} def get_unseen_children(node, parent, seen_nodes=seen_nodes): def is_unseen(node, seen_nodes=seen_nodes): return node not in seen_nodes return [child for child in node.children(scan=1) if is_unseen(child)] def add_to_seen_nodes(node, parent, seen_nodes=seen_nodes): seen_nodes[node] = 1 # If this file is in a VariantDir and has a # corresponding source file in the source tree, remember the # node in the source tree, too. This is needed in # particular to clear cached implicit dependencies on the # source file, since the scanner will scan it if the # VariantDir was created with duplicate=0. try: rfile_method = node.rfile except AttributeError: return else: rfile = rfile_method() if rfile != node: seen_nodes[rfile] = 1 for node in nodes: walker = SCons.Node.Walker(node, kids_func=get_unseen_children, eval_func=add_to_seen_nodes) n = walker.get_next() while n: n = walker.get_next() for node in list(seen_nodes.keys()): # Call node.clear() to clear most of the state node.clear() # node.clear() doesn't reset node.state, so call # node.set_state() to reset it manually node.set_state(SCons.Node.no_state) node.implicit = None # Debug: Uncomment to verify that all Taskmaster reference # counts have been reset to zero. #if node.ref_count != 0: # from SCons.Debug import Trace # Trace('node %s, ref_count %s !!!\n' % (node, node.ref_count)) SCons.SConsign.Reset() SCons.Script.Main.progress_display("scons: done clearing node information.") def do_clean(self, argv): """\ clean [TARGETS] Clean (remove) the specified TARGETS and their dependencies. 'c' is a synonym. """ return self.do_build(['build', '--clean'] + argv[1:]) def do_EOF(self, argv): print() self.do_exit(argv) def _do_one_help(self, arg): try: # If help_() exists, then call it. func = getattr(self, 'help_' + arg) except AttributeError: try: func = getattr(self, 'do_' + arg) except AttributeError: doc = None else: doc = self._doc_to_help(func) if doc: sys.stdout.write(doc + '\n') sys.stdout.flush() else: doc = self.strip_initial_spaces(func()) if doc: sys.stdout.write(doc + '\n') sys.stdout.flush() def _doc_to_help(self, obj): doc = obj.__doc__ if doc is None: return '' return self._strip_initial_spaces(doc) def _strip_initial_spaces(self, s): lines = s.split('\n') spaces = re.match(' *', lines[0]).group(0) def strip_spaces(l, spaces=spaces): if l[:len(spaces)] == spaces: l = l[len(spaces):] return l lines = list(map(strip_spaces, lines)) return '\n'.join(lines) def do_exit(self, argv): """\ exit Exit SCons interactive mode. """ sys.exit(0) def do_help(self, argv): """\ help [COMMAND] Prints help for the specified COMMAND. 'h' and '?' are synonyms. """ if argv[1:]: for arg in argv[1:]: if self._do_one_help(arg): break else: # If bare 'help' is called, print this class's doc # string (if it has one). doc = self._doc_to_help(self.__class__) if doc: sys.stdout.write(doc + '\n') sys.stdout.flush() def do_shell(self, argv): """\ shell [COMMANDLINE] Execute COMMANDLINE in a subshell. 'sh' and '!' are synonyms. """ import subprocess argv = argv[1:] if not argv: argv = os.environ[self.shell_variable] try: # Per "[Python-Dev] subprocess insufficiently platform-independent?" # http://mail.python.org/pipermail/python-dev/2008-August/081979.html "+ # Doing the right thing with an argument list currently # requires different shell= values on Windows and Linux. p = subprocess.Popen(argv, shell=(sys.platform=='win32')) except EnvironmentError as e: sys.stderr.write('scons: %s: %s\n' % (argv[0], e.strerror)) else: p.wait() def do_version(self, argv): """\ version Prints SCons version information. """ sys.stdout.write(self.parser.version + '\n') def interact(fs, parser, options, targets, target_top): c = SConsInteractiveCmd(prompt = 'scons>>> ', fs = fs, parser = parser, options = options, targets = targets, target_top = target_top) c.cmdloop() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/WarningsTests.py0000664000175000017500000001112313160023045021722 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/WarningsTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestUnit import SCons.Warnings class TestOutput(object): def __call__(self, x): args = x.args[0] if len(args) == 1: args = args[0] self.out = str(args) class WarningsTestCase(unittest.TestCase): def test_Warning(self): """Test warn function.""" # Reset global state SCons.Warnings._enabled = [] SCons.Warnings._warningAsException = 0 to = TestOutput() SCons.Warnings._warningOut=to SCons.Warnings.enableWarningClass(SCons.Warnings.Warning) SCons.Warnings.warn(SCons.Warnings.DeprecatedWarning, "Foo") assert to.out == "Foo", to.out SCons.Warnings.warn(SCons.Warnings.DependencyWarning, "Foo", 1) assert to.out == "('Foo', 1)", to.out def test_WarningAsExc(self): """Test warnings as exceptions.""" # Reset global state SCons.Warnings._enabled = [] SCons.Warnings._warningAsException = 0 SCons.Warnings.enableWarningClass(SCons.Warnings.Warning) old = SCons.Warnings.warningAsException() assert old == 0, old exc_caught = 0 try: SCons.Warnings.warn(SCons.Warnings.Warning, "Foo") except: exc_caught = 1 assert exc_caught == 1 old = SCons.Warnings.warningAsException(old) assert old == 1, old exc_caught = 0 try: SCons.Warnings.warn(SCons.Warnings.Warning, "Foo") except: exc_caught = 1 assert exc_caught == 0 def test_Disable(self): """Test disabling/enabling warnings.""" # Reset global state SCons.Warnings._enabled = [] SCons.Warnings._warningAsException = 0 to = TestOutput() SCons.Warnings._warningOut=to to.out = None # No warnings by default SCons.Warnings.warn(SCons.Warnings.DeprecatedWarning, "Foo") assert to.out is None, to.out SCons.Warnings.enableWarningClass(SCons.Warnings.Warning) SCons.Warnings.warn(SCons.Warnings.DeprecatedWarning, "Foo") assert to.out == "Foo", to.out to.out = None SCons.Warnings.suppressWarningClass(SCons.Warnings.DeprecatedWarning) SCons.Warnings.warn(SCons.Warnings.DeprecatedWarning, "Foo") assert to.out is None, to.out SCons.Warnings.warn(SCons.Warnings.MandatoryDeprecatedWarning, "Foo") assert to.out is None, to.out # Dependency warnings should still be enabled though SCons.Warnings.enableWarningClass(SCons.Warnings.Warning) SCons.Warnings.warn(SCons.Warnings.DependencyWarning, "Foo") assert to.out == "Foo", to.out # Try reenabling all warnings... SCons.Warnings.enableWarningClass(SCons.Warnings.Warning) SCons.Warnings.enableWarningClass(SCons.Warnings.Warning) SCons.Warnings.warn(SCons.Warnings.DeprecatedWarning, "Foo") assert to.out == "Foo", to.out if __name__ == "__main__": suite = unittest.makeSuite(WarningsTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Action.xml0000664000175000017500000000751713160023040020503 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Controls whether or not SCons will add implicit dependencies for the commands executed to build targets. By default, SCons will add to each target an implicit dependency on the command represented by the first argument on any command line it executes. The specific file for the dependency is found by searching the PATH variable in the ENV environment used to execute the command. If the construction variable &cv-IMPLICIT_COMMAND_DEPENDENCIES; is set to a false value (None, False, 0, etc.), then the implicit dependency will not be added to the targets built with that construction environment. env = Environment(IMPLICIT_COMMAND_DEPENDENCIES = 0) A Python function used to print the command lines as they are executed (assuming command printing is not disabled by the or options or their equivalents). The function should take four arguments: s, the command being executed (a string), target, the target being built (file node, list, or string name(s)), source, the source(s) used (file node, list, or string name(s)), and env, the environment being used. The function must do the printing itself. The default implementation, used if this variable is not set or is None, is: def print_cmd_line(s, target, source, env): sys.stdout.write(s + "\n") Here's an example of a more interesting function: def print_cmd_line(s, target, source, env): sys.stdout.write("Building %s -> %s...\n" % (' and '.join([str(x) for x in source]), ' and '.join([str(x) for x in target]))) env=Environment(PRINT_CMD_LINE_FUNC=print_cmd_line) env.Program('foo', 'foo.c') This just prints "Building targetname from sourcename..." instead of the actual commands. Such a function could also log the actual commands to a log file, for example. A command interpreter function that will be called to execute command line strings. The function must expect the following arguments: def spawn(shell, escape, cmd, args, env): sh is a string naming the shell program to use. escape is a function that can be called to escape shell special characters in the command line. cmd is the path to the command to be executed. args is the arguments to the command. env is a dictionary of the environment variables in which the command should be executed. scons-src-3.0.0/src/engine/SCons/Warnings.py0000664000175000017500000001550113160023045020703 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # """SCons.Warnings This file implements the warnings framework for SCons. """ __revision__ = "src/engine/SCons/Warnings.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import SCons.Errors class Warning(SCons.Errors.UserError): pass class WarningOnByDefault(Warning): pass # NOTE: If you add a new warning class, add it to the man page, too! class TargetNotBuiltWarning(Warning): # Should go to OnByDefault pass class CacheVersionWarning(WarningOnByDefault): pass class CacheWriteErrorWarning(Warning): pass class CorruptSConsignWarning(WarningOnByDefault): pass class DependencyWarning(Warning): pass class DevelopmentVersionWarning(WarningOnByDefault): pass class DuplicateEnvironmentWarning(WarningOnByDefault): pass class FutureReservedVariableWarning(WarningOnByDefault): pass class LinkWarning(WarningOnByDefault): pass class MisleadingKeywordsWarning(WarningOnByDefault): pass class MissingSConscriptWarning(WarningOnByDefault): pass class NoMD5ModuleWarning(WarningOnByDefault): pass class NoMetaclassSupportWarning(WarningOnByDefault): pass class NoObjectCountWarning(WarningOnByDefault): pass class NoParallelSupportWarning(WarningOnByDefault): pass class ReservedVariableWarning(WarningOnByDefault): pass class StackSizeWarning(WarningOnByDefault): pass class VisualCMissingWarning(WarningOnByDefault): pass # Used when MSVC_VERSION and MSVS_VERSION do not point to the # same version (MSVS_VERSION is deprecated) class VisualVersionMismatch(WarningOnByDefault): pass class VisualStudioMissingWarning(Warning): pass class FortranCxxMixWarning(LinkWarning): pass # Deprecation warnings class FutureDeprecatedWarning(Warning): pass class DeprecatedWarning(Warning): pass class MandatoryDeprecatedWarning(DeprecatedWarning): pass # Special case; base always stays DeprecatedWarning class PythonVersionWarning(DeprecatedWarning): pass class DeprecatedSourceCodeWarning(FutureDeprecatedWarning): pass class DeprecatedBuildDirWarning(DeprecatedWarning): pass class TaskmasterNeedsExecuteWarning(DeprecatedWarning): pass class DeprecatedCopyWarning(MandatoryDeprecatedWarning): pass class DeprecatedOptionsWarning(MandatoryDeprecatedWarning): pass class DeprecatedSourceSignaturesWarning(MandatoryDeprecatedWarning): pass class DeprecatedTargetSignaturesWarning(MandatoryDeprecatedWarning): pass class DeprecatedDebugOptionsWarning(MandatoryDeprecatedWarning): pass class DeprecatedSigModuleWarning(MandatoryDeprecatedWarning): pass class DeprecatedBuilderKeywordsWarning(MandatoryDeprecatedWarning): pass # The below is a list of 2-tuples. The first element is a class object. # The second element is true if that class is enabled, false if it is disabled. _enabled = [] # If set, raise the warning as an exception _warningAsException = 0 # If not None, a function to call with the warning _warningOut = None def suppressWarningClass(clazz): """Suppresses all warnings that are of type clazz or derived from clazz.""" _enabled.insert(0, (clazz, 0)) def enableWarningClass(clazz): """Enables all warnings that are of type clazz or derived from clazz.""" _enabled.insert(0, (clazz, 1)) def warningAsException(flag=1): """Turn warnings into exceptions. Returns the old value of the flag.""" global _warningAsException old = _warningAsException _warningAsException = flag return old def warn(clazz, *args): global _enabled, _warningAsException, _warningOut warning = clazz(args) for clazz, flag in _enabled: if isinstance(warning, clazz): if flag: if _warningAsException: raise warning if _warningOut: _warningOut(warning) break def process_warn_strings(arguments): """Process string specifications of enabling/disabling warnings, as passed to the --warn option or the SetOption('warn') function. An argument to this option should be of the form or no-. The warning class is munged in order to get an actual class name from the classes above, which we need to pass to the {enable,disable}WarningClass() functions. The supplied is split on hyphens, each element is capitalized, then smushed back together. Then the string "Warning" is appended to get the class name. For example, 'deprecated' will enable the DeprecatedWarning class. 'no-dependency' will disable the DependencyWarning class. As a special case, --warn=all and --warn=no-all will enable or disable (respectively) the base Warning class of all warnings. """ def _capitalize(s): if s[:5] == "scons": return "SCons" + s[5:] else: return s.capitalize() for arg in arguments: elems = arg.lower().split('-') enable = 1 if elems[0] == 'no': enable = 0 del elems[0] if len(elems) == 1 and elems[0] == 'all': class_name = "Warning" else: class_name = ''.join(map(_capitalize, elems)) + "Warning" try: clazz = globals()[class_name] except KeyError: sys.stderr.write("No warning type: '%s'\n" % arg) else: if enable: enableWarningClass(clazz) elif issubclass(clazz, MandatoryDeprecatedWarning): fmt = "Can not disable mandataory warning: '%s'\n" sys.stderr.write(fmt % arg) else: suppressWarningClass(clazz) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/DefaultsTests.py0000664000175000017500000000571513160023040021706 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/DefaultsTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import os import sys import unittest from collections import UserDict import TestCmd import TestUnit import SCons.Errors from SCons.Defaults import * class DefaultsTestCase(unittest.TestCase): def test_mkdir_func0(self): test = TestCmd.TestCmd(workdir = '') test.subdir('sub') subdir2 = test.workpath('sub', 'dir1', 'dir2') # Simple smoke test mkdir_func(subdir2) mkdir_func(subdir2) # 2nd time should be OK too def test_mkdir_func1(self): test = TestCmd.TestCmd(workdir = '') test.subdir('sub') subdir1 = test.workpath('sub', 'dir1') subdir2 = test.workpath('sub', 'dir1', 'dir2') # No error if asked to create existing dir os.makedirs(subdir2) mkdir_func(subdir2) mkdir_func(subdir1) def test_mkdir_func2(self): test = TestCmd.TestCmd(workdir = '') test.subdir('sub') subdir1 = test.workpath('sub', 'dir1') subdir2 = test.workpath('sub', 'dir1', 'dir2') file = test.workpath('sub', 'dir1', 'dir2', 'file') # make sure it does error if asked to create a dir # where there's already a file os.makedirs(subdir2) test.write(file, "test\n") try: mkdir_func(file) except os.error as e: pass else: fail("expected os.error") if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ DefaultsTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/exitfuncs.py0000664000175000017500000000413113160023045021120 0ustar bdbaddogbdbaddog"""SCons.exitfuncs Register functions which are executed when SCons exits for any reason. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/exitfuncs.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import atexit _exithandlers = [] def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in reverse order so functions are executed last in, first out. """ while _exithandlers: func, targs, kargs = _exithandlers.pop() func(*targs, **kargs) def register(func, *targs, **kargs): """register a function to be executed upon normal program termination func - function to be called at exit targs - optional arguments to pass to func kargs - optional keyword arguments to pass to func """ _exithandlers.append((func, targs, kargs)) # make our exit function get run by python when it exits atexit.register(_run_exitfuncs) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Node/0000775000175000017500000000000013160023041017420 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Node/FSTests.py0000664000175000017500000037501213160023041021335 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import division, print_function __revision__ = "src/engine/SCons/Node/FSTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import os import os.path import sys import time import unittest import shutil import stat from TestCmd import TestCmd import TestUnit import SCons.Errors import SCons.Node.FS import SCons.Util import SCons.Warnings built_it = None scanner_count = 0 class Scanner(object): def __init__(self, node=None): global scanner_count scanner_count = scanner_count + 1 self.hash = scanner_count self.node = node def path(self, env, dir, target=None, source=None): return () def __call__(self, node, env, path): return [self.node] def __hash__(self): return self.hash def select(self, node): return self def recurse_nodes(self, nodes): return nodes class Environment(object): def __init__(self): self.scanner = Scanner() def Dictionary(self, *args): return {} def autogenerate(self, **kw): return {} def get_scanner(self, skey): return self.scanner def Override(self, overrides): return self def _update(self, dict): pass class Action(object): def __call__(self, targets, sources, env, **kw): global built_it if kw.get('execute', 1): built_it = 1 return 0 def show(self, string): pass def get_contents(self, target, source, env): return bytearray("",'utf-8') def genstring(self, target, source, env): return "" def strfunction(self, targets, sources, env): return "" def get_implicit_deps(self, target, source, env): return [] class Builder(object): def __init__(self, factory, action=Action()): self.factory = factory self.env = Environment() self.overrides = {} self.action = action self.target_scanner = None self.source_scanner = None def targets(self, t): return [t] def source_factory(self, name): return self.factory(name) class _tempdirTestCase(unittest.TestCase): def setUp(self): self.save_cwd = os.getcwd() self.test = TestCmd(workdir='') # FS doesn't like the cwd to be something other than its root. os.chdir(self.test.workpath("")) self.fs = SCons.Node.FS.FS() def tearDown(self): os.chdir(self.save_cwd) class VariantDirTestCase(unittest.TestCase): def runTest(self): """Test variant dir functionality""" test=TestCmd(workdir='') fs = SCons.Node.FS.FS() f1 = fs.File('build/test1') fs.VariantDir('build', 'src') f2 = fs.File('build/test2') d1 = fs.Dir('build') assert f1.srcnode().get_internal_path() == os.path.normpath('src/test1'), f1.srcnode().get_internal_path() assert f2.srcnode().get_internal_path() == os.path.normpath('src/test2'), f2.srcnode().get_internal_path() assert d1.srcnode().get_internal_path() == 'src', d1.srcnode().get_internal_path() fs = SCons.Node.FS.FS() f1 = fs.File('build/test1') fs.VariantDir('build', '.') f2 = fs.File('build/test2') d1 = fs.Dir('build') assert f1.srcnode().get_internal_path() == 'test1', f1.srcnode().get_internal_path() assert f2.srcnode().get_internal_path() == 'test2', f2.srcnode().get_internal_path() assert d1.srcnode().get_internal_path() == '.', d1.srcnode().get_internal_path() fs = SCons.Node.FS.FS() fs.VariantDir('build/var1', 'src') fs.VariantDir('build/var2', 'src') f1 = fs.File('build/var1/test1') f2 = fs.File('build/var2/test1') assert f1.srcnode().get_internal_path() == os.path.normpath('src/test1'), f1.srcnode().get_internal_path() assert f2.srcnode().get_internal_path() == os.path.normpath('src/test1'), f2.srcnode().get_internal_path() fs = SCons.Node.FS.FS() fs.VariantDir('../var1', 'src') fs.VariantDir('../var2', 'src') f1 = fs.File('../var1/test1') f2 = fs.File('../var2/test1') assert f1.srcnode().get_internal_path() == os.path.normpath('src/test1'), f1.srcnode().get_internal_path() assert f2.srcnode().get_internal_path() == os.path.normpath('src/test1'), f2.srcnode().get_internal_path() # Set up some files test.subdir('work', ['work', 'src']) test.subdir(['work', 'build'], ['work', 'build', 'var1']) test.subdir(['work', 'build', 'var2']) test.subdir('rep1', ['rep1', 'src']) test.subdir(['rep1', 'build'], ['rep1', 'build', 'var1']) test.subdir(['rep1', 'build', 'var2']) # A source file in the source directory test.write([ 'work', 'src', 'test.in' ], 'test.in') # A source file in a subdir of the source directory test.subdir([ 'work', 'src', 'new_dir' ]) test.write([ 'work', 'src', 'new_dir', 'test9.out' ], 'test9.out\n') # A source file in the repository test.write([ 'rep1', 'src', 'test2.in' ], 'test2.in') # Some source files in the variant directory test.write([ 'work', 'build', 'var2', 'test.in' ], 'test.old') test.write([ 'work', 'build', 'var2', 'test2.in' ], 'test2.old') # An old derived file in the variant directories test.write([ 'work', 'build', 'var1', 'test.out' ], 'test.old') test.write([ 'work', 'build', 'var2', 'test.out' ], 'test.old') # And just in case we are weird, a derived file in the source # dir. test.write([ 'work', 'src', 'test.out' ], 'test.out.src') # A derived file in the repository test.write([ 'rep1', 'build', 'var1', 'test2.out' ], 'test2.out_rep') test.write([ 'rep1', 'build', 'var2', 'test2.out' ], 'test2.out_rep') os.chdir(test.workpath('work')) fs = SCons.Node.FS.FS(test.workpath('work')) fs.VariantDir('build/var1', 'src', duplicate=0) fs.VariantDir('build/var2', 'src') f1 = fs.File('build/var1/test.in') f1out = fs.File('build/var1/test.out') f1out.builder = 1 f1out_2 = fs.File('build/var1/test2.out') f1out_2.builder = 1 f2 = fs.File('build/var2/test.in') f2out = fs.File('build/var2/test.out') f2out.builder = 1 f2out_2 = fs.File('build/var2/test2.out') f2out_2.builder = 1 fs.Repository(test.workpath('rep1')) assert f1.srcnode().get_internal_path() == os.path.normpath('src/test.in'),\ f1.srcnode().get_internal_path() # str(node) returns source path for duplicate = 0 assert str(f1) == os.path.normpath('src/test.in'), str(f1) # Build path does not exist assert not f1.exists() # ...but the actual file is not there... assert not os.path.exists(f1.get_abspath()) # And duplicate=0 should also work just like a Repository assert f1.rexists() # rfile() should point to the source path assert f1.rfile().get_internal_path() == os.path.normpath('src/test.in'),\ f1.rfile().get_internal_path() assert f2.srcnode().get_internal_path() == os.path.normpath('src/test.in'),\ f2.srcnode().get_internal_path() # str(node) returns build path for duplicate = 1 assert str(f2) == os.path.normpath('build/var2/test.in'), str(f2) # Build path exists assert f2.exists() # ...and exists() should copy the file from src to build path assert test.read(['work', 'build', 'var2', 'test.in']) == bytearray('test.in','utf-8'),\ test.read(['work', 'build', 'var2', 'test.in']) # Since exists() is true, so should rexists() be assert f2.rexists() f3 = fs.File('build/var1/test2.in') f4 = fs.File('build/var2/test2.in') assert f3.srcnode().get_internal_path() == os.path.normpath('src/test2.in'),\ f3.srcnode().get_internal_path() # str(node) returns source path for duplicate = 0 assert str(f3) == os.path.normpath('src/test2.in'), str(f3) # Build path does not exist assert not f3.exists() # Source path does not either assert not f3.srcnode().exists() # But we do have a file in the Repository assert f3.rexists() # rfile() should point to the source path assert f3.rfile().get_internal_path() == os.path.normpath(test.workpath('rep1/src/test2.in')),\ f3.rfile().get_internal_path() assert f4.srcnode().get_internal_path() == os.path.normpath('src/test2.in'),\ f4.srcnode().get_internal_path() # str(node) returns build path for duplicate = 1 assert str(f4) == os.path.normpath('build/var2/test2.in'), str(f4) # Build path should exist assert f4.exists() # ...and copy over the file into the local build path assert test.read(['work', 'build', 'var2', 'test2.in']) == bytearray('test2.in','utf-8') # should exist in repository, since exists() is true assert f4.rexists() # rfile() should point to ourselves assert f4.rfile().get_internal_path() == os.path.normpath('build/var2/test2.in'),\ f4.rfile().get_internal_path() f5 = fs.File('build/var1/test.out') f6 = fs.File('build/var2/test.out') assert f5.exists() # We should not copy the file from the source dir, since this is # a derived file. assert test.read(['work', 'build', 'var1', 'test.out']) == bytearray('test.old','utf-8') assert f6.exists() # We should not copy the file from the source dir, since this is # a derived file. assert test.read(['work', 'build', 'var2', 'test.out']) == bytearray('test.old','utf-8') f7 = fs.File('build/var1/test2.out') f8 = fs.File('build/var2/test2.out') assert not f7.exists() assert f7.rexists() r = f7.rfile().get_internal_path() expect = os.path.normpath(test.workpath('rep1/build/var1/test2.out')) assert r == expect, (repr(r), repr(expect)) assert not f8.exists() assert f8.rexists() assert f8.rfile().get_internal_path() == os.path.normpath(test.workpath('rep1/build/var2/test2.out')),\ f8.rfile().get_internal_path() # Verify the Mkdir and Link actions are called d9 = fs.Dir('build/var2/new_dir') f9 = fs.File('build/var2/new_dir/test9.out') class MkdirAction(Action): def __init__(self, dir_made): self.dir_made = dir_made def __call__(self, target, source, env, executor=None): if executor: target = executor.get_all_targets() source = executor.get_all_sources() self.dir_made.extend(target) save_Link = SCons.Node.FS.Link link_made = [] def link_func(target, source, env, link_made=link_made): link_made.append(target) SCons.Node.FS.Link = link_func try: dir_made = [] d9.builder = Builder(fs.Dir, action=MkdirAction(dir_made)) d9.reset_executor() f9.exists() expect = os.path.join('build', 'var2', 'new_dir') assert dir_made[0].get_internal_path() == expect, dir_made[0].get_internal_path() expect = os.path.join('build', 'var2', 'new_dir', 'test9.out') assert link_made[0].get_internal_path() == expect, link_made[0].get_internal_path() assert f9.linked finally: SCons.Node.FS.Link = save_Link # Test for an interesting pathological case...we have a source # file in a build path, but not in a source path. This can # happen if you switch from duplicate=1 to duplicate=0, then # delete a source file. At one time, this would cause exists() # to return a 1 but get_contents() to throw. test.write([ 'work', 'build', 'var1', 'asourcefile' ], 'stuff') f10 = fs.File('build/var1/asourcefile') assert f10.exists() assert f10.get_contents() == bytearray('stuff','utf-8'), f10.get_contents() f11 = fs.File('src/file11') t, m = f11.alter_targets() bdt = [n.get_internal_path() for n in t] var1_file11 = os.path.normpath('build/var1/file11') var2_file11 = os.path.normpath('build/var2/file11') assert bdt == [var1_file11, var2_file11], bdt f12 = fs.File('src/file12') f12.builder = 1 bdt, m = f12.alter_targets() assert bdt == [], [n.get_internal_path() for n in bdt] d13 = fs.Dir('src/new_dir') t, m = d13.alter_targets() bdt = [n.get_internal_path() for n in t] var1_new_dir = os.path.normpath('build/var1/new_dir') var2_new_dir = os.path.normpath('build/var2/new_dir') assert bdt == [var1_new_dir, var2_new_dir], bdt # Test that an IOError trying to Link a src file # into a VariantDir ends up throwing a StopError. fIO = fs.File("build/var2/IOError") save_Link = SCons.Node.FS.Link def Link_IOError(target, source, env): raise IOError(17, "Link_IOError") SCons.Node.FS.Link = SCons.Action.Action(Link_IOError, None) test.write(['work', 'src', 'IOError'], "work/src/IOError\n") try: exc_caught = 0 try: fIO.exists() except SCons.Errors.StopError: exc_caught = 1 assert exc_caught, "Should have caught a StopError" finally: SCons.Node.FS.Link = save_Link # Test to see if Link() works... test.subdir('src','build') test.write('src/foo', 'src/foo\n') os.chmod(test.workpath('src/foo'), stat.S_IRUSR) SCons.Node.FS.Link(fs.File(test.workpath('build/foo')), fs.File(test.workpath('src/foo')), None) os.chmod(test.workpath('src/foo'), stat.S_IRUSR | stat.S_IWRITE) st=os.stat(test.workpath('build/foo')) assert (stat.S_IMODE(st[stat.ST_MODE]) & stat.S_IWRITE), \ stat.S_IMODE(st[stat.ST_MODE]) # This used to generate a UserError when we forbid the source # directory from being outside the top-level SConstruct dir. fs = SCons.Node.FS.FS() fs.VariantDir('build', '/test/foo') exc_caught = 0 try: try: fs = SCons.Node.FS.FS() fs.VariantDir('build', 'build/src') except SCons.Errors.UserError: exc_caught = 1 assert exc_caught, "Should have caught a UserError." finally: test.unlink( "src/foo" ) test.unlink( "build/foo" ) fs = SCons.Node.FS.FS() fs.VariantDir('build', 'src1') # Calling the same VariantDir twice should work fine. fs.VariantDir('build', 'src1') # Trying to move a variant dir to a second source dir # should blow up try: fs.VariantDir('build', 'src2') except SCons.Errors.UserError: pass else: assert 0, "Should have caught a UserError." # Test against a former bug. Make sure we can get a repository # path for the variant directory itself! fs=SCons.Node.FS.FS(test.workpath('work')) test.subdir('work') fs.VariantDir('build/var3', 'src', duplicate=0) d1 = fs.Dir('build/var3') r = d1.rdir() assert r == d1, "%s != %s" % (r, d1) # verify the link creation attempts in file_link() class LinkSimulator (object): """A class to intercept os.[sym]link() calls and track them.""" def __init__( self, duplicate, link, symlink, copy ) : self.duplicate = duplicate self.have = {} self.have['hard'] = link self.have['soft'] = symlink self.have['copy'] = copy self.links_to_be_called = [] for link in self.duplicate.split('-'): if self.have[link]: self.links_to_be_called.append(link) def link_fail( self , src , dest ) : next_link = self.links_to_be_called.pop(0) assert next_link == "hard", \ "Wrong link order: expected %s to be called "\ "instead of hard" % next_link raise OSError( "Simulating hard link creation error." ) def symlink_fail( self , src , dest ) : next_link = self.links_to_be_called.pop(0) assert next_link == "soft", \ "Wrong link order: expected %s to be called "\ "instead of soft" % next_link raise OSError( "Simulating symlink creation error." ) def copy( self , src , dest ) : next_link = self.links_to_be_called.pop(0) assert next_link == "copy", \ "Wrong link order: expected %s to be called "\ "instead of copy" % next_link # copy succeeds, but use the real copy self.have['copy'](src, dest) # end class LinkSimulator try: SCons.Node.FS.set_duplicate("no-link-order") assert 0, "Expected exception when passing an invalid duplicate to set_duplicate" except SCons.Errors.InternalError: pass for duplicate in SCons.Node.FS.Valid_Duplicates: # save the real functions for later restoration try: real_link = os.link except AttributeError: real_link = None try: real_symlink = os.symlink except AttributeError: real_symlink = None # Disable symlink and link for now in win32. # We don't have a consistant plan to make these work as yet # They are only supported with PY3 if sys.platform == 'win32': real_symlink = None real_link = None real_copy = shutil.copy2 simulator = LinkSimulator(duplicate, real_link, real_symlink, real_copy) # override the real functions with our simulation os.link = simulator.link_fail os.symlink = simulator.symlink_fail shutil.copy2 = simulator.copy try: SCons.Node.FS.set_duplicate(duplicate) src_foo = test.workpath('src', 'foo') build_foo = test.workpath('build', 'foo') test.write(src_foo, 'src/foo\n') os.chmod(src_foo, stat.S_IRUSR) try: SCons.Node.FS.Link(fs.File(build_foo), fs.File(src_foo), None) finally: os.chmod(src_foo, stat.S_IRUSR | stat.S_IWRITE) test.unlink(src_foo) test.unlink(build_foo) finally: # restore the real functions if real_link: os.link = real_link else: delattr(os, 'link') if real_symlink: os.symlink = real_symlink else: delattr(os, 'symlink') shutil.copy2 = real_copy # Test VariantDir "reflection," where a same-named subdirectory # exists underneath a variant_dir. fs = SCons.Node.FS.FS() fs.VariantDir('work/src/b1/b2', 'work/src') dir_list = [ 'work/src', 'work/src/b1', 'work/src/b1/b2', 'work/src/b1/b2/b1', 'work/src/b1/b2/b1/b2', 'work/src/b1/b2/b1/b2/b1', 'work/src/b1/b2/b1/b2/b1/b2', ] srcnode_map = { 'work/src/b1/b2' : 'work/src', 'work/src/b1/b2/f' : 'work/src/f', 'work/src/b1/b2/b1' : 'work/src/b1/', 'work/src/b1/b2/b1/f' : 'work/src/b1/f', 'work/src/b1/b2/b1/b2' : 'work/src/b1/b2', 'work/src/b1/b2/b1/b2/f' : 'work/src/b1/b2/f', 'work/src/b1/b2/b1/b2/b1' : 'work/src/b1/b2/b1', 'work/src/b1/b2/b1/b2/b1/f' : 'work/src/b1/b2/b1/f', 'work/src/b1/b2/b1/b2/b1/b2' : 'work/src/b1/b2/b1/b2', 'work/src/b1/b2/b1/b2/b1/b2/f' : 'work/src/b1/b2/b1/b2/f', } alter_map = { 'work/src' : 'work/src/b1/b2', 'work/src/f' : 'work/src/b1/b2/f', 'work/src/b1' : 'work/src/b1/b2/b1', 'work/src/b1/f' : 'work/src/b1/b2/b1/f', } errors = 0 for dir in dir_list: dnode = fs.Dir(dir) f = dir + '/f' fnode = fs.File(dir + '/f') dp = dnode.srcnode().get_internal_path() expect = os.path.normpath(srcnode_map.get(dir, dir)) if dp != expect: print("Dir `%s' srcnode() `%s' != expected `%s'" % (dir, dp, expect)) errors = errors + 1 fp = fnode.srcnode().get_internal_path() expect = os.path.normpath(srcnode_map.get(f, f)) if fp != expect: print("File `%s' srcnode() `%s' != expected `%s'" % (f, fp, expect)) errors = errors + 1 for dir in dir_list: dnode = fs.Dir(dir) f = dir + '/f' fnode = fs.File(dir + '/f') t, m = dnode.alter_targets() tp = t[0].get_internal_path() expect = os.path.normpath(alter_map.get(dir, dir)) if tp != expect: print("Dir `%s' alter_targets() `%s' != expected `%s'" % (dir, tp, expect)) errors = errors + 1 t, m = fnode.alter_targets() tp = t[0].get_internal_path() expect = os.path.normpath(alter_map.get(f, f)) if tp != expect: print("File `%s' alter_targets() `%s' != expected `%s'" % (f, tp, expect)) errors = errors + 1 self.failIf(errors) class BaseTestCase(_tempdirTestCase): def test_stat(self): """Test the Base.stat() method""" test = self.test test.write("e1", "e1\n") fs = SCons.Node.FS.FS() e1 = fs.Entry('e1') s = e1.stat() assert s is not None, s e2 = fs.Entry('e2') s = e2.stat() assert s is None, s def test_getmtime(self): """Test the Base.getmtime() method""" test = self.test test.write("file", "file\n") fs = SCons.Node.FS.FS() file = fs.Entry('file') assert file.getmtime() file = fs.Entry('nonexistent') mtime = file.getmtime() assert mtime is None, mtime def test_getsize(self): """Test the Base.getsize() method""" test = self.test test.write("file", "file\n") fs = SCons.Node.FS.FS() file = fs.Entry('file') size = file.getsize() assert size == 5, size file = fs.Entry('nonexistent') size = file.getsize() assert size is None, size def test_isdir(self): """Test the Base.isdir() method""" test = self.test test.subdir('dir') test.write("file", "file\n") fs = SCons.Node.FS.FS() dir = fs.Entry('dir') assert dir.isdir() file = fs.Entry('file') assert not file.isdir() nonexistent = fs.Entry('nonexistent') assert not nonexistent.isdir() def test_isfile(self): """Test the Base.isfile() method""" test = self.test test.subdir('dir') test.write("file", "file\n") fs = SCons.Node.FS.FS() dir = fs.Entry('dir') assert not dir.isfile() file = fs.Entry('file') assert file.isfile() nonexistent = fs.Entry('nonexistent') assert not nonexistent.isfile() if sys.platform != 'win32' and hasattr(os, 'symlink'): def test_islink(self): """Test the Base.islink() method""" test = self.test test.subdir('dir') test.write("file", "file\n") test.symlink("symlink", "symlink") fs = SCons.Node.FS.FS() dir = fs.Entry('dir') assert not dir.islink() file = fs.Entry('file') assert not file.islink() symlink = fs.Entry('symlink') assert symlink.islink() nonexistent = fs.Entry('nonexistent') assert not nonexistent.islink() class DirNodeInfoTestCase(_tempdirTestCase): def test___init__(self): """Test DirNodeInfo initialization""" ddd = self.fs.Dir('ddd') ni = SCons.Node.FS.DirNodeInfo() class DirBuildInfoTestCase(_tempdirTestCase): def test___init__(self): """Test DirBuildInfo initialization""" ddd = self.fs.Dir('ddd') bi = SCons.Node.FS.DirBuildInfo() class FileNodeInfoTestCase(_tempdirTestCase): def test___init__(self): """Test FileNodeInfo initialization""" fff = self.fs.File('fff') ni = SCons.Node.FS.FileNodeInfo() assert isinstance(ni, SCons.Node.FS.FileNodeInfo) def test_update(self): """Test updating a File.NodeInfo with on-disk information""" test = self.test fff = self.fs.File('fff') ni = SCons.Node.FS.FileNodeInfo() test.write('fff', "fff\n") st = os.stat('fff') ni.update(fff) assert hasattr(ni, 'timestamp') assert hasattr(ni, 'size') ni.timestamp = 0 ni.size = 0 ni.update(fff) mtime = st[stat.ST_MTIME] assert ni.timestamp == mtime, (ni.timestamp, mtime) size = st[stat.ST_SIZE] assert ni.size == size, (ni.size, size) import time time.sleep(2) test.write('fff', "fff longer size, different time stamp\n") st = os.stat('fff') mtime = st[stat.ST_MTIME] assert ni.timestamp != mtime, (ni.timestamp, mtime) size = st[stat.ST_SIZE] assert ni.size != size, (ni.size, size) class FileBuildInfoTestCase(_tempdirTestCase): def test___init__(self): """Test File.BuildInfo initialization""" fff = self.fs.File('fff') bi = SCons.Node.FS.FileBuildInfo() assert bi, bi def test_convert_to_sconsign(self): """Test converting to .sconsign file format""" fff = self.fs.File('fff') bi = SCons.Node.FS.FileBuildInfo() assert hasattr(bi, 'convert_to_sconsign') def test_convert_from_sconsign(self): """Test converting from .sconsign file format""" fff = self.fs.File('fff') bi = SCons.Node.FS.FileBuildInfo() assert hasattr(bi, 'convert_from_sconsign') def test_prepare_dependencies(self): """Test that we have a prepare_dependencies() method""" fff = self.fs.File('fff') bi = SCons.Node.FS.FileBuildInfo() bi.prepare_dependencies() def test_format(self): """Test the format() method""" f1 = self.fs.File('f1') bi1 = SCons.Node.FS.FileBuildInfo() self.fs.File('n1') self.fs.File('n2') self.fs.File('n3') s1sig = SCons.Node.FS.FileNodeInfo() s1sig.csig = 1 d1sig = SCons.Node.FS.FileNodeInfo() d1sig.timestamp = 2 i1sig = SCons.Node.FS.FileNodeInfo() i1sig.size = 3 bi1.bsources = [self.fs.File('s1')] bi1.bdepends = [self.fs.File('d1')] bi1.bimplicit = [self.fs.File('i1')] bi1.bsourcesigs = [s1sig] bi1.bdependsigs = [d1sig] bi1.bimplicitsigs = [i1sig] bi1.bact = 'action' bi1.bactsig = 'actionsig' expect_lines = [ 's1: 1 None None', 'd1: None 2 None', 'i1: None None 3', 'actionsig [action]', ] expect = '\n'.join(expect_lines) format = bi1.format() assert format == expect, (repr(expect), repr(format)) class FSTestCase(_tempdirTestCase): def test_needs_normpath(self): """Test the needs_normpath Regular expression This test case verifies that the regular expression used to determine whether a path needs normalization works as expected. """ needs_normpath_match = SCons.Node.FS.needs_normpath_match do_not_need_normpath = [ ".", "/", "/a", "/aa", "/a/", "/aa/", "/a/b", "/aa/bb", "/a/b/", "/aa/bb/", "", "a", "aa", "a/", "aa/", "a/b", "aa/bb", "a/b/", "aa/bb/", "a.", "a..", "/a.", "/a..", "a./", "a../", "/a./", "/a../", ".a", "..a", "/.a", "/..a", ".a/", "..a/", "/.a/", "/..a/", ] for p in do_not_need_normpath: assert needs_normpath_match(p) is None, p needs_normpath = [ "//", "//a", "//aa", "//a/", "//a/", "/aa//", "//a/b", "//aa/bb", "//a/b/", "//aa/bb/", "/a//b", "/aa//bb", "/a/b//", "/aa/bb//", "/a/b//", "/aa/bb//", "a//", "aa//", "a//b", "aa//bb", "a//b/", "aa//bb/", "a/b//", "aa/bb//", "..", "/.", "/..", "./", "../", "/./", "/../", "a/.", "a/..", "./a", "../a", "a/./a", "a/../a", ] for p in needs_normpath: assert needs_normpath_match(p) is not None, p def test_runTest(self): """Test FS (file system) Node operations This test case handles all of the file system node tests in one environment, so we don't have to set up a complicated directory structure for each test individually. """ test = self.test test.subdir('sub', ['sub', 'dir']) wp = test.workpath('') sub = test.workpath('sub', '') sub_dir = test.workpath('sub', 'dir', '') sub_dir_foo = test.workpath('sub', 'dir', 'foo', '') sub_dir_foo_bar = test.workpath('sub', 'dir', 'foo', 'bar', '') sub_foo = test.workpath('sub', 'foo', '') os.chdir(sub_dir) fs = SCons.Node.FS.FS() e1 = fs.Entry('e1') assert isinstance(e1, SCons.Node.FS.Entry) d1 = fs.Dir('d1') assert isinstance(d1, SCons.Node.FS.Dir) assert d1.cwd is d1, d1 f1 = fs.File('f1', directory = d1) assert isinstance(f1, SCons.Node.FS.File) d1_f1 = os.path.join('d1', 'f1') assert f1.get_internal_path() == d1_f1, "f1.path %s != %s" % (f1.get_internal_path(), d1_f1) assert str(f1) == d1_f1, "str(f1) %s != %s" % (str(f1), d1_f1) x1 = d1.File('x1') assert isinstance(x1, SCons.Node.FS.File) assert str(x1) == os.path.join('d1', 'x1') x2 = d1.Dir('x2') assert isinstance(x2, SCons.Node.FS.Dir) assert str(x2) == os.path.join('d1', 'x2') x3 = d1.Entry('x3') assert isinstance(x3, SCons.Node.FS.Entry) assert str(x3) == os.path.join('d1', 'x3') assert d1.File(x1) == x1 assert d1.Dir(x2) == x2 assert d1.Entry(x3) == x3 x1.cwd = d1 x4 = x1.File('x4') assert str(x4) == os.path.join('d1', 'x4') x5 = x1.Dir('x5') assert str(x5) == os.path.join('d1', 'x5') x6 = x1.Entry('x6') assert str(x6) == os.path.join('d1', 'x6') x7 = x1.Entry('x7') assert str(x7) == os.path.join('d1', 'x7') assert x1.File(x4) == x4 assert x1.Dir(x5) == x5 assert x1.Entry(x6) == x6 assert x1.Entry(x7) == x7 assert x1.Entry(x5) == x5 try: x1.File(x5) except TypeError: pass else: raise Exception("did not catch expected TypeError") assert x1.Entry(x4) == x4 try: x1.Dir(x4) except TypeError: pass else: raise Exception("did not catch expected TypeError") x6 = x1.File(x6) assert isinstance(x6, SCons.Node.FS.File) x7 = x1.Dir(x7) assert isinstance(x7, SCons.Node.FS.Dir) seps = [os.sep] if os.sep != '/': seps = seps + ['/'] drive, path = os.path.splitdrive(os.getcwd()) def _do_Dir_test(lpath, path_, abspath_, up_path_, sep, fileSys=fs, drive=drive): dir = fileSys.Dir(lpath.replace('/', sep)) if os.sep != '/': path_ = path_.replace('/', os.sep) abspath_ = abspath_.replace('/', os.sep) up_path_ = up_path_.replace('/', os.sep) def strip_slash(p, drive=drive): if p[-1] == os.sep and len(p) > 1: p = p[:-1] if p[0] == os.sep: p = drive + p return p path = strip_slash(path_) abspath = strip_slash(abspath_) up_path = strip_slash(up_path_) name = abspath.split(os.sep)[-1] if not name: if drive: name = drive else: name = os.sep if dir.up() is None: dir_up_path = dir.get_internal_path() else: dir_up_path = dir.up().get_internal_path() assert dir.name == name, \ "dir.name %s != expected name %s" % \ (dir.name, name) assert dir.get_internal_path() == path, \ "dir.path %s != expected path %s" % \ (dir.get_internal_path(), path) assert str(dir) == path, \ "str(dir) %s != expected path %s" % \ (str(dir), path) assert dir.get_abspath() == abspath, \ "dir.abspath %s != expected absolute path %s" % \ (dir.get_abspath(), abspath) assert dir_up_path == up_path, \ "dir.up().path %s != expected parent path %s" % \ (dir_up_path, up_path) for sep in seps: def Dir_test(lpath, path_, abspath_, up_path_, sep=sep, func=_do_Dir_test): return func(lpath, path_, abspath_, up_path_, sep) Dir_test('/', '/', '/', '/') Dir_test('', './', sub_dir, sub) Dir_test('foo', 'foo/', sub_dir_foo, './') Dir_test('foo/bar', 'foo/bar/', sub_dir_foo_bar, 'foo/') Dir_test('/foo', '/foo/', '/foo/', '/') Dir_test('/foo/bar', '/foo/bar/', '/foo/bar/', '/foo/') Dir_test('..', sub, sub, wp) Dir_test('foo/..', './', sub_dir, sub) Dir_test('../foo', sub_foo, sub_foo, sub) Dir_test('.', './', sub_dir, sub) Dir_test('./.', './', sub_dir, sub) Dir_test('foo/./bar', 'foo/bar/', sub_dir_foo_bar, 'foo/') Dir_test('#../foo', sub_foo, sub_foo, sub) Dir_test('#/../foo', sub_foo, sub_foo, sub) Dir_test('#foo/bar', 'foo/bar/', sub_dir_foo_bar, 'foo/') Dir_test('#/foo/bar', 'foo/bar/', sub_dir_foo_bar, 'foo/') Dir_test('#', './', sub_dir, sub) try: f2 = fs.File(sep.join(['f1', 'f2']), directory = d1) except TypeError as x: assert str(x) == ("Tried to lookup File '%s' as a Dir." % d1_f1), x except: raise try: dir = fs.Dir(sep.join(['d1', 'f1'])) except TypeError as x: assert str(x) == ("Tried to lookup File '%s' as a Dir." % d1_f1), x except: raise try: f2 = fs.File('d1') except TypeError as x: assert str(x) == ("Tried to lookup Dir '%s' as a File." % 'd1'), x except: raise # Test that just specifying the drive works to identify # its root directory. p = os.path.abspath(test.workpath('root_file')) drive, path = os.path.splitdrive(p) if drive: # The assert below probably isn't correct for the general # case, but it works for Windows, which covers a lot # of ground... dir = fs.Dir(drive) assert str(dir) == drive + os.sep, str(dir) # Make sure that lookups with and without the drive are # equivalent. p = os.path.abspath(test.workpath('some/file')) drive, path = os.path.splitdrive(p) e1 = fs.Entry(p) e2 = fs.Entry(path) assert e1 is e2, (e1, e2) assert str(e1) is str(e2), (str(e1), str(e2)) # Test for a bug in 0.04 that did not like looking up # dirs with a trailing slash on Windows. d=fs.Dir('./') assert d.get_internal_path() == '.', d.get_abspath() d=fs.Dir('foo/') assert d.get_internal_path() == 'foo', d.get_abspath() # Test for sub-classing of node building. global built_it built_it = None assert not built_it d1.add_source([SCons.Node.Node()]) # XXX FAKE SUBCLASS ATTRIBUTE d1.builder_set(Builder(fs.File)) d1.reset_executor() d1.env_set(Environment()) d1.build() assert built_it built_it = None assert not built_it f1.add_source([SCons.Node.Node()]) # XXX FAKE SUBCLASS ATTRIBUTE f1.builder_set(Builder(fs.File)) f1.reset_executor() f1.env_set(Environment()) f1.build() assert built_it def match(path, expect): expect = expect.replace('/', os.sep) assert path == expect, "path %s != expected %s" % (path, expect) e1 = fs.Entry("d1") assert e1.__class__.__name__ == 'Dir' match(e1.get_internal_path(), "d1") match(e1.dir.get_internal_path(), ".") e2 = fs.Entry("d1/f1") assert e2.__class__.__name__ == 'File' match(e2.get_internal_path(), "d1/f1") match(e2.dir.get_internal_path(), "d1") e3 = fs.Entry("e3") assert e3.__class__.__name__ == 'Entry' match(e3.get_internal_path(), "e3") match(e3.dir.get_internal_path(), ".") e4 = fs.Entry("d1/e4") assert e4.__class__.__name__ == 'Entry' match(e4.get_internal_path(), "d1/e4") match(e4.dir.get_internal_path(), "d1") e5 = fs.Entry("e3/e5") assert e3.__class__.__name__ == 'Dir' match(e3.get_internal_path(), "e3") match(e3.dir.get_internal_path(), ".") assert e5.__class__.__name__ == 'Entry' match(e5.get_internal_path(), "e3/e5") match(e5.dir.get_internal_path(), "e3") e6 = fs.Dir("d1/e4") assert e6 is e4 assert e4.__class__.__name__ == 'Dir' match(e4.get_internal_path(), "d1/e4") match(e4.dir.get_internal_path(), "d1") e7 = fs.File("e3/e5") assert e7 is e5 assert e5.__class__.__name__ == 'File' match(e5.get_internal_path(), "e3/e5") match(e5.dir.get_internal_path(), "e3") fs.chdir(fs.Dir('subdir')) f11 = fs.File("f11") match(f11.get_internal_path(), "subdir/f11") d12 = fs.Dir("d12") e13 = fs.Entry("subdir/e13") match(e13.get_internal_path(), "subdir/subdir/e13") fs.chdir(fs.Dir('..')) # Test scanning f1.builder_set(Builder(fs.File)) f1.env_set(Environment()) xyz = fs.File("xyz") f1.builder.target_scanner = Scanner(xyz) f1.scan() assert f1.implicit[0].get_internal_path() == "xyz" f1.implicit = [] f1.scan() assert f1.implicit == [] f1.implicit = None f1.scan() assert f1.implicit[0].get_internal_path() == "xyz" # Test underlying scanning functionality in get_found_includes() env = Environment() f12 = fs.File("f12") t1 = fs.File("t1") deps = f12.get_found_includes(env, None, t1) assert deps == [], deps class MyScanner(Scanner): call_count = 0 def __call__(self, node, env, path): self.call_count = self.call_count + 1 return Scanner.__call__(self, node, env, path) s = MyScanner(xyz) deps = f12.get_found_includes(env, s, t1) assert deps == [xyz], deps assert s.call_count == 1, s.call_count f12.built() deps = f12.get_found_includes(env, s, t1) assert deps == [xyz], deps assert s.call_count == 2, s.call_count env2 = Environment() deps = f12.get_found_includes(env2, s, t1) assert deps == [xyz], deps assert s.call_count == 3, s.call_count # Make sure we can scan this file even if the target isn't # a file that has a scanner (it might be an Alias, e.g.). class DummyNode(object): pass deps = f12.get_found_includes(env, s, DummyNode()) assert deps == [xyz], deps # Test building a file whose directory is not there yet... f1 = fs.File(test.workpath("foo/bar/baz/ack")) assert not f1.dir.exists() f1.prepare() f1.build() assert f1.dir.exists() os.chdir('..') # Test getcwd() fs = SCons.Node.FS.FS() assert str(fs.getcwd()) == ".", str(fs.getcwd()) fs.chdir(fs.Dir('subdir')) # The cwd's path is always "." assert str(fs.getcwd()) == ".", str(fs.getcwd()) assert fs.getcwd().get_internal_path() == 'subdir', fs.getcwd().get_internal_path() fs.chdir(fs.Dir('../..')) assert fs.getcwd().get_internal_path() == test.workdir, fs.getcwd().get_internal_path() f1 = fs.File(test.workpath("do_i_exist")) assert not f1.exists() test.write("do_i_exist","\n") assert not f1.exists(), "exists() call not cached" f1.built() assert f1.exists(), "exists() call caching not reset" test.unlink("do_i_exist") assert f1.exists() f1.built() assert not f1.exists() # For some reason, in Windows, the \x1a character terminates # the reading of files in text mode. This tests that # get_contents() returns the binary contents. test.write("binary_file", "Foo\x1aBar") f1 = fs.File(test.workpath("binary_file")) assert f1.get_contents() == bytearray("Foo\x1aBar",'utf-8'), f1.get_contents() # This tests to make sure we can decode UTF-8 text files. test_string = u"Foo\x1aBar" test.write("utf8_file", test_string.encode('utf-8')) f1 = fs.File(test.workpath("utf8_file")) assert eval('f1.get_text_contents() == u"Foo\x1aBar"'), \ f1.get_text_contents() # Check for string which doesn't have BOM and isn't valid # ASCII test_string = b'Gan\xdfauge' test.write('latin1_file', test_string) f1 = fs.File(test.workpath("latin1_file")) assert f1.get_text_contents() == test_string.decode('latin-1'), \ f1.get_text_contents() def nonexistent(method, s): try: x = method(s, create = 0) except SCons.Errors.UserError: pass else: raise Exception("did not catch expected UserError") nonexistent(fs.Entry, 'nonexistent') nonexistent(fs.Entry, 'nonexistent/foo') nonexistent(fs.File, 'nonexistent') nonexistent(fs.File, 'nonexistent/foo') nonexistent(fs.Dir, 'nonexistent') nonexistent(fs.Dir, 'nonexistent/foo') test.write("preserve_me", "\n") assert os.path.exists(test.workpath("preserve_me")) f1 = fs.File(test.workpath("preserve_me")) f1.prepare() assert os.path.exists(test.workpath("preserve_me")) test.write("remove_me", "\n") assert os.path.exists(test.workpath("remove_me")) f1 = fs.File(test.workpath("remove_me")) f1.builder = Builder(fs.File) f1.env_set(Environment()) f1.prepare() assert not os.path.exists(test.workpath("remove_me")) e = fs.Entry('e_local') assert not hasattr(e, '_local') e.set_local() assert e._local == 1 f = fs.File('e_local') assert f._local == 1 f = fs.File('f_local') assert f._local == 0 #XXX test_is_up_to_date() for directories #XXX test_sconsign() for directories #XXX test_set_signature() for directories #XXX test_build() for directories #XXX test_root() # test Entry.get_contents() e = fs.Entry('does_not_exist') c = e.get_contents() assert c == "", c assert e.__class__ == SCons.Node.FS.Entry test.write("file", "file\n") try: e = fs.Entry('file') c = e.get_contents() assert c == bytearray("file\n",'utf-8'), c assert e.__class__ == SCons.Node.FS.File finally: test.unlink("file") # test Entry.get_text_contents() e = fs.Entry('does_not_exist') c = e.get_text_contents() assert c == "", c assert e.__class__ == SCons.Node.FS.Entry test.write("file", "file\n") try: e = fs.Entry('file') c = e.get_text_contents() assert c == "file\n", c assert e.__class__ == SCons.Node.FS.File finally: test.unlink("file") test.subdir("dir") e = fs.Entry('dir') c = e.get_contents() assert c == "", c assert e.__class__ == SCons.Node.FS.Dir c = e.get_text_contents() try: eval('assert c == u"", c') except SyntaxError: assert c == "" if sys.platform != 'win32' and hasattr(os, 'symlink'): os.symlink('nonexistent', test.workpath('dangling_symlink')) e = fs.Entry('dangling_symlink') c = e.get_contents() assert e.__class__ == SCons.Node.FS.Entry, e.__class__ assert c == "", c c = e.get_text_contents() try: eval('assert c == u"", c') except SyntaxError: assert c == "", c test.write("tstamp", "tstamp\n") try: # Okay, *this* manipulation accomodates Windows FAT file systems # that only have two-second granularity on their timestamps. # We round down the current time to the nearest even integer # value, subtract two to make sure the timestamp is not "now," # and then convert it back to a float. tstamp = float(int(time.time() // 2) * 2) - 2.0 os.utime(test.workpath("tstamp"), (tstamp - 2.0, tstamp)) f = fs.File("tstamp") t = f.get_timestamp() assert t == tstamp, "expected %f, got %f" % (tstamp, t) finally: test.unlink("tstamp") test.subdir('tdir1') d = fs.Dir('tdir1') t = d.get_timestamp() assert t == 0, "expected 0, got %s" % str(t) test.subdir('tdir2') f1 = test.workpath('tdir2', 'file1') f2 = test.workpath('tdir2', 'file2') test.write(f1, 'file1\n') test.write(f2, 'file2\n') current_time = float(int(time.time() // 2) * 2) t1 = current_time - 4.0 t2 = current_time - 2.0 os.utime(f1, (t1 - 2.0, t1)) os.utime(f2, (t2 - 2.0, t2)) d = fs.Dir('tdir2') fs.File(f1) fs.File(f2) t = d.get_timestamp() assert t == t2, "expected %f, got %f" % (t2, t) skey = fs.Entry('eee.x').scanner_key() assert skey == '.x', skey skey = fs.Entry('eee.xyz').scanner_key() assert skey == '.xyz', skey skey = fs.File('fff.x').scanner_key() assert skey == '.x', skey skey = fs.File('fff.xyz').scanner_key() assert skey == '.xyz', skey skey = fs.Dir('ddd.x').scanner_key() assert skey is None, skey test.write("i_am_not_a_directory", "\n") try: exc_caught = 0 try: fs.Dir(test.workpath("i_am_not_a_directory")) except TypeError: exc_caught = 1 assert exc_caught, "Should have caught a TypeError" finally: test.unlink("i_am_not_a_directory") exc_caught = 0 try: fs.File(sub_dir) except TypeError: exc_caught = 1 assert exc_caught, "Should have caught a TypeError" # XXX test_is_up_to_date() d = fs.Dir('dir') r = d.remove() assert r is None, r f = fs.File('does_not_exist') r = f.remove() assert r is None, r test.write('exists', "exists\n") f = fs.File('exists') r = f.remove() assert r, r assert not os.path.exists(test.workpath('exists')), "exists was not removed" if sys.platform != 'win32' and hasattr(os, 'symlink'): symlink = test.workpath('symlink') os.symlink(test.workpath('does_not_exist'), symlink) assert os.path.islink(symlink) f = fs.File('symlink') r = f.remove() assert r, r assert not os.path.islink(symlink), "symlink was not removed" test.write('can_not_remove', "can_not_remove\n") test.writable(test.workpath('.'), 0) fp = open(test.workpath('can_not_remove')) f = fs.File('can_not_remove') exc_caught = 0 try: r = f.remove() except OSError: exc_caught = 1 fp.close() assert exc_caught, "Should have caught an OSError, r = " + str(r) f = fs.Entry('foo/bar/baz') assert f.for_signature() == 'baz', f.for_signature() assert f.get_string(0) == os.path.normpath('foo/bar/baz'), \ f.get_string(0) assert f.get_string(1) == 'baz', f.get_string(1) def test_drive_letters(self): """Test drive-letter look-ups""" test = self.test test.subdir('sub', ['sub', 'dir']) def drive_workpath(dirs, test=test): x = test.workpath(*dirs) drive, path = os.path.splitdrive(x) return 'X:' + path wp = drive_workpath(['']) if wp[-1] in (os.sep, '/'): tmp = os.path.split(wp[:-1])[0] else: tmp = os.path.split(wp)[0] parent_tmp = os.path.split(tmp)[0] if parent_tmp == 'X:': parent_tmp = 'X:' + os.sep tmp_foo = os.path.join(tmp, 'foo') foo = drive_workpath(['foo']) foo_bar = drive_workpath(['foo', 'bar']) sub = drive_workpath(['sub', '']) sub_dir = drive_workpath(['sub', 'dir', '']) sub_dir_foo = drive_workpath(['sub', 'dir', 'foo', '']) sub_dir_foo_bar = drive_workpath(['sub', 'dir', 'foo', 'bar', '']) sub_foo = drive_workpath(['sub', 'foo', '']) fs = SCons.Node.FS.FS() seps = [os.sep] if os.sep != '/': seps = seps + ['/'] def _do_Dir_test(lpath, path_, up_path_, sep, fileSys=fs): dir = fileSys.Dir(lpath.replace('/', sep)) if os.sep != '/': path_ = path_.replace('/', os.sep) up_path_ = up_path_.replace('/', os.sep) def strip_slash(p): if p[-1] == os.sep and len(p) > 3: p = p[:-1] return p path = strip_slash(path_) up_path = strip_slash(up_path_) name = path.split(os.sep)[-1] assert dir.name == name, \ "dir.name %s != expected name %s" % \ (dir.name, name) assert dir.get_internal_path() == path, \ "dir.path %s != expected path %s" % \ (dir.get_internal_path(), path) assert str(dir) == path, \ "str(dir) %s != expected path %s" % \ (str(dir), path) assert dir.up().get_internal_path() == up_path, \ "dir.up().path %s != expected parent path %s" % \ (dir.up().get_internal_path(), up_path) save_os_path = os.path save_os_sep = os.sep try: import ntpath os.path = ntpath os.sep = '\\' SCons.Node.FS.initialize_do_splitdrive() for sep in seps: def Dir_test(lpath, path_, up_path_, sep=sep, func=_do_Dir_test): return func(lpath, path_, up_path_, sep) Dir_test('#X:', wp, tmp) Dir_test('X:foo', foo, wp) Dir_test('X:foo/bar', foo_bar, foo) Dir_test('X:/foo', 'X:/foo', 'X:/') Dir_test('X:/foo/bar', 'X:/foo/bar/', 'X:/foo/') Dir_test('X:..', tmp, parent_tmp) Dir_test('X:foo/..', wp, tmp) Dir_test('X:../foo', tmp_foo, tmp) Dir_test('X:.', wp, tmp) Dir_test('X:./.', wp, tmp) Dir_test('X:foo/./bar', foo_bar, foo) Dir_test('#X:../foo', tmp_foo, tmp) Dir_test('#X:/../foo', tmp_foo, tmp) Dir_test('#X:foo/bar', foo_bar, foo) Dir_test('#X:/foo/bar', foo_bar, foo) Dir_test('#X:/', wp, tmp) finally: os.path = save_os_path os.sep = save_os_sep SCons.Node.FS.initialize_do_splitdrive() def test_unc_path(self): """Test UNC path look-ups""" test = self.test test.subdir('sub', ['sub', 'dir']) def strip_slash(p): if p[-1] == os.sep and len(p) > 3: p = p[:-1] return p def unc_workpath(dirs, test=test): import ntpath x = test.workpath(*dirs) drive, path = ntpath.splitdrive(x) unc, path = ntpath.splitunc(path) path = strip_slash(path) return '//' + path[1:] wp = unc_workpath(['']) if wp[-1] in (os.sep, '/'): tmp = os.path.split(wp[:-1])[0] else: tmp = os.path.split(wp)[0] parent_tmp = os.path.split(tmp)[0] tmp_foo = os.path.join(tmp, 'foo') foo = unc_workpath(['foo']) foo_bar = unc_workpath(['foo', 'bar']) sub = unc_workpath(['sub', '']) sub_dir = unc_workpath(['sub', 'dir', '']) sub_dir_foo = unc_workpath(['sub', 'dir', 'foo', '']) sub_dir_foo_bar = unc_workpath(['sub', 'dir', 'foo', 'bar', '']) sub_foo = unc_workpath(['sub', 'foo', '']) fs = SCons.Node.FS.FS() seps = [os.sep] if os.sep != '/': seps = seps + ['/'] def _do_Dir_test(lpath, path, up_path, sep, fileSys=fs): dir = fileSys.Dir(lpath.replace('/', sep)) if os.sep != '/': path = path.replace('/', os.sep) up_path = up_path.replace('/', os.sep) if path == os.sep + os.sep: name = os.sep + os.sep else: name = path.split(os.sep)[-1] if dir.up() is None: dir_up_path = dir.get_internal_path() else: dir_up_path = dir.up().get_internal_path() assert dir.name == name, \ "dir.name %s != expected name %s" % \ (dir.name, name) assert dir.get_internal_path() == path, \ "dir.path %s != expected path %s" % \ (dir.get_internal_path(), path) assert str(dir) == path, \ "str(dir) %s != expected path %s" % \ (str(dir), path) assert dir_up_path == up_path, \ "dir.up().path %s != expected parent path %s" % \ (dir.up().get_internal_path(), up_path) save_os_path = os.path save_os_sep = os.sep try: import ntpath os.path = ntpath os.sep = '\\' SCons.Node.FS.initialize_do_splitdrive() for sep in seps: def Dir_test(lpath, path_, up_path_, sep=sep, func=_do_Dir_test): return func(lpath, path_, up_path_, sep) Dir_test('//foo', '//foo', '//') Dir_test('//foo/bar', '//foo/bar', '//foo') Dir_test('//', '//', '//') Dir_test('//..', '//', '//') Dir_test('//foo/..', '//', '//') Dir_test('//../foo', '//foo', '//') Dir_test('//.', '//', '//') Dir_test('//./.', '//', '//') Dir_test('//foo/./bar', '//foo/bar', '//foo') Dir_test('//foo/../bar', '//bar', '//') Dir_test('//foo/../../bar', '//bar', '//') Dir_test('//foo/bar/../..', '//', '//') Dir_test('#//', wp, tmp) Dir_test('#//../foo', tmp_foo, tmp) Dir_test('#//../foo', tmp_foo, tmp) Dir_test('#//foo/bar', foo_bar, foo) Dir_test('#//foo/bar', foo_bar, foo) Dir_test('#//', wp, tmp) finally: os.path = save_os_path os.sep = save_os_sep SCons.Node.FS.initialize_do_splitdrive() def test_target_from_source(self): """Test the method for generating target nodes from sources""" fs = self.fs x = fs.File('x.c') t = x.target_from_source('pre-', '-suf') assert str(t) == 'pre-x-suf', str(t) assert t.__class__ == SCons.Node.FS.Entry y = fs.File('dir/y') t = y.target_from_source('pre-', '-suf') assert str(t) == os.path.join('dir', 'pre-y-suf'), str(t) assert t.__class__ == SCons.Node.FS.Entry z = fs.File('zz') t = z.target_from_source('pre-', '-suf', lambda x: x[:-1]) assert str(t) == 'pre-z-suf', str(t) assert t.__class__ == SCons.Node.FS.Entry d = fs.Dir('ddd') t = d.target_from_source('pre-', '-suf') assert str(t) == 'pre-ddd-suf', str(t) assert t.__class__ == SCons.Node.FS.Entry e = fs.Entry('eee') t = e.target_from_source('pre-', '-suf') assert str(t) == 'pre-eee-suf', str(t) assert t.__class__ == SCons.Node.FS.Entry def test_same_name(self): """Test that a local same-named file isn't found for a Dir lookup""" test = self.test fs = self.fs test.subdir('subdir') test.write(['subdir', 'build'], "subdir/build\n") subdir = fs.Dir('subdir') fs.chdir(subdir, change_os_dir=1) self.fs._lookup('#build/file', subdir, SCons.Node.FS.File) def test_above_root(self): """Testing looking up a path above the root directory""" test = self.test fs = self.fs d1 = fs.Dir('d1') d2 = d1.Dir('d2') dirs = os.path.normpath(d2.get_abspath()).split(os.sep) above_path = os.path.join(*['..']*len(dirs) + ['above']) above = d2.Dir(above_path) def test_lookup_abs(self): """Exercise the _lookup_abs function""" test = self.test fs = self.fs root = fs.Dir('/') d = root._lookup_abs('/tmp/foo-nonexistent/nonexistent-dir', SCons.Node.FS.Dir) assert d.__class__ == SCons.Node.FS.Dir, str(d.__class__) def test_lookup_uncpath(self): """Testing looking up a UNC path on Windows""" if sys.platform not in ('win32',): return test = self.test fs = self.fs path='//servername/C$/foo' f = self.fs._lookup('//servername/C$/foo', fs.Dir('#'), SCons.Node.FS.File) # before the fix in this commit, this returned 'C:\servername\C$\foo' # Should be a normalized Windows UNC path as below. assert str(f) == r'\\servername\C$\foo', \ 'UNC path %s got looked up as %s'%(path, f) def test_unc_drive_letter(self): """Test drive-letter lookup for windows UNC-style directories""" if sys.platform not in ('win32',): return share = self.fs.Dir(r'\\SERVER\SHARE\Directory') assert str(share) == r'\\SERVER\SHARE\Directory', str(share) def test_UNC_dirs_2689(self): """Test some UNC dirs that printed incorrectly and/or caused infinite recursion errors prior to r5180 (SCons 2.1).""" fs = self.fs if sys.platform not in ('win32',): return p = fs.Dir(r"\\computername\sharename").get_abspath() assert p == r"\\computername\sharename", p p = fs.Dir(r"\\\computername\sharename").get_abspath() assert p == r"\\computername\sharename", p def test_rel_path(self): """Test the rel_path() method""" test = self.test fs = self.fs d1 = fs.Dir('d1') d1_f = d1.File('f') d1_d2 = d1.Dir('d2') d1_d2_f = d1_d2.File('f') d3 = fs.Dir('d3') d3_f = d3.File('f') d3_d4 = d3.Dir('d4') d3_d4_f = d3_d4.File('f') cases = [ d1, d1, '.', d1, d1_f, 'f', d1, d1_d2, 'd2', d1, d1_d2_f, 'd2/f', d1, d3, '../d3', d1, d3_f, '../d3/f', d1, d3_d4, '../d3/d4', d1, d3_d4_f, '../d3/d4/f', d1_f, d1, '.', d1_f, d1_f, 'f', d1_f, d1_d2, 'd2', d1_f, d1_d2_f, 'd2/f', d1_f, d3, '../d3', d1_f, d3_f, '../d3/f', d1_f, d3_d4, '../d3/d4', d1_f, d3_d4_f, '../d3/d4/f', d1_d2, d1, '..', d1_d2, d1_f, '../f', d1_d2, d1_d2, '.', d1_d2, d1_d2_f, 'f', d1_d2, d3, '../../d3', d1_d2, d3_f, '../../d3/f', d1_d2, d3_d4, '../../d3/d4', d1_d2, d3_d4_f, '../../d3/d4/f', d1_d2_f, d1, '..', d1_d2_f, d1_f, '../f', d1_d2_f, d1_d2, '.', d1_d2_f, d1_d2_f, 'f', d1_d2_f, d3, '../../d3', d1_d2_f, d3_f, '../../d3/f', d1_d2_f, d3_d4, '../../d3/d4', d1_d2_f, d3_d4_f, '../../d3/d4/f', ] if sys.platform in ('win32',): x_d1 = fs.Dir(r'X:\d1') x_d1_d2 = x_d1.Dir('d2') y_d1 = fs.Dir(r'Y:\d1') y_d1_d2 = y_d1.Dir('d2') y_d2 = fs.Dir(r'Y:\d2') win32_cases = [ x_d1, x_d1, '.', x_d1, x_d1_d2, 'd2', x_d1, y_d1, r'Y:\d1', x_d1, y_d1_d2, r'Y:\d1\d2', x_d1, y_d2, r'Y:\d2', ] cases.extend(win32_cases) failed = 0 while cases: dir, other, expect = cases[:3] expect = os.path.normpath(expect) del cases[:3] result = dir.rel_path(other) if result != expect: if failed == 0: print() fmt = " dir_path(%(dir)s, %(other)s) => '%(result)s' did not match '%(expect)s'" print(fmt % locals()) failed = failed + 1 assert failed == 0, "%d rel_path() cases failed" % failed def test_proxy(self): """Test a Node.FS object wrapped in a proxy instance""" f1 = self.fs.File('fff') class MyProxy(SCons.Util.Proxy): __str__ = SCons.Util.Delegate('__str__') p = MyProxy(f1) f2 = self.fs.Entry(p) assert f1 is f2, (f1, str(f1), f2, str(f2)) class DirTestCase(_tempdirTestCase): def test__morph(self): """Test handling of actions when morphing an Entry into a Dir""" test = self.test e = self.fs.Entry('eee') x = e.get_executor() x.add_pre_action('pre') x.add_post_action('post') e.must_be_same(SCons.Node.FS.Dir) a = x.get_action_list() assert 'pre' in a, a assert 'post' in a, a def test_subclass(self): """Test looking up subclass of Dir nodes""" class DirSubclass(SCons.Node.FS.Dir): pass sd = self.fs._lookup('special_dir', None, DirSubclass, create=1) sd.must_be_same(SCons.Node.FS.Dir) def test_get_env_scanner(self): """Test the Dir.get_env_scanner() method """ import SCons.Defaults d = self.fs.Dir('ddd') s = d.get_env_scanner(Environment()) assert s is SCons.Defaults.DirEntryScanner, s def test_get_target_scanner(self): """Test the Dir.get_target_scanner() method """ import SCons.Defaults d = self.fs.Dir('ddd') s = d.get_target_scanner() assert s is SCons.Defaults.DirEntryScanner, s def test_scan(self): """Test scanning a directory for in-memory entries """ fs = self.fs dir = fs.Dir('ddd') fs.File(os.path.join('ddd', 'f1')) fs.File(os.path.join('ddd', 'f2')) fs.File(os.path.join('ddd', 'f3')) fs.Dir(os.path.join('ddd', 'd1')) fs.Dir(os.path.join('ddd', 'd1', 'f4')) fs.Dir(os.path.join('ddd', 'd1', 'f5')) dir.scan() kids = sorted([x.get_internal_path() for x in dir.children(None)]) assert kids == [os.path.join('ddd', 'd1'), os.path.join('ddd', 'f1'), os.path.join('ddd', 'f2'), os.path.join('ddd', 'f3')], kids def test_get_contents(self): """Test getting the contents for a directory. """ test = self.test test.subdir('d') test.write(['d', 'g'], "67890\n") test.write(['d', 'f'], "12345\n") test.subdir(['d','sub']) test.write(['d', 'sub','h'], "abcdef\n") test.subdir(['d','empty']) d = self.fs.Dir('d') g = self.fs.File(os.path.join('d', 'g')) f = self.fs.File(os.path.join('d', 'f')) h = self.fs.File(os.path.join('d', 'sub', 'h')) e = self.fs.Dir(os.path.join('d', 'empty')) s = self.fs.Dir(os.path.join('d', 'sub')) files = d.get_contents().split('\n') assert e.get_contents() == '', e.get_contents() assert e.get_text_contents() == '', e.get_text_contents() assert e.get_csig()+" empty" == files[0], files assert f.get_csig()+" f" == files[1], files assert g.get_csig()+" g" == files[2], files assert s.get_csig()+" sub" == files[3], files def test_implicit_re_scans(self): """Test that adding entries causes a directory to be re-scanned """ fs = self.fs dir = fs.Dir('ddd') fs.File(os.path.join('ddd', 'f1')) dir.scan() kids = sorted([x.get_internal_path() for x in dir.children()]) assert kids == [os.path.join('ddd', 'f1')], kids fs.File(os.path.join('ddd', 'f2')) dir.scan() kids = sorted([x.get_internal_path() for x in dir.children()]) assert kids == [os.path.join('ddd', 'f1'), os.path.join('ddd', 'f2')], kids def test_entry_exists_on_disk(self): """Test the Dir.entry_exists_on_disk() method """ test = self.test does_not_exist = self.fs.Dir('does_not_exist') assert not does_not_exist.entry_exists_on_disk('foo') test.subdir('d') test.write(['d', 'exists'], "d/exists\n") test.write(['d', 'Case-Insensitive'], "d/Case-Insensitive\n") d = self.fs.Dir('d') assert d.entry_exists_on_disk('exists') assert not d.entry_exists_on_disk('does_not_exist') if os.path.normcase("TeSt") != os.path.normpath("TeSt") or sys.platform == "cygwin": assert d.entry_exists_on_disk('case-insensitive') def test_rentry_exists_on_disk(self): """Test the Dir.rentry_exists_on_disk() method """ test = self.test does_not_exist = self.fs.Dir('does_not_exist') assert not does_not_exist.rentry_exists_on_disk('foo') test.subdir('d') test.write(['d', 'exists'], "d/exists\n") test.write(['d', 'Case-Insensitive'], "d/Case-Insensitive\n") test.subdir('r') test.write(['r', 'rexists'], "r/rexists\n") d = self.fs.Dir('d') r = self.fs.Dir('r') d.addRepository(r) assert d.rentry_exists_on_disk('exists') assert d.rentry_exists_on_disk('rexists') assert not d.rentry_exists_on_disk('does_not_exist') if os.path.normcase("TeSt") != os.path.normpath("TeSt") or sys.platform == "cygwin": assert d.rentry_exists_on_disk('case-insensitive') def test_srcdir_list(self): """Test the Dir.srcdir_list() method """ src = self.fs.Dir('src') bld = self.fs.Dir('bld') sub1 = bld.Dir('sub') sub2 = sub1.Dir('sub') sub3 = sub2.Dir('sub') self.fs.VariantDir(bld, src, duplicate=0) self.fs.VariantDir(sub2, src, duplicate=0) def check(result, expect): result = list(map(str, result)) expect = list(map(os.path.normpath, expect)) assert result == expect, result s = src.srcdir_list() check(s, []) s = bld.srcdir_list() check(s, ['src']) s = sub1.srcdir_list() check(s, ['src/sub']) s = sub2.srcdir_list() check(s, ['src', 'src/sub/sub']) s = sub3.srcdir_list() check(s, ['src/sub', 'src/sub/sub/sub']) self.fs.VariantDir('src/b1/b2', 'src') b1 = src.Dir('b1') b1_b2 = b1.Dir('b2') b1_b2_b1 = b1_b2.Dir('b1') b1_b2_b1_b2 = b1_b2_b1.Dir('b2') b1_b2_b1_b2_sub = b1_b2_b1_b2.Dir('sub') s = b1.srcdir_list() check(s, []) s = b1_b2.srcdir_list() check(s, ['src']) s = b1_b2_b1.srcdir_list() check(s, ['src/b1']) s = b1_b2_b1_b2.srcdir_list() check(s, ['src/b1/b2']) s = b1_b2_b1_b2_sub.srcdir_list() check(s, ['src/b1/b2/sub']) def test_srcdir_duplicate(self): """Test the Dir.srcdir_duplicate() method """ test = self.test test.subdir('src0') test.write(['src0', 'exists'], "src0/exists\n") bld0 = self.fs.Dir('bld0') src0 = self.fs.Dir('src0') self.fs.VariantDir(bld0, src0, duplicate=0) n = bld0.srcdir_duplicate('does_not_exist') assert n is None, n assert not os.path.exists(test.workpath('bld0', 'does_not_exist')) n = bld0.srcdir_duplicate('exists') assert str(n) == os.path.normpath('src0/exists'), str(n) assert not os.path.exists(test.workpath('bld0', 'exists')) test.subdir('src1') test.write(['src1', 'exists'], "src0/exists\n") bld1 = self.fs.Dir('bld1') src1 = self.fs.Dir('src1') self.fs.VariantDir(bld1, src1, duplicate=1) n = bld1.srcdir_duplicate('does_not_exist') assert n is None, n assert not os.path.exists(test.workpath('bld1', 'does_not_exist')) n = bld1.srcdir_duplicate('exists') assert str(n) == os.path.normpath('bld1/exists'), str(n) assert os.path.exists(test.workpath('bld1', 'exists')) def test_srcdir_find_file(self): """Test the Dir.srcdir_find_file() method """ test = self.test def return_true(node): return 1 SCons.Node._is_derived_map[2] = return_true SCons.Node._exists_map[5] = return_true test.subdir('src0') test.write(['src0', 'on-disk-f1'], "src0/on-disk-f1\n") test.write(['src0', 'on-disk-f2'], "src0/on-disk-f2\n") test.write(['src0', 'on-disk-e1'], "src0/on-disk-e1\n") test.write(['src0', 'on-disk-e2'], "src0/on-disk-e2\n") bld0 = self.fs.Dir('bld0') src0 = self.fs.Dir('src0') self.fs.VariantDir(bld0, src0, duplicate=0) derived_f = src0.File('derived-f') derived_f._func_is_derived = 2 exists_f = src0.File('exists-f') exists_f._func_exists = 5 derived_e = src0.Entry('derived-e') derived_e._func_is_derived = 2 exists_e = src0.Entry('exists-e') exists_e._func_exists = 5 def check(result, expect): result = list(map(str, result)) expect = list(map(os.path.normpath, expect)) assert result == expect, result # First check from the source directory. n = src0.srcdir_find_file('does_not_exist') assert n == (None, None), n n = src0.srcdir_find_file('derived-f') check(n, ['src0/derived-f', 'src0']) n = src0.srcdir_find_file('exists-f') check(n, ['src0/exists-f', 'src0']) n = src0.srcdir_find_file('on-disk-f1') check(n, ['src0/on-disk-f1', 'src0']) n = src0.srcdir_find_file('derived-e') check(n, ['src0/derived-e', 'src0']) n = src0.srcdir_find_file('exists-e') check(n, ['src0/exists-e', 'src0']) n = src0.srcdir_find_file('on-disk-e1') check(n, ['src0/on-disk-e1', 'src0']) # Now check from the variant directory. n = bld0.srcdir_find_file('does_not_exist') assert n == (None, None), n n = bld0.srcdir_find_file('derived-f') check(n, ['src0/derived-f', 'bld0']) n = bld0.srcdir_find_file('exists-f') check(n, ['src0/exists-f', 'bld0']) n = bld0.srcdir_find_file('on-disk-f2') check(n, ['src0/on-disk-f2', 'bld0']) n = bld0.srcdir_find_file('derived-e') check(n, ['src0/derived-e', 'bld0']) n = bld0.srcdir_find_file('exists-e') check(n, ['src0/exists-e', 'bld0']) n = bld0.srcdir_find_file('on-disk-e2') check(n, ['src0/on-disk-e2', 'bld0']) test.subdir('src1') test.write(['src1', 'on-disk-f1'], "src1/on-disk-f1\n") test.write(['src1', 'on-disk-f2'], "src1/on-disk-f2\n") test.write(['src1', 'on-disk-e1'], "src1/on-disk-e1\n") test.write(['src1', 'on-disk-e2'], "src1/on-disk-e2\n") bld1 = self.fs.Dir('bld1') src1 = self.fs.Dir('src1') self.fs.VariantDir(bld1, src1, duplicate=1) derived_f = src1.File('derived-f') derived_f._func_is_derived = 2 exists_f = src1.File('exists-f') exists_f._func_exists = 5 derived_e = src1.Entry('derived-e') derived_e._func_is_derived = 2 exists_e = src1.Entry('exists-e') exists_e._func_exists = 5 # First check from the source directory. n = src1.srcdir_find_file('does_not_exist') assert n == (None, None), n n = src1.srcdir_find_file('derived-f') check(n, ['src1/derived-f', 'src1']) n = src1.srcdir_find_file('exists-f') check(n, ['src1/exists-f', 'src1']) n = src1.srcdir_find_file('on-disk-f1') check(n, ['src1/on-disk-f1', 'src1']) n = src1.srcdir_find_file('derived-e') check(n, ['src1/derived-e', 'src1']) n = src1.srcdir_find_file('exists-e') check(n, ['src1/exists-e', 'src1']) n = src1.srcdir_find_file('on-disk-e1') check(n, ['src1/on-disk-e1', 'src1']) # Now check from the variant directory. n = bld1.srcdir_find_file('does_not_exist') assert n == (None, None), n n = bld1.srcdir_find_file('derived-f') check(n, ['bld1/derived-f', 'src1']) n = bld1.srcdir_find_file('exists-f') check(n, ['bld1/exists-f', 'src1']) n = bld1.srcdir_find_file('on-disk-f2') check(n, ['bld1/on-disk-f2', 'bld1']) n = bld1.srcdir_find_file('derived-e') check(n, ['bld1/derived-e', 'src1']) n = bld1.srcdir_find_file('exists-e') check(n, ['bld1/exists-e', 'src1']) n = bld1.srcdir_find_file('on-disk-e2') check(n, ['bld1/on-disk-e2', 'bld1']) def test_dir_on_disk(self): """Test the Dir.dir_on_disk() method""" self.test.subdir('sub', ['sub', 'exists']) self.test.write(['sub', 'file'], "self/file\n") sub = self.fs.Dir('sub') r = sub.dir_on_disk('does_not_exist') assert not r, r r = sub.dir_on_disk('exists') assert r, r r = sub.dir_on_disk('file') assert not r, r def test_file_on_disk(self): """Test the Dir.file_on_disk() method""" self.test.subdir('sub', ['sub', 'dir']) self.test.write(['sub', 'exists'], "self/exists\n") sub = self.fs.Dir('sub') r = sub.file_on_disk('does_not_exist') assert not r, r r = sub.file_on_disk('exists') assert r, r r = sub.file_on_disk('dir') assert not r, r class EntryTestCase(_tempdirTestCase): def test_runTest(self): """Test methods specific to the Entry sub-class. """ test = TestCmd(workdir='') # FS doesn't like the cwd to be something other than its root. os.chdir(test.workpath("")) fs = SCons.Node.FS.FS() e1 = fs.Entry('e1') e1.rfile() assert e1.__class__ is SCons.Node.FS.File, e1.__class__ test.subdir('e3d') test.write('e3f', "e3f\n") e3d = fs.Entry('e3d') e3d.get_contents() assert e3d.__class__ is SCons.Node.FS.Dir, e3d.__class__ e3f = fs.Entry('e3f') e3f.get_contents() assert e3f.__class__ is SCons.Node.FS.File, e3f.__class__ e3n = fs.Entry('e3n') e3n.get_contents() assert e3n.__class__ is SCons.Node.FS.Entry, e3n.__class__ test.subdir('e4d') test.write('e4f', "e4f\n") e4d = fs.Entry('e4d') exists = e4d.exists() assert e4d.__class__ is SCons.Node.FS.Dir, e4d.__class__ assert exists, "e4d does not exist?" e4f = fs.Entry('e4f') exists = e4f.exists() assert e4f.__class__ is SCons.Node.FS.File, e4f.__class__ assert exists, "e4f does not exist?" e4n = fs.Entry('e4n') exists = e4n.exists() assert e4n.__class__ is SCons.Node.FS.File, e4n.__class__ assert not exists, "e4n exists?" class MyCalc(object): def __init__(self, val): self.max_drift = 0 class M(object): def __init__(self, val): self.val = val def collect(self, args): result = 0 for a in args: result += a return result def signature(self, executor): return self.val + 222 self.module = M(val) test.subdir('e5d') test.write('e5f', "e5f\n") def test_Entry_Entry_lookup(self): """Test looking up an Entry within another Entry""" self.fs.Entry('#topdir') self.fs.Entry('#topdir/a/b/c') class FileTestCase(_tempdirTestCase): def test_subclass(self): """Test looking up subclass of File nodes""" class FileSubclass(SCons.Node.FS.File): pass sd = self.fs._lookup('special_file', None, FileSubclass, create=1) sd.must_be_same(SCons.Node.FS.File) def test_Dirs(self): """Test the File.Dirs() method""" fff = self.fs.File('subdir/fff') # This simulates that the SConscript file that defined # fff is in subdir/. fff.cwd = self.fs.Dir('subdir') d1 = self.fs.Dir('subdir/d1') d2 = self.fs.Dir('subdir/d2') dirs = fff.Dirs(['d1', 'd2']) assert dirs == [d1, d2], list(map(str, dirs)) def test_exists(self): """Test the File.exists() method""" fs = self.fs test = self.test src_f1 = fs.File('src/f1') assert not src_f1.exists(), "%s apparently exists?" % src_f1 test.subdir('src') test.write(['src', 'f1'], "src/f1\n") assert not src_f1.exists(), "%s did not cache previous exists() value" % src_f1 src_f1.clear() assert src_f1.exists(), "%s apparently does not exist?" % src_f1 test.subdir('build') fs.VariantDir('build', 'src') build_f1 = fs.File('build/f1') assert build_f1.exists(), "%s did not realize that %s exists" % (build_f1, src_f1) assert os.path.exists(build_f1.get_abspath()), "%s did not get duplicated on disk" % build_f1.get_abspath() test.unlink(['src', 'f1']) src_f1.clear() # so the next exists() call will look on disk again assert build_f1.exists(), "%s did not cache previous exists() value" % build_f1 build_f1.clear() build_f1.linked = None assert not build_f1.exists(), "%s did not realize that %s disappeared" % (build_f1, src_f1) assert not os.path.exists(build_f1.get_abspath()), "%s did not get removed after %s was removed" % (build_f1, src_f1) class GlobTestCase(_tempdirTestCase): def setUp(self): _tempdirTestCase.setUp(self) fs = SCons.Node.FS.FS() self.fs = fs # Make entries on disk that will not have Nodes, so we can verify # the behavior of looking for things on disk. self.test.write('disk-bbb', "disk-bbb\n") self.test.write('disk-aaa', "disk-aaa\n") self.test.write('disk-ccc', "disk-ccc\n") self.test.write('#disk-hash', "#disk-hash\n") self.test.subdir('disk-sub') self.test.write(['disk-sub', 'disk-ddd'], "disk-sub/disk-ddd\n") self.test.write(['disk-sub', 'disk-eee'], "disk-sub/disk-eee\n") self.test.write(['disk-sub', 'disk-fff'], "disk-sub/disk-fff\n") # Make some entries that have both Nodes and on-disk entries, # so we can verify what we do with self.test.write('both-aaa', "both-aaa\n") self.test.write('both-bbb', "both-bbb\n") self.test.write('both-ccc', "both-ccc\n") self.test.write('#both-hash', "#both-hash\n") self.test.subdir('both-sub1') self.test.write(['both-sub1', 'both-ddd'], "both-sub1/both-ddd\n") self.test.write(['both-sub1', 'both-eee'], "both-sub1/both-eee\n") self.test.write(['both-sub1', 'both-fff'], "both-sub1/both-fff\n") self.test.subdir('both-sub2') self.test.write(['both-sub2', 'both-ddd'], "both-sub2/both-ddd\n") self.test.write(['both-sub2', 'both-eee'], "both-sub2/both-eee\n") self.test.write(['both-sub2', 'both-fff'], "both-sub2/both-fff\n") self.both_aaa = fs.File('both-aaa') self.both_bbb = fs.File('both-bbb') self.both_ccc = fs.File('both-ccc') self._both_hash = fs.File('./#both-hash') self.both_sub1 = fs.Dir('both-sub1') self.both_sub1_both_ddd = self.both_sub1.File('both-ddd') self.both_sub1_both_eee = self.both_sub1.File('both-eee') self.both_sub1_both_fff = self.both_sub1.File('both-fff') self.both_sub2 = fs.Dir('both-sub2') self.both_sub2_both_ddd = self.both_sub2.File('both-ddd') self.both_sub2_both_eee = self.both_sub2.File('both-eee') self.both_sub2_both_fff = self.both_sub2.File('both-fff') # Make various Nodes (that don't have on-disk entries) so we # can verify how we match them. self.ggg = fs.File('ggg') self.hhh = fs.File('hhh') self.iii = fs.File('iii') self._hash = fs.File('./#hash') self.subdir1 = fs.Dir('subdir1') self.subdir1_lll = self.subdir1.File('lll') self.subdir1_jjj = self.subdir1.File('jjj') self.subdir1_kkk = self.subdir1.File('kkk') self.subdir2 = fs.Dir('subdir2') self.subdir2_lll = self.subdir2.File('lll') self.subdir2_kkk = self.subdir2.File('kkk') self.subdir2_jjj = self.subdir2.File('jjj') self.sub = fs.Dir('sub') self.sub_dir3 = self.sub.Dir('dir3') self.sub_dir3_kkk = self.sub_dir3.File('kkk') self.sub_dir3_jjj = self.sub_dir3.File('jjj') self.sub_dir3_lll = self.sub_dir3.File('lll') def do_cases(self, cases, **kwargs): # First, execute all of the cases with string=True and verify # that we get the expected strings returned. We do this first # so the Glob() calls don't add Nodes to the self.fs file system # hierarchy. import copy strings_kwargs = copy.copy(kwargs) strings_kwargs['strings'] = True for input, string_expect, node_expect in cases: r = sorted(self.fs.Glob(input, **strings_kwargs)) assert r == string_expect, "Glob(%s, strings=True) expected %s, got %s" % (input, string_expect, r) # Now execute all of the cases without string=True and look for # the expected Nodes to be returned. If we don't have a list of # actual expected Nodes, that means we're expecting a search for # on-disk-only files to have returned some newly-created nodes. # Verify those by running the list through str() before comparing # them with the expected list of strings. for input, string_expect, node_expect in cases: r = self.fs.Glob(input, **kwargs) if node_expect: r = sorted(r, key=lambda a: a.get_internal_path()) result = [] for n in node_expect: if isinstance(n, str): n = self.fs.Entry(n) result.append(n) fmt = lambda n: "%s %s" % (repr(n), repr(str(n))) else: r = sorted(map(str, r)) result = string_expect fmt = lambda n: n if r != result: import pprint print("Glob(%s) expected:" % repr(input)) pprint.pprint(list(map(fmt, result))) print("Glob(%s) got:" % repr(input)) pprint.pprint(list(map(fmt, r))) self.fail() def test_exact_match(self): """Test globbing for exact Node matches""" join = os.path.join cases = ( ('ggg', ['ggg'], [self.ggg]), ('subdir1', ['subdir1'], [self.subdir1]), ('subdir1/jjj', [join('subdir1', 'jjj')], [self.subdir1_jjj]), ('disk-aaa', ['disk-aaa'], None), ('disk-sub', ['disk-sub'], None), ('both-aaa', ['both-aaa'], []), ) self.do_cases(cases) def test_subdir_matches(self): """Test globbing for exact Node matches in subdirectories""" join = os.path.join cases = ( ('*/jjj', [join('subdir1', 'jjj'), join('subdir2', 'jjj')], [self.subdir1_jjj, self.subdir2_jjj]), ('*/disk-ddd', [join('disk-sub', 'disk-ddd')], None), ) self.do_cases(cases) def test_asterisk1(self): """Test globbing for simple asterisk Node matches (1)""" cases = ( ('h*', ['hhh'], [self.hhh]), ('*', ['#both-hash', '#hash', 'both-aaa', 'both-bbb', 'both-ccc', 'both-sub1', 'both-sub2', 'ggg', 'hhh', 'iii', 'sub', 'subdir1', 'subdir2'], [self._both_hash, self._hash, self.both_aaa, self.both_bbb, self.both_ccc, 'both-hash', self.both_sub1, self.both_sub2, self.ggg, 'hash', self.hhh, self.iii, self.sub, self.subdir1, self.subdir2]), ) self.do_cases(cases, ondisk=False) def test_asterisk2(self): """Test globbing for simple asterisk Node matches (2)""" cases = ( ('disk-b*', ['disk-bbb'], None), ('*', ['#both-hash', '#disk-hash', '#hash', 'both-aaa', 'both-bbb', 'both-ccc', 'both-sub1', 'both-sub2', 'disk-aaa', 'disk-bbb', 'disk-ccc', 'disk-sub', 'ggg', 'hhh', 'iii', 'sub', 'subdir1', 'subdir2'], ['./#both-hash', './#disk-hash', './#hash', 'both-aaa', 'both-bbb', 'both-ccc', 'both-hash', 'both-sub1', 'both-sub2', 'disk-aaa', 'disk-bbb', 'disk-ccc', 'disk-sub', 'ggg', 'hash', 'hhh', 'iii', 'sub', 'subdir1', 'subdir2']), ) self.do_cases(cases) def test_question_mark(self): """Test globbing for simple question-mark Node matches""" join = os.path.join cases = ( ('ii?', ['iii'], [self.iii]), ('both-sub?/both-eee', [join('both-sub1', 'both-eee'), join('both-sub2', 'both-eee')], [self.both_sub1_both_eee, self.both_sub2_both_eee]), ('subdir?/jjj', [join('subdir1', 'jjj'), join('subdir2', 'jjj')], [self.subdir1_jjj, self.subdir2_jjj]), ('disk-cc?', ['disk-ccc'], None), ) self.do_cases(cases) def test_does_not_exist(self): """Test globbing for things that don't exist""" cases = ( ('does_not_exist', [], []), ('no_subdir/*', [], []), ('subdir?/no_file', [], []), ) self.do_cases(cases) def test_subdir_asterisk(self): """Test globbing for asterisk Node matches in subdirectories""" join = os.path.join cases = ( ('*/k*', [join('subdir1', 'kkk'), join('subdir2', 'kkk')], [self.subdir1_kkk, self.subdir2_kkk]), ('both-sub?/*', [join('both-sub1', 'both-ddd'), join('both-sub1', 'both-eee'), join('both-sub1', 'both-fff'), join('both-sub2', 'both-ddd'), join('both-sub2', 'both-eee'), join('both-sub2', 'both-fff')], [self.both_sub1_both_ddd, self.both_sub1_both_eee, self.both_sub1_both_fff, self.both_sub2_both_ddd, self.both_sub2_both_eee, self.both_sub2_both_fff], ), ('subdir?/*', [join('subdir1', 'jjj'), join('subdir1', 'kkk'), join('subdir1', 'lll'), join('subdir2', 'jjj'), join('subdir2', 'kkk'), join('subdir2', 'lll')], [self.subdir1_jjj, self.subdir1_kkk, self.subdir1_lll, self.subdir2_jjj, self.subdir2_kkk, self.subdir2_lll]), ('sub/*/*', [join('sub', 'dir3', 'jjj'), join('sub', 'dir3', 'kkk'), join('sub', 'dir3', 'lll')], [self.sub_dir3_jjj, self.sub_dir3_kkk, self.sub_dir3_lll]), ('*/k*', [join('subdir1', 'kkk'), join('subdir2', 'kkk')], None), ('subdir?/*', [join('subdir1', 'jjj'), join('subdir1', 'kkk'), join('subdir1', 'lll'), join('subdir2', 'jjj'), join('subdir2', 'kkk'), join('subdir2', 'lll')], None), ('sub/*/*', [join('sub', 'dir3', 'jjj'), join('sub', 'dir3', 'kkk'), join('sub', 'dir3', 'lll')], None), ) self.do_cases(cases) def test_subdir_question(self): """Test globbing for question-mark Node matches in subdirectories""" join = os.path.join cases = ( ('*/?kk', [join('subdir1', 'kkk'), join('subdir2', 'kkk')], [self.subdir1_kkk, self.subdir2_kkk]), ('subdir?/l?l', [join('subdir1', 'lll'), join('subdir2', 'lll')], [self.subdir1_lll, self.subdir2_lll]), ('*/disk-?ff', [join('disk-sub', 'disk-fff')], None), ('subdir?/l?l', [join('subdir1', 'lll'), join('subdir2', 'lll')], None), ) self.do_cases(cases) def test_sort(self): """Test whether globbing sorts""" join = os.path.join # At least sometimes this should return out-of-order items # if Glob doesn't sort. # It's not a very good test though since it depends on the # order returned by glob, which might already be sorted. g = self.fs.Glob('disk-sub/*', strings=True) expect = [ os.path.join('disk-sub', 'disk-ddd'), os.path.join('disk-sub', 'disk-eee'), os.path.join('disk-sub', 'disk-fff'), ] assert g == expect, str(g) + " is not sorted, but should be!" g = self.fs.Glob('disk-*', strings=True) expect = [ 'disk-aaa', 'disk-bbb', 'disk-ccc', 'disk-sub' ] assert g == expect, str(g) + " is not sorted, but should be!" class RepositoryTestCase(_tempdirTestCase): def setUp(self): _tempdirTestCase.setUp(self) self.test.subdir('rep1', 'rep2', 'rep3', 'work') self.rep1 = self.test.workpath('rep1') self.rep2 = self.test.workpath('rep2') self.rep3 = self.test.workpath('rep3') os.chdir(self.test.workpath('work')) self.fs = SCons.Node.FS.FS() self.fs.Repository(self.rep1, self.rep2, self.rep3) def test_getRepositories(self): """Test the Dir.getRepositories() method""" self.fs.Repository('foo') self.fs.Repository(os.path.join('foo', 'bar')) self.fs.Repository('bar/foo') self.fs.Repository('bar') expect = [ self.rep1, self.rep2, self.rep3, 'foo', os.path.join('foo', 'bar'), os.path.join('bar', 'foo'), 'bar' ] rep = self.fs.Dir('#').getRepositories() r = [os.path.normpath(str(x)) for x in rep] assert r == expect, r def test_get_all_rdirs(self): """Test the Dir.get_all_rdirs() method""" self.fs.Repository('foo') self.fs.Repository(os.path.join('foo', 'bar')) self.fs.Repository('bar/foo') self.fs.Repository('bar') expect = [ '.', self.rep1, self.rep2, self.rep3, 'foo', os.path.join('foo', 'bar'), os.path.join('bar', 'foo'), 'bar' ] rep = self.fs.Dir('#').get_all_rdirs() r = [os.path.normpath(str(x)) for x in rep] assert r == expect, r def test_rentry(self): """Test the Base.entry() method""" return_true = lambda: 1 return_false = lambda: 0 d1 = self.fs.Dir('d1') d2 = self.fs.Dir('d2') d3 = self.fs.Dir('d3') e1 = self.fs.Entry('e1') e2 = self.fs.Entry('e2') e3 = self.fs.Entry('e3') f1 = self.fs.File('f1') f2 = self.fs.File('f2') f3 = self.fs.File('f3') self.test.write([self.rep1, 'd2'], "") self.test.subdir([self.rep2, 'd3']) self.test.write([self.rep3, 'd3'], "") self.test.write([self.rep1, 'e2'], "") self.test.subdir([self.rep2, 'e3']) self.test.write([self.rep3, 'e3'], "") self.test.write([self.rep1, 'f2'], "") self.test.subdir([self.rep2, 'f3']) self.test.write([self.rep3, 'f3'], "") r = d1.rentry() assert r is d1, r r = d2.rentry() assert not r is d2, r r = str(r) assert r == os.path.join(self.rep1, 'd2'), r r = d3.rentry() assert not r is d3, r r = str(r) assert r == os.path.join(self.rep2, 'd3'), r r = e1.rentry() assert r is e1, r r = e2.rentry() assert not r is e2, r r = str(r) assert r == os.path.join(self.rep1, 'e2'), r r = e3.rentry() assert not r is e3, r r = str(r) assert r == os.path.join(self.rep2, 'e3'), r r = f1.rentry() assert r is f1, r r = f2.rentry() assert not r is f2, r r = str(r) assert r == os.path.join(self.rep1, 'f2'), r r = f3.rentry() assert not r is f3, r r = str(r) assert r == os.path.join(self.rep2, 'f3'), r def test_rdir(self): """Test the Dir.rdir() method""" def return_true(obj): return 1 def return_false(obj): return 0 SCons.Node._exists_map[5] = return_true SCons.Node._exists_map[6] = return_false SCons.Node._is_derived_map[2] = return_true SCons.Node._is_derived_map[3] = return_false d1 = self.fs.Dir('d1') d2 = self.fs.Dir('d2') d3 = self.fs.Dir('d3') self.test.subdir([self.rep1, 'd2']) self.test.write([self.rep2, 'd3'], "") self.test.subdir([self.rep3, 'd3']) r = d1.rdir() assert r is d1, r r = d2.rdir() assert not r is d2, r r = str(r) assert r == os.path.join(self.rep1, 'd2'), r r = d3.rdir() assert not r is d3, r r = str(r) assert r == os.path.join(self.rep3, 'd3'), r e1 = self.fs.Dir('e1') e1._func_exists = 6 e2 = self.fs.Dir('e2') e2._func_exists = 6 # Make sure we match entries in repositories, # regardless of whether they're derived or not. re1 = self.fs.Entry(os.path.join(self.rep1, 'e1')) re1._func_exists = 5 re1._func_is_derived = 2 re2 = self.fs.Entry(os.path.join(self.rep2, 'e2')) re2._func_exists = 5 re2._func_is_derived = 3 r = e1.rdir() assert r is re1, r r = e2.rdir() assert r is re2, r def test_rfile(self): """Test the File.rfile() method""" def return_true(obj): return 1 def return_false(obj): return 0 SCons.Node._exists_map[5] = return_true SCons.Node._exists_map[6] = return_false SCons.Node._is_derived_map[2] = return_true SCons.Node._is_derived_map[3] = return_false f1 = self.fs.File('f1') f2 = self.fs.File('f2') f3 = self.fs.File('f3') self.test.write([self.rep1, 'f2'], "") self.test.subdir([self.rep2, 'f3']) self.test.write([self.rep3, 'f3'], "") r = f1.rfile() assert r is f1, r r = f2.rfile() assert not r is f2, r r = str(r) assert r == os.path.join(self.rep1, 'f2'), r r = f3.rfile() assert not r is f3, r r = f3.rstr() assert r == os.path.join(self.rep3, 'f3'), r e1 = self.fs.File('e1') e1._func_exists = 6 e2 = self.fs.File('e2') e2._func_exists = 6 # Make sure we match entries in repositories, # regardless of whether they're derived or not. re1 = self.fs.Entry(os.path.join(self.rep1, 'e1')) re1._func_exists = 5 re1._func_is_derived = 2 re2 = self.fs.Entry(os.path.join(self.rep2, 'e2')) re2._func_exists = 5 re2._func_is_derived = 3 r = e1.rfile() assert r is re1, r r = e2.rfile() assert r is re2, r def test_Rfindalldirs(self): """Test the Rfindalldirs() methods""" fs = self.fs test = self.test d1 = fs.Dir('d1') d2 = fs.Dir('d2') rep1_d1 = fs.Dir(test.workpath('rep1', 'd1')) rep2_d1 = fs.Dir(test.workpath('rep2', 'd1')) rep3_d1 = fs.Dir(test.workpath('rep3', 'd1')) sub = fs.Dir('sub') sub_d1 = sub.Dir('d1') rep1_sub_d1 = fs.Dir(test.workpath('rep1', 'sub', 'd1')) rep2_sub_d1 = fs.Dir(test.workpath('rep2', 'sub', 'd1')) rep3_sub_d1 = fs.Dir(test.workpath('rep3', 'sub', 'd1')) r = fs.Top.Rfindalldirs((d1,)) assert r == [d1], list(map(str, r)) r = fs.Top.Rfindalldirs((d1, d2)) assert r == [d1, d2], list(map(str, r)) r = fs.Top.Rfindalldirs(('d1',)) assert r == [d1, rep1_d1, rep2_d1, rep3_d1], list(map(str, r)) r = fs.Top.Rfindalldirs(('#d1',)) assert r == [d1, rep1_d1, rep2_d1, rep3_d1], list(map(str, r)) r = sub.Rfindalldirs(('d1',)) assert r == [sub_d1, rep1_sub_d1, rep2_sub_d1, rep3_sub_d1], list(map(str, r)) r = sub.Rfindalldirs(('#d1',)) assert r == [d1, rep1_d1, rep2_d1, rep3_d1], list(map(str, r)) r = fs.Top.Rfindalldirs(('d1', d2)) assert r == [d1, rep1_d1, rep2_d1, rep3_d1, d2], list(map(str, r)) def test_rexists(self): """Test the Entry.rexists() method""" fs = self.fs test = self.test test.write([self.rep1, 'f2'], "") test.write([self.rep2, "i_exist"], "\n") test.write(["work", "i_exist_too"], "\n") fs.VariantDir('build', '.') f = fs.File(test.workpath("work", "i_do_not_exist")) assert not f.rexists() f = fs.File(test.workpath("work", "i_exist")) assert f.rexists() f = fs.File(test.workpath("work", "i_exist_too")) assert f.rexists() f1 = fs.File(os.path.join('build', 'f1')) assert not f1.rexists() f2 = fs.File(os.path.join('build', 'f2')) assert f2.rexists() def test_FAT_timestamps(self): """Test repository timestamps on FAT file systems""" fs = self.fs test = self.test test.write(["rep2", "tstamp"], "tstamp\n") try: # Okay, *this* manipulation accomodates Windows FAT file systems # that only have two-second granularity on their timestamps. # We round down the current time to the nearest even integer # value, subtract two to make sure the timestamp is not "now," # and then convert it back to a float. tstamp = float(int(time.time() // 2) * 2) - 2.0 os.utime(test.workpath("rep2", "tstamp"), (tstamp - 2.0, tstamp)) f = fs.File("tstamp") t = f.get_timestamp() assert t == tstamp, "expected %f, got %f" % (tstamp, t) finally: test.unlink(["rep2", "tstamp"]) def test_get_contents(self): """Ensure get_contents() returns binary contents from Repositories""" fs = self.fs test = self.test test.write(["rep3", "contents"], "Con\x1aTents\n") try: c = fs.File("contents").get_contents() assert c == bytearray("Con\x1aTents\n",'utf-8'), "got '%s'" % c finally: test.unlink(["rep3", "contents"]) def test_get_text_contents(self): """Ensure get_text_contents() returns text contents from Repositories""" fs = self.fs test = self.test # Use a test string that has a file terminator in it to make # sure we read the entire file, regardless of its contents. try: eval('test_string = u"Con\x1aTents\n"') except SyntaxError: import collections class FakeUnicodeString(collections.UserString): def encode(self, encoding): return str(self) test_string = FakeUnicodeString("Con\x1aTents\n") # Test with ASCII. test.write(["rep3", "contents"], test_string.encode('ascii')) try: c = fs.File("contents").get_text_contents() assert test_string == c, "got %s" % repr(c) finally: test.unlink(["rep3", "contents"]) # Test with utf-8 test.write(["rep3", "contents"], test_string.encode('utf-8')) try: c = fs.File("contents").get_text_contents() assert test_string == c, "got %s" % repr(c) finally: test.unlink(["rep3", "contents"]) # Test with utf-16 test.write(["rep3", "contents"], test_string.encode('utf-16')) try: c = fs.File("contents").get_text_contents() assert test_string == c, "got %s" % repr(c) finally: test.unlink(["rep3", "contents"]) #def test_is_up_to_date(self): class find_fileTestCase(unittest.TestCase): def runTest(self): """Testing find_file function""" test = TestCmd(workdir = '') test.write('./foo', 'Some file\n') test.write('./foo2', 'Another file\n') test.subdir('same') test.subdir('bar') test.write(['bar', 'on_disk'], 'Another file\n') test.write(['bar', 'same'], 'bar/same\n') fs = SCons.Node.FS.FS(test.workpath("")) # FS doesn't like the cwd to be something other than its root. os.chdir(test.workpath("")) node_derived = fs.File(test.workpath('bar/baz')) node_derived.builder_set(1) # Any non-zero value. node_pseudo = fs.File(test.workpath('pseudo')) node_pseudo.set_src_builder(1) # Any non-zero value. paths = tuple(map(fs.Dir, ['.', 'same', './bar'])) nodes = [SCons.Node.FS.find_file('foo', paths)] nodes.append(SCons.Node.FS.find_file('baz', paths)) nodes.append(SCons.Node.FS.find_file('pseudo', paths)) nodes.append(SCons.Node.FS.find_file('same', paths)) file_names = list(map(str, nodes)) file_names = list(map(os.path.normpath, file_names)) expect = ['./foo', './bar/baz', './pseudo', './bar/same'] expect = list(map(os.path.normpath, expect)) assert file_names == expect, file_names # Make sure we don't blow up if there's already a File in place # of a directory that we'd otherwise try to search. If this # is broken, we'll see an exception like "Tried to lookup File # 'bar/baz' as a Dir. SCons.Node.FS.find_file('baz/no_file_here', paths) import io save_sys_stdout = sys.stdout try: sio = io.StringIO() sys.stdout = sio SCons.Node.FS.find_file('foo2', paths, verbose="xyz") expect = " xyz: looking for 'foo2' in '.' ...\n" + \ " xyz: ... FOUND 'foo2' in '.'\n" c = sio.getvalue() assert c == expect, c sio = io.StringIO() sys.stdout = sio SCons.Node.FS.find_file('baz2', paths, verbose=1) expect = " find_file: looking for 'baz2' in '.' ...\n" + \ " find_file: looking for 'baz2' in 'same' ...\n" + \ " find_file: looking for 'baz2' in 'bar' ...\n" c = sio.getvalue() assert c == expect, c sio = io.StringIO() sys.stdout = sio SCons.Node.FS.find_file('on_disk', paths, verbose=1) expect = " find_file: looking for 'on_disk' in '.' ...\n" + \ " find_file: looking for 'on_disk' in 'same' ...\n" + \ " find_file: looking for 'on_disk' in 'bar' ...\n" + \ " find_file: ... FOUND 'on_disk' in 'bar'\n" c = sio.getvalue() assert c == expect, c finally: sys.stdout = save_sys_stdout class StringDirTestCase(unittest.TestCase): def runTest(self): """Test using a string as the second argument of File() and Dir()""" test = TestCmd(workdir = '') test.subdir('sub') fs = SCons.Node.FS.FS(test.workpath('')) d = fs.Dir('sub', '.') assert str(d) == 'sub', str(d) assert d.exists() f = fs.File('file', 'sub') assert str(f) == os.path.join('sub', 'file') assert not f.exists() class stored_infoTestCase(unittest.TestCase): def runTest(self): """Test how we store build information""" test = TestCmd(workdir = '') test.subdir('sub') fs = SCons.Node.FS.FS(test.workpath('')) d = fs.Dir('sub') f = fs.File('file1', d) bi = f.get_stored_info() assert hasattr(bi, 'ninfo') class MySConsign(object): class Null(object): def __init__(self): self.xyzzy = 7 def get_entry(self, name): return self.Null() def test_sconsign(node): return MySConsign() f = fs.File('file2', d) SCons.Node.FS._sconsign_map[2] = test_sconsign f.dir._func_sconsign = 2 bi = f.get_stored_info() assert bi.xyzzy == 7, bi class has_src_builderTestCase(unittest.TestCase): def runTest(self): """Test the has_src_builder() method""" test = TestCmd(workdir = '') fs = SCons.Node.FS.FS(test.workpath('')) os.chdir(test.workpath('')) test.subdir('sub1') sub1 = fs.Dir('sub1', '.') f1 = fs.File('f1', sub1) f2 = fs.File('f2', sub1) f3 = fs.File('f3', sub1) h = f1.has_src_builder() assert not h, h h = f1.has_builder() assert not h, h b1 = Builder(fs.File) sub1.set_src_builder(b1) test.write(['sub1', 'f2'], "sub1/f2\n") h = f1.has_src_builder() # cached from previous call assert not h, h h = f1.has_builder() # cached from previous call assert not h, h h = f2.has_src_builder() assert not h, h h = f2.has_builder() assert not h, h h = f3.has_src_builder() assert h, h h = f3.has_builder() assert h, h assert f3.builder is b1, f3.builder class prepareTestCase(unittest.TestCase): def runTest(self): """Test the prepare() method""" class MyFile(SCons.Node.FS.File): def _createDir(self, update=None): raise SCons.Errors.StopError def exists(self): return None fs = SCons.Node.FS.FS() file = MyFile('foo', fs.Dir('.'), fs) exc_caught = 0 try: file.prepare() except SCons.Errors.StopError: exc_caught = 1 assert exc_caught, "Should have caught a StopError." class MkdirAction(Action): def __init__(self, dir_made): self.dir_made = dir_made def __call__(self, target, source, env, executor=None): if executor: target = executor.get_all_targets() source = executor.get_all_sources() self.dir_made.extend(target) dir_made = [] new_dir = fs.Dir("new_dir") new_dir.builder = Builder(fs.Dir, action=MkdirAction(dir_made)) new_dir.reset_executor() xyz = fs.File(os.path.join("new_dir", "xyz")) xyz.set_state(SCons.Node.up_to_date) xyz.prepare() assert dir_made == [], dir_made xyz.set_state(0) xyz.prepare() assert dir_made[0].get_internal_path() == "new_dir", dir_made[0] dir = fs.Dir("dir") dir.prepare() class SConstruct_dirTestCase(unittest.TestCase): def runTest(self): """Test setting the SConstruct directory""" fs = SCons.Node.FS.FS() fs.set_SConstruct_dir(fs.Dir('xxx')) assert fs.SConstruct_dir.get_internal_path() == 'xxx' class CacheDirTestCase(unittest.TestCase): def test_get_cachedir_csig(self): fs = SCons.Node.FS.FS() f9 = fs.File('f9') r = f9.get_cachedir_csig() assert r == 'd41d8cd98f00b204e9800998ecf8427e', r class clearTestCase(unittest.TestCase): def runTest(self): """Test clearing FS nodes of cached data.""" fs = SCons.Node.FS.FS() test = TestCmd(workdir='') e = fs.Entry('e') assert not e.exists() assert not e.rexists() assert str(e) == 'e', str(d) e.clear() assert not e.exists() assert not e.rexists() assert str(e) == 'e', str(d) d = fs.Dir(test.workpath('d')) test.subdir('d') assert d.exists() assert d.rexists() assert str(d) == test.workpath('d'), str(d) fs.rename(test.workpath('d'), test.workpath('gone')) # Verify caching is active assert d.exists(), 'caching not active' assert d.rexists() assert str(d) == test.workpath('d'), str(d) # Now verify clear() resets the cache d.clear() assert not d.exists() assert not d.rexists() assert str(d) == test.workpath('d'), str(d) f = fs.File(test.workpath('f')) test.write(test.workpath('f'), 'file f') assert f.exists() assert f.rexists() assert str(f) == test.workpath('f'), str(f) # Verify caching is active test.unlink(test.workpath('f')) assert f.exists() assert f.rexists() assert str(f) == test.workpath('f'), str(f) # Now verify clear() resets the cache f.clear() assert not f.exists() assert not f.rexists() assert str(f) == test.workpath('f'), str(f) class disambiguateTestCase(unittest.TestCase): def runTest(self): """Test calling the disambiguate() method.""" test = TestCmd(workdir='') fs = SCons.Node.FS.FS() ddd = fs.Dir('ddd') d = ddd.disambiguate() assert d is ddd, d fff = fs.File('fff') f = fff.disambiguate() assert f is fff, f test.subdir('edir') test.write('efile', "efile\n") edir = fs.Entry(test.workpath('edir')) d = edir.disambiguate() assert d.__class__ is ddd.__class__, d.__class__ efile = fs.Entry(test.workpath('efile')) f = efile.disambiguate() assert f.__class__ is fff.__class__, f.__class__ test.subdir('build') test.subdir(['build', 'bdir']) test.write(['build', 'bfile'], "build/bfile\n") test.subdir('src') test.write(['src', 'bdir'], "src/bdir\n") test.subdir(['src', 'bfile']) test.subdir(['src', 'edir']) test.write(['src', 'efile'], "src/efile\n") fs.VariantDir(test.workpath('build'), test.workpath('src')) build_bdir = fs.Entry(test.workpath('build/bdir')) d = build_bdir.disambiguate() assert d is build_bdir, d assert d.__class__ is ddd.__class__, d.__class__ build_bfile = fs.Entry(test.workpath('build/bfile')) f = build_bfile.disambiguate() assert f is build_bfile, f assert f.__class__ is fff.__class__, f.__class__ build_edir = fs.Entry(test.workpath('build/edir')) d = build_edir.disambiguate() assert d.__class__ is ddd.__class__, d.__class__ build_efile = fs.Entry(test.workpath('build/efile')) f = build_efile.disambiguate() assert f.__class__ is fff.__class__, f.__class__ build_nonexistant = fs.Entry(test.workpath('build/nonexistant')) f = build_nonexistant.disambiguate() assert f.__class__ is fff.__class__, f.__class__ class postprocessTestCase(unittest.TestCase): def runTest(self): """Test calling the postprocess() method.""" fs = SCons.Node.FS.FS() e = fs.Entry('e') e.postprocess() d = fs.Dir('d') d.postprocess() f = fs.File('f') f.postprocess() class SpecialAttrTestCase(unittest.TestCase): def runTest(self): """Test special attributes of file nodes.""" test=TestCmd(workdir='') fs = SCons.Node.FS.FS(test.workpath('work')) f = fs.Entry('foo/bar/baz.blat').get_subst_proxy() s = str(f.dir) assert s == os.path.normpath('foo/bar'), s assert f.dir.is_literal(), f.dir for_sig = f.dir.for_signature() assert for_sig == 'bar', for_sig s = str(f.file) assert s == 'baz.blat', s assert f.file.is_literal(), f.file for_sig = f.file.for_signature() assert for_sig == 'baz.blat_file', for_sig s = str(f.base) assert s == os.path.normpath('foo/bar/baz'), s assert f.base.is_literal(), f.base for_sig = f.base.for_signature() assert for_sig == 'baz.blat_base', for_sig s = str(f.filebase) assert s == 'baz', s assert f.filebase.is_literal(), f.filebase for_sig = f.filebase.for_signature() assert for_sig == 'baz.blat_filebase', for_sig s = str(f.suffix) assert s == '.blat', s assert f.suffix.is_literal(), f.suffix for_sig = f.suffix.for_signature() assert for_sig == 'baz.blat_suffix', for_sig s = str(f.get_abspath()) assert s == test.workpath('work', 'foo', 'bar', 'baz.blat'), s assert f.abspath.is_literal(), f.abspath for_sig = f.abspath.for_signature() assert for_sig == 'baz.blat_abspath', for_sig s = str(f.posix) assert s == 'foo/bar/baz.blat', s assert f.posix.is_literal(), f.posix if f.posix != f: for_sig = f.posix.for_signature() assert for_sig == 'baz.blat_posix', for_sig s = str(f.windows) assert s == 'foo\\bar\\baz.blat', repr(s) assert f.windows.is_literal(), f.windows if f.windows != f: for_sig = f.windows.for_signature() assert for_sig == 'baz.blat_windows', for_sig # Deprecated synonym for the .windows suffix. s = str(f.win32) assert s == 'foo\\bar\\baz.blat', repr(s) assert f.win32.is_literal(), f.win32 if f.win32 != f: for_sig = f.win32.for_signature() assert for_sig == 'baz.blat_windows', for_sig # And now, combinations!!! s = str(f.srcpath.base) assert s == os.path.normpath('foo/bar/baz'), s s = str(f.srcpath.dir) assert s == str(f.srcdir), s s = str(f.srcpath.posix) assert s == 'foo/bar/baz.blat', s s = str(f.srcpath.windows) assert s == 'foo\\bar\\baz.blat', s s = str(f.srcpath.win32) assert s == 'foo\\bar\\baz.blat', s # Test what happens with VariantDir() fs.VariantDir('foo', 'baz') s = str(f.srcpath) assert s == os.path.normpath('baz/bar/baz.blat'), s assert f.srcpath.is_literal(), f.srcpath g = f.srcpath.get() assert isinstance(g, SCons.Node.FS.File), g.__class__ s = str(f.srcdir) assert s == os.path.normpath('baz/bar'), s assert f.srcdir.is_literal(), f.srcdir g = f.srcdir.get() assert isinstance(g, SCons.Node.FS.Dir), g.__class__ # And now what happens with VariantDir() + Repository() fs.Repository(test.workpath('repository')) f = fs.Entry('foo/sub/file.suffix').get_subst_proxy() test.subdir('repository', ['repository', 'baz'], ['repository', 'baz', 'sub']) rd = test.workpath('repository', 'baz', 'sub') rf = test.workpath('repository', 'baz', 'sub', 'file.suffix') test.write(rf, "\n") s = str(f.srcpath) assert s == os.path.normpath('baz/sub/file.suffix'), s assert f.srcpath.is_literal(), f.srcpath g = f.srcpath.get() # Gets disambiguated to SCons.Node.FS.File by get_subst_proxy(). assert isinstance(g, SCons.Node.FS.File), g.__class__ s = str(f.srcdir) assert s == os.path.normpath('baz/sub'), s assert f.srcdir.is_literal(), f.srcdir g = f.srcdir.get() assert isinstance(g, SCons.Node.FS.Dir), g.__class__ s = str(f.rsrcpath) assert s == rf, s assert f.rsrcpath.is_literal(), f.rsrcpath g = f.rsrcpath.get() assert isinstance(g, SCons.Node.FS.File), g.__class__ s = str(f.rsrcdir) assert s == rd, s assert f.rsrcdir.is_literal(), f.rsrcdir g = f.rsrcdir.get() assert isinstance(g, SCons.Node.FS.Dir), g.__class__ # Check that attempts to access non-existent attributes of the # subst proxy generate the right exceptions and messages. caught = None try: fs.Dir('ddd').get_subst_proxy().no_such_attr except AttributeError as e: assert str(e) == "Dir instance 'ddd' has no attribute 'no_such_attr'", e caught = 1 assert caught, "did not catch expected AttributeError" caught = None try: fs.Entry('eee').get_subst_proxy().no_such_attr except AttributeError as e: # Gets disambiguated to File instance by get_subst_proxy(). assert str(e) == "File instance 'eee' has no attribute 'no_such_attr'", e caught = 1 assert caught, "did not catch expected AttributeError" caught = None try: fs.File('fff').get_subst_proxy().no_such_attr except AttributeError as e: assert str(e) == "File instance 'fff' has no attribute 'no_such_attr'", e caught = 1 assert caught, "did not catch expected AttributeError" class SaveStringsTestCase(unittest.TestCase): def runTest(self): """Test caching string values of nodes.""" test=TestCmd(workdir='') def setup(fs): fs.Dir('src') fs.Dir('d0') fs.Dir('d1') d0_f = fs.File('d0/f') d1_f = fs.File('d1/f') d0_b = fs.File('d0/b') d1_b = fs.File('d1/b') d1_f.duplicate = 1 d1_b.duplicate = 1 d0_b.builder = 1 d1_b.builder = 1 return [d0_f, d1_f, d0_b, d1_b] def modify(nodes): d0_f, d1_f, d0_b, d1_b = nodes d1_f.duplicate = 0 d1_b.duplicate = 0 d0_b.builder = 0 d1_b.builder = 0 fs1 = SCons.Node.FS.FS(test.workpath('fs1')) nodes = setup(fs1) fs1.VariantDir('d0', 'src', duplicate=0) fs1.VariantDir('d1', 'src', duplicate=1) s = list(map(str, nodes)) expect = list(map(os.path.normpath, ['src/f', 'd1/f', 'd0/b', 'd1/b'])) assert s == expect, s modify(nodes) s = list(map(str, nodes)) expect = list(map(os.path.normpath, ['src/f', 'src/f', 'd0/b', 'd1/b'])) assert s == expect, s SCons.Node.FS.save_strings(1) fs2 = SCons.Node.FS.FS(test.workpath('fs2')) nodes = setup(fs2) fs2.VariantDir('d0', 'src', duplicate=0) fs2.VariantDir('d1', 'src', duplicate=1) s = list(map(str, nodes)) expect = list(map(os.path.normpath, ['src/f', 'd1/f', 'd0/b', 'd1/b'])) assert s == expect, s modify(nodes) s = list(map(str, nodes)) expect = list(map(os.path.normpath, ['src/f', 'd1/f', 'd0/b', 'd1/b'])) assert s == expect, 'node str() not cached: %s'%s class AbsolutePathTestCase(unittest.TestCase): def test_root_lookup_equivalence(self): """Test looking up /fff vs. fff in the / directory""" test=TestCmd(workdir='') fs = SCons.Node.FS.FS('/') save_cwd = os.getcwd() try: os.chdir('/') fff1 = fs.File('fff') fff2 = fs.File('/fff') assert fff1 is fff2, "fff and /fff returned different Nodes!" finally: os.chdir(save_cwd) if __name__ == "__main__": suite = unittest.TestSuite() suite.addTest(VariantDirTestCase()) suite.addTest(find_fileTestCase()) suite.addTest(StringDirTestCase()) suite.addTest(stored_infoTestCase()) suite.addTest(has_src_builderTestCase()) suite.addTest(prepareTestCase()) suite.addTest(SConstruct_dirTestCase()) suite.addTest(clearTestCase()) suite.addTest(disambiguateTestCase()) suite.addTest(postprocessTestCase()) suite.addTest(SpecialAttrTestCase()) suite.addTest(SaveStringsTestCase()) tclasses = [ AbsolutePathTestCase, BaseTestCase, CacheDirTestCase, DirTestCase, DirBuildInfoTestCase, DirNodeInfoTestCase, EntryTestCase, FileTestCase, FileBuildInfoTestCase, FileNodeInfoTestCase, FSTestCase, GlobTestCase, RepositoryTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Node/__init__.py0000664000175000017500000017020313160023041021534 0ustar bdbaddogbdbaddog"""SCons.Node The Node package for the SCons software construction utility. This is, in many ways, the heart of SCons. A Node is where we encapsulate all of the dependency information about any thing that SCons can build, or about any thing which SCons can use to build some other thing. The canonical "thing," of course, is a file, but a Node can also represent something remote (like a web page) or something completely abstract (like an Alias). Each specific type of "thing" is specifically represented by a subclass of the Node base class: Node.FS.File for files, Node.Alias for aliases, etc. Dependency information is kept here in the base class, and information specific to files/aliases/etc. is in the subclass. The goal, if we've done this correctly, is that any type of "thing" should be able to depend on any other type of "thing." """ from __future__ import print_function # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Node/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import collections import copy from itertools import chain import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Executor import SCons.Memoize import SCons.Util from SCons.Debug import Trace from SCons.compat import with_metaclass, NoSlotsPyPy print_duplicate = 0 def classname(obj): return str(obj.__class__).split('.')[-1] # Set to false if we're doing a dry run. There's more than one of these # little treats do_store_info = True # Node states # # These are in "priority" order, so that the maximum value for any # child/dependency of a node represents the state of that node if # it has no builder of its own. The canonical example is a file # system directory, which is only up to date if all of its children # were up to date. no_state = 0 pending = 1 executing = 2 up_to_date = 3 executed = 4 failed = 5 StateString = { 0 : "no_state", 1 : "pending", 2 : "executing", 3 : "up_to_date", 4 : "executed", 5 : "failed", } # controls whether implicit dependencies are cached: implicit_cache = 0 # controls whether implicit dep changes are ignored: implicit_deps_unchanged = 0 # controls whether the cached implicit deps are ignored: implicit_deps_changed = 0 # A variable that can be set to an interface-specific function be called # to annotate a Node with information about its creation. def do_nothing(node): pass Annotate = do_nothing # Gets set to 'True' if we're running in interactive mode. Is # currently used to release parts of a target's info during # clean builds and update runs (see release_target_info). interactive = False def is_derived_none(node): raise NotImplementedError def is_derived_node(node): """ Returns true if this node is derived (i.e. built). """ return node.has_builder() or node.side_effect _is_derived_map = {0 : is_derived_none, 1 : is_derived_node} def exists_none(node): raise NotImplementedError def exists_always(node): return 1 def exists_base(node): return node.stat() is not None def exists_entry(node): """Return if the Entry exists. Check the file system to see what we should turn into first. Assume a file if there's no directory.""" node.disambiguate() return _exists_map[node._func_exists](node) def exists_file(node): # Duplicate from source path if we are set up to do this. if node.duplicate and not node.is_derived() and not node.linked: src = node.srcnode() if src is not node: # At this point, src is meant to be copied in a variant directory. src = src.rfile() if src.get_abspath() != node.get_abspath(): if src.exists(): node.do_duplicate(src) # Can't return 1 here because the duplication might # not actually occur if the -n option is being used. else: # The source file does not exist. Make sure no old # copy remains in the variant directory. if print_duplicate: print("dup: no src for %s, unlinking old variant copy"%self) if exists_base(node) or node.islink(): node.fs.unlink(node.get_internal_path()) # Return None explicitly because the Base.exists() call # above will have cached its value if the file existed. return None return exists_base(node) _exists_map = {0 : exists_none, 1 : exists_always, 2 : exists_base, 3 : exists_entry, 4 : exists_file} def rexists_none(node): raise NotImplementedError def rexists_node(node): return node.exists() def rexists_base(node): return node.rfile().exists() _rexists_map = {0 : rexists_none, 1 : rexists_node, 2 : rexists_base} def get_contents_none(node): raise NotImplementedError def get_contents_entry(node): """Fetch the contents of the entry. Returns the exact binary contents of the file.""" try: node = node.disambiguate(must_exist=1) except SCons.Errors.UserError: # There was nothing on disk with which to disambiguate # this entry. Leave it as an Entry, but return a null # string so calls to get_contents() in emitters and the # like (e.g. in qt.py) don't have to disambiguate by hand # or catch the exception. return '' else: return _get_contents_map[node._func_get_contents](node) def get_contents_dir(node): """Return content signatures and names of all our children separated by new-lines. Ensure that the nodes are sorted.""" contents = [] for n in sorted(node.children(), key=lambda t: t.name): contents.append('%s %s\n' % (n.get_csig(), n.name)) return ''.join(contents) def get_contents_file(node): if not node.rexists(): return b'' fname = node.rfile().get_abspath() try: with open(fname, "rb") as fp: contents = fp.read() except EnvironmentError as e: if not e.filename: e.filename = fname raise return contents _get_contents_map = {0 : get_contents_none, 1 : get_contents_entry, 2 : get_contents_dir, 3 : get_contents_file} def target_from_source_none(node, prefix, suffix, splitext): raise NotImplementedError def target_from_source_base(node, prefix, suffix, splitext): return node.dir.Entry(prefix + splitext(node.name)[0] + suffix) _target_from_source_map = {0 : target_from_source_none, 1 : target_from_source_base} # # The new decider subsystem for Nodes # # We would set and overwrite the changed_since_last_build function # before, but for being able to use slots (less memory!) we now have # a dictionary of the different decider functions. Then in the Node # subclasses we simply store the index to the decider that should be # used by it. # # # First, the single decider functions # def changed_since_last_build_node(node, target, prev_ni): """ Must be overridden in a specific subclass to return True if this Node (a dependency) has changed since the last time it was used to build the specified target. prev_ni is this Node's state (for example, its file timestamp, length, maybe content signature) as of the last time the target was built. Note that this method is called through the dependency, not the target, because a dependency Node must be able to use its own logic to decide if it changed. For example, File Nodes need to obey if we're configured to use timestamps, but Python Value Nodes never use timestamps and always use the content. If this method were called through the target, then each Node's implementation of this method would have to have more complicated logic to handle all the different Node types on which it might depend. """ raise NotImplementedError def changed_since_last_build_alias(node, target, prev_ni): cur_csig = node.get_csig() try: return cur_csig != prev_ni.csig except AttributeError: return 1 def changed_since_last_build_entry(node, target, prev_ni): node.disambiguate() return _decider_map[node.changed_since_last_build](node, target, prev_ni) def changed_since_last_build_state_changed(node, target, prev_ni): return (node.state != SCons.Node.up_to_date) def decide_source(node, target, prev_ni): return target.get_build_env().decide_source(node, target, prev_ni) def decide_target(node, target, prev_ni): return target.get_build_env().decide_target(node, target, prev_ni) def changed_since_last_build_python(node, target, prev_ni): cur_csig = node.get_csig() try: return cur_csig != prev_ni.csig except AttributeError: return 1 # # Now, the mapping from indices to decider functions # _decider_map = {0 : changed_since_last_build_node, 1 : changed_since_last_build_alias, 2 : changed_since_last_build_entry, 3 : changed_since_last_build_state_changed, 4 : decide_source, 5 : decide_target, 6 : changed_since_last_build_python} do_store_info = True # # The new store_info subsystem for Nodes # # We would set and overwrite the store_info function # before, but for being able to use slots (less memory!) we now have # a dictionary of the different functions. Then in the Node # subclasses we simply store the index to the info method that should be # used by it. # # # First, the single info functions # def store_info_pass(node): pass def store_info_file(node): # Merge our build information into the already-stored entry. # This accommodates "chained builds" where a file that's a target # in one build (SConstruct file) is a source in a different build. # See test/chained-build.py for the use case. if do_store_info: node.dir.sconsign().store_info(node.name, node) store_info_map = {0 : store_info_pass, 1 : store_info_file} # Classes for signature info for Nodes. class NodeInfoBase(object): """ The generic base class for signature information for a Node. Node subclasses should subclass NodeInfoBase to provide their own logic for dealing with their own Node-specific signature information. """ __slots__ = ('__weakref__',) current_version_id = 2 def update(self, node): try: field_list = self.field_list except AttributeError: return for f in field_list: try: delattr(self, f) except AttributeError: pass try: func = getattr(node, 'get_' + f) except AttributeError: pass else: setattr(self, f, func()) def convert(self, node, val): pass def merge(self, other): """ Merge the fields of another object into this object. Already existing information is overwritten by the other instance's data. WARNING: If a '__dict__' slot is added, it should be updated instead of replaced. """ state = other.__getstate__() self.__setstate__(state) def format(self, field_list=None, names=0): if field_list is None: try: field_list = self.field_list except AttributeError: field_list = list(getattr(self, '__dict__', {}).keys()) for obj in type(self).mro(): for slot in getattr(obj, '__slots__', ()): if slot not in ('__weakref__', '__dict__'): field_list.append(slot) field_list.sort() fields = [] for field in field_list: try: f = getattr(self, field) except AttributeError: f = None f = str(f) if names: f = field + ': ' + f fields.append(f) return fields def __getstate__(self): """ Return all fields that shall be pickled. Walk the slots in the class hierarchy and add those to the state dictionary. If a '__dict__' slot is available, copy all entries to the dictionary. Also include the version id, which is fixed for all instances of a class. """ state = getattr(self, '__dict__', {}).copy() for obj in type(self).mro(): for name in getattr(obj,'__slots__',()): if hasattr(self, name): state[name] = getattr(self, name) state['_version_id'] = self.current_version_id try: del state['__weakref__'] except KeyError: pass return state def __setstate__(self, state): """ Restore the attributes from a pickled state. The version is discarded. """ # TODO check or discard version del state['_version_id'] for key, value in state.items(): if key not in ('__weakref__',): setattr(self, key, value) class BuildInfoBase(object): """ The generic base class for build information for a Node. This is what gets stored in a .sconsign file for each target file. It contains a NodeInfo instance for this node (signature information that's specific to the type of Node) and direct attributes for the generic build stuff we have to track: sources, explicit dependencies, implicit dependencies, and action information. """ __slots__ = ("bsourcesigs", "bdependsigs", "bimplicitsigs", "bactsig", "bsources", "bdepends", "bact", "bimplicit", "__weakref__") current_version_id = 2 def __init__(self): # Create an object attribute from the class attribute so it ends up # in the pickled data in the .sconsign file. self.bsourcesigs = [] self.bdependsigs = [] self.bimplicitsigs = [] self.bactsig = None def merge(self, other): """ Merge the fields of another object into this object. Already existing information is overwritten by the other instance's data. WARNING: If a '__dict__' slot is added, it should be updated instead of replaced. """ state = other.__getstate__() self.__setstate__(state) def __getstate__(self): """ Return all fields that shall be pickled. Walk the slots in the class hierarchy and add those to the state dictionary. If a '__dict__' slot is available, copy all entries to the dictionary. Also include the version id, which is fixed for all instances of a class. """ state = getattr(self, '__dict__', {}).copy() for obj in type(self).mro(): for name in getattr(obj,'__slots__',()): if hasattr(self, name): state[name] = getattr(self, name) state['_version_id'] = self.current_version_id try: del state['__weakref__'] except KeyError: pass return state def __setstate__(self, state): """ Restore the attributes from a pickled state. """ # TODO check or discard version del state['_version_id'] for key, value in state.items(): if key not in ('__weakref__',): setattr(self, key, value) class Node(object, with_metaclass(NoSlotsPyPy)): """The base Node class, for entities that we know how to build, or use to build other Nodes. """ __slots__ = ['sources', 'sources_set', '_specific_sources', 'depends', 'depends_set', 'ignore', 'ignore_set', 'prerequisites', 'implicit', 'waiting_parents', 'waiting_s_e', 'ref_count', 'wkids', 'env', 'state', 'precious', 'noclean', 'nocache', 'cached', 'always_build', 'includes', 'attributes', 'side_effect', 'side_effects', 'linked', '_memo', 'executor', 'binfo', 'ninfo', 'builder', 'is_explicit', 'implicit_set', 'changed_since_last_build', 'store_info', 'pseudo', '_tags', '_func_is_derived', '_func_exists', '_func_rexists', '_func_get_contents', '_func_target_from_source'] class Attrs(object): __slots__ = ('shared', '__dict__') def __init__(self): if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.Node') # Note that we no longer explicitly initialize a self.builder # attribute to None here. That's because the self.builder # attribute may be created on-the-fly later by a subclass (the # canonical example being a builder to fetch a file from a # source code system like CVS or Subversion). # Each list of children that we maintain is accompanied by a # dictionary used to look up quickly whether a node is already # present in the list. Empirical tests showed that it was # fastest to maintain them as side-by-side Node attributes in # this way, instead of wrapping up each list+dictionary pair in # a class. (Of course, we could always still do that in the # future if we had a good reason to...). self.sources = [] # source files used to build node self.sources_set = set() self._specific_sources = False self.depends = [] # explicit dependencies (from Depends) self.depends_set = set() self.ignore = [] # dependencies to ignore self.ignore_set = set() self.prerequisites = None self.implicit = None # implicit (scanned) dependencies (None means not scanned yet) self.waiting_parents = set() self.waiting_s_e = set() self.ref_count = 0 self.wkids = None # Kids yet to walk, when it's an array self.env = None self.state = no_state self.precious = None self.pseudo = False self.noclean = 0 self.nocache = 0 self.cached = 0 # is this node pulled from cache? self.always_build = None self.includes = None self.attributes = self.Attrs() # Generic place to stick information about the Node. self.side_effect = 0 # true iff this node is a side effect self.side_effects = [] # the side effects of building this target self.linked = 0 # is this node linked to the variant directory? self.changed_since_last_build = 0 self.store_info = 0 self._tags = None self._func_is_derived = 1 self._func_exists = 1 self._func_rexists = 1 self._func_get_contents = 0 self._func_target_from_source = 0 self.clear_memoized_values() # Let the interface in which the build engine is embedded # annotate this Node with its own info (like a description of # what line in what file created the node, for example). Annotate(self) def disambiguate(self, must_exist=None): return self def get_suffix(self): return '' @SCons.Memoize.CountMethodCall def get_build_env(self): """Fetch the appropriate Environment to build this node. """ try: return self._memo['get_build_env'] except KeyError: pass result = self.get_executor().get_build_env() self._memo['get_build_env'] = result return result def get_build_scanner_path(self, scanner): """Fetch the appropriate scanner path for this node.""" return self.get_executor().get_build_scanner_path(scanner) def set_executor(self, executor): """Set the action executor for this node.""" self.executor = executor def get_executor(self, create=1): """Fetch the action executor for this node. Create one if there isn't already one, and requested to do so.""" try: executor = self.executor except AttributeError: if not create: raise try: act = self.builder.action except AttributeError: executor = SCons.Executor.Null(targets=[self]) else: executor = SCons.Executor.Executor(act, self.env or self.builder.env, [self.builder.overrides], [self], self.sources) self.executor = executor return executor def executor_cleanup(self): """Let the executor clean up any cached information.""" try: executor = self.get_executor(create=None) except AttributeError: pass else: if executor is not None: executor.cleanup() def reset_executor(self): "Remove cached executor; forces recompute when needed." try: delattr(self, 'executor') except AttributeError: pass def push_to_cache(self): """Try to push a node into a cache """ pass def retrieve_from_cache(self): """Try to retrieve the node's content from a cache This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in built(). Returns true if the node was successfully retrieved. """ return 0 # # Taskmaster interface subsystem # def make_ready(self): """Get a Node ready for evaluation. This is called before the Taskmaster decides if the Node is up-to-date or not. Overriding this method allows for a Node subclass to be disambiguated if necessary, or for an implicit source builder to be attached. """ pass def prepare(self): """Prepare for this Node to be built. This is called after the Taskmaster has decided that the Node is out-of-date and must be rebuilt, but before actually calling the method to build the Node. This default implementation checks that explicit or implicit dependencies either exist or are derived, and initializes the BuildInfo structure that will hold the information about how this node is, uh, built. (The existence of source files is checked separately by the Executor, which aggregates checks for all of the targets built by a specific action.) Overriding this method allows for for a Node subclass to remove the underlying file from the file system. Note that subclass methods should call this base class method to get the child check and the BuildInfo structure. """ if self.depends is not None: for d in self.depends: if d.missing(): msg = "Explicit dependency `%s' not found, needed by target `%s'." raise SCons.Errors.StopError(msg % (d, self)) if self.implicit is not None: for i in self.implicit: if i.missing(): msg = "Implicit dependency `%s' not found, needed by target `%s'." raise SCons.Errors.StopError(msg % (i, self)) self.binfo = self.get_binfo() def build(self, **kw): """Actually build the node. This is called by the Taskmaster after it's decided that the Node is out-of-date and must be rebuilt, and after the prepare() method has gotten everything, uh, prepared. This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in built(). """ try: self.get_executor()(self, **kw) except SCons.Errors.BuildError as e: e.node = self raise def built(self): """Called just after this node is successfully built.""" # Clear the implicit dependency caches of any Nodes # waiting for this Node to be built. for parent in self.waiting_parents: parent.implicit = None self.clear() if self.pseudo: if self.exists(): raise SCons.Errors.UserError("Pseudo target " + str(self) + " must not exist") else: if not self.exists() and do_store_info: SCons.Warnings.warn(SCons.Warnings.TargetNotBuiltWarning, "Cannot find target " + str(self) + " after building") self.ninfo.update(self) def visited(self): """Called just after this node has been visited (with or without a build).""" try: binfo = self.binfo except AttributeError: # Apparently this node doesn't need build info, so # don't bother calculating or storing it. pass else: self.ninfo.update(self) SCons.Node.store_info_map[self.store_info](self) def release_target_info(self): """Called just after this node has been marked up-to-date or was built completely. This is where we try to release as many target node infos as possible for clean builds and update runs, in order to minimize the overall memory consumption. By purging attributes that aren't needed any longer after a Node (=File) got built, we don't have to care that much how many KBytes a Node actually requires...as long as we free the memory shortly afterwards. @see: built() and File.release_target_info() """ pass # # # def add_to_waiting_s_e(self, node): self.waiting_s_e.add(node) def add_to_waiting_parents(self, node): """ Returns the number of nodes added to our waiting parents list: 1 if we add a unique waiting parent, 0 if not. (Note that the returned values are intended to be used to increment a reference count, so don't think you can "clean up" this function by using True and False instead...) """ wp = self.waiting_parents if node in wp: return 0 wp.add(node) return 1 def postprocess(self): """Clean up anything we don't need to hang onto after we've been built.""" self.executor_cleanup() self.waiting_parents = set() def clear(self): """Completely clear a Node of all its cached state (so that it can be re-evaluated by interfaces that do continuous integration builds). """ # The del_binfo() call here isn't necessary for normal execution, # but is for interactive mode, where we might rebuild the same # target and need to start from scratch. self.del_binfo() self.clear_memoized_values() self.ninfo = self.new_ninfo() self.executor_cleanup() try: delattr(self, '_calculated_sig') except AttributeError: pass self.includes = None def clear_memoized_values(self): self._memo = {} def builder_set(self, builder): self.builder = builder try: del self.executor except AttributeError: pass def has_builder(self): """Return whether this Node has a builder or not. In Boolean tests, this turns out to be a *lot* more efficient than simply examining the builder attribute directly ("if node.builder: ..."). When the builder attribute is examined directly, it ends up calling __getattr__ for both the __len__ and __nonzero__ attributes on instances of our Builder Proxy class(es), generating a bazillion extra calls and slowing things down immensely. """ try: b = self.builder except AttributeError: # There was no explicit builder for this Node, so initialize # the self.builder attribute to None now. b = self.builder = None return b is not None def set_explicit(self, is_explicit): self.is_explicit = is_explicit def has_explicit_builder(self): """Return whether this Node has an explicit builder This allows an internal Builder created by SCons to be marked non-explicit, so that it can be overridden by an explicit builder that the user supplies (the canonical example being directories).""" try: return self.is_explicit except AttributeError: self.is_explicit = None return self.is_explicit def get_builder(self, default_builder=None): """Return the set builder, or a specified default value""" try: return self.builder except AttributeError: return default_builder multiple_side_effect_has_builder = has_builder def is_derived(self): """ Returns true if this node is derived (i.e. built). This should return true only for nodes whose path should be in the variant directory when duplicate=0 and should contribute their build signatures when they are used as source files to other derived files. For example: source with source builders are not derived in this sense, and hence should not return true. """ return _is_derived_map[self._func_is_derived](self) def alter_targets(self): """Return a list of alternate targets for this Node. """ return [], None def get_found_includes(self, env, scanner, path): """Return the scanned include lines (implicit dependencies) found in this node. The default is no implicit dependencies. We expect this method to be overridden by any subclass that can be scanned for implicit dependencies. """ return [] def get_implicit_deps(self, env, initial_scanner, path_func, kw = {}): """Return a list of implicit dependencies for this node. This method exists to handle recursive invocation of the scanner on the implicit dependencies returned by the scanner, if the scanner's recursive flag says that we should. """ nodes = [self] seen = set(nodes) dependencies = [] path_memo = {} root_node_scanner = self._get_scanner(env, initial_scanner, None, kw) while nodes: node = nodes.pop(0) scanner = node._get_scanner(env, initial_scanner, root_node_scanner, kw) if not scanner: continue try: path = path_memo[scanner] except KeyError: path = path_func(scanner) path_memo[scanner] = path included_deps = [x for x in node.get_found_includes(env, scanner, path) if x not in seen] if included_deps: dependencies.extend(included_deps) seen.update(included_deps) nodes.extend(scanner.recurse_nodes(included_deps)) return dependencies def _get_scanner(self, env, initial_scanner, root_node_scanner, kw): if initial_scanner: # handle explicit scanner case scanner = initial_scanner.select(self) else: # handle implicit scanner case scanner = self.get_env_scanner(env, kw) if scanner: scanner = scanner.select(self) if not scanner: # no scanner could be found for the given node's scanner key; # thus, make an attempt at using a default. scanner = root_node_scanner return scanner def get_env_scanner(self, env, kw={}): return env.get_scanner(self.scanner_key()) def get_target_scanner(self): return self.builder.target_scanner def get_source_scanner(self, node): """Fetch the source scanner for the specified node NOTE: "self" is the target being built, "node" is the source file for which we want to fetch the scanner. Implies self.has_builder() is true; again, expect to only be called from locations where this is already verified. This function may be called very often; it attempts to cache the scanner found to improve performance. """ scanner = None try: scanner = self.builder.source_scanner except AttributeError: pass if not scanner: # The builder didn't have an explicit scanner, so go look up # a scanner from env['SCANNERS'] based on the node's scanner # key (usually the file extension). scanner = self.get_env_scanner(self.get_build_env()) if scanner: scanner = scanner.select(node) return scanner def add_to_implicit(self, deps): if not hasattr(self, 'implicit') or self.implicit is None: self.implicit = [] self.implicit_set = set() self._children_reset() self._add_child(self.implicit, self.implicit_set, deps) def scan(self): """Scan this node's dependents for implicit dependencies.""" # Don't bother scanning non-derived files, because we don't # care what their dependencies are. # Don't scan again, if we already have scanned. if self.implicit is not None: return self.implicit = [] self.implicit_set = set() self._children_reset() if not self.has_builder(): return build_env = self.get_build_env() executor = self.get_executor() # Here's where we implement --implicit-cache. if implicit_cache and not implicit_deps_changed: implicit = self.get_stored_implicit() if implicit is not None: # We now add the implicit dependencies returned from the # stored .sconsign entry to have already been converted # to Nodes for us. (We used to run them through a # source_factory function here.) # Update all of the targets with them. This # essentially short-circuits an N*M scan of the # sources for each individual target, which is a hell # of a lot more efficient. for tgt in executor.get_all_targets(): tgt.add_to_implicit(implicit) if implicit_deps_unchanged or self.is_up_to_date(): return # one of this node's sources has changed, # so we must recalculate the implicit deps for all targets for tgt in executor.get_all_targets(): tgt.implicit = [] tgt.implicit_set = set() # Have the executor scan the sources. executor.scan_sources(self.builder.source_scanner) # If there's a target scanner, have the executor scan the target # node itself and associated targets that might be built. scanner = self.get_target_scanner() if scanner: executor.scan_targets(scanner) def scanner_key(self): return None def select_scanner(self, scanner): """Selects a scanner for this Node. This is a separate method so it can be overridden by Node subclasses (specifically, Node.FS.Dir) that *must* use their own Scanner and don't select one the Scanner.Selector that's configured for the target. """ return scanner.select(self) def env_set(self, env, safe=0): if safe and self.env: return self.env = env # # SIGNATURE SUBSYSTEM # NodeInfo = NodeInfoBase BuildInfo = BuildInfoBase def new_ninfo(self): ninfo = self.NodeInfo() return ninfo def get_ninfo(self): try: return self.ninfo except AttributeError: self.ninfo = self.new_ninfo() return self.ninfo def new_binfo(self): binfo = self.BuildInfo() return binfo def get_binfo(self): """ Fetch a node's build information. node - the node whose sources will be collected cache - alternate node to use for the signature cache returns - the build signature This no longer handles the recursive descent of the node's children's signatures. We expect that they're already built and updated by someone else, if that's what's wanted. """ try: return self.binfo except AttributeError: pass binfo = self.new_binfo() self.binfo = binfo executor = self.get_executor() ignore_set = self.ignore_set if self.has_builder(): binfo.bact = str(executor) binfo.bactsig = SCons.Util.MD5signature(executor.get_contents()) if self._specific_sources: sources = [ s for s in self.sources if not s in ignore_set] else: sources = executor.get_unignored_sources(self, self.ignore) seen = set() binfo.bsources = [s for s in sources if s not in seen and not seen.add(s)] binfo.bsourcesigs = [s.get_ninfo() for s in binfo.bsources] binfo.bdepends = self.depends binfo.bdependsigs = [d.get_ninfo() for d in self.depends if d not in ignore_set] binfo.bimplicit = self.implicit or [] binfo.bimplicitsigs = [i.get_ninfo() for i in binfo.bimplicit if i not in ignore_set] return binfo def del_binfo(self): """Delete the build info from this node.""" try: delattr(self, 'binfo') except AttributeError: pass def get_csig(self): try: return self.ninfo.csig except AttributeError: ninfo = self.get_ninfo() ninfo.csig = SCons.Util.MD5signature(self.get_contents()) return self.ninfo.csig def get_cachedir_csig(self): return self.get_csig() def get_stored_info(self): return None def get_stored_implicit(self): """Fetch the stored implicit dependencies""" return None # # # def set_precious(self, precious = 1): """Set the Node's precious value.""" self.precious = precious def set_pseudo(self, pseudo = True): """Set the Node's precious value.""" self.pseudo = pseudo def set_noclean(self, noclean = 1): """Set the Node's noclean value.""" # Make sure noclean is an integer so the --debug=stree # output in Util.py can use it as an index. self.noclean = noclean and 1 or 0 def set_nocache(self, nocache = 1): """Set the Node's nocache value.""" # Make sure nocache is an integer so the --debug=stree # output in Util.py can use it as an index. self.nocache = nocache and 1 or 0 def set_always_build(self, always_build = 1): """Set the Node's always_build value.""" self.always_build = always_build def exists(self): """Does this node exists?""" return _exists_map[self._func_exists](self) def rexists(self): """Does this node exist locally or in a repositiory?""" # There are no repositories by default: return _rexists_map[self._func_rexists](self) def get_contents(self): """Fetch the contents of the entry.""" return _get_contents_map[self._func_get_contents](self) def missing(self): return not self.is_derived() and \ not self.linked and \ not self.rexists() def remove(self): """Remove this Node: no-op by default.""" return None def add_dependency(self, depend): """Adds dependencies.""" try: self._add_child(self.depends, self.depends_set, depend) except TypeError as e: e = e.args[0] if SCons.Util.is_List(e): s = list(map(str, e)) else: s = str(e) raise SCons.Errors.UserError("attempted to add a non-Node dependency to %s:\n\t%s is a %s, not a Node" % (str(self), s, type(e))) def add_prerequisite(self, prerequisite): """Adds prerequisites""" if self.prerequisites is None: self.prerequisites = SCons.Util.UniqueList() self.prerequisites.extend(prerequisite) self._children_reset() def add_ignore(self, depend): """Adds dependencies to ignore.""" try: self._add_child(self.ignore, self.ignore_set, depend) except TypeError as e: e = e.args[0] if SCons.Util.is_List(e): s = list(map(str, e)) else: s = str(e) raise SCons.Errors.UserError("attempted to ignore a non-Node dependency of %s:\n\t%s is a %s, not a Node" % (str(self), s, type(e))) def add_source(self, source): """Adds sources.""" if self._specific_sources: return try: self._add_child(self.sources, self.sources_set, source) except TypeError as e: e = e.args[0] if SCons.Util.is_List(e): s = list(map(str, e)) else: s = str(e) raise SCons.Errors.UserError("attempted to add a non-Node as source of %s:\n\t%s is a %s, not a Node" % (str(self), s, type(e))) def _add_child(self, collection, set, child): """Adds 'child' to 'collection', first checking 'set' to see if it's already present.""" added = None for c in child: if c not in set: set.add(c) collection.append(c) added = 1 if added: self._children_reset() def set_specific_source(self, source): self.add_source(source) self._specific_sources = True def add_wkid(self, wkid): """Add a node to the list of kids waiting to be evaluated""" if self.wkids is not None: self.wkids.append(wkid) def _children_reset(self): self.clear_memoized_values() # We need to let the Executor clear out any calculated # build info that it's cached so we can re-calculate it. self.executor_cleanup() @SCons.Memoize.CountMethodCall def _children_get(self): try: return self._memo['_children_get'] except KeyError: pass # The return list may contain duplicate Nodes, especially in # source trees where there are a lot of repeated #includes # of a tangle of .h files. Profiling shows, however, that # eliminating the duplicates with a brute-force approach that # preserves the order (that is, something like: # # u = [] # for n in list: # if n not in u: # u.append(n)" # # takes more cycles than just letting the underlying methods # hand back cached values if a Node's information is requested # multiple times. (Other methods of removing duplicates, like # using dictionary keys, lose the order, and the only ordered # dictionary patterns I found all ended up using "not in" # internally anyway...) if self.ignore_set: iter = chain.from_iterable([_f for _f in [self.sources, self.depends, self.implicit] if _f]) children = [] for i in iter: if i not in self.ignore_set: children.append(i) else: children = self.all_children(scan=0) self._memo['_children_get'] = children return children def all_children(self, scan=1): """Return a list of all the node's direct children.""" if scan: self.scan() # The return list may contain duplicate Nodes, especially in # source trees where there are a lot of repeated #includes # of a tangle of .h files. Profiling shows, however, that # eliminating the duplicates with a brute-force approach that # preserves the order (that is, something like: # # u = [] # for n in list: # if n not in u: # u.append(n)" # # takes more cycles than just letting the underlying methods # hand back cached values if a Node's information is requested # multiple times. (Other methods of removing duplicates, like # using dictionary keys, lose the order, and the only ordered # dictionary patterns I found all ended up using "not in" # internally anyway...) return list(chain.from_iterable([_f for _f in [self.sources, self.depends, self.implicit] if _f])) def children(self, scan=1): """Return a list of the node's direct children, minus those that are ignored by this node.""" if scan: self.scan() return self._children_get() def set_state(self, state): self.state = state def get_state(self): return self.state def get_env(self): env = self.env if not env: import SCons.Defaults env = SCons.Defaults.DefaultEnvironment() return env def Decider(self, function): foundkey = None for k, v in _decider_map.items(): if v == function: foundkey = k break if not foundkey: foundkey = len(_decider_map) _decider_map[foundkey] = function self.changed_since_last_build = foundkey def Tag(self, key, value): """ Add a user-defined tag. """ if not self._tags: self._tags = {} self._tags[key] = value def GetTag(self, key): """ Return a user-defined tag. """ if not self._tags: return None return self._tags.get(key, None) def changed(self, node=None, allowcache=False): """ Returns if the node is up-to-date with respect to the BuildInfo stored last time it was built. The default behavior is to compare it against our own previously stored BuildInfo, but the stored BuildInfo from another Node (typically one in a Repository) can be used instead. Note that we now *always* check every dependency. We used to short-circuit the check by returning as soon as we detected any difference, but we now rely on checking every dependency to make sure that any necessary Node information (for example, the content signature of an #included .h file) is updated. The allowcache option was added for supporting the early release of the executor/builder structures, right after a File target was built. When set to true, the return value of this changed method gets cached for File nodes. Like this, the executor isn't needed any longer for subsequent calls to changed(). @see: FS.File.changed(), FS.File.release_target_info() """ t = 0 if t: Trace('changed(%s [%s], %s)' % (self, classname(self), node)) if node is None: node = self result = False bi = node.get_stored_info().binfo then = bi.bsourcesigs + bi.bdependsigs + bi.bimplicitsigs children = self.children() diff = len(children) - len(then) if diff: # The old and new dependency lists are different lengths. # This always indicates that the Node must be rebuilt. # We also extend the old dependency list with enough None # entries to equal the new dependency list, for the benefit # of the loop below that updates node information. then.extend([None] * diff) if t: Trace(': old %s new %s' % (len(then), len(children))) result = True for child, prev_ni in zip(children, then): if _decider_map[child.changed_since_last_build](child, self, prev_ni): if t: Trace(': %s changed' % child) result = True contents = self.get_executor().get_contents() if self.has_builder(): import SCons.Util newsig = SCons.Util.MD5signature(contents) if bi.bactsig != newsig: if t: Trace(': bactsig %s != newsig %s' % (bi.bactsig, newsig)) result = True if not result: if t: Trace(': up to date') if t: Trace('\n') return result def is_up_to_date(self): """Default check for whether the Node is current: unknown Node subtypes are always out of date, so they will always get built.""" return None def children_are_up_to_date(self): """Alternate check for whether the Node is current: If all of our children were up-to-date, then this Node was up-to-date, too. The SCons.Node.Alias and SCons.Node.Python.Value subclasses rebind their current() method to this method.""" # Allow the children to calculate their signatures. self.binfo = self.get_binfo() if self.always_build: return None state = 0 for kid in self.children(None): s = kid.get_state() if s and (not state or s > state): state = s return (state == 0 or state == SCons.Node.up_to_date) def is_literal(self): """Always pass the string representation of a Node to the command interpreter literally.""" return 1 def render_include_tree(self): """ Return a text representation, suitable for displaying to the user, of the include tree for the sources of this node. """ if self.is_derived(): env = self.get_build_env() if env: for s in self.sources: scanner = self.get_source_scanner(s) if scanner: path = self.get_build_scanner_path(scanner) else: path = None def f(node, env=env, scanner=scanner, path=path): return node.get_found_includes(env, scanner, path) return SCons.Util.render_tree(s, f, 1) else: return None def get_abspath(self): """ Return an absolute path to the Node. This will return simply str(Node) by default, but for Node types that have a concept of relative path, this might return something different. """ return str(self) def for_signature(self): """ Return a string representation of the Node that will always be the same for this particular Node, no matter what. This is by contrast to the __str__() method, which might, for instance, return a relative path for a file Node. The purpose of this method is to generate a value to be used in signature calculation for the command line used to build a target, and we use this method instead of str() to avoid unnecessary rebuilds. This method does not need to return something that would actually work in a command line; it can return any kind of nonsense, so long as it does not change. """ return str(self) def get_string(self, for_signature): """This is a convenience function designed primarily to be used in command generators (i.e., CommandGeneratorActions or Environment variables that are callable), which are called with a for_signature argument that is nonzero if the command generator is being called to generate a signature for the command line, which determines if we should rebuild or not. Such command generators should use this method in preference to str(Node) when converting a Node to a string, passing in the for_signature parameter, such that we will call Node.for_signature() or str(Node) properly, depending on whether we are calculating a signature or actually constructing a command line.""" if for_signature: return self.for_signature() return str(self) def get_subst_proxy(self): """ This method is expected to return an object that will function exactly like this Node, except that it implements any additional special features that we would like to be in effect for Environment variable substitution. The principle use is that some Nodes would like to implement a __getattr__() method, but putting that in the Node type itself has a tendency to kill performance. We instead put it in a proxy and return it from this method. It is legal for this method to return self if no new functionality is needed for Environment substitution. """ return self def explain(self): if not self.exists(): return "building `%s' because it doesn't exist\n" % self if self.always_build: return "rebuilding `%s' because AlwaysBuild() is specified\n" % self old = self.get_stored_info() if old is None: return None old = old.binfo old.prepare_dependencies() try: old_bkids = old.bsources + old.bdepends + old.bimplicit old_bkidsigs = old.bsourcesigs + old.bdependsigs + old.bimplicitsigs except AttributeError: return "Cannot explain why `%s' is being rebuilt: No previous build information found\n" % self new = self.get_binfo() new_bkids = new.bsources + new.bdepends + new.bimplicit new_bkidsigs = new.bsourcesigs + new.bdependsigs + new.bimplicitsigs osig = dict(list(zip(old_bkids, old_bkidsigs))) nsig = dict(list(zip(new_bkids, new_bkidsigs))) # The sources and dependencies we'll want to report are all stored # as relative paths to this target's directory, but we want to # report them relative to the top-level SConstruct directory, # so we only print them after running them through this lambda # to turn them into the right relative Node and then return # its string. def stringify( s, E=self.dir.Entry ) : if hasattr( s, 'dir' ) : return str(E(s)) return str(s) lines = [] removed = [x for x in old_bkids if not x in new_bkids] if removed: removed = list(map(stringify, removed)) fmt = "`%s' is no longer a dependency\n" lines.extend([fmt % s for s in removed]) for k in new_bkids: if not k in old_bkids: lines.append("`%s' is a new dependency\n" % stringify(k)) elif _decider_map[k.changed_since_last_build](k, self, osig[k]): lines.append("`%s' changed\n" % stringify(k)) if len(lines) == 0 and old_bkids != new_bkids: lines.append("the dependency order changed:\n" + "%sold: %s\n" % (' '*15, list(map(stringify, old_bkids))) + "%snew: %s\n" % (' '*15, list(map(stringify, new_bkids)))) if len(lines) == 0: def fmt_with_title(title, strlines): lines = strlines.split('\n') sep = '\n' + ' '*(15 + len(title)) return ' '*15 + title + sep.join(lines) + '\n' if old.bactsig != new.bactsig: if old.bact == new.bact: lines.append("the contents of the build action changed\n" + fmt_with_title('action: ', new.bact)) # lines.append("the contents of the build action changed [%s] [%s]\n"%(old.bactsig,new.bactsig) + # fmt_with_title('action: ', new.bact)) else: lines.append("the build action changed:\n" + fmt_with_title('old: ', old.bact) + fmt_with_title('new: ', new.bact)) if len(lines) == 0: return "rebuilding `%s' for unknown reasons\n" % self preamble = "rebuilding `%s' because" % self if len(lines) == 1: return "%s %s" % (preamble, lines[0]) else: lines = ["%s:\n" % preamble] + lines return ( ' '*11).join(lines) class NodeList(collections.UserList): def __str__(self): return str(list(map(str, self.data))) def get_children(node, parent): return node.children() def ignore_cycle(node, stack): pass def do_nothing(node, parent): pass class Walker(object): """An iterator for walking a Node tree. This is depth-first, children are visited before the parent. The Walker object can be initialized with any node, and returns the next node on the descent with each get_next() call. 'kids_func' is an optional function that will be called to get the children of a node instead of calling 'children'. 'cycle_func' is an optional function that will be called when a cycle is detected. This class does not get caught in node cycles caused, for example, by C header file include loops. """ def __init__(self, node, kids_func=get_children, cycle_func=ignore_cycle, eval_func=do_nothing): self.kids_func = kids_func self.cycle_func = cycle_func self.eval_func = eval_func node.wkids = copy.copy(kids_func(node, None)) self.stack = [node] self.history = {} # used to efficiently detect and avoid cycles self.history[node] = None def get_next(self): """Return the next node for this walk of the tree. This function is intentionally iterative, not recursive, to sidestep any issues of stack size limitations. """ while self.stack: if self.stack[-1].wkids: node = self.stack[-1].wkids.pop(0) if not self.stack[-1].wkids: self.stack[-1].wkids = None if node in self.history: self.cycle_func(node, self.stack) else: node.wkids = copy.copy(self.kids_func(node, self.stack[-1])) self.stack.append(node) self.history[node] = None else: node = self.stack.pop() del self.history[node] if node: if self.stack: parent = self.stack[-1] else: parent = None self.eval_func(node, parent) return node return None def is_done(self): return not self.stack arg2nodes_lookups = [] # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Node/FS.py0000664000175000017500000036435713160023041020324 0ustar bdbaddogbdbaddog"""scons.Node.FS File system nodes. These Nodes represent the canonical external objects that people think of when they think of building software: files and directories. This holds a "default_fs" variable that should be initialized with an FS that can be used by scripts or modules looking for the canonical default. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function __revision__ = "src/engine/SCons/Node/FS.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import fnmatch import os import re import shutil import stat import sys import time import codecs import SCons.Action import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Errors import SCons.Memoize import SCons.Node import SCons.Node.Alias import SCons.Subst import SCons.Util import SCons.Warnings from SCons.Debug import Trace print_duplicate = 0 def sconsign_none(node): raise NotImplementedError def sconsign_dir(node): """Return the .sconsign file info for this directory, creating it first if necessary.""" if not node._sconsign: import SCons.SConsign node._sconsign = SCons.SConsign.ForDirectory(node) return node._sconsign _sconsign_map = {0 : sconsign_none, 1 : sconsign_dir} class EntryProxyAttributeError(AttributeError): """ An AttributeError subclass for recording and displaying the name of the underlying Entry involved in an AttributeError exception. """ def __init__(self, entry_proxy, attribute): AttributeError.__init__(self) self.entry_proxy = entry_proxy self.attribute = attribute def __str__(self): entry = self.entry_proxy.get() fmt = "%s instance %s has no attribute %s" return fmt % (entry.__class__.__name__, repr(entry.name), repr(self.attribute)) # The max_drift value: by default, use a cached signature value for # any file that's been untouched for more than two days. default_max_drift = 2*24*60*60 # # We stringify these file system Nodes a lot. Turning a file system Node # into a string is non-trivial, because the final string representation # can depend on a lot of factors: whether it's a derived target or not, # whether it's linked to a repository or source directory, and whether # there's duplication going on. The normal technique for optimizing # calculations like this is to memoize (cache) the string value, so you # only have to do the calculation once. # # A number of the above factors, however, can be set after we've already # been asked to return a string for a Node, because a Repository() or # VariantDir() call or the like may not occur until later in SConscript # files. So this variable controls whether we bother trying to save # string values for Nodes. The wrapper interface can set this whenever # they're done mucking with Repository and VariantDir and the other stuff, # to let this module know it can start returning saved string values # for Nodes. # Save_Strings = None def save_strings(val): global Save_Strings Save_Strings = val # # Avoid unnecessary function calls by recording a Boolean value that # tells us whether or not os.path.splitdrive() actually does anything # on this system, and therefore whether we need to bother calling it # when looking up path names in various methods below. # do_splitdrive = None _my_splitdrive =None def initialize_do_splitdrive(): global do_splitdrive global has_unc drive, path = os.path.splitdrive('X:/foo') has_unc = hasattr(os.path, 'splitunc') do_splitdrive = not not drive or has_unc global _my_splitdrive if has_unc: def splitdrive(p): if p[1:2] == ':': return p[:2], p[2:] if p[0:2] == '//': # Note that we leave a leading slash in the path # because UNC paths are always absolute. return '//', p[1:] return '', p else: def splitdrive(p): if p[1:2] == ':': return p[:2], p[2:] return '', p _my_splitdrive = splitdrive # Keep some commonly used values in global variables to skip to # module look-up costs. global OS_SEP global UNC_PREFIX global os_sep_is_slash OS_SEP = os.sep UNC_PREFIX = OS_SEP + OS_SEP os_sep_is_slash = OS_SEP == '/' initialize_do_splitdrive() # Used to avoid invoking os.path.normpath if not necessary. needs_normpath_check = re.compile( r''' # We need to renormalize the path if it contains any consecutive # '/' characters. .*// | # We need to renormalize the path if it contains a '..' directory. # Note that we check for all the following cases: # # a) The path is a single '..' # b) The path starts with '..'. E.g. '../' or '../moredirs' # but we not match '..abc/'. # c) The path ends with '..'. E.g. '/..' or 'dirs/..' # d) The path contains a '..' in the middle. # E.g. dirs/../moredirs (.*/)?\.\.(?:/|$) | # We need to renormalize the path if it contains a '.' # directory, but NOT if it is a single '.' '/' characters. We # do not want to match a single '.' because this case is checked # for explicitly since this is common enough case. # # Note that we check for all the following cases: # # a) We don't match a single '.' # b) We match if the path starts with '.'. E.g. './' or # './moredirs' but we not match '.abc/'. # c) We match if the path ends with '.'. E.g. '/.' or # 'dirs/.' # d) We match if the path contains a '.' in the middle. # E.g. dirs/./moredirs \./|.*/\.(?:/|$) ''', re.VERBOSE ) needs_normpath_match = needs_normpath_check.match # # SCons.Action objects for interacting with the outside world. # # The Node.FS methods in this module should use these actions to # create and/or remove files and directories; they should *not* use # os.{link,symlink,unlink,mkdir}(), etc., directly. # # Using these SCons.Action objects ensures that descriptions of these # external activities are properly displayed, that the displays are # suppressed when the -s (silent) option is used, and (most importantly) # the actions are disabled when the the -n option is used, in which case # there should be *no* changes to the external file system(s)... # # For Now disable hard & softlinks for win32 # PY3 supports them, but the rest of SCons is not ready for this # in some cases user permissions may be required. # TODO: See if theres a reasonable way to enable using links on win32/64 if hasattr(os, 'link') and sys.platform != 'win32': def _hardlink_func(fs, src, dst): # If the source is a symlink, we can't just hard-link to it # because a relative symlink may point somewhere completely # different. We must disambiguate the symlink and then # hard-link the final destination file. while fs.islink(src): link = fs.readlink(src) if not os.path.isabs(link): src = link else: src = os.path.join(os.path.dirname(src), link) fs.link(src, dst) else: _hardlink_func = None if hasattr(os, 'symlink') and sys.platform != 'win32': def _softlink_func(fs, src, dst): fs.symlink(src, dst) else: _softlink_func = None def _copy_func(fs, src, dest): shutil.copy2(src, dest) st = fs.stat(src) fs.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) Valid_Duplicates = ['hard-soft-copy', 'soft-hard-copy', 'hard-copy', 'soft-copy', 'copy'] Link_Funcs = [] # contains the callables of the specified duplication style def set_duplicate(duplicate): # Fill in the Link_Funcs list according to the argument # (discarding those not available on the platform). # Set up the dictionary that maps the argument names to the # underlying implementations. We do this inside this function, # not in the top-level module code, so that we can remap os.link # and os.symlink for testing purposes. link_dict = { 'hard' : _hardlink_func, 'soft' : _softlink_func, 'copy' : _copy_func } if not duplicate in Valid_Duplicates: raise SCons.Errors.InternalError("The argument of set_duplicate " "should be in Valid_Duplicates") global Link_Funcs Link_Funcs = [] for func in duplicate.split('-'): if link_dict[func]: Link_Funcs.append(link_dict[func]) def LinkFunc(target, source, env): # Relative paths cause problems with symbolic links, so # we use absolute paths, which may be a problem for people # who want to move their soft-linked src-trees around. Those # people should use the 'hard-copy' mode, softlinks cannot be # used for that; at least I have no idea how ... src = source[0].get_abspath() dest = target[0].get_abspath() dir, file = os.path.split(dest) if dir and not target[0].fs.isdir(dir): os.makedirs(dir) if not Link_Funcs: # Set a default order of link functions. set_duplicate('hard-soft-copy') fs = source[0].fs # Now link the files with the previously specified order. for func in Link_Funcs: try: func(fs, src, dest) break except (IOError, OSError): # An OSError indicates something happened like a permissions # problem or an attempt to symlink across file-system # boundaries. An IOError indicates something like the file # not existing. In either case, keeping trying additional # functions in the list and only raise an error if the last # one failed. if func == Link_Funcs[-1]: # exception of the last link method (copy) are fatal raise return 0 Link = SCons.Action.Action(LinkFunc, None) def LocalString(target, source, env): return 'Local copy of %s from %s' % (target[0], source[0]) LocalCopy = SCons.Action.Action(LinkFunc, LocalString) def UnlinkFunc(target, source, env): t = target[0] t.fs.unlink(t.get_abspath()) return 0 Unlink = SCons.Action.Action(UnlinkFunc, None) def MkdirFunc(target, source, env): t = target[0] if not t.exists(): t.fs.mkdir(t.get_abspath()) return 0 Mkdir = SCons.Action.Action(MkdirFunc, None, presub=None) MkdirBuilder = None def get_MkdirBuilder(): global MkdirBuilder if MkdirBuilder is None: import SCons.Builder import SCons.Defaults # "env" will get filled in by Executor.get_build_env() # calling SCons.Defaults.DefaultEnvironment() when necessary. MkdirBuilder = SCons.Builder.Builder(action = Mkdir, env = None, explain = None, is_explicit = None, target_scanner = SCons.Defaults.DirEntryScanner, name = "MkdirBuilder") return MkdirBuilder class _Null(object): pass _null = _Null() # Cygwin's os.path.normcase pretends it's on a case-sensitive filesystem. _is_cygwin = sys.platform == "cygwin" if os.path.normcase("TeSt") == os.path.normpath("TeSt") and not _is_cygwin: def _my_normcase(x): return x else: def _my_normcase(x): return x.upper() class DiskChecker(object): def __init__(self, type, do, ignore): self.type = type self.do = do self.ignore = ignore self.func = do def __call__(self, *args, **kw): return self.func(*args, **kw) def set(self, list): if self.type in list: self.func = self.do else: self.func = self.ignore def do_diskcheck_match(node, predicate, errorfmt): result = predicate() try: # If calling the predicate() cached a None value from stat(), # remove it so it doesn't interfere with later attempts to # build this Node as we walk the DAG. (This isn't a great way # to do this, we're reaching into an interface that doesn't # really belong to us, but it's all about performance, so # for now we'll just document the dependency...) if node._memo['stat'] is None: del node._memo['stat'] except (AttributeError, KeyError): pass if result: raise TypeError(errorfmt % node.get_abspath()) def ignore_diskcheck_match(node, predicate, errorfmt): pass diskcheck_match = DiskChecker('match', do_diskcheck_match, ignore_diskcheck_match) diskcheckers = [ diskcheck_match, ] def set_diskcheck(list): for dc in diskcheckers: dc.set(list) def diskcheck_types(): return [dc.type for dc in diskcheckers] class EntryProxy(SCons.Util.Proxy): __str__ = SCons.Util.Delegate('__str__') # In PY3 if a class defines __eq__, then it must explicitly provide # __hash__. Since SCons.Util.Proxy provides __eq__ we need the following # see: https://docs.python.org/3.1/reference/datamodel.html#object.__hash__ __hash__ = SCons.Util.Delegate('__hash__') def __get_abspath(self): entry = self.get() return SCons.Subst.SpecialAttrWrapper(entry.get_abspath(), entry.name + "_abspath") def __get_filebase(self): name = self.get().name return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(name)[0], name + "_filebase") def __get_suffix(self): name = self.get().name return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(name)[1], name + "_suffix") def __get_file(self): name = self.get().name return SCons.Subst.SpecialAttrWrapper(name, name + "_file") def __get_base_path(self): """Return the file's directory and file name, with the suffix stripped.""" entry = self.get() return SCons.Subst.SpecialAttrWrapper(SCons.Util.splitext(entry.get_path())[0], entry.name + "_base") def __get_posix_path(self): """Return the path with / as the path separator, regardless of platform.""" if os_sep_is_slash: return self else: entry = self.get() r = entry.get_path().replace(OS_SEP, '/') return SCons.Subst.SpecialAttrWrapper(r, entry.name + "_posix") def __get_windows_path(self): """Return the path with \ as the path separator, regardless of platform.""" if OS_SEP == '\\': return self else: entry = self.get() r = entry.get_path().replace(OS_SEP, '\\') return SCons.Subst.SpecialAttrWrapper(r, entry.name + "_windows") def __get_srcnode(self): return EntryProxy(self.get().srcnode()) def __get_srcdir(self): """Returns the directory containing the source node linked to this node via VariantDir(), or the directory of this node if not linked.""" return EntryProxy(self.get().srcnode().dir) def __get_rsrcnode(self): return EntryProxy(self.get().srcnode().rfile()) def __get_rsrcdir(self): """Returns the directory containing the source node linked to this node via VariantDir(), or the directory of this node if not linked.""" return EntryProxy(self.get().srcnode().rfile().dir) def __get_dir(self): return EntryProxy(self.get().dir) dictSpecialAttrs = { "base" : __get_base_path, "posix" : __get_posix_path, "windows" : __get_windows_path, "win32" : __get_windows_path, "srcpath" : __get_srcnode, "srcdir" : __get_srcdir, "dir" : __get_dir, "abspath" : __get_abspath, "filebase" : __get_filebase, "suffix" : __get_suffix, "file" : __get_file, "rsrcpath" : __get_rsrcnode, "rsrcdir" : __get_rsrcdir, } def __getattr__(self, name): # This is how we implement the "special" attributes # such as base, posix, srcdir, etc. try: attr_function = self.dictSpecialAttrs[name] except KeyError: try: attr = SCons.Util.Proxy.__getattr__(self, name) except AttributeError as e: # Raise our own AttributeError subclass with an # overridden __str__() method that identifies the # name of the entry that caused the exception. raise EntryProxyAttributeError(self, name) return attr else: return attr_function(self) class Base(SCons.Node.Node): """A generic class for file system entries. This class is for when we don't know yet whether the entry being looked up is a file or a directory. Instances of this class can morph into either Dir or File objects by a later, more precise lookup. Note: this class does not define __cmp__ and __hash__ for efficiency reasons. SCons does a lot of comparing of Node.FS.{Base,Entry,File,Dir} objects, so those operations must be as fast as possible, which means we want to use Python's built-in object identity comparisons. """ __slots__ = ['name', 'fs', '_abspath', '_labspath', '_path', '_tpath', '_path_elements', 'dir', 'cwd', 'duplicate', '_local', 'sbuilder', '_proxy', '_func_sconsign'] def __init__(self, name, directory, fs): """Initialize a generic Node.FS.Base object. Call the superclass initialization, take care of setting up our relative and absolute paths, identify our parent directory, and indicate that this node should use signatures.""" if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Base') SCons.Node.Node.__init__(self) # Filenames and paths are probably reused and are intern'ed to save some memory. # Filename with extension as it was specified when the object was # created; to obtain filesystem path, use Python str() function self.name = SCons.Util.silent_intern(name) self.fs = fs #: Reference to parent Node.FS object assert directory, "A directory must be provided" self._abspath = None self._labspath = None self._path = None self._tpath = None self._path_elements = None self.dir = directory self.cwd = None # will hold the SConscript directory for target nodes self.duplicate = directory.duplicate self.changed_since_last_build = 2 self._func_sconsign = 0 self._func_exists = 2 self._func_rexists = 2 self._func_get_contents = 0 self._func_target_from_source = 1 self.store_info = 1 def str_for_display(self): return '"' + self.__str__() + '"' def must_be_same(self, klass): """ This node, which already existed, is being looked up as the specified klass. Raise an exception if it isn't. """ if isinstance(self, klass) or klass is Entry: return raise TypeError("Tried to lookup %s '%s' as a %s." %\ (self.__class__.__name__, self.get_internal_path(), klass.__name__)) def get_dir(self): return self.dir def get_suffix(self): return SCons.Util.splitext(self.name)[1] def rfile(self): return self def __getattr__(self, attr): """ Together with the node_bwcomp dict defined below, this method provides a simple backward compatibility layer for the Node attributes 'abspath', 'labspath', 'path', 'tpath', 'suffix' and 'path_elements'. These Node attributes used to be directly available in v2.3 and earlier, but have been replaced by getter methods that initialize the single variables lazily when required, in order to save memory. The redirection to the getters lets older Tools and SConstruct continue to work without any additional changes, fully transparent to the user. Note, that __getattr__ is only called as fallback when the requested attribute can't be found, so there should be no speed performance penalty involved for standard builds. """ if attr in node_bwcomp: return node_bwcomp[attr](self) raise AttributeError("%r object has no attribute %r" % (self.__class__, attr)) def __str__(self): """A Node.FS.Base object's string representation is its path name.""" global Save_Strings if Save_Strings: return self._save_str() return self._get_str() def __lt__(self, other): """ less than operator used by sorting on py3""" return str(self) < str(other) @SCons.Memoize.CountMethodCall def _save_str(self): try: return self._memo['_save_str'] except KeyError: pass result = SCons.Util.silent_intern(self._get_str()) self._memo['_save_str'] = result return result def _get_str(self): global Save_Strings if self.duplicate or self.is_derived(): return self.get_path() srcnode = self.srcnode() if srcnode.stat() is None and self.stat() is not None: result = self.get_path() else: result = srcnode.get_path() if not Save_Strings: # We're not at the point where we're saving the string # representations of FS Nodes (because we haven't finished # reading the SConscript files and need to have str() return # things relative to them). That also means we can't yet # cache values returned (or not returned) by stat(), since # Python code in the SConscript files might still create # or otherwise affect the on-disk file. So get rid of the # values that the underlying stat() method saved. try: del self._memo['stat'] except KeyError: pass if self is not srcnode: try: del srcnode._memo['stat'] except KeyError: pass return result rstr = __str__ @SCons.Memoize.CountMethodCall def stat(self): try: return self._memo['stat'] except KeyError: pass try: result = self.fs.stat(self.get_abspath()) except os.error: result = None self._memo['stat'] = result return result def exists(self): return SCons.Node._exists_map[self._func_exists](self) def rexists(self): return SCons.Node._rexists_map[self._func_rexists](self) def getmtime(self): st = self.stat() if st: return st[stat.ST_MTIME] else: return None def getsize(self): st = self.stat() if st: return st[stat.ST_SIZE] else: return None def isdir(self): st = self.stat() return st is not None and stat.S_ISDIR(st[stat.ST_MODE]) def isfile(self): st = self.stat() return st is not None and stat.S_ISREG(st[stat.ST_MODE]) if hasattr(os, 'symlink'): def islink(self): try: st = self.fs.lstat(self.get_abspath()) except os.error: return 0 return stat.S_ISLNK(st[stat.ST_MODE]) else: def islink(self): return 0 # no symlinks def is_under(self, dir): if self is dir: return 1 else: return self.dir.is_under(dir) def set_local(self): self._local = 1 def srcnode(self): """If this node is in a build path, return the node corresponding to its source file. Otherwise, return ourself. """ srcdir_list = self.dir.srcdir_list() if srcdir_list: srcnode = srcdir_list[0].Entry(self.name) srcnode.must_be_same(self.__class__) return srcnode return self def get_path(self, dir=None): """Return path relative to the current working directory of the Node.FS.Base object that owns us.""" if not dir: dir = self.fs.getcwd() if self == dir: return '.' path_elems = self.get_path_elements() pathname = '' try: i = path_elems.index(dir) except ValueError: for p in path_elems[:-1]: pathname += p.dirname else: for p in path_elems[i+1:-1]: pathname += p.dirname return pathname + path_elems[-1].name def set_src_builder(self, builder): """Set the source code builder for this node.""" self.sbuilder = builder if not self.has_builder(): self.builder_set(builder) def src_builder(self): """Fetch the source code builder for this node. If there isn't one, we cache the source code builder specified for the directory (which in turn will cache the value from its parent directory, and so on up to the file system root). """ try: scb = self.sbuilder except AttributeError: scb = self.dir.src_builder() self.sbuilder = scb return scb def get_abspath(self): """Get the absolute path of the file.""" return self.dir.entry_abspath(self.name) def get_labspath(self): """Get the absolute path of the file.""" return self.dir.entry_labspath(self.name) def get_internal_path(self): if self.dir._path == '.': return self.name else: return self.dir.entry_path(self.name) def get_tpath(self): if self.dir._tpath == '.': return self.name else: return self.dir.entry_tpath(self.name) def get_path_elements(self): return self.dir._path_elements + [self] def for_signature(self): # Return just our name. Even an absolute path would not work, # because that can change thanks to symlinks or remapped network # paths. return self.name def get_subst_proxy(self): try: return self._proxy except AttributeError: ret = EntryProxy(self) self._proxy = ret return ret def target_from_source(self, prefix, suffix, splitext=SCons.Util.splitext): """ Generates a target entry that corresponds to this entry (usually a source file) with the specified prefix and suffix. Note that this method can be overridden dynamically for generated files that need different behavior. See Tool/swig.py for an example. """ return SCons.Node._target_from_source_map[self._func_target_from_source](self, prefix, suffix, splitext) def _Rfindalldirs_key(self, pathlist): return pathlist @SCons.Memoize.CountDictCall(_Rfindalldirs_key) def Rfindalldirs(self, pathlist): """ Return all of the directories for a given path list, including corresponding "backing" directories in any repositories. The Node lookups are relative to this Node (typically a directory), so memoizing result saves cycles from looking up the same path for each target in a given directory. """ try: memo_dict = self._memo['Rfindalldirs'] except KeyError: memo_dict = {} self._memo['Rfindalldirs'] = memo_dict else: try: return memo_dict[pathlist] except KeyError: pass create_dir_relative_to_self = self.Dir result = [] for path in pathlist: if isinstance(path, SCons.Node.Node): result.append(path) else: dir = create_dir_relative_to_self(path) result.extend(dir.get_all_rdirs()) memo_dict[pathlist] = result return result def RDirs(self, pathlist): """Search for a list of directories in the Repository list.""" cwd = self.cwd or self.fs._cwd return cwd.Rfindalldirs(pathlist) @SCons.Memoize.CountMethodCall def rentry(self): try: return self._memo['rentry'] except KeyError: pass result = self if not self.exists(): norm_name = _my_normcase(self.name) for dir in self.dir.get_all_rdirs(): try: node = dir.entries[norm_name] except KeyError: if dir.entry_exists_on_disk(self.name): result = dir.Entry(self.name) break self._memo['rentry'] = result return result def _glob1(self, pattern, ondisk=True, source=False, strings=False): return [] # Dict that provides a simple backward compatibility # layer for the Node attributes 'abspath', 'labspath', # 'path', 'tpath' and 'path_elements'. # @see Base.__getattr__ above node_bwcomp = {'abspath' : Base.get_abspath, 'labspath' : Base.get_labspath, 'path' : Base.get_internal_path, 'tpath' : Base.get_tpath, 'path_elements' : Base.get_path_elements, 'suffix' : Base.get_suffix} class Entry(Base): """This is the class for generic Node.FS entries--that is, things that could be a File or a Dir, but we're just not sure yet. Consequently, the methods in this class really exist just to transform their associated object into the right class when the time comes, and then call the same-named method in the transformed class.""" __slots__ = ['scanner_paths', 'cachedir_csig', 'cachesig', 'repositories', 'srcdir', 'entries', 'searched', '_sconsign', 'variant_dirs', 'root', 'dirname', 'on_disk_entries', 'released_target_info', 'contentsig'] def __init__(self, name, directory, fs): Base.__init__(self, name, directory, fs) self._func_exists = 3 self._func_get_contents = 1 def diskcheck_match(self): pass def disambiguate(self, must_exist=None): """ """ if self.isdir(): self.__class__ = Dir self._morph() elif self.isfile(): self.__class__ = File self._morph() self.clear() else: # There was nothing on-disk at this location, so look in # the src directory. # # We can't just use self.srcnode() straight away because # that would create an actual Node for this file in the src # directory, and there might not be one. Instead, use the # dir_on_disk() method to see if there's something on-disk # with that name, in which case we can go ahead and call # self.srcnode() to create the right type of entry. srcdir = self.dir.srcnode() if srcdir != self.dir and \ srcdir.entry_exists_on_disk(self.name) and \ self.srcnode().isdir(): self.__class__ = Dir self._morph() elif must_exist: msg = "No such file or directory: '%s'" % self.get_abspath() raise SCons.Errors.UserError(msg) else: self.__class__ = File self._morph() self.clear() return self def rfile(self): """We're a generic Entry, but the caller is actually looking for a File at this point, so morph into one.""" self.__class__ = File self._morph() self.clear() return File.rfile(self) def scanner_key(self): return self.get_suffix() def get_contents(self): """Fetch the contents of the entry. Returns the exact binary contents of the file.""" return SCons.Node._get_contents_map[self._func_get_contents](self) def get_text_contents(self): """Fetch the decoded text contents of a Unicode encoded Entry. Since this should return the text contents from the file system, we check to see into what sort of subclass we should morph this Entry.""" try: self = self.disambiguate(must_exist=1) except SCons.Errors.UserError: # There was nothing on disk with which to disambiguate # this entry. Leave it as an Entry, but return a null # string so calls to get_text_contents() in emitters and # the like (e.g. in qt.py) don't have to disambiguate by # hand or catch the exception. return '' else: return self.get_text_contents() def must_be_same(self, klass): """Called to make sure a Node is a Dir. Since we're an Entry, we can morph into one.""" if self.__class__ is not klass: self.__class__ = klass self._morph() self.clear() # The following methods can get called before the Taskmaster has # had a chance to call disambiguate() directly to see if this Entry # should really be a Dir or a File. We therefore use these to call # disambiguate() transparently (from our caller's point of view). # # Right now, this minimal set of methods has been derived by just # looking at some of the methods that will obviously be called early # in any of the various Taskmasters' calling sequences, and then # empirically figuring out which additional methods are necessary # to make various tests pass. def exists(self): return SCons.Node._exists_map[self._func_exists](self) def rel_path(self, other): d = self.disambiguate() if d.__class__ is Entry: raise Exception("rel_path() could not disambiguate File/Dir") return d.rel_path(other) def new_ninfo(self): return self.disambiguate().new_ninfo() def _glob1(self, pattern, ondisk=True, source=False, strings=False): return self.disambiguate()._glob1(pattern, ondisk, source, strings) def get_subst_proxy(self): return self.disambiguate().get_subst_proxy() # This is for later so we can differentiate between Entry the class and Entry # the method of the FS class. _classEntry = Entry class LocalFS(object): # This class implements an abstraction layer for operations involving # a local file system. Essentially, this wraps any function in # the os, os.path or shutil modules that we use to actually go do # anything with or to the local file system. # # Note that there's a very good chance we'll refactor this part of # the architecture in some way as we really implement the interface(s) # for remote file system Nodes. For example, the right architecture # might be to have this be a subclass instead of a base class. # Nevertheless, we're using this as a first step in that direction. # # We're not using chdir() yet because the calling subclass method # needs to use os.chdir() directly to avoid recursion. Will we # really need this one? #def chdir(self, path): # return os.chdir(path) def chmod(self, path, mode): return os.chmod(path, mode) def copy(self, src, dst): return shutil.copy(src, dst) def copy2(self, src, dst): return shutil.copy2(src, dst) def exists(self, path): return os.path.exists(path) def getmtime(self, path): return os.path.getmtime(path) def getsize(self, path): return os.path.getsize(path) def isdir(self, path): return os.path.isdir(path) def isfile(self, path): return os.path.isfile(path) def link(self, src, dst): return os.link(src, dst) def lstat(self, path): return os.lstat(path) def listdir(self, path): return os.listdir(path) def makedirs(self, path): return os.makedirs(path) def mkdir(self, path): return os.mkdir(path) def rename(self, old, new): return os.rename(old, new) def stat(self, path): return os.stat(path) def symlink(self, src, dst): return os.symlink(src, dst) def open(self, path): return open(path) def unlink(self, path): return os.unlink(path) if hasattr(os, 'symlink'): def islink(self, path): return os.path.islink(path) else: def islink(self, path): return 0 # no symlinks if hasattr(os, 'readlink'): def readlink(self, file): return os.readlink(file) else: def readlink(self, file): return '' class FS(LocalFS): def __init__(self, path = None): """Initialize the Node.FS subsystem. The supplied path is the top of the source tree, where we expect to find the top-level build file. If no path is supplied, the current directory is the default. The path argument must be a valid absolute path. """ if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS') self._memo = {} self.Root = {} self.SConstruct_dir = None self.max_drift = default_max_drift self.Top = None if path is None: self.pathTop = os.getcwd() else: self.pathTop = path self.defaultDrive = _my_normcase(_my_splitdrive(self.pathTop)[0]) self.Top = self.Dir(self.pathTop) self.Top._path = '.' self.Top._tpath = '.' self._cwd = self.Top DirNodeInfo.fs = self FileNodeInfo.fs = self def set_SConstruct_dir(self, dir): self.SConstruct_dir = dir def get_max_drift(self): return self.max_drift def set_max_drift(self, max_drift): self.max_drift = max_drift def getcwd(self): if hasattr(self, "_cwd"): return self._cwd else: return "" def chdir(self, dir, change_os_dir=0): """Change the current working directory for lookups. If change_os_dir is true, we will also change the "real" cwd to match. """ curr=self._cwd try: if dir is not None: self._cwd = dir if change_os_dir: os.chdir(dir.get_abspath()) except OSError: self._cwd = curr raise def get_root(self, drive): """ Returns the root directory for the specified drive, creating it if necessary. """ drive = _my_normcase(drive) try: return self.Root[drive] except KeyError: root = RootDir(drive, self) self.Root[drive] = root if not drive: self.Root[self.defaultDrive] = root elif drive == self.defaultDrive: self.Root[''] = root return root def _lookup(self, p, directory, fsclass, create=1): """ The generic entry point for Node lookup with user-supplied data. This translates arbitrary input into a canonical Node.FS object of the specified fsclass. The general approach for strings is to turn it into a fully normalized absolute path and then call the root directory's lookup_abs() method for the heavy lifting. If the path name begins with '#', it is unconditionally interpreted relative to the top-level directory of this FS. '#' is treated as a synonym for the top-level SConstruct directory, much like '~' is treated as a synonym for the user's home directory in a UNIX shell. So both '#foo' and '#/foo' refer to the 'foo' subdirectory underneath the top-level SConstruct directory. If the path name is relative, then the path is looked up relative to the specified directory, or the current directory (self._cwd, typically the SConscript directory) if the specified directory is None. """ if isinstance(p, Base): # It's already a Node.FS object. Make sure it's the right # class and return. p.must_be_same(fsclass) return p # str(p) in case it's something like a proxy object p = str(p) if not os_sep_is_slash: p = p.replace(OS_SEP, '/') if p[0:1] == '#': # There was an initial '#', so we strip it and override # whatever directory they may have specified with the # top-level SConstruct directory. p = p[1:] directory = self.Top # There might be a drive letter following the # '#'. Although it is not described in the SCons man page, # the regression test suite explicitly tests for that # syntax. It seems to mean the following thing: # # Assuming the the SCons top dir is in C:/xxx/yyy, # '#X:/toto' means X:/xxx/yyy/toto. # # i.e. it assumes that the X: drive has a directory # structure similar to the one found on drive C:. if do_splitdrive: drive, p = _my_splitdrive(p) if drive: root = self.get_root(drive) else: root = directory.root else: root = directory.root # We can only strip trailing after splitting the drive # since the drive might the UNC '//' prefix. p = p.strip('/') needs_normpath = needs_normpath_match(p) # The path is relative to the top-level SCons directory. if p in ('', '.'): p = directory.get_labspath() else: p = directory.get_labspath() + '/' + p else: if do_splitdrive: drive, p = _my_splitdrive(p) if drive and not p: # This causes a naked drive letter to be treated # as a synonym for the root directory on that # drive. p = '/' else: drive = '' # We can only strip trailing '/' since the drive might the # UNC '//' prefix. if p != '/': p = p.rstrip('/') needs_normpath = needs_normpath_match(p) if p[0:1] == '/': # Absolute path root = self.get_root(drive) else: # This is a relative lookup or to the current directory # (the path name is not absolute). Add the string to the # appropriate directory lookup path, after which the whole # thing gets normalized. if directory: if not isinstance(directory, Dir): directory = self.Dir(directory) else: directory = self._cwd if p in ('', '.'): p = directory.get_labspath() else: p = directory.get_labspath() + '/' + p if drive: root = self.get_root(drive) else: root = directory.root if needs_normpath is not None: # Normalize a pathname. Will return the same result for # equivalent paths. # # We take advantage of the fact that we have an absolute # path here for sure. In addition, we know that the # components of lookup path are separated by slashes at # this point. Because of this, this code is about 2X # faster than calling os.path.normpath() followed by # replacing os.sep with '/' again. ins = p.split('/')[1:] outs = [] for d in ins: if d == '..': try: outs.pop() except IndexError: pass elif d not in ('', '.'): outs.append(d) p = '/' + '/'.join(outs) return root._lookup_abs(p, fsclass, create) def Entry(self, name, directory = None, create = 1): """Look up or create a generic Entry node with the specified name. If the name is a relative path (begins with ./, ../, or a file name), then it is looked up relative to the supplied directory node, or to the top level directory of the FS (supplied at construction time) if no directory is supplied. """ return self._lookup(name, directory, Entry, create) def File(self, name, directory = None, create = 1): """Look up or create a File node with the specified name. If the name is a relative path (begins with ./, ../, or a file name), then it is looked up relative to the supplied directory node, or to the top level directory of the FS (supplied at construction time) if no directory is supplied. This method will raise TypeError if a directory is found at the specified path. """ return self._lookup(name, directory, File, create) def Dir(self, name, directory = None, create = True): """Look up or create a Dir node with the specified name. If the name is a relative path (begins with ./, ../, or a file name), then it is looked up relative to the supplied directory node, or to the top level directory of the FS (supplied at construction time) if no directory is supplied. This method will raise TypeError if a normal file is found at the specified path. """ return self._lookup(name, directory, Dir, create) def VariantDir(self, variant_dir, src_dir, duplicate=1): """Link the supplied variant directory to the source directory for purposes of building files.""" if not isinstance(src_dir, SCons.Node.Node): src_dir = self.Dir(src_dir) if not isinstance(variant_dir, SCons.Node.Node): variant_dir = self.Dir(variant_dir) if src_dir.is_under(variant_dir): raise SCons.Errors.UserError("Source directory cannot be under variant directory.") if variant_dir.srcdir: if variant_dir.srcdir == src_dir: return # We already did this. raise SCons.Errors.UserError("'%s' already has a source directory: '%s'."%(variant_dir, variant_dir.srcdir)) variant_dir.link(src_dir, duplicate) def Repository(self, *dirs): """Specify Repository directories to search.""" for d in dirs: if not isinstance(d, SCons.Node.Node): d = self.Dir(d) self.Top.addRepository(d) def PyPackageDir(self, modulename): """Locate the directory of a given python module name For example scons might resolve to Windows: C:\Python27\Lib\site-packages\scons-2.5.1 Linux: /usr/lib/scons This can be useful when we want to determine a toolpath based on a python module name""" dirpath = '' if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] in (0,1,2,3,4)): # Python2 Code import imp splitname = modulename.split('.') srchpths = sys.path for item in splitname: file, path, desc = imp.find_module(item, srchpths) if file is not None: path = os.path.dirname(path) srchpths = [path] dirpath = path else: # Python3 Code import importlib.util modspec = importlib.util.find_spec(modulename) dirpath = os.path.dirname(modspec.origin) return self._lookup(dirpath, None, Dir, True) def variant_dir_target_climb(self, orig, dir, tail): """Create targets in corresponding variant directories Climb the directory tree, and look up path names relative to any linked variant directories we find. Even though this loops and walks up the tree, we don't memoize the return value because this is really only used to process the command-line targets. """ targets = [] message = None fmt = "building associated VariantDir targets: %s" start_dir = dir while dir: for bd in dir.variant_dirs: if start_dir.is_under(bd): # If already in the build-dir location, don't reflect return [orig], fmt % str(orig) p = os.path.join(bd._path, *tail) targets.append(self.Entry(p)) tail = [dir.name] + tail dir = dir.up() if targets: message = fmt % ' '.join(map(str, targets)) return targets, message def Glob(self, pathname, ondisk=True, source=True, strings=False, exclude=None, cwd=None): """ Globs This is mainly a shim layer """ if cwd is None: cwd = self.getcwd() return cwd.glob(pathname, ondisk, source, strings, exclude) class DirNodeInfo(SCons.Node.NodeInfoBase): __slots__ = () # This should get reset by the FS initialization. current_version_id = 2 fs = None def str_to_node(self, s): top = self.fs.Top root = top.root if do_splitdrive: drive, s = _my_splitdrive(s) if drive: root = self.fs.get_root(drive) if not os.path.isabs(s): s = top.get_labspath() + '/' + s return root._lookup_abs(s, Entry) class DirBuildInfo(SCons.Node.BuildInfoBase): __slots__ = () current_version_id = 2 glob_magic_check = re.compile('[*?[]') def has_glob_magic(s): return glob_magic_check.search(s) is not None class Dir(Base): """A class for directories in a file system. """ __slots__ = ['scanner_paths', 'cachedir_csig', 'cachesig', 'repositories', 'srcdir', 'entries', 'searched', '_sconsign', 'variant_dirs', 'root', 'dirname', 'on_disk_entries', 'released_target_info', 'contentsig'] NodeInfo = DirNodeInfo BuildInfo = DirBuildInfo def __init__(self, name, directory, fs): if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Dir') Base.__init__(self, name, directory, fs) self._morph() def _morph(self): """Turn a file system Node (either a freshly initialized directory object or a separate Entry object) into a proper directory object. Set up this directory's entries and hook it into the file system tree. Specify that directories (this Node) don't use signatures for calculating whether they're current. """ self.repositories = [] self.srcdir = None self.entries = {} self.entries['.'] = self self.entries['..'] = self.dir self.cwd = self self.searched = 0 self._sconsign = None self.variant_dirs = [] self.root = self.dir.root self.changed_since_last_build = 3 self._func_sconsign = 1 self._func_exists = 2 self._func_get_contents = 2 self._abspath = SCons.Util.silent_intern(self.dir.entry_abspath(self.name)) self._labspath = SCons.Util.silent_intern(self.dir.entry_labspath(self.name)) if self.dir._path == '.': self._path = SCons.Util.silent_intern(self.name) else: self._path = SCons.Util.silent_intern(self.dir.entry_path(self.name)) if self.dir._tpath == '.': self._tpath = SCons.Util.silent_intern(self.name) else: self._tpath = SCons.Util.silent_intern(self.dir.entry_tpath(self.name)) self._path_elements = self.dir._path_elements + [self] # For directories, we make a difference between the directory # 'name' and the directory 'dirname'. The 'name' attribute is # used when we need to print the 'name' of the directory or # when we it is used as the last part of a path. The 'dirname' # is used when the directory is not the last element of the # path. The main reason for making that distinction is that # for RoorDir's the dirname can not be easily inferred from # the name. For example, we have to add a '/' after a drive # letter but not after a UNC path prefix ('//'). self.dirname = self.name + OS_SEP # Don't just reset the executor, replace its action list, # because it might have some pre-or post-actions that need to # be preserved. # # But don't reset the executor if there is a non-null executor # attached already. The existing executor might have other # targets, in which case replacing the action list with a # Mkdir action is a big mistake. if not hasattr(self, 'executor'): self.builder = get_MkdirBuilder() self.get_executor().set_action_list(self.builder.action) else: # Prepend MkdirBuilder action to existing action list l = self.get_executor().action_list a = get_MkdirBuilder().action l.insert(0, a) self.get_executor().set_action_list(l) def diskcheck_match(self): diskcheck_match(self, self.isfile, "File %s found where directory expected.") def __clearRepositoryCache(self, duplicate=None): """Called when we change the repository(ies) for a directory. This clears any cached information that is invalidated by changing the repository.""" for node in list(self.entries.values()): if node != self.dir: if node != self and isinstance(node, Dir): node.__clearRepositoryCache(duplicate) else: node.clear() try: del node._srcreps except AttributeError: pass if duplicate is not None: node.duplicate=duplicate def __resetDuplicate(self, node): if node != self: node.duplicate = node.get_dir().duplicate def Entry(self, name): """ Looks up or creates an entry node named 'name' relative to this directory. """ return self.fs.Entry(name, self) def Dir(self, name, create=True): """ Looks up or creates a directory node named 'name' relative to this directory. """ return self.fs.Dir(name, self, create) def File(self, name): """ Looks up or creates a file node named 'name' relative to this directory. """ return self.fs.File(name, self) def link(self, srcdir, duplicate): """Set this directory as the variant directory for the supplied source directory.""" self.srcdir = srcdir self.duplicate = duplicate self.__clearRepositoryCache(duplicate) srcdir.variant_dirs.append(self) def getRepositories(self): """Returns a list of repositories for this directory. """ if self.srcdir and not self.duplicate: return self.srcdir.get_all_rdirs() + self.repositories return self.repositories @SCons.Memoize.CountMethodCall def get_all_rdirs(self): try: return list(self._memo['get_all_rdirs']) except KeyError: pass result = [self] fname = '.' dir = self while dir: for rep in dir.getRepositories(): result.append(rep.Dir(fname)) if fname == '.': fname = dir.name else: fname = dir.name + OS_SEP + fname dir = dir.up() self._memo['get_all_rdirs'] = list(result) return result def addRepository(self, dir): if dir != self and not dir in self.repositories: self.repositories.append(dir) dir._tpath = '.' self.__clearRepositoryCache() def up(self): return self.dir def _rel_path_key(self, other): return str(other) @SCons.Memoize.CountDictCall(_rel_path_key) def rel_path(self, other): """Return a path to "other" relative to this directory. """ # This complicated and expensive method, which constructs relative # paths between arbitrary Node.FS objects, is no longer used # by SCons itself. It was introduced to store dependency paths # in .sconsign files relative to the target, but that ended up # being significantly inefficient. # # We're continuing to support the method because some SConstruct # files out there started using it when it was available, and # we're all about backwards compatibility.. try: memo_dict = self._memo['rel_path'] except KeyError: memo_dict = {} self._memo['rel_path'] = memo_dict else: try: return memo_dict[other] except KeyError: pass if self is other: result = '.' elif not other in self._path_elements: try: other_dir = other.get_dir() except AttributeError: result = str(other) else: if other_dir is None: result = other.name else: dir_rel_path = self.rel_path(other_dir) if dir_rel_path == '.': result = other.name else: result = dir_rel_path + OS_SEP + other.name else: i = self._path_elements.index(other) + 1 path_elems = ['..'] * (len(self._path_elements) - i) \ + [n.name for n in other._path_elements[i:]] result = OS_SEP.join(path_elems) memo_dict[other] = result return result def get_env_scanner(self, env, kw={}): import SCons.Defaults return SCons.Defaults.DirEntryScanner def get_target_scanner(self): import SCons.Defaults return SCons.Defaults.DirEntryScanner def get_found_includes(self, env, scanner, path): """Return this directory's implicit dependencies. We don't bother caching the results because the scan typically shouldn't be requested more than once (as opposed to scanning .h file contents, which can be requested as many times as the files is #included by other files). """ if not scanner: return [] # Clear cached info for this Dir. If we already visited this # directory on our walk down the tree (because we didn't know at # that point it was being used as the source for another Node) # then we may have calculated build signature before realizing # we had to scan the disk. Now that we have to, though, we need # to invalidate the old calculated signature so that any node # dependent on our directory structure gets one that includes # info about everything on disk. self.clear() return scanner(self, env, path) # # Taskmaster interface subsystem # def prepare(self): pass def build(self, **kw): """A null "builder" for directories.""" global MkdirBuilder if self.builder is not MkdirBuilder: SCons.Node.Node.build(self, **kw) # # # def _create(self): """Create this directory, silently and without worrying about whether the builder is the default or not.""" listDirs = [] parent = self while parent: if parent.exists(): break listDirs.append(parent) p = parent.up() if p is None: # Don't use while: - else: for this condition because # if so, then parent is None and has no .path attribute. raise SCons.Errors.StopError(parent._path) parent = p listDirs.reverse() for dirnode in listDirs: try: # Don't call dirnode.build(), call the base Node method # directly because we definitely *must* create this # directory. The dirnode.build() method will suppress # the build if it's the default builder. SCons.Node.Node.build(dirnode) dirnode.get_executor().nullify() # The build() action may or may not have actually # created the directory, depending on whether the -n # option was used or not. Delete the _exists and # _rexists attributes so they can be reevaluated. dirnode.clear() except OSError: pass def multiple_side_effect_has_builder(self): global MkdirBuilder return self.builder is not MkdirBuilder and self.has_builder() def alter_targets(self): """Return any corresponding targets in a variant directory. """ return self.fs.variant_dir_target_climb(self, self, []) def scanner_key(self): """A directory does not get scanned.""" return None def get_text_contents(self): """We already emit things in text, so just return the binary version.""" return self.get_contents() def get_contents(self): """Return content signatures and names of all our children separated by new-lines. Ensure that the nodes are sorted.""" return SCons.Node._get_contents_map[self._func_get_contents](self) def get_csig(self): """Compute the content signature for Directory nodes. In general, this is not needed and the content signature is not stored in the DirNodeInfo. However, if get_contents on a Dir node is called which has a child directory, the child directory should return the hash of its contents.""" contents = self.get_contents() return SCons.Util.MD5signature(contents) def do_duplicate(self, src): pass def is_up_to_date(self): """If any child is not up-to-date, then this directory isn't, either.""" if self.builder is not MkdirBuilder and not self.exists(): return 0 up_to_date = SCons.Node.up_to_date for kid in self.children(): if kid.get_state() > up_to_date: return 0 return 1 def rdir(self): if not self.exists(): norm_name = _my_normcase(self.name) for dir in self.dir.get_all_rdirs(): try: node = dir.entries[norm_name] except KeyError: node = dir.dir_on_disk(self.name) if node and node.exists() and \ (isinstance(dir, Dir) or isinstance(dir, Entry)): return node return self def sconsign(self): """Return the .sconsign file info for this directory. """ return _sconsign_map[self._func_sconsign](self) def srcnode(self): """Dir has a special need for srcnode()...if we have a srcdir attribute set, then that *is* our srcnode.""" if self.srcdir: return self.srcdir return Base.srcnode(self) def get_timestamp(self): """Return the latest timestamp from among our children""" stamp = 0 for kid in self.children(): if kid.get_timestamp() > stamp: stamp = kid.get_timestamp() return stamp def get_abspath(self): """Get the absolute path of the file.""" return self._abspath def get_labspath(self): """Get the absolute path of the file.""" return self._labspath def get_internal_path(self): return self._path def get_tpath(self): return self._tpath def get_path_elements(self): return self._path_elements def entry_abspath(self, name): return self._abspath + OS_SEP + name def entry_labspath(self, name): return self._labspath + '/' + name def entry_path(self, name): return self._path + OS_SEP + name def entry_tpath(self, name): return self._tpath + OS_SEP + name def entry_exists_on_disk(self, name): """ Searches through the file/dir entries of the current directory, and returns True if a physical entry with the given name could be found. @see rentry_exists_on_disk """ try: d = self.on_disk_entries except AttributeError: d = {} try: entries = os.listdir(self._abspath) except OSError: pass else: for entry in map(_my_normcase, entries): d[entry] = True self.on_disk_entries = d if sys.platform == 'win32' or sys.platform == 'cygwin': name = _my_normcase(name) result = d.get(name) if result is None: # Belt-and-suspenders for Windows: check directly for # 8.3 file names that don't show up in os.listdir(). result = os.path.exists(self._abspath + OS_SEP + name) d[name] = result return result else: return name in d def rentry_exists_on_disk(self, name): """ Searches through the file/dir entries of the current *and* all its remote directories (repos), and returns True if a physical entry with the given name could be found. The local directory (self) gets searched first, so repositories take a lower precedence regarding the searching order. @see entry_exists_on_disk """ rentry_exists = self.entry_exists_on_disk(name) if not rentry_exists: # Search through the repository folders norm_name = _my_normcase(name) for rdir in self.get_all_rdirs(): try: node = rdir.entries[norm_name] if node: rentry_exists = True break except KeyError: if rdir.entry_exists_on_disk(name): rentry_exists = True break return rentry_exists @SCons.Memoize.CountMethodCall def srcdir_list(self): try: return self._memo['srcdir_list'] except KeyError: pass result = [] dirname = '.' dir = self while dir: if dir.srcdir: result.append(dir.srcdir.Dir(dirname)) dirname = dir.name + OS_SEP + dirname dir = dir.up() self._memo['srcdir_list'] = result return result def srcdir_duplicate(self, name): for dir in self.srcdir_list(): if self.is_under(dir): # We shouldn't source from something in the build path; # variant_dir is probably under src_dir, in which case # we are reflecting. break if dir.entry_exists_on_disk(name): srcnode = dir.Entry(name).disambiguate() if self.duplicate: node = self.Entry(name).disambiguate() node.do_duplicate(srcnode) return node else: return srcnode return None def _srcdir_find_file_key(self, filename): return filename @SCons.Memoize.CountDictCall(_srcdir_find_file_key) def srcdir_find_file(self, filename): try: memo_dict = self._memo['srcdir_find_file'] except KeyError: memo_dict = {} self._memo['srcdir_find_file'] = memo_dict else: try: return memo_dict[filename] except KeyError: pass def func(node): if (isinstance(node, File) or isinstance(node, Entry)) and \ (node.is_derived() or node.exists()): return node return None norm_name = _my_normcase(filename) for rdir in self.get_all_rdirs(): try: node = rdir.entries[norm_name] except KeyError: node = rdir.file_on_disk(filename) else: node = func(node) if node: result = (node, self) memo_dict[filename] = result return result for srcdir in self.srcdir_list(): for rdir in srcdir.get_all_rdirs(): try: node = rdir.entries[norm_name] except KeyError: node = rdir.file_on_disk(filename) else: node = func(node) if node: result = (File(filename, self, self.fs), srcdir) memo_dict[filename] = result return result result = (None, None) memo_dict[filename] = result return result def dir_on_disk(self, name): if self.entry_exists_on_disk(name): try: return self.Dir(name) except TypeError: pass node = self.srcdir_duplicate(name) if isinstance(node, File): return None return node def file_on_disk(self, name): if self.entry_exists_on_disk(name): try: return self.File(name) except TypeError: pass node = self.srcdir_duplicate(name) if isinstance(node, Dir): return None return node def walk(self, func, arg): """ Walk this directory tree by calling the specified function for each directory in the tree. This behaves like the os.path.walk() function, but for in-memory Node.FS.Dir objects. The function takes the same arguments as the functions passed to os.path.walk(): func(arg, dirname, fnames) Except that "dirname" will actually be the directory *Node*, not the string. The '.' and '..' entries are excluded from fnames. The fnames list may be modified in-place to filter the subdirectories visited or otherwise impose a specific order. The "arg" argument is always passed to func() and may be used in any way (or ignored, passing None is common). """ entries = self.entries names = list(entries.keys()) names.remove('.') names.remove('..') func(arg, self, names) for dirname in [n for n in names if isinstance(entries[n], Dir)]: entries[dirname].walk(func, arg) def glob(self, pathname, ondisk=True, source=False, strings=False, exclude=None): """ Returns a list of Nodes (or strings) matching a specified pathname pattern. Pathname patterns follow UNIX shell semantics: * matches any-length strings of any characters, ? matches any character, and [] can enclose lists or ranges of characters. Matches do not span directory separators. The matches take into account Repositories, returning local Nodes if a corresponding entry exists in a Repository (either an in-memory Node or something on disk). By defafult, the glob() function matches entries that exist on-disk, in addition to in-memory Nodes. Setting the "ondisk" argument to False (or some other non-true value) causes the glob() function to only match in-memory Nodes. The default behavior is to return both the on-disk and in-memory Nodes. The "source" argument, when true, specifies that corresponding source Nodes must be returned if you're globbing in a build directory (initialized with VariantDir()). The default behavior is to return Nodes local to the VariantDir(). The "strings" argument, when true, returns the matches as strings, not Nodes. The strings are path names relative to this directory. The "exclude" argument, if not None, must be a pattern or a list of patterns following the same UNIX shell semantics. Elements matching a least one pattern of this list will be excluded from the result. The underlying algorithm is adapted from the glob.glob() function in the Python library (but heavily modified), and uses fnmatch() under the covers. """ dirname, basename = os.path.split(pathname) if not dirname: result = self._glob1(basename, ondisk, source, strings) else: if has_glob_magic(dirname): list = self.glob(dirname, ondisk, source, False, exclude) else: list = [self.Dir(dirname, create=True)] result = [] for dir in list: r = dir._glob1(basename, ondisk, source, strings) if strings: r = [os.path.join(str(dir), x) for x in r] result.extend(r) if exclude: excludes = [] excludeList = SCons.Util.flatten(exclude) for x in excludeList: r = self.glob(x, ondisk, source, strings) excludes.extend(r) result = [x for x in result if not any(fnmatch.fnmatch(str(x), str(e)) for e in SCons.Util.flatten(excludes))] return sorted(result, key=lambda a: str(a)) def _glob1(self, pattern, ondisk=True, source=False, strings=False): """ Globs for and returns a list of entry names matching a single pattern in this directory. This searches any repositories and source directories for corresponding entries and returns a Node (or string) relative to the current directory if an entry is found anywhere. TODO: handle pattern with no wildcard """ search_dir_list = self.get_all_rdirs() for srcdir in self.srcdir_list(): search_dir_list.extend(srcdir.get_all_rdirs()) selfEntry = self.Entry names = [] for dir in search_dir_list: # We use the .name attribute from the Node because the keys of # the dir.entries dictionary are normalized (that is, all upper # case) on case-insensitive systems like Windows. node_names = [ v.name for k, v in dir.entries.items() if k not in ('.', '..') ] names.extend(node_names) if not strings: # Make sure the working directory (self) actually has # entries for all Nodes in repositories or variant dirs. for name in node_names: selfEntry(name) if ondisk: try: disk_names = os.listdir(dir._abspath) except os.error: continue names.extend(disk_names) if not strings: # We're going to return corresponding Nodes in # the local directory, so we need to make sure # those Nodes exist. We only want to create # Nodes for the entries that will match the # specified pattern, though, which means we # need to filter the list here, even though # the overall list will also be filtered later, # after we exit this loop. if pattern[0] != '.': disk_names = [x for x in disk_names if x[0] != '.'] disk_names = fnmatch.filter(disk_names, pattern) dirEntry = dir.Entry for name in disk_names: # Add './' before disk filename so that '#' at # beginning of filename isn't interpreted. name = './' + name node = dirEntry(name).disambiguate() n = selfEntry(name) if n.__class__ != node.__class__: n.__class__ = node.__class__ n._morph() names = set(names) if pattern[0] != '.': names = [x for x in names if x[0] != '.'] names = fnmatch.filter(names, pattern) if strings: return names return [self.entries[_my_normcase(n)] for n in names] class RootDir(Dir): """A class for the root directory of a file system. This is the same as a Dir class, except that the path separator ('/' or '\\') is actually part of the name, so we don't need to add a separator when creating the path names of entries within this directory. """ __slots__ = ['_lookupDict'] def __init__(self, drive, fs): if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir') SCons.Node.Node.__init__(self) # Handle all the types of drives: if drive == '': # No drive, regular UNIX root or Windows default drive. name = OS_SEP dirname = OS_SEP elif drive == '//': # UNC path name = UNC_PREFIX dirname = UNC_PREFIX else: # Windows drive letter name = drive dirname = drive + OS_SEP # Filename with extension as it was specified when the object was # created; to obtain filesystem path, use Python str() function self.name = SCons.Util.silent_intern(name) self.fs = fs #: Reference to parent Node.FS object self._path_elements = [self] self.dir = self self._func_rexists = 2 self._func_target_from_source = 1 self.store_info = 1 # Now set our paths to what we really want them to be. The # name should already contain any necessary separators, such # as the initial drive letter (the name) plus the directory # separator, except for the "lookup abspath," which does not # have the drive letter. self._abspath = dirname self._labspath = '' self._path = dirname self._tpath = dirname self.dirname = dirname self._morph() self.duplicate = 0 self._lookupDict = {} self._lookupDict[''] = self self._lookupDict['/'] = self self.root = self # The // entry is necessary because os.path.normpath() # preserves double slashes at the beginning of a path on Posix # platforms. if not has_unc: self._lookupDict['//'] = self def _morph(self): """Turn a file system Node (either a freshly initialized directory object or a separate Entry object) into a proper directory object. Set up this directory's entries and hook it into the file system tree. Specify that directories (this Node) don't use signatures for calculating whether they're current. """ self.repositories = [] self.srcdir = None self.entries = {} self.entries['.'] = self self.entries['..'] = self.dir self.cwd = self self.searched = 0 self._sconsign = None self.variant_dirs = [] self.changed_since_last_build = 3 self._func_sconsign = 1 self._func_exists = 2 self._func_get_contents = 2 # Don't just reset the executor, replace its action list, # because it might have some pre-or post-actions that need to # be preserved. # # But don't reset the executor if there is a non-null executor # attached already. The existing executor might have other # targets, in which case replacing the action list with a # Mkdir action is a big mistake. if not hasattr(self, 'executor'): self.builder = get_MkdirBuilder() self.get_executor().set_action_list(self.builder.action) else: # Prepend MkdirBuilder action to existing action list l = self.get_executor().action_list a = get_MkdirBuilder().action l.insert(0, a) self.get_executor().set_action_list(l) def must_be_same(self, klass): if klass is Dir: return Base.must_be_same(self, klass) def _lookup_abs(self, p, klass, create=1): """ Fast (?) lookup of a *normalized* absolute path. This method is intended for use by internal lookups with already-normalized path data. For general-purpose lookups, use the FS.Entry(), FS.Dir() or FS.File() methods. The caller is responsible for making sure we're passed a normalized absolute path; we merely let Python's dictionary look up and return the One True Node.FS object for the path. If a Node for the specified "p" doesn't already exist, and "create" is specified, the Node may be created after recursive invocation to find or create the parent directory or directories. """ k = _my_normcase(p) try: result = self._lookupDict[k] except KeyError: if not create: msg = "No such file or directory: '%s' in '%s' (and create is False)" % (p, str(self)) raise SCons.Errors.UserError(msg) # There is no Node for this path name, and we're allowed # to create it. dir_name, file_name = p.rsplit('/',1) dir_node = self._lookup_abs(dir_name, Dir) result = klass(file_name, dir_node, self.fs) # Double-check on disk (as configured) that the Node we # created matches whatever is out there in the real world. result.diskcheck_match() self._lookupDict[k] = result dir_node.entries[_my_normcase(file_name)] = result dir_node.implicit = None else: # There is already a Node for this path name. Allow it to # complain if we were looking for an inappropriate type. result.must_be_same(klass) return result def __str__(self): return self._abspath def entry_abspath(self, name): return self._abspath + name def entry_labspath(self, name): return '/' + name def entry_path(self, name): return self._path + name def entry_tpath(self, name): return self._tpath + name def is_under(self, dir): if self is dir: return 1 else: return 0 def up(self): return None def get_dir(self): return None def src_builder(self): return _null class FileNodeInfo(SCons.Node.NodeInfoBase): __slots__ = ('csig', 'timestamp', 'size') current_version_id = 2 field_list = ['csig', 'timestamp', 'size'] # This should get reset by the FS initialization. fs = None def str_to_node(self, s): top = self.fs.Top root = top.root if do_splitdrive: drive, s = _my_splitdrive(s) if drive: root = self.fs.get_root(drive) if not os.path.isabs(s): s = top.get_labspath() + '/' + s return root._lookup_abs(s, Entry) def __getstate__(self): """ Return all fields that shall be pickled. Walk the slots in the class hierarchy and add those to the state dictionary. If a '__dict__' slot is available, copy all entries to the dictionary. Also include the version id, which is fixed for all instances of a class. """ state = getattr(self, '__dict__', {}).copy() for obj in type(self).mro(): for name in getattr(obj,'__slots__',()): if hasattr(self, name): state[name] = getattr(self, name) state['_version_id'] = self.current_version_id try: del state['__weakref__'] except KeyError: pass return state def __setstate__(self, state): """ Restore the attributes from a pickled state. """ # TODO check or discard version del state['_version_id'] for key, value in state.items(): if key not in ('__weakref__',): setattr(self, key, value) class FileBuildInfo(SCons.Node.BuildInfoBase): __slots__ = () current_version_id = 2 def convert_to_sconsign(self): """ Converts this FileBuildInfo object for writing to a .sconsign file This replaces each Node in our various dependency lists with its usual string representation: relative to the top-level SConstruct directory, or an absolute path if it's outside. """ if os_sep_is_slash: node_to_str = str else: def node_to_str(n): try: s = n.get_internal_path() except AttributeError: s = str(n) else: s = s.replace(OS_SEP, '/') return s for attr in ['bsources', 'bdepends', 'bimplicit']: try: val = getattr(self, attr) except AttributeError: pass else: setattr(self, attr, list(map(node_to_str, val))) def convert_from_sconsign(self, dir, name): """ Converts a newly-read FileBuildInfo object for in-SCons use For normal up-to-date checking, we don't have any conversion to perform--but we're leaving this method here to make that clear. """ pass def prepare_dependencies(self): """ Prepares a FileBuildInfo object for explaining what changed The bsources, bdepends and bimplicit lists have all been stored on disk as paths relative to the top-level SConstruct directory. Convert the strings to actual Nodes (for use by the --debug=explain code and --implicit-cache). """ attrs = [ ('bsources', 'bsourcesigs'), ('bdepends', 'bdependsigs'), ('bimplicit', 'bimplicitsigs'), ] for (nattr, sattr) in attrs: try: strings = getattr(self, nattr) nodeinfos = getattr(self, sattr) except AttributeError: continue if strings is None or nodeinfos is None: continue nodes = [] for s, ni in zip(strings, nodeinfos): if not isinstance(s, SCons.Node.Node): s = ni.str_to_node(s) nodes.append(s) setattr(self, nattr, nodes) def format(self, names=0): result = [] bkids = self.bsources + self.bdepends + self.bimplicit bkidsigs = self.bsourcesigs + self.bdependsigs + self.bimplicitsigs for bkid, bkidsig in zip(bkids, bkidsigs): result.append(str(bkid) + ': ' + ' '.join(bkidsig.format(names=names))) if not hasattr(self,'bact'): self.bact = "none" result.append('%s [%s]' % (self.bactsig, self.bact)) return '\n'.join(result) class File(Base): """A class for files in a file system. """ __slots__ = ['scanner_paths', 'cachedir_csig', 'cachesig', 'repositories', 'srcdir', 'entries', 'searched', '_sconsign', 'variant_dirs', 'root', 'dirname', 'on_disk_entries', 'released_target_info', 'contentsig'] NodeInfo = FileNodeInfo BuildInfo = FileBuildInfo md5_chunksize = 64 def diskcheck_match(self): diskcheck_match(self, self.isdir, "Directory %s found where file expected.") def __init__(self, name, directory, fs): if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.File') Base.__init__(self, name, directory, fs) self._morph() def Entry(self, name): """Create an entry node named 'name' relative to the directory of this file.""" return self.dir.Entry(name) def Dir(self, name, create=True): """Create a directory node named 'name' relative to the directory of this file.""" return self.dir.Dir(name, create=create) def Dirs(self, pathlist): """Create a list of directories relative to the SConscript directory of this file.""" return [self.Dir(p) for p in pathlist] def File(self, name): """Create a file node named 'name' relative to the directory of this file.""" return self.dir.File(name) def _morph(self): """Turn a file system node into a File object.""" self.scanner_paths = {} if not hasattr(self, '_local'): self._local = 0 if not hasattr(self, 'released_target_info'): self.released_target_info = False self.store_info = 1 self._func_exists = 4 self._func_get_contents = 3 # Initialize this Node's decider function to decide_source() because # every file is a source file until it has a Builder attached... self.changed_since_last_build = 4 # If there was already a Builder set on this entry, then # we need to make sure we call the target-decider function, # not the source-decider. Reaching in and doing this by hand # is a little bogus. We'd prefer to handle this by adding # an Entry.builder_set() method that disambiguates like the # other methods, but that starts running into problems with the # fragile way we initialize Dir Nodes with their Mkdir builders, # yet still allow them to be overridden by the user. Since it's # not clear right now how to fix that, stick with what works # until it becomes clear... if self.has_builder(): self.changed_since_last_build = 5 def scanner_key(self): return self.get_suffix() def get_contents(self): return SCons.Node._get_contents_map[self._func_get_contents](self) def get_text_contents(self): """ This attempts to figure out what the encoding of the text is based upon the BOM bytes, and then decodes the contents so that it's a valid python string. """ contents = self.get_contents() # The behavior of various decode() methods and functions # w.r.t. the initial BOM bytes is different for different # encodings and/or Python versions. ('utf-8' does not strip # them, but has a 'utf-8-sig' which does; 'utf-16' seems to # strip them; etc.) Just sidestep all the complication by # explicitly stripping the BOM before we decode(). if contents[:len(codecs.BOM_UTF8)] == codecs.BOM_UTF8: return contents[len(codecs.BOM_UTF8):].decode('utf-8') if contents[:len(codecs.BOM_UTF16_LE)] == codecs.BOM_UTF16_LE: return contents[len(codecs.BOM_UTF16_LE):].decode('utf-16-le') if contents[:len(codecs.BOM_UTF16_BE)] == codecs.BOM_UTF16_BE: return contents[len(codecs.BOM_UTF16_BE):].decode('utf-16-be') try: return contents.decode('utf-8') except UnicodeDecodeError as e: try: return contents.decode('latin-1') except UnicodeDecodeError as e: return contents.decode('utf-8', error='backslashreplace') def get_content_hash(self): """ Compute and return the MD5 hash for this file. """ if not self.rexists(): return SCons.Util.MD5signature('') fname = self.rfile().get_abspath() try: cs = SCons.Util.MD5filesignature(fname, chunksize=SCons.Node.FS.File.md5_chunksize*1024) except EnvironmentError as e: if not e.filename: e.filename = fname raise return cs @SCons.Memoize.CountMethodCall def get_size(self): try: return self._memo['get_size'] except KeyError: pass if self.rexists(): size = self.rfile().getsize() else: size = 0 self._memo['get_size'] = size return size @SCons.Memoize.CountMethodCall def get_timestamp(self): try: return self._memo['get_timestamp'] except KeyError: pass if self.rexists(): timestamp = self.rfile().getmtime() else: timestamp = 0 self._memo['get_timestamp'] = timestamp return timestamp convert_copy_attrs = [ 'bsources', 'bimplicit', 'bdepends', 'bact', 'bactsig', 'ninfo', ] convert_sig_attrs = [ 'bsourcesigs', 'bimplicitsigs', 'bdependsigs', ] def convert_old_entry(self, old_entry): # Convert a .sconsign entry from before the Big Signature # Refactoring, doing what we can to convert its information # to the new .sconsign entry format. # # The old format looked essentially like this: # # BuildInfo # .ninfo (NodeInfo) # .bsig # .csig # .timestamp # .size # .bsources # .bsourcesigs ("signature" list) # .bdepends # .bdependsigs ("signature" list) # .bimplicit # .bimplicitsigs ("signature" list) # .bact # .bactsig # # The new format looks like this: # # .ninfo (NodeInfo) # .bsig # .csig # .timestamp # .size # .binfo (BuildInfo) # .bsources # .bsourcesigs (NodeInfo list) # .bsig # .csig # .timestamp # .size # .bdepends # .bdependsigs (NodeInfo list) # .bsig # .csig # .timestamp # .size # .bimplicit # .bimplicitsigs (NodeInfo list) # .bsig # .csig # .timestamp # .size # .bact # .bactsig # # The basic idea of the new structure is that a NodeInfo always # holds all available information about the state of a given Node # at a certain point in time. The various .b*sigs lists can just # be a list of pointers to the .ninfo attributes of the different # dependent nodes, without any copying of information until it's # time to pickle it for writing out to a .sconsign file. # # The complicating issue is that the *old* format only stored one # "signature" per dependency, based on however the *last* build # was configured. We don't know from just looking at it whether # it was a build signature, a content signature, or a timestamp # "signature". Since we no longer use build signatures, the # best we can do is look at the length and if it's thirty two, # assume that it was (or might have been) a content signature. # If it was actually a build signature, then it will cause a # rebuild anyway when it doesn't match the new content signature, # but that's probably the best we can do. import SCons.SConsign new_entry = SCons.SConsign.SConsignEntry() new_entry.binfo = self.new_binfo() binfo = new_entry.binfo for attr in self.convert_copy_attrs: try: value = getattr(old_entry, attr) except AttributeError: continue setattr(binfo, attr, value) delattr(old_entry, attr) for attr in self.convert_sig_attrs: try: sig_list = getattr(old_entry, attr) except AttributeError: continue value = [] for sig in sig_list: ninfo = self.new_ninfo() if len(sig) == 32: ninfo.csig = sig else: ninfo.timestamp = sig value.append(ninfo) setattr(binfo, attr, value) delattr(old_entry, attr) return new_entry @SCons.Memoize.CountMethodCall def get_stored_info(self): try: return self._memo['get_stored_info'] except KeyError: pass try: sconsign_entry = self.dir.sconsign().get_entry(self.name) except (KeyError, EnvironmentError): import SCons.SConsign sconsign_entry = SCons.SConsign.SConsignEntry() sconsign_entry.binfo = self.new_binfo() sconsign_entry.ninfo = self.new_ninfo() else: if isinstance(sconsign_entry, FileBuildInfo): # This is a .sconsign file from before the Big Signature # Refactoring; convert it as best we can. sconsign_entry = self.convert_old_entry(sconsign_entry) try: delattr(sconsign_entry.ninfo, 'bsig') except AttributeError: pass self._memo['get_stored_info'] = sconsign_entry return sconsign_entry def get_stored_implicit(self): binfo = self.get_stored_info().binfo binfo.prepare_dependencies() try: return binfo.bimplicit except AttributeError: return None def rel_path(self, other): return self.dir.rel_path(other) def _get_found_includes_key(self, env, scanner, path): return (id(env), id(scanner), path) @SCons.Memoize.CountDictCall(_get_found_includes_key) def get_found_includes(self, env, scanner, path): """Return the included implicit dependencies in this file. Cache results so we only scan the file once per path regardless of how many times this information is requested. """ memo_key = (id(env), id(scanner), path) try: memo_dict = self._memo['get_found_includes'] except KeyError: memo_dict = {} self._memo['get_found_includes'] = memo_dict else: try: return memo_dict[memo_key] except KeyError: pass if scanner: result = [n.disambiguate() for n in scanner(self, env, path)] else: result = [] memo_dict[memo_key] = result return result def _createDir(self): # ensure that the directories for this node are # created. self.dir._create() def push_to_cache(self): """Try to push the node into a cache """ # This should get called before the Nodes' .built() method is # called, which would clear the build signature if the file has # a source scanner. # # We have to clear the local memoized values *before* we push # the node to cache so that the memoization of the self.exists() # return value doesn't interfere. if self.nocache: return self.clear_memoized_values() if self.exists(): self.get_build_env().get_CacheDir().push(self) def retrieve_from_cache(self): """Try to retrieve the node's content from a cache This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in built(). Returns true if the node was successfully retrieved. """ if self.nocache: return None if not self.is_derived(): return None return self.get_build_env().get_CacheDir().retrieve(self) def visited(self): if self.exists() and self.executor is not None: self.get_build_env().get_CacheDir().push_if_forced(self) ninfo = self.get_ninfo() csig = self.get_max_drift_csig() if csig: ninfo.csig = csig ninfo.timestamp = self.get_timestamp() ninfo.size = self.get_size() if not self.has_builder(): # This is a source file, but it might have been a target file # in another build that included more of the DAG. Copy # any build information that's stored in the .sconsign file # into our binfo object so it doesn't get lost. old = self.get_stored_info() self.get_binfo().merge(old.binfo) SCons.Node.store_info_map[self.store_info](self) def release_target_info(self): """Called just after this node has been marked up-to-date or was built completely. This is where we try to release as many target node infos as possible for clean builds and update runs, in order to minimize the overall memory consumption. We'd like to remove a lot more attributes like self.sources and self.sources_set, but they might get used in a next build step. For example, during configuration the source files for a built E{*}.o file are used to figure out which linker to use for the resulting Program (gcc vs. g++)! That's why we check for the 'keep_targetinfo' attribute, config Nodes and the Interactive mode just don't allow an early release of most variables. In the same manner, we can't simply remove the self.attributes here. The smart linking relies on the shared flag, and some parts of the java Tool use it to transport information about nodes... @see: built() and Node.release_target_info() """ if (self.released_target_info or SCons.Node.interactive): return if not hasattr(self.attributes, 'keep_targetinfo'): # Cache some required values, before releasing # stuff like env, executor and builder... self.changed(allowcache=True) self.get_contents_sig() self.get_build_env() # Now purge unneeded stuff to free memory... self.executor = None self._memo.pop('rfile', None) self.prerequisites = None # Cleanup lists, but only if they're empty if not len(self.ignore_set): self.ignore_set = None if not len(self.implicit_set): self.implicit_set = None if not len(self.depends_set): self.depends_set = None if not len(self.ignore): self.ignore = None if not len(self.depends): self.depends = None # Mark this node as done, we only have to release # the memory once... self.released_target_info = True def find_src_builder(self): if self.rexists(): return None scb = self.dir.src_builder() if scb is _null: scb = None if scb is not None: try: b = self.builder except AttributeError: b = None if b is None: self.builder_set(scb) return scb def has_src_builder(self): """Return whether this Node has a source builder or not. If this Node doesn't have an explicit source code builder, this is where we figure out, on the fly, if there's a transparent source code builder for it. Note that if we found a source builder, we also set the self.builder attribute, so that all of the methods that actually *build* this file don't have to do anything different. """ try: scb = self.sbuilder except AttributeError: scb = self.sbuilder = self.find_src_builder() return scb is not None def alter_targets(self): """Return any corresponding targets in a variant directory. """ if self.is_derived(): return [], None return self.fs.variant_dir_target_climb(self, self.dir, [self.name]) def _rmv_existing(self): self.clear_memoized_values() if SCons.Node.print_duplicate: print("dup: removing existing target {}".format(self)) e = Unlink(self, [], None) if isinstance(e, SCons.Errors.BuildError): raise e # # Taskmaster interface subsystem # def make_ready(self): self.has_src_builder() self.get_binfo() def prepare(self): """Prepare for this file to be created.""" SCons.Node.Node.prepare(self) if self.get_state() != SCons.Node.up_to_date: if self.exists(): if self.is_derived() and not self.precious: self._rmv_existing() else: try: self._createDir() except SCons.Errors.StopError as drive: raise SCons.Errors.StopError("No drive `{}' for target `{}'.".format(drive, self)) # # # def remove(self): """Remove this file.""" if self.exists() or self.islink(): self.fs.unlink(self.get_internal_path()) return 1 return None def do_duplicate(self, src): self._createDir() if SCons.Node.print_duplicate: print("dup: relinking variant '{}' from '{}'".format(self, src)) Unlink(self, None, None) e = Link(self, src, None) if isinstance(e, SCons.Errors.BuildError): raise SCons.Errors.StopError("Cannot duplicate `{}' in `{}': {}.".format(src.get_internal_path(), self.dir._path, e.errstr)) self.linked = 1 # The Link() action may or may not have actually # created the file, depending on whether the -n # option was used or not. Delete the _exists and # _rexists attributes so they can be reevaluated. self.clear() @SCons.Memoize.CountMethodCall def exists(self): try: return self._memo['exists'] except KeyError: pass result = SCons.Node._exists_map[self._func_exists](self) self._memo['exists'] = result return result # # SIGNATURE SUBSYSTEM # def get_max_drift_csig(self): """ Returns the content signature currently stored for this node if it's been unmodified longer than the max_drift value, or the max_drift value is 0. Returns None otherwise. """ old = self.get_stored_info() mtime = self.get_timestamp() max_drift = self.fs.max_drift if max_drift > 0: if (time.time() - mtime) > max_drift: try: n = old.ninfo if n.timestamp and n.csig and n.timestamp == mtime: return n.csig except AttributeError: pass elif max_drift == 0: try: return old.ninfo.csig except AttributeError: pass return None def get_csig(self): """ Generate a node's content signature, the digested signature of its content. node - the node cache - alternate node to use for the signature cache returns - the content signature """ ninfo = self.get_ninfo() try: return ninfo.csig except AttributeError: pass csig = self.get_max_drift_csig() if csig is None: try: if self.get_size() < SCons.Node.FS.File.md5_chunksize: contents = self.get_contents() else: csig = self.get_content_hash() except IOError: # This can happen if there's actually a directory on-disk, # which can be the case if they've disabled disk checks, # or if an action with a File target actually happens to # create a same-named directory by mistake. csig = '' else: if not csig: csig = SCons.Util.MD5signature(contents) ninfo.csig = csig return csig # # DECISION SUBSYSTEM # def builder_set(self, builder): SCons.Node.Node.builder_set(self, builder) self.changed_since_last_build = 5 def built(self): """Called just after this File node is successfully built. Just like for 'release_target_info' we try to release some more target node attributes in order to minimize the overall memory consumption. @see: release_target_info """ SCons.Node.Node.built(self) if (not SCons.Node.interactive and not hasattr(self.attributes, 'keep_targetinfo')): # Ensure that the build infos get computed and cached... SCons.Node.store_info_map[self.store_info](self) # ... then release some more variables. self._specific_sources = False self._labspath = None self._save_str() self.cwd = None self.scanner_paths = None def changed(self, node=None, allowcache=False): """ Returns if the node is up-to-date with respect to the BuildInfo stored last time it was built. For File nodes this is basically a wrapper around Node.changed(), but we allow the return value to get cached after the reference to the Executor got released in release_target_info(). @see: Node.changed() """ if node is None: try: return self._memo['changed'] except KeyError: pass has_changed = SCons.Node.Node.changed(self, node) if allowcache: self._memo['changed'] = has_changed return has_changed def changed_content(self, target, prev_ni): cur_csig = self.get_csig() try: return cur_csig != prev_ni.csig except AttributeError: return 1 def changed_state(self, target, prev_ni): return self.state != SCons.Node.up_to_date def changed_timestamp_then_content(self, target, prev_ni): if not self.changed_timestamp_match(target, prev_ni): try: self.get_ninfo().csig = prev_ni.csig except AttributeError: pass return False return self.changed_content(target, prev_ni) def changed_timestamp_newer(self, target, prev_ni): try: return self.get_timestamp() > target.get_timestamp() except AttributeError: return 1 def changed_timestamp_match(self, target, prev_ni): try: return self.get_timestamp() != prev_ni.timestamp except AttributeError: return 1 def is_up_to_date(self): T = 0 if T: Trace('is_up_to_date(%s):' % self) if not self.exists(): if T: Trace(' not self.exists():') # The file doesn't exist locally... r = self.rfile() if r != self: # ...but there is one in a Repository... if not self.changed(r): if T: Trace(' changed(%s):' % r) # ...and it's even up-to-date... if self._local: # ...and they'd like a local copy. e = LocalCopy(self, r, None) if isinstance(e, SCons.Errors.BuildError): raise SCons.Node.store_info_map[self.store_info](self) if T: Trace(' 1\n') return 1 self.changed() if T: Trace(' None\n') return None else: r = self.changed() if T: Trace(' self.exists(): %s\n' % r) return not r @SCons.Memoize.CountMethodCall def rfile(self): try: return self._memo['rfile'] except KeyError: pass result = self if not self.exists(): norm_name = _my_normcase(self.name) for dir in self.dir.get_all_rdirs(): try: node = dir.entries[norm_name] except KeyError: node = dir.file_on_disk(self.name) if node and node.exists() and \ (isinstance(node, File) or isinstance(node, Entry) \ or not node.is_derived()): result = node # Copy over our local attributes to the repository # Node so we identify shared object files in the # repository and don't assume they're static. # # This isn't perfect; the attribute would ideally # be attached to the object in the repository in # case it was built statically in the repository # and we changed it to shared locally, but that's # rarely the case and would only occur if you # intentionally used the same suffix for both # shared and static objects anyway. So this # should work well in practice. result.attributes = self.attributes break self._memo['rfile'] = result return result def rstr(self): return str(self.rfile()) def get_cachedir_csig(self): """ Fetch a Node's content signature for purposes of computing another Node's cachesig. This is a wrapper around the normal get_csig() method that handles the somewhat obscure case of using CacheDir with the -n option. Any files that don't exist would normally be "built" by fetching them from the cache, but the normal get_csig() method will try to open up the local file, which doesn't exist because the -n option meant we didn't actually pull the file from cachedir. But since the file *does* actually exist in the cachedir, we can use its contents for the csig. """ try: return self.cachedir_csig except AttributeError: pass cachedir, cachefile = self.get_build_env().get_CacheDir().cachepath(self) if not self.exists() and cachefile and os.path.exists(cachefile): self.cachedir_csig = SCons.Util.MD5filesignature(cachefile, \ SCons.Node.FS.File.md5_chunksize * 1024) else: self.cachedir_csig = self.get_csig() return self.cachedir_csig def get_contents_sig(self): """ A helper method for get_cachedir_bsig. It computes and returns the signature for this node's contents. """ try: return self.contentsig except AttributeError: pass executor = self.get_executor() result = self.contentsig = SCons.Util.MD5signature(executor.get_contents()) return result def get_cachedir_bsig(self): """ Return the signature for a cached file, including its children. It adds the path of the cached file to the cache signature, because multiple targets built by the same action will all have the same build signature, and we have to differentiate them somehow. """ try: return self.cachesig except AttributeError: pass # Collect signatures for all children children = self.children() sigs = [n.get_cachedir_csig() for n in children] # Append this node's signature... sigs.append(self.get_contents_sig()) # ...and it's path sigs.append(self.get_internal_path()) # Merge this all into a single signature result = self.cachesig = SCons.Util.MD5collect(sigs) return result default_fs = None def get_default_fs(): global default_fs if not default_fs: default_fs = FS() return default_fs class FileFinder(object): """ """ def __init__(self): self._memo = {} def filedir_lookup(self, p, fd=None): """ A helper method for find_file() that looks up a directory for a file we're trying to find. This only creates the Dir Node if it exists on-disk, since if the directory doesn't exist we know we won't find any files in it... :-) It would be more compact to just use this as a nested function with a default keyword argument (see the commented-out version below), but that doesn't work unless you have nested scopes, so we define it here just so this work under Python 1.5.2. """ if fd is None: fd = self.default_filedir dir, name = os.path.split(fd) drive, d = _my_splitdrive(dir) if not name and d[:1] in ('/', OS_SEP): #return p.fs.get_root(drive).dir_on_disk(name) return p.fs.get_root(drive) if dir: p = self.filedir_lookup(p, dir) if not p: return None norm_name = _my_normcase(name) try: node = p.entries[norm_name] except KeyError: return p.dir_on_disk(name) if isinstance(node, Dir): return node if isinstance(node, Entry): node.must_be_same(Dir) return node return None def _find_file_key(self, filename, paths, verbose=None): return (filename, paths) @SCons.Memoize.CountDictCall(_find_file_key) def find_file(self, filename, paths, verbose=None): """ Find a node corresponding to either a derived file or a file that exists already. Only the first file found is returned, and none is returned if no file is found. filename: A filename to find paths: A list of directory path *nodes* to search in. Can be represented as a list, a tuple, or a callable that is called with no arguments and returns the list or tuple. returns The node created from the found file. """ memo_key = self._find_file_key(filename, paths) try: memo_dict = self._memo['find_file'] except KeyError: memo_dict = {} self._memo['find_file'] = memo_dict else: try: return memo_dict[memo_key] except KeyError: pass if verbose and not callable(verbose): if not SCons.Util.is_String(verbose): verbose = "find_file" _verbose = u' %s: ' % verbose verbose = lambda s: sys.stdout.write(_verbose + s) filedir, filename = os.path.split(filename) if filedir: self.default_filedir = filedir paths = [_f for _f in map(self.filedir_lookup, paths) if _f] result = None for dir in paths: if verbose: verbose("looking for '%s' in '%s' ...\n" % (filename, dir)) node, d = dir.srcdir_find_file(filename) if node: if verbose: verbose("... FOUND '%s' in '%s'\n" % (filename, d)) result = node break memo_dict[memo_key] = result return result find_file = FileFinder().find_file def invalidate_node_memos(targets): """ Invalidate the memoized values of all Nodes (files or directories) that are associated with the given entries. Has been added to clear the cache of nodes affected by a direct execution of an action (e.g. Delete/Copy/Chmod). Existing Node caches become inconsistent if the action is run through Execute(). The argument `targets` can be a single Node object or filename, or a sequence of Nodes/filenames. """ from traceback import extract_stack # First check if the cache really needs to be flushed. Only # actions run in the SConscript with Execute() seem to be # affected. XXX The way to check if Execute() is in the stacktrace # is a very dirty hack and should be replaced by a more sensible # solution. for f in extract_stack(): if f[2] == 'Execute' and f[0][-14:] == 'Environment.py': break else: # Dont have to invalidate, so return return if not SCons.Util.is_List(targets): targets = [targets] for entry in targets: # If the target is a Node object, clear the cache. If it is a # filename, look up potentially existing Node object first. try: entry.clear_memoized_values() except AttributeError: # Not a Node object, try to look up Node by filename. XXX # This creates Node objects even for those filenames which # do not correspond to an existing Node object. node = get_default_fs().Entry(entry) if node: node.clear_memoized_values() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Node/Python.py0000664000175000017500000001267713160023041021270 0ustar bdbaddogbdbaddog"""scons.Node.Python Python nodes. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Node/Python.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Node class ValueNodeInfo(SCons.Node.NodeInfoBase): __slots__ = ('csig',) current_version_id = 2 field_list = ['csig'] def str_to_node(self, s): return Value(s) def __getstate__(self): """ Return all fields that shall be pickled. Walk the slots in the class hierarchy and add those to the state dictionary. If a '__dict__' slot is available, copy all entries to the dictionary. Also include the version id, which is fixed for all instances of a class. """ state = getattr(self, '__dict__', {}).copy() for obj in type(self).mro(): for name in getattr(obj,'__slots__',()): if hasattr(self, name): state[name] = getattr(self, name) state['_version_id'] = self.current_version_id try: del state['__weakref__'] except KeyError: pass return state def __setstate__(self, state): """ Restore the attributes from a pickled state. """ # TODO check or discard version del state['_version_id'] for key, value in state.items(): if key not in ('__weakref__',): setattr(self, key, value) class ValueBuildInfo(SCons.Node.BuildInfoBase): __slots__ = () current_version_id = 2 class Value(SCons.Node.Node): """A class for Python variables, typically passed on the command line or generated by a script, but not from a file or some other source. """ NodeInfo = ValueNodeInfo BuildInfo = ValueBuildInfo def __init__(self, value, built_value=None): SCons.Node.Node.__init__(self) self.value = value self.changed_since_last_build = 6 self.store_info = 0 if built_value is not None: self.built_value = built_value def str_for_display(self): return repr(self.value) def __str__(self): return str(self.value) def make_ready(self): self.get_csig() def build(self, **kw): if not hasattr(self, 'built_value'): SCons.Node.Node.build(self, **kw) is_up_to_date = SCons.Node.Node.children_are_up_to_date def is_under(self, dir): # Make Value nodes get built regardless of # what directory scons was run from. Value nodes # are outside the filesystem: return 1 def write(self, built_value): """Set the value of the node.""" self.built_value = built_value def read(self): """Return the value. If necessary, the value is built.""" self.build() if not hasattr(self, 'built_value'): self.built_value = self.value return self.built_value def get_text_contents(self): """By the assumption that the node.built_value is a deterministic product of the sources, the contents of a Value are the concatenation of all the contents of its sources. As the value need not be built when get_contents() is called, we cannot use the actual node.built_value.""" ###TODO: something reasonable about universal newlines contents = str(self.value) for kid in self.children(None): contents = contents + kid.get_contents().decode() return contents def get_contents(self): text_contents = self.get_text_contents() try: return text_contents.encode() except UnicodeDecodeError: # Already encoded as python2 str are bytes return text_contents def changed_since_last_build(self, target, prev_ni): cur_csig = self.get_csig() try: return cur_csig != prev_ni.csig except AttributeError: return 1 def get_csig(self, calc=None): """Because we're a Python value node and don't have a real timestamp, we get to ignore the calculator and just use the value contents.""" try: return self.ninfo.csig except AttributeError: pass contents = self.get_contents() self.get_ninfo().csig = contents return contents # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Node/NodeTests.py0000664000175000017500000012206613160023041021711 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Node/NodeTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import collections import os import re import sys import unittest import TestUnit import SCons.Errors import SCons.Node import SCons.Util built_it = None built_target = None built_source = None cycle_detected = None built_order = 0 def _actionAppend(a1, a2): all = [] for curr_a in [a1, a2]: if isinstance(curr_a, MyAction): all.append(curr_a) elif isinstance(curr_a, MyListAction): all.extend(curr_a.list) elif isinstance(curr_a, list): all.extend(curr_a) else: raise Exception('Cannot Combine Actions') return MyListAction(all) class MyActionBase(object): def __add__(self, other): return _actionAppend(self, other) def __radd__(self, other): return _actionAppend(other, self) class MyAction(MyActionBase): def __init__(self): self.order = 0 def __call__(self, target, source, env, executor=None): global built_it, built_target, built_source, built_args, built_order if executor: target = executor.get_all_targets() source = executor.get_all_sources() built_it = 1 built_target = target built_source = source built_args = env built_order = built_order + 1 self.order = built_order return 0 def get_implicit_deps(self, target, source, env): return [] class MyExecutor(object): def __init__(self, env=None, targets=[], sources=[]): self.env = env self.targets = targets self.sources = sources def get_build_env(self): return self.env def get_build_scanner_path(self, scanner): return 'executor would call %s' % scanner def cleanup(self): self.cleaned_up = 1 def scan_targets(self, scanner): if not scanner: return d = scanner(self.targets) for t in self.targets: t.implicit.extend(d) def scan_sources(self, scanner): if not scanner: return d = scanner(self.sources) for t in self.targets: t.implicit.extend(d) class MyListAction(MyActionBase): def __init__(self, list): self.list = list def __call__(self, target, source, env): for A in self.list: A(target, source, env) class Environment(object): def __init__(self, **kw): self._dict = {} self._dict.update(kw) def __getitem__(self, key): return self._dict[key] def get(self, key, default = None): return self._dict.get(key, default) def Dictionary(self, *args): return {} def Override(self, overrides): d = self._dict.copy() d.update(overrides) return Environment(**d) def _update(self, dict): self._dict.update(dict) def get_factory(self, factory): return factory or MyNode def get_scanner(self, scanner_key): try: return self._dict['SCANNERS'][0] except: pass return [] class Builder(object): def __init__(self, env=None, is_explicit=1): if env is None: env = Environment() self.env = env self.overrides = {} self.action = MyAction() self.source_factory = MyNode self.is_explicit = is_explicit self.target_scanner = None self.source_scanner = None def targets(self, t): return [t] def get_actions(self): return [self.action] def get_contents(self, target, source, env): return 7 class NoneBuilder(Builder): def execute(self, target, source, env): Builder.execute(self, target, source, env) return None class ListBuilder(Builder): def __init__(self, *nodes): Builder.__init__(self) self.nodes = nodes def execute(self, target, source, env): if hasattr(self, 'status'): return self.status for n in self.nodes: n.prepare() target = self.nodes[0] self.status = Builder.execute(self, target, source, env) class FailBuilder(object): def execute(self, target, source, env): return 1 class ExceptBuilder(object): def execute(self, target, source, env): raise SCons.Errors.BuildError class ExceptBuilder2(object): def execute(self, target, source, env): raise Exception("foo") class Scanner(object): called = None def __call__(self, node): self.called = 1 return node.GetTag('found_includes') def path(self, env, dir=None, target=None, source=None, kw={}): return () def select(self, node): return self def recurse_nodes(self, nodes): return nodes class MyNode(SCons.Node.Node): """The base Node class contains a number of do-nothing methods that we expect to be overridden by real, functional Node subclasses. So simulate a real, functional Node subclass. """ def __init__(self, name): SCons.Node.Node.__init__(self) self.name = name self.Tag('found_includes', []) def __str__(self): return self.name def get_found_includes(self, env, scanner, target): return scanner(self) class Calculator(object): def __init__(self, val): self.max_drift = 0 class M(object): def __init__(self, val): self.val = val def signature(self, args): return self.val def collect(self, args): result = self.val for a in args: result += a return result self.module = M(val) class NodeInfoBaseTestCase(unittest.TestCase): # The abstract class NodeInfoBase has not enough default slots to perform # the merge and format test (arbitrary attributes do not work). Do it with a # derived class that does provide the slots. def test_merge(self): """Test merging NodeInfoBase attributes""" class TestNodeInfo(SCons.Node.NodeInfoBase): __slots__ = ('a1', 'a2', 'a3') ni1 = TestNodeInfo() ni2 = TestNodeInfo() ni1.a1 = 1 ni1.a2 = 2 ni2.a2 = 222 ni2.a3 = 333 ni1.merge(ni2) assert ni1.a1 == 1, ni1.a1 assert ni1.a2 == 222, ni1.a2 assert ni1.a3 == 333, ni1.a3 def test_update(self): """Test the update() method""" ni = SCons.Node.NodeInfoBase() ni.update(SCons.Node.Node()) def test_format(self): """Test the NodeInfoBase.format() method""" class TestNodeInfo(SCons.Node.NodeInfoBase): __slots__ = ('xxx', 'yyy', 'zzz') ni1 = TestNodeInfo() ni1.xxx = 'x' ni1.yyy = 'y' ni1.zzz = 'z' f = ni1.format() assert f == ['x', 'y', 'z'], f field_list = ['xxx', 'zzz', 'aaa'] f = ni1.format(field_list) assert f == ['x', 'z', 'None'], f class BuildInfoBaseTestCase(unittest.TestCase): def test___init__(self): """Test BuildInfoBase initialization""" n = SCons.Node.Node() bi = SCons.Node.BuildInfoBase() assert bi def test_merge(self): """Test merging BuildInfoBase attributes""" n1 = SCons.Node.Node() bi1 = SCons.Node.BuildInfoBase() n2 = SCons.Node.Node() bi2 = SCons.Node.BuildInfoBase() bi1.bsources = 1 bi1.bdepends = 2 bi2.bdepends = 222 bi2.bact = 333 bi1.merge(bi2) assert bi1.bsources == 1, bi1.bsources assert bi1.bdepends == 222, bi1.bdepends assert bi1.bact == 333, bi1.bact class NodeTestCase(unittest.TestCase): def test_build(self): """Test building a node """ global built_it, built_order # Make sure it doesn't blow up if no builder is set. node = MyNode("www") node.build() assert built_it is None node.build(extra_kw_argument = 1) assert built_it is None node = MyNode("xxx") node.builder_set(Builder()) node.env_set(Environment()) node.path = "xxx" node.sources = ["yyy", "zzz"] node.build() assert built_it assert built_target == [node], built_target assert built_source == ["yyy", "zzz"], built_source built_it = None node = MyNode("qqq") node.builder_set(NoneBuilder()) node.env_set(Environment()) node.path = "qqq" node.sources = ["rrr", "sss"] node.builder.overrides = { "foo" : 1, "bar" : 2 } node.build() assert built_it assert built_target == [node], built_target assert built_source == ["rrr", "sss"], built_source assert built_args["foo"] == 1, built_args assert built_args["bar"] == 2, built_args fff = MyNode("fff") ggg = MyNode("ggg") lb = ListBuilder(fff, ggg) e = Environment() fff.builder_set(lb) fff.env_set(e) fff.path = "fff" ggg.builder_set(lb) ggg.env_set(e) ggg.path = "ggg" fff.sources = ["hhh", "iii"] ggg.sources = ["hhh", "iii"] built_it = None fff.build() assert built_it assert built_target == [fff], built_target assert built_source == ["hhh", "iii"], built_source built_it = None ggg.build() assert built_it assert built_target == [ggg], built_target assert built_source == ["hhh", "iii"], built_source built_it = None jjj = MyNode("jjj") b = Builder() jjj.builder_set(b) # NOTE: No env_set()! We should pull the environment from the builder. b.env = Environment() b.overrides = { "on" : 3, "off" : 4 } e.builder = b jjj.build() assert built_it assert built_target[0] == jjj, built_target[0] assert built_source == [], built_source assert built_args["on"] == 3, built_args assert built_args["off"] == 4, built_args def test_get_build_scanner_path(self): """Test the get_build_scanner_path() method""" n = SCons.Node.Node() x = MyExecutor() n.set_executor(x) p = n.get_build_scanner_path('fake_scanner') assert p == "executor would call fake_scanner", p def test_get_executor(self): """Test the get_executor() method""" n = SCons.Node.Node() try: n.get_executor(0) except AttributeError: pass else: self.fail("did not catch expected AttributeError") class Builder(object): action = 'act' env = 'env1' overrides = {} n = SCons.Node.Node() n.builder_set(Builder()) x = n.get_executor() assert x.env == 'env1', x.env n = SCons.Node.Node() n.builder_set(Builder()) n.env_set('env2') x = n.get_executor() assert x.env == 'env2', x.env def test_set_executor(self): """Test the set_executor() method""" n = SCons.Node.Node() n.set_executor(1) assert n.executor == 1, n.executor def test_executor_cleanup(self): """Test letting the executor cleanup its cache""" n = SCons.Node.Node() x = MyExecutor() n.set_executor(x) n.executor_cleanup() assert x.cleaned_up def test_reset_executor(self): """Test the reset_executor() method""" n = SCons.Node.Node() n.set_executor(1) assert n.executor == 1, n.executor n.reset_executor() assert not hasattr(n, 'executor'), "unexpected executor attribute" def test_built(self): """Test the built() method""" class SubNodeInfo(SCons.Node.NodeInfoBase): __slots__ = ('updated',) def update(self, node): self.updated = 1 class SubNode(SCons.Node.Node): def clear(self): self.cleared = 1 n = SubNode() n.ninfo = SubNodeInfo() n.built() assert n.cleared, n.cleared assert n.ninfo.updated, n.ninfo.cleared def test_push_to_cache(self): """Test the base push_to_cache() method""" n = SCons.Node.Node() r = n.push_to_cache() assert r is None, r def test_retrieve_from_cache(self): """Test the base retrieve_from_cache() method""" n = SCons.Node.Node() r = n.retrieve_from_cache() assert r == 0, r def test_visited(self): """Test the base visited() method Just make sure it's there and we can call it. """ n = SCons.Node.Node() n.visited() def test_builder_set(self): """Test setting a Node's Builder """ node = SCons.Node.Node() b = Builder() node.builder_set(b) assert node.builder == b def test_has_builder(self): """Test the has_builder() method """ n1 = SCons.Node.Node() assert n1.has_builder() == 0 n1.builder_set(Builder()) assert n1.has_builder() == 1 def test_has_explicit_builder(self): """Test the has_explicit_builder() method """ n1 = SCons.Node.Node() assert not n1.has_explicit_builder() n1.set_explicit(1) assert n1.has_explicit_builder() n1.set_explicit(None) assert not n1.has_explicit_builder() def test_get_builder(self): """Test the get_builder() method""" n1 = SCons.Node.Node() b = n1.get_builder() assert b is None, b b = n1.get_builder(777) assert b == 777, b n1.builder_set(888) b = n1.get_builder() assert b == 888, b b = n1.get_builder(999) assert b == 888, b def test_multiple_side_effect_has_builder(self): """Test the multiple_side_effect_has_builder() method """ n1 = SCons.Node.Node() assert n1.multiple_side_effect_has_builder() == 0 n1.builder_set(Builder()) assert n1.multiple_side_effect_has_builder() == 1 def test_is_derived(self): """Test the is_derived() method """ n1 = SCons.Node.Node() n2 = SCons.Node.Node() n3 = SCons.Node.Node() n2.builder_set(Builder()) n3.side_effect = 1 assert n1.is_derived() == 0 assert n2.is_derived() == 1 assert n3.is_derived() == 1 def test_alter_targets(self): """Test the alter_targets() method """ n = SCons.Node.Node() t, m = n.alter_targets() assert t == [], t assert m is None, m def test_is_up_to_date(self): """Test the default is_up_to_date() method """ node = SCons.Node.Node() assert node.is_up_to_date() is None def test_children_are_up_to_date(self): """Test the children_are_up_to_date() method used by subclasses """ n1 = SCons.Node.Node() n2 = SCons.Node.Node() n1.add_source([n2]) assert n1.children_are_up_to_date(), "expected up to date" n2.set_state(SCons.Node.executed) assert not n1.children_are_up_to_date(), "expected not up to date" n2.set_state(SCons.Node.up_to_date) assert n1.children_are_up_to_date(), "expected up to date" n1.always_build = 1 assert not n1.children_are_up_to_date(), "expected not up to date" def test_env_set(self): """Test setting a Node's Environment """ node = SCons.Node.Node() e = Environment() node.env_set(e) assert node.env == e def test_get_actions(self): """Test fetching a Node's action list """ node = SCons.Node.Node() node.builder_set(Builder()) a = node.builder.get_actions() assert isinstance(a[0], MyAction), a[0] def test_get_csig(self): """Test generic content signature calculation """ class TestNodeInfo(SCons.Node.NodeInfoBase): __slots__ = ('csig',) try: SCons.Node.Node.NodeInfo = TestNodeInfo def my_contents(obj): return 444 SCons.Node._get_contents_map[4] = my_contents node = SCons.Node.Node() node._func_get_contents = 4 result = node.get_csig() assert result == '550a141f12de6341fba65b0ad0433500', result finally: SCons.Node.Node.NodeInfo = SCons.Node.NodeInfoBase def test_get_cachedir_csig(self): """Test content signature calculation for CacheDir """ class TestNodeInfo(SCons.Node.NodeInfoBase): __slots__ = ('csig',) try: SCons.Node.Node.NodeInfo = TestNodeInfo def my_contents(obj): return 555 SCons.Node._get_contents_map[4] = my_contents node = SCons.Node.Node() node._func_get_contents = 4 result = node.get_cachedir_csig() assert result == '15de21c670ae7c3f6f3f1f37029303c9', result finally: SCons.Node.Node.NodeInfo = SCons.Node.NodeInfoBase def test_get_binfo(self): """Test fetching/creating a build information structure """ class TestNodeInfo(SCons.Node.NodeInfoBase): __slots__ = ('csig',) SCons.Node.Node.NodeInfo = TestNodeInfo node = SCons.Node.Node() binfo = node.get_binfo() assert isinstance(binfo, SCons.Node.BuildInfoBase), binfo node = SCons.Node.Node() d = SCons.Node.Node() ninfo = d.get_ninfo() assert isinstance(ninfo, SCons.Node.NodeInfoBase), ninfo i = SCons.Node.Node() ninfo = i.get_ninfo() assert isinstance(ninfo, SCons.Node.NodeInfoBase), ninfo node.depends = [d] node.implicit = [i] binfo = node.get_binfo() assert isinstance(binfo, SCons.Node.BuildInfoBase), binfo assert hasattr(binfo, 'bsources') assert hasattr(binfo, 'bsourcesigs') assert binfo.bdepends == [d] assert hasattr(binfo, 'bdependsigs') assert binfo.bimplicit == [i] assert hasattr(binfo, 'bimplicitsigs') def test_explain(self): """Test explaining why a Node must be rebuilt """ class testNode(SCons.Node.Node): def __str__(self): return 'xyzzy' node = testNode() node.exists = lambda: None # Can't do this with new-style classes (python bug #1066490) #node.__str__ = lambda: 'xyzzy' result = node.explain() assert result == "building `xyzzy' because it doesn't exist\n", result class testNode2(SCons.Node.Node): def __str__(self): return 'null_binfo' class FS(object): pass node = testNode2() node.fs = FS() node.fs.Top = SCons.Node.Node() result = node.explain() assert result is None, result def get_null_info(): class Null_SConsignEntry(object): class Null_BuildInfo(object): def prepare_dependencies(self): pass binfo = Null_BuildInfo() return Null_SConsignEntry() node.get_stored_info = get_null_info #see above: node.__str__ = lambda: 'null_binfo' result = node.explain() assert result == "Cannot explain why `null_binfo' is being rebuilt: No previous build information found\n", result # XXX additional tests for the guts of the functionality some day #def test_del_binfo(self): # """Test deleting the build information from a Node # """ # node = SCons.Node.Node() # node.binfo = None # node.del_binfo() # assert not hasattr(node, 'binfo'), node def test_store_info(self): """Test calling the method to store build information """ node = SCons.Node.Node() SCons.Node.store_info_map[node.store_info](node) def test_get_stored_info(self): """Test calling the method to fetch stored build information """ node = SCons.Node.Node() result = node.get_stored_info() assert result is None, result def test_set_always_build(self): """Test setting a Node's always_build value """ node = SCons.Node.Node() node.set_always_build() assert node.always_build node.set_always_build(3) assert node.always_build == 3 def test_set_noclean(self): """Test setting a Node's noclean value """ node = SCons.Node.Node() node.set_noclean() assert node.noclean == 1, node.noclean node.set_noclean(7) assert node.noclean == 1, node.noclean node.set_noclean(0) assert node.noclean == 0, node.noclean node.set_noclean(None) assert node.noclean == 0, node.noclean def test_set_precious(self): """Test setting a Node's precious value """ node = SCons.Node.Node() node.set_precious() assert node.precious node.set_precious(7) assert node.precious == 7 def test_set_pseudo(self): """Test setting a Node's pseudo value """ node = SCons.Node.Node() node.set_pseudo() assert node.pseudo node.set_pseudo(False) assert not node.pseudo def test_exists(self): """Test evaluating whether a Node exists. """ node = SCons.Node.Node() e = node.exists() assert e == 1, e def test_exists(self): """Test evaluating whether a Node exists locally or in a repository. """ node = SCons.Node.Node() e = node.rexists() assert e == 1, e class MyNode(SCons.Node.Node): def exists(self): return 'xyz' node = MyNode() e = node.rexists() assert e == 'xyz', e def test_prepare(self): """Test preparing a node to be built By extension, this also tests the missing() method. """ node = SCons.Node.Node() n1 = SCons.Node.Node() n1.builder_set(Builder()) node.implicit = [] node.implicit_set = set() node._add_child(node.implicit, node.implicit_set, [n1]) node.prepare() # should not throw an exception n2 = SCons.Node.Node() n2.linked = 1 node.implicit = [] node.implicit_set = set() node._add_child(node.implicit, node.implicit_set, [n2]) node.prepare() # should not throw an exception n3 = SCons.Node.Node() node.implicit = [] node.implicit_set = set() node._add_child(node.implicit, node.implicit_set, [n3]) node.prepare() # should not throw an exception class MyNode(SCons.Node.Node): def rexists(self): return None n4 = MyNode() node.implicit = [] node.implicit_set = set() node._add_child(node.implicit, node.implicit_set, [n4]) exc_caught = 0 try: node.prepare() except SCons.Errors.StopError: exc_caught = 1 assert exc_caught, "did not catch expected StopError" def test_add_dependency(self): """Test adding dependencies to a Node's list. """ node = SCons.Node.Node() assert node.depends == [] zero = SCons.Node.Node() one = SCons.Node.Node() two = SCons.Node.Node() three = SCons.Node.Node() four = SCons.Node.Node() five = SCons.Node.Node() six = SCons.Node.Node() node.add_dependency([zero]) assert node.depends == [zero] node.add_dependency([one]) assert node.depends == [zero, one] node.add_dependency([two, three]) assert node.depends == [zero, one, two, three] node.add_dependency([three, four, one]) assert node.depends == [zero, one, two, three, four] try: node.add_depends([[five, six]]) except: pass else: raise Exception("did not catch expected exception") assert node.depends == [zero, one, two, three, four] def test_add_source(self): """Test adding sources to a Node's list. """ node = SCons.Node.Node() assert node.sources == [] zero = SCons.Node.Node() one = SCons.Node.Node() two = SCons.Node.Node() three = SCons.Node.Node() four = SCons.Node.Node() five = SCons.Node.Node() six = SCons.Node.Node() node.add_source([zero]) assert node.sources == [zero] node.add_source([one]) assert node.sources == [zero, one] node.add_source([two, three]) assert node.sources == [zero, one, two, three] node.add_source([three, four, one]) assert node.sources == [zero, one, two, three, four] try: node.add_source([[five, six]]) except: pass else: raise Exception("did not catch expected exception") assert node.sources == [zero, one, two, three, four], node.sources def test_add_ignore(self): """Test adding files whose dependencies should be ignored. """ node = SCons.Node.Node() assert node.ignore == [] zero = SCons.Node.Node() one = SCons.Node.Node() two = SCons.Node.Node() three = SCons.Node.Node() four = SCons.Node.Node() five = SCons.Node.Node() six = SCons.Node.Node() node.add_ignore([zero]) assert node.ignore == [zero] node.add_ignore([one]) assert node.ignore == [zero, one] node.add_ignore([two, three]) assert node.ignore == [zero, one, two, three] node.add_ignore([three, four, one]) assert node.ignore == [zero, one, two, three, four] try: node.add_ignore([[five, six]]) except: pass else: raise Exception("did not catch expected exception") assert node.ignore == [zero, one, two, three, four] def test_get_found_includes(self): """Test the default get_found_includes() method """ node = SCons.Node.Node() target = SCons.Node.Node() e = Environment() deps = node.get_found_includes(e, None, target) assert deps == [], deps def test_get_implicit_deps(self): """Test get_implicit_deps() """ node = MyNode("nnn") target = MyNode("ttt") env = Environment() # No scanner at all returns [] deps = node.get_implicit_deps(env, None, target) assert deps == [], deps s = Scanner() d1 = MyNode("d1") d2 = MyNode("d2") node.Tag('found_includes', [d1, d2]) # Simple return of the found includes deps = node.get_implicit_deps(env, s, s.path) assert deps == [d1, d2], deps # By default, our fake scanner recurses e = MyNode("eee") f = MyNode("fff") g = MyNode("ggg") d1.Tag('found_includes', [e, f]) d2.Tag('found_includes', [e, f]) f.Tag('found_includes', [g]) deps = node.get_implicit_deps(env, s, s.path) assert deps == [d1, d2, e, f, g], list(map(str, deps)) # Recursive scanning eliminates duplicates e.Tag('found_includes', [f]) deps = node.get_implicit_deps(env, s, s.path) assert deps == [d1, d2, e, f, g], list(map(str, deps)) # Scanner method can select specific nodes to recurse def no_fff(nodes): return [n for n in nodes if str(n)[0] != 'f'] s.recurse_nodes = no_fff deps = node.get_implicit_deps(env, s, s.path) assert deps == [d1, d2, e, f], list(map(str, deps)) # Scanner method can short-circuit recursing entirely s.recurse_nodes = lambda nodes: [] deps = node.get_implicit_deps(env, s, s.path) assert deps == [d1, d2], list(map(str, deps)) def test_get_env_scanner(self): """Test fetching the environment scanner for a Node """ node = SCons.Node.Node() scanner = Scanner() env = Environment(SCANNERS = [scanner]) s = node.get_env_scanner(env) assert s == scanner, s s = node.get_env_scanner(env, {'X':1}) assert s == scanner, s def test_get_target_scanner(self): """Test fetching the target scanner for a Node """ s = Scanner() b = Builder() b.target_scanner = s n = SCons.Node.Node() n.builder = b x = n.get_target_scanner() assert x is s, x def test_get_source_scanner(self): """Test fetching the source scanner for a Node """ target = SCons.Node.Node() source = SCons.Node.Node() s = target.get_source_scanner(source) assert isinstance(s, SCons.Util.Null), s ts1 = Scanner() ts2 = Scanner() ts3 = Scanner() class Builder1(Builder): def __call__(self, source): r = SCons.Node.Node() r.builder = self return [r] class Builder2(Builder1): def __init__(self, scanner): self.source_scanner = scanner builder = Builder2(ts1) targets = builder([source]) s = targets[0].get_source_scanner(source) assert s is ts1, s target.builder_set(Builder2(ts1)) target.builder.source_scanner = ts2 s = target.get_source_scanner(source) assert s is ts2, s builder = Builder1(env=Environment(SCANNERS = [ts3])) targets = builder([source]) s = targets[0].get_source_scanner(source) assert s is ts3, s def test_scan(self): """Test Scanner functionality """ env = Environment() node = MyNode("nnn") node.builder = Builder() node.env_set(env) x = MyExecutor(env, [node]) s = Scanner() d = MyNode("ddd") node.Tag('found_includes', [d]) node.builder.target_scanner = s assert node.implicit is None node.scan() assert s.called assert node.implicit == [d], node.implicit # Check that scanning a node with some stored implicit # dependencies resets internal attributes appropriately # if the stored dependencies need recalculation. class StoredNode(MyNode): def get_stored_implicit(self): return [MyNode('implicit1'), MyNode('implicit2')] save_implicit_cache = SCons.Node.implicit_cache save_implicit_deps_changed = SCons.Node.implicit_deps_changed save_implicit_deps_unchanged = SCons.Node.implicit_deps_unchanged SCons.Node.implicit_cache = 1 SCons.Node.implicit_deps_changed = None SCons.Node.implicit_deps_unchanged = None try: sn = StoredNode("eee") sn.builder_set(Builder()) sn.builder.target_scanner = s sn.scan() assert sn.implicit == [], sn.implicit assert sn.children() == [], sn.children() finally: SCons.Node.implicit_cache = save_implicit_cache SCons.Node.implicit_deps_changed = save_implicit_deps_changed SCons.Node.implicit_deps_unchanged = save_implicit_deps_unchanged def test_scanner_key(self): """Test that a scanner_key() method exists""" assert SCons.Node.Node().scanner_key() is None def test_children(self): """Test fetching the non-ignored "children" of a Node. """ node = SCons.Node.Node() n1 = SCons.Node.Node() n2 = SCons.Node.Node() n3 = SCons.Node.Node() n4 = SCons.Node.Node() n5 = SCons.Node.Node() n6 = SCons.Node.Node() n7 = SCons.Node.Node() n8 = SCons.Node.Node() n9 = SCons.Node.Node() n10 = SCons.Node.Node() n11 = SCons.Node.Node() n12 = SCons.Node.Node() node.add_source([n1, n2, n3]) node.add_dependency([n4, n5, n6]) node.implicit = [] node.implicit_set = set() node._add_child(node.implicit, node.implicit_set, [n7, n8, n9]) node._add_child(node.implicit, node.implicit_set, [n10, n11, n12]) node.add_ignore([n2, n5, n8, n11]) kids = node.children() for kid in [n1, n3, n4, n6, n7, n9, n10, n12]: assert kid in kids, kid for kid in [n2, n5, n8, n11]: assert not kid in kids, kid def test_all_children(self): """Test fetching all the "children" of a Node. """ node = SCons.Node.Node() n1 = SCons.Node.Node() n2 = SCons.Node.Node() n3 = SCons.Node.Node() n4 = SCons.Node.Node() n5 = SCons.Node.Node() n6 = SCons.Node.Node() n7 = SCons.Node.Node() n8 = SCons.Node.Node() n9 = SCons.Node.Node() n10 = SCons.Node.Node() n11 = SCons.Node.Node() n12 = SCons.Node.Node() node.add_source([n1, n2, n3]) node.add_dependency([n4, n5, n6]) node.implicit = [] node.implicit_set = set() node._add_child(node.implicit, node.implicit_set, [n7, n8, n9]) node._add_child(node.implicit, node.implicit_set, [n10, n11, n12]) node.add_ignore([n2, n5, n8, n11]) kids = node.all_children() for kid in [n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12]: assert kid in kids, kid def test_state(self): """Test setting and getting the state of a node """ node = SCons.Node.Node() assert node.get_state() == SCons.Node.no_state node.set_state(SCons.Node.executing) assert node.get_state() == SCons.Node.executing assert SCons.Node.pending < SCons.Node.executing assert SCons.Node.executing < SCons.Node.up_to_date assert SCons.Node.up_to_date < SCons.Node.executed assert SCons.Node.executed < SCons.Node.failed def test_walker(self): """Test walking a Node tree. """ n1 = MyNode("n1") nw = SCons.Node.Walker(n1) assert not nw.is_done() assert nw.get_next().name == "n1" assert nw.is_done() assert nw.get_next() is None n2 = MyNode("n2") n3 = MyNode("n3") n1.add_source([n2, n3]) nw = SCons.Node.Walker(n1) n = nw.get_next() assert n.name == "n2", n.name n = nw.get_next() assert n.name == "n3", n.name n = nw.get_next() assert n.name == "n1", n.name n = nw.get_next() assert n is None, n n4 = MyNode("n4") n5 = MyNode("n5") n6 = MyNode("n6") n7 = MyNode("n7") n2.add_source([n4, n5]) n3.add_dependency([n6, n7]) nw = SCons.Node.Walker(n1) assert nw.get_next().name == "n4" assert nw.get_next().name == "n5" assert n2 in nw.history assert nw.get_next().name == "n2" assert nw.get_next().name == "n6" assert nw.get_next().name == "n7" assert n3 in nw.history assert nw.get_next().name == "n3" assert n1 in nw.history assert nw.get_next().name == "n1" assert nw.get_next() is None n8 = MyNode("n8") n8.add_dependency([n3]) n7.add_dependency([n8]) def cycle(node, stack): global cycle_detected cycle_detected = 1 global cycle_detected nw = SCons.Node.Walker(n3, cycle_func = cycle) n = nw.get_next() assert n.name == "n6", n.name n = nw.get_next() assert n.name == "n8", n.name assert cycle_detected cycle_detected = None n = nw.get_next() assert n.name == "n7", n.name n = nw.get_next() assert nw.get_next() is None def test_abspath(self): """Test the get_abspath() method.""" n = MyNode("foo") assert n.get_abspath() == str(n), n.get_abspath() def test_for_signature(self): """Test the for_signature() method.""" n = MyNode("foo") assert n.for_signature() == str(n), n.get_abspath() def test_get_string(self): """Test the get_string() method.""" class TestNode(MyNode): def __init__(self, name, sig): MyNode.__init__(self, name) self.sig = sig def for_signature(self): return self.sig n = TestNode("foo", "bar") assert n.get_string(0) == "foo", n.get_string(0) assert n.get_string(1) == "bar", n.get_string(1) def test_literal(self): """Test the is_literal() function.""" n=SCons.Node.Node() assert n.is_literal() def test_Annotate(self): """Test using an interface-specific Annotate function.""" def my_annotate(node, self=self): node.Tag('annotation', self.node_string) save_Annotate = SCons.Node.Annotate SCons.Node.Annotate = my_annotate try: self.node_string = '#1' n = SCons.Node.Node() a = n.GetTag('annotation') assert a == '#1', a self.node_string = '#2' n = SCons.Node.Node() a = n.GetTag('annotation') assert a == '#2', a finally: SCons.Node.Annotate = save_Annotate def test_clear(self): """Test clearing all cached state information.""" n = SCons.Node.Node() n.set_state(3) n.binfo = 'xyz' n.includes = 'testincludes' n.Tag('found_includes', {'testkey':'testvalue'}) n.implicit = 'testimplicit' x = MyExecutor() n.set_executor(x) n.clear() assert n.includes is None, n.includes assert x.cleaned_up def test_get_subst_proxy(self): """Test the get_subst_proxy method.""" n = MyNode("test") assert n.get_subst_proxy() == n, n.get_subst_proxy() def test_new_binfo(self): """Test the new_binfo() method""" n = SCons.Node.Node() result = n.new_binfo() assert isinstance(result, SCons.Node.BuildInfoBase), result def test_get_suffix(self): """Test the base Node get_suffix() method""" n = SCons.Node.Node() s = n.get_suffix() assert s == '', s def test_postprocess(self): """Test calling the base Node postprocess() method""" n = SCons.Node.Node() n.waiting_parents = set( ['foo','bar'] ) n.postprocess() assert n.waiting_parents == set(), n.waiting_parents def test_add_to_waiting_parents(self): """Test the add_to_waiting_parents() method""" n1 = SCons.Node.Node() n2 = SCons.Node.Node() assert n1.waiting_parents == set(), n1.waiting_parents r = n1.add_to_waiting_parents(n2) assert r == 1, r assert n1.waiting_parents == set((n2,)), n1.waiting_parents r = n1.add_to_waiting_parents(n2) assert r == 0, r class NodeListTestCase(unittest.TestCase): def test___str__(self): """Test""" n1 = MyNode("n1") n2 = MyNode("n2") n3 = MyNode("n3") nl = SCons.Node.NodeList([n3, n2, n1]) l = [1] ul = collections.UserList([2]) s = str(nl) assert s == "['n3', 'n2', 'n1']", s r = repr(nl) r = re.sub('at (0[xX])?[0-9a-fA-F]+', 'at 0x', r) # Don't care about ancestry: just leaf value of MyNode r = re.sub('<.*?\.MyNode', '"]*3) assert r == '[%s]' % l, r if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ BuildInfoBaseTestCase, NodeInfoBaseTestCase, NodeTestCase, NodeListTestCase ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Node/PythonTests.py0000664000175000017500000001013413160023041022275 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Node/PythonTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestUnit import SCons.Errors import SCons.Node.Python class ValueTestCase(unittest.TestCase): def test_Value(self): """Test creating a Value() object """ v1 = SCons.Node.Python.Value('a') assert v1.value == 'a', v1.value value2 = 'a' v2 = SCons.Node.Python.Value(value2) assert v2.value == value2, v2.value assert v2.value is value2, v2.value assert not v1 is v2 assert v1.value == v2.value v3 = SCons.Node.Python.Value('c', 'cb') assert v3.built_value == 'cb' def test_build(self): """Test "building" a Value Node """ class fake_executor(object): def __call__(self, node): node.write('faked') v1 = SCons.Node.Python.Value('b', 'built') v1.executor = fake_executor() v1.build() assert v1.built_value == 'built', v1.built_value v2 = SCons.Node.Python.Value('b') v2.executor = fake_executor() v2.build() assert v2.built_value == 'faked', v2.built_value def test_read(self): """Test the Value.read() method """ v1 = SCons.Node.Python.Value('a') x = v1.read() assert x == 'a', x def test_write(self): """Test the Value.write() method """ v1 = SCons.Node.Python.Value('a') assert v1.value == 'a', v1.value assert not hasattr(v1, 'built_value') v1.write('new') assert v1.value == 'a', v1.value assert v1.built_value == 'new', v1.built_value def test_get_csig(self): """Test calculating the content signature of a Value() object """ v1 = SCons.Node.Python.Value('aaa') csig = v1.get_csig(None) assert csig.decode() == 'aaa', csig v2 = SCons.Node.Python.Value(7) csig = v2.get_csig(None) assert csig.decode() == '7', csig v3 = SCons.Node.Python.Value(None) csig = v3.get_csig(None) assert csig.decode() == 'None', csig class ValueNodeInfoTestCase(unittest.TestCase): def test___init__(self): """Test ValueNodeInfo initialization""" vvv = SCons.Node.Python.Value('vvv') ni = SCons.Node.Python.ValueNodeInfo() class ValueBuildInfoTestCase(unittest.TestCase): def test___init__(self): """Test ValueBuildInfo initialization""" vvv = SCons.Node.Python.Value('vvv') bi = SCons.Node.Python.ValueBuildInfo() if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ ValueTestCase, ValueBuildInfoTestCase, ValueNodeInfoTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Node/Alias.py0000664000175000017500000001215313160023041021025 0ustar bdbaddogbdbaddog """scons.Node.Alias Alias nodes. This creates a hash of global Aliases (dummy targets). """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Node/Alias.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import collections import SCons.Errors import SCons.Node import SCons.Util class AliasNameSpace(collections.UserDict): def Alias(self, name, **kw): if isinstance(name, SCons.Node.Alias.Alias): return name try: a = self[name] except KeyError: a = SCons.Node.Alias.Alias(name, **kw) self[name] = a return a def lookup(self, name, **kw): try: return self[name] except KeyError: return None class AliasNodeInfo(SCons.Node.NodeInfoBase): __slots__ = ('csig',) current_version_id = 2 field_list = ['csig'] def str_to_node(self, s): return default_ans.Alias(s) def __getstate__(self): """ Return all fields that shall be pickled. Walk the slots in the class hierarchy and add those to the state dictionary. If a '__dict__' slot is available, copy all entries to the dictionary. Also include the version id, which is fixed for all instances of a class. """ state = getattr(self, '__dict__', {}).copy() for obj in type(self).mro(): for name in getattr(obj,'__slots__',()): if hasattr(self, name): state[name] = getattr(self, name) state['_version_id'] = self.current_version_id try: del state['__weakref__'] except KeyError: pass return state def __setstate__(self, state): """ Restore the attributes from a pickled state. """ # TODO check or discard version del state['_version_id'] for key, value in state.items(): if key not in ('__weakref__',): setattr(self, key, value) class AliasBuildInfo(SCons.Node.BuildInfoBase): __slots__ = () current_version_id = 2 class Alias(SCons.Node.Node): NodeInfo = AliasNodeInfo BuildInfo = AliasBuildInfo def __init__(self, name): SCons.Node.Node.__init__(self) self.name = name self.changed_since_last_build = 1 self.store_info = 0 def str_for_display(self): return '"' + self.__str__() + '"' def __str__(self): return self.name def make_ready(self): self.get_csig() really_build = SCons.Node.Node.build is_up_to_date = SCons.Node.Node.children_are_up_to_date def is_under(self, dir): # Make Alias nodes get built regardless of # what directory scons was run from. Alias nodes # are outside the filesystem: return 1 def get_contents(self): """The contents of an alias is the concatenation of the content signatures of all its sources.""" childsigs = [n.get_csig() for n in self.children()] return ''.join(childsigs) def sconsign(self): """An Alias is not recorded in .sconsign files""" pass # # # def build(self): """A "builder" for aliases.""" pass def convert(self): try: del self.builder except AttributeError: pass self.reset_executor() self.build = self.really_build def get_csig(self): """ Generate a node's content signature, the digested signature of its content. node - the node cache - alternate node to use for the signature cache returns - the content signature """ try: return self.ninfo.csig except AttributeError: pass contents = self.get_contents() csig = SCons.Util.MD5signature(contents) self.get_ninfo().csig = csig return csig default_ans = AliasNameSpace() SCons.Node.arg2nodes_lookups.append(default_ans.lookup) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Node/AliasTests.py0000664000175000017500000000760213160023041022053 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Node/AliasTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestUnit import SCons.Errors import SCons.Node.Alias class AliasTestCase(unittest.TestCase): def test_AliasNameSpace(self): """Test creating an Alias name space """ ans = SCons.Node.Alias.AliasNameSpace() assert ans is not None, ans def test_ANS_Alias(self): """Test the Alias() factory """ ans = SCons.Node.Alias.AliasNameSpace() a1 = ans.Alias('a1') assert a1.name == 'a1', a1.name a2 = ans.Alias('a1') assert a1 is a2, (a1, a2) def test_get_contents(self): """Test the get_contents() method """ class DummyNode(object): def __init__(self, contents): self.contents = contents def get_csig(self): return self.contents def get_contents(self): return self.contents ans = SCons.Node.Alias.AliasNameSpace() ans.Alias('a1') a = ans.lookup('a1') a.sources = [ DummyNode('one'), DummyNode('two'), DummyNode('three') ] c = a.get_contents() assert c == 'onetwothree', c def test_lookup(self): """Test the lookup() method """ ans = SCons.Node.Alias.AliasNameSpace() ans.Alias('a1') a = ans.lookup('a1') assert a.name == 'a1', a.name a1 = ans.lookup('a1') assert a is a1, a1 a = ans.lookup('a2') assert a is None, a def test_Alias(self): """Test creating an Alias() object """ a1 = SCons.Node.Alias.Alias('a') assert a1.name == 'a', a1.name a2 = SCons.Node.Alias.Alias('a') assert a2.name == 'a', a2.name assert not a1 is a2 assert a1.name == a2.name class AliasNodeInfoTestCase(unittest.TestCase): def test___init__(self): """Test AliasNodeInfo initialization""" ans = SCons.Node.Alias.AliasNameSpace() aaa = ans.Alias('aaa') ni = SCons.Node.Alias.AliasNodeInfo() class AliasBuildInfoTestCase(unittest.TestCase): def test___init__(self): """Test AliasBuildInfo initialization""" ans = SCons.Node.Alias.AliasNameSpace() aaa = ans.Alias('aaa') bi = SCons.Node.Alias.AliasBuildInfo() if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ AliasTestCase, AliasBuildInfoTestCase, AliasNodeInfoTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/ExecutorTests.py0000664000175000017500000004150013160023041021726 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/ExecutorTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestUnit import SCons.Executor class MyEnvironment(object): def __init__(self, **kw): self._dict = {} self._dict.update(kw) def __getitem__(self, key): return self._dict[key] def Override(self, overrides): d = self._dict.copy() d.update(overrides) return MyEnvironment(**d) def _update(self, dict): self._dict.update(dict) class MyAction(object): def __init__(self, actions=['action1', 'action2']): self.actions = actions def __call__(self, target, source, env, **kw): for action in self.actions: action(target, source, env, **kw) def genstring(self, target, source, env): return ' '.join(['GENSTRING'] + list(map(str, self.actions)) + target + source) def get_contents(self, target, source, env): return b' '.join( [SCons.Util.to_bytes(aa) for aa in self.actions] + [SCons.Util.to_bytes(tt) for tt in target] + [SCons.Util.to_bytes(ss) for ss in source] ) def get_implicit_deps(self, target, source, env): return [] class MyBuilder(object): def __init__(self, env, overrides): self.env = env self.overrides = overrides self.action = MyAction() class MyNode(object): def __init__(self, name=None, pre=[], post=[]): self.name = name self.implicit = [] self.pre_actions = pre self.post_actions = post self.missing_val = None self.always_build = False self.up_to_date = False def __str__(self): return self.name def build(self): executor = SCons.Executor.Executor(MyAction(self.pre_actions + [self.builder.action] + self.post_actions), self.builder.env, [], [self], ['s1', 's2']) executor(self) def get_env_scanner(self, env, kw): return MyScanner('dep-') def get_implicit_deps(self, env, scanner, path, kw={}): if not scanner: scanner = self.get_env_scanner(env, kw) return [scanner.prefix + str(self)] def add_to_implicit(self, deps): self.implicit.extend(deps) def missing(self): return self.missing_val def calc_signature(self, calc): return 'cs-'+calc+'-'+self.name def disambiguate(self): return self def is_up_to_date(self): return self.up_to_date class MyScanner(object): def __init__(self, prefix): self.prefix = prefix def path(self, env, cwd, target, source): return () def select(self, node): return self class ExecutorTestCase(unittest.TestCase): def test__init__(self): """Test creating an Executor""" source_list = ['s1', 's2'] x = SCons.Executor.Executor('a', 'e', ['o'], 't', source_list) assert x.action_list == ['a'], x.action_list assert x.env == 'e', x.env assert x.overridelist == ['o'], x.overridelist targets = x.get_all_targets() assert targets == ['t'], targets source_list.append('s3') sources = x.get_all_sources() assert sources == ['s1', 's2'], sources try: x = SCons.Executor.Executor(None, 'e', ['o'], 't', source_list) except SCons.Errors.UserError: pass else: raise Exception("Did not catch expected UserError") def test__action_list(self): """Test the {get,set}_action_list() methods""" x = SCons.Executor.Executor('a', 'e', 'o', 't', ['s1', 's2']) l = x.get_action_list() assert l == ['a'], l x.add_pre_action('pre') x.add_post_action('post') l = x.get_action_list() assert l == ['pre', 'a', 'post'], l x.set_action_list('b') l = x.get_action_list() assert l == ['pre', 'b', 'post'], l x.set_action_list(['c']) l = x.get_action_list() assert l == ['pre', 'c', 'post'], l def test_get_build_env(self): """Test fetching and generating a build environment""" x = SCons.Executor.Executor(MyAction(), MyEnvironment(e=1), [], 't', ['s1', 's2']) x.env = MyEnvironment(eee=1) be = x.get_build_env() assert be['eee'] == 1, be env = MyEnvironment(X='xxx') x = SCons.Executor.Executor(MyAction(), env, [{'O':'o2'}], 't', ['s1', 's2']) be = x.get_build_env() assert be['O'] == 'o2', be['O'] assert be['X'] == 'xxx', be['X'] env = MyEnvironment(Y='yyy') overrides = [{'O':'ob3'}, {'O':'oo3'}] x = SCons.Executor.Executor(MyAction(), env, overrides, ['t'], ['s']) be = x.get_build_env() assert be['O'] == 'oo3', be['O'] assert be['Y'] == 'yyy', be['Y'] overrides = [{'O':'ob3'}] x = SCons.Executor.Executor(MyAction(), env, overrides, ['t'], ['s']) be = x.get_build_env() assert be['O'] == 'ob3', be['O'] assert be['Y'] == 'yyy', be['Y'] def test_get_build_scanner_path(self): """Test fetching the path for the specified scanner.""" t = MyNode('t') t.cwd = 'here' x = SCons.Executor.Executor(MyAction(), MyEnvironment(SCANNERVAL='sss'), [], [t], ['s1', 's2']) class LocalScanner(object): def path(self, env, dir, target, source): target = list(map(str, target)) source = list(map(str, source)) return "scanner: %s, %s, %s, %s" % (env['SCANNERVAL'], dir, target, source) s = LocalScanner() p = x.get_build_scanner_path(s) assert p == "scanner: sss, here, ['t'], ['s1', 's2']", p def test_get_kw(self): """Test the get_kw() method""" t = MyNode('t') x = SCons.Executor.Executor(MyAction(), MyEnvironment(), [], [t], ['s1', 's2'], builder_kw={'X':1, 'Y':2}) kw = x.get_kw() assert kw == {'X':1, 'Y':2, 'executor':x}, kw kw = x.get_kw({'Z':3}) assert kw == {'X':1, 'Y':2, 'Z':3, 'executor':x}, kw kw = x.get_kw({'X':4}) assert kw == {'X':4, 'Y':2, 'executor':x}, kw def test__call__(self): """Test calling an Executor""" result = [] def pre(target, source, env, result=result, **kw): result.append('pre') def action1(target, source, env, result=result, **kw): result.append('action1') def action2(target, source, env, result=result, **kw): result.append('action2') def post(target, source, env, result=result, **kw): result.append('post') env = MyEnvironment() a = MyAction([action1, action2]) t = MyNode('t') x = SCons.Executor.Executor(a, env, [], [t], ['s1', 's2']) x.add_pre_action(pre) x.add_post_action(post) x(t) assert result == ['pre', 'action1', 'action2', 'post'], result del result[:] def pre_err(target, source, env, result=result, **kw): result.append('pre_err') return 1 x = SCons.Executor.Executor(a, env, [], [t], ['s1', 's2']) x.add_pre_action(pre_err) x.add_post_action(post) try: x(t) except SCons.Errors.BuildError: pass else: raise Exception("Did not catch expected BuildError") assert result == ['pre_err'], result del result[:] def test_cleanup(self): """Test cleaning up an Executor""" orig_env = MyEnvironment(e=1) x = SCons.Executor.Executor('b', orig_env, [{'o':1}], 't', ['s1', 's2']) be = x.get_build_env() assert be['e'] == 1, be['e'] x.cleanup() x.env = MyEnvironment(eee=1) be = x.get_build_env() assert be['eee'] == 1, be['eee'] x.cleanup() be = x.get_build_env() assert be['eee'] == 1, be['eee'] def test_add_sources(self): """Test adding sources to an Executor""" x = SCons.Executor.Executor('b', 'e', 'o', 't', ['s1', 's2']) sources = x.get_all_sources() assert sources == ['s1', 's2'], sources x.add_sources(['s1', 's2']) sources = x.get_all_sources() assert sources == ['s1', 's2'], sources x.add_sources(['s3', 's1', 's4']) sources = x.get_all_sources() assert sources == ['s1', 's2', 's3', 's4'], sources def test_get_sources(self): """Test getting sources from an Executor""" x = SCons.Executor.Executor('b', 'e', 'o', 't', ['s1', 's2']) sources = x.get_sources() assert sources == ['s1', 's2'], sources x.add_sources(['s1', 's2']) sources = x.get_sources() assert sources == ['s1', 's2'], sources x.add_sources(['s3', 's1', 's4']) sources = x.get_sources() assert sources == ['s1', 's2', 's3', 's4'], sources def test_prepare(self): """Test the Executor's prepare() method""" env = MyEnvironment() t1 = MyNode('t1') s1 = MyNode('s1') s2 = MyNode('s2') s3 = MyNode('s3') x = SCons.Executor.Executor('b', env, [{}], [t1], [s1, s2, s3]) s2.missing_val = True try: r = x.prepare() except SCons.Errors.StopError as e: assert str(e) == "Source `s2' not found, needed by target `t1'.", e else: raise AssertionError("did not catch expected StopError: %s" % r) def test_add_pre_action(self): """Test adding pre-actions to an Executor""" x = SCons.Executor.Executor('b', 'e', 'o', 't', ['s1', 's2']) x.add_pre_action('a1') assert x.pre_actions == ['a1'] x.add_pre_action('a2') assert x.pre_actions == ['a1', 'a2'] def test_add_post_action(self): """Test adding post-actions to an Executor""" x = SCons.Executor.Executor('b', 'e', 'o', 't', ['s1', 's2']) x.add_post_action('a1') assert x.post_actions == ['a1'] x.add_post_action('a2') assert x.post_actions == ['a1', 'a2'] def test___str__(self): """Test the __str__() method""" env = MyEnvironment(S='string') x = SCons.Executor.Executor(MyAction(), env, [], ['t'], ['s']) c = str(x) assert c == 'GENSTRING action1 action2 t s', c x = SCons.Executor.Executor(MyAction(), env, [], ['t'], ['s']) x.add_pre_action(MyAction(['pre'])) x.add_post_action(MyAction(['post'])) c = str(x) expect = 'GENSTRING pre t s\n' + \ 'GENSTRING action1 action2 t s\n' + \ 'GENSTRING post t s' assert c == expect, c def test_nullify(self): """Test the nullify() method""" env = MyEnvironment(S='string') result = [] def action1(target, source, env, result=result, **kw): result.append('action1') env = MyEnvironment() a = MyAction([action1]) x = SCons.Executor.Executor(a, env, [], ['t1', 't2'], ['s1', 's2']) x(MyNode('', [], [])) assert result == ['action1'], result s = str(x) assert s[:10] == 'GENSTRING ', s del result[:] x.nullify() assert result == [], result x(MyNode('', [], [])) assert result == [], result s = str(x) assert s == '', s def test_get_contents(self): """Test fetching the signatures contents""" env = MyEnvironment(C='contents') x = SCons.Executor.Executor(MyAction(), env, [], ['t'], ['s']) c = x.get_contents() assert c == b'action1 action2 t s', c x = SCons.Executor.Executor(MyAction(actions=['grow']), env, [], ['t'], ['s']) x.add_pre_action(MyAction(['pre'])) x.add_post_action(MyAction(['post'])) c = x.get_contents() assert c == b'pre t sgrow t spost t s', c def test_get_timestamp(self): """Test fetching the "timestamp" """ x = SCons.Executor.Executor('b', 'e', 'o', 't', ['s1', 's2']) ts = x.get_timestamp() assert ts == 0, ts def test_scan_targets(self): """Test scanning the targets for implicit dependencies""" env = MyEnvironment(S='string') t1 = MyNode('t1') t2 = MyNode('t2') sources = [MyNode('s1'), MyNode('s2')] x = SCons.Executor.Executor(MyAction(), env, [{}], [t1, t2], sources) deps = x.scan_targets(None) assert t1.implicit == ['dep-t1', 'dep-t2'], t1.implicit assert t2.implicit == ['dep-t1', 'dep-t2'], t2.implicit t1.implicit = [] t2.implicit = [] deps = x.scan_targets(MyScanner('scanner-')) assert t1.implicit == ['scanner-t1', 'scanner-t2'], t1.implicit assert t2.implicit == ['scanner-t1', 'scanner-t2'], t2.implicit def test_scan_sources(self): """Test scanning the sources for implicit dependencies""" env = MyEnvironment(S='string') t1 = MyNode('t1') t2 = MyNode('t2') sources = [MyNode('s1'), MyNode('s2')] x = SCons.Executor.Executor(MyAction(), env, [{}], [t1, t2], sources) deps = x.scan_sources(None) assert t1.implicit == ['dep-s1', 'dep-s2'], t1.implicit assert t2.implicit == ['dep-s1', 'dep-s2'], t2.implicit t1.implicit = [] t2.implicit = [] deps = x.scan_sources(MyScanner('scanner-')) assert t1.implicit == ['scanner-s1', 'scanner-s2'], t1.implicit assert t2.implicit == ['scanner-s1', 'scanner-s2'], t2.implicit def test_get_unignored_sources(self): """Test fetching the unignored source list""" env = MyEnvironment() s1 = MyNode('s1') s2 = MyNode('s2') s3 = MyNode('s3') x = SCons.Executor.Executor('b', env, [{}], [], [s1, s2, s3]) r = x.get_unignored_sources(None, []) assert r == [s1, s2, s3], list(map(str, r)) r = x.get_unignored_sources(None, [s2]) assert r == [s1, s3], list(map(str, r)) r = x.get_unignored_sources(None, [s1, s3]) assert r == [s2], list(map(str, r)) def test_changed_sources_for_alwaysBuild(self): """ Ensure if a target is marked always build that the sources are always marked changed sources :return: """ env = MyEnvironment() s1 = MyNode('s1') s2 = MyNode('s2') t1 = MyNode('t1') t1.up_to_date = True t1.always_build = True x = SCons.Executor.Executor('b', env, [{}], [t1], [s1, s2]) changed_sources = x._get_changed_sources() assert changed_sources == [s1, s2], "If target marked AlwaysBuild sources should always be marked changed" if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ ExecutorTestCase ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/0000775000175000017500000000000013160023045017454 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/ipkg.py0000664000175000017500000000473513160023044020770 0ustar bdbaddogbdbaddog"""SCons.Tool.ipkg Tool-specific initialization for ipkg. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. The ipkg tool calls the ipkg-build. Its only argument should be the packages fake_root. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/ipkg.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import SCons.Builder def generate(env): """Add Builders and construction variables for ipkg to an Environment.""" try: bld = env['BUILDERS']['Ipkg'] except KeyError: bld = SCons.Builder.Builder(action='$IPKGCOM', suffix='$IPKGSUFFIX', source_scanner=None, target_scanner=None) env['BUILDERS']['Ipkg'] = bld env['IPKG'] = 'ipkg-build' env['IPKGCOM'] = '$IPKG $IPKGFLAGS ${SOURCE}' if env.WhereIs('id'): env['IPKGUSER'] = os.popen('id -un').read().strip() env['IPKGGROUP'] = os.popen('id -gn').read().strip() env['IPKGFLAGS'] = SCons.Util.CLVar('-o $IPKGUSER -g $IPKGGROUP') env['IPKGSUFFIX'] = '.ipk' def exists(env): """ Can we find the tool """ return env.Detect('ipkg-build') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/dvipdf.py0000664000175000017500000001004213160023044021276 0ustar bdbaddogbdbaddog"""SCons.Tool.dvipdf Tool-specific initialization for dvipdf. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/dvipdf.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Action import SCons.Defaults import SCons.Tool.pdf import SCons.Tool.tex import SCons.Util _null = SCons.Scanner.LaTeX._null def DviPdfPsFunction(XXXDviAction, target = None, source= None, env=None): """A builder for DVI files that sets the TEXPICTS environment variable before running dvi2ps or dvipdf.""" try: abspath = source[0].attributes.path except AttributeError : abspath = '' saved_env = SCons.Scanner.LaTeX.modify_env_var(env, 'TEXPICTS', abspath) result = XXXDviAction(target, source, env) if saved_env is _null: try: del env['ENV']['TEXPICTS'] except KeyError: pass # was never set else: env['ENV']['TEXPICTS'] = saved_env return result def DviPdfFunction(target = None, source= None, env=None): result = DviPdfPsFunction(PDFAction,target,source,env) return result def DviPdfStrFunction(target = None, source= None, env=None): """A strfunction for dvipdf that returns the appropriate command string for the no_exec options.""" if env.GetOption("no_exec"): result = env.subst('$DVIPDFCOM',0,target,source) else: result = '' return result PDFAction = None DVIPDFAction = None def PDFEmitter(target, source, env): """Strips any .aux or .log files from the input source list. These are created by the TeX Builder that in all likelihood was used to generate the .dvi file we're using as input, and we only care about the .dvi file. """ def strip_suffixes(n): return not SCons.Util.splitext(str(n))[1] in ['.aux', '.log'] source = [src for src in source if strip_suffixes(src)] return (target, source) def generate(env): """Add Builders and construction variables for dvipdf to an Environment.""" global PDFAction if PDFAction is None: PDFAction = SCons.Action.Action('$DVIPDFCOM', '$DVIPDFCOMSTR') global DVIPDFAction if DVIPDFAction is None: DVIPDFAction = SCons.Action.Action(DviPdfFunction, strfunction = DviPdfStrFunction) from . import pdf pdf.generate(env) bld = env['BUILDERS']['PDF'] bld.add_action('.dvi', DVIPDFAction) bld.add_emitter('.dvi', PDFEmitter) env['DVIPDF'] = 'dvipdf' env['DVIPDFFLAGS'] = SCons.Util.CLVar('') env['DVIPDFCOM'] = 'cd ${TARGET.dir} && $DVIPDF $DVIPDFFLAGS ${SOURCE.file} ${TARGET.file}' # Deprecated synonym. env['PDFCOM'] = ['$DVIPDFCOM'] def exists(env): SCons.Tool.tex.generate_darwin(env) return env.Detect('dvipdf') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/intelc.xml0000664000175000017500000000270013160023044021452 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Intel C/C++ compiler (Linux and Windows, version 7 and later). Calls the &t-gcc; or &t-msvc; (on Linux and Windows, respectively) to set underlying variables. CC CXX LINK AR INTEL_C_COMPILER_VERSION Set by the "intelc" Tool to the major version number of the Intel C compiler selected for use. scons-src-3.0.0/src/engine/SCons/Tool/tlib.py0000664000175000017500000000350513160023045020763 0ustar bdbaddogbdbaddog"""SCons.Tool.tlib XXX """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/tlib.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Tool import SCons.Tool.bcc32 import SCons.Util def generate(env): SCons.Tool.bcc32.findIt('tlib', env) """Add Builders and construction variables for ar to an Environment.""" SCons.Tool.createStaticLibBuilder(env) env['AR'] = 'tlib' env['ARFLAGS'] = SCons.Util.CLVar('') env['ARCOM'] = '$AR $TARGET $ARFLAGS /a $SOURCES' env['LIBPREFIX'] = '' env['LIBSUFFIX'] = '.lib' def exists(env): return SCons.Tool.bcc32.findIt('tlib', env) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/filesystem.py0000664000175000017500000000660413160023044022217 0ustar bdbaddogbdbaddog"""SCons.Tool.filesystem Tool-specific initialization for the filesystem tools. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/filesystem.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons from SCons.Tool.install import copyFunc copyToBuilder, copyAsBuilder = None, None def copyto_emitter(target, source, env): """ changes the path of the source to be under the target (which are assumed to be directories. """ n_target = [] for t in target: n_target = n_target + [t.File( str( s ) ) for s in source] return (n_target, source) def copy_action_func(target, source, env): assert( len(target) == len(source) ), "\ntarget: %s\nsource: %s" %(list(map(str, target)),list(map(str, source))) for t, s in zip(target, source): if copyFunc(t.get_path(), s.get_path(), env): return 1 return 0 def copy_action_str(target, source, env): return env.subst_target_source(env['COPYSTR'], 0, target, source) copy_action = SCons.Action.Action( copy_action_func, copy_action_str ) def generate(env): try: env['BUILDERS']['CopyTo'] env['BUILDERS']['CopyAs'] except KeyError as e: global copyToBuilder if copyToBuilder is None: copyToBuilder = SCons.Builder.Builder( action = copy_action, target_factory = env.fs.Dir, source_factory = env.fs.Entry, multi = 1, emitter = [ copyto_emitter, ] ) global copyAsBuilder if copyAsBuilder is None: copyAsBuilder = SCons.Builder.Builder( action = copy_action, target_factory = env.fs.Entry, source_factory = env.fs.Entry ) env['BUILDERS']['CopyTo'] = copyToBuilder env['BUILDERS']['CopyAs'] = copyAsBuilder env['COPYSTR'] = 'Copy file(s): "$SOURCES" to "$TARGETS"' def exists(env): return 1 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/default.xml0000664000175000017500000000202213160023041021612 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets variables by calling a default list of Tool modules for the platform on which SCons is running. scons-src-3.0.0/src/engine/SCons/Tool/msvs.py0000664000175000017500000023317013160023044021023 0ustar bdbaddogbdbaddog"""SCons.Tool.msvs Tool-specific initialization for Microsoft Visual Studio project files. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function __revision__ = "src/engine/SCons/Tool/msvs.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import base64 import hashlib import ntpath import os import pickle import re import sys import SCons.Builder import SCons.Node.FS import SCons.Platform.win32 import SCons.Script.SConscript import SCons.PathList import SCons.Util import SCons.Warnings from .MSCommon import msvc_exists, msvc_setup_env_once from SCons.Defaults import processDefines from SCons.compat import PICKLE_PROTOCOL ############################################################################## # Below here are the classes and functions for generation of # DSP/DSW/SLN/VCPROJ files. ############################################################################## def xmlify(s): s = s.replace("&", "&") # do this first s = s.replace("'", "'") s = s.replace('"', """) s = s.replace('<', "<") s = s.replace('>', ">") s = s.replace('\n', ' ') return s # Process a CPPPATH list in includes, given the env, target and source. # Returns a tuple of nodes. def processIncludes(includes, env, target, source): return SCons.PathList.PathList(includes).subst_path(env, target, source) external_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' def _generateGUID(slnfile, name): """This generates a dummy GUID for the sln file to use. It is based on the MD5 signatures of the sln filename plus the name of the project. It basically just needs to be unique, and not change with each invocation.""" m = hashlib.md5() # Normalize the slnfile path to a Windows path (\ separators) so # the generated file has a consistent GUID even if we generate # it on a non-Windows platform. m.update(bytearray(ntpath.normpath(str(slnfile)) + str(name),'utf-8')) solution = m.hexdigest().upper() # convert most of the signature to GUID form (discard the rest) solution = "{" + solution[:8] + "-" + solution[8:12] + "-" + solution[12:16] + "-" + solution[16:20] + "-" + solution[20:32] + "}" return solution version_re = re.compile(r'(\d+\.\d+)(.*)') def msvs_parse_version(s): """ Split a Visual Studio version, which may in fact be something like '7.0Exp', into is version number (returned as a float) and trailing "suite" portion. """ num, suite = version_re.match(s).groups() return float(num), suite # This is how we re-invoke SCons from inside MSVS Project files. # The problem is that we might have been invoked as either scons.bat # or scons.py. If we were invoked directly as scons.py, then we could # use sys.argv[0] to find the SCons "executable," but that doesn't work # if we were invoked as scons.bat, which uses "python -c" to execute # things and ends up with "-c" as sys.argv[0]. Consequently, we have # the MSVS Project file invoke SCons the same way that scons.bat does, # which works regardless of how we were invoked. def getExecScriptMain(env, xml=None): scons_home = env.get('SCONS_HOME') if not scons_home and 'SCONS_LIB_DIR' in os.environ: scons_home = os.environ['SCONS_LIB_DIR'] if scons_home: exec_script_main = "from os.path import join; import sys; sys.path = [ r'%s' ] + sys.path; import SCons.Script; SCons.Script.main()" % scons_home else: version = SCons.__version__ exec_script_main = "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%(version)s'), join(sys.prefix, 'scons-%(version)s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()" % locals() if xml: exec_script_main = xmlify(exec_script_main) return exec_script_main # The string for the Python executable we tell the Project file to use # is either sys.executable or, if an external PYTHON_ROOT environment # variable exists, $(PYTHON)ROOT\\python.exe (generalized a little to # pluck the actual executable name from sys.executable). try: python_root = os.environ['PYTHON_ROOT'] except KeyError: python_executable = sys.executable else: python_executable = os.path.join('$$(PYTHON_ROOT)', os.path.split(sys.executable)[1]) class Config(object): pass def splitFully(path): dir, base = os.path.split(path) if dir and dir != '' and dir != path: return splitFully(dir)+[base] if base == '': return [] return [base] def makeHierarchy(sources): '''Break a list of files into a hierarchy; for each value, if it is a string, then it is a file. If it is a dictionary, it is a folder. The string is the original path of the file.''' hierarchy = {} for file in sources: path = splitFully(file) if len(path): dict = hierarchy for part in path[:-1]: if part not in dict: dict[part] = {} dict = dict[part] dict[path[-1]] = file #else: # print 'Warning: failed to decompose path for '+str(file) return hierarchy class _UserGenerator(object): ''' Base class for .dsp.user file generator ''' # Default instance values. # Ok ... a bit defensive, but it does not seem reasonable to crash the # build for a workspace user file. :-) usrhead = None usrdebg = None usrconf = None createfile = False def __init__(self, dspfile, source, env): # DebugSettings should be a list of debug dictionary sorted in the same order # as the target list and variants if 'variant' not in env: raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\ "'Release') to create an MSVSProject.") elif SCons.Util.is_String(env['variant']): variants = [env['variant']] elif SCons.Util.is_List(env['variant']): variants = env['variant'] if 'DebugSettings' not in env or env['DebugSettings'] == None: dbg_settings = [] elif SCons.Util.is_Dict(env['DebugSettings']): dbg_settings = [env['DebugSettings']] elif SCons.Util.is_List(env['DebugSettings']): if len(env['DebugSettings']) != len(variants): raise SCons.Errors.InternalError("Sizes of 'DebugSettings' and 'variant' lists must be the same.") dbg_settings = [] for ds in env['DebugSettings']: if SCons.Util.is_Dict(ds): dbg_settings.append(ds) else: dbg_settings.append({}) else: dbg_settings = [] if len(dbg_settings) == 1: dbg_settings = dbg_settings * len(variants) self.createfile = self.usrhead and self.usrdebg and self.usrconf and \ dbg_settings and bool([ds for ds in dbg_settings if ds]) if self.createfile: dbg_settings = dict(list(zip(variants, dbg_settings))) for var, src in dbg_settings.items(): # Update only expected keys trg = {} for key in [k for k in list(self.usrdebg.keys()) if k in src]: trg[key] = str(src[key]) self.configs[var].debug = trg def UserHeader(self): encoding = self.env.subst('$MSVSENCODING') versionstr = self.versionstr self.usrfile.write(self.usrhead % locals()) def UserProject(self): pass def Build(self): if not self.createfile: return try: filename = self.dspabs +'.user' self.usrfile = open(filename, 'w') except IOError as detail: raise SCons.Errors.InternalError('Unable to open "' + filename + '" for writing:' + str(detail)) else: self.UserHeader() self.UserProject() self.usrfile.close() V9UserHeader = """\ \t """ V9UserConfiguration = """\ \t\t \t\t\t \t\t """ V9DebugSettings = { 'Command':'$(TargetPath)', 'WorkingDirectory': None, 'CommandArguments': None, 'Attach':'false', 'DebuggerType':'3', 'Remote':'1', 'RemoteMachine': None, 'RemoteCommand': None, 'HttpUrl': None, 'PDBPath': None, 'SQLDebugging': None, 'Environment': None, 'EnvironmentMerge':'true', 'DebuggerFlavor': None, 'MPIRunCommand': None, 'MPIRunArguments': None, 'MPIRunWorkingDirectory': None, 'ApplicationCommand': None, 'ApplicationArguments': None, 'ShimCommand': None, 'MPIAcceptMode': None, 'MPIAcceptFilter': None, } class _GenerateV7User(_UserGenerator): """Generates a Project file for MSVS .NET""" def __init__(self, dspfile, source, env): if self.version_num >= 9.0: self.usrhead = V9UserHeader self.usrconf = V9UserConfiguration self.usrdebg = V9DebugSettings _UserGenerator.__init__(self, dspfile, source, env) def UserProject(self): confkeys = sorted(self.configs.keys()) for kind in confkeys: variant = self.configs[kind].variant platform = self.configs[kind].platform debug = self.configs[kind].debug if debug: debug_settings = '\n'.join(['\t\t\t\t%s="%s"' % (key, xmlify(value)) for key, value in debug.items() if value is not None]) self.usrfile.write(self.usrconf % locals()) self.usrfile.write('\t\n') V10UserHeader = """\ """ V10UserConfiguration = """\ \t %(debug_settings)s \t """ V10DebugSettings = { 'LocalDebuggerCommand': None, 'LocalDebuggerCommandArguments': None, 'LocalDebuggerEnvironment': None, 'DebuggerFlavor': 'WindowsLocalDebugger', 'LocalDebuggerWorkingDirectory': None, 'LocalDebuggerAttach': None, 'LocalDebuggerDebuggerType': None, 'LocalDebuggerMergeEnvironment': None, 'LocalDebuggerSQLDebugging': None, 'RemoteDebuggerCommand': None, 'RemoteDebuggerCommandArguments': None, 'RemoteDebuggerWorkingDirectory': None, 'RemoteDebuggerServerName': None, 'RemoteDebuggerConnection': None, 'RemoteDebuggerDebuggerType': None, 'RemoteDebuggerAttach': None, 'RemoteDebuggerSQLDebugging': None, 'DeploymentDirectory': None, 'AdditionalFiles': None, 'RemoteDebuggerDeployDebugCppRuntime': None, 'WebBrowserDebuggerHttpUrl': None, 'WebBrowserDebuggerDebuggerType': None, 'WebServiceDebuggerHttpUrl': None, 'WebServiceDebuggerDebuggerType': None, 'WebServiceDebuggerSQLDebugging': None, } class _GenerateV10User(_UserGenerator): """Generates a Project'user file for MSVS 2010""" def __init__(self, dspfile, source, env): self.versionstr = '4.0' self.usrhead = V10UserHeader self.usrconf = V10UserConfiguration self.usrdebg = V10DebugSettings _UserGenerator.__init__(self, dspfile, source, env) def UserProject(self): confkeys = sorted(self.configs.keys()) for kind in confkeys: variant = self.configs[kind].variant platform = self.configs[kind].platform debug = self.configs[kind].debug if debug: debug_settings = '\n'.join(['\t\t<%s>%s' % (key, xmlify(value), key) for key, value in debug.items() if value is not None]) self.usrfile.write(self.usrconf % locals()) self.usrfile.write('') class _DSPGenerator(object): """ Base class for DSP generators """ srcargs = [ 'srcs', 'incs', 'localincs', 'resources', 'misc'] def __init__(self, dspfile, source, env): self.dspfile = str(dspfile) try: get_abspath = dspfile.get_abspath except AttributeError: self.dspabs = os.path.abspath(dspfile) else: self.dspabs = get_abspath() if 'variant' not in env: raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\ "'Release') to create an MSVSProject.") elif SCons.Util.is_String(env['variant']): variants = [env['variant']] elif SCons.Util.is_List(env['variant']): variants = env['variant'] if 'buildtarget' not in env or env['buildtarget'] == None: buildtarget = [''] elif SCons.Util.is_String(env['buildtarget']): buildtarget = [env['buildtarget']] elif SCons.Util.is_List(env['buildtarget']): if len(env['buildtarget']) != len(variants): raise SCons.Errors.InternalError("Sizes of 'buildtarget' and 'variant' lists must be the same.") buildtarget = [] for bt in env['buildtarget']: if SCons.Util.is_String(bt): buildtarget.append(bt) else: buildtarget.append(bt.get_abspath()) else: buildtarget = [env['buildtarget'].get_abspath()] if len(buildtarget) == 1: bt = buildtarget[0] buildtarget = [] for _ in variants: buildtarget.append(bt) if 'outdir' not in env or env['outdir'] == None: outdir = [''] elif SCons.Util.is_String(env['outdir']): outdir = [env['outdir']] elif SCons.Util.is_List(env['outdir']): if len(env['outdir']) != len(variants): raise SCons.Errors.InternalError("Sizes of 'outdir' and 'variant' lists must be the same.") outdir = [] for s in env['outdir']: if SCons.Util.is_String(s): outdir.append(s) else: outdir.append(s.get_abspath()) else: outdir = [env['outdir'].get_abspath()] if len(outdir) == 1: s = outdir[0] outdir = [] for v in variants: outdir.append(s) if 'runfile' not in env or env['runfile'] == None: runfile = buildtarget[-1:] elif SCons.Util.is_String(env['runfile']): runfile = [env['runfile']] elif SCons.Util.is_List(env['runfile']): if len(env['runfile']) != len(variants): raise SCons.Errors.InternalError("Sizes of 'runfile' and 'variant' lists must be the same.") runfile = [] for s in env['runfile']: if SCons.Util.is_String(s): runfile.append(s) else: runfile.append(s.get_abspath()) else: runfile = [env['runfile'].get_abspath()] if len(runfile) == 1: s = runfile[0] runfile = [] for v in variants: runfile.append(s) self.sconscript = env['MSVSSCONSCRIPT'] if 'cmdargs' not in env or env['cmdargs'] == None: cmdargs = [''] * len(variants) elif SCons.Util.is_String(env['cmdargs']): cmdargs = [env['cmdargs']] * len(variants) elif SCons.Util.is_List(env['cmdargs']): if len(env['cmdargs']) != len(variants): raise SCons.Errors.InternalError("Sizes of 'cmdargs' and 'variant' lists must be the same.") else: cmdargs = env['cmdargs'] self.env = env if 'name' in self.env: self.name = self.env['name'] else: self.name = os.path.basename(SCons.Util.splitext(self.dspfile)[0]) self.name = self.env.subst(self.name) sourcenames = [ 'Source Files', 'Header Files', 'Local Headers', 'Resource Files', 'Other Files'] self.sources = {} for n in sourcenames: self.sources[n] = [] self.configs = {} self.nokeep = 0 if 'nokeep' in env and env['variant'] != 0: self.nokeep = 1 if self.nokeep == 0 and os.path.exists(self.dspabs): self.Parse() for t in zip(sourcenames,self.srcargs): if t[1] in self.env: if SCons.Util.is_List(self.env[t[1]]): for i in self.env[t[1]]: if not i in self.sources[t[0]]: self.sources[t[0]].append(i) else: if not self.env[t[1]] in self.sources[t[0]]: self.sources[t[0]].append(self.env[t[1]]) for n in sourcenames: self.sources[n].sort(key=lambda a: a.lower()) def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, dspfile=dspfile): config = Config() config.buildtarget = buildtarget config.outdir = outdir config.cmdargs = cmdargs config.runfile = runfile match = re.match('(.*)\|(.*)', variant) if match: config.variant = match.group(1) config.platform = match.group(2) else: config.variant = variant config.platform = 'Win32' self.configs[variant] = config print("Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dspfile) + "'") for i in range(len(variants)): AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i]) self.platforms = [] for key in list(self.configs.keys()): platform = self.configs[key].platform if not platform in self.platforms: self.platforms.append(platform) def Build(self): pass V6DSPHeader = """\ # Microsoft Developer Studio Project File - Name="%(name)s" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) External Target" 0x0106 CFG=%(name)s - Win32 %(confkey)s !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "%(name)s.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "%(name)s.mak" CFG="%(name)s - Win32 %(confkey)s" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE """ class _GenerateV6DSP(_DSPGenerator): """Generates a Project file for MSVS 6.0""" def PrintHeader(self): # pick a default config confkeys = sorted(self.configs.keys()) name = self.name confkey = confkeys[0] self.file.write(V6DSPHeader % locals()) for kind in confkeys: self.file.write('!MESSAGE "%s - Win32 %s" (based on "Win32 (x86) External Target")\n' % (name, kind)) self.file.write('!MESSAGE \n\n') def PrintProject(self): name = self.name self.file.write('# Begin Project\n' '# PROP AllowPerConfigDependencies 0\n' '# PROP Scc_ProjName ""\n' '# PROP Scc_LocalPath ""\n\n') first = 1 confkeys = sorted(self.configs.keys()) for kind in confkeys: outdir = self.configs[kind].outdir buildtarget = self.configs[kind].buildtarget if first == 1: self.file.write('!IF "$(CFG)" == "%s - Win32 %s"\n\n' % (name, kind)) first = 0 else: self.file.write('\n!ELSEIF "$(CFG)" == "%s - Win32 %s"\n\n' % (name, kind)) env_has_buildtarget = 'MSVSBUILDTARGET' in self.env if not env_has_buildtarget: self.env['MSVSBUILDTARGET'] = buildtarget # have to write this twice, once with the BASE settings, and once without for base in ("BASE ",""): self.file.write('# PROP %sUse_MFC 0\n' '# PROP %sUse_Debug_Libraries ' % (base, base)) if kind.lower().find('debug') < 0: self.file.write('0\n') else: self.file.write('1\n') self.file.write('# PROP %sOutput_Dir "%s"\n' '# PROP %sIntermediate_Dir "%s"\n' % (base,outdir,base,outdir)) cmd = 'echo Starting SCons && ' + self.env.subst('$MSVSBUILDCOM', 1) self.file.write('# PROP %sCmd_Line "%s"\n' '# PROP %sRebuild_Opt "-c && %s"\n' '# PROP %sTarget_File "%s"\n' '# PROP %sBsc_Name ""\n' '# PROP %sTarget_Dir ""\n'\ %(base,cmd,base,cmd,base,buildtarget,base,base)) if not env_has_buildtarget: del self.env['MSVSBUILDTARGET'] self.file.write('\n!ENDIF\n\n' '# Begin Target\n\n') for kind in confkeys: self.file.write('# Name "%s - Win32 %s"\n' % (name,kind)) self.file.write('\n') first = 0 for kind in confkeys: if first == 0: self.file.write('!IF "$(CFG)" == "%s - Win32 %s"\n\n' % (name,kind)) first = 1 else: self.file.write('!ELSEIF "$(CFG)" == "%s - Win32 %s"\n\n' % (name,kind)) self.file.write('!ENDIF \n\n') self.PrintSourceFiles() self.file.write('# End Target\n' '# End Project\n') if self.nokeep == 0: # now we pickle some data and add it to the file -- MSDEV will ignore it. pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL) pdata = base64.encodestring(pdata).decode() self.file.write(pdata + '\n') pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL) pdata = base64.encodestring(pdata).decode() self.file.write(pdata + '\n') def PrintSourceFiles(self): categories = {'Source Files': 'cpp|c|cxx|l|y|def|odl|idl|hpj|bat', 'Header Files': 'h|hpp|hxx|hm|inl', 'Local Headers': 'h|hpp|hxx|hm|inl', 'Resource Files': 'r|rc|ico|cur|bmp|dlg|rc2|rct|bin|cnt|rtf|gif|jpg|jpeg|jpe', 'Other Files': ''} for kind in sorted(list(categories.keys()), key=lambda a: a.lower()): if not self.sources[kind]: continue # skip empty groups self.file.write('# Begin Group "' + kind + '"\n\n') typelist = categories[kind].replace('|', ';') self.file.write('# PROP Default_Filter "' + typelist + '"\n') for file in self.sources[kind]: file = os.path.normpath(file) self.file.write('# Begin Source File\n\n' 'SOURCE="' + file + '"\n' '# End Source File\n') self.file.write('# End Group\n') # add the SConscript file outside of the groups self.file.write('# Begin Source File\n\n' 'SOURCE="' + str(self.sconscript) + '"\n' '# End Source File\n') def Parse(self): try: dspfile = open(self.dspabs,'r') except IOError: return # doesn't exist yet, so can't add anything to configs. line = dspfile.readline() while line: if line.find("# End Project") > -1: break line = dspfile.readline() line = dspfile.readline() datas = line while line and line != '\n': line = dspfile.readline() datas = datas + line # OK, we've found our little pickled cache of data. try: datas = base64.decodestring(datas) data = pickle.loads(datas) except KeyboardInterrupt: raise except: return # unable to unpickle any data for some reason self.configs.update(data) data = None line = dspfile.readline() datas = line while line and line != '\n': line = dspfile.readline() datas = datas + line # OK, we've found our little pickled cache of data. # it has a "# " in front of it, so we strip that. try: datas = base64.decodestring(datas) data = pickle.loads(datas) except KeyboardInterrupt: raise except: return # unable to unpickle any data for some reason self.sources.update(data) def Build(self): try: self.file = open(self.dspabs,'w') except IOError as detail: raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail)) else: self.PrintHeader() self.PrintProject() self.file.close() V7DSPHeader = """\ """ V7DSPConfiguration = """\ \t\t \t\t\t \t\t """ V8DSPHeader = """\ """ V8DSPConfiguration = """\ \t\t \t\t\t \t\t """ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): """Generates a Project file for MSVS .NET""" def __init__(self, dspfile, source, env): _DSPGenerator.__init__(self, dspfile, source, env) self.version = env['MSVS_VERSION'] self.version_num, self.suite = msvs_parse_version(self.version) if self.version_num >= 9.0: self.versionstr = '9.00' self.dspheader = V8DSPHeader self.dspconfiguration = V8DSPConfiguration elif self.version_num >= 8.0: self.versionstr = '8.00' self.dspheader = V8DSPHeader self.dspconfiguration = V8DSPConfiguration else: if self.version_num >= 7.1: self.versionstr = '7.10' else: self.versionstr = '7.00' self.dspheader = V7DSPHeader self.dspconfiguration = V7DSPConfiguration self.file = None _GenerateV7User.__init__(self, dspfile, source, env) def PrintHeader(self): env = self.env versionstr = self.versionstr name = self.name encoding = self.env.subst('$MSVSENCODING') scc_provider = env.get('MSVS_SCC_PROVIDER', '') scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '') scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '') # MSVS_SCC_LOCAL_PATH is kept for backwards compatibility purpose and should # be deprecated as soon as possible. scc_local_path_legacy = env.get('MSVS_SCC_LOCAL_PATH', '') scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir) scc_local_path = os.path.relpath(scc_connection_root, os.path.dirname(self.dspabs)) project_guid = env.get('MSVS_PROJECT_GUID', '') if not project_guid: project_guid = _generateGUID(self.dspfile, '') if scc_provider != '': scc_attrs = '\tSccProjectName="%s"\n' % scc_project_name if scc_aux_path != '': scc_attrs += '\tSccAuxPath="%s"\n' % scc_aux_path scc_attrs += ('\tSccLocalPath="%s"\n' '\tSccProvider="%s"' % (scc_local_path, scc_provider)) elif scc_local_path_legacy != '': # This case is kept for backwards compatibility purpose and should # be deprecated as soon as possible. scc_attrs = ('\tSccProjectName="%s"\n' '\tSccLocalPath="%s"' % (scc_project_name, scc_local_path_legacy)) else: self.dspheader = self.dspheader.replace('%(scc_attrs)s\n', '') self.file.write(self.dspheader % locals()) self.file.write('\t\n') for platform in self.platforms: self.file.write( '\t\t\n' % platform) self.file.write('\t\n') if self.version_num >= 8.0: self.file.write('\t\n' '\t\n') def PrintProject(self): self.file.write('\t\n') confkeys = sorted(self.configs.keys()) for kind in confkeys: variant = self.configs[kind].variant platform = self.configs[kind].platform outdir = self.configs[kind].outdir buildtarget = self.configs[kind].buildtarget runfile = self.configs[kind].runfile cmdargs = self.configs[kind].cmdargs env_has_buildtarget = 'MSVSBUILDTARGET' in self.env if not env_has_buildtarget: self.env['MSVSBUILDTARGET'] = buildtarget starting = 'echo Starting SCons && ' if cmdargs: cmdargs = ' ' + cmdargs else: cmdargs = '' buildcmd = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs) rebuildcmd = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs) cleancmd = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs) # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE, # so they could vary depending on the command being generated. This code # assumes they don't. preprocdefs = xmlify(';'.join(processDefines(self.env.get('CPPDEFINES', [])))) includepath_Dirs = processIncludes(self.env.get('CPPPATH', []), self.env, None, None) includepath = xmlify(';'.join([str(x) for x in includepath_Dirs])) if not env_has_buildtarget: del self.env['MSVSBUILDTARGET'] self.file.write(self.dspconfiguration % locals()) self.file.write('\t\n') if self.version_num >= 7.1: self.file.write('\t\n' '\t\n') self.PrintSourceFiles() self.file.write('\n') if self.nokeep == 0: # now we pickle some data and add it to the file -- MSDEV will ignore it. pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL) pdata = base64.encodestring(pdata).decode() self.file.write('\n') def printSources(self, hierarchy, commonprefix): sorteditems = sorted(hierarchy.items(), key=lambda a: a[0].lower()) # First folders, then files for key, value in sorteditems: if SCons.Util.is_Dict(value): self.file.write('\t\t\t\n' % (key)) self.printSources(value, commonprefix) self.file.write('\t\t\t\n') for key, value in sorteditems: if SCons.Util.is_String(value): file = value if commonprefix: file = os.path.join(commonprefix, value) file = os.path.normpath(file) self.file.write('\t\t\t\n' '\t\t\t\n' % (file)) def PrintSourceFiles(self): categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat', 'Header Files': 'h;hpp;hxx;hm;inl', 'Local Headers': 'h;hpp;hxx;hm;inl', 'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe', 'Other Files': ''} self.file.write('\t\n') cats = sorted([k for k in list(categories.keys()) if self.sources[k]], key=lambda a: a.lower()) for kind in cats: if len(cats) > 1: self.file.write('\t\t\n' % (kind, categories[kind])) sources = self.sources[kind] # First remove any common prefix commonprefix = None s = list(map(os.path.normpath, sources)) # take the dirname because the prefix may include parts # of the filenames (e.g. if you have 'dir\abcd' and # 'dir\acde' then the cp will be 'dir\a' ) cp = os.path.dirname( os.path.commonprefix(s) ) if cp and s[0][len(cp)] == os.sep: # +1 because the filename starts after the separator sources = [s[len(cp)+1:] for s in sources] commonprefix = cp hierarchy = makeHierarchy(sources) self.printSources(hierarchy, commonprefix=commonprefix) if len(cats)>1: self.file.write('\t\t\n') # add the SConscript file outside of the groups self.file.write('\t\t\n' '\t\t\n' % str(self.sconscript)) self.file.write('\t\n' '\t\n' '\t\n') def Parse(self): try: dspfile = open(self.dspabs,'r') except IOError: return # doesn't exist yet, so can't add anything to configs. line = dspfile.readline() while line: if line.find('\n') def printFilters(self, hierarchy, name): sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower()) for key, value in sorteditems: if SCons.Util.is_Dict(value): filter_name = name + '\\' + key self.filters_file.write('\t\t\n' '\t\t\t%s\n' '\t\t\n' % (filter_name, _generateGUID(self.dspabs, filter_name))) self.printFilters(value, filter_name) def printSources(self, hierarchy, kind, commonprefix, filter_name): keywords = {'Source Files': 'ClCompile', 'Header Files': 'ClInclude', 'Local Headers': 'ClInclude', 'Resource Files': 'None', 'Other Files': 'None'} sorteditems = sorted(hierarchy.items(), key = lambda a: a[0].lower()) # First folders, then files for key, value in sorteditems: if SCons.Util.is_Dict(value): self.printSources(value, kind, commonprefix, filter_name + '\\' + key) for key, value in sorteditems: if SCons.Util.is_String(value): file = value if commonprefix: file = os.path.join(commonprefix, value) file = os.path.normpath(file) self.file.write('\t\t<%s Include="%s" />\n' % (keywords[kind], file)) self.filters_file.write('\t\t<%s Include="%s">\n' '\t\t\t%s\n' '\t\t\n' % (keywords[kind], file, filter_name, keywords[kind])) def PrintSourceFiles(self): categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat', 'Header Files': 'h;hpp;hxx;hm;inl', 'Local Headers': 'h;hpp;hxx;hm;inl', 'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe', 'Other Files': ''} cats = sorted([k for k in list(categories.keys()) if self.sources[k]], key = lambda a: a.lower()) # print vcxproj.filters file first self.filters_file.write('\t\n') for kind in cats: self.filters_file.write('\t\t\n' '\t\t\t{7b42d31d-d53c-4868-8b92-ca2bc9fc052f}\n' '\t\t\t%s\n' '\t\t\n' % (kind, categories[kind])) # First remove any common prefix sources = self.sources[kind] commonprefix = None s = list(map(os.path.normpath, sources)) # take the dirname because the prefix may include parts # of the filenames (e.g. if you have 'dir\abcd' and # 'dir\acde' then the cp will be 'dir\a' ) cp = os.path.dirname( os.path.commonprefix(s) ) if cp and s[0][len(cp)] == os.sep: # +1 because the filename starts after the separator sources = [s[len(cp)+1:] for s in sources] commonprefix = cp hierarchy = makeHierarchy(sources) self.printFilters(hierarchy, kind) self.filters_file.write('\t\n') # then print files and filters for kind in cats: self.file.write('\t\n') self.filters_file.write('\t\n') # First remove any common prefix sources = self.sources[kind] commonprefix = None s = list(map(os.path.normpath, sources)) # take the dirname because the prefix may include parts # of the filenames (e.g. if you have 'dir\abcd' and # 'dir\acde' then the cp will be 'dir\a' ) cp = os.path.dirname( os.path.commonprefix(s) ) if cp and s[0][len(cp)] == os.sep: # +1 because the filename starts after the separator sources = [s[len(cp)+1:] for s in sources] commonprefix = cp hierarchy = makeHierarchy(sources) self.printSources(hierarchy, kind, commonprefix, kind) self.file.write('\t\n') self.filters_file.write('\t\n') # add the SConscript file outside of the groups self.file.write('\t\n' '\t\t\n' #'\t\t\n' '\t\n' % str(self.sconscript)) def Parse(self): print("_GenerateV10DSP.Parse()") def Build(self): try: self.file = open(self.dspabs, 'w') except IOError as detail: raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail)) else: self.PrintHeader() self.PrintProject() self.file.close() _GenerateV10User.Build(self) class _DSWGenerator(object): """ Base class for DSW generators """ def __init__(self, dswfile, source, env): self.dswfile = os.path.normpath(str(dswfile)) self.dsw_folder_path = os.path.dirname(os.path.abspath(self.dswfile)) self.env = env if 'projects' not in env: raise SCons.Errors.UserError("You must specify a 'projects' argument to create an MSVSSolution.") projects = env['projects'] if not SCons.Util.is_List(projects): raise SCons.Errors.InternalError("The 'projects' argument must be a list of nodes.") projects = SCons.Util.flatten(projects) if len(projects) < 1: raise SCons.Errors.UserError("You must specify at least one project to create an MSVSSolution.") self.dspfiles = list(map(str, projects)) if 'name' in self.env: self.name = self.env['name'] else: self.name = os.path.basename(SCons.Util.splitext(self.dswfile)[0]) self.name = self.env.subst(self.name) def Build(self): pass class _GenerateV7DSW(_DSWGenerator): """Generates a Solution file for MSVS .NET""" def __init__(self, dswfile, source, env): _DSWGenerator.__init__(self, dswfile, source, env) self.file = None self.version = self.env['MSVS_VERSION'] self.version_num, self.suite = msvs_parse_version(self.version) self.versionstr = '7.00' if self.version_num >= 11.0: self.versionstr = '12.00' elif self.version_num >= 10.0: self.versionstr = '11.00' elif self.version_num >= 9.0: self.versionstr = '10.00' elif self.version_num >= 8.0: self.versionstr = '9.00' elif self.version_num >= 7.1: self.versionstr = '8.00' if 'slnguid' in env and env['slnguid']: self.slnguid = env['slnguid'] else: self.slnguid = _generateGUID(dswfile, self.name) self.configs = {} self.nokeep = 0 if 'nokeep' in env and env['variant'] != 0: self.nokeep = 1 if self.nokeep == 0 and os.path.exists(self.dswfile): self.Parse() def AddConfig(self, variant, dswfile=dswfile): config = Config() match = re.match('(.*)\|(.*)', variant) if match: config.variant = match.group(1) config.platform = match.group(2) else: config.variant = variant config.platform = 'Win32' self.configs[variant] = config print("Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dswfile) + "'") if 'variant' not in env: raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\ "'Release') to create an MSVS Solution File.") elif SCons.Util.is_String(env['variant']): AddConfig(self, env['variant']) elif SCons.Util.is_List(env['variant']): for variant in env['variant']: AddConfig(self, variant) self.platforms = [] for key in list(self.configs.keys()): platform = self.configs[key].platform if not platform in self.platforms: self.platforms.append(platform) def GenerateProjectFilesInfo(self): for dspfile in self.dspfiles: dsp_folder_path, name = os.path.split(dspfile) dsp_folder_path = os.path.abspath(dsp_folder_path) dsp_relative_folder_path = os.path.relpath(dsp_folder_path, self.dsw_folder_path) if dsp_relative_folder_path == os.curdir: dsp_relative_file_path = name else: dsp_relative_file_path = os.path.join(dsp_relative_folder_path, name) dspfile_info = {'NAME': name, 'GUID': _generateGUID(dspfile, ''), 'FOLDER_PATH': dsp_folder_path, 'FILE_PATH': dspfile, 'SLN_RELATIVE_FOLDER_PATH': dsp_relative_folder_path, 'SLN_RELATIVE_FILE_PATH': dsp_relative_file_path} self.dspfiles_info.append(dspfile_info) self.dspfiles_info = [] GenerateProjectFilesInfo(self) def Parse(self): try: dswfile = open(self.dswfile,'r') except IOError: return # doesn't exist yet, so can't add anything to configs. line = dswfile.readline() while line: if line[:9] == "EndGlobal": break line = dswfile.readline() line = dswfile.readline() datas = line while line: line = dswfile.readline() datas = datas + line # OK, we've found our little pickled cache of data. try: datas = base64.decodestring(datas) data = pickle.loads(datas) except KeyboardInterrupt: raise except: return # unable to unpickle any data for some reason self.configs.update(data) def PrintSolution(self): """Writes a solution file""" self.file.write('Microsoft Visual Studio Solution File, Format Version %s\n' % self.versionstr) if self.version_num >= 12.0: self.file.write('# Visual Studio 14\n') elif self.version_num >= 11.0: self.file.write('# Visual Studio 11\n') elif self.version_num >= 10.0: self.file.write('# Visual Studio 2010\n') elif self.version_num >= 9.0: self.file.write('# Visual Studio 2008\n') elif self.version_num >= 8.0: self.file.write('# Visual Studio 2005\n') for dspinfo in self.dspfiles_info: name = dspinfo['NAME'] base, suffix = SCons.Util.splitext(name) if suffix == '.vcproj': name = base self.file.write('Project("%s") = "%s", "%s", "%s"\n' % (external_makefile_guid, name, dspinfo['SLN_RELATIVE_FILE_PATH'], dspinfo['GUID'])) if self.version_num >= 7.1 and self.version_num < 8.0: self.file.write('\tProjectSection(ProjectDependencies) = postProject\n' '\tEndProjectSection\n') self.file.write('EndProject\n') self.file.write('Global\n') env = self.env if 'MSVS_SCC_PROVIDER' in env: scc_number_of_projects = len(self.dspfiles) + 1 slnguid = self.slnguid scc_provider = env.get('MSVS_SCC_PROVIDER', '').replace(' ', r'\u0020') scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '').replace(' ', r'\u0020') scc_connection_root = env.get('MSVS_SCC_CONNECTION_ROOT', os.curdir) scc_local_path = os.path.relpath(scc_connection_root, self.dsw_folder_path).replace('\\', '\\\\') self.file.write('\tGlobalSection(SourceCodeControl) = preSolution\n' '\t\tSccNumberOfProjects = %(scc_number_of_projects)d\n' '\t\tSccProjectName0 = %(scc_project_name)s\n' '\t\tSccLocalPath0 = %(scc_local_path)s\n' '\t\tSccProvider0 = %(scc_provider)s\n' '\t\tCanCheckoutShared = true\n' % locals()) sln_relative_path_from_scc = os.path.relpath(self.dsw_folder_path, scc_connection_root) if sln_relative_path_from_scc != os.curdir: self.file.write('\t\tSccProjectFilePathRelativizedFromConnection0 = %s\\\\\n' % sln_relative_path_from_scc.replace('\\', '\\\\')) if self.version_num < 8.0: # When present, SolutionUniqueID is automatically removed by VS 2005 # TODO: check for Visual Studio versions newer than 2005 self.file.write('\t\tSolutionUniqueID = %s\n' % slnguid) for dspinfo in self.dspfiles_info: i = self.dspfiles_info.index(dspinfo) + 1 dsp_relative_file_path = dspinfo['SLN_RELATIVE_FILE_PATH'].replace('\\', '\\\\') dsp_scc_relative_folder_path = os.path.relpath(dspinfo['FOLDER_PATH'], scc_connection_root).replace('\\', '\\\\') self.file.write('\t\tSccProjectUniqueName%(i)s = %(dsp_relative_file_path)s\n' '\t\tSccLocalPath%(i)d = %(scc_local_path)s\n' '\t\tCanCheckoutShared = true\n' '\t\tSccProjectFilePathRelativizedFromConnection%(i)s = %(dsp_scc_relative_folder_path)s\\\\\n' % locals()) self.file.write('\tEndGlobalSection\n') if self.version_num >= 8.0: self.file.write('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n') else: self.file.write('\tGlobalSection(SolutionConfiguration) = preSolution\n') confkeys = sorted(self.configs.keys()) cnt = 0 for name in confkeys: variant = self.configs[name].variant platform = self.configs[name].platform if self.version_num >= 8.0: self.file.write('\t\t%s|%s = %s|%s\n' % (variant, platform, variant, platform)) else: self.file.write('\t\tConfigName.%d = %s\n' % (cnt, variant)) cnt = cnt + 1 self.file.write('\tEndGlobalSection\n') if self.version_num <= 7.1: self.file.write('\tGlobalSection(ProjectDependencies) = postSolution\n' '\tEndGlobalSection\n') if self.version_num >= 8.0: self.file.write('\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n') else: self.file.write('\tGlobalSection(ProjectConfiguration) = postSolution\n') for name in confkeys: variant = self.configs[name].variant platform = self.configs[name].platform if self.version_num >= 8.0: for dspinfo in self.dspfiles_info: guid = dspinfo['GUID'] self.file.write('\t\t%s.%s|%s.ActiveCfg = %s|%s\n' '\t\t%s.%s|%s.Build.0 = %s|%s\n' % (guid,variant,platform,variant,platform,guid,variant,platform,variant,platform)) else: for dspinfo in self.dspfiles_info: guid = dspinfo['GUID'] self.file.write('\t\t%s.%s.ActiveCfg = %s|%s\n' '\t\t%s.%s.Build.0 = %s|%s\n' %(guid,variant,variant,platform,guid,variant,variant,platform)) self.file.write('\tEndGlobalSection\n') if self.version_num >= 8.0: self.file.write('\tGlobalSection(SolutionProperties) = preSolution\n' '\t\tHideSolutionNode = FALSE\n' '\tEndGlobalSection\n') else: self.file.write('\tGlobalSection(ExtensibilityGlobals) = postSolution\n' '\tEndGlobalSection\n' '\tGlobalSection(ExtensibilityAddIns) = postSolution\n' '\tEndGlobalSection\n') self.file.write('EndGlobal\n') if self.nokeep == 0: pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL) pdata = base64.encodestring(pdata).decode() self.file.write(pdata) self.file.write('\n') def Build(self): try: self.file = open(self.dswfile,'w') except IOError as detail: raise SCons.Errors.InternalError('Unable to open "' + self.dswfile + '" for writing:' + str(detail)) else: self.PrintSolution() self.file.close() V6DSWHeader = """\ Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "%(name)s"="%(dspfile)s" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### """ class _GenerateV6DSW(_DSWGenerator): """Generates a Workspace file for MSVS 6.0""" def PrintWorkspace(self): """ writes a DSW file """ name = self.name dspfile = os.path.relpath(self.dspfiles[0], self.dsw_folder_path) self.file.write(V6DSWHeader % locals()) def Build(self): try: self.file = open(self.dswfile,'w') except IOError as detail: raise SCons.Errors.InternalError('Unable to open "' + self.dswfile + '" for writing:' + str(detail)) else: self.PrintWorkspace() self.file.close() def GenerateDSP(dspfile, source, env): """Generates a Project file based on the version of MSVS that is being used""" version_num = 6.0 if 'MSVS_VERSION' in env: version_num, suite = msvs_parse_version(env['MSVS_VERSION']) if version_num >= 10.0: g = _GenerateV10DSP(dspfile, source, env) g.Build() elif version_num >= 7.0: g = _GenerateV7DSP(dspfile, source, env) g.Build() else: g = _GenerateV6DSP(dspfile, source, env) g.Build() def GenerateDSW(dswfile, source, env): """Generates a Solution/Workspace file based on the version of MSVS that is being used""" version_num = 6.0 if 'MSVS_VERSION' in env: version_num, suite = msvs_parse_version(env['MSVS_VERSION']) if version_num >= 7.0: g = _GenerateV7DSW(dswfile, source, env) g.Build() else: g = _GenerateV6DSW(dswfile, source, env) g.Build() ############################################################################## # Above here are the classes and functions for generation of # DSP/DSW/SLN/VCPROJ files. ############################################################################## def GetMSVSProjectSuffix(target, source, env, for_signature): return env['MSVS']['PROJECTSUFFIX'] def GetMSVSSolutionSuffix(target, source, env, for_signature): return env['MSVS']['SOLUTIONSUFFIX'] def GenerateProject(target, source, env): # generate the dsp file, according to the version of MSVS. builddspfile = target[0] dspfile = builddspfile.srcnode() # this detects whether or not we're using a VariantDir if not dspfile is builddspfile: try: bdsp = open(str(builddspfile), "w+") except IOError as detail: print('Unable to open "' + str(dspfile) + '" for writing:',detail,'\n') raise bdsp.write("This is just a placeholder file.\nThe real project file is here:\n%s\n" % dspfile.get_abspath()) GenerateDSP(dspfile, source, env) if env.get('auto_build_solution', 1): builddswfile = target[1] dswfile = builddswfile.srcnode() if not dswfile is builddswfile: try: bdsw = open(str(builddswfile), "w+") except IOError as detail: print('Unable to open "' + str(dspfile) + '" for writing:',detail,'\n') raise bdsw.write("This is just a placeholder file.\nThe real workspace file is here:\n%s\n" % dswfile.get_abspath()) GenerateDSW(dswfile, source, env) def GenerateSolution(target, source, env): GenerateDSW(target[0], source, env) def projectEmitter(target, source, env): """Sets up the DSP dependencies.""" # todo: Not sure what sets source to what user has passed as target, # but this is what happens. When that is fixed, we also won't have # to make the user always append env['MSVSPROJECTSUFFIX'] to target. if source[0] == target[0]: source = [] # make sure the suffix is correct for the version of MSVS we're running. (base, suff) = SCons.Util.splitext(str(target[0])) suff = env.subst('$MSVSPROJECTSUFFIX') target[0] = base + suff if not source: source = 'prj_inputs:' source = source + env.subst('$MSVSSCONSCOM', 1) source = source + env.subst('$MSVSENCODING', 1) # Project file depends on CPPDEFINES and CPPPATH preprocdefs = xmlify(';'.join(processDefines(env.get('CPPDEFINES', [])))) includepath_Dirs = processIncludes(env.get('CPPPATH', []), env, None, None) includepath = xmlify(';'.join([str(x) for x in includepath_Dirs])) source = source + "; ppdefs:%s incpath:%s"%(preprocdefs, includepath) if 'buildtarget' in env and env['buildtarget'] != None: if SCons.Util.is_String(env['buildtarget']): source = source + ' "%s"' % env['buildtarget'] elif SCons.Util.is_List(env['buildtarget']): for bt in env['buildtarget']: if SCons.Util.is_String(bt): source = source + ' "%s"' % bt else: try: source = source + ' "%s"' % bt.get_abspath() except AttributeError: raise SCons.Errors.InternalError("buildtarget can be a string, a node, a list of strings or nodes, or None") else: try: source = source + ' "%s"' % env['buildtarget'].get_abspath() except AttributeError: raise SCons.Errors.InternalError("buildtarget can be a string, a node, a list of strings or nodes, or None") if 'outdir' in env and env['outdir'] != None: if SCons.Util.is_String(env['outdir']): source = source + ' "%s"' % env['outdir'] elif SCons.Util.is_List(env['outdir']): for s in env['outdir']: if SCons.Util.is_String(s): source = source + ' "%s"' % s else: try: source = source + ' "%s"' % s.get_abspath() except AttributeError: raise SCons.Errors.InternalError("outdir can be a string, a node, a list of strings or nodes, or None") else: try: source = source + ' "%s"' % env['outdir'].get_abspath() except AttributeError: raise SCons.Errors.InternalError("outdir can be a string, a node, a list of strings or nodes, or None") if 'name' in env: if SCons.Util.is_String(env['name']): source = source + ' "%s"' % env['name'] else: raise SCons.Errors.InternalError("name must be a string") if 'variant' in env: if SCons.Util.is_String(env['variant']): source = source + ' "%s"' % env['variant'] elif SCons.Util.is_List(env['variant']): for variant in env['variant']: if SCons.Util.is_String(variant): source = source + ' "%s"' % variant else: raise SCons.Errors.InternalError("name must be a string or a list of strings") else: raise SCons.Errors.InternalError("variant must be a string or a list of strings") else: raise SCons.Errors.InternalError("variant must be specified") for s in _DSPGenerator.srcargs: if s in env: if SCons.Util.is_String(env[s]): source = source + ' "%s' % env[s] elif SCons.Util.is_List(env[s]): for t in env[s]: if SCons.Util.is_String(t): source = source + ' "%s"' % t else: raise SCons.Errors.InternalError(s + " must be a string or a list of strings") else: raise SCons.Errors.InternalError(s + " must be a string or a list of strings") source = source + ' "%s"' % str(target[0]) source = [SCons.Node.Python.Value(source)] targetlist = [target[0]] sourcelist = source if env.get('auto_build_solution', 1): env['projects'] = [env.File(t).srcnode() for t in targetlist] t, s = solutionEmitter(target, target, env) targetlist = targetlist + t # Beginning with Visual Studio 2010 for each project file (.vcxproj) we have additional file (.vcxproj.filters) version_num = 6.0 if 'MSVS_VERSION' in env: version_num, suite = msvs_parse_version(env['MSVS_VERSION']) if version_num >= 10.0: targetlist.append(targetlist[0] + '.filters') return (targetlist, sourcelist) def solutionEmitter(target, source, env): """Sets up the DSW dependencies.""" # todo: Not sure what sets source to what user has passed as target, # but this is what happens. When that is fixed, we also won't have # to make the user always append env['MSVSSOLUTIONSUFFIX'] to target. if source[0] == target[0]: source = [] # make sure the suffix is correct for the version of MSVS we're running. (base, suff) = SCons.Util.splitext(str(target[0])) suff = env.subst('$MSVSSOLUTIONSUFFIX') target[0] = base + suff if not source: source = 'sln_inputs:' if 'name' in env: if SCons.Util.is_String(env['name']): source = source + ' "%s"' % env['name'] else: raise SCons.Errors.InternalError("name must be a string") if 'variant' in env: if SCons.Util.is_String(env['variant']): source = source + ' "%s"' % env['variant'] elif SCons.Util.is_List(env['variant']): for variant in env['variant']: if SCons.Util.is_String(variant): source = source + ' "%s"' % variant else: raise SCons.Errors.InternalError("name must be a string or a list of strings") else: raise SCons.Errors.InternalError("variant must be a string or a list of strings") else: raise SCons.Errors.InternalError("variant must be specified") if 'slnguid' in env: if SCons.Util.is_String(env['slnguid']): source = source + ' "%s"' % env['slnguid'] else: raise SCons.Errors.InternalError("slnguid must be a string") if 'projects' in env: if SCons.Util.is_String(env['projects']): source = source + ' "%s"' % env['projects'] elif SCons.Util.is_List(env['projects']): for t in env['projects']: if SCons.Util.is_String(t): source = source + ' "%s"' % t source = source + ' "%s"' % str(target[0]) source = [SCons.Node.Python.Value(source)] return ([target[0]], source) projectAction = SCons.Action.Action(GenerateProject, None) solutionAction = SCons.Action.Action(GenerateSolution, None) projectBuilder = SCons.Builder.Builder(action = '$MSVSPROJECTCOM', suffix = '$MSVSPROJECTSUFFIX', emitter = projectEmitter) solutionBuilder = SCons.Builder.Builder(action = '$MSVSSOLUTIONCOM', suffix = '$MSVSSOLUTIONSUFFIX', emitter = solutionEmitter) default_MSVS_SConscript = None def generate(env): """Add Builders and construction variables for Microsoft Visual Studio project files to an Environment.""" try: env['BUILDERS']['MSVSProject'] except KeyError: env['BUILDERS']['MSVSProject'] = projectBuilder try: env['BUILDERS']['MSVSSolution'] except KeyError: env['BUILDERS']['MSVSSolution'] = solutionBuilder env['MSVSPROJECTCOM'] = projectAction env['MSVSSOLUTIONCOM'] = solutionAction if SCons.Script.call_stack: # XXX Need to find a way to abstract this; the build engine # shouldn't depend on anything in SCons.Script. env['MSVSSCONSCRIPT'] = SCons.Script.call_stack[0].sconscript else: global default_MSVS_SConscript if default_MSVS_SConscript is None: default_MSVS_SConscript = env.File('SConstruct') env['MSVSSCONSCRIPT'] = default_MSVS_SConscript env['MSVSSCONS'] = '"%s" -c "%s"' % (python_executable, getExecScriptMain(env)) env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.get_abspath()}" -f ${MSVSSCONSCRIPT.name}' env['MSVSSCONSCOM'] = '$MSVSSCONS $MSVSSCONSFLAGS' env['MSVSBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"' env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"' env['MSVSCLEANCOM'] = '$MSVSSCONSCOM -c "$MSVSBUILDTARGET"' # Set-up ms tools paths for default version msvc_setup_env_once(env) if 'MSVS_VERSION' in env: version_num, suite = msvs_parse_version(env['MSVS_VERSION']) else: (version_num, suite) = (7.0, None) # guess at a default if 'MSVS' not in env: env['MSVS'] = {} if (version_num < 7.0): env['MSVS']['PROJECTSUFFIX'] = '.dsp' env['MSVS']['SOLUTIONSUFFIX'] = '.dsw' elif (version_num < 10.0): env['MSVS']['PROJECTSUFFIX'] = '.vcproj' env['MSVS']['SOLUTIONSUFFIX'] = '.sln' else: env['MSVS']['PROJECTSUFFIX'] = '.vcxproj' env['MSVS']['SOLUTIONSUFFIX'] = '.sln' if (version_num >= 10.0): env['MSVSENCODING'] = 'utf-8' else: env['MSVSENCODING'] = 'Windows-1252' env['GET_MSVSPROJECTSUFFIX'] = GetMSVSProjectSuffix env['GET_MSVSSOLUTIONSUFFIX'] = GetMSVSSolutionSuffix env['MSVSPROJECTSUFFIX'] = '${GET_MSVSPROJECTSUFFIX}' env['MSVSSOLUTIONSUFFIX'] = '${GET_MSVSSOLUTIONSUFFIX}' env['SCONS_HOME'] = os.environ.get('SCONS_HOME') def exists(env): return msvc_exists() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/f08.py0000664000175000017500000000402313160023044020421 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.f08 Tool-specific initialization for the generic Posix f08 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ from __future__ import absolute_import # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/f08.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Util from . import fortran from SCons.Tool.FortranCommon import add_all_to_env, add_f08_to_env compilers = ['f08'] def generate(env): add_all_to_env(env) add_f08_to_env(env) fcomp = env.Detect(compilers) or 'f08' env['F08'] = fcomp env['SHF08'] = fcomp env['FORTRAN'] = fcomp env['SHFORTRAN'] = fcomp def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/rpcgen.py0000664000175000017500000000545513160023044021314 0ustar bdbaddogbdbaddog"""SCons.Tool.rpcgen Tool-specific initialization for RPCGEN tools. Three normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/rpcgen.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from SCons.Builder import Builder import SCons.Util cmd = "cd ${SOURCE.dir} && $RPCGEN -%s $RPCGENFLAGS %s -o ${TARGET.abspath} ${SOURCE.file}" rpcgen_client = cmd % ('l', '$RPCGENCLIENTFLAGS') rpcgen_header = cmd % ('h', '$RPCGENHEADERFLAGS') rpcgen_service = cmd % ('m', '$RPCGENSERVICEFLAGS') rpcgen_xdr = cmd % ('c', '$RPCGENXDRFLAGS') def generate(env): "Add RPCGEN Builders and construction variables for an Environment." client = Builder(action=rpcgen_client, suffix='_clnt.c', src_suffix='.x') header = Builder(action=rpcgen_header, suffix='.h', src_suffix='.x') service = Builder(action=rpcgen_service, suffix='_svc.c', src_suffix='.x') xdr = Builder(action=rpcgen_xdr, suffix='_xdr.c', src_suffix='.x') env.Append(BUILDERS={'RPCGenClient' : client, 'RPCGenHeader' : header, 'RPCGenService' : service, 'RPCGenXDR' : xdr}) env['RPCGEN'] = 'rpcgen' env['RPCGENFLAGS'] = SCons.Util.CLVar('') env['RPCGENCLIENTFLAGS'] = SCons.Util.CLVar('') env['RPCGENHEADERFLAGS'] = SCons.Util.CLVar('') env['RPCGENSERVICEFLAGS'] = SCons.Util.CLVar('') env['RPCGENXDRFLAGS'] = SCons.Util.CLVar('') def exists(env): return env.Detect('rpcgen') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/bcc32.xml0000664000175000017500000000264013160023041021070 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the bcc32 compiler. CC CCFLAGS CFLAGS CCCOM SHCC SHCCFLAGS SHCFLAGS SHCCCOM CPPDEFPREFIX CPPDEFSUFFIX INCPREFIX INCSUFFIX SHOBJSUFFIX CFILESUFFIX _CPPDEFFLAGS _CPPINCFLAGS scons-src-3.0.0/src/engine/SCons/Tool/MSCommon/0000775000175000017500000000000013160023041021140 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/MSCommon/vc.py0000664000175000017500000005274213160023041022134 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # TODO: # * supported arch for versions: for old versions of batch file without # argument, giving bogus argument cannot be detected, so we have to hardcode # this here # * print warning when msvc version specified but not found # * find out why warning do not print # * test on 64 bits XP + VS 2005 (and VS 6 if possible) # * SDK # * Assembly __revision__ = "src/engine/SCons/Tool/MSCommon/vc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Module for Visual C/C++ detection and configuration. """ import SCons.compat import SCons.Util import subprocess import os import platform from string import digits as string_digits import SCons.Warnings from . import common debug = common.debug from . import sdk get_installed_sdks = sdk.get_installed_sdks class VisualCException(Exception): pass class UnsupportedVersion(VisualCException): pass class UnsupportedArch(VisualCException): pass class MissingConfiguration(VisualCException): pass class NoVersionFound(VisualCException): pass class BatchFileExecutionError(VisualCException): pass # Dict to 'canonalize' the arch _ARCH_TO_CANONICAL = { "amd64" : "amd64", "emt64" : "amd64", "i386" : "x86", "i486" : "x86", "i586" : "x86", "i686" : "x86", "ia64" : "ia64", "itanium" : "ia64", "x86" : "x86", "x86_64" : "amd64", "x86_amd64" : "x86_amd64", # Cross compile to 64 bit from 32bits } # Given a (host, target) tuple, return the argument for the bat file. Both host # and targets should be canonalized. _HOST_TARGET_ARCH_TO_BAT_ARCH = { ("x86", "x86"): "x86", ("x86", "amd64"): "x86_amd64", ("x86", "x86_amd64"): "x86_amd64", ("amd64", "x86_amd64"): "x86_amd64", # This is present in (at least) VS2012 express ("amd64", "amd64"): "amd64", ("amd64", "x86"): "x86", ("x86", "ia64"): "x86_ia64" } def get_host_target(env): debug('vc.py:get_host_target()') host_platform = env.get('HOST_ARCH') if not host_platform: host_platform = platform.machine() # TODO(2.5): the native Python platform.machine() function returns # '' on all Python versions before 2.6, after which it also uses # PROCESSOR_ARCHITECTURE. if not host_platform: host_platform = os.environ.get('PROCESSOR_ARCHITECTURE', '') # Retain user requested TARGET_ARCH req_target_platform = env.get('TARGET_ARCH') debug('vc.py:get_host_target() req_target_platform:%s'%req_target_platform) if req_target_platform: # If user requested a specific platform then only try that one. target_platform = req_target_platform else: target_platform = host_platform try: host = _ARCH_TO_CANONICAL[host_platform.lower()] except KeyError as e: msg = "Unrecognized host architecture %s" raise ValueError(msg % repr(host_platform)) try: target = _ARCH_TO_CANONICAL[target_platform.lower()] except KeyError as e: all_archs = str(list(_ARCH_TO_CANONICAL.keys())) raise ValueError("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs)) return (host, target,req_target_platform) # If you update this, update SupportedVSList in Tool/MSCommon/vs.py, and the # MSVC_VERSION documentation in Tool/msvc.xml. _VCVER = ["14.1", "14.0", "14.0Exp", "12.0", "12.0Exp", "11.0", "11.0Exp", "10.0", "10.0Exp", "9.0", "9.0Exp","8.0", "8.0Exp","7.1", "7.0", "6.0"] _VCVER_TO_PRODUCT_DIR = { '14.1' : [ (SCons.Util.HKEY_LOCAL_MACHINE, r'')], # Visual Studio 2017 doesn't set this registry key anymore '14.0' : [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\14.0\Setup\VC\ProductDir')], '14.0Exp' : [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VCExpress\14.0\Setup\VC\ProductDir')], '12.0' : [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\12.0\Setup\VC\ProductDir'), ], '12.0Exp' : [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VCExpress\12.0\Setup\VC\ProductDir'), ], '11.0': [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\11.0\Setup\VC\ProductDir'), ], '11.0Exp' : [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VCExpress\11.0\Setup\VC\ProductDir'), ], '10.0': [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\10.0\Setup\VC\ProductDir'), ], '10.0Exp' : [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VCExpress\10.0\Setup\VC\ProductDir'), ], '9.0': [ (SCons.Util.HKEY_CURRENT_USER, r'Microsoft\DevDiv\VCForPython\9.0\installdir',), (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\9.0\Setup\VC\ProductDir',), ], '9.0Exp' : [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VCExpress\9.0\Setup\VC\ProductDir'), ], '8.0': [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\8.0\Setup\VC\ProductDir'), ], '8.0Exp': [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VCExpress\8.0\Setup\VC\ProductDir'), ], '7.1': [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\7.1\Setup\VC\ProductDir'), ], '7.0': [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\7.0\Setup\VC\ProductDir'), ], '6.0': [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++\ProductDir'), ] } def msvc_version_to_maj_min(msvc_version): msvc_version_numeric = ''.join([x for x in msvc_version if x in string_digits + '.']) t = msvc_version_numeric.split(".") if not len(t) == 2: raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric)) try: maj = int(t[0]) min = int(t[1]) return maj, min except ValueError as e: raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric)) def is_host_target_supported(host_target, msvc_version): """Return True if the given (host, target) tuple is supported given the msvc version. Parameters ---------- host_target: tuple tuple of (canonalized) host-target, e.g. ("x86", "amd64") for cross compilation from 32 bits windows to 64 bits. msvc_version: str msvc version (major.minor, e.g. 10.0) Note ---- This only check whether a given version *may* support the given (host, target), not that the toolchain is actually present on the machine. """ # We assume that any Visual Studio version supports x86 as a target if host_target[1] != "x86": maj, min = msvc_version_to_maj_min(msvc_version) if maj < 8: return False return True def find_vc_pdir_vswhere(msvc_version): """ Find the MSVC product directory using vswhere.exe . Run it asking for specified version and get MSVS install location :param msvc_version: :return: MSVC install dir """ vswhere_path = os.path.join( 'C:\\', 'Program Files (x86)', 'Microsoft Visual Studio', 'Installer', 'vswhere.exe' ) vswhere_cmd = [vswhere_path, '-version', msvc_version, '-property', 'installationPath'] if os.path.exists(vswhere_path): sp = subprocess.Popen(vswhere_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) vsdir, err = sp.communicate() vsdir = vsdir.decode("mbcs") vsdir = vsdir.rstrip() vc_pdir = os.path.join(vsdir, 'VC') return vc_pdir else: # No vswhere on system, no install info available return None def find_vc_pdir(msvc_version): """Try to find the product directory for the given version. Note ---- If for some reason the requested version could not be found, an exception which inherits from VisualCException will be raised.""" root = 'Software\\' try: hkeys = _VCVER_TO_PRODUCT_DIR[msvc_version] except KeyError: debug("Unknown version of MSVC: %s" % msvc_version) raise UnsupportedVersion("Unknown version %s" % msvc_version) for hkroot, key in hkeys: try: comps = None if not key: comps = find_vc_pdir_vswhere(msvc_version) if not comps: debug('find_vc_dir(): no VC found via vswhere for version {}'.format(repr(key))) raise SCons.Util.WinError else: if common.is_win64(): try: # ordinally at win64, try Wow6432Node first. comps = common.read_reg(root + 'Wow6432Node\\' + key, hkroot) except SCons.Util.WinError as e: # at Microsoft Visual Studio for Python 2.7, value is not in Wow6432Node pass if not comps: # not Win64, or Microsoft Visual Studio for Python 2.7 comps = common.read_reg(root + key, hkroot) except SCons.Util.WinError as e: debug('find_vc_dir(): no VC registry key {}'.format(repr(key))) else: debug('find_vc_dir(): found VC in registry: {}'.format(comps)) if os.path.exists(comps): return comps else: debug('find_vc_dir(): reg says dir is {}, but it does not exist. (ignoring)'.format(comps)) raise MissingConfiguration("registry dir {} not found on the filesystem".format(comps)) return None def find_batch_file(env,msvc_version,host_arch,target_arch): """ Find the location of the batch script which should set up the compiler for any TARGET_ARCH whose compilers were installed by Visual Studio/VCExpress """ pdir = find_vc_pdir(msvc_version) if pdir is None: raise NoVersionFound("No version of Visual Studio found") debug('vc.py: find_batch_file() pdir:{}'.format(pdir)) # filter out e.g. "Exp" from the version name msvc_ver_numeric = ''.join([x for x in msvc_version if x in string_digits + "."]) vernum = float(msvc_ver_numeric) if 7 <= vernum < 8: pdir = os.path.join(pdir, os.pardir, "Common7", "Tools") batfilename = os.path.join(pdir, "vsvars32.bat") elif vernum < 7: pdir = os.path.join(pdir, "Bin") batfilename = os.path.join(pdir, "vcvars32.bat") elif 8 <= vernum <= 14: batfilename = os.path.join(pdir, "vcvarsall.bat") else: # vernum >= 14.1 VS2017 and above batfilename = os.path.join(pdir, "Auxiliary", "Build", "vcvarsall.bat") if not os.path.exists(batfilename): debug("Not found: %s" % batfilename) batfilename = None installed_sdks=get_installed_sdks() for _sdk in installed_sdks: sdk_bat_file = _sdk.get_sdk_vc_script(host_arch,target_arch) if not sdk_bat_file: debug("vc.py:find_batch_file() not found:%s"%_sdk) else: sdk_bat_file_path = os.path.join(pdir,sdk_bat_file) if os.path.exists(sdk_bat_file_path): debug('vc.py:find_batch_file() sdk_bat_file_path:%s'%sdk_bat_file_path) return (batfilename,sdk_bat_file_path) return (batfilename,None) __INSTALLED_VCS_RUN = None def cached_get_installed_vcs(): global __INSTALLED_VCS_RUN if __INSTALLED_VCS_RUN is None: ret = get_installed_vcs() __INSTALLED_VCS_RUN = ret return __INSTALLED_VCS_RUN def get_installed_vcs(): installed_versions = [] for ver in _VCVER: debug('trying to find VC %s' % ver) try: if find_vc_pdir(ver): debug('found VC %s' % ver) installed_versions.append(ver) else: debug('find_vc_pdir return None for ver %s' % ver) except VisualCException as e: debug('did not find VC %s: caught exception %s' % (ver, str(e))) return installed_versions def reset_installed_vcs(): """Make it try again to find VC. This is just for the tests.""" __INSTALLED_VCS_RUN = None # Running these batch files isn't cheap: most of the time spent in # msvs.generate() is due to vcvars*.bat. In a build that uses "tools='msvs'" # in multiple environments, for example: # env1 = Environment(tools='msvs') # env2 = Environment(tools='msvs') # we can greatly improve the speed of the second and subsequent Environment # (or Clone) calls by memoizing the environment variables set by vcvars*.bat. script_env_stdout_cache = {} def script_env(script, args=None): cache_key = (script, args) stdout = script_env_stdout_cache.get(cache_key, None) if stdout is None: stdout = common.get_output(script, args) script_env_stdout_cache[cache_key] = stdout # Stupid batch files do not set return code: we take a look at the # beginning of the output for an error message instead olines = stdout.splitlines() if olines[0].startswith("The specified configuration type is missing"): raise BatchFileExecutionError("\n".join(olines[:2])) return common.parse_output(stdout) def get_default_version(env): debug('get_default_version()') msvc_version = env.get('MSVC_VERSION') msvs_version = env.get('MSVS_VERSION') debug('get_default_version(): msvc_version:%s msvs_version:%s'%(msvc_version,msvs_version)) if msvs_version and not msvc_version: SCons.Warnings.warn( SCons.Warnings.DeprecatedWarning, "MSVS_VERSION is deprecated: please use MSVC_VERSION instead ") return msvs_version elif msvc_version and msvs_version: if not msvc_version == msvs_version: SCons.Warnings.warn( SCons.Warnings.VisualVersionMismatch, "Requested msvc version (%s) and msvs version (%s) do " \ "not match: please use MSVC_VERSION only to request a " \ "visual studio version, MSVS_VERSION is deprecated" \ % (msvc_version, msvs_version)) return msvs_version if not msvc_version: installed_vcs = cached_get_installed_vcs() debug('installed_vcs:%s' % installed_vcs) if not installed_vcs: #msg = 'No installed VCs' #debug('msv %s\n' % repr(msg)) #SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, msg) debug('msvc_setup_env: No installed VCs') return None msvc_version = installed_vcs[0] debug('msvc_setup_env: using default installed MSVC version %s\n' % repr(msvc_version)) return msvc_version def msvc_setup_env_once(env): try: has_run = env["MSVC_SETUP_RUN"] except KeyError: has_run = False if not has_run: msvc_setup_env(env) env["MSVC_SETUP_RUN"] = True def msvc_find_valid_batch_script(env,version): debug('vc.py:msvc_find_valid_batch_script()') # Find the host platform, target platform, and if present the requested # target platform (host_platform, target_platform,req_target_platform) = get_host_target(env) try_target_archs = [target_platform] debug("msvs_find_valid_batch_script(): req_target_platform %s target_platform:%s"%(req_target_platform,target_platform)) # VS2012 has a "cross compile" environment to build 64 bit # with x86_amd64 as the argument to the batch setup script if req_target_platform in ('amd64','x86_64'): try_target_archs.append('x86_amd64') elif not req_target_platform and target_platform in ['amd64','x86_64']: # There may not be "native" amd64, but maybe "cross" x86_amd64 tools try_target_archs.append('x86_amd64') # If the user hasn't specifically requested a TARGET_ARCH, and # The TARGET_ARCH is amd64 then also try 32 bits if there are no viable # 64 bit tools installed try_target_archs.append('x86') debug("msvs_find_valid_batch_script(): host_platform: %s try_target_archs:%s"%(host_platform, try_target_archs)) d = None for tp in try_target_archs: # Set to current arch. env['TARGET_ARCH']=tp debug("vc.py:msvc_find_valid_batch_script() trying target_platform:%s"%tp) host_target = (host_platform, tp) if not is_host_target_supported(host_target, version): warn_msg = "host, target = %s not supported for MSVC version %s" % \ (host_target, version) SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) arg = _HOST_TARGET_ARCH_TO_BAT_ARCH[host_target] # Get just version numbers maj, min = msvc_version_to_maj_min(version) # VS2015+ if maj >= 14: if env.get('MSVC_UWP_APP') == '1': # Initialize environment variables with store/universal paths arg += ' store' # Try to locate a batch file for this host/target platform combo try: (vc_script,sdk_script) = find_batch_file(env,version,host_platform,tp) debug('vc.py:msvc_find_valid_batch_script() vc_script:%s sdk_script:%s'%(vc_script,sdk_script)) except VisualCException as e: msg = str(e) debug('Caught exception while looking for batch file (%s)' % msg) warn_msg = "VC version %s not installed. " + \ "C/C++ compilers are most likely not set correctly.\n" + \ " Installed versions are: %s" warn_msg = warn_msg % (version, cached_get_installed_vcs()) SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) continue # Try to use the located batch file for this host/target platform combo debug('vc.py:msvc_find_valid_batch_script() use_script 2 %s, args:%s\n' % (repr(vc_script), arg)) if vc_script: try: d = script_env(vc_script, args=arg) except BatchFileExecutionError as e: debug('vc.py:msvc_find_valid_batch_script() use_script 3: failed running VC script %s: %s: Error:%s'%(repr(vc_script),arg,e)) vc_script=None continue if not vc_script and sdk_script: debug('vc.py:msvc_find_valid_batch_script() use_script 4: trying sdk script: %s'%(sdk_script)) try: d = script_env(sdk_script) except BatchFileExecutionError as e: debug('vc.py:msvc_find_valid_batch_script() use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script),e)) continue elif not vc_script and not sdk_script: debug('vc.py:msvc_find_valid_batch_script() use_script 6: Neither VC script nor SDK script found') continue debug("vc.py:msvc_find_valid_batch_script() Found a working script/target: %s %s"%(repr(sdk_script),arg)) break # We've found a working target_platform, so stop looking # If we cannot find a viable installed compiler, reset the TARGET_ARCH # To it's initial value if not d: env['TARGET_ARCH']=req_target_platform return d def msvc_setup_env(env): debug('msvc_setup_env()') version = get_default_version(env) if version is None: warn_msg = "No version of Visual Studio compiler found - C/C++ " \ "compilers most likely not set correctly" SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) return None debug('msvc_setup_env: using specified MSVC version %s\n' % repr(version)) # XXX: we set-up both MSVS version for backward # compatibility with the msvs tool env['MSVC_VERSION'] = version env['MSVS_VERSION'] = version env['MSVS'] = {} use_script = env.get('MSVC_USE_SCRIPT', True) if SCons.Util.is_String(use_script): debug('vc.py:msvc_setup_env() use_script 1 %s\n' % repr(use_script)) d = script_env(use_script) elif use_script: d = msvc_find_valid_batch_script(env,version) debug('vc.py:msvc_setup_env() use_script 2 %s\n' % d) if not d: return d else: debug('MSVC_USE_SCRIPT set to False') warn_msg = "MSVC_USE_SCRIPT set to False, assuming environment " \ "set correctly." SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) return None for k, v in d.items(): debug('vc.py:msvc_setup_env() env:%s -> %s'%(k,v)) env.PrependENVPath(k, v, delete_existing=True) def msvc_exists(version=None): vcs = cached_get_installed_vcs() if version is None: return len(vcs) > 0 return version in vcs scons-src-3.0.0/src/engine/SCons/Tool/MSCommon/__init__.py0000664000175000017500000000413413160023041023253 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """ Common functions for Microsoft Visual Studio and Visual C/C++. """ import copy import os import re import subprocess import SCons.Errors import SCons.Platform.win32 import SCons.Util from SCons.Tool.MSCommon.sdk import mssdk_exists, \ mssdk_setup_env from SCons.Tool.MSCommon.vc import msvc_exists, \ msvc_setup_env, \ msvc_setup_env_once, \ msvc_version_to_maj_min from SCons.Tool.MSCommon.vs import get_default_version, \ get_vs_by_version, \ merge_default_version, \ msvs_exists, \ query_versions # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/MSCommon/common.py0000664000175000017500000002167613160023041023016 0ustar bdbaddogbdbaddog""" Common helper functions for working with the Microsoft tool chain. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/Tool/MSCommon/common.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import copy import os import subprocess import re import SCons.Util LOGFILE = os.environ.get('SCONS_MSCOMMON_DEBUG') if LOGFILE == '-': def debug(message): print(message) elif LOGFILE: try: import logging except ImportError: debug = lambda message: open(LOGFILE, 'a').write(message + '\n') else: logging.basicConfig(filename=LOGFILE, level=logging.DEBUG) debug = logging.debug else: debug = lambda x: None _is_win64 = None def is_win64(): """Return true if running on windows 64 bits. Works whether python itself runs in 64 bits or 32 bits.""" # Unfortunately, python does not provide a useful way to determine # if the underlying Windows OS is 32-bit or 64-bit. Worse, whether # the Python itself is 32-bit or 64-bit affects what it returns, # so nothing in sys.* or os.* help. # Apparently the best solution is to use env vars that Windows # sets. If PROCESSOR_ARCHITECTURE is not x86, then the python # process is running in 64 bit mode (on a 64-bit OS, 64-bit # hardware, obviously). # If this python is 32-bit but the OS is 64, Windows will set # ProgramW6432 and PROCESSOR_ARCHITEW6432 to non-null. # (Checking for HKLM\Software\Wow6432Node in the registry doesn't # work, because some 32-bit installers create it.) global _is_win64 if _is_win64 is None: # I structured these tests to make it easy to add new ones or # add exceptions in the future, because this is a bit fragile. _is_win64 = False if os.environ.get('PROCESSOR_ARCHITECTURE', 'x86') != 'x86': _is_win64 = True if os.environ.get('PROCESSOR_ARCHITEW6432'): _is_win64 = True if os.environ.get('ProgramW6432'): _is_win64 = True return _is_win64 def read_reg(value, hkroot=SCons.Util.HKEY_LOCAL_MACHINE): return SCons.Util.RegGetValue(hkroot, value)[0] def has_reg(value): """Return True if the given key exists in HKEY_LOCAL_MACHINE, False otherwise.""" try: SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, value) ret = True except SCons.Util.WinError: ret = False return ret # Functions for fetching environment variable settings from batch files. def normalize_env(env, keys, force=False): """Given a dictionary representing a shell environment, add the variables from os.environ needed for the processing of .bat files; the keys are controlled by the keys argument. It also makes sure the environment values are correctly encoded. If force=True, then all of the key values that exist are copied into the returned dictionary. If force=false, values are only copied if the key does not already exist in the copied dictionary. Note: the environment is copied.""" normenv = {} if env: for k in list(env.keys()): normenv[k] = copy.deepcopy(env[k]) for k in keys: if k in os.environ and (force or not k in normenv): normenv[k] = os.environ[k] # This shouldn't be necessary, since the default environment should include system32, # but keep this here to be safe, since it's needed to find reg.exe which the MSVC # bat scripts use. sys32_dir = os.path.join(os.environ.get("SystemRoot", os.environ.get("windir", r"C:\Windows\system32")), "System32") if sys32_dir not in normenv['PATH']: normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_dir # Without Wbem in PATH, vcvarsall.bat has a "'wmic' is not recognized" # error starting with Visual Studio 2017, although the script still # seems to work anyway. sys32_wbem_dir = os.path.join(sys32_dir, 'Wbem') if sys32_wbem_dir not in normenv['PATH']: normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_wbem_dir debug("PATH: %s"%normenv['PATH']) return normenv def get_output(vcbat, args = None, env = None): """Parse the output of given bat file, with given args.""" if env is None: # Create a blank environment, for use in launching the tools env = SCons.Environment.Environment(tools=[]) # TODO: This is a hard-coded list of the variables that (may) need # to be imported from os.environ[] for v[sc]*vars*.bat file # execution to work. This list should really be either directly # controlled by vc.py, or else derived from the common_tools_var # settings in vs.py. vs_vc_vars = [ 'COMSPEC', # VS100 and VS110: Still set, but modern MSVC setup scripts will # discard these if registry has values. However Intel compiler setup # script still requires these as of 2013/2014. 'VS140COMNTOOLS', 'VS120COMNTOOLS', 'VS110COMNTOOLS', 'VS100COMNTOOLS', 'VS90COMNTOOLS', 'VS80COMNTOOLS', 'VS71COMNTOOLS', 'VS70COMNTOOLS', 'VS60COMNTOOLS', ] env['ENV'] = normalize_env(env['ENV'], vs_vc_vars, force=False) if args: debug("Calling '%s %s'" % (vcbat, args)) popen = SCons.Action._subproc(env, '"%s" %s & set' % (vcbat, args), stdin='devnull', stdout=subprocess.PIPE, stderr=subprocess.PIPE) else: debug("Calling '%s'" % vcbat) popen = SCons.Action._subproc(env, '"%s" & set' % vcbat, stdin='devnull', stdout=subprocess.PIPE, stderr=subprocess.PIPE) # Use the .stdout and .stderr attributes directly because the # .communicate() method uses the threading module on Windows # and won't work under Pythons not built with threading. stdout = popen.stdout.read() stderr = popen.stderr.read() # Extra debug logic, uncomment if necessary # debug('get_output():stdout:%s'%stdout) # debug('get_output():stderr:%s'%stderr) if stderr: # TODO: find something better to do with stderr; # this at least prevents errors from getting swallowed. import sys sys.stderr.write(stderr) if popen.wait() != 0: raise IOError(stderr.decode("mbcs")) output = stdout.decode("mbcs") return output def parse_output(output, keep=("INCLUDE", "LIB", "LIBPATH", "PATH")): """ Parse output from running visual c++/studios vcvarsall.bat and running set To capture the values listed in keep """ # dkeep is a dict associating key: path_list, where key is one item from # keep, and pat_list the associated list of paths dkeep = dict([(i, []) for i in keep]) # rdk will keep the regex to match the .bat file output line starts rdk = {} for i in keep: rdk[i] = re.compile('%s=(.*)' % i, re.I) def add_env(rmatch, key, dkeep=dkeep): path_list = rmatch.group(1).split(os.pathsep) for path in path_list: # Do not add empty paths (when a var ends with ;) if path: # XXX: For some reason, VC98 .bat file adds "" around the PATH # values, and it screws up the environment later, so we strip # it. path = path.strip('"') dkeep[key].append(str(path)) for line in output.splitlines(): for k, value in rdk.items(): match = value.match(line) if match: add_env(match, k) return dkeep # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/MSCommon/sdk.py0000664000175000017500000003507313160023041022303 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Module to detect the Platform/Windows SDK PSDK 2003 R1 is the earliest version detected. """ import os import SCons.Errors import SCons.Util from . import common debug = common.debug # SDK Checks. This is of course a mess as everything else on MS platforms. Here # is what we do to detect the SDK: # # For Windows SDK >= 6.0: just look into the registry entries: # HKLM\Software\Microsoft\Microsoft SDKs\Windows # All the keys in there are the available versions. # # For Platform SDK before 6.0 (2003 server R1 and R2, etc...), there does not # seem to be any sane registry key, so the precise location is hardcoded. # # For versions below 2003R1, it seems the PSDK is included with Visual Studio? # # Also, per the following: # http://benjamin.smedbergs.us/blog/tag/atl/ # VC++ Professional comes with the SDK, VC++ Express does not. # Location of the SDK (checked for 6.1 only) _CURINSTALLED_SDK_HKEY_ROOT = \ r"Software\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder" class SDKDefinition(object): """ An abstract base class for trying to find installed SDK directories. """ def __init__(self, version, **kw): self.version = version self.__dict__.update(kw) def find_sdk_dir(self): """Try to find the MS SDK from the registry. Return None if failed or the directory does not exist. """ if not SCons.Util.can_read_reg: debug('find_sdk_dir(): can not read registry') return None hkey = self.HKEY_FMT % self.hkey_data debug('find_sdk_dir(): checking registry:{}'.format(hkey)) try: sdk_dir = common.read_reg(hkey) except SCons.Util.WinError as e: debug('find_sdk_dir(): no SDK registry key {}'.format(repr(hkey))) return None debug('find_sdk_dir(): Trying SDK Dir: {}'.format(sdk_dir)) if not os.path.exists(sdk_dir): debug('find_sdk_dir(): {} not on file system'.format(sdk_dir)) return None ftc = os.path.join(sdk_dir, self.sanity_check_file) if not os.path.exists(ftc): debug("find_sdk_dir(): sanity check {} not found".format(ftc)) return None return sdk_dir def get_sdk_dir(self): """Return the MSSSDK given the version string.""" try: return self._sdk_dir except AttributeError: sdk_dir = self.find_sdk_dir() self._sdk_dir = sdk_dir return sdk_dir def get_sdk_vc_script(self,host_arch, target_arch): """ Return the script to initialize the VC compiler installed by SDK """ if (host_arch == 'amd64' and target_arch == 'x86'): # No cross tools needed compiling 32 bits on 64 bit machine host_arch=target_arch arch_string=target_arch if (host_arch != target_arch): arch_string='%s_%s'%(host_arch,target_arch) debug("sdk.py: get_sdk_vc_script():arch_string:%s host_arch:%s target_arch:%s"%(arch_string, host_arch, target_arch)) file=self.vc_setup_scripts.get(arch_string,None) debug("sdk.py: get_sdk_vc_script():file:%s"%file) return file class WindowsSDK(SDKDefinition): """ A subclass for trying to find installed Windows SDK directories. """ HKEY_FMT = r'Software\Microsoft\Microsoft SDKs\Windows\v%s\InstallationFolder' def __init__(self, *args, **kw): SDKDefinition.__init__(self, *args, **kw) self.hkey_data = self.version class PlatformSDK(SDKDefinition): """ A subclass for trying to find installed Platform SDK directories. """ HKEY_FMT = r'Software\Microsoft\MicrosoftSDK\InstalledSDKS\%s\Install Dir' def __init__(self, *args, **kw): SDKDefinition.__init__(self, *args, **kw) self.hkey_data = self.uuid # # The list of VC initialization scripts installed by the SDK # These should be tried if the vcvarsall.bat TARGET_ARCH fails preSDK61VCSetupScripts = { 'x86' : r'bin\vcvars32.bat', 'amd64' : r'bin\vcvarsamd64.bat', 'x86_amd64': r'bin\vcvarsx86_amd64.bat', 'x86_ia64' : r'bin\vcvarsx86_ia64.bat', 'ia64' : r'bin\vcvarsia64.bat'} SDK61VCSetupScripts = {'x86' : r'bin\vcvars32.bat', 'amd64' : r'bin\amd64\vcvarsamd64.bat', 'x86_amd64': r'bin\x86_amd64\vcvarsx86_amd64.bat', 'x86_ia64' : r'bin\x86_ia64\vcvarsx86_ia64.bat', 'ia64' : r'bin\ia64\vcvarsia64.bat'} SDK70VCSetupScripts = { 'x86' : r'bin\vcvars32.bat', 'amd64' : r'bin\vcvars64.bat', 'x86_amd64': r'bin\vcvarsx86_amd64.bat', 'x86_ia64' : r'bin\vcvarsx86_ia64.bat', 'ia64' : r'bin\vcvarsia64.bat'} SDK100VCSetupScripts = {'x86' : r'bin\vcvars32.bat', 'amd64' : r'bin\vcvars64.bat', 'x86_amd64': r'bin\x86_amd64\vcvarsx86_amd64.bat', 'x86_arm' : r'bin\x86_arm\vcvarsx86_arm.bat'} # The list of support SDKs which we know how to detect. # # The first SDK found in the list is the one used by default if there # are multiple SDKs installed. Barring good reasons to the contrary, # this means we should list SDKs from most recent to oldest. # # If you update this list, update the documentation in Tool/mssdk.xml. SupportedSDKList = [ WindowsSDK('10.0', sanity_check_file=r'bin\SetEnv.Cmd', include_subdir='include', lib_subdir={ 'x86' : ['lib'], 'x86_64' : [r'lib\x64'], 'ia64' : [r'lib\ia64'], }, vc_setup_scripts = SDK70VCSetupScripts, ), WindowsSDK('7.1', sanity_check_file=r'bin\SetEnv.Cmd', include_subdir='include', lib_subdir={ 'x86' : ['lib'], 'x86_64' : [r'lib\x64'], 'ia64' : [r'lib\ia64'], }, vc_setup_scripts = SDK70VCSetupScripts, ), WindowsSDK('7.0A', sanity_check_file=r'bin\SetEnv.Cmd', include_subdir='include', lib_subdir={ 'x86' : ['lib'], 'x86_64' : [r'lib\x64'], 'ia64' : [r'lib\ia64'], }, vc_setup_scripts = SDK70VCSetupScripts, ), WindowsSDK('7.0', sanity_check_file=r'bin\SetEnv.Cmd', include_subdir='include', lib_subdir={ 'x86' : ['lib'], 'x86_64' : [r'lib\x64'], 'ia64' : [r'lib\ia64'], }, vc_setup_scripts = SDK70VCSetupScripts, ), WindowsSDK('6.1', sanity_check_file=r'bin\SetEnv.Cmd', include_subdir='include', lib_subdir={ 'x86' : ['lib'], 'x86_64' : [r'lib\x64'], 'ia64' : [r'lib\ia64'], }, vc_setup_scripts = SDK61VCSetupScripts, ), WindowsSDK('6.0A', sanity_check_file=r'include\windows.h', include_subdir='include', lib_subdir={ 'x86' : ['lib'], 'x86_64' : [r'lib\x64'], 'ia64' : [r'lib\ia64'], }, vc_setup_scripts = preSDK61VCSetupScripts, ), WindowsSDK('6.0', sanity_check_file=r'bin\gacutil.exe', include_subdir='include', lib_subdir='lib', vc_setup_scripts = preSDK61VCSetupScripts, ), PlatformSDK('2003R2', sanity_check_file=r'SetEnv.Cmd', uuid="D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1", vc_setup_scripts = preSDK61VCSetupScripts, ), PlatformSDK('2003R1', sanity_check_file=r'SetEnv.Cmd', uuid="8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3", vc_setup_scripts = preSDK61VCSetupScripts, ), ] SupportedSDKMap = {} for sdk in SupportedSDKList: SupportedSDKMap[sdk.version] = sdk # Finding installed SDKs isn't cheap, because it goes not only to the # registry but also to the disk to sanity-check that there is, in fact, # an SDK installed there and that the registry entry isn't just stale. # Find this information once, when requested, and cache it. InstalledSDKList = None InstalledSDKMap = None def get_installed_sdks(): global InstalledSDKList global InstalledSDKMap debug('sdk.py:get_installed_sdks()') if InstalledSDKList is None: InstalledSDKList = [] InstalledSDKMap = {} for sdk in SupportedSDKList: debug('MSCommon/sdk.py: trying to find SDK %s' % sdk.version) if sdk.get_sdk_dir(): debug('MSCommon/sdk.py:found SDK %s' % sdk.version) InstalledSDKList.append(sdk) InstalledSDKMap[sdk.version] = sdk return InstalledSDKList # We may be asked to update multiple construction environments with # SDK information. When doing this, we check on-disk for whether # the SDK has 'mfc' and 'atl' subdirectories. Since going to disk # is expensive, cache results by directory. SDKEnvironmentUpdates = {} def set_sdk_by_directory(env, sdk_dir): global SDKEnvironmentUpdates debug('set_sdk_by_directory: Using dir:%s'%sdk_dir) try: env_tuple_list = SDKEnvironmentUpdates[sdk_dir] except KeyError: env_tuple_list = [] SDKEnvironmentUpdates[sdk_dir] = env_tuple_list include_path = os.path.join(sdk_dir, 'include') mfc_path = os.path.join(include_path, 'mfc') atl_path = os.path.join(include_path, 'atl') if os.path.exists(mfc_path): env_tuple_list.append(('INCLUDE', mfc_path)) if os.path.exists(atl_path): env_tuple_list.append(('INCLUDE', atl_path)) env_tuple_list.append(('INCLUDE', include_path)) env_tuple_list.append(('LIB', os.path.join(sdk_dir, 'lib'))) env_tuple_list.append(('LIBPATH', os.path.join(sdk_dir, 'lib'))) env_tuple_list.append(('PATH', os.path.join(sdk_dir, 'bin'))) for variable, directory in env_tuple_list: env.PrependENVPath(variable, directory) def get_sdk_by_version(mssdk): if mssdk not in SupportedSDKMap: raise SCons.Errors.UserError("SDK version {} is not supported".format(repr(mssdk))) get_installed_sdks() return InstalledSDKMap.get(mssdk) def get_default_sdk(): """Set up the default Platform/Windows SDK.""" get_installed_sdks() if not InstalledSDKList: return None return InstalledSDKList[0] def mssdk_setup_env(env): debug('sdk.py:mssdk_setup_env()') if 'MSSDK_DIR' in env: sdk_dir = env['MSSDK_DIR'] if sdk_dir is None: return sdk_dir = env.subst(sdk_dir) debug('sdk.py:mssdk_setup_env: Using MSSDK_DIR:{}'.format(sdk_dir)) elif 'MSSDK_VERSION' in env: sdk_version = env['MSSDK_VERSION'] if sdk_version is None: msg = "SDK version is specified as None" raise SCons.Errors.UserError(msg) sdk_version = env.subst(sdk_version) mssdk = get_sdk_by_version(sdk_version) if mssdk is None: msg = "SDK version %s is not installed" % sdk_version raise SCons.Errors.UserError(msg) sdk_dir = mssdk.get_sdk_dir() debug('sdk.py:mssdk_setup_env: Using MSSDK_VERSION:%s'%sdk_dir) elif 'MSVS_VERSION' in env: msvs_version = env['MSVS_VERSION'] debug('sdk.py:mssdk_setup_env:Getting MSVS_VERSION from env:%s'%msvs_version) if msvs_version is None: debug('sdk.py:mssdk_setup_env thinks msvs_version is None') return msvs_version = env.subst(msvs_version) from . import vs msvs = vs.get_vs_by_version(msvs_version) debug('sdk.py:mssdk_setup_env:msvs is :%s'%msvs) if not msvs: debug('sdk.py:mssdk_setup_env: no VS version detected, bailingout:%s'%msvs) return sdk_version = msvs.sdk_version debug('sdk.py:msvs.sdk_version is %s'%sdk_version) if not sdk_version: return mssdk = get_sdk_by_version(sdk_version) if not mssdk: mssdk = get_default_sdk() if not mssdk: return sdk_dir = mssdk.get_sdk_dir() debug('sdk.py:mssdk_setup_env: Using MSVS_VERSION:%s'%sdk_dir) else: mssdk = get_default_sdk() if not mssdk: return sdk_dir = mssdk.get_sdk_dir() debug('sdk.py:mssdk_setup_env: not using any env values. sdk_dir:%s'%sdk_dir) set_sdk_by_directory(env, sdk_dir) #print "No MSVS_VERSION: this is likely to be a bug" def mssdk_exists(version=None): sdks = get_installed_sdks() if version is None: return len(sdks) > 0 return version in sdks # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/MSCommon/arch.py0000664000175000017500000000403513160023041022431 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/MSCommon/arch.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Module to define supported Windows chip architectures. """ import os class ArchDefinition(object): """ A class for defining architecture-specific settings and logic. """ def __init__(self, arch, synonyms=[]): self.arch = arch self.synonyms = synonyms SupportedArchitectureList = [ ArchitectureDefinition( 'x86', ['i386', 'i486', 'i586', 'i686'], ), ArchitectureDefinition( 'x86_64', ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'], ), ArchitectureDefinition( 'ia64', ['IA64'], ), ArchitectureDefinition( 'arm', ['ARM'], ), ] SupportedArchitectureMap = {} for a in SupportedArchitectureList: SupportedArchitectureMap[a.arch] = a for s in a.synonyms: SupportedArchitectureMap[s] = a scons-src-3.0.0/src/engine/SCons/Tool/MSCommon/vs.py0000664000175000017500000005141313160023041022146 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/MSCommon/vs.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Module to detect Visual Studio and/or Visual C/C++ """ import os import SCons.Errors import SCons.Util from .common import debug, \ get_output, \ is_win64, \ normalize_env, \ parse_output, \ read_reg import SCons.Tool.MSCommon.vc class VisualStudio(object): """ An abstract base class for trying to find installed versions of Visual Studio. """ def __init__(self, version, **kw): self.version = version kw['vc_version'] = kw.get('vc_version', version) kw['sdk_version'] = kw.get('sdk_version', version) self.__dict__.update(kw) self._cache = {} def find_batch_file(self): vs_dir = self.get_vs_dir() if not vs_dir: debug('find_executable(): no vs_dir') return None batch_file = os.path.join(vs_dir, self.batch_file_path) batch_file = os.path.normpath(batch_file) if not os.path.isfile(batch_file): debug('find_batch_file(): %s not on file system' % batch_file) return None return batch_file def find_vs_dir_by_vc(self): SCons.Tool.MSCommon.vc.get_installed_vcs() dir = SCons.Tool.MSCommon.vc.find_vc_pdir(self.vc_version) if not dir: debug('find_vs_dir(): no installed VC %s' % self.vc_version) return None return dir def find_vs_dir_by_reg(self): root = 'Software\\' if is_win64(): root = root + 'Wow6432Node\\' for key in self.hkeys: if key=='use_dir': return self.find_vs_dir_by_vc() key = root + key try: comps = read_reg(key) except SCons.Util.WinError as e: debug('find_vs_dir_by_reg(): no VS registry key {}'.format(repr(key))) else: debug('find_vs_dir_by_reg(): found VS in registry: {}'.format(comps)) return comps return None def find_vs_dir(self): """ Can use registry or location of VC to find vs dir First try to find by registry, and if that fails find via VC dir """ if True: vs_dir=self.find_vs_dir_by_reg() return vs_dir else: return self.find_vs_dir_by_vc() def find_executable(self): vs_dir = self.get_vs_dir() if not vs_dir: debug('find_executable(): no vs_dir ({})'.format(vs_dir)) return None executable = os.path.join(vs_dir, self.executable_path) executable = os.path.normpath(executable) if not os.path.isfile(executable): debug('find_executable(): {} not on file system'.format(executable)) return None return executable def get_batch_file(self): try: return self._cache['batch_file'] except KeyError: batch_file = self.find_batch_file() self._cache['batch_file'] = batch_file return batch_file def get_executable(self): try: debug('get_executable using cache:%s'%self._cache['executable']) return self._cache['executable'] except KeyError: executable = self.find_executable() self._cache['executable'] = executable debug('get_executable not in cache:%s'%executable) return executable def get_vs_dir(self): try: return self._cache['vs_dir'] except KeyError: vs_dir = self.find_vs_dir() self._cache['vs_dir'] = vs_dir return vs_dir def get_supported_arch(self): try: return self._cache['supported_arch'] except KeyError: # RDEVE: for the time being use hardcoded lists # supported_arch = self.find_supported_arch() self._cache['supported_arch'] = self.supported_arch return self.supported_arch def reset(self): self._cache = {} # The list of supported Visual Studio versions we know how to detect. # # How to look for .bat file ? # - VS 2008 Express (x86): # * from registry key productdir, gives the full path to vsvarsall.bat. In # HKEY_LOCAL_MACHINE): # Software\Microsoft\VCEpress\9.0\Setup\VC\productdir # * from environmnent variable VS90COMNTOOLS: the path is then ..\..\VC # relatively to the path given by the variable. # # - VS 2008 Express (WoW6432: 32 bits on windows x64): # Software\Wow6432Node\Microsoft\VCEpress\9.0\Setup\VC\productdir # # - VS 2005 Express (x86): # * from registry key productdir, gives the full path to vsvarsall.bat. In # HKEY_LOCAL_MACHINE): # Software\Microsoft\VCEpress\8.0\Setup\VC\productdir # * from environmnent variable VS80COMNTOOLS: the path is then ..\..\VC # relatively to the path given by the variable. # # - VS 2005 Express (WoW6432: 32 bits on windows x64): does not seem to have a # productdir ? # # - VS 2003 .Net (pro edition ? x86): # * from registry key productdir. The path is then ..\Common7\Tools\ # relatively to the key. The key is in HKEY_LOCAL_MACHINE): # Software\Microsoft\VisualStudio\7.1\Setup\VC\productdir # * from environmnent variable VS71COMNTOOLS: the path is the full path to # vsvars32.bat # # - VS 98 (VS 6): # * from registry key productdir. The path is then Bin # relatively to the key. The key is in HKEY_LOCAL_MACHINE): # Software\Microsoft\VisualStudio\6.0\Setup\VC98\productdir # # The first version found in the list is the one used by default if # there are multiple versions installed. Barring good reasons to # the contrary, this means we should list versions from most recent # to oldest. Pro versions get listed before Express versions on the # assumption that, by default, you'd rather use the version you paid # good money for in preference to whatever Microsoft makes available # for free. # # If you update this list, update _VCVER and _VCVER_TO_PRODUCT_DIR in # Tool/MSCommon/vc.py, and the MSVC_VERSION documentation in Tool/msvc.xml. SupportedVSList = [ # Visual Studio 2017 VisualStudio('14.1', vc_version='14.1', sdk_version='10.0A', hkeys=[], common_tools_var='VS150COMNTOOLS', executable_path=r'Common7\IDE\devenv.com', batch_file_path=r'VC\Auxiliary\Build\vsvars32.bat', supported_arch=['x86', 'amd64', "arm"], ), # Visual Studio 2015 VisualStudio('14.0', vc_version='14.0', sdk_version='10.0', hkeys=[r'Microsoft\VisualStudio\14.0\Setup\VS\ProductDir'], common_tools_var='VS140COMNTOOLS', executable_path=r'Common7\IDE\devenv.com', batch_file_path=r'Common7\Tools\vsvars32.bat', supported_arch=['x86', 'amd64', "arm"], ), # Visual C++ 2015 Express Edition (for Desktop) VisualStudio('14.0Exp', vc_version='14.0', sdk_version='10.0A', hkeys=[r'Microsoft\VisualStudio\14.0\Setup\VS\ProductDir'], common_tools_var='VS140COMNTOOLS', executable_path=r'Common7\IDE\WDExpress.exe', batch_file_path=r'Common7\Tools\vsvars32.bat', supported_arch=['x86', 'amd64', "arm"], ), # Visual Studio 2013 VisualStudio('12.0', vc_version='12.0', sdk_version='8.1A', hkeys=[r'Microsoft\VisualStudio\12.0\Setup\VS\ProductDir'], common_tools_var='VS120COMNTOOLS', executable_path=r'Common7\IDE\devenv.com', batch_file_path=r'Common7\Tools\vsvars32.bat', supported_arch=['x86', 'amd64'], ), # Visual C++ 2013 Express Edition (for Desktop) VisualStudio('12.0Exp', vc_version='12.0', sdk_version='8.1A', hkeys=[r'Microsoft\VisualStudio\12.0\Setup\VS\ProductDir'], common_tools_var='VS120COMNTOOLS', executable_path=r'Common7\IDE\WDExpress.exe', batch_file_path=r'Common7\Tools\vsvars32.bat', supported_arch=['x86', 'amd64'], ), # Visual Studio 2012 VisualStudio('11.0', sdk_version='8.0A', hkeys=[r'Microsoft\VisualStudio\11.0\Setup\VS\ProductDir'], common_tools_var='VS110COMNTOOLS', executable_path=r'Common7\IDE\devenv.com', batch_file_path=r'Common7\Tools\vsvars32.bat', supported_arch=['x86', 'amd64'], ), # Visual C++ 2012 Express Edition (for Desktop) VisualStudio('11.0Exp', vc_version='11.0', sdk_version='8.0A', hkeys=[r'Microsoft\VisualStudio\11.0\Setup\VS\ProductDir'], common_tools_var='VS110COMNTOOLS', executable_path=r'Common7\IDE\WDExpress.exe', batch_file_path=r'Common7\Tools\vsvars32.bat', supported_arch=['x86', 'amd64'], ), # Visual Studio 2010 VisualStudio('10.0', sdk_version='7.0A', hkeys=[r'Microsoft\VisualStudio\10.0\Setup\VS\ProductDir'], common_tools_var='VS100COMNTOOLS', executable_path=r'Common7\IDE\devenv.com', batch_file_path=r'Common7\Tools\vsvars32.bat', supported_arch=['x86', 'amd64'], ), # Visual C++ 2010 Express Edition VisualStudio('10.0Exp', vc_version='10.0', sdk_version='7.0A', hkeys=[r'Microsoft\VCExpress\10.0\Setup\VS\ProductDir'], common_tools_var='VS100COMNTOOLS', executable_path=r'Common7\IDE\VCExpress.exe', batch_file_path=r'Common7\Tools\vsvars32.bat', supported_arch=['x86'], ), # Visual Studio 2008 VisualStudio('9.0', sdk_version='6.0A', hkeys=[r'Microsoft\VisualStudio\9.0\Setup\VS\ProductDir'], common_tools_var='VS90COMNTOOLS', executable_path=r'Common7\IDE\devenv.com', batch_file_path=r'Common7\Tools\vsvars32.bat', supported_arch=['x86', 'amd64'], ), # Visual C++ 2008 Express Edition VisualStudio('9.0Exp', vc_version='9.0', sdk_version='6.0A', hkeys=[r'Microsoft\VCExpress\9.0\Setup\VS\ProductDir'], common_tools_var='VS90COMNTOOLS', executable_path=r'Common7\IDE\VCExpress.exe', batch_file_path=r'Common7\Tools\vsvars32.bat', supported_arch=['x86'], ), # Visual Studio 2005 VisualStudio('8.0', sdk_version='6.0A', hkeys=[r'Microsoft\VisualStudio\8.0\Setup\VS\ProductDir'], common_tools_var='VS80COMNTOOLS', executable_path=r'Common7\IDE\devenv.com', batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio 8', supported_arch=['x86', 'amd64'], ), # Visual C++ 2005 Express Edition VisualStudio('8.0Exp', vc_version='8.0Exp', sdk_version='6.0A', hkeys=[r'Microsoft\VCExpress\8.0\Setup\VS\ProductDir'], common_tools_var='VS80COMNTOOLS', executable_path=r'Common7\IDE\VCExpress.exe', batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio 8', supported_arch=['x86'], ), # Visual Studio .NET 2003 VisualStudio('7.1', sdk_version='6.0', hkeys=[r'Microsoft\VisualStudio\7.1\Setup\VS\ProductDir'], common_tools_var='VS71COMNTOOLS', executable_path=r'Common7\IDE\devenv.com', batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio .NET 2003', supported_arch=['x86'], ), # Visual Studio .NET VisualStudio('7.0', sdk_version='2003R2', hkeys=[r'Microsoft\VisualStudio\7.0\Setup\VS\ProductDir'], common_tools_var='VS70COMNTOOLS', executable_path=r'IDE\devenv.com', batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio .NET', supported_arch=['x86'], ), # Visual Studio 6.0 VisualStudio('6.0', sdk_version='2003R1', hkeys=[r'Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Studio\ProductDir', 'use_dir'], common_tools_var='VS60COMNTOOLS', executable_path=r'Common\MSDev98\Bin\MSDEV.COM', batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio', supported_arch=['x86'], ), ] SupportedVSMap = {} for vs in SupportedVSList: SupportedVSMap[vs.version] = vs # Finding installed versions of Visual Studio isn't cheap, because it # goes not only to the registry but also to the disk to sanity-check # that there is, in fact, a Visual Studio directory there and that the # registry entry isn't just stale. Find this information once, when # requested, and cache it. InstalledVSList = None InstalledVSMap = None def get_installed_visual_studios(): global InstalledVSList global InstalledVSMap if InstalledVSList is None: InstalledVSList = [] InstalledVSMap = {} for vs in SupportedVSList: debug('trying to find VS %s' % vs.version) if vs.get_executable(): debug('found VS %s' % vs.version) InstalledVSList.append(vs) InstalledVSMap[vs.version] = vs return InstalledVSList def reset_installed_visual_studios(): global InstalledVSList global InstalledVSMap InstalledVSList = None InstalledVSMap = None for vs in SupportedVSList: vs.reset() # Need to clear installed VC's as well as they are used in finding # installed VS's SCons.Tool.MSCommon.vc.reset_installed_vcs() # We may be asked to update multiple construction environments with # SDK information. When doing this, we check on-disk for whether # the SDK has 'mfc' and 'atl' subdirectories. Since going to disk # is expensive, cache results by directory. #SDKEnvironmentUpdates = {} # #def set_sdk_by_directory(env, sdk_dir): # global SDKEnvironmentUpdates # try: # env_tuple_list = SDKEnvironmentUpdates[sdk_dir] # except KeyError: # env_tuple_list = [] # SDKEnvironmentUpdates[sdk_dir] = env_tuple_list # # include_path = os.path.join(sdk_dir, 'include') # mfc_path = os.path.join(include_path, 'mfc') # atl_path = os.path.join(include_path, 'atl') # # if os.path.exists(mfc_path): # env_tuple_list.append(('INCLUDE', mfc_path)) # if os.path.exists(atl_path): # env_tuple_list.append(('INCLUDE', atl_path)) # env_tuple_list.append(('INCLUDE', include_path)) # # env_tuple_list.append(('LIB', os.path.join(sdk_dir, 'lib'))) # env_tuple_list.append(('LIBPATH', os.path.join(sdk_dir, 'lib'))) # env_tuple_list.append(('PATH', os.path.join(sdk_dir, 'bin'))) # # for variable, directory in env_tuple_list: # env.PrependENVPath(variable, directory) def msvs_exists(): return (len(get_installed_visual_studios()) > 0) def get_vs_by_version(msvs): global InstalledVSMap global SupportedVSMap debug('vs.py:get_vs_by_version()') if msvs not in SupportedVSMap: msg = "Visual Studio version %s is not supported" % repr(msvs) raise SCons.Errors.UserError(msg) get_installed_visual_studios() vs = InstalledVSMap.get(msvs) debug('InstalledVSMap:%s'%InstalledVSMap) debug('vs.py:get_vs_by_version: found vs:%s'%vs) # Some check like this would let us provide a useful error message # if they try to set a Visual Studio version that's not installed. # However, we also want to be able to run tests (like the unit # tests) on systems that don't, or won't ever, have it installed. # It might be worth resurrecting this, with some configurable # setting that the tests can use to bypass the check. #if not vs: # msg = "Visual Studio version %s is not installed" % repr(msvs) # raise SCons.Errors.UserError, msg return vs def get_default_version(env): """Returns the default version string to use for MSVS. If no version was requested by the user through the MSVS environment variable, query all the available visual studios through get_installed_visual_studios, and take the highest one. Return ------ version: str the default version. """ if 'MSVS' not in env or not SCons.Util.is_Dict(env['MSVS']): # get all versions, and remember them for speed later versions = [vs.version for vs in get_installed_visual_studios()] env['MSVS'] = {'VERSIONS' : versions} else: versions = env['MSVS'].get('VERSIONS', []) if 'MSVS_VERSION' not in env: if versions: env['MSVS_VERSION'] = versions[0] #use highest version by default else: debug('get_default_version: WARNING: no installed versions found, ' 'using first in SupportedVSList (%s)'%SupportedVSList[0].version) env['MSVS_VERSION'] = SupportedVSList[0].version env['MSVS']['VERSION'] = env['MSVS_VERSION'] return env['MSVS_VERSION'] def get_default_arch(env): """Return the default arch to use for MSVS if no version was requested by the user through the MSVS_ARCH environment variable, select x86 Return ------ arch: str """ arch = env.get('MSVS_ARCH', 'x86') msvs = InstalledVSMap.get(env['MSVS_VERSION']) if not msvs: arch = 'x86' elif not arch in msvs.get_supported_arch(): fmt = "Visual Studio version %s does not support architecture %s" raise SCons.Errors.UserError(fmt % (env['MSVS_VERSION'], arch)) return arch def merge_default_version(env): version = get_default_version(env) arch = get_default_arch(env) def msvs_setup_env(env): batfilename = msvs.get_batch_file() msvs = get_vs_by_version(version) if msvs is None: return # XXX: I think this is broken. This will silently set a bogus tool instead # of failing, but there is no other way with the current scons tool # framework if batfilename is not None: vars = ('LIB', 'LIBPATH', 'PATH', 'INCLUDE') msvs_list = get_installed_visual_studios() vscommonvarnames = [vs.common_tools_var for vs in msvs_list] save_ENV = env['ENV'] nenv = normalize_env(env['ENV'], ['COMSPEC'] + vscommonvarnames, force=True) try: output = get_output(batfilename, arch, env=nenv) finally: env['ENV'] = save_ENV vars = parse_output(output, vars) for k, v in vars.items(): env.PrependENVPath(k, v, delete_existing=1) def query_versions(): """Query the system to get available versions of VS. A version is considered when a batfile is found.""" msvs_list = get_installed_visual_studios() versions = [msvs.version for msvs in msvs_list] return versions # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/MSCommon/netframework.py0000664000175000017500000000541613160023041024224 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """ """ import os import re import SCons.Util from .common import read_reg, debug # Original value recorded by dcournapeau _FRAMEWORKDIR_HKEY_ROOT = r'Software\Microsoft\.NETFramework\InstallRoot' # On SGK's system _FRAMEWORKDIR_HKEY_ROOT = r'Software\Microsoft\Microsoft SDKs\.NETFramework\v2.0\InstallationFolder' def find_framework_root(): # XXX: find it from environment (FrameworkDir) try: froot = read_reg(_FRAMEWORKDIR_HKEY_ROOT) debug("Found framework install root in registry: {}".format(froot)) except SCons.Util.WinError as e: debug("Could not read reg key {}".format(_FRAMEWORKDIR_HKEY_ROOT)) return None if not os.path.exists(froot): debug("{} not found on fs".format(froot)) return None return froot def query_versions(): froot = find_framework_root() if froot: contents = os.listdir(froot) l = re.compile('v[0-9]+.*') versions = [e for e in contents if l.match(e)] def versrt(a,b): # since version numbers aren't really floats... aa = a[1:] bb = b[1:] aal = aa.split('.') bbl = bb.split('.') # sequence comparison in python is lexicographical # which is exactly what we want. # Note we sort backwards so the highest version is first. return cmp(bbl,aal) versions.sort(versrt) else: versions = [] return versions # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/link.xml0000664000175000017500000002324313160023044021136 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for generic POSIX linkers. SHLINK SHLINKFLAGS SHLINKCOM LINK LINKFLAGS LINKCOM LIBDIRPREFIX LIBDIRSUFFIX LIBLINKPREFIX LIBLINKSUFFIX SHLIBSUFFIX __SHLIBVERSIONFLAGS LDMODULE LDMODULEPREFIX LDMODULESUFFIX LDMODULEFLAGS LDMODULECOM LDMODULEVERSION LDMODULENOVERSIONSYMLINKS LDMODULEVERSIONFLAGS __LDMODULEVERSIONFLAGS SHLINKCOMSTR LINKCOMSTR LDMODULECOMSTR This construction variable automatically introduces &cv-link-_LDMODULEVERSIONFLAGS; if &cv-link-LDMODULEVERSION; is set. Othervise it evaluates to an empty string. This construction variable automatically introduces &cv-link-_SHLIBVERSIONFLAGS; if &cv-link-SHLIBVERSION; is set. Othervise it evaluates to an empty string. A macro that automatically generates loadable module's SONAME based on $TARGET, $LDMODULEVERSION and $LDMODULESUFFIX. Used by &b-link-LoadableModule; builder when the linker tool supports SONAME (e.g. &t-link-gnulink;). This macro automatically introduces extra flags to &cv-link-LDMODULECOM; when building versioned &b-link-LoadableModule; (that is when &cv-link-LDMODULEVERSION; is set). _LDMODULEVERSIONFLAGS usually adds &cv-link-SHLIBVERSIONFLAGS; and some extra dynamically generated options (such as -Wl,-soname=$_LDMODULESONAME). It is unused by plain (unversioned) loadable modules. This macro automatically introduces extra flags to &cv-link-SHLINKCOM; when building versioned &b-link-SharedLibrary; (that is when &cv-link-SHLIBVERSION; is set). _SHLIBVERSIONFLAGS usually adds &cv-link-SHLIBVERSIONFLAGS; and some extra dynamically generated options (such as -Wl,-soname=$_SHLIBSONAME. It is unused by "plain" (unversioned) shared libraries. A macro that automatically generates shared library's SONAME based on $TARGET, $SHLIBVERSION and $SHLIBSUFFIX. Used by &b-link-SharedLibrary; builder when the linker tool supports SONAME (e.g. &t-link-gnulink;). The prefix used for import library names. For example, cygwin uses import libraries (libfoo.dll.a) in pair with dynamic libraries (cygfoo.dll). The &t-link-cyglink; linker sets &cv-link-IMPLIBPREFIX; to 'lib' and &cv-link-SHLIBPREFIX; to 'cyg'. The suffix used for import library names. For example, cygwin uses import libraries (libfoo.dll.a) in pair with dynamic libraries (cygfoo.dll). The &t-link-cyglink; linker sets &cv-link-IMPLIBSUFFIX; to '.dll.a' and &cv-link-SHLIBSUFFIX; to '.dll'. Used to override &cv-link-SHLIBNOVERSIONSYMLINKS;/&cv-link-LDMODULENOVERSIONSYMLINKS; when creating versioned import library for a shared library/loadable module. If not defined, then &cv-link-SHLIBNOVERSIONSYMLINKS;/&cv-link-LDMODULENOVERSIONSYMLINKS; is used to determine whether to disable symlink generation or not. The linker for building loadable modules. By default, this is the same as &cv-link-SHLINK;. The command line for building loadable modules. On Mac OS X, this uses the &cv-link-LDMODULE;, &cv-link-LDMODULEFLAGS; and &cv-link-FRAMEWORKSFLAGS; variables. On other systems, this is the same as &cv-link-SHLINK;. The string displayed when building loadable modules. If this is not set, then &cv-link-LDMODULECOM; (the command line) is displayed. General user options passed to the linker for building loadable modules. Instructs the &b-link-LoadableModule; builder to not automatically create symlinks for versioned modules. Defaults to $SHLIBNOVERSIONSYMLINKS The prefix used for loadable module file names. On Mac OS X, this is null; on other systems, this is the same as &cv-link-SHLIBPREFIX;. The suffix used for loadable module file names. On Mac OS X, this is null; on other systems, this is the same as $SHLIBSUFFIX. Extra flags added to &cv-link-LDMODULECOM; when building versioned &b-link-LoadableModule;. These flags are only used when &cv-link-LDMODULEVERSION; is set. The linker. The command line used to link object files into an executable. The string displayed when object files are linked into an executable. If this is not set, then &cv-link-LINKCOM; (the command line) is displayed. env = Environment(LINKCOMSTR = "Linking $TARGET") General user options passed to the linker. Note that this variable should not contain (or similar) options for linking with the libraries listed in &cv-link-LIBS;, nor (or similar) library search path options that scons generates automatically from &cv-link-LIBPATH;. See &cv-link-_LIBFLAGS; above, for the variable that expands to library-link options, and &cv-link-_LIBDIRFLAGS; above, for the variable that expands to library search path options. Instructs the &b-link-SharedLibrary; builder to not create symlinks for versioned shared libraries. Extra flags added to &cv-link-SHLINKCOM; when building versioned &b-link-SharedLibrary;. These flags are only used when &cv-link-SHLIBVERSION; is set. The linker for programs that use shared libraries. The command line used to link programs using shared libraries. The string displayed when programs using shared libraries are linked. If this is not set, then &cv-link-SHLINKCOM; (the command line) is displayed. env = Environment(SHLINKCOMSTR = "Linking shared $TARGET") General user options passed to the linker for programs using shared libraries. Note that this variable should not contain (or similar) options for linking with the libraries listed in &cv-link-LIBS;, nor (or similar) include search path options that scons generates automatically from &cv-link-LIBPATH;. See &cv-link-_LIBFLAGS; above, for the variable that expands to library-link options, and &cv-link-_LIBDIRFLAGS; above, for the variable that expands to library search path options. Variable used to hard-code SONAME for versioned shared library/loadable module. env.SharedLibrary('test', 'test.c', SHLIBVERSION='0.1.2', SONAME='libtest.so.2') The variable is used, for example, by &t-link-gnulink; linker tool. When this variable is true, static objects and shared objects are assumed to be the same; that is, SCons does not check for linking static objects into a shared library. scons-src-3.0.0/src/engine/SCons/Tool/msvc.py0000664000175000017500000002731013160023044021000 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.msvc Tool-specific initialization for Microsoft Visual C/C++. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/msvc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import re import sys import SCons.Action import SCons.Builder import SCons.Errors import SCons.Platform.win32 import SCons.Tool import SCons.Tool.msvs import SCons.Util import SCons.Warnings import SCons.Scanner.RC from .MSCommon import msvc_exists, msvc_setup_env_once, msvc_version_to_maj_min CSuffixes = ['.c', '.C'] CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++'] def validate_vars(env): """Validate the PCH and PCHSTOP construction variables.""" if 'PCH' in env and env['PCH']: if 'PCHSTOP' not in env: raise SCons.Errors.UserError("The PCHSTOP construction must be defined if PCH is defined.") if not SCons.Util.is_String(env['PCHSTOP']): raise SCons.Errors.UserError("The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP']) def msvc_set_PCHPDBFLAGS(env): """ Set appropriate PCHPDBFLAGS for the MSVC version being used. """ if env.get('MSVC_VERSION',False): maj, min = msvc_version_to_maj_min(env['MSVC_VERSION']) if maj < 8: env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}']) else: env['PCHPDBFLAGS'] = '' else: # Default if we can't determine which version of MSVC we're using env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}']) def pch_emitter(target, source, env): """Adds the object file target.""" validate_vars(env) pch = None obj = None for t in target: if SCons.Util.splitext(str(t))[1] == '.pch': pch = t if SCons.Util.splitext(str(t))[1] == '.obj': obj = t if not obj: obj = SCons.Util.splitext(str(pch))[0]+'.obj' target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work return (target, source) def object_emitter(target, source, env, parent_emitter): """Sets up the PCH dependencies for an object file.""" validate_vars(env) parent_emitter(target, source, env) # Add a dependency, but only if the target (e.g. 'Source1.obj') # doesn't correspond to the pre-compiled header ('Source1.pch'). # If the basenames match, then this was most likely caused by # someone adding the source file to both the env.PCH() and the # env.Program() calls, and adding the explicit dependency would # cause a cycle on the .pch file itself. # # See issue #2505 for a discussion of what to do if it turns # out this assumption causes trouble in the wild: # http://scons.tigris.org/issues/show_bug.cgi?id=2505 if 'PCH' in env: pch = env['PCH'] if str(target[0]) != SCons.Util.splitext(str(pch))[0] + '.obj': env.Depends(target, pch) return (target, source) def static_object_emitter(target, source, env): return object_emitter(target, source, env, SCons.Defaults.StaticObjectEmitter) def shared_object_emitter(target, source, env): return object_emitter(target, source, env, SCons.Defaults.SharedObjectEmitter) pch_action = SCons.Action.Action('$PCHCOM', '$PCHCOMSTR') pch_builder = SCons.Builder.Builder(action=pch_action, suffix='.pch', emitter=pch_emitter, source_scanner=SCons.Tool.SourceFileScanner) # Logic to build .rc files into .res files (resource files) res_scanner = SCons.Scanner.RC.RCScan() res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') res_builder = SCons.Builder.Builder(action=res_action, src_suffix='.rc', suffix='.res', src_builder=[], source_scanner=res_scanner) def msvc_batch_key(action, env, target, source): """ Returns a key to identify unique batches of sources for compilation. If batching is enabled (via the $MSVC_BATCH setting), then all target+source pairs that use the same action, defined by the same environment, and have the same target and source directories, will be batched. Returning None specifies that the specified target+source should not be batched with other compilations. """ # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH # was set to False. This new version should work better. # Note we need to do the env.subst so $MSVC_BATCH can be a reference to # another construction variable, which is why we test for False and 0 # as strings. if not 'MSVC_BATCH' in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None): # We're not using batching; return no key. return None t = target[0] s = source[0] if os.path.splitext(t.name)[0] != os.path.splitext(s.name)[0]: # The base names are different, so this *must* be compiled # separately; return no key. return None return (id(action), id(env), t.dir, s.dir) def msvc_output_flag(target, source, env, for_signature): """ Returns the correct /Fo flag for batching. If batching is disabled or there's only one source file, then we return an /Fo string that specifies the target explicitly. Otherwise, we return an /Fo string that just specifies the first target's directory (where the Visual C/C++ compiler will put the .obj files). """ # Fixing MSVC_BATCH mode. Previous if did not work when MSVC_BATCH # was set to False. This new version should work better. Removed # len(source)==1 as batch mode can compile only one file # (and it also fixed problem with compiling only one changed file # with batch mode enabled) if not 'MSVC_BATCH' in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None): return '/Fo$TARGET' else: # The Visual C/C++ compiler requires a \ at the end of the /Fo # option to indicate an output directory. We use os.sep here so # that the test(s) for this can be run on non-Windows systems # without having a hard-coded backslash mess up command-line # argument parsing. return '/Fo${TARGET.dir}' + os.sep CAction = SCons.Action.Action("$CCCOM", "$CCCOMSTR", batch_key=msvc_batch_key, targets='$CHANGED_TARGETS') ShCAction = SCons.Action.Action("$SHCCCOM", "$SHCCCOMSTR", batch_key=msvc_batch_key, targets='$CHANGED_TARGETS') CXXAction = SCons.Action.Action("$CXXCOM", "$CXXCOMSTR", batch_key=msvc_batch_key, targets='$CHANGED_TARGETS') ShCXXAction = SCons.Action.Action("$SHCXXCOM", "$SHCXXCOMSTR", batch_key=msvc_batch_key, targets='$CHANGED_TARGETS') def generate(env): """Add Builders and construction variables for MSVC++ to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) # TODO(batch): shouldn't reach in to cmdgen this way; necessary # for now to bypass the checks in Builder.DictCmdGenerator.__call__() # and allow .cc and .cpp to be compiled in the same command line. static_obj.cmdgen.source_ext_match = False shared_obj.cmdgen.source_ext_match = False for suffix in CSuffixes: static_obj.add_action(suffix, CAction) shared_obj.add_action(suffix, ShCAction) static_obj.add_emitter(suffix, static_object_emitter) shared_obj.add_emitter(suffix, shared_object_emitter) for suffix in CXXSuffixes: static_obj.add_action(suffix, CXXAction) shared_obj.add_action(suffix, ShCXXAction) static_obj.add_emitter(suffix, static_object_emitter) shared_obj.add_emitter(suffix, shared_object_emitter) env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Z7") or ""}']) env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s \\\"/Fp%s\\\""%(PCHSTOP or "",File(PCH))) or ""}']) env['_MSVC_OUTPUT_FLAG'] = msvc_output_flag env['_CCCOMCOM'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS' env['CC'] = 'cl' env['CCFLAGS'] = SCons.Util.CLVar('/nologo') env['CFLAGS'] = SCons.Util.CLVar('') env['CCCOM'] = '${TEMPFILE("$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM","$CCCOMSTR")}' env['SHCC'] = '$CC' env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS') env['SHCCCOM'] = '${TEMPFILE("$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCCCOMSTR")}' env['CXX'] = '$CC' env['CXXFLAGS'] = SCons.Util.CLVar('$( /TP $)') env['CXXCOM'] = '${TEMPFILE("$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM","$CXXCOMSTR")}' env['SHCXX'] = '$CXX' env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS') env['SHCXXCOM'] = '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCXXCOMSTR")}' env['CPPDEFPREFIX'] = '/D' env['CPPDEFSUFFIX'] = '' env['INCPREFIX'] = '/I' env['INCSUFFIX'] = '' # env.Append(OBJEMITTER = [static_object_emitter]) # env.Append(SHOBJEMITTER = [shared_object_emitter]) env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 env['RC'] = 'rc' env['RCFLAGS'] = SCons.Util.CLVar('') env['RCSUFFIXES']=['.rc','.rc2'] env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES' env['BUILDERS']['RES'] = res_builder env['OBJPREFIX'] = '' env['OBJSUFFIX'] = '.obj' env['SHOBJPREFIX'] = '$OBJPREFIX' env['SHOBJSUFFIX'] = '$OBJSUFFIX' # Set-up ms tools paths msvc_setup_env_once(env) env['CFILESUFFIX'] = '.c' env['CXXFILESUFFIX'] = '.cc' msvc_set_PCHPDBFLAGS(env) env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS' env['BUILDERS']['PCH'] = pch_builder if 'ENV' not in env: env['ENV'] = {} if 'SystemRoot' not in env['ENV']: # required for dlls in the winsxs folders env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root() def exists(env): return msvc_exists() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/msvsTests.py0000664000175000017500000011055513160023044022047 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/Tool/msvsTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import sys import unittest import copy import TestCmd import TestUnit from SCons.Tool.msvs import * from SCons.Tool.MSCommon.vs import SupportedVSList import SCons.Util import SCons.Warnings from SCons.Tool.MSCommon.common import debug from SCons.Tool.MSCommon import get_default_version, \ query_versions from SCons.Tool.msvs import _GenerateV6DSP, _GenerateV7DSP, _GenerateV10DSP regdata_6a = r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\ServicePacks] "sp3"="" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup] "VsCommonDir"="C:\Program Files\Microsoft Visual Studio\Common" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Developer Network Library - Visual Studio 6.0a] "ProductDir"="C:\Program Files\Microsoft Visual Studio\MSDN98\98VSa\1033" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++] "ProductDir"="C:\Program Files\Microsoft Visual Studio\VC98" '''.split('\n') regdata_6b = r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0] "InstallDir"="C:\VS6\Common\IDE\IDE98" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\ServicePacks] "sp5"="" "latest"=dword:00000005 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup] "VsCommonDir"="C:\VS6\Common" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Basic] "ProductDir"="C:\VS6\VB98" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++] "ProductDir"="C:\VS6\VC98" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Studio] "ProductDir"="C:\VS6" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft VSEE Client] "ProductDir"="C:\VS6\Common\Tools" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Visual Studio 98] '''.split('\n') regdata_7 = r''' [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0] "InstallDir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\" "Source Directories"="C:\Program Files\Microsoft Visual Studio .NET\Vc7\crt\;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\src\mfc\;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\src\atl\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\CrystalReports] @="#15007" "Package"="{F05E92C6-8346-11D3-B4AD-00A0C9B04E7B}" "ProductDetails"="#15009" "LogoID"="0" "PID"="#15008" "UseInterface"=dword:00000001 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\Visual Basic.NET] @="" "DefaultProductAttribute"="VB" "Package"="{164B10B9-B200-11D0-8C61-00A0C91E29D5}" "UseInterface"=dword:00000001 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\Visual C#] @="" "Package"="{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}" "UseInterface"=dword:00000001 "DefaultProductAttribute"="C#" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\VisualC++] "UseInterface"=dword:00000001 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}" "DefaultProductAttribute"="VC" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup] "Dbghelp_path"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\" "dw_dir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\MSDN] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\Msdn\1033\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\Servicing\SKU] "Visual Studio .NET Professional - English"="{D0610409-7D65-11D5-A54F-0090278A1BB8}" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VB] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\Vb7\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VC] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\Vc7\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VC#] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\VC#\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\Visual Studio .NET Professional - English] "InstallSuccess"=dword:00000001 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VS] "EnvironmentDirectory"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\" "EnvironmentPath"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\devenv.exe" "VS7EnvironmentLocation"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\devenv.exe" "MSMDir"="C:\Program Files\Common Files\Merge Modules\" "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\" "VS7CommonBinDir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\" "VS7CommonDir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\" "VSUpdateDir"="C:\Program Files\Microsoft Visual Studio .NET\Setup\VSUpdate\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VS\BuildNumber] "1033"="7.0.9466" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VS\Pro] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC\VC_OBJECTS_PLATFORM_INFO] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32] @="{A54AAE91-30C2-11D3-87BF-A04A4CC10000}" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories] "Path Dirs"="$(VCInstallDir)bin;$(VSInstallDir)Common7\Tools\bin\prerelease;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;C:\Program Files\HTML Help Workshop\;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);C:\perl\bin;C:\cygwin\bin;c:\cygwin\usr\bin;C:\bin;C:\program files\perforce;C:\cygwin\usr\local\bin\i686-pc-cygwin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem" "Library Dirs"="$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)PlatformSDK\lib\prerelease;$(VCInstallDir)PlatformSDK\lib;$(FrameworkSDKDir)lib" "Include Dirs"="$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include\prerelease;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include" "Source Dirs"="$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src" "Reference Dirs"="" '''.split('\n') regdata_7_1 = r''' [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1] @="" "Source Directories"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\crt\src\;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src\mfc\;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src\atl\" "ThisVersionSolutionCLSID"="{246C57AE-40DD-4d6b-9E8D-B0F5757BB2A8}" "ThisVersionDTECLSID"="{8CD2DD97-4EC1-4bc4-9359-89A3EEDD57A6}" "InstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\" "CLR Version"="v1.1.4322" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Smart Device Extensions] "UseInterface"=dword:00000001 "VS7InstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\" "VBDeviceInstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VB7\" "CSharpDeviceInstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Visual Basic.NET] "UseInterface"=dword:00000001 "Package"="{164B10B9-B200-11D0-8C61-00A0C91E29D5}" "DefaultProductAttribute"="VB" @="" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Visual C#] "DefaultProductAttribute"="C#" "UseInterface"=dword:00000001 "Package"="{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}" @="" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Visual JSharp] @="" "Package"="{E6FDF8B0-F3D1-11D4-8576-0002A516ECE8}" "UseInterface"=dword:00000001 "DefaultProductAttribute"="Visual JSharp" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\VisualC++] "UseInterface"=dword:00000001 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}" "DefaultProductAttribute"="VC" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup] "Dbghelp_path"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\" "dw_dir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\CSDPROJ] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\JSHPROJ] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VJ#\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Servicing] "CurrentSULevel"=dword:00000000 "CurrentSPLevel"=dword:00000000 "Server Path"="" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Servicing\Package] "FxSDK"="" "VB"="" "VC"="" "VCS"="" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Servicing\SKU] "Visual Studio .NET Professional 2003 - English"="{20610409-CA18-41A6-9E21-A93AE82EE7C5}" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VB] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VBDPROJ] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VC] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VC#] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Visual Studio .NET Professional 2003 - English] "InstallSuccess"=dword:00000001 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VS] "EnvironmentDirectory"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\" "EnvironmentPath"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe" "VS7EnvironmentLocation"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe" "MSMDir"="C:\Program Files\Common Files\Merge Modules\" "VS7CommonBinDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\" "VS7CommonDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\" "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\" "VSUpdateDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Setup\VSUpdate\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VS\BuildNumber] "1033"="7.1.3088" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VS\Pro] "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32] @="{759354D0-6B42-4705-AFFB-56E34D2BC3D4}" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories] "Path Dirs"="$(VCInstallDir)bin;$(VSInstallDir)Common7\Tools\bin\prerelease;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;C:\Program Files\HTML Help Workshop\;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);C:\Perl\bin\;c:\bin;c:\cygwin\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Avid;C:\Program Files\backburner 2\;C:\Program Files\cvsnt;C:\Program Files\Subversion\bin;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\HTMLDoc" "Library Dirs"="$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)PlatformSDK\lib\prerelease;$(VCInstallDir)PlatformSDK\lib;$(FrameworkSDKDir)lib" "Include Dirs"="$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include\prerelease;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include" "Source Dirs"="$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src" "Reference Dirs"="$(FrameWorkDir)$(FrameWorkVersion)" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\ToolDefaultExtensionLists] "VCCLCompilerTool"="*.cpp;*.cxx;*.cc;*.c" "VCLinkerTool"="*.obj;*.res;*.lib;*.rsc" "VCLibrarianTool"="*.obj;*.res;*.lib;*.rsc" "VCMIDLTool"="*.idl;*.odl" "VCCustomBuildTool"="*.bat" "VCResourceCompilerTool"="*.rc" "VCPreBuildEventTool"="*.bat" "VCPreLinkEventTool"="*.bat" "VCPostBuildEventTool"="*.bat" "VCBscMakeTool"="*.sbr" "VCNMakeTool"="" "VCWebServiceProxyGeneratorTool"="*.discomap" "VCWebDeploymentTool"="" "VCALinkTool"="*.resources" "VCManagedResourceCompilerTool"="*.resx" "VCXMLDataGeneratorTool"="*.xsd" "VCManagedWrapperGeneratorTool"="" "VCAuxiliaryManagedWrapperGeneratorTool"="" "VCPrimaryInteropTool"="" '''.split('\n') regdata_8exp = r''' [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0] "CLR Version"="v2.0.50727" "ApplicationID"="VCExpress" "SecurityAppID"="{741726F6-1EAE-4680-86A6-6085E8872CF8}" "InstallDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\" "EnablePreloadCLR"=dword:00000001 "RestoreAppPath"=dword:00000001 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\InstalledProducts] [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\InstalledProducts\Microsoft Visual C++] "UseInterface"=dword:00000001 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}" "DefaultProductAttribute"="VC" [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\Setup] [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\Setup\VC] "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\VC\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\Setup\VS] "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC] [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC\VC_OBJECTS_PLATFORM_INFO] [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32] @="{72f11281-2429-11d7-8bf6-00b0d03daa06}" [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\ToolDefaultExtensionLists] "VCCLCompilerTool"="*.cpp;*.cxx;*.cc;*.c" "VCLinkerTool"="*.obj;*.res;*.lib;*.rsc;*.licenses" "VCLibrarianTool"="*.obj;*.res;*.lib;*.rsc" "VCMIDLTool"="*.idl;*.odl" "VCCustomBuildTool"="*.bat" "VCResourceCompilerTool"="*.rc" "VCPreBuildEventTool"="*.bat" "VCPreLinkEventTool"="*.bat" "VCPostBuildEventTool"="*.bat" "VCBscMakeTool"="*.sbr" "VCFxCopTool"="*.dll;*.exe" "VCNMakeTool"="" "VCWebServiceProxyGeneratorTool"="*.discomap" "VCWebDeploymentTool"="" "VCALinkTool"="*.resources" "VCManagedResourceCompilerTool"="*.resx" "VCXMLDataGeneratorTool"="*.xsd" "VCManifestTool"="*.manifest" "VCXDCMakeTool"="*.xdc" '''.split('\n') regdata_80 = r''' [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0] "CLR Version"="v2.0.50727" "ApplicationID"="VisualStudio" "ThisVersionDTECLSID"="{BA018599-1DB3-44f9-83B4-461454C84BF8}" "ThisVersionSolutionCLSID"="{1B2EEDD6-C203-4d04-BD59-78906E3E8AAB}" "SecurityAppID"="{DF99D4F5-9F04-4CEF-9D39-095821B49C77}" "InstallDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\" "EnablePreloadCLR"=dword:00000001 "RestoreAppPath"=dword:00000001 "Source Directories"="C:\Program Files\Microsoft Visual Studio 8\VC\crt\src\;C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\src\mfc\;C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\src\atl\;C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\InstalledProducts] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\InstalledProducts\Microsoft Visual C++] "UseInterface"=dword:00000001 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}" "DefaultProductAttribute"="VC" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup] "Dbghelp_path"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\EF] "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\EnterpriseFrameworks\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\Microsoft Visual Studio 2005 Professional Edition - ENU] "SrcPath"="d:\vs\" "InstallSuccess"=dword:00000001 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VC] "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\VC\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VS] "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\" "VS7EnvironmentLocation"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe" "EnvironmentPath"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe" "EnvironmentDirectory"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\" "VS7CommonDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\" "VS7CommonBinDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VS\BuildNumber] "1033"="8.0.50727.42" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VS\Pro] "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC\VC_OBJECTS_PLATFORM_INFO] [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32] @="{72f11281-2429-11d7-8bf6-00b0d03daa06}" [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\ToolDefaultExtensionLists] "VCCLCompilerTool"="*.cpp;*.cxx;*.cc;*.c" "VCLinkerTool"="*.obj;*.res;*.lib;*.rsc;*.licenses" "VCLibrarianTool"="*.obj;*.res;*.lib;*.rsc" "VCMIDLTool"="*.idl;*.odl" "VCCustomBuildTool"="*.bat" "VCResourceCompilerTool"="*.rc" "VCPreBuildEventTool"="*.bat" "VCPreLinkEventTool"="*.bat" "VCPostBuildEventTool"="*.bat" "VCBscMakeTool"="*.sbr" "VCFxCopTool"="*.dll;*.exe" "VCNMakeTool"="" "VCWebServiceProxyGeneratorTool"="*.discomap" "VCWebDeploymentTool"="" "VCALinkTool"="*.resources" "VCManagedResourceCompilerTool"="*.resx" "VCXMLDataGeneratorTool"="*.xsd" "VCManifestTool"="*.manifest" "VCXDCMakeTool"="*.xdc" '''.split('\n') regdata_cv = r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion] "ProgramFilesDir"="C:\Program Files" "CommonFilesDir"="C:\Program Files\Common Files" "MediaPath"="C:\WINDOWS\Media" '''.split('\n') regdata_none = [] class DummyEnv(object): def __init__(self, dict=None): if dict: self.dict = dict else: self.dict = {} def Dictionary(self, key = None): if not key: return self.dict return self.dict[key] def __setitem__(self,key,value): self.dict[key] = value def __getitem__(self,key): return self.dict[key] def __contains__(self,key): return key in self.dict def has_key(self,name): return name in self.dict class RegKey(object): """key class for storing an 'open' registry key""" def __init__(self,key): self.key = key # Warning: this is NOT case-insensitive, unlike the Windows registry. # So e.g. HKLM\Software is NOT the same key as HKLM\SOFTWARE. class RegNode(object): """node in the dummy registry""" def __init__(self,name): self.valdict = {} self.keydict = {} self.keyarray = [] self.valarray = [] self.name = name def value(self,val): if val in self.valdict: return (self.valdict[val],1) else: raise SCons.Util.RegError def addValue(self,name,val): self.valdict[name] = val self.valarray.append(name) def valindex(self,index): rv = None try: rv = (self.valarray[index],self.valdict[self.valarray[index]],1) except KeyError: raise SCons.Util.RegError return rv def key(self,key,sep = '\\'): if key.find(sep) != -1: keyname, subkeys = key.split(sep,1) else: keyname = key subkeys = "" try: # recurse, and return the lowest level key node if subkeys: return self.keydict[keyname].key(subkeys) else: return self.keydict[keyname] except KeyError: raise SCons.Util.RegError def addKey(self,name,sep = '\\'): if name.find(sep) != -1: keyname, subkeys = name.split(sep, 1) else: keyname = name subkeys = "" if keyname not in self.keydict: self.keydict[keyname] = RegNode(keyname) self.keyarray.append(keyname) # recurse, and return the lowest level key node if subkeys: return self.keydict[keyname].addKey(subkeys) else: return self.keydict[keyname] def keyindex(self,index): return self.keydict[self.keyarray[index]] def __str__(self): return self._doStr() def _doStr(self, indent = ''): rv = "" for value in self.valarray: rv = rv + '%s"%s" = "%s"\n' % (indent, value, self.valdict[value]) for key in self.keyarray: rv = rv + "%s%s: {\n"%(indent, key) rv = rv + self.keydict[key]._doStr(indent + ' ') rv = rv + indent + '}\n' return rv class DummyRegistry(object): """registry class for storing fake registry attributes""" def __init__(self,data): """parse input data into the fake registry""" self.root = RegNode('REGISTRY') self.root.addKey('HKEY_LOCAL_MACHINE') self.root.addKey('HKEY_CURRENT_USER') self.root.addKey('HKEY_USERS') self.root.addKey('HKEY_CLASSES_ROOT') self.parse(data) def parse(self, data): parents = [None, None] parents[0] = self.root keymatch = re.compile('^\[(.*)\]$') valmatch = re.compile('^(?:"(.*)"|[@])="(.*)"$') for line in data: m1 = keymatch.match(line) if m1: # add a key, set it to current parent. # Also create subkey for Wow6432Node of HKLM\Software; # that's where it looks on a 64-bit machine (tests will fail w/o this) parents[0] = self.root.addKey(m1.group(1)) if 'HKEY_LOCAL_MACHINE\\Software' in m1.group(1): p1 = m1.group(1).replace('HKEY_LOCAL_MACHINE\\Software', 'HKEY_LOCAL_MACHINE\\Software\\Wow6432Node') parents[1] = self.root.addKey(p1) else: parents[1] = None else: m2 = valmatch.match(line) if m2: for p in parents: if p: p.addValue(m2.group(1),m2.group(2)) def OpenKeyEx(self,root,key): if root == SCons.Util.HKEY_CLASSES_ROOT: mykey = 'HKEY_CLASSES_ROOT\\' + key if root == SCons.Util.HKEY_USERS: mykey = 'HKEY_USERS\\' + key if root == SCons.Util.HKEY_CURRENT_USER: mykey = 'HKEY_CURRENT_USER\\' + key if root == SCons.Util.HKEY_LOCAL_MACHINE: mykey = 'HKEY_LOCAL_MACHINE\\' + key debug("Open Key:%s"%mykey) return self.root.key(mykey) def DummyOpenKeyEx(root, key): return registry.OpenKeyEx(root,key) def DummyEnumKey(key, index): rv = None try: rv = key.keyarray[index] except IndexError: raise SCons.Util.RegError # print "Enum Key",key.name,"[",index,"] =>",rv return rv def DummyEnumValue(key, index): rv = key.valindex(index) # print "Enum Value",key.name,"[",index,"] =>",rv return rv def DummyQueryValue(key, value): rv = key.value(value) # print "Query Value",key.name+"\\"+value,"=>",rv return rv def DummyExists(path): return 1 class msvsTestCase(unittest.TestCase): """This test case is run several times with different defaults. See its subclasses below.""" def setUp(self): debug("THIS TYPE :%s"%self) global registry registry = self.registry from SCons.Tool.MSCommon.vs import reset_installed_visual_studios reset_installed_visual_studios() def test_get_default_version(self): """Test retrieval of the default visual studio version""" debug("Testing for default version %s"%self.default_version) env = DummyEnv() v1 = get_default_version(env) if v1: assert env['MSVS_VERSION'] == self.default_version, \ ("env['MSVS_VERSION'] != self.default_version", env['MSVS_VERSION'],self.default_version) assert env['MSVS']['VERSION'] == self.default_version, \ ("env['MSVS']['VERSION'] != self.default_version", env['MSVS']['VERSION'], self.default_version) assert v1 == self.default_version, (self.default_version, v1) env = DummyEnv({'MSVS_VERSION':'7.0'}) v2 = get_default_version(env) assert env['MSVS_VERSION'] == '7.0', env['MSVS_VERSION'] assert env['MSVS']['VERSION'] == '7.0', env['MSVS']['VERSION'] assert v2 == '7.0', v2 env = DummyEnv() v3 = get_default_version(env) if v3 == '7.1': override = '7.0' else: override = '7.1' env['MSVS_VERSION'] = override v3 = get_default_version(env) assert env['MSVS_VERSION'] == override, env['MSVS_VERSION'] assert env['MSVS']['VERSION'] == override, env['MSVS']['VERSION'] assert v3 == override, v3 def _TODO_test_merge_default_version(self): """Test the merge_default_version() function""" pass def test_query_versions(self): """Test retrieval of the list of visual studio versions""" v1 = query_versions() assert not v1 or str(v1[0]) == self.highest_version, \ (v1, self.highest_version) assert len(v1) == self.number_of_versions, v1 def test_config_generation(self): """Test _DSPGenerator.__init__(...)""" if not self.highest_version : return # Initialize 'static' variables version_num, suite = msvs_parse_version(self.highest_version) if version_num >= 10.0: function_test = _GenerateV10DSP elif version_num >= 7.0: function_test = _GenerateV7DSP else: function_test = _GenerateV6DSP str_function_test = str(function_test.__init__) dspfile = 'test.dsp' source = 'test.cpp' # Create the cmdargs test list list_variant = ['Debug|Win32','Release|Win32', 'Debug|x64', 'Release|x64'] list_cmdargs = ['debug=True target_arch=32', 'debug=False target_arch=32', 'debug=True target_arch=x64', 'debug=False target_arch=x64'] # Tuple list : (parameter, dictionary of expected result per variant) tests_cmdargs = [(None, dict.fromkeys(list_variant, '')), ('', dict.fromkeys(list_variant, '')), (list_cmdargs[0], dict.fromkeys(list_variant, list_cmdargs[0])), (list_cmdargs, dict(list(zip(list_variant, list_cmdargs))))] # Run the test for each test case for param_cmdargs, expected_cmdargs in tests_cmdargs: debug('Testing %s. with :\n variant = %s \n cmdargs = "%s"' % \ (str_function_test, list_variant, param_cmdargs)) param_configs = [] expected_configs = {} for platform in ['Win32', 'x64']: for variant in ['Debug', 'Release']: variant_platform = '%s|%s' % (variant, platform) runfile = '%s\\%s\\test.exe' % (platform, variant) buildtarget = '%s\\%s\\test.exe' % (platform, variant) outdir = '%s\\%s' % (platform, variant) # Create parameter list for this variant_platform param_configs.append([variant_platform, runfile, buildtarget, outdir]) # Create expected dictionary result for this variant_platform expected_configs[variant_platform] = \ {'variant': variant, 'platform': platform, 'runfile': runfile, 'buildtarget': buildtarget, 'outdir': outdir, 'cmdargs': expected_cmdargs[variant_platform]} # Create parameter environment with final parameter dictionary param_dict = dict(list(zip(('variant', 'runfile', 'buildtarget', 'outdir'), [list(l) for l in zip(*param_configs)]))) param_dict['cmdargs'] = param_cmdargs # Hack to be able to run the test with a 'DummyEnv' class _DummyEnv(DummyEnv): def subst(self, string) : return string env = _DummyEnv(param_dict) env['MSVSSCONSCRIPT'] = '' env['MSVS_VERSION'] = self.highest_version # Call function to test genDSP = function_test(dspfile, source, env) # Check expected result self.assertListEqual(list(genDSP.configs.keys()), list(expected_configs.keys())) for key in list(genDSP.configs.keys()): self.assertDictEqual(genDSP.configs[key].__dict__, expected_configs[key]) class msvs6aTestCase(msvsTestCase): """Test MSVS 6 Registry""" registry = DummyRegistry(regdata_6a + regdata_cv) default_version = '6.0' highest_version = '6.0' number_of_versions = 1 install_locs = { '6.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio\\VC98', 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio\\VC98\\Bin'}, '7.0' : {}, '7.1' : {}, '8.0' : {}, '8.0Exp' : {}, } default_install_loc = install_locs['6.0'] class msvs6bTestCase(msvsTestCase): """Test Other MSVS 6 Registry""" registry = DummyRegistry(regdata_6b + regdata_cv) default_version = '6.0' highest_version = '6.0' number_of_versions = 1 install_locs = { '6.0' : {'VSINSTALLDIR': 'C:\\VS6\\VC98', 'VCINSTALLDIR': 'C:\\VS6\\VC98\\Bin'}, '7.0' : {}, '7.1' : {}, '8.0' : {}, '8.0Exp' : {}, } default_install_loc = install_locs['6.0'] class msvs6and7TestCase(msvsTestCase): """Test MSVS 6 & 7 Registry""" registry = DummyRegistry(regdata_6b + regdata_7 + regdata_cv) default_version = '7.0' highest_version = '7.0' number_of_versions = 2 install_locs = { '6.0' : {'VSINSTALLDIR': 'C:\\VS6\\VC98', 'VCINSTALLDIR': 'C:\\VS6\\VC98\\Bin'}, '7.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7', 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7\\Tools'}, '7.1' : {}, '8.0' : {}, '8.0Exp' : {}, } default_install_loc = install_locs['7.0'] class msvs7TestCase(msvsTestCase): """Test MSVS 7 Registry""" registry = DummyRegistry(regdata_7 + regdata_cv) default_version = '7.0' highest_version = '7.0' number_of_versions = 1 install_locs = { '6.0' : {}, '7.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7', 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7\\Tools'}, '7.1' : {}, '8.0' : {}, '8.0Exp' : {}, } default_install_loc = install_locs['7.0'] class msvs71TestCase(msvsTestCase): """Test MSVS 7.1 Registry""" registry = DummyRegistry(regdata_7_1 + regdata_cv) default_version = '7.1' highest_version = '7.1' number_of_versions = 1 install_locs = { '6.0' : {}, '7.0' : {}, '7.1' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7', 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\Tools'}, '8.0' : {}, '8.0Exp' : {}, } default_install_loc = install_locs['7.1'] class msvs8ExpTestCase(msvsTestCase): # XXX: only one still not working """Test MSVS 8 Express Registry""" registry = DummyRegistry(regdata_8exp + regdata_cv) default_version = '8.0Exp' highest_version = '8.0Exp' number_of_versions = 1 install_locs = { '6.0' : {}, '7.0' : {}, '7.1' : {}, '8.0' : {}, '8.0Exp' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8', 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8\\VC'}, } default_install_loc = install_locs['8.0Exp'] class msvs80TestCase(msvsTestCase): """Test MSVS 8 Registry""" registry = DummyRegistry(regdata_80 + regdata_cv) default_version = '8.0' highest_version = '8.0' number_of_versions = 1 install_locs = { '6.0' : {}, '7.0' : {}, '7.1' : {}, '8.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8', 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8\\VC'}, '8.0Exp' : {}, } default_install_loc = install_locs['8.0'] class msvsEmptyTestCase(msvsTestCase): """Test Empty Registry""" registry = DummyRegistry(regdata_none) default_version = SupportedVSList[0].version highest_version = None number_of_versions = 0 install_locs = { '6.0' : {}, '7.0' : {}, '7.1' : {}, '8.0' : {}, '8.0Exp' : {}, } default_install_loc = install_locs['8.0Exp'] if __name__ == "__main__": # only makes sense to test this on win32 if sys.platform != 'win32': sys.stdout.write("NO RESULT for msvsTests.py: '%s' is not win32\n" % sys.platform) sys.exit(0) SCons.Util.RegOpenKeyEx = DummyOpenKeyEx SCons.Util.RegEnumKey = DummyEnumKey SCons.Util.RegEnumValue = DummyEnumValue SCons.Util.RegQueryValueEx = DummyQueryValue os.path.exists = DummyExists # make sure all files exist :-) os.path.isfile = DummyExists # make sure all files are files :-) os.path.isdir = DummyExists # make sure all dirs are dirs :-) exit_val = 0 test_classes = [ msvs6aTestCase, msvs6bTestCase, msvs6and7TestCase, msvs7TestCase, msvs71TestCase, msvs8ExpTestCase, msvs80TestCase, msvsEmptyTestCase, ] for test_class in test_classes: print("TEST: ", test_class.__doc__) back_osenv = copy.deepcopy(os.environ) try: # XXX: overriding the os.environ is bad, but doing it # correctly is too complicated for now. Those tests should # be fixed for k in ['VS71COMNTOOLS', 'VS80COMNTOOLS', 'VS90COMNTOOLS']: if k in os.environ: del os.environ[k] suite = unittest.makeSuite(test_class, 'test_') if not TestUnit.cli.get_runner()().run(suite).wasSuccessful(): exit_val = 1 finally: os.env = back_osenv sys.exit(exit_val) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/FortranCommon.py0000664000175000017500000002477713160023041022627 0ustar bdbaddogbdbaddog"""SCons.Tool.FortranCommon Stuff for processing Fortran, common to all fortran dialects. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/Tool/FortranCommon.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import re import os.path import SCons.Action import SCons.Defaults import SCons.Scanner.Fortran import SCons.Tool import SCons.Util def isfortran(env, source): """Return 1 if any of code in source has fortran files in it, 0 otherwise.""" try: fsuffixes = env['FORTRANSUFFIXES'] except KeyError: # If no FORTRANSUFFIXES, no fortran tool, so there is no need to look # for fortran sources. return 0 if not source: # Source might be None for unusual cases like SConf. return 0 for s in source: if s.sources: ext = os.path.splitext(str(s.sources[0]))[1] if ext in fsuffixes: return 1 return 0 def _fortranEmitter(target, source, env): node = source[0].rfile() if not node.exists() and not node.is_derived(): print("Could not locate " + str(node.name)) return ([], []) mod_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)""" cre = re.compile(mod_regex,re.M) # Retrieve all USE'd module names modules = cre.findall(node.get_text_contents()) # Remove unique items from the list modules = SCons.Util.unique(modules) # Convert module name to a .mod filename suffix = env.subst('$FORTRANMODSUFFIX', target=target, source=source) moddir = env.subst('$FORTRANMODDIR', target=target, source=source) modules = [x.lower() + suffix for x in modules] for m in modules: target.append(env.fs.File(m, moddir)) return (target, source) def FortranEmitter(target, source, env): target, source = _fortranEmitter(target, source, env) return SCons.Defaults.StaticObjectEmitter(target, source, env) def ShFortranEmitter(target, source, env): target, source = _fortranEmitter(target, source, env) return SCons.Defaults.SharedObjectEmitter(target, source, env) def ComputeFortranSuffixes(suffixes, ppsuffixes): """suffixes are fortran source files, and ppsuffixes the ones to be pre-processed. Both should be sequences, not strings.""" assert len(suffixes) > 0 s = suffixes[0] sup = s.upper() upper_suffixes = [_.upper() for _ in suffixes] if SCons.Util.case_sensitive_suffixes(s, sup): ppsuffixes.extend(upper_suffixes) else: suffixes.extend(upper_suffixes) def CreateDialectActions(dialect): """Create dialect specific actions.""" CompAction = SCons.Action.Action('$%sCOM ' % dialect, '$%sCOMSTR' % dialect) CompPPAction = SCons.Action.Action('$%sPPCOM ' % dialect, '$%sPPCOMSTR' % dialect) ShCompAction = SCons.Action.Action('$SH%sCOM ' % dialect, '$SH%sCOMSTR' % dialect) ShCompPPAction = SCons.Action.Action('$SH%sPPCOM ' % dialect, '$SH%sPPCOMSTR' % dialect) return CompAction, CompPPAction, ShCompAction, ShCompPPAction def DialectAddToEnv(env, dialect, suffixes, ppsuffixes, support_module = 0): """Add dialect specific construction variables.""" ComputeFortranSuffixes(suffixes, ppsuffixes) fscan = SCons.Scanner.Fortran.FortranScan("%sPATH" % dialect) for suffix in suffixes + ppsuffixes: SCons.Tool.SourceFileScanner.add_scanner(suffix, fscan) env.AppendUnique(FORTRANSUFFIXES = suffixes + ppsuffixes) compaction, compppaction, shcompaction, shcompppaction = \ CreateDialectActions(dialect) static_obj, shared_obj = SCons.Tool.createObjBuilders(env) for suffix in suffixes: static_obj.add_action(suffix, compaction) shared_obj.add_action(suffix, shcompaction) static_obj.add_emitter(suffix, FortranEmitter) shared_obj.add_emitter(suffix, ShFortranEmitter) for suffix in ppsuffixes: static_obj.add_action(suffix, compppaction) shared_obj.add_action(suffix, shcompppaction) static_obj.add_emitter(suffix, FortranEmitter) shared_obj.add_emitter(suffix, ShFortranEmitter) if '%sFLAGS' % dialect not in env: env['%sFLAGS' % dialect] = SCons.Util.CLVar('') if 'SH%sFLAGS' % dialect not in env: env['SH%sFLAGS' % dialect] = SCons.Util.CLVar('$%sFLAGS' % dialect) # If a tool does not define fortran prefix/suffix for include path, use C ones if 'INC%sPREFIX' % dialect not in env: env['INC%sPREFIX' % dialect] = '$INCPREFIX' if 'INC%sSUFFIX' % dialect not in env: env['INC%sSUFFIX' % dialect] = '$INCSUFFIX' env['_%sINCFLAGS' % dialect] = '$( ${_concat(INC%sPREFIX, %sPATH, INC%sSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' % (dialect, dialect, dialect) if support_module == 1: env['%sCOM' % dialect] = '$%s -o $TARGET -c $%sFLAGS $_%sINCFLAGS $_FORTRANMODFLAG $SOURCES' % (dialect, dialect, dialect) env['%sPPCOM' % dialect] = '$%s -o $TARGET -c $%sFLAGS $CPPFLAGS $_CPPDEFFLAGS $_%sINCFLAGS $_FORTRANMODFLAG $SOURCES' % (dialect, dialect, dialect) env['SH%sCOM' % dialect] = '$SH%s -o $TARGET -c $SH%sFLAGS $_%sINCFLAGS $_FORTRANMODFLAG $SOURCES' % (dialect, dialect, dialect) env['SH%sPPCOM' % dialect] = '$SH%s -o $TARGET -c $SH%sFLAGS $CPPFLAGS $_CPPDEFFLAGS $_%sINCFLAGS $_FORTRANMODFLAG $SOURCES' % (dialect, dialect, dialect) else: env['%sCOM' % dialect] = '$%s -o $TARGET -c $%sFLAGS $_%sINCFLAGS $SOURCES' % (dialect, dialect, dialect) env['%sPPCOM' % dialect] = '$%s -o $TARGET -c $%sFLAGS $CPPFLAGS $_CPPDEFFLAGS $_%sINCFLAGS $SOURCES' % (dialect, dialect, dialect) env['SH%sCOM' % dialect] = '$SH%s -o $TARGET -c $SH%sFLAGS $_%sINCFLAGS $SOURCES' % (dialect, dialect, dialect) env['SH%sPPCOM' % dialect] = '$SH%s -o $TARGET -c $SH%sFLAGS $CPPFLAGS $_CPPDEFFLAGS $_%sINCFLAGS $SOURCES' % (dialect, dialect, dialect) def add_fortran_to_env(env): """Add Builders and construction variables for Fortran to an Environment.""" try: FortranSuffixes = env['FORTRANFILESUFFIXES'] except KeyError: FortranSuffixes = ['.f', '.for', '.ftn'] #print("Adding %s to fortran suffixes" % FortranSuffixes) try: FortranPPSuffixes = env['FORTRANPPFILESUFFIXES'] except KeyError: FortranPPSuffixes = ['.fpp', '.FPP'] DialectAddToEnv(env, "FORTRAN", FortranSuffixes, FortranPPSuffixes, support_module = 1) env['FORTRANMODPREFIX'] = '' # like $LIBPREFIX env['FORTRANMODSUFFIX'] = '.mod' # like $LIBSUFFIX env['FORTRANMODDIR'] = '' # where the compiler should place .mod files env['FORTRANMODDIRPREFIX'] = '' # some prefix to $FORTRANMODDIR - similar to $INCPREFIX env['FORTRANMODDIRSUFFIX'] = '' # some suffix to $FORTRANMODDIR - similar to $INCSUFFIX env['_FORTRANMODFLAG'] = '$( ${_concat(FORTRANMODDIRPREFIX, FORTRANMODDIR, FORTRANMODDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' def add_f77_to_env(env): """Add Builders and construction variables for f77 to an Environment.""" try: F77Suffixes = env['F77FILESUFFIXES'] except KeyError: F77Suffixes = ['.f77'] #print("Adding %s to f77 suffixes" % F77Suffixes) try: F77PPSuffixes = env['F77PPFILESUFFIXES'] except KeyError: F77PPSuffixes = [] DialectAddToEnv(env, "F77", F77Suffixes, F77PPSuffixes) def add_f90_to_env(env): """Add Builders and construction variables for f90 to an Environment.""" try: F90Suffixes = env['F90FILESUFFIXES'] except KeyError: F90Suffixes = ['.f90'] #print("Adding %s to f90 suffixes" % F90Suffixes) try: F90PPSuffixes = env['F90PPFILESUFFIXES'] except KeyError: F90PPSuffixes = [] DialectAddToEnv(env, "F90", F90Suffixes, F90PPSuffixes, support_module = 1) def add_f95_to_env(env): """Add Builders and construction variables for f95 to an Environment.""" try: F95Suffixes = env['F95FILESUFFIXES'] except KeyError: F95Suffixes = ['.f95'] #print("Adding %s to f95 suffixes" % F95Suffixes) try: F95PPSuffixes = env['F95PPFILESUFFIXES'] except KeyError: F95PPSuffixes = [] DialectAddToEnv(env, "F95", F95Suffixes, F95PPSuffixes, support_module = 1) def add_f03_to_env(env): """Add Builders and construction variables for f03 to an Environment.""" try: F03Suffixes = env['F03FILESUFFIXES'] except KeyError: F03Suffixes = ['.f03'] #print("Adding %s to f95 suffixes" % F95Suffixes) try: F03PPSuffixes = env['F03PPFILESUFFIXES'] except KeyError: F03PPSuffixes = [] DialectAddToEnv(env, "F03", F03Suffixes, F03PPSuffixes, support_module = 1) def add_f08_to_env(env): """Add Builders and construction variables for f08 to an Environment.""" try: F08Suffixes = env['F08FILESUFFIXES'] except KeyError: F08Suffixes = ['.f08'] try: F08PPSuffixes = env['F08PPFILESUFFIXES'] except KeyError: F08PPSuffixes = [] DialectAddToEnv(env, "F08", F08Suffixes, F08PPSuffixes, support_module = 1) def add_all_to_env(env): """Add builders and construction variables for all supported fortran dialects.""" add_fortran_to_env(env) add_f77_to_env(env) add_f90_to_env(env) add_f95_to_env(env) add_f03_to_env(env) add_f08_to_env(env) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/aixcc.py0000664000175000017500000000440013160023041021107 0ustar bdbaddogbdbaddog"""SCons.Tool.aixcc Tool-specific initialization for IBM xlc / Visual Age C compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/aixcc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import SCons.Platform.aix from . import cc packages = ['vac.C', 'ibmcxx.cmp'] def get_xlc(env): xlc = env.get('CC', 'xlc') return SCons.Platform.aix.get_xlc(env, xlc, packages) def generate(env): """Add Builders and construction variables for xlc / Visual Age suite to an Environment.""" path, _cc, version = get_xlc(env) if path and _cc: _cc = os.path.join(path, _cc) if 'CC' not in env: env['CC'] = _cc cc.generate(env) if version: env['CCVERSION'] = version def exists(env): path, _cc, version = get_xlc(env) if path and _cc: xlc = os.path.join(path, _cc) if os.path.exists(xlc): return xlc return None # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/bcc32.py0000664000175000017500000000562513160023041020726 0ustar bdbaddogbdbaddog"""SCons.Tool.bcc32 XXX """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/bcc32.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import SCons.Defaults import SCons.Tool import SCons.Util def findIt(program, env): # First search in the SCons path and then the OS path: borwin = env.WhereIs(program) or SCons.Util.WhereIs(program) if borwin: dir = os.path.dirname(borwin) env.PrependENVPath('PATH', dir) return borwin def generate(env): findIt('bcc32', env) """Add Builders and construction variables for bcc to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) for suffix in ['.c', '.cpp']: static_obj.add_action(suffix, SCons.Defaults.CAction) shared_obj.add_action(suffix, SCons.Defaults.ShCAction) static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) env['CC'] = 'bcc32' env['CCFLAGS'] = SCons.Util.CLVar('') env['CFLAGS'] = SCons.Util.CLVar('') env['CCCOM'] = '$CC -q $CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o$TARGET $SOURCES' env['SHCC'] = '$CC' env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS') env['SHCCCOM'] = '$SHCC -WD $SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o$TARGET $SOURCES' env['CPPDEFPREFIX'] = '-D' env['CPPDEFSUFFIX'] = '' env['INCPREFIX'] = '-I' env['INCSUFFIX'] = '' env['SHOBJSUFFIX'] = '.dll' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0 env['CFILESUFFIX'] = '.cpp' def exists(env): return findIt('bcc32', env) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/ar.xml0000664000175000017500000000471113160023041020577 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &ar; library archiver. AR ARFLAGS ARCOM LIBPREFIX LIBSUFFIX RANLIB RANLIBFLAGS RANLIBCOM The static library archiver. The command line used to generate a static library from object files. The string displayed when an object file is generated from an assembly-language source file. If this is not set, then &cv-link-ARCOM; (the command line) is displayed. env = Environment(ARCOMSTR = "Archiving $TARGET") General options passed to the static library archiver. The archive indexer. The command line used to index a static library archive. The string displayed when a static library archive is indexed. If this is not set, then &cv-link-RANLIBCOM; (the command line) is displayed. env = Environment(RANLIBCOMSTR = "Indexing $TARGET") General options passed to the archive indexer. scons-src-3.0.0/src/engine/SCons/Tool/ldc.xml0000664000175000017500000001520713160023044020744 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the D language compiler LDC2. DC DCOM SHDC SHDCOM DPATH DFLAGS DVERSIONS DDEBUG DINCPREFIX DINCSUFFIX DVERPREFIX DVERSUFFIX DDEBUGPREFIX DDEBUGSUFFIX DFLAGPREFIX DFLAGSUFFIX DFILESUFFIX DLINK DLINKFLAGS DLINKCOM SHDLINK SHDLINKFLAGS SHDLINKCOM DLIBLINKPREFIX DLIBLINKSUFFIX DLIBDIRPREFIX DLIBDIRSUFFIX DLIB DLIBCOM DLIBFLAGPREFIX DLIBFLAGSUFFIX DLINKFLAGPREFIX DLINKFLAGSUFFIX DRPATHPREFIX DRPATHSUFFIX DShLibSonameGenerator SHDLIBVERSION SHDLIBVERSIONFLAGS The D compiler to use. The command line used to compile a D file to an object file. Any options specified in the &cv-link-DFLAGS; construction variable is included on this command line. List of debug tags to enable when compiling. General options that are passed to the D compiler. Name of the lib tool to use for D codes. The command line to use when creating libraries. Name of the linker to use for linking systems including D sources. The command line to use when linking systems including D sources. List of linker flags. List of paths to search for import modules. List of version tags to enable when compiling. The name of the compiler to use when compiling D source destined to be in a shared objects. The command line to use when compiling code to be part of shared objects. The linker to use when creating shared objects for code bases include D sources. The command line to use when generating shared objects. The list of flags to use when generating a shared object. DVERSUFFIX. DVERPREFIX. DLINKFLAGSUFFIX. DLINKFLAGPREFIX. DLIBLINKSUFFIX. DLIBLINKPREFIX. DLIBFLAGSUFFIX. DLIBFLAGPREFIX. DLIBLINKSUFFIX. DLIBLINKPREFIX. DLIBFLAGSUFFIX. DINCPREFIX. DFLAGSUFFIX. DFLAGPREFIX. DFILESUFFIX. DDEBUGPREFIX. DDEBUGSUFFIX. Builds an executable from D sources without first creating individual objects for each file. D sources can be compiled file-by-file as C and C++ source are, and D is integrated into the &scons; Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others will not. scons-src-3.0.0/src/engine/SCons/Tool/sgilink.xml0000664000175000017500000000211113160023044021630 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the SGI linker. LINK SHLINKFLAGS RPATHPREFIX RPATHSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/c++.py0000664000175000017500000000315113160023041020372 0ustar bdbaddogbdbaddog"""SCons.Tool.c++ Tool-specific initialization for generic Posix C++ compilers. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/c++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" #forward proxy to the preffered cxx version from SCons.Tool.cxx import * # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/dvi.xml0000664000175000017500000000464213160023044020765 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Attaches the &b-DVI; builder to the construction environment. Builds a .dvi file from a .tex, .ltx or .latex input file. If the source file suffix is .tex, &scons; will examine the contents of the file; if the string \documentclass or \documentstyle is found, the file is assumed to be a LaTeX file and the target is built by invoking the &cv-link-LATEXCOM; command line; otherwise, the &cv-link-TEXCOM; command line is used. If the file is a LaTeX file, the &b-DVI; builder method will also examine the contents of the .aux file and invoke the &cv-link-BIBTEX; command line if the string bibdata is found, start &cv-link-MAKEINDEX; to generate an index if a .ind file is found and will examine the contents .log file and re-run the &cv-link-LATEXCOM; command if the log file says it is necessary. The suffix .dvi (hard-coded within TeX itself) is automatically added to the target if it is not already present. Examples: # builds from aaa.tex env.DVI(target = 'aaa.dvi', source = 'aaa.tex') # builds bbb.dvi env.DVI(target = 'bbb', source = 'bbb.ltx') # builds from ccc.latex env.DVI(target = 'ccc.dvi', source = 'ccc.latex') scons-src-3.0.0/src/engine/SCons/Tool/applelink.py0000664000175000017500000000623713160023041022011 0ustar bdbaddogbdbaddog"""SCons.Tool.applelink Tool-specific initialization for the Apple gnu-like linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/applelink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util # Even though the Mac is based on the GNU toolchain, it doesn't understand # the -rpath option, so we use the "link" tool instead of "gnulink". from . import link def generate(env): """Add Builders and construction variables for applelink to an Environment.""" link.generate(env) env['FRAMEWORKPATHPREFIX'] = '-F' env['_FRAMEWORKPATH'] = '${_concat(FRAMEWORKPATHPREFIX, FRAMEWORKPATH, "", __env__)}' env['_FRAMEWORKS'] = '${_concat("-framework ", FRAMEWORKS, "", __env__)}' env['LINKCOM'] = env['LINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS' env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -dynamiclib') env['SHLINKCOM'] = env['SHLINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS' # TODO: Work needed to generate versioned shared libraries # Leaving this commented out, and also going to disable versioned library checking for now # see: http://docstore.mik.ua/orelly/unix3/mac/ch05_04.htm for proper naming #link._setup_versioned_lib_variables(env, tool = 'applelink')#, use_soname = use_soname) #env['LINKCALLBACKS'] = link._versioned_lib_callbacks() # override the default for loadable modules, which are different # on OS X than dynamic shared libs. echoing what XCode does for # pre/suffixes: env['LDMODULEPREFIX'] = '' env['LDMODULESUFFIX'] = '' env['LDMODULEFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -bundle') env['LDMODULECOM'] = '$LDMODULE -o ${TARGET} $LDMODULEFLAGS $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS' def exists(env): return env['PLATFORM'] == 'darwin' # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/install.py0000664000175000017500000003664313160023044021507 0ustar bdbaddogbdbaddog"""SCons.Tool.install Tool-specific initialization for the install tool. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/Tool/install.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import re import shutil import stat import SCons.Action import SCons.Tool import SCons.Util # # We keep track of *all* installed files. _INSTALLED_FILES = [] _UNIQUE_INSTALLED_FILES = None class CopytreeError(EnvironmentError): pass # This is a patched version of shutil.copytree from python 2.5. It # doesn't fail if the dir exists, which regular copytree does # (annoyingly). Note the XXX comment in the docstring. def scons_copytree(src, dst, symlinks=False): """Recursively copy a directory tree using copy2(). The destination directory must not already exist. If exception(s) occur, an CopytreeError is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. XXX Consider this example code rather than the ultimate tool. """ names = os.listdir(src) # garyo@genarts.com fix: check for dir before making dirs. if not os.path.exists(dst): os.makedirs(dst) errors = [] for name in names: srcname = os.path.join(src, name) dstname = os.path.join(dst, name) try: if symlinks and os.path.islink(srcname): linkto = os.readlink(srcname) os.symlink(linkto, dstname) elif os.path.isdir(srcname): scons_copytree(srcname, dstname, symlinks) else: shutil.copy2(srcname, dstname) # XXX What about devices, sockets etc.? except (IOError, os.error) as why: errors.append((srcname, dstname, str(why))) # catch the CopytreeError from the recursive copytree so that we can # continue with other files except CopytreeError as err: errors.extend(err.args[0]) try: shutil.copystat(src, dst) except SCons.Util.WinError: # can't copy file access times on Windows pass except OSError as why: errors.extend((src, dst, str(why))) if errors: raise CopytreeError(errors) # # Functions doing the actual work of the Install Builder. # def copyFunc(dest, source, env): """Install a source file or directory into a destination by copying, (including copying permission/mode bits).""" if os.path.isdir(source): if os.path.exists(dest): if not os.path.isdir(dest): raise SCons.Errors.UserError("cannot overwrite non-directory `%s' with a directory `%s'" % (str(dest), str(source))) else: parent = os.path.split(dest)[0] if not os.path.exists(parent): os.makedirs(parent) scons_copytree(source, dest) else: shutil.copy2(source, dest) st = os.stat(source) os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) return 0 # # Functions doing the actual work of the InstallVersionedLib Builder. # def copyFuncVersionedLib(dest, source, env): """Install a versioned library into a destination by copying, (including copying permission/mode bits) and then creating required symlinks.""" if os.path.isdir(source): raise SCons.Errors.UserError("cannot install directory `%s' as a version library" % str(source) ) else: # remove the link if it is already there try: os.remove(dest) except: pass shutil.copy2(source, dest) st = os.stat(source) os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) installShlibLinks(dest, source, env) return 0 def listShlibLinksToInstall(dest, source, env): install_links = [] source = env.arg2nodes(source) dest = env.fs.File(dest) install_dir = dest.get_dir() for src in source: symlinks = getattr(getattr(src,'attributes',None), 'shliblinks', None) if symlinks: for link, linktgt in symlinks: link_base = os.path.basename(link.get_path()) linktgt_base = os.path.basename(linktgt.get_path()) install_link = env.fs.File(link_base, install_dir) install_linktgt = env.fs.File(linktgt_base, install_dir) install_links.append((install_link, install_linktgt)) return install_links def installShlibLinks(dest, source, env): """If we are installing a versioned shared library create the required links.""" Verbose = False symlinks = listShlibLinksToInstall(dest, source, env) if Verbose: print('installShlibLinks: symlinks={:r}'.format(SCons.Tool.StringizeLibSymlinks(symlinks))) if symlinks: SCons.Tool.CreateLibSymlinks(env, symlinks) return def installFunc(target, source, env): """Install a source file into a target using the function specified as the INSTALL construction variable.""" try: install = env['INSTALL'] except KeyError: raise SCons.Errors.UserError('Missing INSTALL construction variable.') assert len(target)==len(source), \ "Installing source %s into target %s: target and source lists must have same length."%(list(map(str, source)), list(map(str, target))) for t,s in zip(target,source): if install(t.get_path(),s.get_path(),env): return 1 return 0 def installFuncVersionedLib(target, source, env): """Install a versioned library into a target using the function specified as the INSTALLVERSIONEDLIB construction variable.""" try: install = env['INSTALLVERSIONEDLIB'] except KeyError: raise SCons.Errors.UserError('Missing INSTALLVERSIONEDLIB construction variable.') assert len(target)==len(source), \ "Installing source %s into target %s: target and source lists must have same length."%(list(map(str, source)), list(map(str, target))) for t,s in zip(target,source): if hasattr(t.attributes, 'shlibname'): tpath = os.path.join(t.get_dir(), t.attributes.shlibname) else: tpath = t.get_path() if install(tpath,s.get_path(),env): return 1 return 0 def stringFunc(target, source, env): installstr = env.get('INSTALLSTR') if installstr: return env.subst_target_source(installstr, 0, target, source) target = str(target[0]) source = str(source[0]) if os.path.isdir(source): type = 'directory' else: type = 'file' return 'Install %s: "%s" as "%s"' % (type, source, target) # # Emitter functions # def add_targets_to_INSTALLED_FILES(target, source, env): """ An emitter that adds all target files to the list stored in the _INSTALLED_FILES global variable. This way all installed files of one scons call will be collected. """ global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES _INSTALLED_FILES.extend(target) _UNIQUE_INSTALLED_FILES = None return (target, source) def add_versioned_targets_to_INSTALLED_FILES(target, source, env): """ An emitter that adds all target files to the list stored in the _INSTALLED_FILES global variable. This way all installed files of one scons call will be collected. """ global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES Verbose = False _INSTALLED_FILES.extend(target) if Verbose: print("add_versioned_targets_to_INSTALLED_FILES: target={:r}".format(list(map(str, target)))) symlinks = listShlibLinksToInstall(target[0], source, env) if symlinks: SCons.Tool.EmitLibSymlinks(env, symlinks, target[0]) _UNIQUE_INSTALLED_FILES = None return (target, source) class DESTDIR_factory(object): """ A node factory, where all files will be relative to the dir supplied in the constructor. """ def __init__(self, env, dir): self.env = env self.dir = env.arg2nodes( dir, env.fs.Dir )[0] def Entry(self, name): name = SCons.Util.make_path_relative(name) return self.dir.Entry(name) def Dir(self, name): name = SCons.Util.make_path_relative(name) return self.dir.Dir(name) # # The Builder Definition # install_action = SCons.Action.Action(installFunc, stringFunc) installas_action = SCons.Action.Action(installFunc, stringFunc) installVerLib_action = SCons.Action.Action(installFuncVersionedLib, stringFunc) BaseInstallBuilder = None def InstallBuilderWrapper(env, target=None, source=None, dir=None, **kw): if target and dir: import SCons.Errors raise SCons.Errors.UserError("Both target and dir defined for Install(), only one may be defined.") if not dir: dir=target import SCons.Script install_sandbox = SCons.Script.GetOption('install_sandbox') if install_sandbox: target_factory = DESTDIR_factory(env, install_sandbox) else: target_factory = env.fs try: dnodes = env.arg2nodes(dir, target_factory.Dir) except TypeError: raise SCons.Errors.UserError("Target `%s' of Install() is a file, but should be a directory. Perhaps you have the Install() arguments backwards?" % str(dir)) sources = env.arg2nodes(source, env.fs.Entry) tgt = [] for dnode in dnodes: for src in sources: # Prepend './' so the lookup doesn't interpret an initial # '#' on the file name portion as meaning the Node should # be relative to the top-level SConstruct directory. target = env.fs.Entry('.'+os.sep+src.name, dnode) tgt.extend(BaseInstallBuilder(env, target, src, **kw)) return tgt def InstallAsBuilderWrapper(env, target=None, source=None, **kw): result = [] for src, tgt in map(lambda x, y: (x, y), source, target): result.extend(BaseInstallBuilder(env, tgt, src, **kw)) return result BaseVersionedInstallBuilder = None def InstallVersionedBuilderWrapper(env, target=None, source=None, dir=None, **kw): if target and dir: import SCons.Errors raise SCons.Errors.UserError("Both target and dir defined for Install(), only one may be defined.") if not dir: dir=target import SCons.Script install_sandbox = SCons.Script.GetOption('install_sandbox') if install_sandbox: target_factory = DESTDIR_factory(env, install_sandbox) else: target_factory = env.fs try: dnodes = env.arg2nodes(dir, target_factory.Dir) except TypeError: raise SCons.Errors.UserError("Target `%s' of Install() is a file, but should be a directory. Perhaps you have the Install() arguments backwards?" % str(dir)) sources = env.arg2nodes(source, env.fs.Entry) tgt = [] for dnode in dnodes: for src in sources: # Prepend './' so the lookup doesn't interpret an initial # '#' on the file name portion as meaning the Node should # be relative to the top-level SConstruct directory. target = env.fs.Entry('.'+os.sep+src.name, dnode) tgt.extend(BaseVersionedInstallBuilder(env, target, src, **kw)) return tgt added = None def generate(env): from SCons.Script import AddOption, GetOption global added if not added: added = 1 AddOption('--install-sandbox', dest='install_sandbox', type="string", action="store", help='A directory under which all installed files will be placed.') global BaseInstallBuilder if BaseInstallBuilder is None: install_sandbox = GetOption('install_sandbox') if install_sandbox: target_factory = DESTDIR_factory(env, install_sandbox) else: target_factory = env.fs BaseInstallBuilder = SCons.Builder.Builder( action = install_action, target_factory = target_factory.Entry, source_factory = env.fs.Entry, multi = 1, emitter = [ add_targets_to_INSTALLED_FILES, ], source_scanner = SCons.Scanner.Base( {}, name = 'Install', recursive = False ), name = 'InstallBuilder') global BaseVersionedInstallBuilder if BaseVersionedInstallBuilder is None: install_sandbox = GetOption('install_sandbox') if install_sandbox: target_factory = DESTDIR_factory(env, install_sandbox) else: target_factory = env.fs BaseVersionedInstallBuilder = SCons.Builder.Builder( action = installVerLib_action, target_factory = target_factory.Entry, source_factory = env.fs.Entry, multi = 1, emitter = [ add_versioned_targets_to_INSTALLED_FILES, ], name = 'InstallVersionedBuilder') env['BUILDERS']['_InternalInstall'] = InstallBuilderWrapper env['BUILDERS']['_InternalInstallAs'] = InstallAsBuilderWrapper env['BUILDERS']['_InternalInstallVersionedLib'] = InstallVersionedBuilderWrapper # We'd like to initialize this doing something like the following, # but there isn't yet support for a ${SOURCE.type} expansion that # will print "file" or "directory" depending on what's being # installed. For now we punt by not initializing it, and letting # the stringFunc() that we put in the action fall back to the # hand-crafted default string if it's not set. # #try: # env['INSTALLSTR'] #except KeyError: # env['INSTALLSTR'] = 'Install ${SOURCE.type}: "$SOURCES" as "$TARGETS"' try: env['INSTALL'] except KeyError: env['INSTALL'] = copyFunc try: env['INSTALLVERSIONEDLIB'] except KeyError: env['INSTALLVERSIONEDLIB'] = copyFuncVersionedLib def exists(env): return 1 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/rmic.py0000664000175000017500000001046513160023044020765 0ustar bdbaddogbdbaddog"""SCons.Tool.rmic Tool-specific initialization for rmic. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/rmic.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import SCons.Action import SCons.Builder import SCons.Node.FS import SCons.Util def emit_rmic_classes(target, source, env): """Create and return lists of Java RMI stub and skeleton class files to be created from a set of class files. """ class_suffix = env.get('JAVACLASSSUFFIX', '.class') classdir = env.get('JAVACLASSDIR') if not classdir: try: s = source[0] except IndexError: classdir = '.' else: try: classdir = s.attributes.java_classdir except AttributeError: classdir = '.' classdir = env.Dir(classdir).rdir() if str(classdir) == '.': c_ = None else: c_ = str(classdir) + os.sep slist = [] for src in source: try: classname = src.attributes.java_classname except AttributeError: classname = str(src) if c_ and classname[:len(c_)] == c_: classname = classname[len(c_):] if class_suffix and classname[:-len(class_suffix)] == class_suffix: classname = classname[-len(class_suffix):] s = src.rfile() s.attributes.java_classdir = classdir s.attributes.java_classname = classname slist.append(s) stub_suffixes = ['_Stub'] if env.get('JAVAVERSION') == '1.4': stub_suffixes.append('_Skel') tlist = [] for s in source: for suff in stub_suffixes: fname = s.attributes.java_classname.replace('.', os.sep) + \ suff + class_suffix t = target[0].File(fname) t.attributes.java_lookupdir = target[0] tlist.append(t) return tlist, source RMICAction = SCons.Action.Action('$RMICCOM', '$RMICCOMSTR') RMICBuilder = SCons.Builder.Builder(action = RMICAction, emitter = emit_rmic_classes, src_suffix = '$JAVACLASSSUFFIX', target_factory = SCons.Node.FS.Dir, source_factory = SCons.Node.FS.File) def generate(env): """Add Builders and construction variables for rmic to an Environment.""" env['BUILDERS']['RMIC'] = RMICBuilder env['RMIC'] = 'rmic' env['RMICFLAGS'] = SCons.Util.CLVar('') env['RMICCOM'] = '$RMIC $RMICFLAGS -d ${TARGET.attributes.java_lookupdir} -classpath ${SOURCE.attributes.java_classdir} ${SOURCES.attributes.java_classname}' env['JAVACLASSSUFFIX'] = '.class' def exists(env): # As reported by Jan Nijtmans in issue #2730, the simple # return env.Detect('rmic') # doesn't always work during initialization. For now, we # stop trying to detect an executable (analogous to the # javac Builder). # TODO: Come up with a proper detect() routine...and enable it. return 1 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/fortran.py0000664000175000017500000000375313160023044021510 0ustar bdbaddogbdbaddog"""SCons.Tool.fortran Tool-specific initialization for a generic Posix f77/f90 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/fortran.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import re import SCons.Action import SCons.Defaults import SCons.Scanner.Fortran import SCons.Tool import SCons.Util from SCons.Tool.FortranCommon import add_all_to_env, add_fortran_to_env compilers = ['f95', 'f90', 'f77'] def generate(env): add_all_to_env(env) add_fortran_to_env(env) fc = env.Detect(compilers) or 'f77' env['SHFORTRAN'] = fc env['FORTRAN'] = fc def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/icc.xml0000664000175000017500000000254413160023044020740 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the icc compiler on OS/2 systems. CC CCCOM CXXCOM CPPDEFPREFIX CPPDEFSUFFIX INCPREFIX INCSUFFIX CFILESUFFIX CXXFILESUFFIX CFLAGS CCFLAGS CPPFLAGS _CPPDEFFLAGS _CPPINCFLAGS scons-src-3.0.0/src/engine/SCons/Tool/rmic.xml0000664000175000017500000000576113160023044021140 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &rmic; utility. RMIC RMICFLAGS RMICCOM JAVACLASSSUFFIX RMICCOMSTR Builds stub and skeleton class files for remote objects from Java .class files. The target is a directory relative to which the stub and skeleton class files will be written. The source can be the names of .class files, or the objects return from the &b-Java; builder method. If the construction variable &cv-link-JAVACLASSDIR; is set, either in the environment or in the call to the &b-RMIC; builder method itself, then the value of the variable will be stripped from the beginning of any .class file names. classes = env.Java(target = 'classdir', source = 'src') env.RMIC(target = 'outdir1', source = classes) env.RMIC(target = 'outdir2', source = ['package/foo.class', 'package/bar.class']) env.RMIC(target = 'outdir3', source = ['classes/foo.class', 'classes/bar.class'], JAVACLASSDIR = 'classes') The Java RMI stub compiler. The command line used to compile stub and skeleton class files from Java classes that contain RMI implementations. Any options specified in the &cv-link-RMICFLAGS; construction variable are included on this command line. The string displayed when compiling stub and skeleton class files from Java classes that contain RMI implementations. If this is not set, then &cv-link-RMICCOM; (the command line) is displayed. env = Environment(RMICCOMSTR = "Generating stub/skeleton class files $TARGETS from $SOURCES") General options passed to the Java RMI stub compiler. scons-src-3.0.0/src/engine/SCons/Tool/masm.xml0000664000175000017500000000243013160023044021131 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Microsoft assembler. AS ASFLAGS ASPPFLAGS ASCOM ASPPCOM ASCOMSTR ASPPCOMSTR CPPFLAGS _CPPDEFFLAGS _CPPINCFLAGS scons-src-3.0.0/src/engine/SCons/Tool/jar.xml0000664000175000017500000000630613160023044020756 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &jar; utility. JAR JARFLAGS JARCOM JARSUFFIX JARCOMSTR Builds a Java archive (.jar) file from the specified list of sources. Any directories in the source list will be searched for .class files). Any .java files in the source list will be compiled to .class files by calling the &b-link-Java; Builder. If the &cv-link-JARCHDIR; value is set, the &jar; command will change to the specified directory using the option. If &cv-JARCHDIR; is not set explicitly, &SCons; will use the top of any subdirectory tree in which Java .class were built by the &b-link-Java; Builder. If the contents any of the source files begin with the string Manifest-Version, the file is assumed to be a manifest and is passed to the &jar; command with the option set. env.Jar(target = 'foo.jar', source = 'classes') env.Jar(target = 'bar.jar', source = ['bar1.java', 'bar2.java']) The Java archive tool. The directory to which the Java archive tool should change (using the option). The command line used to call the Java archive tool. The string displayed when the Java archive tool is called If this is not set, then &cv-link-JARCOM; (the command line) is displayed. env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") General options passed to the Java archive tool. By default this is set to to create the necessary jar file. The suffix for Java archives: .jar by default. scons-src-3.0.0/src/engine/SCons/Tool/mingw.py0000664000175000017500000001474613160023044021162 0ustar bdbaddogbdbaddog"""SCons.Tool.gcc Tool-specific initialization for MinGW (http://www.mingw.org/) There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/mingw.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import SCons.Action import SCons.Builder import SCons.Defaults import SCons.Tool import SCons.Util # This is what we search for to find mingw: key_program = 'mingw32-gcc' def find(env): # First search in the SCons path path=env.WhereIs(key_program) if (path): return path # then the OS path: path=SCons.Util.WhereIs(key_program) if (path): return path # If that doesn't work try default location for mingw save_path=env['ENV']['PATH'] env.AppendENVPath('PATH',r'c:\MinGW\bin') path =env.WhereIs(key_program) if not path: env['ENV']['PATH']=save_path return path def shlib_generator(target, source, env, for_signature): cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS']) dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') if dll: cmd.extend(['-o', dll]) cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS']) implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX') if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature)) def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') insert_def = env.subst("$WINDOWS_INSERT_DEF") if not insert_def in ['', '0', 0] and def_target: \ cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature)) return [cmd] def shlib_emitter(target, source, env): dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') no_import_lib = env.get('no_import_lib', 0) if not dll: raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s Target(s) are:%s" % \ (env.subst("$SHLIBSUFFIX"), ",".join([str(t) for t in target]))) if not no_import_lib and \ not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'): # Create list of target libraries as strings targetStrings=env.ReplaceIxes(dll, 'SHLIBPREFIX', 'SHLIBSUFFIX', 'LIBPREFIX', 'LIBSUFFIX') # Now add file nodes to target list target.append(env.fs.File(targetStrings)) # Append a def file target if there isn't already a def file target # or a def file source or the user has explicitly asked for the target # to be emitted. def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') skip_def_insert = env.subst("$WINDOWS_INSERT_DEF") in ['', '0', 0] if not def_source and not def_target and not skip_def_insert: # Create list of target libraries and def files as strings targetStrings=env.ReplaceIxes(dll, 'SHLIBPREFIX', 'SHLIBSUFFIX', 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') # Now add file nodes to target list target.append(env.fs.File(targetStrings)) return (target, source) shlib_action = SCons.Action.Action(shlib_generator, generator=1) res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') res_builder = SCons.Builder.Builder(action=res_action, suffix='.o', source_scanner=SCons.Tool.SourceFileScanner) SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan) def generate(env): mingw = find(env) if mingw: dir = os.path.dirname(mingw) env.PrependENVPath('PATH', dir ) # Most of mingw is the same as gcc and friends... gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'gfortran', 'm4'] for tool in gnu_tools: SCons.Tool.Tool(tool)(env) #... but a few things differ: env['CC'] = 'gcc' env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') env['CXX'] = 'g++' env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS') env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') env['SHLINKCOM'] = shlib_action env['LDMODULECOM'] = shlib_action env.Append(SHLIBEMITTER = [shlib_emitter]) env.Append(LDMODULEEMITTER = [shlib_emitter]) env['AS'] = 'as' env['WIN32DEFPREFIX'] = '' env['WIN32DEFSUFFIX'] = '.def' env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}' env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}' env['SHOBJSUFFIX'] = '.o' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 env['RC'] = 'windres' env['RCFLAGS'] = SCons.Util.CLVar('') env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' env['RCINCPREFIX'] = '--include-dir ' env['RCINCSUFFIX'] = '' env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET' env['BUILDERS']['RES'] = res_builder # Some setting from the platform also have to be overridden: env['OBJSUFFIX'] = '.o' env['LIBPREFIX'] = 'lib' env['LIBSUFFIX'] = '.a' env['PROGSUFFIX'] = '.exe' def exists(env): return find(env) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/mssdk.xml0000664000175000017500000000363113160023044021321 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets variables for Microsoft Platform SDK and/or Windows SDK. Note that unlike most other Tool modules, mssdk does not set construction variables, but sets the environment variables in the environment &SCons; uses to execute the Microsoft toolchain: %INCLUDE%, %LIB%, %LIBPATH% and %PATH%. MSSDK_DIR MSSDK_VERSION MSVS_VERSION The directory containing the Microsoft SDK (either Platform SDK or Windows SDK) to be used for compilation. The version string of the Microsoft SDK (either Platform SDK or Windows SDK) to be used for compilation. Supported versions include 6.1, 6.0A, 6.0, 2003R2 and 2003R1. scons-src-3.0.0/src/engine/SCons/Tool/latex.py0000664000175000017500000000527213160023044021150 0ustar bdbaddogbdbaddog"""SCons.Tool.latex Tool-specific initialization for LaTeX. Generates .dvi files from .latex or .ltx files There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/latex.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Action import SCons.Defaults import SCons.Scanner.LaTeX import SCons.Util import SCons.Tool import SCons.Tool.tex def LaTeXAuxFunction(target = None, source= None, env=None): result = SCons.Tool.tex.InternalLaTeXAuxAction( SCons.Tool.tex.LaTeXAction, target, source, env ) if result != 0: SCons.Tool.tex.check_file_error_message(env['LATEX']) return result LaTeXAuxAction = SCons.Action.Action(LaTeXAuxFunction, strfunction=SCons.Tool.tex.TeXLaTeXStrFunction) def generate(env): """Add Builders and construction variables for LaTeX to an Environment.""" env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes) from . import dvi dvi.generate(env) from . import pdf pdf.generate(env) bld = env['BUILDERS']['DVI'] bld.add_action('.ltx', LaTeXAuxAction) bld.add_action('.latex', LaTeXAuxAction) bld.add_emitter('.ltx', SCons.Tool.tex.tex_eps_emitter) bld.add_emitter('.latex', SCons.Tool.tex.tex_eps_emitter) SCons.Tool.tex.generate_common(env) def exists(env): SCons.Tool.tex.generate_darwin(env) return env.Detect('latex') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/f90.py0000664000175000017500000000374213160023044020431 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.f90 Tool-specific initialization for the generic Posix f90 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/f90.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Scanner.Fortran import SCons.Tool import SCons.Util from SCons.Tool.FortranCommon import add_all_to_env, add_f90_to_env compilers = ['f90'] def generate(env): add_all_to_env(env) add_f90_to_env(env) fc = env.Detect(compilers) or 'f90' env['F90'] = fc env['SHF90'] = fc env['FORTRAN'] = fc env['SHFORTRAN'] = fc def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sunf90.py0000664000175000017500000000415613160023044021157 0ustar bdbaddogbdbaddog"""SCons.Tool.sunf90 Tool-specific initialization for sunf90, the Sun Studio F90 compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sunf90.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util from .FortranCommon import add_all_to_env compilers = ['sunf90', 'f90'] def generate(env): """Add Builders and construction variables for sun f90 compiler to an Environment.""" add_all_to_env(env) fcomp = env.Detect(compilers) or 'f90' env['FORTRAN'] = fcomp env['F90'] = fcomp env['SHFORTRAN'] = '$FORTRAN' env['SHF90'] = '$F90' env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS -KPIC') env['SHF90FLAGS'] = SCons.Util.CLVar('$F90FLAGS -KPIC') def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/applelink.xml0000664000175000017500000000673413160023041022163 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Apple linker (similar to the GNU linker). FRAMEWORKPATHPREFIX _FRAMEWORKPATH _FRAMEWORKS LINKCOM SHLINKFLAGS SHLINKCOM LDMODULEPREFIX LDMODULESUFFIX LDMODULEFLAGS LDMODULECOM FRAMEWORKSFLAGS "> On Mac OS X with gcc, general user-supplied frameworks options to be added at the end of a command line building a loadable module. (This has been largely superseded by the &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKPATHPREFIX;, &cv-link-FRAMEWORKPREFIX; and &cv-link-FRAMEWORKS; variables described above.) On Mac OS X with gcc, a list of the framework names to be linked into a program or shared library or bundle. The default value is the empty list. For example: env.AppendUnique(FRAMEWORKS=Split('System Cocoa SystemConfiguration')) On Mac OS X with gcc, the prefix to be used for linking in frameworks (see &cv-link-FRAMEWORKS;). The default value is . On Mac OS X with gcc, an automatically-generated construction variable containing the linker command-line options for linking with FRAMEWORKS. On Mac OS X with gcc, a list containing the paths to search for frameworks. Used by the compiler to find framework-style includes like #include <Fmwk/Header.h>. Used by the linker to find user-specified frameworks when linking (see &cv-link-FRAMEWORKS;). For example: env.AppendUnique(FRAMEWORKPATH='#myframeworkdir') will add ... -Fmyframeworkdir to the compiler and linker command lines. On Mac OS X with gcc, the prefix to be used for the FRAMEWORKPATH entries. (see &cv-link-FRAMEWORKPATH;). The default value is . On Mac OS X with gcc, an automatically-generated construction variable containing the linker command-line options corresponding to &cv-link-FRAMEWORKPATH;. scons-src-3.0.0/src/engine/SCons/Tool/default.py0000664000175000017500000000331513160023041021450 0ustar bdbaddogbdbaddog"""SCons.Tool.default Initialization with a default tool list. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/default.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Tool def generate(env): """Add default tools.""" for t in SCons.Tool.tool_list(env['PLATFORM'], env): SCons.Tool.Tool(t)(env) def exists(env): return 1 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/mwcc.xml0000664000175000017500000000354113160023044021131 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Metrowerks CodeWarrior compiler. MWCW_VERSIONS MWCW_VERSION CC CCCOM CXX CXXCOM SHCC SHCCFLAGS SHCFLAGS SHCCCOM SHCXX SHCXXFLAGS SHCXXCOM CFILESUFFIX CXXFILESUFFIX CPPDEFPREFIX CPPDEFSUFFIX INCPREFIX INCSUFFIX CCCOMSTR CXXCOMSTR SHCCCOMSTR SHCXXCOMSTR The version number of the MetroWerks CodeWarrior C compiler to be used. A list of installed versions of the MetroWerks CodeWarrior C compiler on this system. scons-src-3.0.0/src/engine/SCons/Tool/m4.py0000664000175000017500000000444313160023044020352 0ustar bdbaddogbdbaddog"""SCons.Tool.m4 Tool-specific initialization for m4. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/m4.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Action import SCons.Builder import SCons.Util def generate(env): """Add Builders and construction variables for m4 to an Environment.""" M4Action = SCons.Action.Action('$M4COM', '$M4COMSTR') bld = SCons.Builder.Builder(action = M4Action, src_suffix = '.m4') env['BUILDERS']['M4'] = bld # .m4 files might include other files, and it would be pretty hard # to write a scanner for it, so let's just cd to the dir of the m4 # file and run from there. # The src_suffix setup is like so: file.c.m4 -> file.c, # file.cpp.m4 -> file.cpp etc. env['M4'] = 'm4' env['M4FLAGS'] = SCons.Util.CLVar('-E') env['M4COM'] = 'cd ${SOURCE.rsrcdir} && $M4 $M4FLAGS < ${SOURCE.file} > ${TARGET.abspath}' def exists(env): return env.Detect('m4') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/clang.xml0000664000175000017500000000205513160023041021260 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the Clang C compiler. CC SHCCFLAGS CCVERSION scons-src-3.0.0/src/engine/SCons/Tool/cyglink.py0000664000175000017500000002045513160023041021470 0ustar bdbaddogbdbaddog"""SCons.Tool.cyglink Customization of gnulink for Cygwin (http://www.cygwin.com/) There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ from __future__ import absolute_import, print_function import re import os import SCons.Action import SCons.Util import SCons.Tool #MAYBE: from . import gnulink from . import gnulink from . import link def _lib_generator(target, source, env, for_signature, **kw): try: cmd = kw['cmd'] except KeyError: cmd = SCons.Util.CLVar(['$SHLINK']) try: vp = kw['varprefix'] except KeyError: vp = 'SHLIB' dll = env.FindIxes(target, '%sPREFIX' % vp, '%sSUFFIX' % vp) if dll: cmd.extend(['-o', dll]) cmd.extend(['$SHLINKFLAGS', '$__%sVERSIONFLAGS' % vp, '$__RPATH']) implib = env.FindIxes(target, 'IMPLIBPREFIX', 'IMPLIBSUFFIX') if implib: cmd.extend([ '-Wl,--out-implib='+implib.get_string(for_signature), '-Wl,--export-all-symbols', '-Wl,--enable-auto-import', '-Wl,--whole-archive', '$SOURCES', '-Wl,--no-whole-archive', '$_LIBDIRFLAGS', '$_LIBFLAGS' ]) else: cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS']) return [cmd] def shlib_generator(target, source, env, for_signature): return _lib_generator(target, source, env, for_signature, varprefix='SHLIB', cmd = SCons.Util.CLVar(['$SHLINK'])) def ldmod_generator(target, source, env, for_signature): return _lib_generator(target, source, env, for_signature, varprefix='LDMODULE', cmd = SCons.Util.CLVar(['$LDMODULE'])) def _lib_emitter(target, source, env, **kw): Verbose = False if Verbose: print("_lib_emitter: target[0]=%r" % target[0].get_path()) try: vp = kw['varprefix'] except KeyError: vp = 'SHLIB' try: libtype = kw['libtype'] except KeyError: libtype = 'ShLib' dll = env.FindIxes(target, '%sPREFIX' % vp, '%sSUFFIX' % vp) no_import_lib = env.get('no_import_lib', 0) if Verbose: print("_lib_emitter: dll=%r" % dll.get_path()) if not dll or len(target) > 1: raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s" % env.subst("$%sSUFFIX" % vp)) # Remove any "lib" after the prefix pre = env.subst('$%sPREFIX' % vp) if dll.name[len(pre):len(pre)+3] == 'lib': dll.name = pre + dll.name[len(pre)+3:] if Verbose: print("_lib_emitter: dll.name=%r" % dll.name) orig_target = target target = [env.fs.File(dll)] target[0].attributes.shared = 1 if Verbose: print("_lib_emitter: after target=[env.fs.File(dll)]: target[0]=%r" % target[0].get_path()) # Append an import lib target if not no_import_lib: # Create list of target libraries as strings target_strings = env.ReplaceIxes(orig_target[0], '%sPREFIX' % vp, '%sSUFFIX' % vp, 'IMPLIBPREFIX', 'IMPLIBSUFFIX') if Verbose: print("_lib_emitter: target_strings=%r" % target_strings) implib_target = env.fs.File(target_strings) if Verbose: print("_lib_emitter: implib_target=%r" % implib_target.get_path()) implib_target.attributes.shared = 1 target.append(implib_target) symlinks = SCons.Tool.ImpLibSymlinkGenerator(env, implib_target, implib_libtype=libtype, generator_libtype=libtype+'ImpLib') if Verbose: print("_lib_emitter: implib symlinks=%r" % SCons.Tool.StringizeLibSymlinks(symlinks)) if symlinks: SCons.Tool.EmitLibSymlinks(env, symlinks, implib_target, clean_targets = target[0]) implib_target.attributes.shliblinks = symlinks return (target, source) def shlib_emitter(target, source, env): return _lib_emitter(target, source, env, varprefix='SHLIB', libtype='ShLib') def ldmod_emitter(target, source, env): return _lib_emitter(target, source, env, varprefix='LDMODULE', libtype='LdMod') def _versioned_lib_suffix(env, suffix, version): """Generate versioned shared library suffix from a unversioned one. If suffix='.dll', and version='0.1.2', then it returns '-0-1-2.dll'""" Verbose = False if Verbose: print("_versioned_lib_suffix: suffix= ", suffix) print("_versioned_lib_suffix: version= ", version) cygversion = re.sub('\.', '-', version) if not suffix.startswith('-' + cygversion): suffix = '-' + cygversion + suffix if Verbose: print("_versioned_lib_suffix: return suffix= ", suffix) return suffix def _versioned_implib_name(env, libnode, version, prefix, suffix, **kw): return link._versioned_lib_name(env, libnode, version, prefix, suffix, SCons.Tool.ImpLibPrefixGenerator, SCons.Tool.ImpLibSuffixGenerator, implib_libtype=kw['libtype']) def _versioned_implib_symlinks(env, libnode, version, prefix, suffix, **kw): """Generate link names that should be created for a versioned shared library. Returns a list in the form [ (link, linktarget), ... ] """ Verbose = False if Verbose: print("_versioned_implib_symlinks: libnode=%r" % libnode.get_path()) print("_versioned_implib_symlinks: version=%r" % version) try: libtype = kw['libtype'] except KeyError: libtype = 'ShLib' linkdir = os.path.dirname(libnode.get_path()) if Verbose: print("_versioned_implib_symlinks: linkdir=%r" % linkdir) name = SCons.Tool.ImpLibNameGenerator(env, libnode, implib_libtype=libtype, generator_libtype=libtype+'ImpLib') if Verbose: print("_versioned_implib_symlinks: name=%r" % name) major = version.split('.')[0] link0 = env.fs.File(os.path.join(linkdir, name)) symlinks = [(link0, libnode)] if Verbose: print("_versioned_implib_symlinks: return symlinks=%r" % SCons.Tool.StringizeLibSymlinks(symlinks)) return symlinks shlib_action = SCons.Action.Action(shlib_generator, generator=1) ldmod_action = SCons.Action.Action(ldmod_generator, generator=1) def generate(env): """Add Builders and construction variables for cyglink to an Environment.""" gnulink.generate(env) env['LINKFLAGS'] = SCons.Util.CLVar('-Wl,-no-undefined') env['SHLINKCOM'] = shlib_action env['LDMODULECOM'] = ldmod_action env.Append(SHLIBEMITTER = [shlib_emitter]) env.Append(LDMODULEEMITTER = [ldmod_emitter]) env['SHLIBPREFIX'] = 'cyg' env['SHLIBSUFFIX'] = '.dll' env['IMPLIBPREFIX'] = 'lib' env['IMPLIBSUFFIX'] = '.dll.a' # Variables used by versioned shared libraries env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS' env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS' # SHLIBVERSIONFLAGS and LDMODULEVERSIONFLAGS are same as in gnulink... # LINKCALLBACKS are NOT inherited from gnulink env['LINKCALLBACKS'] = { 'VersionedShLibSuffix' : _versioned_lib_suffix, 'VersionedLdModSuffix' : _versioned_lib_suffix, 'VersionedImpLibSuffix' : _versioned_lib_suffix, 'VersionedShLibName' : link._versioned_shlib_name, 'VersionedLdModName' : link._versioned_ldmod_name, 'VersionedShLibImpLibName' : lambda *args: _versioned_implib_name(*args, libtype='ShLib'), 'VersionedLdModImpLibName' : lambda *args: _versioned_implib_name(*args, libtype='LdMod'), 'VersionedShLibImpLibSymlinks' : lambda *args: _versioned_implib_symlinks(*args, libtype='ShLib'), 'VersionedLdModImpLibSymlinks' : lambda *args: _versioned_implib_symlinks(*args, libtype='LdMod'), } # these variables were set by gnulink but are not used in cyglink try: del env['_SHLIBSONAME'] except KeyError: pass try: del env['_LDMODULESONAME'] except KeyError: pass def exists(env): return gnulink.exists(env) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/suncxx.py0000664000175000017500000001125313160023044021357 0ustar bdbaddogbdbaddog"""SCons.Tool.sunc++ Tool-specific initialization for C++ on SunOS / Solaris. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/suncxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons import os import re import subprocess import SCons.Tool.cxx cplusplus = SCons.Tool.cxx #cplusplus = __import__('c++', globals(), locals(), []) package_info = {} def get_package_info(package_name, pkginfo, pkgchk): try: return package_info[package_name] except KeyError: version = None pathname = None try: sadm_contents = open('/var/sadm/install/contents', 'r').read() except EnvironmentError: pass else: sadm_re = re.compile('^(\S*/bin/CC)(=\S*)? %s$' % package_name, re.M) sadm_match = sadm_re.search(sadm_contents) if sadm_match: pathname = os.path.dirname(sadm_match.group(1)) try: p = subprocess.Popen([pkginfo, '-l', package_name], stdout=subprocess.PIPE, stderr=open('/dev/null', 'w')) except EnvironmentError: pass else: pkginfo_contents = p.communicate()[0] version_re = re.compile('^ *VERSION:\s*(.*)$', re.M) version_match = version_re.search(pkginfo_contents) if version_match: version = version_match.group(1) if pathname is None: try: p = subprocess.Popen([pkgchk, '-l', package_name], stdout=subprocess.PIPE, stderr=open('/dev/null', 'w')) except EnvironmentError: pass else: pkgchk_contents = p.communicate()[0] pathname_re = re.compile(r'^Pathname:\s*(.*/bin/CC)$', re.M) pathname_match = pathname_re.search(pkgchk_contents) if pathname_match: pathname = os.path.dirname(pathname_match.group(1)) package_info[package_name] = (pathname, version) return package_info[package_name] # use the package installer tool lslpp to figure out where cppc and what # version of it is installed def get_cppc(env): cxx = env.subst('$CXX') if cxx: cppcPath = os.path.dirname(cxx) else: cppcPath = None cppcVersion = None pkginfo = env.subst('$PKGINFO') pkgchk = env.subst('$PKGCHK') for package in ['SPROcpl']: path, version = get_package_info(package, pkginfo, pkgchk) if path and version: cppcPath, cppcVersion = path, version break return (cppcPath, 'CC', 'CC', cppcVersion) def generate(env): """Add Builders and construction variables for SunPRO C++.""" path, cxx, shcxx, version = get_cppc(env) if path: cxx = os.path.join(path, cxx) shcxx = os.path.join(path, shcxx) cplusplus.generate(env) env['CXX'] = cxx env['SHCXX'] = shcxx env['CXXVERSION'] = version env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -KPIC') env['SHOBJPREFIX'] = 'so_' env['SHOBJSUFFIX'] = '.o' def exists(env): path, cxx, shcxx, version = get_cppc(env) if path and cxx: cppc = os.path.join(path, cxx) if os.path.exists(cppc): return cppc return None # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/aixf77.xml0000664000175000017500000000206713160023041021304 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the IBM Visual Age f77 Fortran compiler. F77 SHF77 scons-src-3.0.0/src/engine/SCons/Tool/dvi.py0000664000175000017500000000447513160023044020621 0ustar bdbaddogbdbaddog"""SCons.Tool.dvi Common DVI Builder definition for various other Tool modules that use it. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/dvi.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Builder import SCons.Tool DVIBuilder = None def generate(env): try: env['BUILDERS']['DVI'] except KeyError: global DVIBuilder if DVIBuilder is None: # The suffix is hard-coded to '.dvi', not configurable via a # construction variable like $DVISUFFIX, because the output # file name is hard-coded within TeX. DVIBuilder = SCons.Builder.Builder(action = {}, source_scanner = SCons.Tool.LaTeXScanner, suffix = '.dvi', emitter = {}, source_ext_match = None) env['BUILDERS']['DVI'] = DVIBuilder def exists(env): # This only puts a skeleton Builder in place, so if someone # references this Tool directly, it's always "available." return 1 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/zip.xml0000664000175000017500000000720713160023045021006 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &zip; archiver. ZIP ZIPFLAGS ZIPCOM ZIPCOMPRESSION ZIPSUFFIX ZIPCOMSTR Builds a zip archive of the specified files and/or directories. Unlike most builder methods, the &b-Zip; builder method may be called multiple times for a given target; each additional call adds to the list of entries that will be built into the archive. Any source directories will be scanned for changes to any on-disk files, regardless of whether or not &scons; knows about them from other Builder or function calls. env.Zip('src.zip', 'src') # Create the stuff.zip file. env.Zip('stuff', ['subdir1', 'subdir2']) # Also add "another" to the stuff.tar file. env.Zip('stuff', 'another') The zip compression and file packaging utility. The command line used to call the zip utility, or the internal Python function used to create a zip archive. The string displayed when archiving files using the zip utility. If this is not set, then &cv-link-ZIPCOM; (the command line or internal Python function) is displayed. env = Environment(ZIPCOMSTR = "Zipping $TARGET") The compression flag from the Python zipfile module used by the internal Python function to control whether the zip archive is compressed or not. The default value is zipfile.ZIP_DEFLATED, which creates a compressed zip archive. This value has no effect if the zipfile module is unavailable. General options passed to the zip utility. The suffix used for zip file names. An optional zip root directory (default empty). The filenames stored in the zip file will be relative to this directory, if given. Otherwise the filenames are relative to the current directory of the command. For instance: env = Environment() env.Zip('foo.zip', 'subdir1/subdir2/file1', ZIPROOT='subdir1') will produce a zip file foo.zip containing a file with the name subdir2/file1 rather than subdir1/subdir2/file1. scons-src-3.0.0/src/engine/SCons/Tool/PharLapCommon.py0000664000175000017500000001051713160023041022526 0ustar bdbaddogbdbaddog"""SCons.Tool.PharLapCommon This module contains common code used by all Tools for the Phar Lap ETS tool chain. Right now, this is linkloc and 386asm. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/PharLapCommon.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import SCons.Errors import SCons.Util import re def getPharLapPath(): """Reads the registry to find the installed path of the Phar Lap ETS development kit. Raises UserError if no installed version of Phar Lap can be found.""" if not SCons.Util.can_read_reg: raise SCons.Errors.InternalError("No Windows registry module was found") try: k=SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Pharlap\\ETS') val, type = SCons.Util.RegQueryValueEx(k, 'BaseDir') # The following is a hack...there is (not surprisingly) # an odd issue in the Phar Lap plug in that inserts # a bunch of junk data after the phar lap path in the # registry. We must trim it. idx=val.find('\0') if idx >= 0: val = val[:idx] return os.path.normpath(val) except SCons.Util.RegError: raise SCons.Errors.UserError("Cannot find Phar Lap ETS path in the registry. Is it installed properly?") REGEX_ETS_VER = re.compile(r'#define\s+ETS_VER\s+([0-9]+)') def getPharLapVersion(): """Returns the version of the installed ETS Tool Suite as a decimal number. This version comes from the ETS_VER #define in the embkern.h header. For example, '#define ETS_VER 1010' (which is what Phar Lap 10.1 defines) would cause this method to return 1010. Phar Lap 9.1 does not have such a #define, but this method will return 910 as a default. Raises UserError if no installed version of Phar Lap can be found.""" include_path = os.path.join(getPharLapPath(), os.path.normpath("include/embkern.h")) if not os.path.exists(include_path): raise SCons.Errors.UserError("Cannot find embkern.h in ETS include directory.\nIs Phar Lap ETS installed properly?") mo = REGEX_ETS_VER.search(open(include_path, 'r').read()) if mo: return int(mo.group(1)) # Default return for Phar Lap 9.1 return 910 def addPharLapPaths(env): """This function adds the path to the Phar Lap binaries, includes, and libraries, if they are not already there.""" ph_path = getPharLapPath() try: env_dict = env['ENV'] except KeyError: env_dict = {} env['ENV'] = env_dict SCons.Util.AddPathIfNotExists(env_dict, 'PATH', os.path.join(ph_path, 'bin')) SCons.Util.AddPathIfNotExists(env_dict, 'INCLUDE', os.path.join(ph_path, 'include')) SCons.Util.AddPathIfNotExists(env_dict, 'LIB', os.path.join(ph_path, 'lib')) SCons.Util.AddPathIfNotExists(env_dict, 'LIB', os.path.join(ph_path, os.path.normpath('lib/vclib'))) env['PHARLAP_PATH'] = getPharLapPath() env['PHARLAP_VERSION'] = str(getPharLapVersion()) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/ifort.py0000664000175000017500000000640013160023044021150 0ustar bdbaddogbdbaddog"""SCons.Tool.ifort Tool-specific initialization for newer versions of the Intel Fortran Compiler for Linux/Windows (and possibly Mac OS X). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/ifort.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults from SCons.Scanner.Fortran import FortranScan from .FortranCommon import add_all_to_env def generate(env): """Add Builders and construction variables for ifort to an Environment.""" # ifort supports Fortran 90 and Fortran 95 # Additionally, ifort recognizes more file extensions. fscan = FortranScan("FORTRANPATH") SCons.Tool.SourceFileScanner.add_scanner('.i', fscan) SCons.Tool.SourceFileScanner.add_scanner('.i90', fscan) if 'FORTRANFILESUFFIXES' not in env: env['FORTRANFILESUFFIXES'] = ['.i'] else: env['FORTRANFILESUFFIXES'].append('.i') if 'F90FILESUFFIXES' not in env: env['F90FILESUFFIXES'] = ['.i90'] else: env['F90FILESUFFIXES'].append('.i90') add_all_to_env(env) fc = 'ifort' for dialect in ['F77', 'F90', 'FORTRAN', 'F95']: env['%s' % dialect] = fc env['SH%s' % dialect] = '$%s' % dialect if env['PLATFORM'] == 'posix': env['SH%sFLAGS' % dialect] = SCons.Util.CLVar('$%sFLAGS -fPIC' % dialect) if env['PLATFORM'] == 'win32': # On Windows, the ifort compiler specifies the object on the # command line with -object:, not -o. Massage the necessary # command-line construction variables. for dialect in ['F77', 'F90', 'FORTRAN', 'F95']: for var in ['%sCOM' % dialect, '%sPPCOM' % dialect, 'SH%sCOM' % dialect, 'SH%sPPCOM' % dialect]: env[var] = env[var].replace('-o $TARGET', '-object:$TARGET') env['FORTRANMODDIRPREFIX'] = "/module:" else: env['FORTRANMODDIRPREFIX'] = "-module " def exists(env): return env.Detect('ifort') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/zip.py0000664000175000017500000000616513160023045020640 0ustar bdbaddogbdbaddog"""SCons.Tool.zip Tool-specific initialization for zip. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/zip.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import SCons.Builder import SCons.Defaults import SCons.Node.FS import SCons.Util import zipfile zipcompression = zipfile.ZIP_DEFLATED def zip(target, source, env): compression = env.get('ZIPCOMPRESSION', 0) zf = zipfile.ZipFile(str(target[0]), 'w', compression) for s in source: if s.isdir(): for dirpath, dirnames, filenames in os.walk(str(s)): for fname in filenames: path = os.path.join(dirpath, fname) if os.path.isfile(path): zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', '')))) else: zf.write(str(s), os.path.relpath(str(s), str(env.get('ZIPROOT', '')))) zf.close() zipAction = SCons.Action.Action(zip, varlist=['ZIPCOMPRESSION']) ZipBuilder = SCons.Builder.Builder(action = SCons.Action.Action('$ZIPCOM', '$ZIPCOMSTR'), source_factory = SCons.Node.FS.Entry, source_scanner = SCons.Defaults.DirScanner, suffix = '$ZIPSUFFIX', multi = 1) def generate(env): """Add Builders and construction variables for zip to an Environment.""" try: bld = env['BUILDERS']['Zip'] except KeyError: bld = ZipBuilder env['BUILDERS']['Zip'] = bld env['ZIP'] = 'zip' env['ZIPFLAGS'] = SCons.Util.CLVar('') env['ZIPCOM'] = zipAction env['ZIPCOMPRESSION'] = zipcompression env['ZIPSUFFIX'] = '.zip' env['ZIPROOT'] = SCons.Util.CLVar('') def exists(env): return True # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/rpmutils.py0000664000175000017500000004142313160023044021710 0ustar bdbaddogbdbaddog"""SCons.Tool.rpmutils.py RPM specific helper routines for general usage in the test framework and SCons core modules. Since we check for the RPM package target name in several places, we have to know which machine/system name RPM will use for the current hardware setup. The following dictionaries and functions try to mimic the exact naming rules of the RPM source code. They were directly derived from the file "rpmrc.in" of the version rpm-4.9.1.3. For updating to a more recent version of RPM, this Python script can be used standalone. The usage() function below shows the exact syntax. """ # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function __revision__ = "src/engine/SCons/Tool/rpmutils.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import platform import subprocess import SCons.Util # Start of rpmrc dictionaries (Marker, don't change or remove!) os_canon = { 'AIX' : ['AIX','5'], 'AmigaOS' : ['AmigaOS','5'], 'BSD_OS' : ['bsdi','12'], 'CYGWIN32_95' : ['cygwin32','15'], 'CYGWIN32_NT' : ['cygwin32','14'], 'Darwin' : ['darwin','21'], 'FreeBSD' : ['FreeBSD','8'], 'HP-UX' : ['hpux10','6'], 'IRIX' : ['Irix','2'], 'IRIX64' : ['Irix64','10'], 'Linux' : ['Linux','1'], 'Linux/390' : ['OS/390','20'], 'Linux/ESA' : ['VM/ESA','20'], 'MacOSX' : ['macosx','21'], 'MiNT' : ['FreeMiNT','17'], 'NEXTSTEP' : ['NextStep','11'], 'OS/390' : ['OS/390','18'], 'OSF1' : ['osf1','7'], 'SCO_SV' : ['SCO_SV3.2v5.0.2','9'], 'SunOS4' : ['SunOS','4'], 'SunOS5' : ['solaris','3'], 'UNIX_SV' : ['MP_RAS','16'], 'VM/ESA' : ['VM/ESA','19'], 'machten' : ['machten','13'], 'osf3.2' : ['osf1','7'], 'osf4.0' : ['osf1','7'], } buildarch_compat = { 'alpha' : ['noarch'], 'alphaev5' : ['alpha'], 'alphaev56' : ['alphaev5'], 'alphaev6' : ['alphapca56'], 'alphaev67' : ['alphaev6'], 'alphapca56' : ['alphaev56'], 'amd64' : ['x86_64'], 'armv3l' : ['noarch'], 'armv4b' : ['noarch'], 'armv4l' : ['armv3l'], 'armv4tl' : ['armv4l'], 'armv5tejl' : ['armv5tel'], 'armv5tel' : ['armv4tl'], 'armv6l' : ['armv5tejl'], 'armv7l' : ['armv6l'], 'atariclone' : ['m68kmint','noarch'], 'atarist' : ['m68kmint','noarch'], 'atariste' : ['m68kmint','noarch'], 'ataritt' : ['m68kmint','noarch'], 'athlon' : ['i686'], 'falcon' : ['m68kmint','noarch'], 'geode' : ['i586'], 'hades' : ['m68kmint','noarch'], 'hppa1.0' : ['parisc'], 'hppa1.1' : ['hppa1.0'], 'hppa1.2' : ['hppa1.1'], 'hppa2.0' : ['hppa1.2'], 'i386' : ['noarch','fat'], 'i486' : ['i386'], 'i586' : ['i486'], 'i686' : ['i586'], 'ia32e' : ['x86_64'], 'ia64' : ['noarch'], 'm68k' : ['noarch'], 'milan' : ['m68kmint','noarch'], 'mips' : ['noarch'], 'mipsel' : ['noarch'], 'parisc' : ['noarch'], 'pentium3' : ['i686'], 'pentium4' : ['pentium3'], 'ppc' : ['noarch','fat'], 'ppc32dy4' : ['noarch'], 'ppc64' : ['noarch','fat'], 'ppc64iseries' : ['ppc64'], 'ppc64pseries' : ['ppc64'], 'ppc8260' : ['noarch'], 'ppc8560' : ['noarch'], 'ppciseries' : ['noarch'], 'ppcpseries' : ['noarch'], 's390' : ['noarch'], 's390x' : ['noarch'], 'sh3' : ['noarch'], 'sh4' : ['noarch'], 'sh4a' : ['sh4'], 'sparc' : ['noarch'], 'sparc64' : ['sparcv9v'], 'sparc64v' : ['sparc64'], 'sparcv8' : ['sparc'], 'sparcv9' : ['sparcv8'], 'sparcv9v' : ['sparcv9'], 'sun4c' : ['noarch'], 'sun4d' : ['noarch'], 'sun4m' : ['noarch'], 'sun4u' : ['noarch'], 'x86_64' : ['noarch'], } os_compat = { 'BSD_OS' : ['bsdi'], 'Darwin' : ['MacOSX'], 'FreeMiNT' : ['mint','MiNT','TOS'], 'IRIX64' : ['IRIX'], 'MiNT' : ['FreeMiNT','mint','TOS'], 'TOS' : ['FreeMiNT','MiNT','mint'], 'bsdi4.0' : ['bsdi'], 'hpux10.00' : ['hpux9.07'], 'hpux10.01' : ['hpux10.00'], 'hpux10.10' : ['hpux10.01'], 'hpux10.20' : ['hpux10.10'], 'hpux10.30' : ['hpux10.20'], 'hpux11.00' : ['hpux10.30'], 'hpux9.05' : ['hpux9.04'], 'hpux9.07' : ['hpux9.05'], 'mint' : ['FreeMiNT','MiNT','TOS'], 'ncr-sysv4.3' : ['ncr-sysv4.2'], 'osf4.0' : ['osf3.2','osf1'], 'solaris2.4' : ['solaris2.3'], 'solaris2.5' : ['solaris2.3','solaris2.4'], 'solaris2.6' : ['solaris2.3','solaris2.4','solaris2.5'], 'solaris2.7' : ['solaris2.3','solaris2.4','solaris2.5','solaris2.6'], } arch_compat = { 'alpha' : ['axp','noarch'], 'alphaev5' : ['alpha'], 'alphaev56' : ['alphaev5'], 'alphaev6' : ['alphapca56'], 'alphaev67' : ['alphaev6'], 'alphapca56' : ['alphaev56'], 'amd64' : ['x86_64','athlon','noarch'], 'armv3l' : ['noarch'], 'armv4b' : ['noarch'], 'armv4l' : ['armv3l'], 'armv4tl' : ['armv4l'], 'armv5tejl' : ['armv5tel'], 'armv5tel' : ['armv4tl'], 'armv6l' : ['armv5tejl'], 'armv7l' : ['armv6l'], 'atariclone' : ['m68kmint','noarch'], 'atarist' : ['m68kmint','noarch'], 'atariste' : ['m68kmint','noarch'], 'ataritt' : ['m68kmint','noarch'], 'athlon' : ['i686'], 'falcon' : ['m68kmint','noarch'], 'geode' : ['i586'], 'hades' : ['m68kmint','noarch'], 'hppa1.0' : ['parisc'], 'hppa1.1' : ['hppa1.0'], 'hppa1.2' : ['hppa1.1'], 'hppa2.0' : ['hppa1.2'], 'i370' : ['noarch'], 'i386' : ['noarch','fat'], 'i486' : ['i386'], 'i586' : ['i486'], 'i686' : ['i586'], 'ia32e' : ['x86_64','athlon','noarch'], 'ia64' : ['noarch'], 'milan' : ['m68kmint','noarch'], 'mips' : ['noarch'], 'mipsel' : ['noarch'], 'osfmach3_i386' : ['i486'], 'osfmach3_i486' : ['i486','osfmach3_i386'], 'osfmach3_i586' : ['i586','osfmach3_i486'], 'osfmach3_i686' : ['i686','osfmach3_i586'], 'osfmach3_ppc' : ['ppc'], 'parisc' : ['noarch'], 'pentium3' : ['i686'], 'pentium4' : ['pentium3'], 'powerpc' : ['ppc'], 'powerppc' : ['ppc'], 'ppc' : ['rs6000'], 'ppc32dy4' : ['ppc'], 'ppc64' : ['ppc'], 'ppc64iseries' : ['ppc64'], 'ppc64pseries' : ['ppc64'], 'ppc8260' : ['ppc'], 'ppc8560' : ['ppc'], 'ppciseries' : ['ppc'], 'ppcpseries' : ['ppc'], 'rs6000' : ['noarch','fat'], 's390' : ['noarch'], 's390x' : ['s390','noarch'], 'sh3' : ['noarch'], 'sh4' : ['noarch'], 'sh4a' : ['sh4'], 'sparc' : ['noarch'], 'sparc64' : ['sparcv9'], 'sparc64v' : ['sparc64'], 'sparcv8' : ['sparc'], 'sparcv9' : ['sparcv8'], 'sparcv9v' : ['sparcv9'], 'sun4c' : ['sparc'], 'sun4d' : ['sparc'], 'sun4m' : ['sparc'], 'sun4u' : ['sparc64'], 'x86_64' : ['amd64','athlon','noarch'], } buildarchtranslate = { 'alphaev5' : ['alpha'], 'alphaev56' : ['alpha'], 'alphaev6' : ['alpha'], 'alphaev67' : ['alpha'], 'alphapca56' : ['alpha'], 'amd64' : ['x86_64'], 'armv3l' : ['armv3l'], 'armv4b' : ['armv4b'], 'armv4l' : ['armv4l'], 'armv4tl' : ['armv4tl'], 'armv5tejl' : ['armv5tejl'], 'armv5tel' : ['armv5tel'], 'armv6l' : ['armv6l'], 'armv7l' : ['armv7l'], 'atariclone' : ['m68kmint'], 'atarist' : ['m68kmint'], 'atariste' : ['m68kmint'], 'ataritt' : ['m68kmint'], 'athlon' : ['i386'], 'falcon' : ['m68kmint'], 'geode' : ['i386'], 'hades' : ['m68kmint'], 'i386' : ['i386'], 'i486' : ['i386'], 'i586' : ['i386'], 'i686' : ['i386'], 'ia32e' : ['x86_64'], 'ia64' : ['ia64'], 'milan' : ['m68kmint'], 'osfmach3_i386' : ['i386'], 'osfmach3_i486' : ['i386'], 'osfmach3_i586' : ['i386'], 'osfmach3_i686' : ['i386'], 'osfmach3_ppc' : ['ppc'], 'pentium3' : ['i386'], 'pentium4' : ['i386'], 'powerpc' : ['ppc'], 'powerppc' : ['ppc'], 'ppc32dy4' : ['ppc'], 'ppc64iseries' : ['ppc64'], 'ppc64pseries' : ['ppc64'], 'ppc8260' : ['ppc'], 'ppc8560' : ['ppc'], 'ppciseries' : ['ppc'], 'ppcpseries' : ['ppc'], 's390' : ['s390'], 's390x' : ['s390x'], 'sh3' : ['sh3'], 'sh4' : ['sh4'], 'sh4a' : ['sh4'], 'sparc64v' : ['sparc64'], 'sparcv8' : ['sparc'], 'sparcv9' : ['sparc'], 'sparcv9v' : ['sparc'], 'sun4c' : ['sparc'], 'sun4d' : ['sparc'], 'sun4m' : ['sparc'], 'sun4u' : ['sparc64'], 'x86_64' : ['x86_64'], } optflags = { 'alpha' : ['-O2','-g','-mieee'], 'alphaev5' : ['-O2','-g','-mieee','-mtune=ev5'], 'alphaev56' : ['-O2','-g','-mieee','-mtune=ev56'], 'alphaev6' : ['-O2','-g','-mieee','-mtune=ev6'], 'alphaev67' : ['-O2','-g','-mieee','-mtune=ev67'], 'alphapca56' : ['-O2','-g','-mieee','-mtune=pca56'], 'amd64' : ['-O2','-g'], 'armv3l' : ['-O2','-g','-march=armv3'], 'armv4b' : ['-O2','-g','-march=armv4'], 'armv4l' : ['-O2','-g','-march=armv4'], 'armv4tl' : ['-O2','-g','-march=armv4t'], 'armv5tejl' : ['-O2','-g','-march=armv5te'], 'armv5tel' : ['-O2','-g','-march=armv5te'], 'armv6l' : ['-O2','-g','-march=armv6'], 'armv7l' : ['-O2','-g','-march=armv7'], 'atariclone' : ['-O2','-g','-fomit-frame-pointer'], 'atarist' : ['-O2','-g','-fomit-frame-pointer'], 'atariste' : ['-O2','-g','-fomit-frame-pointer'], 'ataritt' : ['-O2','-g','-fomit-frame-pointer'], 'athlon' : ['-O2','-g','-march=athlon'], 'falcon' : ['-O2','-g','-fomit-frame-pointer'], 'fat' : ['-O2','-g','-arch','i386','-arch','ppc'], 'geode' : ['-Os','-g','-m32','-march=geode'], 'hades' : ['-O2','-g','-fomit-frame-pointer'], 'hppa1.0' : ['-O2','-g','-mpa-risc-1-0'], 'hppa1.1' : ['-O2','-g','-mpa-risc-1-0'], 'hppa1.2' : ['-O2','-g','-mpa-risc-1-0'], 'hppa2.0' : ['-O2','-g','-mpa-risc-1-0'], 'i386' : ['-O2','-g','-march=i386','-mtune=i686'], 'i486' : ['-O2','-g','-march=i486'], 'i586' : ['-O2','-g','-march=i586'], 'i686' : ['-O2','-g','-march=i686'], 'ia32e' : ['-O2','-g'], 'ia64' : ['-O2','-g'], 'm68k' : ['-O2','-g','-fomit-frame-pointer'], 'milan' : ['-O2','-g','-fomit-frame-pointer'], 'mips' : ['-O2','-g'], 'mipsel' : ['-O2','-g'], 'parisc' : ['-O2','-g','-mpa-risc-1-0'], 'pentium3' : ['-O2','-g','-march=pentium3'], 'pentium4' : ['-O2','-g','-march=pentium4'], 'ppc' : ['-O2','-g','-fsigned-char'], 'ppc32dy4' : ['-O2','-g','-fsigned-char'], 'ppc64' : ['-O2','-g','-fsigned-char'], 'ppc8260' : ['-O2','-g','-fsigned-char'], 'ppc8560' : ['-O2','-g','-fsigned-char'], 'ppciseries' : ['-O2','-g','-fsigned-char'], 'ppcpseries' : ['-O2','-g','-fsigned-char'], 's390' : ['-O2','-g'], 's390x' : ['-O2','-g'], 'sh3' : ['-O2','-g'], 'sh4' : ['-O2','-g','-mieee'], 'sh4a' : ['-O2','-g','-mieee'], 'sparc' : ['-O2','-g','-m32','-mtune=ultrasparc'], 'sparc64' : ['-O2','-g','-m64','-mtune=ultrasparc'], 'sparc64v' : ['-O2','-g','-m64','-mtune=niagara'], 'sparcv8' : ['-O2','-g','-m32','-mtune=ultrasparc','-mv8'], 'sparcv9' : ['-O2','-g','-m32','-mtune=ultrasparc'], 'sparcv9v' : ['-O2','-g','-m32','-mtune=niagara'], 'x86_64' : ['-O2','-g'], } arch_canon = { 'IP' : ['sgi','7'], 'alpha' : ['alpha','2'], 'alphaev5' : ['alphaev5','2'], 'alphaev56' : ['alphaev56','2'], 'alphaev6' : ['alphaev6','2'], 'alphaev67' : ['alphaev67','2'], 'alphapca56' : ['alphapca56','2'], 'amd64' : ['amd64','1'], 'armv3l' : ['armv3l','12'], 'armv4b' : ['armv4b','12'], 'armv4l' : ['armv4l','12'], 'armv5tejl' : ['armv5tejl','12'], 'armv5tel' : ['armv5tel','12'], 'armv6l' : ['armv6l','12'], 'armv7l' : ['armv7l','12'], 'atariclone' : ['m68kmint','13'], 'atarist' : ['m68kmint','13'], 'atariste' : ['m68kmint','13'], 'ataritt' : ['m68kmint','13'], 'athlon' : ['athlon','1'], 'falcon' : ['m68kmint','13'], 'geode' : ['geode','1'], 'hades' : ['m68kmint','13'], 'i370' : ['i370','14'], 'i386' : ['i386','1'], 'i486' : ['i486','1'], 'i586' : ['i586','1'], 'i686' : ['i686','1'], 'ia32e' : ['ia32e','1'], 'ia64' : ['ia64','9'], 'm68k' : ['m68k','6'], 'm68kmint' : ['m68kmint','13'], 'milan' : ['m68kmint','13'], 'mips' : ['mips','4'], 'mipsel' : ['mipsel','11'], 'pentium3' : ['pentium3','1'], 'pentium4' : ['pentium4','1'], 'ppc' : ['ppc','5'], 'ppc32dy4' : ['ppc32dy4','5'], 'ppc64' : ['ppc64','16'], 'ppc64iseries' : ['ppc64iseries','16'], 'ppc64pseries' : ['ppc64pseries','16'], 'ppc8260' : ['ppc8260','5'], 'ppc8560' : ['ppc8560','5'], 'ppciseries' : ['ppciseries','5'], 'ppcpseries' : ['ppcpseries','5'], 'rs6000' : ['rs6000','8'], 's390' : ['s390','14'], 's390x' : ['s390x','15'], 'sh' : ['sh','17'], 'sh3' : ['sh3','17'], 'sh4' : ['sh4','17'], 'sh4a' : ['sh4a','17'], 'sparc' : ['sparc','3'], 'sparc64' : ['sparc64','2'], 'sparc64v' : ['sparc64v','2'], 'sparcv8' : ['sparcv8','3'], 'sparcv9' : ['sparcv9','3'], 'sparcv9v' : ['sparcv9v','3'], 'sun4' : ['sparc','3'], 'sun4c' : ['sparc','3'], 'sun4d' : ['sparc','3'], 'sun4m' : ['sparc','3'], 'sun4u' : ['sparc64','2'], 'x86_64' : ['x86_64','1'], 'xtensa' : ['xtensa','18'], } # End of rpmrc dictionaries (Marker, don't change or remove!) def defaultMachine(use_rpm_default=True): """ Return the canonicalized machine name. """ if use_rpm_default: try: # This should be the most reliable way to get the default arch rmachine = subprocess.check_output(['rpm', '--eval=%_target_cpu'], shell=False).rstrip() rmachine = SCons.Util.to_str(rmachine) except Exception as e: # Something went wrong, try again by looking up platform.machine() return defaultMachine(False) else: rmachine = platform.machine() # Try to lookup the string in the canon table if rmachine in arch_canon: rmachine = arch_canon[rmachine][0] return rmachine def defaultSystem(): """ Return the canonicalized system name. """ rsystem = platform.system() # Try to lookup the string in the canon tables if rsystem in os_canon: rsystem = os_canon[rsystem][0] return rsystem def defaultNames(): """ Return the canonicalized machine and system name. """ return defaultMachine(), defaultSystem() def updateRpmDicts(rpmrc, pyfile): """ Read the given rpmrc file with RPM definitions and update the info dictionaries in the file pyfile with it. The arguments will usually be 'rpmrc.in' from a recent RPM source tree, and 'rpmutils.py' referring to this script itself. See also usage() below. """ try: # Read old rpmutils.py file oldpy = open(pyfile,"r").readlines() # Read current rpmrc.in file rpm = open(rpmrc,"r").readlines() # Parse for data data = {} # Allowed section names that get parsed sections = ['optflags', 'arch_canon', 'os_canon', 'buildarchtranslate', 'arch_compat', 'os_compat', 'buildarch_compat'] for l in rpm: l = l.rstrip('\n').replace(':',' ') # Skip comments if l.lstrip().startswith('#'): continue tokens = l.strip().split() if len(tokens): key = tokens[0] if key in sections: # Have we met this section before? if tokens[0] not in data: # No, so insert it data[key] = {} # Insert data data[key][tokens[1]] = tokens[2:] # Write new rpmutils.py file out = open(pyfile,"w") pm = 0 for l in oldpy: if pm: if l.startswith('# End of rpmrc dictionaries'): pm = 0 out.write(l) else: out.write(l) if l.startswith('# Start of rpmrc dictionaries'): pm = 1 # Write data sections to single dictionaries for key, entries in data.items(): out.write("%s = {\n" % key) for arch in sorted(entries.keys()): out.write(" '%s' : ['%s'],\n" % (arch, "','".join(entries[arch]))) out.write("}\n\n") out.close() except: pass def usage(): print("rpmutils.py rpmrc.in rpmutils.py") def main(): import sys if len(sys.argv) < 3: usage() sys.exit(0) updateRpmDicts(sys.argv[1], sys.argv[2]) if __name__ == "__main__": main() scons-src-3.0.0/src/engine/SCons/Tool/g++.py0000664000175000017500000000312213160023044020377 0ustar bdbaddogbdbaddog"""SCons.Tool.g++ Tool-specific initialization for g++. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/g++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" #forward proxy to the preffered cxx version from SCons.Tool.gxx import * # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/swig.xml0000664000175000017500000001465413160023045021161 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the SWIG interface generator. SWIG SWIGFLAGS SWIGDIRECTORSUFFIX SWIGCFILESUFFIX SWIGCXXFILESUFFIX _SWIGINCFLAGS SWIGINCPREFIX SWIGINCSUFFIX SWIGCOM SWIGPATH SWIGVERSION SWIGCOMSTR The scripting language wrapper and interface generator. The suffix that will be used for intermediate C source files generated by the scripting language wrapper and interface generator. The default value is _wrap&cv-link-CFILESUFFIX;. By default, this value is used whenever the option is not specified as part of the &cv-link-SWIGFLAGS; construction variable. The suffix that will be used for intermediate C++ header files generated by the scripting language wrapper and interface generator. These are only generated for C++ code when the SWIG 'directors' feature is turned on. The default value is _wrap.h. The command line used to call the scripting language wrapper and interface generator. The string displayed when calling the scripting language wrapper and interface generator. If this is not set, then &cv-link-SWIGCOM; (the command line) is displayed. The suffix that will be used for intermediate C++ source files generated by the scripting language wrapper and interface generator. The default value is _wrap&cv-link-CFILESUFFIX;. By default, this value is used whenever the -c++ option is specified as part of the &cv-link-SWIGFLAGS; construction variable. General options passed to the scripting language wrapper and interface generator. This is where you should set , , , or whatever other options you want to specify to SWIG. If you set the option in this variable, &scons; will, by default, generate a C++ intermediate source file with the extension that is specified as the &cv-link-CXXFILESUFFIX; variable. An automatically-generated construction variable containing the SWIG command-line options for specifying directories to be searched for included files. The value of &cv-_SWIGINCFLAGS; is created by appending &cv-SWIGINCPREFIX; and &cv-SWIGINCSUFFIX; to the beginning and end of each directory in &cv-SWIGPATH;. The prefix used to specify an include directory on the SWIG command line. This will be appended to the beginning of each directory in the &cv-SWIGPATH; construction variable when the &cv-_SWIGINCFLAGS; variable is automatically generated. The suffix used to specify an include directory on the SWIG command line. This will be appended to the end of each directory in the &cv-SWIGPATH; construction variable when the &cv-_SWIGINCFLAGS; variable is automatically generated. Specifies the output directory in which the scripting language wrapper and interface generator should place generated language-specific files. This will be used by SCons to identify the files that will be generated by the &swig; call, and translated into the swig -outdir option on the command line. The list of directories that the scripting language wrapper and interface generate will search for included files. The SWIG implicit dependency scanner will search these directories for include files. The default value is an empty list. Don't explicitly put include directory arguments in SWIGFLAGS; the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in SWIGPATH will be looked-up relative to the SConscript directory when they are used in a command. To force &scons; to look-up a directory relative to the root of the source tree use #: env = Environment(SWIGPATH='#/include') The directory look-up can also be forced using the &Dir;() function: include = Dir('include') env = Environment(SWIGPATH=include) The directory list will be added to command lines through the automatically-generated &cv-_SWIGINCFLAGS; construction variable, which is constructed by appending the values of the &cv-SWIGINCPREFIX; and &cv-SWIGINCSUFFIX; construction variables to the beginning and end of each directory in &cv-SWIGPATH;. Any command lines you define that need the SWIGPATH directory list should include &cv-_SWIGINCFLAGS;: env = Environment(SWIGCOM="my_swig -o $TARGET $_SWIGINCFLAGS $SOURCES") The version number of the SWIG tool. scons-src-3.0.0/src/engine/SCons/Tool/386asm.xml0000664000175000017500000000235513160023041021220 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the 386ASM assembler for the Phar Lap ETS embedded operating system. AS ASFLAGS ASPPFLAGS ASCOM ASPPCOM CC CPPFLAGS _CPPDEFFLAGS _CPPINCFLAGS scons-src-3.0.0/src/engine/SCons/Tool/midl.py0000664000175000017500000000601413160023044020753 0ustar bdbaddogbdbaddog"""SCons.Tool.midl Tool-specific initialization for midl (Microsoft IDL compiler). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/midl.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Action import SCons.Builder import SCons.Defaults import SCons.Scanner.IDL import SCons.Util from .MSCommon import msvc_exists def midl_emitter(target, source, env): """Produces a list of outputs from the MIDL compiler""" base, _ = SCons.Util.splitext(str(target[0])) tlb = target[0] incl = base + '.h' interface = base + '_i.c' targets = [tlb, incl, interface] midlcom = env['MIDLCOM'] if midlcom.find('/proxy') != -1: proxy = base + '_p.c' targets.append(proxy) if midlcom.find('/dlldata') != -1: dlldata = base + '_data.c' targets.append(dlldata) return (targets, source) idl_scanner = SCons.Scanner.IDL.IDLScan() midl_action = SCons.Action.Action('$MIDLCOM', '$MIDLCOMSTR') midl_builder = SCons.Builder.Builder(action = midl_action, src_suffix = '.idl', suffix='.tlb', emitter = midl_emitter, source_scanner = idl_scanner) def generate(env): """Add Builders and construction variables for midl to an Environment.""" env['MIDL'] = 'MIDL.EXE' env['MIDLFLAGS'] = SCons.Util.CLVar('/nologo') env['MIDLCOM'] = '$MIDL $MIDLFLAGS /tlb ${TARGETS[0]} /h ${TARGETS[1]} /iid ${TARGETS[2]} /proxy ${TARGETS[3]} /dlldata ${TARGETS[4]} $SOURCE 2> NUL' env['BUILDERS']['TypeLibrary'] = midl_builder def exists(env): return msvc_exists() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/mssdk.py0000664000175000017500000000345313160023044021153 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/mssdk.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" """engine.SCons.Tool.mssdk Tool-specific initialization for Microsoft SDKs, both Platform SDKs and Windows SDKs. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ from .MSCommon import mssdk_exists, \ mssdk_setup_env def generate(env): """Add construction variables for an MS SDK to an Environment.""" mssdk_setup_env(env) def exists(env): return mssdk_exists() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/gettext.xml0000664000175000017500000002045113160023044021663 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> This is actually a toolset, which supports internationalization and localization of software being constructed with SCons. The toolset loads following tools: &t-link-xgettext; - to extract internationalized messages from source code to POT file(s), &t-link-msginit; - may be optionally used to initialize PO files, &t-link-msgmerge; - to update PO files, that already contain translated messages, &t-link-msgfmt; - to compile textual PO file to binary installable MO file. When you enable &t-gettext;, it internally loads all abovementioned tools, so you're encouraged to see their individual documentation. Each of the above tools provides its own builder(s) which may be used to perform particular activities related to software internationalization. You may be however interested in top-level builder &b-Translate; described few paragraphs later. To use &t-gettext; tools add 'gettext' tool to your environment: env = Environment( tools = ['default', 'gettext'] ) This pseudo-builder belongs to &t-link-gettext; toolset. The builder extracts internationalized messages from source files, updates POT template (if necessary) and then updates PO translations (if necessary). If &cv-link-POAUTOINIT; is set, missing PO files will be automatically created (i.e. without translator person intervention). The variables &cv-link-LINGUAS_FILE; and &cv-link-POTDOMAIN; are taken into acount too. All other construction variables used by &b-link-POTUpdate;, and &b-link-POUpdate; work here too. Example 1. The simplest way is to specify input files and output languages inline in a SCons script when invoking &b-Translate; # SConscript in 'po/' directory env = Environment( tools = ["default", "gettext"] ) env['POAUTOINIT'] = 1 env.Translate(['en','pl'], ['../a.cpp','../b.cpp']) Example 2. If you wish, you may also stick to conventional style known from autotools, i.e. using POTFILES.in and LINGUAS files # LINGUAS en pl #end # POTFILES.in a.cpp b.cpp # end # SConscript env = Environment( tools = ["default", "gettext"] ) env['POAUTOINIT'] = 1 env['XGETTEXTPATH'] = ['../'] env.Translate(LINGUAS_FILE = 1, XGETTEXTFROM = 'POTFILES.in') The last approach is perhaps the recommended one. It allows easily split internationalization/localization onto separate SCons scripts, where a script in source tree is responsible for translations (from sources to PO files) and script(s) under variant directories are responsible for compilation of PO to MO files to and for installation of MO files. The "gluing factor" synchronizing these two scripts is then the content of LINGUAS file. Note, that the updated POT and PO files are usually going to be committed back to the repository, so they must be updated within the source directory (and not in variant directories). Additionaly, the file listing of po/ directory contains LINGUAS file, so the source tree looks familiar to translators, and they may work with the project in their usual way. Example 3. Let's prepare a development tree as below project/ + SConstruct + build/ + src/ + po/ + SConscript + SConscript.i18n + POTFILES.in + LINGUAS with build being variant directory. Write the top-level SConstruct script as follows # SConstruct env = Environment( tools = ["default", "gettext"] ) VariantDir('build', 'src', duplicate = 0) env['POAUTOINIT'] = 1 SConscript('src/po/SConscript.i18n', exports = 'env') SConscript('build/po/SConscript', exports = 'env') the src/po/SConscript.i18n as # src/po/SConscript.i18n Import('env') env.Translate(LINGUAS_FILE=1, XGETTEXTFROM='POTFILES.in', XGETTEXTPATH=['../']) and the src/po/SConscript # src/po/SConscript Import('env') env.MOFiles(LINGUAS_FILE = 1) Such setup produces POT and PO files under source tree in src/po/ and binary MO files under variant tree in build/po/. This way the POT and PO files are separated from other output files, which must not be committed back to source repositories (e.g. MO files). In above example, the PO files are not updated, nor created automatically when you issue scons '.' command. The files must be updated (created) by hand via scons po-update and then MO files can be compiled by running scons '.'. The &cv-POTDOMAIN; defines default domain, used to generate POT filename as &cv-POTDOMAIN;.pot when no POT file name is provided by the user. This applies to &b-link-POTUpdate;, &b-link-POInit; and &b-link-POUpdate; builders (and builders, that use them, e.g. &b-Translate;). Normally (if &cv-POTDOMAIN; is not defined), the builders use messages.pot as default POT file name. The &cv-POAUTOINIT; variable, if set to True (on non-zero numeric value), let the &t-link-msginit; tool to automatically initialize missing PO files with msginit(1). This applies to both, &b-link-POInit; and &b-link-POUpdate; builders (and others that use any of them). The &cv-LINGUAS_FILE; defines file(s) containing list of additional linguas to be processed by &b-link-POInit;, &b-link-POUpdate; or &b-link-MOFiles; builders. It also affects &b-link-Translate; builder. If the variable contains a string, it defines name of the list file. The &cv-LINGUAS_FILE; may be a list of file names as well. If &cv-LINGUAS_FILE; is set to True (or non-zero numeric value), the list will be read from default file named LINGUAS. scons-src-3.0.0/src/engine/SCons/Tool/__init__.py0000664000175000017500000013722713160023041021575 0ustar bdbaddogbdbaddog"""SCons.Tool SCons tool selection. This looks for modules that define a callable object that can modify a construction environment as appropriate for a given tool (or tool chain). Note that because this subsystem just *selects* a callable that can modify a construction environment, it's possible for people to define their own "tool specification" in an arbitrary callable function. No one needs to use or tie in to this subsystem in order to roll their own tool definition. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import imp import importlib import sys import re import os import shutil import SCons.Builder import SCons.Errors import SCons.Node.FS import SCons.Scanner import SCons.Scanner.C import SCons.Scanner.D import SCons.Scanner.LaTeX import SCons.Scanner.Prog import SCons.Scanner.SWIG import collections DefaultToolpath=[] CScanner = SCons.Scanner.C.CScanner() DScanner = SCons.Scanner.D.DScanner() LaTeXScanner = SCons.Scanner.LaTeX.LaTeXScanner() PDFLaTeXScanner = SCons.Scanner.LaTeX.PDFLaTeXScanner() ProgramScanner = SCons.Scanner.Prog.ProgramScanner() SourceFileScanner = SCons.Scanner.Base({}, name='SourceFileScanner') SWIGScanner = SCons.Scanner.SWIG.SWIGScanner() CSuffixes = [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", ".h", ".H", ".hxx", ".hpp", ".hh", ".F", ".fpp", ".FPP", ".m", ".mm", ".S", ".spp", ".SPP", ".sx"] DSuffixes = ['.d'] IDLSuffixes = [".idl", ".IDL"] LaTeXSuffixes = [".tex", ".ltx", ".latex"] SWIGSuffixes = ['.i'] for suffix in CSuffixes: SourceFileScanner.add_scanner(suffix, CScanner) for suffix in DSuffixes: SourceFileScanner.add_scanner(suffix, DScanner) for suffix in SWIGSuffixes: SourceFileScanner.add_scanner(suffix, SWIGScanner) # FIXME: what should be done here? Two scanners scan the same extensions, # but look for different files, e.g., "picture.eps" vs. "picture.pdf". # The builders for DVI and PDF explicitly reference their scanners # I think that means this is not needed??? for suffix in LaTeXSuffixes: SourceFileScanner.add_scanner(suffix, LaTeXScanner) SourceFileScanner.add_scanner(suffix, PDFLaTeXScanner) # Tool aliases are needed for those tools whos module names also # occur in the python standard library. This causes module shadowing and # can break using python library functions under python3 TOOL_ALIASES = { 'gettext':'gettext_tool', 'clang++': 'clangxx', } class Tool(object): def __init__(self, name, toolpath=[], **kw): # Rename if there's a TOOL_ALIAS for this tool self.name = TOOL_ALIASES.get(name,name) self.toolpath = toolpath + DefaultToolpath # remember these so we can merge them into the call self.init_kw = kw module = self._tool_module() self.generate = module.generate self.exists = module.exists if hasattr(module, 'options'): self.options = module.options def _load_dotted_module_py2(self, short_name, full_name, searchpaths=None): splitname = short_name.split('.') index = 0 srchpths = searchpaths for item in splitname: file, path, desc = imp.find_module(item, srchpths) mod = imp.load_module(full_name, file, path, desc) srchpths = [path] return mod, file def _tool_module(self): oldpythonpath = sys.path sys.path = self.toolpath + sys.path # sys.stderr.write("Tool:%s\nPATH:%s\n"%(self.name,sys.path)) if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] in (0,1,2,3,4)): # Py 2 code try: try: file = None try: mod, file = self._load_dotted_module_py2(self.name, self.name, self.toolpath) return mod finally: if file: file.close() except ImportError as e: splitname = self.name.split('.') if str(e)!="No module named %s"%splitname[0]: raise SCons.Errors.EnvironmentError(e) try: import zipimport except ImportError: pass else: for aPath in self.toolpath: try: importer = zipimport.zipimporter(aPath) return importer.load_module(self.name) except ImportError as e: pass finally: sys.path = oldpythonpath elif sys.version_info[1] > 4: # From: http://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path/67692#67692 # import importlib.util # spec = importlib.util.spec_from_file_location("module.name", "/path/to/file.py") # foo = importlib.util.module_from_spec(spec) # spec.loader.exec_module(foo) # foo.MyClass() # Py 3 code # import pdb; pdb.set_trace() import importlib.util # sys.stderr.write("toolpath:%s\n" % self.toolpath) # sys.stderr.write("SCONS.TOOL path:%s\n" % sys.modules['SCons.Tool'].__path__) debug = False spec = None found_name = self.name add_to_scons_tools_namespace = False for path in self.toolpath: sepname = self.name.replace('.', os.path.sep) file_path = os.path.join(path, "%s.py"%sepname) file_package = os.path.join(path, sepname) if debug: sys.stderr.write("Trying:%s %s\n"%(file_path, file_package)) if os.path.isfile(file_path): spec = importlib.util.spec_from_file_location(self.name, file_path) if debug: print("file_Path:%s FOUND"%file_path) break elif os.path.isdir(file_package): file_package = os.path.join(file_package, '__init__.py') spec = importlib.util.spec_from_file_location(self.name, file_package) if debug: print("PACKAGE:%s Found"%file_package) break else: continue if spec is None: if debug: sys.stderr.write("NO SPEC :%s\n"%self.name) spec = importlib.util.find_spec("."+self.name, package='SCons.Tool') if spec: found_name = 'SCons.Tool.'+self.name add_to_scons_tools_namespace = True if debug: sys.stderr.write("Spec Found? .%s :%s\n"%(self.name, spec)) if spec is None: error_string = "No module named %s"%self.name raise SCons.Errors.EnvironmentError(error_string) module = importlib.util.module_from_spec(spec) if module is None: if debug: print("MODULE IS NONE:%s"%self.name) error_string = "No module named %s"%self.name raise SCons.Errors.EnvironmentError(error_string) # Don't reload a tool we already loaded. sys_modules_value = sys.modules.get(found_name,False) if sys_modules_value and sys_modules_value.__file__ == spec.origin: return sys.modules[found_name] else: # Not sure what to do in the case that there already # exists sys.modules[self.name] but the source file is # different.. ? module = spec.loader.load_module(spec.name) sys.modules[found_name] = module if add_to_scons_tools_namespace: # If we found it in SCons.Tool, then add it to the module setattr(SCons.Tool, self.name, module) return module sys.path = oldpythonpath full_name = 'SCons.Tool.' + self.name try: return sys.modules[full_name] except KeyError: try: smpath = sys.modules['SCons.Tool'].__path__ try: module, file = self._load_dotted_module_py2(self.name, full_name, smpath) setattr(SCons.Tool, self.name, module) if file: file.close() return module except ImportError as e: if str(e)!="No module named %s"%self.name: raise SCons.Errors.EnvironmentError(e) try: import zipimport importer = zipimport.zipimporter( sys.modules['SCons.Tool'].__path__[0] ) module = importer.load_module(full_name) setattr(SCons.Tool, self.name, module) return module except ImportError as e: m = "No tool named '%s': %s" % (self.name, e) raise SCons.Errors.EnvironmentError(m) except ImportError as e: m = "No tool named '%s': %s" % (self.name, e) raise SCons.Errors.EnvironmentError(m) def __call__(self, env, *args, **kw): if self.init_kw is not None: # Merge call kws into init kws; # but don't bash self.init_kw. if kw is not None: call_kw = kw kw = self.init_kw.copy() kw.update(call_kw) else: kw = self.init_kw env.Append(TOOLS = [ self.name ]) if hasattr(self, 'options'): import SCons.Variables if 'options' not in env: from SCons.Script import ARGUMENTS env['options']=SCons.Variables.Variables(args=ARGUMENTS) opts=env['options'] self.options(opts) opts.Update(env) self.generate(env, *args, **kw) def __str__(self): return self.name ########################################################################## # Create common executable program / library / object builders def createProgBuilder(env): """This is a utility function that creates the Program Builder in an Environment if it is not there already. If it is already there, we return the existing one. """ try: program = env['BUILDERS']['Program'] except KeyError: import SCons.Defaults program = SCons.Builder.Builder(action = SCons.Defaults.LinkAction, emitter = '$PROGEMITTER', prefix = '$PROGPREFIX', suffix = '$PROGSUFFIX', src_suffix = '$OBJSUFFIX', src_builder = 'Object', target_scanner = ProgramScanner) env['BUILDERS']['Program'] = program return program def createStaticLibBuilder(env): """This is a utility function that creates the StaticLibrary Builder in an Environment if it is not there already. If it is already there, we return the existing one. """ try: static_lib = env['BUILDERS']['StaticLibrary'] except KeyError: action_list = [ SCons.Action.Action("$ARCOM", "$ARCOMSTR") ] if env.get('RANLIB',False) or env.Detect('ranlib'): ranlib_action = SCons.Action.Action("$RANLIBCOM", "$RANLIBCOMSTR") action_list.append(ranlib_action) static_lib = SCons.Builder.Builder(action = action_list, emitter = '$LIBEMITTER', prefix = '$LIBPREFIX', suffix = '$LIBSUFFIX', src_suffix = '$OBJSUFFIX', src_builder = 'StaticObject') env['BUILDERS']['StaticLibrary'] = static_lib env['BUILDERS']['Library'] = static_lib return static_lib def _call_linker_cb(env, callback, args, result = None): """Returns the result of env['LINKCALLBACKS'][callback](*args) if env['LINKCALLBACKS'] is a dictionary and env['LINKCALLBACKS'][callback] is callable. If these conditions are not met, return the value provided as the *result* argument. This function is mainly used for generating library info such as versioned suffixes, symlink maps, sonames etc. by delegating the core job to callbacks configured by current linker tool""" Verbose = False if Verbose: print('_call_linker_cb: args=%r' % args) print('_call_linker_cb: callback=%r' % callback) try: cbfun = env['LINKCALLBACKS'][callback] except (KeyError, TypeError): if Verbose: print('_call_linker_cb: env["LINKCALLBACKS"][%r] not found or can not be used' % callback) pass else: if Verbose: print('_call_linker_cb: env["LINKCALLBACKS"][%r] found' % callback) print('_call_linker_cb: env["LINKCALLBACKS"][%r]=%r' % (callback, cbfun)) if(isinstance(cbfun, collections.Callable)): if Verbose: print('_call_linker_cb: env["LINKCALLBACKS"][%r] is callable' % callback) result = cbfun(env, *args) return result def _call_env_subst(env, string, *args, **kw): kw2 = {} for k in ('raw', 'target', 'source', 'conv', 'executor'): try: kw2[k] = kw[k] except KeyError: pass return env.subst(string, *args, **kw2) class _ShLibInfoSupport(object): def get_libtype(self): return 'ShLib' def get_lib_prefix(self, env, *args, **kw): return _call_env_subst(env,'$SHLIBPREFIX', *args, **kw) def get_lib_suffix(self, env, *args, **kw): return _call_env_subst(env,'$SHLIBSUFFIX', *args, **kw) def get_lib_version(self, env, *args, **kw): return _call_env_subst(env,'$SHLIBVERSION', *args, **kw) def get_lib_noversionsymlinks(self, env, *args, **kw): return _call_env_subst(env,'$SHLIBNOVERSIONSYMLINKS', *args, **kw) class _LdModInfoSupport(object): def get_libtype(self): return 'LdMod' def get_lib_prefix(self, env, *args, **kw): return _call_env_subst(env,'$LDMODULEPREFIX', *args, **kw) def get_lib_suffix(self, env, *args, **kw): return _call_env_subst(env,'$LDMODULESUFFIX', *args, **kw) def get_lib_version(self, env, *args, **kw): return _call_env_subst(env,'$LDMODULEVERSION', *args, **kw) def get_lib_noversionsymlinks(self, env, *args, **kw): return _call_env_subst(env,'$LDMODULENOVERSIONSYMLINKS', *args, **kw) class _ImpLibInfoSupport(object): def get_libtype(self): return 'ImpLib' def get_lib_prefix(self, env, *args, **kw): return _call_env_subst(env,'$IMPLIBPREFIX', *args, **kw) def get_lib_suffix(self, env, *args, **kw): return _call_env_subst(env,'$IMPLIBSUFFIX', *args, **kw) def get_lib_version(self, env, *args, **kw): version = _call_env_subst(env,'$IMPLIBVERSION', *args, **kw) if not version: try: lt = kw['implib_libtype'] except KeyError: pass else: if lt == 'ShLib': version = _call_env_subst(env,'$SHLIBVERSION', *args, **kw) elif lt == 'LdMod': version = _call_env_subst(env,'$LDMODULEVERSION', *args, **kw) return version def get_lib_noversionsymlinks(self, env, *args, **kw): disable = None try: env['IMPLIBNOVERSIONSYMLINKS'] except KeyError: try: lt = kw['implib_libtype'] except KeyError: pass else: if lt == 'ShLib': disable = _call_env_subst(env,'$SHLIBNOVERSIONSYMLINKS', *args, **kw) elif lt == 'LdMod': disable = _call_env_subst(env,'$LDMODULENOVERSIONSYMLINKS', *args, **kw) else: disable = _call_env_subst(env,'$IMPLIBNOVERSIONSYMLINKS', *args, **kw) return disable class _LibInfoGeneratorBase(object): """Generator base class for library-related info such as suffixes for versioned libraries, symlink maps, sonames etc. It handles commonities of SharedLibrary and LoadableModule """ _support_classes = { 'ShLib' : _ShLibInfoSupport, 'LdMod' : _LdModInfoSupport, 'ImpLib' : _ImpLibInfoSupport } def __init__(self, libtype, infoname): self.set_libtype(libtype) self.set_infoname(infoname) def set_libtype(self, libtype): try: support_class = self._support_classes[libtype] except KeyError: raise ValueError('unsupported libtype %r' % libtype) self._support = support_class() def get_libtype(self): return self._support.get_libtype() def set_infoname(self, infoname): self.infoname = infoname def get_infoname(self): return self.infoname def get_lib_prefix(self, env, *args, **kw): return self._support.get_lib_prefix(env,*args,**kw) def get_lib_suffix(self, env, *args, **kw): return self._support.get_lib_suffix(env,*args,**kw) def get_lib_version(self, env, *args, **kw): return self._support.get_lib_version(env,*args,**kw) def get_lib_noversionsymlinks(self, env, *args, **kw): return self._support.get_lib_noversionsymlinks(env,*args,**kw) # Returns name of generator linker callback that shall be used to generate # our info for a versioned library. For example, if our libtype is 'ShLib' # and infoname is 'Prefix', it would return 'VersionedShLibPrefix'. def get_versioned_lib_info_generator(self, **kw): try: libtype = kw['generator_libtype'] except KeyError: libtype = self.get_libtype() infoname = self.get_infoname() return 'Versioned%s%s' % (libtype, infoname) def generate_versioned_lib_info(self, env, args, result = None, **kw): callback = self.get_versioned_lib_info_generator(**kw) return _call_linker_cb(env, callback, args, result) class _LibPrefixGenerator(_LibInfoGeneratorBase): """Library prefix generator, used as target_prefix in SharedLibrary and LoadableModule builders""" def __init__(self, libtype): super(_LibPrefixGenerator, self).__init__(libtype, 'Prefix') def __call__(self, env, sources = None, **kw): Verbose = False if sources and 'source' not in kw: kw2 = kw.copy() kw2['source'] = sources else: kw2 = kw prefix = self.get_lib_prefix(env,**kw2) if Verbose: print("_LibPrefixGenerator: input prefix=%r" % prefix) version = self.get_lib_version(env, **kw2) if Verbose: print("_LibPrefixGenerator: version=%r" % version) if version: prefix = self.generate_versioned_lib_info(env, [prefix, version], prefix, **kw2) if Verbose: print("_LibPrefixGenerator: return prefix=%r" % prefix) return prefix ShLibPrefixGenerator = _LibPrefixGenerator('ShLib') LdModPrefixGenerator = _LibPrefixGenerator('LdMod') ImpLibPrefixGenerator = _LibPrefixGenerator('ImpLib') class _LibSuffixGenerator(_LibInfoGeneratorBase): """Library suffix generator, used as target_suffix in SharedLibrary and LoadableModule builders""" def __init__(self, libtype): super(_LibSuffixGenerator, self).__init__(libtype, 'Suffix') def __call__(self, env, sources = None, **kw): Verbose = False if sources and 'source' not in kw: kw2 = kw.copy() kw2['source'] = sources else: kw2 = kw suffix = self.get_lib_suffix(env, **kw2) if Verbose: print("_LibSuffixGenerator: input suffix=%r" % suffix) version = self.get_lib_version(env, **kw2) if Verbose: print("_LibSuffixGenerator: version=%r" % version) if version: suffix = self.generate_versioned_lib_info(env, [suffix, version], suffix, **kw2) if Verbose: print("_LibSuffixGenerator: return suffix=%r" % suffix) return suffix ShLibSuffixGenerator = _LibSuffixGenerator('ShLib') LdModSuffixGenerator = _LibSuffixGenerator('LdMod') ImpLibSuffixGenerator = _LibSuffixGenerator('ImpLib') class _LibSymlinkGenerator(_LibInfoGeneratorBase): """Library symlink map generator. It generates a list of symlinks that should be created by SharedLibrary or LoadableModule builders""" def __init__(self, libtype): super(_LibSymlinkGenerator, self).__init__(libtype, 'Symlinks') def __call__(self, env, libnode, **kw): Verbose = False if libnode and 'target' not in kw: kw2 = kw.copy() kw2['target'] = libnode else: kw2 = kw if Verbose: print("_LibSymLinkGenerator: libnode=%r" % libnode.get_path()) symlinks = None version = self.get_lib_version(env, **kw2) disable = self.get_lib_noversionsymlinks(env, **kw2) if Verbose: print('_LibSymlinkGenerator: version=%r' % version) print('_LibSymlinkGenerator: disable=%r' % disable) if version and not disable: prefix = self.get_lib_prefix(env,**kw2) suffix = self.get_lib_suffix(env,**kw2) symlinks = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2) if Verbose: print('_LibSymlinkGenerator: return symlinks=%r' % StringizeLibSymlinks(symlinks)) return symlinks ShLibSymlinkGenerator = _LibSymlinkGenerator('ShLib') LdModSymlinkGenerator = _LibSymlinkGenerator('LdMod') ImpLibSymlinkGenerator = _LibSymlinkGenerator('ImpLib') class _LibNameGenerator(_LibInfoGeneratorBase): """Generates "unmangled" library name from a library file node. Generally, it's thought to revert modifications done by prefix/suffix generators (_LibPrefixGenerator/_LibSuffixGenerator) used by a library builder. For example, on gnulink the suffix generator used by SharedLibrary builder appends $SHLIBVERSION to $SHLIBSUFFIX producing node name which ends with "$SHLIBSUFFIX.$SHLIBVERSION". Correspondingly, the implementation of _LibNameGenerator replaces "$SHLIBSUFFIX.$SHLIBVERSION" with "$SHLIBSUFFIX" in the node's basename. So that, if $SHLIBSUFFIX is ".so", $SHLIBVERSION is "0.1.2" and the node path is "/foo/bar/libfoo.so.0.1.2", the _LibNameGenerator shall return "libfoo.so". Other link tools may implement it's own way of library name unmangling. """ def __init__(self, libtype): super(_LibNameGenerator, self).__init__(libtype, 'Name') def __call__(self, env, libnode, **kw): """Returns "demangled" library name""" Verbose = False if libnode and 'target' not in kw: kw2 = kw.copy() kw2['target'] = libnode else: kw2 = kw if Verbose: print("_LibNameGenerator: libnode=%r" % libnode.get_path()) version = self.get_lib_version(env, **kw2) if Verbose: print('_LibNameGenerator: version=%r' % version) name = None if version: prefix = self.get_lib_prefix(env,**kw2) suffix = self.get_lib_suffix(env,**kw2) name = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2) if not name: name = os.path.basename(libnode.get_path()) if Verbose: print('_LibNameGenerator: return name=%r' % name) return name ShLibNameGenerator = _LibNameGenerator('ShLib') LdModNameGenerator = _LibNameGenerator('LdMod') ImpLibNameGenerator = _LibNameGenerator('ImpLib') class _LibSonameGenerator(_LibInfoGeneratorBase): """Library soname generator. Returns library soname (e.g. libfoo.so.0) for a given node (e.g. /foo/bar/libfoo.so.0.1.2)""" def __init__(self, libtype): super(_LibSonameGenerator, self).__init__(libtype, 'Soname') def __call__(self, env, libnode, **kw): """Returns a SONAME based on a shared library's node path""" Verbose = False if libnode and 'target' not in kw: kw2 = kw.copy() kw2['target'] = libnode else: kw2 = kw if Verbose: print("_LibSonameGenerator: libnode=%r" % libnode.get_path()) soname = _call_env_subst(env, '$SONAME', **kw2) if not soname: version = self.get_lib_version(env,**kw2) if Verbose: print("_LibSonameGenerator: version=%r" % version) if version: prefix = self.get_lib_prefix(env,**kw2) suffix = self.get_lib_suffix(env,**kw2) soname = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2) if not soname: # fallback to library name (as returned by appropriate _LibNameGenerator) soname = _LibNameGenerator(self.get_libtype())(env, libnode) if Verbose: print("_LibSonameGenerator: FALLBACK: soname=%r" % soname) if Verbose: print("_LibSonameGenerator: return soname=%r" % soname) return soname ShLibSonameGenerator = _LibSonameGenerator('ShLib') LdModSonameGenerator = _LibSonameGenerator('LdMod') def StringizeLibSymlinks(symlinks): """Converts list with pairs of nodes to list with pairs of node paths (strings). Used mainly for debugging.""" if SCons.Util.is_List(symlinks): try: return [ (k.get_path(), v.get_path()) for k,v in symlinks ] except (TypeError, ValueError): return symlinks else: return symlinks def EmitLibSymlinks(env, symlinks, libnode, **kw): """Used by emitters to handle (shared/versioned) library symlinks""" Verbose = False # nodes involved in process... all symlinks + library nodes = list(set([ x for x,y in symlinks ] + [libnode])) clean_targets = kw.get('clean_targets', []) if not SCons.Util.is_List(clean_targets): clean_targets = [ clean_targets ] for link, linktgt in symlinks: env.SideEffect(link, linktgt) if(Verbose): print("EmitLibSymlinks: SideEffect(%r,%r)" % (link.get_path(), linktgt.get_path())) clean_list = [x for x in nodes if x != linktgt] env.Clean(list(set([linktgt] + clean_targets)), clean_list) if(Verbose): print("EmitLibSymlinks: Clean(%r,%r)" % (linktgt.get_path(), [x.get_path() for x in clean_list])) def CreateLibSymlinks(env, symlinks): """Physically creates symlinks. The symlinks argument must be a list in form [ (link, linktarget), ... ], where link and linktarget are SCons nodes. """ Verbose = False for link, linktgt in symlinks: linktgt = link.get_dir().rel_path(linktgt) link = link.get_path() if(Verbose): print("CreateLibSymlinks: preparing to add symlink %r -> %r" % (link, linktgt)) # Delete the (previously created) symlink if exists. Let only symlinks # to be deleted to prevent accidental deletion of source files... if env.fs.islink(link): env.fs.unlink(link) if(Verbose): print("CreateLibSymlinks: removed old symlink %r" % link) # If a file or directory exists with the same name as link, an OSError # will be thrown, which should be enough, I think. env.fs.symlink(linktgt, link) if(Verbose): print("CreateLibSymlinks: add symlink %r -> %r" % (link, linktgt)) return 0 def LibSymlinksActionFunction(target, source, env): for tgt in target: symlinks = getattr(getattr(tgt,'attributes', None), 'shliblinks', None) if symlinks: CreateLibSymlinks(env, symlinks) return 0 def LibSymlinksStrFun(target, source, env, *args): cmd = None for tgt in target: symlinks = getattr(getattr(tgt,'attributes', None), 'shliblinks', None) if symlinks: if cmd is None: cmd = "" if cmd: cmd += "\n" cmd += "Create symlinks for: %r" % tgt.get_path() try: linkstr = ', '.join([ "%r->%r" %(k,v) for k,v in StringizeLibSymlinks(symlinks)]) except (KeyError, ValueError): pass else: cmd += ": %s" % linkstr return cmd LibSymlinksAction = SCons.Action.Action(LibSymlinksActionFunction, LibSymlinksStrFun) def createSharedLibBuilder(env): """This is a utility function that creates the SharedLibrary Builder in an Environment if it is not there already. If it is already there, we return the existing one. """ try: shared_lib = env['BUILDERS']['SharedLibrary'] except KeyError: import SCons.Defaults action_list = [ SCons.Defaults.SharedCheck, SCons.Defaults.ShLinkAction, LibSymlinksAction ] shared_lib = SCons.Builder.Builder(action = action_list, emitter = "$SHLIBEMITTER", prefix = ShLibPrefixGenerator, suffix = ShLibSuffixGenerator, target_scanner = ProgramScanner, src_suffix = '$SHOBJSUFFIX', src_builder = 'SharedObject') env['BUILDERS']['SharedLibrary'] = shared_lib return shared_lib def createLoadableModuleBuilder(env): """This is a utility function that creates the LoadableModule Builder in an Environment if it is not there already. If it is already there, we return the existing one. """ try: ld_module = env['BUILDERS']['LoadableModule'] except KeyError: import SCons.Defaults action_list = [ SCons.Defaults.SharedCheck, SCons.Defaults.LdModuleLinkAction, LibSymlinksAction ] ld_module = SCons.Builder.Builder(action = action_list, emitter = "$LDMODULEEMITTER", prefix = LdModPrefixGenerator, suffix = LdModSuffixGenerator, target_scanner = ProgramScanner, src_suffix = '$SHOBJSUFFIX', src_builder = 'SharedObject') env['BUILDERS']['LoadableModule'] = ld_module return ld_module def createObjBuilders(env): """This is a utility function that creates the StaticObject and SharedObject Builders in an Environment if they are not there already. If they are there already, we return the existing ones. This is a separate function because soooo many Tools use this functionality. The return is a 2-tuple of (StaticObject, SharedObject) """ try: static_obj = env['BUILDERS']['StaticObject'] except KeyError: static_obj = SCons.Builder.Builder(action = {}, emitter = {}, prefix = '$OBJPREFIX', suffix = '$OBJSUFFIX', src_builder = ['CFile', 'CXXFile'], source_scanner = SourceFileScanner, single_source = 1) env['BUILDERS']['StaticObject'] = static_obj env['BUILDERS']['Object'] = static_obj try: shared_obj = env['BUILDERS']['SharedObject'] except KeyError: shared_obj = SCons.Builder.Builder(action = {}, emitter = {}, prefix = '$SHOBJPREFIX', suffix = '$SHOBJSUFFIX', src_builder = ['CFile', 'CXXFile'], source_scanner = SourceFileScanner, single_source = 1) env['BUILDERS']['SharedObject'] = shared_obj return (static_obj, shared_obj) def createCFileBuilders(env): """This is a utility function that creates the CFile/CXXFile Builders in an Environment if they are not there already. If they are there already, we return the existing ones. This is a separate function because soooo many Tools use this functionality. The return is a 2-tuple of (CFile, CXXFile) """ try: c_file = env['BUILDERS']['CFile'] except KeyError: c_file = SCons.Builder.Builder(action = {}, emitter = {}, suffix = {None:'$CFILESUFFIX'}) env['BUILDERS']['CFile'] = c_file env.SetDefault(CFILESUFFIX = '.c') try: cxx_file = env['BUILDERS']['CXXFile'] except KeyError: cxx_file = SCons.Builder.Builder(action = {}, emitter = {}, suffix = {None:'$CXXFILESUFFIX'}) env['BUILDERS']['CXXFile'] = cxx_file env.SetDefault(CXXFILESUFFIX = '.cc') return (c_file, cxx_file) ########################################################################## # Create common Java builders def CreateJarBuilder(env): try: java_jar = env['BUILDERS']['Jar'] except KeyError: fs = SCons.Node.FS.get_default_fs() jar_com = SCons.Action.Action('$JARCOM', '$JARCOMSTR') java_jar = SCons.Builder.Builder(action = jar_com, suffix = '$JARSUFFIX', src_suffix = '$JAVACLASSSUFFIX', src_builder = 'JavaClassFile', source_factory = fs.Entry) env['BUILDERS']['Jar'] = java_jar return java_jar def CreateJavaHBuilder(env): try: java_javah = env['BUILDERS']['JavaH'] except KeyError: fs = SCons.Node.FS.get_default_fs() java_javah_com = SCons.Action.Action('$JAVAHCOM', '$JAVAHCOMSTR') java_javah = SCons.Builder.Builder(action = java_javah_com, src_suffix = '$JAVACLASSSUFFIX', target_factory = fs.Entry, source_factory = fs.File, src_builder = 'JavaClassFile') env['BUILDERS']['JavaH'] = java_javah return java_javah def CreateJavaClassFileBuilder(env): try: java_class_file = env['BUILDERS']['JavaClassFile'] except KeyError: fs = SCons.Node.FS.get_default_fs() javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR') java_class_file = SCons.Builder.Builder(action = javac_com, emitter = {}, #suffix = '$JAVACLASSSUFFIX', src_suffix = '$JAVASUFFIX', src_builder = ['JavaFile'], target_factory = fs.Entry, source_factory = fs.File) env['BUILDERS']['JavaClassFile'] = java_class_file return java_class_file def CreateJavaClassDirBuilder(env): try: java_class_dir = env['BUILDERS']['JavaClassDir'] except KeyError: fs = SCons.Node.FS.get_default_fs() javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR') java_class_dir = SCons.Builder.Builder(action = javac_com, emitter = {}, target_factory = fs.Dir, source_factory = fs.Dir) env['BUILDERS']['JavaClassDir'] = java_class_dir return java_class_dir def CreateJavaFileBuilder(env): try: java_file = env['BUILDERS']['JavaFile'] except KeyError: java_file = SCons.Builder.Builder(action = {}, emitter = {}, suffix = {None:'$JAVASUFFIX'}) env['BUILDERS']['JavaFile'] = java_file env['JAVASUFFIX'] = '.java' return java_file class ToolInitializerMethod(object): """ This is added to a construction environment in place of a method(s) normally called for a Builder (env.Object, env.StaticObject, etc.). When called, it has its associated ToolInitializer object search the specified list of tools and apply the first one that exists to the construction environment. It then calls whatever builder was (presumably) added to the construction environment in place of this particular instance. """ def __init__(self, name, initializer): """ Note: we store the tool name as __name__ so it can be used by the class that attaches this to a construction environment. """ self.__name__ = name self.initializer = initializer def get_builder(self, env): """ Returns the appropriate real Builder for this method name after having the associated ToolInitializer object apply the appropriate Tool module. """ builder = getattr(env, self.__name__) self.initializer.apply_tools(env) builder = getattr(env, self.__name__) if builder is self: # There was no Builder added, which means no valid Tool # for this name was found (or possibly there's a mismatch # between the name we were called by and the Builder name # added by the Tool module). return None self.initializer.remove_methods(env) return builder def __call__(self, env, *args, **kw): """ """ builder = self.get_builder(env) if builder is None: return [], [] return builder(*args, **kw) class ToolInitializer(object): """ A class for delayed initialization of Tools modules. Instances of this class associate a list of Tool modules with a list of Builder method names that will be added by those Tool modules. As part of instantiating this object for a particular construction environment, we also add the appropriate ToolInitializerMethod objects for the various Builder methods that we want to use to delay Tool searches until necessary. """ def __init__(self, env, tools, names): if not SCons.Util.is_List(tools): tools = [tools] if not SCons.Util.is_List(names): names = [names] self.env = env self.tools = tools self.names = names self.methods = {} for name in names: method = ToolInitializerMethod(name, self) self.methods[name] = method env.AddMethod(method) def remove_methods(self, env): """ Removes the methods that were added by the tool initialization so we no longer copy and re-bind them when the construction environment gets cloned. """ for method in list(self.methods.values()): env.RemoveMethod(method) def apply_tools(self, env): """ Searches the list of associated Tool modules for one that exists, and applies that to the construction environment. """ for t in self.tools: tool = SCons.Tool.Tool(t) if tool.exists(env): env.Tool(tool) return # If we fall through here, there was no tool module found. # This is where we can put an informative error message # about the inability to find the tool. We'll start doing # this as we cut over more pre-defined Builder+Tools to use # the ToolInitializer class. def Initializers(env): ToolInitializer(env, ['install'], ['_InternalInstall', '_InternalInstallAs', '_InternalInstallVersionedLib']) def Install(self, *args, **kw): return self._InternalInstall(*args, **kw) def InstallAs(self, *args, **kw): return self._InternalInstallAs(*args, **kw) def InstallVersionedLib(self, *args, **kw): return self._InternalInstallVersionedLib(*args, **kw) env.AddMethod(Install) env.AddMethod(InstallAs) env.AddMethod(InstallVersionedLib) def FindTool(tools, env): for tool in tools: t = Tool(tool) if t.exists(env): return tool return None def FindAllTools(tools, env): def ToolExists(tool, env=env): return Tool(tool).exists(env) return list(filter (ToolExists, tools)) def tool_list(platform, env): other_plat_tools=[] # XXX this logic about what tool to prefer on which platform # should be moved into either the platform files or # the tool files themselves. # The search orders here are described in the man page. If you # change these search orders, update the man page as well. if str(platform) == 'win32': "prefer Microsoft tools on Windows" linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32' ] c_compilers = ['msvc', 'mingw', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32' ] cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'cxx', 'bcc32' ] assemblers = ['masm', 'nasm', 'gas', '386asm' ] fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran'] ars = ['mslib', 'ar', 'tlib'] other_plat_tools = ['msvs', 'midl'] elif str(platform) == 'os2': "prefer IBM tools on OS/2" linkers = ['ilink', 'gnulink', ]#'mslink'] c_compilers = ['icc', 'gcc',]# 'msvc', 'cc'] cxx_compilers = ['icc', 'g++',]# 'msvc', 'cxx'] assemblers = ['nasm',]# 'masm', 'gas'] fortran_compilers = ['ifl', 'g77'] ars = ['ar',]# 'mslib'] elif str(platform) == 'irix': "prefer MIPSPro on IRIX" linkers = ['sgilink', 'gnulink'] c_compilers = ['sgicc', 'gcc', 'cc'] cxx_compilers = ['sgicxx', 'g++', 'cxx'] assemblers = ['as', 'gas'] fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran'] ars = ['sgiar'] elif str(platform) == 'sunos': "prefer Forte tools on SunOS" linkers = ['sunlink', 'gnulink'] c_compilers = ['suncc', 'gcc', 'cc'] cxx_compilers = ['suncxx', 'g++', 'cxx'] assemblers = ['as', 'gas'] fortran_compilers = ['sunf95', 'sunf90', 'sunf77', 'f95', 'f90', 'f77', 'gfortran', 'g77', 'fortran'] ars = ['sunar'] elif str(platform) == 'hpux': "prefer aCC tools on HP-UX" linkers = ['hplink', 'gnulink'] c_compilers = ['hpcc', 'gcc', 'cc'] cxx_compilers = ['hpcxx', 'g++', 'cxx'] assemblers = ['as', 'gas'] fortran_compilers = ['f95', 'f90', 'f77', 'g77', 'fortran'] ars = ['ar'] elif str(platform) == 'aix': "prefer AIX Visual Age tools on AIX" linkers = ['aixlink', 'gnulink'] c_compilers = ['aixcc', 'gcc', 'cc'] cxx_compilers = ['aixcxx', 'g++', 'cxx'] assemblers = ['as', 'gas'] fortran_compilers = ['f95', 'f90', 'aixf77', 'g77', 'fortran'] ars = ['ar'] elif str(platform) == 'darwin': "prefer GNU tools on Mac OS X, except for some linkers and IBM tools" linkers = ['applelink', 'gnulink'] c_compilers = ['gcc', 'cc'] cxx_compilers = ['g++', 'cxx'] assemblers = ['as'] fortran_compilers = ['gfortran', 'f95', 'f90', 'g77'] ars = ['ar'] elif str(platform) == 'cygwin': "prefer GNU tools on Cygwin, except for a platform-specific linker" linkers = ['cyglink', 'mslink', 'ilink'] c_compilers = ['gcc', 'msvc', 'intelc', 'icc', 'cc'] cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'cxx'] assemblers = ['gas', 'nasm', 'masm'] fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77'] ars = ['ar', 'mslib'] else: "prefer GNU tools on all other platforms" linkers = ['gnulink', 'ilink'] c_compilers = ['gcc', 'intelc', 'icc', 'cc'] cxx_compilers = ['g++', 'intelc', 'icc', 'cxx'] assemblers = ['gas', 'nasm', 'masm'] fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77'] ars = ['ar',] if not str(platform) == 'win32': other_plat_tools += ['m4', 'rpm'] c_compiler = FindTool(c_compilers, env) or c_compilers[0] # XXX this logic about what tool provides what should somehow be # moved into the tool files themselves. if c_compiler and c_compiler == 'mingw': # MinGW contains a linker, C compiler, C++ compiler, # Fortran compiler, archiver and assembler: cxx_compiler = None linker = None assembler = None fortran_compiler = None ar = None else: # Don't use g++ if the C compiler has built-in C++ support: if c_compiler in ('msvc', 'intelc', 'icc'): cxx_compiler = None else: cxx_compiler = FindTool(cxx_compilers, env) or cxx_compilers[0] linker = FindTool(linkers, env) or linkers[0] assembler = FindTool(assemblers, env) or assemblers[0] fortran_compiler = FindTool(fortran_compilers, env) or fortran_compilers[0] ar = FindTool(ars, env) or ars[0] d_compilers = ['dmd', 'ldc', 'gdc'] d_compiler = FindTool(d_compilers, env) or d_compilers[0] other_tools = FindAllTools(other_plat_tools + [ #TODO: merge 'install' into 'filesystem' and # make 'filesystem' the default 'filesystem', 'wix', #'midl', 'msvs', # Parser generators 'lex', 'yacc', # Foreign function interface 'rpcgen', 'swig', # Java 'jar', 'javac', 'javah', 'rmic', # TeX 'dvipdf', 'dvips', 'gs', 'tex', 'latex', 'pdflatex', 'pdftex', # Archivers 'tar', 'zip', ], env) tools = ([linker, c_compiler, cxx_compiler, fortran_compiler, assembler, ar, d_compiler] + other_tools) return [x for x in tools if x] # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/msgmerge.py0000664000175000017500000001023413160023044021633 0ustar bdbaddogbdbaddog""" msgmerget tool Tool specific initialization for `msgmerge` tool. """ # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/msgmerge.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" ############################################################################# def _update_or_init_po_files(target, source, env): """ Action function for `POUpdate` builder """ import SCons.Action from SCons.Tool.GettextCommon import _init_po_files for tgt in target: if tgt.rexists(): action = SCons.Action.Action('$MSGMERGECOM', '$MSGMERGECOMSTR') else: action = _init_po_files status = action([tgt], source, env) if status : return status return 0 ############################################################################# ############################################################################# def _POUpdateBuilder(env, **kw): """ Create an object of `POUpdate` builder """ import SCons.Action from SCons.Tool.GettextCommon import _POFileBuilder action = SCons.Action.Action(_update_or_init_po_files, None) return _POFileBuilder(env, action=action, target_alias='$POUPDATE_ALIAS') ############################################################################# ############################################################################# from SCons.Environment import _null ############################################################################# def _POUpdateBuilderWrapper(env, target=None, source=_null, **kw): """ Wrapper for `POUpdate` builder - make user's life easier """ if source is _null: if 'POTDOMAIN' in kw: domain = kw['POTDOMAIN'] elif 'POTDOMAIN' in env and env['POTDOMAIN']: domain = env['POTDOMAIN'] else: domain = 'messages' source = [ domain ] # NOTE: Suffix shall be appended automatically return env._POUpdateBuilder(target, source, **kw) ############################################################################# ############################################################################# def generate(env,**kw): """ Generate the `xgettext` tool """ from SCons.Tool.GettextCommon import _detect_msgmerge try: env['MSGMERGE'] = _detect_msgmerge(env) except: env['MSGMERGE'] = 'msgmerge' env.SetDefault( POTSUFFIX = ['.pot'], POSUFFIX = ['.po'], MSGMERGECOM = '$MSGMERGE $MSGMERGEFLAGS --update $TARGET $SOURCE', MSGMERGECOMSTR = '', MSGMERGEFLAGS = [ ], POUPDATE_ALIAS = 'po-update' ) env.Append(BUILDERS = { '_POUpdateBuilder':_POUpdateBuilder(env) }) env.AddMethod(_POUpdateBuilderWrapper, 'POUpdate') env.AlwaysBuild(env.Alias('$POUPDATE_ALIAS')) ############################################################################# ############################################################################# def exists(env): """ Check if the tool exists """ from SCons.Tool.GettextCommon import _msgmerge_exists try: return _msgmerge_exists(env) except: return False ############################################################################# # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/intelc.py0000664000175000017500000006342013160023044021310 0ustar bdbaddogbdbaddog"""SCons.Tool.icl Tool-specific initialization for the Intel C/C++ compiler. Supports Linux and Windows compilers, v7 and up. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import division, print_function __revision__ = "src/engine/SCons/Tool/intelc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import math, sys, os.path, glob, string, re is_windows = sys.platform == 'win32' is_win64 = is_windows and (os.environ['PROCESSOR_ARCHITECTURE'] == 'AMD64' or ('PROCESSOR_ARCHITEW6432' in os.environ and os.environ['PROCESSOR_ARCHITEW6432'] == 'AMD64')) is_linux = sys.platform.startswith('linux') is_mac = sys.platform == 'darwin' if is_windows: import SCons.Tool.msvc elif is_linux: import SCons.Tool.gcc elif is_mac: import SCons.Tool.gcc import SCons.Util import SCons.Warnings # Exceptions for this tool class IntelCError(SCons.Errors.InternalError): pass class MissingRegistryError(IntelCError): # missing registry entry pass class MissingDirError(IntelCError): # dir not found pass class NoRegistryModuleError(IntelCError): # can't read registry at all pass def linux_ver_normalize(vstr): """Normalize a Linux compiler version number. Intel changed from "80" to "9.0" in 2005, so we assume if the number is greater than 60 it's an old-style number and otherwise new-style. Always returns an old-style float like 80 or 90 for compatibility with Windows. Shades of Y2K!""" # Check for version number like 9.1.026: return 91.026 # XXX needs to be updated for 2011+ versions (like 2011.11.344 which is compiler v12.1.5) m = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)', vstr) if m: vmaj,vmin,build = m.groups() return float(vmaj) * 10. + float(vmin) + float(build) / 1000.; else: f = float(vstr) if is_windows: return f else: if f < 60: return f * 10.0 else: return f def check_abi(abi): """Check for valid ABI (application binary interface) name, and map into canonical one""" if not abi: return None abi = abi.lower() # valid_abis maps input name to canonical name if is_windows: valid_abis = {'ia32' : 'ia32', 'x86' : 'ia32', 'ia64' : 'ia64', 'em64t' : 'em64t', 'amd64' : 'em64t'} if is_linux: valid_abis = {'ia32' : 'ia32', 'x86' : 'ia32', 'x86_64' : 'x86_64', 'em64t' : 'x86_64', 'amd64' : 'x86_64'} if is_mac: valid_abis = {'ia32' : 'ia32', 'x86' : 'ia32', 'x86_64' : 'x86_64', 'em64t' : 'x86_64'} try: abi = valid_abis[abi] except KeyError: raise SCons.Errors.UserError("Intel compiler: Invalid ABI %s, valid values are %s"% \ (abi, list(valid_abis.keys()))) return abi def vercmp(a, b): """Compare strings as floats, but Intel changed Linux naming convention at 9.0""" return cmp(linux_ver_normalize(b), linux_ver_normalize(a)) def get_version_from_list(v, vlist): """See if we can match v (string) in vlist (list of strings) Linux has to match in a fuzzy way.""" if is_windows: # Simple case, just find it in the list if v in vlist: return v else: return None else: # Fuzzy match: normalize version number first, but still return # original non-normalized form. fuzz = 0.001 for vi in vlist: if math.fabs(linux_ver_normalize(vi) - linux_ver_normalize(v)) < fuzz: return vi # Not found return None def get_intel_registry_value(valuename, version=None, abi=None): """ Return a value from the Intel compiler registry tree. (Windows only) """ # Open the key: if is_win64: K = 'Software\\Wow6432Node\\Intel\\Compilers\\C++\\' + version + '\\'+abi.upper() else: K = 'Software\\Intel\\Compilers\\C++\\' + version + '\\'+abi.upper() try: k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K) except SCons.Util.RegError: # For version 13 and later, check UUID subkeys for valuename if is_win64: K = 'Software\\Wow6432Node\\Intel\\Suites\\' + version + "\\Defaults\\C++\\" + abi.upper() else: K = 'Software\\Intel\\Suites\\' + version + "\\Defaults\\C++\\" + abi.upper() try: k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K) uuid = SCons.Util.RegQueryValueEx(k, 'SubKey')[0] if is_win64: K = 'Software\\Wow6432Node\\Intel\\Suites\\' + version + "\\" + uuid + "\\C++" else: K = 'Software\\Intel\\Suites\\' + version + "\\" + uuid + "\\C++" k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K) try: v = SCons.Util.RegQueryValueEx(k, valuename)[0] return v # or v.encode('iso-8859-1', 'replace') to remove unicode? except SCons.Util.RegError: if abi.upper() == 'EM64T': abi = 'em64t_native' if is_win64: K = 'Software\\Wow6432Node\\Intel\\Suites\\' + version + "\\" + uuid + "\\C++\\" + abi.upper() else: K = 'Software\\Intel\\Suites\\' + version + "\\" + uuid + "\\C++\\" + abi.upper() k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K) try: v = SCons.Util.RegQueryValueEx(k, valuename)[0] return v # or v.encode('iso-8859-1', 'replace') to remove unicode? except SCons.Util.RegError: raise MissingRegistryError("%s was not found in the registry, for Intel compiler version %s, abi='%s'"%(K, version,abi)) except SCons.Util.RegError: raise MissingRegistryError("%s was not found in the registry, for Intel compiler version %s, abi='%s'"%(K, version,abi)) except SCons.Util.WinError: raise MissingRegistryError("%s was not found in the registry, for Intel compiler version %s, abi='%s'"%(K, version,abi)) # Get the value: try: v = SCons.Util.RegQueryValueEx(k, valuename)[0] return v # or v.encode('iso-8859-1', 'replace') to remove unicode? except SCons.Util.RegError: raise MissingRegistryError("%s\\%s was not found in the registry."%(K, valuename)) def get_all_compiler_versions(): """Returns a sorted list of strings, like "70" or "80" or "9.0" with most recent compiler version first. """ versions=[] if is_windows: if is_win64: keyname = 'Software\\WoW6432Node\\Intel\\Compilers\\C++' else: keyname = 'Software\\Intel\\Compilers\\C++' try: k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, keyname) except SCons.Util.WinError: # For version 13 or later, check for default instance UUID if is_win64: keyname = 'Software\\WoW6432Node\\Intel\\Suites' else: keyname = 'Software\\Intel\\Suites' try: k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, keyname) except SCons.Util.WinError: return [] i = 0 versions = [] try: while i < 100: subkey = SCons.Util.RegEnumKey(k, i) # raises EnvironmentError # Check that this refers to an existing dir. # This is not 100% perfect but should catch common # installation issues like when the compiler was installed # and then the install directory deleted or moved (rather # than uninstalling properly), so the registry values # are still there. if subkey == 'Defaults': # Ignore default instances i = i + 1 continue ok = False for try_abi in ('IA32', 'IA32e', 'IA64', 'EM64T'): try: d = get_intel_registry_value('ProductDir', subkey, try_abi) except MissingRegistryError: continue # not found in reg, keep going if os.path.exists(d): ok = True if ok: versions.append(subkey) else: try: # Registry points to nonexistent dir. Ignore this # version. value = get_intel_registry_value('ProductDir', subkey, 'IA32') except MissingRegistryError as e: # Registry key is left dangling (potentially # after uninstalling). print("scons: *** Ignoring the registry key for the Intel compiler version %s.\n" \ "scons: *** It seems that the compiler was uninstalled and that the registry\n" \ "scons: *** was not cleaned up properly.\n" % subkey) else: print("scons: *** Ignoring "+str(value)) i = i + 1 except EnvironmentError: # no more subkeys pass elif is_linux or is_mac: for d in glob.glob('/opt/intel_cc_*'): # Typical dir here is /opt/intel_cc_80. m = re.search(r'cc_(.*)$', d) if m: versions.append(m.group(1)) for d in glob.glob('/opt/intel/cc*/*'): # Typical dir here is /opt/intel/cc/9.0 for IA32, # /opt/intel/cce/9.0 for EMT64 (AMD64) m = re.search(r'([0-9][0-9.]*)$', d) if m: versions.append(m.group(1)) for d in glob.glob('/opt/intel/Compiler/*'): # Typical dir here is /opt/intel/Compiler/11.1 m = re.search(r'([0-9][0-9.]*)$', d) if m: versions.append(m.group(1)) for d in glob.glob('/opt/intel/composerxe-*'): # Typical dir here is /opt/intel/composerxe-2011.4.184 m = re.search(r'([0-9][0-9.]*)$', d) if m: versions.append(m.group(1)) for d in glob.glob('/opt/intel/composer_xe_*'): # Typical dir here is /opt/intel/composer_xe_2011_sp1.11.344 # The _sp1 is useless, the installers are named 2011.9.x, 2011.10.x, 2011.11.x m = re.search(r'([0-9]{0,4})(?:_sp\d*)?\.([0-9][0-9.]*)$', d) if m: versions.append("%s.%s"%(m.group(1), m.group(2))) for d in glob.glob('/opt/intel/compilers_and_libraries_*'): # JPA: For the new version of Intel compiler 2016.1. m = re.search(r'([0-9]{0,4})(?:_sp\d*)?\.([0-9][0-9.]*)$', d) if m: versions.append("%s.%s"%(m.group(1), m.group(2))) def keyfunc(str): """Given a dot-separated version string, return a tuple of ints representing it.""" return [int(x) for x in str.split('.')] # split into ints, sort, then remove dups return sorted(SCons.Util.unique(versions), key=keyfunc, reverse=True) def get_intel_compiler_top(version, abi): """ Return the main path to the top-level dir of the Intel compiler, using the given version. The compiler will be in /bin/icl.exe (icc on linux), the include dir is /include, etc. """ if is_windows: if not SCons.Util.can_read_reg: raise NoRegistryModuleError("No Windows registry module was found") top = get_intel_registry_value('ProductDir', version, abi) archdir={'x86_64': 'intel64', 'amd64' : 'intel64', 'em64t' : 'intel64', 'x86' : 'ia32', 'i386' : 'ia32', 'ia32' : 'ia32' }[abi] # for v11 and greater # pre-11, icl was in Bin. 11 and later, it's in Bin/ apparently. if not os.path.exists(os.path.join(top, "Bin", "icl.exe")) \ and not os.path.exists(os.path.join(top, "Bin", abi, "icl.exe")) \ and not os.path.exists(os.path.join(top, "Bin", archdir, "icl.exe")): raise MissingDirError("Can't find Intel compiler in %s"%(top)) elif is_mac or is_linux: def find_in_2008style_dir(version): # first dir is new (>=9.0) style, second is old (8.0) style. dirs=('/opt/intel/cc/%s', '/opt/intel_cc_%s') if abi == 'x86_64': dirs=('/opt/intel/cce/%s',) # 'e' stands for 'em64t', aka x86_64 aka amd64 top=None for d in dirs: if os.path.exists(os.path.join(d%version, "bin", "icc")): top = d%version break return top def find_in_2010style_dir(version): dirs=('/opt/intel/Compiler/%s/*'%version) # typically /opt/intel/Compiler/11.1/064 (then bin/intel64/icc) dirs=glob.glob(dirs) # find highest sub-version number by reverse sorting and picking first existing one. dirs.sort() dirs.reverse() top=None for d in dirs: if (os.path.exists(os.path.join(d, "bin", "ia32", "icc")) or os.path.exists(os.path.join(d, "bin", "intel64", "icc"))): top = d break return top def find_in_2011style_dir(version): # The 2011 (compiler v12) dirs are inconsistent, so just redo the search from # get_all_compiler_versions and look for a match (search the newest form first) top=None for d in glob.glob('/opt/intel/composer_xe_*'): # Typical dir here is /opt/intel/composer_xe_2011_sp1.11.344 # The _sp1 is useless, the installers are named 2011.9.x, 2011.10.x, 2011.11.x m = re.search(r'([0-9]{0,4})(?:_sp\d*)?\.([0-9][0-9.]*)$', d) if m: cur_ver = "%s.%s"%(m.group(1), m.group(2)) if cur_ver == version and \ (os.path.exists(os.path.join(d, "bin", "ia32", "icc")) or os.path.exists(os.path.join(d, "bin", "intel64", "icc"))): top = d break if not top: for d in glob.glob('/opt/intel/composerxe-*'): # Typical dir here is /opt/intel/composerxe-2011.4.184 m = re.search(r'([0-9][0-9.]*)$', d) if m and m.group(1) == version and \ (os.path.exists(os.path.join(d, "bin", "ia32", "icc")) or os.path.exists(os.path.join(d, "bin", "intel64", "icc"))): top = d break return top def find_in_2016style_dir(version): # The 2016 (compiler v16) dirs are inconsistent from previous. top = None for d in glob.glob('/opt/intel/compilers_and_libraries_%s/linux'%version): if os.path.exists(os.path.join(d, "bin", "ia32", "icc")) or os.path.exists(os.path.join(d, "bin", "intel64", "icc")): top = d break return top top = find_in_2016style_dir(version) or find_in_2011style_dir(version) or find_in_2010style_dir(version) or find_in_2008style_dir(version) # print "INTELC: top=",top if not top: raise MissingDirError("Can't find version %s Intel compiler in %s (abi='%s')"%(version,top, abi)) return top def generate(env, version=None, abi=None, topdir=None, verbose=0): """Add Builders and construction variables for Intel C/C++ compiler to an Environment. args: version: (string) compiler version to use, like "80" abi: (string) 'win32' or whatever Itanium version wants topdir: (string) compiler top dir, like "c:\Program Files\Intel\Compiler70" If topdir is used, version and abi are ignored. verbose: (int) if >0, prints compiler version used. """ if not (is_mac or is_linux or is_windows): # can't handle this platform return if is_windows: SCons.Tool.msvc.generate(env) elif is_linux: SCons.Tool.gcc.generate(env) elif is_mac: SCons.Tool.gcc.generate(env) # if version is unspecified, use latest vlist = get_all_compiler_versions() if not version: if vlist: version = vlist[0] else: # User may have specified '90' but we need to get actual dirname '9.0'. # get_version_from_list does that mapping. v = get_version_from_list(version, vlist) if not v: raise SCons.Errors.UserError("Invalid Intel compiler version %s: "%version + \ "installed versions are %s"%(', '.join(vlist))) version = v # if abi is unspecified, use ia32 # alternatives are ia64 for Itanium, or amd64 or em64t or x86_64 (all synonyms here) abi = check_abi(abi) if abi is None: if is_mac or is_linux: # Check if we are on 64-bit linux, default to 64 then. uname_m = os.uname()[4] if uname_m == 'x86_64': abi = 'x86_64' else: abi = 'ia32' else: if is_win64: abi = 'em64t' else: abi = 'ia32' if version and not topdir: try: topdir = get_intel_compiler_top(version, abi) except (SCons.Util.RegError, IntelCError): topdir = None if not topdir: # Normally this is an error, but it might not be if the compiler is # on $PATH and the user is importing their env. class ICLTopDirWarning(SCons.Warnings.Warning): pass if (is_mac or is_linux) and not env.Detect('icc') or \ is_windows and not env.Detect('icl'): SCons.Warnings.enableWarningClass(ICLTopDirWarning) SCons.Warnings.warn(ICLTopDirWarning, "Failed to find Intel compiler for version='%s', abi='%s'"% (str(version), str(abi))) else: # should be cleaned up to say what this other version is # since in this case we have some other Intel compiler installed SCons.Warnings.enableWarningClass(ICLTopDirWarning) SCons.Warnings.warn(ICLTopDirWarning, "Can't find Intel compiler top dir for version='%s', abi='%s'"% (str(version), str(abi))) if topdir: archdir={'x86_64': 'intel64', 'amd64' : 'intel64', 'em64t' : 'intel64', 'x86' : 'ia32', 'i386' : 'ia32', 'ia32' : 'ia32' }[abi] # for v11 and greater if os.path.exists(os.path.join(topdir, 'bin', archdir)): bindir="bin/%s"%archdir libdir="lib/%s"%archdir else: bindir="bin" libdir="lib" if verbose: print("Intel C compiler: using version %s (%g), abi %s, in '%s/%s'"%\ (repr(version), linux_ver_normalize(version),abi,topdir,bindir)) if is_linux: # Show the actual compiler version by running the compiler. os.system('%s/%s/icc --version'%(topdir,bindir)) if is_mac: # Show the actual compiler version by running the compiler. os.system('%s/%s/icc --version'%(topdir,bindir)) env['INTEL_C_COMPILER_TOP'] = topdir if is_linux: paths={'INCLUDE' : 'include', 'LIB' : libdir, 'PATH' : bindir, 'LD_LIBRARY_PATH' : libdir} for p in list(paths.keys()): env.PrependENVPath(p, os.path.join(topdir, paths[p])) if is_mac: paths={'INCLUDE' : 'include', 'LIB' : libdir, 'PATH' : bindir, 'LD_LIBRARY_PATH' : libdir} for p in list(paths.keys()): env.PrependENVPath(p, os.path.join(topdir, paths[p])) if is_windows: # env key reg valname default subdir of top paths=(('INCLUDE', 'IncludeDir', 'Include'), ('LIB' , 'LibDir', 'Lib'), ('PATH' , 'BinDir', 'Bin')) # We are supposed to ignore version if topdir is set, so set # it to the emptry string if it's not already set. if version is None: version = '' # Each path has a registry entry, use that or default to subdir for p in paths: try: path=get_intel_registry_value(p[1], version, abi) # These paths may have $(ICInstallDir) # which needs to be substituted with the topdir. path=path.replace('$(ICInstallDir)', topdir + os.sep) except IntelCError: # Couldn't get it from registry: use default subdir of topdir env.PrependENVPath(p[0], os.path.join(topdir, p[2])) else: env.PrependENVPath(p[0], path.split(os.pathsep)) # print "ICL %s: %s, final=%s"%(p[0], path, str(env['ENV'][p[0]])) if is_windows: env['CC'] = 'icl' env['CXX'] = 'icl' env['LINK'] = 'xilink' else: env['CC'] = 'icc' env['CXX'] = 'icpc' # Don't reset LINK here; # use smart_link which should already be here from link.py. #env['LINK'] = '$CC' env['AR'] = 'xiar' env['LD'] = 'xild' # not used by default # This is not the exact (detailed) compiler version, # just the major version as determined above or specified # by the user. It is a float like 80 or 90, in normalized form for Linux # (i.e. even for Linux 9.0 compiler, still returns 90 rather than 9.0) if version: env['INTEL_C_COMPILER_VERSION']=linux_ver_normalize(version) if is_windows: # Look for license file dir # in system environment, registry, and default location. envlicdir = os.environ.get("INTEL_LICENSE_FILE", '') K = ('SOFTWARE\Intel\Licenses') try: k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K) reglicdir = SCons.Util.RegQueryValueEx(k, "w_cpp")[0] except (AttributeError, SCons.Util.RegError): reglicdir = "" defaultlicdir = r'C:\Program Files\Common Files\Intel\Licenses' licdir = None for ld in [envlicdir, reglicdir]: # If the string contains an '@', then assume it's a network # license (port@system) and good by definition. if ld and (ld.find('@') != -1 or os.path.exists(ld)): licdir = ld break if not licdir: licdir = defaultlicdir if not os.path.exists(licdir): class ICLLicenseDirWarning(SCons.Warnings.Warning): pass SCons.Warnings.enableWarningClass(ICLLicenseDirWarning) SCons.Warnings.warn(ICLLicenseDirWarning, "Intel license dir was not found." " Tried using the INTEL_LICENSE_FILE environment variable (%s), the registry (%s) and the default path (%s)." " Using the default path as a last resort." % (envlicdir, reglicdir, defaultlicdir)) env['ENV']['INTEL_LICENSE_FILE'] = licdir def exists(env): if not (is_mac or is_linux or is_windows): # can't handle this platform return 0 try: versions = get_all_compiler_versions() except (SCons.Util.RegError, IntelCError): versions = None detected = versions is not None and len(versions) > 0 if not detected: # try env.Detect, maybe that will work if is_windows: return env.Detect('icl') elif is_linux: return env.Detect('icc') elif is_mac: return env.Detect('icc') return detected # end of file # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/lex.py0000664000175000017500000000643613160023044020626 0ustar bdbaddogbdbaddog"""SCons.Tool.lex Tool-specific initialization for lex. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/lex.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import SCons.Action import SCons.Tool import SCons.Util LexAction = SCons.Action.Action("$LEXCOM", "$LEXCOMSTR") def lexEmitter(target, source, env): sourceBase, sourceExt = os.path.splitext(SCons.Util.to_String(source[0])) if sourceExt == ".lm": # If using Objective-C target = [sourceBase + ".m"] # the extension is ".m". # This emitter essentially tries to add to the target all extra # files generated by flex. # Different options that are used to trigger the creation of extra files. fileGenOptions = ["--header-file=", "--tables-file="] lexflags = env.subst("$LEXFLAGS", target=target, source=source) for option in SCons.Util.CLVar(lexflags): for fileGenOption in fileGenOptions: l = len(fileGenOption) if option[:l] == fileGenOption: # A file generating option is present, so add the # file name to the target list. fileName = option[l:].strip() target.append(fileName) return (target, source) def generate(env): """Add Builders and construction variables for lex to an Environment.""" c_file, cxx_file = SCons.Tool.createCFileBuilders(env) # C c_file.add_action(".l", LexAction) c_file.add_emitter(".l", lexEmitter) c_file.add_action(".lex", LexAction) c_file.add_emitter(".lex", lexEmitter) # Objective-C cxx_file.add_action(".lm", LexAction) cxx_file.add_emitter(".lm", lexEmitter) # C++ cxx_file.add_action(".ll", LexAction) cxx_file.add_emitter(".ll", lexEmitter) env["LEX"] = env.Detect("flex") or "lex" env["LEXFLAGS"] = SCons.Util.CLVar("") env["LEXCOM"] = "$LEX $LEXFLAGS -t $SOURCES > $TARGET" def exists(env): return env.Detect(["flex", "lex"]) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/msvs.xml0000664000175000017500000005632113160023044021174 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for Microsoft Visual Studio. MSVSPROJECTCOM MSVSSOLUTIONCOM MSVSSCONSCRIPT MSVSSCONS MSVSSCONSFLAGS MSVSSCONSCOM MSVSBUILDCOM MSVSREBUILDCOM MSVSCLEANCOM MSVSENCODING Builds a Microsoft Visual Studio project file, and by default builds a solution file as well. This builds a Visual Studio project file, based on the version of Visual Studio that is configured (either the latest installed version, or the version specified by &cv-link-MSVS_VERSION; in the Environment constructor). For Visual Studio 6, it will generate a .dsp file. For Visual Studio 7 (.NET) and later versions, it will generate a .vcproj file. By default, this also generates a solution file for the specified project, a .dsw file for Visual Studio 6 or a .sln file for Visual Studio 7 (.NET). This behavior may be disabled by specifying auto_build_solution=0 when you call &b-MSVSProject;, in which case you presumably want to build the solution file(s) by calling the &b-MSVSSolution; Builder (see below). The &b-MSVSProject; builder takes several lists of filenames to be placed into the project file. These are currently limited to srcs, incs, localincs, resources, and misc. These are pretty self-explanatory, but it should be noted that these lists are added to the &cv-link-SOURCES; construction variable as strings, NOT as SCons File Nodes. This is because they represent file names to be added to the project file, not the source files used to build the project file. The above filename lists are all optional, although at least one must be specified for the resulting project file to be non-empty. In addition to the above lists of values, the following values may be specified: target The name of the target .dsp or .vcproj file. The correct suffix for the version of Visual Studio must be used, but the &cv-link-MSVSPROJECTSUFFIX; construction variable will be defined to the correct value (see example below). variant The name of this particular variant. For Visual Studio 7 projects, this can also be a list of variant names. These are typically things like "Debug" or "Release", but really can be anything you want. For Visual Studio 7 projects, they may also specify a target platform separated from the variant name by a | (vertical pipe) character: Debug|Xbox. The default target platform is Win32. Multiple calls to &b-MSVSProject; with different variants are allowed; all variants will be added to the project file with their appropriate build targets and sources. cmdargs Additional command line arguments for the different variants. The number of cmdargs entries must match the number of variant entries, or be empty (not specified). If you give only one, it will automatically be propagated to all variants. buildtarget An optional string, node, or list of strings or nodes (one per build variant), to tell the Visual Studio debugger what output target to use in what build variant. The number of buildtarget entries must match the number of variant entries. runfile The name of the file that Visual Studio 7 and later will run and debug. This appears as the value of the Output field in the resulting Visual Studio project file. If this is not specified, the default is the same as the specified buildtarget value. Note that because &SCons; always executes its build commands from the directory in which the &SConstruct; file is located, if you generate a project file in a different directory than the &SConstruct; directory, users will not be able to double-click on the file name in compilation error messages displayed in the Visual Studio console output window. This can be remedied by adding the Visual C/C++ /FC compiler option to the &cv-link-CCFLAGS; variable so that the compiler will print the full path name of any files that cause compilation errors. Example usage: barsrcs = ['bar.cpp'] barincs = ['bar.h'] barlocalincs = ['StdAfx.h'] barresources = ['bar.rc','resource.h'] barmisc = ['bar_readme.txt'] dll = env.SharedLibrary(target = 'bar.dll', source = barsrcs) buildtarget = [s for s in dll if str(s).endswith('dll')] env.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'], srcs = barsrcs, incs = barincs, localincs = barlocalincs, resources = barresources, misc = barmisc, buildtarget = buildtarget, variant = 'Release') Starting with version 2.4 of SCons it's also possible to specify the optional argument DebugSettings, which creates files for debugging under Visual Studio: DebugSettings A dictionary of debug settings that get written to the .vcproj.user or the .vcxproj.user file, depending on the version installed. As it is done for cmdargs (see above), you can specify a DebugSettings dictionary per variant. If you give only one, it will be propagated to all variants. Currently, only Visual Studio v9.0 and Visual Studio version v11 are implemented, for other versions no file is generated. To generate the user file, you just need to add a DebugSettings dictionary to the environment with the right parameters for your MSVS version. If the dictionary is empty, or does not contain any good value, no file will be generated.Following is a more contrived example, involving the setup of a project for variants and DebugSettings:# Assuming you store your defaults in a file vars = Variables('variables.py') msvcver = vars.args.get('vc', '9') # Check command args to force one Microsoft Visual Studio version if msvcver == '9' or msvcver == '11': env = Environment(MSVC_VERSION=msvcver+'.0', MSVC_BATCH=False) else: env = Environment() AddOption('--userfile', action='store_true', dest='userfile', default=False, help="Create Visual Studio Project user file") # # 1. Configure your Debug Setting dictionary with options you want in the list # of allowed options, for instance if you want to create a user file to launch # a specific application for testing your dll with Microsoft Visual Studio 2008 (v9): # V9DebugSettings = { 'Command':'c:\\myapp\\using\\thisdll.exe', 'WorkingDirectory': 'c:\\myapp\\using\\', 'CommandArguments': '-p password', # 'Attach':'false', # 'DebuggerType':'3', # 'Remote':'1', # 'RemoteMachine': None, # 'RemoteCommand': None, # 'HttpUrl': None, # 'PDBPath': None, # 'SQLDebugging': None, # 'Environment': '', # 'EnvironmentMerge':'true', # 'DebuggerFlavor': None, # 'MPIRunCommand': None, # 'MPIRunArguments': None, # 'MPIRunWorkingDirectory': None, # 'ApplicationCommand': None, # 'ApplicationArguments': None, # 'ShimCommand': None, # 'MPIAcceptMode': None, # 'MPIAcceptFilter': None, } # # 2. Because there are a lot of different options depending on the Microsoft # Visual Studio version, if you use more than one version you have to # define a dictionary per version, for instance if you want to create a user # file to launch a specific application for testing your dll with Microsoft # Visual Studio 2012 (v11): # V10DebugSettings = { 'LocalDebuggerCommand': 'c:\\myapp\\using\\thisdll.exe', 'LocalDebuggerWorkingDirectory': 'c:\\myapp\\using\\', 'LocalDebuggerCommandArguments': '-p password', # 'LocalDebuggerEnvironment': None, # 'DebuggerFlavor': 'WindowsLocalDebugger', # 'LocalDebuggerAttach': None, # 'LocalDebuggerDebuggerType': None, # 'LocalDebuggerMergeEnvironment': None, # 'LocalDebuggerSQLDebugging': None, # 'RemoteDebuggerCommand': None, # 'RemoteDebuggerCommandArguments': None, # 'RemoteDebuggerWorkingDirectory': None, # 'RemoteDebuggerServerName': None, # 'RemoteDebuggerConnection': None, # 'RemoteDebuggerDebuggerType': None, # 'RemoteDebuggerAttach': None, # 'RemoteDebuggerSQLDebugging': None, # 'DeploymentDirectory': None, # 'AdditionalFiles': None, # 'RemoteDebuggerDeployDebugCppRuntime': None, # 'WebBrowserDebuggerHttpUrl': None, # 'WebBrowserDebuggerDebuggerType': None, # 'WebServiceDebuggerHttpUrl': None, # 'WebServiceDebuggerDebuggerType': None, # 'WebServiceDebuggerSQLDebugging': None, } # # 3. Select the dictionary you want depending on the version of visual Studio # Files you want to generate. # if not env.GetOption('userfile'): dbgSettings = None elif env.get('MSVC_VERSION', None) == '9.0': dbgSettings = V9DebugSettings elif env.get('MSVC_VERSION', None) == '11.0': dbgSettings = V10DebugSettings else: dbgSettings = None # # 4. Add the dictionary to the DebugSettings keyword. # barsrcs = ['bar.cpp', 'dllmain.cpp', 'stdafx.cpp'] barincs = ['targetver.h'] barlocalincs = ['StdAfx.h'] barresources = ['bar.rc','resource.h'] barmisc = ['ReadMe.txt'] dll = env.SharedLibrary(target = 'bar.dll', source = barsrcs) env.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'], srcs = barsrcs, incs = barincs, localincs = barlocalincs, resources = barresources, misc = barmisc, buildtarget = [dll[0]] * 2, variant = ('Debug|Win32', 'Release|Win32'), cmdargs = 'vc=%s' % msvcver, DebugSettings = (dbgSettings, {})) Builds a Microsoft Visual Studio solution file. This builds a Visual Studio solution file, based on the version of Visual Studio that is configured (either the latest installed version, or the version specified by &cv-link-MSVS_VERSION; in the construction environment). For Visual Studio 6, it will generate a .dsw file. For Visual Studio 7 (.NET), it will generate a .sln file. The following values must be specified: target The name of the target .dsw or .sln file. The correct suffix for the version of Visual Studio must be used, but the value &cv-link-MSVSSOLUTIONSUFFIX; will be defined to the correct value (see example below). variant The name of this particular variant, or a list of variant names (the latter is only supported for MSVS 7 solutions). These are typically things like "Debug" or "Release", but really can be anything you want. For MSVS 7 they may also specify target platform, like this "Debug|Xbox". Default platform is Win32. projects A list of project file names, or Project nodes returned by calls to the &b-MSVSProject; Builder, to be placed into the solution file. It should be noted that these file names are NOT added to the $SOURCES environment variable in form of files, but rather as strings. This is because they represent file names to be added to the solution file, not the source files used to build the solution file. Example Usage: env.MSVSSolution(target = 'Bar' + env['MSVSSOLUTIONSUFFIX'], projects = ['bar' + env['MSVSPROJECTSUFFIX']], variant = 'Release') When the Microsoft Visual Studio tools are initialized, they set up this dictionary with the following keys: VERSION the version of MSVS being used (can be set via &cv-link-MSVS_VERSION;) VERSIONS the available versions of MSVS installed VCINSTALLDIR installed directory of Visual C++ VSINSTALLDIR installed directory of Visual Studio FRAMEWORKDIR installed directory of the .NET framework FRAMEWORKVERSIONS list of installed versions of the .NET framework, sorted latest to oldest. FRAMEWORKVERSION latest installed version of the .NET framework FRAMEWORKSDKDIR installed location of the .NET SDK. PLATFORMSDKDIR installed location of the Platform SDK. PLATFORMSDK_MODULES dictionary of installed Platform SDK modules, where the dictionary keys are keywords for the various modules, and the values are 2-tuples where the first is the release date, and the second is the version number. If a value isn't set, it wasn't available in the registry. Sets the architecture for which the generated project(s) should build. The default value is x86. amd64 is also supported by &SCons; for some Visual Studio versions. Trying to set &cv-MSVS_ARCH; to an architecture that's not supported for a given Visual Studio version will generate an error. The string placed in a generated Microsoft Visual Studio project file as the value of the ProjectGUID attribute. There is no default value. If not defined, a new GUID is generated. The path name placed in a generated Microsoft Visual Studio project file as the value of the SccAuxPath attribute if the MSVS_SCC_PROVIDER construction variable is also set. There is no default value. The root path of projects in your SCC workspace, i.e the path under which all project and solution files will be generated. It is used as a reference path from which the relative paths of the generated Microsoft Visual Studio project and solution files are computed. The relative project file path is placed as the value of the SccLocalPath attribute of the project file and as the values of the SccProjectFilePathRelativizedFromConnection[i] (where [i] ranges from 0 to the number of projects in the solution) attributes of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file. Similarly the relative solution file path is placed as the values of the SccLocalPath[i] (where [i] ranges from 0 to the number of projects in the solution) attributes of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file. This is used only if the MSVS_SCC_PROVIDER construction variable is also set. The default value is the current working directory. The project name placed in a generated Microsoft Visual Studio project file as the value of the SccProjectName attribute if the MSVS_SCC_PROVIDER construction variable is also set. In this case the string is also placed in the SccProjectName0 attribute of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file. There is no default value. The string placed in a generated Microsoft Visual Studio project file as the value of the SccProvider attribute. The string is also placed in the SccProvider0 attribute of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file. There is no default value. Sets the preferred version of Microsoft Visual Studio to use. If &cv-MSVS_VERSION; is not set, &SCons; will (by default) select the latest version of Visual Studio installed on your system. So, if you have version 6 and version 7 (MSVS .NET) installed, it will prefer version 7. You can override this by specifying the MSVS_VERSION variable in the Environment initialization, setting it to the appropriate version ('6.0' or '7.0', for example). If the specified version isn't installed, tool initialization will fail. This is obsolete: use &cv-MSVC_VERSION; instead. If &cv-MSVS_VERSION; is set and &cv-MSVC_VERSION; is not, &cv-MSVC_VERSION; will be set automatically to &cv-MSVS_VERSION;. If both are set to different values, scons will raise an error. The build command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with any specified build targets. The clean command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with the -c option to remove any specified targets. The encoding string placed in a generated Microsoft Visual Studio project file. The default is encoding Windows-1252. The action used to generate Microsoft Visual Studio project files. The suffix used for Microsoft Visual Studio project (DSP) files. The default value is .vcproj when using Visual Studio version 7.x (.NET) or later version, and .dsp when using earlier versions of Visual Studio. The rebuild command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with any specified rebuild targets. The SCons used in generated Microsoft Visual Studio project files. The default is the version of SCons being used to generate the project file. The SCons flags used in generated Microsoft Visual Studio project files. The default SCons command used in generated Microsoft Visual Studio project files. The sconscript file (that is, &SConstruct; or &SConscript; file) that will be invoked by Visual Studio project files (through the &cv-link-MSVSSCONSCOM; variable). The default is the same sconscript file that contains the call to &b-MSVSProject; to build the project file. The action used to generate Microsoft Visual Studio solution files. The suffix used for Microsoft Visual Studio solution (DSW) files. The default value is .sln when using Visual Studio version 7.x (.NET), and .dsw when using earlier versions of Visual Studio. The (optional) path to the SCons library directory, initialized from the external environment. If set, this is used to construct a shorter and more efficient search path in the &cv-link-MSVSSCONS; command line executed from Microsoft Visual Studio project files. scons-src-3.0.0/src/engine/SCons/Tool/docbook/0000775000175000017500000000000013160023044021073 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/0000775000175000017500000000000013160023044024047 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/AUTHORS0000664000175000017500000000021713160023041025114 0ustar bdbaddogbdbaddogThe DocBook XSL stylesheets are maintained by Norman Walsh, , and members of the DocBook Project, scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/0000775000175000017500000000000013160023043025331 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/htmlhelp/0000775000175000017500000000000013160023043027146 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/htmlhelp/htmlhelp.xsl0000664000175000017500000000615613160023043031523 0ustar bdbaddogbdbaddog '> ]>
  • &lf; &lf;
  • &lf;
      &lf;
    &lf;
  • &lf; &lf;
  • &lf;
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/0000775000175000017500000000000013160023043026465 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/jscript.xsl0000664000175000017500000001054013160023043030673 0ustar bdbaddogbdbaddog / / http://docbook.sourceforge.net/release/slides/browser/ scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/css.xsl0000664000175000017500000000317313160023043030011 0ustar bdbaddogbdbaddog / / http://docbook.sourceforge.net/release/slides/browser/ scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/flat.xsl0000664000175000017500000000350213160023043030143 0ustar bdbaddogbdbaddog <xsl:value-of select="/slides/slidesinfo/title"/>

    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/param.xsl0000664000175000017500000000667713160023043030335 0ustar bdbaddogbdbaddog #FFFFFF toc/bullet.png slides.css hidetoc.gif active/nav-home.png toc/open.png white 40 white active/nav-next.png inactive/nav-home.png inactive/nav-next.png inactive/nav-prev.png inactive/nav-toc.png inactive/nav-up.png no overlay.js http://docbook.sourceforge.net/release/buttons/slides-1.png toc/closed.png active/nav-prev.png showtoc.gif slides.js Home Next Prev ToC Up #FFFFFF active/nav-toc.png 22 250 ua.js active/nav-up.png xbCollapsibleLists.js xbDOM.js xbStyle.js xbLibrary.js scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/w3c.xsl0000664000175000017500000003156713160023043027725 0ustar bdbaddogbdbaddog {$logo.title} position: absolute; visibility: visible;
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/vslides.xsl0000664000175000017500000005267313160023043030703 0ustar bdbaddogbdbaddog <xsl:value-of select="slidesinfo/title"/> navigate(event)
     
     
    <xsl:value-of select="title"/> navigate(event)
     
     
    <xsl:value-of select="title"/> navigate(event)
     
     
    <xsl:value-of select="title"/> navigate(event)
     
     
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/frames.xsl0000664000175000017500000022037113160023043030477 0ustar bdbaddogbdbaddog -//W3C//DTD HTML 4.01 Frameset//EN -//W3C//DTD XHTML 1.0 Frameset//EN -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/html4/loose.dtd http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd Multiframe and overlay are mutually exclusive. <xsl:value-of select="$title"/> <body class="frameset"> <xsl:call-template name="body.attributes"/> <a href="{concat('titleframe', $html.ext)}"> <xsl:text>Your browser doesn't support frames.</xsl:text> </a> </body> TOC - <xsl:value-of select="$title"/> overlaySetup('ll'); init( ); overlaySetup('ll');
    logo
    <xsl:value-of select="title"/> javascript:body.focus() <body class="frameset"> <xsl:call-template name="body.attributes"/> <p> <xsl:text>Your browser doesn't support frames.</xsl:text> </p> </body> Navigation Body Navigation newPage(' ', ); overlaySetup('lc'); this.focus() navigate(event)
    <xsl:value-of select="title"/> foilgroup javascript:body.focus() <body class="frameset"> <xsl:call-template name="body.attributes"/> <p> <xsl:text>Your browser doesn't support frames.</xsl:text> </p> </body> foilgroup Navigation foilgroup Body foilgroup Navigation newPage(' ', ); overlaySetup('lc'); navigate(event)
    position:absolute;visibility:visible;
    <xsl:value-of select="title"/> javascript:body.focus() <body class="frameset"> <xsl:call-template name="body.attributes"/> <p> <xsl:text>Your browser doesn't support frames.</xsl:text> </p> </body> Navigation Body Navigation newPage(' ', ); overlaySetup('lc'); navigate(event)
    position:absolute;visibility:visible;
    foilgroup myList.addItem(' <div id=" " class="toc-slidesinfo"> <a href=" " target="foil"> ' \' <\/a><\/div> '); subList = new List(false, width, height, " "); subList.setIndent(12); myList.addList(subList, ' <div id=" " class="toc-foilgroup"> <a href=" " target="foil"> ' \' <\/a><\/div> '); subList.addItem(' myList.addItem(' <div id=" " class="toc-foil"> <img alt="-" src=" "><\/img> <a href=" " target="foil"> ' \' <\/a><\/div> '); scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/graphics.xsl0000664000175000017500000001204713160023043031021 0ustar bdbaddogbdbaddog / / http://docbook.sourceforge.net/release/slides/graphics/ scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/plain.xsl0000664000175000017500000003773413160023043030336 0ustar bdbaddogbdbaddog scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/slides-common.xsl0000664000175000017500000014466113160023043032002 0ustar bdbaddogbdbaddog <xsl:value-of select="title"/> titlepage - overlaySetup('lc') navigate(event)

    : <xsl:value-of select="slidesinfo/title"/> overlaySetup('lc') navigate(event)

    TableofContents

    .
    .
    <xsl:value-of select="title"/> - overlaySetup('lc') navigate(event)

    <xsl:value-of select="title"/> - overlaySetup('lc') navigate(event)

    position: absolute; visibility: visible; padding-top: 2in; foil foilgroup </span> <span class="green" class="blue" class="orange" class="red" class="brown" class="violet" class="black" class="bold" >

    copyright ( )

    1 1 1 0 0 / foil foilgroup chunk-filename-error- /  
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/tables.xsl0000664000175000017500000002505413160023043030475 0ustar bdbaddogbdbaddog #6A719C 220
     
     
    +



     +
    +
     
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/xhtml/default.xsl0000664000175000017500000001750613160023043030652 0ustar bdbaddogbdbaddog Hide/Show TOC toggletoc(this, ,' ',' '); scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/0000775000175000017500000000000013160023043026275 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/jscript.xsl0000664000175000017500000001011613160023043030502 0ustar bdbaddogbdbaddog / / http://docbook.sourceforge.net/release/slides/browser/ scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/css.xsl0000664000175000017500000000277213160023043027625 0ustar bdbaddogbdbaddog / / http://docbook.sourceforge.net/release/slides/browser/ scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/flat.xsl0000664000175000017500000000330113160023043027750 0ustar bdbaddogbdbaddog <xsl:value-of select="/slides/slidesinfo/title"/>

    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/param.xsl0000664000175000017500000000647713160023043030143 0ustar bdbaddogbdbaddog #FFFFFF toc/bullet.png slides.css hidetoc.gif active/nav-home.png toc/open.png white 40 white active/nav-next.png inactive/nav-home.png inactive/nav-next.png inactive/nav-prev.png inactive/nav-toc.png inactive/nav-up.png no overlay.js http://docbook.sourceforge.net/release/buttons/slides-1.png toc/closed.png active/nav-prev.png showtoc.gif slides.js Home Next Prev ToC Up #FFFFFF active/nav-toc.png 22 250 ua.js active/nav-up.png xbCollapsibleLists.js xbDOM.js xbStyle.js xbLibrary.js scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/w3c.xsl0000664000175000017500000003171713160023043027532 0ustar bdbaddogbdbaddog {$logo.title} position: absolute; visibility: visible;
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/vslides.xsl0000664000175000017500000005267013160023043030510 0ustar bdbaddogbdbaddog <xsl:value-of select="slidesinfo/title"/> navigate(event)
     
     
    <xsl:value-of select="title"/> navigate(event)
     
     
    <xsl:value-of select="title"/> navigate(event)
     
     
    <xsl:value-of select="title"/> navigate(event)
     
     
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/frames.xsl0000664000175000017500000022037513160023043030313 0ustar bdbaddogbdbaddog -//W3C//DTD HTML 4.01 Frameset//EN -//W3C//DTD XHTML 1.0 Frameset//EN -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/html4/loose.dtd http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd Multiframe and overlay are mutually exclusive. <xsl:value-of select="$title"/> <body class="frameset"> <xsl:call-template name="body.attributes"/> <a href="{concat('titleframe', $html.ext)}"> <xsl:text>Your browser doesn't support frames.</xsl:text> </a> </body> TOC - <xsl:value-of select="$title"/> overlaySetup('ll'); init( ); overlaySetup('ll');
    logo
    <xsl:value-of select="title"/> javascript:body.focus() <body class="frameset"> <xsl:call-template name="body.attributes"/> <p> <xsl:text>Your browser doesn't support frames.</xsl:text> </p> </body> Navigation Body Navigation newPage(' ', ); overlaySetup('lc'); this.focus() navigate(event)
    <xsl:value-of select="title"/> foilgroup javascript:body.focus() <body class="frameset"> <xsl:call-template name="body.attributes"/> <p> <xsl:text>Your browser doesn't support frames.</xsl:text> </p> </body> foilgroup Navigation foilgroup Body foilgroup Navigation newPage(' ', ); overlaySetup('lc'); navigate(event)
    position:absolute;visibility:visible;
    <xsl:value-of select="title"/> javascript:body.focus() <body class="frameset"> <xsl:call-template name="body.attributes"/> <p> <xsl:text>Your browser doesn't support frames.</xsl:text> </p> </body> Navigation Body Navigation newPage(' ', ); overlaySetup('lc'); navigate(event)
    position:absolute;visibility:visible;
    foilgroup myList.addItem(' <div id=" " class="toc-slidesinfo"> <a href=" " target="foil"> ' \' <\/a><\/div> '); subList = new List(false, width, height, " "); subList.setIndent(12); myList.addList(subList, ' <div id=" " class="toc-foilgroup"> <a href=" " target="foil"> ' \' <\/a><\/div> '); subList.addItem(' myList.addItem(' <div id=" " class="toc-foil"> <img alt="-" src=" "><\/img> <a href=" " target="foil"> ' \' <\/a><\/div> '); scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/graphics.xsl0000664000175000017500000001164613160023043030635 0ustar bdbaddogbdbaddog / / http://docbook.sourceforge.net/release/slides/graphics/ scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/plain.xsl0000664000175000017500000003762113160023043030141 0ustar bdbaddogbdbaddog scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/slides-common.xsl0000664000175000017500000014423713160023043031611 0ustar bdbaddogbdbaddog <xsl:value-of select="title"/> titlepage - overlaySetup('lc') navigate(event)

    : <xsl:value-of select="slidesinfo/title"/> overlaySetup('lc') navigate(event)

    TableofContents

    .
    .
    <xsl:value-of select="title"/> - overlaySetup('lc') navigate(event)

    <xsl:value-of select="title"/> - overlaySetup('lc') navigate(event)

    position: absolute; visibility: visible; padding-top: 2in; foil foilgroup </span> <span class="green" class="blue" class="orange" class="red" class="brown" class="violet" class="black" class="bold" >

    copyright ( )

    1 1 1 0 0 / foil foilgroup chunk-filename-error- /  
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/param.xml0000664000175000017500000011704613160023043030130 0ustar bdbaddogbdbaddog Slides HTML Parameter Reference $Id: param.xweb 6633 2007-02-21 18:33:33Z xmldoc $ Walsh Norman 2002 Norman Walsh This is reference documentation for all user-configurable parameters in the DocBook XSL Slides HTML stylesheet (for generating HTML slide presentations). Note that the Slides stylesheet for HTML output is a customization layer of the DocBook XSL HTML stylesheet. Therefore, in addition to the slides-specific parameters listed in this section, you can also use a number of HTML stylesheet parameters to control Slides HTML output. HTML: General Parameters keyboard.nav boolean keyboard.nav Enable keyboard navigation? <xsl:param name="keyboard.nav" select="1"></xsl:param> Description If non-zero, JavaScript is added to the slides to enable keyboard navigation. Pressing 'n', space, or return moves forward; pressing 'p' moves backward. css.stylesheet uri css.stylesheet CSS stylesheet for slides <xsl:param name="css.stylesheet">slides.css</xsl:param> Description Identifies the CSS stylesheet used by all the slides. This parameter can be set in the source document with the <?dbhtml?> pseudo-attribute css-stylesheet. css.stylesheet.dir uri css.stylesheet.dir Default directory for CSS stylesheets <xsl:param name="css.stylesheet.dir"></xsl:param> Description Identifies the default directory for the CSS stylesheet generated on all the slides. This parameter can be set in the source document with the <?dbhtml?> pseudo-attribute css-stylesheet-dir. If non-empty, this value is prepended to each of the stylesheets. titlefoil.html filename titlefoil.html Name of title foil HTML file <xsl:param name="titlefoil.html" select="concat('index', $html.ext)"></xsl:param> Description Sets the filename used for the slides titlepage. toc.html filename toc.html Name of ToC HTML file <xsl:param name="toc.html" select="concat('toc', $html.ext)"></xsl:param> Description Sets the filename used for the table of contents page. foilgroup.toc boolean foilgroup.toc Put ToC on foilgroup pages? <xsl:param name="foilgroup.toc" select="1"></xsl:param> Description If non-zero, a ToC will be placed on foilgroup pages (after any other content). output.indent list no yes output.indent Indent output? <xsl:param name="output.indent">no</xsl:param> Description Specifies the setting of the indent parameter on the HTML slides. For more information, see the discussion of the xsl:output element in the XSLT specification. Select from yes or no. overlay boolean overlay Overlay footer navigation? <xsl:param name="overlay" select="0"></xsl:param> Description If non-zero, JavaScript is added to the slides to make the bottom navigation appear at the bottom of each page. This option and multiframe are mutually exclusive. If this parameter is zero, the bottom navigation simply appears below the content of each slide. show.foil.number boolean show.foil.number Show foil number on each foil? <xsl:param name="show.foil.number" select="0"></xsl:param> Description If non-zero, on each slide there will be its number. Currently not supported in all output formats. HTML: Frames Parameters nav.separator boolean nav.separator Output separator between navigation and body? <xsl:param name="nav.separator" select="1"></xsl:param> Description If non-zero, a separator (<HR>) is added between the navigation links and the content of each slide. toc.row.height length toc.row.height Height of ToC rows in dynamic ToCs <xsl:param name="toc.row.height">22</xsl:param> Description This parameter specifies the height of each row in the table of contents. This is only applicable if a dynamic ToC is used. You may want to adjust this parameter for optimal appearance with the font and image sizes selected by your CSS stylesheet. toc.bg.color color toc.bg.color Background color for ToC frame <xsl:param name="toc.bg.color">#FFFFFF</xsl:param> Description Specifies the background color used in the ToC frame. body.bg.color color body.bg.color Background color for body frame <xsl:param name="body.bg.color">#FFFFFF</xsl:param> Description Specifies the background color used in the body column of tabular slides. toc.width length toc.width Width of ToC frame <xsl:param name="toc.width">250</xsl:param> <!-- Presumably in pixels? --> Description Specifies the width of the ToC frame in pixels. toc.hide.show boolean toc.hide.show Enable hide/show button for ToC frame <xsl:param name="toc.hide.show" select="0"></xsl:param> Description If non-zero, JavaScript (and an additional icon, see hidetoc.image and showtoc.image) is added to each slide to allow the ToC panel to be toggled on each panel. There is a bug in Mozilla 1.0 (at least as of CR3) that causes the browser to reload the titlepage when this feature is used. dynamic.toc boolean dynamic.toc Dynamic ToCs? <xsl:param name="dynamic.toc" select="0"></xsl:param> Description If non-zero, JavaScript is used to make the ToC panel dynamic. In a dynamic ToC, each section in the ToC can be expanded and collapsed by clicking on the appropriate image. active.toc boolean active.toc Active ToCs? <xsl:param name="active.toc" select="0"></xsl:param> Description If non-zero, JavaScript is used to keep the ToC and the current slide in sync. That is, each time the slide changes, the corresponding ToC entry will be underlined. overlay.logo uri overlay.logo Logo to overlay on ToC frame <xsl:param name="overlay.logo">http://docbook.sourceforge.net/release/buttons/slides-1.png</xsl:param> Description If this URI is non-empty, JavaScript is used to overlay the specified image on the ToC frame. multiframe boolean multiframe Use multiple frames for slide bodies? <xsl:param name="multiframe" select="0"></xsl:param> Description If non-zero, multiple frames are used for the body of each slide. This is one way of forcing the slide navigation elements to appear in constant locations. The other way is with overlays. The overlay and multiframe parameters are mutually exclusive. multiframe.top.bgcolor color multiframe.top.bgcolor Background color for top navigation frame <xsl:param name="multiframe.top.bgcolor">white</xsl:param> Description Specifies the background color of the top navigation frame when multiframe is enabled. multiframe.bottom.bgcolor color multiframe.bottom.bgcolor Background color for bottom navigation frame <xsl:param name="multiframe.bottom.bgcolor">white</xsl:param> Description Specifies the background color of the bottom navigation frame when multiframe is enabled. multiframe.navigation.height length multiframe.navigation.height Height of navigation frames <xsl:param name="multiframe.navigation.height">40</xsl:param> Description Specifies the height of the navigation frames in pixels when multiframe is enabled. HTML: Graphics Parameters graphics.dir uri graphics.dir Graphics directory <xsl:param name="graphics.dir"></xsl:param> Description Identifies the graphics directory for the navigation components generated on all the slides. This parameter can be set in the source document with the <?dbhtml?> pseudo-attribute graphics-dir. If non-empty, this value is prepended to each of the graphic image paths. bullet.image filename bullet.image Bullet image <xsl:param name="bullet.image">toc/bullet.png</xsl:param> Description Specifies the filename of the bullet image used for foils in the framed ToC. next.image filename next.image Right-arrow image <xsl:param name="next.image">active/nav-next.png</xsl:param> Description Specifies the filename of the right-pointing navigation arrow. prev.image filename prev.image Left-arrow image <xsl:param name="prev.image">active/nav-prev.png</xsl:param> Description Specifies the filename of the left-pointing navigation arrow. up.image filename up.image Up-arrow image <xsl:param name="up.image">active/nav-up.png</xsl:param> Description Specifies the filename of the upward-pointing navigation arrow. home.image filename home.image Home image <xsl:param name="home.image">active/nav-home.png</xsl:param> Description Specifies the filename of the home navigation icon. toc.image filename toc.image ToC image <xsl:param name="toc.image">active/nav-toc.png</xsl:param> Description Specifies the filename of the ToC navigation icon. no.next.image filename no.next.image Inactive right-arrow image <xsl:param name="no.next.image">inactive/nav-next.png</xsl:param> Description Specifies the filename of the inactive right-pointing navigation arrow. no.prev.image filename no.prev.image Inactive left-arrow image <xsl:param name="no.prev.image">inactive/nav-prev.png</xsl:param> Description Specifies the filename of the inactive left-pointing navigation arrow. no.up.image filename no.up.image Inactive up-arrow image <xsl:param name="no.up.image">inactive/nav-up.png</xsl:param> Description Specifies the filename of the inactive upward-pointing navigation arrow. no.home.image filename no.home.image Inactive home image <xsl:param name="no.home.image">inactive/nav-home.png</xsl:param> Description Specifies the filename of the inactive home navigation icon. no.toc.image filename no.toc.image Inactive ToC image <xsl:param name="no.toc.image">inactive/nav-toc.png</xsl:param> Description Specifies the filename of the inactive ToC navigation icon. plus.image filename plus.image Plus image <xsl:param name="plus.image">toc/closed.png</xsl:param> Description Specifies the filename of the plus image; the image used in a dynamic ToC to indicate that a section can be expanded. minus.image filename minus.image Minus image <xsl:param name="minus.image">toc/open.png</xsl:param> Description Specifies the filename of the minus image; the image used in a dynamic ToC to indicate that a section can be collapsed. hidetoc.image filename hidetoc.image Hide ToC image <xsl:param name="hidetoc.image">hidetoc.gif</xsl:param> Description Specifies the filename of the hide ToC image. This is used when the ToC hide/show parameter is enabled. showtoc.image filename showtoc.image Show ToC image <xsl:param name="showtoc.image">showtoc.gif</xsl:param> Description Specifies the filename of the show ToC image. This is used when the ToC hide/show parameter is enabled. HTML: JavaScript Parameters script.dir uri script.dir Script directory <xsl:param name="script.dir"></xsl:param> Description Identifies the JavaScript source directory for the slides. This parameter can be set in the source document with the <?dbhtml?> pseudo-attribute script-dir. If non-empty, this value is prepended to each of the JavaScript files. ua.js filename ua.js UA JavaScript file <xsl:param name="ua.js">ua.js</xsl:param> Description Specifies the filename of the UA JavaScript file. It's unlikely that you will ever need to change this parameter. xbDOM.js filename xbDOM.js xbDOM JavaScript file <xsl:param name="xbDOM.js">xbDOM.js</xsl:param> Description Specifies the filename of the xbDOM JavaScript file. It's unlikely that you will ever need to change this parameter. xbStyle.js filename xbStyle.js xbStyle JavaScript file <xsl:param name="xbStyle.js">xbStyle.js</xsl:param> Description Specifies the filename of the xbStyle JavaScript file. It's unlikely that you will ever need to change this parameter. xbLibrary.js filename xbLibrary.js xbLibrary JavaScript file <xsl:param name="xbLibrary.js">xbLibrary.js</xsl:param> Description Specifies the filename of the xbLibrary JavaScript file. It's unlikely that you will ever need to change this parameter. xbCollapsibleLists.js filename xbCollapsibleLists.js xbCollapsibleLists JavaScript file <xsl:param name="xbCollapsibleLists.js">xbCollapsibleLists.js</xsl:param> Description Specifies the filename of the xbCollapsibleLists JavaScript file. It's unlikely that you will ever need to change this parameter. overlay.js filename overlay.js Overlay JavaScript file <xsl:param name="overlay.js">overlay.js</xsl:param> Description Specifies the filename of the overlay JavaScript file. It's unlikely that you will ever need to change this parameter. slides.js filename slides.js Slides overlay file <xsl:param name="slides.js">slides.js</xsl:param> Description Specifies the filename of the slides JavaScript file. It's unlikely that you will ever need to change this parameter. HTML: Localization Parameters text.home string text.home Home <xsl:param name="text.home">Home</xsl:param> Description FIXME: text.toc string text.toc FIXME: <xsl:param name="text.toc">ToC</xsl:param> Description FIXME: text.prev string text.prev FIXME: <xsl:param name="text.prev">Prev</xsl:param> Description FIXME: text.up string text.up FIXME: <xsl:param name="text.up">Up</xsl:param> Description FIXME: text.next string text.next FIXME: <xsl:param name="text.next">Next</xsl:param> Description FIXME: The Stylesheet The param.xsl stylesheet is just a wrapper around all these parameters. <!-- This file is generated from param.xweb --> <xsl:stylesheet exclude-result-prefixes="src" version="1.0"> <!-- ******************************************************************** $Id: param.xweb 6633 2007-02-21 18:33:33Z xmldoc $ ******************************************************************** This file is part of the DocBook Slides Stylesheet distribution. See ../README or http://docbook.sf.net/release/xsl/current/ for copyright and other information. ******************************************************************** --> <src:fragref linkend="active.toc.frag"></src:fragref> <src:fragref linkend="body.bg.color.frag"></src:fragref> <src:fragref linkend="bullet.image.frag"></src:fragref> <src:fragref linkend="css.stylesheet.frag"></src:fragref> <src:fragref linkend="css.stylesheet.dir.frag"></src:fragref> <src:fragref linkend="dynamic.toc.frag"></src:fragref> <src:fragref linkend="foilgroup.toc.frag"></src:fragref> <src:fragref linkend="graphics.dir.frag"></src:fragref> <src:fragref linkend="hidetoc.image.frag"></src:fragref> <src:fragref linkend="home.image.frag"></src:fragref> <src:fragref linkend="keyboard.nav.frag"></src:fragref> <src:fragref linkend="minus.image.frag"></src:fragref> <src:fragref linkend="multiframe.bottom.bgcolor.frag"></src:fragref> <src:fragref linkend="multiframe.frag"></src:fragref> <src:fragref linkend="multiframe.navigation.height.frag"></src:fragref> <src:fragref linkend="multiframe.top.bgcolor.frag"></src:fragref> <src:fragref linkend="nav.separator.frag"></src:fragref> <src:fragref linkend="next.image.frag"></src:fragref> <src:fragref linkend="no.home.image.frag"></src:fragref> <src:fragref linkend="no.next.image.frag"></src:fragref> <src:fragref linkend="no.prev.image.frag"></src:fragref> <src:fragref linkend="no.toc.image.frag"></src:fragref> <src:fragref linkend="no.up.image.frag"></src:fragref> <src:fragref linkend="output.indent.frag"></src:fragref> <src:fragref linkend="overlay.frag"></src:fragref> <src:fragref linkend="overlay.js.frag"></src:fragref> <src:fragref linkend="overlay.logo.frag"></src:fragref> <src:fragref linkend="plus.image.frag"></src:fragref> <src:fragref linkend="prev.image.frag"></src:fragref> <src:fragref linkend="script.dir.frag"></src:fragref> <src:fragref linkend="show.foil.number.frag"></src:fragref> <src:fragref linkend="showtoc.image.frag"></src:fragref> <src:fragref linkend="slides.js.frag"></src:fragref> <src:fragref linkend="text.home.frag"></src:fragref> <src:fragref linkend="text.next.frag"></src:fragref> <src:fragref linkend="text.prev.frag"></src:fragref> <src:fragref linkend="text.toc.frag"></src:fragref> <src:fragref linkend="text.up.frag"></src:fragref> <src:fragref linkend="titlefoil.html.frag"></src:fragref> <src:fragref linkend="toc.bg.color.frag"></src:fragref> <src:fragref linkend="toc.hide.show.frag"></src:fragref> <src:fragref linkend="toc.html.frag"></src:fragref> <src:fragref linkend="toc.image.frag"></src:fragref> <src:fragref linkend="toc.row.height.frag"></src:fragref> <src:fragref linkend="toc.width.frag"></src:fragref> <src:fragref linkend="ua.js.frag"></src:fragref> <src:fragref linkend="up.image.frag"></src:fragref> <src:fragref linkend="xbCollapsibleLists.js.frag"></src:fragref> <src:fragref linkend="xbDOM.js.frag"></src:fragref> <src:fragref linkend="xbStyle.js.frag"></src:fragref> <src:fragref linkend="xbLibrary.js.frag"></src:fragref> </xsl:stylesheet> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/tables.xsl0000664000175000017500000002467513160023043030315 0ustar bdbaddogbdbaddog #6A719C 220
     
     
    +



     +
    +
     
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/html/default.xsl0000664000175000017500000001735013160023043030457 0ustar bdbaddogbdbaddog Hide/Show TOC toggletoc(this, ,' ',' '); scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/browser/0000775000175000017500000000000013160023043027014 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/browser/xbLibrary.js0000664000175000017500000000426213160023043031314 0ustar bdbaddogbdbaddog/* * xbLibrary.js * $Revision: 1.3 $ $Date: 2003/03/17 03:44:20 $ */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Bob Clary code. * * The Initial Developer of the Original Code is * Bob Clary. * Portions created by the Initial Developer are Copyright (C) 2000 * the Initial Developer. All Rights Reserved. * * Contributor(s): Bob Clary * * ***** END LICENSE BLOCK ***** */ if (!document.getElementById || navigator.userAgent.indexOf('Opera') != -1) { // assign error handler for downlevel browsers // Note until Opera improves it's overall support // for JavaScript and the DOM, it must be considered downlevel window.onerror = defaultOnError; function defaultOnError(msg, url, line) { // handle bug in NS6.1, N6.2 // where an Event is passed to error handlers if (typeof(msg) != 'string') { msg = 'unknown error'; } if (typeof(url) != 'string') { url = document.location; } alert('An error has occurred at ' + url + ', line ' + line + ': ' + msg); } } function xbLibrary(path) { if (path.charAt(path.length-1) == '/') { path = path.substr(0, path.length-1) } this.path = path; } // dynamically loaded scripts // // it is an error to reference anything from the dynamically loaded file inside the // same script block. This means that a file can not check its dependencies and // load the files for it's own use. someone else must do this. xbLibrary.prototype.loadScript = function (scriptName) { document.write(' ...rest of head...
    ...body of overlay...
    ...rest of page... */ var overlayNS4 = document.layers ? 1 : 0; var overlayIE = document.all ? 1 : 0; var overlayNS6 = document.getElementById && !document.all ? 1 : 0; var overlayPadX = 15; var overlayPadY = 15; var overlayDelay = 60; var overlayCorner = 'ur'; // ul, ll, ur, lr, uc, lc, cl, cr function overlayRefresh() { var overlayLx = 0; var overlayLy = 0; var overlayX = 0; var overlayY = 0; var overlayW = 0; var overlayH = 0; var contentH = 0; var links = document.getElementsByTagName("body")[0]; if (overlayIE) { overlayLx = document.body.clientWidth; overlayLy = document.body.clientHeight; if (document.body.parentElement) { // For IE6 overlayLx = document.body.parentElement.clientWidth; overlayLy = document.body.parentElement.clientHeight; } overlayH = overlayDiv.offsetHeight; overlayW = body.offsetWidth; // overlayDiv.offsetWidth; contentH = body.offsetHeight; } else if (overlayNS4) { overlayLy = window.innerHeight; overlayLx = window.innerWidth; overlayH = document.overlayDiv.clip.height; overlayW = body.clip.width; // document.overlayDiv.clip.width; contentH = body.clip.height; } else if (overlayNS6) { var odiv = document.getElementById('overlayDiv'); overlayLy = window.innerHeight; overlayLx = window.innerWidth; overlayH = odiv.offsetHeight; overlayW = odiv.offsetWidth; // body.offsetWidth; contentH = odiv.offsetHeight; } if (overlayCorner == 'ul') { overlayX = overlayPadX; overlayY = overlayPadY; } else if (overlayCorner == 'cl') { overlayX = overlayPadX; overlayY = (overlayLy - overlayH) / 2; } else if (overlayCorner == 'll') { overlayX = overlayPadX; overlayY = (overlayLy - overlayH) - overlayPadY; } else if (overlayCorner == 'ur') { overlayX = (overlayLx - overlayW) - overlayPadX; overlayY = overlayPadY; } else if (overlayCorner == 'cr') { overlayX = (overlayLx - overlayW) - overlayPadX; overlayY = (overlayLy - overlayH) / 2; } else if (overlayCorner == 'lr') { overlayX = (overlayLx - overlayW) - overlayPadX; overlayY = (overlayLy - overlayH) - overlayPadY; } else if (overlayCorner == 'uc') { overlayX = (overlayLx - overlayW) / 2; overlayY = overlayPadY; } else { // overlayCorner == 'lc' overlayX = (overlayLx - overlayW) / 2; overlayY = (overlayLy - overlayH) - overlayPadY; } if (overlayIE) { overlayDiv.style.left=overlayX; overlayDiv.style.top=overlayY+document.body.scrollTop; if (contentH > overlayLy) { overlayDiv.style.visibility = "hidden"; } } else if (overlayNS4) { document.overlayDiv.pageX=overlayX; document.overlayDiv.pageY=overlayY+window.pageYOffset; document.overlayDiv.visibility="visible"; if (contentH > overlayLy) { document.overlayDiv.style.visibility = "hidden"; } } else if (overlayNS6) { var div = document.getElementById("overlayDiv"); var leftpx = overlayX; var toppx = overlayY+window.pageYOffset; var widthpx = overlayW; div.style.left = leftpx + "px"; div.style.top = toppx + "px"; div.style.width = widthpx + "px"; if (contentH > overlayLy) { div.style.visibility = "hidden"; } else { div.style.visibility = "visible"; } } } function onad() { loopfunc(); } function loopfunc() { overlayRefresh(); setTimeout('loopfunc()',overlayDelay); } function overlaySetup(corner) { overlayCorner = corner; if (overlayIE || overlayNS4 || overlayNS6) { onad(); } } scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/browser/slides-w3c.css0000664000175000017500000000003313160023043031477 0ustar bdbaddogbdbaddog@import url('slides.css'); scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/browser/xbStyle-nn4.js0000664000175000017500000003130413160023043031502 0ustar bdbaddogbdbaddog/* * xbStyle-nn4.js * $Revision: 1.2 $ $Date: 2003/02/07 16:04:22 $ */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Netscape code. * * The Initial Developer of the Original Code is * Netscape Corporation. * Portions created by the Initial Developer are Copyright (C) 2001 * the Initial Developer. All Rights Reserved. * * Contributor(s): Bob Clary * * ***** END LICENSE BLOCK ***** */ ///////////////////////////////////////////////////////////// // xbStyle.getClip() function nsxbStyleGetClip() { var clip = this.styleObj.clip; var rect = new xbClipRect(clip.top, clip.right, clip.bottom, clip.left); return rect.toString(); } ///////////////////////////////////////////////////////////// // xbStyle.setClip() function nsxbStyleSetClip(sClipString) { var rect = new xbClipRect(sClipString); this.styleObj.clip.top = rect.top; this.styleObj.clip.right = rect.right; this.styleObj.clip.bottom = rect.bottom; this.styleObj.clip.left = rect.left; } ///////////////////////////////////////////////////////////// // xbStyle.getClipTop() function nsxbStyleGetClipTop() { return this.styleObj.clip.top; } ///////////////////////////////////////////////////////////// // xbStyle.setClipTop() function nsxbStyleSetClipTop(top) { return this.styleObj.clip.top = top; } ///////////////////////////////////////////////////////////// // xbStyle.getClipRight() function nsxbStyleGetClipRight() { return this.styleObj.clip.right; } ///////////////////////////////////////////////////////////// // xbStyle.setClipRight() function nsxbStyleSetClipRight(right) { return this.styleObj.clip.right = right; } ///////////////////////////////////////////////////////////// // xbStyle.getClipBottom() function nsxbStyleGetClipBottom() { return this.styleObj.clip.bottom; } ///////////////////////////////////////////////////////////// // xbStyle.setClipBottom() function nsxbStyleSetClipBottom(bottom) { return this.styleObj.clip.bottom = bottom; } ///////////////////////////////////////////////////////////// // xbStyle.getClipLeft() function nsxbStyleGetClipLeft() { return this.styleObj.clip.left; } ///////////////////////////////////////////////////////////// // xbStyle.setClipLeft() function nsxbStyleSetClipLeft(left) { return this.styleObj.clip.left = left; } ///////////////////////////////////////////////////////////// // xbStyle.getClipWidth() function nsxbStyleGetClipWidth() { return this.styleObj.clip.width; } ///////////////////////////////////////////////////////////// // xbStyle.setClipWidth() function nsxbStyleSetClipWidth(width) { return this.styleObj.clip.width = width; } ///////////////////////////////////////////////////////////// // xbStyle.getClipHeight() function nsxbStyleGetClipHeight() { return this.styleObj.clip.height; } ///////////////////////////////////////////////////////////// // xbStyle.setClipHeight() function nsxbStyleSetClipHeight(height) { return this.styleObj.clip.height = height; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.getLeft() function nsxbStyleGetLeft() { return this.styleObj.left; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setLeft() function nsxbStyleSetLeft(left) { this.styleObj.left = left; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.getTop() function nsxbStyleGetTop() { return this.styleObj.top; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setTop() function nsxbStyleSetTop(top) { this.styleObj.top = top; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.getPageX() function nsxbStyleGetPageX() { return this.styleObj.pageX; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setPageX() function nsxbStyleSetPageX(x) { this.styleObj.x = this.styleObj.x + x - this.styleObj.pageX; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.getPageY() function nsxbStyleGetPageY() { return this.styleObj.pageY; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setPageY() function nsxbStyleSetPageY(y) { this.styleObj.y = this.styleObj.y + y - this.styleObj.pageY; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.getHeight() function nsxbStyleGetHeight() { //if (this.styleObj.document && this.styleObj.document.height) // return this.styleObj.document.height; return this.styleObj.clip.height; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setHeight() function nsxbStyleSetHeight(height) { this.styleObj.clip.height = height; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.getWidth() function nsxbStyleGetWidth() { //if (this.styleObj.document && this.styleObj.document.width) // return this.styleObj.document.width; return this.styleObj.clip.width; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setWidth() // netscape will not dynamically change the width of a // layer. It will only happen upon a refresh. function nsxbStyleSetWidth(width) { this.styleObj.clip.width = width; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // xbStyle.getVisibility() function nsxbStyleGetVisibility() { switch(this.styleObj.visibility) { case 'hide': return 'hidden'; case 'show': return 'visible'; } return ''; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setVisibility() function nsxbStyleSetVisibility(visibility) { switch(visibility) { case 'hidden': visibility = 'hide'; break; case 'visible': visibility = 'show'; break; case 'inherit': break; default: visibility = 'show'; break; } this.styleObj.visibility = visibility; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.getzIndex() function nsxbStyleGetzIndex() { return this.styleObj.zIndex; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setzIndex() function nsxbStyleSetzIndex(zIndex) { this.styleObj.zIndex = zIndex; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.getBackgroundColor() function nsxbStyleGetBackgroundColor() { return this.styleObj.bgColor; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setBackgroundColor() function nsxbStyleSetBackgroundColor(color) { if (color) { this.styleObj.bgColor = color; this.object.document.bgColor = color; this.resizeTo(this.getWidth(), this.getHeight()); } } ///////////////////////////////////////////////////////////////////////////// // xbStyle.getColor() function nsxbStyleGetColor() { return '#ffffff'; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setColor() function nsxbStyleSetColor(color) { this.object.document.fgColor = color; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.moveAbove() function xbStyleMoveAbove(cont) { this.setzIndex(cont.getzIndex()+1); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.moveBelow() function xbStyleMoveBelow(cont) { var zindex = cont.getzIndex() - 1; this.setzIndex(zindex); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.moveBy() function xbStyleMoveBy(deltaX, deltaY) { this.moveTo(this.getLeft() + deltaX, this.getTop() + deltaY); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.moveTo() function xbStyleMoveTo(x, y) { this.setLeft(x); this.setTop(y); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.moveToAbsolute() function xbStyleMoveToAbsolute(x, y) { this.setPageX(x); this.setPageY(y); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.resizeBy() function xbStyleResizeBy(deltaX, deltaY) { this.setWidth( this.getWidth() + deltaX ); this.setHeight( this.getHeight() + deltaY ); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.resizeTo() function xbStyleResizeTo(x, y) { this.setWidth(x); this.setHeight(y); } //////////////////////////////////////////////////////////////////////// // Navigator 4.x resizing... function nsxbStyleOnresize() { if (saveInnerWidth != xbGetWindowWidth() || saveInnerHeight != xbGetWindowHeight()) location.reload(); return false; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.setInnerHTML() function nsxbSetInnerHTML(str) { this.object.document.open('text/html'); this.object.document.write(str); this.object.document.close(); } xbStyle.prototype.getClip = nsxbStyleGetClip; xbStyle.prototype.setClip = nsxbStyleSetClip; xbStyle.prototype.getClipTop = nsxbStyleGetClipTop; xbStyle.prototype.setClipTop = nsxbStyleSetClipTop; xbStyle.prototype.getClipRight = nsxbStyleGetClipRight; xbStyle.prototype.setClipRight = nsxbStyleSetClipRight; xbStyle.prototype.getClipBottom = nsxbStyleGetClipBottom; xbStyle.prototype.setClipBottom = nsxbStyleSetClipBottom; xbStyle.prototype.getClipLeft = nsxbStyleGetClipLeft; xbStyle.prototype.setClipLeft = nsxbStyleSetClipLeft; xbStyle.prototype.getClipWidth = nsxbStyleGetClipWidth; xbStyle.prototype.setClipWidth = nsxbStyleSetClipWidth; xbStyle.prototype.getClipHeight = nsxbStyleGetClipHeight; xbStyle.prototype.setClipHeight = nsxbStyleSetClipHeight; xbStyle.prototype.getLeft = nsxbStyleGetLeft; xbStyle.prototype.setLeft = nsxbStyleSetLeft; xbStyle.prototype.getTop = nsxbStyleGetTop; xbStyle.prototype.setTop = nsxbStyleSetTop; xbStyle.prototype.getPageX = nsxbStyleGetPageX; xbStyle.prototype.setPageX = nsxbStyleSetPageX; xbStyle.prototype.getPageY = nsxbStyleGetPageY; xbStyle.prototype.setPageY = nsxbStyleSetPageY; xbStyle.prototype.getVisibility = nsxbStyleGetVisibility; xbStyle.prototype.setVisibility = nsxbStyleSetVisibility; xbStyle.prototype.getzIndex = nsxbStyleGetzIndex; xbStyle.prototype.setzIndex = nsxbStyleSetzIndex; xbStyle.prototype.getHeight = nsxbStyleGetHeight; xbStyle.prototype.setHeight = nsxbStyleSetHeight; xbStyle.prototype.getWidth = nsxbStyleGetWidth; xbStyle.prototype.setWidth = nsxbStyleSetWidth; xbStyle.prototype.getBackgroundColor = nsxbStyleGetBackgroundColor; xbStyle.prototype.setBackgroundColor = nsxbStyleSetBackgroundColor; xbStyle.prototype.getColor = nsxbStyleGetColor; xbStyle.prototype.setColor = nsxbStyleSetColor; xbStyle.prototype.setInnerHTML = nsxbSetInnerHTML; xbStyle.prototype.getBorderTopWidth = xbStyleNotSupported; xbStyle.prototype.getBorderRightWidth = xbStyleNotSupported; xbStyle.prototype.getBorderBottomWidth = xbStyleNotSupported; xbStyle.prototype.getBorderLeftWidth = xbStyleNotSupported; xbStyle.prototype.getMarginLeft = xbStyleNotSupported; xbStyle.prototype.getMarginTop = xbStyleNotSupported; xbStyle.prototype.getMarginRight = xbStyleNotSupported; xbStyle.prototype.getMarginBottom = xbStyleNotSupported; xbStyle.prototype.getMarginLeft = xbStyleNotSupported; xbStyle.prototype.getPaddingTop = xbStyleNotSupported; xbStyle.prototype.getPaddingRight = xbStyleNotSupported; xbStyle.prototype.getPaddingBottom = xbStyleNotSupported; xbStyle.prototype.getPaddingLeft = xbStyleNotSupported; xbStyle.prototype.getClientWidth = xbStyleNotSupported; xbStyle.prototype.getClientHeight = xbStyleNotSupported; window.saveInnerWidth = window.innerWidth; window.saveInnerHeight = window.innerHeight; window.onresize = nsxbStyleOnresize; ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/browser/xbStyle-not-supported.jsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/browser/xbStyle-not-supporte0000664000175000017500000000735613160023043033061 0ustar bdbaddogbdbaddog/* * xbStyle-not-supported.js * $Revision: 1.2 $ $Date: 2003/02/07 16:04:22 $ */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Netscape code. * * The Initial Developer of the Original Code is * Netscape Corporation. * Portions created by the Initial Developer are Copyright (C) 2001 * the Initial Developer. All Rights Reserved. * * Contributor(s): Bob Clary * * ***** END LICENSE BLOCK ***** */ xbStyle.prototype.toString = xbStyleNotSupported; xbStyle.prototype.getClip = xbStyleNotSupported; xbStyle.prototype.setClip = xbStyleNotSupported; xbStyle.prototype.getClipTop = xbStyleNotSupported; xbStyle.prototype.setClipTop = xbStyleNotSupported; xbStyle.prototype.getClipRight = xbStyleNotSupported; xbStyle.prototype.setClipRight = xbStyleNotSupported; xbStyle.prototype.getClipBottom = xbStyleNotSupported; xbStyle.prototype.setClipBottom = xbStyleNotSupported; xbStyle.prototype.getClipLeft = xbStyleNotSupported; xbStyle.prototype.setClipLeft = xbStyleNotSupported; xbStyle.prototype.getClipWidth = xbStyleNotSupported; xbStyle.prototype.setClipWidth = xbStyleNotSupported; xbStyle.prototype.getClipHeight = xbStyleNotSupported; xbStyle.prototype.setClipHeight = xbStyleNotSupported; xbStyle.prototype.getLeft = xbStyleNotSupported; xbStyle.prototype.setLeft = xbStyleNotSupported; xbStyle.prototype.getTop = xbStyleNotSupported; xbStyle.prototype.setTop = xbStyleNotSupported; xbStyle.prototype.getVisibility = xbStyleNotSupported; xbStyle.prototype.setVisibility = xbStyleNotSupported; xbStyle.prototype.getzIndex = xbStyleNotSupported; xbStyle.prototype.setzIndex = xbStyleNotSupported; xbStyle.prototype.getHeight = xbStyleNotSupported; xbStyle.prototype.setHeight = xbStyleNotSupported; xbStyle.prototype.getWidth = xbStyleNotSupported; xbStyle.prototype.setWidth = xbStyleNotSupported; xbStyle.prototype.getBackgroundColor = xbStyleNotSupported; xbStyle.prototype.setBackgroundColor = xbStyleNotSupported; xbStyle.prototype.getColor = xbStyleNotSupported; xbStyle.prototype.setColor = xbStyleNotSupported; xbStyle.prototype.setInnerHTML = xbStyleNotSupported; xbStyle.prototype.getBorderTopWidth = xbStyleNotSupported; xbStyle.prototype.getBorderRightWidth = xbStyleNotSupported; xbStyle.prototype.getBorderBottomWidth = xbStyleNotSupported; xbStyle.prototype.getBorderLeftWidth = xbStyleNotSupported; xbStyle.prototype.getMarginLeft = xbStyleNotSupported; xbStyle.prototype.getMarginTop = xbStyleNotSupported; xbStyle.prototype.getMarginRight = xbStyleNotSupported; xbStyle.prototype.getMarginBottom = xbStyleNotSupported; xbStyle.prototype.getMarginLeft = xbStyleNotSupported; xbStyle.prototype.getPaddingTop = xbStyleNotSupported; xbStyle.prototype.getPaddingRight = xbStyleNotSupported; xbStyle.prototype.getPaddingBottom = xbStyleNotSupported; xbStyle.prototype.getPaddingLeft = xbStyleNotSupported; xbStyle.prototype.getClientWidth = xbStyleNotSupported; xbStyle.prototype.getClientHeight = xbStyleNotSupported; scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/browser/slides-default.css0000664000175000017500000000032413160023043032432 0ustar bdbaddogbdbaddog@import url('slides.css'); .toclink { font-size: 10pt; font-weight: normal; } .toclink a { color: blue; } .toclink a:link { color: blue; } .toclink a:visited { color: blue; } scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/browser/xbStyle-css.js0000664000175000017500000004275213160023043031604 0ustar bdbaddogbdbaddog/* * xbStyle-css.js * $Revision: 1.2 $ $Date: 2003/02/07 16:04:21 $ * */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Netscape code. * * The Initial Developer of the Original Code is * Netscape Corporation. * Portions created by the Initial Developer are Copyright (C) 2001 * the Initial Developer. All Rights Reserved. * * Contributor(s): Bob Clary * * ***** END LICENSE BLOCK ***** */ // xbStyle.getClip() function cssStyleGetClip() { var clip = this.getEffectiveValue('clip'); // hack opera if (clip == 'rect()') clip = ''; if (clip == '' || clip == 'auto') { clip = 'rect(0px, ' + this.getWidth() + 'px, ' + this.getHeight() + 'px, 0px)'; } else { clip = clip.replace(/px /g, 'px, '); } return clip; } // xbStyle.setClip() function cssStyleSetClip(sClipString) { this.styleObj.clip = sClipString; } // xbStyle.getClipTop() function cssStyleGetClipTop() { var clip = this.getClip(); var rect = new xbClipRect(clip); return rect.top; } // xbStyle.setClipTop() function cssStyleSetClipTop(top) { var clip = this.getClip(); var rect = new xbClipRect(clip); rect.top = top; this.styleObj.clip = rect.toString(); } // xbStyle.getClipRight() function cssStyleGetClipRight() { var clip = this.getClip(); var rect = new xbClipRect(clip); return rect.right; } // xbStyle.setClipRight() function cssStyleSetClipRight(right) { var clip = this.getClip(); var rect = new xbClipRect(clip); rect.right = right; this.styleObj.clip = rect.toString(); } // xbStyle.getClipBottom() function cssStyleGetClipBottom() { var clip = this.getClip(); var rect = new xbClipRect(clip); return rect.bottom; } // xbStyle.setClipBottom() function cssStyleSetClipBottom(bottom) { var clip = this.getClip(); var rect = new xbClipRect(clip); rect.bottom = bottom; this.styleObj.clip = rect.toString(); } // xbStyle.getClipLeft() function cssStyleGetClipLeft() { var clip = this.getClip(); var rect = new xbClipRect(clip); return rect.left; } // xbStyle.setClipLeft() function cssStyleSetClipLeft(left) { var clip = this.getClip(); var rect = new xbClipRect(clip); rect.left = left; this.styleObj.clip = rect.toString(); } // xbStyle.getClipWidth() function cssStyleGetClipWidth() { var clip = this.getClip(); var rect = new xbClipRect(clip); return rect.getWidth(); } // xbStyle.setClipWidth() function cssStyleSetClipWidth(width) { var clip = this.getClip(); var rect = new xbClipRect(clip); rect.setWidth(width); this.styleObj.clip = rect.toString(); } // xbStyle.getClipHeight() function cssStyleGetClipHeight() { var clip = this.getClip(); var rect = new xbClipRect(clip); return rect.getHeight(); } // xbStyle.setClipHeight() function cssStyleSetClipHeight(height) { var clip = this.getClip(); var rect = new xbClipRect(clip); rect.setHeight(height); this.styleObj.clip = rect.toString(); } // the CSS attributes left,top are for absolutely positioned elements // measured relative to the containing element. for relatively positioned // elements, left,top are measured from the element's normal inline position. // getLeft(), setLeft() operate on this type of coordinate. // // to allow dynamic positioning the getOffsetXXX and setOffsetXXX methods are // defined to return and set the position of either an absolutely or relatively // positioned element relative to the containing element. // // // xbStyle.getLeft() function cssStyleGetLeft() { var left = this.getEffectiveValue('left'); if (typeof(left) == 'number') return left; if (left != '' && left.indexOf('px') == -1) { xbDEBUG.dump('xbStyle.getLeft: Element ID=' + this.object.id + ' does not use pixels as units. left=' + left + ' Click Ok to continue, Cancel to Abort'); return 0; } if (top == 'auto' && this.object && typeof(this.object.offsetTop) == 'number') { left = this.object.offsetTop + 'px'; } if (left == '') left = '0px'; return xbToInt(left); } // xbStyle.setLeft() function cssStyleSetLeft(left) { if (typeof(this.styleObj.left) == 'number') this.styleObj.left = left; else this.styleObj.left = left + 'px'; } // xbStyle.getTop() function cssStyleGetTop() { var top = this.getEffectiveValue('top'); if (typeof(top) == 'number') return top; if (top != '' && top.indexOf('px') == -1) { xbDEBUG.dump('xbStyle.getTop: Element ID=' + this.object.id + ' does not use pixels as units. top=' + top + ' Click Ok to continue, Cancel to Abort'); return 0; } if (top == 'auto' && this.object && typeof(this.object.offsetTop) == 'number') { top = this.object.offsetTop + 'px'; } if (top == '') top = '0px'; return xbToInt(top); } // xbStyle.setTop() function cssStyleSetTop(top) { if (typeof(this.styleObj.top) == 'number') this.styleObj.top = top; else this.styleObj.top = top + 'px'; } // xbStyle.getPageX() function cssStyleGetPageX() { var x = 0; var elm = this.object; var elmstyle; var position; //xxxHack: Due to limitations in Gecko's (0.9.6) ability to determine the // effective position attribute , attempt to use offsetXXX if (typeof(elm.offsetLeft) == 'number') { while (elm) { x += elm.offsetLeft; elm = elm.offsetParent; } } else { while (elm) { if (elm.style) { elmstyle = new xbStyle(elm); position = elmstyle.getEffectiveValue('position'); if (position != '' && position != 'static') x += elmstyle.getLeft(); } elm = elm.parentNode; } } return x; } // xbStyle.setPageX() function cssStyleSetPageX(x) { var xParent = 0; var elm = this.object.parentNode; var elmstyle; var position; //xxxHack: Due to limitations in Gecko's (0.9.6) ability to determine the // effective position attribute , attempt to use offsetXXX if (elm && typeof(elm.offsetLeft) == 'number') { while (elm) { xParent += elm.offsetLeft; elm = elm.offsetParent; } } else { while (elm) { if (elm.style) { elmstyle = new xbStyle(elm); position = elmstyle.getEffectiveValue('position'); if (position != '' && position != 'static') xParent += elmstyle.getLeft(); } elm = elm.parentNode; } } x -= xParent; this.setLeft(x); } // xbStyle.getPageY() function cssStyleGetPageY() { var y = 0; var elm = this.object; var elmstyle; var position; //xxxHack: Due to limitations in Gecko's (0.9.6) ability to determine the // effective position attribute , attempt to use offsetXXX if (typeof(elm.offsetTop) == 'number') { while (elm) { y += elm.offsetTop; elm = elm.offsetParent; } } else { while (elm) { if (elm.style) { elmstyle = new xbStyle(elm); position = elmstyle.getEffectiveValue('position'); if (position != '' && position != 'static') y += elmstyle.getTop(); } elm = elm.parentNode; } } return y; } // xbStyle.setPageY() function cssStyleSetPageY(y) { var yParent = 0; var elm = this.object.parentNode; var elmstyle; var position; //xxxHack: Due to limitations in Gecko's (0.9.6) ability to determine the // effective position attribute , attempt to use offsetXXX if (elm && typeof(elm.offsetTop) == 'number') { while (elm) { yParent += elm.offsetTop; elm = elm.offsetParent; } } else { while (elm) { if (elm.style) { elmstyle = new xbStyle(elm); position = elmstyle.getEffectiveValue('position'); if (position != '' && position != 'static') yParent += elmstyle.getTop(); } elm = elm.parentNode; } } y -= yParent; this.setTop(y); } // xbStyle.getHeight() function cssStyleGetHeight() { var display = this.getEffectiveValue('display'); var height = this.getEffectiveValue('height'); if (typeof(height) == 'number') { // Opera return height; } if (height == '' || height == 'auto' || height.indexOf('%') != -1) { if (typeof(this.object.offsetHeight) == 'number') { height = this.object.offsetHeight + 'px'; } else if (typeof(this.object.scrollHeight) == 'number') { height = this.object.scrollHeight + 'px'; } } if (height.indexOf('px') == -1) { xbDEBUG.dump('xbStyle.getHeight: Element ID=' + this.object.id + ' does not use pixels as units. height=' + height + ' Click Ok to continue, Cancel to Abort'); return 0; } height = xbToInt(height); return height; } // xbStyle.setHeight() function cssStyleSetHeight(height) { if (typeof(this.styleObj.height) == 'number') this.styleObj.height = height; else this.styleObj.height = height + 'px'; } // xbStyle.getWidth() function cssStyleGetWidth() { var display = this.getEffectiveValue('display'); var width = this.getEffectiveValue('width'); if (typeof(width) == 'number') { // note Opera 6 has a bug in width and offsetWidth where // it returns the page width. Use clientWidth instead. if (navigator.userAgent.indexOf('Opera') != -1) return this.object.clientWidth; else return width; } if (width == '' || width == 'auto' || width.indexOf('%') != -1) { if (typeof(this.object.offsetWidth) == 'number') { width = this.object.offsetWidth + 'px'; } else if (typeof(this.object.scrollHeight) == 'number') { width = this.object.scrollWidth + 'px'; } } if (width.indexOf('px') == -1) { xbDEBUG.dump('xbStyle.getWidth: Element ID=' + this.object.id + ' does not use pixels as units. width=' + width + ' Click Ok to continue, Cancel to Abort'); return 0; } width = xbToInt(width); return width; } // xbStyle.setWidth() function cssStyleSetWidth(width) { if (typeof(this.styleObj.width) == 'number') this.styleObj.width = width; else this.styleObj.width = width + 'px'; } // xbStyle.getVisibility() function cssStyleGetVisibility() { return this.getEffectiveValue('visibility'); } // xbStyle.setVisibility() function cssStyleSetVisibility(visibility) { this.styleObj.visibility = visibility; } // xbStyle.getzIndex() function cssStyleGetzIndex() { return xbToInt(this.getEffectiveValue('zIndex')); } // xbStyle.setzIndex() function cssStyleSetzIndex(zIndex) { this.styleObj.zIndex = zIndex; } // xbStyle.getBackgroundColor() function cssStyleGetBackgroundColor() { return this.getEffectiveValue('backgroundColor'); } // xbStyle.setBackgroundColor() function cssStyleSetBackgroundColor(color) { this.styleObj.backgroundColor = color; } // xbStyle.getColor() function cssStyleGetColor() { return this.getEffectiveValue('color'); } // xbStyle.setColor() function cssStyleSetColor(color) { this.styleObj.color = color; } // xbStyle.moveAbove() function xbStyleMoveAbove(cont) { this.setzIndex(cont.getzIndex()+1); } // xbStyle.moveBelow() function xbStyleMoveBelow(cont) { var zindex = cont.getzIndex() - 1; this.setzIndex(zindex); } // xbStyle.moveBy() function xbStyleMoveBy(deltaX, deltaY) { this.moveTo(this.getLeft() + deltaX, this.getTop() + deltaY); } // xbStyle.moveTo() function xbStyleMoveTo(x, y) { this.setLeft(x); this.setTop(y); } // xbStyle.moveToAbsolute() function xbStyleMoveToAbsolute(x, y) { this.setPageX(x); this.setPageY(y); } // xbStyle.resizeBy() function xbStyleResizeBy(deltaX, deltaY) { this.setWidth( this.getWidth() + deltaX ); this.setHeight( this.getHeight() + deltaY ); } // xbStyle.resizeTo() function xbStyleResizeTo(x, y) { this.setWidth(x); this.setHeight(y); } // xbStyle.setInnerHTML() function xbSetInnerHTML(str) { if (typeof(this.object.innerHTML) != 'undefined') this.object.innerHTML = str; } // Extensions to xbStyle that are not supported by Netscape Navigator 4 // but that provide cross browser implementations of properties for // Mozilla, Gecko, Netscape 6.x and Opera // xbStyle.getBorderTopWidth() function cssStyleGetBorderTopWidth() { return xbToInt(this.getEffectiveValue('borderTopWidth')); } // xbStyle.getBorderRightWidth() function cssStyleGetBorderRightWidth() { return xbToInt(this.getEffectiveValue('borderRightWidth')); } // xbStyle.getBorderBottomWidth() function cssStyleGetBorderBottomWidth() { return xbToInt(this.getEffectiveValue('borderBottomWidth')); } // xbStyle.getBorderLeftWidth() function cssStyleGetBorderLeftWidth() { return xbToInt(this.getEffectiveValue('borderLeftWidth')); } // xbStyle.getMarginTop() function cssStyleGetMarginTop() { return xbToInt(this.getEffectiveValue('marginTop')); } // xbStyle.getMarginRight() function cssStyleGetMarginRight() { return xbToInt(this.getEffectiveValue('marginRight')); } // xbStyle.getMarginBottom() function cssStyleGetMarginBottom() { return xbToInt(this.getEffectiveValue('marginBottom')); } // xbStyle.getMarginLeft() function cssStyleGetMarginLeft() { return xbToInt(this.getEffectiveValue('marginLeft')); } // xbStyle.getPaddingTop() function cssStyleGetPaddingTop() { return xbToInt(this.getEffectiveValue('paddingTop')); } // xbStyle.getPaddingRight() function cssStyleGetPaddingRight() { return xbToInt(this.getEffectiveValue('paddingRight')); } // xbStyle.getPaddingBottom() function cssStyleGetPaddingBottom() { return xbToInt(this.getEffectiveValue('paddingBottom')); } // xbStyle.getPaddingLeft() function cssStyleGetPaddingLeft() { return xbToInt(this.getEffectiveValue('paddingLeft')); } // xbStyle.getClientWidth() function cssStyleGetClientWidth() { return this.getWidth() + this.getPaddingLeft() + this.getPaddingRight(); /* if (typeof(this.object.clientWidth) == 'number') return this.object.clientWidth; return null; */ } // xbStyle.getClientHeight() function cssStyleGetClientHeight() { return this.getHeight() + this.getPaddingTop() + this.getPaddingBottom(); /* if (typeof(this.object.clientHeight) == 'number') return this.object.clientHeight; return null; */ } xbStyle.prototype.getClip = cssStyleGetClip; xbStyle.prototype.setClip = cssStyleSetClip; xbStyle.prototype.getClipTop = cssStyleGetClipTop; xbStyle.prototype.setClipTop = cssStyleSetClipTop; xbStyle.prototype.getClipRight = cssStyleGetClipRight; xbStyle.prototype.setClipRight = cssStyleSetClipRight; xbStyle.prototype.getClipBottom = cssStyleGetClipBottom; xbStyle.prototype.setClipBottom = cssStyleSetClipBottom; xbStyle.prototype.getClipLeft = cssStyleGetClipLeft; xbStyle.prototype.setClipLeft = cssStyleSetClipLeft; xbStyle.prototype.getClipWidth = cssStyleGetClipWidth; xbStyle.prototype.setClipWidth = cssStyleSetClipWidth; xbStyle.prototype.getClipHeight = cssStyleGetClipHeight; xbStyle.prototype.setClipHeight = cssStyleSetClipHeight; xbStyle.prototype.getLeft = cssStyleGetLeft; xbStyle.prototype.setLeft = cssStyleSetLeft; xbStyle.prototype.getTop = cssStyleGetTop; xbStyle.prototype.setTop = cssStyleSetTop; xbStyle.prototype.getPageX = cssStyleGetPageX; xbStyle.prototype.setPageX = cssStyleSetPageX; xbStyle.prototype.getPageY = cssStyleGetPageY; xbStyle.prototype.setPageY = cssStyleSetPageY; xbStyle.prototype.getVisibility = cssStyleGetVisibility; xbStyle.prototype.setVisibility = cssStyleSetVisibility; xbStyle.prototype.getzIndex = cssStyleGetzIndex; xbStyle.prototype.setzIndex = cssStyleSetzIndex; xbStyle.prototype.getHeight = cssStyleGetHeight; xbStyle.prototype.setHeight = cssStyleSetHeight; xbStyle.prototype.getWidth = cssStyleGetWidth; xbStyle.prototype.setWidth = cssStyleSetWidth; xbStyle.prototype.getBackgroundColor = cssStyleGetBackgroundColor; xbStyle.prototype.setBackgroundColor = cssStyleSetBackgroundColor; xbStyle.prototype.getColor = cssStyleGetColor; xbStyle.prototype.setColor = cssStyleSetColor; xbStyle.prototype.setInnerHTML = xbSetInnerHTML; xbStyle.prototype.getBorderTopWidth = cssStyleGetBorderTopWidth; xbStyle.prototype.getBorderRightWidth = cssStyleGetBorderRightWidth; xbStyle.prototype.getBorderBottomWidth = cssStyleGetBorderBottomWidth; xbStyle.prototype.getBorderLeftWidth = cssStyleGetBorderLeftWidth; xbStyle.prototype.getMarginLeft = cssStyleGetMarginLeft; xbStyle.prototype.getMarginTop = cssStyleGetMarginTop; xbStyle.prototype.getMarginRight = cssStyleGetMarginRight; xbStyle.prototype.getMarginBottom = cssStyleGetMarginBottom; xbStyle.prototype.getMarginLeft = cssStyleGetMarginLeft; xbStyle.prototype.getPaddingTop = cssStyleGetPaddingTop; xbStyle.prototype.getPaddingRight = cssStyleGetPaddingRight; xbStyle.prototype.getPaddingBottom = cssStyleGetPaddingBottom; xbStyle.prototype.getPaddingLeft = cssStyleGetPaddingLeft; xbStyle.prototype.getClientWidth = cssStyleGetClientWidth; xbStyle.prototype.getClientHeight = cssStyleGetClientHeight; scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/browser/xbStyle.js0000664000175000017500000001771213160023043031014 0ustar bdbaddogbdbaddog/* * xbStyle.js * $Revision: 1.2 $ $Date: 2003/02/07 16:04:22 $ */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Netscape code. * * The Initial Developer of the Original Code is * Netscape Corporation. * Portions created by the Initial Developer are Copyright (C) 2001 * the Initial Developer. All Rights Reserved. * * Contributor(s): Bob Clary * * ***** END LICENSE BLOCK ***** */ function xbStyleNotSupported() {} function xbStyleNotSupportStringValue(propname) { xbDEBUG.dump(propname + ' is not supported in this browser'); return '';}; ///////////////////////////////////////////////////////////// // xbClipRect function xbClipRect(a1, a2, a3, a4) { this.top = 0; this.right = 0; this.bottom = 0; this.left = 0; if (typeof(a1) == 'string') { var val; var ca; var i; if (a1.indexOf('rect(') == 0) { // I would have preferred [0-9]+[a-zA-Z]+ for a regexp // but NN4 returns null for that. ca = a1.substring(5, a1.length-1).match(/-?[0-9a-zA-Z]+/g); for (i = 0; i < 4; ++i) { val = xbToInt(ca[i]); if (val != 0 && ca[i].indexOf('px') == -1) { xbDEBUG.dump('xbClipRect: A clipping region ' + a1 + ' was detected that did not use pixels as units. Click Ok to continue, Cancel to Abort'); return; } ca[i] = val; } this.top = ca[0]; this.right = ca[1]; this.bottom = ca[2]; this.left = ca[3]; } } else if (typeof(a1) == 'number' && typeof(a2) == 'number' && typeof(a3) == 'number' && typeof(a4) == 'number') { this.top = a1; this.right = a2; this.bottom = a3; this.left = a4; } } xbClipRect.prototype.top = 0; xbClipRect.prototype.right = 0; xbClipRect.prototype.bottom = 0; xbClipRect.prototype.left = 0; function xbClipRectGetWidth() { return this.right - this.left; } xbClipRect.prototype.getWidth = xbClipRectGetWidth; function xbClipRectSetWidth(width) { this.right = this.left + width; } xbClipRect.prototype.setWidth = xbClipRectSetWidth; function xbClipRectGetHeight() { return this.bottom - this.top; } xbClipRect.prototype.getHeight = xbClipRectGetHeight; function xbClipRectSetHeight(height) { this.bottom = this.top + height; } xbClipRect.prototype.setHeight = xbClipRectSetHeight; function xbClipRectToString() { return 'rect(' + this.top + 'px ' + this.right + 'px ' + this.bottom + 'px ' + this.left + 'px )' ; } xbClipRect.prototype.toString = xbClipRectToString; ///////////////////////////////////////////////////////////// // xbStyle // // Note Opera violates the standard by cascading the effective values // into the HTMLElement.style object. We can use IE's HTMLElement.currentStyle // to get the effective values. In Gecko we will use the W3 DOM Style Standard getComputedStyle function xbStyle(obj, win, position) { if (typeof(obj) == 'object' && typeof(obj.style) != 'undefined') this.styleObj = obj.style; else if (document.layers) // NN4 { if (typeof(position) == 'undefined') position = ''; this.styleObj = obj; this.styleObj.position = position; } this.object = obj; this.window = win ? win : window; } xbStyle.prototype.styleObj = null; xbStyle.prototype.object = null; ///////////////////////////////////////////////////////////// // xbStyle.getEffectiveValue() // note that xbStyle's constructor uses the currentStyle object // for IE5+ and that Opera's style object contains computed values // already. Netscape Navigator's layer object also contains the // computed values as well. Note that IE4 will not return the // computed values. function xbStyleGetEffectiveValue(propname) { var value = null; if (this.window.document.defaultView && this.window.document.defaultView.getComputedStyle) { // W3 // Note that propname is the name of the property in the CSS Style // Object. However the W3 method getPropertyValue takes the actual // property name from the CSS Style rule, i.e., propname is // 'backgroundColor' but getPropertyValue expects 'background-color'. var capIndex; var cappropname = propname; while ( (capIndex = cappropname.search(/[A-Z]/)) != -1) { if (capIndex != -1) { cappropname = cappropname.substring(0, capIndex) + '-' + cappropname.substring(capIndex, capIndex+1).toLowerCase() + cappropname.substr(capIndex+1); } } value = this.window.document.defaultView.getComputedStyle(this.object, '').getPropertyValue(cappropname); // xxxHack for Gecko: if (!value && this.styleObj[propname]) { value = this.styleObj[propname]; } } else if (typeof(this.styleObj[propname]) == 'undefined') { value = xbStyleNotSupportStringValue(propname); } else if (typeof(this.object.currentStyle) != 'undefined') { // IE5+ value = this.object.currentStyle[propname]; if (!value) { value = this.styleObj[propname]; } if (propname == 'clip' && !value) { // clip is not stored in IE5/6 handle separately value = 'rect(' + this.object.currentStyle.clipTop + ', ' + this.object.currentStyle.clipRight + ', ' + this.object.currentStyle.clipBottom + ', ' + this.object.currentStyle.clipLeft + ')'; } } else { // IE4+, Opera, NN4 value = this.styleObj[propname]; } return value; } ///////////////////////////////////////////////////////////////////////////// // xbStyle.moveAbove() function xbStyleMoveAbove(cont) { this.setzIndex(cont.getzIndex()+1); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.moveBelow() function xbStyleMoveBelow(cont) { var zindex = cont.getzIndex() - 1; this.setzIndex(zindex); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.moveBy() function xbStyleMoveBy(deltaX, deltaY) { this.moveTo(this.getLeft() + deltaX, this.getTop() + deltaY); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.moveTo() function xbStyleMoveTo(x, y) { this.setLeft(x); this.setTop(y); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.moveToAbsolute() function xbStyleMoveToAbsolute(x, y) { this.setPageX(x); this.setPageY(y); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.resizeBy() function xbStyleResizeBy(deltaX, deltaY) { this.setWidth( this.getWidth() + deltaX ); this.setHeight( this.getHeight() + deltaY ); } ///////////////////////////////////////////////////////////////////////////// // xbStyle.resizeTo() function xbStyleResizeTo(x, y) { this.setWidth(x); this.setHeight(y); } //////////////////////////////////////////////////////////////////////// xbStyle.prototype.getEffectiveValue = xbStyleGetEffectiveValue; xbStyle.prototype.moveAbove = xbStyleMoveAbove; xbStyle.prototype.moveBelow = xbStyleMoveBelow; xbStyle.prototype.moveBy = xbStyleMoveBy; xbStyle.prototype.moveTo = xbStyleMoveTo; xbStyle.prototype.moveToAbsolute = xbStyleMoveToAbsolute; xbStyle.prototype.resizeBy = xbStyleResizeBy; xbStyle.prototype.resizeTo = xbStyleResizeTo; if (document.all || document.getElementsByName) { xblibrary.loadScript('xbStyle-css.js'); } else if (document.layers) { xblibrary.loadScript('xbStyle-nn4.js'); } else { xblibrary.loadScript('xbStyle-not-supported.js'); } scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/svg/0000775000175000017500000000000013160023043026130 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/svg/default.xsl0000664000175000017500000006250413160023043030313 0ustar bdbaddogbdbaddog SVG Slides Steve Ball Zveno
    zveno.com
    $Id: default.xsl 6567 2007-01-30 06:43:18Z xmldoc $ 2002 Steve Ball, Zveno Pty Ltd Zveno Pty Ltd makes this software and associated documentation available free of charge for any purpose. You may make copies of the software but you must include all of this notice on any copy. Zveno Pty Ltd does not warrant that this software is error free or fit for any purpose. Zveno Pty Ltd disclaims any liability for all claims, expenses, losses, damages and costs any user may incur as a result of using, copying or modifying the software.
    slides.css graphics white Arial white black preserve 100% font-family: ; font-size: 18pt; fill: ; stroke: ; background-color: font-size: 24pt; font-weight: bold font-size: 18pt font-size: 18pt href=" " type="text/css" title title.click foil1-previous-button.click; toc title.click toc.click; toc-content.click 50 75 title.click toc.click; toc-content.click index-foilgroup- #ff8000 #ff8000 toc index-foilgroup-1.click; toc.click; toc-content.click index-foilgroup- .click; foil .click 50 75 index-foilgroup-1.click; toc.click; toc-content.click index-foilgroup- .click; foil .click - TOC Previous title.click 1 font-weight: bold font-style: italic font-style: italic scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/fo/0000775000175000017500000000000013160023043025735 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/fo/param.xsl0000664000175000017500000000572313160023043027574 0ustar bdbaddogbdbaddog Helvetica Helvetica 36 pt 1in 1in bold center pt 12pt 14pt #9F9F9F Times Roman italic 12pt normal scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/fo/plain-titlepage.xsl0000664000175000017500000002311613160023043031547 0ustar bdbaddogbdbaddog 1 1 scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/fo/plain.xsl0000664000175000017500000004540713160023043027602 0ustar bdbaddogbdbaddog bold pt false 8pt 6pt 10pt 12pt 8pt 14pt 0pt 0pt 0pt 6pt 4pt 8pt 8pt 6pt 10pt      /  slides-titlepage slides-foil . scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/fo/param.xml0000664000175000017500000003031113160023043027555 0ustar bdbaddogbdbaddog Slides FO Parameter Reference $Id: param.xweb 6633 2007-02-21 18:33:33Z xmldoc $ Walsh Norman 2002 Norman Walsh This is reference documentation for all user-configurable parameters in the DocBook XSL Slides FO stylesheet (for generating PDF slide presentations). Note that the Slides stylesheet for FO output is a customization layer of the DocBook XSL FO stylesheet. Therefore, in addition to the slides-specific parameters listed in this section, you can also use a number of FO stylesheet parameters to control Slides FO output. FO: General Params slide.title.font.family list open serif sans-serif monospace slide.title.font.family Specifies font family to use for slide titles <xsl:param name="slide.title.font.family">Helvetica</xsl:param> Description Specifies the font family to use for slides titles. slide.font.family list open serif sans-serif monospace slide.font.family Specifies font family to use for slide bodies <xsl:param name="slide.font.family">Helvetica</xsl:param> Description Specifies the font family to use for slides bodies. foil.title.master number foil.title.master Specifies unitless font size to use for foil titles <xsl:param name="foil.title.master">36</xsl:param> <!-- Inconsistant use of point size? --> Description Specifies a unitless font size to use for foil titles; used in combination with the foil.title.size parameter. foil.title.size length foil.title.size Specifies font size to use for foil titles, including units <xsl:param name="foil.title.size"> <xsl:value-of select="$foil.title.master"></xsl:value-of><xsl:text>pt</xsl:text> </xsl:param> Description This parameter combines the value of the foil.title.master parameter with a unit specification. The default unit is pt (points). FO: Property Sets slides.properties attribute set slides.properties Specifies properties for all slides <xsl:attribute-set name="slides.properties"> <xsl:attribute name="font-family"> <xsl:value-of select="$slide.font.family"></xsl:value-of> </xsl:attribute> </xsl:attribute-set> Description This parameter specifies properties that are applied to all slides. foilgroup.properties attribute set foilgroup.properties Specifies properties for all foilgroups <xsl:attribute-set name="foilgroup.properties"> <xsl:attribute name="font-family"> <xsl:value-of select="$slide.font.family"></xsl:value-of> </xsl:attribute> </xsl:attribute-set> Description This parameter specifies properties that are applied to all foilgroups. foil.subtitle.properties attribute set foil.subtitle.properties Specifies properties for all foil subtitles <xsl:attribute-set name="foil.subtitle.properties"> <xsl:attribute name="font-family"> <xsl:value-of select="$slide.title.font.family"></xsl:value-of> </xsl:attribute> <xsl:attribute name="text-align">center</xsl:attribute> <xsl:attribute name="font-size"> <xsl:value-of select="$foil.title.master * 0.8"></xsl:value-of><xsl:text>pt</xsl:text> </xsl:attribute> <xsl:attribute name="space-after">12pt</xsl:attribute> </xsl:attribute-set> Description This parameter specifies properties that are applied to all foil subtitles. foil.properties attribute set foil.properties Specifies properties for all foils <xsl:attribute-set name="foil.properties"> <xsl:attribute name="font-family"> <xsl:value-of select="$slide.font.family"></xsl:value-of> </xsl:attribute> <xsl:attribute name="margin-{$direction.align.start}">1in</xsl:attribute> <xsl:attribute name="margin-{$direction.align.end}">1in</xsl:attribute> <xsl:attribute name="font-size"> <xsl:value-of select="$body.font.size"></xsl:value-of> </xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> </xsl:attribute-set> Description This parameter specifies properties that are applied to all foils. speakernote.properties attribute set speakernote.properties Specifies properties for all speakernotes <xsl:attribute-set name="speakernote.properties"> <xsl:attribute name="font-family">Times Roman</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> <xsl:attribute name="font-size">12pt</xsl:attribute> <xsl:attribute name="font-weight">normal</xsl:attribute> </xsl:attribute-set> Description This parameter specifies properties that are applied to all speakernotes. running.foot.properties attribute set running.foot.properties Specifies properties for running foot on each slide <xsl:attribute-set name="running.foot.properties"> <xsl:attribute name="font-family"> <xsl:value-of select="$slide.font.family"></xsl:value-of> </xsl:attribute> <xsl:attribute name="font-size">14pt</xsl:attribute> <xsl:attribute name="color">#9F9F9F</xsl:attribute> </xsl:attribute-set> Description This parameter specifies properties that are applied to the running foot area of each slide. The Stylesheet The param.xsl stylesheet is just a wrapper around all these parameters. <!-- This file is generated from param.xweb --> <xsl:stylesheet exclude-result-prefixes="src" version="1.0"> <!-- ******************************************************************** $Id: param.xweb 6633 2007-02-21 18:33:33Z xmldoc $ ******************************************************************** This file is part of the DocBook Slides Stylesheet distribution. See ../README or http://docbook.sf.net/release/xsl/current/ for copyright and other information. ******************************************************************** --> <src:fragref linkend="slide.font.family.frag"></src:fragref> <src:fragref linkend="slide.title.font.family.frag"></src:fragref> <src:fragref linkend="foil.title.master.frag"></src:fragref> <src:fragref linkend="foil.title.size.frag"></src:fragref> <src:fragref linkend="foilgroup.properties.frag"></src:fragref> <src:fragref linkend="foil.properties.frag"></src:fragref> <src:fragref linkend="foil.subtitle.properties.frag"></src:fragref> <src:fragref linkend="running.foot.properties.frag"></src:fragref> <src:fragref linkend="speakernote.properties.frag"></src:fragref> <src:fragref linkend="slides.properties.frag"></src:fragref> </xsl:stylesheet> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/fo/plain-titlepage.xml0000664000175000017500000000463513160023043031546 0ustar bdbaddogbdbaddog ]> <subtitle t:predicate="[1]" text-align="center" space-after="1em" font-family="{$slide.title.font.family}"/> <corpauthor font-size="&hsize4;" text-align="center" space-after="1em"/> <authorgroup/> <author font-size="&hsize4;" text-align="center" space-after="1em"/> <pubdate font-size="&hsize3;" text-align="center" space-after="1em"/> <confgroup font-size="&hsize3;" text-align="center" space-after="1em"/> <releaseinfo font-size="&hsize3;" text-align="center" space-after="1em"/> <copyright font-size="&hsize3;" text-align="center"/> <revision text-align="center"/> </t:titlepage-content> <t:titlepage-content t:side="verso"> </t:titlepage-content> <t:titlepage-separator> </t:titlepage-separator> <t:titlepage-before t:side="recto"> </t:titlepage-before> <t:titlepage-before t:side="verso"> </t:titlepage-before> </t:titlepage> </t:templates> ���������������������������������������������������������������������������������������������������scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/��������������������0000775�0001750�0001750�00000000000�13160023043�027007� 5����������������������������������������������������������������������������������������������������ustar �bdbaddog������������������������bdbaddog���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/default.xsl���������0000664�0001750�0001750�00000062330�13160023043�031167� 0����������������������������������������������������������������������������������������������������ustar �bdbaddog������������������������bdbaddog���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns='http://developer.apple.com/schemas/APXL' xmlns:apxl='http://developer.apple.com/schemas/APXL' xmlns:plugin='http://developer.apple.com/schemas/APXLPlugins' xmlns:doc='http://nwalsh.com/xsl/documentation/1.0' xmlns:str='http://xsltsl.org/string' xmlns:math='http://xsltsl.org/math' exclude-result-prefixes='doc str math'> <xsl:import href='xsltsl/stdlib.xsl'/> <xsl:output method='xml' indent='yes' encoding='UTF-8'/> <xsl:strip-space elements='*'/> <doc:article xmlns=''> <articleinfo> <title>Keynote Slides Steve Ball Zveno
    zveno.com
    $Id: default.xsl 3991 2004-11-10 06:51:55Z balls $ 2004 2003 Steve Ball, Zveno Pty Ltd Zveno Pty Ltd makes this software and associated documentation available free of charge for any purpose. You may make copies of the software but you must include all of this notice on any copy. Zveno Pty Ltd does not warrant that this software is error free or fit for any purpose. Zveno Pty Ltd disclaims any liability for all claims, expenses, losses, damages and costs any user may incur as a result of using, copying or modifying the software. You must specify your slides document using the "slides" parameter </drawables> <transition-style type='inherited'/> <thumbnails> <thumbnail file='thumbs/st0.tiff' byte-size='6520' size='60 45'/> </thumbnails> <bullets> <bullet marker-type='inherited' level='0'> <content tab-stops='L 96' font-size='84' font-color='g1' font-name='GillSans' paragraph-alignment='center'> <xsl:apply-templates select='slidesinfo/title/node()'/> </content> </bullet> <xsl:choose> <xsl:when test='slidesinfo/subtitle'> <bullet marker-type='inherited' level='1'> <content tab-stops='L 96' font-size='36' font-color='g1' font-name='GillSans' paragraph-alignment='center'> <xsl:apply-templates select='slidesinfo/subtitle/node()' mode='slides'/> </content> </bullet> </xsl:when> <xsl:when test='slidesinfo/corpauthor'> <bullet marker-type='inherited' level='1'> <content tab-stops='L 96' font-size='36' font-color='g1' font-name='GillSans' paragraph-alignment='center'> <xsl:apply-templates select='slidesinfo/corpauthor/node()' mode='slides'/> </content> </bullet> </xsl:when> <xsl:when test='slidesinfo/author'> <bullet marker-type='inherited' level='1'> <content tab-stops='L 96' font-size='36' font-color='g1' font-name='GillSans' paragraph-alignment='center'> <xsl:apply-templates select='slidesinfo/author' mode='slides'/> </content> </bullet> </xsl:when> </xsl:choose> </bullets> <notes font-size='18' font-name='LucidaGrande'> <xsl:apply-templates select='slidesinfo/*[not(self::title|self::subtitle|self::corpauthor|self::author)]' mode='slides'/> </notes> </slide> <xsl:if test='foilgroup'> <xsl:call-template name='overview'/> </xsl:if> <xsl:apply-templates select='foilgroup|foil' mode='slides'/> </xsl:template> <xsl:template name='overview'> <xsl:param name='current' select='/'/> <slide id='overview-{generate-id()}' master-slide-id="{$masters/apxl:master-slide[@name=$overview-master]/@id}"> <drawables> <body visibility='tracks-master' vertical-alignment='tracks-master'/> <title visibility='tracks-master' vertical-alignment='tracks-master'/> <xsl:for-each select='ancestor-or-self::slides/foilgroup'> <textbox id='textbox-{position()}' grow-horizontally='true' transformation='1 0 0 1 {100 + floor((position() - 1) div 10) * 400} {200 + floor((position() - 1) mod 10) * 50}' size='200 50'> <content tab-stops='L 84' font-size='36' paragraph-alignment='left'> <xsl:attribute name='font-color'> <xsl:choose> <xsl:when test='generate-id() = generate-id($current)'> <xsl:text>1 0.5 0</xsl:text> </xsl:when> <xsl:otherwise>g1</xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:apply-templates select='title' mode='slides'/> </content> </textbox> </xsl:for-each> </drawables> <transition-style type='inherited'/> <thumbnails> <thumbnail file='thumbs/st0.tiff' byte-size='6520' size='60 45'/> </thumbnails> <bullets> <bullet marker-type='inherited' level='0'> <content tab-stops='L 96' font-size='84' font-color='g1' font-name='GillSans' paragraph-alignment='center'>Overview</content> </bullet> </bullets> </slide> </xsl:template> <xsl:template match='author' mode='slides'> <xsl:apply-templates select='firstname/node()' mode='slides'/> <xsl:text> </xsl:text> <xsl:apply-templates select='surname/node()' mode='slides'/> </xsl:template> <xsl:template match='copyright' mode='slides'> <xsl:text>Copyright (c) </xsl:text> <xsl:value-of select='year'/> <xsl:text> </xsl:text> <xsl:apply-templates select='holder' mode='slides'/> <xsl:text>. </xsl:text> </xsl:template> <xsl:template match='foilgroup' mode='slides'> <xsl:variable name='number' select='count(preceding-sibling::foilgroup) + count(preceding::foil) + 1'/> <xsl:call-template name='overview'> <xsl:with-param name='current' select='.'/> </xsl:call-template> <slide id='foilgroup-{generate-id()}'> <xsl:attribute name='master-slide-id'> <xsl:choose> <xsl:when test='*[not(self::foil|self::foilgroupinfo|self::speakernotes)]'> <xsl:value-of select='$masters/apxl:master-slide[@name=$title-only-master]/@id'/> </xsl:when> <xsl:otherwise> <xsl:value-of select='$masters/apxl:master-slide[@name=$foilgroup-master]/@id'/> </xsl:otherwise> </xsl:choose> </xsl:attribute> <drawables> <title visibility='tracks-master' vertical-alignment='tracks-master'/> <body visibility='hidden' vertical-alignment='tracks-master'/> <xsl:call-template name='drawables'/> </drawables> <transition-style type='inherited'/> <thumbnails> <thumbnail file='thumbs/st0.tiff' byte-size='6520' size='60 45'/> </thumbnails> <bullets> <bullet marker-type='inherited' level='0'> <content tab-stops='L 96' font-size='84' font-color='g1' font-name='GillSans' paragraph-alignment='center'> <xsl:apply-templates select='title' mode='slides'/> </content> </bullet> <xsl:apply-templates select='itemizedlist/listitem' mode='slides'/> </bullets> <xsl:if test='speakernotes'> <notes font-size='18' font-name='LucidaGrande'> <xsl:apply-templates select='speakernotes/para[1]/node()' mode='slides'/> <xsl:for-each select='speakernotes/para[position() != 1]'> <xsl:text>; </xsl:text> <xsl:apply-templates select='node()' mode='slides'/> </xsl:for-each> </notes> </xsl:if> </slide> <xsl:apply-templates select='foil' mode='slides'/> </xsl:template> <xsl:template match='foil' mode='slides'> <xsl:variable name='number' select='count(preceding::foilgroup) + count(preceding::foil) + count(preceding-sibling::foil) + 1'/> <slide id='foil-{generate-id()}'> <xsl:attribute name='master-slide-id'> <xsl:choose> <xsl:when test='imageobject'> <xsl:value-of select='$masters/apxl:master-slide[@name=$title-only-master]/@id'/> </xsl:when> <xsl:when test='itemizedlist[.//imageobject]'> <xsl:value-of select='$masters/apxl:master-slide[@name=$bullet-and-image-master]/@id'/> </xsl:when> <xsl:when test='itemizedlist'> <xsl:value-of select='$masters/apxl:master-slide[@name=$bullet-master]/@id'/> </xsl:when> <xsl:when test='example|informalexample'> <xsl:value-of select='$masters/apxl:master-slide[@name=$title-only-master]/@id'/> </xsl:when> <xsl:otherwise> <xsl:value-of select='$masters/apxl:master-slide[@name=$bullet-master]/@id'/> </xsl:otherwise> </xsl:choose> </xsl:attribute> <drawables> <body visibility='tracks-master' vertical-alignment='tracks-master'/> <title visibility='tracks-master' vertical-alignment='tracks-master'/> <xsl:call-template name='drawables'/> </drawables> <transition-style type='inherited'/> <thumbnails> <thumbnail file='thumbs/st0.tiff' byte-size='6520' size='60 45'/> </thumbnails> <bullets> <bullet marker-type='inherited' level='0'> <content tab-stops='L 96' font-size='64' font-color='g1' font-name='GillSans' paragraph-alignment='inherited'> <!-- <xsl:apply-templates select='../title' mode='slides'/> <xsl:text>: </xsl:text> --> <xsl:apply-templates select='title' mode='slides'/> </content> </bullet> <xsl:apply-templates select='itemizedlist/listitem' mode='slides'/> </bullets> <xsl:if test='speakernotes'> <notes font-size='18' font-name='LucidaGrande'> <xsl:apply-templates select='speakernotes/para[1]/node()' mode='slides'/> <xsl:for-each select='speakernotes/para[position() != 1]'> <xsl:text>; </xsl:text> <xsl:apply-templates select='node()' mode='slides'/> </xsl:for-each> </notes> </xsl:if> </slide> </xsl:template> <doc:template xmlns=''> <title>drawables Template This template adds objects to the drawables section of a foil. These include images, as well as unadorned (non-bullet) text. A single image is placed centered on the foil. An image on a foil that contains other text is placed on the right-hand-side. 1.0 video/quicktime {800, 400} {0, 300} {150, 300} {0, 200} {150, 200} ]]> ]]> <![CDATA[ GillSans-Italic GillSans " “ ]]> ]] > < < ]]> ]] > 20 0 AmericanTypewriter-CondensedBoldItalic GillSans-BoldItalic AmericanTypewriter-CondensedItalic GillSans-Italic AmericanTypewriter-CondensedBold GillSans-Bold scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/0000775000175000017500000000000013160023043030340 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/uri.xsl0000664000175000017500000004416013160023043031674 0ustar bdbaddogbdbaddog $Id: uri.xsl 3991 2004-11-10 06:51:55Z balls $ Diamond Jason 2001 Jason Diamond URI (Uniform Resource Identifier) Processing
    Introduction This module provides templates for processing URIs (Uniform Resource Identifers).
    Determines if a URI is absolute or relative. Absolute URIs start with a scheme (like "http:" or "mailto:"). uri An absolute or relative URI. Returns 'true' if the URI is absolute or '' if it's not. Gets the scheme part of a URI. The ':' is not part of the scheme. uri An absolute or relative URI. Returns the scheme (without the ':') or '' if the URI is relative. Gets the authority part of a URI. The authority usually specifies the host machine for a resource. It always follows '//' in a typical URI. uri An absolute or relative URI. Returns the authority (without the '//') or '' if the URI has no authority. Gets the path part of a URI. The path usually comes after the '/' in a URI. uri An absolute or relative URI. Returns the path (with any leading '/') or '' if the URI has no path. Gets the query part of a URI. The query comes after the '?' in a URI. uri An absolute or relative URI. Returns the query (without the '?') or '' if the URI has no query. Gets the fragment part of a URI. The fragment comes after the '#' in a URI. uri An absolute or relative URI. Returns the fragment (without the '#') or '' if the URI has no fragment. Resolves a URI reference against a base URI. This template follows the guidelines specified by RFC 2396. reference A (potentially relative) URI reference. base The base URI. document The URI of the current document. This defaults to the value of the base URI if not specified. The "combined" URI.
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/cmp.xsl0000664000175000017500000002650613160023043031660 0ustar bdbaddogbdbaddog $Id: cmp.xsl 6297 2006-09-14 01:32:27Z xmldoc $ Hummel Mark 2003 Mark Hummel XML Compare
    Introduction This module provides a template for comparing two xml documents.
    Find differences Compare two xml documents and display differences. Two xml documents are defined to be the same if: They have the matching elements and attributes, and that the data in the elements also match. The comparison is order sensitive. The element names from the documents at the current depth are compared, followed by their values, then any attribute names and values are compared. The process is applied then to the subtrees of the documents. Notes: If there are leaf nodes in one nodeset which don't exist in the other, the value of those 'extra' elements won't appear as a difference. ns1 ns2 The two nodesets which are to be compared. Returns the difference between the documents. The format of the output is an xml document. A node is added to the result tree for every difference. The node contains the type of difference (e.g element name difference, attribute value difference, etc), the value in the first nodeset and the value in the second nodeset, and the parent node. The indentation level is the depth at which the difference was found relative to the first document. node[]: Compare Recursively compare two xml nodesets, stop when a difference is found and return false. Otherwise return true if the document is identical. The element names from the documents at the current depth are compared, followed by their values, then any attribute names and values are compared. The process is applied then to the subtrees of the documents. Notes: If there are leaf nodes in one nodeset which don't exist in the other, the value of those 'extra' elements won't appear as a difference. ns1 ns2 The two nodesets which are to be compared. False when the nodesets are not identical, empty otherwise.
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/stdlib.xsl0000664000175000017500000003236313160023043032360 0ustar bdbaddogbdbaddog ]> XSLT Standard Library Version &version; Ball Steve 2004 2002 Steve Ball The XSLT Standard Library, xsltsl, provides the XSLT developer with a set of XSLT templates for commonly used functions. These are implemented purely in XSLT, that is they do not use any extensions. xsltsl is a SourceForge project. SourceForge Logo Goals of the xsltsl project include: Provision of a high-quality library of XSLT templates, suitable for inclusion by vendors in XSLT processor software products. Demonstration of best practice in XSLT stylesheet development and documentation. Provide examples of various techniques used to develop XSLT stylesheets (ie. a working FAQ). Using The Library There are two ways of using the library: Use a local copy of the library. Download the distribution (see below). Unpack the distribution, using either gunzip/tar or unzip. In your stylesheet import or include either the main stylesheet, stdlib.xsl, or the stylesheet module you wish to use, such as string.xsl. This example assumes that the distribution has been extracted into the same directory as your own stylesheet: ]]> Import or include either the main stylesheet, or the stylesheet module you wish to use, directly from the library website; http://xsltsl.sourceforge.net/modules/. The modules directory always contains the latest stable release. For example: ]]> Older versions of the library are available in subdirectories. For example, to access version 1.1 of the library use: ]]> Next, add XML Namespace declarations for the modules you wish to use. For example, to use templates from the string module, your stylesheet should have the following declaration: ]]> Finally, use a template with the call-template element. Most templates require parameters, which are passed using the with-param element. For example: a word another word
    ]]> Obtaining The Library The XSLT Standard Library is available for download as either: Gzip'd tarball: http://prdownloads.sourceforge.net/xsltsl/xsltsl-&version;.tar.gz Zip file: http://prdownloads.sourceforge.net/xsltsl/xsltsl-&version;.zip Getting Involved Contributions to the project are most welcome, and may be in the form of stylesheet modules, patches, bug reports or sample code. Any contributed code must use the LGPL license to be accepted into the library. See the SourceForge Project Page http://sourceforge.net/projects/xsltsl/ for information on the development of the project. Bug reports may be submitted here. See the project Web Page http://xsltsl.sourceforge.net/ for documentation. There are three mailing lists for the project: xsltsl-users@lists.sourceforge.net Discussion of the use of xsltsl. xsltsl-devel@lists.sourceforge.net Discussion of the development of xsltsl. xsltsl-announce@lists.sourceforge.net Project announcements. XML Namespaces Apart from the XSLT XML Namespace (http://www.w3.org/1999/XSL/Transform), xsltsl employs a number of XML Namespaces to allow inclusion of the library in developer stylesheets. In addition, documentation is defined in a separate namespace. Each module is allocated a namespace URI by appending the module name to the URI for the project, http://xsltsl.org/. For example, the string module has the namespace URI http://xsltsl.org/string. All documentation is written using an extension of DocBook designed for embedding DocBook into XSLT stylesheets. The namespace URI for DocBook embedded in stylesheets is http://xsltsl.org/xsl/documentation/1.0 Engineering Standards In order to maintain a high engineering standard, all modules and contributions to the xsltsl project must adhere to the following coding and documentation standards. Submissions which do not meet (or exceed) this standard will not be accepted. All stylesheets must be indented, with each level indented by two spaces. NB. a simple stylesheet could be used to enforce/fix this. Templates are named using a qualified name (QName). The namespace URI for the template's containing stylesheet is assigned as above. Parameters for templates should use sensible names. Where possible (or if in doubt), follow these conventions: A parameter containing a single node is named node. Where more than one parameter contains a single node, the suffix Node is appended to the parameter name, eg. referenceNode A parameter which potentially contains multiple nodes is named nodes. Where more than one parameter potentially contains multiple nodes, the suffix Nodes is appended to the parameter name, eg. copyNodes A parameter which contains a string value is named text. All templates in each stylesheet must be documented. A template is documented as a DocBook RefEntry. Every stylesheet must include a test suite. The test system is in the test subdirectory. See test/test.html for further details. An example stylesheet has been provided, which acts as a template for new stylesheet modules. Related Work The EXSLT project is creating a library to standardise extension functions. The XSLT Standard Library is complementary to the EXSLT project. Reference Documentation Reference documentation is available for each module.
    String Processing string.xsl
    Nodes node.xsl
    Date/Time Processing date-time.xsl
    Mathematics math.xsl
    URI (Uniform Resource Identifier) Processing uri.xsl
    Comparing Nodesets cmp.xsl
    Generating XML Markup markup.xsl
    Presentation Media Support Scalable Vector Graphics: svg.xsl
    Example example.xsl
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/svg.xsl0000664000175000017500000001574713160023043031705 0ustar bdbaddogbdbaddog $Id: svg.xsl 3991 2004-11-10 06:51:55Z balls $ Ball Steve 2002 Steve Ball SVG Stylesheet
    Introduction This module provides templates for creating SVG images.
    Aqua-style Button Part of the mechanism to create an Aqua-style button. Include a call to this template in your SVG document's defs element. This template only needs to be included once. Use this in conjunction with svg:aqua-button. The default values for color1, color2 and color3 result in a grey button. prefix A prefix to append to the identifiers used, so that they don't clash with other identifiers. Default: "aqua-". color1 The base colour of the button. Default: "#d9d9d9". color2 A "background" colour for the button. Should be a darker colour than color1. Default: "#a9a9a9". color3 A highlight colour for the button. Should be a lighter colour than color1. Default: "#f9f9f9". Returns SVG result-tree-fragment. Aqua-style Button Part of the mechanism to create an Aqua-style button. Include a call to this template in your SVG document where you want a button to appear. This template can be used many times in a single SVG document. Use this in conjunction with svg:aqua-button-defs. prefix A prefix to append to the identifiers used, so that they don't clash with other identifiers. Default: "aqua-". Returns SVG result-tree-fragment.
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/string.xsl0000664000175000017500000014161013160023043032401 0ustar bdbaddogbdbaddog $Id: string.xsl 3991 2004-11-10 06:51:55Z balls $ Ball Steve 2002 2001 Steve Ball String Processing
    Introduction This module provides templates for manipulating strings.
    Make string uppercase Converts all lowercase letters to uppercase. text The string to be converted Returns string with all uppercase letters. ß S S Make string lowercase Converts all uppercase letters to lowercase. text The string to be converted Returns string with all lowercase letters. Capitalise string Converts first character of string to an uppercase letter. All remaining characters are converted to lowercase. text The string to be capitalised all Boolean controlling whether all words in the string are capitalised. Default is true. Returns string with first character uppcase and all remaining characters lowercase. Convert a string to one camelcase word Converts a string to one lowerCamelCase or UpperCamelCase word, depending on the setting of the "upper" parameter. UpperCamelCase is also called MixedCase while lowerCamelCase is also called just camelCase. The template removes any spaces, tabs and slashes, but doesn't deal with other punctuation. It's purpose is to convert strings like "hollow timber flush door" to a term suitable as identifier or XML tag like "HollowTimberFlushDoor". text The string to be capitalised upper Boolean controlling whether the string becomes an UpperCamelCase word or a lowerCamelCase word. Default is true. Returns string with first character uppcase and all remaining characters lowercase. String extraction Extracts the portion of string 'text' which occurs before any of the characters in string 'chars'. text The string from which to extract a substring. chars The string containing characters to find. Returns string. String extraction Extracts the portion of string 'text' which occurs after the last of the character in string 'chars'. text The string from which to extract a substring. chars The string containing characters to find. Returns string. String extraction Extracts the portion of string 'text' which occurs before the first character of the last occurance of string 'chars'. text The string from which to extract a substring. chars The string containing characters to find. Returns string. String substitution Substitute 'replace' for 'with' in string 'text'. text The string upon which to perform substitution. replace The string to substitute. with The string to be substituted. disable-output-escaping A value of yes indicates that the result should have output escaping disabled. Any other value allows normal escaping of text values. The default is to enable output escaping. Returns string. no Count Substrings Counts the number of times a substring occurs in a string. This can also counts the number of times a character occurs in a string, since a character is simply a string of length 1. Counting Lines ]]> text The source string. chars The substring to count. Returns a non-negative integer value. 0 0 String extraction Extracts the portion of a 'char' delimited 'text' string "array" at a given 'position'. text The string from which to extract a substring. chars delimiters position position of the elements all If true all of the remaining string is returned, otherwise only the element at the given position is returned. Default: false(). Returns string. String extraction Extracts the portion of a 'char' delimited 'text' string "array" at a given 'position' text The string from which to extract a substring. chars delimiters position position of the elements Returns string. String insertion Insert 'chars' into "text' at any given "position' text The string upon which to perform insertion position the position where insertion will be performed with The string to be inserted Returns string. String reversal Reverse the content of a given string text The string to be reversed Returns string. Format a string Inserts newlines and spaces into a string to format it as a block of text. text String to be formatted. max Maximum line length. indent Number of spaces to insert at the beginning of each line. justify Justify left, right or both. Not currently implemented (fixed at "left"). Formatted block of text. Find first occurring character in a string Finds which of the given characters occurs first in a string. text The source string. chars The characters to search for. Match A String To A Pattern Performs globbing-style pattern matching on a string. Match Pattern ]]> text The source string. pattern The pattern to match against. Certain characters have special meaning: * Matches zero or more characters. ? Matches a single character. \ Character escape. The next character is taken as a literal character. Returns "1" if the string matches the pattern, "0" otherwise. 1 1 0 0 1 0 1 0 0 Create A Repeating Sequence of Characters Repeats a string a given number of times. text The string to repeat. count The number of times to repeat the string.
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/math.xsl0000664000175000017500000006106513160023043032031 0ustar bdbaddogbdbaddog $Id: math.xsl 3991 2004-11-10 06:51:55Z balls $ Ball Steve 2004 2002 Steve Ball Math Module
    Introduction This module provides mathematical functions.
    Power Raises a number to a power. base The base number. Must be a number. power The power to raise the number to. Must be an integer. Returns base multiplied by itself power times. If the base or power are not numbers or if the power is fractional then an empty string is returned. 1 1 0 Absolute Value Absolute value of a number. number The number. Must be a number. Returns the absolute value of the number. Conversion Converts a hexidecimal value to a decimal value. value The hexidecimal number. Must be a number in hexidecimal format. Returns the value as a decimal string. If the value is not a number then a NaN value is returned. 10 11 12 13 14 15 Conversion Converts a decimal value to a hexidecimal value. value The decimal number. Returns the value as a hexidecimal string (lowercase). If the value is not a number then a NaN value is returned. 0 NaN a b c d e f Ordinal number Gives the ordinal number of a given counting number. For example, 1 becomes "1st". number An integer number. Returns the number with an ordinal suffix. th st nd rd th Returns an ordinal number This template returns the ordinal number for a given counting number as a word. For example "first" for 1. Only handles numbers less than 10000000 (ten million). number The counting number. conjunctive Whether to add the word "and" to the result, for example "one hundred and first" rather than "one hundred first". Default is "yes". Returns the ordinal number as a string. zeroth and first and second and third and fourth and fifth and sixth and seventh and eighth and ninth and tenth and eleventh and twelveth and thirteenth and fourteenth and fifteenth and sixteenth and seventeenth and eighteenth and nineteenth and twentieth and thirtieth and fortieth and fiftieth and sixtieth and seventieth and eightieth and ninetieth millionth and thousandth and hundredth and and and and Returns a number as a word This template returns the word for a given integer number, for example "one" for 1. Only handles numbers less than 10000000 (ten million). number The counting number. conjunctive Adds the word "and" where appropriate, for example. Returns the number as a string. zero minus million million thousand thousand and hundred hundred and one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty thirty forty fifty sixty seventy eighty ninety
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/example.xsl0000664000175000017500000000522313160023043032525 0ustar bdbaddogbdbaddog $Id: example.xsl 3991 2004-11-10 06:51:55Z balls $ Ball Steve 2001 Steve Ball Example Stylesheet
    Introduction This module provides a template for adding stylesheet modules to the XSLT Standard Library. To add a new module to the library, follow these easy steps: Copy this file and replace its contents with the new module templates and documentation. Copy the corresponding test file in the test directory. Replace its contents with tests for the new module. Add an include element in the stdlib.xsl stylesheet. Add an entry in the test/test.xml file. Add entries in the test/test.xsl stylesheet. Add an entry in the doc/build.xml file. The example.xsl stylesheet provides a more extensive example.
    Template Example Provides a template for writing templates. Replace this paragraph with a description of your template text The example string Returns nothing.
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/date-time.xsl0000664000175000017500000014063213160023043032747 0ustar bdbaddogbdbaddog $Id: date-time.xsl 3991 2004-11-10 06:51:55Z balls $ Diamond Jason 2004 Steve Ball 2001 Jason Diamond Date/Time Processing
    Introduction This module provides templates for formatting and parsing date/time strings. See http://www.tondering.dk/claus/calendar.html for more information on calendars and the calculations this library performs.
    Returns a string with a formatted date/time. The formatted date/time is determined by the format parameter. The default format is %Y-%m-%dT%H:%M:%S%z, the W3C format. xsd-date-time The date-time value in XML Schemas (WXS) format. If this value is specified, it takes priority over other parameters. year Year, in either 2 or 4+ digit format.. If the year is given as a two digit value, it will be converted to a four digit value using the fixed window method. Values between 00 and 49 will be prepended by "20". Values between 50 and 99 will be prepended by "19". month Month (1 - 12; January = 1) day Day of month (1 - 31) hour Hours since midnight (0 - 23) minute Minutes after hour (0 - 59) second Seconds after minute (0 - 59) time-zone Time zone string (e.g., 'Z' or '-08:00') format The format specification. %a Abbreviated weekday name %A Full weekday name %b Abbreviated month name %B Full month name %c Date and time representation appropriate for locale %d Day of month as decimal number (01 - 31) %e Day of month as decimal number (1 - 31) %H Hour in 24-hour format (00 - 23) %I Hour in 12-hour format (01 - 12) %i Hour in 12-hour format (1 - 12) %j Day of year as decimal number (001 - 366) %m Month as decimal number (01 - 12) %n Month as decimal number (1 - 12) %M Minute as decimal number (00 - 59) %P Current locale's A.M./P.M. indicator for 12-hour clock, uppercase %Q Current locale's A.M./P.M. indicator for 12-hour clock, uppercase with periods %p Current locale's A.M./P.M. indicator for 12-hour clock, lowercase %q Current locale's A.M./P.M. indicator for 12-hour clock, lowercase with periods %S Second as decimal number (00 - 59) %U Week of year as decimal number, with Sunday as first day of week (00 - 53) %w Weekday as decimal number (0 - 6; Sunday is 0) %W Week of year as decimal number, with Monday as first day of week (00 - 53) %x Date representation for current locale %X Time representation for current locale %y Year without century, as decimal number (00 - 99) %Y Year with century, as decimal number %z Time-zone name or abbreviation; no characters if time zone is unknown %% Percent sign Returns a formatted date/time string. % [not implemented] 0 0 12 0 0 12 [not implemented] 0 0 am pm am p.m. AM PM AM P.M. 0 [not implemented] [not implemented] invalid year value 00 invalid year value invalid year value % Calculates the day of the week. Given any Gregorian date, this calculates the day of the week. year Year month Month (1 - 12; January = 1) day Day of month (1 - 31) Returns the day of the week (0 - 6; Sunday = 0). Calculates the number of days for a specified month. Given any Gregorian month, this calculates the last day of the month. year Year month Month (1 - 12; January = 1) Returns the number of days in given month as a decimal number. 29 28 30 31 30 31 Gets the day of the week's full name. Converts a numeric day of the week value into a string representing the day's full name. day-of-the-week Day of the week (0 - 6; Sunday = 0) Returns a string. Sunday Monday Tuesday Wednesday Thursday Friday Saturday error: Gets the day of the week's abbreviation. Converts a numeric day of the week value into a string representing the day's abbreviation. day-of-the-week Day of the week (0 - 6; Sunday = 0) Returns a string. Sun Mon Tue Wed Thu Fri Sat error: Gets the month's full name. Converts a numeric month value into a string representing the month's full name. month Month (1 - 12; Januaray = 1) Returns a string. January February March April May June July August September October November December error: Gets the month's abbreviation. Converts a numeric month value into a string representing the month's abbreviation. month Month (1 - 12; Januaray = 1) Returns a string. Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec error: Calculates the Julian Day for a specified date. Given any Gregorian date, this calculates the Julian Day. year Year month Month (1 - 12; January = 1) day Day of month (1 - 31) Returns the Julian Day as a decimal number. Returns a string with a formatted date for a specified Julian Day. Given any Julian Day, this returns a string according to the format specification. julian-day A Julian Day format The format specification. See dt:format-date-time for more details. A string. Calculates the week number for a specified date. Assumes Monday is the first day of the week. year Year month Month (1 - 12; January = 1) day Day of month (1 - 31) Returns the week number as a decimal number. Take a month by name and return a number which can be used as input to the templates. Input month Month as described either by full name or abbreviation. Return a month as a decimal number. (Jan = 1) Return year component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns year component. Return month component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns month component. Return day component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns day component. Return hour component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns hour component. Return minute component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns minute component. Return second component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns second component. Return timezone component of XSD DateTime value. Extract component of XML Schemas DateTime value. xsd-date-time A value in XSD DateTime format. Returns timezone component. Z + - Return two digit year as four digit year value. Prepend century to two digit year value. Century value is calculated according to suggested solutions in RFC2626 (section 5). Fixed window solution: 20 is prepended to year if the year is less than 50, otherwise 19 is prepended to year. Sliding window solution: The year is considered in the future if the year is less than the current 2 digit year plus 'n' years (where 'n' is a param), otherwise it is considered in the past. year A year value in 2 digit format. method RFC2626 suggested solution ('fixed' or 'sliding'). Default is 'fixed'. n No. of years. Used in sliding windows solution. Returns four digit year value. invalid year value 20 19 not yet implemented invalid method
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/node.xsl0000664000175000017500000001443313160023043032022 0ustar bdbaddogbdbaddog $Id: node.xsl 3991 2004-11-10 06:51:55Z balls $ Ball Steve 2001 Steve Ball Node Templates
    Introduction This stylesheet module provides functions for reporting on or manipulating nodes and nodesets.
    Returns an XPath location path This template returns an XPath location path that uniquely identifies the given node within the document. node The node to create an XPath for. If this parameter is given as a nodeset, then the first node in the nodeset is used. Returns an XPath location path as a string. / [] /comment() [] /processing-instruction() [] /text() [] / /namespace:: /@ /.. Return node type Returns the type of a node as a string. node The node to get the type for. If this parameter is given as a nodeset, then the first node in the nodeset is used. Returns node type as a string. Values returned are: Element element Text Node text Comment comment Processing Instruction processing instruction element text comment processing instruction root namespace attribute Copy Nodes Makes a copy of the given nodes, including attributes and descendants. nodes The nodes to copy. Returns the copied nodes as a result tree fragment.
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/slides/keynote/xsltsl/markup.xsl0000664000175000017500000005757413160023043032411 0ustar bdbaddogbdbaddog $Id: markup.xsl 3991 2004-11-10 06:51:55Z balls $ Ball Steve 2003 2001 Steve Ball XML Markup Templates
    Introduction This stylesheet module provides functions for generating literal XML markup.
    Create an XML Declaration This template returns an XML Declaration. Although the XSLT standard provides control over the generation of the XML Declaration, this template may be useful in circumstances where the values must be computed at runtime. version Version number. standalone Standalone indication. Must be value "yes" or "no". encoding Character encoding. Returns an XML Declaration as a string. <?xml version=" " standalone=" " invalid value "" for standalone attribute encoding=" " ?> Create a Document Type Declaration This template returns a Document Type Declaration. Although the XSLT standard provides control over the generation of a Document Type Declaration, this template may be useful in circumstances where the values for the identifiers or the internal subset must be computed at runtime. docel The name of the document element. publicid The public identifier for the external DTD subset. systemid The system identifier for the external DTD subset. internaldtd The internal DTD subset. Returns a Document Type Declaration as a string. No document element specified <!DOCTYPE [ ] > Create an Element Declaration This template returns an element declaration.. type The element type. content-spec The content specification. Returns an element declaration as a string. element type must be specified content specification must be specified <!ELEMENT > Create an Attribute List Declaration This template returns an attribute list declaration. type The element type. attr-defns Attribute definitions. Returns an attribute list declaration as a string. element type must be specified <!ATTLIST > Create an Attribute Definition This template returns an attribute definition. name The attribute name. type The attribute type. default The attribute default. Returns an attribute definition as a string. attribute name must be specified attribute type must be specified attribute default must be specified Create an Entity Declaration This template returns an entity declaration. If the 'text' parameter is given a value, then an internal entity is created. If either the 'publicid' or 'systemid' parameters are given a value then an external entity is created. It is an error for the 'text' parameter to have value as well as the 'publicid', 'systemid' or 'notation' parameters. name The entity name. parameter Boolean value to determine whether a parameter entity is created. Default is 'false()'. text The replacement text. Must be a string. nodes The replacement text as a nodeset. The nodeset is formatted as XML using the as-xml template. If both text and nodes are specified then nodes takes precedence. publicid The public identifier for an external entity. systemid The system identifier for an external entity. notation The notation for an external entity. Returns an entity declaration as a string. entity name must be specified both replacement text and external identifier specified <!ENTITY % NDATA " " > Quote an Attribute Value This template returns a quoted value. value The value to quote. Returns a quote value as a string. < &lt; " ' " " &quot; " ' ' " " Create an External Identifier This template returns an external identifier. publicid The public identifier. systemid The system identifier. Returns an external identifier as a string. PUBLIC " " " " SYSTEM " " Create an Entity Reference This template returns an entity reference. name The name of the entity. Returns an entity reference as a string. & ; Create a Notation Declaration This template returns a notation declaration. name The notation name. publicid The public identifier for the notation. systemid The system identifier for the notation. Returns a notation declaration as a string. notation name must be specified external identifier must be specified <!NOTATION > Create a CDATA Section This template returns a CDATA Section. The XSLT specification provides a mechanism for instructing the XSL processor to output character data in a CDATA section for certain elements, but this template may be useful in those circumstances where not all instances of an element are to have their content placed in a CDATA section. text The content of the CDATA section. Returns a CDATA section as a string. CDATA section contains "]]>" <![CDATA[ ]]> Format Nodeset As XML Markup This template returns XML markup. Each node in the given nodeset is converted to its equivalent XML markup. BUG: This version may not adequately handle XML Namespaces. nodes Nodeset to format as XML. Returns XML markup. < = > </ > /> <!-- --> <? ?>
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/tests/0000775000175000017500000000000013160023043025210 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/tests/refentry.007.xml0000664000175000017500000002436713160023043030111 0ustar bdbaddogbdbaddog Unit Test: refentry.007 $Id: refentry.007.xml 7282 2007-08-23 09:27:01Z xmldoc $ NormanWalsh
    ndw@nwalsh.com
    Reference NormanWalsh ndw@nwalsh.com Wrote the original version of this document. Added a bunch of test cases. Michael(tm)Smith smith@sideshowbarker.net 2003 Norman Walsh 2006 Michael(tm) Smith This file is a product of the DocBook Project. Share and share alike. FirstName SecondName Purpose for FirstName ThirdName Purpose for ThirdName #include <varargs.h> #include <mouteyh.h> #include <qlmppzj.h> float rand int max int idiv int n int m Another. void qsort void *dataptr[] int left int right int (*comp) void *, void * int foo_frob_something foo_sometype1 foo_frob_parm1 foo_sometype1 foo_frob_parm2 foo_sometype1 foo_frob_parm3 int (* parm4 ) int a, int b, int c foo_sometype1 foo_frob_parm5 int foo_frob_something foo_sometype1 foo_frob_parm1 foo_sometype1 foo_frob_parm2 foo_sometype1 foo_frob_parm3 int (* parm4 ) int a, int b, int c foo_sometype1 foo_frob_parm5 Description This is a minimal RefEntry. The following is a Variablelist with a title. My variablelist varlistentry term 1 some listitem text varlistentry term 2 some more listitem text Subsection This is a minimal RefEntry. The following is a Variablelist with a title and a nested variablelist My glosslist glossentry term 1 some glossdef text glossentry term 2 nested variablelist term 1 some variablelist text nested variablelist term 2 some more variablelist text Sub-subsection This is a minimal RefEntry. More Description This is a not-so minimal RefEntry. This is a screen [break here] that starts with a line of space. [break here] And it ends with a line of space. normal paragraph here This is a screen [break here] that does not start with a line of space. [break here] And does not end with a line of space. This is a normal paragraph that contains a screen. This is a screen within a normal paragraph [break here] that does not start with a line of space. [break here] And does not end with a line of space but is followed by a line of space. This is another normal paragraph that contains a screen. This is a screen within a normal paragraph [break here] that does not start with a line of space. [break here] And does not end with a line of space and is not followed by a line of space. This is another normal paragraph that contains a screen. This is a screen within a normal paragraph [break here] that starts with a line of space. [break here] And ends with a line of space but is not followed by a line of space. This is another normal paragraph that contains a screen. This is a screen within a normal paragraph [break here] that starts with a line of space. [break here] And ends with a line of space and is followed by a line of space. This is another normal paragraph that contains a screen. This is a screen within a normal paragraph [break here] that starts with a 2 lines of space. [break here] And ends with 3 lines of space and is followed by a line of space. This paragraph contains an itemizedlist with a title. The title is “Mrignkwolmcngâ€. Mrignkwolmcng itemizedlist listitem 1 itemizedlist listitem 2 This is some useless text that follows the “Mrignkwolmcng†orderedlist in the same para. The following is a Variablelist with a title and with a nested itemizedlist. My variablelist varlistentry term 1 nested itemizedlist itemizedlist listitem 1 itemizedlist listitem 2 varlistentry term 2 some more listitem text The following is a Variablelist with a title and with a nested Varlistentry that contains multiple Terms My nested-multi-term-per-varlistentry variablelist Varlistentry term 1 varlistentry term 1.1 varlistentry term 1.2 varlistentry term 1.3 All 'bout terms 1.1, 1.2, and 1.3 varlistentry term 2 some more listitem text Subsection This is a minimal RefEntry. Even More Description This is an even less minimal RefEntry. This is a paragraph. It contains the following segmentedlist, titled “Gibbererishâ€, with several segtitle elements. Gibbererish Floober Buugler Sstangooo Borobinda Bamalalaboonda Bamalalaboonda Bamalalaboonda Bamalalaboonda Bamalalaboonda Bamalalaboonda Mondorotoluafu Ganafutralinga Patagularamakundra Cadraracondar Hentirotomaambu BdomentriolaiaBdomentriolaiaBdomentriolaia Candamalaturuanio This is some text that follows the segementedlist within the same paragraph. The next part of this same paragraph is an important admonition. It is very important that you read this. That’s why it stands out the way that it does. This is a para with a footnote Stuff here This is a program listing that's two lines long. and stuff after the footnote
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/tests/refentry.007.ns.xml0000664000175000017500000002440713160023043030523 0ustar bdbaddogbdbaddog Unit Test: refentry.007 $Id: refentry.007.xml 7282 2007-08-23 09:27:01Z xmldoc $ NormanWalsh
    ndw@nwalsh.com
    Reference NormanWalshndw@nwalsh.com Wrote the original version of this document. Michael(tm)SmithAdded a bunch of test cases.smith@sideshowbarker.net 2003 Norman Walsh 2006 Michael(tm) Smith This file is a product of the DocBook Project. Share and share alike. FirstName SecondName Purpose for FirstName ThirdName Purpose for ThirdName #include <varargs.h> #include <mouteyh.h> #include <qlmppzj.h> float rand int max int idiv int n int m Another. void qsort void *dataptr[] int left int right int (*comp) void *, void * int foo_frob_something foo_sometype1 foo_frob_parm1 foo_sometype1 foo_frob_parm2 foo_sometype1 foo_frob_parm3 int (* parm4 ) int a, int b, int c foo_sometype1 foo_frob_parm5 int foo_frob_something foo_sometype1 foo_frob_parm1 foo_sometype1 foo_frob_parm2 foo_sometype1 foo_frob_parm3 int (* parm4 ) int a, int b, int c foo_sometype1 foo_frob_parm5 Description This is a minimal RefEntry. The following is a Variablelist with a title. My variablelist varlistentry term 1 some listitem text varlistentry term 2 some more listitem text Subsection This is a minimal RefEntry. The following is a Variablelist with a title and a nested variablelist glossentry term 1 some glossdef text glossentry term 2 nested variablelist term 1 some variablelist text nested variablelist term 2 some more variablelist text Sub-subsection This is a minimal RefEntry. More Description This is a not-so minimal RefEntry. This is a screen [break here] that starts with a line of space. [break here] And it ends with a line of space. normal paragraph here This is a screen [break here] that does not start with a line of space. [break here] And does not end with a line of space. This is a normal paragraph that contains a screen. This is a screen within a normal paragraph [break here] that does not start with a line of space. [break here] And does not end with a line of space but is followed by a line of space. This is another normal paragraph that contains a screen. This is a screen within a normal paragraph [break here] that does not start with a line of space. [break here] And does not end with a line of space and is not followed by a line of space. This is another normal paragraph that contains a screen. This is a screen within a normal paragraph [break here] that starts with a line of space. [break here] And ends with a line of space but is not followed by a line of space. This is another normal paragraph that contains a screen. This is a screen within a normal paragraph [break here] that starts with a line of space. [break here] And ends with a line of space and is followed by a line of space. This is another normal paragraph that contains a screen. This is a screen within a normal paragraph [break here] that starts with a 2 lines of space. [break here] And ends with 3 lines of space and is followed by a line of space. This paragraph contains an itemizedlist with a title. The title is “Mrignkwolmcngâ€. Mrignkwolmcng itemizedlist listitem 1 itemizedlist listitem 2 This is some useless text that follows the “Mrignkwolmcng†orderedlist in the same para. The following is a Variablelist with a title and with a nested itemizedlist. My variablelist varlistentry term 1 nested itemizedlist itemizedlist listitem 1 itemizedlist listitem 2 varlistentry term 2 some more listitem text The following is a Variablelist with a title and with a nested Varlistentry that contains multiple Terms My nested-multi-term-per-varlistentry variablelist Varlistentry term 1 varlistentry term 1.1 varlistentry term 1.2 varlistentry term 1.3 All 'bout terms 1.1, 1.2, and 1.3 varlistentry term 2 some more listitem text Subsection This is a minimal RefEntry. Even More Description This is an even less minimal RefEntry. This is a paragraph. It contains the following segmentedlist, titled “Gibbererishâ€, with several segtitle elements. Floober Buugler Sstangooo Borobinda Bamalalaboonda Bamalalaboonda Bamalalaboonda Bamalalaboonda Bamalalaboonda Bamalalaboonda Mondorotoluafu Ganafutralinga Patagularamakundra Cadraracondar Hentirotomaambu BdomentriolaiaBdomentriolaiaBdomentriolaia Candamalaturuanio This is some text that follows the segementedlist within the same paragraph. The next part of this same paragraph is an important admonition. It is very important that you read this. That’s why it stands out the way that it does. This is a para with a footnote Stuff here This is a program listing that's two lines long. and stuff after the footnote
    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/0000775000175000017500000000000013160023042025312 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/colorsvg/0000775000175000017500000000000013160023042027150 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/colorsvg/prev.svg0000664000175000017500000007436613160023042030665 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/colorsvg/note.svg0000664000175000017500000004327113160023042030645 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/colorsvg/home.svg0000664000175000017500000014747113160023042030637 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/colorsvg/up.svg0000664000175000017500000007472013160023042030327 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/colorsvg/tip.svg0000664000175000017500000010111613160023042030465 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/colorsvg/next.svg0000664000175000017500000007466013160023042030664 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/colorsvg/important.svg0000664000175000017500000004655113160023042031721 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/colorsvg/warning.svg0000664000175000017500000004132213160023042031340 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/colorsvg/caution.svg0000664000175000017500000002610713160023042031341 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/prev.svg0000664000175000017500000000202013160023042027001 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/note.svg0000664000175000017500000000333313160023042027002 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/home.svg0000664000175000017500000000400313160023042026760 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/0000775000175000017500000000000013160023042027140 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/4.svg0000664000175000017500000000141713160023042030027 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/29.svg0000664000175000017500000000260713160023042030120 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/10.svg0000664000175000017500000000202613160023041030100 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/17.svg0000664000175000017500000000154213160023041030111 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/14.svg0000664000175000017500000000161213160023041030104 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/25.svg0000664000175000017500000000243213160023041030107 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/20.svg0000664000175000017500000000234113160023041030101 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/30.svg0000664000175000017500000000255313160023042030110 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/23.svg0000664000175000017500000000260313160023041030105 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/5.svg0000664000175000017500000000170713160023042030032 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/12.svg0000664000175000017500000000203313160023041030100 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/7.svg0000664000175000017500000000134213160023042030027 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/3.svg0000664000175000017500000000205313160023042030023 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/22.svg0000664000175000017500000000237213160023041030107 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/11.svg0000664000175000017500000000147313160023041030106 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/2.svg0000664000175000017500000000163613160023041030027 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/9.svg0000664000175000017500000000206213160023042030031 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/13.svg0000664000175000017500000000224613160023041030107 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/16.svg0000664000175000017500000000232413160023041030107 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/1.svg0000664000175000017500000000127713160023041030027 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/27.svg0000664000175000017500000000207313160023041030112 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/26.svg0000664000175000017500000000266313160023041030116 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/15.svg0000664000175000017500000000207613160023041030112 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/28.svg0000664000175000017500000000303213160023042030110 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/21.svg0000664000175000017500000000203513160023041030102 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/8.svg0000664000175000017500000000230013160023042030023 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/19.svg0000664000175000017500000000225513160023041030115 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/18.svg0000664000175000017500000000247313160023041030116 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/6.svg0000664000175000017500000000213613160023042030030 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/callouts/24.svg0000664000175000017500000000215113160023041030104 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/up.svg0000664000175000017500000000202013160023042026451 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/tip.svg0000664000175000017500000000464213160023042026635 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/next.svg0000664000175000017500000000202013160023042027003 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/important.svg0000664000175000017500000000233413160023042030052 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/warning.svg0000664000175000017500000000217513160023042027505 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/images/caution.svg0000664000175000017500000000233413160023042027477 0ustar bdbaddogbdbaddog ]> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/htmlhelp/0000775000175000017500000000000013160023041025661 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/htmlhelp/htmlhelp.xsl0000664000175000017500000000163413160023041030232 0ustar bdbaddogbdbaddog scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/htmlhelp/profile-htmlhelp.xsl0000664000175000017500000000165413160023041031672 0ustar bdbaddogbdbaddog ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/htmlhelp/profile-htmlhelp-common.xslscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/htmlhelp/profile-htmlhelp-common.xs0000664000175000017500000011435513160023041033007 0ustar bdbaddogbdbaddog Note: namesp. cut : stripped namespace before processingNote: namesp. cut : processing stripped document ID ' ' not found in document. Formatting from 0x 0x [OPTIONS] Auto Index=Yes Binary TOC=Yes Compatibility=1.1 or later Compiled file= Contents file= Default Window= Default topic= Display compile progress= No Yes Full-text search=Yes Index file= Language= Title= Enhanced decompilation= Yes No [WINDOWS] =" "," ", " " ," ", " " , " " , " " , " " , " " , ,, ,,,,,,,,0 [FILES] [ALIAS] #include [MAP] #include 1 0 0 1
    • -toc
    • -toc
    , , <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1"> <!-- Sitemap 1.0 --> </HEAD><BODY> <OBJECT type="text/site properties"> </OBJECT> <UL> </UL> </BODY></HTML>
  • #define = 0 1 2 3 4 5 6 7 8 9 A B C D E F

    scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/htmlhelp/htmlhelp-common.xsl0000664000175000017500000011337313160023041031524 0ustar bdbaddogbdbaddog '> ]> Note namesp. cut stripped namespace before processing Note namesp. cut processing stripped document ID ' ' not found in document. Formatting from 0x 0x [OPTIONS] Auto Index=Yes Binary TOC=Yes Compatibility=1.1 or later Compiled file= Contents file= Default Window= Default topic= Display compile progress= No Yes Full-text search=Yes Index file= Language= Title= Enhanced decompilation= Yes No [WINDOWS] =" "," ", " " ," ", " " , " " , " " , " " , " " , ,, ,,,,,,,,0 [FILES] [ALIAS] #include [MAP] #include 1 0 0 1 &lf; &lf; &lf; &lf; &lf; &lf;
      &lf;
    &lf;
  • &lf; &lf;
  • &lf;
    • &lf; &lf; -toc
    • &lf;
    &lf;
    • &lf; &lf; -toc
    • &lf;
    &lf;
      &lf;
      &lf;
      &lf;
      &lf;
      &lf;
      &lf;
      &lf;
    , , ").addClass("ui-autocomplete").appendTo("body",c).mousedown(function(){setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(d,b){b=b.item.data("item.autocomplete"); false!==a._trigger("focus",null,{item:b})&&/^key/.test(d.originalEvent.type)&&a.element.val(b.value)},selected:function(d,b){b=b.item.data("item.autocomplete");false!==a._trigger("select",d,{item:b})&&a.element.val(b.value);a.close(d);d=a.previous;if(a.element[0]!==c.activeElement){a.element.focus();a.previous=d}a.selectedItem=b},blur:function(){a.menu.element.is(":visible")&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");e.fn.bgiframe&&this.menu.element.bgiframe()}, destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();e.Widget.prototype.destroy.call(this)},_setOption:function(a){e.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource()},_initSource:function(){var a,c;if(e.isArray(this.options.source)){a=this.options.source;this.source=function(d,b){b(e.ui.autocomplete.filter(a,d.term))}}else if(typeof this.options.source=== "string"){c=this.options.source;this.source=function(d,b){e.getJSON(c,d,b)}}else this.source=this.options.source},search:function(a,c){a=a!=null?a:this.element.val();if(a.length").data("item.autocomplete", c).append(""+c.label+"").appendTo(a)},_move:function(a,c){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](c);else this.search(null,c)},widget:function(){return this.menu.element}});e.extend(e.ui.autocomplete,{escapeRegex:function(a){return a.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")},filter:function(a,c){var d=new RegExp(e.ui.autocomplete.escapeRegex(c), "i");return e.grep(a,function(b){return d.test(b.label||b.value||b)})}})})(jQuery); (function(e){e.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(e(c.target).closest(".ui-menu-item a").length){c.preventDefault();a.select(c)}});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", -1).mouseenter(function(c){a.activate(c,e(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,c){this.deactivate();if(this.hasScroll()){var d=c.offset().top-this.element.offset().top,b=this.element.attr("scrollTop"),f=this.element.height();if(d<0)this.element.attr("scrollTop",b+d);else d>f&&this.element.attr("scrollTop",b+d-f+c.height())}this.active=c.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:c})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prev().length},last:function(){return this.active&&!this.active.next().length},move:function(a,c,d){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0);a.length?this.activate(d,a):this.activate(d,this.element.children(c))}else this.activate(d,this.element.children(c))},nextPage:function(a){if(this.hasScroll())if(!this.active|| this.last())this.activate(a,this.element.children(":first"));else{var c=this.active.offset().top,d=this.element.height(),b=this.element.children("li").filter(function(){var f=e(this).offset().top-c-d+e(this).height();return f<10&&f>-10});b.length||(b=this.element.children(":last"));this.activate(a,b)}else this.activate(a,this.element.children(!this.active||this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(":last")); else{var c=this.active.offset().top,d=this.element.height();result=this.element.children("li").filter(function(){var b=e(this).offset().top-c+d-e(this).height();return b<10&&b>-10});result.length||(result=this.element.children(":first"));this.activate(a,result)}else this.activate(a,this.element.children(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":""));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon"); this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()}, destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery); ;/* * jQuery UI Dialog 1.8.2 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Dialog * * Depends: * jquery.ui.core.js * jquery.ui.widget.js * jquery.ui.button.js * jquery.ui.draggable.js * jquery.ui.mouse.js * jquery.ui.position.js * jquery.ui.resizable.js */ (function(c){c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");var a=this,b=a.options,d=b.title||a.originalTitle||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== b.uiDialog[0])d=Math.max(d,c(this).css("z-index"))});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index", c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;d.next().length&&d.appendTo("body");a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== f[0]&&e.shiftKey){g.focus(1);return false}}});c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();a._trigger("open");a._isOpen=true;return a}},_createButtons:function(a){var b=this,d=false,e=c("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a, function(g,f){g=c('').text(g).click(function(){f.apply(b.element[0],arguments)}).appendTo(e);c.fn.button&&g.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging"); b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize,position:f.position,size:f.size}}a=a===undefined?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position"); a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop", f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0];a=a||c.ui.dialog.prototype.options.position;if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(e,g){if(+b[e]===b[e]){d[e]=b[e];b[e]= g}})}else if(typeof a==="object"){if("left"in a){b[0]="left";d[0]=a.left}else if("right"in a){b[0]="right";d[0]=-a.right}if("top"in a){b[1]="top";d[1]=a.top}else if("bottom"in a){b[1]="bottom";d[1]=-a.bottom}}(a=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position({my:b.join(" "),at:b.join(" "),offset:d.join(" "),of:window,collision:"fit",using:function(e){var g=c(this).css(e).offset().top;g<0&&c(this).css("top",e.top-g)}});a||this.uiDialog.hide()},_setOption:function(a, b){var d=this,e=d.uiDialog,g=e.is(":data(resizable)"),f=false;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled");break;case "draggable":b?d._makeDraggable():e.draggable("destroy");break; case "height":f=true;break;case "maxHeight":g&&e.resizable("option","maxHeight",b);f=true;break;case "maxWidth":g&&e.resizable("option","maxWidth",b);f=true;break;case "minHeight":g&&e.resizable("option","minHeight",b);f=true;break;case "minWidth":g&&e.resizable("option","minWidth",b);f=true;break;case "position":d._position(b);break;case "resizable":g&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title", d.uiDialogTitlebar).html(""+(b||" "));break;case "width":f=true;break}c.Widget.prototype._setOption.apply(d,arguments);f&&d._size()},_size:function(){var a=this.options,b;this.element.css({width:"auto",minHeight:0,height:0});b=this.uiDialog.css({height:"auto",width:a.width}).height();this.element.css(a.height==="auto"?{minHeight:Math.max(a.minHeight-b,0),height:"auto"}:{minHeight:0,height:Math.max(a.height-b,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight", this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.2",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&& c(document).bind(c.ui.dialog.overlay.events,function(d){return c(d.target).zIndex()>=c.ui.dialog.overlay.maxZ})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("
    ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&& b.bgiframe();this.instances.push(b);return b},destroy:function(a){this.oldInstances.push(this.instances.splice(c.inArray(a,this.instances),1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var b=0;c.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight, document.body.offsetHeight);return a",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:'
  • #{label}
  • '},_create:function(){this._tabify(true)},_setOption:function(c,e){if(c=="selected")this.options.collapsible&& e==this.options.selected||this.select(e);else{this.options[c]=e;this._tabify()}},_tabId:function(c){return c.title&&c.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+s()},_sanitizeSelector:function(c){return c.replace(/:/g,"\\:")},_cookie:function(){var c=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+v());return d.cookie.apply(null,[c].concat(d.makeArray(arguments)))},_ui:function(c,e){return{tab:c,panel:e,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var c= d(this);c.html(c.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function e(g,f){g.css({display:""});!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}this.list=this.element.find("ol,ul").eq(0);this.lis=d("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);var a=this,b=this.options,h=/^#.+/;this.anchors.each(function(g,f){var j=d(f).attr("href"),l=j.split("#")[0],p;if(l&&(l===location.toString().split("#")[0]|| (p=d("base")[0])&&l===p.href)){j=f.hash;f.href=j}if(h.test(j))a.panels=a.panels.add(a._sanitizeSelector(j));else if(j!="#"){d.data(f,"href.tabs",j);d.data(f,"load.tabs",j.replace(/#.*$/,""));j=a._tabId(f);f.href="#"+j;f=d("#"+j);if(!f.length){f=d(b.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else b.disabled.push(g)});if(c){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(b.selected===undefined){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){b.selected=g;return false}});if(typeof b.selected!="number"&&b.cookie)b.selected=parseInt(a._cookie(),10);if(typeof b.selected!="number"&&this.lis.filter(".ui-tabs-selected").length)b.selected= this.lis.index(this.lis.filter(".ui-tabs-selected"));b.selected=b.selected||(this.lis.length?0:-1)}else if(b.selected===null)b.selected=-1;b.selected=b.selected>=0&&this.anchors[b.selected]||b.selected<0?b.selected:0;b.disabled=d.unique(b.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(b.selected,b.disabled)!=-1&&b.disabled.splice(d.inArray(b.selected,b.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); if(b.selected>=0&&this.anchors.length){this.panels.eq(b.selected).removeClass("ui-tabs-hide");this.lis.eq(b.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[b.selected],a.panels[b.selected]))});this.load(b.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else b.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));this.element[b.collapsible?"addClass": "removeClass"]("ui-tabs-collapsible");b.cookie&&this._cookie(b.selected,b.cookie);c=0;for(var i;i=this.lis[c];c++)d(i)[d.inArray(c,b.disabled)!=-1&&!d(i).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");b.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(b.event!="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+g)};this.lis.bind("mouseover.tabs", function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(b.fx)if(d.isArray(b.fx)){m=b.fx[0];o=b.fx[1]}else m=o=b.fx;var q=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",function(){e(f,o);a._trigger("show", null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},r=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};this.anchors.bind(b.event+".tabs", function(){var g=this,f=d(this).closest("li"),j=a.panels.filter(":not(.ui-tabs-hide)"),l=d(a._sanitizeSelector(this.hash));if(f.hasClass("ui-tabs-selected")&&!b.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}b.selected=a.anchors.index(this);a.abort();if(b.collapsible)if(f.hasClass("ui-tabs-selected")){b.selected=-1;b.cookie&&a._cookie(b.selected,b.cookie);a.element.queue("tabs",function(){r(g, j)}).dequeue("tabs");this.blur();return false}else if(!j.length){b.cookie&&a._cookie(b.selected,b.cookie);a.element.queue("tabs",function(){q(g,l)});a.load(a.anchors.index(this));this.blur();return false}b.cookie&&a._cookie(b.selected,b.cookie);if(l.length){j.length&&a.element.queue("tabs",function(){r(g,j)});a.element.queue("tabs",function(){q(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";d.browser.msie&&this.blur()});this.anchors.bind("click.tabs", function(){return false})},destroy:function(){var c=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(b,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this, "destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});c.cookie&&this._cookie(null,c.cookie);return this},add:function(c,e,a){if(a===undefined)a=this.anchors.length;var b=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,e));c=!c.indexOf("#")?c.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs", true);var i=d("#"+c);i.length||(i=d(h.panelTemplate).attr("id",c).data("destroy.tabs",true));i.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);i.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);i.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");i.removeClass("ui-tabs-hide"); this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(c){var e=this.options,a=this.lis.eq(c).remove(),b=this.panels.eq(c).remove();if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(c+(c+1=c?--h:h});this._tabify();this._trigger("remove", null,this._ui(a.find("a")[0],b[0]));return this},enable:function(c){var e=this.options;if(d.inArray(c,e.disabled)!=-1){this.lis.eq(c).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=c});this._trigger("enable",null,this._ui(this.anchors[c],this.panels[c]));return this}},disable:function(c){var e=this.options;if(c!=e.selected){this.lis.eq(c).addClass("ui-state-disabled");e.disabled.push(c);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}return this}, select:function(c){if(typeof c=="string")c=this.anchors.index(this.anchors.filter("[href$="+c+"]"));else if(c===null)c=-1;if(c==-1&&this.options.collapsible)c=this.options.selected;this.anchors.eq(c).trigger(this.options.event+".tabs");return this},load:function(c){var e=this,a=this.options,b=this.anchors.eq(c)[0],h=d.data(b,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(b,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(c).addClass("ui-state-processing"); if(a.spinner){var i=d("span",b);i.data("label.tabs",i.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){d(e._sanitizeSelector(b.hash)).html(k);e._cleanup();a.cache&&d.data(b,"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[c],e.panels[c]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[c],e.panels[c]));try{a.ajaxOptions.error(k,n,c,b)}catch(m){}}}));e.element.dequeue("tabs");return this}}, abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(c,e){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.2"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(c,e){var a=this,b=this.options,h=a._rotate||(a._rotate= function(i){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=b.selected;a.select(++k").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"}); c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=j.apply(this,arguments);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c|| typeof c=="number"||f.fx.speeds[c])return this._show.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(!c||typeof c=="number"||f.fx.speeds[c])return this._hide.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||typeof c=="boolean"||f.isFunction(c))return this.__toggle.apply(this, arguments);else{var a=j.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c, a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+ b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2, 10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)* a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(ha"; var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

    ";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); (function(){var g=s.createElement("div");g.innerHTML="
    ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= {},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
    ","
    "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
    ").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
    "; a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/them0000775000175000017500000000000013160023044032775 5ustar bdbaddogbdbaddog././@LongLink0000644000000000000000000000021100000000000011575 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/jquery-ui-1.8.2.custom.cssscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/them0000664000175000017500000006220113160023044033000 0ustar bdbaddogbdbaddog/* * jQuery UI CSS Framework * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. */ /* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } .ui-helper-hidden-accessible { position: absolute; left: -99999999px; } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .ui-helper-clearfix { display: inline-block; } /* required comment for clearfix to work in Opera \*/ * html .ui-helper-clearfix { height:1%; } .ui-helper-clearfix { display:block; } /* end clearfix */ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } /* Interaction Cues ----------------------------------*/ .ui-state-disabled { cursor: default !important; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } /* Misc visuals ----------------------------------*/ /* Overlays */ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } /* * jQuery UI CSS Framework * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDefault=02_glass.png&bgImgOpacityDefault=85&borderColorDefault=c5dbec&fcDefault=2e6e9e&iconColorDefault=6da8d5&bgColorHover=d0e5f5&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=79b7e7&fcHover=1d5987&iconColorHover=217bc0&bgColorActive=f5f8f9&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=79b7e7&fcActive=e17009&iconColorActive=f9bd01&bgColorHighlight=fbec88&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=fad42e&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px */ /* Component containers ----------------------------------*/ .ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } .ui-widget-header { border: 1px solid #4297d7; background: #5c9ccc url(images/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } .ui-widget-header a { color: #ffffff; } /* Interaction states ----------------------------------*/ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #c5dbec; background: #dfeffc url(images/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2e6e9e; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2e6e9e; text-decoration: none; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #79b7e7; background: #d0e5f5 url(images/ui-bg_glass_75_d0e5f5_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1d5987; } .ui-state-hover a, .ui-state-hover a:hover { color: #1d5987; text-decoration: none; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #79b7e7; background: #f5f8f9 url(images/ui-bg_inset-hard_100_f5f8f9_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #e17009; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e17009; text-decoration: none; } .ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fad42e; background: #fbec88 url(images/ui-bg_flat_55_fbec88_40x100.png) 50% 50% repeat-x; color: #363636; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_469bdd_256x240.png); } .ui-widget-content .ui-icon {background-image: url(images/ui-icons_469bdd_256x240.png); } .ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); } .ui-state-default .ui-icon { background-image: url(images/ui-icons_6da8d5_256x240.png); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_217bc0_256x240.png); } .ui-state-active .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); } .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } /* positioning */ .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } .ui-icon-carat-1-se { background-position: -48px 0; } .ui-icon-carat-1-s { background-position: -64px 0; } .ui-icon-carat-1-sw { background-position: -80px 0; } .ui-icon-carat-1-w { background-position: -96px 0; } .ui-icon-carat-1-nw { background-position: -112px 0; } .ui-icon-carat-2-n-s { background-position: -128px 0; } .ui-icon-carat-2-e-w { background-position: -144px 0; } .ui-icon-triangle-1-n { background-position: 0 -16px; } .ui-icon-triangle-1-ne { background-position: -16px -16px; } .ui-icon-triangle-1-e { background-position: -32px -16px; } .ui-icon-triangle-1-se { background-position: -48px -16px; } .ui-icon-triangle-1-s { background-position: -64px -16px; } .ui-icon-triangle-1-sw { background-position: -80px -16px; } .ui-icon-triangle-1-w { background-position: -96px -16px; } .ui-icon-triangle-1-nw { background-position: -112px -16px; } .ui-icon-triangle-2-n-s { background-position: -128px -16px; } .ui-icon-triangle-2-e-w { background-position: -144px -16px; } .ui-icon-arrow-1-n { background-position: 0 -32px; } .ui-icon-arrow-1-ne { background-position: -16px -32px; } .ui-icon-arrow-1-e { background-position: -32px -32px; } .ui-icon-arrow-1-se { background-position: -48px -32px; } .ui-icon-arrow-1-s { background-position: -64px -32px; } .ui-icon-arrow-1-sw { background-position: -80px -32px; } .ui-icon-arrow-1-w { background-position: -96px -32px; } .ui-icon-arrow-1-nw { background-position: -112px -32px; } .ui-icon-arrow-2-n-s { background-position: -128px -32px; } .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } .ui-icon-arrow-2-e-w { background-position: -160px -32px; } .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } .ui-icon-arrowstop-1-n { background-position: -192px -32px; } .ui-icon-arrowstop-1-e { background-position: -208px -32px; } .ui-icon-arrowstop-1-s { background-position: -224px -32px; } .ui-icon-arrowstop-1-w { background-position: -240px -32px; } .ui-icon-arrowthick-1-n { background-position: 0 -48px; } .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } .ui-icon-arrowthick-1-e { background-position: -32px -48px; } .ui-icon-arrowthick-1-se { background-position: -48px -48px; } .ui-icon-arrowthick-1-s { background-position: -64px -48px; } .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } .ui-icon-arrowthick-1-w { background-position: -96px -48px; } .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } .ui-icon-arrow-4 { background-position: 0 -80px; } .ui-icon-arrow-4-diag { background-position: -16px -80px; } .ui-icon-extlink { background-position: -32px -80px; } .ui-icon-newwin { background-position: -48px -80px; } .ui-icon-refresh { background-position: -64px -80px; } .ui-icon-shuffle { background-position: -80px -80px; } .ui-icon-transfer-e-w { background-position: -96px -80px; } .ui-icon-transferthick-e-w { background-position: -112px -80px; } .ui-icon-folder-collapsed { background-position: 0 -96px; } .ui-icon-folder-open { background-position: -16px -96px; } .ui-icon-document { background-position: -32px -96px; } .ui-icon-document-b { background-position: -48px -96px; } .ui-icon-note { background-position: -64px -96px; } .ui-icon-mail-closed { background-position: -80px -96px; } .ui-icon-mail-open { background-position: -96px -96px; } .ui-icon-suitcase { background-position: -112px -96px; } .ui-icon-comment { background-position: -128px -96px; } .ui-icon-person { background-position: -144px -96px; } .ui-icon-print { background-position: -160px -96px; } .ui-icon-trash { background-position: -176px -96px; } .ui-icon-locked { background-position: -192px -96px; } .ui-icon-unlocked { background-position: -208px -96px; } .ui-icon-bookmark { background-position: -224px -96px; } .ui-icon-tag { background-position: -240px -96px; } .ui-icon-home { background-position: 0 -112px; } .ui-icon-flag { background-position: -16px -112px; } .ui-icon-calendar { background-position: -32px -112px; } .ui-icon-cart { background-position: -48px -112px; } .ui-icon-pencil { background-position: -64px -112px; } .ui-icon-clock { background-position: -80px -112px; } .ui-icon-disk { background-position: -96px -112px; } .ui-icon-calculator { background-position: -112px -112px; } .ui-icon-zoomin { background-position: -128px -112px; } .ui-icon-zoomout { background-position: -144px -112px; } .ui-icon-search { background-position: -160px -112px; } .ui-icon-wrench { background-position: -176px -112px; } .ui-icon-gear { background-position: -192px -112px; } .ui-icon-heart { background-position: -208px -112px; } .ui-icon-star { background-position: -224px -112px; } .ui-icon-link { background-position: -240px -112px; } .ui-icon-cancel { background-position: 0 -128px; } .ui-icon-plus { background-position: -16px -128px; } .ui-icon-plusthick { background-position: -32px -128px; } .ui-icon-minus { background-position: -48px -128px; } .ui-icon-minusthick { background-position: -64px -128px; } .ui-icon-close { background-position: -80px -128px; } .ui-icon-closethick { background-position: -96px -128px; } .ui-icon-key { background-position: -112px -128px; } .ui-icon-lightbulb { background-position: -128px -128px; } .ui-icon-scissors { background-position: -144px -128px; } .ui-icon-clipboard { background-position: -160px -128px; } .ui-icon-copy { background-position: -176px -128px; } .ui-icon-contact { background-position: -192px -128px; } .ui-icon-image { background-position: -208px -128px; } .ui-icon-video { background-position: -224px -128px; } .ui-icon-script { background-position: -240px -128px; } .ui-icon-alert { background-position: 0 -144px; } .ui-icon-info { background-position: -16px -144px; } .ui-icon-notice { background-position: -32px -144px; } .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } .ui-icon-radio-off { background-position: -96px -144px; } .ui-icon-radio-on { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-play { background-position: 0 -160px; } .ui-icon-pause { background-position: -16px -160px; } .ui-icon-seek-next { background-position: -32px -160px; } .ui-icon-seek-prev { background-position: -48px -160px; } .ui-icon-seek-end { background-position: -64px -160px; } .ui-icon-seek-start { background-position: -80px -160px; } /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ .ui-icon-seek-first { background-position: -80px -160px; } .ui-icon-stop { background-position: -96px -160px; } .ui-icon-eject { background-position: -112px -160px; } .ui-icon-volume-off { background-position: -128px -160px; } .ui-icon-volume-on { background-position: -144px -160px; } .ui-icon-power { background-position: 0 -176px; } .ui-icon-signal-diag { background-position: -16px -176px; } .ui-icon-signal { background-position: -32px -176px; } .ui-icon-battery-0 { background-position: -48px -176px; } .ui-icon-battery-1 { background-position: -64px -176px; } .ui-icon-battery-2 { background-position: -80px -176px; } .ui-icon-battery-3 { background-position: -96px -176px; } .ui-icon-circle-plus { background-position: 0 -192px; } .ui-icon-circle-minus { background-position: -16px -192px; } .ui-icon-circle-close { background-position: -32px -192px; } .ui-icon-circle-triangle-e { background-position: -48px -192px; } .ui-icon-circle-triangle-s { background-position: -64px -192px; } .ui-icon-circle-triangle-w { background-position: -80px -192px; } .ui-icon-circle-triangle-n { background-position: -96px -192px; } .ui-icon-circle-arrow-e { background-position: -112px -192px; } .ui-icon-circle-arrow-s { background-position: -128px -192px; } .ui-icon-circle-arrow-w { background-position: -144px -192px; } .ui-icon-circle-arrow-n { background-position: -160px -192px; } .ui-icon-circle-zoomin { background-position: -176px -192px; } .ui-icon-circle-zoomout { background-position: -192px -192px; } .ui-icon-circle-check { background-position: -208px -192px; } .ui-icon-circlesmall-plus { background-position: 0 -208px; } .ui-icon-circlesmall-minus { background-position: -16px -208px; } .ui-icon-circlesmall-close { background-position: -32px -208px; } .ui-icon-squaresmall-plus { background-position: -48px -208px; } .ui-icon-squaresmall-minus { background-position: -64px -208px; } .ui-icon-squaresmall-close { background-position: -80px -208px; } .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } .ui-icon-grip-solid-vertical { background-position: -32px -224px; } .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ .ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; } .ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; } .ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; } .ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } .ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; } .ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } .ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } .ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; } .ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } /* Overlays */ .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* Resizable ----------------------------------*/ .ui-resizable { position: relative;} .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Selectable ----------------------------------*/ .ui-selectable-helper { border:1px dotted black } /* Autocomplete ----------------------------------*/ .ui-autocomplete { position: absolute; cursor: default; } .ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } /* workarounds */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ /* Menu ----------------------------------*/ .ui-menu { list-style:none; padding: 2px; margin: 0; display:block; } .ui-menu .ui-menu { margin-top: -3px; } .ui-menu .ui-menu-item { margin:0; padding: 0; zoom: 1; float: left; clear: left; width: 100%; } .ui-menu .ui-menu-item a { text-decoration:none; display:block; padding:.2em .4em; line-height:1.5; zoom:1; } .ui-menu .ui-menu-item a.ui-state-hover, .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; } /* Button ----------------------------------*/ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ .ui-button-icons-only { width: 3.4em; } button.ui-button-icons-only { width: 3.7em; } /*button text element */ .ui-button .ui-button-text { display: block; line-height: 1.4; } .ui-button-text-only .ui-button-text { padding: .4em 1em; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } .ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } /* no icon support for input elements, provide padding by default */ input.ui-button { padding: .4em 1em; } /*button icon element(s) */ .ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } .ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } /*button sets*/ .ui-buttonset { margin-right: 7px; } .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } /* workarounds */ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ /* Dialog ----------------------------------*/ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } .ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } .ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } .ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } .ui-draggable .ui-dialog-titlebar { cursor: move; } /* Tabs ----------------------------------*/ .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } .ui-tabs .ui-tabs-hide { display: none !important; } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/tree0000775000175000017500000000000013160023044032777 5ustar bdbaddogbdbaddog././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.pack.jsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/tree0000664000175000017500000000647613160023044033016 0ustar bdbaddogbdbaddog/* * Treeview 1.4 - jQuery plugin to hide and show branches of a tree * * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ * http://docs.jquery.com/Plugins/Treeview * * Copyright (c) 2007 Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $ * */ eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(4($){$.1l($.F,{E:4(b,c){l a=3.n(\'.\'+b);3.n(\'.\'+c).o(c).m(b);a.o(b).m(c);8 3},s:4(a,b){8 3.n(\'.\'+a).o(a).m(b).P()},1n:4(a){a=a||"1j";8 3.1j(4(){$(3).m(a)},4(){$(3).o(a)})},1h:4(b,a){b?3.1g({1e:"p"},b,a):3.x(4(){T(3)[T(3).1a(":U")?"H":"D"]();7(a)a.A(3,O)})},12:4(b,a){7(b){3.1g({1e:"D"},b,a)}1L{3.D();7(a)3.x(a)}},11:4(a){7(!a.1k){3.n(":r-1H:G(9)").m(k.r);3.n((a.1F?"":"."+k.X)+":G(."+k.W+")").6(">9").D()}8 3.n(":y(>9)")},S:4(b,c){3.n(":y(>9):G(:y(>a))").6(">1z").C(4(a){c.A($(3).19())}).w($("a",3)).1n();7(!b.1k){3.n(":y(>9:U)").m(k.q).s(k.r,k.t);3.G(":y(>9:U)").m(k.u).s(k.r,k.v);3.1r("").6("J."+k.5).x(4(){l a="";$.x($(3).B().1o("14").13(" "),4(){a+=3+"-5 "});$(3).m(a)})}3.6("J."+k.5).C(c)},z:4(g){g=$.1l({N:"z"},g);7(g.w){8 3.1K("w",[g.w])}7(g.p){l d=g.p;g.p=4(){8 d.A($(3).B()[0],O)}}4 1m(b,c){4 L(a){8 4(){K.A($("J."+k.5,b).n(4(){8 a?$(3).B("."+a).1i:1I}));8 1G}}$("a:10(0)",c).C(L(k.u));$("a:10(1)",c).C(L(k.q));$("a:10(2)",c).C(L())}4 K(){$(3).B().6(">.5").E(k.Z,k.Y).E(k.I,k.M).P().E(k.u,k.q).E(k.v,k.t).6(">9").1h(g.1f,g.p);7(g.1E){$(3).B().1D().6(">.5").s(k.Z,k.Y).s(k.I,k.M).P().s(k.u,k.q).s(k.v,k.t).6(">9").12(g.1f,g.p)}}4 1d(){4 1C(a){8 a?1:0}l b=[];j.x(4(i,e){b[i]=$(e).1a(":y(>9:1B)")?1:0});$.V(g.N,b.1A(""))}4 1c(){l b=$.V(g.N);7(b){l a=b.13("");j.x(4(i,e){$(e).6(">9")[1y(a[i])?"H":"D"]()})}}3.m("z");l j=3.6("Q").11(g);1x(g.1w){18"V":l h=g.p;g.p=4(){1d();7(h){h.A(3,O)}};1c();17;18"1b":l f=3.6("a").n(4(){8 3.16.15()==1b.16.15()});7(f.1i){f.m("1v").1u("9, Q").w(f.19()).H()}17}j.S(g,K);7(g.R){1m(3,g.R);$(g.R).H()}8 3.1t("w",4(a,b){$(b).1s().o(k.r).o(k.v).o(k.t).6(">.5").o(k.I).o(k.M);$(b).6("Q").1q().11(g).S(g,K)})}});l k=$.F.z.1J={W:"W",X:"X",q:"q",Y:"q-5",M:"t-5",u:"u",Z:"u-5",I:"v-5",v:"v",t:"t",r:"r",5:"5"};$.F.1p=$.F.z})(T);',62,110,'|||this|function|hitarea|find|if|return|ul||||||||||||var|addClass|filter|removeClass|toggle|expandable|last|replaceClass|lastExpandable|collapsable|lastCollapsable|add|each|has|treeview|apply|parent|click|hide|swapClass|fn|not|show|lastCollapsableHitarea|div|toggler|handler|lastExpandableHitarea|cookieId|arguments|end|li|control|applyClasses|jQuery|hidden|cookie|open|closed|expandableHitarea|collapsableHitarea|eq|prepareBranches|heightHide|split|class|toLowerCase|href|break|case|next|is|location|deserialize|serialize|height|animated|animate|heightToggle|length|hover|prerendered|extend|treeController|hoverClass|attr|Treeview|andSelf|prepend|prev|bind|parents|selected|persist|switch|parseInt|span|join|visible|binary|siblings|unique|collapsed|false|child|true|classes|trigger|else'.split('|'),0,{}))././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.async.jsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/tree0000664000175000017500000000365313160023044033010 0ustar bdbaddogbdbaddog/* * Async Treeview 0.1 - Lazy-loading extension for Treeview * * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ * * Copyright (c) 2007 Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id$ * */ ;(function($) { function load(settings, root, child, container) { $.getJSON(settings.url, {root: root}, function(response) { function createNode(parent) { var current = $("
  • ").attr("id", this.id || "").html("" + this.text + "").appendTo(parent); if (this.classes) { current.children("span").addClass(this.classes); } if (this.expanded) { current.addClass("open"); } if (this.hasChildren || this.children && this.children.length) { var branch = $("
      ").appendTo(current); if (this.hasChildren) { current.addClass("hasChildren"); createNode.call({ text:"placeholder", id:"placeholder", children:[] }, branch); } if (this.children && this.children.length) { $.each(this.children, createNode, [branch]) } } } $.each(response, createNode, [child]); $(container).treeview({add: child}); }); } var proxied = $.fn.treeview; $.fn.treeview = function(settings) { if (!settings.url) { return proxied.apply(this, arguments); } var container = this; load(settings, "source", this, container); var userToggle = settings.toggle; return proxied.call(this, $.extend({}, settings, { collapsed: true, toggle: function() { var $this = $(this); if ($this.hasClass("hasChildren")) { var childList = $this.removeClass("hasChildren").find("ul"); childList.empty(); load(settings, this.id, childList, container); } if (userToggle) { userToggle.apply(this, arguments); } } })); }; })(jQuery);././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.jsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/tree0000664000175000017500000001750713160023044033013 0ustar bdbaddogbdbaddog/* * Treeview 1.4 - jQuery plugin to hide and show branches of a tree * * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ * http://docs.jquery.com/Plugins/Treeview * * Copyright (c) 2007 Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $ * */ ;(function($) { $.extend($.fn, { swapClass: function(c1, c2) { var c1Elements = this.filter('.' + c1); this.filter('.' + c2).removeClass(c2).addClass(c1); c1Elements.removeClass(c1).addClass(c2); return this; }, replaceClass: function(c1, c2) { return this.filter('.' + c1).removeClass(c1).addClass(c2).end(); }, hoverClass: function(className) { className = className || "hover"; return this.hover(function() { $(this).addClass(className); }, function() { $(this).removeClass(className); }); }, heightToggle: function(animated, callback) { animated ? this.animate({ height: "toggle" }, animated, callback) : this.each(function(){ jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ](); if(callback) callback.apply(this, arguments); }); }, heightHide: function(animated, callback) { if (animated) { this.animate({ height: "hide" }, animated, callback); } else { this.hide(); if (callback) this.each(callback); } }, prepareBranches: function(settings) { if (!settings.prerendered) { // mark last tree items this.filter(":last-child:not(ul)").addClass(CLASSES.last); // collapse whole tree, or only those marked as closed, anyway except those marked as open this.filter((settings.collapsed ? "" : "." + CLASSES.closed) + ":not(." + CLASSES.open + ")").find(">ul").hide(); } // return all items with sublists return this.filter(":has(>ul)"); }, applyClasses: function(settings, toggler) { this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event) { toggler.apply($(this).next()); }).add( $("a", this) ).hoverClass(); if (!settings.prerendered) { // handle closed ones first this.filter(":has(>ul:hidden)") .addClass(CLASSES.expandable) .replaceClass(CLASSES.last, CLASSES.lastExpandable); // handle open ones this.not(":has(>ul:hidden)") .addClass(CLASSES.collapsable) .replaceClass(CLASSES.last, CLASSES.lastCollapsable); // create hitarea this.prepend("
      ").find("div." + CLASSES.hitarea).each(function() { var classes = ""; $.each($(this).parent().attr("class").split(" "), function() { classes += this + "-hitarea "; }); $(this).addClass( classes ); }); } // apply event to hitarea this.find("div." + CLASSES.hitarea).click( toggler ); }, treeview: function(settings) { if(typeof(window.treeCookieId) !== 'undefined' || window.treeCookieId === ""){ treeCookieId = "treeview"; } settings = $.extend({ cookieId: treeCookieId }, settings); if (settings.add) { return this.trigger("add", [settings.add]); } if ( settings.toggle ) { var callback = settings.toggle; settings.toggle = function() { return callback.apply($(this).parent()[0], arguments); }; } // factory for treecontroller function treeController(tree, control) { // factory for click handlers function handler(filter) { return function() { // reuse toggle event handler, applying the elements to toggle // start searching for all hitareas toggler.apply( $("div." + CLASSES.hitarea, tree).filter(function() { // for plain toggle, no filter is provided, otherwise we need to check the parent element return filter ? $(this).parent("." + filter).length : true; }) ); return false; }; } // click on first element to collapse tree $("a:eq(0)", control).click( handler(CLASSES.collapsable) ); // click on second to expand tree $("a:eq(1)", control).click( handler(CLASSES.expandable) ); // click on third to toggle tree $("a:eq(2)", control).click( handler() ); } // handle toggle event function toggler() { $(this) .parent() // swap classes for hitarea .find(">.hitarea") .swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea ) .swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea ) .end() // swap classes for parent li .swapClass( CLASSES.collapsable, CLASSES.expandable ) .swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable ) // find child lists .find( ">ul" ) // toggle them .heightToggle( settings.animated, settings.toggle ); if ( settings.unique ) { $(this).parent() .siblings() // swap classes for hitarea .find(">.hitarea") .replaceClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea ) .replaceClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea ) .end() .replaceClass( CLASSES.collapsable, CLASSES.expandable ) .replaceClass( CLASSES.lastCollapsable, CLASSES.lastExpandable ) .find( ">ul" ) .heightHide( settings.animated, settings.toggle ); } } //Cookie Persistence function serialize() { function binary(arg) { return arg ? 1 : 0; } var data = []; branches.each(function(i, e) { data[i] = $(e).is(":has(>ul:visible)") ? 1 : 0; }); $.cookie(settings.cookieId, data.join("") ); } function deserialize() { var stored = $.cookie(settings.cookieId); if ( stored ) { var data = stored.split(""); branches.each(function(i, e) { $(e).find(">ul")[ parseInt(data[i]) ? "show" : "hide" ](); }); } } // add treeview class to activate styles this.addClass("treeview"); // prepare branches and find all tree items with child lists var branches = this.find("li").prepareBranches(settings); switch(settings.persist) { case "cookie": var toggleCallback = settings.toggle; settings.toggle = function() { serialize(); if (toggleCallback) { toggleCallback.apply(this, arguments); } }; deserialize(); break; case "location": var current = this.find("a").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); }); if ( current.length ) { current.addClass("selected").parents("ul, li").add( current.next() ).show(); } break; } branches.applyClasses(settings, toggler); // if control option is set, create the treecontroller and show it if ( settings.control ) { treeController(this, settings.control); $(settings.control).show(); } return this.bind("add", function(event, branches) { $(branches).prev() .removeClass(CLASSES.last) .removeClass(CLASSES.lastCollapsable) .removeClass(CLASSES.lastExpandable) .find(">.hitarea") .removeClass(CLASSES.lastCollapsableHitarea) .removeClass(CLASSES.lastExpandableHitarea); $(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings, toggler); }); } }); // classes used by the plugin // need to be styled via external stylesheet, see first example var CLASSES = $.fn.treeview.classes = { open: "open", closed: "closed", expandable: "expandable", expandableHitarea: "expandable-hitarea", lastExpandableHitarea: "lastExpandable-hitarea", collapsable: "collapsable", collapsableHitarea: "collapsable-hitarea", lastCollapsableHitarea: "lastCollapsable-hitarea", lastCollapsable: "lastCollapsable", lastExpandable: "lastExpandable", last: "last", hitarea: "hitarea" }; // provide backwards compability $.fn.Treeview = $.fn.treeview; })(jQuery);././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.cssscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/tree0000664000175000017500000000551613160023044033010 0ustar bdbaddogbdbaddog.treeview, .treeview ul { padding: 0; margin: 0; list-style: none; } .treeview ul { background-color: white; margin-top: 4px; } .treeview .hitarea { background: url(images/treeview-default.gif) -64px -25px no-repeat; height: 16px; width: 16px; margin-left: -16px; float: left; cursor: pointer; } /* fix for IE6 */ * html .hitarea { display: inline; float:none; } .treeview li { margin: 0; padding: 3px 0 3px 16px; } .treeview a.selected { background-color: #eee; } #treecontrol { margin: 1em 0; display: none; } .treeview .hover { color: red; cursor: pointer; } .treeview li { background: url(images/treeview-default-line.gif) 0 0 no-repeat; } .treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; } .treeview .expandable-hitarea { background-position: -80px -3px; } .treeview li.last { background-position: 0 -1766px } .treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(images/treeview-default.gif); } .treeview li.lastCollapsable { background-position: 0 -111px } .treeview li.lastExpandable { background-position: -32px -67px } .treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; } .treeview-red li { background-image: url(images/treeview-red-line.gif); } .treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(images/treeview-red.gif); } .treeview-black li { background-image: url(images/treeview-black-line.gif); } .treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(images/treeview-black.gif); } .treeview-gray li { background-image: url(images/treeview-gray-line.gif); } .treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(images/treeview-gray.gif); } .treeview-famfamfam li { background-image: url(images/treeview-famfamfam-line.gif); } .treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(images/treeview-famfamfam.gif); } .filetree li { padding: 3px 0 2px 16px; } .filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; } .filetree span.folder { background: url(images/folder.gif) 0 0 no-repeat; } .filetree li.expandable span.folder { background: url(images/folder-closed.gif) 0 0 no-repeat; } .filetree span.file { background: url(images/file.gif) 0 0 no-repeat; } html, body {height:100%; margin: 0; padding: 0; } /* html>body { font-size: 16px; font-size: 68.75%; } Reset Base Font Size */ /* body { font-family: Verdana, helvetica, arial, sans-serif; font-size: 68.75%; background: #fff; color: #333; } */ a img { border: none; }././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/jquery.treeview.min.jsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/jquery/tree0000664000175000017500000001271413160023044033006 0ustar bdbaddogbdbaddog/* * Treeview 1.4 - jQuery plugin to hide and show branches of a tree * * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ * http://docs.jquery.com/Plugins/Treeview * * Copyright (c) 2007 Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $ * kasunbg: changed the cookieid name * */;(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter('.'+c1);this.filter('.'+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this;},replaceClass:function(c1,c2){return this.filter('.'+c1).removeClass(c1).addClass(c2).end();},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},animated,callback):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();if(callback)callback.apply(this,arguments);});},heightHide:function(animated,callback){if(animated){this.animate({height:"hide"},animated,callback);}else{this.hide();if(callback)this.each(callback);}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter((settings.collapsed?"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide();}return this.filter(":has(>ul)");},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event){toggler.apply($(this).next());}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,CLASSES.lastCollapsable);this.prepend("
      ").find("div."+CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea ";});$(this).addClass(classes);});}this.find("div."+CLASSES.hitarea).click(toggler);},treeview:function(settings){if(typeof(window.treeCookieId) === 'undefined' || window.treeCookieId === ""){treeCookieId = "treeview";} settings=$.extend({cookieId: treeCookieId},settings);if(settings.add){return this.trigger("add",[settings.add]);}if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments);};}function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true;}));return false;};}$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler());}function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique){$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle);}}function serialize(){function binary(arg){return arg?1:0;}var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0;});$.cookie(settings.cookieId,data.join(""));}function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?"show":"hide"]();});}}this.addClass("treeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case"cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback){toggleCallback.apply(this,arguments);}};deserialize();break;case"location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase();});if(current.length){current.addClass("selected").parents("ul, li").add(current.next()).show();}break;}branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show();}return this.bind("add",function(event,branches){$(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea);$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings,toggler);});}});var CLASSES=$.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};$.fn.Treeview=$.fn.treeview;})(jQuery);scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/common/main.js0000664000175000017500000001273013160023044032065 0ustar bdbaddogbdbaddog/** * Miscellaneous js functions for WebHelp * Kasun Gajasinghe, http://kasunbg.blogspot.com * David Cramer, http://www.thingbag.net * */ $(document).ready(function() { // $("#showHideHighlight").button(); //add jquery button styling to 'Go' button //Generate tabs in nav-pane with JQuery $(function() { $("#tabs").tabs({ cookie: { // store cookie for 2 days. expires: 2 } }); }); //Generate the tree $("#ulTreeDiv").attr("style",""); $("#tree").treeview({ collapsed: true, animated: "medium", control: "#sidetreecontrol", persist: "cookie" }); //after toc fully styled, display it. Until loading, a 'loading' image will be displayed $("#tocLoading").attr("style","display:none;"); // $("#ulTreeDiv").attr("style","display:block;"); //.searchButton is the css class applied to 'Go' button $(function() { $("button", ".searchButton").button(); $("button", ".searchButton").click(function() { return false; }); }); //'ui-tabs-1' is the cookie name which is used for the persistence of the tabs.(Content/Search tab) if ($.cookie('ui-tabs-1') === '1') { //search tab is visible if ($.cookie('textToSearch') != undefined && $.cookie('textToSearch').length > 0) { document.getElementById('textToSearch').value = $.cookie('textToSearch'); Verifie('diaSearch_Form'); searchHighlight($.cookie('textToSearch')); $("#showHideHighlight").css("display","block"); } } syncToc(); //Synchronize the toc tree with the content pane, when loading the page. //$("#doSearch").button(); //add jquery button styling to 'Go' button }); /** * Synchronize with the tableOfContents */ function syncToc(){ var a = document.getElementById("webhelp-currentid"); if (a != undefined) { var b = a.getElementsByTagName("a")[0]; if (b != undefined) { //Setting the background for selected node. var style = a.getAttribute("style"); if (style != null && !style.match(/background-color: Background;/)) { a.setAttribute("style", "background-color: #6495ed; " + style); b.setAttribute("style", "color: white;"); } else if (style != null) { a.setAttribute("style", "background-color: #6495ed; " + style); b.setAttribute("style", "color: white;"); } else { a.setAttribute("style", "background-color: #6495ed; "); b.setAttribute("style", "color: white;"); } } //shows the node related to current content. //goes a recursive call from current node to ancestor nodes, displaying all of them. while (a.parentNode && a.parentNode.nodeName) { var parentNode = a.parentNode; var nodeName = parentNode.nodeName; if (nodeName.toLowerCase() == "ul") { parentNode.setAttribute("style", "display: block;"); } else if (nodeName.toLocaleLowerCase() == "li") { parentNode.setAttribute("class", "collapsable"); parentNode.firstChild.setAttribute("class", "hitarea collapsable-hitarea "); } a = parentNode; } } } /** * Code for Show/Hide TOC * */ function showHideToc() { var showHideButton = $("#showHideButton"); var leftNavigation = $("#leftnavigation"); var content = $("#content"); if (showHideButton != undefined && showHideButton.hasClass("pointLeft")) { //Hide TOC showHideButton.removeClass('pointLeft').addClass('pointRight'); content.css("margin", "0 0 0 0"); leftNavigation.css("display","none"); showHideButton.attr("title", "Show the TOC tree"); } else { //Show the TOC showHideButton.removeClass('pointRight').addClass('pointLeft'); content.css("margin", "0 0 0 280px"); leftNavigation.css("display","block"); showHideButton.attr("title", "Hide the TOC Tree"); } } /** * Code for searh highlighting */ var highlightOn = true; function searchHighlight(searchText) { highlightOn = true; if (searchText != undefined) { var wList; var sList = new Array(); //stem list //Highlight the search terms searchText = searchText.toLowerCase().replace(/<\//g, "_st_").replace(/\$_/g, "_di_").replace(/\.|%2C|%3B|%21|%3A|@|\/|\*/g, " ").replace(/(%20)+/g, " ").replace(/_st_/g, " äck, ackers -> acker, armes -> arm, bedürfnissen -> bedürfnis) */ if (index1 != 10000 && r1Index != -1) { if (index1 >= r1Index) { word = word.substring(0, index1); if (optionUsed1 == 'b') { if (word.search(/niss$/) != -1) { word = word.substring(0, word.length -1); } } } } /* Step 2: Search for the longest among the following suffixes, (a) en er est (b) st (preceded by a valid st-ending, itself preceded by at least 3 letters) */ var a2Index = word.search(/(en|er|est)$/g); var b2Index = word.search(/(.{3}[bdfghklmnt]st)$/g); if (b2Index != -1) { b2Index += 4; } var index2 = 10000; var optionUsed2 = ''; if (a2Index != -1 && a2Index < index2) { optionUsed2 = 'a'; index2 = a2Index; } if (b2Index != -1 && b2Index < index2) { optionUsed2 = 'b'; index2 = b2Index; } /* and delete if in R1. (For example, derbsten -> derbst by step 1, and derbst -> derb by step 2, since b is a valid st-ending, and is preceded by just 3 letters) */ if (index2 != 10000 && r1Index != -1) { if (index2 >= r1Index) { word = word.substring(0, index2); } } /* Step 3: d-suffixes (*) Search for the longest among the following suffixes, and perform the action indicated. end ung delete if in R2 if preceded by ig, delete if in R2 and not preceded by e ig ik isch delete if in R2 and not preceded by e lich heit delete if in R2 if preceded by er or en, delete if in R1 keit delete if in R2 if preceded by lich or ig, delete if in R2 */ var a3Index = word.search(/(end|ung)$/g); var b3Index = word.search(/[^e](ig|ik|isch)$/g); var c3Index = word.search(/(lich|heit)$/g); var d3Index = word.search(/(keit)$/g); if (b3Index != -1) { b3Index ++; } var index3 = 10000; var optionUsed3 = ''; if (a3Index != -1 && a3Index < index3) { optionUsed3 = 'a'; index3 = a3Index; } if (b3Index != -1 && b3Index < index3) { optionUsed3 = 'b'; index3 = b3Index; } if (c3Index != -1 && c3Index < index3) { optionUsed3 = 'c'; index3 = c3Index; } if (d3Index != -1 && d3Index < index3) { optionUsed3 = 'd'; index3 = d3Index; } if (index3 != 10000 && r2Index != -1) { if (index3 >= r2Index) { word = word.substring(0, index3); var optionIndex = -1; var optionSubsrt = ''; if (optionUsed3 == 'a') { optionIndex = word.search(/[^e](ig)$/); if (optionIndex != -1) { optionIndex++; if (optionIndex >= r2Index) { word = word.substring(0, optionIndex); } } } else if (optionUsed3 == 'c') { optionIndex = word.search(/(er|en)$/); if (optionIndex != -1) { if (optionIndex >= r1Index) { word = word.substring(0, optionIndex); } } } else if (optionUsed3 == 'd') { optionIndex = word.search(/(lich|ig)$/); if (optionIndex != -1) { if (optionIndex >= r2Index) { word = word.substring(0, optionIndex); } } } } } /* Finally, turn U and Y back into lower case, and remove the umlaut accent from a, o and u. */ word = word.replace(/U/g, 'u'); word = word.replace(/Y/g, 'y'); word = word.replace(/ä/g, 'a'); word = word.replace(/ö/g, 'o'); word = word.replace(/ü/g, 'u'); return word; }; //}././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/stemmers/fr_stemmer.jsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/ste0000664000175000017500000003176713160023044032763 0ustar bdbaddogbdbaddog/* * Author: Kasun Gajasinghe * E-Mail: kasunbg AT gmail DOT com * Date: 09.08.2010 * * usage: stemmer(word); * ex: var stem = stemmer(foobar); * Implementation of the stemming algorithm from http://snowball.tartarus.org/algorithms/french/stemmer.html * * LICENSE: * * Copyright (c) 2010, Kasun Gajasinghe. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * THIS SOFTWARE IS PROVIDED BY KASUN GAJASINGHE ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KASUN GAJASINGHE BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ var stemmer = function(word){ // Letters in French include the following accented forms, // â à ç ë é ê è ï î ô û ù // The following letters are vowels: // a e i o u y â à ë é ê è ï î ô û ù word = word.toLowerCase(); var oriWord = word; word = word.replace(/qu/g, 'qU'); //have to perform first, as after the operation, capital U is not treated as a vowel word = word.replace(/([aeiouyâàëéêèïîôûù])u([aeiouyâàëéêèïîôûù])/g, '$1U$2'); word = word.replace(/([aeiouyâàëéêèïîôûù])i([aeiouyâàëéêèïîôûù])/g, '$1I$2'); word = word.replace(/([aeiouyâàëéêèïîôûù])y/g, '$1Y'); word = word.replace(/y([aeiouyâàëéêèïîôûù])/g, 'Y$1'); var rv=''; var rvIndex = -1; if(word.search(/^(par|col|tap)/) != -1 || word.search(/^[aeiouyâàëéêèïîôûù]{2}/) != -1){ rv = word.substring(3); rvIndex = 3; } else { rvIndex = word.substring(1).search(/[aeiouyâàëéêèïîôûù]/); if(rvIndex != -1){ rvIndex +=2; //+2 is to supplement the substring(1) used to find rvIndex rv = word.substring(rvIndex); } else { rvIndex = word.length; } } // R1 is the region after the first non-vowel following a vowel, or the end of the word if there is no such non-vowel. // R2 is the region after the first non-vowel following a vowel in R1, or the end of the word if there is no such non-vowel var r1Index = word.search(/[aeiouyâàëéêèïîôûù][^aeiouyâàëéêèïîôûù]/); var r1 = ''; if (r1Index != -1) { r1Index += 2; r1 = word.substring(r1Index); } else { r1Index = word.length; } var r2Index = -1; var r2 = ''; if (r1Index != -1) { r2Index = r1.search(/[aeiouyâàëéêèïîôûù][^aeiouyâàëéêèïîôûù]/); if (r2Index != -1) { r2Index += 2; r2 = r1.substring(r2Index); r2Index += r1Index; } else { r2 = ''; r2Index = word.length; } } if (r1Index != -1 && r1Index < 3) { r1Index = 3; r1 = word.substring(r1Index); } /* Step 1: Standard suffix removal */ var a1Index = word.search(/(ance|iqUe|isme|able|iste|eux|ances|iqUes|ismes|ables|istes)$/); var a2Index = word.search(/(atrice|ateur|ation|atrices|ateurs|ations)$/); var a3Index = word.search(/(logie|logies)$/); var a4Index = word.search(/(usion|ution|usions|utions)$/); var a5Index = word.search(/(ence|ences)$/); var a6Index = word.search(/(ement|ements)$/); var a7Index = word.search(/(ité|ités)$/); var a8Index = word.search(/(if|ive|ifs|ives)$/); var a9Index = word.search(/(eaux)$/); var a10Index = word.search(/(aux)$/); var a11Index = word.search(/(euse|euses)$/); var a12Index = word.search(/[^aeiouyâàëéêèïîôûù](issement|issements)$/); var a13Index = word.search(/(amment)$/); var a14Index = word.search(/(emment)$/); var a15Index = word.search(/[aeiouyâàëéêèïîôûù](ment|ments)$/); if(a1Index != -1 && a1Index >= r2Index){ word = word.substring(0,a1Index); } else if(a2Index != -1 && a2Index >= r2Index){ word = word.substring(0,a2Index); var a2Index2 = word.search(/(ic)$/); if(a2Index2 != -1 && a2Index2 >= r2Index){ word = word.substring(0, a2Index2); //if preceded by ic, delete if in R2, } else { //else replace by iqU word = word.replace(/(ic)$/,'iqU'); } } else if(a3Index != -1 && a3Index >= r2Index){ word = word.replace(/(logie|logies)$/,'log'); //replace with log if in R2 } else if(a4Index != -1 && a4Index >= r2Index){ word = word.replace(/(usion|ution|usions|utions)$/,'u'); //replace with u if in R2 } else if(a5Index != -1 && a5Index >= r2Index){ word = word.replace(/(ence|ences)$/,'ent'); //replace with ent if in R2 } else if(a6Index != -1 && a6Index >= rvIndex){ word = word.substring(0,a6Index); if(word.search(/(iv)$/) >= r2Index){ word = word.replace(/(iv)$/, ''); if(word.search(/(at)$/) >= r2Index){ word = word.replace(/(at)$/, ''); } } else if(word.search(/(eus)$/) != -1){ var a6Index2 = word.search(/(eus)$/); if(a6Index2 >=r2Index){ word = word.substring(0, a6Index2); } else if(a6Index2 >= r1Index){ word = word.substring(0,a6Index2)+"eux"; } } else if(word.search(/(abl|iqU)$/) >= r2Index){ word = word.replace(/(abl|iqU)$/,''); //if preceded by abl or iqU, delete if in R2, } else if(word.search(/(ièr|Ièr)$/) >= rvIndex){ word = word.replace(/(ièr|Ièr)$/,'i'); //if preceded by abl or iqU, delete if in R2, } } else if(a7Index != -1 && a7Index >= r2Index){ word = word.substring(0,a7Index); //delete if in R2 if(word.search(/(abil)$/) != -1){ //if preceded by abil, delete if in R2, else replace by abl, otherwise, var a7Index2 = word.search(/(abil)$/); if(a7Index2 >=r2Index){ word = word.substring(0, a7Index2); } else { word = word.substring(0,a7Index2)+"abl"; } } else if(word.search(/(ic)$/) != -1){ var a7Index3 = word.search(/(ic)$/); if(a7Index3 != -1 && a7Index3 >= r2Index){ word = word.substring(0, a7Index3); //if preceded by ic, delete if in R2, } else { //else replace by iqU word = word.replace(/(ic)$/,'iqU'); } } else if(word.search(/(iv)$/) != r2Index){ word = word.replace(/(iv)$/,''); } } else if(a8Index != -1 && a8Index >= r2Index){ word = word.substring(0,a8Index); if(word.search(/(at)$/) >= r2Index){ word = word.replace(/(at)$/, ''); if(word.search(/(ic)$/) >= r2Index){ word = word.replace(/(ic)$/, ''); } else { word = word.replace(/(ic)$/, 'iqU'); } } } else if(a9Index != -1){ word = word.replace(/(eaux)/,'eau') } else if(a10Index >= r1Index){ word = word.replace(/(aux)/,'al') } else if(a11Index != -1 ){ var a11Index2 = word.search(/(euse|euses)$/); if(a11Index2 >=r2Index){ word = word.substring(0, a11Index2); } else if(a11Index2 >= r1Index){ word = word.substring(0, a11Index2)+"eux"; } } else if(a12Index!=-1 && a12Index>=r1Index){ word = word.substring(0,a12Index+1); //+1- amendment to non-vowel } else if(a13Index!=-1 && a13Index>=rvIndex){ word = word.replace(/(amment)$/,'ant'); } else if(a14Index!=-1 && a14Index>=rvIndex){ word = word.replace(/(emment)$/,'ent'); } else if(a15Index!=-1 && a15Index>=rvIndex){ word = word.substring(0,a15Index+1); } /* Step 2a: Verb suffixes beginning i*/ var wordStep1 = word; var step2aDone = false; if(oriWord == word.toLowerCase() || oriWord.search(/(amment|emment|ment|ments)$/) != -1){ step2aDone = true; var b1Regex = /([^aeiouyâàëéêèïîôûù])(îmes|ît|îtes|i|ie|ies|ir|ira|irai|iraIent|irais|irait|iras|irent|irez|iriez|irions|irons|iront|is|issaIent|issais|issait|issant|issante|issantes|issants|isse|issent|isses|issez|issiez|issions|issons|it)$/i; if(word.search(b1Regex) >= rvIndex){ word = word.replace(b1Regex,'$1'); } } /* Step 2b: Other verb suffixes*/ if (step2aDone && wordStep1 == word) { if (word.search(/(ions)$/) >= r2Index) { word = word.replace(/(ions)$/, ''); } else { var b2Regex = /(é|ée|ées|és|èrent|er|era|erai|eraIent|erais|erait|eras|erez|eriez|erions|erons|eront|ez|iez)$/i; if (word.search(b2Regex) >= rvIndex) { word = word.replace(b2Regex, ''); } else { var b3Regex = /e(âmes|ât|âtes|a|ai|aIent|ais|ait|ant|ante|antes|ants|as|asse|assent|asses|assiez|assions)$/i; if (word.search(b3Regex) >= rvIndex) { word = word.replace(b3Regex, ''); } else { var b3Regex2 = /(âmes|ât|âtes|a|ai|aIent|ais|ait|ant|ante|antes|ants|as|asse|assent|asses|assiez|assions)$/i; if (word.search(b3Regex2) >= rvIndex) { word = word.replace(b3Regex2, ''); } } } } } if(oriWord != word.toLowerCase()){ /* Step 3 */ var rep = ''; if(word.search(/Y$/) != -1) { word = word.replace(/Y$/, 'i'); } else if(word.search(/ç$/) != -1){ word = word.replace(/ç$/, 'c'); } } else { /* Step 4 */ //If the word ends s, not preceded by a, i, o, u, è or s, delete it. if (word.search(/([^aiouès])s$/) >= rvIndex) { word = word.replace(/([^aiouès])s$/, '$1'); } var e1Index = word.search(/ion$/); if (e1Index >= r2Index && word.search(/[st]ion$/) >= rvIndex) { word = word.substring(0, e1Index); } else { var e2Index = word.search(/(ier|ière|Ier|Ière)$/); if (e2Index != -1 && e2Index >= rvIndex) { word = word.substring(0, e2Index) + "i"; } else { if (word.search(/e$/) >= rvIndex) { word = word.replace(/e$/, ''); //delete last e } else if (word.search(/guë$/) >= rvIndex) { word = word.replace(/guë$/, 'gu'); } } } } /* Step 5: Undouble */ //word = word.replace(/(en|on|et|el|eil)(n|t|l)$/,'$1'); word = word.replace(/(en|on)(n)$/,'$1'); word = word.replace(/(ett)$/,'et'); word = word.replace(/(el|eil)(l)$/,'$1'); /* Step 6: Un-accent */ word = word.replace(/[éè]([^aeiouyâàëéêèïîôûù]+)$/,'e$1'); word = word.toLowerCase(); return word; }; var eqOut = new Array(); var noteqOut = new Array(); var eqCount = 0; /* To test the stemming, create two arrays named "voc" and "COut" which are for vocabualary and the stemmed output. Then add the vocabulary strings and output strings. This method will generate the stemmed output for "voc" and will compare the output with COut. (I used porter's voc and out files and did a regex to convert them to js objects. regex: /");\nvoc.push("/g . This will add strings to voc array such that output would look like: voc.push("foobar"); ) drop me an email for any help. */ function testFr(){ var start = new Date().getTime(); //execution time eqCount = 0; eqOut = new Array(); noteqOut = new Array(); for(var k=0;k0 meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$", // [C]VC[V] is m=1 mgr1 = "^(" + C + ")?" + V + C + V + C, // [C]VCVC... is m>1 s_v = "^(" + C + ")?" + v; // vowel in stem return function (w) { var stem, suffix, firstch, re, re2, re3, re4, origword = w; if (w.length < 3) { return w; } firstch = w.substr(0,1); if (firstch == "y") { w = firstch.toUpperCase() + w.substr(1); } // Step 1a re = /^(.+?)(ss|i)es$/; re2 = /^(.+?)([^s])s$/; if (re.test(w)) { w = w.replace(re,"$1$2"); } else if (re2.test(w)) { w = w.replace(re2,"$1$2"); } // Step 1b re = /^(.+?)eed$/; re2 = /^(.+?)(ed|ing)$/; if (re.test(w)) { var fp = re.exec(w); re = new RegExp(mgr0); if (re.test(fp[1])) { re = /.$/; w = w.replace(re,""); } } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1]; re2 = new RegExp(s_v); if (re2.test(stem)) { w = stem; re2 = /(at|bl|iz)$/; re3 = new RegExp("([^aeiouylsz])\\1$"); re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re2.test(w)) { w = w + "e"; } else if (re3.test(w)) { re = /.$/; w = w.replace(re,""); } else if (re4.test(w)) { w = w + "e"; } } } // Step 1c re = /^(.+?)y$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(s_v); if (re.test(stem)) { w = stem + "i"; } } // Step 2 re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) { w = stem + step2list[suffix]; } } // Step 3 re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) { w = stem + step3list[suffix]; } } // Step 4 re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; re2 = /^(.+?)(s|t)(ion)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); if (re.test(stem)) { w = stem; } } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1] + fp[2]; re2 = new RegExp(mgr1); if (re2.test(stem)) { w = stem; } } // Step 5 re = /^(.+?)e$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); re2 = new RegExp(meq1); re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) { w = stem; } } re = /ll$/; re2 = new RegExp(mgr1); if (re.test(w) && re2.test(w)) { re = /.$/; w = w.replace(re,""); } // and turn initial Y back to y if (firstch == "y") { w = firstch.toLowerCase() + w.substr(1); } return w; } })();././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/ja-jp.propsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/ja-0000664000175000017500000000001313160023044032613 0ustar bdbaddogbdbaddogJ01=\\u306B././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/punctuation.propsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/pun0000664000175000017500000000072613160023044032761 0ustar bdbaddogbdbaddogPunct01=\\u3002 Punct02=\\u3003 Punct03=\\u300C Punct04=\\u300D Punct05=\\u300E Punct06=\\u300F Punct07=\\u301D Punct08=\\u301E Punct09=\\u301F Punct10=\\u309B Punct11=\\u2018 Punct12=\\u2019 Punct13=\\u201A Punct14=\\u201C Punct15=\\u201D Punct16=\\u201E Punct17=\\u2032 Punct18=\\u2033 Punct19=\\u2035 Punct20=\\u2039 Punct21=\\u203A Punct22=\\u201E Punct23=\\u00BB Punct24=\\u00AB Punct25=© Punct26=’ Punct27=\\u00A0 Punct28=\\u2014 ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/en-us.propsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/en-0000664000175000017500000000076713160023044032643 0ustar bdbaddogbdbaddogDEF01=this DEF02=is DEF03=the DEF04=in DEF05=i DEF06=on DEF07=a DEF08=about DEF09=an DEF10=are DEF11=as DEF12=at DEF13=be DEF14=by DEF15=com DEF16=de DEF17=en DEF18=for DEF19=from DEF20=how DEF21=it DEF22=la DEF23=of DEF24=on DEF25=or DEF26=that DEF27=to DEF28=was DEF29=what DEF30=when DEF31=where DEF32=who DEF33=will DEF34=with DEF35=und DEF36=Next DEF37=Prev DEF38=Home DEF39=Motive DEF40=Inc DEF41=Copyright DEF42=All DEF43=rights DEF44=reserved DEF45=Up././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/es-es.propsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/es-0000664000175000017500000000465013160023044032643 0ustar bdbaddogbdbaddogDEF01=un DEF02=una DEF03=unas DEF04=unos DEF05=uno DEF06=sobre DEF07=todo DEF08=también DEF09=tras DEF10=otro DEF11=algún DEF12=alguno DEF13=alguna DEF14=algunos DEF15=algunas DEF16=ser DEF17=es DEF18=soy DEF19=eres DEF20=somos DEF21=sois DEF22=estoy DEF23=esta DEF24=estamos DEF25=estais DEF26=estan DEF27=como DEF28=en DEF29=para DEF30=atras DEF31=porque DEF32=por DEF33=estado DEF34=estaba DEF35=ante DEF36=antes DEF37=siendo DEF38=ambos DEF39=pero DEF40=por DEF41=poder DEF42=puede DEF43=puedo DEF44=podemos DEF45=podeis DEF46=pueden DEF47=fui DEF48=fue DEF49=fuimos DEF50=fueron DEF51=hacer DEF52=hago DEF53=hace DEF54=hacemos DEF55=haceis DEF56=hacen DEF57=cada DEF58=fin DEF59=incluso DEF60=primero DEF61=desde DEF62=conseguir DEF63=consigo DEF64=consigue DEF65=consigues DEF66=conseguimos DEF67=consiguen DEF68=ir DEF69=voy DEF70=va DEF71=vamos DEF72=vais DEF73=van DEF74=vaya DEF75=gueno DEF76=ha DEF77=tener DEF78=tengo DEF79=tiene DEF80=tenemos DEF81=teneis DEF82=tienen DEF83=el DEF84=la DEF85=lo DEF86=las DEF87=los DEF88=su DEF89=aqui DEF90=mio DEF91=tuyo DEF92=ellos DEF93=ellas DEF94=nos DEF95=nosotros DEF96=vosotros DEF97=vosotras DEF98=si DEF99=dentro DEF100=solo DEF101=solamente DEF102=saber DEF103=sabes DEF104=sabe DEF105=sabemos DEF106=sabeis DEF107=saben DEF108=ultimo DEF109=largo DEF110=bastante DEF111=haces DEF112=muchos DEF113=aquellos DEF114=aquellas DEF115=sus DEF116=entonces DEF117=tiempo DEF118=verdad DEF119=verdadero DEF120=verdadera DEF121=cierto DEF122=ciertos DEF123=cierta DEF124=ciertas DEF125=intentar DEF126=intento DEF127=intenta DEF128=intentas DEF129=intentamos DEF130=intentais DEF131=intentan DEF132=dos DEF133=bajo DEF134=arriba DEF135=encima DEF136=usar DEF137=uso DEF138=usas DEF139=usa DEF140=usamos DEF141=usais DEF142=usan DEF143=emplear DEF144=empleo DEF145=empleas DEF146=emplean DEF147=ampleamos DEF148=empleais DEF149=valor DEF150=muy DEF151=era DEF152=eras DEF153=eramos DEF154=eran DEF155=modo DEF156=bien DEF157=cual DEF158=cuando DEF159=donde DEF160=mientras DEF161=quien DEF162=con DEF163=entre DEF164=sin DEF165=trabajo DEF166=trabajar DEF167=trabajas DEF168=trabaja DEF169=trabajamos DEF170=trabajais DEF171=trabajan DEF172=podria DEF173=podrias DEF174=podriamos DEF175=podrian DEF176=podriais DEF177=yo DEF178=aquel DEF179=qué././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/nwSearchFnt.jsscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/template/content/search/nwS0000664000175000017500000004014513160023044032725 0ustar bdbaddogbdbaddog/*---------------------------------------------------------------------------- * JavaScript for webhelp search *---------------------------------------------------------------------------- This file is part of the webhelpsearch plugin for DocBook WebHelp Copyright (c) 2007-2008 NexWave Solutions All Rights Reserved. www.nexwave.biz Nadege Quaine http://kasunbg.blogspot.com/ Kasun Gajasinghe */ //string initialization var htmlfileList = "htmlFileList.js"; var htmlfileinfoList = "htmlFileInfoList.js"; var useCJKTokenizing = false; /* Cette fonction verifie la validite de la recherche entrre par l utilisateur */ function Verifie(ditaSearch_Form) { // Check browser compatibitily if (navigator.userAgent.indexOf("Konquerer") > -1) { alert(txt_browser_not_supported); return; } var expressionInput = document.ditaSearch_Form.textToSearch.value; //Set a cookie to store the searched keywords $.cookie('textToSearch', expressionInput); if (expressionInput.length < 1) { // expression is invalid alert(txt_enter_at_least_1_char); // reactive la fenetre de search (utile car cadres) document.ditaSearch_Form.textToSearch.focus(); } else { // Effectuer la recherche Effectuer_recherche(expressionInput); // reactive la fenetre de search (utile car cadres) document.ditaSearch_Form.textToSearch.focus(); } } var stemQueryMap = new Array(); // A hashtable which maps stems to query words /* This function parses the search expression, loads the indices and displays the results*/ function Effectuer_recherche(expressionInput) { /* Display a waiting message */ //DisplayWaitingMessage(); /*data initialisation*/ var searchFor = ""; // expression en lowercase et sans les caracte res speciaux //w = new Object(); // hashtable, key=word, value = list of the index of the html files scriptLetterTab = new Scriptfirstchar(); // Array containing the first letter of each word to look for var wordsList = new Array(); // Array with the words to look for var finalWordsList = new Array(); // Array with the words to look for after removing spaces var linkTab = new Array(); var fileAndWordList = new Array(); var txt_wordsnotfound = ""; /*nqu: expressionInput, la recherche est lower cased, plus remplacement des char speciaux*/ searchFor = expressionInput.toLowerCase().replace(/<\//g, "_st_").replace(/\$_/g, "_di_").replace(/\.|%2C|%3B|%21|%3A|@|\/|\*/g, " ").replace(/(%20)+/g, " ").replace(/_st_/g, "= 0; i--) { if (fileAndWordList[i] != undefined) { linkTab.push("

      " + txt_results_for + " " + "" + fileAndWordList[i][0].motslisteDisplay + "" + "

      "); linkTab.push("
        "); for (t in fileAndWordList[i]) { //DEBUG: alert(": "+ fileAndWordList[i][t].filenb+" " +fileAndWordList[i][t].motsliste); //linkTab.push("
      • "+fl[fileAndWordList[i][t].filenb]+"
      • "); var tempInfo = fil[fileAndWordList[i][t].filenb]; var pos1 = tempInfo.indexOf("@@@"); var pos2 = tempInfo.lastIndexOf("@@@"); var tempPath = tempInfo.substring(0, pos1); var tempTitle = tempInfo.substring(pos1 + 3, pos2); var tempShortdesc = tempInfo.substring(pos2 + 3, tempInfo.length); //file:///home/kasun/docbook/WEBHELP/webhelp-draft-output-format-idea/src/main/resources/web/webhelp/installation.html var linkString = "
      • " + tempTitle + ""; // var linkString = "
      • " + tempTitle + ""; if ((tempShortdesc != "null")) { linkString += "\n
        " + tempShortdesc + "
        "; } linkString += "
      • "; linkTab.push(linkString); } linkTab.push("
      "); } } } var results = ""; if (linkTab.length > 0) { /*writeln ("

      " + txt_results_for + " " + "" + cleanwordsList + "" + "
      "+"

      ");*/ results = "

      "; //write("

        "); for (t in linkTab) { results += linkTab[t].toString(); } results += "

        "; } else { results = "

        " + "Your search returned no results for " + "" + txt_wordsnotfound + "" + "

        "; } //alert(results); document.getElementById('searchResults').innerHTML = results; } function tokenize(wordsList){ var stemmedWordsList = new Array(); // Array with the words to look for after removing spaces var cleanwordsList = new Array(); // Array with the words to look for for(var j in wordsList){ var word = wordsList[j]; if(typeof stemmer != "undefined" ){ stemQueryMap[stemmer(word)] = word; } else { stemQueryMap[word] = word; } } //stemmedWordsList is the stemmed list of words separated by spaces. for (var t in wordsList) { wordsList[t] = wordsList[t].replace(/(%22)|^-/g, ""); if (wordsList[t] != "%20") { scriptLetterTab.add(wordsList[t].charAt(0)); cleanwordsList.push(wordsList[t]); } } if(typeof stemmer != "undefined" ){ //Do the stemming using Porter's stemming algorithm for (var i = 0; i < cleanwordsList.length; i++) { var stemWord = stemmer(cleanwordsList[i]); stemmedWordsList.push(stemWord); } } else { stemmedWordsList = cleanwordsList; } return stemmedWordsList; } //Invoker of CJKTokenizer class methods. function cjkTokenize(wordsList){ var allTokens= new Array(); var notCJKTokens= new Array(); var j=0; for(j=0;j"; return this.input.substring(this.offset,this.offset+2); } function getAllTokens(){ while(this.incrementToken()){ var tmp = this.tokenize(); this.tokens.push(tmp); } return this.unique(this.tokens); // document.getElementById("content").innerHTML += tokens+" "; // document.getElementById("content").innerHTML += "
        dada"+sortedTokens+" "; // console.log(tokens.length+"dsdsds"); /*for(i=0;i t2.length) { return 1; } else { return -1; } //return t1.length - t2.length); }scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/LICENSE0000664000175000017500000000003313160023043026475 0ustar bdbaddogbdbaddogSee doc/content/index.html.scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/docsrc/0000775000175000017500000000000013160023044026752 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/docsrc/readme.xml0000664000175000017500000012031313160023044030731 0ustar bdbaddogbdbaddog README: Web-based Help from DocBook XML Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Except as contained in this notice, the names of individuals credited with contribution to this software shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the individuals in question. Any stylesheet derived from this Software that is publicly distributed will be identified with a different name and the version strings in any derived Software will be changed so that no possibility of confusion between the derived package and this Software will exist. Warranty: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DAVID CRAMER, KASUN GAJASINGHE, OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. This package is maintained by Kasun Gajasinghe, kasunbg AT gmail DOT com and David Cramer, david AT thingbag DOT net. This package also includes the following software written and copyrighted by others: Files in template/common/jquery are copyrighted by JQuery under the MIT License. The file jquery.cookie.js Copyright (c) 2006 Klaus Hartl under the MIT license. jquery Some files in the template/content/search and indexer directories were originally part of N. Quaine's htmlsearch DITA plugin. The htmlsearch DITA plugin is available from the files page of the DITA-users yahoogroup. The htmlsearch plugin was released under a BSD-style license. See indexer/license.txt for details. htmlsearch DITA htmlsearch plugin Stemmers from the Snowball project released under a BSD license. Code from the Apache Lucene search engine provides support for tokenizing Chinese, Japanese, and Korean content released under the Apache 2.0 license. Webhelp for DocBook was developed as a Google Summer of Code project. 2008-2010 Kasun Gajasinghe David Cramer David Cramer dcramer AT motive DOT com david AT thingbag DOT net Kasun Gajasinghe kasunbg AT gmail DOT com August 2010 Overview of the package. Introduction A common requirement for technical publications groups is to produce a Web-based help format that includes a table of contents pane, a search feature, and an index similar to what you get from the Microsoft HTML Help (.chm) format or Eclipse help. If the content is help for a Web application that is not exposed to the Internet or requires that the user be logged in, then it is impossible to use services like Google to add search. features Features Full text search. search features Stemming support for English, French, and German. Stemming support can be added for other languages by implementing a stemmer. search stemming Support for Chinese, Japanese, and Korean using code from the Lucene search engine. Search highlighting shows where the searched for term appears in the results. Use the H button to toggle the highlighting off and on. search highlighting Search results can include brief descriptions of the target. search descriptions Table of contents pane with collapsible toc tree. Auto-synchronization of content pane and TOC. TOC and search pane implemented without the use of a frameset. An Ant build.xml file to generate output. You can use this build file by importing it into your own or use it as a model for integrating this output format into your own build system. Possible future enhancements Move webhelp-specific parameters and gentext strings into base DocBook stylesheets. Use tabindex attributes to control the tab order in the output. The Contents and Search tabs should be first and second, then the search box and button, then the table of contents items, and so on. Add "Expand all" and "Collapse all" buttons to the table of contents. Add other search options: Add an option to use Lucene for server-side searches with table of contents state persisted on the server. Add a simple form that uses a Google site:my.domain.com based search. Sort search results based on relevance Support wild card characters in the search query. Parameterize width of the TOC pane OR make the TOC pane resizeable by the user. Automate search results summary text: Automatically use the first non-heading content as the summary in the search results. Automatically limit the size of the search description to something 140 characters. Support boolean operators in search. Parameterize list of files to exclude from indexing. Currently it's hard coded that we don't index index.html and ix01.html (the legal notice and index topics). It should be smarter and automatically not index the index file even if it's not named ix01.html. Improve performance by moving the table of contents div out of each page and into a separate JavaScript file which then adds it to the page. Add to the indexer the ability to specify a list of files or file patterns not to index. Currently it does not index index.html or ix01.html, which is generally appropriate, but it should be up to the user to decide. Add an index tab populated by a separate JavaScript file. Include a param/property that allows the content creator to disable the index. Add functionality to the build.xml file so that when a property is set, the build generates a pdf version of the document and includes a link to it from the header. Add breadcrumbs so the user will know what topics he's been to. Consider using more advanced Lucene indexers for Chinese and Japanese than the CJKAnalyzer Using the package The following sections describe how to install and use the package on Windows.
        Installation instructions Generating webhelp output To install the package on Windows The examples in this procedure assume a Windows installation, but the process is the same in other environments, mutatis mutandis. If necessary, install Java 1.6 or higher. Confirm that Java is installed and in your PATH by typing the following at a command prompt: java -version To build the indexer, you must have the JDK. If necessary, install Apache Ant 1.6.5 or higher. Unzip the Ant binary distribution to a convenient location on your system. For example: c:\Program Files. Set the environment variable ANT_HOME to the top-level Ant directory. For example: c:\Program Files\apache-ant-1.7.1. See How To Manage Environment Variables in Windows XP for information on setting environment variables. Add the Ant bin directory to your PATH. For example: c:\Program Files\apache-ant-1.7.1\bin Confirm that Ant is installed by typing the following at a command prompt: ant -version If you see a message about the file tools.jar being missing, you can safely ignore it. Download Saxon 6.5.x and unzip the distribution to a convenient location on your file system. You will use the path to saxon.jar in below. The build.xml has only been tested with Saxon 6.5, though it could be adapted to work with other XSLT processors. However, when you generate output, the Saxon jar must not be in your CLASSPATH. In a text editor, edit the build.properties file in the webhelp directory and make the changes indicated by the comments:# The path (relative to the build.xml file) to your input document. # To use your own input document, create a build.xml file of your own # and import this build.xml. input-xml=docsrc/readme.xml # The directory in which to put the output files. # This directory is created if it does not exist. output-dir=docs # If you are using a customization layer that imports webhelp.xsl, use # this property to point to it. stylesheet-path=${ant.file.dir}/xsl/webhelp.xsl # If your document has image directories that need to be copied # to the output directory, you can list patterns here. # See the Ant documentation for fileset for documentation # on patterns. #input-images-dirs=images/**,figures/**,graphics/** # By default, the ant script assumes your images are stored # in the same directory as the input-xml. If you store your # image directories in another directory, specify it here. # and uncomment this line. #input-images-basedir=/path/to/image/location # Modify this so that it points to your copy of the Saxon 6.5 jar. xslt-processor-classpath=/usr/share/java/saxon-6.5.5.jar # For non-ns version only, this validates the document # against a dtd. validate-against-dtd=true # Set this to false if you don't need a search tab. webhelp.include.search.tab=true # indexer-language is used to tell the search indexer which language # the docbook is written. This will be used to identify the correct # stemmer, and punctuations that differs from language to language. # see the documentation for details. en=English, fr=French, de=German, # zh=Chinese, ja=Japanese etc. webhelp.indexer.language=en Test the package by running the command ant webhelp -Doutput-dir=test-ouput at the command line in the webhelp directory. It should generate a copy of this documentation in the doc directory. Type start test-output\index.html to open the output in a browser. Once you have confirmed that the process worked, you can delete the test-output directory. The Saxon 6.5 jar should not be in your CLASSPATH when you generate the webhelp output. If you have any problems, try running ant with an empty CLASSPATH. To process your own document, simply refer to this package from another build.xml in arbitrary location on your system: Create a new build.xml file that defines the name of your source file, the desired output directory, and imports the build.xml from this package. For example: <project> <property name="input-xml" value="path-to/yourfile.xml"/> <property name="input-images-dirs" value="images/** figures/** graphics/**"/> <property name="output-dir" value="path-to/desired-output-dir"/> <import file="path-to/docbook-webhelp/build.xml"/> </project> From the directory containing your newly created build.xml file, type ant webhelp to build your document. The Saxon 6.5 jar should not be in your CLASSPATH when you generate the webhelp output. If you have any problems, try running ant with an empty CLASSPATH.
        Using and customizing the output To deep link to a topic inside the help set, simply link directly to the page. This help system uses no frameset, so nothing further is necessary. See Chunking into multiple HTML files in Bob Stayton's DocBook XSL: The Complete Guide for information on controlling output file names and which files are chunked in DocBook. When you perform a search, the results can include brief summaries. These are populated in one of two ways: By adding role="summary" to a para or phrase in the chapter or section. By adding an abstract to the chapterinfo or sectioninfo element. To customize the look and feel of the help, study the following css files: docs/common/css/positioning.css: This handles the Positioning of DIVs in appropriate positions. For example, it causes the leftnavigation div to appear on the left, the header on top, and so on. Use this if you need to change the relative positions or need to change the width/height etc. docs/common/jquery/theme-redmond/jquery-ui-1.8.2.custom.css: This is the theming part which adds colors and stuff. This is a default theme comes with jqueryui unchanged. You can get any theme based your interest from this. (Themes are on right navigation bar.) Then replace the css theme folder (theme-redmond) with it, and change the xsl to point to the new css. docs/common/jquery/treeview/jquery.treeview.css: This styles the toc Tree. Generally, you don't have to edit this file.
        Recommended Apache configurations If you are serving a long document from an Apache web server, we recommend you make the following additions or changes to your httpd.conf or .htaccess file. TODO: Explain what each thing does.AddDefaultCharSet UTF-8 # # 480 weeks <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> # Header set Cache-Control "max-age=290304000, public" </FilesMatch> # 2 DAYS <FilesMatch "\.(xml|txt)$"> Header set Cache-Control "max-age=172800, public, must-revalidate" </FilesMatch> # 2 HOURS <FilesMatch "\.(html|htm)$"> Header set Cache-Control "max-age=7200, must-revalidate" </FilesMatch> # compress text, html, javascript, css, xml: AddOutputFilterByType DEFLATE text/plain # AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript # Or, compress certain file types by extension: <Files *.html> SetOutputFilter DEFLATE </Files> See Odd characters in HTML output in Bob Stayton's book DocBook XSL: The Complete Guide for more information about this setting. These lines and those that follow cause the browser to cache various resources such as bitmaps and JavaScript files. Note that caching JavaScript files could cause your users to have stale search indexes if you update your document since the search index is stored in JavaScript files. These lines cause the the server to compress html, css, and JavaScript files and the brower to uncompress them to improve download performance.
        Building the indexer To build the indexer, you must have installed the JDK version 1.5 or higher and set the ANT_HOME environment variable. Run ant build-indexer to recompile nw-cms.jar ANT_HOME indexer building
        Adding support for other (non-CJKV) languages To support stemming for a language, the search mechanism requires a stemmer implemented in both Java and JavaScript. The Java version is used by the indexer and the JavaScript verison is used to stem the user's input on the search form. Currently the search mechanism supports stemming for English and German. In addition, Java stemmers are included for the following languages. Therefore, to support these languages, you only need to implement the stemmer in JavaScript and add it to the template. If you do undertake this task, please consider contributing the JavaScript version back to this project and to Martin Porter's project. Danish Dutch Finnish Hungarian Italian Norwegian Portuguese Romanian Russian Spanish Swedish Turkish
        Developer Docs This chapter provides an overview of how webhelp is implemented. The table of contents and search panes are implemented as divs and rendered as if they were the left pane in a frameset. As a result, the page must save the state of the table of contents and the search in cookies when you navigate away from a page. When you load a new page, the page reads these cookies and restores the state of the table of contents tree and search. The result is that the help system behaves exactly as if it were a frameset.
        Design An overview of webhelp page structure. DocBook WebHelp page structure is fully built on css-based design abandoning frameset structure. Overall page structure can be divided in to three main sections Header: Header is a separate Div which include company logo, navigation button(prev, next etc.), page title and heading of parent topic. Content: This includes the content of the documentation. The processing of this part is done by DocBook XSL Chunking customization. Few further css-styling applied from positioning.css. Left Navigation: This includes the table of contents and search tab. This is customized using jquery-ui styling. Tabbed Navigation: The navigation pane is organized in to two tabs. Contents tab, and Search tab. Tabbed output is achieved using JQuery Tabs plugin. Table of Contents (TOC) tree: When building the chunked html from the docbook file, Table of Contents is generated as an Unordered List (a list made from <ul> <li> tags). When page loads in the browser, we apply styling to it to achieve the nice look that you see. Styling for TOC tree is done by a JQuery UI plugin called TreeView. We can generate the tree easily by following javascript code: //Generate the tree $("#tree").treeview({ collapsed: true, animated: "medium", control: "#sidetreecontrol", persist: "cookie" }); Search Tab: This includes the search feature.
        Search Overview design of Search mechanism. The searching is a fully client-side implementation of querying texts for content searching, and no server is involved. That means when a user enters a query, it is processed by JavaScript inside the browser, and displays the matching results by comparing the query with a generated 'index', which too reside in the client-side web browser. Mainly the search mechanism has two parts. Indexing: First we need to traverse the content in the docs/content folder and index the words in it. This is done by nw-cms.jar. You can invoke it by ant index command from the root of webhelp of directory. You can recompile it again and build the jar file by ant build-indexer. Indexer has some extensive support for such as stemming of words. Indexer has extensive support for English, German, French languages. By extensive support, what I meant is that those texts are stemmed first, to get the root word and then indexes them. For CJK (Chinese, Japanese, Korean) languages, it uses bi-gram tokenizing to break up the words. (CJK languages does not have spaces between words.) When we run ant index, it generates five output files: htmlFileList.js - This contains an array named fl which stores details all the files indexed by the indexer. htmlFileInfoList.js - This includes some meta data about the indexed files in an array named fil. It includes details about file name, file (html) title, a summary of the content.Format would look like, fil["4"]= "ch03.html@@@Developer Docs@@@This chapter provides an overview of how webhelp is implemented."; index-*.js (Three index files) - These three files actually stores the index of the content. Index is added to an array named w. Querying: Query processing happens totally in client side. Following JavaScript files handles them. nwSearchFnt.js - This handles the user query and returns the search results. It does query word tokenizing, drop unnecessary punctuations and common words, do stemming if docbook language supports it, etc. {$indexer-language-code}_stemmer.js - This includes the stemming library. nwSearchFnt.js file calls stemmer method in this file for stemming. ex: var stem = stemmer(foobar);
        New Stemmers Adding new Stemmers is very simple. Currently, only English, French, and German stemmers are integrated in to WebHelp. But the code is extensible such that you can add new stemmers easily by few steps. What you need: You'll need two versions of the stemmer; One written in JavaScript, and another in Java. But fortunately, Snowball contains Java stemmers for number of popular languages, and are already included with the package. You can see the full list in Adding support for other (non-CJKV) languages. If your language is listed there, Then you have to find javascript version of the stemmer. Generally, new stemmers are getting added in to Snowball Stemmers in other languages location. If javascript stemmer for your language is available, then download it. Else, you can write a new stemmer in JavaScript using SnowBall algorithm fairly easily. Algorithms are at Snowball. Then, name the JS stemmer exactly like this: {$language-code}_stemmer.js. For example, for Italian(it), name it as, it_stemmer.js. Then, copy it to the docbook-webhelp/template/content/search/stemmers/ folder. (I assumed docbook-webhelp is the root folder for webhelp.) Make sure you changed the webhelp.indexer.language property in build.properties to your language. Now two easy changes needed for the indexer. Open docbook-webhelp/indexer/src/com/nexwave/nquindexer/IndexerTask.java in a text editor and add your language code to the supportedLanguages String Array. Add new language to supportedLanguages array change the Array from, private String[] supportedLanguages= {"en", "de", "fr", "cn", "ja", "ko"}; //currently extended support available for // English, German, French and CJK (Chinese, Japanese, Korean) languages only. To, private String[] supportedLanguages= {"en", "de", "fr", "cn", "ja", "ko", "it"}; //currently extended support available for // English, German, French, CJK (Chinese, Japanese, Korean), and Italian languages only. Now, open docbook-webhelp/indexer/src/com/nexwave/nquindexer/SaxHTMLIndex.java and add the following line to the code where it initializes the Stemmer (Search for SnowballStemmer stemmer;). Then add code to initialize the stemmer Object in your language. It's self understandable. See the example. The class names are at: docbook-webhelp/indexer/src/com/nexwave/stemmer/snowball/ext/. initialize correct stemmer based on the <code>webhelp.indexer.language</code> specified SnowballStemmer stemmer; if(indexerLanguage.equalsIgnoreCase("en")){ stemmer = new EnglishStemmer(); } else if (indexerLanguage.equalsIgnoreCase("de")){ stemmer= new GermanStemmer(); } else if (indexerLanguage.equalsIgnoreCase("fr")){ stemmer= new FrenchStemmer(); } else if (indexerLanguage.equalsIgnoreCase("it")){ //If language code is "it" (Italian) stemmer= new italianStemmer(); //Initialize the stemmer to italianStemmer object. } else { stemmer = null; } That's all. Now run ant build-indexer to compile and build the java code. Then, run ant webhelp to generate the output from your docbook file. For any questions, contact us or email to the docbook mailing list docbook-apps@lists.oasis-open.org.
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/xsl/0000775000175000017500000000000013160023044026303 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/webhelp/xsl/webhelp.xsl0000664000175000017500000011210013160023044030454 0ustar bdbaddogbdbaddog true index.html docs en 0 no 0 0 language: Note namesp. cut stripped namespace before processing Note namesp. cut processing stripped document Unable to strip the namespace from DB5 document, cannot proceed. ID ' ' not found in document.
      • webhelp-currentid
      • <xsl:value-of select="//title[1]"/>  If not automatically redirected, click here: content/ch01.html
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/0000775000175000017500000000000013160023042025640 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/block.xsl0000664000175000017500000003726613160023042027500 0ustar bdbaddogbdbaddog n .sp .RS 4 .BM yellow .ps +1 .ps -1 .br .sp .5v .EM yellow .RE .PP . .sp .RS 4n .PP .RE .sp .RS 4n .sp Yes Yes .sp .RS .ft .nf .fi .ft .nf t .sp -1 .BB lightgray adjust-for-leading-newline .sp -1 .BB lightgray .EB lightgray adjust-for-leading-newline t .sp 1 .EB lightgray .fi .RE .sp before .PP .sp .RS .RE [IMAGE] [ ] scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/refentry.xsl0000664000175000017500000003011113160023042030222 0ustar bdbaddogbdbaddog .br , \- .SS " " .RS .RE .RS .RE .ti (\n(SNu * 5u / 3u) (\n(SNu) .RS (\n(SNu) .RE \c .SH-xref " \c" \& scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/profile-docbook.xsl0000664000175000017500000003531213160023042031452 0ustar bdbaddogbdbaddog Note: namesp. cut : stripped namespace before processingNote: namesp. cut : processing stripped document MAN.MANIFEST Erro no refentry No refentry elements found in " ... " . '\" t .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/param.xsl0000664000175000017500000002164213160023042027475 0ustar bdbaddogbdbaddog 1 0 [set $man.base.url.for.relative.links]/ @*[local-name() = 'block'] = 'Miscellaneous Technical' or (@*[local-name() = 'block'] = 'C1 Controls And Latin-1 Supplement (Latin-1 Supplement)' and (@*[local-name() = 'class'] = 'symbols' or @*[local-name() = 'class'] = 'letters') ) or @*[local-name() = 'block'] = 'Latin Extended-A' or (@*[local-name() = 'block'] = 'General Punctuation' and (@*[local-name() = 'class'] = 'spaces' or @*[local-name() = 'class'] = 'dashes' or @*[local-name() = 'class'] = 'quotes' or @*[local-name() = 'class'] = 'bullets' ) ) or @*[local-name() = 'name'] = 'HORIZONTAL ELLIPSIS' or @*[local-name() = 'name'] = 'WORD JOINER' or @*[local-name() = 'name'] = 'SERVICE MARK' or @*[local-name() = 'name'] = 'TRADE MARK SIGN' or @*[local-name() = 'name'] = 'ZERO WIDTH NO-BREAK SPACE' @*[local-name() = 'block'] = 'Miscellaneous Technical' or (@*[local-name() = 'block'] = 'C1 Controls And Latin-1 Supplement (Latin-1 Supplement)' and @*[local-name() = 'class'] = 'symbols') or (@*[local-name() = 'block'] = 'General Punctuation' and (@*[local-name() = 'class'] = 'spaces' or @*[local-name() = 'class'] = 'dashes' or @*[local-name() = 'class'] = 'quotes' or @*[local-name() = 'class'] = 'bullets' ) ) or @*[local-name() = 'name'] = 'HORIZONTAL ELLIPSIS' or @*[local-name() = 'name'] = 'WORD JOINER' or @*[local-name() = 'name'] = 'SERVICE MARK' or @*[local-name() = 'name'] = 'TRADE MARK SIGN' or @*[local-name() = 'name'] = 'ZERO WIDTH NO-BREAK SPACE' 1 1 1 BI B B B B ansi 0 0 0 0 4 0 man/ UTF-8 MAN.MANIFEST 0 0 ======================================================================== ---- 0 30 0 30 0 20 0 (($info[//date])[last()]/date)[1]| (($info[//pubdate])[last()]/pubdate)[1] refmeta/refmiscinfo[not(@class = 'date')][1]/node() 0 (($info[//title])[last()]/title)[1]| ../title/node() refmeta/refmiscinfo[not(@class = 'date')][1]/node() 0 (($info[//productname])[last()]/productname)[1]| (($info[//corpname])[last()]/corpname)[1]| (($info[//corpcredit])[last()]/corpcredit)[1]| (($info[//corpauthor])[last()]/corpauthor)[1]| (($info[//orgname])[last()]/orgname)[1]| (($info[//publishername])[last()]/publishername)[1] 0 0 (($info[//productnumber])[last()]/productnumber)[1]| (($info[//edition])[last()]/edition)[1]| (($info[//releaseinfo])[last()]/releaseinfo)[1] 0 scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/charmap.groff.xsl0000664000175000017500000045437513160023042031127 0ustar bdbaddogbdbaddog scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/inline.xsl0000664000175000017500000001666113160023042027660 0ustar bdbaddogbdbaddog ( ) © ® .\" : .\" scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/endnotes.xsl0000664000175000017500000006354513160023042030224 0ustar bdbaddogbdbaddog Warn endnote Bad: [ ] in source Note endnote Has: / Note endnote Fix: / para/ \% \m[blue] Warn link font invalid $man.font.links value: ' ' \m[] \&\s-2\u[ ]\d\s+2 .IP " . " .RS \% .RE scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/pi.xml0000664000175000017500000000424113160023042026773 0ustar bdbaddogbdbaddog manpages Processing Instruction Reference $Id: pi.xsl 7644 2008-01-16 11:04:07Z xmldoc $ Introduction This is generated reference documentation for all user-specifiable processing instructions (PIs) in the DocBook XSL stylesheets for manpages output. You add these PIs at particular points in a document to cause specific “exceptions†to formatting/output behavior. To make global changes in formatting/output behavior across an entire document, it’s better to do it by setting an appropriate stylesheet parameter (if there is one). dbman_funcsynopsis-style Specifies presentation style for a funcsynopsis. dbman funcsynopsis-style="kr"|"ansi" Description Use the dbman funcsynopsis-style PI as a child of a funcsynopsis or anywhere within a funcsynopsis to control the presentation style for output of all funcprototype instances within that funcsynopsis. Parameters funcsynopsis-style="kr" Displays the funcprototype in K&R style funcsynopsis-style="ansi" Displays the funcprototype in ANSI style Related Global Parameters man.funcsynopsis.style scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/pi.xsl0000664000175000017500000000615013160023042027002 0ustar bdbaddogbdbaddog manpages Processing Instruction Reference $Id: pi.xsl 7644 2008-01-16 11:04:07Z xmldoc $ Introduction This is generated reference documentation for all user-specifiable processing instructions (PIs) in the DocBook XSL stylesheets for manpages output. You add these PIs at particular points in a document to cause specific “exceptions†to formatting/output behavior. To make global changes in formatting/output behavior across an entire document, it’s better to do it by setting an appropriate stylesheet parameter (if there is one). Specifies presentation style for a funcsynopsis. Use the dbman funcsynopsis-style PI as a child of a funcsynopsis or anywhere within a funcsynopsis to control the presentation style for output of all funcprototype instances within that funcsynopsis. dbman funcsynopsis-style="kr"|"ansi" funcsynopsis-style="kr" Displays the funcprototype in K&R style funcsynopsis-style="ansi" Displays the funcprototype in ANSI style man.funcsynopsis.style scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/table.xsl0000664000175000017500000006734513160023042027476 0ustar bdbaddogbdbaddog : allbox center expand
        .sp . *[nested▀table] .TS H tab( ) ; .TH .T& .TE .sp 1
        T{ T} Warn tbl convert Extracted a nested table [\fInested▀table\fR]* . ^ c r n l t ^ s .br ftn. # [ ]
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/synop.xsl0000664000175000017500000004026013160023042027542 0ustar bdbaddogbdbaddog | ( ) .HP \w' ( ) \ 'u ( ) \ .br▒ .ad l .hy 0 .HP \w' \ 'u .ad .hy .ad l .hy 0 .ad .hy .HP \w' ('u . " ( " .sp .RS .RE ); ...); void); ...); , ); , ); .br . " ; " "░" "░" ( ) scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/docbook.xsl0000664000175000017500000003557613160023042030030 0ustar bdbaddogbdbaddog Note namesp. cut stripped namespace before processing Note namesp. cut processing stripped document MAN.MANIFEST Erro no refentry No refentry elements found in " ... " . '\" t .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/utility.xsl0000664000175000017500000005461313160023042030104 0ustar bdbaddogbdbaddog \fB \fR \fI \fR \FC \F[] .fam C .ps -1 .fam .ps +1 .fam C .fam \% .sp .ps +1 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .sp .RS .RE .SH " " .\" n .ie \{\ n .if \{\ .\} .el \{\ .\} scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/param.xml0000664000175000017500000040060413160023042027466 0ustar bdbaddogbdbaddog Manpages Parameter Reference $Id: param.xweb 8235 2009-02-09 16:22:14Z xmldoc $ The DocBook Project 2005-2007 The DocBook Project This is reference documentation for all user-configurable parameters in the DocBook XSL "manpages" stylesheet (for generating groff/nroff output). Note that the manpages stylesheet is a customization layer of the DocBook XSL HTML stylesheet. Therefore, you can also use a number of HTML stylesheet parameters to control manpages output (in addition to the manpages-specific parameters listed in this section). Hyphenation, justification, and breaking man.hyphenate boolean man.hyphenate Enable hyphenation? <xsl:param name="man.hyphenate">0</xsl:param> Description If non-zero, hyphenation is enabled. The default value for this parameter is zero because groff is not particularly smart about how it does hyphenation; it can end up hyphenating a lot of things that you don't want hyphenated. To mitigate that, the default behavior of the stylesheets is to suppress hyphenation of computer inlines, filenames, and URLs. (You can override the default behavior by setting non-zero values for the man.hyphenate.urls, man.hyphenate.filenames, and man.hyphenate.computer.inlines parameters.) But the best way is still to just globally disable hyphenation, as the stylesheets do by default. The only good reason to enabled hyphenation is if you have also enabled justification (which is disabled by default). The reason is that justified text can look very bad unless you also hyphenate it; to quote the Hypenation node from the groff info page:
        Since the odds are not great for finding a set of words, for every output line, which fit nicely on a line without inserting excessive amounts of space between words, 'gtroff' hyphenates words so that it can justify lines without inserting too much space between words.
        So, if you set a non-zero value for the man.justify parameter (to enable justification), then you should probably also set a non-zero value for man.hyphenate (to enable hyphenation).
        man.hyphenate.urls boolean man.hyphenate.urls Hyphenate URLs? <xsl:param name="man.hyphenate.urls">0</xsl:param> Description If zero (the default), hyphenation is suppressed for output of the ulink url attribute. If hyphenation is already turned off globally (that is, if man.hyphenate is zero, setting man.hyphenate.urls is not necessary. If man.hyphenate.urls is non-zero, URLs will not be treated specially and are subject to hyphenation just like other words. If you are thinking about setting a non-zero value for man.hyphenate.urls in order to make long URLs break across lines, you'd probably be better off experimenting with setting the man.break.after.slash parameter first. That will cause long URLs to be broken after slashes. man.hyphenate.filenames boolean man.hyphenate.filenames Hyphenate filenames? <xsl:param name="man.hyphenate.filenames">0</xsl:param> Description If zero (the default), hyphenation is suppressed for filename output. If hyphenation is already turned off globally (that is, if man.hyphenate is zero, setting man.hyphenate.filenames is not necessary. If man.hyphenate.filenames is non-zero, filenames will not be treated specially and are subject to hyphenation just like other words. If you are thinking about setting a non-zero value for man.hyphenate.filenames in order to make long filenames/pathnames break across lines, you'd probably be better off experimenting with setting the man.break.after.slash parameter first. That will cause long pathnames to be broken after slashes. man.hyphenate.computer.inlines boolean man.hyphenate.computer.inlines Hyphenate computer inlines? <xsl:param name="man.hyphenate.computer.inlines">0</xsl:param> Description If zero (the default), hyphenation is suppressed for computer inlines such as environment variables, constants, etc. This parameter current affects output of the following elements: classname constant envar errorcode option replaceable userinput type varname If hyphenation is already turned off globally (that is, if man.hyphenate is zero, setting the man.hyphenate.computer.inlines is not necessary. If man.hyphenate.computer.inlines is non-zero, computer inlines will not be treated specially and will be hyphenated like other words when needed. man.justify boolean man.justify Justify text to both right and left margins? <xsl:param name="man.justify">0</xsl:param> Description If non-zero, text is justified to both the right and left margins (or, in roff terminology, "adjusted and filled" to both the right and left margins). If zero (the default), text is adjusted to the left margin only -- producing what is traditionally called "ragged-right" text. The default value for this parameter is zero because justified text looks good only when it is also hyphenated. Without hyphenation, excessive amounts of space often end up getting between words, in order to "pad" lines out to align on the right margin. The problem is that groff is not particularly smart about how it does hyphenation; it can end up hyphenating a lot of things that you don't want hyphenated. So, disabling both justification and hyphenation ensures that hyphens won't get inserted where you don't want to them, and you don't end up with lines containing excessive amounts of space between words. However, if do you decide to set a non-zero value for the man.justify parameter (to enable justification), then you should probably also set a non-zero value for man.hyphenate (to enable hyphenation). Yes, these default settings run counter to how most existing man pages are formatted. But there are some notable exceptions, such as the perl man pages. man.break.after.slash boolean man.break.after.slash Enable line-breaking after slashes? <xsl:param name="man.break.after.slash">0</xsl:param> Description If non-zero, line-breaking after slashes is enabled. This is mainly useful for causing long URLs or pathnames/filenames to be broken up or "wrapped" across lines (though it also has the side effect of sometimes causing relatively short URLs and pathnames to be broken up across lines too). If zero (the default), line-breaking after slashes is disabled. In that case, strings containing slashes (for example, URLs or filenames) are not broken across lines, even if they exceed the maximum column widith. If you set a non-zero value for this parameter, check your man-page output carefuly afterwards, in order to make sure that the setting has not introduced an excessive amount of breaking-up of URLs or pathnames. If your content contains mostly short URLs or pathnames, setting a non-zero value for man.break.after.slash will probably result in in a significant number of relatively short URLs and pathnames being broken across lines, which is probably not what you want.
        Indentation man.indent.width length man.indent.width Specifies width used for adjusted indents <xsl:param name="man.indent.width">4</xsl:param> Description The man.indent.width parameter specifies the width used for adjusted indents. The value of man.indent.width is used for indenting of lists, verbatims, headings, and elsewhere, depending on whether the values of certain man.indent.* boolean parameters are non-zero. The value of man.indent.width should include a valid roff measurement unit (for example, n or u). The default value of 4n specifies a 4-en width; when viewed on a console, that amounts to the width of four characters. For details about roff measurment units, see the Measurements node in the groff info page. man.indent.refsect boolean man.indent.refsect Adjust indentation of refsect* and refsection? <xsl:param name="man.indent.refsect" select="0"></xsl:param> Description If the value of man.indent.refsect is non-zero, the width of the left margin for refsect1, refsect2 and refsect3 contents and titles (and first-level, second-level, and third-level nested refsectioninstances) is adjusted by the value of the man.indent.width parameter. With man.indent.width set to its default value of 3n, the main results are that: contents of refsect1 are output with a left margin of three characters instead the roff default of seven or eight characters contents of refsect2 are displayed in console output with a left margin of six characters instead the of the roff default of seven characters the contents of refsect3 and nested refsection instances are adjusted accordingly. If instead the value of man.indent.refsect is zero, no margin adjustment is done for refsect* output. If your content is primarly comprised of refsect1 and refsect2 content (or the refsection equivalent) – with few or no refsect3 or lower nested sections , you may be able to “conserve” space in your output by setting man.indent.refsect to a non-zero value. Doing so will “squeeze” the left margin in such as way as to provide an additional four characters of “room” per line in refsect1 output. That extra room may be useful if, for example, you have many verbatim sections with long lines in them. man.indent.blurbs boolean man.indent.blurbs Adjust indentation of blurbs? <xsl:param name="man.indent.blurbs" select="1"></xsl:param> Description If the value of man.indent.blurbs is non-zero, the width of the left margin for authorblurb, personblurb, and contrib output is set to the value of the man.indent.width parameter (3n by default). If instead the value of man.indent.blurbs is zero, the built-in roff default width (7.2n) is used. man.indent.lists boolean man.indent.lists Adjust indentation of lists? <xsl:param name="man.indent.lists" select="1"></xsl:param> Description If the value of man.indent.lists is non-zero, the width of the left margin for list items in itemizedlist, orderedlist, variablelist output (and output of some other lists) is set to the value of the man.indent.width parameter (4n by default). If instead the value of man.indent.lists is zero, the built-in roff default width (7.2n) is used. man.indent.verbatims boolean man.indent.verbatims Adjust indentation of verbatims? <xsl:param name="man.indent.verbatims" select="1"></xsl:param> Description If the value of man.indent.verbatims is non-zero, the width of the left margin for output of verbatim environments (programlisting, screen, and so on) is set to the value of the man.indent.width parameter (3n by default). If instead the value of man.indent.verbatims is zero, the built-in roff default width (7.2n) is used. Fonts man.font.funcprototype string man.font.funcprototype Specifies font for funcprototype output <xsl:param name="man.font.funcprototype">BI</xsl:param> Description The man.font.funcprototype parameter specifies the font for funcprototype output. It should be a valid roff font name, such as BI or B. man.font.funcsynopsisinfo string man.font.funcsynopsisinfo Specifies font for funcsynopsisinfo output <xsl:param name="man.font.funcsynopsisinfo">B</xsl:param> Description The man.font.funcsynopsisinfo parameter specifies the font for funcsynopsisinfo output. It should be a valid roff font name, such as B or I. man.font.links string man.font.links Specifies font for links <xsl:param name="man.font.links">B</xsl:param> Description The man.font.links parameter specifies the font for output of links (ulink instances and any instances of any element with an xlink:href attribute). The value of man.font.links must be either B or I, or empty. If the value is empty, no font formatting is applied to links. If you set man.endnotes.are.numbered and/or man.endnotes.list.enabled to zero (disabled), then you should probably also set an empty value for man.font.links. But if man.endnotes.are.numbered is non-zero (enabled), you should probably keep man.font.links set to B or IThe main purpose of applying a font format to links in most output formats it to indicate that the formatted text is “clickable”; given that links rendered in man pages are not “real” hyperlinks that users can click on, it might seem like there is never a good reason to have font formatting for link contents in man output. In fact, if you suppress the display of inline link references (by setting man.endnotes.are.numbered to zero), there is no good reason to apply font formatting to links. However, if man.endnotes.are.numbered is non-zero, having font formatting for links (arguably) serves a purpose: It provides “context” information about exactly what part of the text is being “annotated” by the link. Depending on how you mark up your content, that context information may or may not have value.. Related Parameters man.endnotes.list.enabled, man.endnotes.are.numbered man.font.table.headings string man.font.table.headings Specifies font for table headings <xsl:param name="man.font.table.headings">B</xsl:param> Description The man.font.table.headings parameter specifies the font for table headings. It should be a valid roff font, such as B or I. man.font.table.title string man.font.table.title Specifies font for table headings <xsl:param name="man.font.table.title">B</xsl:param> Description The man.font.table.title parameter specifies the font for table titles. It should be a valid roff font, such as B or I. SYNOPSIS section man.funcsynopsis.style list ansi kr man.funcsynopsis.style What style of funcsynopsis should be generated? <xsl:param name="man.funcsynopsis.style">ansi</xsl:param> Description If man.funcsynopsis.style is ansi, ANSI-style function synopses are generated for a funcsynopsis, otherwise K&R-style function synopses are generated. AUTHORS and COPYRIGHT sections man.authors.section.enabled boolean man.authors.section.enabled Display auto-generated AUTHORS section? <xsl:param name="man.authors.section.enabled">1</xsl:param> Description If the value of man.authors.section.enabled is non-zero (the default), then an AUTHORS section is generated near the end of each man page. The output of the AUTHORS section is assembled from any author, editor, and othercredit metadata found in the contents of the child info or refentryinfo (if any) of the refentry itself, or from any author, editor, and othercredit metadata that may appear in info contents of any ancestors of the refentry. If the value of man.authors.section.enabled is zero, the the auto-generated AUTHORS section is suppressed. Set the value of man.authors.section.enabled to zero if you want to have a manually created AUTHORS section in your source, and you want it to appear in output instead of the auto-generated AUTHORS section. man.copyright.section.enabled boolean man.copyright.section.enabled Display auto-generated COPYRIGHT section? <xsl:param name="man.copyright.section.enabled">1</xsl:param> Description If the value of man.copyright.section.enabled is non-zero (the default), then a COPYRIGHT section is generated near the end of each man page. The output of the COPYRIGHT section is assembled from any copyright and legalnotice metadata found in the contents of the child info or refentryinfo (if any) of the refentry itself, or from any copyright and legalnotice metadata that may appear in info contents of any ancestors of the refentry. If the value of man.copyright.section.enabled is zero, the the auto-generated COPYRIGHT section is suppressed. Set the value of man.copyright.section.enabled to zero if you want to have a manually created COPYRIGHT section in your source, and you want it to appear in output instead of the auto-generated COPYRIGHT section. Endnotes and link handling man.endnotes.list.enabled boolean man.endnotes.list.enabled Display endnotes list at end of man page? <xsl:param name="man.endnotes.list.enabled">1</xsl:param> Description If the value of man.endnotes.list.enabled is non-zero (the default), then an endnotes list is added to the end of the output man page. If the value of man.endnotes.list.enabled is zero, the list is suppressed — unless link numbering is enabled (that is, if man.endnotes.are.numbered is non-zero), in which case, that setting overrides the man.endnotes.list.enabled setting, and the endnotes list is still displayed. The reason is that inline numbering of notesources associated with endnotes only makes sense if a (numbered) list of endnotes is also generated. Leaving man.endnotes.list.enabled at its default (non-zero) value ensures that no “out of line” information (such as the URLs for hyperlinks and images) gets lost in your man-page output. It just gets “rearranged”. So if you’re thinking about disabling endnotes listing by setting the value of man.endnotes.list.enabled to zero: Before you do so, first take some time to carefully consider the information needs and experiences of your users. The “out of line” information has value even if the presentation of it in text output is not as interactive as it may be in other output formats. As far as the specific case of URLs: Even though the URLs displayed in text output may not be “real” (clickable) hyperlinks, many X terminals have convenience features for recognizing URLs and can, for example, present users with an options to open a URL in a browser with the user clicks on the URL is a terminal window. And short of those, users with X terminals can always manually cut and paste the URLs into a web browser. Also, note that various “man to html” tools, such as the widely used man2html (VH-Man2html) application, automatically mark up URLs with a@href markup during conversion — resulting in “real” hyperlinks in HTML output from those tools. To “turn off” numbering of endnotes in the endnotes list, set man.endnotes.are.numbered to zero. The endnotes list will still be displayed; it will just be displayed without the numbersIt can still make sense to have the list of endnotes displayed even if you have endnotes numbering turned off. In that case, your endnotes list basically becomes a “list of references” without any association with specific text in your document. This is probably the best option if you find the inline endnotes numbering obtrusive. Your users will still have access to all the “out of line” such as URLs for hyperlinks. The default heading for the endnotes list is NOTES. To change that, set a non-empty value for the man.endnotes.list.heading parameter. In the case of notesources that are links: Along with the URL for each link, the endnotes list includes the contents of the link. The list thus includes only non-empty A “non-empty” link is one that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/">manpages</ulink> an “empty link” is on that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/"/> links. Empty links are never included, and never numbered. They are simply displayed inline, without any numbering. In addition, if there are multiple instances of links in a refentry that have the same URL, the URL is listed only once. The contents listed for that link in the endnotes list are the contents of the first link which has that URL. If you disable endnotes listing, you should probably also set man.links.are.underlined to zero (to disable link underlining). man.endnotes.list.heading string man.endnotes.list.heading Specifies an alternate name for endnotes list <xsl:param name="man.endnotes.list.heading"></xsl:param> Description If the value of the man.endnotes.are.numbered parameter and/or the man.endnotes.list.enabled parameter is non-zero (the defaults for both are non-zero), a numbered list of endnotes is generated near the end of each man page. The default heading for the list of endnotes is the equivalent of the English word NOTES in the current locale. To cause an alternate heading to be displayed, set a non-empty value for the man.endnotes.list.heading parameter — for example, REFERENCES. man.endnotes.are.numbered boolean man.endnotes.are.numbered Number endnotes? <xsl:param name="man.endnotes.are.numbered">1</xsl:param> Description If the value of man.endnotes.are.numbered is non-zero (the default), then for each non-empty A “non-empty” notesource is one that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/">manpages</ulink> an “empty” notesource is on that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/"/> “notesource”: a number (in square brackets) is displayed inline after the rendered inline contents (if any) of the notesource the contents of the notesource are included in a numbered list of endnotes that is generated at the end of each man page; the number for each endnote corresponds to the inline number for the notesource with which it is associated The default heading for the list of endnotes is NOTES. To output a different heading, set a value for the man.endnotes.section.heading parameter. The endnotes list is also displayed (but without numbers) if the value of man.endnotes.list.enabled is non-zero. If the value of man.endnotes.are.numbered is zero, numbering of endnotess is suppressed; only inline contents (if any) of the notesource are displayed inline. If you are thinking about disabling endnote numbering by setting the value of man.endnotes.are.numbered to zero, before you do so, first take some time to carefully consider the information needs and experiences of your users. The square-bracketed numbers displayed inline after notesources may seem obstrusive and aesthetically unpleasingAs far as notesources that are links, ytou might think it would be better to just display URLs for non-empty links inline, after their content, rather than displaying square-bracketed numbers all over the place. But it's not better. In fact, it's not even practical, because many (most) URLs for links are too long to be displayed inline. They end up overflowing the right margin. You can set a non-zero value for man.break.after.slash parameter to deal with that, but it could be argued that what you end up with is at least as ugly, and definitely more obstrusive, then having short square-bracketed numbers displayed inline., but in a text-only output format, the numbered-notesources/endnotes-listing mechanism is the only practical way to handle this kind of content. Also, users of “text based” browsers such as lynx will already be accustomed to seeing inline numbers for links. And various "man to html" applications, such as the widely used man2html (VH-Man2html) application, can automatically turn URLs into "real" HTML hyperlinks in output. So leaving man.endnotes.are.numbered at its default (non-zero) value ensures that no information is lost in your man-page output. It just gets “rearranged”. The handling of empty links is not affected by this parameter. Empty links are handled simply by displaying their URLs inline. Empty links are never auto-numbered. If you disable endnotes numbering, you should probably also set man.font.links to an empty value (to disable font formatting for links. Related Parameters man.endnotes.list.enabled, man.font.links man.base.url.for.relative.links string man.base.url.for.relative.links Specifies a base URL for relative links <xsl:param name="man.base.url.for.relative.links">[set $man.base.url.for.relative.links]/</xsl:param> Description For any “notesource” listed in the auto-generated “NOTES” section of output man pages (which is generated when the value of the man.endnotes.list.enabled parameter is non-zero), if the notesource is a link source with a relative URI, the URI is displayed in output with the value of the man.base.url.for.relative.links parameter prepended to the value of the link URI. A link source is an notesource that references an external resource: a ulink element with a url attribute any element with an xlink:href attribute an imagedata, audiodata, or videodata element If you use relative URIs in link sources in your DocBook refentry source, and you leave man.base.url.for.relative.links unset, the relative links will appear “as is” in the “Notes” section of any man-page output generated from your source. That’s probably not what you want, because such relative links are only usable in the context of HTML output. So, to make the links meaningful and usable in the context of man-page output, set a value for man.base.url.for.relative.links that points to the online version of HTML output generated from your DocBook refentry source. For example: <xsl:param name="man.base.url.for.relative.links" >http://www.kernel.org/pub/software/scm/git/docs/</xsl:param> Related Parameters man.endnotes.list.enabled Lists man.segtitle.suppress boolean man.segtitle.suppress Suppress display of segtitle contents? <xsl:param name="man.segtitle.suppress" select="0"></xsl:param> Description If the value of man.segtitle.suppress is non-zero, then display of segtitle contents is suppressed in output. Character/string substitution man.charmap.enabled boolean man.charmap.enabled Apply character map before final output? <xsl:param name="man.charmap.enabled" select="1"></xsl:param> Description If the value of the man.charmap.enabled parameter is non-zero, a "character map" is used to substitute certain Unicode symbols and special characters with appropriate roff/groff equivalents, just before writing each man-page file to the filesystem. If instead the value of man.charmap.enabled is zero, Unicode characters are passed through "as is". Details For converting certain Unicode symbols and special characters in UTF-8 or UTF-16 encoded XML source to appropriate groff/roff equivalents in man-page output, the DocBook XSL Stylesheets distribution includes a roff character map that is compliant with the XSLT character map format as detailed in the XSLT 2.0 specification. The map contains more than 800 character mappings and can be considered the standard roff character map for the distribution. You can use the man.charmap.uri parameter to specify a URI for the location for an alternate roff character map to use in place of the standard roff character map provided in the distribution. You can also use a subset of a character map. For details, see the man.charmap.use.subset, man.charmap.subset.profile, and man.charmap.subset.profile.english parameters. man.charmap.uri uri man.charmap.uri URI for custom roff character map <xsl:param name="man.charmap.uri"></xsl:param> Description For converting certain Unicode symbols and special characters in UTF-8 or UTF-16 encoded XML source to appropriate groff/roff equivalents in man-page output, the DocBook XSL Stylesheets distribution includes an XSLT character map. That character map can be considered the standard roff character map for the distribution. If the value of the man.charmap.uri parameter is non-empty, that value is used as the URI for the location for an alternate roff character map to use in place of the standard roff character map provided in the distribution. Do not set a value for man.charmap.uri unless you have a custom roff character map that differs from the standard one provided in the distribution. man.charmap.use.subset boolean man.charmap.use.subset Use subset of character map instead of full map? <xsl:param name="man.charmap.use.subset" select="1"></xsl:param> Description If the value of the man.charmap.use.subset parameter is non-zero, a subset of the roff character map is used instead of the full roff character map. The profile of the subset used is determined either by the value of the man.charmap.subset.profile parameter (if the source is not in English) or the man.charmap.subset.profile.english parameter (if the source is in English). You may want to experiment with setting a non-zero value of man.charmap.use.subset, so that the full character map is used. Depending on which XSLT engine you run, setting a non-zero value for man.charmap.use.subset may significantly increase the time needed to process your documents. Or it may not. For example, if you set it and run it with xsltproc, it seems to dramatically increase processing time; on the other hand, if you set it and run it with Saxon, it does not seem to increase processing time nearly as much. If processing time is not a important concern and/or you can tolerate the increase in processing time imposed by using the full character map, set man.charmap.use.subset to zero. Details For converting certain Unicode symbols and special characters in UTF-8 or UTF-16 encoded XML source to appropriate groff/roff equivalents in man-page output, the DocBook XSL Stylesheets distribution includes a roff character map that is compliant with the XSLT character map format as detailed in the XSLT 2.0 specification. The map contains more than 800 character mappings and can be considered the standard roff character map for the distribution. You can use the man.charmap.uri parameter to specify a URI for the location for an alternate roff character map to use in place of the standard roff character map provided in the distribution. Because it is not terrifically efficient to use the standard 800-character character map in full -- and for most (or all) users, never necessary to use it in full -- the DocBook XSL Stylesheets support a mechanism for using, within any given character map, a subset of character mappings instead of the full set. You can use the man.charmap.subset.profile or man.charmap.subset.profile.english parameter to tune the profile of that subset to use. man.charmap.subset.profile string man.charmap.subset.profile Profile of character map subset <xsl:param name="man.charmap.subset.profile"> @*[local-name() = 'block'] = 'Miscellaneous Technical' or (@*[local-name() = 'block'] = 'C1 Controls And Latin-1 Supplement (Latin-1 Supplement)' and (@*[local-name() = 'class'] = 'symbols' or @*[local-name() = 'class'] = 'letters') ) or @*[local-name() = 'block'] = 'Latin Extended-A' or (@*[local-name() = 'block'] = 'General Punctuation' and (@*[local-name() = 'class'] = 'spaces' or @*[local-name() = 'class'] = 'dashes' or @*[local-name() = 'class'] = 'quotes' or @*[local-name() = 'class'] = 'bullets' ) ) or @*[local-name() = 'name'] = 'HORIZONTAL ELLIPSIS' or @*[local-name() = 'name'] = 'WORD JOINER' or @*[local-name() = 'name'] = 'SERVICE MARK' or @*[local-name() = 'name'] = 'TRADE MARK SIGN' or @*[local-name() = 'name'] = 'ZERO WIDTH NO-BREAK SPACE' </xsl:param> Description If the value of the man.charmap.use.subset parameter is non-zero, and your DocBook source is not written in English (that is, if the lang or xml:lang attribute on the root element in your DocBook source or on the first refentry element in your source has a value other than en), then the character-map subset specified by the man.charmap.subset.profile parameter is used instead of the full roff character map. Otherwise, if the lang or xml:lang attribute on the root element in your DocBook source or on the first refentry element in your source has the value en or if it has no lang or xml:lang attribute, then the character-map subset specified by the man.charmap.subset.profile.english parameter is used instead of man.charmap.subset.profile. The difference between the two subsets is that man.charmap.subset.profile provides mappings for characters in Western European languages that are not part of the Roman (English) alphabet (ASCII character set). The value of man.charmap.subset.profile is a string representing an XPath expression that matches attribute names and values for output-character elements in the character map. The attributes supported in the standard roff character map included in the distribution are: character a raw Unicode character or numeric Unicode character-entity value (either in decimal or hex); all characters have this attribute name a standard full/long ISO/Unicode character name (e.g., "OHM SIGN"); all characters have this attribute block a standard Unicode "block" name (e.g., "General Punctuation"); all characters have this attribute. For the full list of Unicode block names supported in the standard roff character map, see . class a class of characters (e.g., "spaces"). Not all characters have this attribute; currently, it is used only with certain characters within the "C1 Controls And Latin-1 Supplement" and "General Punctuation" blocks. For details, see . entity an ISO entity name (e.g., "ohm"); not all characters have this attribute, because not all characters have ISO entity names; for example, of the 800 or so characters in the standard roff character map included in the distribution, only around 300 have ISO entity names. string a string representing an roff/groff escape-code (with "@esc@" used in place of the backslash), or a simple ASCII string; all characters in the roff character map have this attribute The value of man.charmap.subset.profile is evaluated as an XPath expression at run-time to select a portion of the roff character map to use. You can tune the subset used by adding or removing parts. For example, if you need to use a wide range of mathematical operators in a document, and you want to have them converted into roff markup properly, you might add the following: @*[local-name() = 'block'] ='MathematicalOperators' That will cause a additional set of around 67 additional "math" characters to be converted into roff markup. Depending on which XSLT engine you use, either the EXSLT dyn:evaluate extension function (for xsltproc or Xalan) or saxon:evaluate extension function (for Saxon) are used to dynamically evaluate the value of man.charmap.subset.profile at run-time. If you don't use xsltproc, Saxon, Xalan -- or some other XSLT engine that supports dyn:evaluate -- you must either set the value of the man.charmap.use.subset parameter to zero and process your documents using the full character map instead, or set the value of the man.charmap.enabled parameter to zero instead (so that character-map processing is disabled completely. An alternative to using man.charmap.subset.profile is to create your own custom character map, and set the value of man.charmap.uri to the URI/filename for that. If you use a custom character map, you will probably want to include in it just the characters you want to use, and so you will most likely also want to set the value of man.charmap.use.subset to zero. You can create a custom character map by making a copy of the standard roff character map provided in the distribution, and then adding to, changing, and/or deleting from that. If you author your DocBook XML source in UTF-8 or UTF-16 encoding and aren't sure what OSes or environments your man-page output might end up being viewed on, and not sure what version of nroff/groff those environments might have, you should be careful about what Unicode symbols and special characters you use in your source and what parts you add to the value of man.charmap.subset.profile. Many of the escape codes used are specific to groff and using them may not provide the expected output on an OS or environment that uses nroff instead of groff. On the other hand, if you intend for your man-page output to be viewed only on modern systems (for example, GNU/Linux systems, FreeBSD systems, or Cygwin environments) that have a good, up-to-date groff, then you can safely include a wide range of Unicode symbols and special characters in your UTF-8 or UTF-16 encoded DocBook XML source and add any of the supported Unicode block names to the value of man.charmap.subset.profile. For other details, see the documentation for the man.charmap.use.subset parameter. Supported Unicode block names and "class" values Below is the full list of Unicode block names and "class" values supported in the standard roff stylesheet provided in the distribution, along with a description of which codepoints from the Unicode range corresponding to that block name or block/class combination are supported. C1 Controls And Latin-1 Supplement (Latin-1 Supplement) (x00a0 to x00ff) class values symbols letters Latin Extended-A (x0100 to x017f, partial) Spacing Modifier Letters (x02b0 to x02ee, partial) Greek and Coptic (x0370 to x03ff, partial) General Punctuation (x2000 to x206f, partial) class values spaces dashes quotes daggers bullets leaders primes Superscripts and Subscripts (x2070 to x209f) Currency Symbols (x20a0 to x20b1) Letterlike Symbols (x2100 to x214b) Number Forms (x2150 to x218f) Arrows (x2190 to x21ff, partial) Mathematical Operators (x2200 to x22ff, partial) Control Pictures (x2400 to x243f) Enclosed Alphanumerics (x2460 to x24ff) Geometric Shapes (x25a0 to x25f7, partial) Miscellaneous Symbols (x2600 to x26ff, partial) Dingbats (x2700 to x27be, partial) Alphabetic Presentation Forms (xfb00 to xfb04 only) man.charmap.subset.profile.english string man.charmap.subset.profile.english Profile of character map subset <xsl:param name="man.charmap.subset.profile.english"> @*[local-name() = 'block'] = 'Miscellaneous Technical' or (@*[local-name() = 'block'] = 'C1 Controls And Latin-1 Supplement (Latin-1 Supplement)' and @*[local-name() = 'class'] = 'symbols') or (@*[local-name() = 'block'] = 'General Punctuation' and (@*[local-name() = 'class'] = 'spaces' or @*[local-name() = 'class'] = 'dashes' or @*[local-name() = 'class'] = 'quotes' or @*[local-name() = 'class'] = 'bullets' ) ) or @*[local-name() = 'name'] = 'HORIZONTAL ELLIPSIS' or @*[local-name() = 'name'] = 'WORD JOINER' or @*[local-name() = 'name'] = 'SERVICE MARK' or @*[local-name() = 'name'] = 'TRADE MARK SIGN' or @*[local-name() = 'name'] = 'ZERO WIDTH NO-BREAK SPACE' </xsl:param> Description If the value of the man.charmap.use.subset parameter is non-zero, and your DocBook source is written in English (that is, if its lang or xml:lang attribute on the root element in your DocBook source or on the first refentry element in your source has the value en or if it has no lang or xml:lang attribute), then the character-map subset specified by the man.charmap.subset.profile.english parameter is used instead of the full roff character map. Otherwise, if the lang or xml:lang attribute on the root element in your DocBook source or on the first refentry element in your source has a value other than en, then the character-map subset specified by the man.charmap.subset.profile parameter is used instead of man.charmap.subset.profile.english. The difference between the two subsets is that man.charmap.subset.profile provides mappings for characters in Western European languages that are not part of the Roman (English) alphabet (ASCII character set). The value of man.charmap.subset.profile.english is a string representing an XPath expression that matches attribute names and values for output-character elements in the character map. For other details, see the documentation for the man.charmap.subset.profile.english and man.charmap.use.subset parameters. man.string.subst.map.local.pre string man.string.subst.map.local.pre Specifies “local” string substitutions <xsl:param name="man.string.subst.map.local.pre"></xsl:param> Description Use the man.string.subst.map.local.pre parameter to specify any “local” string substitutions to perform over the entire roff source for each man page before performing the string substitutions specified by the man.string.subst.map parameter. For details about the format of this parameter, see the documentation for the man.string.subst.map parameter. man.string.subst.map rtf man.string.subst.map Specifies a set of string substitutions <xsl:param name="man.string.subst.map"> <!-- * remove no-break marker at beginning of line (stylesheet artifact) --> <ss:substitution oldstring="▒▀" newstring="▒"></ss:substitution> <!-- * replace U+2580 no-break marker (stylesheet-added) w/ no-break space --> <ss:substitution oldstring="▀" newstring="\ "></ss:substitution> <!-- ==================================================================== --> <!-- * squeeze multiple newlines before a roff request --> <ss:substitution oldstring=" ." newstring=" ."></ss:substitution> <!-- * remove any .sp instances that directly precede a .PP --> <ss:substitution oldstring=".sp .PP" newstring=".PP"></ss:substitution> <!-- * remove any .sp instances that directly follow a .PP --> <ss:substitution oldstring=".sp .sp" newstring=".sp"></ss:substitution> <!-- * squeeze multiple .sp instances into a single .sp--> <ss:substitution oldstring=".PP .sp" newstring=".PP"></ss:substitution> <!-- * squeeze multiple newlines after start of no-fill (verbatim) env. --> <ss:substitution oldstring=".nf " newstring=".nf "></ss:substitution> <!-- * squeeze multiple newlines after REstoring margin --> <ss:substitution oldstring=".RE " newstring=".RE "></ss:substitution> <!-- * U+2591 is a marker we add before and after every Parameter in --> <!-- * Funcprototype output --> <ss:substitution oldstring="░" newstring=" "></ss:substitution> <!-- * U+2592 is a marker we add for the newline before output of <sbr>; --> <ss:substitution oldstring="▒" newstring=" "></ss:substitution> <!-- * --> <!-- * Now deal with some other characters that are added by the --> <!-- * stylesheets during processing. --> <!-- * --> <!-- * bullet --> <ss:substitution oldstring="•" newstring="\(bu"></ss:substitution> <!-- * left double quote --> <ss:substitution oldstring="“" newstring="\(lq"></ss:substitution> <!-- * right double quote --> <ss:substitution oldstring="”" newstring="\(rq"></ss:substitution> <!-- * left single quote --> <ss:substitution oldstring="‘" newstring="\(oq"></ss:substitution> <!-- * right single quote --> <ss:substitution oldstring="’" newstring="\(cq"></ss:substitution> <!-- * copyright sign --> <ss:substitution oldstring="©" newstring="\(co"></ss:substitution> <!-- * registered sign --> <ss:substitution oldstring="®" newstring="\(rg"></ss:substitution> <!-- * ...servicemark... --> <!-- * There is no groff equivalent for it. --> <ss:substitution oldstring="℠" newstring="(SM)"></ss:substitution> <!-- * ...trademark... --> <!-- * We don't do "\(tm" because for console output, --> <!-- * groff just renders that as "tm"; that is: --> <!-- * --> <!-- * Product&#x2122; -> Producttm --> <!-- * --> <!-- * So we just make it to "(TM)" instead; thus: --> <!-- * --> <!-- * Product&#x2122; -> Product(TM) --> <ss:substitution oldstring="™" newstring="(TM)"></ss:substitution> </xsl:param> Description The man.string.subst.map parameter contains a map that specifies a set of string substitutions to perform over the entire roff source for each man page, either just before generating final man-page output (that is, before writing man-page files to disk) or, if the value of the man.charmap.enabled parameter is non-zero, before applying the roff character map. You can use man.string.subst.map as a “lightweight” character map to perform “essential” substitutions -- that is, substitutions that are always performed, even if the value of the man.charmap.enabled parameter is zero. For example, you can use it to replace quotation marks or other special characters that are generated by the DocBook XSL stylesheets for a particular locale setting (as opposed to those characters that are actually in source XML documents), or to replace any special characters that may be automatically generated by a particular customization of the DocBook XSL stylesheets. Do you not change value of the man.string.subst.map parameter unless you are sure what you are doing. First consider adding your string-substitution mappings to either or both of the following parameters: man.string.subst.map.local.pre applied before man.string.subst.map man.string.subst.map.local.post applied after man.string.subst.map By default, both of those parameters contain no string substitutions. They are intended as a means for you to specify your own local string-substitution mappings. If you remove any of default mappings from the value of the man.string.subst.map parameter, you are likely to end up with broken output. And be very careful about adding anything to it; it’s used for doing string substitution over the entire roff source of each man page – it causes target strings to be replaced in roff requests and escapes, not just in the visible contents of the page. Contents of the substitution map The string-substitution map contains one or more ss:substitution elements, each of which has two attributes: oldstring string to replace newstring string with which to replace oldstring It may also include XML comments (that is, delimited with "<!--" and "-->"). man.string.subst.map.local.post string man.string.subst.map.local.post Specifies “local” string substitutions <xsl:param name="man.string.subst.map.local.post"></xsl:param> Description Use the man.string.subst.map.local.post parameter to specify any “local” string substitutions to perform over the entire roff source for each man page after performing the string substitutions specified by the man.string.subst.map parameter. For details about the format of this parameter, see the documentation for the man.string.subst.map parameter. Refentry metadata gathering refentry.meta.get.quietly boolean refentry.meta.get.quietly Suppress notes and warnings when gathering refentry metadata? <xsl:param name="refentry.meta.get.quietly" select="0"></xsl:param> Description If zero (the default), notes and warnings about “missing” markup are generated during gathering of refentry metadata. If non-zero, the metadata is gathered “quietly” -- that is, the notes and warnings are suppressed. If you are processing a large amount of refentry content, you may be able to speed up processing significantly by setting a non-zero value for refentry.meta.get.quietly. refentry.date.profile string refentry.date.profile Specifies profile for refentry "date" data <xsl:param name="refentry.date.profile"> (($info[//date])[last()]/date)[1]| (($info[//pubdate])[last()]/pubdate)[1] </xsl:param> Description The value of refentry.date.profile is a string representing an XPath expression. It is evaluated at run-time and used only if refentry.date.profile.enabled is non-zero. Otherwise, the refentry metadata-gathering logic "hard coded" into the stylesheets is used. The man(7) man page describes this content as "the date of the last revision". In man pages, it is the content that is usually displayed in the center footer. refentry.date.profile.enabled boolean refentry.date.profile.enabled Enable refentry "date" profiling? <xsl:param name="refentry.date.profile.enabled">0</xsl:param> Description If the value of refentry.date.profile.enabled is non-zero, then during refentry metadata gathering, the info profile specified by the customizable refentry.date.profile parameter is used. If instead the value of refentry.date.profile.enabled is zero (the default), then "hard coded" logic within the DocBook XSL stylesheets is used for gathering refentry "date" data. If you find that the default refentry metadata-gathering behavior is causing incorrect "date" data to show up in your output, then consider setting a non-zero value for refentry.date.profile.enabled and adjusting the value of refentry.date.profile to cause correct data to be gathered. Note that the terms "source" and "date" have special meanings in this context. For details, see the documentation for the refentry.date.profile parameter. refentry.manual.profile string refentry.manual.profile Specifies profile for refentry "manual" data <xsl:param name="refentry.manual.profile"> (($info[//title])[last()]/title)[1]| ../title/node() </xsl:param> Description The value of refentry.manual.profile is a string representing an XPath expression. It is evaluated at run-time and used only if refentry.manual.profile.enabled is non-zero. Otherwise, the refentry metadata-gathering logic "hard coded" into the stylesheets is used. In man pages, this content is usually displayed in the middle of the header of the page. The man(7) man page describes this as "the title of the manual (e.g., Linux Programmer's Manual)". Here are some examples from existing man pages: dpkg utilities (dpkg-name) User Contributed Perl Documentation (GET) GNU Development Tools (ld) Emperor Norton Utilities (ddate) Debian GNU/Linux manual (faked) GIMP Manual Pages (gimp) KDOC Documentation System (qt2kdoc) refentry.manual.profile.enabled boolean refentry.manual.profile.enabled Enable refentry "manual" profiling? <xsl:param name="refentry.manual.profile.enabled">0</xsl:param> Description If the value of refentry.manual.profile.enabled is non-zero, then during refentry metadata gathering, the info profile specified by the customizable refentry.manual.profile parameter is used. If instead the value of refentry.manual.profile.enabled is zero (the default), then "hard coded" logic within the DocBook XSL stylesheets is used for gathering refentry "manual" data. If you find that the default refentry metadata-gathering behavior is causing incorrect "manual" data to show up in your output, then consider setting a non-zero value for refentry.manual.profile.enabled and adjusting the value of refentry.manual.profile to cause correct data to be gathered. Note that the term "manual" has a special meanings in this context. For details, see the documentation for the refentry.manual.profile parameter. refentry.source.name.suppress boolean refentry.source.name.suppress Suppress "name" part of refentry "source" contents? <xsl:param name="refentry.source.name.suppress">0</xsl:param> Description If the value of refentry.source.name.suppress is non-zero, then during refentry metadata gathering, no "source name" data is added to the refentry "source" contents. Instead (unless refentry.version.suppress is also non-zero), only "version" data is added to the "source" contents. If you find that the refentry metadata gathering mechanism is causing unwanted "source name" data to show up in your output -- for example, in the footer (or possibly header) of a man page -- then you might consider setting a non-zero value for refentry.source.name.suppress. Note that the terms "source", "source name", and "version" have special meanings in this context. For details, see the documentation for the refentry.source.name.profile parameter. refentry.source.name.profile string refentry.source.name.profile Specifies profile for refentry "source name" data <xsl:param name="refentry.source.name.profile"> (($info[//productname])[last()]/productname)[1]| (($info[//corpname])[last()]/corpname)[1]| (($info[//corpcredit])[last()]/corpcredit)[1]| (($info[//corpauthor])[last()]/corpauthor)[1]| (($info[//orgname])[last()]/orgname)[1]| (($info[//publishername])[last()]/publishername)[1] </xsl:param> Description The value of refentry.source.name.profile is a string representing an XPath expression. It is evaluated at run-time and used only if refentry.source.name.profile.enabled is non-zero. Otherwise, the refentry metadata-gathering logic "hard coded" into the stylesheets is used. A "source name" is one part of a (potentially) two-part Name Version "source" field. In man pages, it is usually displayed in the left footer of the page. It typically indicates the software system or product that the item documented in the man page belongs to. The man(7) man page describes it as "the source of the command", and provides the following examples: For binaries, use something like: GNU, NET-2, SLS Distribution, MCC Distribution. For system calls, use the version of the kernel that you are currently looking at: Linux 0.99.11. For library calls, use the source of the function: GNU, BSD 4.3, Linux DLL 4.4.1. In practice, there are many pages that simply have a Version number in the "source" field. So, it looks like what we have is a two-part field, Name Version, where: Name product name (e.g., BSD) or org. name (e.g., GNU) Version version number Each part is optional. If the Name is a product name, then the Version is probably the version of the product. Or there may be no Name, in which case, if there is a Version, it is probably the version of the item itself, not the product it is part of. Or, if the Name is an organization name, then there probably will be no Version. refentry.source.name.profile.enabled boolean refentry.source.name.profile.enabled Enable refentry "source name" profiling? <xsl:param name="refentry.source.name.profile.enabled">0</xsl:param> Description If the value of refentry.source.name.profile.enabled is non-zero, then during refentry metadata gathering, the info profile specified by the customizable refentry.source.name.profile parameter is used. If instead the value of refentry.source.name.profile.enabled is zero (the default), then "hard coded" logic within the DocBook XSL stylesheets is used for gathering refentry "source name" data. If you find that the default refentry metadata-gathering behavior is causing incorrect "source name" data to show up in your output, then consider setting a non-zero value for refentry.source.name.profile.enabled and adjusting the value of refentry.source.name.profile to cause correct data to be gathered. Note that the terms "source" and "source name" have special meanings in this context. For details, see the documentation for the refentry.source.name.profile parameter. refentry.version.suppress boolean refentry.version.suppress Suppress "version" part of refentry "source" contents? <xsl:param name="refentry.version.suppress">0</xsl:param> Description If the value of refentry.version.suppress is non-zero, then during refentry metadata gathering, no "version" data is added to the refentry "source" contents. Instead (unless refentry.source.name.suppress is also non-zero), only "source name" data is added to the "source" contents. If you find that the refentry metadata gathering mechanism is causing unwanted "version" data to show up in your output -- for example, in the footer (or possibly header) of a man page -- then you might consider setting a non-zero value for refentry.version.suppress. Note that the terms "source", "source name", and "version" have special meanings in this context. For details, see the documentation for the refentry.source.name.profile parameter. refentry.version.profile string refentry.version.profile Specifies profile for refentry "version" data <xsl:param name="refentry.version.profile"> (($info[//productnumber])[last()]/productnumber)[1]| (($info[//edition])[last()]/edition)[1]| (($info[//releaseinfo])[last()]/releaseinfo)[1] </xsl:param> Description The value of refentry.version.profile is a string representing an XPath expression. It is evaluated at run-time and used only if refentry.version.profile.enabled is non-zero. Otherwise, the refentry metadata-gathering logic "hard coded" into the stylesheets is used. A "source.name" is one part of a (potentially) two-part Name Version "source" field. For more details, see the documentation for the refentry.source.name.profile parameter. refentry.version.profile.enabled boolean refentry.version.profile.enabled Enable refentry "version" profiling? <xsl:param name="refentry.version.profile.enabled">0</xsl:param> Description If the value of refentry.version.profile.enabled is non-zero, then during refentry metadata gathering, the info profile specified by the customizable refentry.version.profile parameter is used. If instead the value of refentry.version.profile.enabled is zero (the default), then "hard coded" logic within the DocBook XSL stylesheets is used for gathering refentry "version" data. If you find that the default refentry metadata-gathering behavior is causing incorrect "version" data to show up in your output, then consider setting a non-zero value for refentry.version.profile.enabled and adjusting the value of refentry.version.profile to cause correct data to be gathered. Note that the terms "source" and "version" have special meanings in this context. For details, see the documentation for the refentry.version.profile parameter. refentry.manual.fallback.profile string refentry.manual.fallback.profile Specifies profile of "fallback" for refentry "manual" data <xsl:param name="refentry.manual.fallback.profile"> refmeta/refmiscinfo[not(@class = 'date')][1]/node()</xsl:param> Description The value of refentry.manual.fallback.profile is a string representing an XPath expression. It is evaluated at run-time and used only if no "manual" data can be found by other means (that is, either using the refentry metadata-gathering logic "hard coded" in the stylesheets, or the value of refentry.manual.profile, if it is enabled). Depending on which XSLT engine you run, either the EXSLT dyn:evaluate extension function (for xsltproc or Xalan) or saxon:evaluate extension function (for Saxon) are used to dynamically evaluate the value of refentry.manual.fallback.profile at run-time. If you don't use xsltproc, Saxon, Xalan -- or some other XSLT engine that supports dyn:evaluate -- you must manually disable fallback processing by setting an empty value for the refentry.manual.fallback.profile parameter. refentry.source.fallback.profile string refentry.source.fallback.profile Specifies profile of "fallback" for refentry "source" data <xsl:param name="refentry.source.fallback.profile"> refmeta/refmiscinfo[not(@class = 'date')][1]/node()</xsl:param> Description The value of refentry.source.fallback.profile is a string representing an XPath expression. It is evaluated at run-time and used only if no "source" data can be found by other means (that is, either using the refentry metadata-gathering logic "hard coded" in the stylesheets, or the value of the refentry.source.name.profile and refentry.version.profile parameters, if those are enabled). Depending on which XSLT engine you run, either the EXSLT dyn:evaluate extension function (for xsltproc or Xalan) or saxon:evaluate extension function (for Saxon) are used to dynamically evaluate the value of refentry.source.fallback.profile at run-time. If you don't use xsltproc, Saxon, Xalan -- or some other XSLT engine that supports dyn:evaluate -- you must manually disable fallback processing by setting an empty value for the refentry.source.fallback.profile parameter. Page header/footer man.th.extra1.suppress boolean man.th.extra1.suppress Suppress extra1 part of header/footer? <xsl:param name="man.th.extra1.suppress">0</xsl:param> Description If the value of man.th.extra1.suppress is non-zero, then the extra1 part of the .TH title line header/footer is suppressed. The content of the extra1 field is almost always displayed in the center footer of the page and is, universally, a date. man.th.extra2.suppress boolean man.th.extra2.suppress Suppress extra2 part of header/footer? <xsl:param name="man.th.extra2.suppress">0</xsl:param> Description If the value of man.th.extra2.suppress is non-zero, then the extra2 part of the .TH title line header/footer is suppressed. The content of the extra2 field is usually displayed in the left footer of the page and is typically "source" data, often in the form Name Version; for example, "GTK+ 1.2" (from the gtk-options(7) man page). You can use the refentry.source.name.suppress and refentry.version.suppress parameters to independently suppress the Name and Version parts of the extra2 field. man.th.extra3.suppress boolean man.th.extra3.suppress Suppress extra3 part of header/footer? <xsl:param name="man.th.extra3.suppress">0</xsl:param> Description If the value of man.th.extra3.suppress is non-zero, then the extra3 part of the .TH title line header/footer is suppressed. The content of the extra3 field is usually displayed in the middle header of the page and is typically a "manual name"; for example, "GTK+ User's Manual" (from the gtk-options(7) man page). man.th.title.max.length integer man.th.title.max.length Maximum length of title in header/footer <xsl:param name="man.th.title.max.length">20</xsl:param> Description Specifies the maximum permitted length of the title part of the man-page .TH title line header/footer. If the title exceeds the maxiumum specified, it is truncated down to the maximum permitted length. Details Every man page generated using the DocBook stylesheets has a title line, specified using the TH roff macro. Within that title line, there is always, at a minimum, a title, followed by a section value (representing a man "section" -- usually just a number). The title and section are displayed, together, in the visible header of each page. Where in the header they are displayed depends on OS the man page is viewed on, and on what version of nroff/groff/man is used for viewing the page. But, at a minimum and across all systems, the title and section are displayed on the right-hand column of the header. On many systems -- those with a modern groff, including Linux systems -- they are displayed twice: both in the left and right columns of the header. So if the length of the title exceeds a certain percentage of the column width in which the page is viewed, the left and right titles can end up overlapping, making them unreadable, or breaking to another line, which doesn't look particularly good. So the stylesheets provide the man.th.title.max.length parameter as a means for truncating titles that exceed the maximum length that can be viewing properly in a page header. The default value is reasonable but somewhat arbitrary. If you have pages with long titles, you may want to experiment with changing the value in order to achieve the correct aesthetic results. man.th.extra2.max.length integer man.th.extra2.max.length Maximum length of extra2 in header/footer <xsl:param name="man.th.extra2.max.length">30</xsl:param> Description Specifies the maximum permitted length of the extra2 part of the man-page part of the .TH title line header/footer. If the extra2 content exceeds the maxiumum specified, it is truncated down to the maximum permitted length. The content of the extra2 field is usually displayed in the left footer of the page and is typically "source" data indicating the software system or product that the item documented in the man page belongs to, often in the form Name Version; for example, "GTK+ 1.2" (from the gtk-options(7) man page). The default value for this parameter is reasonable but somewhat arbitrary. If you are processing pages with long "source" information, you may want to experiment with changing the value in order to achieve the correct aesthetic results. man.th.extra3.max.length integer man.th.extra3.max.length Maximum length of extra3 in header/footer <xsl:param name="man.th.extra3.max.length">30</xsl:param> Description Specifies the maximum permitted length of the extra3 part of the man-page .TH title line header/footer. If the extra3 content exceeds the maxiumum specified, it is truncated down to the maximum permitted length. The content of the extra3 field is usually displayed in the middle header of the page and is typically a "manual name"; for example, "GTK+ User's Manual" (from the gtk-options(7) man page). The default value for this parameter is reasonable but somewhat arbitrary. If you are processing pages with long "manual names" -- or especially if you are processing pages that have both long "title" parts (command/function, etc. names) and long manual names -- you may want to experiment with changing the value in order to achieve the correct aesthetic results. Output man.output.manifest.enabled boolean man.output.manifest.enabled Generate a manifest file? <xsl:param name="man.output.manifest.enabled" select="0"></xsl:param> Description If non-zero, a list of filenames for man pages generated by the stylesheet transformation is written to the file named by the man.output.manifest.filename parameter. man.output.manifest.filename string man.output.manifest.filename Name of manifest file <xsl:param name="man.output.manifest.filename">MAN.MANIFEST</xsl:param> Description The man.output.manifest.filename parameter specifies the name of the file to which the manpages manifest file is written (if the value of the man.output.manifest.enabled parameter is non-zero). man.output.in.separate.dir boolean man.output.in.separate.dir Output man-page files in separate output directory? <xsl:param name="man.output.in.separate.dir" select="0"></xsl:param> Description If the value of man.output.in.separate.dir parameter is non-zero, man-page files are output in a separate directory, specified by the man.output.base.dir parameter; otherwise, if the value of man.output.in.separate.dir is zero, man-page files are not output in a separate directory. man.output.lang.in.name.enabled boolean man.output.lang.in.name.enabled Include $LANG value in man-page filename/pathname? <xsl:param name="man.output.lang.in.name.enabled" select="0"></xsl:param> Description The man.output.lang.in.name.enabled parameter specifies whether a $lang value is included in man-page filenames and pathnames. If the value of man.output.lang.in.name.enabled is non-zero, man-page files are output with the $lang value included in their filenames or pathnames as follows; if man.output.subdirs.enabled is non-zero, each file is output to, e.g., a man/$lang/man8/foo.8 pathname if man.output.subdirs.enabled is zero, each file is output with a foo.$lang.8 filename man.output.base.dir uri man.output.base.dir Specifies separate output directory <xsl:param name="man.output.base.dir">man/</xsl:param> Description The man.output.base.dir parameter specifies the base directory into which man-page files are output. The man.output.subdirs.enabled parameter controls whether the files are output in subdirectories within the base directory. The values of the man.output.base.dir and man.output.subdirs.enabled parameters are used only if the value of man.output.in.separate.dir parameter is non-zero. If the value of the man.output.in.separate.dir is zero, man-page files are not output in a separate directory. man.output.subdirs.enabled boolean man.output.subdirs.enabled Output man-page files in subdirectories within base output directory? <xsl:param name="man.output.subdirs.enabled" select="1"></xsl:param> Description The man.output.subdirs.enabled parameter controls whether man-pages files are output in subdirectories within the base directory specified by the directory specified by the man.output.base.dir parameter. The values of the man.output.base.dir and man.output.subdirs.enabled parameters are used only if the value of man.output.in.separate.dir parameter is non-zero. If the value of the man.output.in.separate.dir is zero, man-page files are not output in a separate directory. man.output.quietly boolean man.output.quietly Suppress filename messages emitted when generating output? <xsl:param name="man.output.quietly" select="0"></xsl:param> Description If zero (the default), for each man-page file created, a message with the name of the file is emitted. If non-zero, the files are output "quietly" -- that is, the filename messages are suppressed. If you are processing a large amount of refentry content, you may be able to speed up processing significantly by setting a non-zero value for man.output.quietly. man.output.encoding string man.output.encoding Encoding used for man-page output <xsl:param name="man.output.encoding">UTF-8</xsl:param> Description This parameter specifies the encoding to use for files generated by the manpages stylesheet. Not all processors support specification of this parameter. If the value of the man.charmap.enabled parameter is non-zero (the default), keeping the man.output.encoding parameter at its default value (UTF-8) or setting it to UTF-16 does not cause your man pages to be output in raw UTF-8 or UTF-16 -- because any Unicode characters for which matches are found in the enabled character map will be replaced with roff escape sequences before the final man-page files are generated. So if you want to generate "real" UTF-8 man pages, without any character substitution being performed on your content, you need to set man.charmap.enabled to zero (which will completely disable character-map processing). You may also need to set man.charmap.enabled to zero if you want to output man pages in an encoding other than UTF-8 or UTF-16. Character-map processing is based on Unicode character values and may not work with other output encodings. man.output.better.ps.enabled boolean man.output.better.ps.enabled Enable enhanced print/PostScript output? <xsl:param name="man.output.better.ps.enabled">0</xsl:param> Description If the value of the man.output.better.ps.enabled parameter is non-zero, certain markup is embedded in each generated man page such that PostScript output from the man -Tps command for that page will include a number of enhancements designed to improve the quality of that output. If man.output.better.ps.enabled is zero (the default), no such markup is embedded in generated man pages, and no enhancements are included in the PostScript output generated from those man pages by the man -Tps command. The enhancements provided by this parameter rely on features that are specific to groff (GNU troff) and that are not part of “classic” AT&T troff or any of its derivatives. Therefore, any man pages you generate with this parameter enabled will be readable only on systems on which the groff (GNU troff) program is installed, such as GNU/Linux systems. The pages will not not be readable on systems on with the classic troff (AT&T troff) command is installed. The value of this parameter only affects PostScript output generated from the man command. It has no effect on output generated using the FO backend. You can generate PostScript output for any man page by running the following command: man FOO -Tps > FOO.ps You can then generate PDF output by running the following command: ps2pdf FOO.ps Other man.table.footnotes.divider string man.table.footnotes.divider Specifies divider string that appears before table footnotes <xsl:param name="man.table.footnotes.divider">----</xsl:param> Description In each table that contains footenotes, the string specified by the man.table.footnotes.divider parameter is output before the list of footnotes for the table. man.subheading.divider.enabled boolean man.subheading.divider.enabled Add divider comment to roff source before/after subheadings? <xsl:param name="man.subheading.divider.enabled">0</xsl:param> Description If the value of the man.subheading.divider.enabled parameter is non-zero, the contents of the man.subheading.divider parameter are used to add a "divider" before and after subheadings in the roff output. The divider is not visisble in the rendered man page; it is added as a comment, in the source, simply for the purpose of increasing reability of the source. If man.subheading.divider.enabled is zero (the default), the subheading divider is suppressed. man.subheading.divider string man.subheading.divider Specifies string to use as divider comment before/after subheadings <xsl:param name="man.subheading.divider">========================================================================</xsl:param> Description If the value of the man.subheading.divider.enabled parameter is non-zero, the contents of the man.subheading.divider parameter are used to add a "divider" before and after subheadings in the roff output. The divider is not visisble in the rendered man page; it is added as a comment, in the source, simply for the purpose of increasing reability of the source. If man.subheading.divider.enabled is zero (the default), the subheading divider is suppressed. The Stylesheet The param.xsl stylesheet is just a wrapper around all of these parameters. <xsl:stylesheet exclude-result-prefixes="src" version="1.0"> <!-- This file is generated from param.xweb --> <!-- ******************************************************************** $Id: param.xweb 8235 2009-02-09 16:22:14Z xmldoc $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://docbook.sf.net/release/xsl/current/ for copyright and other information. ******************************************************************** --> <src:fragref linkend="man.authors.section.enabled.frag"></src:fragref> <src:fragref linkend="man.break.after.slash.frag"></src:fragref> <src:fragref linkend="man.base.url.for.relative.links.frag"></src:fragref> <src:fragref linkend="man.charmap.enabled.frag"></src:fragref> <src:fragref linkend="man.charmap.subset.profile.frag"></src:fragref> <src:fragref linkend="man.charmap.subset.profile.english.frag"></src:fragref> <src:fragref linkend="man.charmap.uri.frag"></src:fragref> <src:fragref linkend="man.charmap.use.subset.frag"></src:fragref> <src:fragref linkend="man.copyright.section.enabled.frag"></src:fragref> <src:fragref linkend="man.endnotes.are.numbered.frag"></src:fragref> <src:fragref linkend="man.endnotes.list.enabled.frag"></src:fragref> <src:fragref linkend="man.endnotes.list.heading.frag"></src:fragref> <src:fragref linkend="man.font.funcprototype.frag"></src:fragref> <src:fragref linkend="man.font.funcsynopsisinfo.frag"></src:fragref> <src:fragref linkend="man.font.links.frag"></src:fragref> <src:fragref linkend="man.font.table.headings.frag"></src:fragref> <src:fragref linkend="man.font.table.title.frag"></src:fragref> <src:fragref linkend="man.funcsynopsis.style.frag"></src:fragref> <src:fragref linkend="man.hyphenate.computer.inlines.frag"></src:fragref> <src:fragref linkend="man.hyphenate.filenames.frag"></src:fragref> <src:fragref linkend="man.hyphenate.frag"></src:fragref> <src:fragref linkend="man.hyphenate.urls.frag"></src:fragref> <src:fragref linkend="man.indent.blurbs.frag"></src:fragref> <src:fragref linkend="man.indent.lists.frag"></src:fragref> <src:fragref linkend="man.indent.refsect.frag"></src:fragref> <src:fragref linkend="man.indent.verbatims.frag"></src:fragref> <src:fragref linkend="man.indent.width.frag"></src:fragref> <src:fragref linkend="man.justify.frag"></src:fragref> <src:fragref linkend="man.output.base.dir.frag"></src:fragref> <src:fragref linkend="man.output.encoding.frag"></src:fragref> <src:fragref linkend="man.output.in.separate.dir.frag"></src:fragref> <src:fragref linkend="man.output.lang.in.name.enabled.frag"></src:fragref> <src:fragref linkend="man.output.manifest.enabled.frag"></src:fragref> <src:fragref linkend="man.output.manifest.filename.frag"></src:fragref> <src:fragref linkend="man.output.better.ps.enabled.frag"></src:fragref> <src:fragref linkend="man.output.quietly.frag"></src:fragref> <src:fragref linkend="man.output.subdirs.enabled.frag"></src:fragref> <src:fragref linkend="man.segtitle.suppress.frag"></src:fragref> <src:fragref linkend="man.string.subst.map.frag"></src:fragref> <src:fragref linkend="man.string.subst.map.local.post.frag"></src:fragref> <src:fragref linkend="man.string.subst.map.local.pre.frag"></src:fragref> <src:fragref linkend="man.subheading.divider.enabled.frag"></src:fragref> <src:fragref linkend="man.subheading.divider.frag"></src:fragref> <src:fragref linkend="man.table.footnotes.divider.frag"></src:fragref> <src:fragref linkend="man.th.extra1.suppress.frag"></src:fragref> <src:fragref linkend="man.th.extra2.max.length.frag"></src:fragref> <src:fragref linkend="man.th.extra2.suppress.frag"></src:fragref> <src:fragref linkend="man.th.extra3.max.length.frag"></src:fragref> <src:fragref linkend="man.th.extra3.suppress.frag"></src:fragref> <src:fragref linkend="man.th.title.max.length.frag"></src:fragref> <src:fragref linkend="refentry.date.profile.enabled.frag"></src:fragref> <src:fragref linkend="refentry.date.profile.frag"></src:fragref> <src:fragref linkend="refentry.manual.fallback.profile.frag"></src:fragref> <src:fragref linkend="refentry.manual.profile.enabled.frag"></src:fragref> <src:fragref linkend="refentry.manual.profile.frag"></src:fragref> <src:fragref linkend="refentry.meta.get.quietly.frag"></src:fragref> <src:fragref linkend="refentry.source.fallback.profile.frag"></src:fragref> <src:fragref linkend="refentry.source.name.profile.enabled.frag"></src:fragref> <src:fragref linkend="refentry.source.name.profile.frag"></src:fragref> <src:fragref linkend="refentry.source.name.suppress.frag"></src:fragref> <src:fragref linkend="refentry.version.profile.enabled.frag"></src:fragref> <src:fragref linkend="refentry.version.profile.frag"></src:fragref> <src:fragref linkend="refentry.version.suppress.frag"></src:fragref> </xsl:stylesheet>
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/lists.xsl0000664000175000017500000005507313160023042027540 0ustar bdbaddogbdbaddog \n(zqu .sp .PP .PP .br .RS .RE .sp .sp .RS \h'- 0 \n(INu ' \h'+ 0 \n(INu-1 '\c .sp -1 .IP \(bu 2.3 .RE .sp .RS \h'- 0 \n(INu+3n ' \h'+ 0 1n '\c .sp -1 .IP " " 4.2 .RE .PP .sp .PP .sp , .RS .RE .PP .\" line length increase to cope w/ tbl weirdness .ll +(\n(LLu * 62u / 100u) .TS l . .TE .\" line length decrease back to previous value .ll -(\n(LLu * 62u / 100u) .sp T{ T} .TS tab(:); r lw(\n(.lu*75u/100u). .TE \h'-2n': T{ T} 1 ??? \ ??? \fB( )\fR \fB .\fR scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/ChangeLog.200209170000664000175000017500000001532213160023042030320 0ustar bdbaddogbdbaddogNote: This changelog is a record of descriptions of all changes made to the DocBook XSL manpages stylesheets during the time when they were maintained in their original home in the [cvs]/docbook/contrib/xsl/db2man area of the DocBook Project source-code repository at Sourceforge; that is, from October 2001 (when they were contributed to the project by Martijn van Beers) until September 2002 (when they were moved to the [cvs]/docbook/xsl/manpages area and became a standard part of all subsequent DocBook XSL Stylesheets releases). 2002-09-17 Norman Walsh * README, db2man.xsl, lists.xsl, sect23.xsl, synop.xsl, xref.xsl: Moved to docbook/xsl/manpages * db2man.xsl, synop.xsl: Patch from Joe Orton 2002-06-16 * db2man.xsl: commit patch sent by Joe Orton: This patch adds support for using the productname, date and title out of a if one is present, rather than having to add each of these individually for every refentry. * db2man.xsl: Tim Waugh sent: This patch normalizes space in each refname before displaying it in the name section. 2002-05-21 * xref.xsl: from Joe Orton: this patch allows cross-referencing to a specific refname. I need this since I'm documenting several different (but related) functions per refentry, and want to cross-reference them individually, rather than just by the title used for the refentry as a whole. 2002-05-17 * lists.xsl: apply glosslist support patch from twaugh 2002-05-15 * db2man.xsl: slightly sanitize the filenames we generate. again from twaugh * db2man.xsl: Apply twaugh's fix for making the entity transform stuff work 2002-05-14 * db2man.xsl: generalize the tip template for all admonitions (caution,important,note,tip,warning) * db2man.xsl: Apply Joe Orton's patch, modified to be indented. Also show "Tip" in the title. so if foo, you get Tip: foo * synop.xsl: rewrote funcprototype. It used to convert all its children to a single string and the split it up again through recursion. Now has a nice foreach loop for the paramdefs, which seems much cleaner than throwing everything in a big string before processing it. 2002-05-10 * db2man.xsl: add support for simpara * db2man.xsl, lists.xsl: fix refsect2 titles * synop.xsl: also from twaugh: I found some input that goes wrong with the synop.xsl we have in CVS: -o FILE --output=FILE It gets rendered as (with *bold* and _italic_): [*-o FILE* | *--output=FILE*] The desired markup should look like: The following macro does the trick: [\fB-o \fIFILE\fR\fR | \fB--output=\fIFILE\fR\fR] The trouble is that the named template 'bold' uses value-of, and so strips of its significance. Another thing I found is that the arg/replaceable template is superfluous altogether: db2man.xsl has a 'replaceable' template which does the same thing. Here is a patch to make those two modifications. NOTE TO SELF: must try to fix bold template so we can use it everywhere 2002-05-09 * db2man.xsl: oops, removed too much * db2man.xsl: remove stuff that's apparently left-over from sect23.xsl * db2man.xsl, lists.xsl, synop.xsl: batch of patches from twaugh: * This patch (based on one from Jirka Kosek) adds support for block-level elements inside s---s for example, or lists. * This patch replaces entities (like '舒') with sensible characters or groups of characters. * This patch adds support for sbr. * This patch normalizes spaces in varlistentry terms. * This patch normalizes spaces in terminal varlistentry terms. * This patch allows variable lists to be nested (once). * This patch prevents variable list item paragraphs from merging into one another. * This patch improves the rendering of itemized lists, and adds support for ordered lists and procedures. * This patch makes some small adjustments to group/arg: don't put extra spaces in where they aren't needed, and normalize the space of $arg. * This patch makes adjustments to cmdsynopsis elements. In particular, they can now be wrapped if no is provided. * This patch adds funcsynopsis//* support. Again, wrapping is done automatically. * synop.xsl: make synopsises work for --arg=foo s too * synop.xsl: remove unneccesary adding of whitespace for arg/replaceable 2002-05-01 * db2man.xsl: This patch adds support for multiple refnames. (another twaugh patch) * db2man.xsl: modified ulink patch from twaugh. Be nice to content-less ulinks. But we don't accomodate silly people who don't understand ulink and put the url as the content too. * db2man.xsl, synop.xsl: db2man.xsl: * temporarily add some params that chunker.xsl needs * fix bold/italic templates * update calls to bold/italic templates for new syntax synop.xsl: * add support for synopfragment * update calls to bold/italic templates for new syntax 2002-04-30 * db2man.xsl: Add twaug's patch for xref support * db2man.xsl: This patch adds support for: - Multiple authors. - A (single) man page editor. (another patch from twaugh) * db2man.xsl: more twaugh patches: - Use refentrytitle, not refname[1], for title. - Upper-case it. - Use date, productname, and title. - Pick up author from main document if not contained in refentry. - Use refname[1] for man page filename, not refentrytitle. * db2man.xsl: add varname support * db2man.xsl: This patch makes userinput (an inline element) have inline formatting. * db2man.xsl: This patch adds support for the top-level document being something other than an article. It also emits a helpful warning if no refentry elements are found. * db2man.xsl: next twaugh patch: Instead of writing to stdout, create a file for each refentry. Plus, for bonus points, a file for each additional refname within that entry (pointing to the main page). * db2man.xsl: Add named templates for bold-ifying and italicizing stuff. Inspired by yet another twaugh patch * db2man.xsl, lists.xsl, sect23.xsl: consistently use instead of a newline * db2man.xsl, synop.xsl: * add support for informalexample, screen, errorcode, constant, type, quote, programlisting and citerefentry * use the 'bold' and 'italic' named templates * xref.xsl: New file. 2001-12-01 Norman Walsh * README, db2man.xsl, lists.xsl, sect23.xsl, synop.xsl: New file. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/other.xsl0000664000175000017500000010600513160023042027513 0ustar bdbaddogbdbaddog \ \e . \&. - \- ' \*(Aq   \ \& .\" Title: .\" Author: .\" Generator: DocBook v <http://docbook.sf.net/> .\" Date: .\" Manual: .\" Source: .\" Language: .\" .TH " " " " " " " " " " .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" store initial "default indentation value" .nr zq \n(IN .\" adjust default indentation .nr IN .\" adjust indentation of SS headings .nr SN \n(IN .\" enable line breaks after slashes .cflags 4 / Note: Note: (soelim stub) Note: (manifest file) .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * (re)Define some macros .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" toupper - uppercase a string (locale-aware) .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de toupper .tr \\$* .tr .. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" SH-xref - format a cross-reference to an SH section .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de SH-xref .ie n \{\ .\} .toupper \\$* .el \{\ \\$* .\} .. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" SH - level-one heading that works better for non-TTY output .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de1 SH .\" put an extra blank line of space above the head in non-TTY output t .sp 1 .sp \\n[PD]u .nr an-level 1 .set-an-margin .nr an-prevailing-indent \\n[IN] .fi .in \\n[an-margin]u .ti 0 .HTML-TAG ".NH \\n[an-level]" .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 \." make the size of the head bigger .ps +3 .ft B .ne (2v + 1u) .ie n \{\ .\" if n (TTY output), use uppercase .toupper \\$* .\} .el \{\ .nr an-break-flag 0 .\" if not n (not TTY), use normal case (not uppercase) \\$1 .in \\n[an-margin]u .ti 0 .\" if not n (not TTY), put a border/line under subheading .sp -.6 \l'\n(.lu' .\} .. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" SS - level-two heading that works better for non-TTY output .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de1 SS .sp \\n[PD]u .nr an-level 1 .set-an-margin .nr an-prevailing-indent \\n[IN] .fi .in \\n[IN]u .ti \\n[SN]u .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .ps \\n[PS-SS]u \." make the size of the head bigger .ps +2 .ft B .ne (2v + 1u) .if \\n[.$] \&\\$* .. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" BB/EB - put background/screen (filled box) around block of text .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de BB .if t \{\ .sp -.5 .br .in +2n .ll -2n .gcolor red .di BX .\} .. .de EB .if t \{\ .if "\\$2"adjust-for-leading-newline" \{\ .sp -1 .\} .br .di .in .ll .gcolor .nr BW \\n(.lu-\\n(.i .nr BH \\n(dn+.5v .ne \\n(BHu+.5v .ie "\\$2"adjust-for-leading-newline" \{\ \M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] .\} .el \{\ \M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] .\} .in 0 .sp -.5v .nf .BX .in .sp .5v .fi .\} .. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" BM/EM - put colored marker in margin next to block of text .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de BM .if t \{\ .br .ll -2n .gcolor red .di BX .\} .. .de EM .if t \{\ .br .di .ll .gcolor .nr BH \\n(dn .ne \\n(BHu \M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] .in 0 .nf .BX .in .fi .\} .. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/info.xsl0000664000175000017500000010470413160023042027331 0ustar bdbaddogbdbaddog \n(zqu " " " " " " " " Documentation DOCUMENTATION [see the section] [FIXME: author] [see http://docbook.sf.net/el/author] Warn meta author no refentry/info/author Note meta author see http://docbook.sf.net/el/author Warn meta author no author data, so inserted a fixme < > Author Authors .PP .br .PP .PP .PP .RS . .RE <\& \&> , .br , .br .br Warn AUTHOR sect. no personblurb|contrib for Note AUTHOR sect. see see http://docbook.sf.net/el/contrib Note AUTHOR sect. see see http://docbook.sf.net/el/personblurb .RS . .RE .RS . .RE .RS . .RE .RE . .RE .RS .PP .br Copyright .br .br .sp scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/manpages/html-synop.xsl0000664000175000017500000013530413160023042030510 0ustar bdbaddogbdbaddog

        . . ( )   ( ) .sp .nf
            
            
          
        .fi

        .

        ( ) ; ... ) ; , ) ; . ; ( )
         
         
        ( ) ;   ... ) ;   , ) ;       ; ( ) ;

        ( void) ; ... ) ; , ) ; ( )
         
         
        ( void) ;   ... ) ;   , ) ; ( ) java Unrecognized language on : . .sp .nf
            
            
            
               extends
              
              
                
        .
        
        	    
              
            
            
              implements
              
              
                
        .
        
        	    
              
            
            
              throws
              
            
             {
            
        .
        
            
            }
          
        .fi
        ,   , , ,    ;     =  void  0 , .      ( ) .     throws  ; .sp .nf
            
            
            
              : 
              
              
                
        .
        
        	    
              
            
            
               implements
              
              
                
        .
        
        	    
              
            
            
               throws
              
            
             {
            
        .
        
            
            }
          
        .fi
        ,   , , ,    ;     =  void  ,    ( ) .     throws  ; .sp .nf
            
            interface 
            
            
              : 
              
              
                
        .
        
        	    
              
            
            
               implements
              
              
                
        .
        
        	    
              
            
            
               throws
              
            
             {
            
        .
        
            
            }
          
        .fi
        ,   , , ,    ;     =  void  ,    ( ) .     raises( ) ; .sp .nf
            
            package 
            
            ;
            
        .
        
        
            
              @ISA = (
              
              );
              
        .
        
            
        
            
          
        .fi
        ,   , , ,    ;     =  void  , sub { ... };
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/lib/0000775000175000017500000000000013160023042024613 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/lib/lib.xsl0000664000175000017500000004410413160023042026114 0ustar bdbaddogbdbaddog http://... Unrecognized unit of measure: . Unrecognized unit of measure: . filename 1 / / scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/RELEASE-NOTES.xml0000664000175000017500000200146213160023041026541 0ustar bdbaddogbdbaddog
        Release Notes for the DocBook XSL Stylesheets $Revision: 8934 $ $Date: 2010-11-01 13:03:14 -0700 (Mon, 01 Nov 2010) $ This release-notes document is available in the following formats: HTML, PDF, plain text; it provides a per-release list of enhancements and changes to the stylesheets’ public APIs (user-configurable parameters) and excludes descriptions of most bug fixes. For a complete list of all changes (including all bug fixes) that have been made since the previous release, see the separate NEWS (plain text) or NEWS.html files. Also available: An online hyperlinked change history (warning: big file) of all changes made over the entire history of the codebase. As with all DocBook Project dot-zero releases, this is an experimental release. It will be followed shortly by a stable release. As with all DocBook Project “dot one plus†releases, this release aspires to be stable (in contrast to dot-zero releases, which are experimental). This is a pre-release “snapshot†of the DocBook XSL Stylesheets. The change information in the first section of this file (for “â€) is auto-generated from change descriptions stored in the project source-code repository. That means the first section contains descriptions both of bug fixes and of feature changes. The remaining sections are manually edited changelog subsets that exclude bug-fix descriptions – that is, trimmed down to just those those descriptions that document enhancements and changes to the public APIs (user-configurable parameters). Release Notes: 1.76.1 The following is a list of changes that have been made since the 1.76.0 release. FO The following changes have been made to the fo code since the 1.76.0 release. Robert Stayton: docbook.xsl; xref.xsl; fop1.xslApply patch to support named destination in fop1.xsl, per Sourceforge bug report #3029845. HTML The following changes have been made to the html code since the 1.76.0 release. Keith Fahlgren: highlight.xslImplementing handling for <b> and <i>: transform to <strong> and <em> for XHTML outputs and do not use in the highliting output (per Mauritz Jeanson) Params The following changes have been made to the params code since the 1.76.0 release. Robert Stayton: draft.mode.xmlChange default for draft.mode to 'no'. Release Notes: 1.76.0 This release includes important bug fixes and adds the following significant feature changes: Webhelp A new browser-based, cross-platform help format with full-text search and other features typically found in help systems. See webhelp/docs/content/ch01.html for more information and a demo. Gentext Many updates and additions to translation/locales thanks to Red Hat, the Fedora Project, and other contributors. Common Faster localization support, as language files are loaded on demand. FO Support for SVG content in imagedata added. HTML Output improved when using 'make.clean.html' and a stock CSS file is now provided. EPUB A number of improvements to NCX, cover and image selection, and XHTML 1.1 element choices The following is a list of changes that have been made since the 1.75.2 release. Gentext The following changes have been made to the gentext code since the 1.75.2 release. rlandmann: locale/fa.xml Update to Persian translation from the Fedora Project rlandmann: locale/nds.xml Locale for Low German Mauritz Jeanson: locale/ka.xml; Makefile Added support for Georgian based on patch #2917147. rlandmann: locale/nl.xml; locale/ja.xml Updated translations from Red Hat and the Fedora Project rlandmann: locale/bs.xml; locale/ru.xml; locale/hr.xml Updated locales from Red Hat and the Fedora Project rlandmann: locale/pt.xml; locale/cs.xml; locale/es.xml; locale/bg.xml; locale/nl.xml; loca⋯ Updated translations from Red Hat and the Fedora Project rlandmann: locale/as.xml; locale/bn_IN.xml; locale/ast.xml; locale/ml.xml; locale/te.xml; ⋯ New translations from Red Hat and the Fedora Project rlandmann: locale/pt.xml; locale/ca.xml; locale/da.xml; locale/sr.xml; locale/ru.xml; loca⋯ Updated translations from Red Hat and the Fedora Project Common The following changes have been made to the common code since the 1.75.2 release. Mauritz Jeanson: common.xsl Fixed bug in output-orderedlist-starting-number template (@startingnumber did not work for FO). Mauritz Jeanson: gentext.xsl Added fix to catch ID also of descendants of listitem. Closes bug #2955077. Jirka Kosek: l10n.xsl Stripped down, faster version of gentext.template is used when there is no localization customization. Mauritz Jeanson: stripns.xsl Added fix that preserves link/@role (makes links in the reference documentation with @role="tcg" work). Mauritz Jeanson: l10n.xsl Fixed bugs related to manpages and L10n. Jirka Kosek: entities.ent; autoidx-kosek.xsl Upgraded to use common entities. Fixed bug when some code used @sortas and some not for grouping/sorting of indexterms. Jirka Kosek: l10n.xsl; l10n.dtd; l10n.xml; autoidx-kosek.xsl Refactored localization support. Language files are loaded on demand. Speedup is about 30%. Jirka Kosek: l10n.xsl Added xsl:keys for improved performance of localization texts look up. Performance gain around 15%. Mauritz Jeanson: titles.xsl Fixed bug #2912677 (error with xref in title). Robert Stayton: olink.xsl Fix bug in xrefstyle "title" handling introduced with the 'insert.targetdb.data' template. Robert Stayton: gentext.xsl Fix bug in xref to equation without title to use context="xref-number" instead of "xref-number-and-title". Robert Stayton: labels.xsl Number all equations in one sequence, with or without title. Robert Stayton: entities.ent Fix bug #2896909 where duplicate @sortas on indexterms caused some indexterms to drop out of index. Robert Stayton: stripns.xsl Expand the "Stripping namespace ..." message to advise users to use the namespaced stylesheets. Robert Stayton: stripns.xsl need a local version of $exsl.node.set.available variable because this module imported many places. Mauritz Jeanson: olink.xsl Added /node() to the select expression that is used to compute the title text so that no <ttl> elements end up in the output. Closes bug #2830119. FO The following changes have been made to the fo code since the 1.75.2 release. Robert Stayton: table.xsl Fix bug 2979166 able - Attribute @rowheader not working Mauritz Jeanson: inline.xsl Improved glossterm auto-linking by using keys. The old code was inefficient when processing documents with many inline glossterms. Robert Stayton: titlepage.xsl Fix bug 2805530 author/orgname not appearing on title page. Mauritz Jeanson: graphics.xsl Added support for SVG content in imagedata (inspired by patch #2909154). Mauritz Jeanson: table.xsl Removed superfluous test used when computing column-width. Closes bug #3000898. Mauritz Jeanson: inline.xsl Added missing <xsl:call-template name="anchor"/>. Closes bug #2998567. Mauritz Jeanson: lists.xsl Added table-layout="fixed" on segmentedlist table (required by XSL spec when proportional-column-width() is used). Jirka Kosek: autoidx-kosek.xsl Upgraded to use common entities. Fixed bug when some code used @sortas and some not for grouping/sorting of indexterms. Jirka Kosek: index.xsl Upgraded to use common entities. Fixed bug when some code used @sortas and some not for grouping/sorting of indexterms. Robert Stayton: xref.xsl Fix bug in olink template when an olink has an id. Add warning message with id value when trying to link to an element that has no generated text. Mauritz Jeanson: refentry.xsl Fixed bug #2930968 (indexterm in refmeta not handled correctly). Robert Stayton: block.xsl fix bug 2949567 title in revhistory breaks FO transform. Robert Stayton: glossary.xsl Output id attributes on glossdiv blocks so they can be added to xrefs or TOC. Jirka Kosek: xref.xsl Enabled hyphenation of URLs when ulink content is the same as link target Robert Stayton: table.xsl Apply patch to turn off row recursion if no @morerows attributes present. This will enable very large tables without row spanning to process without running into recursion limits. Robert Stayton: formal.xsl Format equation without title using table layout with equation number next to the equation. Robert Stayton: param.xweb; param.ent Add equation.number.properties. HTML The following changes have been made to the html code since the 1.75.2 release. Mauritz Jeanson: block.xsl Modified acknowledgements template to avoid invalid output (<p> in <p>). Mauritz Jeanson: titlepage.xsl Added default sidebar attribute-sets. Robert Stayton: table.xsl Fix bug 2979166 able - Attribute @rowheader not working Robert Stayton: footnote.xsl Fix bug 3033191 footnotes in html tables. Mauritz Jeanson: inline.xsl Improved glossterm auto-linking by using keys. The old code was inefficient when processing documents with many inline glossterms. Robert Stayton: docbook.css.xml; verbatim.xsl Fix bug 2844927 Validity error for callout bugs. Robert Stayton: formal.xsl Convert formal.object.heading to respect make.clean.html param. Robert Stayton: titlepage.templates.xml; block.xsl Fix bug 2840768 sidebar without title inserts empty b tag. Mauritz Jeanson: docbook.xsl Moved the template that outputs <base> so that the base URI also applies to relative CSS paths that come later. See patch #2896121. Jirka Kosek: autoidx-kosek.xsl Upgraded to use common entities. Fixed bug when some code used @sortas and some not for grouping/sorting of indexterms. Robert Stayton: chunk-code.xsl fix bug 2948363 generated filename for refentry not unique, when used in a set. Robert Stayton: component.xsl Fix missing "Chapter n" label when use chapter/info/title. Robert Stayton: table.xsl Row recursion turned off if no @morerows attributes in the table. This will prevent failure on long table (with no @morerows) due to excessive depth of recursion. Robert Stayton: autotoc.xsl; docbook.css.xml Support make.clean.html in autotoc.xsl. Robert Stayton: docbook.css.xml; block.xsl Add support for make.clean.html setting in block elements. Robert Stayton: docbook.css.xml Stock CSS styles for DocBook HTML output when 'make.clean.html' is non-zero. Robert Stayton: html.xsl Add templates for generating CSS files and links to them. Robert Stayton: param.xweb Fix bugs in new entity references. Robert Stayton: chunk-common.xsl List of Equations now includes on equations with titles. Robert Stayton: table.xsl If a colspec has a colname attribute, add it to the HTML col element as a class attribute so it can be styled. Robert Stayton: formal.xsl Fix bug 2825842 where table footnotes not appearing in HTML-coded table. Robert Stayton: chunktoc.xsl Fix bug #2834826 where appendix inside part was not chunked as it should be. Mauritz Jeanson: chunktoc.xsl Added missing namespace declarations. Closes bug #2890069. Mauritz Jeanson: footnote.xsl Updated the template for footnote paras to use the 'paragraph' template. Closes bug #2803739. Keith Fahlgren: inline.xsl; lists.xsl Remove <b> and <i> elements "discouraged in favor of style sheets" from XHTML, XHTML 1.1 (and therefore EPUB) outputs by changing html2xhtml.xsl. Fixes bug #2873153: No <b> and <i> tags in XHTML/EPUB Added regression to EPUB specs: Mauritz Jeanson: inline.xsl Fixed bug #2844916 (don't output @target if ulink.target is empty). Keith Fahlgren: autoidx.xsl Fix a bug when using index.on.type: an 'index symbols' section was created even if that typed index didn't include any symbols (they were in the other types). Manpages The following changes have been made to the manpages code since the 1.75.2 release. Mauritz Jeanson: other.xsl Modified the write.stubs template so that the section directory name is not output twice. Should fix bug #2831602. Also ensured that $lang is added to the .so path (when man.output.lang.in.name.enabled=1). Mauritz Jeanson: docbook.xsl; other.xsl Fixed bug #2412738 (apostrophe escaping) by applying the submitted patch. Norman Walsh: block.xsl; endnotes.xsl Fix bug where simpara in footnote didn't work. Patch by Jonathan Nieder, jrnieder@gmail.com dleidert: lists.xsl Fix two indentation issues: In the first case there is no corresponding .RS macro (Debian #519438, sf.net 2793873). In the second case an .RS instead of the probably intended .sp leads to an indentation bug (Debian #527309, sf.net #2642139). Epub The following changes have been made to the epub code since the 1.75.2 release. Keith Fahlgren: bin/spec/examples/AMasqueOfDays.epub; docbook.xsl; bin/spec/epub_spec.rb Resolve some actual regressions in date output spotted by more recent versions of epubcheck Keith Fahlgren: docbook.xsl Updated mediaobject selection code that better uses roles (when available); based on contributons by Glenn McDonald Keith Fahlgren: bin/spec/epub_regressions_spec.rb; docbook.xsl Ensure that NCX documents are always outputted with a default namespace to prevent problems with the kindlegen machinery Keith Fahlgren: bin/spec/epub_regressions_spec.rb; bin/spec/files/partintro.xml; docbook.x⋯ Adding support for partintros with sect2s, 3s, etc Keith Fahlgren: docbook.xsl Adding param to workaround horrific ADE bug with the inability to process <br> Keith Fahlgren: docbook.xsl Add support for authorgroup/author in OPF metadata (via Michael Wiedmann) Keith Fahlgren: bin/spec/epub_regressions_spec.rb Remove <b> and <i> elements "discouraged in favor of style sheets" from XHTML, XHTML 1.1 (and therefore EPUB) outputs by changing html2xhtml.xsl. Fixes bug #2873153: No <b> and <i> tags in XHTML/EPUB Added regression to EPUB specs: Keith Fahlgren: bin/lib/docbook.rb; bin/spec/files/DejaVuSerif-Italic.otf; docbook.xsl; bi⋯ This resolves bug #2873142, Please add support for multiple embedded fonts If you navigate to a checkout of DocBook-XSL and go to: xsl/epub/bin/spec/files You can now run the following command: ../../dbtoepub -f DejaVuSerif.otf -f DejaVuSerif-Italic.otf -c test.css -s test_cust.xsl orm.book.001.xml In dbtoepub, the following option can be used more than once: -f, --font [OTF FILE] Embed OTF FILE in .epub. The underlying stylesheet now accepts a comma-separated list of font file names rather than just one as the RENAMED epub.embedded.fonts ('s' added). The runnable EPUB spec now includes: - should be valid .epub after including more than one embedded font Keith Fahlgren: docbook.xsl Improve the selection of cover images when working in DocBook 4.x land (work in progress) Keith Fahlgren: bin/spec/epub_regressions_spec.rb; docbook.xsl Improve the quality of the OPF spine regression by ensuring that the spine elements for deeply nested refentries are in order and adjacent to their opening wrapper XHTML chunk. Keith Fahlgren: bin/spec/epub_regressions_spec.rb; docbook.xsl; bin/spec/files/orm.book.00⋯ Add more careful handling of refentries to ensure that they always appear in the opf:spine. This was only a problem when refentries were pushed deep into the hierarchy (like inside a sect2), but presented navigational problems for many reading systems (despite the correct NCX references). This may *not* be the best solution, but attacking a better chunking strategy for refentries was too big a nut to crack at this time. Eclipse The following changes have been made to the eclipse code since the 1.75.2 release. Mauritz Jeanson: eclipse3.xsl Added a stylesheet module that generates plug-ins conforming to the standard (OSGi-based) Eclipse 3.x architecture. The main difference to the older format is that metadata is stored in a separate manifest file. The module imports and extends the existing eclipse.xsl module. Based on code contributed in patch #2624668. Params The following changes have been made to the params code since the 1.75.2 release. Robert Stayton: draft.watermark.image.xml Fix bug 2922488 draft.watermark.image pointing to web resource. Now the value is images/draft.png, and may require customization for local resolution. Mauritz Jeanson: equation.number.properties.xml Corrected refpurpose. Norman Walsh: paper.type.xml Added USlegal and USlegallandscape paper types. Jirka Kosek: highlight.xslthl.config.xml Added note about specifying location as URL Robert Stayton: docbook.css.source.xml; generate.css.header.xml; custom.css.source.xml; ma⋯ Params to support generated CSS files. Robert Stayton: equation.number.properties.xml New attribute set for numbers appearing next to equations. XSL-Xalan The following changes have been made to the xsl-xalan code since the 1.75.2 release. dleidert: nbproject/genfiles.properties; nbproject/build-impl.xml Rebuild netbeans build files after adding missing Netbeans configuration to allow easier packaging for Debian. Release Notes: 1.75.2 The following is a list of changes that have been made since the 1.75.1 release. Gentext The following changes have been made to the gentext code since the 1.75.1 release. dleidert: locale/ja.xmlImproved Japanese translation for Note(s). Closes bug #2823965. dleidert: locale/pl.xmlPolish alphabet contains O with acute accent, not with grave accent. Closes bug #2823964. Robert Stayton: locale/ja.xmlFix translation of "index", per bug report 2796064. Robert Stayton: locale/is.xmlNew Icelandic locale file. Common The following changes have been made to the common code since the 1.75.1 release. Norman Walsh: stripns.xslSupport more downconvert cases Robert Stayton: titles.xslMake sure title inside info is used if no other title. FO The following changes have been made to the fo code since the 1.75.1 release. Robert Stayton: pi.xslTurn off dbfo-need for fop1.extensions also, per bug #2816141. HTML The following changes have been made to the html code since the 1.75.1 release. Mauritz Jeanson: titlepage.xslOutput "Copyright" heading in XHTML too. Mauritz Jeanson: titlepage.xslAdded stylesheet.result.type test for copyright. Closes bug #2813289. Norman Walsh: htmltbl.xslRemove ambiguity wrt @span, @rowspan, and @colspan Manpages The following changes have been made to the manpages code since the 1.75.1 release. Mauritz Jeanson: endnotes.xslAdded normalize-space() for ulink content. Closes bug #2793877. Mauritz Jeanson: docbook.xslAdded stylesheet.result.type test for copyright. Closes bug #2813289. Epub The following changes have been made to the epub code since the 1.75.1 release. Keith Fahlgren: bin/dbtoepub; bin/lib/docbook.rbCorrected bugs caused by path and file assumptions were not met Keith Fahlgren: bin/lib/docbook.rb; docbook.xslCleaning up hardcoded values into parameters and fixing Ruby library to pass them properly; all thanks to patch from Liza Daly Profiling The following changes have been made to the profiling code since the 1.75.1 release. Robert Stayton: profile.xslFix bug 2815493 missing exsl.node.set.available parameter. XSL-Saxon The following changes have been made to the xsl-saxon code since the 1.75.1 release. Mauritz Jeanson: src/com/nwalsh/saxon/ColumnUpdateEmitter.java; src/com/nwalsh/saxon/Colum⋯Added fixes so that colgroups in the XHTML namespace are processed properly. XSL-Xalan The following changes have been made to the xsl-xalan code since the 1.75.1 release. Mauritz Jeanson: nbproject/project.xmlAdded missing NetBeans configuration. Release Notes: 1.75.1 This release includes bug fixes. The following is a list of changes that have been made since the 1.75.0 release. FO The following changes have been made to the fo code since the 1.75.0 release. Keith Fahlgren: block.xslSwitching to em dash for character before attribution in epigraph; resolves Bug #2793878 Robert Stayton: lists.xslFixed bug 2789947, id attribute missing on simplelist fo output. HTML The following changes have been made to the html code since the 1.75.0 release. Keith Fahlgren: block.xslSwitching to em dash for character before attribution in epigraph; resolves Bug #2793878 Robert Stayton: lists.xslFixed bug 2789678: apply-templates line accidentally deleted. Epub The following changes have been made to the epub code since the 1.75.0 release. Keith Fahlgren: bin/spec/epub_regressions_spec.rb; docbook.xslAdded regression and fix to correct "bug" with namespace-prefixed container elements in META-INF/container.xml ; resolves Issue #2790017 Keith Fahlgren: bin/spec/epub_regressions_spec.rb; bin/spec/files/onegraphic.xinclude.xml;⋯Another attempt at flexible named entity and XInclude processing Keith Fahlgren: bin/lib/docbook.rbTweaking solution to Bug #2750442 following regression reported by Michael Wiedmann. Params The following changes have been made to the params code since the 1.75.0 release. Mauritz Jeanson: highlight.source.xmlUpdated documentation to reflect changes made in r8419. Release Notes: 1.75.0 This release includes important bug fixes and adds the following significant feature changes: Gentext Modifications to translations have been made. Common Added support for some format properties on tables using HTML table markup. Added two new qanda.defaultlabel values so that numbered sections and numbered questions can be distinguished. Satisfies Feature Request #1539045. Added code to handle acknowledgements in book and part. The element is processed similarly to dedication. All acknowledgements will appear as front matter, after any dedications. FO The inclusion of highlighting code has been simplified. Add support for pgwide on informal objects. Added a new parameter, bookmarks.collapse, that controls the initial state of the bookmark tree. Closes FR #1792326. Add support for more dbfo processing instructions. Add new variablelist.term.properties to format terms, per request # 1968513. Add support for @width on screen and programlisting, fixes bug #2012736. Add support for writing-mode="rl-tb" (right-to-left) in FO outputs. Add writing.mode param for FO output. HTML Convert all calls to class.attribute to calls to common.html.attributes to support dir, lang, and title attributes in html output for all elements. Fulfills feature request #1993833. Inclusion of highlighting code was simplified. Only one import is now necessary. Add new param index.links.to.section. Add support for the new index.links.to.section param which permits precise links to indexterms in HTML output rather than to the section title. ePub Slightly more nuanced handling of imageobject alternatives and better support in dbtoepub for XIncludes and ENTITYs to resolve Issue #2750442 reported by Raphael Hertzog. Added a colon after an abstract/title when mapping into the dc:description for OPF metadata in ePub output to help the flat text have more pseudo-semantics (sugestions from Michael Wiedmann) Added DocBook subjectset -> OPF dc:subject mapping and tests Added DocBook date -> OPF dc:date mapping and tests Added DocBook abstract -> OPF dc:description mapping and tests Added --output option to dbtoepub based on user request HTMLHelp Add support for generating olink target database for htmlhelp files. Params Add default setting for @rules attribute on HTML markup tables. Added a new parameter, bookmarks.collapse, that controls the initial state of the bookmark tree. When the parameter has a non-zero value (the default), only the top-level bookmarks are displayed initially. Otherwise, the whole tree of bookmarks is displayed. This is implemented for FOP 0.9X. Closes FR #1792326. Add new variablelist.term.properties to format terms, per request # 1968513. Add two new qanda.defaultlabel values so that numbered sections and numbered questions can be distinguished. Satisfies Feature Request #1539045. Add param to control whether an index entry links to a section title or to the precise location of the indexterm. New attribute list for glossentry in glossary. New parameter to support @width on programlisting and screen. Add attribute-sets for formatting glossary terms and defs. Highlighting Inclusion of highlighting code was simplified. Only one import is now necessary. The following is a list of changes that have been made since the 1.74.3 release. Gentext The following changes have been made to the gentext code since the 1.74.3 release. Robert Stayton: locale/sv.xml; locale/ja.xml; locale/pl.xmlCheck in translations of Legalnotice submitted on mailing list. Robert Stayton: locale/es.xmlFix spelling errors in Acknowledgements entries. Robert Stayton: locale/es.xmlCheck in translations for 4 elements submitted through docbook-apps message of 14 April 2009. David Cramer: locale/zh.xml; locale/ca.xml; locale/ru.xml; locale/ga.xml; locale/gl.xml; l⋯Internationalized punctuation in glosssee and glossseealso Robert Stayton: MakefileCheck in fixes for DSSSL gentext targets from submitted patch #1689633. Robert Stayton: locale/uk.xmlCheck in major update submitted with bug report #2008524. Robert Stayton: locale/zh_tw.xmlCheck in fix to Note string submitted in bug #2441051. Robert Stayton: locale/ru.xmlCheckin typo fix submitted in bug #2453406. Common The following changes have been made to the common code since the 1.74.3 release. Robert Stayton: gentext.xslFix extra generated space when xrefstyle includes 'nopage'. Robert Stayton: table.xslAdd support for some format properties on tables using HTML table markup. These include: - frame attribute on table (or uses $default.table.frame parameter). - rules attribute on table (or uses $default.table.rules parameter). - align attribute on td and th - valign attribute on td and th - colspan on td and th - rowspan on td and th - bgcolor on td and th Robert Stayton: olink.xslAdd placeholder template to massage olink hot text to make customization easier, per Feature Request 1828608. Robert Stayton: targets.xslAdd support for collecting olink targets from a glossary generated from a glossary.collection. Robert Stayton: titles.xslHandle firstterm like glossterm in mode="title.markup". Robert Stayton: titles.xslAdd match on info/title in title.markup templates where missing. Mauritz Jeanson: titles.xslChanged "ancestor::title" to "(ancestor::title and (@id or @xml:id))". This enables proper formatting of inline elements in titles in TOCs, as long as these inlines don't have id or xml:id attributes. Robert Stayton: labels.xslAdd two new qanda.defaultlabel values so that numbered sections and numbered questions can be distinguished. Satisfies Feature Request #1539045. Robert Stayton: stripns.xsl; pi.xslConvert function-available(exsl:node-set) to use the new param so Xalan bug is isolated. Mauritz Jeanson: titles.xslAdded fixes for bugs #2112656 and #1759205: 1. Reverted mistaken commits r7485 and r7523. 2. Updated the template with match="link" and mode="no.anchor.mode" so that @endterm is used if it exists and if the link has no content. Mauritz Jeanson: titles.xslAdded code to handle acknowledgements in book and part. The element is processed similarly to dedication. All acknowledgements will appear as front matter, after any dedications. Robert Stayton: olink.xslFix bug #2018717 use.local.olink.style uses wrong gentext context. Robert Stayton: olink.xslFix bug #1787167 incorrect hot text for some olinks. Robert Stayton: common.xslFix bug #1669654 Broken output if copyright <year> contains a range. Robert Stayton: labels.xslFix bug in labelling figure inside appendix inside article inside book. FO The following changes have been made to the fo code since the 1.74.3 release. Jirka Kosek: highlight.xslInclusion of highlighting code was simplified. Only one import is now necessary. Robert Stayton: fop1.xslAdd the new fop extensions namespace declaration, in case FOP extension functions are used. Robert Stayton: formal.xslAdd support for pgwide on informal objects. Robert Stayton: docbook.xslFixed spurious closing quote on line 134. Robert Stayton: docbook.xsl; autoidx-kosek.xsl; autoidx.xslConvert function-available for node-set() to use new $exsl.node.set.available param in test. David Cramer: xref.xslSuppress extra space after xref when xrefstyle='select: label nopage' (#2740472) Mauritz Jeanson: pi.xslFixed doc bug for row-height. David Cramer: glossary.xslInternationalized punctuation in glosssee and glossseealso Robert Stayton: param.xweb; param.ent; htmltbl.xsl; table.xslAdd support for some format properties on tables using HTML table markup. These include: - frame attribute on table (or uses $default.table.frame parameter). - rules attribute on table (or uses $default.table.rules parameter). - align attribute on td and th - valign attribute on td and th - colspan on td and th - rowspan on td and th - bgcolor on td and th Robert Stayton: table.xslAdd support bgcolor in td and th elements in HTML table markup. Robert Stayton: htmltbl.xslAdd support for colspan and rowspan and bgcolor in td and th elements in HTML table markup. Robert Stayton: param.xwebFix working of page-master left and right margins. Mauritz Jeanson: param.xweb; param.ent; fop1.xslAdded a new parameter, bookmarks.collapse, that controls the initial state of the bookmark tree. When the parameter has a non-zero value (the default), only the top-level bookmarks are displayed initially. Otherwise, the whole tree of bookmarks is displayed. This is implemented for FOP 0.9X. Closes FR #1792326. Robert Stayton: table.xsl; pi.xslAdd support for dbfo row-height processing instruction, like that in dbhtml. Robert Stayton: lists.xslAdd support for dbfo keep-together processing instruction for entire list instances. Robert Stayton: lists.xsl; block.xslAdd support fo dbfo keep-together processing instruction to more blocks like list items and paras. Robert Stayton: lists.xsl; param.xweb; param.entAdd new variablelist.term.properties to format terms, per request # 1968513. Robert Stayton: inline.xslIn simple.xlink, rearrange order of processing. Robert Stayton: xref.xslHandle firstterm like glossterm in mode="xref-to". Robert Stayton: glossary.xsl; xref.xsl; pi.xsl; footnote.xslImplement simple.xlink for glosssee and glossseealso so they can use other types of linking besides otherterm. Robert Stayton: qandaset.xslAdd two new qanda.defaultlabel values so that numbered sections and numbered questions can be distinguished. Satisfies Feature Request #1539045. Robert Stayton: titlepage.xslFor the book title templates, I changed info/title to book/info/title so other element's titles will not be affected. Robert Stayton: xref.xsl; verbatim.xslUse param exsl.node.set.available to test for function. Robert Stayton: param.xweb; param.ent; footnote.xslStart using new param exsl.node.set.available to work around Xalan bug. Robert Stayton: titlepage.templates.xmlAdd comment on use of t:predicate for editor to prevent extra processing of multiple editors. Fixes bug 2687842. Robert Stayton: xref.xsl; autoidx.xslAn indexterm primary, secondary, or tertiary element with an id or xml:id now outputs that ID, so that index entries can be cross referenced to. Mauritz Jeanson: synop.xslAdded modeless template for ooclass|oointerface|ooexception. Closes bug #1623468. Robert Stayton: xref.xslAdd template with match on indexterm in mode="xref-to" to fix bug 2102592. Robert Stayton: xref.xslNow xref to qandaentry will use the label element in a question for the link text if it has one. Robert Stayton: inline.xslAdd id if specified from @id to output for quote and phrase so they can be xref'ed to. Robert Stayton: xref.xslAdd support for xref to phrase, simpara, anchor, and quote. This assumes the author specifies something using xrefstyle since the elements don't have ordinary link text. Robert Stayton: toc.xslFix bug in new toc templates. Mauritz Jeanson: titlepage.xsl; component.xsl; division.xsl; xref.xsl; titlepage.templates⋯Added code to handle acknowledgements in book and part. The element is processed similarly to dedication. All acknowledgements will appear as front matter, after any dedications. Robert Stayton: toc.xslRewrite toc templates to support an empty toc or populated toc in all permitted contexts. Same for lot elements. This fixes bug #1595969 for FO outputs. Robert Stayton: index.xslFix indents for seealsoie so they are consistent. Mauritz Jeanson: param.xwebRemoved duplicate (monospace.font.family). Robert Stayton: param.xweb; param.entAdd glossentry.list.item.properties. Robert Stayton: param.xweb; param.entAdd monospace.verbatim.font.width param to support @width on programlisting. Robert Stayton: verbatim.xslPut programlisting in fo:block-container with writing-mode="lr-tb" when text direction is right to left because all program languages are left-to-right. Robert Stayton: verbatim.xslAdd support for @width on screen and programlisting, fixes bug #2012736. Robert Stayton: xref.xslFix bug #1973585 xref to para with xrefstyle not handled correctly. Mauritz Jeanson: block.xslAdded support for acknowledgements in article. Support in book/part remains to be added. Robert Stayton: xref.xslFix bug #1787167 incorrect hot text for some olinks. Robert Stayton: fo.xslAdd writing-mode="tb-rl" as well since some XSL-FO processors support it. Robert Stayton: autotoc.xsl; lists.xsl; glossary.xsl; fo.xsl; table.xsl; pagesetup.xslAdd support for writing-mode="rl-tb" (right-to-left) in FO outputs. Changed instances of margin-left to margin-{$direction.align.start} and margin-right to margin-{$direction.align.end}. Those direction.align params are computed from the writing mode value in each locale's gentext key named 'writing-mode', introduced in 1.74.3 to add right-to-left support to HTML outputs. Robert Stayton: param.xweb; param.entAdd attribute-sets for formatting glossary terms and defs. Robert Stayton: param.xweb; param.entAdd writing.mode param for FO output. Robert Stayton: autotoc.xslFix bug 1546008: in qandaentry in a TOC, use its blockinfo/titleabbrev or blockinfo/title instead of question, if available. For DocBook 5, use the info versions. Keith Fahlgren: verbatim.xslAdd better pointer to README for XSLTHL Keith Fahlgren: verbatim.xslMore tweaking the way that XSLTHL does or does not get called Keith Fahlgren: verbatim.xslAlternate attempt at sanely including/excluding XSLTHT code HTML The following changes have been made to the html code since the 1.74.3 release. Robert Stayton: lists.xslRemoved redundant lang and title attributes on list element inside div element for lists. Robert Stayton: inline.xsl; titlepage.xsl; division.xsl; toc.xsl; sections.xsl; table.xsl;⋯Convert all calls to class.attribute to calls to common.html.attributes to support dir, lang, and title attributes in html output for all elements. Fulfills feature request #1993833. Robert Stayton: chunk-common.xslFix bug #2750253 wrong links in list of figures in chunk.html when target html is in a subdirectory and dbhtml filename used. Jirka Kosek: highlight.xslInclusion of highlighting code was simplified. Only one import is now necessary. Robert Stayton: chunk-common.xsl; chunktoc.xsl; docbook.xsl; chunk-changebars.xsl; autoidx⋯Convert function-available for node-set() to use new $exsl.node.set.available param in test. Mauritz Jeanson: pi.xslFixed doc bug for row-height. David Cramer: glossary.xslInternationalized punctuation in glosssee and glossseealso Robert Stayton: lists.xsl; html.xsl; block.xslMore elements get common.html.attributes. Added locale.html.attributes template which does the lang, dir, and title attributes, but not the class attribute (used on para, for example). Robert Stayton: lists.xslReplace more literal class atts with mode="class.attribute" to support easier customization. Robert Stayton: glossary.xslSupport olinking in glosssee and glossseealso. Robert Stayton: inline.xslIn simple.xlink, rearrange order of processing. Robert Stayton: xref.xslHandle firstterm like glossterm in mode="xref-to". Robert Stayton: lists.xsl; html.xsl; block.xslAdded template named common.html.attributes to output class, title, lang, and dir for most elements. Started adding it to some list and block elements. Robert Stayton: qandaset.xslAdd two new qanda.defaultlabel values so that numbered sections and numbered questions can be distinguished. Satisfies Feature Request #1539045. Robert Stayton: param.xweb; chunk-code.xsl; param.ent; xref.xsl; chunkfast.xsl; verbatim.x⋯Use new param exsl.node.set.available to test, handles Xalan bug. Robert Stayton: autoidx.xslUse named anchors for primary, secondary, and tertiary ids so duplicate entries with different ids can still have an id output. Robert Stayton: param.xweb; param.entAdd new param index.links.to.section. Robert Stayton: xref.xsl; autoidx.xslPass through an id on primary, secondary, or tertiary to the index entry, so that one could link to an index entry. You can't link to the id on an indexterm because that is used to place the main anchor in the text flow. Robert Stayton: autoidx.xslAdd support for the new index.links.to.section param which permits precise links to indexterms in HTML output rather than to the section title. Mauritz Jeanson: synop.xslAdded modeless template for ooclass|oointerface|ooexception. Closes bug #1623468. Robert Stayton: qandaset.xslMake sure a qandaset has an anchor, even when it has no title, because it may be referenced in a TOC or xref. Before, the anchor was output by the title, but there was no anchor if there was no title. Robert Stayton: xref.xslAdd a template for indexterm with mode="xref-to" to fix bug 2102592. Robert Stayton: xref.xslNow xref to qandaentry will use the label element in a question for the link text if it has one. Robert Stayton: qandaset.xsl; html.xslCreate separate templates for computing label of question and answer in a qandaentry, so such can be used for the alt text of an xref to a qandaentry. Robert Stayton: inline.xsl; xref.xslNow support xref to phrase, simpara, anchor, and quote, most useful when an xrefstyle is used. Robert Stayton: toc.xslRewrite toc templates to support an empty toc or populated toc in all permitted contexts. Same for lot elements. This fixes bug #1595969 for HTML outputs. Mauritz Jeanson: titlepage.xsl; component.xsl; division.xsl; xref.xsl; titlepage.templates⋯Added code to handle acknowledgements in book and part. The element is processed similarly to dedication. All acknowledgements will appear as front matter, after any dedications. Robert Stayton: index.xslRewrote primaryie, secondaryie and tertiaryie templates to handle nesting of elements and seeie and seealsoie, as reported in bug # 1168912. Robert Stayton: autotoc.xslFix simplesect in toc problem. Robert Stayton: verbatim.xslAdd support for @width per bug report #2012736. Robert Stayton: formal.xsl; htmltbl.xslFix bug #1787140 HTML tables not handling attributes correctly. Robert Stayton: param.xwebMove writing-mode param. Keith Fahlgren: refentry.xslRemove a nesting of <p> inside <p> for refclass (made XHTML* invalid, made HTML silly) Robert Stayton: table.xslFix bug #1945872 to allow passthrough of colwidth values to HTML table when no tablecolumns.extension is available and when no instance of * appears in the table's colspecs. Mauritz Jeanson: block.xslAdded support for acknowledgements in article. Support in book/part remains to be added. Robert Stayton: chunk-common.xslFix bug #1787167 incorrect hot text for some olinks. Robert Stayton: qandaset.xslFix bug 1546008: in qandaentry in a TOC, use its blockinfo/titleabbrev or blockinfo/title instead of question, if available. For DocBook 5, use the info versions. Robert Stayton: chunktoc.xslAdd support for generating olink database when using chunktoc.xsl. Keith Fahlgren: verbatim.xslAdd better pointer to README for XSLTHL Keith Fahlgren: verbatim.xslAnother stab at fixing the stupid XSLTHT includes across processors (Saxon regression reported by Sorin Ristache) Keith Fahlgren: verbatim.xslMore tweaking the way that XSLTHL does or does not get called Keith Fahlgren: verbatim.xslAlternate attempt at sanely including/excluding XSLTHT code Manpages The following changes have been made to the manpages code since the 1.74.3 release. Robert Stayton: table.xslConvert function-available test for node-set() function to test of $exsl.node.set.available param. Mauritz Jeanson: lists.xslAdded a template for bibliolist. Closes bug #1815916. ePub The following changes have been made to the epub code since the 1.74.3 release. Keith Fahlgren: bin/spec/epub_regressions_spec.rb; bin/spec/files/onegraphic.xinclude.xml;⋯Slightly more nuanced handling of imageobject alternatives and better support in dbtoepub for XIncludes and ENTITYs to resolve Issue #2750442 reported by Raphael Hertzog. Keith Fahlgren: docbook.xslAdd a colon after an abstract/title when mapping into the dc:description for OPF metadata in ePub output to help the flat text have more pseudo-semantics (sugestions from Michael Wiedmann) Keith Fahlgren: bin/spec/epub_regressions_spec.rb; docbook.xsl; bin/spec/files/de.xmlCorrectly set dc:language in OPF metadata when i18nizing. Closes Bug #2755150 Keith Fahlgren: bin/spec/epub_regressions_spec.rb; docbook.xslCorrected namespace declarations for literal XHTML elements to make them serialize "normally" Keith Fahlgren: docbook.xslBe a little bit more nuanced about dates Keith Fahlgren: docbook.xsl; bin/spec/epub_realbook_spec.rb; bin/spec/files/orm.book.001.x⋯Add DocBook subjectset -> OPF dc:subject mapping and tests Keith Fahlgren: docbook.xsl; bin/spec/epub_realbook_spec.rb; bin/spec/files/orm.book.001.x⋯Add DocBook date -> OPF dc:date mapping and tests Keith Fahlgren: docbook.xsl; bin/spec/epub_realbook_spec.rb; bin/spec/files/orm.book.001.x⋯Add DocBook abstract -> OPF dc:description mapping and tests Robert Stayton: docbook.xslCheck in patch submitted by user to add opf:file-as attribute to dc:creator element. Keith Fahlgren: bin/dbtoepubAdding --output option to dbtoepub based on user request Keith Fahlgren: docbook.xsl; bin/spec/epub_spec.rbCleaning and regularizing the generation of namespaced nodes for OPF, NCX, XHTML and other outputted filetypes (hat tip to bobstayton for pointing out the silly, incorrect code) Keith Fahlgren: bin/spec/epub_regressions_spec.rb; bin/spec/files/refclass.xmlRemove a nesting of <p> inside <p> for refclass (made XHTML* invalid, made HTML silly) Keith Fahlgren: bin/spec/epub_regressions_spec.rb; bin/spec/files/blockquotepre.xmlAdded regression test and fix for XHTML validation problem with <a>s added inside <blockquote>; This potentially causes another problem (where something is referenced by has no anchor, but someone reporting that should cause the whole <a id='thing'/> thing to be reconsidered with modern browsers in mind. HTMLHelp The following changes have been made to the htmlhelp code since the 1.74.3 release. Robert Stayton: htmlhelp-common.xslAdd support for generating olink target database for htmlhelp files. Params The following changes have been made to the params code since the 1.74.3 release. Robert Stayton: default.table.rules.xmlAdd default setting for @rules attribute on HTML markup tables. Mauritz Jeanson: bookmarks.collapse.xmlAdded a new parameter, bookmarks.collapse, that controls the initial state of the bookmark tree. When the parameter has a non-zero value (the default), only the top-level bookmarks are displayed initially. Otherwise, the whole tree of bookmarks is displayed. This is implemented for FOP 0.9X. Closes FR #1792326. Robert Stayton: variablelist.term.properties.xmlAdd new variablelist.term.properties to format terms, per request # 1968513. Robert Stayton: qanda.defaultlabel.xmlAdd two new qanda.defaultlabel values so that numbered sections and numbered questions can be distinguished. Satisfies Feature Request #1539045. Robert Stayton: index.links.to.section.xmlChange default to 1 to match past behavior. Robert Stayton: exsl.node.set.available.xmlIsolate this text for Xalan bug regarding exsl:node-set available. If it is ever fixed in Xalan, just fix it here. Robert Stayton: index.links.to.section.xmlAdd param to control whether an index entry links to a section title or to the precise location of the indexterm. Robert Stayton: glossentry.list.item.properties.xmlNew attribute list for glossentry in glossary. Robert Stayton: monospace.verbatim.font.width.xmlNew parameter to support @width on programlisting and screen. Mauritz Jeanson: highlight.source.xmlUpdated and reorganized the description. Robert Stayton: page.margin.outer.xml; page.margin.inner.xmlAdd caveat about XEP bug when writing-mode is right-to-left. Robert Stayton: article.appendix.title.properties.xml; writing.mode.xml; body.start.indent⋯Change 'left' to 'start' and 'right' to 'end' to support right-to-left writing mode. Robert Stayton: glossdef.block.properties.xml; glossdef.list.properties.xml; glossterm.blo⋯Add attribute-sets for formatting glossary terms and defs. Robert Stayton: glossterm.separation.xmlClarify the description. Robert Stayton: make.year.ranges.xmlNow handles year element containing a comma or dash without error. Highlighting The following changes have been made to the highlighting code since the 1.74.3 release. Jirka Kosek: READMEInclusion of highlighting code was simplified. Only one import is now necessary. Keith Fahlgren: READMEAdding XSLTHL readme Keith Fahlgren: common.xslAlternate attempt at sanely including/excluding XSLTHT code XSL-Saxon The following changes have been made to the xsl-saxon code since the 1.74.3 release. Mauritz Jeanson: src/com/nwalsh/saxon/Text.javaAdded a fix that prevents output of extra blank line. Hopefully this closes bug #894805. XSL-Xalan The following changes have been made to the xsl-xalan code since the 1.74.3 release. Mauritz Jeanson: src/com/nwalsh/xalan/Text.javaAdded a fix that prevents output of extra blank line. Hopefully this closes bug #894805. Release Notes: 1.74.3 This release fixes some bugs in the 1.74.2 release. See highlighting/README for XSLTHL usage instructions. Release Notes: 1.74.2 This release fixes some bugs in the 1.74.1 release. Release Notes: 1.74.1 This release includes important bug fixes and adds the following significant feature changes: Gentext Kirghiz locale added and Chinese translations have been simplified. Somme support for gentext and right-to-left languages has been added. FO Various bugs have been resolved. Support for a new processing instruction: dbfo funcsynopsis-style has been added. Added new param email.mailto.enabled for FO output. Patch from Paolo Borelli. Support for documented metadata in fop1 mode has been added. Highlighting Support for the latest version of XSLTHL 2.0 and some new language syntaxes have been added to a variety of outputs. Manpages Added man.output.better.ps.enabled param (zero default). It non-zero, no such markup is embedded in generated man pages, and no enhancements are included in the PostScript output generated from those man pages by the man -Tps command. HTML Support for writing.mode to set text direction and alignment based on document locale has been added. Added a new top-level stylesheet module, chunk-changebars.xsl, to be used for generating chunked output with highlighting based on change (@revisionflag) markup. The module imports/includes the standard chunking and changebars templates and contains additional logic for chunked output. See FRs #1015180 and #1819915. ePub Covers now look better in Adobe Digital Editions thanks to a patch from Paul Norton of Adobe Cover handling now more generic (including limited DocBook 5.0 cover support thanks to patch contributed by Liza Daly. Cover markup now carries more reliably into files destined for .mobi and the Kindle. dc:identifiers are now generated from more types of numbering schemes. Both SEO and semantic structure of chunked ePub output by ensuring that we always send out one and only one h1 in each XHTML chunk. Primitive support for embedding a single font added. Support for embedding a CSS customizations added. Roundtrip Support for imagedata-metadata and table as images added. Support for imagedata-metadata and legalnotice as images added. Params man.output.better.ps.enabled added for Manpages output writing.mode.xml added to set text direction. Added new param email.mailto.enabled for FO output. Patch from Paolo Borelli. Closes #2086321. highlight.source upgraded to support the latest version of XSLTHL 2.0. The following is a list of changes that have been made since the 1.74.0 release. Gentext The following changes have been made to the gentext code since the 1.74.0 release. Michael(tm) Smith: locale/ky.xml; Makefilenew Kirghiz locale from Ilyas Bakirov Mauritz Jeanson: locale/en.xmlAdded "Acknowledgements". Dongsheng Song: locale/zh_cn.xmlSimplified Chinese translation. Robert Stayton: locale/lv.xml; locale/ca.xml; locale/pt.xml; locale/tr.xml; locale/af.xml;⋯Add writing-mode gentext string to support right-to-left languages. FO The following changes have been made to the fo code since the 1.74.0 release. David Cramer: footnote.xslAdded a check to confirm that a footnoteref's linkend points to a footnote. Stylesheets stop processing if not and provide a useful error message. Mauritz Jeanson: spaces.xslConvert spaces to fo:leader also in elements in the DB 5 namespace. Mauritz Jeanson: pi.xsl; synop.xslAdded support for a new processing instruction: dbfo funcsynopsis-style. Closes bug #1838213. Michael(tm) Smith: inline.xsl; param.xweb; param.entAdded new param email.mailto.enabled for FO output. Patch from Paolo Borelli. Closes #2086321. Mauritz Jeanson: docbook.xslAdded support for document metadata for fop1 (patch #2067318). Jirka Kosek: param.ent; param.xweb; highlight.xslUpgraded to support the latest version of XSLTHL 2.0 -- nested markup in highlited code is now processed -- it is no longer needed to specify path XSLTHL configuration file using Java property -- support for new languages, including Perl, Python and Ruby was added HTML The following changes have been made to the html code since the 1.74.0 release. Robert Stayton: param.xweb; docbook.xsl; param.ent; html.xslAdd support for writing.mode to set text direction and alignment based on document locale. Mauritz Jeanson: chunk-changebars.xslAdded a new top-level stylesheet module, chunk-changebars.xsl, to be used for generating chunked output with highlighting based on change (@revisionflag) markup. The module imports/includes the standard chunking and changebars templates and contains additional logic for chunked output. See FRs #1015180 and #1819915. Manpages The following changes have been made to the manpages code since the 1.74.0 release. Michael(tm) Smith: docbook.xslPut the following at the top of generated roff for each page: \" t purpose is to explicitly tell AT&T troff that the page needs to be pre-processed through tbl(1); groff can figure it out automatically, but apparently AT&T troff needs to be explicitly told ePub The following changes have been made to the epub code since the 1.74.0 release. Keith Fahlgren: docbook.xslPatch from Paul Norton of Adobe to get covers to look better in Adobe Digital Editions Keith Fahlgren: bin/spec/epub_regressions_spec.rb; bin/spec/files/v5cover.xml; bin/spec/sp⋯Patch contributed by Liza Daly to make ePub cover handling more generic. Additionally DocBook 5.0's <cover> now has some limited support: - should reference a cover in the OPF guide for a DocBook 5.0 test document Keith Fahlgren: bin/spec/files/isbn.xml; bin/spec/files/issn.xml; bin/spec/files/biblioid.⋯Liza Daly reported that the dc:identifer-generation code was garbage (she was right). Added new tests: - should include at least one dc:identifier - should include an ISBN as URN for dc:identifier if an ISBN was in the metadata - should include an ISSN as URN for dc:identifier if an ISSN was in the metadata - should include an biblioid as a dc:identifier if an biblioid was in the metadata - should include a URN for a biblioid with @class attribute as a dc:identifier if an biblioid was in the metadata Keith Fahlgren: docbook.xsl; bin/spec/epub_spec.rbImprove both SEO and semantic structure of chunked ePub output by ensuring that we always send out one and only one h1 in each XHTML chunk. DocBook::Epub - should include one and only one <h1> in each HTML file in rendered ePub files for <book>s - should include one and only one <h1> in each HTML file in rendered ePub files for <book>s even if they do not have section markup Keith Fahlgren: docbook.xsl; bin/spec/epub_realbook_spec.rb; bin/spec/files/orm.book.001.x⋯Adding better support for covers in epub files destined for .mobi and the Kindle Keith Fahlgren: bin/dbtoepub; bin/lib/docbook.rb; bin/spec/files/DejaVuSerif.otf; docbook.⋯Adding primitive support for embedding a single font Keith Fahlgren: bin/dbtoepub; bin/lib/docbook.rb; bin/spec/files/test_cust.xsl; bin/spec/e⋯Adding support for user-specified customization layers in dbtoepub Keith Fahlgren: bin/dbtoepub; bin/spec/epub_regressions_spec.rb; bin/lib/docbook.rb; bin/s⋯Adding CSS support to .epub target & dbtoepub: -c, --css [FILE] Use FILE for CSS on generated XHTML. DocBook::Epub ... - should include a CSS link in HTML files when a CSS file has been provided - should include CSS file in .epub when a CSS file has been provided - should include a CSS link in OPF file when a CSS file has been provided Roundtrip The following changes have been made to the roundtrip code since the 1.74.0 release. Steve Ball: blocks2dbk.xsl; template.xml; template.dotadded support for imagedata-metadata added support for table as images Steve Ball: blocks2dbk.xsl; normalise2sections.xsl; sections2blocks.xslImproved support for personname inlines. Steve Ball: blocks2dbk.xsl; blocks2dbk.dtd; template.xmlAdded support for legalnotice. Steve Ball: blocks2dbk.xsl; wordml2normalise.xsladded support for orgname in author Steve Ball: specifications.xml; supported.xml; blocks2dbk.xsl; wordml2normalise.xsl; dbk2w⋯Updated specification. to-DocBook: add cols attribute to tgroup from-DocBook: fix for blockquote title Params The following changes have been made to the params since the 1.74.0 release. The change was to add man.output.better.ps.enabled parameter, with its default value set to zero. If the value of the man.output.better.ps.enabled parameter is non-zero, certain markup is embedded in each generated man page such that PostScript output from the man -Tps command for that page will include a number of enhancements designed to improve the quality of that output. If man.output.better.ps.enabled is zero (the default), no such markup is embedded in generated man pages, and no enhancements are included in the PostScript output generated from those man pages by the man -Tps command. WARNING: The enhancements provided by this parameter rely on features that are specific to groff (GNU troff) and that are not part of "classic" AT&T troff or any of its derivatives. Therefore, any man pages you generate with this parameter enabled will be readable only on systems on which the groff (GNU troff) program is installed, such as GNU/Linux systems. The pages will not not be readable on systems on with the classic troff (AT&T troff) command is installed. NOTE: The value of this parameter only affects PostScript output generated from the man command. It has no effect on output generated using the FO backend. TIP: You can generate PostScript output for any man page by running the following command: man FOO -Tps > FOO.ps You can then generate PDF output by running the following command: ps2pdf FOO.ps Robert Stayton: writing.mode.xmlwriting mode param used to set text direction. Michael(tm) Smith: email.mailto.enabled.xmlAdded new param email.mailto.enabled for FO output. Patch from Paolo Borelli. Closes #2086321. Jirka Kosek: highlight.source.xml; highlight.xslthl.config.xmlUpgraded to support the latest version of XSLTHL 2.0 -- nested markup in highlited code is now processed -- it is no longer needed to specify path XSLTHL configuration file using Java property -- support for new languages, including Perl, Python and Ruby was added Highlighting The following changes have been made to the highlighting code since the 1.74.0 release. Jirka Kosek: cpp-hl.xml; c-hl.xml; tcl-hl.xml; php-hl.xml; common.xsl; perl-hl.xml; delphi⋯Upgraded to support the latest version of XSLTHL 2.0 -- nested markup in highlited code is now processed -- it is no longer needed to specify path XSLTHL configuration file using Java property -- support for new languages, including Perl, Python and Ruby was added Release Notes: 1.74.0 This release includes important bug fixes and adds the following significant feature changes: .epub target Paul Norton (Adobe) and Keith Fahlgren(O'Reilly Media) have donated code that generates .epub documents from DocBook input. An alpha-reference implementation in Ruby has also been provided. .epub is an open standard of the The International Digital Publishing Forum (IDPF), a the trade and standards association for the digital publishing industry. Read more about this target in epub/README XHTML 1.1 target To support .epub output, a strict XHTML 1.1 target has been added. The stylesheets for this output are generated and are quite similar to the XHTML target. Gentext updates A number of locales have been updated. Roundtrip improvements Table, figure, template syncronization, and character style improvements have been made for WordML & Pages. Support added for OpenOffice.org. First implementation of a libxslt extension A stylesheet extension for libxslt, written in Python, has been added. The extension is a function for adjusting column widths in CALS tables. See extensions/README.LIBXSLT for more information. The following is a list of changes that have been made since the 1.73.2 release. Gentext The following changes have been made to the gentext code since the 1.73.2 release. Michael(tm) Smith: locale/id.xmlChecked in changes to Indonesion locale submitted by Euis Luhuanam a long time ago. Michael(tm) Smith: locale/lt.xmlAdded changes to Lithuanian locate submitted a long time back by Nikolajus Krauklis. Michael(tm) Smith: locale/hu.xmlfixed error in lowercase.alpha definition in Hungarian locale Michael(tm) Smith: locale/nb.xmlCorrected language code for nb locale, and restored missing "startquote" key. Michael(tm) Smith: locale/ja.xmlCommitted changes to ja locale file, from Akagi Kobayashi. Adds bracket quotes around many xref instances that did not have them before. Michael(tm) Smith: Makefile"no" locale is now "nb" Michael(tm) Smith: locale/nb.xmlUpdate Norwegian BokmÃ¥l translation. Thanks to Hans F. Nordhaug. Michael(tm) Smith: locale/no.xml; locale/nb.xmlper message from Hans F. Nordhaug, correct identifier for Norwegian BokmÃ¥l is "nb" (not "no") and has been for quite some time now... Michael(tm) Smith: locale/ja.xmlConverted ja.xml source file to use real unicode characters so that the actual glyphs so up when you edit it in a text editor (instead of the character references). Michael(tm) Smith: locale/ja.xmlChecked in changes to ja.xml locale file. Thanks to Akagi Kobayashi. Michael(tm) Smith: locale/it.xmlChanges from Federico Zenith Dongsheng Song: locale/zh_cn.xmlAdded missing translations. Common The following changes have been made to the common code since the 1.73.2 release. Michael(tm) Smith: l10n.xslAdded new template "l10.language.name" for retrieving the English-language name of the lang setting of the current document. Closes #1916837. Thanks to Simon Kennedy. Michael(tm) Smith: refentry.xslfixed syntax error Michael(tm) Smith: refentry.xslfixed a couple of typos Michael(tm) Smith: refentry.xslrefined handling of cases where refentry "source" or "manual" metadata is missing or when we use fallback content instead. We now report a Warning if we use fallback content. Michael(tm) Smith: refentry.xsldon't use refmiscinfo@class=date value as fallback for refentry "source" or "manual" metadata fields Michael(tm) Smith: refentry.xslMade reporting of missing refentry metadata more quiet: - we no longer report anything if usable-but-not-preferred metadata is found; we just quietly use whatever we manage to find - we now only report missing "source" metadata if the refentry is missing BOTH "source name" and "version" metadata; if it has one but not the other, we use whichever one it has and don't report anything as missing The above changes were made because testing with some "real world" source reveals that some authors are intentionally choosing to use "non preferred" markup for some metadata, and also choosing to omit "source name" or "version" metadata in there DocBook XML. So it does no good to give them pedantic reminders about what they already know... Also, changed code to cause "fixme" text to be inserted in output in particular cases: - if we can't manage to find any "source" metadata at all, we now put fixme text into the output - if we can't manage to find any "manual" metadata a all, we now put fixme text into the output The "source" and "manual" metadata is necessary information, so buy putting the fixme stuff in the output, we alert users to the need problem of it being missing. Michael(tm) Smith: refentry.xslWhen generating manpages output, we no longer report anything if the refentry source is missing date or pubdate content. In practice, many users intentionally omit the date from the source because they explicitly want it to be generated. Michael(tm) Smith: l10n.xmlfurther change needed for switch from no locale to nb. Michael(tm) Smith: common.xslAdded support for orgname in authorgroup. Thanks to Camille Bégnis. Michael(tm) Smith: Makefile"no" locale is now "nb" Mauritz Jeanson: stripns.xslRemoved the template matching "ng:link|db:link" (in order to make @xlink:show work with <link> elements). As far as I can tell, this template is no longer needed. Mauritz Jeanson: entities.entMoved declaration of comment.block.parents entity to common/entities.ent. Mauritz Jeanson: titles.xslAdded an update the fix made in revision 7528 (handling of xref/link in no.anchor.mode mode). Having xref in title is not a problem as long as the target is not an ancestor element. Closes bug #1838136. Note that an xref that is in a title and whose target is an ancestor element is still not rendered in the TOC. This could be considered a bug, but on the other hand I cannot really see the point in having such an xref in a document. Mauritz Jeanson: titles.xslAdded a "not(ancestor::title)" test to work around "too many nested apply-templates" problems when processing xrefs or links in no.anchor.mode mode. Hopefully, this closes bug #1811721. Mauritz Jeanson: titles.xslRemoved old template matching "link" in no.anchor.mode mode. Mauritz Jeanson: titles.xslProcess <link> in no.anchor.mode mode with the same template as <xref>. Closes bug #1759205 (Empty link in no.anchor.mode mode). Mauritz Jeanson: titles.xslIn no.anchor.mode mode, do not output anchors for elements that are descendants of <title>. Previously, having inline elements with @id/@xml:id in <title>s resulted in anchors both in the TOC and in the main flow. Closes bug #1797492. FO The following changes have been made to the fo code since the 1.73.2 release. Mauritz Jeanson: pi.xslUpdated documentation for keep-together. Mauritz Jeanson: task.xslEnabled use of the keep-together PI on task elements. Robert Stayton: index.xslFOP1 requires fo:wrapper for inline index entries, not fo:inline. Robert Stayton: index.xslFixed non-working inline.or.block template for indexterm wrappers. Add fop1 to list of processors using inline.or.block. Mauritz Jeanson: table.xslFixed bug #1891965 (colsep in entytbl not working). Mauritz Jeanson: titlepage.xslAdded support for title in revhistory. Closes bug #1842847. Mauritz Jeanson: pi.xslSmall doc cleanup (dbfo float-type). Mauritz Jeanson: titlepage.xslInsert commas between multiple copyright holders. Mauritz Jeanson: autotoc.xsl; division.xslAdded modifications to support nested set elements. See bug #1853172. David Cramer: glossary.xslAdded normalize-space to xsl:sorts to avoid missorting of glossterms due to stray leading spaces. David Cramer: glossary.xslFixed bug #1854199: glossary.xsl should use the sortas attribute on glossentry Mauritz Jeanson: inline.xslAdded a template for citebiblioid. The hyperlink target is the parent of the referenced biblioid, and the "hot text" is the biblioid itself enclosed in brackets. Mauritz Jeanson: inline.xslMoved declaration of comment.block.parents entity to common/entities.ent. Mauritz Jeanson: docbook.xslUpdated message about unmatched element. Mauritz Jeanson: param.xwebAdded link to profiling chapter of TCG. Mauritz Jeanson: refentry.xslFixed typo (refsynopsysdiv -> refsynopsisdiv). David Cramer: fop.xsl; fop1.xsl; ptc.xsl; xep.xslAdded test to check generate.index param when generating pdf bookmarks Mauritz Jeanson: graphics.xslAdded support for MathML in imagedata. Michael(tm) Smith: math.xslRemoved unnecessary extra test condition in test express that checks for passivetex. Michael(tm) Smith: math.xslDon't use fo:instream-foreign-object if we are processing with passivetex. Closes #1806899. Thanks to Justus Piater. Mauritz Jeanson: component.xslAdded code to output a TOC for an appendix in an article when generate.toc='article/appendix toc'. Closes bug #1669658. Dongsheng Song: biblio-iso690.xslChange encoding from "windows-1250" to "UTF-8". Mauritz Jeanson: pi.xslUpdated documentation for dbfo_label-width. Mauritz Jeanson: lists.xslAdded support for the dbfo_label-width PI in calloutlists. Robert Stayton: biblio.xslSupport finding glossary database entries inside bibliodivs. Robert Stayton: formal.xslComplete support for <?dbfo pgwide="1"?> for informal elements too. Mauritz Jeanson: table.xslIn the table.block template, added a check for the dbfo_keep-together PI, so that a table may break (depending on the PI value) at a page break. This was needed since the outer fo:block that surrounds fo:table has keep-together.within-column="always" by default, which prevents the table from breaking. Closes bug #1740964 (Titled table does not respect dbfo PI). Mauritz Jeanson: pi.xslAdded a few missing @role="tcg". Mauritz Jeanson: inline.xslUse normalize-space() in glossterm comparisons (as in html/inline.xsl). Mauritz Jeanson: autoidx.xslRemoved the [&scope;] predicate from the target variable in the template with name="reference". This filter was the cause of missing index backlinks when @zone and @type were used on indexterms, with index.on.type=1. Closes bug #1680836. Michael(tm) Smith: inline.xsl; xref.xsl; footnote.xslAdded capability in FO output for displaying URLs for all hyperlinks (elements marked up with xlink:href attributes) in the same way as URLs for ulinks are already handled (which is to say, either inline or as numbered footnotes). Background on this change: DocBook 5 allows "ubiquitous" linking, which means you can make any element a hyperlink just by adding an xlink:href attribute to it, with the value set to an external URL. That's in contrast to DocBook 4, which only allows you to use specific elements (e.g., the link and ulink elements) to mark up hyperlinks. The existing FO stylesheets have a mechanism for handling display of URLs for hyperlinks that are marked up with ulink, but they did not handle display of URLs for elements that were marked up with xlink:href attributes. This change adds handling for those other elements, enabling the URLs they link to be displayed either inline or as numbered footnotes (depending on what values the user has the ulink.show and ulink.footnotes params set to). Note that this change only adds URL display support for elements that call the simple.xlink template -- which currently is most (but not all) inline elements. This change also moves the URL display handling out of the ulink template and into a new "hyperlink.url.display" named template; the ulink template and the simple.xlink named template now both call the hyperlink.url.display template. Warning: In the stylesheet code that determines what footnote number to assign to each footnote or external hyperlink, there is an XPath expression for determining whether a particular xlink:href instance is an external hyperlink; that expression is necessarily a bit complicated and further testing may reveal that it doesn't handle all cases as expected -- so some refinements to it may need to be done later. Closes #1785519. Thanks to Ken Morse for reporting and troubleshooting the problem. HTML The following changes have been made to the html code since the 1.73.2 release. Keith Fahlgren: inline.xsl; synop.xslWork to make HTML and XHTML targets more valid Keith Fahlgren: table.xslAdd better handling for tables that have footnotes in the titles Keith Fahlgren: biblio.xslAdd anchors to bibliodivs Keith Fahlgren: formal.xsl; Makefile; htmltbl.xslInitial checkin/merge of epub target from work provided by Paul Norton of Adobe and Keith Fahlgren of O'Reilly. This change includes new code for generating the XHTML 1.1 target sanely. Mauritz Jeanson: biblio.xslAdded code for creating URLs from biblioids with @class="doi" (representing Digital Object Identifiers). See FR #1934434 and http://doi.org. To do: 1) Add support for FO output. 2) Figure out how @class="doi" should be handled for bibliorelation, bibliosource and citebiblioid. Norman Walsh: formal.xslDon't use xsl:copy because it forces the resulting element to be in the same namespace as the source element; in the XHTML stylesheets, that's wrong. But the HTML-to-XHTML converter does the right thing with literal result elements, so use one of them. Michael(tm) Smith: MakefileAdded checks and hacks to various makefiles to enable building under Cygwin. This stuff is ugly and maybe not worth the mess and trouble, but does seem to work as expected and not break anything else. Michael(tm) Smith: docbook.xsladded "exslt" namespace binding to html/docbook.xsl file (in addition to existing "exsl" binding. reason is because lack of it seems to cause processing problems when using the profiled version of the stylsheet Norman Walsh: chunk-common.xslRename link Mauritz Jeanson: table.xslAdded a fix to make rowsep apply to the last row of thead in entrytbl. Michael(tm) Smith: synop.xslSimplified and streamlined handling of output for ANSI-style funcprototype output, to correct a problem that was causing type data to be lost in the output parameter definitions. For example, for an instance like this: <paramdef>void *<parameter>dataptr</parameter>[]</paramdef> ... the brackets (indicating an array type) were being dropped. Michael(tm) Smith: synop.xslChanged HTML handling of K&R-style paramdef output. The parameter definitions are no longer output in a table (though the prototype still is). The reason for the change is that the kr-tabular-funcsynopsis-mode template was causing type data to be lost in the output parameter definitions. For example, for an instance like this: <paramdef>void *<parameter>dataptr</parameter>[]</paramdef> ... the brackets (indicating an array type) were being dropped. The easiest way to deal with the problem is to not try to chop up the parameter definitions and display them in table format, but to instead just output them as-is. May not look quite as pretty, but at least we can be sure no information is being lost... Michael(tm) Smith: pi.xslupdated wording of doc for funcsynopsis-style PI Michael(tm) Smith: param.xweb; param.ent; synop.xslRemoved the funcsynopsis.tabular.threshold param. It's no longer being used in the code and hasn't been since mid 2006. Mauritz Jeanson: graphics.xslAdded support for the img.src.path parameter for SVG graphics. Closes bug #1888169. Mauritz Jeanson: chunk-common.xslAdded missing space. Norman Walsh: component.xslFix bug where component titles inside info elements were not handled properly Michael(tm) Smith: pi.xslMoved dbhtml_stop-chunking embedded doc into alphabetical order, fixed text of TCG section it see-also'ed. David Cramer: pi.xslAdded support for <?dbhtml stop-chunking?> processing instruction David Cramer: chunk-common.xsl; pi.xslAdded support for <?dbhtml stop-chunking?> processing instruction David Cramer: glossary.xslFixed bug #1854199: glossary.xsl should use the sortas attribute on glossentry. Also added normalize-space to avoid missorting due to stray leading spaces. Mauritz Jeanson: inline.xslAdded a template for citebiblioid. The hyperlink target is the parent of the referenced biblioid, and the "hot text" is the biblioid itself enclosed in brackets. Mauritz Jeanson: inline.xslAdded support for @xlink:show in the simple.xlink template. The "new" and "replace" values are supported (corresponding to values of "_blank" and "_top" for the ulink.target parameter). I have assumed that @xlink:show should override ulink.target for external URI links. This closes bugs #1762023 and #1727498. Mauritz Jeanson: inline.xslMoved declaration of comment.block.parents entity to common/entities.ent. Mauritz Jeanson: param.xwebAdded link to profiling chapter of TCG. Dongsheng Song: biblio-iso690.xslChange encoding from "windows-1250" to "UTF-8". Robert Stayton: biblio.xslAdd support in biblio collection to entries in bibliodivs. Mauritz Jeanson: pi.xslAdded missing @role="tcg". Mauritz Jeanson: chunk-common.xsl; titlepage.xslRefactored legalnotice/revhistory chunking, so that the use.id.as.filename parameter as well as the dbhtml_filename PI are taken into account. A new named template in titlepage.xsl is used to compute the filename. Mauritz Jeanson: chunk-common.xsl; titlepage.xslAn update to the fix for bug #1790495 (r7433): The "ln-" prefix is output only when the legalnotice doesn't have an @id/@xml:id, in which case the stylesheets generate an ID value, resulting in a filename like "ln-7e0fwgj.html". This is useful because without the prefix, you wouldn't know that the file contained a legalnotice. The same logic is also applied to revhistory, using an "rh-" prefix. Mauritz Jeanson: autoidx.xslRemoved the [&scope;] predicate from the target variable in the template with name="reference". This filter was the cause of missing index backlinks when @zone and @type were used on indexterms, with index.on.type=1. Closes bug #1680836. Mauritz Jeanson: titlepage.xslAdded 'ln-' prefix to the name of the legalnotice chunk, in order to match the <link href"..."> that is output by make.legalnotice.head.links (chunk-common.xsl). Modified the href attribute on the legalnotice link. Closes bug #1790495. Manpages The following changes have been made to the manpages code since the 1.73.2 release. Michael(tm) Smith: other.xslslightly adjusted spacing around admonition markers Michael(tm) Smith: refentry.xsl; utility.xslmake sure refsect3 titles are preceded by a line of space, and make the indenting of their child content less severe Michael(tm) Smith: block.xslonly indent verbatim environments in TTY output, not in non-TTY/PS Michael(tm) Smith: block.xslmade another adjustment to correct vertical alignment of admonition marker Michael(tm) Smith: block.xsl; other.xslAdjusted/corrected alignment of adominition marker in PS/non-TTY output. Michael(tm) Smith: endnotes.xslFor PS/non-TTY output, display footnote/endnote numbers in superscript. Michael(tm) Smith: table.xsl; synop.xsl; utility.xslChanged handling of hanging indents for cmdsynopsis, funcsynopsis, and synopfragment such that they now look correct in non-TTY/PS output. We now use the groff \w escape to hang by the actual width -- in the current font -- of the command, funcdef, or synopfragment references number (as opposed to hanging by the number of characters). This rendering in TTY output remains the same, since the width in monospaced TTY output is the same as the number of characters. Also, created new synopsis-block-start and synopsis-block-end templates to use for cmdsynopsis and funcsynopsis instead of the corresponding verbatim-* templates. Along with those changes, also corrected a problem that caused the content of synopfragment to be dropped, and made a vertical-spacing change to adjust spacing around table titles and among sibling synopfragment instances. Michael(tm) Smith: other.xsluse common l10.language.name template to retrieve English-language name Michael(tm) Smith: synop.xsl; inline.xsladded comment in code explaining why we don't put filename output in italic (despite the fact that man guidelines say we should) Michael(tm) Smith: inline.xslput filename output in monospace instead of italic Michael(tm) Smith: synop.xslput cmdsynopsis in monospace Michael(tm) Smith: inline.xslremoved template match for literal. template matches for monospace inlines are all imported from the HTML stylesheet Michael(tm) Smith: block.xsldon't indent verbatim environments that are descendants of refsynopsisdiv, not put backgrounds behind them Michael(tm) Smith: inline.xslset output of the literal element in monospace. this causes all inline monospace instances in the git man pages to be set in monospace (since DocBook XML source for git docs is generated with asciidoc and asciidoc consistently outputs only <literal> for inline monospace (not <command> or <code> or anything else). Of course this only affects non-TTY output... Michael(tm) Smith: utility.xslAdded inline.monoseq named template. Michael(tm) Smith: utility.xsldon't bother using a custom register to store the previous font-family value when setting blocks of text in code font; just use \F[] .fam with no arg to switch back Michael(tm) Smith: endnotes.xslput links in blue in PS output (note that this matches how groff renders content marked up with the .URL macro) Michael(tm) Smith: endnotes.xsl; param.xweb; param.entremoved man.links.are.underlined and added man.font.links. Also, changed the default font formatting for links to bold. Michael(tm) Smith: endnotes.xsl; param.xweb; param.entAdded new param man.base.url.for.relative.links .. specifies a base URL for relative links (for ulink, @xlink:href, imagedata, audiodata, videodata) shown in the generated NOTES section of man-page output. The value of man.base.url.for.relative.links is prepended to any relative URI that is a value of ulink url, xlink:href, or fileref attribute. If you use relative URIs in link sources in your DocBook refentry source, and you leave man.base.url.for.relative.links unset, the relative links will appear "as is" in the NOTES section of any man-page output generated from your source. That's probably not what you want, because such relative links are only usable in the context of HTML output. So, to make the links meaningful and usable in the context of man-page output, set a value for man.base.url.for.relative.links that points to the online version of HTML output generated from your DocBook refentry source. For example: <xsl:param name="man.base.url.for.relative.links" >http://www.kernel.org/pub/software/scm/git/docs/</xsl:param> Michael(tm) Smith: info.xslIf a source refentry contains a Documentation or DOCUMENTATION section, don't report it as having missing AUTHOR information. Also, if missing a contrib/personblurb for a person or org, report pointers to http://docbook.sf.net/el/personblurb and to http://docbook.sf.net/el/contrib Michael(tm) Smith: info.xslIf we encounter an author|editor|othercredit instance that lacks a personblurb or contrib, report it to the user (because that means we have no information about that author|editor|othercredit to display in the generated AUTHOR|AUTHORS section...) Michael(tm) Smith: info.xsl; docbook.xsl; other.xslif we can't find any usable author data, emit a warning and insert a fixme in the output Michael(tm) Smith: info.xslfixed bug in indenting of output for contrib instances in AUTHORS section. Thanks to Daniel Leidert and the fglrx docs for exposing the bug. Michael(tm) Smith: block.xslfor a para or simpara that is the first child of a callout, suppress the .sp or .PP that would normally be output (because in those cases, the output goes into a table cell, and the .sp or .PP markup causes a spurious linebreak before it when displayed Michael(tm) Smith: lists.xslAdded support for rendering co callouts and calloutlist instances. So you can now use simple callouts -- marking up programlisting and such with co instances -- and have the callouts displayed in man-page output. ("simple callouts" means using co@id and callout@arearefs pointing to co@id instances; in man/roff output, we can't/don't support markup that uses areaset and area) Michael(tm) Smith: block.xslonly put a line of space after a verbatim if it's followed by a text node or a paragraph Michael(tm) Smith: utility.xslput verbatim environments in slightly smaller font in non-TTY output Michael(tm) Smith: lists.xslminor whitespace-only reformatting of lists.xsl source Michael(tm) Smith: lists.xslMade refinements/fixes to output of orderedlist and itemizedlist -- in part, to get mysql man pages to display correctly. This change causes a "\c" continuation marker to be added between listitem markers and contents (to ensure that the content remains on the same line as the marker when displayed) Michael(tm) Smith: block.xslput a line of vertical space after all verbatim output that has sibling content following it (not just if that sibling content is a text node) Michael(tm) Smith: block.xslrefined spacing around titles for admonitions Michael(tm) Smith: block.xsl; other.xslDeal with case of verbatim environments that have a linebreak after the opening tag. Assumption is that users generally don't want that linebreak to appear in output, so we do some groff hackery to mess with vertical spacing and close the space. Michael(tm) Smith: inline.xslindexterm instances now produce groff comments like this: .\" primary: secondary: tertiary remark instances, if non-empty, now produce groff comments Michael(tm) Smith: charmap.groff.xsl; other.xslconvert no-break space character to groff "\ \&" (instead of just "\ "). the reason is that if a space occurs at the end of a line, our processing causes it to be eaten. a real-world case of this is the mysql(1) man page. appending the "\&" prevents that Michael(tm) Smith: block.xsloutput "sp" before simpara output, not after it (outputting it after results in undesirable whitespace in particular cases; for example, in the hg/mercurial docs Michael(tm) Smith: table.xsl; synop.xsl; utility.xslrenamed from title-preamble to pinch.together and replaced "sp -1" between synopsis fragments with call to pinch.together instead Michael(tm) Smith: table.xsluse title-preamble template for table titles (instead of "sp -1" hack), and "sp 1" after all tables (instead of just "sp" Michael(tm) Smith: utility.xslcreated title-preamble template for suppressing line spacing after headings Michael(tm) Smith: info.xslfurther refinement of indenting in AUTHORS section Michael(tm) Smith: block.xsl; other.xslrefined handling of admonitions Michael(tm) Smith: lists.xslUse RS/RE in another place where we had IP "" Michael(tm) Smith: info.xslReplace (ab)use of IP with "sp -1" in AUTHORS section with RS/RE instead. Michael(tm) Smith: table.xsl; synop.xsl; info.xslchanged all instances of ".sp -1n" to ".sp -1" Michael(tm) Smith: other.xsladd extra line before SH heads only in non-TTY output Michael(tm) Smith: block.xslReworked output for admonitions (caution, important, note, tip, warning). In TTY output, admonitions now get indented. In non-TTY output, a colored marker (yellow) is displayed next to them. Michael(tm) Smith: other.xslAdded BM/EM macros for putting a colored marker in margin next to a block of text. Michael(tm) Smith: utility.xslcreated make.bold.title template by moving title-bolding part out from nested-section-title template. This allows the bolding to also be used by the template for formatting admonitions Michael(tm) Smith: info.xslput .br before copyright contents to prevent them from getting run in Michael(tm) Smith: refentry.xsl; other.xsl; utility.xslmade point size of output for Refsect2 and Refsect3 heads bigger Michael(tm) Smith: other.xslput slightly more space between SH head and underline in non-TTY output Michael(tm) Smith: param.xweb; param.ent; other.xslAdded the man.charmap.subset.profile.english parameter and refined the handling of charmap subsets to differentiate between English and non-English source. This way charmap subsets are now handled is this: If the value of the man.charmap.use.subset parameter is non-zero, and your DocBook source is not written in English (that is, if its lang or xml:lang attribute has a value other than en), then the character-map subset specified by the man.charmap.subset.profile parameter is used instead of the full roff character map. Otherwise, if the lang or xml:lang attribute on the root element in your DocBook source or on the first refentry element in your source has the value en or if it has no lang or xml:lang attribute, then the character-map subset specified by the man.charmap.subset.profile.english parameter is used instead of man.charmap.subset.profile. The difference between the two subsets is that man.charmap.subset.profile provides mappings for characters in Western European languages that are not part of the Roman (English) alphabet (ASCII character set). Michael(tm) Smith: other.xslVarious updates, mainly related to uppercasing SH titles: - added a "Language: " metadata line to the top comment area of output man pages, to indicate the language the page is in - added a "toupper" macro of doing locale-aware uppercasing of SH titles and cross-references to SH titles; the mechanism relies on the uppercase.alpha and lowercase.alpha DocBook gentext keys to do locale-aware uppercasing based on the language the page is written in - added a "string.shuffle" template, which provides a library function for "shuffling" two strings together into a single string; it takes the first character for the first string, the first character from second string, etc. The only current use for it is to generate the argument for the groff tr request that does string uppercasing. - added make.tr.uppercase.arg and make.tr.normalcase.arg named templates for use in generating groff code for uppercasing and "normal"-casing SH titles - made the BB/BE "background drawing" macros have effect only in non-TTY output - output a few comments in the top part of source Michael(tm) Smith: utility.xslremoved some leftover kruft Michael(tm) Smith: refentry.xslTo create the name(s) for each man page, we now replace any spaces in the refname(s) with underscores. This ensures that tools like lexgrog(1) will be able to parse the name (lexgrog won't parse names that contain spaces). Michael(tm) Smith: docbook.xslPut a comment into source of man page to indicate where the main content starts. (We now have a few of macro definitions at the start of the source, so putting this comment in helps those that might be viewing the source.) Michael(tm) Smith: refentry.xslrefined mechanism for generating SH titles Michael(tm) Smith: charmap.groff.xslAdded zcaron, Zcaron, scaron, and Scaron to the groff character map. This means that generated Finnish man pages will no longer contain any raw accented characters -- they'll instead by marked up with groff escapes. Michael(tm) Smith: other.xsl; utility.xslcorrected a regression I introduced about a year ago that caused dots to be output just as "\." -- instead needs to be "\&." (which is what it will be now, after this change) Michael(tm) Smith: refentry.xslChanged backend handling for generating titles for SH sections and for cross-references to those sections. This should have no effect on TTY output (behavior should remain the same hopefully) but results in titles in normal case (instead of uppercase) in PS output. Michael(tm) Smith: info.xsluse make.subheading template to make subheadings for AUTHORS and COPYRIGHT sections (instead of harcoding roff markup) Michael(tm) Smith: block.xslput code font around programlisting etc. Michael(tm) Smith: synop.xsl; docbook.xslembed custom macro definitions in man pages, plus wrap synopsis in code font Michael(tm) Smith: endnotes.xsluse the make.subheading template to generated SH subheading for endnotes section. Michael(tm) Smith: lists.xslAdded some templates for generating if-then-else conditional markup in groff, so let's use those instead of hard-coding it in multiple places... Michael(tm) Smith: other.xsl; utility.xslInitial checkin of some changes related to making PS/PDF output from "man -l -Tps" look better. The current changes: - render synopsis and verbatim sections in a monospace/code font - put a light-grey background behind all programlisting, screen, and literallayout instances - prevent SH heads in PS output from being rendered in uppercase (as they are in console output) - also display xrefs to SH heads in PS output in normal case (instead of uppercase) - draw a line under SH heads in PS output The changes made to the code to support the above features were: - added some embedded/custom macros: one for conditionally upper-casing SH x-refs, one for redefining the SH macro itself, with some conditional handling for PS output, and finally a macro for putting a background/screen (filled box) around a block of text (e.g., a program listing) in PS output - added utility templates for wrapping blocks of text in code font; also templates for inline code font Robert Stayton: refentry.xslrefpurpose nodes now get apply-templates instead of just normalize-space(). Michael(tm) Smith: lists.xslFixed alignment of first lined of text for each listitem in orderedlist output for TTY. Existing code seemed to have been causing an extra undesirable space to appear. Michael(tm) Smith: lists.xslWrapped some roff conditionals around roff markup for orderedlist and itemizedlist output, so that the lists look acceptable in PS output as well as TTY. Michael(tm) Smith: pi.xsl; synop.xsl; param.xweb; param.entAdded the man.funcsynopsis.style parameter. Has the same effect in manpages output as the funcsynopsis.style parameter has in HTML output -- except that its default value is 'ansi' instead of 'kr'. Michael(tm) Smith: synop.xslReworked handling of K&R funcprototype output. It no longer relies on the HTML kr-tabular templates, but instead just does direct transformation to roff. For K&R output, it displays the paramdef output in an indented list following the prototype. Michael(tm) Smith: synop.xslProperly integrated handling for K&R output into manpages stylesheet. The choice between K&R output and ANSI output is currently controlled through use of the (HTML) funcsynopsis.style parameter. Note that because the mechanism does currently rely on funcsynopsis.style, the default in manpages output is now K&R (because that's the default of that param). But I suppose I ought to create a man.funcsynopsis.style and make the default for that ANSI (to preserve the existing default behavior). Michael(tm) Smith: docbook.xsladded manpages/pi.xsl file Michael(tm) Smith: .cvsignore; pi.xslAdded "dbman funcsynopsis-style" PI and incorporated it into the doc build. Michael(tm) Smith: refentry.xslFixed regression that caused an unescaped dash to be output between refname and refpurpose content. Closes bug #1894244. Thanks to Daniel Leidert. Michael(tm) Smith: other.xslFixed problem with dots being escaped in filenames of generated man files. Closes #1827195. Thanks to Daniel Leidert. Michael(tm) Smith: inline.xslAdded support for processing structfield (was appearing in roff output surrounded by HTML <em> tags; fixed so that it gets roff ital markup). Closes bug #1858329. Thanks to Sam Varshavchik. Epub The following changes have been made to the epub code since the 1.73.2 release. Keith Fahlgren: bin/spec/README; bin/spec/epub_realbook_spec.rb'Realbook' spec now passes Keith Fahlgren: bin/dbtoepub; README; bin/spec/README; bin/lib/docbook.rb; bin/spec/epub_r⋯Very primitive Windows support for dbtoepub reference implementation; README for running tests and for the .epub target in general; shorter realbook test document (still fails for now) Keith Fahlgren: bin/dbtoepub; bin/spec/epub_regressions_spec.rb; bin/lib/docbook.rb; bin/s⋯Changes to OPF spine to not duplicate idrefs for documents with parts not at the root; regression specs for same Keith Fahlgren: docbook.xslFixing linking to cover @id, distinct from other needs of cover-image-id (again, thanks to Martin Goerner) Keith Fahlgren: docbook.xslUpdating the title of the toc element in the guide to be more explicit (thanks to Martin Goerner) Keith Fahlgren: bin/spec/examples/amasque_exploded/content.opf; bin/spec/examples/amasque_⋯Initial checkin/merge of epub target from work provided by Paul Norton of Adobe and Keith Fahlgren of O'Reilly. Keith Fahlgren: docbook.xsl== General epub test support $ spec -O ~/.spec.opts spec/epub_spec.rb DocBook::Epub - should be able to be created - should fail on a nonexistent file - should be able to render to a file - should create a file after rendering - should have the correct mimetype after rendering - should be valid .epub after rendering an article - should be valid .epub after rendering an article without sections - should be valid .epub after rendering a book - should be valid .epub after rendering a book even if it has one graphic - should be valid .epub after rendering a book even if it has many graphics - should be valid .epub after rendering a book even if it has many duplicated graphics - should report an empty file as invalid - should confirm that a valid .epub file is valid - should not include PDFs in rendered epub files as valid image inclusions - should include a TOC link in rendered epub files for <book>s Finished in 20.608395 seconds 15 examples, 0 failures == Verbose epub test coverage against _all_ of the testdocs Fails on only (errors truncated): 1) 'DocBook::Epub should be able to render a valid .epub for the test document /Users/keith/work/docbook-dev/trunk/xsl/epub/bin/spec/testdocs/calloutlist.003.xml [30]' FAILED 'DocBook::Epub should be able to render a valid .epub for the test document /Users/keith/work/docbook-dev/trunk/xsl/epub/bin/spec/testdocs/cmdsynopsis.001.xml [35]' FAILED .... Finished in 629.89194 seconds 224 examples, 15 failures 224 examples, 15 failures yields 6% failure rate HTMLHelp The following changes have been made to the htmlhelp code since the 1.73.2 release. Mauritz Jeanson: htmlhelp-common.xslAdded <xsl:with-param name="quiet" select="$chunk.quietly"/> to calls to the write.chunk, write.chunk.with.doctype, and write.text.chunk templates. This makes chunk.quietly=1 suppress chunk filename messages also for help support files (which seems to be what one would expect). See bug #1648360. Eclipse The following changes have been made to the eclipse code since the 1.73.2 release. David Cramer: eclipse.xslUse sortas attributes (if they exist) when sorting indexterms David Cramer: eclipse.xslAdded support for indexterm/see in eclipse index.xml Mauritz Jeanson: eclipse.xslAdded <xsl:with-param name="quiet" select="$chunk.quietly"/> to helpidx template. David Cramer: eclipse.xslGenerate index.xml file and add related goo to plugin.xml file. Does not yet support see and seealso. Mauritz Jeanson: eclipse.xslAdded <xsl:with-param name="quiet" select="$chunk.quietly"/> to calls to the write.chunk, write.chunk.with.doctype, and write.text.chunk templates. This makes chunk.quietly=1 suppress chunk filename messages also for help support files (which seems to be what one would expect). See bug #1648360. JavaHelp The following changes have been made to the javahelp code since the 1.73.2 release. Mauritz Jeanson: javahelp.xslAdded <xsl:with-param name="quiet" select="$chunk.quietly"/> to calls to the write.chunk, write.chunk.with.doctype, and write.text.chunk templates. This makes chunk.quietly=1 suppress chunk filename messages also for help support files (which seems to be what one would expect). See bug #1648360. Roundtrip The following changes have been made to the roundtrip code since the 1.73.2 release. Steve Ball: blocks2dbk.xsl; wordml2normalise.xslfix table/cell borders for wordml, fix formal figure, add emphasis-strong Mauritz Jeanson: supported.xmlChanged @cols to 5. Steve Ball: blocks2dbk.xsl; blocks2dbk.dtd; template.xmladded pubdate, fixed metadata handling in biblioentry Steve Ball: supported.xmlAdded support for edition. Steve Ball: docbook-pages.xsl; wordml-blocks.xsl; docbook.xsl; wordml.xsl; pages-normalise⋯Removed stylesheets for old, deprecated conversion method. Steve Ball: specifications.xml; dbk2ooo.xsl; blocks2dbk.xsl; dbk2pages.xsl; blocks2dbk.dtd⋯Added support for Open Office, added edition element, improved list and table support in Word and Pages Steve Ball: normalise-common.xsl; blocks2dbk.xsl; dbk2pages.xsl; template-pages.xml; templ⋯Fixed bug in WordML table handling, improved table handling for Pages 08, synchronised WordML and Pages templates. Steve Ball: normalise-common.xsl; blocks2dbk.xsl; wordml2normalise.xsl; dbk2wp.xslfix caption, attributes Steve Ball: specifications.xml; blocks2dbk.xsl; wordml2normalise.xsl; blocks2dbk.dtd; temp⋯Fixes to table and list handling Steve Ball: blocks2dbk.xsladded support for explicit emphasis character styles Steve Ball: wordml2normalise.xsladded support for customisation in image handling Steve Ball: blocks2dbk.xslAdded inlinemediaobject support for metadata. Steve Ball: normalise-common.xsl; blocks2dbk.xsl; template.xml; dbk2wordml.xsl; dbk2wp.xslAdded support file. Added style locking. Conversion bug fixes. Slides The following changes have been made to the slides code since the 1.73.2 release. Michael(tm) Smith: fo/Makefile; html/MakefileAdded checks and hacks to various makefiles to enable building under Cygwin. This stuff is ugly and maybe not worth the mess and trouble, but does seem to work as expected and not break anything else. Jirka Kosek: html/plain.xslAdded support for showing foil number Website The following changes have been made to the website code since the 1.73.2 release. Michael(tm) Smith: extensions/saxon64/.classes/.gitignore; extensions/xalan2/.classes/com/⋯renamed a bunch more .cvsignore files to .gitignore (to facilitate use of git-svn) Params The following changes have been made to the params code since the 1.73.2 release. Keith Fahlgren: epub.autolabel.xmlNew parameter for epub, epub.autolabel Mauritz Jeanson: table.frame.border.color.xml; table.cell.padding.xml; table.cell.border.t⋯Added missing refpurposes and descriptions. Keith Fahlgren: ade.extensions.xmlExtensions to support Adobe Digital Editions extensions in .epub output. Mauritz Jeanson: fop.extensions.xml; fop1.extensions.xmlClarified that fop1.extensions is for FOP 0.90 and later. Version 1 is not here yet... Michael(tm) Smith: man.links.are.underlined.xml; man.endnotes.list.enabled.xml; man.font.l⋯removed man.links.are.underlined and added man.font.links. Also, changed the default font formatting for links to bold. Michael(tm) Smith: man.base.url.for.relative.links.xmlAdded new param man.base.url.for.relative.links .. specifies a base URL for relative links (for ulink, @xlink:href, imagedata, audiodata, videodata) shown in the generated NOTES section of man-page output. The value of man.base.url.for.relative.links is prepended to any relative URI that is a value of ulink url, xlink:href, or fileref attribute. If you use relative URIs in link sources in your DocBook refentry source, and you leave man.base.url.for.relative.links unset, the relative links will appear "as is" in the NOTES section of any man-page output generated from your source. That's probably not what you want, because such relative links are only usable in the context of HTML output. So, to make the links meaningful and usable in the context of man-page output, set a value for man.base.url.for.relative.links that points to the online version of HTML output generated from your DocBook refentry source. For example: <xsl:param name="man.base.url.for.relative.links" >http://www.kernel.org/pub/software/scm/git/docs/</xsl:param> Michael(tm) Smith: man.string.subst.map.xmlsqueeze .sp\n.sp into a single .sp (to prevent a extra, spurious line of whitespace from being inserted after programlisting etc. in certain cases) Michael(tm) Smith: refentry.manual.fallback.profile.xml; refentry.source.fallback.profile.⋯don't use refmiscinfo@class=date value as fallback for refentry "source" or "manual" metadata fields Michael(tm) Smith: man.charmap.subset.profile.xml; man.charmap.enabled.xml; man.charmap.su⋯made some further doc tweaks related to the man.charmap.subset.profile.english param Michael(tm) Smith: man.charmap.subset.profile.xml; man.charmap.enabled.xml; man.charmap.su⋯Added the man.charmap.subset.profile.english parameter and refined the handling of charmap subsets to differentiate between English and non-English source. This way charmap subsets are now handled is this: If the value of the man.charmap.use.subset parameter is non-zero, and your DocBook source is not written in English (that is, if its lang or xml:lang attribute has a value other than en), then the character-map subset specified by the man.charmap.subset.profile parameter is used instead of the full roff character map. Otherwise, if the lang or xml:lang attribute on the root element in your DocBook source or on the first refentry element in your source has the value en or if it has no lang or xml:lang attribute, then the character-map subset specified by the man.charmap.subset.profile.english parameter is used instead of man.charmap.subset.profile. The difference between the two subsets is that man.charmap.subset.profile provides mappings for characters in Western European languages that are not part of the Roman (English) alphabet (ASCII character set). Michael(tm) Smith: man.charmap.subset.profile.xmlAdded to default charmap used by manpages: - the "letters" part of the 'C1 Controls And Latin-1 Supplement (Latin-1 Supplement)' Unicode block - Latin Extended-A block (but not all of the characters from that block have mappings in groff, so some of them are still passed through as-is) The effects of this change are that in man pages generated for most Western European languages and for Finnish, all characters not part of the Roman alphabet are (e.g., "accented" characters) are converted to groff escapes. Previously, by default we passed through those characters as is (and users needed to use the full charmap if they wanted to have those characters converted). As a result of this change, man pages generated for Western European languages will be viewable in some environments in which they are not viewable if the "raw" non-Roman characters are in them. Mauritz Jeanson: generate.legalnotice.link.xml; generate.revhistory.link.xmlAdded information on how the filename is computed. Mauritz Jeanson: default.table.width.xmlClarified PI usage. Michael(tm) Smith: man.funcsynopsis.style.xmlAdded the man.funcsynopsis.style parameter. Has the same effect in manpages output as the funcsynopsis.style parameter has in HTML output -- except that its default value is 'ansi' instead of 'kr'. Michael(tm) Smith: funcsynopsis.tabular.threshold.xmlRemoved the funcsynopsis.tabular.threshold param. It's no longer being used in the code and hasn't been since mid 2006. Mauritz Jeanson: table.properties.xmlSet keep-together.within-column to "auto". This seems to be the most sensible default value for tables. Mauritz Jeanson: informal.object.properties.xml; admon.graphics.extension.xml; informalequ⋯Several small documentation fixes. Mauritz Jeanson: manifest.in.base.dir.xmlWording fixes. Mauritz Jeanson: header.content.properties.xml; footer.content.properties.xmlAdded refpurpose. Mauritz Jeanson: ulink.footnotes.xml; ulink.show.xmlUpdated for DocBook 5. Mauritz Jeanson: index.method.xml; glossterm.auto.link.xmlSpelling and wording fixes. Mauritz Jeanson: callout.graphics.extension.xmlClarifed available graphics formats and extensions. Mauritz Jeanson: footnote.sep.leader.properties.xmlCorrected refpurpose. Jirka Kosek: footnote.properties.xmlAdded more properties which make it possible to render correctly footnotes placed inside verbatim elements. Mauritz Jeanson: img.src.path.xmlimg.src.path works with inlinegraphic too. Mauritz Jeanson: saxon.character.representation.xmlAdded TCG link. Mauritz Jeanson: img.src.path.xmlUpdated description of img.src.path. Bug #1785224 revealed that there was a risk of misunderstanding how it works. Profiling The following changes have been made to the profiling code since the 1.73.2 release. Jirka Kosek: xsl2profile.xslAdded new rules to profile all content generated by HTML Help (including alias files) Robert Stayton: profile-mode.xsluse mode="profile" instead of xsl:copy-of for attributes so they can be more easily customized. Tools The following changes have been made to the tools code since the 1.73.2 release. Michael(tm) Smith: make/Makefile.DocBookvarious changes and additions to support making with asciidoc as an input format Michael(tm) Smith: make/Makefile.DocBookmake dblatex the default PDF maker for the example makefile Michael(tm) Smith: xsl/build/html2roff.xslReworked handling of K&R funcprototype output. It no longer relies on the HTML kr-tabular templates, but instead just does direct transformation to roff. For K&R output, it displays the paramdef output in an indented list following the prototype. Mauritz Jeanson: xsl/build/make-xsl-params.xslMade attribute-sets members of the param list. This enables links to attribute-sets in the reference documentation. Michael(tm) Smith: xsl/build/html2roff.xsluse .BI handling in K&R funsynopsis output for manpages, just as we do already of ANSI output Michael(tm) Smith: xsl/build/html2roff.xslImplemented initial support for handling tabular K&R output of funcprototype in manpages output. Accomplished by adding more templates to the intermediate HTML-to-roff stylesheet that the build uses to create the manpages/html-synop.xsl stylesheet. Michael(tm) Smith: xsl/build/doc-link-docbook.xslMade the xsl/tools/xsl/build/doc-link-docbook.xsl stylesheet import profile-docbook.xsl, so that we can do profiling of release notes. Corrected some problems in the target for the release-notes HTML build. Extensions The following changes have been made to the extensions code since the 1.73.2 release. Keith Fahlgren: MakefileUse DOCBOOK_SVN variable everywhere, please; build with PDF_MAKER Michael(tm) Smith: Makefilemoved extensions build targets from master xsl/Makefile to xsl/extensions/Makefile Michael(tm) Smith: .cvsignorere-adding empty extensions subdir XSL-Saxon The following changes have been made to the xsl-saxon code since the 1.73.2 release. Michael(tm) Smith: VERSIONbring xsl2, xsl-saxon, and xsl-xalan VERSION files up-to-date with recent change to snapshot build infrastructure Michael(tm) Smith: nbproject/build-impl.xml; nbproject/project.propertiesChanged hard-coded file references in "clean" target to variable references. Closes #1792043. Thanks to Daniel Leidert. Michael(tm) Smith: VERSION; MakefileDid post-release wrap-up of xsl-saxon and xsl-xalan dirs Michael(tm) Smith: nbproject/build-impl.xml; VERSION; Makefile; testMore tweaks to get release-ready XSL-Xalan The following changes have been made to the xsl-xalan code since the 1.73.2 release. Michael(tm) Smith: VERSIONbring xsl2, xsl-saxon, and xsl-xalan VERSION files up-to-date with recent change to snapshot build infrastructure Michael(tm) Smith: nbproject/build-impl.xmlChanged hard-coded file references in "clean" target to variable references. Closes #1792043. Thanks to Daniel Leidert. Michael(tm) Smith: Makefile; VERSIONDid post-release wrap-up of xsl-saxon and xsl-xalan dirs Michael(tm) Smith: Makefile; nbproject/build-impl.xml; VERSIONMore tweaks to get release-ready XSL-libxslt The following changes have been made to the xsl-libxslt code since the 1.73.2 release. Mauritz Jeanson: python/xslt.pyPrint the result to stdout if no outfile has been given. Some unnecessary semicolons removed. Mauritz Jeanson: python/xslt.pyAdded a function that quotes parameter values (to ensure that they are interpreted as strings). Replaced deprecated functions from the string module with string methods. Michael(tm) Smith: python/README; python/README.LIBXSLTrenamed xsl-libxslt/python/README to xsl-libxslt/python/README.LIBXSLT Mauritz Jeanson: python/READMETweaked the text a little. Release Notes: 1.73.2 This is solely a minor bug-fix update to the 1.73.1 release. It fixes a packaging error in the 1.73.1 package, as well as a bug in footnote handling in FO output. Release: 1.73.1 This is mostly a bug-fix update to the 1.73.0 release. Gentext The following changes have been made to the gentext code since the 1.73.0 release. Mauritz Jeanson: locale/de.xmlApplied patch #1766009. Michael(tm) Smith: locale/lv.xmlAdded localization for ProductionSet. FO The following changes have been made to the fo code since the 1.73.0 release. Mauritz Jeanson: table.xslModified the tgroup template so that, for tables with multiple tgroups, a width attribute is output on all corresponding fo:tables. Previously, there was a test prohibiting this (and a comment saying that outputting more than one width attribute will cause an error). But this seems to be no longer relevant; it is not a problem with FOP 0.93 or XEP 4.10. Closes bug #1760559. Mauritz Jeanson: graphics.xslReplaced useless <a> elements with warning messages (textinsert extension). Mauritz Jeanson: admon.xslEnabled generation of ids (on fo:wrapper) for indexterms in admonition titles, so that page references in the index can be created. Closes bug #1775086. HTML The following changes have been made to the html code since the 1.73.0 release. Mauritz Jeanson: titlepage.xslAdded <xsl:call-template name="process.footnotes"/> to abstract template so that footnotes in info/abstract are processed. Closes bug #1760907. Michael(tm) Smith: pi.xsl; synop.xslChanged handling of HTML output for the cmdsynopsis and funcsynopsis elements, such that a@id instances are generated for them if they are descendants of any element containing a dbcmdlist or dbfunclist PI. Also, update the embedded reference docs for the dbcmdlist and dbfunclist PIs to make it clear that they can be used within any element for which cmdsynopsis or funcsynopsis are valid children. Michael(tm) Smith: formal.xslReverted the part of revision 6952 that caused a@id anchors to be generated for output of informal objects. Thanks to Sam Steingold for reporting. Robert Stayton: glossary.xslAccount for a glossary with no glossdiv or glossentry children. Mauritz Jeanson: titlepage.xslModified legalnotice template so that the base.name parameter is calculated in the same way as for revhistory chunks. Using <xsl:apply-templates mode="chunk-filename" select="."/> did not work for single-page output since the template with that mode is in chunk-code.xsl. Mauritz Jeanson: graphics.xslUpdated support for SVG (must be a child of imagedata in DB 5). Added support for MathML in imagedata. Mauritz Jeanson: pi.xslAdded documentation for the dbhh PI (used for context-sensitive HTML Help). (The two templates matching 'dbhh' are still in htmlhelp-common.xsl). Manpages The following changes have been made to the manpages code since the 1.73.0 release. Michael(tm) Smith: endnotes.xslIn manpages output, generate warnings about notesources with non-para children only if the notesource is a footnote or annotation. Thanks to Sam Steingold for reporting problems with the existing handling. HTMLHelp The following changes have been made to the htmlhelp code since the 1.73.0 release. Michael(tm) Smith: htmlhelp-common.xslAdded single-pass namespace-stripping support to the htmlhelp, eclipse, and javahelp stylesheets. Eclipse The following changes have been made to the eclipse code since the 1.73.0 release. Michael(tm) Smith: eclipse.xslAdded single-pass namespace-stripping support to the htmlhelp, eclipse, and javahelp stylesheets. JavaHelp The following changes have been made to the javahelp code since the 1.73.0 release. Michael(tm) Smith: javahelp.xslAdded single-pass namespace-stripping support to the htmlhelp, eclipse, and javahelp stylesheets. Roundtrip The following changes have been made to the roundtrip code since the 1.73.0 release. Steve Ball: blocks2dbk.xsl; blocks2dbk.dtd; pages2normalise.xslModularised blocks2dbk to allow customisation, Added support for tables to pages2normalise Params The following changes have been made to the params code since the 1.73.0 release. Robert Stayton: procedure.properties.xmlprocedure was inheriting keep-together from formal.object.properties, but a procedure does not need to be kept together by default. Dave Pawson: title.font.family.xml; component.label.includes.part.label.xml; table.frame.b⋯Regular formatting re-org. Release: 1.73.0 This release includes important bug fixes and adds the following significant feature changes: New localizations and localization updates We added two new localizations: Latvian and Esperanto, and made updates to the Czech, Chinese Simplified, Mongolian, Serbian, Italian, and Ukrainian localizations. ISO690 citation style for bibliography output. Set the bibliography.style parameter to iso690 to use ISO690 style. New documentation for processing instructions (PI) The reference documentation that ships with the release now includes documentation on all PIs that you can use to control output from the stylesheets. New profiling parameters for audience and wordsize You can now do profiling based on the values of the audience and wordsize attributes. Changes to man-page output The manpages stylesheet now supports single-pass profiling and single-pass DocBook 5 namespace stripping (just as the HTML and FO stylesheets also do). Also, added handling for mediaobject & inlinemediaobject. (Each imagedata, audiodata, or videodata element within a mediaobject or inline mediaobject is now treated as a "notesource" and so handled in much the same way as links and annotation/alt/footnote are in manpages output.) And added the man.authors.section.enabled and man.copyright.section.enabled parameters to enable control over whether output includes auto-generated AUTHORS and COPYRIGHT sections. Highlighting support for C The highlighting mechanism for generating syntax-highlighted code snippets in output now supports C code listings (along with Java, PHP, XSLT, and others). Experimental docbook-xsl-update script We added an experimental docbook-xsl-update script, the purpose of which is to facilitate easy sync-up to the latest docbook-xsl snapshot (by means of rsync). Gentext The following changes have been made to the gentext code since the 1.72.0 release. Michael(tm) Smith: locale/lv.xml; MakefileAdded Latvian localization file, from Girts Ziemelis. Dongsheng Song: locale/zh_cn.xmlBrought up to date with en.xml in terms of items. A few strings marked for translation. Jirka Kosek: locale/cs.xmlAdded missing translations Robert Stayton: locale/eo.xmlNew locale for Esperanto. Robert Stayton: locale/mn.xmlUpdate from Ganbold Tsagaankhuu. Jirka Kosek: locale/en.xml; locale/cs.xmlRules for normalizing glossary entries before they are sorted can be now different for each language. Michael(tm) Smith: locale/sr_Latn.xml; locale/sr.xmlCommitted changes from MiloÅ¡ KomarÄević to Serbian files. Robert Stayton: locale/ja.xmlFix chapter in context xref-number-and-title Robert Stayton: locale/it.xmlImproved version from contributor. Mauritz Jeanson: locale/uk.xmlApplied patch 1592083. Common The following changes have been made to the common code since the 1.72.0 release. Michael(tm) Smith: labels.xslChanged handling of reference auto-labeling such that reference (when it appears at the component level) is now affected by the label.from.part param, just as preface, chapter, and appendix. Michael(tm) Smith: common.xslAdded support to the HTML stylesheets for proper processing of orgname as a child of author. Michael(tm) Smith: refentry.xslRefined logging output of refentry metadata-gathering template; for some cases of "missing" elements (refmiscinfo stuff, etc.), the log messages now include URL to corresponding page in the Definitive Guide (TDG). Robert Stayton: titles.xslAdd refsection/info/title support. Michael(tm) Smith: titles.xslAdded support for correct handling of xref to elements that contain info/title descendants but no title children. This should be further refined so that it handles any *info elements. And there are probably some other places where similar handling for *info/title should be added. Mauritz Jeanson: pi.xslModified <xsl:when> in datetime.format template to work around Xalan bug. FO The following changes have been made to the fo code since the 1.72.0 release. Robert Stayton: component.xslAdd parameters to the page.sequence utility template. Mauritz Jeanson: xref.xslAdded template for xref to area/areaset. Part of fix for bug #1675513 (xref to area broken). Michael(tm) Smith: inline.xslAdded template match for person element to fo stylesheet. Robert Stayton: lists.xslAdded support for spacing="compact" in variablelist, per bug report #1722540. Robert Stayton: table.xsltable pgwide="1" should also use pgwide.properties attribute-set. Mauritz Jeanson: inline.xslMake citations numbered if bibliography.numbered != 0. Robert Stayton: param.xweb; param.entAdd new profiling parameters for audience and wordsize. Robert Stayton: param.xweb; param.entAdded callout.icon.size parameter. Robert Stayton: inline.xsl; xref.xslAdd support for xlink as olink. Robert Stayton: autotoc.xsl; param.xweb; param.entAdd support for qanda.in.toc to fo TOC. Robert Stayton: component.xslImproved the page.sequence utility template for use with book. Robert Stayton: division.xslRefactored the big book template into smaller pieces. Used the "page.sequence" utility template in component.xsl to shorten the toc piece. Added placeholder templates for front.cover and back.cover. Robert Stayton: param.xweb; param.ent; sections.xslAdd section.container.element parameter to enable pgwide spans inside sections. Robert Stayton: param.xweb; param.ent; component.xslAdd component.titlepage.properties attribute-set to support span="all" and other properties. Robert Stayton: htmltbl.xsl; table.xslApply table.row.properties template to html tr rows too. Add keep-with-next to table.row.properties when row is in thead. Robert Stayton: table.xslAdd support for default.table.frame parameter. Fix bug 1575446 rowsep last check for @morerows. Robert Stayton: refentry.xslAdd support for info/title in refsections. David Cramer: qandaset.xslMake fo questions and answers behave the same way as html Jirka Kosek: lists.xslAdded missing attribute set for procedure Jirka Kosek: param.xweb; biblio.xsl; docbook.xsl; param.ent; biblio-iso690.xslAdded support for formatting biblioentries according to ISO690 citation style. New bibliography style can be turned on by setting parameter bibliography.style to "iso690" The code was provided by Jana Dvorakova Robert Stayton: param.xweb; param.ent; pagesetup.xslAdd header.table.properties and footer.table.properties attribute-sets. Robert Stayton: inline.xslAdd fop1.extensions for menuchoice arrow handling exception. HTML The following changes have been made to the html code since the 1.72.0 release. Mauritz Jeanson: param.xweb; param.entMoved declaration and documentation of javahelp.encoding from javahelp.xsl to the regular "parameter machinery". Michael(tm) Smith: admon.xslChanged handling of titles for note, warning, caution, important, tip admonitions: We now output and HTML h3 head only if admon.textlabel is non-zero or if the admonition actually contains a title; otherwise, we don't output an h3 head at all. (Previously, we were outputting an empty h3 if the admon.textlabel was zero and if the admonition had no title.) Mauritz Jeanson: xref.xslAdded template for xref to area/areaset. Part of fix for bug #1675513 (xref to area broken). Mauritz Jeanson: titlepage.xsl; component.xsl; division.xsl; sections.xslAdded fixes to avoid duplicate ids when generate.id.attributes = 1. This (hopefully) closes bug #1671052. Michael(tm) Smith: formal.xsl; pi.xslMade the dbfunclist PI work as intended. Also added doc for dbfunclist and dbcmdlist PIs. Michael(tm) Smith: pi.xsl; synop.xslMade the dbcmdlist work the way it appears to have been intended to work. Restored dbhtml-dir template back to pi.xsl. Michael(tm) Smith: titlepage.xsl; param.xweb; param.entAdded new param abstract.notitle.enabled. If non-zero, in output of the abstract element on titlepages, display of the abstract title is suppressed. Because sometimes you really don't want or need that title there... Michael(tm) Smith: chunk-code.xsl; graphics.xslWhen we are chunking long descriptions for mediaobject instances into separate HTML output files, and use.id.as.filename is non-zero, if a mediaobject has an ID, use that ID as the basename for the long-description file (otherwise, we generate an ID for it and use that ID as the basename for the file). The parallels the recent change made to cause IDs for legalnotice instances to be used as basenames for legalnotice chunks. Also, made some minor refinements to the recent changes for legalnotice chunk handling. Michael(tm) Smith: titlepage.xslAdded support to the HTML stylesheets for proper processing of orgname as a child of author. Michael(tm) Smith: chunk-code.xslWhen $generate.legalnotice.link is non-zero and $use.id.as.filename is also non-zero, if a legalnotice has an ID, then instead of assigning the "ln-<generatedID>" basename to the output file for that legalnotice, just use its real ID as the basename for the file -- as we do when chunking other elements that have IDs. David Cramer: xref.xslHandle alt text on xrefs to steps when the step doesn't have a title. David Cramer: lists.xslAdded <p> element around term in variablelist when formatted as table to avoid misalignment of term and listitem in xhtml (non-quirks mode) output David Cramer: qandaset.xslAdded <p> element around question and answer labels to avoid misalignment of label and listitem in xhtml (non-quirks mode) output David Cramer: lists.xslAdded <p> element around callouts to avoid misalignment of callout and listitem in xhtml (non-quirks mode) output Mauritz Jeanson: inline.xslMake citations numbered if bibliography.numbered != 0. Robert Stayton: param.xweb; param.entAdd support for new profiling attributes audience and wordsize. Robert Stayton: inline.xsl; xref.xslAdd support for xlink olinks. Jirka Kosek: glossary.xslRules for normalizing glossary entries before they are sorted can be now different for each language. Robert Stayton: chunk-common.xsl; chunk-code.xsl; manifest.xsl; chunk.xslRefactored the chunking modules to move all named templates to chunk-common.xsl and all match templates to chunk-code.xsl, in order to enable better chunk customization. See the comments in chunk.xsl for more details. Robert Stayton: lists.xslAdd anchor for xml:id for listitem in varlistentry. Robert Stayton: refentry.xslAdd support for info/title in refsections for db5. Jirka Kosek: param.xweb; biblio.xsl; docbook.xsl; param.ent; biblio-iso690.xslAdded support for formatting biblioentries according to ISO690 citation style. New bibliography style can be turned on by setting parameter bibliography.style to "iso690" The code was provided by Jana Dvorakova Robert Stayton: inline.xsl; xref.xslAdd call to class.attribute to <a> output elements so they can have a class value too. Mauritz Jeanson: glossary.xslFixed bug #1644881: * Added curly braces around all $language attribute values. * Moved declaration of language variable to top level of stylesheet. Tested with Xalan, Saxon, and xsltproc. Manpages The following changes have been made to the manpages code since the 1.72.0 release. Michael(tm) Smith: param.xweb; docbook.xsl; param.entAdded the man.authors.section.enabled and man.copyright.section.enabled parameters. Set those to zero when you want to suppress display of the auto-generated AUTHORS and COPYRIGHT sections. Closes request #1467806. Thanks to Daniel Leidert. Michael(tm) Smith: docbook.xslTook the test that the manpages stylesheet does to see if there are any Refentry chilren in current doc, and made it namespace-agnostic. Reason for that is because the test otherwise won't work when it is copied over into the generated profile-docbook.xsl stylesheet. Michael(tm) Smith: MakefileAdded a manpages/profile-docbook.xsl file to enable single-pass profiling for manpages output. Michael(tm) Smith: info.xslOutput copyright and legalnotice in man-page output in whatever place they are in in document order. Closes #1690539. Thanks to Daniel Leidert for reporting. Michael(tm) Smith: docbook.xslRestored support for single-pass namespace stripping to manpages stylesheet. Michael(tm) Smith: synop.xsl; block.xsl; info.xsl; inline.xsl; lists.xsl; endnotes.xsl; ut⋯Changed handling of bold and italic/underline output in manpages output. Should be transparent to users, but... This touches handling of all bold and italic/underline output. The exact change is that the mode="bold" and mode="italic" utility templates were changed to named templates. (I think maybe I've changed it back and forth from mode to named before, so this is maybe re-reverting it yet again). Anyway, the reason for the change is that the templates are sometimes call on dynamically node-sets, and using modes to format those doesn't allow passing info about the current/real context node from the source (not the node-set created by the stylesheet) to that formatting stage. The named templates allow the context to be passed in as a parameter, so that the bold/ital formatting template can use context-aware condition checking. This was basically necessary in order to suppress bold formatting in titles, which otherwise gets screwed up because of the numbnut way that roff handles nested bold/ital. Closes #1674534). Much thanks to Daniel Leidert, whose in his docbook-xsl bug-finding kung-fu has achieved Grand Master status. Michael(tm) Smith: block.xslFixed handling of example instances by adding the example element to the same template we use for processing figure. Closes #1674538. Thanks to Daniel Leidert. Michael(tm) Smith: utility.xslDon't include lang in manpages filename/pathname if lang=en (that is, only generate lang-qualified file-/pathnames for non-English). Michael(tm) Smith: endnotes.xslIn manpages output, emit warnings for notesources (footnote, etc.) that have something other than para as a child. The numbered-with-hanging-indent formatting that's used for rendering endnotes in the NOTES section of man pages places some limits/assumptions on how the DocBook source is marked up; namely, for notesources (footnote, annotation, etc.) that can contain block-level children, if the they have a block-level child such as a table or itemizedlist or orderedlist that is the first child of a footnote, we have no way of rendering/indenting its content properly in the endnotes list. Thus, the manpages stylesheet not emits a warning message for that case, and suggests the "fix" (which is to wrap the table or itemizedlist or whatever in a para that has some preferatory text. Michael(tm) Smith: utility.xslAdded support to mixed-block template for handling tables in mixed-blocks (e.g., as child of para) correctly. Michael(tm) Smith: table.xsl; synop.xsl; block.xsl; info.xsl; lists.xsl; refentry.xsl; end⋯Reverted necessary escaping of backslash, dot, and dash out of the well-intentioned (but it now appears, misguided) "marker" mechanism (introduced in the 1.72.0 release) -- which made use of alternative "marker" characters as internal representations of those characters, and then replaced them just prior to serialization -- and back into what's basically the system that was used prior to the 1.69.0 release; that is, into a part of stylesheet code that gets executed at the beginning of processing -- before any other roff markup up is. This change obviates the need for the marker system. It also requires a lot less RAM during processing (for large files, the marker mechanism ending up requiring gigabytes of memory). Closes bug #1661177. Thanks to Scott Smedley for providing a test case (the fvwm man page) that exposed the problem with the marker mechanism. Also moved the mechanism for converting non-breaking spaces back into the same area of the stylesheet code. Michael(tm) Smith: lists.xslFixed problem with incorrect formatting of nested variablelist. Closes bug #1650931. Thanks to Daniel "Eagle Eye" Leidert. Michael(tm) Smith: lists.xslMake sure that all listitems in itemizedlist and orderedlist are preceded by a blank line. This fixes a regression that occurred when instances of the TP macro that were use in a previous versions of the list-handling code were switched to RS/RE (because TP doesn't support nesting). TP automatically generates a blank line, but RS doesn't. So I added a .sp before each .RS Michael(tm) Smith: block.xsl; inline.xsl; param.xweb; docbook.xsl; links.xsl; param.entMade a number of changes related to elements with out-of-line content: - Added handling for mediaobject & inlinemediaobject. Each imagedata, audiodata, or videodata element within a mediaobject or inline mediaobject is now treated as a "notesource" and so handled in much the same way as links and annotation/alt/footnotes. That means a numbered marker is generated inline to mark the place in the main flow where the imagedata, audiodata, or videodata element occurs, and a corresponding numbered endnote for it is generated in the endnotes list at the end of the man page; the endnote contains the URL from the fileref attribute of the imagedata, audiodata, or videodata element. For mediobject and inlinemediaobject instances that have a textobject child, the textobject is displayed within the main text flow. - Renamed several man.link.* params to man.endnotes.*, to reflect that fact that the endnotes list now contains more than just links. Also did similar renaming for a number of stylesheet-internal vars. - Added support for xlink:href (along with existing support for the legacy ulink element). - Cleaned up and streamlined the endnotes-handling code. It's still messy and klunky and the basic mechanism it uses is very inefficent for documents that contain a lot of notesources, but at least it's a bit better than it was. Eclipse The following changes have been made to the eclipse code since the 1.72.0 release. Mauritz Jeanson: MakefileFixed bug #1715093: Makefile for creating profiled version of eclipse.xsl added. David Cramer: eclipse.xslAdded normalize-space around to avoid leading whitespace from appearing in the output if there's extra leading whitespace (e.g. <title> Foo</title>) in the source JavaHelp The following changes have been made to the javahelp code since the 1.72.0 release. Mauritz Jeanson: javahelp.xslImplemented FR #1230233 (sorted index in javahelp). Mauritz Jeanson: javahelp.xslAdded normalize-space() around titles and index entries to work around whitespace problems. Added support for glossary and bibliography in toc and map files. Roundtrip The following changes have been made to the roundtrip code since the 1.72.0 release. Steve Ball: blocks2dbk.xsl; wordml2normalise.xsl; normalise2sections.xsl; sections2blocks.⋯new stylesheets for better word processor support and easier maintenance Steve Ball: template-pages.xml; dbk2wp.xsl; sections-spec.xmlfixed bugs Params The following changes have been made to the params code since the 1.72.0 release. Mauritz Jeanson: htmlhelp.button.back.xml; htmlhelp.button.forward.xml; htmlhelp.button.zo⋯Modified refpurpose text. Mauritz Jeanson: htmlhelp.map.file.xml; htmlhelp.force.map.and.alias.xml; htmlhelp.alias.f⋯Fixed typos, made some small changes. Mauritz Jeanson: javahelp.encoding.xmlMoved declaration and documentation of javahelp.encoding from javahelp.xsl to the regular "parameter machinery". Mauritz Jeanson: generate.id.attributes.xmlAdded refpurpose text. Mauritz Jeanson: annotation.js.xml; annotation.graphic.open.xml; annotation.graphic.close.⋯Added better refpurpose texts. Michael(tm) Smith: chunker.output.cdata-section-elements.xml; chunker.output.standalone.xm⋯Fixed some broken formatting in source files for chunker.* params, as pointed out by Dave Pawson. Michael(tm) Smith: label.from.part.xmlChanged handling of reference auto-labeling such that reference (when it appears at the component level) is now affected by the label.from.part param, just as preface, chapter, and appendix. Mauritz Jeanson: callout.graphics.extension.xmlClarified that 'extension' refers to file names. Michael(tm) Smith: abstract.notitle.enabled.xmlAdded new param abstract.notitle.enabled. If non-zero, in output of the abstract element on titlepages, display of the abstract title is suppressed. Because sometimes you really don't want or need that title there... Michael(tm) Smith: man.string.subst.map.xmlUpdated manpages string-substitute map to reflect fact that because of another recent change to suppress bold markup in .SH output, we no longer need to add a workaround for the accidental uppercasing of roff escapes that occurred previously. Jirka Kosek: margin.note.float.type.xml; title.font.family.xml; table.frame.border.color.x⋯Improved parameter metadata Robert Stayton: profile.wordsize.xml; profile.audience.xmlAdd support for profiling on new attributes audience and wordsize. Robert Stayton: callout.graphics.number.limit.xml; callout.graphics.extension.xmlAdded SVG graphics for fo output. Robert Stayton: callout.icon.size.xmlSet size of callout graphics. Jirka Kosek: default.units.xml; chunker.output.method.xml; toc.list.type.xml; output.inden⋯Updated parameter metadata to the new format. Jirka Kosek: man.output.quietly.xml; title.font.family.xml; footnote.sep.leader.properties⋯Added type annotations into parameter definition files. Robert Stayton: section.container.element.xmlSupport spans in sections for certain processors. Robert Stayton: component.titlepage.properties.xmlEmpty attribute set for top level component titlepage block. Allows setting a span on title info. Jirka Kosek: bibliography.style.xmlAdded link to WiKi page with description of special markup needed for ISO690 biblioentries Robert Stayton: make.year.ranges.xmlClarify that multiple year elements are required. Robert Stayton: id.warnings.xmlTurn off id.warnings by default. Jirka Kosek: bibliography.style.xmlAdded support for formatting biblioentries according to ISO690 citation style. New bibliography style can be turned on by setting parameter bibliography.style to "iso690" The code was provided by Jana Dvorakova Robert Stayton: header.table.properties.xml; footer.table.properties.xmlSupport adding table properties to header and footer tables. Highlighting The following changes have been made to the highlighting code since the 1.72.0 release. Jirka Kosek: c-hl.xml; xslthl-config.xmlAdded support for C language. Provided by Bruno Guegan. Profiling The following changes have been made to the profiling code since the 1.72.0 release. Robert Stayton: profile-mode.xslAdd support for new profiling attributes audience and wordsize. Lib The following changes have been made to the lib code since the 1.72.0 release. Michael(tm) Smith: lib.xwebChanged name of prepend-pad template to pad-string and twheeked so it can do both right/left padding. Tools The following changes have been made to the tools code since the 1.72.0 release. Michael(tm) Smith: bin; bin/docbook-xsl-updateDid some cleanup to the install.sh source and added a docbook-xsl-update script to the docbook-xsl distro, the purpose of which is to facilitate easy sync-up to the latest docbook-xsl snapshot (by means of rsync). XSL-Saxon The following changes have been made to the xsl-saxon code since the 1.72.0 release. Mauritz Jeanson: xalan27/src/com/nwalsh/xalan/Verbatim.java; xalan27/src/com/nwalsh/xalan/⋯Added modifications so that the new callout.icon.size parameter is taken into account. This parameter is used for FO output (where SVG now is the default graphics format for callouts). Mauritz Jeanson: saxon65/src/com/nwalsh/saxon/FormatCallout.java; xalan27/src/com/nwalsh/x⋯Added code for generating id attributes on callouts in HTML and FO output. These patches enable cross-references to callouts placed by area coordinates. It works for graphic, unicode and text callouts. Part of fix for bug #1675513 (xref to area broken). Michael(tm) Smith: saxon65/src/com/nwalsh/saxon/Website.java; xalan27/src/com/nwalsh/xalan⋯Copied over Website XSL Java extensions. XSL-Xalan The following changes have been made to the xsl-xalan code since the 1.72.0 release. Michael(tm) Smith: Makefile; xalan2Turned off xalan2.jar build. This removes DocBook XSL Java extensions support for versions of Xalan prior to Xalan 2.7. If you are currently using the extensions with an earlier version of Xalan, you need to upgrade to Xalan 2.7. Mauritz Jeanson: xalan27/src/com/nwalsh/xalan/Verbatim.java; xalan27/src/com/nwalsh/xalan/⋯Added modifications so that the new callout.icon.size parameter is taken into account. This parameter is used for FO output (where SVG now is the default graphics format for callouts). Mauritz Jeanson: saxon65/src/com/nwalsh/saxon/FormatCallout.java; xalan27/src/com/nwalsh/x⋯Added code for generating id attributes on callouts in HTML and FO output. These patches enable cross-references to callouts placed by area coordinates. It works for graphic, unicode and text callouts. Part of fix for bug #1675513 (xref to area broken). Michael(tm) Smith: saxon65/src/com/nwalsh/saxon/Website.java; xalan27/src/com/nwalsh/xalan⋯Copied over Website XSL Java extensions. Release: 1.72.0 This release includes important bug fixes and adds the following significant feature changes: Automatic sorting of glossary entries The HTML and FO stylesheets now support automatic sorting of glossary entries. To enable glossary sorting, set the value of the glossary.sort parameter to 1 (by default, it’s value is 0). When you enable glossary sorting, glossentry elements within a glossary, glossdiv, or glosslist are sorted on the glossterm, using the current language setting. If you don’t enable glossary sorting, then the order of glossentry elements is left “as is†— that is, they are not sorted but are instead just displayed in document order. WordML renamed to Roundtrip, OpenOffice support added Stylesheets for “roundtrip†conversion between documents in OpenOffice format (ODF) and DocBook XML have been added to the set of stylesheets that formerly had the collective title WordML, and that set of stylesheets has been renamed to Roundtrip to better reflect the actual scope and purpose of its contents. So the DocBook XSL Stylesheets now support roundtrip conversion (with certain limitations) of WordML, OpenOffice, and Apple Pages documents to and from DocBook XML. Including QandASet questions in TOCs The HTML stylesheet now provides support for including QandASet questions in the document TOC. To enable display of questions in the document TOC, set the value of the qanda.in.toc to 1 (by default, it’s 0). When you enable qanda.in.toc, then the generated table of contents for a document will include qandaset titles, qandadiv titles, and question elements. The default value of zero excludes them from the TOC. The qanda.in.toc parameter does not affect any tables of contents that may be generated within a qandaset or qandadiv (only in the document TOC). Language identifier in man-page filenames and pathnames Added new parameter man.output.lang.in.name.enabled, which controls whether a language identifier is included in man-page filenames and pathnames. It works like this: If the value of man.output.lang.in.name.enabled is non-zero, man-page files are output with a language identifier included in their filenames or pathnames as follows: if man.output.subdirs.enabled is non-zero, each file is output to, e.g., a /$lang/man8/foo.8 pathname if man.output.subdirs.enabled is zero, each file is output with a foo.$lang.8 filename index.page.number.properties property set For FO output, use the index.page.number.properties to control formatting of page numbers in index output — to (for example) to display page numbers in index output in a different color (to indicate that they are links). Crop marks in output from Antenna House XSL Formatter Support has been added for generating crop marks in print/PDF output generated using Antenna House XSL Formatter More string-substitution hooks in manpages output The man.string.subst.map.local.pre and man.string.subst.map.local.post parameters have been added to enable easier control over custom string substitutions. Moved verbatim properties to attribute-set The hardcoded properties used in verbatim elements (literallayout, programlisting, screen) were moved to the verbatim.properties attribute-set so they can be more easily customized. enhanced simple.xlink template Now the simple.xlink template in inline.xsl works with cross reference elements xref and link as well. Also, more elements call simple.xlink, which enables DB5 xlink functionality. DocBook 5 compatibility Stylesheets now consistently support DocBook 5 attributes (such as xml:id). Also, DocBook 5 info elements are now checked along with other *info elements, and the use of name() function was replaced by local-name() so it also matches on DocBook 5 elements. These changes enable reusing the stylesheets with DocBook 5 documents with minimal fixup. HTML class attributes now handled in class.attribute mode The HTML class attributes were formerly hardcoded to the element name. Now the class attribute is generated by applying templates in class.attribute mode so class attribute names can be customized. The default is still the element name. arabic-indic numbering enabled in autolabels Numbering of chapter, sections, and pages can now use arabic-indic numbering when number format is set to 'arabicindic' or to ١. The following is a detailed list of changes (not including bug fixes) that have been made since the 1.71.1 release. Common The following changes have been made to the common code since the 1.71.1 release. Add support for arabicindic numbering to autolabel.format template.M: /trunk/xsl/common/labels.xsl - Robert Stayton Finish support for @xml:id everywhere @id is used.M: /trunk/xsl/common/gentext.xsl; M: /trunk/xsl/common/titles.xsl - Robert Stayton replace name() with local-name() in most cases.M: /trunk/xsl/common/l10n.xsl; M: /trunk/xsl/common/olink.xsl; M: /trunk/xsl/common/subtitles.xsl; M: /trunk/xsl/common/labels.xsl; M: /trunk/xsl/common/titles.xsl; M: /trunk/xsl/common/common.xsl - Robert Stayton Add support for info.M: /trunk/xsl/common/subtitles.xsl; M: /trunk/xsl/common/labels.xsl; M: /trunk/xsl/common/titles.xsl; M: /trunk/xsl/common/common.xsl; M: /trunk/xsl/common/targets.xsl - Robert Stayton Add utility template tabstyle to return the tabstyle from any table element.M: /trunk/xsl/common/table.xsl - Robert Stayton FO The following changes have been made to the fo code since the 1.71.1 release. Add support for sorting glossary entriesM: /trunk/xsl/fo/param.xweb; M: /trunk/xsl/fo/param.ent; M: /trunk/xsl/fo/glossary.xsl - Robert Stayton Add table.row.properties template to customize table rows.M: /trunk/xsl/fo/table.xsl - Robert Stayton Moved all properties to attribute-sets so can be customized more easily.M: /trunk/xsl/fo/verbatim.xsl - Robert Stayton Add index.page.number.properties attribute-set to format page numbers.M: /trunk/xsl/fo/autoidx.xsl - Robert Stayton xref now supports xlink:href, using simple.xlink template.M: /trunk/xsl/fo/xref.xsl - Robert Stayton Rewrote simple.xlink, and call it with all charseq templates.M: /trunk/xsl/fo/inline.xsl - Robert Stayton Add simple.xlink processing to term and member elements.M: /trunk/xsl/fo/lists.xsl - Robert Stayton Add support for crop marks in Antenna House.M: /trunk/xsl/fo/axf.xsl; M: /trunk/xsl/fo/pagesetup.xsl - Robert Stayton HTML The following changes have been made to the html code since the 1.71.1 release. Add support for sorting glossary entriesM: /trunk/xsl/html/glossary.xsl - Robert Stayton Add support for qanda.in.toc to add qandaentry questions to document TOC.M: /trunk/xsl/html/autotoc.xsl; M: /trunk/xsl/html/param.xweb; M: /trunk/xsl/html/param.ent - Robert Stayton add simple.xlink support to variablelist term and simplelist member.M: /trunk/xsl/html/lists.xsl - Robert Stayton *.propagates.style now handled in class.attribute mode.M: /trunk/xsl/html/inline.xsl; M: /trunk/xsl/html/lists.xsl; M: /trunk/xsl/html/table.xsl; M: /trunk/xsl/html/block.xsl; M: /trunk/xsl/html/footnote.xsl - Robert Stayton add class parameter to class.attribute mode to set default class.M: /trunk/xsl/html/html.xsl - Robert Stayton Convert all class attributes to use the class.attribute mode so class names can be customized more easily.M: /trunk/xsl/html/titlepage.xsl; M: /trunk/xsl/html/chunk-code.xsl; M: /trunk/xsl/html/division.xsl; M: /trunk/xsl/html/sections.xsl; M: /trunk/xsl/html/math.xsl; M: /trunk/xsl/html/block.xsl; M: /trunk/xsl/html/info.xsl; M: /trunk/xsl/html/footnote.xsl; M: /trunk/xsl/html/lists.xsl; M: /trunk/xsl/html/admon.xsl; M: /trunk/xsl/html/refentry.xsl; M: /trunk/xsl/html/qandaset.xsl; M: /trunk/xsl/html/graphics.xsl; M: /trunk/xsl/html/biblio.xsl; M: /trunk/xsl/html/task.xsl; M: /trunk/xsl/html/component.xsl; M: /trunk/xsl/html/glossary.xsl; M: /trunk/xsl/html/callout.xsl; M: /trunk/xsl/html/index.xsl; M: /trunk/xsl/html/synop.xsl; M: /trunk/xsl/html/verbatim.xsl; M: /trunk/xsl/html/ebnf.xsl - Robert Stayton Add class.attribute mode to generate class attributes.M: /trunk/xsl/html/html.xsl - Robert Stayton Added simple.xlink to most remaining inlines. Changed class attributes to applying class.attributes mode.M: /trunk/xsl/html/inline.xsl - Robert Stayton Changed xref template to use simple.xlink tempalte.M: /trunk/xsl/html/xref.xsl - Robert Stayton Improve generate.html.title to work with link targets too.M: /trunk/xsl/html/html.xsl - Robert Stayton Improved simple.xlink to support link and xref.M: /trunk/xsl/html/inline.xsl - Robert Stayton Use new link.title.attribute now.M: /trunk/xsl/html/xref.xsl - Robert Stayton Rewrote simple.xlink to handle linkend also. Better computation of title attribute on link too.M: /trunk/xsl/html/inline.xsl - Robert Stayton Handle Xalan quirk as special case.M: /trunk/xsl/html/db5strip.xsl - Robert Stayton Add support for info.M: /trunk/xsl/html/admon.xsl; M: /trunk/xsl/html/autotoc.xsl; M: /trunk/xsl/html/lists.xsl; M: /trunk/xsl/html/refentry.xsl; M: /trunk/xsl/html/biblio.xsl; M: /trunk/xsl/html/qandaset.xsl; M: /trunk/xsl/html/component.xsl; M: /trunk/xsl/html/glossary.xsl; M: /trunk/xsl/html/division.xsl; M: /trunk/xsl/html/index.xsl; M: /trunk/xsl/html/sections.xsl; M: /trunk/xsl/html/table.xsl; M: /trunk/xsl/html/block.xsl - Robert Stayton Fixed imagemaps so they work properly going from calspair coords to HTML area coords.M: /trunk/xsl/html/graphics.xsl - Robert Stayton Manpages The following changes have been made to the manpages code since the 1.71.1 release. Added doc for man.output.lang.in.name.enabled parameter. This checkin completes support for writing file/pathnames for man-pages with $lang include in the names. Closes #1585967. knightly accolades to Daniel Leidert for providing the feature request.M: /trunk/xsl/manpages/param.xweb; M: /trunk/xsl/manpages/param.ent - Michael(tm) Smith Added new param man.output.lang.in.name.enabled, which controls whether $LANG value is included in manpages filenames and pathnames. It works like this: If the value of man.output.lang.in.name.enabled is non-zero, man-page files are output with the $lang value included in their filenames or pathnames as follows; - if man.output.subdirs.enabled is non-zero, each file is output to, e.g., a /$lang/man8/foo.8 pathname - if man.output.subdirs.enabled is zero, each file is output with a foo.$lang.8 filenameM: /trunk/xsl/manpages/docbook.xsl; M: /trunk/xsl/manpages/other.xsl; M: /trunk/xsl/manpages/utility.xsl - Michael(tm) Smith Use "\e" instead of "\\" for backslash output, because the groff docs say that's the correct thing to do; also because testing (thanks, Paul Dubois) shows that "\\" doesn't always work as expected; for example, "\\" within a table seems to mess things up.M: /trunk/xsl/manpages/charmap.groff.xsl - Michael(tm) Smith Added the man.string.subst.map.local.pre and man.string.subst.map.local.post parameters. Those parameters enable local additions and changes to string-substitution mappings without the need to change the value of man.string.subst.map parameter (which is for standard system mappings). Closes #1456738. Thanks to Sam Steingold for constructing a true stylesheet torture test (the clisp docs) that exposed the need for these params.M: /trunk/xsl/manpages/param.xweb; M: /trunk/xsl/manpages/param.ent; M: /trunk/xsl/manpages/other.xsl - Michael(tm) Smith Added the Markup element to the list of elements that get output in bold. Thanks to Eric S. Raymond.M: /trunk/xsl/manpages/inline.xsl - Michael(tm) Smith Replaced all dots in roff requests with U+2302 ("house" character), and added escaping in output for all instances of dot that are not in roff requests. This fixes the problem case where a string beginning with a dot (for example, the string ".bashrc") might occur at the beginning of a line in output, in which case would mistakenly get interpreted as a roff request. Thanks to Eric S. Raymond for pushing to fix this.M: /trunk/xsl/manpages/table.xsl; M: /trunk/xsl/manpages/synop.xsl; M: /trunk/xsl/manpages/block.xsl; M: /trunk/xsl/manpages/info.xsl; M: /trunk/xsl/manpages/lists.xsl; M: /trunk/xsl/manpages/refentry.xsl; M: /trunk/xsl/manpages/links.xsl; M: /trunk/xsl/manpages/other.xsl; M: /trunk/xsl/manpages/utility.xsl - Michael(tm) Smith Made change to ensure that list content nested in itemizedlist and orderedlist instances is properly indented. This is a switch from using .TP to format those lists to using .RS/.RE to format them instead (because .TP does not allow nesting). Closes bug #1602616. Thanks to Daniel Leidert.M: /trunk/xsl/manpages/lists.xsl - Michael(tm) Smith Params The following changes have been made to the params code since the 1.71.1 release. Added doc for man.output.lang.in.name.enabled parameter. This checkin completes support for writing file/pathnames for man-pages with $lang include in the names. Closes #1585967. knightly accolades to Daniel Leidert for providing the feature request.A: /trunk/xsl/params/man.output.lang.in.name.enabled.xml - Michael(tm) Smith Added new param man.output.lang.in.name.enabled, which controls whether $LANG value is included in manpages filenames and pathnames. It works like this: If the value of man.output.lang.in.name.enabled is non-zero, man-page files are output with the $lang value included in their filenames or pathnames as follows; - if man.output.subdirs.enabled is non-zero, each file is output to, e.g., a /$lang/man8/foo.8 pathname - if man.output.subdirs.enabled is zero, each file is output with a foo.$lang.8 filenameM: /trunk/xsl/manpages/docbook.xsl; M: /trunk/xsl/manpages/other.xsl; M: /trunk/xsl/manpages/utility.xsl - Michael(tm) Smith Added the man.string.subst.map.local.pre and man.string.subst.map.local.post parameters. Those parameters enable local additions and changes to string-substitution mappings without the need to change the value of man.string.subst.map parameter (which is for standard system mappings). Closes #1456738. Thanks to Sam Steingold for constructing a true stylesheet torture test (the clisp docs) that exposed the need for these params.A: /trunk/xsl/params/man.string.subst.map.local.post.xml; A: /trunk/xsl/params/man.string.subst.map.local.pre.xml; M: /trunk/xsl/params/man.string.subst.map.xml - Michael(tm) Smith Add index.page.number.properties by default.M: /trunk/xsl/params/xep.index.item.properties.xml - Robert Stayton Added index.page.number.properties to allow customizations of page numbers in indexes.A: /trunk/xsl/params/index.page.number.properties.xml - Robert Stayton Move show-destination="replace" property from template to attribute-set so it can be customized.M: /trunk/xsl/params/olink.properties.xml - Robert Stayton Add support for sorting glossary entriesA: /trunk/xsl/params/glossary.sort.xml - Robert Stayton Add option to include qanda in tables of contents.A: /trunk/xsl/params/qanda.in.toc.xml - Robert Stayton Moved all properties to attribute-sets so can be customized more easily.M: /trunk/xsl/params/verbatim.properties.xml - Robert Stayton Template The following changes have been made to the template code since the 1.71.1 release. Added workaround for Xalan bug: use for-each and copy instead of copy-of (#1604770).M: /trunk/xsl/template/titlepage.xsl - Mauritz Jeanson Roundtrip The following changes have been made to the roundtrip code since the 1.71.1 release. rename to roundtrip, add OpenOffice supportM: /trunk/xsl/roundtrip/docbook-pages.xsl; M: /trunk/xsl/roundtrip/specifications.xml; A: /trunk/xsl/roundtrip/dbk2ooo.xsl; M: /trunk/xsl/roundtrip/docbook.xsl; A: /trunk/xsl/roundtrip/dbk2pages.xsl; M: /trunk/xsl/roundtrip/template.xml; A: /trunk/xsl/roundtrip/dbk2wordml.xsl; A: /trunk/xsl/roundtrip/dbk2wp.xsl; M: /trunk/xsl/roundtrip/template.dot; M: /trunk/xsl/roundtrip/wordml-final.xsl - Steve Ball Release: 1.71.1 This is a minor update to the 1.71.0 release. Along with a number of bug fixes, it includes two feature changes: Added support for profiling based on xml:lang and status attributes. Added initial support in manpages output for footnote, annotation, and alt instances. Basically, they all now get handled the same way ulink instances are. They are treated as a class as "note sources": A numbered marker is generated at the place in the main text flow where they occur, then their contents are displayed in an endnotes section at the end of the man page. Common The following changes have been made to the common code since the 1.71.1 release. For backward compatability autoidx-ng.xsl is invoking "kosek" indexing method again.D: /trunk/xsl/common/autoidx-ng.xsl - Jirka Kosek Add support for Xalan generating a root xml:base like saxon.M: /trunk/xsl/common/stripns.xsl - Robert Stayton FO The following changes have been made to the fo code since the 1.71.1 release. For backward compatability autoidx-ng.xsl is invoking "kosek" indexing method again.M: /trunk/xsl/fo/autoidx-ng.xsl; M: /trunk/xsl/fo/autoidx-kosek.xsl - Jirka Kosek Add support for Xalan to add root node xml:base for db5 docs.M: /trunk/xsl/fo/docbook.xsl - Robert Stayton Added support for profiling based on xml:lang and status attributes.M: /trunk/xsl/fo/param.xweb; M: /trunk/xsl/fo/param.ent - Jirka Kosek HTML The following changes have been made to the html code since the 1.71.1 release. For backward compatability autoidx-ng.xsl is invoking "kosek" indexing method again.M: /trunk/xsl/html/autoidx-ng.xsl; M: /trunk/xsl/html/autoidx-kosek.xsl - Jirka Kosek Add support for Xalan to add root node xml:base for db5 docs.M: /trunk/xsl/html/chunk-code.xsl; M: /trunk/xsl/html/docbook.xsl - Robert Stayton Added support for profiling based on xml:lang and status attributes.M: /trunk/xsl/html/param.xweb; M: /trunk/xsl/html/param.ent - Jirka Kosek Made changes in namespace declarations to prevent xmllint's canonicalizer from treating them as relative namespace URIs. - Changed xmlns:k="java:com.isogen.saxoni18n.Saxoni18nService" to xmlns:k="http://www.isogen.com/functions/com.isogen.saxoni18n.Saxoni18nService"; Saxon accepts either form (see http://www.saxonica.com/documentation/extensibility/functions.html); to Saxon, "the part of the URI before the final '/' is immaterial". - Changed, e.g. xmlns:xverb="com.nwalsh.xalan.Verbatim" to xmlns:xverb="xalan://com.nwalsh.xalan.Verbatim"; Xalan accepts either form (see http://xml.apache.org/xalan-j/extensions.html#java-namespace-declare); just as Saxon does, it will "simply use the string to the right of the rightmost forward slash as the Java class name". - Changed xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect" to xmlns:redirect="http://xml.apache.org/xalan/redirect", and adjusted associated code to make the current Xalan redirect spec. (see http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/lib/Redirect.html)M: /trunk/xsl/html/oldchunker.xsl; M: /trunk/xsl/html/chunker.xsl; M: /trunk/xsl/html/graphics.xsl; M: /trunk/xsl/html/callout.xsl; M: /trunk/xsl/html/autoidx-kimber.xsl; M: /trunk/xsl/html/autoidx-kosek.xsl; M: /trunk/xsl/html/table.xsl; M: /trunk/xsl/html/verbatim.xsl - Michael(tm) Smith Added the html.append and chunk.append parameters. By default, the value of both is empty; but the internal DocBook XSL stylesheets build sets their value to "<xsl:text>&#x0a;</xsl:text>", in order to ensure that all files in the docbook-xsl-doc package end in a newline character. (Because diff and some other tools may emit error messages and/or not behave as expected when processing files that are not newline-terminated.)M: /trunk/xsl/html/chunk-common.xsl; M: /trunk/xsl/html/titlepage.xsl; M: /trunk/xsl/html/param.xweb; M: /trunk/xsl/html/docbook.xsl; M: /trunk/xsl/html/graphics.xsl; M: /trunk/xsl/html/param.ent - Michael(tm) Smith Highlighting The following changes have been made to the highlighting code since the 1.71.1 release. Added license informationM: /trunk/xsl/highlighting/delphi-hl.xml; M: /trunk/xsl/highlighting/myxml-hl.xml; M: /trunk/xsl/highlighting/php-hl.xml; M: /trunk/xsl/highlighting/m2-hl.xml; M: /trunk/xsl/highlighting/ini-hl.xml; M: /trunk/xsl/highlighting/xslthl-config.xml; M: /trunk/xsl/highlighting/java-hl.xml - Jirka Kosek Manpages The following changes have been made to the manpages code since the 1.71.1 release. Added initial support in manpages output for footnote, annotation, and alt instances. Basically, they all now get handled the same way ulink instances are. They are treated as a class as "note sources": A numbered marker is generated at the place in the main text flow where they occur, then their contents are displayed in an endnotes section at the end of the man page (currently titled REFERENCES, for English output, but will be changed to NOTES). This support is not yet complete. It works for most "normal" cases, but probably mishandles a good number of cases. More testing will be needed to expose the problems. It may well also introduce some bugs and regressions in other areas, including basic paragraph handling, handling of "mixed block" content, handling of other indented content, and handling of authorblurb and personblurb in the AUTHORS section.M: /trunk/xsl/manpages/table.xsl; M: /trunk/xsl/manpages/block.xsl; M: /trunk/xsl/manpages/docbook.xsl; M: /trunk/xsl/manpages/links.xsl; M: /trunk/xsl/manpages/other.xsl; M: /trunk/xsl/manpages/utility.xsl - Michael(tm) Smith Params The following changes have been made to the params code since the 1.71.1 release. Added support for profiling based on xml:lang and status attributes.A: /trunk/xsl/params/profile.status.xml - Jirka Kosek Added the html.append and chunk.append parameters. By default, the value of both is empty; but the internal DocBook XSL stylesheets build sets their value to "<xsl:text>&#x0a;</xsl:text>", in order to ensure that all files in the docbook-xsl-doc package end in a newline character. (Because diff and some other tools may emit error messages and/or not behave as expected when processing files that are not newline-terminated.)A: /trunk/xsl/params/html.append.xml; A: /trunk/xsl/params/chunk.append.xml - Michael(tm) Smith Profiling The following changes have been made to the profiling code since the 1.71.1 release. Added support for profiling based on xml:lang and status attributes.M: /trunk/xsl/profiling/profile.xsl; M: /trunk/xsl/profiling/profile-mode.xsl - Jirka Kosek Release: 1.71.0 This is mainly a bug fix release, but it also includes two significant feature changes: Highlighting support added The stylesheets now include support for source-code highlighting in output of programlisting instances (controlled through the highlight.source parameter). The Java-based implementation requires Saxon and makes use of MichalMolhanec’s XSLTHL. More details are available at Jirka Kosek’s website:
        The support is currently limited to highlighting of XML, Java, PHP, Delphi, Modula-2 sources, and INI files.
        Changes to autoindexing The templates that handle alternative indexing methods were reworked to avoid errors produced by certain processors not being able to tolerate the presence of unused functions. With this release, none of the code for the 'kimber' or 'kosek' methods is included in the default stylesheets. In order to use one of those methods, your customization layer must import one of the optional stylesheet modules: html/autoidx-kosek.xsl html/autoidx-kimber.xsl fo/autoidx-kosek.xsl fo/autoidx-kimber.xsl See the index.method parameter reference page for more information. Two other changes to note: The default indexing method now can handle accented characters in latin-based alphabets, not just English. This means accented latin letters will group and sort with their unaccented counterpart. The default value for the index.method parameter was changed from 'english' to 'basic' because now the default method can handle latin-based alphabets, not just English.
        The following is a list of changes that have been made since the 1.70.1 release.
        Common The following changes have been made to the common code since the 1.70.1 release. Added reference.autolabel parameter for controlling labels on reference output.M: /trunk/xsl/common/labels.xsl - Michael(tm) Smith Support rows that are *completely* overlapped by the preceding rowM: /trunk/xsl/common/table.xsl - Norman Walsh New modules for supporting indexing extensions.A: /trunk/xsl/common/autoidx-kimber.xsl; A: /trunk/xsl/common/autoidx-kosek.xsl - Robert Stayton Support startinglinenumber on orderedlistM: /trunk/xsl/common/common.xsl - Norman Walsh Extensions The following changes have been made to the extensions code since the 1.70.1 release. Completely reworked extensions build system; now uses NetBeans and antD: /trunk/xsl/extensions/xalan27/.cvsignore; A: /trunk/xsl/extensions/saxon65/nbproject; A: /trunk/xsl/extensions/saxon65/nbproject/project.properties; D: /trunk/xsl/extensions/prj.el; A: /trunk/xsl/extensions/saxon65/src; A: /trunk/xsl/extensions/xalan2/src/com; M: /trunk/xsl/extensions/xalan2/src/com/nwalsh/xalan/Text.java; A: /trunk/xsl/extensions/saxon65/nbproject/project.xml; D: /trunk/xsl/extensions/build.xml; A: /trunk/xsl/extensions/saxon65/build.xml; A: /trunk/xsl/extensions/xalan2/nbproject/genfiles.properties; A: /trunk/xsl/extensions/saxon65; D: /trunk/xsl/extensions/xalan2/com; M: /trunk/xsl/extensions/xalan2/src/com/nwalsh/xalan/Func.java; A: /trunk/xsl/extensions/xalan2/test; A: /trunk/xsl/extensions/saxon65/src/com; A: /trunk/xsl/extensions/xalan2/nbproject/build-impl.xml; A: /trunk/xsl/extensions/xalan2/nbproject; A: /trunk/xsl/extensions/xalan2/src; A: /trunk/xsl/extensions/xalan2/nbproject/project.properties; D: /trunk/xsl/extensions/.cvsignore; M: /trunk/xsl/extensions/Makefile; D: /trunk/xsl/extensions/saxon8; A: /trunk/xsl/extensions/saxon65/nbproject/genfiles.properties; A: /trunk/xsl/extensions/xalan2/nbproject/project.xml; A: /trunk/xsl/extensions/saxon65/test; M: /trunk/xsl/extensions/xalan2/src/com/nwalsh/xalan/Verbatim.java; A: /trunk/xsl/extensions/xalan2/build.xml; M: /trunk/xsl/extensions/xalan2; D: /trunk/xsl/extensions/saxon643; A: /trunk/xsl/extensions/saxon65/nbproject/build-impl.xml - Norman Walsh FO The following changes have been made to the fo code since the 1.70.1 release. xsl:sort lang attribute now uses two-char substring of lang attribute.M: /trunk/xsl/fo/autoidx-kimber.xsl - Robert Stayton Support titlecase "Java", "Perl", and "IDL" as values for the language attribute on classsynopsis, etc. (instead of just lowercase "java", "perl", and "idl"). Also support "c++" and "C++" (instead of just "cpp"). Affects HTML, FO, and manpages output. Closes bug 1552332. Thanks to "Brian A. Vanderburg II".M: /trunk/xsl/fo/synop.xsl - Michael(tm) Smith Added support for the reference.autolabel param in (X)HTML and FO output.M: /trunk/xsl/fo/param.xweb; M: /trunk/xsl/fo/param.ent - Michael(tm) Smith Support rows that are *completely* overlapped by the preceding rowM: /trunk/xsl/fo/table.xsl - Norman Walsh Rearranged templates for the 3 indexing methods and changed method named 'english' to 'basic'.M: /trunk/xsl/fo/autoidx.xsl - Robert Stayton New modules for supporting indexing extensions.A: /trunk/xsl/fo/autoidx-kimber.xsl; A: /trunk/xsl/fo/autoidx-kosek.xsl - Robert Stayton Turn off blank-body for fop1.extensions too since fop 0.92 does not support it either.M: /trunk/xsl/fo/pagesetup.xsl - Robert Stayton Add Xalan variant to test for exslt:node-set function. Xalan can use function named node-set(), but doesn't recognize it using function-available().M: /trunk/xsl/fo/autoidx.xsl - Robert Stayton Added support to FO stylesheets for handling instances of Org where it occurs outside of *info content. In HTML stylesheets, moved handling of Org out of info.xsl and into inline.xsl. In both FO and HTML stylesheets, added support for correctly processing Affiliation and Jobtitle.M: /trunk/xsl/fo/inline.xsl - Michael(tm) Smith Don't output punctuation between Refname and Refpurpose if Refpurpose is empty. Also corrected handling of Refsect2/title instances, and removed some debugging stuff that was generated in manpages output to mark the ends of sections.M: /trunk/xsl/fo/refentry.xsl - Michael(tm) Smith Added new email.delimiters.enabled param. If non-zero (the default), delimiters are generated around e-mail addresses (output of the email element). If zero, the delimiters are suppressed.M: /trunk/xsl/fo/inline.xsl; M: /trunk/xsl/fo/param.xweb; M: /trunk/xsl/fo/param.ent - Michael(tm) Smith Initial support of syntax highlighting of programlistings.M: /trunk/xsl/fo/param.ent; M: /trunk/xsl/fo/param.xweb; A: /trunk/xsl/fo/highlight.xsl; M: /trunk/xsl/fo/verbatim.xsl - Jirka Kosek Chapter after preface should restart numbering of pages.M: /trunk/xsl/fo/pagesetup.xsl - Jirka Kosek HTML The following changes have been made to the html code since the 1.70.1 release. xsl:sort lang attribute now uses two-char substring of lang attribute.M: /trunk/xsl/html/autoidx-kimber.xsl - Robert Stayton Support titlecase "Java", "Perl", and "IDL" as values for the language attribute on classsynopsis, etc. (instead of just lowercase "java", "perl", and "idl"). Also support "c++" and "C++" (instead of just "cpp"). Affects HTML, FO, and manpages output. Closes bug 1552332. Thanks to "Brian A. Vanderburg II".M: /trunk/xsl/html/synop.xsl - Michael(tm) Smith Added support for the reference.autolabel param in (X)HTML and FO output.M: /trunk/xsl/html/param.xweb; M: /trunk/xsl/html/param.ent - Michael(tm) Smith Support rows that are *completely* overlapped by the preceding rowM: /trunk/xsl/html/table.xsl - Norman Walsh Rearranged templates for the 3 indexing methods and changed method named 'english' to 'basic'.M: /trunk/xsl/html/autoidx.xsl - Robert Stayton New modules for supporting indexing extensions.A: /trunk/xsl/html/autoidx-kimber.xsl; A: /trunk/xsl/html/autoidx-kosek.xsl - Robert Stayton Added several new HTML parameters for controlling appearance of content on HTML title pages: contrib.inline.enabled: If non-zero (the default), output of the contrib element is displayed as inline content rather than as block content. othercredit.like.author.enabled: If non-zero, output of the othercredit element on titlepages is displayed in the same style as author and editor output. If zero (the default), othercredit output is displayed using a style different than that of author and editor. blurb.on.titlepage.enabled: If non-zero, output from authorblurb and personblurb elements is displayed on title pages. If zero (the default), output from those elements is suppressed on title pages (unless you are using a titlepage customization that causes them to be included). editedby.enabled If non-zero (the default), a localized Edited by heading is displayed above editor names in output of the editor element.M: /trunk/xsl/html/titlepage.xsl; M: /trunk/xsl/html/param.xweb; M: /trunk/xsl/html/param.ent - Michael(tm) Smith Add Xalan variant to test for exslt:node-set function. Xalan can use function named node-set(), but doesn't recognize it using function-available().M: /trunk/xsl/html/autoidx.xsl - Robert Stayton Added support to FO stylesheets for handling instances of Org where it occurs outside of *info content. In HTML stylesheets, moved handling of Org out of info.xsl and into inline.xsl. In both FO and HTML stylesheets, added support for correctly processing Affiliation and Jobtitle.M: /trunk/xsl/html/inline.xsl; M: /trunk/xsl/html/info.xsl - Michael(tm) Smith Don't output punctuation between Refname and Refpurpose if Refpurpose is empty. Also corrected handling of Refsect2/title instances, and removed some debugging stuff that was generated in manpages output to mark the ends of sections.M: /trunk/xsl/html/refentry.xsl - Michael(tm) Smith Added new email.delimiters.enabled param. If non-zero (the default), delimiters are generated around e-mail addresses (output of the email element). If zero, the delimiters are suppressed.M: /trunk/xsl/html/inline.xsl; M: /trunk/xsl/html/param.xweb; M: /trunk/xsl/html/param.ent - Michael(tm) Smith Added qanda.nested.in.toc param. Default value is zero. If non-zero, instances of "nested" Qandaentry (ones that are children of Answer elements) are displayed in the TOC. Closes patch 1509018 (from Daniel Leidert). Currently on affects HTML output (no patch for FO output provided).M: /trunk/xsl/html/param.xweb; M: /trunk/xsl/html/param.ent; M: /trunk/xsl/html/qandaset.xsl - Michael(tm) Smith Improved handling of relative locations generated filesM: /trunk/xsl/html/html.xsl - Jirka Kosek Initial support of syntax highlighting of programlistings.M: /trunk/xsl/html/param.ent; M: /trunk/xsl/html/param.xweb; A: /trunk/xsl/html/highlight.xsl; M: /trunk/xsl/html/verbatim.xsl - Jirka Kosek Support orgM: /trunk/xsl/html/info.xsl - Norman Walsh Support personM: /trunk/xsl/html/inline.xsl - Norman Walsh Support $keep.relative.image.uris also when chunkingM: /trunk/xsl/html/chunk-code.xsl - Jirka Kosek Highlighting The following changes have been made to the highlighting code since the 1.70.1 release. Initial support of syntax highlighting of programlistings.A: /trunk/xsl/highlighting/php-hl.xml; A: /trunk/xsl/highlighting/common.xsl; A: /trunk/xsl/highlighting/delphi-hl.xml; A: /trunk/xsl/highlighting/myxml-hl.xml; A: /trunk/xsl/highlighting/m2-hl.xml; A: /trunk/xsl/highlighting/ini-hl.xml; A: /trunk/xsl/highlighting/xslthl-config.xml; A: /trunk/xsl/highlighting/java-hl.xml - Jirka Kosek Manpages The following changes have been made to the manpages code since the 1.70.1 release. Suppress footnote markers and output warning that footnotes are not yet supported.M: /trunk/xsl/manpages/docbook.xsl; M: /trunk/xsl/manpages/links.xsl; M: /trunk/xsl/manpages/other.xsl - Michael(tm) Smith Handle instances of address/otheraddr/ulink in author et al in the same way as email instances; that is, display them on the same linke as the author, editor, etc., name.M: /trunk/xsl/manpages/info.xsl - Michael(tm) Smith Don't number or link-list any Ulink instance whose string value is identical to the value of its url attribute. Just display it inline.M: /trunk/xsl/manpages/links.xsl - Michael(tm) Smith Don't output punctuation between Refname and Refpurpose if Refpurpose is empty. Also corrected handling of Refsect2/title instances, and removed some debugging stuff that was generated in manpages output to mark the ends of sections.M: /trunk/xsl/manpages/refentry.xsl - Michael(tm) Smith Added new email.delimiters.enabled param. If non-zero (the default), delimiters are generated around e-mail addresses (output of the email element). If zero, the delimiters are suppressed.M: /trunk/xsl/manpages/param.xweb; M: /trunk/xsl/manpages/param.ent - Michael(tm) Smith In manpages output, if the last/nearest *info element for particular Refentry has multiple Copyright and/or Legalnotice children, process them all (not just the first ones). Closes bug 1524576. Thanks to Sam Steingold for the report and to Daniel Leidert for providing a patch.M: /trunk/xsl/manpages/info.xsl - Michael(tm) Smith Params The following changes have been made to the params code since the 1.70.1 release. Added reference.autolabel parameter for controlling labels on reference output.A: /trunk/xsl/params/reference.autolabel.xml - Michael(tm) Smith Added namespace declarations to document elements for all param files.M: /trunk/xsl/params/toc.line.properties.xml; M: /trunk/xsl/params/title.font.family.xml; M: /trunk/xsl/params/component.label.includes.part.label.xml; M: /trunk/xsl/params/refentry.manual.profile.xml; M: /trunk/xsl/params/orderedlist.properties.xml; M: /trunk/xsl/params/olink.pubid.xml; M: /trunk/xsl/params/informalexample.properties.xml; M: /trunk/xsl/params/appendix.autolabel.xml; M: /trunk/xsl/params/htmlhelp.show.toolbar.text.xml; M: /trunk/xsl/params/index.on.role.xml; M: /trunk/xsl/params/htmlhelp.button.jump2.url.xml; M: /trunk/xsl/params/variablelist.term.separator.xml; M: /trunk/xsl/params/para.propagates.style.xml; M: /trunk/xsl/params/html.stylesheet.xml; M: /trunk/xsl/params/qanda.nested.in.toc.xml; M: /trunk/xsl/params/annotation.css.xml; M: /trunk/xsl/params/funcsynopsis.style.xml; M: /trunk/xsl/params/htmlhelp.encoding.xml; M: /trunk/xsl/params/footer.content.properties.xml; M: /trunk/xsl/params/verbatim.properties.xml; M: /trunk/xsl/params/autotoc.label.in.hyperlink.xml; M: /trunk/xsl/params/body.margin.top.xml; M: /trunk/xsl/params/bibliography.numbered.xml; M: /trunk/xsl/params/figure.properties.xml; M: /trunk/xsl/params/variablelist.max.termlength.xml; M: /trunk/xsl/params/table.cell.border.style.xml; M: /trunk/xsl/params/htmlhelp.button.options.xml; M: /trunk/xsl/params/preferred.mediaobject.role.xml; M: /trunk/xsl/params/htmlhelp.chm.xml; M: /trunk/xsl/params/man.charmap.subset.profile.xml; M: /trunk/xsl/params/qanda.title.level3.properties.xml; M: /trunk/xsl/params/page.width.xml; M: /trunk/xsl/params/firstterm.only.link.xml; M: /trunk/xsl/params/section.level6.properties.xml; M: /trunk/xsl/params/htmlhelp.button.locate.xml; M: /trunk/xsl/params/chunk.sections.xml; M: /trunk/xsl/params/use.local.olink.style.xml; M: /trunk/xsl/params/refentry.date.profile.enabled.xml; M: /trunk/xsl/params/refentry.version.suppress.xml; M: /trunk/xsl/params/refentry.generate.title.xml; M: /trunk/xsl/params/punct.honorific.xml; M: /trunk/xsl/params/column.gap.index.xml; M: /trunk/xsl/params/body.start.indent.xml; M: /trunk/xsl/params/crop.mark.width.xml; M: /trunk/xsl/params/refentry.version.profile.enabled.xml; M: /trunk/xsl/params/superscript.properties.xml; M: /trunk/xsl/params/chunker.output.doctype-public.xml; M: /trunk/xsl/params/saxon.character.representation.xml; M: /trunk/xsl/params/saxon.linenumbering.xml; M: /trunk/xsl/params/shade.verbatim.style.xml; M: /trunk/xsl/params/annotate.toc.xml; M: /trunk/xsl/params/profile.attribute.xml; M: /trunk/xsl/params/callout.graphics.number.limit.xml; M: /trunk/xsl/params/profile.arch.xml; M: /trunk/xsl/params/saxon.tablecolumns.xml; M: /trunk/xsl/params/glossterm.auto.link.xml; M: /trunk/xsl/params/default.units.xml; M: /trunk/xsl/params/qanda.title.level1.properties.xml; M: /trunk/xsl/params/list.block.spacing.xml; M: /trunk/xsl/params/section.level4.properties.xml; M: /trunk/xsl/params/spacing.paras.xml; M: /trunk/xsl/params/column.count.index.xml; M: /trunk/xsl/params/dingbat.font.family.xml; M: /trunk/xsl/params/citerefentry.link.xml; M: /trunk/xsl/params/keep.relative.image.uris.xml; M: /trunk/xsl/params/ulink.footnotes.xml; M: /trunk/xsl/params/prefer.internal.olink.xml; M: /trunk/xsl/params/refentry.title.properties.xml; M: /trunk/xsl/params/variablelist.term.break.after.xml; M: /trunk/xsl/params/use.id.function.xml; M: /trunk/xsl/params/callout.unicode.start.character.xml; M: /trunk/xsl/params/column.gap.titlepage.xml; M: /trunk/xsl/params/editedby.enabled.xml; M: /trunk/xsl/params/funcsynopsis.tabular.threshold.xml; M: /trunk/xsl/params/use.extensions.xml; M: /trunk/xsl/params/index.preferred.page.properties.xml; M: /trunk/xsl/params/man.th.extra3.max.length.xml; M: /trunk/xsl/params/column.gap.back.xml; M: /trunk/xsl/params/tex.math.delims.xml; M: /trunk/xsl/params/article.appendix.title.properties.xml; M: /trunk/xsl/params/ulink.target.xml; M: /trunk/xsl/params/suppress.header.navigation.xml; M: /trunk/xsl/params/olink.resolver.xml; M: /trunk/xsl/params/admon.textlabel.xml; M: /trunk/xsl/params/procedure.properties.xml; M: /trunk/xsl/params/blurb.on.titlepage.enabled.xml; M: /trunk/xsl/params/section.level2.properties.xml; M: /trunk/xsl/params/column.gap.front.xml; M: /trunk/xsl/params/margin.note.title.properties.xml; M: /trunk/xsl/params/glossary.collection.xml; M: /trunk/xsl/params/admon.graphics.xml; M: /trunk/xsl/params/current.docid.xml; M: /trunk/xsl/params/qanda.inherit.numeration.xml; M: /trunk/xsl/params/table.cell.padding.xml; M: /trunk/xsl/params/preface.autolabel.xml; M: /trunk/xsl/params/man.th.extra3.suppress.xml; M: /trunk/xsl/params/wordml.template.xml; M: /trunk/xsl/params/htmlhelp.use.hhk.xml; M: /trunk/xsl/params/textinsert.extension.xml; M: /trunk/xsl/params/ebnf.table.bgcolor.xml; M: /trunk/xsl/params/refentry.source.fallback.profile.xml; M: /trunk/xsl/params/body.font.master.xml; M: /trunk/xsl/params/l10n.gentext.default.language.xml; M: /trunk/xsl/params/list.block.properties.xml; M: /trunk/xsl/params/refentry.source.name.suppress.xml; M: /trunk/xsl/params/htmlhelp.hhp.window.xml; M: /trunk/xsl/params/sidebar.properties.xml; M: /trunk/xsl/params/tex.math.file.xml; M: /trunk/xsl/params/man.justify.xml; M: /trunk/xsl/params/subscript.properties.xml; M: /trunk/xsl/params/column.count.front.xml; M: /trunk/xsl/params/index.term.separator.xml; M: /trunk/xsl/params/biblioentry.properties.xml; M: /trunk/xsl/params/biblioentry.item.separator.xml; M: /trunk/xsl/params/htmlhelp.button.home.url.xml; M: /trunk/xsl/params/column.count.body.xml; M: /trunk/xsl/params/suppress.navigation.xml; M: /trunk/xsl/params/htmlhelp.remember.window.position.xml; M: /trunk/xsl/params/htmlhelp.hhc.section.depth.xml; M: /trunk/xsl/params/xref.with.number.and.title.xml; M: /trunk/xsl/params/make.year.ranges.xml; M: /trunk/xsl/params/region.before.extent.xml; M: /trunk/xsl/params/xref.label-page.separator.xml; M: /trunk/xsl/params/html.longdesc.link.xml; M: /trunk/xsl/params/man.subheading.divider.enabled.xml; M: /trunk/xsl/params/index.entry.properties.xml; M: /trunk/xsl/params/generate.legalnotice.link.xml; M: /trunk/xsl/params/section.autolabel.xml; M: /trunk/xsl/params/html.base.xml; M: /trunk/xsl/params/suppress.footer.navigation.xml; M: /trunk/xsl/params/nominal.image.depth.xml; M: /trunk/xsl/params/table.footnote.number.symbols.xml; M: /trunk/xsl/params/table.footnote.number.format.xml; M: /trunk/xsl/params/callout.graphics.xml; M: /trunk/xsl/params/man.break.after.slash.xml; M: /trunk/xsl/params/function.parens.xml; M: /trunk/xsl/params/part.autolabel.xml; M: /trunk/xsl/params/saxon.callouts.xml; M: /trunk/xsl/params/css.decoration.xml; M: /trunk/xsl/params/htmlhelp.button.home.xml; M: /trunk/xsl/params/email.delimiters.enabled.xml; M: /trunk/xsl/params/column.count.lot.xml; M: /trunk/xsl/params/draft.mode.xml; M: /trunk/xsl/params/use.role.for.mediaobject.xml; M: /trunk/xsl/params/refentry.separator.xml; M: /trunk/xsl/params/man.font.funcsynopsisinfo.xml; M: /trunk/xsl/params/man.output.manifest.filename.xml; M: /trunk/xsl/params/process.empty.source.toc.xml; M: /trunk/xsl/params/man.output.in.separate.dir.xml; M: /trunk/xsl/params/graphicsize.use.img.src.path.xml; M: /trunk/xsl/params/man.output.encoding.xml; M: /trunk/xsl/params/column.gap.lot.xml; M: /trunk/xsl/params/profile.role.xml; M: /trunk/xsl/params/column.count.titlepage.xml; M: /trunk/xsl/params/show.comments.xml; M: /trunk/xsl/params/informalfigure.properties.xml; M: /trunk/xsl/params/entry.propagates.style.xml; M: /trunk/xsl/params/bibliography.collection.xml; M: /trunk/xsl/params/contrib.inline.enabled.xml; M: /trunk/xsl/params/section.title.level5.properties.xml; M: /trunk/xsl/params/fop.extensions.xml; M: /trunk/xsl/params/htmlhelp.button.jump1.xml; M: /trunk/xsl/params/man.hyphenate.urls.xml; M: /trunk/xsl/params/profile.condition.xml; M: /trunk/xsl/params/header.column.widths.xml; M: /trunk/xsl/params/annotation.js.xml; M: /trunk/xsl/params/chunker.output.standalone.xml; M: /trunk/xsl/params/targets.filename.xml; M: /trunk/xsl/params/default.float.class.xml; M: /trunk/xsl/params/chapter.autolabel.xml; M: /trunk/xsl/params/sidebar.float.type.xml; M: /trunk/xsl/params/profile.separator.xml; M: /trunk/xsl/params/generate.index.xml; M: /trunk/xsl/params/nongraphical.admonition.properties.xml; M: /trunk/xsl/params/navig.graphics.xml; M: /trunk/xsl/params/htmlhelp.button.next.xml; M: /trunk/xsl/params/insert.olink.pdf.frag.xml; M: /trunk/xsl/params/htmlhelp.button.stop.xml; M: /trunk/xsl/params/footnote.font.size.xml; M: /trunk/xsl/params/profile.value.xml; M: /trunk/xsl/params/ebnf.table.border.xml; M: /trunk/xsl/params/htmlhelp.hhc.folders.instead.books.xml; M: /trunk/xsl/params/glossary.as.blocks.xml; M: /trunk/xsl/params/body.end.indent.xml; M: /trunk/xsl/params/use.role.as.xrefstyle.xml; M: /trunk/xsl/params/man.indent.blurbs.xml; M: /trunk/xsl/params/chunker.output.encoding.xml; M: /trunk/xsl/params/chunker.output.omit-xml-declaration.xml; M: /trunk/xsl/params/sans.font.family.xml; M: /trunk/xsl/params/html.cleanup.xml; M: /trunk/xsl/params/htmlhelp.hhp.xml; M: /trunk/xsl/params/htmlhelp.only.xml; M: /trunk/xsl/params/eclipse.plugin.name.xml; M: /trunk/xsl/params/section.title.level3.properties.xml; M: /trunk/xsl/params/man.th.extra1.suppress.xml; M: /trunk/xsl/params/chunk.section.depth.xml; M: /trunk/xsl/params/htmlhelp.hhp.tail.xml; M: /trunk/xsl/params/sidebar.title.properties.xml; M: /trunk/xsl/params/hyphenate.xml; M: /trunk/xsl/params/paper.type.xml; M: /trunk/xsl/params/chunk.tocs.and.lots.has.title.xml; M: /trunk/xsl/params/symbol.font.family.xml; M: /trunk/xsl/params/page.margin.bottom.xml; M: /trunk/xsl/params/callout.unicode.number.limit.xml; M: /trunk/xsl/params/itemizedlist.properties.xml; M: /trunk/xsl/params/root.filename.xml; M: /trunk/xsl/params/tablecolumns.extension.xml; M: /trunk/xsl/params/htmlhelp.show.favorities.xml; M: /trunk/xsl/params/informaltable.properties.xml; M: /trunk/xsl/params/revhistory.table.cell.properties.xml; M: /trunk/xsl/params/htmlhelp.default.topic.xml; M: /trunk/xsl/params/compact.list.item.spacing.xml; M: /trunk/xsl/params/page.height.portrait.xml; M: /trunk/xsl/params/html.head.legalnotice.link.types.xml; M: /trunk/xsl/params/passivetex.extensions.xml; M: /trunk/xsl/params/orderedlist.label.properties.xml; M: /trunk/xsl/params/othercredit.like.author.enabled.xml; M: /trunk/xsl/params/header.content.properties.xml; M: /trunk/xsl/params/refentry.meta.get.quietly.xml; M: /trunk/xsl/params/section.properties.xml; M: /trunk/xsl/params/htmlhelp.button.hideshow.xml; M: /trunk/xsl/params/simplesect.in.toc.xml; M: /trunk/xsl/params/chunk.quietly.xml; M: /trunk/xsl/params/htmlhelp.enumerate.images.xml; M: /trunk/xsl/params/section.title.level1.properties.xml; M: /trunk/xsl/params/qanda.defaultlabel.xml; M: /trunk/xsl/params/htmlhelp.enhanced.decompilation.xml; M: /trunk/xsl/params/man.th.title.max.length.xml; M: /trunk/xsl/params/footnote.number.format.xml; M: /trunk/xsl/params/body.margin.bottom.xml; M: /trunk/xsl/params/htmlhelp.window.geometry.xml; M: /trunk/xsl/params/htmlhelp.button.jump2.xml; M: /trunk/xsl/params/use.svg.xml; M: /trunk/xsl/params/qanda.title.level6.properties.xml; M: /trunk/xsl/params/collect.xref.targets.xml; M: /trunk/xsl/params/html.extra.head.links.xml; M: /trunk/xsl/params/variablelist.as.table.xml; M: /trunk/xsl/params/man.indent.width.xml; M: /trunk/xsl/params/eclipse.plugin.id.xml; M: /trunk/xsl/params/linenumbering.width.xml; M: /trunk/xsl/params/axf.extensions.xml; M: /trunk/xsl/params/menuchoice.separator.xml; M: /trunk/xsl/params/glossterm.separation.xml; M: /trunk/xsl/params/htmlhelp.autolabel.xml; M: /trunk/xsl/params/chunk.separate.lots.xml; M: /trunk/xsl/params/man.hyphenate.computer.inlines.xml; M: /trunk/xsl/params/linenumbering.separator.xml; M: /trunk/xsl/params/htmlhelp.title.xml; M: /trunk/xsl/params/index.number.separator.xml; M: /trunk/xsl/params/htmlhelp.button.prev.xml; M: /trunk/xsl/params/refentry.manual.fallback.profile.xml; M: /trunk/xsl/params/table.frame.border.color.xml; M: /trunk/xsl/params/footnote.sep.leader.properties.xml; M: /trunk/xsl/params/hyphenate.verbatim.characters.xml; M: /trunk/xsl/params/table.cell.border.thickness.xml; M: /trunk/xsl/params/template.xml; M: /trunk/xsl/params/margin.note.properties.xml; M: /trunk/xsl/params/man.segtitle.suppress.xml; M: /trunk/xsl/params/generate.toc.xml; M: /trunk/xsl/params/formal.object.properties.xml; M: /trunk/xsl/params/footnote.mark.properties.xml; M: /trunk/xsl/params/header.table.height.xml; M: /trunk/xsl/params/htmlhelp.button.back.xml; M: /trunk/xsl/params/qanda.title.level4.properties.xml; M: /trunk/xsl/params/man.links.are.numbered.xml; M: /trunk/xsl/params/manual.toc.xml; M: /trunk/xsl/params/olink.lang.fallback.sequence.xml; M: /trunk/xsl/params/refentry.manual.profile.enabled.xml; M: /trunk/xsl/params/ulink.hyphenate.chars.xml; M: /trunk/xsl/params/manifest.xml; M: /trunk/xsl/params/olink.fragid.xml; M: /trunk/xsl/params/refentry.date.profile.xml; M: /trunk/xsl/params/linenumbering.extension.xml; M: /trunk/xsl/params/component.title.properties.xml; M: /trunk/xsl/params/alignment.xml; M: /trunk/xsl/params/refentry.version.profile.xml; M: /trunk/xsl/params/ebnf.assignment.xml; M: /trunk/xsl/params/htmlhelp.button.print.xml; M: /trunk/xsl/params/annotation.support.xml; M: /trunk/xsl/params/sidebar.float.width.xml; M: /trunk/xsl/params/normal.para.spacing.xml; M: /trunk/xsl/params/xref.title-page.separator.xml; M: /trunk/xsl/params/callout.unicode.font.xml; M: /trunk/xsl/params/default.table.frame.xml; M: /trunk/xsl/params/pages.template.xml; M: /trunk/xsl/params/htmlhelp.button.zoom.xml; M: /trunk/xsl/params/admonition.title.properties.xml; M: /trunk/xsl/params/callout.graphics.extension.xml; M: /trunk/xsl/params/make.valid.html.xml; M: /trunk/xsl/params/qanda.title.level2.properties.xml; M: /trunk/xsl/params/page.margin.top.xml; M: /trunk/xsl/params/xep.index.item.properties.xml; M: /trunk/xsl/params/section.level5.properties.xml; M: /trunk/xsl/params/line-height.xml; M: /trunk/xsl/params/table.cell.border.color.xml; M: /trunk/xsl/params/qandadiv.autolabel.xml; M: /trunk/xsl/params/xref.label-title.separator.xml; M: /trunk/xsl/params/chunk.tocs.and.lots.xml; M: /trunk/xsl/params/man.font.funcprototype.xml; M: /trunk/xsl/params/process.source.toc.xml; M: /trunk/xsl/params/page.orientation.xml; M: /trunk/xsl/params/refentry.generate.name.xml; M: /trunk/xsl/params/navig.showtitles.xml; M: /trunk/xsl/params/table.table.properties.xml; M: /trunk/xsl/params/arbortext.extensions.xml; M: /trunk/xsl/params/informalequation.properties.xml; M: /trunk/xsl/params/headers.on.blank.pages.xml; M: /trunk/xsl/params/table.footnote.properties.xml; M: /trunk/xsl/params/root.properties.xml; M: /trunk/xsl/params/htmlhelp.display.progress.xml; M: /trunk/xsl/params/htmlhelp.hhp.windows.xml; M: /trunk/xsl/params/graphical.admonition.properties.xml; M: /trunk/xsl/params/refclass.suppress.xml; M: /trunk/xsl/params/profile.conformance.xml; M: /trunk/xsl/params/htmlhelp.button.forward.xml; M: /trunk/xsl/params/segmentedlist.as.table.xml; M: /trunk/xsl/params/margin.note.float.type.xml; M: /trunk/xsl/params/man.table.footnotes.divider.xml; M: /trunk/xsl/params/man.output.quietly.xml; M: /trunk/xsl/params/htmlhelp.hhc.show.root.xml; M: /trunk/xsl/params/footers.on.blank.pages.xml; M: /trunk/xsl/params/crop.mark.offset.xml; M: /trunk/xsl/params/olink.doctitle.xml; M: /trunk/xsl/params/section.level3.properties.xml; M: /trunk/xsl/params/callout.unicode.xml; M: /trunk/xsl/params/formal.procedures.xml; M: /trunk/xsl/params/toc.section.depth.xml; M: /trunk/xsl/params/index.prefer.titleabbrev.xml; M: /trunk/xsl/params/nominal.image.width.xml; M: /trunk/xsl/params/htmlhelp.show.menu.xml; M: /trunk/xsl/params/linenumbering.everyNth.xml; M: /trunk/xsl/params/double.sided.xml; M: /trunk/xsl/params/generate.revhistory.link.xml; M: /trunk/xsl/params/olink.properties.xml; M: /trunk/xsl/params/tex.math.in.alt.xml; M: /trunk/xsl/params/man.output.subdirs.enabled.xml; M: /trunk/xsl/params/section.title.properties.xml; M: /trunk/xsl/params/column.count.back.xml; M: /trunk/xsl/params/toc.indent.width.xml; M: /trunk/xsl/params/man.charmap.uri.xml; M: /trunk/xsl/params/index.method.xml; M: /trunk/xsl/params/generate.section.toc.level.xml; M: /trunk/xsl/params/page.width.portrait.xml; M: /trunk/xsl/params/man.th.extra2.max.length.xml; M: /trunk/xsl/params/abstract.properties.xml; M: /trunk/xsl/params/revhistory.table.properties.xml; M: /trunk/xsl/params/nominal.table.width.xml; M: /trunk/xsl/params/ulink.show.xml; M: /trunk/xsl/params/htmlhelp.button.jump1.title.xml; M: /trunk/xsl/params/index.div.title.properties.xml; M: /trunk/xsl/params/profile.userlevel.xml; M: /trunk/xsl/params/html.cellpadding.xml; M: /trunk/xsl/params/orderedlist.label.width.xml; M: /trunk/xsl/params/crop.marks.xml; M: /trunk/xsl/params/menuchoice.menu.separator.xml; M: /trunk/xsl/params/author.othername.in.middle.xml; M: /trunk/xsl/params/section.level1.properties.xml; M: /trunk/xsl/params/textdata.default.encoding.xml; M: /trunk/xsl/params/label.from.part.xml; M: /trunk/xsl/params/use.embed.for.svg.xml; M: /trunk/xsl/params/list.item.spacing.xml; M: /trunk/xsl/params/htmlhelp.hhc.width.xml; M: /trunk/xsl/params/column.gap.body.xml; M: /trunk/xsl/params/rootid.xml; M: /trunk/xsl/params/glosslist.as.blocks.xml; M: /trunk/xsl/params/index.range.separator.xml; M: /trunk/xsl/params/html.ext.xml; M: /trunk/xsl/params/callout.list.table.xml; M: /trunk/xsl/params/highlight.source.xml; M: /trunk/xsl/params/show.revisionflag.xml; M: /trunk/xsl/params/man.output.manifest.enabled.xml; M: /trunk/xsl/params/make.single.year.ranges.xml; M: /trunk/xsl/params/pgwide.properties.xml; M: /trunk/xsl/params/generate.id.attributes.xml; M: /trunk/xsl/params/emphasis.propagates.style.xml; M: /trunk/xsl/params/abstract.title.properties.xml; M: /trunk/xsl/params/htmlhelp.hhc.xml; M: /trunk/xsl/params/monospace.properties.xml; M: /trunk/xsl/params/htmlhelp.hhk.xml; M: /trunk/xsl/params/table.borders.with.css.xml; M: /trunk/xsl/params/man.links.are.underlined.xml; M: /trunk/xsl/params/profile.vendor.xml; M: /trunk/xsl/params/shade.verbatim.xml; M: /trunk/xsl/params/callout.graphics.path.xml; M: /trunk/xsl/params/olink.debug.xml; M: /trunk/xsl/params/make.graphic.viewport.xml; M: /trunk/xsl/params/footnote.number.symbols.xml; M: /trunk/xsl/params/man.charmap.enabled.xml; M: /trunk/xsl/params/page.height.xml; M: /trunk/xsl/params/htmlhelp.button.jump1.url.xml; M: /trunk/xsl/params/man.font.table.title.xml; M: /trunk/xsl/params/revhistory.title.properties.xml; M: /trunk/xsl/params/chunker.output.media-type.xml; M: /trunk/xsl/params/glossterm.width.xml; M: /trunk/xsl/params/points.per.em.xml; M: /trunk/xsl/params/page.margin.inner.xml; M: /trunk/xsl/params/itemizedlist.label.width.xml; M: /trunk/xsl/params/ulink.hyphenate.xml; M: /trunk/xsl/params/crop.mark.bleed.xml; M: /trunk/xsl/params/use.id.as.filename.xml; M: /trunk/xsl/params/section.title.level6.properties.xml; M: /trunk/xsl/params/highlight.default.language.xml; M: /trunk/xsl/params/man.th.extra2.suppress.xml; M: /trunk/xsl/params/id.warnings.xml; M: /trunk/xsl/params/title.margin.left.xml; M: /trunk/xsl/params/chunker.output.doctype-system.xml; M: /trunk/xsl/params/man.indent.verbatims.xml; M: /trunk/xsl/params/table.frame.border.thickness.xml; M: /trunk/xsl/params/monospace.verbatim.properties.xml; M: /trunk/xsl/params/formal.title.properties.xml; M: /trunk/xsl/params/margin.note.width.xml; M: /trunk/xsl/params/man.hyphenate.filenames.xml; M: /trunk/xsl/params/blockquote.properties.xml; M: /trunk/xsl/params/callout.defaultcolumn.xml; M: /trunk/xsl/params/profile.security.xml; M: /trunk/xsl/params/informal.object.properties.xml; M: /trunk/xsl/params/formal.title.placement.xml; M: /trunk/xsl/params/draft.watermark.image.xml; M: /trunk/xsl/params/equation.properties.xml; M: /trunk/xsl/params/body.font.family.xml; M: /trunk/xsl/params/ignore.image.scaling.xml; M: /trunk/xsl/params/chunk.first.sections.xml; M: /trunk/xsl/params/base.dir.xml; M: /trunk/xsl/params/footnote.properties.xml; M: /trunk/xsl/params/olink.outline.ext.xml; M: /trunk/xsl/params/img.src.path.xml; M: /trunk/xsl/params/qanda.title.properties.xml; M: /trunk/xsl/params/ebnf.statement.terminator.xml; M: /trunk/xsl/params/callouts.extension.xml; M: /trunk/xsl/params/manifest.in.base.dir.xml; M: /trunk/xsl/params/fop1.extensions.xml; M: /trunk/xsl/params/olink.sysid.xml; M: /trunk/xsl/params/section.title.level4.properties.xml; M: /trunk/xsl/params/monospace.font.family.xml; M: /trunk/xsl/params/l10n.gentext.language.xml; M: /trunk/xsl/params/graphic.default.extension.xml; M: /trunk/xsl/params/default.image.width.xml; M: /trunk/xsl/params/htmlhelp.button.refresh.xml; M: /trunk/xsl/params/chunker.output.cdata-section-elements.xml; M: /trunk/xsl/params/admon.graphics.path.xml; M: /trunk/xsl/params/admon.style.xml; M: /trunk/xsl/params/profile.revision.xml; M: /trunk/xsl/params/generate.manifest.xml; M: /trunk/xsl/params/html.longdesc.xml; M: /trunk/xsl/params/footer.rule.xml; M: /trunk/xsl/params/eclipse.plugin.provider.xml; M: /trunk/xsl/params/refentry.source.name.profile.xml; M: /trunk/xsl/params/toc.max.depth.xml; M: /trunk/xsl/params/chunker.output.indent.xml; M: /trunk/xsl/params/html.head.legalnotice.link.multiple.xml; M: /trunk/xsl/params/toc.list.type.xml; M: /trunk/xsl/params/link.mailto.url.xml; M: /trunk/xsl/params/table.properties.xml; M: /trunk/xsl/params/side.float.properties.xml; M: /trunk/xsl/params/man.charmap.use.subset.xml; M: /trunk/xsl/params/annotation.graphic.open.xml; M: /trunk/xsl/params/html.cellspacing.xml; M: /trunk/xsl/params/default.table.width.xml; M: /trunk/xsl/params/xep.extensions.xml; M: /trunk/xsl/params/admonition.properties.xml; M: /trunk/xsl/params/toc.margin.properties.xml; M: /trunk/xsl/params/chunk.toc.xml; M: /trunk/xsl/params/table.entry.padding.xml; M: /trunk/xsl/params/header.rule.xml; M: /trunk/xsl/params/glossentry.show.acronym.xml; M: /trunk/xsl/params/variablelist.as.blocks.xml; M: /trunk/xsl/params/man.hyphenate.xml; M: /trunk/xsl/params/refentry.source.name.profile.enabled.xml; M: /trunk/xsl/params/section.label.includes.component.label.xml; M: /trunk/xsl/params/bridgehead.in.toc.xml; M: /trunk/xsl/params/section.title.level2.properties.xml; M: /trunk/xsl/params/admon.graphics.extension.xml; M: /trunk/xsl/params/inherit.keywords.xml; M: /trunk/xsl/params/insert.xref.page.number.xml; M: /trunk/xsl/params/pixels.per.inch.xml; M: /trunk/xsl/params/refentry.pagebreak.xml; M: /trunk/xsl/params/profile.lang.xml; M: /trunk/xsl/params/insert.olink.page.number.xml; M: /trunk/xsl/params/generate.meta.abstract.xml; M: /trunk/xsl/params/graphicsize.extension.xml; M: /trunk/xsl/params/man.indent.lists.xml; M: /trunk/xsl/params/funcsynopsis.decoration.xml; M: /trunk/xsl/params/runinhead.title.end.punct.xml; M: /trunk/xsl/params/man.string.subst.map.xml; M: /trunk/xsl/params/man.links.list.enabled.xml; M: /trunk/xsl/params/section.autolabel.max.depth.xml; M: /trunk/xsl/params/htmlhelp.show.advanced.search.xml; M: /trunk/xsl/params/htmlhelp.map.file.xml; M: /trunk/xsl/params/l10n.gentext.use.xref.language.xml; M: /trunk/xsl/params/body.font.size.xml; M: /trunk/xsl/params/html.stylesheet.type.xml; M: /trunk/xsl/params/refentry.xref.manvolnum.xml; M: /trunk/xsl/params/runinhead.default.title.end.punct.xml; M: /trunk/xsl/params/navig.graphics.extension.xml; M: /trunk/xsl/params/itemizedlist.label.properties.xml; M: /trunk/xsl/params/htmlhelp.force.map.and.alias.xml; M: /trunk/xsl/params/profile.os.xml; M: /trunk/xsl/params/htmlhelp.alias.file.xml; M: /trunk/xsl/params/page.margin.outer.xml; M: /trunk/xsl/params/annotation.graphic.close.xml; M: /trunk/xsl/params/eclipse.autolabel.xml; M: /trunk/xsl/params/table.frame.border.style.xml; M: /trunk/xsl/params/navig.graphics.path.xml; M: /trunk/xsl/params/htmlhelp.hhc.binary.xml; M: /trunk/xsl/params/index.on.type.xml; M: /trunk/xsl/params/target.database.document.xml; M: /trunk/xsl/params/man.subheading.divider.xml; M: /trunk/xsl/params/chunker.output.method.xml; M: /trunk/xsl/params/make.index.markup.xml; M: /trunk/xsl/params/olink.base.uri.xml; M: /trunk/xsl/params/phrase.propagates.style.xml; M: /trunk/xsl/params/man.indent.refsect.xml; M: /trunk/xsl/params/example.properties.xml; M: /trunk/xsl/params/man.font.table.headings.xml; M: /trunk/xsl/params/profile.revisionflag.xml; M: /trunk/xsl/params/region.after.extent.xml; M: /trunk/xsl/params/qanda.title.level5.properties.xml; M: /trunk/xsl/params/marker.section.level.xml; M: /trunk/xsl/params/footer.table.height.xml; M: /trunk/xsl/params/autotoc.label.separator.xml; M: /trunk/xsl/params/footer.column.widths.xml; M: /trunk/xsl/params/hyphenate.verbatim.xml; M: /trunk/xsl/params/xref.properties.xml; M: /trunk/xsl/params/man.output.base.dir.xml; M: /trunk/xsl/params/man.links.list.heading.xml; M: /trunk/xsl/params/insert.link.page.number.xml; M: /trunk/xsl/params/htmlhelp.button.jump2.title.xml; M: /trunk/xsl/params/l10n.lang.value.rfc.compliant.xml - Michael(tm) Smith Updated index.method doc to describe revised setup for importing index extensions.M: /trunk/xsl/params/index.method.xml - Robert Stayton Added several new HTML parameters for controlling appearance of content on HTML title pages: contrib.inline.enabled: If non-zero (the default), output of the contrib element is displayed as inline content rather than as block content. othercredit.like.author.enabled: If non-zero, output of the othercredit element on titlepages is displayed in the same style as author and editor output. If zero (the default), othercredit output is displayed using a style different than that of author and editor. blurb.on.titlepage.enabled: If non-zero, output from authorblurb and personblurb elements is displayed on title pages. If zero (the default), output from those elements is suppressed on title pages (unless you are using a titlepage customization that causes them to be included). editedby.enabled If non-zero (the default), a localized Edited by heading is displayed above editor names in output of the editor element.A: /trunk/xsl/params/contrib.inline.enabled.xml; A: /trunk/xsl/params/blurb.on.titlepage.enabled.xml; A: /trunk/xsl/params/othercredit.like.author.enabled.xml; A: /trunk/xsl/params/editedby.enabled.xml - Michael(tm) Smith Added new email.delimiters.enabled param. If non-zero (the default), delimiters are generated around e-mail addresses (output of the email element). If zero, the delimiters are suppressed.A: /trunk/xsl/params/email.delimiters.enabled.xml - Michael(tm) Smith Added qanda.nested.in.toc param. Default value is zero. If non-zero, instances of "nested" Qandaentry (ones that are children of Answer elements) are displayed in the TOC. Closes patch 1509018 (from Daniel Leidert). Currently on affects HTML output (no patch for FO output provided).A: /trunk/xsl/params/qanda.nested.in.toc.xml - Michael(tm) Smith Initial support of syntax highlighting of programlistings.A: /trunk/xsl/params/highlight.source.xml; A: /trunk/xsl/params/highlight.default.language.xml - Jirka Kosek Tools The following changes have been made to the tools code since the 1.70.1 release. Racheted down font sizes of headings in example makefile FO output.M: /trunk/xsl/tools/make/Makefile.DocBook - Michael(tm) Smith Added param and attribute set to example makefile, for getting wrapping in verbatims in FO output.M: /trunk/xsl/tools/make/Makefile.DocBook - Michael(tm) Smith Renamed Makefile.paramDoc to Makefile.docParam.A: /trunk/xsl/tools/make/Makefile.docParam; D: /trunk/xsl/tools/make/Makefile.paramDoc - Michael(tm) Smith Added Makefile.paramDoc file, for creating versions of param.xsl files with doc embedded.A: /trunk/xsl/tools/make/Makefile.paramDoc - Michael(tm) Smith Added variable to example makefile for controlling whether HTML or XHTML is generated.M: /trunk/xsl/tools/make/Makefile.DocBook - Michael(tm) Smith
        Release: 1.70.1 This is a stable release of the 1.70 stylesheets. It includes only a few small changes from 1.70.0. The following is a list of changes that have been made since the 1.70.0 release. FO The following changes have been made to the fo code since the 1.70.0 release. Added three new attribute sets (revhistory.title.properties, revhistory.table.properties and revhistory.table.cell.properties) for controlling appearance of revhistory in FO output. Modified: fo/block.xsl,1.34; fo/param.ent,1.101; fo/param.xweb,1.114; fo/titlepage.xsl,1.41; params/revhistory.table.cell.properties.xml,1.1; params/revhistory.table.properties.xml,1.1; params/revhistory.title.properties.xml,1.1 - Jirka Kosek Support DBv5 revisions with full author name (not only authorinitials) Modified: fo/block.xsl,1.33; fo/titlepage.xsl,1.40 - Jirka Kosek HTML The following changes have been made to the html code since the 1.70.0 release. Support DBv5 revisions with full author name (not only authorinitials) Modified: html/block.xsl,1.23; html/titlepage.xsl,1.34 - Jirka Kosek HTMLHelp The following changes have been made to the htmlhelp code since the 1.70.0 release. htmlhelp.generate.index is now param, not variable. This means that you can override its setting from outside. This is useful when you generate indexterms on the fly (see http://www.xml.com/pub/a/2004/07/14/dbndx.html?page=3). Modified: htmlhelp/htmlhelp-common.xsl,1.38 - Jirka Kosek Support chunk.tocs.and.lots in HTML Help Modified: htmlhelp/htmlhelp-common.xsl,1.37 - Jirka Kosek Params The following changes have been made to the params code since the 1.70.0 release. Added three new attribute sets (revhistory.title.properties, revhistory.table.properties and revhistory.table.cell.properties) for controlling appearance of revhistory in FO output. Modified: fo/block.xsl,1.34; fo/param.ent,1.101; fo/param.xweb,1.114; fo/titlepage.xsl,1.41; params/revhistory.table.cell.properties.xml,1.1; params/revhistory.table.properties.xml,1.1; params/revhistory.title.properties.xml,1.1 - Jirka Kosek Release: 1.70.0 As with all DocBook Project dot-zero releases, this is an experimental release. It will be followed shortly by a stable release. This release adds a number of new features, including: support for selecting alternative index-collation methods (in particular, support for using a collation library developed by Eliot Kimber) improved handling of DocBook 5 document instances (through a namespace-stripping mechanism) full support for CALS and HTML tables in manpages output a mechanism for preserving relative URIs in documents that make use of XInclude support for the "new" .90 version of FOP enhanced capabilities for controlling formatting of lists in HTML and FO output autogeneration of AUTHOR and COPYRIGHT sections in manpages output support for generating crop marks in FO/PDF output support for qandaset as a root element in FO output support for floatstyle and orient on all table types support for floatstyle in figure, and example pgwide.properties attribute-set supports extending figure, example and table into the left indent area instead of spanning multiple columns. The following is a detailed list of enhancements and API changes that have been made since the 1.69.1 release. Common The following changes have been made to the common code since the 1.69.1 release. Add the xsl:key for the kimber indexing method. Modified: common/autoidx-ng.xsl,1.2 - Robert Stayton Add support for qandaset. Modified: common/labels.xsl,1.37; common/subtitles.xsl,1.7; common/titles.xsl,1.35 - Robert Stayton Support dbhtml/dbfo start PI for orderedlist numbering in both HTML and FO Modified: common/common.xsl,1.61; html/lists.xsl,1.50 - Norman Walsh Added CVS header. Modified: common/stripns.xsl,1.12 - Robert Stayton Changed content model of text element to ANY rather than #PCDATA because they could contain markup. Modified: common/targetdatabase.dtd,1.7 - Robert Stayton Added refentry.meta.get.quietly param. If zero (the default), notes and warnings about "missing" markup are generated during gathering of refentry metadata. If non-zero, the metadata is gathered "quietly" -- that is, the notes and warnings are suppressed. NOTE: If you are processing a large amount of refentry content, you may be able to speed up processing significantly by setting a non-zero value for refentry.meta.get.quietly. Modified: common/refentry.xsl,1.17; manpages/param.ent,1.15; manpages/param.xweb,1.17; params/refentry.meta.get.quietly.xml,1.1 - Michael(tm) Smith After namespace stripping, the source document is the temporary tree created by the stripping process and it has the wrong base URI for relative references. Earlier versions of this code used to try to fix that by patching the elements with relative @fileref attributes. That was inadequate because it calculated an absolute base URI without considering that there might be xml:base attributes already in effect. It seems obvious now that the right thing to do is simply to put the xml:base on the root of the document. And that seems to work. Modified: common/stripns.xsl,1.7 - Norman Walsh Added support for "software" and "sectdesc" class values on refmiscinfo; "software" is treated identically to "source", and "setdesc" is treated identically to "manual". Modified: common/refentry.xsl,1.10; params/man.th.extra2.max.length.xml,1.3; params/refentry.source.name.profile.xml,1.4 - Michael(tm) Smith Added support for DocBook 5 namespace-stripping in manpages stylesheet. Closes request #1210692. Modified: common/common.xsl,1.56; manpages/docbook.xsl,1.57 - Michael(tm) Smith Added <xsl:template match="/"> to make stripns.xsl usable as a standalone stylesheet for stripping out DocBook 5/NG to DocBook 4. Note that DocBook XSLT drivers that include this stylesheet all override the match="/" template. Modified: common/stripns.xsl,1.4 - Michael(tm) Smith Number figures, examples, and tables from book if there is no prefix (i.e. if chapter.autolabel is set to 0). This avoids having the list of figures where the figures mysteriously restart their numeration periodically when chapter.autolabel is set to 0. Modified: common/labels.xsl,1.36 - David Cramer Add task template in title.markup mode. Modified: common/titles.xsl,1.34 - Robert Stayton Add children (with ids) of formal objects to target data. Modified: common/targets.xsl,1.10 - Robert Stayton Added support for case when personname doesn't contain specific name markup (as allowed in DocBook 5.0) Modified: common/common.xsl,1.54 - Jirka Kosek Extensions The following changes have been made to the extensions code since the 1.69.1 release. Support Xalan 2.7 Modified: extensions/xalan27/.cvsignore,1.1; extensions/xalan27/build.xml,1.1; extensions/xalan27/nbproject/.cvsignore,1.1; extensions/xalan27/nbproject/build-impl.xml,1.1; extensions/xalan27/nbproject/genfiles.properties,1.1; extensions/xalan27/nbproject/project.properties,1.1; extensions/xalan27/nbproject/project.xml,1.1; extensions/xalan27/src/com/nwalsh/xalan/CVS.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/Callout.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/FormatCallout.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/FormatDingbatCallout.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/FormatGraphicCallout.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/FormatTextCallout.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/FormatUnicodeCallout.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/Func.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/ImageIntrinsics.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/Params.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/Table.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/Text.java,1.1; extensions/xalan27/src/com/nwalsh/xalan/Verbatim.java,1.1 - Norman Walsh Handle the case where the imageFn is actually a URI. This still needs work. Modified: extensions/saxon643/com/nwalsh/saxon/ImageIntrinsics.java,1.4 - Norman Walsh FO The following changes have been made to the fo code since the 1.69.1 release. Adapted to the new indexing code. Now works just like a wrapper that calls kosek indexing method, originally implemented here. Modified: fo/autoidx-ng.xsl,1.5 - Jirka Kosek Added parameters for header/footer table minimum height. Modified: fo/pagesetup.xsl,1.60; fo/param.ent,1.100; fo/param.xweb,1.113 - Robert Stayton Add the index.method parameter. Modified: fo/param.ent,1.99; fo/param.xweb,1.112 - Robert Stayton Integrate support for three indexing methods: - the original English-only method. - Jirka Kosek's method using EXSLT extensions. - Eliot Kimber's method using Saxon extensions. Use the 'index.method' parameter to select. Modified: fo/autoidx.xsl,1.38 - Robert Stayton Add support for TOC for qandaset in fo output. Modified: fo/autotoc.xsl,1.30; fo/qandaset.xsl,1.20 - Robert Stayton Added parameter ulink.hyphenate.chars. Added parameter insert.link.page.number. Modified: fo/param.ent,1.98; fo/param.xweb,1.111 - Robert Stayton Implemented feature request #942524 to add insert.link.page.number to allow link element cross references to have a page number. Modified: fo/xref.xsl,1.67 - Robert Stayton Add support for ulink.hyphenate.chars so more characters can be break points in urls. Modified: fo/xref.xsl,1.66 - Robert Stayton Implemented patch #1075144 to make the url text in a ulink in FO output an active link as well. Modified: fo/xref.xsl,1.65 - Robert Stayton table footnotes now have their own table.footnote.properties attribute set. Modified: fo/footnote.xsl,1.23 - Robert Stayton Add qandaset to root.elements. Modified: fo/docbook.xsl,1.41 - Robert Stayton Added mode="page.sequence" to make it easier to put content into a page sequence. First used for qandaset. Modified: fo/component.xsl,1.37 - Robert Stayton Implemented feature request #1434408 to support formatting of biblioentry. Modified: fo/biblio.xsl,1.35 - Robert Stayton Added biblioentry.properties. Modified: fo/param.ent,1.97; fo/param.xweb,1.110 - Robert Stayton Support PTC/Arbortext bookmarks Modified: fo/docbook.xsl,1.40; fo/ptc.xsl,1.1 - Norman Walsh Added table.footnote.properties to permit table footnotes to format differently from regular footnotes. Modified: fo/param.ent,1.96; fo/param.xweb,1.109 - Robert Stayton Refactored table templates to unify their processing and support all options in all types. Now table and informaltable, in both Cals and Html markup, use the same templates where possible, and all support pgwide, rotation, and floats. There is also a placeholder table.container template to support wrapping a table in a layout table, so the XEP table title "continued" extension can be more easily implemented. Modified: fo/formal.xsl,1.52; fo/htmltbl.xsl,1.9; fo/table.xsl,1.48 - Robert Stayton Added new attribute set toc.line.properties for controlling appearance of lines in ToC/LoT Modified: fo/autotoc.xsl,1.29; fo/param.ent,1.95; fo/param.xweb,1.108 - Jirka Kosek Added support for float to example and equation. Added support for pgwide to figure, example, and equation (the latter two via a dbfo pgwide="1" processing instruction). Modified: fo/formal.xsl,1.51 - Robert Stayton Add pgwide.properties attribute-set. Modified: fo/param.ent,1.94; fo/param.xweb,1.107 - Robert Stayton Added refclass.suppress param. If the value of refclass.suppress is non-zero, then display refclass contents is suppressed in output. Affects HTML and FO output only. Modified: fo/param.ent,1.93; fo/param.xweb,1.106; html/param.ent,1.90; html/param.xweb,1.99; params/refclass.suppress.xml,1.1 - Michael(tm) Smith Improved support for task subelements Modified: fo/task.xsl,1.3; html/task.xsl,1.3 - Jirka Kosek Adjusted spacing around K&R-formatted Funcdef and Paramdef output such that it can more easily be discerned where one ends and the other begins. Closes #1213264. Modified: fo/synop.xsl,1.18 - Michael(tm) Smith Made handling of paramdef/parameter in FO output consistent with that in HTML and manpages output. Closes #1213259. Modified: fo/synop.xsl,1.17 - Michael(tm) Smith Made handling of Refnamediv consistent with formatting in HTML and manpages output; specifically, changed so that Refname (comma-separated list of multiple instances found) is used (instead of Refentrytitle as previously), then em-dash, then the Refpurpose. Closes #1212562. Modified: fo/refentry.xsl,1.30 - Michael(tm) Smith Added output of Releaseinfo to recto titlepage ("copyright" page) for Book in FO output. This makes it consistent with HTML output. Closes #1327034. Thanks to Paul DuBois for reporting. Modified: fo/titlepage.templates.xml,1.28 - Michael(tm) Smith Added condition for setting block-progression-dimension.minimum on table-row, instead of height, when fop1.extensions is non-zero. For an explanation of the reason for the change, see: http://wiki.apache.org/xmlgraphics-fop/Troubleshooting/CommonLogMessages Modified: fo/pagesetup.xsl,1.59 - Michael(tm) Smith Added new refclass.suppress param for suppressing display of Refclass in HTML and FO output. Did not add it to manpages because manpages stylesheet is currently just silently ignoring Refclass anyway. Closes request #1461065. Thanks to Davor Ocelic (docelic) for reporting. Modified: fo/refentry.xsl,1.29; html/refentry.xsl,1.23 - Michael(tm) Smith Add support for keep-together PI to informal objects. Modified: fo/formal.xsl,1.50 - Robert Stayton Add support for fop1.extensions. Modified: fo/formal.xsl,1.49; fo/graphics.xsl,1.44; fo/table.xsl,1.47 - Robert Stayton Add support for fop1 bookmarks. Modified: fo/docbook.xsl,1.39 - Robert Stayton Add fop1.extentions parameter to add support for fop development version. Modified: fo/param.ent,1.92; fo/param.xweb,1.105 - Robert Stayton Start supporting fop development version, which will become fop version 1. Modified: fo/fop1.xsl,1.1 - Robert Stayton Add template for task in mode="xref-to". Modified: fo/xref.xsl,1.63; html/xref.xsl,1.57 - Robert Stayton table footnotes now also get footnote.properties attribute-set. Modified: fo/footnote.xsl,1.22 - Robert Stayton Added index.separator named template to compute the separator punctuation based on locale. Modified: fo/autoidx.xsl,1.36 - Robert Stayton Added support for link, olink, and xref within OO Classsynopsis and children. (Because DocBook NG/5 allows it). Modified: fo/synop.xsl,1.15; html/synop.xsl,1.19 - Michael(tm) Smith Support date as an inline Modified: fo/inline.xsl,1.43; html/inline.xsl,1.46 - Norman Walsh Added new parameter keep.relative.image.uris Modified: fo/param.ent,1.91; fo/param.xweb,1.104; html/param.ent,1.87; html/param.xweb,1.96; params/keep.relative.image.uris.xml,1.1 - Norman Walsh Map Unicode space characters U+2000-U+200A to fo:leaders. Modified: fo/docbook.xsl,1.38; fo/passivetex.xsl,1.4; fo/spaces.xsl,1.1 - Jirka Kosek Output a real em dash for em-dash dingbat (instead of two hypens). Modified: fo/fo.xsl,1.7 - Michael(tm) Smith Support default label width parameters for itemized and ordered lists Modified: fo/lists.xsl,1.64; fo/param.ent,1.90; fo/param.xweb,1.103; params/itemizedlist.label.width.xml,1.1; params/orderedlist.label.width.xml,1.1 - Norman Walsh Generate localized title for Refsynopsisdiv if no appropriate Title descendant found in source. Closes #1212398. This change makes behavior for the Synopsis title consistent with the behavior of HTML and manpages output. Also, added xsl:use-attribute-sets="normal.para.spacing" to block generated for Cmdsynopsis output. Previously, that block had no spacing at all specified, which resulted it being crammed up to closely to the Synopsis head. Modified: fo/refentry.xsl,1.28; fo/synop.xsl,1.13 - Michael(tm) Smith Added parameters to support localization of index item punctuation. Modified: fo/autoidx.xsl,1.35 - Robert Stayton Added index.number.separator, index.range.separator, and index.term.separator parameters to support localization of punctuation in index entries. Modified: fo/param.ent,1.89; fo/param.xweb,1.102 - Robert Stayton Added "Cross References" section in HTML doc (for consistency with the FO doc). Also, moved the existing FO "Cross References" section to follow the "Linking" section. Modified: fo/param.xweb,1.101; html/param.xweb,1.95 - Michael(tm) Smith Added ID attribues to all Reference elements (e.g., id="tables" for the doc for section on Table params). So pages for all subsections of ref docs now have stable filenames instead of arbitrary generated filenames. Modified: fo/param.xweb,1.100; html/param.xweb,1.94 - Michael(tm) Smith Added two new parameters for handling of multi-term varlistentry elements: variablelist.term.break.after: When the variablelist.term.break.after is non-zero, it will generate a line break after each term multi-term varlistentry. variablelist.term.separator: When a varlistentry contains multiple term elements, the string specified in the value of the variablelist.term.separator parameter is placed after each term except the last. The default is ", " (a comma followed by a space). To suppress rendering of the separator, set the value of variablelist.term.separator to the empty string (""). These parameters are primarily intended to be useful if you have multi-term varlistentries that have long terms. Closes #1306676. Thanks to Sam Steingold for providing an example "lots of long terms" doc that demonstrated the value of having these options. Also, added normalize-space() call to processing of each term. This change affects all output formats (HTML, PDF, manpages). The default behavior should pretty much remain the same as before, but it is possible (as always) that the change may introduce some new bugginess. Modified: fo/lists.xsl,1.62; fo/param.ent,1.88; fo/param.xweb,1.99; html/lists.xsl,1.48; html/param.ent,1.86; html/param.xweb,1.93; manpages/lists.xsl,1.22; manpages/param.ent,1.14; manpages/param.xweb,1.16; params/variablelist.term.break.after.xml,1.1; params/variablelist.term.separator.xml,1.1 - Michael(tm) Smith Add sidebar titlepage placeholder attset for styles. Modified: fo/titlepage.xsl,1.37 - Robert Stayton Add titlepage for sidebar. Modified: fo/titlepage.templates.xml,1.27 - Robert Stayton Implemented RFE #1292615. Added bunch of new parameters (attribute sets) that affect list presentation: list.block.properties, itemizedlist.properties, orderedlist.properties, itemizedlist.label.properties and orderedlist.label.properties. Default behaviour of stylesheets has not been changed but further customizations will be much more easier. Modified: fo/lists.xsl,1.61; fo/param.ent,1.87; fo/param.xweb,1.98; params/itemizedlist.label.properties.xml,1.1; params/itemizedlist.properties.xml,1.1; params/list.block.properties.xml,1.1; params/orderedlist.label.properties.xml,1.1; params/orderedlist.properties.xml,1.1 - Jirka Kosek Implemented RFE #1242092. You can enable crop marks in your document by setting crop.marks=1 and xep.extensions=1. Appearance of crop marks can be controlled by parameters crop.mark.bleed (6pt), crop.mark.offset (24pt) and crop.mark.width (0.5pt). Also there is new named template called user-xep-pis. You can overwrite it in order to produce some PIs that can control XEP as described in http://www.renderx.com/reference.html#Output_Formats Modified: fo/docbook.xsl,1.36; fo/param.ent,1.86; fo/param.xweb,1.97; fo/xep.xsl,1.23; params/crop.mark.bleed.xml,1.1; params/crop.mark.offset.xml,1.1; params/crop.mark.width.xml,1.1; params/crop.marks.xml,1.1 - Jirka Kosek HTML The following changes have been made to the html code since the 1.69.1 release. implemented index.method parameter and three methods. Modified: html/autoidx.xsl,1.28 - Robert Stayton added index.method parameter to support 3 indexing methods. Modified: html/param.ent,1.94; html/param.xweb,1.103 - Robert Stayton Implemented feature request #1072510 as a processing instruction to permit including external HTML content into HTML output. Modified: html/pi.xsl,1.9 - Robert Stayton Added new parameter chunk.tocs.and.lots.has.title which controls presence of title in a separate chunk with ToC/LoT. Disabling title can be very useful if you are generating frameset output (well, yes those frames, but some customers really want them ;-). Modified: html/chunk-code.xsl,1.15; html/param.ent,1.93; html/param.xweb,1.102; params/chunk.tocs.and.lots.has.title.xml,1.1 - Jirka Kosek Support dbhtml/dbfo start PI for orderedlist numbering in both HTML and FO Modified: common/common.xsl,1.61; html/lists.xsl,1.50 - Norman Walsh Allow ToC without title also for set and book. Modified: html/autotoc.xsl,1.37; html/division.xsl,1.12 - Jirka Kosek Implemented floats uniformly for figure, example, equation and informalfigure, informalexample, and informalequation. Modified: html/formal.xsl,1.22 - Robert Stayton Added the autotoc.label.in.hyperlink param. If the value of autotoc.label.in.hyperlink is non-zero, labels are included in hyperlinked titles in the TOC. If it is instead zero, labels are still displayed prior to the hyperlinked titles, but are not hyperlinked along with the titles. Closes patch #1065868. Thanks to anatoly techtonik for the patch. Modified: html/autotoc.xsl,1.36; html/param.ent,1.92; html/param.xweb,1.101; params/autotoc.label.in.hyperlink.xml,1.1 - Michael(tm) Smith Added two new params: html.head.legalnotice.link.types and html.head.legalnotice.link.multiple. If the value of the generate.legalnotice.link is non-zero, then the stylesheet generates (in the head section of the HTML source) either a single HTML link element or, if the value of the html.head.legalnotice.link.multiple is non-zero, one link element for each link type specified. Each link has the following attributes: - a rel attribute whose value is derived from the value of html.head.legalnotice.link.types - an href attribute whose value is set to the URL of the file containing the legalnotice - a title attribute whose value is set to the title of the corresponding legalnotice (or a title programatically determined by the stylesheet) For example: <link rel="copyright" href="ln-id2524073.html" title="Legal Notice"> Closes #1476450. Thanks to Sam Steingold. Modified: html/chunk-common.xsl,1.45; html/param.ent,1.91; html/param.xweb,1.100; params/generate.legalnotice.link.xml,1.4; params/html.head.legalnotice.link.multiple.xml,1.1; params/html.head.legalnotice.link.types.xml,1.1 - Michael(tm) Smith Added refclass.suppress param. If the value of refclass.suppress is non-zero, then display refclass contents is suppressed in output. Affects HTML and FO output only. Modified: fo/param.ent,1.93; fo/param.xweb,1.106; html/param.ent,1.90; html/param.xweb,1.99; params/refclass.suppress.xml,1.1 - Michael(tm) Smith Improved support for task subelements Modified: fo/task.xsl,1.3; html/task.xsl,1.3 - Jirka Kosek Added new refclass.suppress param for suppressing display of Refclass in HTML and FO output. Did not add it to manpages because manpages stylesheet is currently just silently ignoring Refclass anyway. Closes request #1461065. Thanks to Davor Ocelic (docelic) for reporting. Modified: fo/refentry.xsl,1.29; html/refentry.xsl,1.23 - Michael(tm) Smith Process alt text with normalize-space(). Replace tab indents with spaces. Modified: html/graphics.xsl,1.57 - Robert Stayton Content of citation element is automatically linked to the bibliographic entry with the corresponding abbrev. Modified: html/biblio.xsl,1.26; html/inline.xsl,1.47; html/xref.xsl,1.58 - Jirka Kosek Add template for task in mode="xref-to". Modified: fo/xref.xsl,1.63; html/xref.xsl,1.57 - Robert Stayton Suppress ID warnings if the .warnings parameter is 0 Modified: html/html.xsl,1.17 - Norman Walsh Add support for floatstyle to figure. Modified: html/formal.xsl,1.21 - Robert Stayton Handling of xref to area/areaset need support in extensions code also. I currently have no time to touch extensions code, so code is here to be enabled when extension is fixed also. Modified: html/xref.xsl,1.56 - Jirka Kosek Added 3 parameters for overriding gentext for index punctuation. Modified: html/param.ent,1.89; html/param.xweb,1.98 - Robert Stayton Added parameters to support localization of index item punctuation. Added index.separator named template to compute the separator punctuation based on locale. Modified: html/autoidx.xsl,1.27 - Robert Stayton Added a <div class="{$class}-contents"> wrapper around output of contents of all formal objects. Also, added an optional <br class="{class}-break"/> linebreak after all formal objects. WARNING: Because this change places an additional DIV between the DIV wrapper for the equation and the equation contents, it may break some existing CSS stylesheets that have been created with the assumption that there would never be an intervening DIV there. The following is an example of what Equation output looks like as a result of the changes described above. <div class="equation"> <a name="three" id="three"></a> <p class="title"><b>(1.3)</b></p> <div class="equation-contents"> <span class="mathphrase">1+1=3</span> </div> </div><br class="equation-break"> Rationale: These changes allow CSS control of the placement of the formal-object title relative to the formal-object contents. For example, using the CSS "float" property enables the title and contents to be rendered on the same line. Example stylesheet: .equation { margin-top: 20px; margin-bottom: 20px; } .equation-contents { float: left; } .equation .title { margin-top: 0; float: right; margin-right: 200px; } .equation .title b { font-weight: normal; } .equation-break { clear: both; } Note that the purpose of the ".equation-break" class is to provide a way to clear off the floats. If you want to instead have the equation title rendered to the left of the equation contents, you can do something like this: .equation { margin-top: 20px; width: 300px; margin-bottom: 20px; } .equation-contents { float: right; } .equation .title { margin-top: 0; float: left; margin-right: 200px; } .equation .title b { font-weight: normal; } .equation-break { clear: both; } Modified: html/formal.xsl,1.20 - Michael(tm) Smith Added a chunker.output.quiet top-level parameter so that the chunker can be made quiet by default Modified: html/chunker.xsl,1.26 - Norman Walsh Added support for link, olink, and xref within OO Classsynopsis and children. (Because DocBook NG/5 allows it). Modified: fo/synop.xsl,1.15; html/synop.xsl,1.19 - Michael(tm) Smith New parameter: id.warnings. If non-zero, warnings are generated for titled objects that don't have titles. True by default; I wonder if this will be too aggressive? Modified: html/biblio.xsl,1.25; html/component.xsl,1.27; html/division.xsl,1.11; html/formal.xsl,1.19; html/glossary.xsl,1.20; html/html.xsl,1.13; html/index.xsl,1.16; html/param.ent,1.88; html/param.xweb,1.97; html/refentry.xsl,1.22; html/sections.xsl,1.30; params/id.warnings.xml,1.1 - Norman Walsh If the keep.relative.image.uris parameter is true, don't use the absolute URI (as calculated from xml:base) in the img src attribute, us the value the author specified. Note that we still have to calculate the absolute filename for use in the image intrinsics extension. Modified: html/graphics.xsl,1.56 - Norman Walsh Support date as an inline Modified: fo/inline.xsl,1.43; html/inline.xsl,1.46 - Norman Walsh Added new parameter keep.relative.image.uris Modified: fo/param.ent,1.91; fo/param.xweb,1.104; html/param.ent,1.87; html/param.xweb,1.96; params/keep.relative.image.uris.xml,1.1 - Norman Walsh Added two new parameters for handling of multi-term varlistentry elements: variablelist.term.break.after: When the variablelist.term.break.after is non-zero, it will generate a line break after each term multi-term varlistentry. variablelist.term.separator: When a varlistentry contains multiple term elements, the string specified in the value of the variablelist.term.separator parameter is placed after each term except the last. The default is ", " (a comma followed by a space). To suppress rendering of the separator, set the value of variablelist.term.separator to the empty string (""). These parameters are primarily intended to be useful if you have multi-term varlistentries that have long terms. Closes #1306676. Thanks to Sam Steingold for providing an example "lots of long terms" doc that demonstrated the value of having these options. Also, added normalize-space() call to processing of each term. This change affects all output formats (HTML, PDF, manpages). The default behavior should pretty much remain the same as before, but it is possible (as always) that the change may introduce some new bugginess. Modified: fo/lists.xsl,1.62; fo/param.ent,1.88; fo/param.xweb,1.99; html/lists.xsl,1.48; html/param.ent,1.86; html/param.xweb,1.93; manpages/lists.xsl,1.22; manpages/param.ent,1.14; manpages/param.xweb,1.16; params/variablelist.term.break.after.xml,1.1; params/variablelist.term.separator.xml,1.1 - Michael(tm) Smith Added "wrapper-name" param to inline.charseq named template, enabling it to output inlines other than just "span". Acronym and Abbrev templates now use inline.charseq to output HTML "acronym" and "abbr" elements (instead of "span"). Closes #1305468. Thanks to Sam Steingold for suggesting the change. Modified: html/inline.xsl,1.45 - Michael(tm) Smith Manpages The following changes have been made to the manpages code since the 1.69.1 release. Added the following params: - man.indent.width (string-valued) - man.indent.refsect (boolean) - man.indent.blurbs (boolean) - man.indent.lists (boolean) - man.indent.verbatims (boolean) Note that in earlier snapshots, man.indent.width was named man.indentation.default.value and the boolean params had names like man.indentation.*.adjust. Also the man.indent.blurbs param was called man.indentation.authors.adjust (or something). The behavior now is: If the value of a particular man.indent.* boolean param is non-zero, the corresponding contents (refsect*, list items, authorblurb/personblurb, vervatims) are displayed with a left margin indented by a width equal to the value of man.indent.width. Modified: params/man.indent.blurbs.xml,1.1; manpages/docbook.xsl,1.74; manpages/info.xsl,1.20; manpages/lists.xsl,1.30; manpages/other.xsl,1.20; manpages/param.ent,1.22; manpages/param.xweb,1.24; manpages/refentry.xsl,1.14; params/man.indent.lists.xml,1.1; params/man.indent.refsect.xml,1.1; params/man.indent.verbatims.xml,1.1; params/man.indent.width.xml,1.1 - Michael(tm) Smith Added man.table.footnotes.divider param. In each table that contains footenotes, the string specified by the man.table.footnotes.divider parameter is output before the list of footnotes for the table. Modified: manpages/docbook.xsl,1.73; manpages/links.xsl,1.6; manpages/param.ent,1.21; manpages/param.xweb,1.23; params/man.table.footnotes.divider.xml,1.1 - Michael(tm) Smith Added the man.output.in.separate.dir, man.output.base.dir, and man.output.subdirs.enabled parameters. The man.output.base.dir parameter specifies the base directory into which man-page files are output. The man.output.subdirs.enabled parameter controls whether the files are output in subdirectories within the base directory. The values of the man.output.base.dir and man.output.subdirs.enabled parameters are used only if the value of man.output.in.separate.dir parameter is non-zero. If the value of man.output.in.separate.dir is zero, man-page files are not output in a separate directory. Modified: manpages/docbook.xsl,1.72; manpages/param.ent,1.20; manpages/param.xweb,1.22; params/man.output.base.dir.xml,1.1; params/man.output.in.separate.dir.xml,1.1; params/man.output.subdirs.enabled.xml,1.1 - Michael(tm) Smith Added man.font.table.headings and man.font.table.title params, for controlling font in table headings and titles. Modified: manpages/docbook.xsl,1.71; manpages/param.ent,1.19; manpages/param.xweb,1.21; params/man.font.table.headings.xml,1.1; params/man.font.table.title.xml,1.1 - Michael(tm) Smith Added man.font.funcsynopsisinfo and man.font.funcprototype params, for specifying the roff font (for example, BI, B, I) for funcsynopsisinfo and funcprototype output. Modified: manpages/block.xsl,1.19; manpages/docbook.xsl,1.69; manpages/param.ent,1.18; manpages/param.xweb,1.20; manpages/synop.xsl,1.29; manpages/table.xsl,1.21; params/man.font.funcprototype.xml,1.1; params/man.font.funcsynopsisinfo.xml,1.1 - Michael(tm) Smith Added man.segtitle.suppress param. If the value of man.segtitle.suppress is non-zero, then display of segtitle contents is suppressed in output. Modified: manpages/docbook.xsl,1.68; manpages/param.ent,1.17; manpages/param.xweb,1.19; params/man.segtitle.suppress.xml,1.1 - Michael(tm) Smith Added man.output.manifest.enabled and man.output.manifest.filename params. If man.output.manifest.enabled is non-zero, a list of filenames for man pages generated by the stylesheet transformation is written to the file named by man.output.manifest.filename Modified: manpages/docbook.xsl,1.67; manpages/other.xsl,1.19; manpages/param.ent,1.16; manpages/param.xweb,1.18; params/man.output.manifest.enabled.xml,1.1; params/man.output.manifest.filename.xml,1.1; tools/make/Makefile.DocBook,1.4 - Michael(tm) Smith Added refentry.meta.get.quietly param. If zero (the default), notes and warnings about "missing" markup are generated during gathering of refentry metadata. If non-zero, the metadata is gathered "quietly" -- that is, the notes and warnings are suppressed. NOTE: If you are processing a large amount of refentry content, you may be able to speed up processing significantly by setting a non-zero value for refentry.meta.get.quietly. Modified: common/refentry.xsl,1.17; manpages/param.ent,1.15; manpages/param.xweb,1.17; params/refentry.meta.get.quietly.xml,1.1 - Michael(tm) Smith Changed names of all boolean indentation params to man.indent.* Also discarded individual man.indent.*.value params and switched to just using a common man.indent.width param (3n by default). Modified: manpages/docbook.xsl,1.66; manpages/info.xsl,1.19; manpages/lists.xsl,1.29; manpages/other.xsl,1.18; manpages/refentry.xsl,1.13 - Michael(tm) Smith Added boolean man.output.in.separate.dir param, to control whether or not man files are output in separate directory. Modified: manpages/docbook.xsl,1.65; manpages/utility.xsl,1.14 - Michael(tm) Smith Added options for controlling indentation of verbatim output. Controlled through the man.indentation.verbatims.adjust and man.indentation.verbatims.value params. Closes #1242997 Modified: manpages/block.xsl,1.15; manpages/docbook.xsl,1.64 - Michael(tm) Smith Added options for controlling indentation in lists and in *blurb output in the AUTHORS section. Controlled through the man.indentation.lists.adjust, man.indentation.lists.value, man.indentation.authors.adjust, and man.indentation.authors.value parameters. Default is 3 characters (instead of the roff default of 8 characters). Closes #1449369. Also, removed the indent that was being set on informalexample outuput. I will instead add an option for indenting verbatims, which I think is what the informalexample indent was intended for originally. Modified: manpages/block.xsl,1.14; manpages/docbook.xsl,1.63; manpages/info.xsl,1.18; manpages/lists.xsl,1.28 - Michael(tm) Smith Changed line-spacing call before synopfragment to use ".sp -1n" ("n" units specified) instead of plain ".sp -1" Modified: manpages/synop.xsl,1.28 - Michael(tm) Smith Added support for writing man files into a specific output directory and into appropriate subdirectories within that output directory. Controlled through the man.base.dir parameter (similar to the base.dir support in the HTML stylesheet) and the man.subdirs.enabled parameter, which automatically determines the name of an appropriate subdir (for example, man/man7, man/man1, etc.) based on the section number/manvolnum of the source Refentry. Closes #1255036 and #1170317. Thanks to Denis Bradford for the original feature request, and to Costin Stroie for submitting a patch that was very helpful in implementing the support. Modified: manpages/docbook.xsl,1.62; manpages/utility.xsl,1.13 - Michael(tm) Smith Refined XPath statements and notification messages for refentry metadata handling. Modified: common/common.xsl,1.59; common/refentry.xsl,1.14; manpages/docbook.xsl,1.61; manpages/other.xsl,1.17 - Michael(tm) Smith Added support for copyright and legalnotice. The manpages stylesheets now output a COPYRIGHT section, after the AUTHORS section, if a copyright or legalnotice is found in the source. The section contains the copyright contents followed by the legalnotice contents. Closes #1450209. Modified: manpages/docbook.xsl,1.59; manpages/info.xsl,1.17 - Michael(tm) Smith Drastically reworked all of the XPath expressions used in refentry metadata gathering -- completely removed $parentinfo and turned $info into a set of nodes that includes the *info contents of the Refentry plus the *info contents all all of its ancestor elements. The basic XPath expression now used throughout is (using the example of checking for a date): (($info[//date])[last()]/date)[1]. That selects the "last" *info/date date in document order -- that is, the one eitther on the Refentry itself or on the closest ancestor to the Refentry. It's likely this change may break some things; may need to pick up some pieces later. Also, changed the default value for the man.th.extra2.max.length from 40 to 30. Modified: common/common.xsl,1.58; common/refentry.xsl,1.7; params/man.th.extra2.max.length.xml,1.2; params/refentry.date.profile.xml,1.2; params/refentry.manual.profile.xml,1.2; params/refentry.source.name.profile.xml,1.2; params/refentry.version.profile.xml,1.2; manpages/docbook.xsl,1.58; manpages/other.xsl,1.15 - Michael(tm) Smith Added support for DocBook 5 namespace-stripping in manpages stylesheet. Closes request #1210692. Modified: common/common.xsl,1.56; manpages/docbook.xsl,1.57 - Michael(tm) Smith Fixed handling of table footnotes. With this checkin, the table support in the manpages stylesheet is now basically feature complete. So this change closes request #619532, "No support for tables" -- the oldest currently open manpages feature request, submitted by Ben Secrest (blsecres) on 2002-10-07. Congratulations to me [patting myself on the back]. Modified: manpages/block.xsl,1.11; manpages/docbook.xsl,1.55; manpages/table.xsl,1.15 - Michael(tm) Smith Added handling for table titles. Also fixed handling of nested tables; nest tables are now "extracted" and displayed just after their parent tables. Modified: manpages/docbook.xsl,1.54; manpages/table.xsl,1.14 - Michael(tm) Smith Added option for turning off bold formatting in Funcsynopsis. Boldface formatting in function synopsis is mandated in the man(7) man page and is used almost universally in existing man pages. Despite that, it really does look like crap to have an entire Funcsynopsis output in bold, so I added params for turning off the bold formatting and/or replacing it with a different roff special font (e.g., "RI" for alternating roman/italic instead of the default "BI" for alternating bold/italic). The new params are "man.funcprototype.font" and "man.funcsynopsisinfo.font". To be documented later. Closes #1452247. Thanks to Joe Orton for the feature request. Modified: params/man.string.subst.map.xml,1.16; manpages/block.xsl,1.10; manpages/docbook.xsl,1.51; manpages/inline.xsl,1.16; manpages/synop.xsl,1.27 - Michael(tm) Smith Use AUTHORS instead of AUTHOR if we have multiple people to attribute. Also, fixed checking such that we generate author section even if we don't have an author (as long as there is at least one other person/entity we can put in the section). Also adjusted assembly of content for Author metainfo field such that we now not only use author, but try to find a "best match" if we can't find an author name to put there. Closes #1233592. Thanks to Sam Steingold for the request. Modified: manpages/info.xsl,1.12 - Michael(tm) Smith Changes for request #1243027, "Impove handling of AUTHOR section." This adds support for Collab, Corpauthor, Corpcredt, Orgname, Publishername, and Publisher. Also adds support for output of Affiliation and its children, and support for using gentext strings for auto-attributing roles (Author, Editor, Publisher, Translator, etc.). Also did a lot of code cleanup and modularization of all the AUTHOR handling code. And fixed a bug that was causing Author info to not be picked up correctly for metainfo comment we embed in man-page source. Modified: manpages/info.xsl,1.11 - Michael(tm) Smith Support bold output for "emphasis remap='B'". (because Eric Raymond's doclifter(1) tool converts groff source marked up with ".B" request or "\fB" escapes to DocBook "emphasis remap='B'".) Modified: manpages/inline.xsl,1.14 - Michael(tm) Smith Added support for Segmentedlist. Details: Output is tabular, with no option for "list" type output. Output for Segtitle elements can be supressed by setting man.segtitle.suppress. If Segtitle content is output, it is rendered in italic type (not bold because not all terminals support bold and so italic ensures the stand out on those terminals). Extra space (.sp line) at end of table code ensures that it gets handled correctly in the case where its source is the child of a Para. Closes feature-request #1400097. Thanks to Daniel Leidert for the patch and push, and to Alastair Rankine for filing the original feature request. Modified: manpages/lists.xsl,1.23; manpages/utility.xsl,1.10 - Michael(tm) Smith Improved handling or Author/Editor/Othercredit. Reworked content of (non-visible) comment added at top of each page (metadata stuff). Added support for generating a manifest file (useful for cleaning up after builds, etc.) Modified: manpages/docbook.xsl,1.46; manpages/info.xsl,1.9; manpages/other.xsl,1.12; manpages/utility.xsl,1.6 - Michael(tm) Smith Added two new parameters for handling of multi-term varlistentry elements: variablelist.term.break.after: When the variablelist.term.break.after is non-zero, it will generate a line break after each term multi-term varlistentry. variablelist.term.separator: When a varlistentry contains multiple term elements, the string specified in the value of the variablelist.term.separator parameter is placed after each term except the last. The default is ", " (a comma followed by a space). To suppress rendering of the separator, set the value of variablelist.term.separator to the empty string (""). These parameters are primarily intended to be useful if you have multi-term varlistentries that have long terms. Closes #1306676. Thanks to Sam Steingold for providing an example "lots of long terms" doc that demonstrated the value of having these options. Also, added normalize-space() call to processing of each term. This change affects all output formats (HTML, PDF, manpages). The default behavior should pretty much remain the same as before, but it is possible (as always) that the change may introduce some new bugginess. Modified: fo/lists.xsl,1.62; fo/param.ent,1.88; fo/param.xweb,1.99; html/lists.xsl,1.48; html/param.ent,1.86; html/param.xweb,1.93; manpages/lists.xsl,1.22; manpages/param.ent,1.14; manpages/param.xweb,1.16; params/variablelist.term.break.after.xml,1.1; params/variablelist.term.separator.xml,1.1 - Michael(tm) Smith Params The following changes have been made to the params code since the 1.69.1 release. New parameters to set header/footer table minimum height. Modified: params/footer.table.height.xml,1.1; params/header.table.height.xml,1.1 - Robert Stayton Support multiple indexing methods for different languages. Modified: params/index.method.xml,1.1 - Robert Stayton Remove qandaset and qandadiv from generate.toc for fo output because formerly it wasn't working, but now it is and the default behavior should stay the same. Modified: params/generate.toc.xml,1.8 - Robert Stayton add support for page number references to link element too. Modified: params/insert.link.page.number.xml,1.1 - Robert Stayton Add support for more characters to hyphen on when ulink.hyphenate is turned on. Modified: params/ulink.hyphenate.chars.xml,1.1; params/ulink.hyphenate.xml,1.3 - Robert Stayton New attribute-set to format biblioentry and bibliomixed. Modified: params/biblioentry.properties.xml,1.1 - Robert Stayton Added new parameter chunk.tocs.and.lots.has.title which controls presence of title in a separate chunk with ToC/LoT. Disabling title can be very useful if you are generating frameset output (well, yes those frames, but some customers really want them ;-). Modified: html/chunk-code.xsl,1.15; html/param.ent,1.93; html/param.xweb,1.102; params/chunk.tocs.and.lots.has.title.xml,1.1 - Jirka Kosek Added new attribute set toc.line.properties for controlling appearance of lines in ToC/LoT Modified: params/toc.line.properties.xml,1.1 - Jirka Kosek Allow table footnotes to have different properties from regular footnotes. Modified: params/table.footnote.properties.xml,1.1 - Robert Stayton Set properties for pgwide="1" objects. Modified: params/pgwide.properties.xml,1.1 - Robert Stayton Added the autotoc.label.in.hyperlink param. If the value of autotoc.label.in.hyperlink is non-zero, labels are included in hyperlinked titles in the TOC. If it is instead zero, labels are still displayed prior to the hyperlinked titles, but are not hyperlinked along with the titles. Closes patch #1065868. Thanks to anatoly techtonik for the patch. Modified: html/autotoc.xsl,1.36; html/param.ent,1.92; html/param.xweb,1.101; params/autotoc.label.in.hyperlink.xml,1.1 - Michael(tm) Smith Added two new params: html.head.legalnotice.link.types and html.head.legalnotice.link.multiple. If the value of the generate.legalnotice.link is non-zero, then the stylesheet generates (in the head section of the HTML source) either a single HTML link element or, if the value of the html.head.legalnotice.link.multiple is non-zero, one link element for each link type specified. Each link has the following attributes: - a rel attribute whose value is derived from the value of html.head.legalnotice.link.types - an href attribute whose value is set to the URL of the file containing the legalnotice - a title attribute whose value is set to the title of the corresponding legalnotice (or a title programatically determined by the stylesheet) For example: <link rel="copyright" href="ln-id2524073.html" title="Legal Notice"> Closes #1476450. Thanks to Sam Steingold. Modified: html/chunk-common.xsl,1.45; html/param.ent,1.91; html/param.xweb,1.100; params/generate.legalnotice.link.xml,1.4; params/html.head.legalnotice.link.multiple.xml,1.1; params/html.head.legalnotice.link.types.xml,1.1 - Michael(tm) Smith Added the following params: - man.indent.width (string-valued) - man.indent.refsect (boolean) - man.indent.blurbs (boolean) - man.indent.lists (boolean) - man.indent.verbatims (boolean) Note that in earlier snapshots, man.indent.width was named man.indentation.default.value and the boolean params had names like man.indentation.*.adjust. Also the man.indent.blurbs param was called man.indentation.authors.adjust (or something). The behavior now is: If the value of a particular man.indent.* boolean param is non-zero, the corresponding contents (refsect*, list items, authorblurb/personblurb, vervatims) are displayed with a left margin indented by a width equal to the value of man.indent.width. Modified: params/man.indent.blurbs.xml,1.1; manpages/docbook.xsl,1.74; manpages/info.xsl,1.20; manpages/lists.xsl,1.30; manpages/other.xsl,1.20; manpages/param.ent,1.22; manpages/param.xweb,1.24; manpages/refentry.xsl,1.14; params/man.indent.lists.xml,1.1; params/man.indent.refsect.xml,1.1; params/man.indent.verbatims.xml,1.1; params/man.indent.width.xml,1.1 - Michael(tm) Smith Added man.table.footnotes.divider param. In each table that contains footenotes, the string specified by the man.table.footnotes.divider parameter is output before the list of footnotes for the table. Modified: manpages/docbook.xsl,1.73; manpages/links.xsl,1.6; manpages/param.ent,1.21; manpages/param.xweb,1.23; params/man.table.footnotes.divider.xml,1.1 - Michael(tm) Smith Added the man.output.in.separate.dir, man.output.base.dir, and man.output.subdirs.enabled parameters. The man.output.base.dir parameter specifies the base directory into which man-page files are output. The man.output.subdirs.enabled parameter controls whether the files are output in subdirectories within the base directory. The values of the man.output.base.dir and man.output.subdirs.enabled parameters are used only if the value of man.output.in.separate.dir parameter is non-zero. If the value of man.output.in.separate.dir is zero, man-page files are not output in a separate directory. Modified: manpages/docbook.xsl,1.72; manpages/param.ent,1.20; manpages/param.xweb,1.22; params/man.output.base.dir.xml,1.1; params/man.output.in.separate.dir.xml,1.1; params/man.output.subdirs.enabled.xml,1.1 - Michael(tm) Smith Added man.font.table.headings and man.font.table.title params, for controlling font in table headings and titles. Modified: manpages/docbook.xsl,1.71; manpages/param.ent,1.19; manpages/param.xweb,1.21; params/man.font.table.headings.xml,1.1; params/man.font.table.title.xml,1.1 - Michael(tm) Smith Added man.font.funcsynopsisinfo and man.font.funcprototype params, for specifying the roff font (for example, BI, B, I) for funcsynopsisinfo and funcprototype output. Modified: manpages/block.xsl,1.19; manpages/docbook.xsl,1.69; manpages/param.ent,1.18; manpages/param.xweb,1.20; manpages/synop.xsl,1.29; manpages/table.xsl,1.21; params/man.font.funcprototype.xml,1.1; params/man.font.funcsynopsisinfo.xml,1.1 - Michael(tm) Smith Changed to select="0" in refclass.suppress (instead of ..>0</..) Modified: params/refclass.suppress.xml,1.3 - Michael(tm) Smith Added man.segtitle.suppress param. If the value of man.segtitle.suppress is non-zero, then display of segtitle contents is suppressed in output. Modified: manpages/docbook.xsl,1.68; manpages/param.ent,1.17; manpages/param.xweb,1.19; params/man.segtitle.suppress.xml,1.1 - Michael(tm) Smith Added man.output.manifest.enabled and man.output.manifest.filename params. If man.output.manifest.enabled is non-zero, a list of filenames for man pages generated by the stylesheet transformation is written to the file named by man.output.manifest.filename Modified: manpages/docbook.xsl,1.67; manpages/other.xsl,1.19; manpages/param.ent,1.16; manpages/param.xweb,1.18; params/man.output.manifest.enabled.xml,1.1; params/man.output.manifest.filename.xml,1.1; tools/make/Makefile.DocBook,1.4 - Michael(tm) Smith Added refclass.suppress param. If the value of refclass.suppress is non-zero, then display refclass contents is suppressed in output. Affects HTML and FO output only. Modified: fo/param.ent,1.93; fo/param.xweb,1.106; html/param.ent,1.90; html/param.xweb,1.99; params/refclass.suppress.xml,1.1 - Michael(tm) Smith Added refentry.meta.get.quietly param. If zero (the default), notes and warnings about "missing" markup are generated during gathering of refentry metadata. If non-zero, the metadata is gathered "quietly" -- that is, the notes and warnings are suppressed. NOTE: If you are processing a large amount of refentry content, you may be able to speed up processing significantly by setting a non-zero value for refentry.meta.get.quietly. Modified: common/refentry.xsl,1.17; manpages/param.ent,1.15; manpages/param.xweb,1.17; params/refentry.meta.get.quietly.xml,1.1 - Michael(tm) Smith Added support for "software" and "sectdesc" class values on refmiscinfo; "software" is treated identically to "source", and "setdesc" is treated identically to "manual". Modified: common/refentry.xsl,1.10; params/man.th.extra2.max.length.xml,1.3; params/refentry.source.name.profile.xml,1.4 - Michael(tm) Smith Drastically reworked all of the XPath expressions used in refentry metadata gathering -- completely removed $parentinfo and turned $info into a set of nodes that includes the *info contents of the Refentry plus the *info contents all all of its ancestor elements. The basic XPath expression now used throughout is (using the example of checking for a date): (($info[//date])[last()]/date)[1]. That selects the "last" *info/date date in document order -- that is, the one eitther on the Refentry itself or on the closest ancestor to the Refentry. It's likely this change may break some things; may need to pick up some pieces later. Also, changed the default value for the man.th.extra2.max.length from 40 to 30. Modified: common/common.xsl,1.58; common/refentry.xsl,1.7; params/man.th.extra2.max.length.xml,1.2; params/refentry.date.profile.xml,1.2; params/refentry.manual.profile.xml,1.2; params/refentry.source.name.profile.xml,1.2; params/refentry.version.profile.xml,1.2; manpages/docbook.xsl,1.58; manpages/other.xsl,1.15 - Michael(tm) Smith Added option for turning off bold formatting in Funcsynopsis. Boldface formatting in function synopsis is mandated in the man(7) man page and is used almost universally in existing man pages. Despite that, it really does look like crap to have an entire Funcsynopsis output in bold, so I added params for turning off the bold formatting and/or replacing it with a different roff special font (e.g., "RI" for alternating roman/italic instead of the default "BI" for alternating bold/italic). The new params are "man.funcprototype.font" and "man.funcsynopsisinfo.font". To be documented later. Closes #1452247. Thanks to Joe Orton for the feature request. Modified: params/man.string.subst.map.xml,1.16; manpages/block.xsl,1.10; manpages/docbook.xsl,1.51; manpages/inline.xsl,1.16; manpages/synop.xsl,1.27 - Michael(tm) Smith fop.extensions now only for FOP version 0.20.5 and earlier. Modified: params/fop.extensions.xml,1.4 - Robert Stayton Support for fop1 different from fop 0.20.5 and earlier. Modified: params/fop1.extensions.xml,1.1 - Robert Stayton Reset default value to empty string so template uses gentext first, then the parameter value if not empty. Modified: params/index.number.separator.xml,1.2; params/index.range.separator.xml,1.2; params/index.term.separator.xml,1.2 - Robert Stayton New parameter: id.warnings. If non-zero, warnings are generated for titled objects that don't have titles. True by default; I wonder if this will be too aggressive? Modified: html/biblio.xsl,1.25; html/component.xsl,1.27; html/division.xsl,1.11; html/formal.xsl,1.19; html/glossary.xsl,1.20; html/html.xsl,1.13; html/index.xsl,1.16; html/param.ent,1.88; html/param.xweb,1.97; html/refentry.xsl,1.22; html/sections.xsl,1.30; params/id.warnings.xml,1.1 - Norman Walsh Added new parameter keep.relative.image.uris Modified: fo/param.ent,1.91; fo/param.xweb,1.104; html/param.ent,1.87; html/param.xweb,1.96; params/keep.relative.image.uris.xml,1.1 - Norman Walsh Support default label width parameters for itemized and ordered lists Modified: fo/lists.xsl,1.64; fo/param.ent,1.90; fo/param.xweb,1.103; params/itemizedlist.label.width.xml,1.1; params/orderedlist.label.width.xml,1.1 - Norman Walsh Added parameters to localize punctuation in indexes. Modified: params/index.number.separator.xml,1.1; params/index.range.separator.xml,1.1; params/index.term.separator.xml,1.1 - Robert Stayton Added two new parameters for handling of multi-term varlistentry elements: variablelist.term.break.after: When the variablelist.term.break.after is non-zero, it will generate a line break after each term multi-term varlistentry. variablelist.term.separator: When a varlistentry contains multiple term elements, the string specified in the value of the variablelist.term.separator parameter is placed after each term except the last. The default is ", " (a comma followed by a space). To suppress rendering of the separator, set the value of variablelist.term.separator to the empty string (""). These parameters are primarily intended to be useful if you have multi-term varlistentries that have long terms. Closes #1306676. Thanks to Sam Steingold for providing an example "lots of long terms" doc that demonstrated the value of having these options. Also, added normalize-space() call to processing of each term. This change affects all output formats (HTML, PDF, manpages). The default behavior should pretty much remain the same as before, but it is possible (as always) that the change may introduce some new bugginess. Modified: fo/lists.xsl,1.62; fo/param.ent,1.88; fo/param.xweb,1.99; html/lists.xsl,1.48; html/param.ent,1.86; html/param.xweb,1.93; manpages/lists.xsl,1.22; manpages/param.ent,1.14; manpages/param.xweb,1.16; params/variablelist.term.break.after.xml,1.1; params/variablelist.term.separator.xml,1.1 - Michael(tm) Smith Convert 'no' to string in default value. Modified: params/olink.doctitle.xml,1.4 - Robert Stayton Implemented RFE #1292615. Added bunch of new parameters (attribute sets) that affect list presentation: list.block.properties, itemizedlist.properties, orderedlist.properties, itemizedlist.label.properties and orderedlist.label.properties. Default behaviour of stylesheets has not been changed but further customizations will be much more easier. Modified: fo/lists.xsl,1.61; fo/param.ent,1.87; fo/param.xweb,1.98; params/itemizedlist.label.properties.xml,1.1; params/itemizedlist.properties.xml,1.1; params/list.block.properties.xml,1.1; params/orderedlist.label.properties.xml,1.1; params/orderedlist.properties.xml,1.1 - Jirka Kosek Implemented RFE #1242092. You can enable crop marks in your document by setting crop.marks=1 and xep.extensions=1. Appearance of crop marks can be controlled by parameters crop.mark.bleed (6pt), crop.mark.offset (24pt) and crop.mark.width (0.5pt). Also there is new named template called user-xep-pis. You can overwrite it in order to produce some PIs that can control XEP as described in http://www.renderx.com/reference.html#Output_Formats Modified: fo/docbook.xsl,1.36; fo/param.ent,1.86; fo/param.xweb,1.97; fo/xep.xsl,1.23; params/crop.mark.bleed.xml,1.1; params/crop.mark.offset.xml,1.1; params/crop.mark.width.xml,1.1; params/crop.marks.xml,1.1 - Jirka Kosek Changed short descriptions in doc for *autolabel* params to match new autolabel behavior. Modified: params/appendix.autolabel.xml,1.5; params/chapter.autolabel.xml,1.4; params/part.autolabel.xml,1.5; params/preface.autolabel.xml,1.4 - Michael(tm) Smith Profiling The following changes have been made to the profiling code since the 1.69.1 release. Profiling now works together with namespace stripping (V5 documents). Namespace striping should work with all stylesheets named profile-, even if they are not supporting namespace stripping in a non-profiling variant. Modified: profiling/profile-mode.xsl,1.4; profiling/xsl2profile.xsl,1.7 - Jirka Kosek Moved profiling stage out of templates. This make possible to reuse profiled content by several templates and still maintaing node indentity (needed for example for HTML Help where content is processed multiple times). I don't know why this was not on the top level before. Maybe some XSLT processors choked on it. I hope this will be OK now. Modified: profiling/xsl2profile.xsl,1.5 - Jirka Kosek Tools The following changes have been made to the tools code since the 1.69.1 release. Moved Makefile.DocBook from contrib module to xsl module. Modified: tools/make/Makefile.DocBook,1.1 - Michael(tm) Smith WordML The following changes have been made to the wordml code since the 1.69.1 release. added contrib element, better handling of default paragraph style Modified: wordml/pages-normalise.xsl,1.6; wordml/supported.xml,1.2; wordml/wordml-final.xsl,1.14 - Steve Ball added bridgehead Modified: wordml/docbook-pages.xsl,1.6; wordml/docbook.xsl,1.17; wordml/pages-normalise.xsl,1.5; wordml/template-pages.xml,1.7; wordml/template.dot,1.4; wordml/template.xml,1.14; wordml/wordml-final.xsl,1.13 - Steve Ball added blocks stylesheet to support bibliographies, glossaries and qandasets Modified: wordml/Makefile,1.4; wordml/README,1.3; wordml/blocks-spec.xml,1.1; wordml/docbook-pages.xsl,1.5; wordml/docbook.xsl,1.16; wordml/pages-normalise.xsl,1.4; wordml/sections-spec.xml,1.3; wordml/specifications.xml,1.13; wordml/template-pages.xml,1.6; wordml/template.dot,1.3; wordml/template.xml,1.13; wordml/wordml-blocks.xsl,1.1; wordml/wordml-final.xsl,1.12; wordml/wordml-sections.xsl,1.3 - Steve Ball added mediaobject caption Modified: wordml/docbook-pages.xsl,1.4; wordml/docbook.xsl,1.15; wordml/specifications.xml,1.12; wordml/template-pages.xml,1.5; wordml/template.dot,1.2; wordml/template.xml,1.12; wordml/wordml-final.xsl,1.11 - Steve Ball added callouts Modified: wordml/docbook-pages.xsl,1.3; wordml/docbook.xsl,1.14; wordml/pages-normalise.xsl,1.3; wordml/specifications.xml,1.11; wordml/template-pages.xml,1.4; wordml/wordml-final.xsl,1.10 - Steve Ball added Word template file Modified: wordml/template.dot,1.1 - Steve Ball added abstract, fixed itemizedlist, ulink Modified: wordml/specifications.xml,1.10; wordml/wordml-final.xsl,1.9 - Steve Ball fixed Makefile added many features to Pages support added revhistory, inlines, highlights, abstract Modified: wordml/Makefile,1.2; wordml/docbook-pages.xsl,1.2; wordml/pages-normalise.xsl,1.2; wordml/sections-spec.xml,1.2; wordml/specifications.xml,1.9; wordml/template-pages.xml,1.3; wordml/template.xml,1.11; wordml/wordml-final.xsl,1.8; wordml/wordml-sections.xsl,1.2 - Steve Ball fixed handling linebreaks when generating WordML added Apple Pages support Modified: wordml/docbook.xsl,1.13; wordml/template-pages.xml,1.2 - Steve Ball Release 1.69.1 This release is a minor bug-fix update to the 1.69.0 release. Along with bug fixes, it includes one configuration-parameter change: The default value of the annotation.support parameter is now 0 (off). The reason for that change is that there have been reports that annotation handling is causing a significant performance degradation in processing of large documents with xsltproc. Release 1.69.0 The release includes major feature changes, particularly in the manpages stylesheets, as well as a large number of bug fixes. As with all DocBook Project dot zero releases, this is an experimental release . Common This release adds localizations for the following languages: Albanian Amharic Azerbaijani Hindi Irish (Gaelic) Gujarati Kannada Mongolian Oriya Punjabi Tagalog Tamil Welsh . Added support for specifying number format for auto labels for chapter, appendix, part, and preface. Contolled with the appendix.autolabel, chapter.autolabel, part.autolabel, and preface.autolabel parameters. Added basic support for biblioref cross referencing. Added support for align on caption in mediaobject. Added support for processing documents that use the DocBook V5 namespace. Added support for termdef and mathphrase. EXPERIMENTAL: Incorporated the Slides and Website stylesheets into the DocBook XSL stylesheets package. So, for example, Website documents can now be processed using the following URI for the driver Website tabular.xsl file: http://docbook.sourceforge.net/release/xsl/current/website/tabular.xsl A procedure without a title is now treated as an informal procedure (meaning that it is not added to any generated list of procedures and has no affect on numbering of generated labels for other procedures). docname is no longer added to olink when pointing to a root element. Added support for generation of choice separator in inline simplelist. This enables auto-generation of an appropriate localized choice separator (for example, and or or) before the final item in an inline simplelist. To indicate that you want a choice separator generated for a particular list, you need to put a processing instruction (PI) of the form dbchoice choice="foo" as a child of the list. For example: <para>Choose from ONE and ONLY ONE of the following: <simplelist type="inline"> <?dbchoice choice="or" ?> <member>A</member> <member>B</member> <member>C</member>.</simplelist></para> Output (for English):
        Choose from ONE and only ONE of the following choices: A, B, or C.
        As a temporary workaround for the fact that most of the DocBook non-English locale files don't have a localization for the word or, you can put in a literal string to be used; example for French: dbchoice choice="ou". That is, use ou instead of or.
        FO Added content-type property to external-graphic element, based on imagedata format attribute. Added support for generating <rx:meta-field creator="$VERSION"/> field for XEP output. This makes the DocBook XSL stylesheet version information available through the Document Properties menu in Acrobat Reader and other PDF viewers. Trademark symbol handling made consistent with handling of same in HTML stylesheets. Prior to this change, if you processed a document that contained no value for the class attribute on the trademark element, the HTML stylesheets would default to rendering a superscript TM symbol after the trademark contents, but the FO stylesheets would render nothing. Added support for generating XEP bookmarks for refentry. Added support for HTML markup table border attribute, applied to each table cell. The table.width template can now sum column specs if none use % or *. Added fox:destination extension inside fox:outline to support linking to internal destinations. Added support for customizing abstract with property sets. Controlled with the abstract.properties and abstract.title.properties parameters. Add footnotes in table title to table footnote set, and add support for table footnotes to HTML table markup. Added support for title in glosslist. Added support for itemizedlist symbol none. Implemented the new graphical.admonition.properties and nongraphical.admonition.properties attribute sets. Added id to formalpara and some other blocks that were missing it. Changed the anchor template to output fo:inline instead of fo:wrapper. Added support for toc.max.depth parameter. Help Eclipse Help: Added support for generating olink database. HTML Added a first cut at support in HTML output for DocBook 5 style annotations. Controlled using the annotation.support parameter, and implemented using JavaScript and CSS styling. For more details, see the documentation for the annotation.js, annotation.css, annotation.graphic.open, and annotation.graphic.close parameters. Generate client-side image map for imageobjectco with areas using calspair units Added support for img.src.path PI. Added support for passing img.src.path to DocBook Java XSLT image extensions when appropriate. Controlled using the graphicsize.use.img.src.path parameter. Added support for (not valid for DocBook 4) xlink:href on area and (not valid for DocBook 4) alt in area. Added new parameter default.table.frame to control table framing if there is no frame attribute on a table. Added initial, experimental support for generating content for the HTML title attribute from content of the alt element. This change adds support for the following inline elements only (none of them are block elements): abbrev accel acronym action application authorinitials beginpage citation citerefentry citetitle city classname code command computeroutput constant country database email envar errorcode errorname errortext errortype exceptionname fax filename firstname firstterm foreignphrase function glossterm guibutton guiicon guilabel guimenu guimenuitem guisubmenu hardware honorific interface interfacename keycap keycode keysym lineage lineannotation literal markup medialabel methodname mousebutton option optional otheraddr othername package parameter personname phone pob postcode productname productnumber prompt property quote refentrytitle remark replaceable returnvalue tag shortcut state street structfield structname subscript superscript surname symbol systemitem tag termdef token trademark type uri userinput varname wordasword Added support for chunking revhistory into separate file (similar to the support for doing same with legalnotice). Patch from Thomas Schraitle. Controlled through new generate.revhistory.link parameter. l10n.xsl: Made language codes RFC compliant. Added a new boolean config parameter, l10n.lang.value.rfc.compliant. If it is non-zero (the default), any underscore in a language code will be converted to a hyphen in HTML output. If it is zero, the language code will be left as-is. man This release closes out 44 manpages stylesheet bug reports and feature requests. It adds more than 35 new configuration parameters for controlling aspects of man-page output -- including hyphenation and justification, handling of links, conversion of Unicode characters, and contents of man-page headers and footers. New options for globally disabling/enabling hyphenation and justification: man.justify and man.hyphenate. Note that the default for the both of those is zero (off), because justified text looks good only when it is also hyphenated; to quote the Hyphenation node from the groff info page:
        Since the odds are not great for finding a set of words, for every output line, which fit nicely on a line without inserting excessive amounts of space between words, `gtroff' hyphenates words so that it can justify lines without inserting too much space between words.
        The problem is that groff can end up hyphenating a lot of things that you don't want hyphenated (variable names and command names, for example). Keeping both justification and hyphenation disabled ensures that hyphens won't get inserted where you don't want to them, and you don't end up with lines containing excessive amounts of space between words. These default settings run counter to how most existing man pages are formatted. But there are some notable exceptions, such as the perl man pages.
        Added parameters for controlling hyphenation of computer inlines, filenames, and URLs. By default, even when hyphenation is enabled (globally), hyphenation is now suppressed for "computer inlines" (currently, just classname, constant, envar, errorcode, option, replaceable, userinput, type, and varname, and for filenames, and for URLs from link. It can be (re)enabled using the man.hyphenate.computer.inlines, man.hyphenate.filenames, and man.hyphenate.urls parameters. Implemented a new system for replacing Unicode characters. There are two parts to the new system: a string substitution map for doing essential replacements, and a character map that can optionally be disabled and enabled. The new system fixes all open bugs that had to do with literal Unicode numbered entities such as &#8220; and &#8221; showing up in output, and greatly expands the ability of the stylesheets to generate good roff equivalents for Unicode symbols and special characters. Here are some details... The previous manpages mechanism for replacing Unicode symbols and special characters with roff equivalents (the replace-entities template) was not scalable and not complete. The mechanism handled a somewhat arbitrary selection of less than 20 or so Unicode characters. But there are potentially more than 800 Unicode special characters that have some groff equivalent they can be mapped to. And there are about 34 symbols in the Latin-1 (ISO-8859-1) block alone. Users might reasonably expect that if they include any of those Latin-1 characters in their DocBook source documents, they will get correctly converted to known roff equivalents in output. In addition to those common symbols, certain users may have a need to use symbols from other Unicode blocks. Say, somebody who is documenting an application related to math might need to use a bunch of symbols from the Mathematical Operators Unicode block (there are about 65 characters in that block that have reasonable roff equivalents). Or somebody else might really like Dingbats -- such as the checkmark character -- and so might use a bunch of things from the Dingbat block (141 characters in that that have roff equivalents or that can at least be degraded somewhat gracefully into roff). So, the old replace-entities mechanism was replaced with a completely different mechanism that is based on use of two maps: a substitution map and a character map (the latter in a format compliant with the XSLT 2.0 spec and therefore completely forward compatible with XSLT 2.0). The substitution map is controlled through the man.string.subst.map parameter, and is used to replace things like the backslash character (which needs special handling to prevent it from being interpreted as a roff escape). The substitution map cannot be disabled, because disabling it will cause the output to be broken. However, you can add to it and change it if needed. The character map mechanism, on the other hand, can be completely disabled. It is enabled by default, and, by default, does replacement of all Latin-1 symbols, along with most special spaces, dashes, and quotes (about 75 characters by default). Also, you can optionally enable a full character map that provides support for converting all 800 or so of the characters that have some reasonable groff equivalent. The character-map mechanism is controlled through the following parameters: man.charmap.enabled turns character-map support on/off man.charmap.use.subset specifies that a subset of the character map is used instead of the full map man.charmap.subset.profile specifies profile of character-map subset man.charmap.uri specifies an alternate character map to use instead of the standard character map provided in the distribution Implemented out-of-line handling of display of URLs for links (currently, only for ulink). This gives you three choices for handling of links: Number and list links. Each link is numbered inline, with a number in square brackets preceding the link contents, and a numbered list of all links is added to the end of the document. Only list links. Links are not numbered, but an (unnumbered) list of links is added to the end of the document. Suppress links. Don't number links and don't add any list of links to the end of the document. You can also choose whether links should be underlined. The default is the works -- list, number, and underline links. You can use the man.links.list.enabled, man.links.are.numbered, and man.links.are.underlined parameters to change the defaults. The default heading for the link list is REFERENCES. You can be change that using the man.links.list.heading parameter. Changed default output encoding to UTF-8. This does not mean that man pages are output in raw UTF-8, because the character map is applied before final output, causing all UTF-8 characters covered in the map to be converted to roff equivalents. Added support for processing refsect3 and formalpara and nested refsection elements, down to any arbitrary level of nesting. Output of the NAME and SYNOPSIS and AUTHOR headings and the headings for admonitions (note, caution, etc.) are no longer hard-coded for English. Instead, headings are generated for those in the correct locale (just as the FO and HTML stylesheets do). Re-worked mechanism for assembling page headers/footers (the contents of the .TH macro title line). Here are some details... All man pages contain a .TH roff macro whose contents are used for rendering the title line displayed in the header and footer of each page. Here are a couple of examples of real-world man pages that have useful page headers/footers: gtk-options(7) GTK+ User's Manual gtk-options(7) <-- header GTK+ 1.2 2003-10-20 gtk-options(7) <-- footer svgalib(7) Svgalib User Manual svgalib(7) <-- header Svgalib 1.4.1 16 December 1999 svgalib(7) <-- footer And here are the terms with which the groff_man(7) man page refers to the various parts of the header/footer: title(section) extra3 title(section) <- header extra2 extra1 title(section) <- footer Or, using the names with which the man(7) man page refers to those same fields: title(section) manual title(section) <- page header source date title(section) <- page footer The easiest way to control the contents of those fields is to mark up your refentry content like the following (note that this is a minimal example). <refentry> <info> <date>2003-10-20</date> </info> <refmeta> <refentrytitle>gtk-options</refentrytitle> <manvolnum>7</manvolnum> <refmiscinfo class="source-name">GTK+</refmiscinfo> <refmiscinfo class="version">1.2</refmiscinfo> <refmiscinfo class="manual">GTK+ User's Manual</refmiscinfo> </refmeta> <refnamediv> <refname>gtk-options</refname> <refpurpose>Standard Command Line Options for GTK+ Programs</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para>This manual page describes the command line options, which are common to all GTK+ based applications.</para> </refsect1> </refentry> Sets the date part of the header/footer. Sets the title part. Sets the section part. Sets the source name part. Sets the version part. Sets the manual part. Below are explanations of the steps the stylesheets take to attempt to assemble and display good headers and footer. [In the descriptions, note that *info is the refentry info child (whatever its name), and parentinfo is the info child of its parent (again, whatever its name).] extra1 field (date) Content of the extra1 field is what shows up in the center footer position of each page. The man(7) man page describes it as the date of the last revision. To provide this content, if the refentry.date.profile.enabled is non-zero, the stylesheets check the value of refentry.date.profile. Otherwise, by default, they check for a date or pubdate not only in the *info contents, but also in the parentinfo contents. If a date cannot be found, the stylesheets now automatically generate a localized long format date, ensuring that this field always has content in output. However, if for some reason you want to suppress this field, you can do so by setting a non-zero value for man.th.extra1.suppress. extra2 field (source) On Linux systems and on systems with a modern groff, the content of the extra2 field are what shows up in the left footer position of each page. The man(7) man page describes this as the source of the command, and provides the following examples: For binaries, use somwething like: GNU, NET-2, SLS Distribution, MCC Distribution. For system calls, use the version of the kernel that you are currently looking at: Linux 0.99.11. For library calls, use the source of the function: GNU, BSD 4.3, Linux DLL 4.4.1. In practice, there are many pages that simply have a version number in the source field. So, it looks like what we have is a two-part field, Name Version, where: Name product name (e.g., BSD) or org. name (e.g., GNU) Version version name Each part is optional. If the Name is a product name, then the Version is probably the version of the product. Or there may be no Name, in which case, if there is a Version, it is probably the version of the item itself, not the product it is part of. Or, if the Name is an organization name, then there probably will be no Version. To provide this content, if the refentry.source.name.profile.enabled and refentry.version.profile.enabled parameter are non-zero, the stylesheets check the value of refentry.source.name.profile refentry.version.profile. Otherwise, by default, they check the following places, in the following order: *info/productnumber *info/productnumber refmeta/refmiscinfo[@class = 'version'] parentinfo/productnumber *info/productname parentinfo/productname refmeta/refmiscinfo [nothing found, so leave it empty] extra3 field On Linux systems and on systems with a modern groff, the content of the extra3 field are what shows up in the center header position of each page. Some man pages have extra2 content, some don't. If a particular man page has it, it is most often context data about some larger system the documented item belongs to (for example, the name or description of a group of related applications). The stylesheets now check the following places, in the following order, to look for content to add to the extra3 field. parentinfo/title parent's title refmeta/refmiscinfo [nothing found, so leave it empty] Reworked *info gathering. For each refentry found, the stylesheets now cache its *info content, then check for any valid parent of it that might have metainfo content and cache that, if found; they then then do all further matches against those node-sets (rather than re-selecting the original *info nodes each time they are needed). New option for breaking strings after forward slashes. This enables long URLs and pathnames to be broken across lines. Controlled through man.break.after.slash parameter. Output for servicemark and trademark are now (SM) and (TM). There is a groff "\(tm" escape, but output from that is not acceptable. New option for controlling the length of the title part of the .TH title line. Controlled through the man.th.title.max.length parameter. New option for specifying output encoding of each man page; controlled with man.output.encoding (similar to the HTML chunker.output.encoding parameter). New option for suppressing filename messages when generating output; controlled with man.output.quietly (similar to the HTML chunk.quietly parameter). The text of cross-references to first-level refentry (refsect1, top-level refsection, refnamediv, and refsynopsisdiv) are now capitalized. Cross-references to refnamediv now use the localized NAME title instead of using the first refname child. This makes the output inconsistent with HTML and FO output, but for man-page output, it seems to make better sense to have the NAME. (It may actually make better sense to do it that way in HTML and FO output as well...) Added support for processing funcparams. Removed the space that was being output between funcdef and paramdef; example: was: float rand (void); now: float rand(void) Turned off bold formatting for the type element when it occurs within a funcdef or paramdef Corrected rendering of simplelist. Any <simplelist type="inline" instance is now rendered as a comma-separated list (also with an optional localized and or or before the last item -- see description elsewhere in these release notes). Any simplelist instance whose type is not inline is rendered as a one-column vertical list (ignoring the values of the type and columns attributes if present) Comment added at top of roff source for each page now includes DocBook XSL stylesheets version number (as in the HTML stylesheets) Made change to prevent sticky fonts changes. Now, when the manpages stylesheets encounter node sets that need to be boldfaced or italicized, they put the \fBfoo\fR and \fIbar\fR groff bold/italic instructions separately around each node in the set. synop.xsl: Boldface everything in funcsynopsis output except parameters (which are in ital). The man(7) man page says:
        For functions, the arguments are always specified using italics, even in the SYNOPSIS section, where the rest of the function is specified in bold.
        A look through the contents of the man/man2 directory shows that most (all) existing pages do follow this everything in funcsynopsis bold rule. That means the type content and any punctuation (parens, semicolons, varargs) also must be bolded.
        Removed code for adding backslashes before periods/dots in roff source, because backslashes in front of periods/dots in roff source are needed only in the very rare case where a period is the very first character in a line, without any space in front of it. A better way to deal with that rare case is for you to add a zero-width space in front of the offending dot(s) in your source Removed special handling of the quote element. That was hard-coded to cause anything marked up with the quote element to be output preceded by two backticks and followed by two apostrophes -- that is, that old-school kludge for generating curly quotes in Emacs and in X-Windows fonts. While Emacs still seems to support that, I don't think X-Windows has for a long time now. And, anyway, it looks (and has always looked) like crap when viewed on a normal tty/console. In addition, it breaks localiztion of quote. By default, quote content is output with localized quotation marks, which, depending on the locale, may or may not be left and right double quotation marks. Changed mappings for left and right single quotation marks. Those had previously been incorrectly mapped to the backtick (&#96;) and apostrophe (&39;) characters (for kludgy reasons -- see above). They are now correctly mapped to the \(oq and \(cq roff escapes. If you want the old (broken) behavior, you need to manually change the mappings for those in the value of the man.string.subst.map parameter. Removed xref.xsl file. Now, of the various cross-reference elements, only the ulink element is handled differently; the rest are handled exactly as the HTML stylesheets handle them, except that no hypertext links are generated. (Because there is no equivalent hypertext mechanism is man pages.) New option for making subheading dividers in generated roff source. The dividers are not visible in the rendered man page; they are just there to make the source readable. Controlled using man.subheading.divider. Fixed many places where too much space was being added between lines.
        Release 1.68.1 The release adds localization support for Farsi (thanks to Sina Heshmati) and improved support for the XLink-based DocBook NG db:link element. Other than that, it is a minor bug-fix update to the 1.68.0 release. The main thing it fixes is a build error that caused the XSLT Java extensions to be jarred up with the wrong package structure. Thanks to Jens Stavnstrup for quickly reporting the problem, and to Mauritz Jeanson for investigating and finding the cause. Release 1.68.0 This release includes some features changes, particularly for FO/PDF output, and a number of bug fixes. FO Moved footnote properties to attribute-sets. Added support for side floats, margin notes, and custom floats. Added new parameters body.start.indent and body.end.indent to the set.flow.properties template. Added support for xml:id Added support for refdescriptor. Added support for multiple refnamedivs. Added index.entry.properties attribute-set to support customization of index entries. Added set.flow.properties template call to each fo:flow to support customizations entry point. Add support for @floatstyle in figure Moved hardcoded properties for index division titles to the index.div.title.properties attribute-set. Added support for table-layout="auto" for XEP. Added index.div.title.properties attribute-set. $verbose parameter is now passed to most elements. Added refentry to toc in part, as it is permitted by the DocBook schema/DTD. Added backmatter elements and article to toc in part, since they are permitted by the DocBook schema/DTD. Added mode="toc" for simplesect, since it is now permitted in the toc if simplesect.in.toc is set. Moved hard-coded properties to nongraphical.admonintion.properties and graphical.admonition.properties attribute sets. Added support for sidebar-width and float-type processing instructions in sidebar. For tables with HTML markup elements, added support for dbfo bgcolor PI, the attribute-sets named table.properties, informaltable.properties, table.table.properties, and table.cell.padding. Also added support for the templates named table.cell.properties and table.cell.block.properties so that tabstyles can be implemented. Also added support for tables containing only tr instead of tbody with tr. Added new paramater hyphenate.verbatim.characters which can specify characters after which a line break can occur in verbatim environments. This parameter can be used to extend the initial set of characters which contain only space and non-breakable space. Added itemizedlist.label.markup to enable selection of different bullet symbol. Also added several potential bullet characters, commented out by default. Enabled all id's in XEP output for external olinking. HTML Added support for refdescriptor. Added support for multiple refnamedivs. Added support for xml:id refsynopsisdiv as a section for counting section levels Images Added new SVG admonition graphics and navigation images. Release 1.67.2 This release fixes a table bug introduced in the 1.67.1 release. Release 1.67.1 This release includes a number of bug fixes. The following lists provide details about API and feature changes. FO Tables: Inherited cell properties are now passed to the table.cell.properties template so they can be overridden by a customization. Tables: Added support for bgcolor PI on table row element. TOCs: Added new parameter simplesect.in.toc; default value of 0 causes simplesect to be omitted from TOCs; to cause simplesect to be included in TOCs, you must set the value of simplesect.in.toc to 1.Comment from Norm:
        Simplesect elements aren't supposed to appear in the ToC at all... The use case for simplesect is when, for example, every chapter in a book ends with "Exercises" or "For More Information" sections and you don't want those to appear in the ToC.
        Sections: Reverted change that caused a variable reference to be used in a template match and rewrote code to preserve intended semantics. Lists: Added workaround to prevent "* 0.60 + 1em" garbage in list output from PassiveTeX Moved the literal attributes from component.title to the component.title.properties attribute-set so they can be customized. Lists: Added glossdef's first para to special handling in fo:list-item-body.
        HTML TOCs: Added new parameter simplesect.in.toc; for details, see the list of changes for this release. Indexing: Added new parameter index.prefer.titleabbrev; when set to 1, index references will use titleabbrev instead of title when available. HTML Help Added support for generating windows-1252-encoded output using Saxon; for more details, see the list of changes for this release. man pages Replaced named/numeric character-entity references for non-breaking space with groff equivalent (backslash-tilde). XSL Java extensions Saxon extensions: Added the Windows1252 class. It extends Saxon 6.5.x with the windows-1252 character set, which is particularly useful when generating HTML Help for Western European Languages (code from Pontus Haglund and contributed to the DocBook community by Sectra AB, Sweden). To use: Make sure that the Saxon 6.5.x jar file and the jar file for the DocBook XSL Java extensions are in your CLASSPATH Create a DocBook XSL customization layer -- a file named mystylesheet.xsl or whatever -- that, at a minimum, contains the following: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl"/> <xsl:output method="html" encoding="WINDOWS-1252" indent="no"/> <xsl:param name="htmlhelp.encoding" select="'WINDOWS-1252'"></xsl:param> <xsl:param name="chunker.output.encoding" select="'WINDOWS-1252'"></xsl:param> <xsl:param name="saxon.character.representation" select="'native'"></xsl:param> </xsl:stylesheet> Invoke Saxon with the encoding.windows-1252 Java system property set to com.nwalsh.saxon.Windows1252; for example java \ -Dencoding.windows-1252=com.nwalsh.saxon.Windows1252 \ com.icl.saxon.StyleSheet \ mydoc.xml mystylesheet.xsl Or, for a more complete "real world" case showing other options you'll typically want to use: java \ -Dencoding.windows-1252=com.nwalsh.saxon.Windows1252 \ -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \ -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \ -Djavax.xml.transform.TransformerFactory=com.icl.saxon.TransformerFactoryImpl \ com.icl.saxon.StyleSheet \ -x org.apache.xml.resolver.tools.ResolvingXMLReader \ -y org.apache.xml.resolver.tools.ResolvingXMLReader \ -r org.apache.xml.resolver.tools.CatalogResolver \ mydoc.xml mystylesheet.xsl In both cases, the "mystylesheet.xsl" file should be a DocBook customization layer containing the parameters show in step 2. Saxon extensions: Removed Saxon 8 extensions from release package
        Release 1.67.0 A number of important bug fixes. Added Saxon8 extensions Enabled dbfo table-width on entrytbl in FO output Added support for role=strong on emphasis in FO output Added new FO parameter hyphenate.verbatim that can be used to turn on "intelligent" wrapping of verbatim environments. Replaced all <tt></tt> output with <code></code> Changed admon.graphic.width template to a mode so that different admonitions can have different graphical widths. Deprecated the HTML shade.verbatim parameter (use CSS instead) Wrapped ToC refentrytitle/refname and refpurpose in span with class values. This makes it possible to style them using a CSS stylesheet. Use strong/em instead of b/i in HTML output Added support for converting Emphasis to groff italic and Emphasis role='bold' to bold. Controlled by emphasis.propagates.style param, but not documented yet using litprog system. Will do that next (planning to add some other parameter-controllable options for hyphenation and handling of line spacing). callout.graphics.number.limit.xml param: Changed the default from 10 to 15. verbatim.properties: Added hyphenate=false Saxon and Xalan Text.java extensions: Added support for URIResolver() on insertfile href's Added generated RELEASE-NOTES.txt file. Added INSTALL file (executable file for generating catalog.xml) Removed obsolete tools directory from package Release 1.66.1 A number of important bug fixes. Now xml:base attributes that are generated by an XInclude processor are resolved for image files. Rewrote olink templates to support several new features. Extended full olink support to FO output. Add support for xrefstyle attribute in olinks. New parameters to support new olink features: insert.olink.page.number, insert.olink.pdf.frag, olink.debug, olink.lang.fallback.sequence, olink.properties, prefer.internal.olink. See the reference page for each parameter for more information. Added index.on.type parameter for new type attribute introduced in DocBook 4.3 for indexterms and index. This allows you to create multiple indices containing different categories of entries. For users of 4.2 and earlier, you can use the new parameter index.on.role instead. Added new section.autolabel.max.depth parameter to turn off section numbering below a certain depth. This permits you to number major section levels and leave minor section levels unnumbered. Added footnote.sep.leader.properties attribute set to format the line separating footnotes in printed output. Added parameter img.src.path as a prefix to HTML img src attributes. The prefix is added to whatever path is already generated by the stylesheet for each image file. Added new attribute-sets informalequation.properties, informalexample.properties, informalfigure.properties, and informaltable.properties, so each such element type can be formatted individually if needed. Add component.label.includes.part.label parameter to add any part number to chapter, appendix and other component labels when the label.from.part parameter is nonzero. This permits you to distinguish multiple chapters with the same chapter number in cross references and the TOC. Added chunk.separate.lots parameter for HTML output. This parameter lets you generate separate chunk files for each LOT (list of tables, list of figures, etc.). Added several table features: Added table.table.properties attribute set to add properties to the fo:table element. Added placeholder templates named table.cell.properties and table.cell.block.properties to enable adding properties to any fo:table-cell or the cell's fo:block, respectively. These templates are a start for implementing table styles. Added new attribute set component.title.properties for easy modifications of component's title formatting in FO output. Added Saxon support for an encoding attribute on the textdata element. Added new parameter textdata.default.encoding which specifies encoding when encoding attribute on textdata is missing. Template label.this.section now controls whole section label, not only sub-label which corresponds to particular label. Former behaviour was IMHO bug as it was not usable. Formatting in titleabbrev for TOC and headers is preserved when there are no hotlink elements in the title. Formerly the title showed only the text of the title, no font changes or other markup. Added intial.page.number template to set the initial-page-number property for page sequences in print output. Customizing this template lets you change when page numbering restarts. This is similar to the format.page.number template that lets you change how the page number formatting changes in the output. Added force.page.count template to set the force-page-count property for page sequences in print output. This is similar to the format.page.number template. Sort language for localized index sorting in autoidx-ng.xsl is now taken from document lang, not from system environment. Numbering and formatting of normal and ulink footnotes (if turned on) has been unified. Now ulink footnotes are mixed in with any other footnotes. Added support for renderas attribute in section and sect1 et al. This permits you to render a given section title as if it were a different level. Added support for label attribute in footnote to manually supply the footnote mark. Added support for DocBook 4.3 corpcredit element. Added support for a dbfo keep-together PI for formal objects (table, figure, example, equation, programlisting). That permits a formal object to be kept together if it is not already, or to be broken if it is very long and the default keep-together is not appropriate. For graphics files, made file extension matching case insensitive, and updated the list of graphics extensions. Allow calloutlist to have block content before the first callout Added dbfo-need processing instruction to provide soft page breaks. Added implementation of existing but unused default.image.width parameter for graphics. Support DocBook NG tag inline element. It appears that XEP now supports Unicode characters in bookmarks. There is no further need to strip accents from characters. Make segmentedlist HTML markup more semantic and available to CSS styles. Added user.preroot placeholder template to permit xsl-stylesheet and other PIs and comments to be output before the HTML root element. Non-chunked legalnotice now gets an <a name="id"> element in HTML output so it can be referenced with xref or link. In chunked HTML output, changed link rel="home" to rel="start", and link rel="previous" to rel="prev", per W3C HTML 4.01 spec. Added several patches to htmlhelp from W. Borgert Added Bosnian locale file as common/bs.xml. Release 1.65.0 A number of important bug fixes. Added a workaround to allow these stylesheets to process DocBook NG documents. (It’s a hack that pre-processes the document to strip off the namespace and then uses exsl:node-set to process the result.) Added alternative indexing mechanism which has better internationalization support. New indexing method allows grouping of accented letters like e, é, ë into the same group under letter "e". It can also treat special letters (e.g. "ch") as one character and place them in the correct position (e.g. between "h" and "i" in Czech language). In order to use this mechanism you must create customization layer which imports some base stylesheet (like fo/docbook.xsl, html/chunk.xsl) and then includes appropriate stylesheet with new indexing code (fo/autoidx-ng.xsl or html/autoidx-ng.xsl). For example: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/> <xsl:include href="http://docbook.sourceforge.net/release/xsl/current/fo/autoidx-ng.xsl"/> </xsl:stylesheet> New method is known to work with Saxon and it should also work with xsltproc 1.1.1 and later. Currently supported languages are English, Czech, German, French, Spanish and Danish. Release 1.64.1 General bug fixes and improvements. Sorry about the failure to produce an updated release notes file for 1.62.0—1.63.2 In the course of fixing bug #849787, wrapping Unicode callouts with an appropriate font change in the Xalan extensions, I discovered that the Xalan APIs have changed a bit. So xalan2.jar will work with older Xalan 2 implementations, xalan25.jar works with Xalan 2.5. Release 1.61.0 Lots of bug fixes and improvements. Initial support for timestamp PI. From now you can use <?dbtimestamp format="Y-m-d H:M:S"?> to get current datetime in your document. Added localization support for datetime PI Added level 6 to test for section depth in section.level template so that section.title.level6.properties will be used for sections that are 6 deep or deeper. This should also cause a h6 to be created in html output. Don't use SVG graphics if use.svg=0 Now uses number-and-title-template for sections only if section.autolabel is not zero. Added missing 'english-language-name' attribute to the l10n element, and the missing 'style' attribute to the template element so the current gentext documents will validate. Corrected several references to parameter qanda.defaultlabel that were missing the "$". Now accepts admon.textlabel parameter to turn off Note, Warning, etc. label. FeatReq #684561: support more XEP metadata Added hyphenation support. Added support for coref. Added beginpage support. (does nothing; see TDG). Added support for hyphenation-character, hyphenation-push-character-count, and hyphenation-remain-character-count Added root.properties, ebnf.assignment, and ebnf.statement.terminator Support bgcolor PI in table cells; make sure rowsep and colsep don't have any effect on the last row or column Handle othercredit on titlepage a little better Applied fix from Jeff Beal that fixed the bug that put secondary page numbers on primary entries. Same with tertiary page numbers on secondary entries. Added definition of missing variable collection. Make footnote formatting 'normal' even when it occurs in a context that has special formatting Added warning when glossary.collection is not blank, but it cannot open the specified file. Pick up the frame attribute on table and informaltable. indexdiv/title in non-autogenerated indexes are now picked up. Removed (unused) component.title.properties Move IDs from page-sequences down to titlepage blocks Use proportional-column-width(1) on more tables. Use proportional-column-width() for header/footer tables; suppress relative-align when when using FOP Check for glossterm.auto.link when linking firstterms; don't output gl. prefix on glossterm links Generate Part ToCs Support glossary, bibliography, and index in component ToCs. Refactored chunking code so that customization of chunk algorithm and chunk elements is more practical Support textobject/phrase on inlinemediaobject. Support 'start' PI on ordered lists Fixed test of $toc PI to turn on qandaset TOC. Added process.chunk.footnotes to sect2 through 5 to fix bug of missing footnotes when chunk level greater than 1. Added paramater toc.max.depth which controls maximal depth of ToC as requested by PHP-DOC group. Exempted titleabbrev from preamble processing in lists, and fixed variablelist preamble code to use the same syntax as the other lists. Added support for elements between variablelist and first varlistentry since DocBook 4.2 supports that now. Release 1.60.1 Lots of bug fixes. The format of the titlepage.templates.xml files and the stylesheet that transforms them have been significantly changed. All of the attributes used to control the templates are now namespace qualified. So what used to be: <t:titlepage element="article" wrapper="fo:block"> is now: <t:titlepage t:element="article" t:wrapper="fo:block"> Attributes from other namespaces (including those that are unqualified) are now copied directly through. In practice, this means that the names that used to be fo: qualified: <title named-template="component.title" param:node="ancestor-or-self::article[1]" fo:text-align="center" fo:keep-with-next="always" fo:font-size="&hsize5;" fo:font-weight="bold" fo:font-family="{$title.font.family}"/> are now unqualified: <title t:named-template="component.title" param:node="ancestor-or-self::article[1]" text-align="center" keep-with-next="always" font-size="&hsize5;" font-weight="bold" font-family="{$title.font.family}"/> The t:titlepage and t:titlepage-content elements both generate wrappers now. And unqualified attributes on those elements are passed through. This means that you can now make the title font apply to ane entire titlepage and make the entire recto titlepage centered by specifying the font and alignment on the those elements: <t:titlepage t:element="article" t:wrapper="fo:block" font-family="{$title.font.family}"> <t:titlepage-content t:side="recto" text-align="center"> Support use of titleabbrev in running headers and footers. Added (experimental) xref.with.number.and.title parameter to enable number/title cross references even when the default would be just the number. Generate part ToCs if they're requested. Use proportional-column-width() in header/footer tables. Handle alignment correctly when screenshot wraps a graphic in a figure. Format chapter and appendix cross references consistently. Attempt to support tables with multiple tgroups in FO. Output fo:table-columns in simplelist tables. Use titlepage.templates.xml for indexdiv and glossdiv formatting. Improve support for new bibliography elements. Added footnote.number.format, table.footnote.number.format, footnote.number.symbols, and table.footnote.number.symbols for better control of footnote markers. Added glossentry.show.acronyms. Suppress the draft-mode page masters when draft-mode is no. Make blank pages verso not recto. D'Oh! Improved formatting of ulink footnotes. Fixed bugs in graphic width/height calculations. Added class attributes to inline elements. Don't add .html to the filenames identified with the dbhtml PI. Don't force a ToC when sections contain refentrys. Make section title sizes a function of the body.master.size. Release 1.59.2 The 1.59.2 fixes an FO bug in the page masters that causes FOP to fail. Removed the region-name from the region-body of blank pages. There's no reason to give the body of blank pages a unique name and doing so causes a mismatch that FOP detects. Output IDs for the first paragraphs in listitems. Fixed some small bugs in the handling of page numbers in double-sided mode. Attempt to prevent duplicated IDs from being produced when endterm on xref points to something with nested structure. Fix aligment problems in equations. Output the type attribute on unordered lists (UL) in HTML only if the css.decoration parameter is true. Calculate the font size in formal.title.properties so that it's 1.2 times the base font size, not a fixed "12pt". Release 1.59.1 The 1.59.1 fixes a few bugs. Added Bulgarian localization. Indexing improvements; localize book indexes to books but allow setindex to index an entire set. The default value for rowsep and colsep is now "1" as per CALS. Added support for titleabbrev (use them for cross references). Improvements to mediaobject for selecting print vs. online images. Added seperate property sets for figures, examples, equations, tabless, and procedures. Make lineannotations italic. Support xrefstyle attribute. Make endterm on xref higher priority than xreflabel target. Glossary formatting improvements. Release 1.58.0 The 1.58.0 adds some initial support for extensions in xsltproc, adds a few features, and fixes bugs. This release contains the first attempt at extension support for xsltproc. The only extension available to date is the one that adjusts table column widths. Run extensions/xsltproc/python/xslt.py. Fixed bugs in calculation of adjusted column widths to correct for rounding errors. Support nested refsection elements correctly. Reworked gentext.template to take context into consideration. The name of elements in localization files is now an xpath-like context list, not just a simple name. Made some improvements to bibliography formatting. Improved graphical formatting of admonitions. Added support for entrytbl. Support spanning index terms. Support bibliosource. Release 1.57.0 The 1.57.0 release wasn't documented here. Oops. Release 1.56.0 The 1.56.0 release fixes bugs. Reworked chunking. This will break all existing customizations layers that change the chunking algorithm. If you're customizing chunking, look at the new content parameter that's passed to process-chunk-element and friends. Support continued and inherited numeration in orderedlist formatting for FOs. Added Thai localization. Tweaked stylesheet documentation stylesheets to link to TDG and the parameter references. Allow title on tables of contents ("Table of Contents") to be optional. Added new keyword to generate.toc. Support tables of contents on sections. Made separate parameters for table borders and table cell borders: table.frame.border.color, table.frame.border.style, table.frame.border.thickness, table.cell.border.color, table.cell.border.style, and table.cell.border.thickness. Suppress formatting of endofrange indexterms. This is only half-right. They should generate a range, but I haven't figured out how to do that yet. Support revdescription. (Bug #582192) Added default.float.class and fixed figure floats. (Bug #497603) Fixed formatting of sbr in FOs. Added context to the missing template error message. Process arg correctly in a group. (Bug #605150) Removed 'keep-with-next' from formal.title.properties attribute set now that the stylesheets support the option of putting such titles below the object. Now the $placement value determines if 'keep-with-next' or 'keep-with-previous' is used in the title block. Wrap url() around external-destinations when appropriate. Fixed typo in compact list spacing. (Bug #615464) Removed spurious hash in anchor name. (Bug #617717) Address is now displayed verbatim on title pages. (Bug #618600) The bridgehead.in.toc parameter is now properly supported. Improved effectiveness of HTML cleanup by increasing the number of places where it is used. Improve use of HTML cleanup in XHTML stylesheets. Support table of contents for appendix in article. (Bug #596599) Don't duplicate footnotes in bibliographys and glossarys. (Bug #583282) Added default.image.width. (Bug #516859) Totally reworked funcsynopsis code; it now supports a 'tabular' presentation style for 'wide' prototypes; see funcsynopsis.tabular.threshold. (HTML only right now, I think, FO support, uh, real soon now.) Reworked support for difference marking; toned down the colors a bit and added a system.head.content template so that the diff CSS wasn't overriding user.head.content. (Bug #610660) Added call to the *.head.content elements when writing out long description chunks. Make sure legalnotice link is correct even when chunking to a different base.dir. Use CSS to set viewport characteristics if css.decoration is non-zero, use div instead of p for making graphic a block element; make figure titles the default alt text for images in a figure. Added space-after to list.block.spacing. Reworked section.level template to give correct answer instead of being off by one. When processing tables, use the tabstyle attribute as the division class. Fixed bug in html2xhtml.xsl that was causing the XHTML chunker to output HTML instead of XHTML. Older releases To view the release notes for older releases, see http://cvs.sourceforge.net/viewcvs.py/docbook/xsl/RELEASE-NOTES.xml. Be aware that there were no release notes for releases prior to the 1.50.0 release. About dot-zero releases DocBook Project “dot zero†releases should be considered experimental and are always followed by stable “dot one plus†releases, usually within two or three weeks. Please help to ensure the stability of “dot one plus†releases by carefully testing each “dot zero†release and reporting back about any problems you find. It is not recommended that you use a “dot zero†release in a production system. Instead, you should wait for the “dot one†or greater versions.
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/0000775000175000017500000000000013160023043025331 5ustar bdbaddogbdbaddog././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.charmap.subset.profile.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.charmap.subset.profile.x0000664000175000017500000003331413160023042032655 0ustar bdbaddogbdbaddog man.charmap.subset.profile string man.charmap.subset.profile Profile of character map subset @*[local-name() = 'block'] = 'Miscellaneous Technical' or (@*[local-name() = 'block'] = 'C1 Controls And Latin-1 Supplement (Latin-1 Supplement)' and (@*[local-name() = 'class'] = 'symbols' or @*[local-name() = 'class'] = 'letters') ) or @*[local-name() = 'block'] = 'Latin Extended-A' or (@*[local-name() = 'block'] = 'General Punctuation' and (@*[local-name() = 'class'] = 'spaces' or @*[local-name() = 'class'] = 'dashes' or @*[local-name() = 'class'] = 'quotes' or @*[local-name() = 'class'] = 'bullets' ) ) or @*[local-name() = 'name'] = 'HORIZONTAL ELLIPSIS' or @*[local-name() = 'name'] = 'WORD JOINER' or @*[local-name() = 'name'] = 'SERVICE MARK' or @*[local-name() = 'name'] = 'TRADE MARK SIGN' or @*[local-name() = 'name'] = 'ZERO WIDTH NO-BREAK SPACE' Description If the value of the man.charmap.use.subset parameter is non-zero, and your DocBook source is not written in English (that is, if the lang or xml:lang attribute on the root element in your DocBook source or on the first refentry element in your source has a value other than en), then the character-map subset specified by the man.charmap.subset.profile parameter is used instead of the full roff character map. Otherwise, if the lang or xml:lang attribute on the root element in your DocBook source or on the first refentry element in your source has the value en or if it has no lang or xml:lang attribute, then the character-map subset specified by the man.charmap.subset.profile.english parameter is used instead of man.charmap.subset.profile. The difference between the two subsets is that man.charmap.subset.profile provides mappings for characters in Western European languages that are not part of the Roman (English) alphabet (ASCII character set). The value of man.charmap.subset.profile is a string representing an XPath expression that matches attribute names and values for output-character elements in the character map. The attributes supported in the standard roff character map included in the distribution are: character a raw Unicode character or numeric Unicode character-entity value (either in decimal or hex); all characters have this attribute name a standard full/long ISO/Unicode character name (e.g., "OHM SIGN"); all characters have this attribute block a standard Unicode "block" name (e.g., "General Punctuation"); all characters have this attribute. For the full list of Unicode block names supported in the standard roff character map, see . class a class of characters (e.g., "spaces"). Not all characters have this attribute; currently, it is used only with certain characters within the "C1 Controls And Latin-1 Supplement" and "General Punctuation" blocks. For details, see . entity an ISO entity name (e.g., "ohm"); not all characters have this attribute, because not all characters have ISO entity names; for example, of the 800 or so characters in the standard roff character map included in the distribution, only around 300 have ISO entity names. string a string representing an roff/groff escape-code (with "@esc@" used in place of the backslash), or a simple ASCII string; all characters in the roff character map have this attribute The value of man.charmap.subset.profile is evaluated as an XPath expression at run-time to select a portion of the roff character map to use. You can tune the subset used by adding or removing parts. For example, if you need to use a wide range of mathematical operators in a document, and you want to have them converted into roff markup properly, you might add the following: @*[local-name() = 'block'] ='MathematicalOperators' That will cause a additional set of around 67 additional "math" characters to be converted into roff markup. Depending on which XSLT engine you use, either the EXSLT dyn:evaluate extension function (for xsltproc or Xalan) or saxon:evaluate extension function (for Saxon) are used to dynamically evaluate the value of man.charmap.subset.profile at run-time. If you don't use xsltproc, Saxon, Xalan -- or some other XSLT engine that supports dyn:evaluate -- you must either set the value of the man.charmap.use.subset parameter to zero and process your documents using the full character map instead, or set the value of the man.charmap.enabled parameter to zero instead (so that character-map processing is disabled completely. An alternative to using man.charmap.subset.profile is to create your own custom character map, and set the value of man.charmap.uri to the URI/filename for that. If you use a custom character map, you will probably want to include in it just the characters you want to use, and so you will most likely also want to set the value of man.charmap.use.subset to zero. You can create a custom character map by making a copy of the standard roff character map provided in the distribution, and then adding to, changing, and/or deleting from that. If you author your DocBook XML source in UTF-8 or UTF-16 encoding and aren't sure what OSes or environments your man-page output might end up being viewed on, and not sure what version of nroff/groff those environments might have, you should be careful about what Unicode symbols and special characters you use in your source and what parts you add to the value of man.charmap.subset.profile. Many of the escape codes used are specific to groff and using them may not provide the expected output on an OS or environment that uses nroff instead of groff. On the other hand, if you intend for your man-page output to be viewed only on modern systems (for example, GNU/Linux systems, FreeBSD systems, or Cygwin environments) that have a good, up-to-date groff, then you can safely include a wide range of Unicode symbols and special characters in your UTF-8 or UTF-16 encoded DocBook XML source and add any of the supported Unicode block names to the value of man.charmap.subset.profile. For other details, see the documentation for the man.charmap.use.subset parameter. Supported Unicode block names and "class" values Below is the full list of Unicode block names and "class" values supported in the standard roff stylesheet provided in the distribution, along with a description of which codepoints from the Unicode range corresponding to that block name or block/class combination are supported. C1 Controls And Latin-1 Supplement (Latin-1 Supplement) (x00a0 to x00ff) class values symbols letters Latin Extended-A (x0100 to x017f, partial) Spacing Modifier Letters (x02b0 to x02ee, partial) Greek and Coptic (x0370 to x03ff, partial) General Punctuation (x2000 to x206f, partial) class values spaces dashes quotes daggers bullets leaders primes Superscripts and Subscripts (x2070 to x209f) Currency Symbols (x20a0 to x20b1) Letterlike Symbols (x2100 to x214b) Number Forms (x2150 to x218f) Arrows (x2190 to x21ff, partial) Mathematical Operators (x2200 to x22ff, partial) Control Pictures (x2400 to x243f) Enclosed Alphanumerics (x2460 to x24ff) Geometric Shapes (x25a0 to x25f7, partial) Miscellaneous Symbols (x2600 to x26ff, partial) Dingbats (x2700 to x27be, partial) Alphabetic Presentation Forms (xfb00 to xfb04 only) scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.userlevel.xml0000664000175000017500000000254513160023043031526 0ustar bdbaddogbdbaddog profile.userlevel string profile.userlevel Target profile for userlevel attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhp.windows.xml0000664000175000017500000000172113160023042032137 0ustar bdbaddogbdbaddog htmlhelp.hhp.windows string htmlhelp.hhp.windows Definition of additional windows Description Content of this parameter is placed at the end of [WINDOWS] section of project file. You can use it for defining your own addtional windows. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/orderedlist.properties.xml0000664000175000017500000000211713160023043032567 0ustar bdbaddogbdbaddog orderedlist.properties attribute set orderedlist.properties Properties that apply to each list-block generated by orderedlist. 2em Description Properties that apply to each fo:list-block generated by orderedlist. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.ext.xml0000664000175000017500000000166313160023042027623 0ustar bdbaddogbdbaddog html.ext string html.ext Identifies the extension of generated HTML files .html Description The extension identified by html.ext will be used as the filename extension for chunks created by this stylesheet. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.properties.xml0000664000175000017500000000263613160023043032461 0ustar bdbaddogbdbaddog qanda.title.properties attribute set qanda.title.properties Properties for qanda set titles bold always 0.8em 1.0em 1.2em Description The properties common to all qanda set titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.pointer.graphic.xml0000664000175000017500000000201213160023043031726 0ustar bdbaddogbdbaddog toc.pointer.graphic boolean toc.pointer.graphic Use graphic for TOC pointer? Description If non-zero, the "pointer" in the TOC will be displayed with the graphic identified by toc.pointer.image. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.alias.file.xml0000664000175000017500000000162413160023042031700 0ustar bdbaddogbdbaddog htmlhelp.alias.file string htmlhelp.alias.file Filename of alias file. alias.h Description Specifies the filename of the alias file (used for context-sensitive help). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/page.orientation.xml0000664000175000017500000000212113160023043031315 0ustar bdbaddogbdbaddog page.orientation list portrait landscape page.orientation Select the page orientation portrait Description Select one from portrait or landscape. In portrait orientation, the short edge is horizontal; in landscape orientation, it is vertical. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/nominal.table.width.xml0000664000175000017500000000210413160023043031711 0ustar bdbaddogbdbaddog nominal.table.width length nominal.table.width The (absolute) nominal width of tables 6in Description In order to convert CALS column widths into HTML column widths, it is sometimes necessary to have an absolute table width to use for conversion of mixed absolute and relative widths. This value must be an absolute length (not a percentage). ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/monospace.verbatim.font.width.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/monospace.verbatim.font.widt0000664000175000017500000000300513160023043032761 0ustar bdbaddogbdbaddog monospace.verbatim.font.width length monospace.verbatim.font.width Width of a single monospace font character 0.60em Description Specifies with em units the width of a single character of the monospace font. The default value is 0.6em. This parameter is only used when a screen or programlisting element has a width attribute, which is expressed as a plain integer to indicate the maximum character count of each line. To convert this character count to an actual maximum width measurement, the width of the font characters must be provided. Different monospace fonts have different character width, so this parameter should be adjusted to fit the monospace font being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.gap.body.xml0000664000175000017500000000165513160023042031060 0ustar bdbaddogbdbaddog column.gap.body length column.gap.body Gap between columns in the body 12pt Description Specifies the gap between columns in body matter (if column.count.body is greater than one). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/navbodywidth.xml0000664000175000017500000000161713160023043030562 0ustar bdbaddogbdbaddog navbodywidth length navbodywidth Specifies the width of the navigation table body Description The width of the body column. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/variablelist.as.table.xml0000664000175000017500000000406113160023043032225 0ustar bdbaddogbdbaddog variablelist.as.table boolean variablelist.as.table Format variablelists as tables? Description If non-zero, variablelists will be formatted as tables. A processing instruction exists to specify a particular width for the column containing the terms: dbhtml term-width=".25in" You can override this setting with a processing instruction as the child of variablelist: dbhtml list-presentation="table" or dbhtml list-presentation="list". This parameter only applies to the HTML transformations. In the FO case, proper list markup is robust enough to handle the formatting. But see also variablelist.as.blocks. <variablelist> <?dbhtml list-presentation="table"?> <?dbhtml term-width="1.5in"?> <?dbfo list-presentation="list"?> <?dbfo term-width="1in"?> <varlistentry> <term>list</term> <listitem> <para> Formatted as a table even if variablelist.as.table is set to 0. </para> </listitem> </varlistentry> </variablelist> ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.title.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.title.properties.xm0000664000175000017500000000510613160023043033052 0ustar bdbaddogbdbaddog refentry.title.properties attribute set refentry.title.properties Title properties for a refentry title 18pt bold 1em false always 0.8em 1.0em 1.2em 0.5em 0.4em 0.6em Description Formatting properties applied to the title generated for the refnamediv part of output for refentry when the value of the refentry.generate.title parameter is non-zero. The font size is supplied by the appropriate section.levelX.title.properties attribute-set, computed from the location of the refentry in the section hierarchy. This parameter has no effect on the the title generated for the refnamediv part of output for refentry when the value of the refentry.generate.name parameter is non-zero. By default, that title is formatted with the same properties as the titles for all other first-level children of refentry. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.count.back.xml0000664000175000017500000000161213160023042031375 0ustar bdbaddogbdbaddog column.count.back integer column.count.back Number of columns on back matter pages Description Number of columns on back matter (appendix, glossary, etc.) pages. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level1.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level1.properties.xm0000664000175000017500000000277113160023043032734 0ustar bdbaddogbdbaddog section.level1.properties attribute set section.level1.properties Properties for level-1 sections Description The properties that apply to the containing block of a level-1 section, and therefore apply to the whole section. This includes sect1 elements and section elements at level 1. For example, you could start each level-1 section on a new page by using: <xsl:attribute-set name="section.level1.properties"> <xsl:attribute name="break-before">page</xsl:attribute> </xsl:attribute-set> This attribute set inherits attributes from the general section.properties attribute set. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footers.on.blank.pages.xml0000664000175000017500000000161113160023042032331 0ustar bdbaddogbdbaddog footers.on.blank.pages boolean footers.on.blank.pages Put footers on blank pages? Description If non-zero, footers will be placed on blank pages. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.frame.border.style.xml0000664000175000017500000000312613160023043032650 0ustar bdbaddogbdbaddog table.frame.border.style list none solid dotted dashed double groove ridge inset outset solid table.frame.border.style Specifies the border style of table frames solid Description Specifies the border style of table frames. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.outline.ext.xml0000664000175000017500000000167613160023043031456 0ustar bdbaddogbdbaddog olink.outline.ext string olink.outline.ext The extension of OLink outline files .olink Description The extension to be expected for OLink outline files Bob has this parameter as dead. Please don't use scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/margin.note.float.type.xml0000664000175000017500000000530613160023043032364 0ustar bdbaddogbdbaddog margin.note.float.type list none before left start right end inside outside margin.note.float.type Select type of float for margin note customizations none Description Selects the type of float for margin notes. DocBook does not define a margin note element, so this feature must be implemented as a customization of the stylesheet. See margin.note.properties for an example. If margin.note.float.type is none, then no float is used. If margin.note.float.type is before, then the float appears at the top of the page. On some processors, that may be the next page rather than the current page. If margin.note.float.type is left or start, then a left side float is used. If margin.note.float.type is right or end, then a right side float is used. If your XSL-FO processor supports floats positioned on the inside or outside of double-sided pages, then you have those two options for side floats as well. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/crop.mark.bleed.xml0000664000175000017500000000166213160023042031025 0ustar bdbaddogbdbaddog crop.mark.bleed length crop.mark.bleed Length of invisible part of crop marks. 6pt Description Length of invisible part of crop marks. Crop marks are controlled by crop.marks parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.properties.xml0000664000175000017500000000217513160023043031367 0ustar bdbaddogbdbaddog olink.properties attribute set olink.properties Properties associated with the cross-reference text of an olink. replace Description This attribute set is applied to the fo:basic-link element of an olink. It is not applied to the optional page number or optional title of the external document. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunk.toc.xml0000664000175000017500000000177113160023042027754 0ustar bdbaddogbdbaddog chunk.toc string chunk.toc An explicit TOC to be used for chunking Description The chunk.toc identifies an explicit TOC that will be used for chunking. This parameter is only used by the chunktoc.xsl stylesheet (and customization layers built from it). ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.show.advanced.search.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.show.advanced.searc0000664000175000017500000000172713160023042032716 0ustar bdbaddogbdbaddog htmlhelp.show.advanced.search boolean htmlhelp.show.advanced.search Should advanced search features be available? Description If you want advanced search features in your help, turn this parameter to 1. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.on.role.xml0000664000175000017500000000316713160023042030543 0ustar bdbaddogbdbaddog index.on.role boolean index.on.role Select indexterms based on role value Description If non-zero, then an index element that has a role attribute value will contain only those indexterm elements with a matching role value. If an index has no role attribute or it is blank, then the index will contain all indexterms in the current scope. If index.on.role is zero, then the role attribute has no effect on selecting indexterms for an index. If you are using DocBook version 4.3 or later, you should use the type attribute instead of role on indexterm and index, and set the index.on.type to a nonzero value. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/overlay.js.xml0000664000175000017500000000162713160023043030155 0ustar bdbaddogbdbaddog overlay.js filename overlay.js Overlay JavaScript file overlay.js Description Specifies the filename of the overlay JavaScript file. It's unlikely that you will ever need to change this parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/default.table.frame.xml0000664000175000017500000000162213160023042031656 0ustar bdbaddogbdbaddog default.table.frame string default.table.frame The default framing of tables all Description This value will be used when there is no frame attribute on the table. ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.charmap.subset.profile.english.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.charmap.subset.profile.e0000664000175000017500000000657713160023042032645 0ustar bdbaddogbdbaddog man.charmap.subset.profile.english string man.charmap.subset.profile.english Profile of character map subset @*[local-name() = 'block'] = 'Miscellaneous Technical' or (@*[local-name() = 'block'] = 'C1 Controls And Latin-1 Supplement (Latin-1 Supplement)' and @*[local-name() = 'class'] = 'symbols') or (@*[local-name() = 'block'] = 'General Punctuation' and (@*[local-name() = 'class'] = 'spaces' or @*[local-name() = 'class'] = 'dashes' or @*[local-name() = 'class'] = 'quotes' or @*[local-name() = 'class'] = 'bullets' ) ) or @*[local-name() = 'name'] = 'HORIZONTAL ELLIPSIS' or @*[local-name() = 'name'] = 'WORD JOINER' or @*[local-name() = 'name'] = 'SERVICE MARK' or @*[local-name() = 'name'] = 'TRADE MARK SIGN' or @*[local-name() = 'name'] = 'ZERO WIDTH NO-BREAK SPACE' Description If the value of the man.charmap.use.subset parameter is non-zero, and your DocBook source is written in English (that is, if its lang or xml:lang attribute on the root element in your DocBook source or on the first refentry element in your source has the value en or if it has no lang or xml:lang attribute), then the character-map subset specified by the man.charmap.subset.profile.english parameter is used instead of the full roff character map. Otherwise, if the lang or xml:lang attribute on the root element in your DocBook source or on the first refentry element in your source has a value other than en, then the character-map subset specified by the man.charmap.subset.profile parameter is used instead of man.charmap.subset.profile.english. The difference between the two subsets is that man.charmap.subset.profile provides mappings for characters in Western European languages that are not part of the Roman (English) alphabet (ASCII character set). The value of man.charmap.subset.profile.english is a string representing an XPath expression that matches attribute names and values for output-character elements in the character map. For other details, see the documentation for the man.charmap.subset.profile.english and man.charmap.use.subset parameters. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footnote.number.format.xml0000664000175000017500000000257613160023042032477 0ustar bdbaddogbdbaddog footnote.number.format list 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... footnote.number.format Identifies the format used for footnote numbers 1 Description The footnote.number.format specifies the format to use for footnote numeration (1, i, I, a, or A). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/show.revisionflag.xml0000664000175000017500000000332413160023043031524 0ustar bdbaddogbdbaddog show.revisionflag boolean show.revisionflag Enable decoration of elements that have a revisionflag Description If show.revisionflag is turned on, then the stylesheets may produce additional markup designed to allow a CSS stylesheet to highlight elements that have specific revisionflag settings. The markup inserted will be usually be either a <span> or <div> with an appropriate class attribute. (The value of the class attribute will be the same as the value of the revisionflag attribute). In some contexts, for example tables, where extra markup would be structurally illegal, the class attribute will be added to the appropriate container element. In general, the stylesheets only test for revisionflag in contexts where an importing stylesheet would have to redefine whole templates. Most of the revisionflag processing is expected to be done by another stylesheet, for example changebars.xsl. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.lang.in.name.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.lang.in.name.enab0000664000175000017500000000344413160023042032542 0ustar bdbaddogbdbaddog man.output.lang.in.name.enabled boolean man.output.lang.in.name.enabled Include $LANG value in man-page filename/pathname? Description The man.output.lang.in.name.enabled parameter specifies whether a $lang value is included in man-page filenames and pathnames. If the value of man.output.lang.in.name.enabled is non-zero, man-page files are output with the $lang value included in their filenames or pathnames as follows; if man.output.subdirs.enabled is non-zero, each file is output to, e.g., a man/$lang/man8/foo.8 pathname if man.output.subdirs.enabled is zero, each file is output with a foo.$lang.8 filename scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.encoding.xml0000664000175000017500000000421113160023042031747 0ustar bdbaddogbdbaddog man.output.encoding string man.output.encoding Encoding used for man-page output UTF-8 Description This parameter specifies the encoding to use for files generated by the manpages stylesheet. Not all processors support specification of this parameter. If the value of the man.charmap.enabled parameter is non-zero (the default), keeping the man.output.encoding parameter at its default value (UTF-8) or setting it to UTF-16 does not cause your man pages to be output in raw UTF-8 or UTF-16 -- because any Unicode characters for which matches are found in the enabled character map will be replaced with roff escape sequences before the final man-page files are generated. So if you want to generate "real" UTF-8 man pages, without any character substitution being performed on your content, you need to set man.charmap.enabled to zero (which will completely disable character-map processing). You may also need to set man.charmap.enabled to zero if you want to output man pages in an encoding other than UTF-8 or UTF-16. Character-map processing is based on Unicode character values and may not work with other output encodings. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/verbatim.properties.xml0000664000175000017500000000324713160023043032065 0ustar bdbaddogbdbaddog verbatim.properties attribute set verbatim.properties Properties associated with verbatim text 0.8em 1em 1.2em 0.8em 1em 1.2em false no-wrap false preserve preserve start Description This attribute set is used on all verbatim environments. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/margin.note.properties.xml0000664000175000017500000000361613160023043032475 0ustar bdbaddogbdbaddog margin.note.properties attribute set margin.note.properties Attribute set for margin.note properties 90% start Description The styling for margin notes. By default, margin notes are not implemented for any element. A stylesheet customization is needed to make use of this attribute-set. You can use a template named floater to create the customization. That template can create side floats by specifying the content and characteristics as template parameters. For example: <xsl:template match="para[@role='marginnote']"> <xsl:call-template name="floater"> <xsl:with-param name="position"> <xsl:value-of select="$margin.note.float.type"/> </xsl:with-param> <xsl:with-param name="width"> <xsl:value-of select="$margin.note.width"/> </xsl:with-param> <xsl:with-param name="content"> <xsl:apply-imports/> </xsl:with-param> </xsl:call-template> </xsl:template> ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/preferred.mediaobject.role.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/preferred.mediaobject.role.x0000664000175000017500000000310313160023043032702 0ustar bdbaddogbdbaddog preferred.mediaobject.role string preferred.mediaobject.role Select which mediaobject to use based on this value of an object's role attribute. Description A mediaobject may contain several objects such as imageobjects. If the parameter use.role.for.mediaobject is non-zero, then the role attribute on imageobjects and other objects within a mediaobject container will be used to select which object will be used. If one of the objects has a role value that matches the preferred.mediaobject.role parameter, then it has first priority for selection. If more than one has such a role value, the first one is used. See the use.role.for.mediaobject parameter for the sequence of selection. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.hide.show.xml0000664000175000017500000000230513160023043030527 0ustar bdbaddogbdbaddog toc.hide.show boolean toc.hide.show Enable hide/show button for ToC frame Description If non-zero, JavaScript (and an additional icon, see hidetoc.image and showtoc.image) is added to each slide to allow the ToC panel to be toggled on each panel. There is a bug in Mozilla 1.0 (at least as of CR3) that causes the browser to reload the titlepage when this feature is used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footnote.number.symbols.xml0000664000175000017500000000330713160023042032670 0ustar bdbaddogbdbaddog footnote.number.symbols footnote.number.symbols Special characters to use as footnote markers Description If footnote.number.symbols is not the empty string, footnotes will use the characters it contains as footnote symbols. For example, *&#x2020;&#x2021;&#x25CA;&#x2720; will identify footnotes with *, †, ‡, â—Š, and ✠. If there are more footnotes than symbols, the stylesheets will fall back to numbered footnotes using footnote.number.format. The use of symbols for footnotes depends on the ability of your processor (or browser) to render the symbols you select. Not all systems are capable of displaying the full range of Unicode characters. If the quoted characters in the preceding paragraph are not displayed properly, that's a good indicator that you may have trouble using those symbols for footnotes. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.width.xml0000664000175000017500000000153513160023043027762 0ustar bdbaddogbdbaddog toc.width length toc.width Width of ToC frame 250 Description Specifies the width of the ToC frame in pixels. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footnote.mark.properties.xml0000664000175000017500000000267213160023042033042 0ustar bdbaddogbdbaddog footnote.mark.properties attribute set footnote.mark.properties Properties applied to each footnote mark 75% normal normal Description This attribute set is applied to the footnote mark used for each footnote. It should contain only inline properties. The property to make the mark a superscript is contained in the footnote template itself, because the current version of FOP reports an error if baseline-shift is used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.unicode.xml0000664000175000017500000000203713160023042031144 0ustar bdbaddogbdbaddog callout.unicode boolean callout.unicode Use Unicode characters rather than images for callouts. Description The stylesheets can use either an image of the numbers one to ten, or the single Unicode character which represents the numeral, in white on a black background. Use this to select the Unicode character option. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/overlay.xml0000664000175000017500000000207513160023043027540 0ustar bdbaddogbdbaddog overlay boolean overlay Overlay footer navigation? Description If non-zero, JavaScript is added to the slides to make the bottom navigation appear at the bottom of each page. This option and multiframe are mutually exclusive. If this parameter is zero, the bottom navigation simply appears below the content of each slide. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.entry.properties.xml0000664000175000017500000000224413160023042032516 0ustar bdbaddogbdbaddog index.entry.properties attribute set index.entry.properties Properties applied to the formatted entries in an index 0pt Description This attribute set is applied to the block containing the entries in a letter division in an index. It can be used to set the font-size, font-family, and other inheritable properties that will be applied to all index entries. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/page.width.xml0000664000175000017500000000223313160023043030105 0ustar bdbaddogbdbaddog page.width length page.width The width of the physical page Description The page width is generally calculated from the paper.type and page.orientation parameters. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.count.lot.xml0000664000175000017500000000164513160023042031301 0ustar bdbaddogbdbaddog column.count.lot integer column.count.lot Number of columns on a 'List-of-Titles' page Description Number of columns on a page sequence containing the Table of Contents, List of Figures, etc. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/suppress.footer.navigation.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/suppress.footer.navigation.x0000664000175000017500000000163213160023043033043 0ustar bdbaddogbdbaddog suppress.footer.navigation boolean suppress.footer.navigation Disable footer navigation 0 Description If non-zero, footer navigation will be suppressed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/phrase.propagates.style.xml0000664000175000017500000000205213160023043032637 0ustar bdbaddogbdbaddog phrase.propagates.style boolean phrase.propagates.style Pass phrase role attribute through to HTML? Description If non-zero, the role attribute of phrase elements will be passed through to the HTML as a class attribute on a span that surrounds the phrase. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.footnote.number.format.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.footnote.number.format0000664000175000017500000000266513160023043032766 0ustar bdbaddogbdbaddog table.footnote.number.format list 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... table.footnote.number.format Identifies the format used for footnote numbers in tables a Description The table.footnote.number.format specifies the format to use for footnote numeration (1, i, I, a, or A) in tables. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.funcsynopsis.style.xml0000664000175000017500000000227713160023042032536 0ustar bdbaddogbdbaddog man.funcsynopsis.style list ansi kr man.funcsynopsis.style What style of funcsynopsis should be generated? ansi Description If man.funcsynopsis.style is ansi, ANSI-style function synopses are generated for a funcsynopsis, otherwise K&R-style function synopses are generated. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/eclipse.plugin.id.xml0000664000175000017500000000163313160023042031371 0ustar bdbaddogbdbaddog eclipse.plugin.id string eclipse.plugin.id Eclipse Help plugin id com.example.help Description Eclipse Help plugin id. You should change this id to something unique for each help. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.version.profile.xml0000664000175000017500000000312213160023043033032 0ustar bdbaddogbdbaddog refentry.version.profile string refentry.version.profile Specifies profile for refentry "version" data (($info[//productnumber])[last()]/productnumber)[1]| (($info[//edition])[last()]/edition)[1]| (($info[//releaseinfo])[last()]/releaseinfo)[1] Description The value of refentry.version.profile is a string representing an XPath expression. It is evaluated at run-time and used only if refentry.version.profile.enabled is non-zero. Otherwise, the refentry metadata-gathering logic "hard coded" into the stylesheets is used. A "source.name" is one part of a (potentially) two-part Name Version "source" field. For more details, see the documentation for the refentry.source.name.profile parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.break.after.slash.xml0000664000175000017500000000357613160023042032134 0ustar bdbaddogbdbaddog man.break.after.slash boolean man.break.after.slash Enable line-breaking after slashes? 0 Description If non-zero, line-breaking after slashes is enabled. This is mainly useful for causing long URLs or pathnames/filenames to be broken up or "wrapped" across lines (though it also has the side effect of sometimes causing relatively short URLs and pathnames to be broken up across lines too). If zero (the default), line-breaking after slashes is disabled. In that case, strings containing slashes (for example, URLs or filenames) are not broken across lines, even if they exceed the maximum column widith. If you set a non-zero value for this parameter, check your man-page output carefuly afterwards, in order to make sure that the setting has not introduced an excessive amount of breaking-up of URLs or pathnames. If your content contains mostly short URLs or pathnames, setting a non-zero value for man.break.after.slash will probably result in in a significant number of relatively short URLs and pathnames being broken across lines, which is probably not what you want. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level2.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level2.propertie0000664000175000017500000000212013160023043032653 0ustar bdbaddogbdbaddog qanda.title.level2.properties attribute set qanda.title.level2.properties Properties for level-2 qanda set titles pt Description The properties of level-2 qanda set titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/page.margin.top.xml0000664000175000017500000000163413160023043031050 0ustar bdbaddogbdbaddog page.margin.top length page.margin.top The top margin of the page 0.5in Description The top page margin is the distance from the physical top of the page to the top of the region-before. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.jump1.xml0000664000175000017500000000164313160023042032240 0ustar bdbaddogbdbaddog htmlhelp.button.jump1 boolean htmlhelp.button.jump1 Should the Jump1 button be shown? Description Set to non-zero to include the Jump1 button on the toolbar. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/body.start.indent.xml0000664000175000017500000000427013160023042031426 0ustar bdbaddogbdbaddog body.start.indent length body.start.indent The start-indent for the body text 0pt 0pt 4pc Description This parameter provides the means of indenting the body text relative to section titles. For left-to-right text direction, it indents the left side. For right-to-left text direction, it indents the right side. It is used in place of the title.margin.left for all XSL-FO processors except FOP 0.25. It enables support for side floats to appear in the indented margin area. This start-indent property is added to the fo:flow for certain page sequences. Which page-sequences it is applied to is determined by the template named set.flow.properties. By default, that template adds it to the flow for page-sequences using the body master-reference, as well as appendixes and prefaces. If this parameter is used, section titles should have a start-indent value of 0pt if they are to be outdented relative to the body text. If you are using FOP, then set this parameter to a zero width value and set the title.margin.left parameter to the negative value of the desired indent. See also body.end.indent and title.margin.left. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.hyphenate.filenames.xml0000664000175000017500000000325013160023042032553 0ustar bdbaddogbdbaddog man.hyphenate.filenames boolean man.hyphenate.filenames Hyphenate filenames? 0 Description If zero (the default), hyphenation is suppressed for filename output. If hyphenation is already turned off globally (that is, if man.hyphenate is zero, setting man.hyphenate.filenames is not necessary. If man.hyphenate.filenames is non-zero, filenames will not be treated specially and are subject to hyphenation just like other words. If you are thinking about setting a non-zero value for man.hyphenate.filenames in order to make long filenames/pathnames break across lines, you'd probably be better off experimenting with setting the man.break.after.slash parameter first. That will cause long pathnames to be broken after slashes. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/graphic.default.extension.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/graphic.default.extension.xm0000664000175000017500000000213313160023042032750 0ustar bdbaddogbdbaddog graphic.default.extension string graphic.default.extension Default extension for graphic filenames Description If a graphic or mediaobject includes a reference to a filename that does not include an extension, and the format attribute is unspecified, the default extension will be used. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/informal.object.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/informal.object.properties.x0000664000175000017500000000263013160023042032771 0ustar bdbaddogbdbaddog informal.object.properties attribute set informal.object.properties Properties associated with an informal (untitled) object, such as an informalfigure 0.5em 1em 2em 0.5em 1em 2em Description The styling for informal objects in docbook. Specify the spacing before and after the object. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/keyboard.nav.xml0000664000175000017500000000167413160023042030445 0ustar bdbaddogbdbaddog keyboard.nav boolean keyboard.nav Enable keyboard navigation? Description If non-zero, JavaScript is added to the slides to enable keyboard navigation. Pressing 'n', space, or return moves forward; pressing 'p' moves backward. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.indent.width.xml0000664000175000017500000000234213160023043031237 0ustar bdbaddogbdbaddog toc.indent.width float toc.indent.width Amount of indentation for TOC entries 24 Description Specifies, in points, the distance by which each level of the TOC is indented from its parent. This value is expressed in points, without a unit (in other words, it is a bare number). Using a bare number allows the stylesheet to perform calculations that would otherwise have to be performed by the FO processor because not all processors support expressions. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.indent.xml0000664000175000017500000000221413160023042032327 0ustar bdbaddogbdbaddog chunker.output.indent string chunker.output.indent Specification of indentation on generated pages no Description This parameter specifies the value of the indent specification for generated pages. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/nongraphical.admonition.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/nongraphical.admonition.prop0000664000175000017500000000353713160023043033050 0ustar bdbaddogbdbaddog nongraphical.admonition.properties attribute set nongraphical.admonition.properties To add properties to the outer block of a nongraphical admonition. 0.8em 1em 1.2em 0.25in 0.25in Description These properties are added to the outer block containing the entire nongraphical admonition, including its title. It is used when the parameter admon.graphics is set to zero. Use this attribute-set to set the space above and below, and any indent for the whole admonition. In addition to these properties, a nongraphical admonition also applies the admonition.title.properties attribute-set to the title, and the admonition.properties attribute-set to the rest of the content. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.properties.xml0000664000175000017500000000213413160023043031712 0ustar bdbaddogbdbaddog section.properties attribute set section.properties Properties for all section levels Description The properties that apply to the containing block of all section levels, and therefore apply to the whole section. This attribute set is inherited by the more specific attribute sets such as section.level1.properties. The default is empty. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level5.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level5.propert0000664000175000017500000000211613160023043032725 0ustar bdbaddogbdbaddog section.title.level5.properties attribute set section.title.level5.properties Properties for level-5 section titles pt Description The properties of level-5 section titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.date.profile.xml0000664000175000017500000000265513160023043032274 0ustar bdbaddogbdbaddog refentry.date.profile string refentry.date.profile Specifies profile for refentry "date" data (($info[//date])[last()]/date)[1]| (($info[//pubdate])[last()]/pubdate)[1] Description The value of refentry.date.profile is a string representing an XPath expression. It is evaluated at run-time and used only if refentry.date.profile.enabled is non-zero. Otherwise, the refentry metadata-gathering logic "hard coded" into the stylesheets is used. The man(7) man page describes this content as "the date of the last revision". In man pages, it is the content that is usually displayed in the center footer. ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.head.legalnotice.link.types.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.head.legalnotice.link.t0000664000175000017500000000611513160023042032605 0ustar bdbaddogbdbaddog html.head.legalnotice.link.types string html.head.legalnotice.link.types Specifies link types for legalnotice link in html head copyright Description The value of html.head.legalnotice.link.types is a space-separated list of link types, as described in Section 6.12 of the HTML 4.01 specification. If the value of the generate.legalnotice.link parameter is non-zero, then the stylesheet generates (in the head section of the HTML source) either a single HTML link element or, if the value of the html.head.legalnotice.link.multiple is non-zero, one link element for each link type specified. Each link has the following attributes: a rel attribute whose value is derived from the value of html.head.legalnotice.link.types an href attribute whose value is set to the URL of the file containing the legalnotice a title attribute whose value is set to the title of the corresponding legalnotice (or a title programatically determined by the stylesheet) For example: <link rel="license" href="ln-id2524073.html" title="Legal Notice"> About the default value In an ideal world, the default value of html.head.legalnotice.link.types would probably be “licenseâ€, since the content of the DocBook legalnotice is typically license information, not copyright information. However, the default value is “copyright†for pragmatic reasons: because that’s among the set of “recognized link types†listed in Section 6.12 of the HTML 4.01 specification, and because certain browsers and browser extensions are preconfigured to recognize that value. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/annotate.toc.xml0000664000175000017500000000167013160023042030453 0ustar bdbaddogbdbaddog annotate.toc boolean annotate.toc Annotate the Table of Contents? Description If true, TOCs will be annotated. At present, this just means that the refpurpose of refentry TOC entries will be displayed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.manual.profile.xml0000664000175000017500000000457613160023043032640 0ustar bdbaddogbdbaddog refentry.manual.profile string refentry.manual.profile Specifies profile for refentry "manual" data (($info[//title])[last()]/title)[1]| ../title/node() Description The value of refentry.manual.profile is a string representing an XPath expression. It is evaluated at run-time and used only if refentry.manual.profile.enabled is non-zero. Otherwise, the refentry metadata-gathering logic "hard coded" into the stylesheets is used. In man pages, this content is usually displayed in the middle of the header of the page. The man(7) man page describes this as "the title of the manual (e.g., Linux Programmer's Manual)". Here are some examples from existing man pages: dpkg utilities (dpkg-name) User Contributed Perl Documentation (GET) GNU Development Tools (ld) Emperor Norton Utilities (ddate) Debian GNU/Linux manual (faked) GIMP Manual Pages (gimp) KDOC Documentation System (qt2kdoc) scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/line-height.xml0000664000175000017500000000150713160023042030252 0ustar bdbaddogbdbaddog line-height string line-height Specify the line-height property normal Description Sets the line-height property. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.append.xml0000664000175000017500000000220513160023042030263 0ustar bdbaddogbdbaddog html.append string html.append Specifies content to append to HTML output Description Specifies content to append to the end of HTML files output by the html/docbook.xsl stylesheet, after the closing <html> tag. You probably don’t want to set any value for this parameter; but if you do, the only value it should ever be set to is a newline character: &#x0a; or &#10; scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.row.height.xml0000664000175000017500000000227213160023043030720 0ustar bdbaddogbdbaddog toc.row.height length toc.row.height Height of ToC rows in dynamic ToCs 22 Description This parameter specifies the height of each row in the table of contents. This is only applicable if a dynamic ToC is used. You may want to adjust this parameter for optimal appearance with the font and image sizes selected by your CSS stylesheet. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.lang.fallback.sequence.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.lang.fallback.sequence0000664000175000017500000000623113160023043032657 0ustar bdbaddogbdbaddog olink.lang.fallback.sequence string olink.lang.fallback.sequence look up translated documents if olink not found? Description This parameter defines a list of lang values to search among to resolve olinks. Normally an olink tries to resolve to a document in the same language as the olink itself. The language of an olink is determined by its nearest ancestor element with a lang attribute, otherwise the value of the l10n.gentext.default.lang parameter. An olink database can contain target data for the same document in multiple languages. Each set of data has the same value for the targetdoc attribute in the document element in the database, but with a different lang attribute value. When an olink is being resolved, the target is first sought in the document with the same language as the olink. If no match is found there, then this parameter is consulted for additional languages to try. The olink.lang.fallback.sequence must be a whitespace separated list of lang values to try. The first one with a match in the olink database is used. The default value is empty. For example, a document might be written in German and contain an olink with targetdoc="adminguide". When the document is processed, the processor first looks for a target dataset in the olink database starting with: <document targetdoc="adminguide" lang="de">. If there is no such element, then the olink.lang.fallback.sequence parameter is consulted. If its value is, for example, fr en, then the processor next looks for targetdoc="adminguide" lang="fr", and then for targetdoc="adminguide" lang="en". If there is still no match, it looks for targetdoc="adminguide" with no lang attribute. This parameter is useful when a set of documents is only partially translated, or is in the process of being translated. If a target of an olink has not yet been translated, then this parameter permits the processor to look for the document in other languages. This assumes the reader would rather have a link to a document in a different language than to have a broken link. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/equation.number.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/equation.number.properties.x0000664000175000017500000000245413160023042033035 0ustar bdbaddogbdbaddog equation.number.properties attribute set equation.number.properties Properties that apply to the fo:table-cell containing the number of an equation that does not have a title. end center Description Properties that apply to the fo:table-cell containing the number of an equation when it has no title. The number in an equation with a title is formatted along with the title, and this attribute-set does not apply. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ignore.image.scaling.xml0000664000175000017500000000170313160023042032036 0ustar bdbaddogbdbaddog ignore.image.scaling boolean ignore.image.scaling Tell the stylesheets to ignore the author's image scaling attributes Description If non-zero, the scaling attributes on graphics and media objects are ignored. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/variablelist.term.separator.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/variablelist.term.separator.0000664000175000017500000000310313160023043032755 0ustar bdbaddogbdbaddog variablelist.term.separator string variablelist.term.separator Text to separate terms within a multi-term varlistentry , Description When a varlistentry contains multiple term elements, the string specified in the value of the variablelist.term.separator parameter is placed after each term except the last. To generate a line break between multiple terms in a varlistentry, set a non-zero value for the variablelist.term.break.after parameter. If you do so, you may also want to set the value of the variablelist.term.separator parameter to an empty string (to suppress rendering of the default comma and space after each term). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.zoom.xml0000664000175000017500000000161513160023042032167 0ustar bdbaddogbdbaddog htmlhelp.button.zoom boolean htmlhelp.button.zoom Should the Zoom button be shown? Description Set to non-zero to include the Zoom button on the toolbar. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/dingbat.font.family.xml0000664000175000017500000000237213160023042031713 0ustar bdbaddogbdbaddog dingbat.font.family list open serif sans-serif monospace dingbat.font.family The font family for copyright, quotes, and other symbols serif Description The dingbat font family is used for dingbats. If it is defined as the empty string, no font change is effected around dingbats. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/make.clean.html.xml0000664000175000017500000000377513160023042031027 0ustar bdbaddogbdbaddog make.clean.html boolean make.clean.html Make HTML conform to modern coding standards Description If make.clean.html is true, the stylesheets take extra effort to ensure that the resulting HTML is conforms to modern HTML coding standards. In addition to eliminating excessive and noncompliant coding, it moves presentation HTML coding to a CSS stylesheet. The resulting HTML is dependent on CSS for formatting, and so the stylesheet is capable of generating a supporting CSS file. The docbook.css.source and custom.css.source parameters control how a CSS file is generated. If you require your CSS to reside in the HTML head element, then the generate.css.header can be used to do that. The make.clean.html parameter is different from html.cleanup because the former changes the resulting markup; it does not use extension functions like the latter to manipulate result-tree-fragments, and is therefore applicable to any XSLT processor. If make.clean.html is set to zero (the default), then the stylesheet retains its original old style HTML formatting features. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/highlight.default.language.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/highlight.default.language.x0000664000175000017500000000167413160023042032705 0ustar bdbaddogbdbaddog highlight.default.language string highlight.default.language Default language of programlisting Description This language is used when there is no language attribute on programlisting. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/revhistory.table.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/revhistory.table.properties.0000664000175000017500000000173213160023043033034 0ustar bdbaddogbdbaddog revhistory.table.properties attribute set revhistory.table.properties The properties of table used for formatting revhistory Description This property set defines appearance of revhistory table. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/passivetex.extensions.xml0000664000175000017500000000237213160023043032450 0ustar bdbaddogbdbaddog passivetex.extensions boolean passivetex.extensions Enable PassiveTeX extensions? Description If non-zero, PassiveTeX extensions will be used. At present, this consists of PDF bookmarks and sorted index terms. This parameter can also affect which graphics file formats are supported PassiveTeX is incomplete and development has ceased. In most cases, another XSL-FO engine is probably a better choice. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/funcsynopsis.decoration.xml0000664000175000017500000000207013160023042032742 0ustar bdbaddogbdbaddog funcsynopsis.decoration boolean funcsynopsis.decoration Decorate elements of a funcsynopsis? Description If non-zero, elements of the funcsynopsis will be decorated (e.g. rendered as bold or italic text). The decoration is controlled by templates that can be redefined in a customization layer. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/exsl.node.set.available.xml0000664000175000017500000000315313160023042032464 0ustar bdbaddogbdbaddog exsl.node.set.available boolean exsl.node.set.available Is the test function-available('exsl:node-set') true? 1 0 Description If non-zero, then the exsl:node-set() function is available to be used in the stylesheet. If zero, then the function is not available. This param automatically detects the presence of the function and does not normally need to be set manually. This param was created to handle a long-standing bug in the Xalan processor that fails to detect the function even though it is available. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/entry.propagates.style.xml0000664000175000017500000000203113160023042032512 0ustar bdbaddogbdbaddog entry.propagates.style boolean entry.propagates.style Pass entry role attribute through to HTML? Description If true, the role attribute of entry elements will be passed through to the HTML as a class attribute on the td or th generated for the table cell. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/tablecolumns.extension.xml0000664000175000017500000000200313160023043032551 0ustar bdbaddogbdbaddog tablecolumns.extension boolean tablecolumns.extension Enable the table columns extension function Description The table columns extension function adjusts the widths of table columns in the HTML result to more accurately reflect the specifications in the CALS table. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.font.table.title.xml0000664000175000017500000000202313160023042031775 0ustar bdbaddogbdbaddog man.font.table.title string man.font.table.title Specifies font for table headings B Description The man.font.table.title parameter specifies the font for table titles. It should be a valid roff font, such as B or I. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/margin.note.width.xml0000664000175000017500000000224313160023043031413 0ustar bdbaddogbdbaddog margin.note.width length margin.note.width Set the default width for margin notes 1in Description Sets the default width for margin notes when used as a side float. The width determines the degree to which the margin note block intrudes into the text area. If margin.note.float.type is before or none, then this parameter is ignored. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/sidebar.float.type.xml0000664000175000017500000000565013160023043031556 0ustar bdbaddogbdbaddog sidebar.float.type list none before left start right end inside outside sidebar.float.type Select type of float for sidebar elements none Description Selects the type of float for sidebar elements. If sidebar.float.type is none, then no float is used. If sidebar.float.type is before, then the float appears at the top of the page. On some processors, that may be the next page rather than the current page. If sidebar.float.type is left, then a left side float is used. If sidebar.float.type is start, then when the text direction is left-to-right a left side float is used. When the text direction is right-to-left, a right side float is used. If sidebar.float.type is right, then a right side float is used. If sidebar.float.type is end, then when the text direction is left-to-right a right side float is used. When the text direction is right-to-left, a left side float is used. If your XSL-FO processor supports floats positioned on the inside or outside of double-sided pages, then you have those two options for side floats as well. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level1.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level1.propertie0000664000175000017500000000212113160023043032653 0ustar bdbaddogbdbaddog qanda.title.level1.properties attribute set qanda.title.level1.properties Properties for level-1 qanda set titles pt Description The properties of level-1 qanda set titles. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/orderedlist.label.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/orderedlist.label.properties0000664000175000017500000000224013160023043033043 0ustar bdbaddogbdbaddog orderedlist.label.properties attribute set orderedlist.label.properties Properties that apply to each label inside ordered list. Description Properties that apply to each label inside ordered list. E.g.: <xsl:attribute-set name="orderedlist.label.properties"> <xsl:attribute name="text-align">right</xsl:attribute> </xsl:attribute-set> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.stylesheet.type.xml0000664000175000017500000000166013160023042032171 0ustar bdbaddogbdbaddog html.stylesheet.type string html.stylesheet.type The type of the stylesheet used in the generated HTML text/css Description The type of the stylesheet to place in the HTML link tag. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhc.width.xml0000664000175000017500000000164313160023042031552 0ustar bdbaddogbdbaddog htmlhelp.hhc.width integer htmlhelp.hhc.width Width of navigation pane Description This parameter specifies the width of the navigation pane (containing TOC and other navigation tabs) in pixels. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/admon.textlabel.xml0000664000175000017500000000206213160023042031133 0ustar bdbaddogbdbaddog admon.textlabel boolean admon.textlabel Use text label in admonitions? Description If true (non-zero), admonitions are presented with a generated text label such as Note or Warning in the appropriate language. If zero, such labels are turned off, but any title child of the admonition element are still output. The default value is 1. ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.source.fallback.profile.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.source.fallback.pro0000664000175000017500000000403713160023043032752 0ustar bdbaddogbdbaddog refentry.source.fallback.profile string refentry.source.fallback.profile Specifies profile of "fallback" for refentry "source" data refmeta/refmiscinfo[not(@class = 'date')][1]/node() Description The value of refentry.source.fallback.profile is a string representing an XPath expression. It is evaluated at run-time and used only if no "source" data can be found by other means (that is, either using the refentry metadata-gathering logic "hard coded" in the stylesheets, or the value of the refentry.source.name.profile and refentry.version.profile parameters, if those are enabled). Depending on which XSLT engine you run, either the EXSLT dyn:evaluate extension function (for xsltproc or Xalan) or saxon:evaluate extension function (for Saxon) are used to dynamically evaluate the value of refentry.source.fallback.profile at run-time. If you don't use xsltproc, Saxon, Xalan -- or some other XSLT engine that supports dyn:evaluate -- you must manually disable fallback processing by setting an empty value for the refentry.source.fallback.profile parameter. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.preferred.page.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.preferred.page.propert0000664000175000017500000000231013160023042032740 0ustar bdbaddogbdbaddog index.preferred.page.properties attribute set index.preferred.page.properties Properties used to emphasize page number references for significant index terms bold Description Properties used to emphasize page number references for significant index terms (significance=preferred). Currently works only with XEP. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.count.titlepage.xml0000664000175000017500000000157513160023042032463 0ustar bdbaddogbdbaddog column.count.titlepage integer column.count.titlepage Number of columns on a title page Description Number of columns on a title page scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/slide.font.family.xml0000664000175000017500000000223513160023043031402 0ustar bdbaddogbdbaddog slide.font.family list open serif sans-serif monospace slide.font.family Specifies font family to use for slide bodies Helvetica Description Specifies the font family to use for slides bodies. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.sysid.xml0000664000175000017500000000151313160023043030321 0ustar bdbaddogbdbaddog olink.sysid string olink.sysid Names the system identifier portion of an OLink resolver query sysid Description FIXME scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.condition.xml0000664000175000017500000000254513160023043031506 0ustar bdbaddogbdbaddog profile.condition string profile.condition Target profile for condition attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/superscript.properties.xml0000664000175000017500000000173513160023043032637 0ustar bdbaddogbdbaddog superscript.properties attribute set superscript.properties Properties associated with superscripts 75% Description Specifies styling properties for superscripts. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.source.name.profile.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.source.name.profile0000664000175000017500000000660213160023043032773 0ustar bdbaddogbdbaddog refentry.source.name.profile string refentry.source.name.profile Specifies profile for refentry "source name" data (($info[//productname])[last()]/productname)[1]| (($info[//corpname])[last()]/corpname)[1]| (($info[//corpcredit])[last()]/corpcredit)[1]| (($info[//corpauthor])[last()]/corpauthor)[1]| (($info[//orgname])[last()]/orgname)[1]| (($info[//publishername])[last()]/publishername)[1] Description The value of refentry.source.name.profile is a string representing an XPath expression. It is evaluated at run-time and used only if refentry.source.name.profile.enabled is non-zero. Otherwise, the refentry metadata-gathering logic "hard coded" into the stylesheets is used. A "source name" is one part of a (potentially) two-part Name Version "source" field. In man pages, it is usually displayed in the left footer of the page. It typically indicates the software system or product that the item documented in the man page belongs to. The man(7) man page describes it as "the source of the command", and provides the following examples: For binaries, use something like: GNU, NET-2, SLS Distribution, MCC Distribution. For system calls, use the version of the kernel that you are currently looking at: Linux 0.99.11. For library calls, use the source of the function: GNU, BSD 4.3, Linux DLL 4.4.1. In practice, there are many pages that simply have a Version number in the "source" field. So, it looks like what we have is a two-part field, Name Version, where: Name product name (e.g., BSD) or org. name (e.g., GNU) Version version number Each part is optional. If the Name is a product name, then the Version is probably the version of the product. Or there may be no Name, in which case, if there is a Version, it is probably the version of the item itself, not the product it is part of. Or, if the Name is an organization name, then there probably will be no Version. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.authors.section.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.authors.section.enabled.0000664000175000017500000000366213160023042032633 0ustar bdbaddogbdbaddog man.authors.section.enabled boolean man.authors.section.enabled Display auto-generated AUTHORS section? 1 Description If the value of man.authors.section.enabled is non-zero (the default), then an AUTHORS section is generated near the end of each man page. The output of the AUTHORS section is assembled from any author, editor, and othercredit metadata found in the contents of the child info or refentryinfo (if any) of the refentry itself, or from any author, editor, and othercredit metadata that may appear in info contents of any ancestors of the refentry. If the value of man.authors.section.enabled is zero, the the auto-generated AUTHORS section is suppressed. Set the value of man.authors.section.enabled to zero if you want to have a manually created AUTHORS section in your source, and you want it to appear in output instead of the auto-generated AUTHORS section. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ade.extensions.xml0000664000175000017500000000240013160023042030775 0ustar bdbaddogbdbaddog ade.extensions boolean ade.extensions Enable Adobe Digitial Editions extensions for ePub rendering? Description If non-zero, Adobe Digital Editions extensions will be used when rendering to ePub output. Adobe Digital Editions extensions consists rendering and layout extensions. This parameter can also affect which graphics file formats are supported. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.th.extra2.max.length.xml0000664000175000017500000000343313160023043032513 0ustar bdbaddogbdbaddog man.th.extra2.max.length integer man.th.extra2.max.length Maximum length of extra2 in header/footer 30 Description Specifies the maximum permitted length of the extra2 part of the man-page part of the .TH title line header/footer. If the extra2 content exceeds the maxiumum specified, it is truncated down to the maximum permitted length. The content of the extra2 field is usually displayed in the left footer of the page and is typically "source" data indicating the software system or product that the item documented in the man page belongs to, often in the form Name Version; for example, "GTK+ 1.2" (from the gtk-options(7) man page). The default value for this parameter is reasonable but somewhat arbitrary. If you are processing pages with long "source" information, you may want to experiment with changing the value in order to achieve the correct aesthetic results. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.home.url.xml0000664000175000017500000000162413160023042032734 0ustar bdbaddogbdbaddog htmlhelp.button.home.url string htmlhelp.button.home.url URL address of page accessible by Home button Description URL address of page accessible by Home button. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/keep.relative.image.uris.xml0000664000175000017500000000243013160023042032651 0ustar bdbaddogbdbaddog keep.relative.image.uris boolean keep.relative.image.uris Should image URIs be resolved against xml:base? Description If non-zero, relative URIs (in, for example fileref attributes) will be used in the generated output. Otherwise, the URIs will be made absolute with respect to the base URI. Note that the stylesheets calculate (and use) the absolute form for some purposes, this only applies to the resulting output. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.default.topic.xml0000664000175000017500000000253113160023042032430 0ustar bdbaddogbdbaddog htmlhelp.default.topic string htmlhelp.default.topic Name of file with default topic Description Normally first chunk of document is displayed when you open HTML Help file. If you want to display another topic, simply set its filename by this parameter. This is useful especially if you don't generate ToC in front of your document and you also hide root element in ToC. E.g.: <xsl:param name="generate.book.toc" select="0"/> <xsl:param name="htmlhelp.hhc.show.root" select="0"/> <xsl:param name="htmlhelp.default.topic">pr01.html</xsl:param> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.on.type.xml0000664000175000017500000000344013160023042030555 0ustar bdbaddogbdbaddog index.on.type boolean index.on.type Select indexterms based on type attribute value Description If non-zero, then an index element that has a type attribute value will contain only those indexterm elements with a matching type attribute value. If an index has no type attribute or it is blank, then the index will contain all indexterms in the current scope. If index.on.type is zero, then the type attribute has no effect on selecting indexterms for an index. For those using DocBook version 4.2 or earlier, the type attribute is not available for index terms. However, you can achieve the same effect by using the role attribute in the same manner on indexterm and index, and setting the stylesheet parameter index.on.role to a nonzero value. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/slides.js.xml0000664000175000017500000000161513160023043027754 0ustar bdbaddogbdbaddog slides.js filename slides.js Slides overlay file slides.js Description Specifies the filename of the slides JavaScript file. It's unlikely that you will ever need to change this parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.html.xml0000664000175000017500000000153013160023043027602 0ustar bdbaddogbdbaddog toc.html filename toc.html Name of ToC HTML file Description Sets the filename used for the table of contents page. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/feedback.link.text.xml0000664000175000017500000000201613160023042031514 0ustar bdbaddogbdbaddog feedback.link.text string feedback.link.text The text of the feedback link Feedback Description The contents of this variable is used as the text of the feedback link if feedback.href is not empty. If feedback.href is empty, no feedback link is generated. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/header.table.height.xml0000664000175000017500000000233113160023042031636 0ustar bdbaddogbdbaddog header.table.height length header.table.height Specify the minimum height of the table containing the running page headers 14pt Description Page headers in print output use a three column table to position text at the left, center, and right side of the header on the page. This parameter lets you specify the minimum height of the single row in the table. Since this specifies only the minimum height, the table should automatically grow to fit taller content. The default value is "14pt". scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.gap.index.xml0000664000175000017500000000166013160023042031226 0ustar bdbaddogbdbaddog column.gap.index length column.gap.index Gap between columns in the index 12pt Description Specifies the gap between columns in indexes (if column.count.index is greater than one). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.borders.with.css.xml0000664000175000017500000000164013160023043032343 0ustar bdbaddogbdbaddog table.borders.with.css boolean table.borders.with.css Use CSS to specify table, row, and cell borders? Description If non-zero, CSS will be used to draw table borders. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.better.ps.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.better.ps.enabled0000664000175000017500000000513613160023042032670 0ustar bdbaddogbdbaddog man.output.better.ps.enabled boolean man.output.better.ps.enabled Enable enhanced print/PostScript output? 0 Description If the value of the man.output.better.ps.enabled parameter is non-zero, certain markup is embedded in each generated man page such that PostScript output from the man -Tps command for that page will include a number of enhancements designed to improve the quality of that output. If man.output.better.ps.enabled is zero (the default), no such markup is embedded in generated man pages, and no enhancements are included in the PostScript output generated from those man pages by the man -Tps command. The enhancements provided by this parameter rely on features that are specific to groff (GNU troff) and that are not part of “classic†AT&T troff or any of its derivatives. Therefore, any man pages you generate with this parameter enabled will be readable only on systems on which the groff (GNU troff) program is installed, such as GNU/Linux systems. The pages will not not be readable on systems on with the classic troff (AT&T troff) command is installed. The value of this parameter only affects PostScript output generated from the man command. It has no effect on output generated using the FO backend. You can generate PostScript output for any man page by running the following command: man FOO -Tps > FOO.ps You can then generate PDF output by running the following command: ps2pdf FOO.ps scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/collect.xref.targets.xml0000664000175000017500000000333213160023042032113 0ustar bdbaddogbdbaddog collect.xref.targets list no yes only collect.xref.targets Controls whether cross reference data is collected no Description In order to resolve olinks efficiently, the stylesheets can generate an external data file containing information about all potential cross reference endpoints in a document. This parameter determines whether the collection process is run when the document is processed by the stylesheet. The default value is no, which means the data file is not generated during processing. The other choices are yes, which means the data file is created and the document is processed for output, and only, which means the data file is created but the document is not processed for output. See also targets.filename. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/use.role.as.xrefstyle.xml0000664000175000017500000000635413160023043032245 0ustar bdbaddogbdbaddog use.role.as.xrefstyle boolean use.role.as.xrefstyle Use role attribute for xrefstyle on xref? Description In DocBook documents that conform to a schema older than V4.3, this parameter allows role to serve the purpose of specifying the cross reference style. If non-zero, the role attribute on xref will be used to select the cross reference style. In DocBook V4.3, the xrefstyle attribute was added for this purpose. If the xrefstyle attribute is present, role will be ignored, regardless of the setting of this parameter. Example The following small stylesheet shows how to configure the stylesheets to make use of the cross reference style: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="../xsl/html/docbook.xsl"/> <xsl:output method="html"/> <xsl:param name="local.l10n.xml" select="document('')"/> <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en"> <l:context name="xref"> <l:template name="chapter" style="title" text="Chapter %n, %t"/> <l:template name="chapter" text="Chapter %n"/> </l:context> </l:l10n> </l:i18n> </xsl:stylesheet> With this stylesheet, the cross references in the following document: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> <book id="book"><title>Book</title> <preface> <title>Preface</title> <para>Normal: <xref linkend="ch1"/>.</para> <para>Title: <xref xrefstyle="title" linkend="ch1"/>.</para> </preface> <chapter id="ch1"> <title>First Chapter</title> <para>Irrelevant.</para> </chapter> </book> will appear as: Normal: Chapter 1. Title: Chapter 1, First Chapter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.th.title.max.length.xml0000664000175000017500000000512713160023043032431 0ustar bdbaddogbdbaddog man.th.title.max.length integer man.th.title.max.length Maximum length of title in header/footer 20 Description Specifies the maximum permitted length of the title part of the man-page .TH title line header/footer. If the title exceeds the maxiumum specified, it is truncated down to the maximum permitted length. Details Every man page generated using the DocBook stylesheets has a title line, specified using the TH roff macro. Within that title line, there is always, at a minimum, a title, followed by a section value (representing a man "section" -- usually just a number). The title and section are displayed, together, in the visible header of each page. Where in the header they are displayed depends on OS the man page is viewed on, and on what version of nroff/groff/man is used for viewing the page. But, at a minimum and across all systems, the title and section are displayed on the right-hand column of the header. On many systems -- those with a modern groff, including Linux systems -- they are displayed twice: both in the left and right columns of the header. So if the length of the title exceeds a certain percentage of the column width in which the page is viewed, the left and right titles can end up overlapping, making them unreadable, or breaking to another line, which doesn't look particularly good. So the stylesheets provide the man.th.title.max.length parameter as a means for truncating titles that exceed the maximum length that can be viewing properly in a page header. The default value is reasonable but somewhat arbitrary. If you have pages with long titles, you may want to experiment with changing the value in order to achieve the correct aesthetic results. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/component.title.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/component.title.properties.x0000664000175000017500000000354213160023042033042 0ustar bdbaddogbdbaddog component.title.properties attribute set component.title.properties Properties for component titles always false center start Description The properties common to all component titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/feedback.href.xml0000664000175000017500000000175713160023042030533 0ustar bdbaddogbdbaddog feedback.href uri feedback.href HREF (URI) for feedback link Description The feedback.href value is used as the value for the href attribute on the feedback link. If feedback.href is empty, no feedback link is generated. ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.source.name.profile.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.source.name.profile0000664000175000017500000000374613160023043033001 0ustar bdbaddogbdbaddog refentry.source.name.profile.enabled boolean refentry.source.name.profile.enabled Enable refentry "source name" profiling? 0 Description If the value of refentry.source.name.profile.enabled is non-zero, then during refentry metadata gathering, the info profile specified by the customizable refentry.source.name.profile parameter is used. If instead the value of refentry.source.name.profile.enabled is zero (the default), then "hard coded" logic within the DocBook XSL stylesheets is used for gathering refentry "source name" data. If you find that the default refentry metadata-gathering behavior is causing incorrect "source name" data to show up in your output, then consider setting a non-zero value for refentry.source.name.profile.enabled and adjusting the value of refentry.source.name.profile to cause correct data to be gathered. Note that the terms "source" and "source name" have special meanings in this context. For details, see the documentation for the refentry.source.name.profile parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/simplesect.in.toc.xml0000664000175000017500000000163113160023043031415 0ustar bdbaddogbdbaddog simplesect.in.toc boolean simplesect.in.toc Should simplesect elements appear in the TOC? Description If non-zero, simplesects will be included in the TOC. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/body.font.family.xml0000664000175000017500000000224113160023042031233 0ustar bdbaddogbdbaddog body.font.family list open serif sans-serif monospace body.font.family The default font family for body text serif Description The body font family is the default font used for text in the page body. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.graphics.number.limit.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.graphics.number.limi0000664000175000017500000000251413160023042032737 0ustar bdbaddogbdbaddog callout.graphics.number.limit integer callout.graphics.number.limit Number of the largest callout graphic 15 30 Description If callout.graphics is non-zero, graphics are used to represent callout numbers instead of plain text. The value of callout.graphics.number.limit is the largest number for which a graphic exists. If the callout number exceeds this limit, the default presentation "(plain text instead of a graphic)" will be used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunk.first.sections.xml0000664000175000017500000000202513160023042032135 0ustar bdbaddogbdbaddog chunk.first.sections boolean chunk.first.sections Chunk the first top-level section? Description If non-zero, a chunk will be created for the first top-level sect1 or section elements in each component. Otherwise, that section will be part of the chunk for its parent. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.show.menu.xml0000664000175000017500000000161613160023042031615 0ustar bdbaddogbdbaddog htmlhelp.show.menu boolean htmlhelp.show.menu Should the menu bar be shown? Description Set to non-zero to have an application menu bar in your HTML Help window. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/prev.image.xml0000664000175000017500000000154013160023043030110 0ustar bdbaddogbdbaddog prev.image filename prev.image Left-arrow image active/nav-prev.png Description Specifies the filename of the left-pointing navigation arrow. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/abstract.properties.xml0000664000175000017500000000214213160023042032047 0ustar bdbaddogbdbaddog abstract.properties attribute set abstract.properties Properties associated with the block surrounding an abstract 0.0in 0.0in Description Block styling properties for abstract. See also abstract.title.properties. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/tex.math.delims.xml0000664000175000017500000000277113160023043031066 0ustar bdbaddogbdbaddog tex.math.delims boolean tex.math.delims Should equations output for processing by TeX be surrounded by math mode delimiters? Description For compatibility with DSSSL based DBTeXMath from Allin Cottrell you should set this parameter to 0. This feature is useful for print/PDF output only if you use the obsolete and now unsupported PassiveTeX XSL-FO engine. Related Parameters tex.math.in.alt, passivetex.extensions See Also You can also use the dbtex delims processing instruction to control whether delimiters are output. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/use.id.as.filename.xml0000664000175000017500000000174013160023043031425 0ustar bdbaddogbdbaddog use.id.as.filename boolean use.id.as.filename Use ID value of chunk elements as the filename? Description If use.id.as.filename is non-zero, the filename of chunk elements that have IDs will be derived from the ID value. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.generate.name.xml0000664000175000017500000000230313160023043032417 0ustar bdbaddogbdbaddog refentry.generate.name boolean refentry.generate.name Output NAME header before refnames? Description If non-zero, a "NAME" section title is output before the list of refnames. This parameter and refentry.generate.title are mutually exclusive. This means that if you change this parameter to zero, you should set refentry.generate.title to non-zero unless you want get quite strange output. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/annotation.support.xml0000664000175000017500000000172313160023042031742 0ustar bdbaddogbdbaddog annotation.support boolean annotation.support Enable annotations? Description If non-zero, the stylesheets will attempt to support annotation elements in HTML by including some JavaScript (see annotation.js). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/bibliography.style.xml0000664000175000017500000000246113160023042031667 0ustar bdbaddogbdbaddog bibliography.style list normal iso690 bibliography.style Style used for formatting of biblioentries. normal Description Currently only normal and iso690 styles are supported. In order to use ISO690 style to the full extent you might need to use additional markup described on the following WiKi page. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/process.empty.source.toc.xml0000664000175000017500000000303613160023043032753 0ustar bdbaddogbdbaddog process.empty.source.toc boolean process.empty.source.toc Generate automated TOC if toc element occurs in a source document? Description Specifies that if an empty toc element is found in a source document, an automated TOC is generated at this point in the document. Depending on what the value of the generate.toc parameter is, setting this parameter to 1 could result in generation of duplicate automated TOCs. So the process.empty.source.toc is primarily useful as an "override": by placing an empty toc in your document and setting this parameter to 1, you can force a TOC to be generated even if generate.toc says not to. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossterm.list.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossterm.list.properties.xm0000664000175000017500000000213613160023042033064 0ustar bdbaddogbdbaddog glossterm.list.properties attribute set glossterm.list.properties To add properties to the glossterm in a list. Description These properties are added to the block containing a glossary term in a glossary when the glossary.as.blocks parameter is zero. Use this attribute-set to set font properties, for example. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/page.margin.inner.xml0000664000175000017500000000361513160023043031362 0ustar bdbaddogbdbaddog page.margin.inner length page.margin.inner The inner page margin 1.25in 1in Description The inner page margin is the distance from bound edge of the page to the first column of text. The inner page margin is the distance from bound edge of the page to the outer edge of the first column of text. In left-to-right text direction, this is the left margin of recto (front side) pages. For single-sided output, it is the left margin of all pages. In right-to-left text direction, this is the right margin of recto pages. For single-sided output, this is the right margin of all pages. Current versions (at least as of version 4.13) of the XEP XSL-FO processor do not correctly handle these margin settings for documents with right-to-left text direction. The workaround in that situation is to reverse the values for page.margin.inner and page.margin.outer, until this bug is fixed by RenderX. It does not affect documents with left-to-right text direction. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhc.show.root.xml0000664000175000017500000000202013160023042032363 0ustar bdbaddogbdbaddog htmlhelp.hhc.show.root boolean htmlhelp.hhc.show.root Should there be an entry for the root element in the ToC? Description If set to zero, there will be no entry for the root element in the ToC. This is useful when you want to provide the user with an expanded ToC as a default. ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footnote.sep.leader.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footnote.sep.leader.properti0000664000175000017500000000266513160023042033005 0ustar bdbaddogbdbaddog footnote.sep.leader.properties attribute set footnote.sep.leader.properties Properties associated with footnote separators black rule 1in Description The styling for the rule line that separates the footnotes from the body text. These are properties applied to the fo:leader used as the separator. If you want to do more than just set properties on the leader element, then you can customize the template named footnote.separator in fo/pagesetup.xsl. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.meta.get.quietly.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.meta.get.quietly.xm0000664000175000017500000000252613160023043032740 0ustar bdbaddogbdbaddog refentry.meta.get.quietly boolean refentry.meta.get.quietly Suppress notes and warnings when gathering refentry metadata? Description If zero (the default), notes and warnings about “missing†markup are generated during gathering of refentry metadata. If non-zero, the metadata is gathered “quietly†-- that is, the notes and warnings are suppressed. If you are processing a large amount of refentry content, you may be able to speed up processing significantly by setting a non-zero value for refentry.meta.get.quietly. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.in.separate.dir.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.in.separate.dir.x0000664000175000017500000000233113160023042032617 0ustar bdbaddogbdbaddog man.output.in.separate.dir boolean man.output.in.separate.dir Output man-page files in separate output directory? Description If the value of man.output.in.separate.dir parameter is non-zero, man-page files are output in a separate directory, specified by the man.output.base.dir parameter; otherwise, if the value of man.output.in.separate.dir is zero, man-page files are not output in a separate directory. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/draft.watermark.image.xml0000664000175000017500000000164013160023042032230 0ustar bdbaddogbdbaddog draft.watermark.image uri draft.watermark.image The URI of the image to be used for draft watermarks images/draft.png Description The image to be used for draft watermarks. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.unicode.font.xml0000664000175000017500000000172313160023042032112 0ustar bdbaddogbdbaddog callout.unicode.font string callout.unicode.font Specify a font for Unicode glyphs ZapfDingbats Description The name of the font to specify around Unicode callout glyphs. If set to the empty string, no font change will occur. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.jump2.url.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.jump2.url.xm0000664000175000017500000000164613160023042032671 0ustar bdbaddogbdbaddog htmlhelp.button.jump2.url string htmlhelp.button.jump2.url URL address of page accessible by Jump2 button Description URL address of page accessible by Jump2 button. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/bookmarks.collapse.xml0000664000175000017500000000210013160023042031634 0ustar bdbaddogbdbaddog bookmarks.collapse boolean bookmarks.collapse Specifies the initial state of bookmarks Description If non-zero, the bookmark tree is collapsed so that only the top-level bookmarks are displayed initially. Otherwise, the whole tree of bookmarks is displayed. This parameter currently works with FOP 0.93 or later. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/side.float.properties.xml0000664000175000017500000000373013160023043032301 0ustar bdbaddogbdbaddog side.float.properties attribute set side.float.properties Attribute set for side float container properties 2in 4pt 4pt 2pt 2pt 0pt 0pt start Description Properties that are applied to the fo:block-container inside of a side float that is generated by the template named floater. That template generates a side float when the side.float.type is set to one of the values for a side float. If you do only left or start side floats, you may want to set the padding-start attribute to zero. If you do only right or end side floats, you may want to set the padding-end attribute to zero. ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/revhistory.table.cell.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/revhistory.table.cell.proper0000664000175000017500000000201513160023043033002 0ustar bdbaddogbdbaddog revhistory.table.cell.properties attribute set revhistory.table.cell.properties The properties of table cells used for formatting revhistory Description This property set defines appearance of individual cells in revhistory table. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.revhistory.link.xml0000664000175000017500000000367613160023042033031 0ustar bdbaddogbdbaddog generate.revhistory.link boolean generate.revhistory.link Write revhistory to separate chunk and generate link? Description If non-zero, the contents of revhistory are written to a separate HTML file and a link to the file is generated. Otherwise, revhistory contents are rendered on the title page. The name of the separate HTML file is computed as follows: If a filename is given by the dbhtml filename processing instruction, that filename is used. If the revhistory has an id/xml:id attribute, and if use.id.as.filename != 0, the filename is the concatenation of the id value and the value of the html.ext parameter. If the revhistory does not have an id/xml:id attribute, or if use.id.as.filename = 0, the filename is the concatenation of "rh-", auto-generated id value, and html.ext value. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/headers.on.blank.pages.xml0000664000175000017500000000161113160023042032263 0ustar bdbaddogbdbaddog headers.on.blank.pages boolean headers.on.blank.pages Put headers on blank pages? Description If non-zero, headers will be placed on blank pages. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.resolver.xml0000664000175000017500000000153313160023043031031 0ustar bdbaddogbdbaddog olink.resolver string olink.resolver The root name of the OLink resolver (usually a script) /cgi-bin/olink Description FIXME: scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/template.xml0000664000175000017500000000133213160023043027665 0ustar bdbaddogbdbaddog [[NAME]] [[NAME]] Description FIXME: scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/list.block.spacing.xml0000664000175000017500000000261313160023042031543 0ustar bdbaddogbdbaddog list.block.spacing attribute set list.block.spacing What spacing do you want before and after lists? 1em 0.8em 1.2em 1em 0.8em 1.2em Description Specify the spacing required before and after a list. It is necessary to specify the space after a list block because lists can come inside of paras. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.chm.xml0000664000175000017500000000153113160023042030435 0ustar bdbaddogbdbaddog htmlhelp.chm string htmlhelp.chm Filename of output HTML Help file. htmlhelp.chm Description Set the name of resulting CHM file scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footnote.properties.xml0000664000175000017500000000337713160023042032114 0ustar bdbaddogbdbaddog footnote.properties attribute set footnote.properties Properties applied to each footnote body normal normal 0pt 0pt wrap treat-as-space Description This attribute set is applied to the footnote-block for each footnote. It can be used to set the font-size, font-family, and other inheritable properties that will be applied to all footnotes. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.count.index.xml0000664000175000017500000000155113160023042031606 0ustar bdbaddogbdbaddog column.count.index integer column.count.index Number of columns on index pages 2 Description Number of columns on index pages. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level2.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level2.propert0000664000175000017500000000212713160023043032724 0ustar bdbaddogbdbaddog section.title.level2.properties attribute set section.title.level2.properties Properties for level-2 section titles pt Description The properties of level-2 section titles. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.display.progress.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.display.progress.xm0000664000175000017500000000162213160023042033023 0ustar bdbaddogbdbaddog htmlhelp.display.progress boolean htmlhelp.display.progress Display compile progress? Description Set to non-zero to to display compile progress ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.label.includes.component.label.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.label.includes.compo0000664000175000017500000000202413160023043032715 0ustar bdbaddogbdbaddog section.label.includes.component.label boolean section.label.includes.component.label Do section labels include the component label? Description If non-zero, section labels are prefixed with the label of the component that contains them. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.pubid.xml0000664000175000017500000000150613160023043030273 0ustar bdbaddogbdbaddog olink.pubid string olink.pubid Names the public identifier portion of an OLink resolver query pubid Description ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.jump1.url.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.jump1.url.xm0000664000175000017500000000163313160023042032664 0ustar bdbaddogbdbaddog htmlhelp.button.jump1.url string htmlhelp.button.jump1.url URL address of page accessible by Jump1 button Description URL address of page accessible by Jump1 button. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/hyphenate.verbatim.xml0000664000175000017500000000417413160023042031655 0ustar bdbaddogbdbaddog hyphenate.verbatim boolean hyphenate.verbatim Should verbatim environments be hyphenated on space characters? Description If the lines of program listing are too long to fit into one line it is quite common to split them at space and indicite by hook arrow that code continues on the next line. You can turn on this behaviour for programlisting, screen and synopsis elements by using this parameter. Note that you must also enable line wrapping for verbatim environments and select appropriate hyphenation character (e.g. hook arrow). This can be done using monospace.verbatim.properties attribute set: <xsl:attribute-set name="monospace.verbatim.properties" use-attribute-sets="verbatim.properties monospace.properties"> <xsl:attribute name="wrap-option">wrap</xsl:attribute> <xsl:attribute name="hyphenation-character">&#x25BA;</xsl:attribute> </xsl:attribute-set> For a list of arrows available in Unicode see http://www.unicode.org/charts/PDF/U2190.pdf and http://www.unicode.org/charts/PDF/U2900.pdf and make sure that selected character is available in the font you are using for verbatim environments. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/page.height.xml0000664000175000017500000000224213160023043030236 0ustar bdbaddogbdbaddog page.height length page.height The height of the physical page Description The page height is generally calculated from the paper.type and page.orientation parameters. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/biblioentry.properties.xml0000664000175000017500000000224013160023042032565 0ustar bdbaddogbdbaddog biblioentry.properties attribute set biblioentry.properties To set the style for biblioentry. 0.5in -0.5in Description How do you want biblioentry styled? Set the font-size, weight, space-above and space-below, indents, etc. to the style required ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xref.label-page.separator.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xref.label-page.separator.xm0000664000175000017500000000271713160023043032641 0ustar bdbaddogbdbaddog xref.label-page.separator string xref.label-page.separator Punctuation or space separating label from page number in xref Description This parameter allows you to control the punctuation of certain types of generated cross reference text. When cross reference text is generated for an xref or olink element using an xrefstyle attribute that makes use of the select: feature, and the selected components include both label and page but no title, then the value of this parameter is inserted between label and page number in the output. If a title is included, then other separators are used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/use.extensions.xml0000664000175000017500000000172613160023043031053 0ustar bdbaddogbdbaddog use.extensions boolean use.extensions Enable extensions Description If non-zero, extensions may be used. Each extension is further controlled by its own parameter. But if use.extensions is zero, no extensions will be used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.show.favorities.xml0000664000175000017500000000167513160023042033031 0ustar bdbaddogbdbaddog htmlhelp.show.favorities boolean htmlhelp.show.favorities Should the Favorites tab be shown? Description Set to non-zero to include a Favorites tab in the navigation pane of the help window. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.base.dir.xml0000664000175000017500000000276113160023042031660 0ustar bdbaddogbdbaddog man.output.base.dir uri man.output.base.dir Specifies separate output directory man/ Description The man.output.base.dir parameter specifies the base directory into which man-page files are output. The man.output.subdirs.enabled parameter controls whether the files are output in subdirectories within the base directory. The values of the man.output.base.dir and man.output.subdirs.enabled parameters are used only if the value of man.output.in.separate.dir parameter is non-zero. If the value of the man.output.in.separate.dir is zero, man-page files are not output in a separate directory. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/hidetoc.image.xml0000664000175000017500000000170313160023042030553 0ustar bdbaddogbdbaddog hidetoc.image filename hidetoc.image Hide ToC image hidetoc.gif Description Specifies the filename of the hide ToC image. This is used when the ToC hide/show parameter is enabled. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/linenumbering.extension.xml0000664000175000017500000000205413160023042032724 0ustar bdbaddogbdbaddog linenumbering.extension boolean linenumbering.extension Enable the line numbering extension Description If non-zero, verbatim environments (address, literallayout, programlisting, screen, synopsis) that specify line numbering will have line numbers. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.forward.xml0000664000175000017500000000164213160023042032647 0ustar bdbaddogbdbaddog htmlhelp.button.forward boolean htmlhelp.button.forward Should the Forward button be shown? Description Set to non-zero to include the Forward button on the toolbar. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/foil.properties.xml0000664000175000017500000000253513160023042031203 0ustar bdbaddogbdbaddog foil.properties attribute set foil.properties Specifies properties for all foils 1in 1in bold Description This parameter specifies properties that are applied to all foils. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.date.profile.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.date.profile.enable0000664000175000017500000000357513160023043032724 0ustar bdbaddogbdbaddog refentry.date.profile.enabled boolean refentry.date.profile.enabled Enable refentry "date" profiling? 0 Description If the value of refentry.date.profile.enabled is non-zero, then during refentry metadata gathering, the info profile specified by the customizable refentry.date.profile parameter is used. If instead the value of refentry.date.profile.enabled is zero (the default), then "hard coded" logic within the DocBook XSL stylesheets is used for gathering refentry "date" data. If you find that the default refentry metadata-gathering behavior is causing incorrect "date" data to show up in your output, then consider setting a non-zero value for refentry.date.profile.enabled and adjusting the value of refentry.date.profile to cause correct data to be gathered. Note that the terms "source" and "date" have special meanings in this context. For details, see the documentation for the refentry.date.profile parameter. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossentry.list.item.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossentry.list.item.propert0000664000175000017500000000252013160023042033064 0ustar bdbaddogbdbaddog glossentry.list.item.properties attribute set glossentry.list.item.properties To add properties to each glossentry in a list. 1em 0.8em 1.2em Description These properties are added to the fo:list-item containing a glossentry in a glossary when the glossary.as.blocks parameter is zero. Use this attribute-set to set spacing between entries, for example. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.inherit.numeration.xml0000664000175000017500000000207513160023043032764 0ustar bdbaddogbdbaddog qanda.inherit.numeration boolean qanda.inherit.numeration Does enumeration of QandASet components inherit the numeration of parent elements? Description If non-zero, numbered qandadiv elements and question and answer inherit the enumeration of the ancestors of the qandaset. ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.omit-xml-declaration.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.omit-xml-decl0000664000175000017500000000233113160023042032722 0ustar bdbaddogbdbaddog chunker.output.omit-xml-declaration string chunker.output.omit-xml-declaration Omit-xml-declaration for generated pages no Description This parameter specifies the value of the omit-xml-declaration specification for generated pages. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.hyphenate.urls.xml0000664000175000017500000000321713160023042031600 0ustar bdbaddogbdbaddog man.hyphenate.urls boolean man.hyphenate.urls Hyphenate URLs? 0 Description If zero (the default), hyphenation is suppressed for output of the ulink url attribute. If hyphenation is already turned off globally (that is, if man.hyphenate is zero, setting man.hyphenate.urls is not necessary. If man.hyphenate.urls is non-zero, URLs will not be treated specially and are subject to hyphenation just like other words. If you are thinking about setting a non-zero value for man.hyphenate.urls in order to make long URLs break across lines, you'd probably be better off experimenting with setting the man.break.after.slash parameter first. That will cause long URLs to be broken after slashes. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/show.comments.xml0000664000175000017500000000206613160023043030663 0ustar bdbaddogbdbaddog show.comments boolean show.comments Display remark elements? Description If non-zero, comments will be displayed, otherwise they are suppressed. Comments here refers to the remark element (which was called comment prior to DocBook 4.0), not XML comments (<-- like this -->) which are unavailable. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/no.toc.image.xml0000664000175000017500000000155313160023043030340 0ustar bdbaddogbdbaddog no.toc.image filename no.toc.image Inactive ToC image inactive/nav-toc.png Description Specifies the filename of the inactive ToC navigation icon. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/foilgroup.properties.xml0000664000175000017500000000207013160023042032252 0ustar bdbaddogbdbaddog foilgroup.properties attribute set foilgroup.properties Specifies properties for all foilgroups Description This parameter specifies properties that are applied to all foilgroups. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/active.toc.xml0000664000175000017500000000167613160023042030123 0ustar bdbaddogbdbaddog active.toc boolean active.toc Active ToCs? Description If non-zero, JavaScript is used to keep the ToC and the current slide in sync. That is, each time the slide changes, the corresponding ToC entry will be underlined. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/slide.title.font.family.xml0000664000175000017500000000227213160023043032523 0ustar bdbaddogbdbaddog slide.title.font.family list open serif sans-serif monospace slide.title.font.family Specifies font family to use for slide titles Helvetica Description Specifies the font family to use for slides titles. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xref.title-page.separator.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xref.title-page.separator.xm0000664000175000017500000000262113160023043032675 0ustar bdbaddogbdbaddog xref.title-page.separator string xref.title-page.separator Punctuation or space separating title from page number in xref Description This parameter allows you to control the punctuation of certain types of generated cross reference text. When cross reference text is generated for an xref or olink element using an xrefstyle attribute that makes use of the select: feature, and the selected components include both title and page number, then the value of this parameter is inserted between title and page number in the output. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/textbgcolor.xml0000664000175000017500000000163113160023043030410 0ustar bdbaddogbdbaddog textbgcolor color textbgcolor The background color of the table body white Description The background color of the table body. Only applies with the tabular presentation is being used. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level5.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level5.propertie0000664000175000017500000000211013160023043032655 0ustar bdbaddogbdbaddog qanda.title.level5.properties attribute set qanda.title.level5.properties Properties for level-5 qanda set titles pt Description The properties of level-5 qanda set titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.method.xml0000664000175000017500000000244013160023042032327 0ustar bdbaddogbdbaddog chunker.output.method list html xml chunker.output.method Method used in generated pages html Description This parameter specifies the output method to be used in files generated by the chunking stylesheet. This parameter used to be named output.method. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/axf.extensions.xml0000664000175000017500000000213213160023042031024 0ustar bdbaddogbdbaddog axf.extensions boolean axf.extensions Enable XSL Formatter extensions? Description If non-zero, XSL Formatter extensions will be used. XSL Formatter extensions consists of PDF bookmarks, document information and better index processing. This parameter can also affect which graphics file formats are supported scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/root.properties.xml0000664000175000017500000000315013160023043031230 0ustar bdbaddogbdbaddog root.properties attribute set root.properties The properties of the fo:root element character-by-character disregard-shifts Description This property set is used on the fo:root element of an FO file. It defines a set of default, global parameters. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossary.collection.xml0000664000175000017500000002410313160023042032047 0ustar bdbaddogbdbaddog glossary.collection string glossary.collection Name of the glossary collection file Description Glossaries maintained independently across a set of documents are likely to become inconsistent unless considerable effort is expended to keep them in sync. It makes much more sense, usually, to store all of the glossary entries in a single place and simply extract the ones you need in each document. That's the purpose of the glossary.collection parameter. To setup a global glossary database, follow these steps: Setting Up the Glossary Database First, create a stand-alone glossary document that contains all of the entries that you wish to reference. Make sure that each glossary entry has an ID. Here's an example glossary: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE glossary PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> <glossary> <glossaryinfo> <editor><firstname>Eric</firstname><surname>Raymond</surname></editor> <title>Jargon File 4.2.3 (abridged)</title> <releaseinfo>Just some test data</releaseinfo> </glossaryinfo> <glossdiv><title>0</title> <glossentry> <glossterm>0</glossterm> <glossdef> <para>Numeric zero, as opposed to the letter `O' (the 15th letter of the English alphabet). In their unmodified forms they look a lot alike, and various kluges invented to make them visually distinct have compounded the confusion. If your zero is center-dotted and letter-O is not, or if letter-O looks almost rectangular but zero looks more like an American football stood on end (or the reverse), you're probably looking at a modern character display (though the dotted zero seems to have originated as an option on IBM 3270 controllers). If your zero is slashed but letter-O is not, you're probably looking at an old-style ASCII graphic set descended from the default typewheel on the venerable ASR-33 Teletype (Scandinavians, for whom /O is a letter, curse this arrangement). (Interestingly, the slashed zero long predates computers; Florian Cajori's monumental "A History of Mathematical Notations" notes that it was used in the twelfth and thirteenth centuries.) If letter-O has a slash across it and the zero does not, your display is tuned for a very old convention used at IBM and a few other early mainframe makers (Scandinavians curse <emphasis>this</emphasis> arrangement even more, because it means two of their letters collide). Some Burroughs/Unisys equipment displays a zero with a <emphasis>reversed</emphasis> slash. Old CDC computers rendered letter O as an unbroken oval and 0 as an oval broken at upper right and lower left. And yet another convention common on early line printers left zero unornamented but added a tail or hook to the letter-O so that it resembled an inverted Q or cursive capital letter-O (this was endorsed by a draft ANSI standard for how to draw ASCII characters, but the final standard changed the distinguisher to a tick-mark in the upper-left corner). Are we sufficiently confused yet?</para> </glossdef> </glossentry> <glossentry> <glossterm>1TBS</glossterm> <glossdef> <para role="accidence"> <phrase role="pronounce"></phrase> <phrase role="partsofspeach">n</phrase> </para> <para>The "One True Brace Style"</para> <glossseealso>indent style</glossseealso> </glossdef> </glossentry> <!-- ... --> </glossdiv> <!-- ... --> </glossary> Marking Up Glossary Terms That takes care of the glossary database, now you have to get the entries into your document. Unlike bibliography entries, which can be empty, creating placeholder glossary entries would be very tedious. So instead, support for glossary.collection relies on implicit linking. In your source document, simply use firstterm and glossterm to identify the terms you wish to have included in the glossary. The stylesheets assume that you will either set the baseform attribute correctly, or that the content of the element exactly matches a term in your glossary. If you're using a glossary.collection, don't make explicit links on the terms in your document. So, in your document, you might write things like this: <para>This is dummy text, without any real meaning. The point is simply to reference glossary terms like <glossterm>0</glossterm> and the <firstterm baseform="1TBS">One True Brace Style (1TBS)</firstterm>. The <glossterm>1TBS</glossterm>, as you can probably imagine, is a nearly religious issue.</para> If you set the firstterm.only.link parameter, only the terms marked with firstterm will be links. Otherwise, all the terms will be linked. Marking Up the Glossary The glossary itself has to be identified for the stylesheets. For lack of a better choice, the role is used. To identify the glossary as the target for automatic processing, set the role to auto. The title of this glossary (and any other information from the glossaryinfo that's rendered by your stylesheet) will be displayed, but the entries will come from the database. Unfortunately, the glossary can't be empty, so you must put in at least one glossentry. The content of this entry is irrelevant, it will not be rendered: <glossary role="auto"> <glossentry> <glossterm>Irrelevant</glossterm> <glossdef> <para>If you can see this, the document was processed incorrectly. Use the <parameter>glossary.collection</parameter> parameter.</para> </glossdef> </glossentry> </glossary> What about glossary divisions? If your glossary database has glossary divisions and your automatic glossary contains at least one glossdiv, the automic glossary will have divisions. If the glossdiv is missing from either location, no divisions will be rendered. Glossary entries (and divisions, if appropriate) in the glossary will occur in precisely the order they occur in your database. Formatting the Document Finally, when you are ready to format your document, simply set the glossary.collection parameter (in either a customization layer or directly through your processor's interface) to point to your global glossary. The stylesheets will format the glossary in your document as if all of the entries implicilty referenced appeared there literally. Limitations Glossary cross-references within the glossary are not supported. For example, this will not work: <glossentry> <glossterm>gloss-1</glossterm> <glossdef><para>A description that references <glossterm>gloss-2</glossterm>.</para> <glossseealso>gloss-2</glossseealso> </glossdef> </glossentry> If you put glossary cross-references in your glossary that way, you'll get the cryptic error: Warning: glossary.collection specified, but there are 0 automatic glossaries. Instead, you must do two things: Markup your glossary using glossseealso: <glossentry> <glossterm>gloss-1</glossterm> <glossdef><para>A description that references <glossterm>gloss-2</glossterm>.</para> <glossseealso>gloss-2</glossseealso> </glossdef> </glossentry> Make sure there is at least one glossterm reference to gloss-2 in your document. The easiest way to do that is probably within a remark in your automatic glossary: <glossary role="auto"> <remark>Make sure there's a reference to <glossterm>gloss-2</glossterm>.</remark> <glossentry> <glossterm>Irrelevant</glossterm> <glossdef> <para>If you can see this, the document was processed incorrectly. Use the <parameter>glossary.collection</parameter> parameter.</para> </glossdef> </glossentry> </glossary> ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/runinhead.title.end.punct.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/runinhead.title.end.punct.xm0000664000175000017500000000225513160023043032675 0ustar bdbaddogbdbaddog runinhead.title.end.punct string runinhead.title.end.punct Characters that count as punctuation on a run-in-head .!?: Description Specify which characters are to be counted as punctuation. These characters are checked for a match with the last character of the title. If no match is found, the runinhead.default.title.end.punct contents are inserted. This is to avoid duplicated punctuation in the output. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callouts.extension.xml0000664000175000017500000000203113160023042031707 0ustar bdbaddogbdbaddog callouts.extension boolean callouts.extension Enable the callout extension Description The callouts extension processes areaset elements in programlistingco and other text-based callout elements. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.options.xml0000664000175000017500000000165113160023042032676 0ustar bdbaddogbdbaddog htmlhelp.button.options boolean htmlhelp.button.options Should the Options button be shown? Description If you want Options button shown on toolbar, turn this parameter to 1. ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/article.appendix.title.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/article.appendix.title.prope0000664000175000017500000000244613160023042032757 0ustar bdbaddogbdbaddog article.appendix.title.properties attribute set article.appendix.title.properties Properties for appendix titles that appear in an article Description The properties for the title of an appendix that appears inside an article. The default is to use the properties of sect1 titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/next.image.xml0000664000175000017500000000154313160023043030115 0ustar bdbaddogbdbaddog next.image filename next.image Right-arrow image active/nav-next.png Description Specifies the filename of the right-pointing navigation arrow. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/banner.before.navigation.xml0000664000175000017500000000154513160023042032723 0ustar bdbaddogbdbaddog banner.before.navigation boolean banner.before.navigation Put banner before navigation? Description FIXME scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/body.margin.top.xml0000664000175000017500000000167413160023042031074 0ustar bdbaddogbdbaddog body.margin.top length body.margin.top To specify the size of the top margin of a page 0.5in Description The body top margin is the distance from the top of the region-before to the first line of text in the page body. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhc.binary.xml0000664000175000017500000000177313160023042031723 0ustar bdbaddogbdbaddog htmlhelp.hhc.binary boolean htmlhelp.hhc.binary Generate binary ToC? Description Set to non-zero to generate a binary TOC. You must create a binary TOC if you want to add Prev/Next buttons to toolbar (which is default behaviour). Files with binary TOC can't be merged. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/itemizedlist.properties.xml0000664000175000017500000000200613160023042032751 0ustar bdbaddogbdbaddog itemizedlist.properties attribute set itemizedlist.properties Properties that apply to each list-block generated by itemizedlist. Description Properties that apply to each fo:list-block generated by itemizedlist. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.longdesc.xml0000664000175000017500000000176613160023042030625 0ustar bdbaddogbdbaddog html.longdesc boolean html.longdesc Should longdesc URIs be created? Description If non-zero, HTML files will be created for the longdesc attribute. These files are created from the textobjects in mediaobjects and inlinemediaobject. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/filename-prefix.xml0000664000175000017500000000207013160023042031124 0ustar bdbaddogbdbaddog filename-prefix string filename-prefix Prefix added to all filenames Description To produce the text-only (that is, non-tabular) layout of a website simultaneously with the tabular layout, the filenames have to be distinguished. That's accomplished by adding the filename-prefix to the front of each filename. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.indent.blurbs.xml0000664000175000017500000000236013160023042031376 0ustar bdbaddogbdbaddog man.indent.blurbs boolean man.indent.blurbs Adjust indentation of blurbs? Description If the value of man.indent.blurbs is non-zero, the width of the left margin for authorblurb, personblurb, and contrib output is set to the value of the man.indent.width parameter (3n by default). If instead the value of man.indent.blurbs is zero, the built-in roff default width (7.2n) is used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/eclipse.plugin.name.xml0000664000175000017500000000156613160023042031722 0ustar bdbaddogbdbaddog eclipse.plugin.name string eclipse.plugin.name Eclipse Help plugin name DocBook Online Help Sample Description Eclipse Help plugin name. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/docbook.css.link.xml0000664000175000017500000000276013160023042031222 0ustar bdbaddogbdbaddog docbook.css.link boolean docbook.css.link Insert a link referencing the default CSS stylesheet Description The stylesheets are capable of generating a default CSS stylesheet file. The parameters make.clean.html and docbook.css.source control that feature. Normally if a default CSS file is generated, then the stylesheet inserts a link tag in the HTML HEAD element to reference it. However, you can omit that link reference if you set the docbook.css.link to zero (1 is the default). This parameter is useful when you want to import the default CSS into a custom CSS file generated using the custom.css.source parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.window.geometry.xml0000664000175000017500000000202013160023042033021 0ustar bdbaddogbdbaddog htmlhelp.window.geometry string htmlhelp.window.geometry Set initial geometry of help window Description This parameter specifies initial position of help window. E.g. <xsl:param name="htmlhelp.window.geometry">[160,64,992,704]</xsl:param> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/crop.marks.xml0000664000175000017500000000163613160023042030137 0ustar bdbaddogbdbaddog crop.marks boolean crop.marks Output crop marks? Description If non-zero, crop marks will be added to each page. Currently this works only with XEP if you have xep.extensions set. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.print.xml0000664000175000017500000000162413160023042032337 0ustar bdbaddogbdbaddog htmlhelp.button.print boolean htmlhelp.button.print Should the Print button be shown? Description Set to non-zero to include the Print button on the toolbar. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhp.xml0000664000175000017500000000160013160023042030442 0ustar bdbaddogbdbaddog htmlhelp.hhp string htmlhelp.hhp Filename of project file. htmlhelp.hhp Description Change this parameter if you want different name of project file than htmlhelp.hhp. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xref.label-title.separator.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xref.label-title.separator.x0000664000175000017500000000256013160023043032665 0ustar bdbaddogbdbaddog xref.label-title.separator string xref.label-title.separator Punctuation or space separating label from title in xref : Description This parameter allows you to control the punctuation of certain types of generated cross reference text. When cross reference text is generated for an xref or olink element using an xrefstyle attribute that makes use of the select: feature, and the selected components include both label and title, then the value of this parameter is inserted between label and title in the output. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/rootid.xml0000664000175000017500000000237013160023043027355 0ustar bdbaddogbdbaddog rootid string rootid Specify the root element to format Description If rootid is not empty, it must be the value of an ID that occurs in the document being formatted. The entire document will be loaded and parsed, but formatting will begin at the element identified, rather than at the root. For example, this allows you to process only chapter 4 of a book. Because the entire document is available to the processor, automatic numbering, cross references, and other dependencies are correctly resolved. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.indent.width.xml0000664000175000017500000000306413160023042031226 0ustar bdbaddogbdbaddog man.indent.width length man.indent.width Specifies width used for adjusted indents 4 Description The man.indent.width parameter specifies the width used for adjusted indents. The value of man.indent.width is used for indenting of lists, verbatims, headings, and elsewhere, depending on whether the values of certain man.indent.* boolean parameters are non-zero. The value of man.indent.width should include a valid roff measurement unit (for example, n or u). The default value of 4n specifies a 4-en width; when viewed on a console, that amounts to the width of four characters. For details about roff measurment units, see the Measurements node in the groff info page. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/dry-run.xml0000664000175000017500000000214613160023042027455 0ustar bdbaddogbdbaddog dry-run boolean dry-run Indicates that no files should be produced Description When using the XSLT processor to manage dependencies and construct the website, this parameter can be used to suppress the generation of new and updated files. Effectively, this allows you to see what the stylesheet would do, without actually making any changes. Only applies when XSLT-based chunking is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunk.quietly.xml0000664000175000017500000000172313160023042030660 0ustar bdbaddogbdbaddog chunk.quietly boolean chunk.quietly Omit the chunked filename messages. Description If zero (the default), the XSL processor emits a message naming each separate chunk filename as it is being output. If nonzero, then the messages are suppressed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/annotation.css.xml0000664000175000017500000000421613160023042031016 0ustar bdbaddogbdbaddog annotation.css string annotation.css CSS rules for annotations /* ====================================================================== Annotations */ div.annotation-list { visibility: hidden; } div.annotation-nocss { position: absolute; visibility: hidden; } div.annotation-popup { position: absolute; z-index: 4; visibility: hidden; padding: 0px; margin: 2px; border-style: solid; border-width: 1px; width: 200px; background-color: white; } div.annotation-title { padding: 1px; font-weight: bold; border-bottom-style: solid; border-bottom-width: 1px; color: white; background-color: black; } div.annotation-body { padding: 2px; } div.annotation-body p { margin-top: 0px; padding-top: 0px; } div.annotation-close { position: absolute; top: 2px; right: 2px; } Description If annotation.support is enabled and the document contains annotations, then the CSS in this parameter will be included in the document. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/function.parens.xml0000664000175000017500000000163213160023042031170 0ustar bdbaddogbdbaddog function.parens boolean function.parens Generate parens after a function? Description If non-zero, the formatting of a function element will include generated parentheses. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/page.height.portrait.xml0000664000175000017500000000621113160023043032101 0ustar bdbaddogbdbaddog page.height.portrait length page.height.portrait Specify the physical size of the long edge of the page 210mm 11in 8.5in 2378mm 1682mm 1189mm 841mm 594mm 420mm 297mm 210mm 148mm 105mm 74mm 52mm 37mm 1414mm 1000mm 707mm 500mm 353mm 250mm 176mm 125mm 88mm 62mm 44mm 1297mm 917mm 648mm 458mm 324mm 229mm 162mm 114mm 81mm 57mm 40mm 11in Description The portrait page height is the length of the long edge of the physical page. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/img.src.path.xml0000664000175000017500000000274613160023042030360 0ustar bdbaddogbdbaddog img.src.path string img.src.path Path to HTML/FO image files Description Add a path prefix to the value of the fileref attribute of graphic, inlinegraphic, and imagedata elements. The resulting compound path is used in the output as the value of the src attribute of img (HTML) or external-graphic (FO). The path given by img.src.path could be relative to the directory where the HTML/FO files are created, or it could be an absolute URI. The default value is empty. Be sure to include a trailing slash if needed. This prefix is not applied to any filerefs that start with "/" or contain "//:". scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.prev.xml0000664000175000017500000000161513160023042032157 0ustar bdbaddogbdbaddog htmlhelp.button.prev boolean htmlhelp.button.prev Should the Prev button be shown? Description Set to non-zero to include the Prev button on the toolbar. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.th.extra3.max.length.xml0000664000175000017500000000337513160023043032521 0ustar bdbaddogbdbaddog man.th.extra3.max.length integer man.th.extra3.max.length Maximum length of extra3 in header/footer 30 Description Specifies the maximum permitted length of the extra3 part of the man-page .TH title line header/footer. If the extra3 content exceeds the maxiumum specified, it is truncated down to the maximum permitted length. The content of the extra3 field is usually displayed in the middle header of the page and is typically a "manual name"; for example, "GTK+ User's Manual" (from the gtk-options(7) man page). The default value for this parameter is reasonable but somewhat arbitrary. If you are processing pages with long "manual names" -- or especially if you are processing pages that have both long "title" parts (command/function, etc. names) and long manual names -- you may want to experiment with changing the value in order to achieve the correct aesthetic results. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.fragid.xml0000664000175000017500000000161113160023043030421 0ustar bdbaddogbdbaddog olink.fragid string olink.fragid Names the fragment identifier portion of an OLink resolver query fragid= Description The fragment identifier portion of an olink target. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/wordml.template.xml0000664000175000017500000000252613160023043031176 0ustar bdbaddogbdbaddog wordml.template uri wordml.template Specify the template WordML document Description The wordml.template parameter specifies a WordML document to use as a template for the generated document. The template document is used to define the (extensive) headers for the generated document, in particular the paragraph and character styles that are used to format the various elements. Any content in the template document is ignored. A template document is used in order to allow maintenance of the paragraph and character styles to be done using Word itself, rather than these XSL stylesheets. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/hyphenate.xml0000664000175000017500000000203213160023042030034 0ustar bdbaddogbdbaddog hyphenate list closed true false hyphenate Specify hyphenation behavior true Description If true, words may be hyphenated. Otherwise, they may not. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/textdata.default.encoding.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/textdata.default.encoding.xm0000664000175000017500000000227213160023043032730 0ustar bdbaddogbdbaddog textdata.default.encoding string textdata.default.encoding Default encoding of external text files which are included using textdata element Description Specifies the encoding of any external text files included using textdata element. This value is used only when you do not specify encoding by the appropriate attribute directly on textdata. An empty string is interpreted as the system default encoding. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.pagebreak.xml0000664000175000017500000000244113160023043031632 0ustar bdbaddogbdbaddog refentry.pagebreak boolean refentry.pagebreak Start each refentry on a new page Description If non-zero (the default), each refentry element will start on a new page. If zero, a page break will not be generated between refentry elements. The exception is when the refentry elements are children of a part element, in which case the page breaks are always retained. That is because a part element does not generate a page-sequence for its children, so each refentry must start its own page-sequence. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/suppress.navigation.xml0000664000175000017500000000161613160023043032101 0ustar bdbaddogbdbaddog suppress.navigation boolean suppress.navigation Disable header and footer navigation Description If non-zero, header and footer navigation will be suppressed. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level3.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level3.propertie0000664000175000017500000000211713160023043032662 0ustar bdbaddogbdbaddog qanda.title.level3.properties attribute set qanda.title.level3.properties Properties for level-3 qanda set titles pt Description The properties of level-3 qanda set titles. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level3.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level3.propert0000664000175000017500000000212513160023043032723 0ustar bdbaddogbdbaddog section.title.level3.properties attribute set section.title.level3.properties Properties for level-3 section titles pt Description The properties of level-3 section titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.value.xml0000664000175000017500000000272413160023043030633 0ustar bdbaddogbdbaddog profile.value string profile.value Target profile for user-specified attribute Description When you are using this parameter you must also specify name of profiling attribute with parameter profile.attribute. The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footer.table.height.xml0000664000175000017500000000233213160023042031705 0ustar bdbaddogbdbaddog footer.table.height length footer.table.height Specify the minimum height of the table containing the running page footers 14pt Description Page footers in print output use a three column table to position text at the left, center, and right side of the footer on the page. This parameter lets you specify the minimum height of the single row in the table. Since this specifies only the minimum height, the table should automatically grow to fit taller content. The default value is "14pt". scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/monospace.properties.xml0000664000175000017500000000252613160023043032237 0ustar bdbaddogbdbaddog monospace.properties attribute set monospace.properties Properties of monospaced content Description Specifies the font name for monospaced output. This property set used to set the font-size as well, but that doesn't work very well when different fonts are used (as they are in titles and paragraphs, for example). If you want to set the font-size in a customization layer, it's probably going to be more appropriate to set font-size-adjust, if your formatter supports it. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/title.margin.left.xml0000664000175000017500000000421013160023043031376 0ustar bdbaddogbdbaddog title.margin.left length title.margin.left Adjust the left margin for titles -4pc 0pt 0pt Description This parameter provides the means of adjusting the left margin for titles when the XSL-FO processor being used is an old version of FOP (0.25 and earlier). It is only useful when the fop.extensions is nonzero. The left margin of the body region is calculated to include this space, and titles are outdented to the left outside the body region by this amount, effectively leaving titles at the intended left margin and the body text indented. Currently this method is only used for old FOP because it cannot properly use the body.start.indent parameter. The default value when the fop.extensions parameter is nonzero is -4pc, which means the body text is indented 4 picas relative to the titles. The default value when the fop.extensions parameter equals zero is 0pt, and the body indent should instead be specified using the body.start.indent parameter. If you set the value to zero, be sure to still include a unit indicator such as 0pt, or the FO processor will report errors. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.footnote.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.footnote.properties.xm0000664000175000017500000000303413160023043033015 0ustar bdbaddogbdbaddog table.footnote.properties attribute set table.footnote.properties Properties applied to each table footnote body normal normal 2pt Description This attribute set is applied to the footnote-block for each table footnote. It can be used to set the font-size, font-family, and other inheritable properties that will be applied to all table footnotes. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.section.toc.level.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.section.toc.level.x0000664000175000017500000000257613160023042032662 0ustar bdbaddogbdbaddog generate.section.toc.level integer generate.section.toc.level Control depth of TOC generation in sections Description The generate.section.toc.level parameter controls the depth of section in which TOCs will be generated. Note that this is related to, but not the same as toc.section.depth, which controls the depth to which TOC entries will be generated in a given TOC. If, for example, generate.section.toc.level is 3, TOCs will be generated in first, second, and third level sections, but not in fourth level sections. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/alignment.xml0000664000175000017500000000302713160023042030032 0ustar bdbaddogbdbaddog alignment list open left start right end center justify alignment Specify the default text alignment justify Description The default text alignment is used for most body text. Allowed values are left, right, start, end, center, justify. The default value is justify. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/paper.type.xml0000664000175000017500000001046313160023043030146 0ustar bdbaddogbdbaddog paper.type list open open USletter8.5x11in USlandscape11x8.5in USlegal8.5inx14in USlegallandscape14inx8.5in 4A02378x1682mm 2A01682x1189mm A01189x841mm A1841x594mm A2594x420mm A3420x297mm A4297x210mm A5210x148mm A6148x105mm A7105x74mm A874x52mm A952x37mm A1037x26mm B01414x1000mm B11000x707mm B2707x500mm B3500x353mm B4353x250mm B5250x176mm B6176x125mm B7125x88mm B888x62mm B962x44mm B1044x31mm C01297x917mm C1917x648mm C2648x458mm C3458x324mm C4324x229mm C5229x162mm C6162x114mm C7114x81mm C881x57mm C957x40mm C1040x28mm paper.type Select the paper type USletter Description The paper type is a convenient way to specify the paper size. The list of known paper sizes includes USletter and most of the A, B, and C sizes. See page.width.portrait, for example. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.base.url.for.relative.links.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.base.url.for.relative.li0000664000175000017500000000615713160023042032553 0ustar bdbaddogbdbaddog man.base.url.for.relative.links string man.base.url.for.relative.links Specifies a base URL for relative links [set $man.base.url.for.relative.links]/ Description For any “notesource†listed in the auto-generated “NOTES†section of output man pages (which is generated when the value of the man.endnotes.list.enabled parameter is non-zero), if the notesource is a link source with a relative URI, the URI is displayed in output with the value of the man.base.url.for.relative.links parameter prepended to the value of the link URI. A link source is an notesource that references an external resource: a ulink element with a url attribute any element with an xlink:href attribute an imagedata, audiodata, or videodata element If you use relative URIs in link sources in your DocBook refentry source, and you leave man.base.url.for.relative.links unset, the relative links will appear “as is†in the “Notes†section of any man-page output generated from your source. That’s probably not what you want, because such relative links are only usable in the context of HTML output. So, to make the links meaningful and usable in the context of man-page output, set a value for man.base.url.for.relative.links that points to the online version of HTML output generated from your DocBook refentry source. For example: <xsl:param name="man.base.url.for.relative.links" >http://www.kernel.org/pub/software/scm/git/docs/</xsl:param> Related Parameters man.endnotes.list.enabled scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/l10n.gentext.language.xml0000664000175000017500000000231713160023042032066 0ustar bdbaddogbdbaddog l10n.gentext.language string l10n.gentext.language Sets the gentext language Description If this parameter is set to any value other than the empty string, its value will be used as the value for the language when generating text. Setting l10n.gentext.language overrides any settings within the document being formatted. It's much more likely that you might want to set the l10n.gentext.default.language parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xbLibrary.js.xml0000664000175000017500000000164713160023043030434 0ustar bdbaddogbdbaddog xbLibrary.js filename xbLibrary.js xbLibrary JavaScript file xbLibrary.js Description Specifies the filename of the xbLibrary JavaScript file. It's unlikely that you will ever need to change this parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.gap.lot.xml0000664000175000017500000000170113160023042030711 0ustar bdbaddogbdbaddog column.gap.lot length column.gap.lot Gap between columns on a 'List-of-Titles' page 12pt Description Specifies the gap between columns on 'List-of-Titles' pages (if column.count.lot is greater than one). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.refresh.xml0000664000175000017500000000163613160023042032644 0ustar bdbaddogbdbaddog htmlhelp.button.refresh boolean htmlhelp.button.refresh Should the Refresh button be shown? Description Set to non-zero to include the Stop button on the toolbar. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/running.foot.properties.xml0000664000175000017500000000233313160023043032675 0ustar bdbaddogbdbaddog running.foot.properties attribute set running.foot.properties Specifies properties for running foot on each slide 14pt #9F9F9F Description This parameter specifies properties that are applied to the running foot area of each slide. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/admonition.title.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/admonition.title.properties.0000664000175000017500000000236713160023042033015 0ustar bdbaddogbdbaddog admonition.title.properties attribute set admonition.title.properties To set the style for admonitions titles. 14pt bold false always Description How do you want admonitions titles styled? Set the font-size, weight etc to the style required. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/eclipse.autolabel.xml0000664000175000017500000000167013160023042031451 0ustar bdbaddogbdbaddog eclipse.autolabel boolean eclipse.autolabel Should tree-like ToC use autonumbering feature? Description If you want to include chapter and section numbers into ToC in the left panel, set this parameter to 1. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/highlight.source.xml0000664000175000017500000000655113160023042031327 0ustar bdbaddogbdbaddog highlight.source boolean highlight.source Should the content of programlisting be syntactically highlighted? Description When this parameter is non-zero, the stylesheets will try to do syntax highlighting of the content of programlisting elements. You specify the language for each programlisting by using the language attribute. The highlight.default.language parameter can be used to specify the language for programlistings without a language attribute. Syntax highlighting also works for screen and synopsis elements. The actual highlighting work is done by the XSLTHL extension module. This is an external Java library that has to be downloaded separately (see below). In order to use this extension, you must add xslthl-2.x.x.jar to your Java classpath. The latest version is available from the XSLT syntax highlighting project at SourceForge. use a customization layer in which you import one of the following stylesheet modules: html/highlight.xsl xhtml/highlight.xsl xhtml-1_1/highlight.xsl fo/highlight.xsl let either the xslthl.config Java system property or the highlight.xslthl.config parameter point to the configuration file for syntax highlighting (using URL syntax). DocBook XSL comes with a ready-to-use configuration file, highlighting/xslthl-config.xml. The extension works with Saxon 6.5.x and Xalan-J. (Saxon 8.5 or later is also supported, but since it is an XSLT 2.0 processor it is not guaranteed to work with DocBook XSL in all circumstances.) The following is an example of a Saxon 6 command adapted for syntax highlighting, to be used on Windows: java -cp c:/Java/saxon.jar;c:/Java/xslthl-2.0.1.jar -Dxslthl.config=file:///c:/docbook-xsl/highlighting/xslthl-config.xml com.icl.saxon.StyleSheet -o test.html test.xml myhtml.xsl scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.count.front.xml0000664000175000017500000000162213160023042031626 0ustar bdbaddogbdbaddog column.count.front integer column.count.front Number of columns on front matter pages Description Number of columns on front matter (dedication, preface, etc.) pages. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/annotation.js.xml0000664000175000017500000000230713160023042030641 0ustar bdbaddogbdbaddog annotation.js string annotation.js URIs identifying JavaScript files with support for annotation popups http://docbook.sourceforge.net/release/script/AnchorPosition.js http://docbook.sourceforge.net/release/script/PopupWindow.js Description If annotation.support is enabled and the document contains annotations, then the URIs listed in this parameter will be included. These JavaScript files are required for popup annotation support. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/root.filename.xml0000664000175000017500000000170313160023043030616 0ustar bdbaddogbdbaddog root.filename uri root.filename Identifies the name of the root HTML file when chunking index Description The root.filename is the base filename for the chunk created for the root of each document processed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/page.width.portrait.xml0000664000175000017500000000577513160023043031766 0ustar bdbaddogbdbaddog page.width.portrait length page.width.portrait Specify the physical size of the short edge of the page 8.5in 1682mm 1189mm 841mm 594mm 420mm 297mm 210mm 148mm 105mm 74mm 52mm 37mm 26mm 1000mm 707mm 500mm 353mm 250mm 176mm 125mm 88mm 62mm 44mm 31mm 917mm 648mm 458mm 324mm 229mm 162mm 114mm 81mm 57mm 40mm 28mm 8.5in Description The portrait page width is the length of the short edge of the physical page. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.autolabel.max.depth.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.autolabel.max.depth.0000664000175000017500000000220413160023043032632 0ustar bdbaddogbdbaddog section.autolabel.max.depth integer section.autolabel.max.depth The deepest level of sections that are numbered. 8 Description When section numbering is turned on by the section.autolabel parameter, then this parameter controls the depth of section nesting that is numbered. Sections nested to a level deeper than this value will not be numbered. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.title.xml0000664000175000017500000000165113160023042031012 0ustar bdbaddogbdbaddog htmlhelp.title string htmlhelp.title Title of HTML Help Description Content of this parameter will be used as a title for generated HTML Help. If empty, title will be automatically taken from document. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/writing.mode.xml0000664000175000017500000000467513160023043030475 0ustar bdbaddogbdbaddog writing.mode string writing.mode Direction of text flow based on locale writing-mode Description Sets direction of text flow and text alignment based on locale. The value is normally taken from the gentext file for the lang attribute of the document's root element, using the key name 'writing-mode' to look it up in the gentext file. But the param can also be set on the command line to override that gentext value. Accepted values are: lr-tb Left-to-right text flow in each line, lines stack top to bottom. rl-tb Right-to-left text flow in each line, lines stack top to bottom. tb-rl Top-to-bottom text flow in each vertical line, lines stack right to left. Supported by only a few XSL-FO processors. Not supported in HTML output. lr Shorthand for lr-tb. rl Shorthand for rl-tb. tb Shorthand for tb-rl. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossary.as.blocks.xml0000664000175000017500000000254113160023042031575 0ustar bdbaddogbdbaddog glossary.as.blocks boolean glossary.as.blocks Present glossarys using blocks instead of lists? Description If non-zero, glossarys will be formatted as blocks. If you have long glossterms, proper list markup in the FO case may produce unattractive lists. By setting this parameter, you can force the stylesheets to produce block markup instead of proper lists. You can override this setting with a processing instruction as the child of glossary: dbfo glossary-presentation="blocks" or dbfo glossary-presentation="list" scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/body.attributes.xml0000664000175000017500000000211313160023042031171 0ustar bdbaddogbdbaddog body.attributes attribute set body.attributes DEPRECATED white black #0000FF #840084 #0000FF Description DEPRECATED ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.frame.border.thickness.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.frame.border.thickness0000664000175000017500000000170313160023043032703 0ustar bdbaddogbdbaddog table.frame.border.thickness length table.frame.border.thickness Specifies the thickness of the frame border 0.5pt Description Specifies the thickness of the border on the table's frame. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.table.properties.xml0000664000175000017500000000244013160023043032423 0ustar bdbaddogbdbaddog table.table.properties attribute set table.table.properties Properties associated with a table retain collapse Description The styling for tables. This parameter should really have been called table.properties, but that parameter name was inadvertently established for the block-level properties of the table as a whole. See also table.properties. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footer.rule.xml0000664000175000017500000000151713160023042030322 0ustar bdbaddogbdbaddog footer.rule boolean footer.rule Rule over footers? Description If non-zero, a rule will be drawn above the page footers. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/minus.image.xml0000664000175000017500000000170513160023043030272 0ustar bdbaddogbdbaddog minus.image filename minus.image Minus image toc/open.png Description Specifies the filename of the minus image; the image used in a dynamic ToC to indicate that a section can be collapsed. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/compact.list.item.spacing.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/compact.list.item.spacing.xm0000664000175000017500000000236213160023042032661 0ustar bdbaddogbdbaddog compact.list.item.spacing attribute set compact.list.item.spacing What space do you want between list items (when spacing="compact")? 0em 0em 0.2em Description Specify what spacing you want between each list item when spacing is compact. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/autolayout-file.xml0000664000175000017500000000214313160023042031175 0ustar bdbaddogbdbaddog autolayout-file filename autolayout-file Identifies the autolayout.xml file autolayout.xml Description When the source pages are spread over several directories, this parameter can be set (for example, from the command line of a batch-mode XSLT processor) to indicate the location of the autolayout.xml file. FIXME: for browser-based use, there needs to be a PI for this... scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.range.separator.xml0000664000175000017500000000375513160023042032265 0ustar bdbaddogbdbaddog index.range.separator string index.range.separator Override for punctuation separating the two numbers in a page range in index Description This parameter permits you to override the text to insert between the two numbers of a page range in an index. This parameter is only used by those XSL-FO processors that support an extension for generating such page ranges (such as XEP). Because this text may be locale dependent, this parameter's value is normally taken from a gentext template named 'range-separator' in the context 'index' in the stylesheet locale file for the language of the current document. This parameter can be used to override the gentext string, and would typically be used on the command line. This parameter would apply to all languages. So this text string can be customized in two ways. You can reset the default gentext string using the local.l10n.xml parameter, or you can override the gentext with the content of this parameter. The content can be a simple string, or it can be something more complex such as a call-template. In HTML index output, section title references are used instead of page number references. So there are no page ranges and this parameter has no effect. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/itemizedlist.label.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/itemizedlist.label.propertie0000664000175000017500000000225013160023042033046 0ustar bdbaddogbdbaddog itemizedlist.label.properties attribute set itemizedlist.label.properties Properties that apply to each label inside itemized list. Description Properties that apply to each label inside itemized list. E.g.: <xsl:attribute-set name="itemizedlist.label.properties"> <xsl:attribute name="text-align">right</xsl:attribute> </xsl:attribute-set> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.blank.text.xml0000664000175000017500000000176013160023043030715 0ustar bdbaddogbdbaddog toc.blank.text string toc.blank.text The text for "blanks" in the TOC     Description If toc.blank.graphic is zero, this text string will be used for "blanks" in the TOC. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.cellpadding.xml0000664000175000017500000000172713160023042031272 0ustar bdbaddogbdbaddog html.cellpadding integer html.cellpadding Default value for cellpadding in HTML tables Description If non-zero, this value will be used as the default cellpadding value in HTML tables. nn for pixels or nn% for percentage length. E.g. 5 or 5% scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/fop1.extensions.xml0000664000175000017500000000223513160023042031117 0ustar bdbaddogbdbaddog fop1.extensions boolean fop1.extensions Enable extensions for FOP version 0.90 and later Description If non-zero, extensions for FOP version 0.90 and later will be used. This parameter can also affect which graphics file formats are supported. The original fop.extensions parameter should still be used for FOP version 0.20.5 and earlier. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/abstract.notitle.enabled.xml0000664000175000017500000000173213160023042032726 0ustar bdbaddogbdbaddog abstract.notitle.enabled boolean abstract.notitle.enabled Suppress display of abstract titles? Description If non-zero, in output of the abstract element on titlepages, display of the abstract title is suppressed. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/author.othername.in.middle.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/author.othername.in.middle.x0000664000175000017500000000207013160023042032645 0ustar bdbaddogbdbaddog author.othername.in.middle boolean author.othername.in.middle Is othername in author a middle name? Description If non-zero, the othername of an author appears between the firstname and surname. Otherwise, othername is suppressed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.line.properties.xml0000664000175000017500000000340513160023043031763 0ustar bdbaddogbdbaddog toc.line.properties attribute set toc.line.properties Properties for lines in ToCs and LoTs justify start Description Properties which are applied to every line in ToC (or LoT). You can modify them in order to change appearance of all, or some lines. For example, in order to make lines for chapters bold, specify the following in your customization layer: <xsl:attribute-set name="toc.line.properties"> <xsl:attribute name="font-weight"> <xsl:choose> <xsl:when test="self::chapter">bold</xsl:when> <xsl:otherwise>normal</xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:attribute-set> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/process.source.toc.xml0000664000175000017500000000301213160023043031610 0ustar bdbaddogbdbaddog process.source.toc boolean process.source.toc Process a non-empty toc element if it occurs in a source document? Description Specifies that the contents of a non-empty "hard-coded" toc element in a source document are processed to generate a TOC in output. This parameter has no effect on automated generation of TOCs. An automated TOC may still be generated along with the "hard-coded" TOC. To suppress automated TOC generation, adjust the value of the generate.toc paramameter. The process.source.toc parameter also has no effect if the toc element is empty; handling for empty toc is controlled by the process.empty.source.toc parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.count.body.xml0000664000175000017500000000154113160023042031433 0ustar bdbaddogbdbaddog column.count.body integer column.count.body Number of columns on body pages Description Number of columns on body pages. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/othercredit.like.author.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/othercredit.like.author.enab0000664000175000017500000000226213160023043032722 0ustar bdbaddogbdbaddog othercredit.like.author.enabled boolean othercredit.like.author.enabled Display othercredit in same style as author? 0 Description If non-zero, output of the othercredit element on titlepages is displayed in the same style as author and editor output. If zero then othercredit output is displayed using a style different than that of author and editor. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/make.single.year.ranges.xml0000664000175000017500000000176213160023042032472 0ustar bdbaddogbdbaddog make.single.year.ranges boolean make.single.year.ranges Print single-year ranges (e.g., 1998-1999) Description If non-zero, year ranges that span a single year will be printed in range notation (1998-1999) instead of discrete notation (1998, 1999). ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/header.content.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/header.content.properties.xm0000664000175000017500000000215713160023042032777 0ustar bdbaddogbdbaddog header.content.properties attribute set header.content.properties Properties of page header content Description Properties of page header content. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/insert.olink.page.number.xml0000664000175000017500000000545313160023042032702 0ustar bdbaddogbdbaddog insert.olink.page.number list no yes maybe insert.olink.page.number Turns page numbers in olinks on and off no Description The value of this parameter determines if cross references made between documents with olink will include page number citations. In most cases this is only applicable to references in printed output. The parameter has three possible values. no No page number references will be generated for olinks. yes Page number references will be generated for all olink references. The style of page reference may be changed if an xrefstyle attribute is used. maybe Page number references will not be generated for an olink element unless it has an xrefstyle attribute whose value specifies a page reference. Olinks that point to targets within the same document are treated as xrefs, and controlled by the insert.xref.page.number parameter. Page number references for olinks to external documents can only be inserted if the information exists in the olink database. This means each olink target element (div or obj) must have a page attribute whose value is its page number in the target document. The XSL stylesheets are not able to extract that information during processing because pages have not yet been created in XSLT transformation. Only the XSL-FO processor knows what page each element is placed on. Therefore some postprocessing must take place to populate page numbers in the olink database. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/annotation.graphic.close.xml0000664000175000017500000000235713160023042032753 0ustar bdbaddogbdbaddog annotation.graphic.close uri annotation.graphic.close Image for identifying a link that closes an annotation popup http://docbook.sourceforge.net/release/images/annot-close.png Description This image is used on popup annotations as the “x†that the user can click to dismiss the popup. This image is used on popup annotations as the “x†that the user can click to dismiss the popup. It may be replaced by a user provided graphic. The size should be approximately 10x10 pixels. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/navbgcolor.xml0000664000175000017500000000163613160023043030215 0ustar bdbaddogbdbaddog navbgcolor color navbgcolor The background color of the navigation TOC #4080FF Description The background color of the navigation TOC. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/showtoc.image.xml0000664000175000017500000000170313160023043030623 0ustar bdbaddogbdbaddog showtoc.image filename showtoc.image Show ToC image showtoc.gif Description Specifies the filename of the show ToC image. This is used when the ToC hide/show parameter is enabled. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.show.toolbar.text.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.show.toolbar.text.x0000664000175000017500000000170313160023042032742 0ustar bdbaddogbdbaddog htmlhelp.show.toolbar.text boolean htmlhelp.show.toolbar.text Show text under toolbar buttons? Description Set to non-zero to display texts under toolbar buttons, zero to switch off displays. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.links.to.section.xml0000664000175000017500000000523313160023042032367 0ustar bdbaddogbdbaddog index.links.to.section boolean index.links.to.section HTML index entries link to container section title Description If zero, then an index entry in an index links directly to the location of the generated anchor that is output for the indexterm. If two identical indexterm elements exist in the same section, then both entries appear in the index with the same title but link to different locations. If non-zero, then an index entry in an index links to the section title containing the indexterm, rather than directly to the anchor output for the indexterm. Duplicate indexterm entries in the same section are dropped. The default value is 1, so index entries link to section titles by default. In both cases, the link text in an index entry is the title of the section containing the indexterm. That is because HTML does not have numbered pages. It also provides the reader with context information for each link. This parameter lets you choose which style of index linking you want. When set to 0, an index entry takes you to the precise location of its corresponding indexterm. However, if you have a lot of duplicate entries in sections, then you have a lot of duplicate titles in the index, which makes it more cluttered. The reader may not recognize why duplicate titles appear until they follow the links. Also, the links may land the reader in the middle of a section where the section title is not visible, which may also be confusing to the reader. When set to 1, an index entry link is less precise, but duplicate titles in the index entries are eliminated. Landing on the section title location may confirm the reader's expectation that a link that shows a section title will take them to that section title, not a location within the section. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.copyright.section.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.copyright.section.enable0000664000175000017500000000365313160023042032734 0ustar bdbaddogbdbaddog man.copyright.section.enabled boolean man.copyright.section.enabled Display auto-generated COPYRIGHT section? 1 Description If the value of man.copyright.section.enabled is non-zero (the default), then a COPYRIGHT section is generated near the end of each man page. The output of the COPYRIGHT section is assembled from any copyright and legalnotice metadata found in the contents of the child info or refentryinfo (if any) of the refentry itself, or from any copyright and legalnotice metadata that may appear in info contents of any ancestors of the refentry. If the value of man.copyright.section.enabled is zero, the the auto-generated COPYRIGHT section is suppressed. Set the value of man.copyright.section.enabled to zero if you want to have a manually created COPYRIGHT section in your source, and you want it to appear in output instead of the auto-generated COPYRIGHT section. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/header.column.widths.xml0000664000175000017500000000565313160023042032110 0ustar bdbaddogbdbaddog header.column.widths string header.column.widths Specify relative widths of header areas 1 1 1 Description Page headers in print output use a three column table to position text at the left, center, and right side of the header on the page. This parameter lets you specify the relative sizes of the three columns. The default value is "1 1 1". The parameter value must be three numbers, separated by white space. The first number represents the relative width of the inside header for double-sided output. The second number is the relative width of the center header. The third number is the relative width of the outside header for double-sided output. For single-sided output, the first number is the relative width of left header for left-to-right text direction, or the right header for right-to-left text direction. The third number is the relative width of right header for left-to-right text direction, or the left header for right-to-left text direction. The numbers are used to specify the column widths for the table that makes up the header area. In the FO output, this looks like: <fo:table-column column-number="1" column-width="proportional-column-width(1)"/> The proportional-column-width() function computes a column width by dividing its argument by the total of the arguments for all the columns, and then multiplying the result by the width of the whole table (assuming all the column specs use the function). Its argument can be any positive integer or floating point number. Zero is an acceptable value, although some FO processors may warn about it, in which case using a very small number might be more satisfactory. For example, the value "1 2 1" means the center header should have twice the width of the other areas. A value of "0 0 1" means the entire header area is reserved for the right (or outside) header text. Note that to keep the center area centered on the page, the left and right values must be the same. A specification like "1 2 3" means the center area is no longer centered on the page since the right area is three times the width of the left area. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhp.window.xml0000664000175000017500000000163213160023042031755 0ustar bdbaddogbdbaddog htmlhelp.hhp.window string htmlhelp.hhp.window Name of default window. Main Description Name of default window. If empty no [WINDOWS] section will be added to project file. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/crop.mark.offset.xml0000664000175000017500000000162413160023042031236 0ustar bdbaddogbdbaddog crop.mark.offset length crop.mark.offset Length of crop marks. 24pt Description Length of crop marks. Crop marks are controlled by crop.marks parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/tex.math.file.xml0000664000175000017500000000263313160023043030525 0ustar bdbaddogbdbaddog tex.math.file string tex.math.file Name of temporary file for generating images from equations tex-math-equations.tex Description Name of auxiliary file for TeX equations. This file can be processed by dvi2bitmap to get bitmap versions of equations for HTML output. Related Parameters tex.math.in.alt, tex.math.delims, More information For how-to documentation on embedding TeX equations and generating output from them, see DBTeXMath. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/pgwide.properties.xml0000664000175000017500000000334013160023043031525 0ustar bdbaddogbdbaddog pgwide.properties attribute set pgwide.properties Properties to make a figure or table page wide. 0pt Description This attribute set is used to set the properties that make a figure or table "page wide" in fo output. It comes into effect when an attribute pgwide="1" is used. By default, it sets start-indent to 0pt. In a stylesheet that sets the parameter body.start.indent to a non-zero value in order to indent body text, this attribute set can be used to outdent pgwide figures to the start margin. If a document uses a multi-column page layout, then this attribute set could try setting span to a value of all. However, this may not work with some processors because a span property must be on an fo:block that is a direct child of fo:flow. It may work in some processors anyway. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.index.xml0000664000175000017500000000151713160023042030756 0ustar bdbaddogbdbaddog generate.index boolean generate.index Do you want an index? Description Specify if an index should be generated. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/double.sided.xml0000664000175000017500000000176513160023042030424 0ustar bdbaddogbdbaddog double.sided boolean double.sided Is the document to be printed double sided? Description Double-sided documents are printed with a slightly wider margin on the binding edge of the page. FIXME: The current set of parameters does not take writing direction into account. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/default.table.rules.xml0000664000175000017500000000424413160023042031721 0ustar bdbaddogbdbaddog default.table.rules string default.table.rules The default column and row rules for tables using HTML markup none Description Tables using HTML markup elements can use an attribute named rules on the table or informaltable element to specify whether column and row border rules should be displayed. This parameter lets you specify a global default style for all HTML tables that don't otherwise have that attribute. These are the supported values: all Rules will appear between all rows and columns. rows Rules will appear between rows only. cols Rules will appear between columns only. groups Rules will appear between row groups (thead, tfoot, tbody). No support for rules between column groups yet. none No rules. This is the default value. The border after the last row and the border after the last column are not affected by this setting. Those borders are controlled by the frame attribute on the table element. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/spacing.paras.xml0000664000175000017500000000176213160023043030612 0ustar bdbaddogbdbaddog spacing.paras boolean spacing.paras Insert additional <p> elements for spacing? Description When non-zero, additional, empty paragraphs are inserted in several contexts (for example, around informal figures), to create a more pleasing visual appearance in many browsers. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/use.role.for.mediaobject.xml0000664000175000017500000000362413160023043032646 0ustar bdbaddogbdbaddog use.role.for.mediaobject boolean use.role.for.mediaobject Use role attribute value for selecting which of several objects within a mediaobject to use. Description If non-zero, the role attribute on imageobjects or other objects within a mediaobject container will be used to select which object will be used. The order of selection when then parameter is non-zero is: If the stylesheet parameter preferred.mediaobject.role has a value, then the object whose role equals that value is selected. Else if an object's role attribute has a value of html for HTML processing or fo for FO output, then the first of such objects is selected. Else the first suitable object is selected. If the value of use.role.for.mediaobject is zero, then role attributes are not considered and the first suitable object with or without a role value is used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.font.table.headings.xml0000664000175000017500000000204713160023042032444 0ustar bdbaddogbdbaddog man.font.table.headings string man.font.table.headings Specifies font for table headings B Description The man.font.table.headings parameter specifies the font for table headings. It should be a valid roff font, such as B or I. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/script.dir.xml0000664000175000017500000000202613160023043030134 0ustar bdbaddogbdbaddog script.dir uri script.dir Script directory Description Identifies the JavaScript source directory for the slides. This parameter can be set in the source document with the <?dbhtml?> pseudo-attribute script-dir. If non-empty, this value is prepended to each of the JavaScript files. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/saxon.tablecolumns.xml0000664000175000017500000000175713160023043031704 0ustar bdbaddogbdbaddog saxon.tablecolumns boolean saxon.tablecolumns Enable the table columns extension function Description The table columns extension function adjusts the widths of table columns in the HTML result to more accurately reflect the specifications in the CALS table. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.source.name.suppress.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.source.name.suppres0000664000175000017500000000341413160023043033032 0ustar bdbaddogbdbaddog refentry.source.name.suppress boolean refentry.source.name.suppress Suppress "name" part of refentry "source" contents? 0 Description If the value of refentry.source.name.suppress is non-zero, then during refentry metadata gathering, no "source name" data is added to the refentry "source" contents. Instead (unless refentry.version.suppress is also non-zero), only "version" data is added to the "source" contents. If you find that the refentry metadata gathering mechanism is causing unwanted "source name" data to show up in your output -- for example, in the footer (or possibly header) of a man page -- then you might consider setting a non-zero value for refentry.source.name.suppress. Note that the terms "source", "source name", and "version" have special meanings in this context. For details, see the documentation for the refentry.source.name.profile parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.term.separator.xml0000664000175000017500000000361013160023042032126 0ustar bdbaddogbdbaddog index.term.separator string index.term.separator Override for punctuation separating an index term from its list of page references in an index Description This parameter permits you to override the text to insert between the end of an index term and its list of page references. Typically that might be a comma and a space. Because this text may be locale dependent, this parameter's value is normally taken from a gentext template named 'term-separator' in the context 'index' in the stylesheet locale file for the language of the current document. This parameter can be used to override the gentext string, and would typically be used on the command line. This parameter would apply to all languages. So this text string can be customized in two ways. You can reset the default gentext string using the local.l10n.xml parameter, or you can fill in the content for this normally empty override parameter. The content can be a simple string, or it can be something more complex such as a call-template. For fo output, it could be an fo:leader element to provide space of a specific length, or a dot leader. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/overlay.logo.xml0000664000175000017500000000167113160023043030500 0ustar bdbaddogbdbaddog overlay.logo uri overlay.logo Logo to overlay on ToC frame http://docbook.sourceforge.net/release/buttons/slides-1.png Description If this URI is non-empty, JavaScript is used to overlay the specified image on the ToC frame. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.generate.title.xml0000664000175000017500000000232013160023043032617 0ustar bdbaddogbdbaddog refentry.generate.title boolean refentry.generate.title Output title before refnames? Description If non-zero, the reference page title or first name is output before the list of refnames. This parameter and refentry.generate.name are mutually exclusive. This means that if you change this parameter to non-zero, you should set refentry.generate.name to zero unless you want get quite strange output. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.enhanced.decompilation.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.enhanced.decompilat0000664000175000017500000000171713160023042032762 0ustar bdbaddogbdbaddog htmlhelp.enhanced.decompilation boolean htmlhelp.enhanced.decompilation Allow enhanced decompilation of CHM? Description When non-zero this parameter enables enhanced decompilation of CHM. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.charmap.uri.xml0000664000175000017500000000321613160023042031037 0ustar bdbaddogbdbaddog man.charmap.uri uri man.charmap.uri URI for custom roff character map Description For converting certain Unicode symbols and special characters in UTF-8 or UTF-16 encoded XML source to appropriate groff/roff equivalents in man-page output, the DocBook XSL Stylesheets distribution includes an XSLT character map. That character map can be considered the standard roff character map for the distribution. If the value of the man.charmap.uri parameter is non-empty, that value is used as the URI for the location for an alternate roff character map to use in place of the standard roff character map provided in the distribution. Do not set a value for man.charmap.uri unless you have a custom roff character map that differs from the standard one provided in the distribution. ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.head.legalnotice.link.multiple.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.head.legalnotice.link.m0000664000175000017500000000340613160023042032576 0ustar bdbaddogbdbaddog html.head.legalnotice.link.multiple boolean html.head.legalnotice.link.multiple Generate multiple link instances in html head for legalnotice? Description If html.head.legalnotice.link.multiple is non-zero and the value of html.head.legalnotice.link.types contains multiple link types, then the stylesheet generates (in the head section of the HTML source) one link element for each link type specified. For example, if the value of html.head.legalnotice.link.types is “copyright licenseâ€: <link rel="copyright" href="ln-id2524073.html" title="Legal Notice"> <link rel="license" href="ln-id2524073.html" title="Legal Notice"> Otherwise, the stylesheet generates generates a single link instance; for example: <link rel="copyright license" href="ln-id2524073.html" title="Legal Notice"> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/foil.title.master.xml0000664000175000017500000000200313160023042031410 0ustar bdbaddogbdbaddog foil.title.master number foil.title.master Specifies unitless font size to use for foil titles 36 Description Specifies a unitless font size to use for foil titles; used in combination with the foil.title.size parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ulink.hyphenate.chars.xml0000664000175000017500000000247213160023043032265 0ustar bdbaddogbdbaddog ulink.hyphenate.chars string ulink.hyphenate.chars List of characters to allow ulink URLs to be automatically hyphenated on / Description If the ulink.hyphenate is not empty, then hyphenation of ulinks is turned on, and any character contained in this parameter is treated as an allowable hyphenation point. The default value is /, but the parameter could be customized to contain other URL characters, as for example: <xsl:param name="ulink.hyphenate.chars">:/@&?.#</xsl:param> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/equation.properties.xml0000664000175000017500000000163413160023042032076 0ustar bdbaddogbdbaddog equation.properties attribute set equation.properties Properties associated with a equation Description The styling for equations. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunk.tocs.and.lots.xml0000664000175000017500000000221613160023042031653 0ustar bdbaddogbdbaddog chunk.tocs.and.lots boolean chunk.tocs.and.lots Should ToC and LoTs be in separate chunks? Description If non-zero, ToC and LoT (List of Examples, List of Figures, etc.) will be put in a separate chunk. At the moment, this chunk is not in the normal forward/backward navigation list. Instead, a new link is added to the navigation footer. This feature is still somewhat experimental. Feedback welcome. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.th.extra2.suppress.xml0000664000175000017500000000322513160023043032331 0ustar bdbaddogbdbaddog man.th.extra2.suppress boolean man.th.extra2.suppress Suppress extra2 part of header/footer? 0 Description If the value of man.th.extra2.suppress is non-zero, then the extra2 part of the .TH title line header/footer is suppressed. The content of the extra2 field is usually displayed in the left footer of the page and is typically "source" data, often in the form Name Version; for example, "GTK+ 1.2" (from the gtk-options(7) man page). You can use the refentry.source.name.suppress and refentry.version.suppress parameters to independently suppress the Name and Version parts of the extra2 field. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/body.bg.color.xml0000664000175000017500000000157313160023042030521 0ustar bdbaddogbdbaddog body.bg.color color body.bg.color Background color for body frame #FFFFFF Description Specifies the background color used in the body column of tabular slides. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/current.docid.xml0000664000175000017500000000332013160023042030613 0ustar bdbaddogbdbaddog current.docid string current.docid targetdoc identifier for the document being processed Description When olinks between documents are resolved for HTML output, the stylesheet can compute the relative path between the current document and the target document. The stylesheet needs to know the targetdoc identifiers for both documents, as they appear in the target.database.document database file. This parameter passes to the stylesheet the targetdoc identifier of the current document, since that identifier does not appear in the document itself. This parameter can also be used for print output. If an olink's targetdoc id differs from the current.docid, then the stylesheet can append the target document's title to the generated olink text. That identifies to the reader that the link is to a different document, not the current document. See also olink.doctitle to enable that feature. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.unicode.number.limit.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.unicode.number.limit0000664000175000017500000000233013160023042032745 0ustar bdbaddogbdbaddog callout.unicode.number.limit integer callout.unicode.number.limit Number of the largest unicode callout character 10 Description If callout.unicode is non-zero, unicode characters are used to represent callout numbers. The value of callout.unicode.number.limit is the largest number for which a unicode character exists. If the callout number exceeds this limit, the default presentation "(nnn)" will always be used. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/menuchoice.menu.separator.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/menuchoice.menu.separator.xm0000664000175000017500000000275513160023043032771 0ustar bdbaddogbdbaddog menuchoice.menu.separator string menuchoice.menu.separator Separator between items of a menuchoice with guimenuitem or guisubmenu → Description Separator used to connect items of a menuchoice with guimenuitem or guisubmenu. Other elements are linked with menuchoice.separator. The default value is &#x2192;, which is the &rarr; (right arrow) character entity. The current FOP (0.20.5) requires setting the font-family explicitly. The default value also includes spaces around the arrow, which will allow a line to break. Replace the spaces with &#xA0; (nonbreaking space) if you don't want those spaces to break. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/multiframe.top.bgcolor.xml0000664000175000017500000000174013160023043032451 0ustar bdbaddogbdbaddog multiframe.top.bgcolor color multiframe.top.bgcolor Background color for top navigation frame white Description Specifies the background color of the top navigation frame when multiframe is enabled. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossary.sort.xml0000664000175000017500000000203513160023042030703 0ustar bdbaddogbdbaddog glossary.sort boolean glossary.sort Sort glossentry elements? Description If non-zero, then the glossentry elements within a glossary, glossdiv, or glosslist are sorted on the glossterm, using the current lang setting. If zero (the default), then glossentry elements are not sorted and are presented in document order. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/variablelist.term.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/variablelist.term.properties0000664000175000017500000000207413160023043033101 0ustar bdbaddogbdbaddog variablelist.term.properties attribute set variablelist.term.properties To add properties to the term elements in a variablelist. Description These properties are added to the block containing a term in a variablelist. Use this attribute-set to set font properties or alignment, for example. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/output.indent.xml0000664000175000017500000000224613160023043030677 0ustar bdbaddogbdbaddog output.indent list no yes output.indent Indent output? no Description Specifies the setting of the indent parameter on the HTML slides. For more information, see the discussion of the xsl:output element in the XSLT specification. Select from yes or no. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/formal.title.properties.xml0000664000175000017500000000274013160023042032650 0ustar bdbaddogbdbaddog formal.title.properties attribute set formal.title.properties Style the title element of formal object such as a figure. bold pt false 0.4em 0.6em 0.8em Description Specify how the title should be styled. Specify the font size and weight of the title of the formal object. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.subheading.divider.xml0000664000175000017500000000300013160023043032354 0ustar bdbaddogbdbaddog man.subheading.divider string man.subheading.divider Specifies string to use as divider comment before/after subheadings ======================================================================== Description If the value of the man.subheading.divider.enabled parameter is non-zero, the contents of the man.subheading.divider parameter are used to add a "divider" before and after subheadings in the roff output. The divider is not visisble in the rendered man page; it is added as a comment, in the source, simply for the purpose of increasing reability of the source. If man.subheading.divider.enabled is zero (the default), the subheading divider is suppressed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/text.up.xml0000664000175000017500000000137613160023043027471 0ustar bdbaddogbdbaddog text.up string text.up FIXME: Up Description FIXME: scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.gap.back.xml0000664000175000017500000000166013160023042031017 0ustar bdbaddogbdbaddog column.gap.back length column.gap.back Gap between columns in back matter 12pt Description Specifies the gap between columns in back matter (if column.count.back is greater than one). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/textinsert.extension.xml0000664000175000017500000000547313160023043032310 0ustar bdbaddogbdbaddog textinsert.extension boolean textinsert.extension Enables the textinsert extension element Description The textinsert extension element inserts the contents of a file into the result tree (as text). To use the textinsert extension element, you must use either Saxon or Xalan as your XSLT processor (it doesn’t work with xsltproc), along with either the DocBook Saxon extensions or DocBook Xalan extensions (for more information about those extensions, see DocBook Saxon Extensions and DocBook Xalan Extensions), and you must set both the use.extensions and textinsert.extension parameters to 1. As an alternative to using the textinsert element, consider using an Xinclude element with the parse="text" attribute and value specified, as detailed in Using XInclude for text inclusions. See Also You can also use the dbhtml-include href processing instruction to insert external files — both files containing plain text and files with markup content (including HTML content). More information For how-to documentation on inserting contents of external code files and other text files into output, see External code files. For guidelines on inserting contents of HTML files into output, see Inserting external HTML code. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/sans.font.family.xml0000664000175000017500000000165213160023043031250 0ustar bdbaddogbdbaddog sans.font.family string sans.font.family The default sans-serif font family sans-serif Description The default sans-serif font family. At the present, this isn't actually used by the stylesheets. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.autolabel.xml0000664000175000017500000000165513160023042031645 0ustar bdbaddogbdbaddog htmlhelp.autolabel boolean htmlhelp.autolabel Should tree-like ToC use autonumbering feature? Description Set this to non-zero to include chapter and section numbers into ToC in the left panel. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.stylesheet.xml0000664000175000017500000000250313160023042031206 0ustar bdbaddogbdbaddog html.stylesheet string html.stylesheet Name of the stylesheet(s) to use in the generated HTML Description The html.stylesheet parameter is either empty, indicating that no stylesheet link tag should be generated in the html output, or it is a list of one or more stylesheet files. Multiple stylesheets are space-delimited. If you need to reference a stylesheet URI that includes a space, encode it with %20. A separate html link element will be generated for each stylesheet in the order they are listed in the parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.font.links.xml0000664000175000017500000000532513160023042030716 0ustar bdbaddogbdbaddog man.font.links string man.font.links Specifies font for links B Description The man.font.links parameter specifies the font for output of links (ulink instances and any instances of any element with an xlink:href attribute). The value of man.font.links must be either B or I, or empty. If the value is empty, no font formatting is applied to links. If you set man.endnotes.are.numbered and/or man.endnotes.list.enabled to zero (disabled), then you should probably also set an empty value for man.font.links. But if man.endnotes.are.numbered is non-zero (enabled), you should probably keep man.font.links set to B or IThe main purpose of applying a font format to links in most output formats it to indicate that the formatted text is “clickableâ€; given that links rendered in man pages are not “real†hyperlinks that users can click on, it might seem like there is never a good reason to have font formatting for link contents in man output. In fact, if you suppress the display of inline link references (by setting man.endnotes.are.numbered to zero), there is no good reason to apply font formatting to links. However, if man.endnotes.are.numbered is non-zero, having font formatting for links (arguably) serves a purpose: It provides “context†information about exactly what part of the text is being “annotated†by the link. Depending on how you mark up your content, that context information may or may not have value.. Related Parameters man.endnotes.list.enabled, man.endnotes.are.numbered scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footer.hr.xml0000664000175000017500000000156113160023042027763 0ustar bdbaddogbdbaddog footer.hr boolean footer.hr Toggle <HR> before footer Description If non-zero, an <HR> is generated at the bottom of each web page, before the footer. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunk.section.depth.xml0000664000175000017500000000160713160023042031734 0ustar bdbaddogbdbaddog chunk.section.depth integer chunk.section.depth Depth to which sections should be chunked Description This parameter sets the depth of section chunking. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.container.element.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.container.element.xm0000664000175000017500000000444113160023043032757 0ustar bdbaddogbdbaddog section.container.element list block wrapper section.container.element Select XSL-FO element name to contain sections block Description Selects the element name for outer container of each section. The choices are block (default) or wrapper. The fo: namespace prefix is added by the stylesheet to form the full element name. This element receives the section id attribute and the appropriate section level attribute-set. Changing this parameter to wrapper is only necessary when producing multi-column output that contains page-wide spans. Using fo:wrapper avoids the nesting of fo:block elements that prevents spans from working (the standard says a span must be on a block that is a direct child of fo:flow). If set to wrapper, the section attribute-sets only support properties that are inheritable. That's because there is no block to apply them to. Properties such as font-family are inheritable, but properties such as border are not. Only some XSL-FO processors need to use this parameter. The Antenna House processor, for example, will handle spans in nested blocks without changing the element name. The RenderX XEP product and FOP follow the XSL-FO standard and need to use wrapper. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.max.depth.xml0000664000175000017500000000155513160023043030535 0ustar bdbaddogbdbaddog toc.max.depth integer toc.max.depth How many levels should be created for each TOC? 8 Description Specifies the maximal depth of TOC on all levels. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/epub.autolabel.xml0000664000175000017500000000163313160023042030757 0ustar bdbaddogbdbaddog epub.autolabel boolean epub.autolabel Should tree-like ToC use autonumbering feature? Description If you want to include chapter and section numbers into ToC in, set this parameter to 1. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.icon.size.xml0000664000175000017500000000163313160023042031420 0ustar bdbaddogbdbaddog callout.icon.size length callout.icon.size Specifies the size of callout marker icons 7pt Description Specifies the size of the callout marker icons. The default size is 7 points. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.entry.padding.xml0000664000175000017500000000145013160023043031707 0ustar bdbaddogbdbaddog table.entry.padding length table.entry.padding 2pt Description FIXME: scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/foil.title.size.xml0000664000175000017500000000212213160023042031071 0ustar bdbaddogbdbaddog foil.title.size length foil.title.size Specifies font size to use for foil titles, including units pt Description This parameter combines the value of the foil.title.master parameter with a unit specification. The default unit is pt (points). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/punct.honorific.xml0000664000175000017500000000165613160023043031173 0ustar bdbaddogbdbaddog punct.honorific string punct.honorific Punctuation after an honorific in a personal name. . Description This parameter specifies the punctuation that should be added after an honorific in a personal name. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/manifest.in.base.dir.xml0000664000175000017500000000204313160023043031753 0ustar bdbaddogbdbaddog manifest.in.base.dir boolean manifest.in.base.dir Should the manifest file be written into base.dir? Description If non-zero, the manifest file as well as project files for HTML Help and Eclipse Help are written into base.dir instead of the current directory. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/monospace.font.family.xml0000664000175000017500000000171713160023043032272 0ustar bdbaddogbdbaddog monospace.font.family string monospace.font.family The default font family for monospace environments monospace Description The monospace font family is used for verbatim environments (program listings, screens, etc.). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.margin.properties.xml0000664000175000017500000000262313160023043032312 0ustar bdbaddogbdbaddog toc.margin.properties attribute set toc.margin.properties Margin properties used on Tables of Contents 0.5em 1em 2em 0.5em 1em 2em Description This attribute set is used on Tables of Contents. These attributes are set on the wrapper that surrounds the ToC block, not on each individual lines. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/label.from.part.xml0000664000175000017500000000264613160023042031050 0ustar bdbaddogbdbaddog label.from.part boolean label.from.part Renumber components in each part? Description If label.from.part is non-zero, then numbering of components — preface, chapter, appendix, and reference (when reference occurs at the component level) — is re-started within each part. If label.from.part is zero (the default), numbering of components is not re-started within each part; instead, components are numbered sequentially throughout each book, regardless of whether or not they occur within part instances. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ulink.show.xml0000664000175000017500000000245313160023043030160 0ustar bdbaddogbdbaddog ulink.show boolean ulink.show Display URLs after ulinks? Description If non-zero, the URL of each ulink will appear after the text of the link. If the text of the link and the URL are identical, the URL is suppressed. See also ulink.footnotes. DocBook 5 does not have an ulink element. When processing DocBoook 5 documents, ulink.show applies to all inline elements that are marked up with xlink:href attributes that point to external resources. ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/saxon.character.representation.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/saxon.character.representati0000664000175000017500000000310613160023043033043 0ustar bdbaddogbdbaddog saxon.character.representation string saxon.character.representation Saxon character representation used in generated HTML pages Description This parameter has effect only when Saxon 6 is used (version 6.4.2 or later). It sets the character representation in files generated by the chunking stylesheets. If you want to suppress entity references for characters with direct representations in chunker.output.encoding, set the parameter value to native. For more information, see Saxon output character representation. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/fop.extensions.xml0000664000175000017500000000233613160023042031040 0ustar bdbaddogbdbaddog fop.extensions boolean fop.extensions Enable extensions for FOP version 0.20.5 and earlier Description If non-zero, extensions intended for FOP version 0.20.5 and earlier will be used. At present, this consists of PDF bookmarks. This parameter can also affect which graphics file formats are supported. If you are using a version of FOP beyond version 0.20.5, then use the fop1.extensions parameter instead. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.nested.in.toc.xml0000664000175000017500000000173113160023043031613 0ustar bdbaddogbdbaddog qanda.nested.in.toc boolean qanda.nested.in.toc Should nested answer/qandaentry instances appear in TOC? Description If non-zero, instances of qandaentry that are children of answer elements are shown in the TOC. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xref.properties.xml0000664000175000017500000000164313160023043031216 0ustar bdbaddogbdbaddog xref.properties attribute set xref.properties Properties associated with cross-reference text Description This attribute set is used to set properties on cross reference text. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xref.with.number.and.title.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xref.with.number.and.title.x0000664000175000017500000000215213160023043032610 0ustar bdbaddogbdbaddog xref.with.number.and.title boolean xref.with.number.and.title Use number and title in cross references Description A cross reference may include the number (for example, the number of an example or figure) and the title which is a required child of some targets. This parameter inserts both the relevant number as well as the title into the link. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xbDOM.js.xml0000664000175000017500000000160713160023043027443 0ustar bdbaddogbdbaddog xbDOM.js filename xbDOM.js xbDOM JavaScript file xbDOM.js Description Specifies the filename of the xbDOM JavaScript file. It's unlikely that you will ever need to change this parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.properties.xml0000664000175000017500000000237713160023043031346 0ustar bdbaddogbdbaddog table.properties attribute set table.properties Properties associated with the block surrounding a table auto Description Block styling properties for tables. This parameter should really have been called table.block.properties or something like that, but we’re leaving it to avoid backwards-compatibility problems. See also table.table.properties. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.manifest.filename.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.manifest.filename0000664000175000017500000000223613160023042032754 0ustar bdbaddogbdbaddog man.output.manifest.filename string man.output.manifest.filename Name of manifest file MAN.MANIFEST Description The man.output.manifest.filename parameter specifies the name of the file to which the manpages manifest file is written (if the value of the man.output.manifest.enabled parameter is non-zero). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/header.table.properties.xml0000664000175000017500000000205613160023042032566 0ustar bdbaddogbdbaddog header.table.properties attribute set header.table.properties Apply properties to the header layout table fixed 100% Description Properties applied to the table that lays out the page header. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossentry.show.acronym.xml0000664000175000017500000000256313160023042032717 0ustar bdbaddogbdbaddog glossentry.show.acronym list no yes primary glossentry.show.acronym Display glossentry acronyms? no Description A setting of yes means they should be displayed; no means they shouldn't. If primary is used, then they are shown as the primary text for the entry. This setting controls both acronym and abbrev elements in the glossentry. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/informalexample.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/informalexample.properties.x0000664000175000017500000000172013160023042033077 0ustar bdbaddogbdbaddog informalexample.properties attribute set informalexample.properties Properties associated with an informalexample Description The styling for informalexamples. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.endnotes.list.heading.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.endnotes.list.heading.xm0000664000175000017500000000267613160023042032652 0ustar bdbaddogbdbaddog man.endnotes.list.heading string man.endnotes.list.heading Specifies an alternate name for endnotes list Description If the value of the man.endnotes.are.numbered parameter and/or the man.endnotes.list.enabled parameter is non-zero (the defaults for both are non-zero), a numbered list of endnotes is generated near the end of each man page. The default heading for the list of endnotes is the equivalent of the English word NOTES in the current locale. To cause an alternate heading to be displayed, set a non-empty value for the man.endnotes.list.heading parameter — for example, REFERENCES. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/region.before.extent.xml0000664000175000017500000000164513160023043032113 0ustar bdbaddogbdbaddog region.before.extent length region.before.extent Specifies the height of the header 0.4in Description The region before extent is the height of the area where headers are printed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xbCollapsibleLists.js.xml0000664000175000017500000000175713160023043032302 0ustar bdbaddogbdbaddog xbCollapsibleLists.js filename xbCollapsibleLists.js xbCollapsibleLists JavaScript file xbCollapsibleLists.js Description Specifies the filename of the xbCollapsibleLists JavaScript file. It's unlikely that you will ever need to change this parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footnote.font.size.xml0000664000175000017500000000167113160023042031632 0ustar bdbaddogbdbaddog footnote.font.size length footnote.font.size The font size for footnotes pt Description The footnote font size is used for...footnotes! scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/nominal.image.depth.xml0000664000175000017500000000160013160023043031671 0ustar bdbaddogbdbaddog nominal.image.depth length nominal.image.depth Nominal image depth Description See nominal.image.width. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/css.decoration.xml0000664000175000017500000000214713160023042030774 0ustar bdbaddogbdbaddog css.decoration boolean css.decoration Enable CSS decoration of elements Description If non-zero, then html elements produced by the stylesheet may be decorated with style attributes. For example, the li tags produced for list items may include a fragment of CSS in the style attribute which sets the CSS property "list-style-type". ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level4.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level4.properties.xm0000664000175000017500000000277113160023043032737 0ustar bdbaddogbdbaddog section.level4.properties attribute set section.level4.properties Properties for level-4 sections Description The properties that apply to the containing block of a level-4 section, and therefore apply to the whole section. This includes sect4 elements and section elements at level 4. For example, you could start each level-4 section on a new page by using: <xsl:attribute-set name="section.level4.properties"> <xsl:attribute name="break-before">page</xsl:attribute> </xsl:attribute-set> This attribute set inherits attributes from the general section.properties attribute set. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/funcsynopsis.style.xml0000664000175000017500000000225213160023042031755 0ustar bdbaddogbdbaddog funcsynopsis.style list ansi kr funcsynopsis.style What style of funcsynopsis should be generated? kr Description If funcsynopsis.style is ansi, ANSI-style function synopses are generated for a funcsynopsis, otherwise K&R-style function synopses are generated. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/eclipse.plugin.provider.xml0000664000175000017500000000162213160023042032625 0ustar bdbaddogbdbaddog eclipse.plugin.provider string eclipse.plugin.provider Eclipse Help plugin provider name Example provider Description Eclipse Help plugin provider name. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/draft.mode.xml0000664000175000017500000000260213160023042030075 0ustar bdbaddogbdbaddog draft.mode list no yes maybe draft.mode Select draft mode no Description Selects draft mode. If draft.mode is yes, the entire document will be treated as a draft. If it is no, the entire document will be treated as a final copy. If it is maybe, individual sections will be treated as draft or final independently, depending on how their status attribute is set. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.only.xml0000664000175000017500000000202513160023042030646 0ustar bdbaddogbdbaddog htmlhelp.only boolean htmlhelp.only Should only project files be generated? Description Set to non-zero if you want to play with various HTML Help parameters and you don't need to regenerate all HTML files. This setting will not process whole document, only project files (hhp, hhc, hhk,...) will be generated. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chapter.autolabel.xml0000664000175000017500000000454713160023042031461 0ustar bdbaddogbdbaddog chapter.autolabel list 0none 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... chapter.autolabel Specifies the labeling format for Chapter titles Description If non-zero, then chapters will be numbered using the parameter value as the number format if the value matches one of the following: 1 or arabic Arabic numeration (1, 2, 3 ...). A or upperalpha Uppercase letter numeration (A, B, C ...). a or loweralpha Lowercase letter numeration (a, b, c ...). I or upperroman Uppercase roman numeration (I, II, III ...). i or lowerroman Lowercase roman letter numeration (i, ii, iii ...). Any nonzero value other than the above will generate the default number format (arabic). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.method.xml0000664000175000017500000001320413160023042030440 0ustar bdbaddogbdbaddog index.method list basic kosek kimber index.method Select method used to group index entries in an index basic Description This parameter lets you select which method to use for sorting and grouping index entries in an index. Indexes in Latin-based languages that have accented characters typically sort together accented words and unaccented words. Thus à (U+00C1 LATIN CAPITAL LETTER A WITH ACUTE) would sort together with A (U+0041 LATIN CAPITAL LETTER A), so both would appear in the A section of the index. Languages using other alphabets (such as Russian, which is written in the Cyrillic alphabet) and languages using ideographic chararacters (such as Japanese) require grouping specific to the languages and alphabets. The default indexing method is limited. It can group accented characters in Latin-based languages only. It cannot handle non-Latin alphabets or ideographic languages. The other indexing methods require extensions of one type or another, and do not work with all XSLT processors, which is why they are not used by default. The three choices for indexing method are: basic (default) Sort and groups words based only on the Latin alphabet. Words with accented Latin letters will group and sort with their respective primary letter, but words in non-Latin alphabets will be put in the Symbols section of the index. kosek This method sorts and groups words based on letter groups configured in the DocBook locale file for the given language. See, for example, the French locale file common/fr.xml. This method requires that the XSLT processor supports the EXSLT extensions (most do). It also requires support for using user-defined functions in xsl:key (xsltproc does not). This method is suitable for any language for which you can list all the individual characters that should appear in each letter group in an index. It is probably not practical to use it for ideographic languages such as Chinese that have hundreds or thousands of characters. To use the kosek method, you must: Use a processor that supports its extensions, such as Saxon 6 or Xalan (xsltproc and Saxon 8 do not). Set the index.method parameter's value to kosek. Import the appropriate index extensions stylesheet module fo/autoidx-kosek.xsl or html/autoidx-kosek.xsl into your customization. kimber This method uses extensions to the Saxon processor to implement sophisticated indexing processes. It uses its own configuration file, which can include information for any number of languages. Each language's configuration can group words using one of two processes. In the enumerated process similar to that used in the kosek method, you indicate the groupings character-by-character. In the between-key process, you specify the break-points in the sort order that should start a new group. The latter configuration is useful for ideographic languages such as Chinese, Japanese, and Korean. You can also define your own collation algorithms and how you want mixed Latin-alphabet words sorted. For a whitepaper describing the extensions, see: http://www.innodata-isogen.com/knowledge_center/white_papers/back_of_book_for_xsl_fo.pdf. To download the extension library, see http://www.innodata-isogen.com/knowledge_center/tools_downloads/i18nsupport. To use the kimber method, you must: Use Saxon (version 6 or 8) as your XSLT processor. Install and configure the Innodata Isogen library, using the documentation that comes with it. Set the index.method parameter's value to kimber. Import the appropriate index extensions stylesheet module fo/autoidx-kimber.xsl or html/autoidx-kimber.xsl into your customization. ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/runinhead.default.title.end.punct.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/runinhead.default.title.end.0000664000175000017500000000207113160023043032617 0ustar bdbaddogbdbaddog runinhead.default.title.end.punct string runinhead.default.title.end.punct Default punctuation character on a run-in-head . Description If non-zero, For a formalpara, use the specified string as the separator between the title and following text. The period is the default value. ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.cdata-section-elements.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.cdata-section0000664000175000017500000000237113160023042032771 0ustar bdbaddogbdbaddog chunker.output.cdata-section-elements string chunker.output.cdata-section-elements List of elements to escape with CDATA sections Description This parameter specifies the list of elements that should be escaped as CDATA sections by the chunking stylesheet. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.unicode.start.character.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.unicode.start.charac0000664000175000017500000000241213160023042032716 0ustar bdbaddogbdbaddog callout.unicode.start.character integer callout.unicode.start.character First Unicode character to use, decimal value. 10102 Description If callout.graphics is zero and callout.unicode is non-zero, unicode characters are used to represent callout numbers. The value of callout.unicode.start.character is the decimal unicode value used for callout number one. Currently, only 10102 is supported in the stylesheets for this parameter. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/informalfigure.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/informalfigure.properties.xm0000664000175000017500000000171113160023042033102 0ustar bdbaddogbdbaddog informalfigure.properties attribute set informalfigure.properties Properties associated with an informalfigure Description The styling for informalfigures. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/home.image.xml0000664000175000017500000000152013160023042030061 0ustar bdbaddogbdbaddog home.image filename home.image Home image active/nav-home.png Description Specifies the filename of the home navigation icon. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/linenumbering.everyNth.xml0000664000175000017500000000172313160023042032516 0ustar bdbaddogbdbaddog linenumbering.everyNth integer linenumbering.everyNth Indicate which lines should be numbered 5 Description If line numbering is enabled, everyNth line will be numbered. Note that numbering is one based, not zero based. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/make.year.ranges.xml0000664000175000017500000000217613160023042031212 0ustar bdbaddogbdbaddog make.year.ranges boolean make.year.ranges Collate copyright years into ranges? Description If non-zero, multiple copyright year elements will be collated into ranges. This works only if each year number is put into a separate year element. The copyright element permits multiple year elements. If a year element contains a dash or a comma, then that year element will not be merged into any range. ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.manual.fallback.profile.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.manual.fallback.pro0000664000175000017500000000372313160023043032730 0ustar bdbaddogbdbaddog refentry.manual.fallback.profile string refentry.manual.fallback.profile Specifies profile of "fallback" for refentry "manual" data refmeta/refmiscinfo[not(@class = 'date')][1]/node() Description The value of refentry.manual.fallback.profile is a string representing an XPath expression. It is evaluated at run-time and used only if no "manual" data can be found by other means (that is, either using the refentry metadata-gathering logic "hard coded" in the stylesheets, or the value of refentry.manual.profile, if it is enabled). Depending on which XSLT engine you run, either the EXSLT dyn:evaluate extension function (for xsltproc or Xalan) or saxon:evaluate extension function (for Saxon) are used to dynamically evaluate the value of refentry.manual.fallback.profile at run-time. If you don't use xsltproc, Saxon, Xalan -- or some other XSLT engine that supports dyn:evaluate -- you must manually disable fallback processing by setting an empty value for the refentry.manual.fallback.profile parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.cell.border.style.xml0000664000175000017500000000337213160023043032500 0ustar bdbaddogbdbaddog table.cell.border.style list none solid dotted dashed double groove ridge inset outset solid table.cell.border.style Specifies the border style of table cells solid Description Specifies the border style of table cells. To control properties of cell borders in HTML output, you must also turn on the table.borders.with.css parameter. ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhc.folders.instead.books.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhc.folders.instead0000664000175000017500000000216313160023042032716 0ustar bdbaddogbdbaddog htmlhelp.hhc.folders.instead.books boolean htmlhelp.hhc.folders.instead.books Use folder icons in ToC (instead of book icons)? Description Set to non-zero for folder-like icons or zero for book-like icons in the ToC. If you want to use folder-like icons, you must switch off the binary ToC using htmlhelp.hhc.binary. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/header.rule.xml0000664000175000017500000000152013160023042030246 0ustar bdbaddogbdbaddog header.rule boolean header.rule Rule under headers? Description If non-zero, a rule will be drawn below the page headers. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossdef.list.properties.xml0000664000175000017500000000215113160023042033024 0ustar bdbaddogbdbaddog glossdef.list.properties attribute set glossdef.list.properties To add properties to the glossary definition in a list. Description These properties are added to the block containing a glossary definition in a glossary when the glossary.as.blocks parameter is zero. Use this attribute-set to set font properties, for example. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.spacer.image.xml0000664000175000017500000000212013160023043031472 0ustar bdbaddogbdbaddog table.spacer.image filename table.spacer.image Invisible pixel for tabular accessibility graphics/spacer.gif Description This is the 1x1 pixel, transparent pixel used for the table trick to increase the accessibility of the tabular website presentation. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/output-root.xml0000664000175000017500000000204013160023043030370 0ustar bdbaddogbdbaddog output-root filename output-root Specifies the root directory of the website . Description When using the XSLT processor to manage dependencies and construct the website, this parameter can be used to indicate the root directory where the resulting pages are placed. Only applies when XSLT-based chunking is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/bibliography.collection.xml0000664000175000017500000001003413160023042032655 0ustar bdbaddogbdbaddog bibliography.collection string bibliography.collection Name of the bibliography collection file http://docbook.sourceforge.net/release/bibliography/bibliography.xml Description Maintaining bibliography entries across a set of documents is tedious, time consuming, and error prone. It makes much more sense, usually, to store all of the bibliography entries in a single place and simply extract the ones you need in each document. That's the purpose of the bibliography.collection parameter. To setup a global bibliography database, follow these steps: First, create a stand-alone bibliography document that contains all of the documents that you wish to reference. Make sure that each bibliography entry (whether you use biblioentry or bibliomixed) has an ID. My global bibliography, ~/bibliography.xml begins like this: <!DOCTYPE bibliography PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> <bibliography><title>References</title> <bibliomixed id="xml-rec"><abbrev>XML 1.0</abbrev>Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, and Eve Maler, editors. <citetitle><ulink url="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 Second Edition</ulink></citetitle>. World Wide Web Consortium, 2000. </bibliomixed> <bibliomixed id="xml-names"><abbrev>Namespaces</abbrev>Tim Bray, Dave Hollander, and Andrew Layman, editors. <citetitle><ulink url="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML</ulink></citetitle>. World Wide Web Consortium, 1999. </bibliomixed> <!-- ... --> </bibliography> When you create a bibliography in your document, simply provide empty bibliomixed entries for each document that you wish to cite. Make sure that these elements have the same ID as the corresponding real entry in your global bibliography. For example: <bibliography><title>Bibliography</title> <bibliomixed id="xml-rec"/> <bibliomixed id="xml-names"/> <bibliomixed id="DKnuth86">Donald E. Knuth. <citetitle>Computers and Typesetting: Volume B, TeX: The Program</citetitle>. Addison-Wesley, 1986. ISBN 0-201-13437-3. </bibliomixed> <bibliomixed id="relaxng"/> </bibliography> Note that it's perfectly acceptable to mix entries from your global bibliography with normal entries. You can use xref or other elements to cross-reference your bibliography entries in exactly the same way you do now. Finally, when you are ready to format your document, simply set the bibliography.collection parameter (in either a customization layer or directly through your processor's interface) to point to your global bibliography. The stylesheets will format the bibliography in your document as if all of the entries referenced appeared there literally. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/shade.verbatim.style.xml0000664000175000017500000000272413160023043032113 0ustar bdbaddogbdbaddog shade.verbatim.style attribute set shade.verbatim.style Properties that specify the style of shaded verbatim listings 0 #E0E0E0 #E0E0E0 Description Properties that specify the style of shaded verbatim listings. The parameters specified (the border and background color) are added to the styling of the xsl-fo output. A border might be specified as "thin black solid" for example. See xsl-fo scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/make.valid.html.xml0000664000175000017500000000247213160023042031035 0ustar bdbaddogbdbaddog make.valid.html boolean make.valid.html Attempt to make sure the HTML output is valid HTML Description If make.valid.html is true, the stylesheets take extra effort to ensure that the resulting HTML is valid. This may mean that some para tags are translated into HTML divs or that other substitutions occur. This parameter is different from html.cleanup because it changes the resulting markup; it does not use extension functions to manipulate result-tree-fragments and is therefore applicable to any XSLT processor. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.jump1.title.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.jump1.title.0000664000175000017500000000160313160023042032633 0ustar bdbaddogbdbaddog htmlhelp.button.jump1.title string htmlhelp.button.jump1.title Title of Jump1 button User1 Description Title of Jump1 button. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ua.js.xml0000664000175000017500000000155713160023043027103 0ustar bdbaddogbdbaddog ua.js filename ua.js UA JavaScript file ua.js Description Specifies the filename of the UA JavaScript file. It's unlikely that you will ever need to change this parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.th.extra1.suppress.xml0000664000175000017500000000226313160023043032331 0ustar bdbaddogbdbaddog man.th.extra1.suppress boolean man.th.extra1.suppress Suppress extra1 part of header/footer? 0 Description If the value of man.th.extra1.suppress is non-zero, then the extra1 part of the .TH title line header/footer is suppressed. The content of the extra1 field is almost always displayed in the center footer of the page and is, universally, a date. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/annotation.graphic.open.xml0000664000175000017500000000212313160023042032576 0ustar bdbaddogbdbaddog annotation.graphic.open uri annotation.graphic.open Image for identifying a link that opens an annotation popup http://docbook.sourceforge.net/release/images/annot-open.png Description This image is used inline to identify the location of annotations. It may be replaced by a user provided graphic. The size should be approximately 10x10 pixels. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/shade.verbatim.xml0000664000175000017500000000205413160023043030750 0ustar bdbaddogbdbaddog shade.verbatim boolean shade.verbatim Should verbatim environments be shaded? Description In the FO stylesheet, if this parameter is non-zero then the shade.verbatim.style properties will be applied to verbatim environments. In the HTML stylesheet, this parameter is now deprecated. Use CSS instead. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/graphical.admonition.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/graphical.admonition.propert0000664000175000017500000000357213160023042033046 0ustar bdbaddogbdbaddog graphical.admonition.properties attribute set graphical.admonition.properties To add properties to the outer block of a graphical admonition. 1em 0.8em 1.2em 1em 0.8em 1.2em Description These properties are added to the outer block containing the entire graphical admonition, including its title. It is used when the parameter admon.graphics is set to nonzero. Use this attribute-set to set the space above and below, and any indent for the whole admonition. In addition to these properties, a graphical admonition also applies the admonition.title.properties attribute-set to the title, and applies the admonition.properties attribute-set to the rest of the content. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/formal.procedures.xml0000664000175000017500000000157713160023042031516 0ustar bdbaddogbdbaddog formal.procedures boolean formal.procedures Selects formal or informal procedures Description Formal procedures are numbered and always have a title. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.revisionflag.xml0000664000175000017500000000256713160023043032214 0ustar bdbaddogbdbaddog profile.revisionflag string profile.revisionflag Target profile for revisionflag attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/currentpage.marker.xml0000664000175000017500000000160613160023042031654 0ustar bdbaddogbdbaddog currentpage.marker string currentpage.marker The text symbol used to mark the current page @ Description Character to use as identifying the current page in scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/inherit.keywords.xml0000664000175000017500000000211313160023042031357 0ustar bdbaddogbdbaddog inherit.keywords boolean inherit.keywords Inherit keywords from ancestor elements? Description If inherit.keywords is non-zero, the keyword meta for each HTML head element will include all of the keywords from ancestor elements. Otherwise, only the keywords from the current section will be used. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.endnotes.are.numbered.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.endnotes.are.numbered.xm0000664000175000017500000001143213160023042032636 0ustar bdbaddogbdbaddog man.endnotes.are.numbered boolean man.endnotes.are.numbered Number endnotes? 1 Description If the value of man.endnotes.are.numbered is non-zero (the default), then for each non-empty A “non-empty†notesource is one that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/">manpages</ulink> an “empty†notesource is on that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/"/> “notesourceâ€: a number (in square brackets) is displayed inline after the rendered inline contents (if any) of the notesource the contents of the notesource are included in a numbered list of endnotes that is generated at the end of each man page; the number for each endnote corresponds to the inline number for the notesource with which it is associated The default heading for the list of endnotes is NOTES. To output a different heading, set a value for the man.endnotes.section.heading parameter. The endnotes list is also displayed (but without numbers) if the value of man.endnotes.list.enabled is non-zero. If the value of man.endnotes.are.numbered is zero, numbering of endnotess is suppressed; only inline contents (if any) of the notesource are displayed inline. If you are thinking about disabling endnote numbering by setting the value of man.endnotes.are.numbered to zero, before you do so, first take some time to carefully consider the information needs and experiences of your users. The square-bracketed numbers displayed inline after notesources may seem obstrusive and aesthetically unpleasingAs far as notesources that are links, ytou might think it would be better to just display URLs for non-empty links inline, after their content, rather than displaying square-bracketed numbers all over the place. But it's not better. In fact, it's not even practical, because many (most) URLs for links are too long to be displayed inline. They end up overflowing the right margin. You can set a non-zero value for man.break.after.slash parameter to deal with that, but it could be argued that what you end up with is at least as ugly, and definitely more obstrusive, then having short square-bracketed numbers displayed inline., but in a text-only output format, the numbered-notesources/endnotes-listing mechanism is the only practical way to handle this kind of content. Also, users of “text based†browsers such as lynx will already be accustomed to seeing inline numbers for links. And various "man to html" applications, such as the widely used man2html (VH-Man2html) application, can automatically turn URLs into "real" HTML hyperlinks in output. So leaving man.endnotes.are.numbered at its default (non-zero) value ensures that no information is lost in your man-page output. It just gets “rearrangedâ€. The handling of empty links is not affected by this parameter. Empty links are handled simply by displaying their URLs inline. Empty links are never auto-numbered. If you disable endnotes numbering, you should probably also set man.font.links to an empty value (to disable font formatting for links. Related Parameters man.endnotes.list.enabled, man.font.links ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level3.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level3.properties.xm0000664000175000017500000000277113160023043032736 0ustar bdbaddogbdbaddog section.level3.properties attribute set section.level3.properties Properties for level-3 sections Description The properties that apply to the containing block of a level-3 section, and therefore apply to the whole section. This includes sect3 elements and section elements at level 3. For example, you could start each level-3 section on a new page by using: <xsl:attribute-set name="section.level3.properties"> <xsl:attribute name="break-before">page</xsl:attribute> </xsl:attribute-set> This attribute set inherits attributes from the general section.properties attribute set. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.next.xml0000664000175000017500000000161413160023042032160 0ustar bdbaddogbdbaddog htmlhelp.button.next boolean htmlhelp.button.next Should the Next button be shown? Description Set to non-zero to include the Next button on the toolbar. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/insert.xref.page.number.xml0000664000175000017500000000357413160023042032534 0ustar bdbaddogbdbaddog insert.xref.page.number list no yes maybe insert.xref.page.number Turns page numbers in xrefs on and off no Description The value of this parameter determines if cross references (xrefs) in printed output will include page number citations. It has three possible values. no No page number references will be generated. yes Page number references will be generated for all xref elements. The style of page reference may be changed if an xrefstyle attribute is used. maybe Page number references will not be generated for an xref element unless it has an xrefstyle attribute whose value specifies a page reference. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.locate.xml0000664000175000017500000000164213160023042032452 0ustar bdbaddogbdbaddog htmlhelp.button.locate boolean htmlhelp.button.locate Should the Locate button be shown? Description If you want Locate button shown on toolbar, turn this parameter to 1. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.doctype-public.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.doctype-publi0000664000175000017500000000237713160023042033041 0ustar bdbaddogbdbaddog chunker.output.doctype-public string chunker.output.doctype-public Public identifer to use in the document type of generated pages Description This parameter specifies the public identifier that should be used by the chunking stylesheet in the document type declaration of chunked pages. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/foil.subtitle.properties.xml0000664000175000017500000000254213160023042033033 0ustar bdbaddogbdbaddog foil.subtitle.properties attribute set foil.subtitle.properties Specifies properties for all foil subtitles center pt 12pt Description This parameter specifies properties that are applied to all foil subtitles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.th.extra3.suppress.xml0000664000175000017500000000241313160023043032330 0ustar bdbaddogbdbaddog man.th.extra3.suppress boolean man.th.extra3.suppress Suppress extra3 part of header/footer? 0 Description If the value of man.th.extra3.suppress is non-zero, then the extra3 part of the .TH title line header/footer is suppressed. The content of the extra3 field is usually displayed in the middle header of the page and is typically a "manual name"; for example, "GTK+ User's Manual" (from the gtk-options(7) man page). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.status.xml0000664000175000017500000000252313160023043031037 0ustar bdbaddogbdbaddog profile.status string profile.status Target profile for status attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/linenumbering.width.xml0000664000175000017500000000167313160023042032035 0ustar bdbaddogbdbaddog linenumbering.width integer linenumbering.width Indicates the width of line numbers 3 Description If line numbering is enabled, line numbers will appear right justified in a field "width" characters wide. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/body.end.indent.xml0000664000175000017500000000232213160023042031033 0ustar bdbaddogbdbaddog body.end.indent length body.end.indent The end-indent for the body text 0pt Description This end-indent property is added to the fo:flow for certain page sequences. Which page-sequences it is applied to is determined by the template named set.flow.properties. By default, that template adds it to the flow for page-sequences using the body master-reference, as well as appendixes and prefaces. See also body.start.indent. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.pointer.text.xml0000664000175000017500000000201313160023043031276 0ustar bdbaddogbdbaddog toc.pointer.text string toc.pointer.text The text for the "pointer" in the TOC  >  Description If toc.pointer.graphic is zero, this text string will be used to display the "pointer" in the TOC. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/orderedlist.label.width.xml0000664000175000017500000000216513160023043032573 0ustar bdbaddogbdbaddog orderedlist.label.width length orderedlist.label.width The default width of the label (number) in an ordered list. 1.2em Description Specifies the default width of the label (usually a number or sequence of numbers) in an ordered list. You can override the default value on any particular list with the “dbfo†processing instruction using the “label-width†pseudoattribute. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.pointer.image.xml0000664000175000017500000000201413160023043031375 0ustar bdbaddogbdbaddog toc.pointer.image filename toc.pointer.image The image for the "pointer" in the TOC graphics/arrow.gif Description If toc.pointer.graphic is non-zero, this image will be used for the "pointer" in the TOC. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/contrib.inline.enabled.xml0000664000175000017500000000173013160023042032361 0ustar bdbaddogbdbaddog contrib.inline.enabled boolean contrib.inline.enabled Display contrib output inline? 1 Description If non-zero (the default), output of the contrib element is displayed as inline content rather than as block content. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/manual.toc.xml0000664000175000017500000000162513160023043030120 0ustar bdbaddogbdbaddog manual.toc string manual.toc An explicit TOC to be used for the TOC Description The manual.toc identifies an explicit TOC that will be used for building the printed TOC. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/suppress.header.navigation.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/suppress.header.navigation.x0000664000175000017500000000163213160023043032775 0ustar bdbaddogbdbaddog suppress.header.navigation boolean suppress.header.navigation Disable header navigation Description If non-zero, header navigation will be suppressed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.jump2.xml0000664000175000017500000000162313160023042032237 0ustar bdbaddogbdbaddog htmlhelp.button.jump2 boolean htmlhelp.button.jump2 Should the Jump2 button be shown? Description Set to non-zero to include the Jump2 button on the toolbar. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossterm.separation.xml0000664000175000017500000000206613160023042032241 0ustar bdbaddogbdbaddog glossterm.separation length glossterm.separation Separation between glossary terms and descriptions in list mode 0.25in Description Specifies the miminum horizontal separation between glossary terms and descriptions when they are presented side-by-side using lists when the glossary.as.blocks is zero. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.indent.refsect.xml0000664000175000017500000000521613160023042031543 0ustar bdbaddogbdbaddog man.indent.refsect boolean man.indent.refsect Adjust indentation of refsect* and refsection? Description If the value of man.indent.refsect is non-zero, the width of the left margin for refsect1, refsect2 and refsect3 contents and titles (and first-level, second-level, and third-level nested refsectioninstances) is adjusted by the value of the man.indent.width parameter. With man.indent.width set to its default value of 3n, the main results are that: contents of refsect1 are output with a left margin of three characters instead the roff default of seven or eight characters contents of refsect2 are displayed in console output with a left margin of six characters instead the of the roff default of seven characters the contents of refsect3 and nested refsection instances are adjusted accordingly. If instead the value of man.indent.refsect is zero, no margin adjustment is done for refsect* output. If your content is primarly comprised of refsect1 and refsect2 content (or the refsection equivalent) – with few or no refsect3 or lower nested sections , you may be able to “conserve†space in your output by setting man.indent.refsect to a non-zero value. Doing so will “squeeze†the left margin in such as way as to provide an additional four characters of “room†per line in refsect1 output. That extra room may be useful if, for example, you have many verbatim sections with long lines in them. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qandadiv.autolabel.xml0000664000175000017500000000160013160023043031606 0ustar bdbaddogbdbaddog qandadiv.autolabel boolean qandadiv.autolabel Are divisions in QAndASets enumerated? Description If non-zero, unlabeled qandadivs will be enumerated. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossterm.width.xml0000664000175000017500000000164713160023042031217 0ustar bdbaddogbdbaddog glossterm.width length glossterm.width Width of glossterm in list presentation mode 2in Description This parameter specifies the width reserved for glossary terms when a list presentation is used. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/monospace.verbatim.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/monospace.verbatim.propertie0000664000175000017500000000223013160023043033055 0ustar bdbaddogbdbaddog monospace.verbatim.properties attribute set monospace.verbatim.properties What font and size do you want for monospaced content? start no-wrap Description Specify the font name and size you want for monospaced output scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.hideshow.xml0000664000175000017500000000165313160023042033017 0ustar bdbaddogbdbaddog htmlhelp.button.hideshow boolean htmlhelp.button.hideshow Should the Hide/Show button be shown? Description Set to non-zero to include the Hide/Show button shown on toolbar scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.vendor.xml0000664000175000017500000000252313160023043031011 0ustar bdbaddogbdbaddog profile.vendor string profile.vendor Target profile for vendor attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.indent.lists.xml0000664000175000017500000000243113160023042031242 0ustar bdbaddogbdbaddog man.indent.lists boolean man.indent.lists Adjust indentation of lists? Description If the value of man.indent.lists is non-zero, the width of the left margin for list items in itemizedlist, orderedlist, variablelist output (and output of some other lists) is set to the value of the man.indent.width parameter (4n by default). If instead the value of man.indent.lists is zero, the built-in roff default width (7.2n) is used. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.jump2.title.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.jump2.title.0000664000175000017500000000160313160023042032634 0ustar bdbaddogbdbaddog htmlhelp.button.jump2.title string htmlhelp.button.jump2.title Title of Jump2 button User2 Description Title of Jump2 button. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/marker.section.level.xml0000664000175000017500000000345713160023043032116 0ustar bdbaddogbdbaddog marker.section.level integer marker.section.level Control depth of sections shown in running headers or footers 2 Description The marker.section.level parameter controls the depth of section levels that may be displayed in running headers and footers. For example, if the value is 2 (the default), then titles from sect1 and sect2 or equivalent section elements are candidates for use in running headers and footers. Each candidate title is marked in the FO output with a <fo:marker marker-class-name="section.head.marker"> element. In order for such titles to appear in headers or footers, the header.content or footer.content template must be customized to retrieve the marker using an output element such as: <fo:retrieve-marker retrieve-class-name="section.head.marker" retrieve-position="first-including-carryover" retrieve-boundary="page-sequence"/> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/up.image.xml0000664000175000017500000000152413160023043027562 0ustar bdbaddogbdbaddog up.image filename up.image Up-arrow image active/nav-up.png Description Specifies the filename of the upward-pointing navigation arrow. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/linenumbering.separator.xml0000664000175000017500000000211613160023042032707 0ustar bdbaddogbdbaddog linenumbering.separator string linenumbering.separator Specify a separator between line numbers and lines Description The separator is inserted between line numbers and lines in the verbatim environment. The default value is a single white space. Note the interaction with linenumbering.width ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/blurb.on.titlepage.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/blurb.on.titlepage.enabled.x0000664000175000017500000000224613160023042032614 0ustar bdbaddogbdbaddog blurb.on.titlepage.enabled boolean blurb.on.titlepage.enabled Display personblurb and authorblurb on title pages? Description If non-zero, output from authorblurb and personblurb elements is displayed on title pages. If zero (the default), output from those elements is suppressed on title pages (unless you are using a titlepage customization that causes them to be included). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/formal.title.placement.xml0000664000175000017500000000236113160023042032423 0ustar bdbaddogbdbaddog formal.title.placement table formal.title.placement Specifies where formal object titles should occur figure before example before equation before table before procedure before task before Description Specifies where formal object titles should occur. For each formal object type (figure, example, equation, table, and procedure) you can specify either the keyword before or after. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.endnotes.list.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.endnotes.list.enabled.xm0000664000175000017500000001205013160023042032630 0ustar bdbaddogbdbaddog man.endnotes.list.enabled boolean man.endnotes.list.enabled Display endnotes list at end of man page? 1 Description If the value of man.endnotes.list.enabled is non-zero (the default), then an endnotes list is added to the end of the output man page. If the value of man.endnotes.list.enabled is zero, the list is suppressed — unless link numbering is enabled (that is, if man.endnotes.are.numbered is non-zero), in which case, that setting overrides the man.endnotes.list.enabled setting, and the endnotes list is still displayed. The reason is that inline numbering of notesources associated with endnotes only makes sense if a (numbered) list of endnotes is also generated. Leaving man.endnotes.list.enabled at its default (non-zero) value ensures that no “out of line†information (such as the URLs for hyperlinks and images) gets lost in your man-page output. It just gets “rearrangedâ€. So if you’re thinking about disabling endnotes listing by setting the value of man.endnotes.list.enabled to zero: Before you do so, first take some time to carefully consider the information needs and experiences of your users. The “out of line†information has value even if the presentation of it in text output is not as interactive as it may be in other output formats. As far as the specific case of URLs: Even though the URLs displayed in text output may not be “real†(clickable) hyperlinks, many X terminals have convenience features for recognizing URLs and can, for example, present users with an options to open a URL in a browser with the user clicks on the URL is a terminal window. And short of those, users with X terminals can always manually cut and paste the URLs into a web browser. Also, note that various “man to html†tools, such as the widely used man2html (VH-Man2html) application, automatically mark up URLs with a@href markup during conversion — resulting in “real†hyperlinks in HTML output from those tools. To “turn off†numbering of endnotes in the endnotes list, set man.endnotes.are.numbered to zero. The endnotes list will still be displayed; it will just be displayed without the numbersIt can still make sense to have the list of endnotes displayed even if you have endnotes numbering turned off. In that case, your endnotes list basically becomes a “list of references†without any association with specific text in your document. This is probably the best option if you find the inline endnotes numbering obtrusive. Your users will still have access to all the “out of line†such as URLs for hyperlinks. The default heading for the endnotes list is NOTES. To change that, set a non-empty value for the man.endnotes.list.heading parameter. In the case of notesources that are links: Along with the URL for each link, the endnotes list includes the contents of the link. The list thus includes only non-empty A “non-empty†link is one that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/">manpages</ulink> an “empty link†is on that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/"/> links. Empty links are never included, and never numbered. They are simply displayed inline, without any numbering. In addition, if there are multiple instances of links in a refentry that have the same URL, the URL is listed only once. The contents listed for that link in the endnotes list are the contents of the first link which has that URL. If you disable endnotes listing, you should probably also set man.links.are.underlined to zero (to disable link underlining). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/reference.autolabel.xml0000664000175000017500000000456713160023043031774 0ustar bdbaddogbdbaddog reference.autolabel list 0none 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... reference.autolabel Specifies the labeling format for Reference titles I Description If non-zero, references will be numbered using the parameter value as the number format if the value matches one of the following: 1 or arabic Arabic numeration (1, 2, 3 ...). A or upperalpha Uppercase letter numeration (A, B, C ...). a or loweralpha Lowercase letter numeration (a, b, c ...). I or upperroman Uppercase roman numeration (I, II, III ...). i or lowerroman Lowercase roman letter numeration (i, ii, iii ...). Any non-zero value other than the above will generate the default number format (upperroman). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunk.sections.xml0000664000175000017500000000170013160023042031006 0ustar bdbaddogbdbaddog chunk.sections boolean chunk.sections Should top-level sections be chunks in their own right? Description If non-zero, chunks will be created for top-level sect1 and section elements in each component. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/normal.para.spacing.xml0000664000175000017500000000215313160023043031711 0ustar bdbaddogbdbaddog normal.para.spacing attribute set normal.para.spacing What space do you want between normal paragraphs 1em 0.8em 1.2em Description Specify the spacing required between normal paragraphs scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/sidebar.title.properties.xml0000664000175000017500000000222213160023043032775 0ustar bdbaddogbdbaddog sidebar.title.properties attribute set sidebar.title.properties Attribute set for sidebar titles bold false start always Description The styling for sidebars titles. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhc.section.depth.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhc.section.depth.x0000664000175000017500000000166513160023042032655 0ustar bdbaddogbdbaddog htmlhelp.hhc.section.depth integer htmlhelp.hhc.section.depth Depth of TOC for sections in a left pane. 5 Description Set the section depth in the left pane of HTML Help viewer. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ebnf.table.border.xml0000664000175000017500000000163313160023042031331 0ustar bdbaddogbdbaddog ebnf.table.border boolean ebnf.table.border Selects border on EBNF tables Description Selects the border on EBNF tables. If non-zero, the tables have borders, otherwise they don't. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.font.funcsynopsisinfo.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.font.funcsynopsisinfo.xm0000664000175000017500000000211213160023042033030 0ustar bdbaddogbdbaddog man.font.funcsynopsisinfo string man.font.funcsynopsisinfo Specifies font for funcsynopsisinfo output B Description The man.font.funcsynopsisinfo parameter specifies the font for funcsynopsisinfo output. It should be a valid roff font name, such as B or I. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/pages.template.xml0000664000175000017500000000256713160023043030776 0ustar bdbaddogbdbaddog pages.template uri pages.template Specify the template Pages document Description The pages.template parameter specifies a Pages (the Apple word processing application) document to use as a template for the generated document. The template document is used to define the (extensive) headers for the generated document, in particular the paragraph and character styles that are used to format the various elements. Any content in the template document is ignored. A template document is used in order to allow maintenance of the paragraph and character styles to be done using Pages itself, rather than these XSL stylesheets. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/abstract.title.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/abstract.title.properties.xm0000664000175000017500000000336213160023042033020 0ustar bdbaddogbdbaddog abstract.title.properties attribute set abstract.title.properties Properties for abstract titles bold always always false center Description The properties for abstract titles. See also abstract.properties. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/speakernote.properties.xml0000664000175000017500000000231413160023043032566 0ustar bdbaddogbdbaddog speakernote.properties attribute set speakernote.properties Specifies properties for all speakernotes Times Roman italic 12pt normal Description This parameter specifies properties that are applied to all speakernotes. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level6.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level6.propertie0000664000175000017500000000221113160023043032660 0ustar bdbaddogbdbaddog qanda.title.level6.properties attribute set qanda.title.level6.properties Properties for level-6 qanda set titles pt Description The properties of level-6 qanda set titles. This property set is actually used for all titles below level 5. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.security.xml0000664000175000017500000000253713160023043031370 0ustar bdbaddogbdbaddog profile.security string profile.security Target profile for security attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/hyphenate.verbatim.characters.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/hyphenate.verbatim.character0000664000175000017500000000222313160023042033002 0ustar bdbaddogbdbaddog hyphenate.verbatim.characters string hyphenate.verbatim.characters List of characters after which a line break can occur in listings Description If you enable hyphenate.verbatim line breaks are allowed only on space characters. If this is not enough for your document, you can specify list of additional characters after which line break is allowed in this parameter. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/variablelist.max.termlength.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/variablelist.max.termlength.0000664000175000017500000000323113160023043032746 0ustar bdbaddogbdbaddog variablelist.max.termlength number variablelist.max.termlength Specifies the longest term in variablelists 24 Description In variablelists, the listitem is indented to leave room for the term elements. That indent may be computed if it is not specified with a termlength attribute on the variablelist element. The computation counts characters in the term elements in the list to find the longest term. However, some terms are very long and would produce extreme indents. This parameter lets you set a maximum character count. Any terms longer than the maximum would line wrap. The default value is 24. The character counts are converted to physical widths by multiplying by 0.50em. There will be some variability in how many actual characters fit in the space since some characters are wider than others. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.stop.xml0000664000175000017500000000162413160023042032170 0ustar bdbaddogbdbaddog htmlhelp.button.stop boolean htmlhelp.button.stop Should the Stop button be shown? Description If you want Stop button shown on toolbar, turn this parameter to 1. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.longdesc.link.xml0000664000175000017500000000241513160023042031551 0ustar bdbaddogbdbaddog html.longdesc.link boolean html.longdesc.link Should a link to the longdesc be included in the HTML? Description If non-zero, links will be created to the HTML files created for the longdesc attribute. It makes no sense to enable this option without also enabling the html.longdesc parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.frame.border.color.xml0000664000175000017500000000176513160023043032635 0ustar bdbaddogbdbaddog table.frame.border.color color table.frame.border.color Specifies the border color of table frames black Description Specifies the border color of table frames. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.role.xml0000664000175000017500000000426113160023043030456 0ustar bdbaddogbdbaddog profile.role string profile.role Target profile for role attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). Note that role is often used for other purposes than profiling. For example it is commonly used to get emphasize in bold font: <emphasis role="bold">very important</emphasis> If you are using role for these purposes do not forget to add values like bold to value of this parameter. If you forgot you will get document with small pieces missing which are very hard to track. For this reason it is not recommended to use role attribute for profiling. You should rather use profiling specific attributes like userlevel, os, arch, condition, etc. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/foilgroup.toc.xml0000664000175000017500000000157113160023042030650 0ustar bdbaddogbdbaddog foilgroup.toc boolean foilgroup.toc Put ToC on foilgroup pages? Description If non-zero, a ToC will be placed on foilgroup pages (after any other content). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.id.attributes.xml0000664000175000017500000000402513160023042032425 0ustar bdbaddogbdbaddog generate.id.attributes boolean generate.id.attributes Generate ID attributes on container elements? Description If non-zero, the HTML stylesheet will generate ID attributes on containers. For example, the markup: <section id="foo"><title>Some Title</title> <para>Some para.</para> </section> might produce: <div class="section" id="foo"> <h2>Some Title</h2> <p>Some para.</p> </div> The alternative is to generate anchors: <div class="section"> <h2><a name="foo"></a>Some Title</h2> <p>Some para.</p> </div> Because the name attribute of the a element and the id attribute of other tags are both of type ID, producing both generates invalid documents. As of version 1.50, you can use this switch to control which type of identifier is generated. For backwards-compatibility, generating a anchors is preferred. Note: at present, this switch is incompletely implemented. Disabling ID attributes will suppress them, but enabling ID attributes will not suppress the anchors. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.graphics.xml0000664000175000017500000000174113160023042031317 0ustar bdbaddogbdbaddog callout.graphics boolean callout.graphics Use graphics for callouts? Description If non-zero, callouts are presented with graphics (e.g., reverse-video circled numbers instead of "(1)", "(2)", etc.). Default graphics are provided in the distribution. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xbStyle.js.xml0000664000175000017500000000162713160023043030126 0ustar bdbaddogbdbaddog xbStyle.js filename xbStyle.js xbStyle JavaScript file xbStyle.js Description Specifies the filename of the xbStyle JavaScript file. It's unlikely that you will ever need to change this parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.blank.graphic.xml0000664000175000017500000000200513160023043031337 0ustar bdbaddogbdbaddog toc.blank.graphic boolean toc.blank.graphic Use graphic for "blanks" in TOC? Description If non-zero, "blanks" in the the TOC will be accomplished with the graphic identified by toc.spacer.image. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.graphics.path.xml0000664000175000017500000000213413160023042032247 0ustar bdbaddogbdbaddog callout.graphics.path string callout.graphics.path Path to callout graphics images/callouts/ Description Sets the path to the directory holding the callout graphics. his location is normally relative to the output html directory. see base.dir. Always terminate the directory with / since the graphic file is appended to this string, hence needs the separator. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/custom.css.source.xml0000664000175000017500000001023713160023042031455 0ustar bdbaddogbdbaddog custom.css.source string custom.css.source Name of a custom CSS input file Description The custom.css.source parameter enables you to add CSS styles to DocBook's HTML output. The parameter specifies the name of a file containing custom CSS styles. The file must be a well-formed XML file that consists of a single style root element that contains CSS styles as its text content. For example: ]]> The filename specified by the parameter should have a .xml filename suffix, although that is not required. The default value of this parameter is blank. If custom.css.source is not blank, then the stylesheet takes the following actions. These actions take place regardless of the value of the make.clean.html parameter. The stylesheet uses the XSLT document() function to open the file specified by the parameter and load it into a variable. The stylesheet forms an output pathname consisting of the value of the base.dir parameter (if it is set) and the value of custom.css.source, with the .xml suffix stripped off. The stylesheet removes the style wrapper element and writes just the CSS text content to the output file. The stylesheet adds a link element to the HTML HEAD element to reference this external CSS stylesheet. For example: <link rel="stylesheet" href="custom.css" type="text/css"> If the make.clean.html parameter is nonzero (the default is zero), and if the docbook.css.source parameter is not blank (the default is not blank), then the stylesheet will also generate a default CSS file and add a link tag to reference it. The link to the custom CSS comes after the link to the default, so it should cascade properly in most browsers. If you do not want two link tags, and instead want your custom CSS to import the default generated CSS file, then do the following: Add a line like the following to your custom CSS source file: @import url("docbook.css") Set the docbook.css.link parameter to zero. This will omit the link tag that references the default CSS file. If you set make.clean.html to nonzero but you do not want the default CSS generated, then also set the docbook.css.source parameter to blank. Then no default CSS will be generated, and so all CSS styles must come from your custom CSS file. You can use the generate.css.header parameter to instead write the CSS to each HTML HEAD element in a style tag instead of an external CSS file. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xep.extensions.xml0000664000175000017500000000206513160023043031050 0ustar bdbaddogbdbaddog xep.extensions boolean xep.extensions Enable XEP extensions? Description If non-zero, XEP extensions will be used. XEP extensions consists of PDF bookmarks, document information and better index processing. This parameter can also affect which graphics file formats are supported ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/component.label.includes.part.label.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/component.label.includes.par0000664000175000017500000000310713160023042032722 0ustar bdbaddogbdbaddog component.label.includes.part.label boolean component.label.includes.part.label Do component labels include the part label? Description If non-zero, number labels for chapter, appendix, and other component elements are prefixed with the label of the part element that contains them. So you might see Chapter II.3 instead of Chapter 3. Also, the labels for formal elements such as table and figure will include the part label. If there is no part element container, then no prefix is generated. This feature is most useful when the label.from.part parameter is turned on. In that case, there would be more than one chapter 1, and the extra part label prefix will identify each chapter unambiguously. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/sidebar.properties.xml0000664000175000017500000000322013160023043031654 0ustar bdbaddogbdbaddog sidebar.properties attribute set sidebar.properties Attribute set for sidebar properties solid 1pt black #DDDDDD 12pt 12pt 6pt 6pt 0pt 0pt Description The styling for sidebars. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/no.home.image.xml0000664000175000017500000000156313160023043030504 0ustar bdbaddogbdbaddog no.home.image filename no.home.image Inactive home image inactive/nav-home.png Description Specifies the filename of the inactive home navigation icon. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/plus.image.xml0000664000175000017500000000167713160023043030132 0ustar bdbaddogbdbaddog plus.image filename plus.image Plus image toc/closed.png Description Specifies the filename of the plus image; the image used in a dynamic ToC to indicate that a section can be expanded. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/pixels.per.inch.xml0000664000175000017500000000202713160023043031065 0ustar bdbaddogbdbaddog pixels.per.inch integer pixels.per.inch How many pixels are there per inch? 90 Description When lengths are converted to pixels, this value is used to determine the size of a pixel. The default value is taken from the XSL Recommendation. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.separator.xml0000664000175000017500000000165613160023043031522 0ustar bdbaddogbdbaddog profile.separator string profile.separator Separator character for compound profile values ; Description Separator character used for compound profile values. See profile.arch ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.div.title.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.div.title.properties.x0000664000175000017500000000340413160023042032725 0ustar bdbaddogbdbaddog index.div.title.properties attribute set index.div.title.properties Properties associated with the letter headings in an index 0pt 14.4pt bold always 0pt Description This attribute set is used on the letter headings that separate the divisions in an index. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footer.column.widths.xml0000664000175000017500000000565313160023042032156 0ustar bdbaddogbdbaddog footer.column.widths string footer.column.widths Specify relative widths of footer areas 1 1 1 Description Page footers in print output use a three column table to position text at the left, center, and right side of the footer on the page. This parameter lets you specify the relative sizes of the three columns. The default value is "1 1 1". The parameter value must be three numbers, separated by white space. The first number represents the relative width of the inside footer for double-sided output. The second number is the relative width of the center footer. The third number is the relative width of the outside footer for double-sided output. For single-sided output, the first number is the relative width of left footer for left-to-right text direction, or the right footer for right-to-left text direction. The third number is the relative width of right footer for left-to-right text direction, or the left footer for right-to-left text direction. The numbers are used to specify the column widths for the table that makes up the footer area. In the FO output, this looks like: <fo:table-column column-number="1" column-width="proportional-column-width(1)"/> The proportional-column-width() function computes a column width by dividing its argument by the total of the arguments for all the columns, and then multiplying the result by the width of the whole table (assuming all the column specs use the function). Its argument can be any positive integer or floating point number. Zero is an acceptable value, although some FO processors may warn about it, in which case using a very small number might be more satisfactory. For example, the value "1 2 1" means the center footer should have twice the width of the other areas. A value of "0 0 1" means the entire footer area is reserved for the right (or outside) footer text. Note that to keep the center area centered on the page, the left and right values must be the same. A specification like "1 2 3" means the center area is no longer centered on the page since the right area is three times the width of the left area. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/autotoc.label.in.hyperlink.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/autotoc.label.in.hyperlink.x0000664000175000017500000000217613160023042032674 0ustar bdbaddogbdbaddog autotoc.label.in.hyperlink boolean autotoc.label.in.hyperlink Include label in hyperlinked titles in TOC? Description If the value of autotoc.label.in.hyperlink is non-zero, labels are included in hyperlinked titles in the TOC. If it is instead zero, labels are still displayed prior to the hyperlinked titles, but are not hyperlinked along with the titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.audience.xml0000664000175000017500000000253313160023043031272 0ustar bdbaddogbdbaddog profile.audience string profile.audience Target profile for audience attribute Description Value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.manifest.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.manifest.enabled.0000664000175000017500000000212713160023042032643 0ustar bdbaddogbdbaddog man.output.manifest.enabled boolean man.output.manifest.enabled Generate a manifest file? Description If non-zero, a list of filenames for man pages generated by the stylesheet transformation is written to the file named by the man.output.manifest.filename parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.properties.xml0000664000175000017500000000310013160023043033024 0ustar bdbaddogbdbaddog section.title.properties attribute set section.title.properties Properties for section titles bold always 0.8em 1.0em 1.2em start Description The properties common to all section titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.css.header.xml0000664000175000017500000000272113160023042031664 0ustar bdbaddogbdbaddog generate.css.header boolean generate.css.header Insert generated CSS styles in HEAD element Description The stylesheets are capable of generating both default and custom CSS stylesheet files. The parameters make.clean.html, docbook.css.source, and custom.css.source control that feature. If you require that CSS styles reside in the HTML HEAD element instead of external CSS files, then set the generate.css.header parameter to nonzero (it is zero by default). Then instead of generating the CSS in external files, they are wrapped in style elements in the HEAD element of each HTML output file. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/figure.properties.xml0000664000175000017500000000162013160023042031525 0ustar bdbaddogbdbaddog figure.properties attribute set figure.properties Properties associated with a figure Description The styling for figures. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.wordsize.xml0000664000175000017500000000253713160023043031367 0ustar bdbaddogbdbaddog profile.wordsize string profile.wordsize Target profile for wordsize attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.base.xml0000664000175000017500000000201013160023042027720 0ustar bdbaddogbdbaddog html.base uri html.base An HTML base URI Description If html.base is set, it is used for the base element in the head of the html documents. The parameter specifies the base URL for all relative URLs in the document. This is useful for dynamically served html where the base URI needs to be shifted. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.string.subst.map.local.post.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.string.subst.map.local.p0000664000175000017500000000252113160023043032576 0ustar bdbaddogbdbaddog man.string.subst.map.local.post string man.string.subst.map.local.post Specifies “local†string substitutions Description Use the man.string.subst.map.local.post parameter to specify any “local†string substitutions to perform over the entire roff source for each man page after performing the string substitutions specified by the man.string.subst.map parameter. For details about the format of this parameter, see the documentation for the man.string.subst.map parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/use.local.olink.style.xml0000664000175000017500000000331413160023043032213 0ustar bdbaddogbdbaddog use.local.olink.style boolean use.local.olink.style Process olinks using xref style of current document Description When cross reference data is collected for use by olinks, the data for each potential target includes one field containing a completely assembled cross reference string, as if it were an xref generated in that document. Other fields record the separate title, number, and element name of each target. When an olink is formed to a target from another document, the olink resolves to that preassembled string by default. If the use.local.olink.style parameter is set to non-zero, then instead the cross reference string is formed again from the target title, number, and element name, using the stylesheet processing the targeting document. Then olinks will match the xref style in the targeting document rather than in the target document. If both documents are processed with the same stylesheet, then the results will be the same. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/margin.note.title.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/margin.note.title.properties0000664000175000017500000000225513160023043033014 0ustar bdbaddogbdbaddog margin.note.title.properties attribute set margin.note.title.properties Attribute set for margin note titles bold false start always Description The styling for margin note titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/firstterm.only.link.xml0000664000175000017500000000177513160023042032017 0ustar bdbaddogbdbaddog firstterm.only.link boolean firstterm.only.link Does automatic glossterm linking only apply to firstterms? Description If non-zero, only firstterms will be automatically linked to the glossary. If glossary linking is not enabled, this parameter has no effect. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/biblioentry.item.separator.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/biblioentry.item.separator.x0000664000175000017500000000163113160023042033000 0ustar bdbaddogbdbaddog biblioentry.item.separator string biblioentry.item.separator Text to separate bibliography entries . Description Text to separate bibliography entries scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/default.units.xml0000664000175000017500000000270513160023042030643 0ustar bdbaddogbdbaddog default.units list cm mm in pt pc px em default.units Default units for an unqualified dimension pt Description If an unqualified dimension is encountered (for example, in a graphic width), the default.units will be used for the units. Unqualified dimensions are not allowed in XSL Formatting Objects. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunk.tocs.and.lots.has.title.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunk.tocs.and.lots.has.titl0000664000175000017500000000173213160023042032603 0ustar bdbaddogbdbaddog chunk.tocs.and.lots.has.title boolean chunk.tocs.and.lots.has.title Should ToC and LoTs in a separate chunks have title? Description If non-zero title of document is shown before ToC/LoT in separate chunk. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/nav.separator.xml0000664000175000017500000000167013160023043030642 0ustar bdbaddogbdbaddog nav.separator boolean nav.separator Output separator between navigation and body? Description If non-zero, a separator (<HR>) is added between the navigation links and the content of each slide. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level2.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level2.properties.xm0000664000175000017500000000277113160023043032735 0ustar bdbaddogbdbaddog section.level2.properties attribute set section.level2.properties Properties for level-2 sections Description The properties that apply to the containing block of a level-2 section, and therefore apply to the whole section. This includes sect2 elements and section elements at level 2. For example, you could start each level-2 section on a new page by using: <xsl:attribute-set name="section.level2.properties"> <xsl:attribute name="break-before">page</xsl:attribute> </xsl:attribute-set> This attribute set inherits attributes from the general section.properties attribute set. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/css.stylesheet.xml0000664000175000017500000000174613160023042031042 0ustar bdbaddogbdbaddog css.stylesheet uri css.stylesheet CSS stylesheet for slides slides.css Description Identifies the CSS stylesheet used by all the slides. This parameter can be set in the source document with the <?dbhtml?> pseudo-attribute css-stylesheet. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/id.warnings.xml0000664000175000017500000000172113160023042030276 0ustar bdbaddogbdbaddog id.warnings boolean id.warnings Should warnings be generated for titled elements without IDs? Description If non-zero, the stylesheet will issue a warning for any element (other than the root element) which has a title but does not have an ID. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/editedby.enabled.xml0000664000175000017500000000174513160023042031243 0ustar bdbaddogbdbaddog editedby.enabled boolean editedby.enabled Display “Edited by†heading above editor name? 1 Description If non-zero, a localized Edited by heading is displayed above editor names in output of the editor element. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/navig.graphics.xml0000664000175000017500000000210513160023043030754 0ustar bdbaddogbdbaddog navig.graphics boolean navig.graphics Use graphics in navigational headers and footers? Description If non-zero, the navigational headers and footers in chunked HTML are presented in an alternate style that uses graphical icons for Next, Previous, Up, and Home. Default graphics are provided in the distribution. If zero, text is used instead of graphics. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/citerefentry.link.xml0000664000175000017500000000201713160023042031511 0ustar bdbaddogbdbaddog citerefentry.link boolean citerefentry.link Generate URL links when cross-referencing RefEntrys? Description If non-zero, a web link will be generated, presumably to an online man->HTML gateway. The text of the link is generated by the generate.citerefentry.link template. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/graphicsize.extension.xml0000664000175000017500000000216413160023042032400 0ustar bdbaddogbdbaddog graphicsize.extension boolean graphicsize.extension Enable the getWidth()/getDepth() extension functions Description If non-zero (and if use.extensions is non-zero and if you're using a processor that supports extension functions), the getWidth and getDepth functions will be used to extract image sizes from graphics. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ebnf.statement.terminator.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ebnf.statement.terminator.xm0000664000175000017500000000222013160023042032772 0ustar bdbaddogbdbaddog ebnf.statement.terminator rtf ebnf.statement.terminator Punctuation that ends an EBNF statement. Description The ebnf.statement.terminator parameter determines what text is used to terminate each production in productionset. Some notations end each statement with a period. ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.subdirs.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.subdirs.enabled.x0000664000175000017500000000304313160023042032676 0ustar bdbaddogbdbaddog man.output.subdirs.enabled boolean man.output.subdirs.enabled Output man-page files in subdirectories within base output directory? Description The man.output.subdirs.enabled parameter controls whether man-pages files are output in subdirectories within the base directory specified by the directory specified by the man.output.base.dir parameter. The values of the man.output.base.dir and man.output.subdirs.enabled parameters are used only if the value of man.output.in.separate.dir parameter is non-zero. If the value of the man.output.in.separate.dir is zero, man-page files are not output in a separate directory. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/multiframe.bottom.bgcolor.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/multiframe.bottom.bgcolor.xm0000664000175000017500000000176413160023043033005 0ustar bdbaddogbdbaddog multiframe.bottom.bgcolor color multiframe.bottom.bgcolor Background color for bottom navigation frame white Description Specifies the background color of the bottom navigation frame when multiframe is enabled. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/slides.properties.xml0000664000175000017500000000203713160023043031533 0ustar bdbaddogbdbaddog slides.properties attribute set slides.properties Specifies properties for all slides Description This parameter specifies properties that are applied to all slides. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.prefer.titleabbrev.xml0000664000175000017500000000200413160023042032741 0ustar bdbaddogbdbaddog index.prefer.titleabbrev boolean index.prefer.titleabbrev Should abbreviated titles be used as back references? Description If non-zero, and if a titleabbrev is defined, the abbreviated title is used as the link text of a back reference in the index. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/list.item.spacing.xml0000664000175000017500000000213213160023042031403 0ustar bdbaddogbdbaddog list.item.spacing attribute set list.item.spacing What space do you want between list items? 1em 0.8em 1.2em Description Specify what spacing you want between each list item. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.legalnotice.link.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.legalnotice.link.xm0000664000175000017500000000521213160023042032711 0ustar bdbaddogbdbaddog generate.legalnotice.link boolean generate.legalnotice.link Write legalnotice to separate chunk and generate link? Description If the value of generate.legalnotice.link is non-zero, the stylesheet: writes the contents of legalnotice to a separate HTML file inserts a hyperlink to the legalnotice file adds (in the HTML head) either a single link or element or multiple link elements (depending on the value of the html.head.legalnotice.link.multiple parameter), with the value or values derived from the html.head.legalnotice.link.types parameter Otherwise, if generate.legalnotice.link is zero, legalnotice contents are rendered on the title page. The name of the separate HTML file is computed as follows: If a filename is given by the dbhtml filename processing instruction, that filename is used. If the legalnotice has an id/xml:id attribute, and if use.id.as.filename != 0, the filename is the concatenation of the id value and the value of the html.ext parameter. If the legalnotice does not have an id/xml:id attribute, or if use.id.as.filename = 0, the filename is the concatenation of "ln-", auto-generated id value, and html.ext value. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/no.up.image.xml0000664000175000017500000000157013160023043030176 0ustar bdbaddogbdbaddog no.up.image filename no.up.image Inactive up-arrow image inactive/nav-up.png Description Specifies the filename of the inactive upward-pointing navigation arrow. ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.version.profile.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.version.profile.ena0000664000175000017500000000365213160023043033005 0ustar bdbaddogbdbaddog refentry.version.profile.enabled boolean refentry.version.profile.enabled Enable refentry "version" profiling? 0 Description If the value of refentry.version.profile.enabled is non-zero, then during refentry metadata gathering, the info profile specified by the customizable refentry.version.profile parameter is used. If instead the value of refentry.version.profile.enabled is zero (the default), then "hard coded" logic within the DocBook XSL stylesheets is used for gathering refentry "version" data. If you find that the default refentry metadata-gathering behavior is causing incorrect "version" data to show up in your output, then consider setting a non-zero value for refentry.version.profile.enabled and adjusting the value of refentry.version.profile to cause correct data to be gathered. Note that the terms "source" and "version" have special meanings in this context. For details, see the documentation for the refentry.version.profile parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/para.propagates.style.xml0000664000175000017500000000177713160023043032315 0ustar bdbaddogbdbaddog para.propagates.style boolean para.propagates.style Pass para role attribute through to HTML? Description If true, the role attribute of para elements will be passed through to the HTML as a class attribute on the p generated for the paragraph. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level6.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level6.propert0000664000175000017500000000221713160023043032730 0ustar bdbaddogbdbaddog section.title.level6.properties attribute set section.title.level6.properties Properties for level-6 section titles pt Description The properties of level-6 section titles. This property set is actually used for all titles below level 5. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhk.xml0000664000175000017500000000156613160023042030450 0ustar bdbaddogbdbaddog htmlhelp.hhk string htmlhelp.hhk Filename of index file. index.hhk Description set the name of the index file. The default is index.hhk. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunk.separate.lots.xml0000664000175000017500000000221513160023042031745 0ustar bdbaddogbdbaddog chunk.separate.lots boolean chunk.separate.lots Should each LoT be in its own separate chunk? Description If non-zero, each of the ToC and LoTs (List of Examples, List of Figures, etc.) will be put in its own separate chunk. The title page includes generated links to each of the separate files. This feature depends on the chunk.tocs.and.lots parameter also being non-zero. ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.subheading.divider.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.subheading.divider.enabl0000664000175000017500000000273313160023043032651 0ustar bdbaddogbdbaddog man.subheading.divider.enabled boolean man.subheading.divider.enabled Add divider comment to roff source before/after subheadings? 0 Description If the value of the man.subheading.divider.enabled parameter is non-zero, the contents of the man.subheading.divider parameter are used to add a "divider" before and after subheadings in the roff output. The divider is not visisble in the rendered man page; it is added as a comment, in the source, simply for the purpose of increasing reability of the source. If man.subheading.divider.enabled is zero (the default), the subheading divider is suppressed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/list.block.properties.xml0000664000175000017500000000216213160023042032312 0ustar bdbaddogbdbaddog list.block.properties attribute set list.block.properties Properties that apply to each list-block generated by list. 0.2em 1.5em Description Properties that apply to each fo:list-block generated by itemizedlist/orderedlist. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/l10n.gentext.default.language.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/l10n.gentext.default.languag0000664000175000017500000000212513160023042032542 0ustar bdbaddogbdbaddog l10n.gentext.default.language string l10n.gentext.default.language Sets the default language for generated text en Description The value of the l10n.gentext.default.language parameter is used as the language for generated text if no setting is provided in the source document. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/admon.style.xml0000664000175000017500000000207713160023042030315 0ustar bdbaddogbdbaddog admon.style string admon.style Specifies the CSS style attribute that should be added to admonitions. Description Specifies the value of the CSS style attribute that should be added to admonitions. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.charmap.use.subset.xml0000664000175000017500000000702613160023042032343 0ustar bdbaddogbdbaddog man.charmap.use.subset boolean man.charmap.use.subset Use subset of character map instead of full map? Description If the value of the man.charmap.use.subset parameter is non-zero, a subset of the roff character map is used instead of the full roff character map. The profile of the subset used is determined either by the value of the man.charmap.subset.profile parameter (if the source is not in English) or the man.charmap.subset.profile.english parameter (if the source is in English). You may want to experiment with setting a non-zero value of man.charmap.use.subset, so that the full character map is used. Depending on which XSLT engine you run, setting a non-zero value for man.charmap.use.subset may significantly increase the time needed to process your documents. Or it may not. For example, if you set it and run it with xsltproc, it seems to dramatically increase processing time; on the other hand, if you set it and run it with Saxon, it does not seem to increase processing time nearly as much. If processing time is not a important concern and/or you can tolerate the increase in processing time imposed by using the full character map, set man.charmap.use.subset to zero. Details For converting certain Unicode symbols and special characters in UTF-8 or UTF-16 encoded XML source to appropriate groff/roff equivalents in man-page output, the DocBook XSL Stylesheets distribution includes a roff character map that is compliant with the XSLT character map format as detailed in the XSLT 2.0 specification. The map contains more than 800 character mappings and can be considered the standard roff character map for the distribution. You can use the man.charmap.uri parameter to specify a URI for the location for an alternate roff character map to use in place of the standard roff character map provided in the distribution. Because it is not terrifically efficient to use the standard 800-character character map in full -- and for most (or all) users, never necessary to use it in full -- the DocBook XSL Stylesheets support a mechanism for using, within any given character map, a subset of character mappings instead of the full set. You can use the man.charmap.subset.profile or man.charmap.subset.profile.english parameter to tune the profile of that subset to use. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/highlight.xslthl.config.xml0000664000175000017500000000215413160023042032604 0ustar bdbaddogbdbaddog highlight.xslthl.config uri highlight.xslthl.config Location of XSLTHL configuration file Description This location has precedence over the corresponding Java property. Please note that usually you have to specify location as URL not just as a simple path on the local filesystem. E.g. file:///home/user/xslthl/my-xslthl-config.xml. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.xref.manvolnum.xml0000664000175000017500000000203713160023043032671 0ustar bdbaddogbdbaddog refentry.xref.manvolnum boolean refentry.xref.manvolnum Output manvolnum as part of refentry cross-reference? Description if non-zero, the manvolnum is used when cross-referencing refentrys, either with xref or citerefentry. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/l10n.lang.value.rfc.compliant.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/l10n.lang.value.rfc.complian0000664000175000017500000000455013160023042032436 0ustar bdbaddogbdbaddog l10n.lang.value.rfc.compliant boolean l10n.lang.value.rfc.compliant Make value of lang attribute RFC compliant? Description If non-zero, ensure that the values for all lang attributes in HTML output are RFC compliantSection 8.1.1, Language Codes, in the HTML 4.0 Recommendation states that:
        [RFC1766] defines and explains the language codes that must be used in HTML documents. Briefly, language codes consist of a primary code and a possibly empty series of subcodes: language-code = primary-code ( "-" subcode )* And in RFC 1766, Tags for the Identification of Languages, the EBNF for "language tag" is given as: Language-Tag = Primary-tag *( "-" Subtag ) Primary-tag = 1*8ALPHA Subtag = 1*8ALPHA
        . by taking any underscore characters in any lang values found in source documents, and replacing them with hyphen characters in output HTML files. For example, zh_CN in a source document becomes zh-CN in the HTML output form that source. This parameter does not cause any case change in lang values, because RFC 1766 explicitly states that all "language tags" (as it calls them) "are to be treated as case insensitive".
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/subscript.properties.xml0000664000175000017500000000171713160023043032272 0ustar bdbaddogbdbaddog subscript.properties attribute set subscript.properties Properties associated with subscripts 75% Description Specifies styling properties for subscripts. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.spacer.graphic.xml0000664000175000017500000000201013160023043031521 0ustar bdbaddogbdbaddog toc.spacer.graphic boolean toc.spacer.graphic Use graphic for TOC spacer? Description If non-zero, the indentation in the TOC will be accomplished with the graphic identified by toc.spacer.image. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/target.database.document.xml0000664000175000017500000000316513160023043032726 0ustar bdbaddogbdbaddog target.database.document uri target.database.document Name of master database file for resolving olinks olinkdb.xml Description To resolve olinks between documents, the stylesheets use a master database document that identifies the target datafiles for all the documents within the scope of the olinks. This parameter value is the URI of the master document to be read during processing to resolve olinks. The default value is olinkdb.xml. The data structure of the file is defined in the targetdatabase.dtd DTD. The database file provides the high level elements to record the identifiers, locations, and relationships of documents. The cross reference data for individual documents is generally pulled into the database using system entity references or XIncludes. See also targets.filename. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/css.stylesheet.dir.xml0000664000175000017500000000216013160023042031606 0ustar bdbaddogbdbaddog css.stylesheet.dir uri css.stylesheet.dir Default directory for CSS stylesheets Description Identifies the default directory for the CSS stylesheet generated on all the slides. This parameter can be set in the source document with the <?dbhtml?> pseudo-attribute css-stylesheet-dir. If non-empty, this value is prepended to each of the stylesheets. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/navig.graphics.extension.xml0000664000175000017500000000172713160023043033000 0ustar bdbaddogbdbaddog navig.graphics.extension string navig.graphics.extension Extension for navigational graphics .gif Description Sets the filename extension to use on navigational graphics used in the headers and footers of chunked HTML. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.justify.xml0000664000175000017500000000422513160023042030324 0ustar bdbaddogbdbaddog man.justify boolean man.justify Justify text to both right and left margins? 0 Description If non-zero, text is justified to both the right and left margins (or, in roff terminology, "adjusted and filled" to both the right and left margins). If zero (the default), text is adjusted to the left margin only -- producing what is traditionally called "ragged-right" text. The default value for this parameter is zero because justified text looks good only when it is also hyphenated. Without hyphenation, excessive amounts of space often end up getting between words, in order to "pad" lines out to align on the right margin. The problem is that groff is not particularly smart about how it does hyphenation; it can end up hyphenating a lot of things that you don't want hyphenated. So, disabling both justification and hyphenation ensures that hyphens won't get inserted where you don't want to them, and you don't end up with lines containing excessive amounts of space between words. However, if do you decide to set a non-zero value for the man.justify parameter (to enable justification), then you should probably also set a non-zero value for man.hyphenate (to enable hyphenation). Yes, these default settings run counter to how most existing man pages are formatted. But there are some notable exceptions, such as the perl man pages. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.spacer.text.xml0000664000175000017500000000175413160023043031106 0ustar bdbaddogbdbaddog toc.spacer.text string toc.spacer.text The text for spacing the TOC     Description If toc.spacer.graphic is zero, this text string will be used to indent the TOC. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/nominal.image.width.xml0000664000175000017500000000324613160023043031714 0ustar bdbaddogbdbaddog nominal.image.width length nominal.image.width The nominal image width Description Graphic widths expressed as a percentage are problematic. In the following discussion, we speak of width and contentwidth, but the same issues apply to depth and contentdepth. A width of 50% means "half of the available space for the image." That's fine. But note that in HTML, this is a dynamic property and the image size will vary if the browser window is resized. A contentwidth of 50% means "half of the actual image width". But what does that mean if the stylesheets cannot assess the image's actual size? Treating this as a width of 50% is one possibility, but it produces behavior (dynamic scaling) that seems entirely out of character with the meaning. Instead, the stylesheets define a nominal.image.width and convert percentages to actual values based on that nominal size. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.segtitle.suppress.xml0000664000175000017500000000175213160023043032335 0ustar bdbaddogbdbaddog man.segtitle.suppress boolean man.segtitle.suppress Suppress display of segtitle contents? Description If the value of man.segtitle.suppress is non-zero, then display of segtitle contents is suppressed in output. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/informalequation.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/informalequation.properties.0000664000175000017500000000172713160023042033110 0ustar bdbaddogbdbaddog informalequation.properties attribute set informalequation.properties Properties associated with an informalequation Description The styling for informalequations. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/informaltable.properties.xml0000664000175000017500000000234513160023042033070 0ustar bdbaddogbdbaddog informaltable.properties attribute set informaltable.properties Properties associated with the block surrounding an informaltable Description Block styling properties for informaltables. This parameter should really have been called informaltable.block.properties or something like that, but we’re leaving it to avoid backwards-compatibility problems. See also table.table.properties. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.cell.border.thickness.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.cell.border.thickness.0000664000175000017500000000234413160023043032610 0ustar bdbaddogbdbaddog table.cell.border.thickness length table.cell.border.thickness Specifies the thickness of table cell borders 0.5pt Description If non-zero, specifies the thickness of borders on table cells. The units are points. See CSS To control properties of cell borders in HTML output, you must also turn on the table.borders.with.css parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/title.font.family.xml0000664000175000017500000000225113160023043031421 0ustar bdbaddogbdbaddog title.font.family list open serif sans-serif monospace title.font.family The default font family for titles sans-serif Description The title font family is used for titles (chapter, section, figure, etc.) ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/graphicsize.use.img.src.path.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/graphicsize.use.img.src.path0000664000175000017500000000211413160023042032650 0ustar bdbaddogbdbaddog graphicsize.use.img.src.path boolean graphicsize.use.img.src.path Prepend img.src.path before filenames passed to extension functions Description If non-zero img.src.path parameter will be appended before filenames passed to extension functions for measuring image dimensions. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/autotoc.label.separator.xml0000664000175000017500000000166013160023042032610 0ustar bdbaddogbdbaddog autotoc.label.separator string autotoc.label.separator Separator between labels and titles in the ToC . Description String used to separate labels and titles in a table of contents. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/example.properties.xml0000664000175000017500000000162513160023042031704 0ustar bdbaddogbdbaddog example.properties attribute set example.properties Properties associated with a example Description The styling for examples. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.meta.abstract.xml0000664000175000017500000000202113160023042032366 0ustar bdbaddogbdbaddog generate.meta.abstract boolean generate.meta.abstract Generate HTML META element from abstract? Description If non-zero, document abstracts will be reproduced in the HTML head, with >meta name="description" content="..." scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/use.svg.xml0000664000175000017500000000202313160023043027442 0ustar bdbaddogbdbaddog use.svg boolean use.svg Allow SVG in the result tree? Description If non-zero, SVG will be considered an acceptable image format. SVG is passed through to the result tree, so correct rendering of the resulting diagram depends on the formatter (FO processor or web browser) that is used to process the output from the stylesheet. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footer.content.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footer.content.properties.xm0000664000175000017500000000215713160023042033045 0ustar bdbaddogbdbaddog footer.content.properties attribute set footer.content.properties Properties of page footer content Description Properties of page footer content. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossdef.block.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossdef.block.properties.xm0000664000175000017500000000237613160023042033000 0ustar bdbaddogbdbaddog glossdef.block.properties attribute set glossdef.block.properties To add properties to the block of a glossary definition. .25in Description These properties are added to the block containing a glossary definition in a glossary when the glossary.as.blocks parameter is non-zero. Use this attribute-set to set the space above and below, any font properties, and any indent for the glossary definition. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/admon.graphics.xml0000664000175000017500000000167413160023042030757 0ustar bdbaddogbdbaddog admon.graphics boolean admon.graphics Use graphics in admonitions? Description If true (non-zero), admonitions are presented in an alternate style that uses a graphic. Default graphics are provided in the distribution. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/no.next.image.xml0000664000175000017500000000160513160023043030527 0ustar bdbaddogbdbaddog no.next.image filename no.next.image Inactive right-arrow image inactive/nav-next.png Description Specifies the filename of the inactive right-pointing navigation arrow. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.indent.verbatims.xml0000664000175000017500000000242413160023042032102 0ustar bdbaddogbdbaddog man.indent.verbatims boolean man.indent.verbatims Adjust indentation of verbatims? Description If the value of man.indent.verbatims is non-zero, the width of the left margin for output of verbatim environments (programlisting, screen, and so on) is set to the value of the man.indent.width parameter (3n by default). If instead the value of man.indent.verbatims is zero, the built-in roff default width (7.2n) is used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/admon.graphics.extension.xml0000664000175000017500000000165413160023042032770 0ustar bdbaddogbdbaddog admon.graphics.extension string admon.graphics.extension Filename extension for admonition graphics .png Description Sets the filename extension to use on admonition graphics. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/itemizedlist.label.width.xml0000664000175000017500000000217713160023042032763 0ustar bdbaddogbdbaddog itemizedlist.label.width length itemizedlist.label.width The default width of the label (bullet) in an itemized list. 1.0em Description Specifies the default width of the label (usually a bullet or other symbol) in an itemized list. You can override the default value on any particular list with the “dbfo†processing instruction using the “label-width†pseudoattribute. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/make.index.markup.xml0000664000175000017500000000540113160023042031373 0ustar bdbaddogbdbaddog make.index.markup boolean make.index.markup Generate XML index markup in the index? Description This parameter enables a very neat trick for getting properly merged, collated back-of-the-book indexes. G. Ken Holman suggested this trick at Extreme Markup Languages 2002 and I'm indebted to him for it. Jeni Tennison's excellent code in autoidx.xsl does a great job of merging and sorting indexterms in the document and building a back-of-the-book index. However, there's one thing that it cannot reasonably be expected to do: merge page numbers into ranges. (I would not have thought that it could collate and suppress duplicate page numbers, but in fact it appears to manage that task somehow.) Ken's trick is to produce a document in which the index at the back of the book is displayed in XML. Because the index is generated by the FO processor, all of the page numbers have been resolved. It's a bit hard to explain, but what it boils down to is that instead of having an index at the back of the book that looks like this:
        A ap1, 1, 2, 3
        you get one that looks like this:
        <indexdiv>A</indexdiv> <indexentry> <primaryie>ap1</primaryie>, <phrase role="pageno">1</phrase>, <phrase role="pageno">2</phrase>, <phrase role="pageno">3</phrase> </indexentry>
        After building a PDF file with this sort of odd-looking index, you can extract the text from the PDF file and the result is a proper index expressed in XML. Now you have data that's amenable to processing and a simple Perl script (such as fo/pdf2index) can merge page ranges and generate a proper index. Finally, reformat your original document using this literal index instead of an automatically generated one and bingo!
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/targets.filename.xml0000664000175000017500000000243313160023043031305 0ustar bdbaddogbdbaddog targets.filename string targets.filename Name of cross reference targets data file target.db Description In order to resolve olinks efficiently, the stylesheets can generate an external data file containing information about all potential cross reference endpoints in a document. This parameter lets you change the name of the generated file from the default name target.db. The name must agree with that used in the target database used to resolve olinks during processing. See also target.database.document. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.separator.xml0000664000175000017500000000165613160023043031720 0ustar bdbaddogbdbaddog refentry.separator boolean refentry.separator Generate a separator between consecutive RefEntry elements? Description If true, a separator will be generated between consecutive reference pages. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/text.home.xml0000664000175000017500000000140713160023043027770 0ustar bdbaddogbdbaddog text.home string text.home Home Home Description FIXME: scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/preface.autolabel.xml0000664000175000017500000000454713160023043031441 0ustar bdbaddogbdbaddog preface.autolabel list 0none 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... preface.autolabel Specifices the labeling format for Preface titles Description If non-zero then prefaces will be numbered using the parameter value as the number format if the value matches one of the following: 1 or arabic Arabic numeration (1, 2, 3 ...). A or upperalpha Uppercase letter numeration (A, B, C ...). a or loweralpha Lowercase letter numeration (a, b, c ...). I or upperroman Uppercase roman numeration (I, II, III ...). i or lowerroman Lowercase roman letter numeration (i, ii, iii ...). Any nonzero value other than the above will generate the default number format (arabic). ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level4.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.title.level4.propertie0000664000175000017500000000211613160023043032662 0ustar bdbaddogbdbaddog qanda.title.level4.properties attribute set qanda.title.level4.properties Properties for level-4 qanda set titles pt Description The properties of level-4 qanda set titles. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/use.embed.for.svg.xml0000664000175000017500000000230113160023043031301 0ustar bdbaddogbdbaddog use.embed.for.svg boolean use.embed.for.svg Use HTML embed for SVG? Description If non-zero, an embed element will be created for SVG figures. An object is always created, this parameter merely controls whether or not an additional embed is generated inside the object. On the plus side, this may be more portable among browsers and plug-ins. On the minus side, it isn't valid HTML. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ulink.target.xml0000664000175000017500000000171713160023043030470 0ustar bdbaddogbdbaddog ulink.target string ulink.target The HTML anchor target for ULinks _top Description If ulink.target is non-zero, its value will be used for the target attribute on anchors generated for ulinks. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.lang.xml0000664000175000017500000000250713160023043030437 0ustar bdbaddogbdbaddog profile.lang string profile.lang Target profile for lang attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/appendix.autolabel.xml0000664000175000017500000000456513160023042031643 0ustar bdbaddogbdbaddog appendix.autolabel list 0none 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... appendix.autolabel Specifies the labeling format for Appendix titles A Description If non-zero, then appendices will be numbered using the parameter value as the number format if the value matches one of the following: 1 or arabic Arabic numeration (1, 2, 3 ...). A or upperalpha Uppercase letter numeration (A, B, C ...). a or loweralpha Lowercase letter numeration (a, b, c ...). I or upperroman Uppercase roman numeration (I, II, III ...). i or lowerroman Lowercase roman letter numeration (i, ii, iii ...). Any nonzero value other than the above will generate the default number format (upperalpha). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/default.image.width.xml0000664000175000017500000000215013160023042031673 0ustar bdbaddogbdbaddog default.image.width length default.image.width The default width of images Description If specified, this value will be used for the width attribute on images that do not specify any viewport dimensions. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.version.suppress.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.version.suppress.xm0000664000175000017500000000336313160023043033111 0ustar bdbaddogbdbaddog refentry.version.suppress boolean refentry.version.suppress Suppress "version" part of refentry "source" contents? 0 Description If the value of refentry.version.suppress is non-zero, then during refentry metadata gathering, no "version" data is added to the refentry "source" contents. Instead (unless refentry.source.name.suppress is also non-zero), only "source name" data is added to the "source" contents. If you find that the refentry metadata gathering mechanism is causing unwanted "version" data to show up in your output -- for example, in the footer (or possibly header) of a man page -- then you might consider setting a non-zero value for refentry.version.suppress. Note that the terms "source", "source name", and "version" have special meanings in this context. For details, see the documentation for the refentry.source.name.profile parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/prefer.internal.olink.xml0000664000175000017500000000562513160023043032274 0ustar bdbaddogbdbaddog prefer.internal.olink boolean prefer.internal.olink Prefer a local olink reference to an external reference Description If you are re-using XML content modules in multiple documents, you may want to redirect some of your olinks. This parameter permits you to redirect an olink to the current document. For example: you are writing documentation for a product, which includes 3 manuals: a little installation booklet (booklet.xml), a user guide (user.xml), and a reference manual (reference.xml). All 3 documents begin with the same introduction section (intro.xml) that contains a reference to the customization section (custom.xml) which is included in both user.xml and reference.xml documents. How do you write the link to custom.xml in intro.xml so that it is interpreted correctly in all 3 documents? If you use xref, it will fail in user.xml. If you use olink (pointing to reference.xml), the reference in user.xml will point to the customization section of the reference manual, while it is actually available in user.xml. If you set the prefer.internal.olink parameter to a non-zero value, then the processor will first look in the olink database for the olink's targetptr attribute value in document matching the current.docid parameter value. If it isn't found there, then it tries the document in the database with the targetdoc value that matches the olink's targetdoc attribute. This feature permits an olink reference to resolve to the current document if there is an element with an id matching the olink's targetptr value. The current document's olink data must be included in the target database for this to work. There is a potential for incorrect links if the same id attribute value is used for different content in different documents. Some of your olinks may be redirected to the current document when they shouldn't be. It is not possible to control individual olink instances. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/page.margin.bottom.xml0000664000175000017500000000166713160023043031560 0ustar bdbaddogbdbaddog page.margin.bottom length page.margin.bottom The bottom margin of the page 0.5in Description The bottom page margin is the distance from the bottom of the region-after to the physical bottom of the page. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.doctitle.xml0000664000175000017500000001117113160023043030776 0ustar bdbaddogbdbaddog olink.doctitle list no yes maybe olink.doctitle show the document title for external olinks? no Description When olinks between documents are resolved, the generated text may not make it clear that the reference is to another document. It is possible for the stylesheets to append the other document's title to external olinks. For this to happen, two parameters must be set. This olink.doctitle parameter should be set to either yes or maybe to enable this feature. And you should also set the current.docid parameter to the document id for the document currently being processed for output. Then if an olink's targetdoc id differs from the current.docid value, the stylesheet knows that it is a reference to another document and can append the target document's title to the generated olink text. The text for the target document's title is copied from the olink database from the ttl element of the top-level div for that document. If that ttl element is missing or empty, no title is output. The supported values for olink.doctitle are: yes Always insert the title to the target document if it is not the current document. no Never insert the title to the target document, even if requested in an xrefstyle attribute. maybe Only insert the title to the target document, if requested in an xrefstyle attribute. An xrefstyle attribute may override the global setting for individual olinks. The following values are supported in an xrefstyle attribute using the select: syntax: docname Insert the target document name for this olink using the docname gentext template, but only if the value of olink.doctitle is not no. docnamelong Insert the target document name for this olink using the docnamelong gentext template, but only if the value of olink.doctitle is not no. nodocname Omit the target document name even if the value of olink.doctitle is yes. Another way of inserting the target document name for a single olink is to employ an xrefstyle attribute using the template: syntax. The %o placeholder (the letter o, not zero) in such a template will be filled in with the target document's title when it is processed. This will occur regardless of the value of olink.doctitle. Note that prior to version 1.66 of the XSL stylesheets, the allowed values for this parameter were 0 and 1. Those values are still supported and mapped to 'no' and 'yes', respectively. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.base.uri.xml0000664000175000017500000000307313160023043030701 0ustar bdbaddogbdbaddog olink.base.uri uri olink.base.uri Base URI used in olink hrefs Description When cross reference data is collected for resolving olinks, it may be necessary to prepend a base URI to each target's href. This parameter lets you set that base URI when cross reference data is collected. This feature is needed when you want to link to a document that is processed without chunking. The output filename for such a document is not known to the XSL stylesheet; the only target information consists of fragment identifiers such as #idref. To enable the resolution of olinks between documents, you should pass the name of the HTML output file as the value of this parameter. Then the hrefs recorded in the cross reference data collection look like outfile.html#idref, which can be reached as links from other documents. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level1.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level1.propert0000664000175000017500000000212713160023043032723 0ustar bdbaddogbdbaddog section.title.level1.properties attribute set section.title.level1.properties Properties for level-1 section titles pt Description The properties of level-1 section titles. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xep.index.item.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/xep.index.item.properties.xm0000664000175000017500000000275413160023043032741 0ustar bdbaddogbdbaddog xep.index.item.properties attribute set xep.index.item.properties Properties associated with XEP index-items true true Description Properties associated with XEP index-items, which generate page numbers in an index processed by XEP. For more info see the XEP documentation section "Indexes" in http://www.renderx.com/reference.html#Indexes. This attribute-set also adds by default any properties from the index.page.number.properties attribute-set. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/dynamic.toc.xml0000664000175000017500000000171413160023042030265 0ustar bdbaddogbdbaddog dynamic.toc boolean dynamic.toc Dynamic ToCs? Description If non-zero, JavaScript is used to make the ToC panel dynamic. In a dynamic ToC, each section in the ToC can be expanded and collapsed by clicking on the appropriate image. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/body.font.size.xml0000664000175000017500000000210013160023042030716 0ustar bdbaddogbdbaddog body.font.size length body.font.size Specifies the default font size for body text pt Description The body font size is specified in two parameters (body.font.master and body.font.size) so that math can be performed on the font size by XSLT. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.standalone.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.standalone.xm0000664000175000017500000000235013160023042033023 0ustar bdbaddogbdbaddog chunker.output.standalone string chunker.output.standalone Standalone declaration for generated pages no Description This parameter specifies the value of the standalone specification for generated pages. It must be either yes or no. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level4.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.title.level4.propert0000664000175000017500000000212413160023043032723 0ustar bdbaddogbdbaddog section.title.level4.properties attribute set section.title.level4.properties Properties for level-4 section titles pt Description The properties of level-4 section titles. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level5.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level5.properties.xm0000664000175000017500000000277113160023043032740 0ustar bdbaddogbdbaddog section.level5.properties attribute set section.level5.properties Properties for level-5 sections Description The properties that apply to the containing block of a level-5 section, and therefore apply to the whole section. This includes sect5 elements and section elements at level 5. For example, you could start each level-5 section on a new page by using: <xsl:attribute-set name="section.level5.properties"> <xsl:attribute name="break-before">page</xsl:attribute> </xsl:attribute-set> This attribute set inherits attributes from the general section.properties attribute set. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossterm.auto.link.xml0000664000175000017500000000243513160023042032000 0ustar bdbaddogbdbaddog glossterm.auto.link boolean glossterm.auto.link Generate links from glossterm to glossentry automatically? Description If non-zero, links from inline glossterms to the corresponding glossentry elements in a glossary or glosslist will be automatically generated. This is useful when your glossterms are consistent and you don't want to add links manually. The automatic link generation feature is not used on glossterm elements that have a linkend attribute. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.conformance.xml0000664000175000017500000000256113160023043032010 0ustar bdbaddogbdbaddog profile.conformance string profile.conformance Target profile for conformance attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/tex.math.in.alt.xml0000664000175000017500000000535113160023043030773 0ustar bdbaddogbdbaddog tex.math.in.alt list plain latex tex.math.in.alt TeX notation used for equations Description If you want type math directly in TeX notation in equations, this parameter specifies notation used. Currently are supported two values -- plain and latex. Empty value means that you are not using TeX math at all. Preferred way for including TeX alternative of math is inside of textobject element. Eg.: <inlineequation> <inlinemediaobject> <imageobject> <imagedata fileref="eq1.gif"/> </imageobject> <textobject><phrase>E=mc squared</phrase></textobject> <textobject role="tex"><phrase>E=mc^2</phrase></textobject> </inlinemediaobject> </inlineequation> If you are using graphic element, you can store TeX inside alt element: <inlineequation> <alt role="tex">a^2+b^2=c^2</alt> <graphic fileref="a2b2c2.gif"/> </inlineequation> If you want use this feature, you should process your FO with PassiveTeX, which only supports TeX math notation. When calling stylsheet, don't forget to specify also passivetex.extensions=1. If you want equations in HTML, just process generated file tex-math-equations.tex by TeX or LaTeX. Then run dvi2bitmap program on result DVI file. You will get images for equations in your document. This feature is useful for print/PDF output only if you use the obsolete and now unsupported PassiveTeX XSL-FO engine. Related Parameters tex.math.delims, passivetex.extensions, tex.math.file ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.string.subst.map.local.pre.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.string.subst.map.local.p0000664000175000017500000000251613160023043032602 0ustar bdbaddogbdbaddog man.string.subst.map.local.pre string man.string.subst.map.local.pre Specifies “local†string substitutions Description Use the man.string.subst.map.local.pre parameter to specify any “local†string substitutions to perform over the entire roff source for each man page before performing the string substitutions specified by the man.string.subst.map parameter. For details about the format of this parameter, see the documentation for the man.string.subst.map parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.blank.image.xml0000664000175000017500000000177113160023043031015 0ustar bdbaddogbdbaddog toc.blank.image filename toc.blank.image The image for "blanks" in the TOC graphics/blank.gif Description If toc.blank.graphic is non-zero, this image will be used to for "blanks" in the TOC. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/suppress.homepage.title.xml0000664000175000017500000000162413160023043032646 0ustar bdbaddogbdbaddog suppress.homepage.title boolean suppress.homepage.title Suppress title on homepage? Description FIXME:If non-zero, the title on the homepage is suppressed? scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/insert.olink.pdf.frag.xml0000664000175000017500000000503313160023042032160 0ustar bdbaddogbdbaddog insert.olink.pdf.frag boolean insert.olink.pdf.frag Add fragment identifiers for links into PDF files Description The value of this parameter determines whether the cross reference URIs to PDF documents made with olink will include fragment identifiers. When forming a URI to link to a PDF document, a fragment identifier (typically a '#' followed by an id value) appended to the PDF filename can be used by the PDF viewer to open the PDF file to a location within the document instead of the first page. However, not all PDF files have id values embedded in them, and not all PDF viewers can handle fragment identifiers. If insert.olink.pdf.frag is set to a non-zero value, then any olink targeting a PDF file will have the fragment identifier appended to the URI. The URI is formed by concatenating the value of the olink.base.uri parameter, the value of the baseuri attribute from the document element in the olink database with the matching targetdoc value, and the value of the href attribute for the targeted element in the olink database. The href attribute contains the fragment identifier. If insert.olink.pdf.frag is set to zero (the default value), then the href attribute from the olink database is not appended to PDF olinks, so the fragment identifier is left off. A PDF olink is any olink for which the baseuri attribute from the matching document element in the olink database ends with '.pdf'. Any other olinks will still have the fragment identifier added. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/titlefoil.html.xml0000664000175000017500000000157113160023043031015 0ustar bdbaddogbdbaddog titlefoil.html filename titlefoil.html Name of title foil HTML file Description Sets the filename used for the slides titlepage. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.table.footnotes.divider.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.table.footnotes.divider.0000664000175000017500000000211113160023043032632 0ustar bdbaddogbdbaddog man.table.footnotes.divider string man.table.footnotes.divider Specifies divider string that appears before table footnotes ---- Description In each table that contains footenotes, the string specified by the man.table.footnotes.divider parameter is output before the list of footnotes for the table. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/variablelist.as.blocks.xml0000664000175000017500000000452113160023043032414 0ustar bdbaddogbdbaddog variablelist.as.blocks boolean variablelist.as.blocks Format variablelists lists as blocks? Description If non-zero, variablelists will be formatted as blocks. If you have long terms, proper list markup in the FO case may produce unattractive lists. By setting this parameter, you can force the stylesheets to produce block markup instead of proper lists. You can override this setting with a processing instruction as the child of variablelist: dbfo list-presentation="blocks" or dbfo list-presentation="list". When using list-presentation="list", you can also control the amount of space used for the terms with the dbfo term-width=".25in" processing instruction, the termlength attribute on variablelist, or allow the stylesheets to attempt to calculate the amount of space to leave based on the number of letters in the longest term. <variablelist> <?dbfo list-presentation="list"?> <?dbfo term-width="1.5in"?> <?dbhtml list-presentation="table"?> <?dbhtml term-width="1.5in"?> <varlistentry> <term>list</term> <listitem> <para> Formatted as a list even if variablelist.as.blocks is set to 1. </para> </listitem> </varlistentry> </variablelist> scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/body.margin.bottom.xml0000664000175000017500000000170313160023042031567 0ustar bdbaddogbdbaddog body.margin.bottom length body.margin.bottom The bottom margin of the body text 0.5in Description The body bottom margin is the distance from the last line of text in the page body to the bottom of the region-after. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhc.xml0000664000175000017500000000155613160023042030437 0ustar bdbaddogbdbaddog htmlhelp.hhc string htmlhelp.hhc Filename of TOC file. toc.hhc Description Set the name of the TOC file. The default is toc.hhc. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/text.prev.xml0000664000175000017500000000141113160023043030007 0ustar bdbaddogbdbaddog text.prev string text.prev FIXME: Prev Description FIXME: scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refclass.suppress.xml0000664000175000017500000000172213160023043031542 0ustar bdbaddogbdbaddog refclass.suppress boolean refclass.suppress Suppress display of refclass contents? Description If the value of refclass.suppress is non-zero, then display of refclass contents is suppressed in output. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/default.table.width.xml0000664000175000017500000000211213160023042031676 0ustar bdbaddogbdbaddog default.table.width length default.table.width The default width of tables Description If non-zero, this value will be used for the width attribute on tables that do not specify an alternate width (with the dbhtml table-width or dbfo table-width processing instruction). ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.page.number.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.page.number.properties0000664000175000017500000000203313160023042032755 0ustar bdbaddogbdbaddog index.page.number.properties attribute set index.page.number.properties Properties associated with index page numbers Description Properties associated with page numbers in indexes. Changing color to indicate the page number is a link is one possibility. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/navig.showtitles.xml0000664000175000017500000000216313160023043031365 0ustar bdbaddogbdbaddog navig.showtitles boolean navig.showtitles Display titles in HTML headers and footers? 1 Description If non-zero, the headers and footers of chunked HTML display the titles of the next and previous chunks, along with the words 'Next' and 'Previous' (or the equivalent graphical icons if navig.graphics is true). If false (zero), then only the words 'Next' and 'Previous' (or the icons) are displayed. ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.manual.profile.enabled.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/refentry.manual.profile.enab0000664000175000017500000000361613160023043032737 0ustar bdbaddogbdbaddog refentry.manual.profile.enabled boolean refentry.manual.profile.enabled Enable refentry "manual" profiling? 0 Description If the value of refentry.manual.profile.enabled is non-zero, then during refentry metadata gathering, the info profile specified by the customizable refentry.manual.profile parameter is used. If instead the value of refentry.manual.profile.enabled is zero (the default), then "hard coded" logic within the DocBook XSL stylesheets is used for gathering refentry "manual" data. If you find that the default refentry metadata-gathering behavior is causing incorrect "manual" data to show up in your output, then consider setting a non-zero value for refentry.manual.profile.enabled and adjusting the value of refentry.manual.profile to cause correct data to be gathered. Note that the term "manual" has a special meanings in this context. For details, see the documentation for the refentry.manual.profile parameter. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.footnote.number.symbols.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.footnote.number.symbol0000664000175000017500000000342313160023043032774 0ustar bdbaddogbdbaddog table.footnote.number.symbols string table.footnote.number.symbols Special characters to use a footnote markers in tables Description If table.footnote.number.symbols is not the empty string, table footnotes will use the characters it contains as footnote symbols. For example, *&#x2020;&#x2021;&#x25CA;&#x2720; will identify footnotes with *, †, ‡, ◊, and ✠. If there are more footnotes than symbols, the stylesheets will fall back to numbered footnotes using table.footnote.number.format. The use of symbols for footnotes depends on the ability of your processor (or browser) to render the symbols you select. Not all systems are capable of displaying the full range of Unicode characters. If the quoted characters in the preceding paragraph are not displayed properly, that's a good indicator that you may have trouble using those symbols for footnotes. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.manifest.xml0000664000175000017500000000201013160023042031442 0ustar bdbaddogbdbaddog generate.manifest boolean generate.manifest Generate a manifest file? Description If non-zero, a list of HTML files generated by the stylesheet transformation is written to the file named by the manifest parameter. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/multiframe.navigation.height.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/multiframe.navigation.height0000664000175000017500000000175213160023043033033 0ustar bdbaddogbdbaddog multiframe.navigation.height length multiframe.navigation.height Height of navigation frames 40 Description Specifies the height of the navigation frames in pixels when multiframe is enabled. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/no.prev.image.xml0000664000175000017500000000160413160023043030524 0ustar bdbaddogbdbaddog no.prev.image filename no.prev.image Inactive left-arrow image inactive/nav-prev.png Description Specifies the filename of the inactive left-pointing navigation arrow. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ebnf.table.bgcolor.xml0000664000175000017500000000177213160023042031507 0ustar bdbaddogbdbaddog ebnf.table.bgcolor color ebnf.table.bgcolor Background color for EBNF tables #F5DCB3 Description Sets the background color for EBNF tables (a pale brown). No bgcolor attribute is output if ebnf.table.bgcolor is set to the null string. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/text.toc.xml0000664000175000017500000000140313160023043027621 0ustar bdbaddogbdbaddog text.toc string text.toc FIXME: ToC Description FIXME: ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossterm.block.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glossterm.block.properties.x0000664000175000017500000000300613160023042033023 0ustar bdbaddogbdbaddog glossterm.block.properties attribute set glossterm.block.properties To add properties to the block of a glossentry's glossterm. 1em 0.8em 1.2em always always Description These properties are added to the block containing a glossary term in a glossary when the glossary.as.blocks parameter is non-zero. Use this attribute-set to set the space above and below, font properties, and any indent for the glossary term. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/link.mailto.url.xml0000664000175000017500000000172113160023042031075 0ustar bdbaddogbdbaddog link.mailto.url string link.mailto.url Mailto URL for the LINK REL=made HTML HEAD element Description If not the empty string, this address will be used for the rel=made link element in the html head scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.gap.titlepage.xml0000664000175000017500000000171713160023042032100 0ustar bdbaddogbdbaddog column.gap.titlepage length column.gap.titlepage Gap between columns on title pages 12pt Description Specifies the gap between columns on title pages (if column.count.titlepage is greater than one). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.home.xml0000664000175000017500000000161413160023042032132 0ustar bdbaddogbdbaddog htmlhelp.button.home boolean htmlhelp.button.home Should the Home button be shown? Description Set to non-zero to include the Home button on the toolbar. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/saxon.callouts.xml0000664000175000017500000000166213160023043031035 0ustar bdbaddogbdbaddog saxon.callouts boolean saxon.callouts Enable the callout extension Description The callouts extension processes areaset elements in ProgramListingCO and other text-based callout elements. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.use.hhk.xml0000664000175000017500000000207013160023042031232 0ustar bdbaddogbdbaddog htmlhelp.use.hhk boolean htmlhelp.use.hhk Should the index be built using the HHK file? Description If non-zero, the index is created using the HHK file (instead of using object elements in the HTML files). For more information, see Generating an index. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/text.next.xml0000664000175000017500000000141113160023043030011 0ustar bdbaddogbdbaddog text.next string text.next FIXME: Next Description FIXME: scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/docbook.css.source.xml0000664000175000017500000000672513160023042031572 0ustar bdbaddogbdbaddog docbook.css.source string docbook.css.source Name of the default CSS input file docbook.css.xml Description The docbook.css.source parameter specifies the name of the file containing the default DocBook CSS styles. Those styles are necessary when the make.clean.html parameter is nonzero. The file is a well-formed XML file that must consist of a single style root element that contains CSS styles as its text content. The default value of the parameter (and filename) is docbook.css.xml. The stylesheets ship with the default file. You can substitute your own and specify its path in this parameter. If docbook.css.source is not blank, and make.clean.html is nonzero, then the stylesheet takes the following actions: The stylesheet uses the XSLT document() function to open the file specified by the parameter and load it into a variable. The stylesheet forms an output pathname consisting of the value of the base.dir parameter (if it is set) and the value of docbook.css.source, with the .xml suffix stripped off. The stylesheet removes the style wrapper element and writes just the CSS text content to the output file. The stylesheet adds a link element to the HTML HEAD element to reference the external CSS stylesheet. For example: <link rel="stylesheet" href="docbook.css" type="text/css"> However, if the docbook.css.link parameter is set to zero, then no link is written for the default CSS file. That is useful if a custom CSS file will import the default CSS stylesheet to ensure proper cascading of styles. If the docbook.css.source parameter is changed from its default docbook.css.xml to blank, then no default CSS is generated. Likewise if the make.clean.html parameter is set to zero, then no default CSS is generated. The custom.css.source parameter can be used instead to generate a complete custom CSS file. You can use the generate.css.header parameter to instead write the CSS to each HTML HEAD element in a style tag instead of an external CSS file. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/email.mailto.enabled.xml0000664000175000017500000000176413160023042032026 0ustar bdbaddogbdbaddog email.mailto.enabled boolean email.mailto.enabled Generate mailto: links for email addresses? Description If non-zero the generated output for the email element will be a clickable mailto: link that brings up the default mail client on the system. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/body.font.master.xml0000664000175000017500000000201413160023042031243 0ustar bdbaddogbdbaddog body.font.master number body.font.master Specifies the default point size for body text 10 Description The body font size is specified in two parameters (body.font.master and body.font.size) so that math can be performed on the font size by XSLT. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/variablelist.term.break.after.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/variablelist.term.break.afte0000664000175000017500000000265713160023043032716 0ustar bdbaddogbdbaddog variablelist.term.break.after boolean variablelist.term.break.after Generate line break after each term within a multi-term varlistentry? 0 Description Set a non-zero value for the variablelist.term.break.after parameter to generate a line break between terms in a multi-term varlistentry. If you set a non-zero value for variablelist.term.break.after, you may also want to set the value of the variablelist.term.separator parameter to an empty string (to suppress rendering of the default comma and space after each term). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/header.hr.xml0000664000175000017500000000156013160023042027714 0ustar bdbaddogbdbaddog header.hr boolean header.hr Toggle <HR> after header Description If non-zero, an <HR> is generated at the bottom of each web page, before the footer. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/formal.object.properties.xml0000664000175000017500000000275113160023042032777 0ustar bdbaddogbdbaddog formal.object.properties attribute set formal.object.properties Properties associated with a formal object such as a figure, or other component that has a title 0.5em 1em 2em 0.5em 1em 2em always Description The styling for formal objects in docbook. Specify the spacing before and after the object. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.in.toc.xml0000664000175000017500000000225413160023043030333 0ustar bdbaddogbdbaddog qanda.in.toc boolean qanda.in.toc Should qandaentry questions appear in the document table of contents? Description If true (non-zero), then the generated table of contents for a document will include qandaset titles, qandadiv titles, and question elements. The default value (zero) excludes them from the TOC. This parameter does not affect any tables of contents that may be generated inside a qandaset or qandadiv. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.arch.xml0000664000175000017500000000251013160023043030425 0ustar bdbaddogbdbaddog profile.arch string profile.arch Target profile for arch attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/sidebar.float.width.xml0000664000175000017500000000223313160023043031706 0ustar bdbaddogbdbaddog sidebar.float.width length sidebar.float.width Set the default width for sidebars 1in Description Sets the default width for sidebars when used as a side float. The width determines the degree to which the sidebar block intrudes into the text area. If sidebar.float.type is before or none, then this parameter is ignored. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/make.graphic.viewport.xml0000664000175000017500000000250513160023042032263 0ustar bdbaddogbdbaddog make.graphic.viewport boolean make.graphic.viewport Use tables in HTML to make viewports for graphics Description The HTML img element only supports the notion of content-area scaling; it doesn't support the distinction between a content-area and a viewport-area, so we have to make some compromises. If make.graphic.viewport is non-zero, a table will be used to frame the image. This creates an effective viewport-area. Tables and alignment don't work together, so this parameter is ignored if alignment is specified on an image. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/graphics.dir.xml0000664000175000017500000000211013160023042030421 0ustar bdbaddogbdbaddog graphics.dir uri graphics.dir Graphics directory Description Identifies the graphics directory for the navigation components generated on all the slides. This parameter can be set in the source document with the <?dbhtml?> pseudo-attribute graphics-dir. If non-empty, this value is prepended to each of the graphic image paths. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/navtocwidth.xml0000664000175000017500000000165113160023043030410 0ustar bdbaddogbdbaddog navtocwidth length navtocwidth Specifies the width of the navigation table TOC 220 Description The width, in pixels, of the navigation column. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/crop.mark.width.xml0000664000175000017500000000161613160023042031070 0ustar bdbaddogbdbaddog crop.mark.width length crop.mark.width Width of crop marks. 0.5pt Description Width of crop marks. Crop marks are controlled by crop.marks parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/insert.link.page.number.xml0000664000175000017500000000443613160023042032523 0ustar bdbaddogbdbaddog insert.link.page.number list no yes maybe insert.link.page.number Turns page numbers in link elements on and off no Description The value of this parameter determines if cross references using the link element in printed output will include standard page number citations. It has three possible values. no No page number references will be generated. yes Page number references will be generated for all link elements. The style of page reference may be changed if an xrefstyle attribute is used. maybe Page number references will not be generated for a link element unless it has an xrefstyle attribute whose value specifies a page reference. Although the xrefstyle attribute can be used to turn the page reference on or off, it cannot be used to control the formatting of the page number as it can in xref. In link it will always format with the style established by the gentext template with name="page.citation" in the l:context name="xref". scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ulink.hyphenate.xml0000664000175000017500000000252313160023043031163 0ustar bdbaddogbdbaddog ulink.hyphenate string ulink.hyphenate Allow URLs to be automatically hyphenated Description If not empty, the specified character (or more generally, content) is added to URLs after every character included in the string in the ulink.hyphenate.chars parameter (default is /). If the character in this parameter is a Unicode soft hyphen (0x00AD) or Unicode zero-width space (0x200B), some FO processors will be able to reasonably hyphenate long URLs. As of 28 Jan 2002, discretionary hyphens are more widely and correctly supported than zero-width spaces for this purpose. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/manifest.xml0000664000175000017500000000173413160023043027666 0ustar bdbaddogbdbaddog manifest string manifest Name of manifest file HTML.manifest Description The name of the file to which a manifest is written (if the value of the generate.manifest parameter is non-zero). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/nav.table.summary.xml0000664000175000017500000000202113160023043031414 0ustar bdbaddogbdbaddog nav.table.summary string nav.table.summary HTML Table summary attribute value for navigation tables Navigation Description The value of this parameter is used as the value of the table summary attribute for the navigation table. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/show.foil.number.xml0000664000175000017500000000163613160023043031260 0ustar bdbaddogbdbaddog show.foil.number boolean show.foil.number Show foil number on each foil? Description If non-zero, on each slide there will be its number. Currently not supported in all output formats. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.charmap.enabled.xml0000664000175000017500000000457013160023042031636 0ustar bdbaddogbdbaddog man.charmap.enabled boolean man.charmap.enabled Apply character map before final output? Description If the value of the man.charmap.enabled parameter is non-zero, a "character map" is used to substitute certain Unicode symbols and special characters with appropriate roff/groff equivalents, just before writing each man-page file to the filesystem. If instead the value of man.charmap.enabled is zero, Unicode characters are passed through "as is". Details For converting certain Unicode symbols and special characters in UTF-8 or UTF-16 encoded XML source to appropriate groff/roff equivalents in man-page output, the DocBook XSL Stylesheets distribution includes a roff character map that is compliant with the XSLT character map format as detailed in the XSLT 2.0 specification. The map contains more than 800 character mappings and can be considered the standard roff character map for the distribution. You can use the man.charmap.uri parameter to specify a URI for the location for an alternate roff character map to use in place of the standard roff character map provided in the distribution. You can also use a subset of a character map. For details, see the man.charmap.use.subset, man.charmap.subset.profile, and man.charmap.subset.profile.english parameters. ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.force.map.and.alias.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.force.map.and.alias0000664000175000017500000000213013160023042032566 0ustar bdbaddogbdbaddog htmlhelp.force.map.and.alias boolean htmlhelp.force.map.and.alias Should [MAP] and [ALIAS] sections be added to the project file unconditionally? Description Set to non-zero if you have your own alias.h and context.h files and you want to include references to them in the project file. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/navig.graphics.path.xml0000664000175000017500000000176113160023043031716 0ustar bdbaddogbdbaddog navig.graphics.path string navig.graphics.path Path to navigational graphics images/ Description Sets the path, probably relative to the directory where the HTML files are created, to the navigational graphics used in the headers and footers of chunked HTML. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.enumerate.images.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.enumerate.images.xm0000664000175000017500000000201113160023042032735 0ustar bdbaddogbdbaddog htmlhelp.enumerate.images boolean htmlhelp.enumerate.images Should the paths to all used images be added to the project file? Description Set to non-zero if you insert images into your documents as external binary entities or if you are using absolute image paths. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.hhp.tail.xml0000664000175000017500000000167213160023042031403 0ustar bdbaddogbdbaddog htmlhelp.hhp.tail string htmlhelp.hhp.tail Additional content for project file. Description If you want to include some additional parameters into project file, store appropriate part of project file into this parameter. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.encoding.xml0000664000175000017500000000235513160023042032642 0ustar bdbaddogbdbaddog chunker.output.encoding string chunker.output.encoding Encoding used in generated pages ISO-8859-1 Description This parameter specifies the encoding to be used in files generated by the chunking stylesheet. Not all processors support specification of this parameter. This parameter used to be named default.encoding. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/base.dir.xml0000664000175000017500000000165013160023042027543 0ustar bdbaddogbdbaddog base.dir uri base.dir The base directory of chunks Description If specified, the base.dir identifies the output directory for chunks. (If not specified, the output directory is system dependent.) scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.encoding.xml0000664000175000017500000000212613160023042031455 0ustar bdbaddogbdbaddog htmlhelp.encoding string htmlhelp.encoding Character encoding to use in files for HTML Help compiler. iso-8859-1 Description HTML Help Compiler is not UTF-8 aware, so you should always use an appropriate single-byte encoding here. Use one from iana, the registered charset values. ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.doctype-system.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.doctype-syste0000664000175000017500000000237613160023042033074 0ustar bdbaddogbdbaddog chunker.output.doctype-system uri chunker.output.doctype-system System identifier to use for the document type in generated pages Description This parameter specifies the system identifier that should be used by the chunking stylesheet in the document type declaration of chunked pages. Not all processors support specification of this parameter. This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/bibliography.numbered.xml0000664000175000017500000000161713160023042032332 0ustar bdbaddogbdbaddog bibliography.numbered boolean bibliography.numbered Should bibliography entries be numbered? Description If non-zero bibliography entries will be numbered scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/column.gap.front.xml0000664000175000017500000000167413160023042031254 0ustar bdbaddogbdbaddog column.gap.front length column.gap.front Gap between columns in the front matter 12pt Description Specifies the gap between columns in front matter (if column.count.front is greater than one). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/bullet.image.xml0000664000175000017500000000156013160023042030424 0ustar bdbaddogbdbaddog bullet.image filename bullet.image Bullet image toc/bullet.png Description Specifies the filename of the bullet image used for foils in the framed ToC. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/olink.debug.xml0000664000175000017500000000222513160023043030255 0ustar bdbaddogbdbaddog olink.debug boolean olink.debug Turn on debugging messages for olinks Description If non-zero, then each olink will generate several messages about how it is being resolved during processing. This is useful when an olink does not resolve properly and the standard error messages are not sufficient to find the problem. You may need to read through the olink XSL templates to understand the context for some of the debug messages. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.button.back.xml0000664000175000017500000000162213160023042032101 0ustar bdbaddogbdbaddog htmlhelp.button.back boolean htmlhelp.button.back Should the Back button be shown? Description Set to non-zero to include the Hide/Show button shown on toolbar scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ebnf.assignment.xml0000664000175000017500000000256513160023042031143 0ustar bdbaddogbdbaddog ebnf.assignment rtf ebnf.assignment The EBNF production assignment operator ::= ::= Description The ebnf.assignment parameter determines what text is used to show assignment in productions in productionsets. While ::= is common, so are several other operators. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/segmentedlist.as.table.xml0000664000175000017500000000163713160023043032421 0ustar bdbaddogbdbaddog segmentedlist.as.table boolean segmentedlist.as.table Format segmented lists as tables? Description If non-zero, segmentedlists will be formatted as tables. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/symbol.font.family.xml0000664000175000017500000000325713160023043031614 0ustar bdbaddogbdbaddog symbol.font.family list open serif sans-serif monospace symbol.font.family The font families to be searched for symbols outside of the body font Symbol,ZapfDingbats Description A typical body or title font does not contain all the character glyphs that DocBook supports. This parameter specifies additional fonts that should be searched for special characters not in the normal font. These symbol font names are automatically appended to the body or title font family name when fonts are specified in a font-family property in the FO output. The symbol font names should be entered as a comma-separated list. The default value is Symbol,ZapfDingbats. ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/revhistory.title.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/revhistory.title.properties.0000664000175000017500000000170613160023043033067 0ustar bdbaddogbdbaddog revhistory.title.properties attribute set revhistory.title.properties The properties of revhistory title Description This property set defines appearance of revhistory title. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/sequential.links.xml0000664000175000017500000000147013160023043031346 0ustar bdbaddogbdbaddog sequential.links boolean sequential.links Make sequentional links? Description FIXME scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/footer.table.properties.xml0000664000175000017500000000205613160023042032634 0ustar bdbaddogbdbaddog footer.table.properties attribute set footer.table.properties Apply properties to the footer layout table fixed 100% Description Properties applied to the table that lays out the page footer. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.hyphenate.xml0000664000175000017500000000450613160023042030616 0ustar bdbaddogbdbaddog man.hyphenate boolean man.hyphenate Enable hyphenation? 0 Description If non-zero, hyphenation is enabled. The default value for this parameter is zero because groff is not particularly smart about how it does hyphenation; it can end up hyphenating a lot of things that you don't want hyphenated. To mitigate that, the default behavior of the stylesheets is to suppress hyphenation of computer inlines, filenames, and URLs. (You can override the default behavior by setting non-zero values for the man.hyphenate.urls, man.hyphenate.filenames, and man.hyphenate.computer.inlines parameters.) But the best way is still to just globally disable hyphenation, as the stylesheets do by default. The only good reason to enabled hyphenation is if you have also enabled justification (which is disabled by default). The reason is that justified text can look very bad unless you also hyphenate it; to quote the Hypenation node from the groff info page:
        Since the odds are not great for finding a set of words, for every output line, which fit nicely on a line without inserting excessive amounts of space between words, 'gtroff' hyphenates words so that it can justify lines without inserting too much space between words.
        So, if you set a non-zero value for the man.justify parameter (to enable justification), then you should probably also set a non-zero value for man.hyphenate (to enable hyphenation).
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/glosslist.as.blocks.xml0000664000175000017500000000156413160023042031761 0ustar bdbaddogbdbaddog glosslist.as.blocks boolean glosslist.as.blocks Use blocks for glosslists? Description See glossary.as.blocks. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.list.type.xml0000664000175000017500000000220313160023043030567 0ustar bdbaddogbdbaddog toc.list.type list dl ul ol toc.list.type Type of HTML list element to use for Tables of Contents dl Description When an automatically generated Table of Contents (or List of Titles) is produced, this HTML element will be used to make the list. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/bridgehead.in.toc.xml0000664000175000017500000000175413160023042031330 0ustar bdbaddogbdbaddog bridgehead.in.toc boolean bridgehead.in.toc Should bridgehead elements appear in the TOC? Description If non-zero, bridgeheads appear in the TOC. Note that this option is not fully supported and may be removed in a future version of the stylesheets. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.cleanup.xml0000664000175000017500000000236413160023042030451 0ustar bdbaddogbdbaddog html.cleanup boolean html.cleanup Attempt to clean up the resulting HTML? Description If non-zero, and if the EXSLT extensions are supported by your processor, the resulting HTML will be cleaned up. This improves the chances that the resulting HTML will be valid. It may also improve the formatting of some elements. This parameter is different from make.valid.html because it uses extension functions to manipulate result-tree-fragments. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/saxon.linenumbering.xml0000664000175000017500000000213113160023043032035 0ustar bdbaddogbdbaddog saxon.linenumbering boolean saxon.linenumbering Enable the line numbering extension Description If non-zero, verbatim environments (elements that have the format='linespecific' notation attribute: address, literallayout, programlisting, screen, synopsis) that specify line numbering will have line numbers. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/ulink.footnotes.xml0000664000175000017500000000236113160023043031216 0ustar bdbaddogbdbaddog ulink.footnotes boolean ulink.footnotes Generate footnotes for ulinks? Description If non-zero, and if ulink.show also is non-zero, the URL of each ulink will appear as a footnote. DocBook 5 does not have an ulink element. When processing DocBoook 5 documents, ulink.footnotes applies to all inline elements that are marked up with xlink:href attributes that point to external resources. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/email.delimiters.enabled.xml0000664000175000017500000000212313160023042032670 0ustar bdbaddogbdbaddog email.delimiters.enabled boolean email.delimiters.enabled Generate delimiters around email addresses? Description If non-zero, delimiters For delimiters, the stylesheets are currently hard-coded to output angle brackets. are generated around e-mail addresses (the output of the email element). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.cell.border.color.xml0000664000175000017500000000277713160023043032466 0ustar bdbaddogbdbaddog table.cell.border.color color table.cell.border.color Specifies the border color of table cells black Description Set the color of table cell borders. If non-zero, the value is used for the border coloration. See CSS. A color is either a keyword or a numerical RGB specification. Keywords are aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and yellow. To control properties of cell borders in HTML output, you must also turn on the table.borders.with.css parameter. ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.hyphenate.computer.inlines.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.hyphenate.computer.inlin0000664000175000017500000000357613160023042032772 0ustar bdbaddogbdbaddog man.hyphenate.computer.inlines boolean man.hyphenate.computer.inlines Hyphenate computer inlines? 0 Description If zero (the default), hyphenation is suppressed for computer inlines such as environment variables, constants, etc. This parameter current affects output of the following elements: classname constant envar errorcode option replaceable userinput type varname If hyphenation is already turned off globally (that is, if man.hyphenate is zero, setting the man.hyphenate.computer.inlines is not necessary. If man.hyphenate.computer.inlines is non-zero, computer inlines will not be treated specially and will be hyphenated like other words when needed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.cellspacing.xml0000664000175000017500000000172713160023042031310 0ustar bdbaddogbdbaddog html.cellspacing integer html.cellspacing Default value for cellspacing in HTML tables Description If non-zero, this value will be used as the default cellspacing value in HTML tables. nn for pixels or nn% for percentage length. E.g. 5 or 5% scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.image.xml0000664000175000017500000000151013160023043027716 0ustar bdbaddogbdbaddog toc.image filename toc.image ToC image active/nav-toc.png Description Specifies the filename of the ToC navigation icon. ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.remember.window.position.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.remember.window.pos0000664000175000017500000000172013160023042032773 0ustar bdbaddogbdbaddog htmlhelp.remember.window.position boolean htmlhelp.remember.window.position Remember help window position? Description Set to non-zero to remember help window position between starts. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.media-type.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunker.output.media-type.xm0000664000175000017500000000275713160023042032744 0ustar bdbaddogbdbaddog chunker.output.media-type string chunker.output.media-type Media type to use in generated pages Description This parameter specifies the media type that should be used by the chunking stylesheet. Not all processors support specification of this parameter. This parameter specifies the media type that should be used by the chunking stylesheet. This should be one from those defined in [RFC2045] and [RFC2046] This parameter is documented here, but the declaration is actually in the chunker.xsl stylesheet module. It must be one from html, xml or text scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/procedure.properties.xml0000664000175000017500000000200013160023043032226 0ustar bdbaddogbdbaddog procedure.properties attribute set procedure.properties Properties associated with a procedure auto Description The styling for procedures. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.output.quietly.xml0000664000175000017500000000241513160023042031661 0ustar bdbaddogbdbaddog man.output.quietly boolean man.output.quietly Suppress filename messages emitted when generating output? Description If zero (the default), for each man-page file created, a message with the name of the file is emitted. If non-zero, the files are output "quietly" -- that is, the filename messages are suppressed. If you are processing a large amount of refentry content, you may be able to speed up processing significantly by setting a non-zero value for man.output.quietly. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/region.after.extent.xml0000664000175000017500000000164013160023043031745 0ustar bdbaddogbdbaddog region.after.extent length region.after.extent Specifies the height of the footer. 0.4in Description The region after extent is the height of the area where footers are printed. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/points.per.em.xml0000664000175000017500000000174113160023043030557 0ustar bdbaddogbdbaddog points.per.em number points.per.em Specify the nominal size of an em-space in points 10 Description The fixed value used for calculations based upon the size of a character. The assumption made is that ten point font is in use. This assumption may not be valid. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/htmlhelp.map.file.xml0000664000175000017500000000165213160023042031365 0ustar bdbaddogbdbaddog htmlhelp.map.file string htmlhelp.map.file Filename of map file. context.h Description Set the name of map file. The default is context.h. (used for context-sensitive help). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.font.funcprototype.xml0000664000175000017500000000206413160023042032514 0ustar bdbaddogbdbaddog man.font.funcprototype string man.font.funcprototype Specifies font for funcprototype output BI Description The man.font.funcprototype parameter specifies the font for funcprototype output. It should be a valid roff font name, such as BI or B. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/default.float.class.xml0000664000175000017500000000221413160023042031705 0ustar bdbaddogbdbaddog default.float.class string default.float.class Specifies the default float class left before Description Selects the direction in which a float should be placed. for xsl-fo this is before, for html it is left. For Western texts, the before direction is the top of the page. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/arbortext.extensions.xml0000664000175000017500000000200513160023042032257 0ustar bdbaddogbdbaddog arbortext.extensions boolean arbortext.extensions Enable Arbortext extensions? Description If non-zero, Arbortext extensions will be used. This parameter can also affect which graphics file formats are supported scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/part.autolabel.xml0000664000175000017500000000453113160023043030773 0ustar bdbaddogbdbaddog part.autolabel list 0none 11,2,3... AA,B,C... aa,b,c... ii,ii,iii... II,II,III... part.autolabel Specifies the labeling format for Part titles I Description If non-zero, then parts will be numbered using the parameter value as the number format if the value matches one of the following: 1 or arabic Arabic numeration (1, 2, 3 ...). A or upperalpha Uppercase letter numeration (A, B, C ...). a or loweralpha Lowercase letter numeration (a, b, c ...). I or upperroman Uppercase roman numeration (I, II, III ...). i or lowerroman Lowercase roman letter numeration (i, ii, iii ...). Any nonzero value other than the above will generate the default number format (upperroman). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/use.id.function.xml0000664000175000017500000000225313160023043031070 0ustar bdbaddogbdbaddog use.id.function boolean use.id.function Use the XPath id() function to find link targets? Description If 1, the stylesheets use the id() function to find the targets of cross reference elements. This is more efficient, but only works if your XSLT processor implements the id() function, naturally. THIS PARAMETER IS NOT SUPPORTED. IT IS ALWAYS ASSUMED TO BE 1. SEE xref.xsl IF YOU NEED TO TURN IT OFF. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.defaultcolumn.xml0000664000175000017500000000202713160023042032357 0ustar bdbaddogbdbaddog callout.defaultcolumn integer callout.defaultcolumn Indicates what column callouts appear in by default 60 Description If a callout does not identify a column (for example, if it uses the linerange unit), it will appear in the default column. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/admonition.properties.xml0000664000175000017500000000170413160023042032410 0ustar bdbaddogbdbaddog admonition.properties attribute set admonition.properties To set the style for admonitions. Description How do you want admonitions styled? Set the font-size, weight, etc. to the style required scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/multiframe.xml0000664000175000017500000000221113160023043030214 0ustar bdbaddogbdbaddog multiframe boolean multiframe Use multiple frames for slide bodies? Description If non-zero, multiple frames are used for the body of each slide. This is one way of forcing the slide navigation elements to appear in constant locations. The other way is with overlays. The overlay and multiframe parameters are mutually exclusive. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.attribute.xml0000664000175000017500000000225013160023043031514 0ustar bdbaddogbdbaddog profile.attribute string profile.attribute Name of user-specified profiling attribute Description This parameter is used in conjuction with profile.value. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.bg.color.xml0000664000175000017500000000154113160023043030345 0ustar bdbaddogbdbaddog toc.bg.color color toc.bg.color Background color for ToC frame #FFFFFF Description Specifies the background color used in the ToC frame. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/admon.graphics.path.xml0000664000175000017500000000202313160023042031677 0ustar bdbaddogbdbaddog admon.graphics.path string admon.graphics.path Path to admonition graphics images/ Description Sets the path to the directory containing the admonition graphics (caution.png, important.png etc). This location is normally relative to the output html directory. See base.dir ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.graphics.extension.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.graphics.extension.x0000664000175000017500000000265013160023042033001 0ustar bdbaddogbdbaddog callout.graphics.extension string callout.graphics.extension Filename extension for callout graphics .png .svg Description Sets the filename extension to use on callout graphics. The Docbook XSL distribution provides callout graphics in the following formats: SVG (extension: .svg) PNG (extension: .png) GIF (extension: .gif) scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/feedback.with.ids.xml0000664000175000017500000000201013160023042031317 0ustar bdbaddogbdbaddog feedback.with.ids boolean feedback.with.ids Toggle use of IDs in feedback Description If feedback.with.ids is non-zero, the ID of the current page will be added to the feedback link. This can be used, for example, if the feedback.href is a CGI script. ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/l10n.gentext.use.xref.language.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/l10n.gentext.use.xref.langua0000664000175000017500000000351213160023042032507 0ustar bdbaddogbdbaddog l10n.gentext.use.xref.language boolean l10n.gentext.use.xref.language Use the language of target when generating cross-reference text? Description If non-zero, the language of the target will be used when generating cross reference text. Usually, the current language is used when generating text (that is, the language of the element that contains the cross-reference element). But setting this parameter allows the language of the element pointed to to control the generated text. Consider the following example: <para lang="en">See also <xref linkend="chap3"/>.</para> Suppose that Chapter 3 happens to be written in German. If l10n.gentext.use.xref.language is non-zero, the resulting text will be something like this:
        See also Kapital 3.
        Where the more traditional rendering would be:
        See also Chapter 3.
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/blockquote.properties.xml0000664000175000017500000000250113160023042032413 0ustar bdbaddogbdbaddog blockquote.properties attribute set blockquote.properties To set the style for block quotations. 0.5in 0.5in 0.5em 1em 2em Description The blockquote.properties attribute set specifies the formating properties of block quotations. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.spacer.image.xml0000664000175000017500000000176213160023043031203 0ustar bdbaddogbdbaddog toc.spacer.image filename toc.spacer.image The image for spacing the TOC graphics/blank.gif Description If toc.spacer.graphic is non-zero, this image will be used to indent the TOC. Only applies with the tabular presentation is being used. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/html.extra.head.links.xml0000664000175000017500000000214613160023042032162 0ustar bdbaddogbdbaddog html.extra.head.links boolean html.extra.head.links Toggle extra HTML head link information Description If non-zero, extra link elements will be generated in the head of chunked HTML files. These extra links point to chapters, appendixes, sections, etc. as supported by the Site Navigation Bar in Mozilla 1.0 (as of CR1, at least). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/index.number.separator.xml0000664000175000017500000000363113160023042032452 0ustar bdbaddogbdbaddog index.number.separator string index.number.separator Override for punctuation separating page numbers in index Description This parameter permits you to override the text to insert between page references in a formatted index entry. Typically that would be a comma and a space. Because this text may be locale dependent, this parameter's value is normally taken from a gentext template named 'number-separator' in the context 'index' in the stylesheet locale file for the language of the current document. This parameter can be used to override the gentext string, and would typically be used on the command line. This parameter would apply to all languages. So this text string can be customized in two ways. You can reset the default gentext string using the local.l10n.xml parameter, or you can override the gentext with the content of this parameter. The content can be a simple string, or it can be something more complex such as a call-template. In HTML index output, section title references are used instead of page number references. This punctuation appears between such section titles in an HTML index. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/table.cell.padding.xml0000664000175000017500000000215413160023043031467 0ustar bdbaddogbdbaddog table.cell.padding attribute set table.cell.padding Specifies the padding of table cells 2pt 2pt 2pt 2pt Description Specifies the padding of table cells. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/javahelp.encoding.xml0000664000175000017500000000176713160023042031444 0ustar bdbaddogbdbaddog javahelp.encoding string javahelp.encoding Character encoding to use in control files for JavaHelp. iso-8859-1 Description JavaHelp crashes on some characters when written as character references. In that case you can use this parameter to select an appropriate encoding. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/chunk.append.xml0000664000175000017500000000222013160023042030424 0ustar bdbaddogbdbaddog chunk.append string chunk.append Specifies content to append to chunked HTML output Description Specifies content to append to the end of HTML files output by the html/chunk.xsl stylesheet, after the closing <html> tag. You probably don’t want to set any value for this parameter; but if you do, the only value it should ever be set to is a newline character: &#x0a; or &#10; scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/page.margin.outer.xml0000664000175000017500000000344213160023043031403 0ustar bdbaddogbdbaddog page.margin.outer length page.margin.outer The outer page margin 0.75in 1in Description The outer page margin is the distance from non-bound edge of the page to the outer edge of the last column of text. In left-to-right text direction, this is the right margin of recto (front side) pages. For single-sided output, it is the right margin of all pages. In right-to-left text direction, this is the left margin of recto pages. For single-sided output, this is the left margin of all pages. Current versions (at least as of version 4.13) of the XEP XSL-FO processor do not correctly handle these margin settings for documents with right-to-left text direction. The workaround in that situation is to reverse the values for page.margin.inner and page.margin.outer, until this bug is fixed by RenderX. It does not affect documents with left-to-right text direction. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/menuchoice.separator.xml0000664000175000017500000000215513160023043032174 0ustar bdbaddogbdbaddog menuchoice.separator string menuchoice.separator Separator between items of a menuchoice other than guimenuitem and guisubmenu + Description Separator used to connect items of a menuchoice other than guimenuitem and guisubmenu. The latter elements are linked with menuchoice.menu.separator. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/callout.list.table.xml0000664000175000017500000000227313160023042031561 0ustar bdbaddogbdbaddog callout.list.table boolean callout.list.table Present callout lists using a table? Description The default presentation of calloutlists uses an HTML DL element. Some browsers don't align DLs very well if callout.graphics is used. With this option turned on, calloutlists are presented in an HTML TABLE, which usually results in better alignment of the callout number with the callout description. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/qanda.defaultlabel.xml0000664000175000017500000000555213160023043031571 0ustar bdbaddogbdbaddog qanda.defaultlabel list number qanda none qanda.defaultlabel Sets the default for defaultlabel on QandASet. number Description If no defaultlabel attribute is specified on a qandaset, this value is used. It is generally one of the legal values for the defaultlabel attribute (none, number or qanda), or one of the additional stylesheet-specific values (qnumber or qnumberanda). The default value is 'number'. The values are rendered as follows: qanda questions are labeled "Q:" and answers are labeled "A:". number The questions are enumerated and the answers are not labeled. qnumber The questions are labeled "Q:" followed by a number, and answers are not labeled. When sections are numbered, adding a label to the number distinguishes the question numbers from the section numbers. This value is not allowed in the defaultlabel attribute of a qandaset element. qnumberanda The questions are labeled "Q:" followed by a number, and the answers are labeled "A:". When sections are numbered, adding a label to the number distinguishes the question numbers from the section numbers. This value is not allowed in the defaultlabel attribute of a qandaset element. none No distinguishing label precedes Questions or Answers. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.revision.xml0000664000175000017500000000254013160023043031351 0ustar bdbaddogbdbaddog profile.revision string profile.revision Target profile for revision attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.autolabel.xml0000664000175000017500000000156313160023043031473 0ustar bdbaddogbdbaddog section.autolabel boolean section.autolabel Are sections enumerated? Description If true (non-zero), unlabeled sections will be enumerated. ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level6.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/section.level6.properties.xm0000664000175000017500000000275713160023043032745 0ustar bdbaddogbdbaddog section.level6.properties attribute set section.level6.properties Properties for level-6 sections Description The properties that apply to the containing block of a level 6 or lower section, and therefore apply to the whole section. This includes section elements at level 6 and lower. For example, you could start each level-6 section on a new page by using: <xsl:attribute-set name="section.level6.properties"> <xsl:attribute name="break-before">page</xsl:attribute> </xsl:attribute-set> This attribute set inherits attributes from the general section.properties attribute set. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/profile.os.xml0000664000175000017500000000247313160023043030141 0ustar bdbaddogbdbaddog profile.os string profile.os Target profile for os attribute Description The value of this parameter specifies profiles which should be included in the output. You can specify multiple profiles by separating them by semicolon. You can change separator character by profile.separator parameter. This parameter has effect only when you are using profiling stylesheets (profile-docbook.xsl, profile-chunk.xsl, …) instead of normal ones (docbook.xsl, chunk.xsl, …). ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/emphasis.propagates.style.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/emphasis.propagates.style.xm0000664000175000017500000000206713160023042033017 0ustar bdbaddogbdbaddog emphasis.propagates.style boolean emphasis.propagates.style Pass emphasis role attribute through to HTML? Description If non-zero, the role attribute of emphasis elements will be passed through to the HTML as a class attribute on a span that surrounds the emphasis. ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/component.titlepage.properties.xmlscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/component.titlepage.properti0000664000175000017500000000232113160023042033073 0ustar bdbaddogbdbaddog component.titlepage.properties attribute set component.titlepage.properties Properties for component titlepages Description The properties that are applied to the outer block containing all the component title page information. Its main use is to set a span="all" property on the block that is a direct child of the flow. This attribute-set also applies to index titlepages. It is empty by default. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/toc.section.depth.xml0000664000175000017500000000165313160023043031413 0ustar bdbaddogbdbaddog toc.section.depth integer toc.section.depth How deep should recursive sections appear in the TOC? 2 Description Specifies the depth to which recursive sections should appear in the TOC. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/man.string.subst.map.xml0000664000175000017500000001531513160023043032053 0ustar bdbaddogbdbaddog man.string.subst.map rtf man.string.subst.map Specifies a set of string substitutions Description The man.string.subst.map parameter contains a map that specifies a set of string substitutions to perform over the entire roff source for each man page, either just before generating final man-page output (that is, before writing man-page files to disk) or, if the value of the man.charmap.enabled parameter is non-zero, before applying the roff character map. You can use man.string.subst.map as a “lightweight†character map to perform “essential†substitutions -- that is, substitutions that are always performed, even if the value of the man.charmap.enabled parameter is zero. For example, you can use it to replace quotation marks or other special characters that are generated by the DocBook XSL stylesheets for a particular locale setting (as opposed to those characters that are actually in source XML documents), or to replace any special characters that may be automatically generated by a particular customization of the DocBook XSL stylesheets. Do you not change value of the man.string.subst.map parameter unless you are sure what you are doing. First consider adding your string-substitution mappings to either or both of the following parameters: man.string.subst.map.local.pre applied before man.string.subst.map man.string.subst.map.local.post applied after man.string.subst.map By default, both of those parameters contain no string substitutions. They are intended as a means for you to specify your own local string-substitution mappings. If you remove any of default mappings from the value of the man.string.subst.map parameter, you are likely to end up with broken output. And be very careful about adding anything to it; it’s used for doing string substitution over the entire roff source of each man page – it causes target strings to be replaced in roff requests and escapes, not just in the visible contents of the page. Contents of the substitution map The string-substitution map contains one or more ss:substitution elements, each of which has two attributes: oldstring string to replace newstring string with which to replace oldstring It may also include XML comments (that is, delimited with "<!--" and "-->"). scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/params/generate.toc.xml0000664000175000017500000000710413160023042030432 0ustar bdbaddogbdbaddog generate.toc table generate.toc Control generation of ToCs and LoTs appendix toc,title article/appendix nop article toc,title book toc,title,figure,table,example,equation chapter toc,title part toc,title preface toc,title qandadiv toc qandaset toc reference toc,title sect1 toc sect2 toc sect3 toc sect4 toc sect5 toc section toc set toc,title /appendix toc,title article/appendix nop /article toc,title book toc,title,figure,table,example,equation /chapter toc,title part toc,title /preface toc,title reference toc,title /sect1 toc /sect2 toc /sect3 toc /sect4 toc /sect5 toc /section toc set toc,title Description This parameter has a structured value. It is a table of space-delimited path/value pairs. Each path identifies some element in the source document using a restricted subset of XPath (only the implicit child axis, no wildcards, no predicates). Paths can be either relative or absolute. When processing a particular element, the stylesheets consult this table to determine if a ToC (or LoT(s)) should be generated. For example, consider the entry: book toc,figure This indicates that whenever a book is formatted, a Table Of Contents and a List of Figures should be generated. Similarly, /chapter toc indicates that whenever a document that has a root of chapter is formatted, a Table of Contents should be generated. The entry chapter would match all chapters, but /chapter matches only chapter document elements. Generally, the longest match wins. So, for example, if you want to distinguish articles in books from articles in parts, you could use these two entries: book/article toc,figure part/article toc Note that an article in a part can never match a book/article, so if you want nothing to be generated for articles in parts, you can simply leave that rule out. If you want to leave the rule in, to make it explicit that you're turning something off, use the value nop. For example, the following entry disables ToCs and LoTs for articles: article nop Do not simply leave the word article in the file without a matching value. That'd be just begging the silly little path/value parser to get confused. Section ToCs are further controlled by the generate.section.toc.level parameter. For a given section level to have a ToC, it must have both an entry in generate.toc and be within the range enabled by generate.section.toc.level. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/0000775000175000017500000000000013160023041024777 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/bin/0000775000175000017500000000000013160023041025547 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/bin/dbtoepub0000664000175000017500000000524613160023041027305 0ustar bdbaddogbdbaddog#!/usr/bin/env ruby # This program converts DocBook documents into .epub files. # # Usage: dbtoepub [OPTIONS] [DocBook Files] # # .epub is defined by the IDPF at www.idpf.org and is made up of 3 standards: # - Open Publication Structure (OPS) # - Open Packaging Format (OPF) # - Open Container Format (OCF) # # Specific options: # -c, --css [FILE] Use FILE for CSS on generated XHTML. # -d, --debug Show debugging output. # -f, --font [OTF FILE] Embed OTF FILE in .epub. # -h, --help Display usage info. # -s, --stylesheet [XSL FILE] Use XSL FILE as a customization # layer (imports epub/docbook.xsl). # -v, --verbose Make output verbose. lib = File.expand_path(File.join(File.dirname(src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/bin/dbtoepub), 'lib')) $LOAD_PATH.unshift(lib) if File.exist?(lib) require 'fileutils' require 'optparse' require 'tmpdir' require 'docbook' verbose = false debug = false css_file = nil otf_files = [] customization_layer = nil output_file = nil #$DEBUG=true # Set up the OptionParser opts = OptionParser.new opts.banner = "Usage: #{File.basename($0)} [OPTIONS] [DocBook Files] #{File.basename($0)} converts DocBook and
        s into to .epub files. .epub is defined by the IDPF at www.idpf.org and is made up of 3 standards: - Open Publication Structure (OPS) - Open Packaging Format (OPF) - Open Container Format (OCF) Specific options:" opts.on("-c", "--css [FILE]", "Use FILE for CSS on generated XHTML.") {|f| css_file = f} opts.on("-d", "--debug", "Show debugging output.") {debug = true; verbose = true} opts.on("-f", "--font [OTF FILE]", "Embed OTF FILE in .epub.") {|f| otf_files << f} opts.on("-h", "--help", "Display usage info.") {puts opts.to_s; exit 0} opts.on("-o", "--output [OUTPUT FILE]", "Output ePub file as OUTPUT FILE.") {|f| output_file = f} opts.on("-s", "--stylesheet [XSL FILE]", "Use XSL FILE as a customization layer (imports epub/docbook.xsl).") {|f| customization_layer = f} opts.on("-v", "--verbose", "Make output verbose.") {verbose = true} db_files = opts.parse(ARGV) if db_files.size == 0 puts opts.to_s exit 0 end db_files.each {|docbook_file| dir = File.expand_path(File.join(Dir.tmpdir, ".epubtmp#{Time.now.to_f.to_s}")) FileUtils.mkdir_p(dir) e = DocBook::Epub.new(docbook_file, dir, css_file, customization_layer, otf_files) if output_file epub_file = output_file else epub_file = File.basename(docbook_file, ".xml") + ".epub" end puts "Rendering DocBook file #{docbook_file} to #{epub_file}" if verbose e.render_to_file(epub_file) } scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/bin/xslt/0000775000175000017500000000000013160023041026541 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/bin/xslt/obfuscate.xsl0000664000175000017500000000113013160023041031237 0ustar bdbaddogbdbaddog scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/bin/lib/0000775000175000017500000000000013160023041026315 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/bin/lib/docbook.rb0000664000175000017500000002023413160023041030263 0ustar bdbaddogbdbaddogrequire 'fileutils' require 'rexml/parsers/pullparser' module DocBook class Epub CHECKER = "epubcheck" STYLESHEET = File.expand_path(File.join(File.dirname(src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/bin/lib/docbook.rb), '..', '..', "docbook.xsl")) CALLOUT_PATH = File.join('images', 'callouts') CALLOUT_FULL_PATH = File.expand_path(File.join(File.dirname(src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/bin/lib/docbook.rb), '..', '..', '..', CALLOUT_PATH)) CALLOUT_LIMIT = 15 CALLOUT_EXT = ".png" XSLT_PROCESSOR = "xsltproc" OUTPUT_DIR = ".epubtmp#{Time.now.to_f.to_s}" MIMETYPE = "application/epub+zip" META_DIR = "META-INF" OEBPS_DIR = "OEBPS" ZIPPER = "zip" attr_reader :output_dir def initialize(docbook_file, output_dir=OUTPUT_DIR, css_file=nil, customization_layer=nil, embedded_fonts=[]) @docbook_file = docbook_file @output_dir = output_dir @meta_dir = File.join(@output_dir, META_DIR) @oebps_dir = File.join(@output_dir, OEBPS_DIR) @css_file = css_file ? File.expand_path(css_file) : css_file @embedded_fonts = embedded_fonts @to_delete = [] if customization_layer @stylesheet = File.expand_path(customization_layer) else @stylesheet = STYLESHEET end unless File.exist?(@docbook_file) raise ArgumentError.new("File #{@docbook_file} does not exist") end end def render_to_file(output_file, verbose=false) render_to_epub(output_file, verbose) bundle_epub(output_file, verbose) cleanup_files(@to_delete) end def self.invalid?(file) # Obnoxiously, we can't just check for a non-zero output... cmd = %Q(#{CHECKER} "#{file}") output = `#{cmd} 2>&1` if $?.to_i == 0 return false else STDERR.puts output if $DEBUG return output end end private def render_to_epub(output_file, verbose) @collapsed_docbook_file = collapse_docbook() chunk_quietly = "--stringparam chunk.quietly " + (verbose ? '0' : '1') callout_path = "--stringparam callout.graphics.path #{CALLOUT_PATH}/" callout_limit = "--stringparam callout.graphics.number.limit #{CALLOUT_LIMIT}" callout_ext = "--stringparam callout.graphics.extension #{CALLOUT_EXT}" html_stylesheet = "--stringparam html.stylesheet #{File.basename(@css_file)}" if @css_file base = "--stringparam base.dir #{OEBPS_DIR}/" unless @embedded_fonts.empty? embedded_fonts = @embedded_fonts.map {|f| File.basename(f)}.join(',') font = "--stringparam epub.embedded.fonts \"#{embedded_fonts}\"" end meta = "--stringparam epub.metainf.dir #{META_DIR}/" oebps = "--stringparam epub.oebps.dir #{OEBPS_DIR}/" options = [chunk_quietly, callout_path, callout_limit, callout_ext, base, font, meta, oebps, html_stylesheet, ].join(" ") # Double-quote stylesheet & file to help Windows cmd.exe db2epub_cmd = %Q(cd "#{@output_dir}" && #{XSLT_PROCESSOR} #{options} "#{@stylesheet}" "#{@collapsed_docbook_file}") STDERR.puts db2epub_cmd if $DEBUG success = system(db2epub_cmd) raise "Could not render as .epub to #{output_file} (#{db2epub_cmd})" unless success @to_delete << Dir["#{@meta_dir}/*"] @to_delete << Dir["#{@oebps_dir}/*"] end def bundle_epub(output_file, verbose) quiet = verbose ? "" : "-q" mimetype_filename = write_mimetype() meta = File.basename(@meta_dir) oebps = File.basename(@oebps_dir) images = copy_images() csses = copy_csses() fonts = copy_fonts() callouts = copy_callouts() # zip -X -r ../book.epub mimetype META-INF OEBPS # Double-quote stylesheet & file to help Windows cmd.exe zip_cmd = %Q(cd "#{@output_dir}" && #{ZIPPER} #{quiet} -X -r "#{File.expand_path(output_file)}" "#{mimetype_filename}" "#{meta}" "#{oebps}") puts zip_cmd if $DEBUG success = system(zip_cmd) raise "Could not bundle into .epub file to #{output_file}" unless success end # Input must be collapsed because REXML couldn't find figures in files that # were XIncluded or added by ENTITY # http://sourceforge.net/tracker/?func=detail&aid=2750442&group_id=21935&atid=373747 def collapse_docbook # Double-quote stylesheet & file to help Windows cmd.exe collapsed_file = File.join(File.expand_path(File.dirname(@docbook_file)), '.collapsed.' + File.basename(@docbook_file)) entity_collapse_command = %Q(xmllint --loaddtd --noent -o "#{collapsed_file}" "#{@docbook_file}") entity_success = system(entity_collapse_command) raise "Could not collapse named entites in #{@docbook_file}" unless entity_success xinclude_collapse_command = %Q(xmllint --xinclude -o "#{collapsed_file}" "#{collapsed_file}") xinclude_success = system(xinclude_collapse_command) raise "Could not collapse XIncludes in #{@docbook_file}" unless xinclude_success @to_delete << collapsed_file return collapsed_file end def copy_callouts new_callout_images = [] if has_callouts? calloutglob = "#{CALLOUT_FULL_PATH}/*#{CALLOUT_EXT}" Dir.glob(calloutglob).each {|img| img_new_filename = File.join(@oebps_dir, CALLOUT_PATH, File.basename(img)) # TODO: What to rescue for these two? FileUtils.mkdir_p(File.dirname(img_new_filename)) FileUtils.cp(img, img_new_filename) @to_delete << img_new_filename new_callout_images << img } end return new_callout_images end def copy_fonts new_fonts = [] @embedded_fonts.each {|font_file| font_new_filename = File.join(@oebps_dir, File.basename(font_file)) FileUtils.cp(font_file, font_new_filename) new_fonts << font_file } return new_fonts end def copy_csses if @css_file css_new_filename = File.join(@oebps_dir, File.basename(@css_file)) FileUtils.cp(@css_file, css_new_filename) end end def copy_images image_references = get_image_refs() new_images = [] image_references.each {|img| # TODO: It'd be cooler if we had a filetype lookup rather than just # extension if img =~ /\.(svg|png|gif|jpe?g|xml)/i img_new_filename = File.join(@oebps_dir, img) img_full = File.join(File.expand_path(File.dirname(@docbook_file)), img) # TODO: What to rescue for these two? FileUtils.mkdir_p(File.dirname(img_new_filename)) puts(img_full + ": " + img_new_filename) if $DEBUG FileUtils.cp(img_full, img_new_filename) @to_delete << img_new_filename new_images << img_full end } return new_images end def write_mimetype mimetype_filename = File.join(@output_dir, "mimetype") File.open(mimetype_filename, "w") {|f| f.print MIMETYPE} @to_delete << mimetype_filename return File.basename(mimetype_filename) end def cleanup_files(file_list) file_list.flatten.each {|f| # Yikes FileUtils.rm_r(f, :force => true ) } end # Returns an Array of all of the (image) @filerefs in a document def get_image_refs parser = REXML::Parsers::PullParser.new(File.new(@collapsed_docbook_file)) image_refs = [] while parser.has_next? el = parser.pull if el.start_element? and (el[0] == "imagedata" or el[0] == "graphic") image_refs << el[1]['fileref'] end end return image_refs.uniq end # Returns true if the document has code callouts def has_callouts? parser = REXML::Parsers::PullParser.new(File.new(@collapsed_docbook_file)) while parser.has_next? el = parser.pull if el.start_element? and (el[0] == "calloutlist" or el[0] == "co") return true end end return false end end end scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/README0000664000175000017500000000704513160023041025665 0ustar bdbaddogbdbaddog---------------------------------------------------------------------- README file for the DocBook XSL Stylesheets ---------------------------------------------------------------------- These are XSL stylesheets for transforming DocBook XML document instances into .epub format. .epub is an open standard of the The International Digital Publishing Forum (IDPF), a the trade and standards association for the digital publishing industry. An alpha-quality reference implementation (dbtoepub) for a DocBook to .epub converter (written in Ruby) is available under bin/. From http://idpf.org What is EPUB, .epub, OPS/OCF & OEB? ".epub" is the file extension of an XML format for reflowable digital books and publications. ".epub" is composed of three open standards, the Open Publication Structure (OPS), Open Packaging Format (OPF) and Open Container Format (OCF), produced by the IDPF. "EPUB" allows publishers to produce and send a single digital publication file through distribution and offers consumers interoperability between software/hardware for unencrypted reflowable digital books and other publications. The Open eBook Publication Structure or "OEB", originally produced in 1999, is the precursor to OPS. ---------------------------------------------------------------------- .epub Constraints ---------------------------------------------------------------------- .epub does not support all of the image formats that DocBook supports. When an image is available in an accepted format, it will be used. The accepted @formats are: 'GIF','GIF87a','GIF89a','JPEG','JPG','PNG','SVG' A mime-type for the image will be guessed from the file extension, which may not work if your file extensions are non-standard. Non-supported elements: * * , , , with text/XML @filerefs * * in lists (generic XHTML rendering inability) * (just make your programlistings siblings, rather than descendents of paras) ---------------------------------------------------------------------- dbtoepub Reference Implementation ---------------------------------------------------------------------- An alpha-quality DocBook to .epub conversion program, dbtoepub, is provided in bin/dbtoepub. This tool requires: - 'xsltproc' in your PATH - 'zip' in your PATH - Ruby 1.8.4+ Windows compatibility has not been extensively tested; bug reports encouraged. [See http://www.zlatkovic.com/libxml.en.html and http://unxutils.sourceforge.net/] $ dbtoepub --help Usage: dbtoepub [OPTIONS] [DocBook Files] dbtoepub converts DocBook and
        s into to .epub files. .epub is defined by the IDPF at www.idpf.org and is made up of 3 standards: - Open Publication Structure (OPS) - Open Packaging Format (OPF) - Open Container Format (OCF) Specific options: -d, --debug Show debugging output. -h, --help Display usage info -v, --verbose Make output verbose ---------------------------------------------------------------------- Validation ---------------------------------------------------------------------- The epubcheck project provides limited validation for .epub documents. See http://code.google.com/p/epubcheck/ for details. ---------------------------------------------------------------------- Copyright information ---------------------------------------------------------------------- See the accompanying file named COPYING. scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/epub/docbook.xsl0000664000175000017500000022052413160023041027154 0ustar bdbaddogbdbaddog 1 2 book toc,title 4 ncxtoc htmltoc 0 .png 1 1 1 1 0 Note namesp. cut stripped namespace before processing Note namesp. cut processing stripped document ID ' ' not found in document. Formatting from urn: : urn:isbn: urn:issn: _ 2.0 cover 1.0 application/oebps-package+xml 2005-1 cover dtb:uid : : © cover Cover toc Table of Contents yes no yes application/x-dtbncx+xml application/xhtml+xml text/css css application/xhtml+xml image/gif image/gif image/png image/png image/jpeg image/jpeg image/jpeg image/jpeg image/svg+xml image/svg+xml WARNING: mediaobjectco almost certainly will not render as expected in .epub! application/xhtml+xml (missing alt) text-align: middle 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 No insertfile extension available. No insertfile extension available. Use a different processor (with extensions) or turn on $use.extensions and $textinsert.extension (see docs for more). Cover text/css img { max-width: 100%; } -toc font/opentype WARNING: OpenType fonts should be supplied! ( ) 6 clear: both 1 1 1 2 3 4 5 6 5 4 3 2 1 title scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/COPYING0000664000175000017500000000365013160023041025103 0ustar bdbaddogbdbaddogCopyright --------- Copyright (C) 1999-2007 Norman Walsh Copyright (C) 2003 Jiří Kosek Copyright (C) 2004-2007 Steve Ball Copyright (C) 2005-2008 The DocBook Project Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Except as contained in this notice, the names of individuals credited with contribution to this software shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the individuals in question. Any stylesheet derived from this Software that is publically distributed will be identified with a different name and the version strings in any derived Software will be changed so that no possibility of confusion between the derived package and this Software will exist. Warranty -------- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Contacting the Author --------------------- The DocBook XSL stylesheets are maintained by Norman Walsh, , and members of the DocBook Project, scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/eclipse/0000775000175000017500000000000013160023041025470 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/eclipse/eclipse3.xsl0000664000175000017500000000757413160023041027744 0ustar bdbaddogbdbaddog 1 1 Manifest-Version: 1.0 Bundle-Version: 1.0 Bundle-Name: Bundle-SymbolicName: Bundle-Vendor: scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/eclipse/profile-eclipse.xsl0000664000175000017500000002767213160023041031320 0ustar bdbaddogbdbaddog Note: namesp. cut : stripped namespace before processingNote: namesp. cut : processing stripped document ID ' ' not found in document. Formatting from ( ) scons-src-3.0.0/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/eclipse/eclipse.xsl0000664000175000017500000002763613160023041027662 0ustar bdbaddogbdbaddog Note namesp. cut stripped namespace before processing Note namesp. cut processing stripped document ID ' ' not found in document. Formatting from ( ) scons-src-3.0.0/src/engine/SCons/Tool/docbook/__init__.py0000664000175000017500000007240413160023041023210 0ustar bdbaddogbdbaddog """SCons.Tool.docbook Tool-specific initialization for Docbook. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # import os import glob import re import SCons.Action import SCons.Builder import SCons.Defaults import SCons.Script import SCons.Tool import SCons.Util __debug_tool_location = False # Get full path to this script scriptpath = os.path.dirname(os.path.realpath(__file__)) # Local folder for the collection of DocBook XSLs db_xsl_folder = 'docbook-xsl-1.76.1' # Do we have libxml2/libxslt/lxml? has_libxml2 = True has_lxml = True try: import libxml2 import libxslt except: has_libxml2 = False try: import lxml except: has_lxml = False # Set this to True, to prefer xsltproc over libxml2 and lxml prefer_xsltproc = False # Regexs for parsing Docbook XML sources of MAN pages re_manvolnum = re.compile("([^<]*)") re_refname = re.compile("([^<]*)") # # Helper functions # def __extend_targets_sources(target, source): """ Prepare the lists of target and source files. """ if not SCons.Util.is_List(target): target = [target] if not source: source = target[:] elif not SCons.Util.is_List(source): source = [source] if len(target) < len(source): target.extend(source[len(target):]) return target, source def __init_xsl_stylesheet(kw, env, user_xsl_var, default_path): if kw.get('DOCBOOK_XSL','') == '': xsl_style = kw.get('xsl', env.subst(user_xsl_var)) if xsl_style == '': path_args = [scriptpath, db_xsl_folder] + default_path xsl_style = os.path.join(*path_args) kw['DOCBOOK_XSL'] = xsl_style def __select_builder(lxml_builder, libxml2_builder, cmdline_builder): """ Selects a builder, based on which Python modules are present. """ if prefer_xsltproc: return cmdline_builder if not has_libxml2: # At the moment we prefer libxml2 over lxml, the latter can lead # to conflicts when installed together with libxml2. if has_lxml: return lxml_builder else: return cmdline_builder return libxml2_builder def __ensure_suffix(t, suffix): """ Ensure that the target t has the given suffix. """ tpath = str(t) if not tpath.endswith(suffix): return tpath+suffix return t def __ensure_suffix_stem(t, suffix): """ Ensure that the target t has the given suffix, and return the file's stem. """ tpath = str(t) if not tpath.endswith(suffix): stem = tpath tpath += suffix return tpath, stem else: stem, ext = os.path.splitext(tpath) return t, stem def __get_xml_text(root): """ Return the text for the given root node (xml.dom.minidom). """ txt = "" for e in root.childNodes: if (e.nodeType == e.TEXT_NODE): txt += e.data return txt def __create_output_dir(base_dir): """ Ensure that the output directory base_dir exists. """ root, tail = os.path.split(base_dir) dir = None if tail: if base_dir.endswith('/'): dir = base_dir else: dir = root else: if base_dir.endswith('/'): dir = base_dir if dir and not os.path.isdir(dir): os.makedirs(dir) # # Supported command line tools and their call "signature" # xsltproc_com_priority = ['xsltproc', 'saxon', 'saxon-xslt', 'xalan'] # TODO: Set minimum version of saxon-xslt to be 8.x (lower than this only supports xslt 1.0. # see: http://saxon.sourceforge.net/saxon6.5.5/ # see: http://saxon.sourceforge.net/ xsltproc_com = {'xsltproc' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE', 'saxon' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS', 'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS', 'xalan' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE'} xmllint_com = {'xmllint' : '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'} fop_com = {'fop' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -fo $SOURCE -pdf $TARGET', 'xep' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -valid -fo $SOURCE -pdf $TARGET', 'jw' : '$DOCBOOK_FOP $DOCBOOK_FOPFLAGS -f docbook -b pdf $SOURCE -o $TARGET'} def __detect_cl_tool(env, chainkey, cdict, cpriority=None): """ Helper function, picks a command line tool from the list and initializes its environment variables. """ if env.get(chainkey,'') == '': clpath = '' if cpriority is None: cpriority = cdict.keys() for cltool in cpriority: if __debug_tool_location: print("DocBook: Looking for %s"%cltool) clpath = env.WhereIs(cltool) if clpath: if __debug_tool_location: print("DocBook: Found:%s"%cltool) env[chainkey] = clpath if not env[chainkey + 'COM']: env[chainkey + 'COM'] = cdict[cltool] break def _detect(env): """ Detect all the command line tools that we might need for creating the requested output formats. """ global prefer_xsltproc if env.get('DOCBOOK_PREFER_XSLTPROC',''): prefer_xsltproc = True if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc)): # Try to find the XSLT processors __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com, xsltproc_com_priority) __detect_cl_tool(env, 'DOCBOOK_XMLLINT', xmllint_com) __detect_cl_tool(env, 'DOCBOOK_FOP', fop_com, ['fop','xep','jw']) # # Scanners # include_re = re.compile('fileref\\s*=\\s*["|\']([^\\n]*)["|\']') sentity_re = re.compile('') def __xml_scan(node, env, path, arg): """ Simple XML file scanner, detecting local images and XIncludes as implicit dependencies. """ # Does the node exist yet? if not os.path.isfile(str(node)): return [] if env.get('DOCBOOK_SCANENT',''): # Use simple pattern matching for system entities..., no support # for recursion yet. contents = node.get_text_contents() return sentity_re.findall(contents) xsl_file = os.path.join(scriptpath,'utils','xmldepend.xsl') if not has_libxml2 or prefer_xsltproc: if has_lxml and not prefer_xsltproc: from lxml import etree xsl_tree = etree.parse(xsl_file) doc = etree.parse(str(node)) result = doc.xslt(xsl_tree) depfiles = [x.strip() for x in str(result).splitlines() if x.strip() != "" and not x.startswith(" 1: env.Clean(outfiles[0], outfiles[1:]) return result def DocbookSlidesPdf(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for PDF slides output. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_SLIDESPDF', ['slides','fo','plain.xsl']) # Setup builder __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder) # Create targets result = [] for t,s in zip(target,source): t, stem = __ensure_suffix_stem(t, '.pdf') xsl = __builder.__call__(env, stem+'.fo', s, **kw) env.Depends(xsl, kw['DOCBOOK_XSL']) result.extend(xsl) result.extend(__fop_builder.__call__(env, t, xsl, **kw)) return result def DocbookSlidesHtml(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for HTML slides output. """ # Init list of targets/sources if not SCons.Util.is_List(target): target = [target] if not source: source = target target = ['index.html'] elif not SCons.Util.is_List(source): source = [source] # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_SLIDESHTML', ['slides','html','plain.xsl']) # Setup builder __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder) # Detect base dir base_dir = kw.get('base_dir', '') if base_dir: __create_output_dir(base_dir) # Create targets result = [] r = __builder.__call__(env, __ensure_suffix(str(target[0]), '.html'), source[0], **kw) env.Depends(r, kw['DOCBOOK_XSL']) result.extend(r) # Add supporting files for cleanup env.Clean(r, [os.path.join(base_dir, 'toc.html')] + glob.glob(os.path.join(base_dir, 'foil*.html'))) return result def DocbookXInclude(env, target, source, *args, **kw): """ A pseudo-Builder, for resolving XIncludes in a separate processing step. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Setup builder __builder = __select_builder(__xinclude_lxml_builder,__xinclude_libxml2_builder,__xmllint_builder) # Create targets result = [] for t,s in zip(target,source): result.extend(__builder.__call__(env, t, s, **kw)) return result def DocbookXslt(env, target, source=None, *args, **kw): """ A pseudo-Builder, applying a simple XSL transformation to the input file. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet kw['DOCBOOK_XSL'] = kw.get('xsl', 'transform.xsl') # Setup builder __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder) # Create targets result = [] for t,s in zip(target,source): r = __builder.__call__(env, t, s, **kw) env.Depends(r, kw['DOCBOOK_XSL']) result.extend(r) return result def generate(env): """Add Builders and construction variables for docbook to an Environment.""" env.SetDefault( # Default names for customized XSL stylesheets DOCBOOK_DEFAULT_XSL_EPUB = '', DOCBOOK_DEFAULT_XSL_HTML = '', DOCBOOK_DEFAULT_XSL_HTMLCHUNKED = '', DOCBOOK_DEFAULT_XSL_HTMLHELP = '', DOCBOOK_DEFAULT_XSL_PDF = '', DOCBOOK_DEFAULT_XSL_MAN = '', DOCBOOK_DEFAULT_XSL_SLIDESPDF = '', DOCBOOK_DEFAULT_XSL_SLIDESHTML = '', # Paths to the detected executables DOCBOOK_XSLTPROC = '', DOCBOOK_XMLLINT = '', DOCBOOK_FOP = '', # Additional flags for the text processors DOCBOOK_XSLTPROCFLAGS = SCons.Util.CLVar(''), DOCBOOK_XMLLINTFLAGS = SCons.Util.CLVar(''), DOCBOOK_FOPFLAGS = SCons.Util.CLVar(''), DOCBOOK_XSLTPROCPARAMS = SCons.Util.CLVar(''), # Default command lines for the detected executables DOCBOOK_XSLTPROCCOM = xsltproc_com['xsltproc'], DOCBOOK_XMLLINTCOM = xmllint_com['xmllint'], DOCBOOK_FOPCOM = fop_com['fop'], # Screen output for the text processors DOCBOOK_XSLTPROCCOMSTR = None, DOCBOOK_XMLLINTCOMSTR = None, DOCBOOK_FOPCOMSTR = None, ) _detect(env) env.AddMethod(DocbookEpub, "DocbookEpub") env.AddMethod(DocbookHtml, "DocbookHtml") env.AddMethod(DocbookHtmlChunked, "DocbookHtmlChunked") env.AddMethod(DocbookHtmlhelp, "DocbookHtmlhelp") env.AddMethod(DocbookPdf, "DocbookPdf") env.AddMethod(DocbookMan, "DocbookMan") env.AddMethod(DocbookSlidesPdf, "DocbookSlidesPdf") env.AddMethod(DocbookSlidesHtml, "DocbookSlidesHtml") env.AddMethod(DocbookXInclude, "DocbookXInclude") env.AddMethod(DocbookXslt, "DocbookXslt") def exists(env): return 1 scons-src-3.0.0/src/engine/SCons/Tool/docbook/utils/0000775000175000017500000000000013160023044022233 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/utils/xmldepend.xsl0000664000175000017500000001054013160023044024743 0ustar bdbaddogbdbaddog scons-src-3.0.0/src/engine/SCons/Tool/docbook/docs/0000775000175000017500000000000013160023044022023 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/docbook/docs/html.xsl0000664000175000017500000000363513160023044023526 0ustar bdbaddogbdbaddog /appendix toc,title article/appendix nop /article toc,title book toc,title,figure,table,example,equation /chapter toc,title part toc,title /preface toc,title reference toc,title /sect1 toc /sect2 toc /sect3 toc /sect4 toc /sect5 toc /section toc set toc,title scons-src-3.0.0/src/engine/SCons/Tool/docbook/docs/pdf.xsl0000664000175000017500000000420313160023044023323 0ustar bdbaddogbdbaddog 0pt /appendix toc,title article/appendix nop /article toc,title book toc,title,figure,table,example,equation /chapter toc,title part toc,title /preface toc,title reference toc,title /sect1 toc /sect2 toc /sect3 toc /sect4 toc /sect5 toc /section toc set toc,title scons-src-3.0.0/src/engine/SCons/Tool/docbook/docs/SConstruct0000664000175000017500000000253313160023044024060 0ustar bdbaddogbdbaddog# # Copyright (c) 2001-2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import os env = Environment(ENV = os.environ, tools = ['docbook']) env.DocbookPdf('manual', xsl='pdf.xsl') #env.DocbookPdf('reference', xsl='pdf.xsl') env.DocbookHtml('manual', xsl='html.xsl') #env.DocbookHtml('reference', xsl='html.xsl') scons-src-3.0.0/src/engine/SCons/Tool/docbook/docs/manual.xml0000664000175000017500000002610613160023044024027 0ustar bdbaddogbdbaddog
        The SCons Docbook tool Dirk Baechle 2010-12-30
        Basics This tool tries to make working with Docbook in SCons a little easier. It provides several toolchains for creating different output formats, like HTML or PDF. Contained in the package is a distribution of the Docbook XSL stylesheets as of version 1.76.1. As long as you don't specify your own stylesheets for customization (see Selecting stylesheet), these official versions are picked as default...which should reduce the inevitable setup hassles for you. Implicit dependencies to images and XIncludes are detected automatically if you meet the HTML requirements (see Requirements). The additional stylesheet utils/xmldepend.xsl by Paul DuBois is used for this purpose. Note, that there is no support for XML catalog resolving offered! This tool calls the XSLT processors and PDF renderers with the stylesheets you specified, that's it. The rest lies in your hands and you still have to know what you're doing when resolving names via a catalog.
        Install Installing it, requires you to copy (or, even better: checkout) the contents of the package's docbook folder to /path_to_your_project/site_scons/site_tools/docbook, if you need the Docbook Tool in one project only, or ~/.scons/site_scons/site_tools/docbook, for a system-wide installation under your current login. For more infos about this, please refer to the SCons User's Guide, chap. 19.7 "Where to put your custom Builders and Tools" and the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex.
        How to activate For activating the tool "docbook", you have to add its name to the Environment constructor, like this env = Environment(tools=['docbook']) On its startup, the Docbook tool tries to find a required xsltproc processor, and a PDF renderer, e.g. fop. So make sure that these are added to your system's environment PATH and can be called directly, without specifying their full path.
        Requirements For the most basic processing of Docbook to HTML, you need to have installed the Python lxml binding to libxml2, or the direct Python bindings for libxml2/libxslt, or a standalone XSLT processor, currently detected are xsltproc, saxon, saxon-xslt and xalan. Rendering to PDF requires you to have one of the applications fop, xep or jw installed.
        Processing documents Creating a HTML or PDF document is very simple and straightforward. Say env = Environment(tools=['docbook']) env.DocbookHtml('manual.html', 'manual.xml') env.DocbookPdf('manual.pdf', 'manual.xml') to get both outputs from your XML source manual.xml. As a shortcut, you can give the stem of the filenames alone, like this: env = Environment(tools=['docbook']) env.DocbookHtml('manual') env.DocbookPdf('manual') and get the same result. Target and source lists are also supported: env = Environment(tools=['docbook']) env.DocbookHtml(['manual.html','reference.html'], ['manual.xml','reference.xml']) or even env = Environment(tools=['docbook']) env.DocbookHtml(['manual','reference']) Whenever you leave out the list of sources, you may not specify a file extension! The Tool uses the given names as file stems, and adds the suffixes for target and source files accordingly. The rules given above are valid for the Builders DocbookHtml, DocbookPdf, DocbookSlidePdf and DocbookXInclude. For the DocbookMan transformation you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source. Please refer to the section Chunked output for more infos about the other Builders.
        Selecting your own stylesheet If you want to use a specific XSL file, you can set the additional xsl parameter to your Builder call as follows: env.DocbookHtml('other.html', 'manual.xml', xsl='html.xsl') Since this may get tedious if you always use the same local naming for your customized XSL files, e.g. html.xsl for HTML and pdf.xsl for PDF output, a set of variables for setting the default XSL name is provided. These are: DOCBOOK_DEFAULT_XSL_HTML DOCBOOK_DEFAULT_XSL_HTMLCHUNKED DOCBOOK_DEFAULT_XSL_HTMLHELP DOCBOOK_DEFAULT_XSL_PDF DOCBOOK_DEFAULT_XSL_MAN DOCBOOK_DEFAULT_XSL_SLIDESPDF DOCBOOK_DEFAULT_XSL_SLIDESHTML and you can set them when constructing your environment: env = Environment(tools=['docbook'], DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') env.DocbookHtml('manual') # now uses html.xsl
        Chunked output The Builders DocbookHtmlChunked, DocbookHtmlhelp and DocbookSlidesHtml are special, in that: they create a large set of files, where the exact names and their number depend on the content of the source file, and the main target is always named index.html, i.e. the output name for the XSL transformation is not picked up by the stylesheets. As a result, there is simply no use in specifying a target HTML name. So the basic syntax for these builders is: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual') Only if you use the root.filename (titlefoil.html for slides) parameter in your own stylesheets you have to give the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('mymanual.html','manual', xsl='htmlhelp.xsl') Some basic support for the base.dir is added (this has not been properly tested with variant dirs, yet!). You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/') Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only!
        All builders A simple list of all builders currently available: DocbookHtml Single HTML file. DocbookHtmlChunked Chunked HTML files, with support for the base.dir parameter. The chunkfast.xsl file (requires "EXSLT") is used as the default stylesheet. DocbookHtmlhelp Htmlhelp files, with support for base.dir. DocbookPdf PDF output. DocbookMan Man pages. DocbookSlidesPdf Slides in PDF format. DocbookSlidesHtml Slides in HTML format, with support for base.dir. DocbookXInclude Can be used to resolve XIncludes in a preprocessing step.
        Need more? This work is still in a very basic state and hasn't been tested well with things like variant dirs, yet. Unicode problems and poor performance with large input files may occur. There will definitely arise the need for adding features, or a variable. Let us know if you can think of a nice improvement or have worked on a bugfix/patch with success. Enter your issues at the Launchpad bug tracker for the Docbook Tool, or write to the User General Discussion list of SCons at scons-users@scons.org.
        scons-src-3.0.0/src/engine/SCons/Tool/docbook/__init__.xml0000664000175000017500000004357413160023041023366 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> This tool tries to make working with Docbook in SCons a little easier. It provides several toolchains for creating different output formats, like HTML or PDF. Contained in the package is a distribution of the Docbook XSL stylesheets as of version 1.76.1. As long as you don't specify your own stylesheets for customization, these official versions are picked as default...which should reduce the inevitable setup hassles for you. Implicit dependencies to images and XIncludes are detected automatically if you meet the HTML requirements. The additional stylesheet utils/xmldepend.xsl by Paul DuBois is used for this purpose. Note, that there is no support for XML catalog resolving offered! This tool calls the XSLT processors and PDF renderers with the stylesheets you specified, that's it. The rest lies in your hands and you still have to know what you're doing when resolving names via a catalog. For activating the tool "docbook", you have to add its name to the Environment constructor, like this env = Environment(tools=['docbook']) On its startup, the Docbook tool tries to find a required xsltproc processor, and a PDF renderer, e.g. fop. So make sure that these are added to your system's environment PATH and can be called directly, without specifying their full path. For the most basic processing of Docbook to HTML, you need to have installed the Python lxml binding to libxml2, or the direct Python bindings for libxml2/libxslt, or a standalone XSLT processor, currently detected are xsltproc, saxon, saxon-xslt and xalan. Rendering to PDF requires you to have one of the applications fop or xep installed. Creating a HTML or PDF document is very simple and straightforward. Say env = Environment(tools=['docbook']) env.DocbookHtml('manual.html', 'manual.xml') env.DocbookPdf('manual.pdf', 'manual.xml') to get both outputs from your XML source manual.xml. As a shortcut, you can give the stem of the filenames alone, like this: env = Environment(tools=['docbook']) env.DocbookHtml('manual') env.DocbookPdf('manual') and get the same result. Target and source lists are also supported: env = Environment(tools=['docbook']) env.DocbookHtml(['manual.html','reference.html'], ['manual.xml','reference.xml']) or even env = Environment(tools=['docbook']) env.DocbookHtml(['manual','reference']) Whenever you leave out the list of sources, you may not specify a file extension! The Tool uses the given names as file stems, and adds the suffixes for target and source files accordingly. The rules given above are valid for the Builders &b-link-DocbookHtml;, &b-link-DocbookPdf;, &b-link-DocbookEpub;, &b-link-DocbookSlidesPdf; and &b-link-DocbookXInclude;. For the &b-link-DocbookMan; transformation you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source. The Builders &b-link-DocbookHtmlChunked;, &b-link-DocbookHtmlhelp; and &b-link-DocbookSlidesHtml; are special, in that: they create a large set of files, where the exact names and their number depend on the content of the source file, and the main target is always named index.html, i.e. the output name for the XSL transformation is not picked up by the stylesheets. As a result, there is simply no use in specifying a target HTML name. So the basic syntax for these builders is always: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual') If you want to use a specific XSL file, you can set the additional xsl parameter to your Builder call as follows: env.DocbookHtml('other.html', 'manual.xml', xsl='html.xsl') Since this may get tedious if you always use the same local naming for your customized XSL files, e.g. html.xsl for HTML and pdf.xsl for PDF output, a set of variables for setting the default XSL name is provided. These are: DOCBOOK_DEFAULT_XSL_HTML DOCBOOK_DEFAULT_XSL_HTMLCHUNKED DOCBOOK_DEFAULT_XSL_HTMLHELP DOCBOOK_DEFAULT_XSL_PDF DOCBOOK_DEFAULT_XSL_EPUB DOCBOOK_DEFAULT_XSL_MAN DOCBOOK_DEFAULT_XSL_SLIDESPDF DOCBOOK_DEFAULT_XSL_SLIDESHTML and you can set them when constructing your environment: env = Environment(tools=['docbook'], DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') env.DocbookHtml('manual') # now uses html.xsl DOCBOOK_DEFAULT_XSL_HTML DOCBOOK_DEFAULT_XSL_HTMLCHUNKED DOCBOOK_DEFAULT_XSL_HTMLHELP DOCBOOK_DEFAULT_XSL_PDF DOCBOOK_DEFAULT_XSL_EPUB DOCBOOK_DEFAULT_XSL_MAN DOCBOOK_DEFAULT_XSL_SLIDESPDF DOCBOOK_DEFAULT_XSL_SLIDESHTML DOCBOOK_XSLTPROC DOCBOOK_XMLLINT DOCBOOK_FOP DOCBOOK_XSLTPROCFLAGS DOCBOOK_XMLLINTFLAGS DOCBOOK_FOPFLAGS DOCBOOK_XSLTPROCPARAMS DOCBOOK_XSLTPROCCOM DOCBOOK_XMLLINTCOM DOCBOOK_FOPCOM DOCBOOK_XSLTPROCCOMSTR DOCBOOK_XMLLINTCOMSTR DOCBOOK_FOPCOMSTR The default XSLT file for the &b-link-DocbookHtml; builder within the current environment, if no other XSLT gets specified via keyword. The default XSLT file for the &b-link-DocbookHtmlChunked; builder within the current environment, if no other XSLT gets specified via keyword. The default XSLT file for the &b-link-DocbookHtmlhelp; builder within the current environment, if no other XSLT gets specified via keyword. The default XSLT file for the &b-link-DocbookPdf; builder within the current environment, if no other XSLT gets specified via keyword. The default XSLT file for the &b-link-DocbookEpub; builder within the current environment, if no other XSLT gets specified via keyword. The default XSLT file for the &b-link-DocbookMan; builder within the current environment, if no other XSLT gets specified via keyword. The default XSLT file for the &b-link-DocbookSlidesPdf; builder within the current environment, if no other XSLT gets specified via keyword. The default XSLT file for the &b-link-DocbookSlidesHtml; builder within the current environment, if no other XSLT gets specified via keyword. The path to the external executable xsltproc (or saxon, xalan), if one of them is installed. Note, that this is only used as last fallback for XSL transformations, if no libxml2 or lxml Python binding can be imported in the current system. The path to the external executable xmllint, if it's installed. Note, that this is only used as last fallback for resolving XIncludes, if no libxml2 or lxml Python binding can be imported in the current system. The path to the PDF renderer fop or xep, if one of them is installed (fop gets checked first). Additonal command-line flags for the external executable xsltproc (or saxon, xalan). Additonal command-line flags for the external executable xmllint. Additonal command-line flags for the PDF renderer fop or xep. Additonal parameters that are not intended for the XSLT processor executable, but the XSL processing itself. By default, they get appended at the end of the command line for saxon and saxon-xslt, respectively. The full command-line for the external executable xsltproc (or saxon, xalan). The full command-line for the external executable xmllint. The full command-line for the PDF renderer fop or xep. The string displayed when xsltproc is used to transform an XML file via a given XSLT stylesheet. The string displayed when xmllint is used to resolve XIncludes for a given XML file. The string displayed when a renderer like fop or xep is used to create PDF output from an XML file. A pseudo-Builder, providing a Docbook toolchain for HTML output. env = Environment(tools=['docbook']) env.DocbookHtml('manual.html', 'manual.xml') or simply env = Environment(tools=['docbook']) env.DocbookHtml('manual') A pseudo-Builder, providing a Docbook toolchain for chunked HTML output. It supports the base.dir parameter. The chunkfast.xsl file (requires "EXSLT") is used as the default stylesheet. Basic syntax: env = Environment(tools=['docbook']) env.DocbookHtmlChunked('manual') where manual.xml is the input file. If you use the root.filename parameter in your own stylesheets you have to specify the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: env = Environment(tools=['docbook']) env.DocbookHtmlChunked('mymanual.html', 'manual', xsl='htmlchunk.xsl') Some basic support for the base.dir is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: env = Environment(tools=['docbook']) env.DocbookHtmlChunked('manual', xsl='htmlchunk.xsl', base_dir='output/') Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! A pseudo-Builder, providing a Docbook toolchain for HTMLHELP output. Its basic syntax is: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual') where manual.xml is the input file. If you use the root.filename parameter in your own stylesheets you have to specify the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('mymanual.html', 'manual', xsl='htmlhelp.xsl') Some basic support for the base.dir parameter is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/') Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! A pseudo-Builder, providing a Docbook toolchain for PDF output. env = Environment(tools=['docbook']) env.DocbookPdf('manual.pdf', 'manual.xml') or simply env = Environment(tools=['docbook']) env.DocbookPdf('manual') A pseudo-Builder, providing a Docbook toolchain for EPUB output. env = Environment(tools=['docbook']) env.DocbookEpub('manual.epub', 'manual.xml') or simply env = Environment(tools=['docbook']) env.DocbookEpub('manual') A pseudo-Builder, providing a Docbook toolchain for Man page output. Its basic syntax is: env = Environment(tools=['docbook']) env.DocbookMan('manual') where manual.xml is the input file. Note, that you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source. A pseudo-Builder, providing a Docbook toolchain for PDF slides output. env = Environment(tools=['docbook']) env.DocbookSlidesPdf('manual.pdf', 'manual.xml') or simply env = Environment(tools=['docbook']) env.DocbookSlidesPdf('manual') A pseudo-Builder, providing a Docbook toolchain for HTML slides output. env = Environment(tools=['docbook']) env.DocbookSlidesHtml('manual') If you use the titlefoil.html parameter in your own stylesheets you have to give the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: env = Environment(tools=['docbook']) env.DocbookSlidesHtml('mymanual.html','manual', xsl='slideshtml.xsl') Some basic support for the base.dir parameter is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: env = Environment(tools=['docbook']) env.DocbookSlidesHtml('manual', xsl='slideshtml.xsl', base_dir='output/') Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! A pseudo-Builder, for resolving XIncludes in a separate processing step. env = Environment(tools=['docbook']) env.DocbookXInclude('manual_xincluded.xml', 'manual.xml') A pseudo-Builder, applying a given XSL transformation to the input file. env = Environment(tools=['docbook']) env.DocbookXslt('manual_transformed.xml', 'manual.xml', xsl='transform.xslt') Note, that this builder requires the xsl parameter to be set. scons-src-3.0.0/src/engine/SCons/Tool/dvipdf.xml0000664000175000017500000000344113160023044021453 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the dvipdf utility. DVIPDF DVIPDFFLAGS DVIPDFCOM DVIPDFCOMSTR The TeX DVI file to PDF file converter. General options passed to the TeX DVI file to PDF file converter. The command line used to convert TeX DVI files into a PDF file. The string displayed when a TeX DVI file is converted into a PDF file. If this is not set, then &cv-link-DVIPDFCOM; (the command line) is displayed. A deprecated synonym for &cv-link-DVIPDFCOM;. scons-src-3.0.0/src/engine/SCons/Tool/lex.xml0000664000175000017500000000343413160023044020771 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &lex; lexical analyser. LEX LEXFLAGS LEXCOM LEXCOMSTR The lexical analyzer generator. The command line used to call the lexical analyzer generator to generate a source file. The string displayed when generating a source file using the lexical analyzer generator. If this is not set, then &cv-link-LEXCOM; (the command line) is displayed. env = Environment(LEXCOMSTR = "Lex'ing $TARGET from $SOURCES") General options passed to the lexical analyzer generator. scons-src-3.0.0/src/engine/SCons/Tool/midl.xml0000664000175000017500000000437313160023044021131 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Microsoft IDL compiler. MIDL MIDLFLAGS MIDLCOM MIDLCOMSTR Builds a Windows type library (.tlb) file from an input IDL file (.idl). In addition, it will build the associated interface stub and proxy source files, naming them according to the base name of the .idl file. For example, env.TypeLibrary(source="foo.idl") Will create foo.tlb, foo.h, foo_i.c, foo_p.c and foo_data.c files. The Microsoft IDL compiler. The command line used to pass files to the Microsoft IDL compiler. The string displayed when the Microsoft IDL copmiler is called. If this is not set, then &cv-link-MIDLCOM; (the command line) is displayed. General options passed to the Microsoft IDL compiler. scons-src-3.0.0/src/engine/SCons/Tool/ilink32.py0000664000175000017500000000403113160023044021276 0ustar bdbaddogbdbaddog"""SCons.Tool.ilink32 XXX """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/ilink32.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Tool import SCons.Tool.bcc32 import SCons.Util def generate(env): """Add Builders and construction variables for Borland ilink to an Environment.""" SCons.Tool.createSharedLibBuilder(env) SCons.Tool.createProgBuilder(env) env['LINK'] = '$CC' env['LINKFLAGS'] = SCons.Util.CLVar('') env['LINKCOM'] = '$LINK -q $LINKFLAGS -e$TARGET $SOURCES $LIBS' env['LIBDIRPREFIX']='' env['LIBDIRSUFFIX']='' env['LIBLINKPREFIX']='' env['LIBLINKSUFFIX']='$LIBSUFFIX' def exists(env): # Uses bcc32 to do linking as it generally knows where the standard # LIBS are and set up the linking correctly return SCons.Tool.bcc32.findIt('bcc32', env) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/msginit.xml0000664000175000017500000001554513160023044021661 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> This scons tool is a part of scons &t-link-gettext; toolset. It provides scons interface to msginit(1) program, which creates new PO file, initializing the meta information with values from user's environment (or options). MSGINIT MSGINITCOM MSGINITCOMSTR MSGINITFLAGS POAUTOINIT POCREATE_ALIAS POSUFFIX POTSUFFIX _MSGINITLOCALE POTDOMAIN LINGUAS_FILE POAUTOINIT This builder belongs to &t-link-msginit; tool. The builder initializes missing PO file(s) if &cv-link-POAUTOINIT; is set. If &cv-link-POAUTOINIT; is not set (default), &b-POInit; prints instruction for user (that is supposed to be a translator), telling how the PO file should be initialized. In normal projects you should not use &b-POInit; and use &b-link-POUpdate; instead. &b-link-POUpdate; chooses intelligently between msgmerge(1) and msginit(1). &b-POInit; always uses msginit(1) and should be regarded as builder for special purposes or for temporary use (e.g. for quick, one time initialization of a bunch of PO files) or for tests. Target nodes defined through &b-POInit; are not built by default (they're Ignored from '.' node) but are added to special Alias ('po-create' by default). The alias name may be changed through the &cv-link-POCREATE_ALIAS; construction variable. All PO files defined through &b-POInit; may be easily initialized by scons po-create. Example 1. Initialize en.po and pl.po from messages.pot: # ... env.POInit(['en', 'pl']) # messages.pot --> [en.po, pl.po] Example 2. Initialize en.po and pl.po from foo.pot: # ... env.POInit(['en', 'pl'], ['foo']) # foo.pot --> [en.po, pl.po] Example 3. Initialize en.po and pl.po from foo.pot but using &cv-link-POTDOMAIN; construction variable: # ... env.POInit(['en', 'pl'], POTDOMAIN='foo') # foo.pot --> [en.po, pl.po] Example 4. Initialize PO files for languages defined in LINGUAS file. The files will be initialized from template messages.pot: # ... env.POInit(LINGUAS_FILE = 1) # needs 'LINGUAS' file Example 5. Initialize en.po and pl.pl PO files plus files for languages defined in LINGUAS file. The files will be initialized from template messages.pot: # ... env.POInit(['en', 'pl'], LINGUAS_FILE = 1) Example 6. You may preconfigure your environment first, and then initialize PO files: # ... env['POAUTOINIT'] = 1 env['LINGUAS_FILE'] = 1 env['POTDOMAIN'] = 'foo' env.POInit() which has same efect as: # ... env.POInit(POAUTOINIT = 1, LINGUAS_FILE = 1, POTDOMAIN = 'foo') Common alias for all PO files created with &b-POInit; builder (default: 'po-create'). See &t-link-msginit; tool and &b-link-POInit; builder. Suffix used for PO files (default: '.po') See &t-link-msginit; tool and &b-link-POInit; builder. Path to msginit(1) program (found via Detect()). See &t-link-msginit; tool and &b-link-POInit; builder. Complete command line to run msginit(1) program. See &t-link-msginit; tool and &b-link-POInit; builder. String to display when msginit(1) is invoked (default: '', which means ``print &cv-link-MSGINITCOM;''). See &t-link-msginit; tool and &b-link-POInit; builder. List of additional flags to msginit(1) (default: []). See &t-link-msginit; tool and &b-link-POInit; builder. Internal ``macro''. Computes locale (language) name based on target filename (default: '${TARGET.filebase}' ). See &t-link-msginit; tool and &b-link-POInit; builder. scons-src-3.0.0/src/engine/SCons/Tool/sunf95.xml0000664000175000017500000000217613160023045021335 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the Sun &f95; Fortran compiler. FORTRAN F95 SHFORTRAN SHF95 SHFORTRANFLAGS SHF95FLAGS scons-src-3.0.0/src/engine/SCons/Tool/link.py0000664000175000017500000003210113160023044020757 0ustar bdbaddogbdbaddog """SCons.Tool.link Tool-specific initialization for the generic Posix linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/Tool/link.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import re import os import SCons.Tool import SCons.Util import SCons.Warnings from SCons.Tool.FortranCommon import isfortran from SCons.Tool.DCommon import isD import SCons.Tool.cxx cplusplus = SCons.Tool.cxx # cplusplus = __import__(__package__+'.cxx', globals(), locals(), ['*']) issued_mixed_link_warning = False def smart_link(source, target, env, for_signature): has_cplusplus = cplusplus.iscplusplus(source) has_fortran = isfortran(env, source) has_d = isD(env, source) if has_cplusplus and has_fortran and not has_d: global issued_mixed_link_warning if not issued_mixed_link_warning: msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \ "This may generate a buggy executable if the '%s'\n\t" + \ "compiler does not know how to deal with Fortran runtimes." SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning, msg % env.subst('$CXX')) issued_mixed_link_warning = True return '$CXX' elif has_d: env['LINKCOM'] = env['DLINKCOM'] env['SHLINKCOM'] = env['SHDLINKCOM'] return '$DC' elif has_fortran: return '$FORTRAN' elif has_cplusplus: return '$CXX' return '$CC' def _lib_emitter(target, source, env, **kw): Verbose = False if Verbose: print("_lib_emitter: target[0]={:r}".format(target[0].get_path())) for tgt in target: tgt.attributes.shared = 1 try: symlink_generator = kw['symlink_generator'] except KeyError: pass else: if Verbose: print("_lib_emitter: symlink_generator={:r}".format(symlink_generator)) symlinks = symlink_generator(env, target[0]) if Verbose: print("_lib_emitter: symlinks={:r}".format(symlinks)) if symlinks: SCons.Tool.EmitLibSymlinks(env, symlinks, target[0]) target[0].attributes.shliblinks = symlinks return (target, source) def shlib_emitter(target, source, env): return _lib_emitter(target, source, env, symlink_generator = SCons.Tool.ShLibSymlinkGenerator) def ldmod_emitter(target, source, env): return _lib_emitter(target, source, env, symlink_generator = SCons.Tool.LdModSymlinkGenerator) # This is generic enough to be included here... def _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw): """For libnode='/optional/dir/libfoo.so.X.Y.Z' it returns 'libfoo.so'""" Verbose = False if Verbose: print("_versioned_lib_name: libnode={:r}".format(libnode.get_path())) print("_versioned_lib_name: version={:r}".format(version)) print("_versioned_lib_name: prefix={:r}".format(prefix)) print("_versioned_lib_name: suffix={:r}".format(suffix)) print("_versioned_lib_name: suffix_generator={:r}".format(suffix_generator)) versioned_name = os.path.basename(libnode.get_path()) if Verbose: print("_versioned_lib_name: versioned_name={:r}".format(versioned_name)) versioned_prefix = prefix_generator(env, **kw) versioned_suffix = suffix_generator(env, **kw) if Verbose: print("_versioned_lib_name: versioned_prefix={:r}".format(versioned_prefix)) print("_versioned_lib_name: versioned_suffix={:r}".format(versioned_suffix)) versioned_prefix_re = '^' + re.escape(versioned_prefix) versioned_suffix_re = re.escape(versioned_suffix) + '$' name = re.sub(versioned_prefix_re, prefix, versioned_name) name = re.sub(versioned_suffix_re, suffix, name) if Verbose: print("_versioned_lib_name: name={:r}".format(name)) return name def _versioned_shlib_name(env, libnode, version, prefix, suffix, **kw): pg = SCons.Tool.ShLibPrefixGenerator sg = SCons.Tool.ShLibSuffixGenerator return _versioned_lib_name(env, libnode, version, prefix, suffix, pg, sg, **kw) def _versioned_ldmod_name(env, libnode, version, prefix, suffix, **kw): pg = SCons.Tool.LdModPrefixGenerator sg = SCons.Tool.LdModSuffixGenerator return _versioned_lib_name(env, libnode, version, prefix, suffix, pg, sg, **kw) def _versioned_lib_suffix(env, suffix, version): """For suffix='.so' and version='0.1.2' it returns '.so.0.1.2'""" Verbose = False if Verbose: print("_versioned_lib_suffix: suffix={:r}".format(suffix)) print("_versioned_lib_suffix: version={:r}".format(version)) if not suffix.endswith(version): suffix = suffix + '.' + version if Verbose: print("_versioned_lib_suffix: return suffix={:r}".format(suffix)) return suffix def _versioned_lib_soname(env, libnode, version, prefix, suffix, name_func): """For libnode='/optional/dir/libfoo.so.X.Y.Z' it returns 'libfoo.so.X'""" Verbose = False if Verbose: print("_versioned_lib_soname: version={:r}".format(version)) name = name_func(env, libnode, version, prefix, suffix) if Verbose: print("_versioned_lib_soname: name={:r}".format(name)) major = version.split('.')[0] soname = name + '.' + major if Verbose: print("_versioned_lib_soname: soname={:r}".format(soname)) return soname def _versioned_shlib_soname(env, libnode, version, prefix, suffix): return _versioned_lib_soname(env, libnode, version, prefix, suffix, _versioned_shlib_name) def _versioned_ldmod_soname(env, libnode, version, prefix, suffix): return _versioned_lib_soname(env, libnode, version, prefix, suffix, _versioned_ldmod_name) def _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, soname_func): """Generate link names that should be created for a versioned shared lirbrary. Returns a dictionary in the form { linkname : linktarget } """ Verbose = False if Verbose: print("_versioned_lib_symlinks: libnode={:r}".format(libnode.get_path())) print("_versioned_lib_symlinks: version={:r}".format(version)) if sys.platform.startswith('openbsd'): # OpenBSD uses x.y shared library versioning numbering convention # and doesn't use symlinks to backwards-compatible libraries if Verbose: print("_versioned_lib_symlinks: return symlinks={:r}".format(None)) return None linkdir = libnode.get_dir() if Verbose: print("_versioned_lib_symlinks: linkdir={:r}".format(linkdir.get_path())) name = name_func(env, libnode, version, prefix, suffix) if Verbose: print("_versioned_lib_symlinks: name={:r}".format(name)) soname = soname_func(env, libnode, version, prefix, suffix) link0 = env.fs.File(soname, linkdir) link1 = env.fs.File(name, linkdir) # We create direct symlinks, not daisy-chained. if link0 == libnode: # This enables SHLIBVERSION without periods (e.g. SHLIBVERSION=1) symlinks = [ (link1, libnode) ] else: # This handles usual SHLIBVERSION, i.e. '1.2', '1.2.3', etc. symlinks = [ (link0, libnode), (link1, libnode) ] if Verbose: print("_versioned_lib_symlinks: return symlinks={:r}".format(SCons.Tool.StringizeLibSymlinks(symlinks))) return symlinks def _versioned_shlib_symlinks(env, libnode, version, prefix, suffix): nf = _versioned_shlib_name sf = _versioned_shlib_soname return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, nf, sf) def _versioned_ldmod_symlinks(env, libnode, version, prefix, suffix): nf = _versioned_ldmod_name sf = _versioned_ldmod_soname return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, nf, sf) def _versioned_lib_callbacks(): return { 'VersionedShLibSuffix' : _versioned_lib_suffix, 'VersionedLdModSuffix' : _versioned_lib_suffix, 'VersionedShLibSymlinks' : _versioned_shlib_symlinks, 'VersionedLdModSymlinks' : _versioned_ldmod_symlinks, 'VersionedShLibName' : _versioned_shlib_name, 'VersionedLdModName' : _versioned_ldmod_name, 'VersionedShLibSoname' : _versioned_shlib_soname, 'VersionedLdModSoname' : _versioned_ldmod_soname, }.copy() def _setup_versioned_lib_variables(env, **kw): """ Setup all variables required by the versioning machinery """ tool = None try: tool = kw['tool'] except KeyError: pass use_soname = False try: use_soname = kw['use_soname'] except KeyError: pass # The $_SHLIBVERSIONFLAGS define extra commandline flags used when # building VERSIONED shared libraries. It's always set, but used only # when VERSIONED library is built (see __SHLIBVERSIONFLAGS in SCons/Defaults.py). if use_soname: # If the linker uses SONAME, then we need this little automata if tool == 'sunlink': env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS -h $_SHLIBSONAME' env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS -h $_LDMODULESONAME' else: env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS -Wl,-soname=$_SHLIBSONAME' env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS -Wl,-soname=$_LDMODULESONAME' env['_SHLIBSONAME'] = '${ShLibSonameGenerator(__env__,TARGET)}' env['_LDMODULESONAME'] = '${LdModSonameGenerator(__env__,TARGET)}' env['ShLibSonameGenerator'] = SCons.Tool.ShLibSonameGenerator env['LdModSonameGenerator'] = SCons.Tool.LdModSonameGenerator else: env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS' env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS' # LDOMDULVERSIONFLAGS should always default to $SHLIBVERSIONFLAGS env['LDMODULEVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS' def generate(env): """Add Builders and construction variables for gnulink to an Environment.""" SCons.Tool.createSharedLibBuilder(env) SCons.Tool.createProgBuilder(env) env['SHLINK'] = '$LINK' env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') env['SHLINKCOM'] = '$SHLINK -o $TARGET $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' # don't set up the emitter, cause AppendUnique will generate a list # starting with None :-( env.Append(SHLIBEMITTER = [shlib_emitter]) env['SMARTLINK'] = smart_link env['LINK'] = "$SMARTLINK" env['LINKFLAGS'] = SCons.Util.CLVar('') # __RPATH is only set to something ($_RPATH typically) on platforms that support it. env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['LIBDIRPREFIX']='-L' env['LIBDIRSUFFIX']='' env['_LIBFLAGS']='${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}' env['LIBLINKPREFIX']='-l' env['LIBLINKSUFFIX']='' if env['PLATFORM'] == 'hpux': env['SHLIBSUFFIX'] = '.sl' elif env['PLATFORM'] == 'aix': env['SHLIBSUFFIX'] = '.a' # For most platforms, a loadable module is the same as a shared # library. Platforms which are different can override these, but # setting them the same means that LoadableModule works everywhere. SCons.Tool.createLoadableModuleBuilder(env) env['LDMODULE'] = '$SHLINK' env.Append(LDMODULEEMITTER = [ldmod_emitter]) env['LDMODULEPREFIX'] = '$SHLIBPREFIX' env['LDMODULESUFFIX'] = '$SHLIBSUFFIX' env['LDMODULEFLAGS'] = '$SHLINKFLAGS' env['LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__LDMODULEVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['LDMODULEVERSION'] = '$SHLIBVERSION' env['LDMODULENOVERSIONSYMLINKS'] = '$SHLIBNOVERSIONSYMLINKS' def exists(env): # This module isn't really a Tool on its own, it's common logic for # other linkers. return None # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sunar.py0000664000175000017500000000446213160023044021163 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.sunar Tool-specific initialization for Solaris (Forte) ar (library archive). If CC exists, static libraries should be built with it, so that template instantiations can be resolved. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sunar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Util def generate(env): """Add Builders and construction variables for ar to an Environment.""" SCons.Tool.createStaticLibBuilder(env) if env.Detect('CC'): env['AR'] = 'CC' env['ARFLAGS'] = SCons.Util.CLVar('-xar') env['ARCOM'] = '$AR $ARFLAGS -o $TARGET $SOURCES' else: env['AR'] = 'ar' env['ARFLAGS'] = SCons.Util.CLVar('r') env['ARCOM'] = '$AR $ARFLAGS $TARGET $SOURCES' env['LIBPREFIX'] = 'lib' env['LIBSUFFIX'] = '.a' def exists(env): return env.Detect('CC') or env.Detect('ar') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/cvf.py0000664000175000017500000000470413160023041020605 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.cvf Tool-specific initialization for the Compaq Visual Fortran compiler. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/cvf.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from . import fortran compilers = ['f90'] def generate(env): """Add Builders and construction variables for compaq visual fortran to an Environment.""" fortran.generate(env) env['FORTRAN'] = 'f90' env['FORTRANCOM'] = '$FORTRAN $FORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}' env['FORTRANPPCOM'] = '$FORTRAN $FORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}' env['SHFORTRANCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}' env['SHFORTRANPPCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}' env['OBJSUFFIX'] = '.obj' env['FORTRANMODDIR'] = '${TARGET.dir}' env['FORTRANMODDIRPREFIX'] = '/module:' env['FORTRANMODDIRSUFFIX'] = '' def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sunc++.py0000664000175000017500000000315613160023044021130 0ustar bdbaddogbdbaddog"""SCons.Tool.sunc++ Tool-specific initialization for C++ on SunOS / Solaris. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sunc++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" #forward proxy to the preffered cxx version from SCons.Tool.suncxx import * # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/pdftex.py0000664000175000017500000000724413160023044021326 0ustar bdbaddogbdbaddog"""SCons.Tool.pdftex Tool-specific initialization for pdftex. Generates .pdf files from .tex files There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/pdftex.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import SCons.Action import SCons.Util import SCons.Tool.tex PDFTeXAction = None # This action might be needed more than once if we are dealing with # labels and bibtex. PDFLaTeXAction = None def PDFLaTeXAuxAction(target = None, source= None, env=None): result = SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXAction, target, source, env ) return result def PDFTeXLaTeXFunction(target = None, source= None, env=None): """A builder for TeX and LaTeX that scans the source file to decide the "flavor" of the source and then executes the appropriate program.""" basedir = os.path.split(str(source[0]))[0] abspath = os.path.abspath(basedir) if SCons.Tool.tex.is_LaTeX(source,env,abspath): result = PDFLaTeXAuxAction(target,source,env) if result != 0: SCons.Tool.tex.check_file_error_message(env['PDFLATEX']) else: result = PDFTeXAction(target,source,env) if result != 0: SCons.Tool.tex.check_file_error_message(env['PDFTEX']) return result PDFTeXLaTeXAction = None def generate(env): """Add Builders and construction variables for pdftex to an Environment.""" global PDFTeXAction if PDFTeXAction is None: PDFTeXAction = SCons.Action.Action('$PDFTEXCOM', '$PDFTEXCOMSTR') global PDFLaTeXAction if PDFLaTeXAction is None: PDFLaTeXAction = SCons.Action.Action("$PDFLATEXCOM", "$PDFLATEXCOMSTR") global PDFTeXLaTeXAction if PDFTeXLaTeXAction is None: PDFTeXLaTeXAction = SCons.Action.Action(PDFTeXLaTeXFunction, strfunction=SCons.Tool.tex.TeXLaTeXStrFunction) env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes) from . import pdf pdf.generate(env) bld = env['BUILDERS']['PDF'] bld.add_action('.tex', PDFTeXLaTeXAction) bld.add_emitter('.tex', SCons.Tool.tex.tex_pdf_emitter) # Add the epstopdf builder after the pdftex builder # so pdftex is the default for no source suffix pdf.generate2(env) SCons.Tool.tex.generate_common(env) def exists(env): SCons.Tool.tex.generate_darwin(env) return env.Detect('pdftex') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/mslink.xml0000664000175000017500000002015413160023044021474 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Microsoft linker. SHLINK SHLINKFLAGS SHLINKCOM LINK LINKFLAGS LINKCOM LIBDIRPREFIX LIBDIRSUFFIX LIBLINKPREFIX LIBLINKSUFFIX WIN32DEFPREFIX WIN32DEFSUFFIX WINDOWSDEFPREFIX WINDOWSDEFSUFFIX WINDOWS_INSERT_DEF WIN32EXPPREFIX WIN32EXPSUFFIX WINDOWSEXPPREFIX WINDOWSEXPSUFFIX WINDOWSSHLIBMANIFESTPREFIX WINDOWSSHLIBMANIFESTSUFFIX WINDOWSPROGMANIFESTPREFIX WINDOWSPROGMANIFESTSUFFIX REGSVR REGSVRFLAGS REGSVRCOM LDMODULE LDMODULEPREFIX LDMODULESUFFIX LDMODULEFLAGS LDMODULECOM SHLINKCOMSTR LINKCOMSTR REGSVRCOMSTR LDMODULECOMSTR When set to non-zero, suppresses creation of a corresponding Windows static import lib by the SharedLibrary builder when used with MinGW, Microsoft Visual Studio or Metrowerks. This also suppresses creation of an export (.exp) file when using Microsoft Visual Studio. The Microsoft Visual C++ PDB file that will store debugging information for object files, shared libraries, and programs. This variable is ignored by tools other than Microsoft Visual C++. When this variable is defined SCons will add options to the compiler and linker command line to cause them to generate external debugging information, and will also set up the dependencies for the PDB file. Example: env['PDB'] = 'hello.pdb' The Visual C++ compiler switch that SCons uses by default to generate PDB information is . This works correctly with parallel () builds because it embeds the debug information in the intermediate object files, as opposed to sharing a single PDB file between multiple object files. This is also the only way to get debug information embedded into a static library. Using the instead may yield improved link-time performance, although parallel builds will no longer work. You can generate PDB files with the switch by overriding the default &cv-link-CCPDBFLAGS; variable; see the entry for that variable for specific examples. Set this variable to True or 1 to embed the compiler-generated manifest (normally ${TARGET}.manifest) into all Windows exes and DLLs built with this environment, as a resource during their link step. This is done using &cv-link-MT; and &cv-link-MTEXECOM; and &cv-link-MTSHLIBCOM;. The program used on Windows systems to embed manifests into DLLs and EXEs. See also &cv-link-WINDOWS_EMBED_MANIFEST;. Flags passed to the &cv-link-MT; manifest embedding program (Windows only). The Windows command line used to embed manifests into executables. See also &cv-link-MTSHLIBCOM;. The Windows command line used to embed manifests into shared libraries (DLLs). See also &cv-link-MTEXECOM;. The program used on Windows systems to register a newly-built DLL library whenever the &b-SharedLibrary; builder is passed a keyword argument of register=1. The command line used on Windows systems to register a newly-built DLL library whenever the &b-SharedLibrary; builder is passed a keyword argument of register=1. The string displayed when registering a newly-built DLL file. If this is not set, then &cv-link-REGSVRCOM; (the command line) is displayed. Flags passed to the DLL registration program on Windows systems when a newly-built DLL library is registered. By default, this includes the that prevents dialog boxes from popping up and requiring user attention. A deprecated synonym for &cv-link-WINDOWS_INSERT_DEF;. A deprecated synonym for &cv-link-WINDOWSDEFPREFIX;. A deprecated synonym for &cv-link-WINDOWSDEFSUFFIX;. A deprecated synonym for &cv-link-WINDOWSEXPSUFFIX;. A deprecated synonym for &cv-link-WINDOWSEXPSUFFIX;. When this is set to true, a library build of a Windows shared library (.dll file) will also build a corresponding .def file at the same time, if a .def file is not already listed as a build target. The default is 0 (do not build a .def file). When this is set to true, &scons; will be aware of the .manifest files generated by Microsoft Visua C/C++ 8. The prefix used for Windows .def file names. The suffix used for Windows .def file names. The prefix used for Windows .exp file names. The suffix used for Windows .exp file names. The prefix used for executable program .manifest files generated by Microsoft Visual C/C++. The suffix used for executable program .manifest files generated by Microsoft Visual C/C++. The prefix used for shared library .manifest files generated by Microsoft Visual C/C++. The suffix used for shared library .manifest files generated by Microsoft Visual C/C++. scons-src-3.0.0/src/engine/SCons/Tool/gnulink.xml0000664000175000017500000000226113160023044021645 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for GNU linker/loader. SHLINKFLAGS RPATHPREFIX RPATHSUFFIX _LDMODULESONAME _SHLIBSONAME LDMODULEVERSIONFLAGS SHLIBVERSIONFLAGS scons-src-3.0.0/src/engine/SCons/Tool/textfile.py0000664000175000017500000001513013160023045021652 0ustar bdbaddogbdbaddog# -*- python -*- # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __doc__ = """ Textfile/Substfile builder for SCons. Create file 'target' which typically is a textfile. The 'source' may be any combination of strings, Nodes, or lists of same. A 'linesep' will be put between any part written and defaults to os.linesep. The only difference between the Textfile builder and the Substfile builder is that strings are converted to Value() nodes for the former and File() nodes for the latter. To insert files in the former or strings in the latter, wrap them in a File() or Value(), respectively. The values of SUBST_DICT first have any construction variables expanded (its keys are not expanded). If a value of SUBST_DICT is a python callable function, it is called and the result is expanded as the value. Values are substituted in a "random" order; if any substitution could be further expanded by another substitution, it is unpredictable whether the expansion will occur. """ __revision__ = "src/engine/SCons/Tool/textfile.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons import os import re from SCons.Node import Node from SCons.Node.Python import Value from SCons.Util import is_String, is_Sequence, is_Dict, to_bytes, PY3 if PY3: TEXTFILE_FILE_WRITE_MODE = 'w' else: TEXTFILE_FILE_WRITE_MODE = 'wb' LINESEP = '\n' def _do_subst(node, subs): """ Fetch the node contents and replace all instances of the keys with their values. For example, if subs is {'%VERSION%': '1.2345', '%BASE%': 'MyProg', '%prefix%': '/bin'}, then all instances of %VERSION% in the file will be replaced with 1.2345 and so forth. """ contents = node.get_text_contents() if subs: for (k, val) in subs: contents = re.sub(k, val, contents) if 'b' in TEXTFILE_FILE_WRITE_MODE: try: contents = bytearray(contents, 'utf-8') except UnicodeDecodeError: # contents is already utf-8 encoded python 2 str i.e. a byte array contents = bytearray(contents) return contents def _action(target, source, env): # prepare the line separator linesep = env['LINESEPARATOR'] if linesep is None: linesep = LINESEP # os.linesep elif is_String(linesep): pass elif isinstance(linesep, Value): linesep = linesep.get_text_contents() else: raise SCons.Errors.UserError('unexpected type/class for LINESEPARATOR: %s' % repr(linesep), None) if 'b' in TEXTFILE_FILE_WRITE_MODE: linesep = to_bytes(linesep) # create a dictionary to use for the substitutions if 'SUBST_DICT' not in env: subs = None # no substitutions else: subst_dict = env['SUBST_DICT'] if is_Dict(subst_dict): subst_dict = list(subst_dict.items()) elif is_Sequence(subst_dict): pass else: raise SCons.Errors.UserError('SUBST_DICT must be dict or sequence') subs = [] for (k, value) in subst_dict: if callable(value): value = value() if is_String(value): value = env.subst(value) else: value = str(value) subs.append((k, value)) # write the file try: if SCons.Util.PY3: target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='') else: target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE) except (OSError, IOError): raise SCons.Errors.UserError("Can't write target file %s" % target[0]) # separate lines by 'linesep' only if linesep is not empty lsep = None for line in source: if lsep: target_file.write(lsep) target_file.write(_do_subst(line, subs)) lsep = linesep target_file.close() def _strfunc(target, source, env): return "Creating '%s'" % target[0] def _convert_list_R(newlist, sources): for elem in sources: if is_Sequence(elem): _convert_list_R(newlist, elem) elif isinstance(elem, Node): newlist.append(elem) else: newlist.append(Value(elem)) def _convert_list(target, source, env): if len(target) != 1: raise SCons.Errors.UserError("Only one target file allowed") newlist = [] _convert_list_R(newlist, source) return target, newlist _common_varlist = ['SUBST_DICT', 'LINESEPARATOR'] _text_varlist = _common_varlist + ['TEXTFILEPREFIX', 'TEXTFILESUFFIX'] _text_builder = SCons.Builder.Builder( action=SCons.Action.Action(_action, _strfunc, varlist=_text_varlist), source_factory=Value, emitter=_convert_list, prefix='$TEXTFILEPREFIX', suffix='$TEXTFILESUFFIX', ) _subst_varlist = _common_varlist + ['SUBSTFILEPREFIX', 'TEXTFILESUFFIX'] _subst_builder = SCons.Builder.Builder( action=SCons.Action.Action(_action, _strfunc, varlist=_subst_varlist), source_factory=SCons.Node.FS.File, emitter=_convert_list, prefix='$SUBSTFILEPREFIX', suffix='$SUBSTFILESUFFIX', src_suffix=['.in'], ) def generate(env): env['LINESEPARATOR'] = LINESEP # os.linesep env['BUILDERS']['Textfile'] = _text_builder env['TEXTFILEPREFIX'] = '' env['TEXTFILESUFFIX'] = '.txt' env['BUILDERS']['Substfile'] = _subst_builder env['SUBSTFILEPREFIX'] = '' env['SUBSTFILESUFFIX'] = '' def exists(env): return 1 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/tlib.xml0000664000175000017500000000224013160023045021126 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Borlan tib library archiver. AR ARFLAGS ARCOM LIBPREFIX LIBSUFFIX ARCOMSTR scons-src-3.0.0/src/engine/SCons/Tool/ifl.xml0000664000175000017500000000235013160023044020747 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Intel Fortran compiler. FORTRAN FORTRANCOM FORTRANPPCOM SHFORTRANCOM SHFORTRANPPCOM FORTRANFLAGS _FORTRANINCFLAGS CPPFLAGS _CPPDEFFLAGS scons-src-3.0.0/src/engine/SCons/Tool/pdflatex.xml0000664000175000017500000000344613160023044022013 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &pdflatex; utility. PDFLATEX PDFLATEXFLAGS PDFLATEXCOM LATEXRETRIES PDFLATEXCOMSTR The &pdflatex; utility. The command line used to call the &pdflatex; utility. The string displayed when calling the &pdflatex; utility. If this is not set, then &cv-link-PDFLATEXCOM; (the command line) is displayed. env = Environment(PDFLATEX;COMSTR = "Building $TARGET from LaTeX input $SOURCES") General options passed to the &pdflatex; utility. scons-src-3.0.0/src/engine/SCons/Tool/hpcxx.py0000664000175000017500000000525013160023044021161 0ustar bdbaddogbdbaddog"""SCons.Tool.hpc++ Tool-specific initialization for c++ on HP/UX. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/hpcxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import SCons.Util import SCons.Tool.cxx cplusplus = SCons.Tool.cxx #cplusplus = __import__('cxx', globals(), locals(), []) acc = None # search for the acc compiler and linker front end try: dirs = os.listdir('/opt') except (IOError, OSError): # Not being able to read the directory because it doesn't exist # (IOError) or isn't readable (OSError) is okay. dirs = [] for dir in dirs: cc = '/opt/' + dir + '/bin/aCC' if os.path.exists(cc): acc = cc break def generate(env): """Add Builders and construction variables for g++ to an Environment.""" cplusplus.generate(env) if acc: env['CXX'] = acc or 'aCC' env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z') # determine version of aCC line = os.popen(acc + ' -V 2>&1').readline().rstrip() if line.find('aCC: HP ANSI C++') == 0: env['CXXVERSION'] = line.split()[-1] if env['PLATFORM'] == 'cygwin': env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS') else: env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z') def exists(env): return acc # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/wixTests.py0000664000175000017500000000432013160023045021657 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/wixTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import unittest import os.path import os import sys import SCons.Errors from SCons.Tool.wix import * from SCons.Environment import Environment import TestCmd import TestUnit # create fake candle and light, so the tool's exists() method will succeed test = TestCmd.TestCmd(workdir = '') test.write('candle.exe', 'rem this is candle') test.write('light.exe', 'rem this is light') os.environ['PATH'] += os.pathsep + test.workdir class WixTestCase(unittest.TestCase): def test_vars(self): """Test that WiX tool adds vars""" env = Environment(tools=['wix']) assert env['WIXCANDLE'] is not None assert env['WIXCANDLEFLAGS'] is not None assert env['WIXLIGHTFLAGS'] is not None assert env.subst('$WIXOBJSUF') == '.wixobj' assert env.subst('$WIXSRCSUF') == '.wxs' if __name__ == "__main__": suite = unittest.makeSuite(WixTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/as.py0000664000175000017500000000562613160023041020436 0ustar bdbaddogbdbaddog"""SCons.Tool.as Tool-specific initialization for as, the generic Posix assembler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/as.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Util assemblers = ['as'] ASSuffixes = ['.s', '.asm', '.ASM'] ASPPSuffixes = ['.spp', '.SPP', '.sx'] if SCons.Util.case_sensitive_suffixes('.s', '.S'): ASPPSuffixes.extend(['.S']) else: ASSuffixes.extend(['.S']) def generate(env): """Add Builders and construction variables for as to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) for suffix in ASSuffixes: static_obj.add_action(suffix, SCons.Defaults.ASAction) shared_obj.add_action(suffix, SCons.Defaults.ASAction) static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) for suffix in ASPPSuffixes: static_obj.add_action(suffix, SCons.Defaults.ASPPAction) shared_obj.add_action(suffix, SCons.Defaults.ASPPAction) static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) env['AS'] = env.Detect(assemblers) or 'as' env['ASFLAGS'] = SCons.Util.CLVar('') env['ASCOM'] = '$AS $ASFLAGS -o $TARGET $SOURCES' env['ASPPFLAGS'] = '$ASFLAGS' env['ASPPCOM'] = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' def exists(env): return env.Detect(assemblers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/gdc.py0000664000175000017500000001303013160023044020557 0ustar bdbaddogbdbaddogfrom __future__ import print_function """SCons.Tool.gdc Tool-specific initialization for the GDC compiler. (https://github.com/D-Programming-GDC/GDC) Developed by Russel Winder (russel@winder.org.uk) 2012-05-09 onwards Compiler variables: DC - The name of the D compiler to use. Defaults to gdc. DPATH - List of paths to search for import modules. DVERSIONS - List of version tags to enable when compiling. DDEBUG - List of debug tags to enable when compiling. Linker related variables: LIBS - List of library files to link in. DLINK - Name of the linker to use. Defaults to gdc. DLINKFLAGS - List of linker flags. Lib tool variables: DLIB - Name of the lib tool to use. Defaults to lib. DLIBFLAGS - List of flags to pass to the lib tool. LIBS - Same as for the linker. (libraries to pull into the .lib) """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/gdc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Action import SCons.Defaults import SCons.Tool import SCons.Tool.DCommon as DCommon def generate(env): static_obj, shared_obj = SCons.Tool.createObjBuilders(env) static_obj.add_action('.d', SCons.Defaults.DAction) shared_obj.add_action('.d', SCons.Defaults.ShDAction) static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter) env['DC'] = env.Detect('gdc') or 'gdc' env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -o $TARGET $SOURCES' env['_DINCFLAGS'] = '${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}' env['_DVERFLAGS'] = '${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}' env['_DDEBUGFLAGS'] = '${_concat(DDEBUGPREFIX, DDEBUG, DDEBUGSUFFIX, __env__)}' env['_DFLAGS'] = '${_concat(DFLAGPREFIX, DFLAGS, DFLAGSUFFIX, __env__)}' env['SHDC'] = '$DC' env['SHDCOM'] = '$SHDC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -fPIC -c -o $TARGET $SOURCES' env['DPATH'] = ['#/'] env['DFLAGS'] = [] env['DVERSIONS'] = [] env['DDEBUG'] = [] if env['DC']: DCommon.addDPATHToEnv(env, env['DC']) env['DINCPREFIX'] = '-I' env['DINCSUFFIX'] = '' env['DVERPREFIX'] = '-version=' env['DVERSUFFIX'] = '' env['DDEBUGPREFIX'] = '-debug=' env['DDEBUGSUFFIX'] = '' env['DFLAGPREFIX'] = '-' env['DFLAGSUFFIX'] = '' env['DFILESUFFIX'] = '.d' env['DLINK'] = '$DC' env['DLINKFLAGS'] = SCons.Util.CLVar('') env['DLINKCOM'] = '$DLINK -o $TARGET $DLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['SHDLINK'] = '$DC' env['SHDLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -shared-libphobos') env['SHDLINKCOM'] = '$DLINK -o $TARGET $SHDLINKFLAGS $__SHDLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr' env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLINKLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '') env['_DLIBFLAGS'] = '${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)}' env['DLIBFLAGPREFIX'] = '-' env['DLIBFLAGSUFFIX'] = '' env['DLINKFLAGPREFIX'] = '-' env['DLINKFLAGSUFFIX'] = '' # __RPATH is set to $_RPATH in the platform specification if that # platform supports it. env['RPATHPREFIX'] = '-Wl,-rpath=' env['RPATHSUFFIX'] = '' env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}' # Support for versioned libraries env['_SHDLIBVERSIONFLAGS'] = '$SHDLIBVERSIONFLAGS -Wl,-soname=$_SHDLIBSONAME' env['_SHDLIBSONAME'] = '${DShLibSonameGenerator(__env__,TARGET)}' # NOTE: this is a quick hack, the soname will only work if there is # c/c++ linker loaded which provides callback for the ShLibSonameGenerator env['DShLibSonameGenerator'] = SCons.Tool.ShLibSonameGenerator # NOTE: this is only for further reference, currently $SHDLIBVERSION does # not work, the user must use $SHLIBVERSION env['SHDLIBVERSION'] = '$SHLIBVERSION' env['SHDLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS' env['BUILDERS']['ProgramAllAtOnce'] = SCons.Builder.Builder( action='$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -o $TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS', emitter=DCommon.allAtOnceEmitter, ) def exists(env): return env.Detect('gdc') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/g77.xml0000664000175000017500000000202413160023044020577 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the &g77; Fortran compiler. Calls the &t-f77; Tool module to set variables. scons-src-3.0.0/src/engine/SCons/Tool/yacc.xml0000664000175000017500000000713113160023045021117 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &yacc; parse generator. YACC YACCFLAGS YACCCOM YACCHFILESUFFIX YACCHXXFILESUFFIX YACCVCGFILESUFFIX YACCCOMSTR The parser generator. The command line used to call the parser generator to generate a source file. The string displayed when generating a source file using the parser generator. If this is not set, then &cv-link-YACCCOM; (the command line) is displayed. env = Environment(YACCCOMSTR = "Yacc'ing $TARGET from $SOURCES") General options passed to the parser generator. If &cv-link-YACCFLAGS; contains a option, SCons assumes that the call will also create a .h file (if the yacc source file ends in a .y suffix) or a .hpp file (if the yacc source file ends in a .yy suffix) The suffix of the C header file generated by the parser generator when the option is used. Note that setting this variable does not cause the parser generator to generate a header file with the specified suffix, it exists to allow you to specify what suffix the parser generator will use of its own accord. The default value is .h. The suffix of the C++ header file generated by the parser generator when the option is used. Note that setting this variable does not cause the parser generator to generate a header file with the specified suffix, it exists to allow you to specify what suffix the parser generator will use of its own accord. The default value is .hpp, except on Mac OS X, where the default is ${TARGET.suffix}.h. because the default &bison; parser generator just appends .h to the name of the generated C++ file. The suffix of the file containing the VCG grammar automaton definition when the option is used. Note that setting this variable does not cause the parser generator to generate a VCG file with the specified suffix, it exists to allow you to specify what suffix the parser generator will use of its own accord. The default value is .vcg. scons-src-3.0.0/src/engine/SCons/Tool/javacTests.py0000664000175000017500000000667613160023044022153 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # import os import unittest import TestUnit import SCons.Tool.javac class DummyNode(object): def __init__(self, val): self.val = val def __str__(self): return str(self.val) class pathoptTestCase(unittest.TestCase): def assert_pathopt(self, expect, path): popt = SCons.Tool.javac.pathopt('-foopath', 'FOOPATH') env = {'FOOPATH': path} actual = popt(None, None, env, None) self.assertEquals(expect, actual) def assert_pathopt_default(self, expect, path, default): popt = SCons.Tool.javac.pathopt('-foopath', 'FOOPATH', default='DPATH') env = {'FOOPATH': path, 'DPATH': default} actual = popt(None, None, env, None) self.assertEquals(expect, actual) def test_unset(self): self.assert_pathopt([], None) self.assert_pathopt([], '') def test_str(self): self.assert_pathopt(['-foopath', '/foo/bar'], '/foo/bar') def test_list_str(self): self.assert_pathopt(['-foopath', '/foo%s/bar' % os.pathsep], ['/foo', '/bar']) def test_uses_pathsep(self): save = os.pathsep try: os.pathsep = '!' self.assert_pathopt(['-foopath', 'foo!bar'], ['foo', 'bar']) finally: os.pathsep = save def test_node(self): self.assert_pathopt(['-foopath', '/foo'], DummyNode('/foo')) def test_list_node(self): self.assert_pathopt(['-foopath', os.pathsep.join(['/foo','/bar'])], ['/foo', DummyNode('/bar')]) def test_default_str(self): self.assert_pathopt_default( ['-foopath', os.pathsep.join(['/foo','/bar','/baz'])], ['/foo', '/bar'], '/baz') def test_default_list(self): self.assert_pathopt_default( ['-foopath', os.pathsep.join(['/foo','/bar','/baz'])], ['/foo', '/bar'], ['/baz']) def test_default_unset(self): self.assert_pathopt_default( ['-foopath', '/foo'], '/foo', None) self.assert_pathopt_default( ['-foopath', '/foo'], '/foo', '') if __name__ == "__main__": suite = unittest.makeSuite(pathoptTestCase, 'test_') TestUnit.run(suite) scons-src-3.0.0/src/engine/SCons/Tool/clangxx.xml0000664000175000017500000000220113160023041021631 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the Clang C++ compiler. CXX SHCXXFLAGS STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME SHOBJSUFFIX CXXVERSION scons-src-3.0.0/src/engine/SCons/Tool/masm.py0000664000175000017500000000563713160023044020775 0ustar bdbaddogbdbaddog"""SCons.Tool.masm Tool-specific initialization for the Microsoft Assembler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/masm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Util ASSuffixes = ['.s', '.asm', '.ASM'] ASPPSuffixes = ['.spp', '.SPP', '.sx'] if SCons.Util.case_sensitive_suffixes('.s', '.S'): ASPPSuffixes.extend(['.S']) else: ASSuffixes.extend(['.S']) def generate(env): """Add Builders and construction variables for masm to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) for suffix in ASSuffixes: static_obj.add_action(suffix, SCons.Defaults.ASAction) shared_obj.add_action(suffix, SCons.Defaults.ASAction) static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) for suffix in ASPPSuffixes: static_obj.add_action(suffix, SCons.Defaults.ASPPAction) shared_obj.add_action(suffix, SCons.Defaults.ASPPAction) static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) env['AS'] = 'ml' env['ASFLAGS'] = SCons.Util.CLVar('/nologo') env['ASPPFLAGS'] = '$ASFLAGS' env['ASCOM'] = '$AS $ASFLAGS /c /Fo$TARGET $SOURCES' env['ASPPCOM'] = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c /Fo$TARGET $SOURCES' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 def exists(env): return env.Detect('ml') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/f03.xml0000664000175000017500000002113113160023044020563 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for generic POSIX Fortran 03 compilers. F03 F03FLAGS F03COM F03PPCOM SHF03 SHF03FLAGS SHF03COM SHF03PPCOM _F03INCFLAGS F03COMSTR F03PPCOMSTR SHF03COMSTR SHF03PPCOMSTR The Fortran 03 compiler. You should normally set the &cv-link-FORTRAN; variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set &cv-link-F03; if you need to use a specific compiler or compiler version for Fortran 03 files. The command line used to compile a Fortran 03 source file to an object file. You only need to set &cv-link-F03COM; if you need to use a specific command line for Fortran 03 files. You should normally set the &cv-link-FORTRANCOM; variable, which specifies the default command line for all Fortran versions. The string displayed when a Fortran 03 source file is compiled to an object file. If this is not set, then &cv-link-F03COM; or &cv-link-FORTRANCOM; (the command line) is displayed. The list of file extensions for which the F03 dialect will be used. By default, this is ['.f03'] The list of file extensions for which the compilation + preprocessor pass for F03 dialect will be used. By default, this is empty General user-specified options that are passed to the Fortran 03 compiler. Note that this variable does not contain (or similar) include search path options that scons generates automatically from &cv-link-F03PATH;. See &cv-link-_F03INCFLAGS; below, for the variable that expands to those options. You only need to set &cv-link-F03FLAGS; if you need to define specific user options for Fortran 03 files. You should normally set the &cv-link-FORTRANFLAGS; variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. An automatically-generated construction variable containing the Fortran 03 compiler command-line options for specifying directories to be searched for include files. The value of &cv-link-_F03INCFLAGS; is created by appending &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; to the beginning and end of each directory in &cv-link-F03PATH;. The list of directories that the Fortran 03 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in &cv-link-F03FLAGS; because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in &cv-link-F03PATH; will be looked-up relative to the SConscript directory when they are used in a command. To force &scons; to look-up a directory relative to the root of the source tree use #: You only need to set &cv-link-F03PATH; if you need to define a specific include path for Fortran 03 files. You should normally set the &cv-link-FORTRANPATH; variable, which specifies the include path for the default Fortran compiler for all Fortran versions. env = Environment(F03PATH='#/include') The directory look-up can also be forced using the &Dir;() function: include = Dir('include') env = Environment(F03PATH=include) The directory list will be added to command lines through the automatically-generated &cv-link-_F03INCFLAGS; construction variable, which is constructed by appending the values of the &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; construction variables to the beginning and end of each directory in &cv-link-F03PATH;. Any command lines you define that need the F03PATH directory list should include &cv-link-_F03INCFLAGS;: env = Environment(F03COM="my_compiler $_F03INCFLAGS -c -o $TARGET $SOURCE") The command line used to compile a Fortran 03 source file to an object file after first running the file through the C preprocessor. Any options specified in the &cv-link-F03FLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. You only need to set &cv-link-F03PPCOM; if you need to use a specific C-preprocessor command line for Fortran 03 files. You should normally set the &cv-link-FORTRANPPCOM; variable, which specifies the default C-preprocessor command line for all Fortran versions. The string displayed when a Fortran 03 source file is compiled to an object file after first running the file through the C preprocessor. If this is not set, then &cv-link-F03PPCOM; or &cv-link-FORTRANPPCOM; (the command line) is displayed. The Fortran 03 compiler used for generating shared-library objects. You should normally set the &cv-link-SHFORTRAN; variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set &cv-link-SHF03; if you need to use a specific compiler or compiler version for Fortran 03 files. The command line used to compile a Fortran 03 source file to a shared-library object file. You only need to set &cv-link-SHF03COM; if you need to use a specific command line for Fortran 03 files. You should normally set the &cv-link-SHFORTRANCOM; variable, which specifies the default command line for all Fortran versions. The string displayed when a Fortran 03 source file is compiled to a shared-library object file. If this is not set, then &cv-link-SHF03COM; or &cv-link-SHFORTRANCOM; (the command line) is displayed. Options that are passed to the Fortran 03 compiler to generated shared-library objects. You only need to set &cv-link-SHF03FLAGS; if you need to define specific user options for Fortran 03 files. You should normally set the &cv-link-SHFORTRANFLAGS; variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. The command line used to compile a Fortran 03 source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the &cv-link-SHF03FLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. You only need to set &cv-link-SHF03PPCOM; if you need to use a specific C-preprocessor command line for Fortran 03 files. You should normally set the &cv-link-SHFORTRANPPCOM; variable, which specifies the default C-preprocessor command line for all Fortran versions. The string displayed when a Fortran 03 source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then &cv-link-SHF03PPCOM; or &cv-link-SHFORTRANPPCOM; (the command line) is displayed. scons-src-3.0.0/src/engine/SCons/Tool/JavaCommonTests.py0000664000175000017500000003506213160023041023105 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/JavaCommonTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import sys import unittest import TestUnit import SCons.Scanner.IDL import SCons.Tool.JavaCommon # Adding trace=trace to any of the parse_jave() calls below will cause # the parser to spit out trace messages of the tokens it sees and the # attendant transitions. def trace(token, newstate): from SCons.Debug import Trace statename = newstate.__class__.__name__ Trace('token = %s, state = %s\n' % (repr(token), statename)) class parse_javaTestCase(unittest.TestCase): def test_bare_bones(self): """Test a bare-bones class""" input = """\ package com.sub.bar; public class Foo { public static void main(String[] args) { /* This tests a former bug where strings would eat later code. */ String hello1 = new String("Hello, world!"); } } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input) assert pkg_dir == os.path.join('com', 'sub', 'bar'), pkg_dir assert classes == ['Foo'], classes def test_dollar_sign(self): """Test class names with $ in them""" input = """\ public class BadDep { public void new$rand () {} } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input) assert pkg_dir is None, pkg_dir assert classes == ['BadDep'], classes def test_inner_classes(self): """Test parsing various forms of inner classes""" input = """\ class Empty { } interface Listener { public void execute(); } public class Test implements Listener { class Inner { void go() { use(new Listener() { public void execute() { System.out.println("In Inner"); } }); } String s1 = "class A"; String s2 = "new Listener() { }"; /* class B */ /* new Listener() { } */ } class Inner2 { Inner2() { Listener l = new Listener(); } } /* Make sure this class doesn't get interpreted as an inner class of the previous one, when "new" is used in the previous class. */ class Inner3 { } public static void main(String[] args) { new Test().run(); } void run() { use(new Listener() { public void execute() { use(new Listener( ) { public void execute() { System.out.println("Inside execute()"); } }); } }); new Inner().go(); } void use(Listener l) { l.execute(); } } class Private { void run() { new Listener() { public void execute() { } }; } } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.4') assert pkg_dir is None, pkg_dir expect = [ 'Empty', 'Listener', 'Test$1', 'Test$Inner', 'Test$Inner2', 'Test$Inner3', 'Test$2', 'Test$3', 'Test', 'Private$1', 'Private', ] assert classes == expect, classes pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.5') assert pkg_dir is None, pkg_dir expect = [ 'Empty', 'Listener', 'Test$Inner$1', 'Test$Inner', 'Test$Inner2', 'Test$Inner3', 'Test$1', 'Test$1$1', 'Test', 'Private$1', 'Private', ] assert classes == expect, (expect, classes) pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '5') assert pkg_dir is None, pkg_dir expect = [ 'Empty', 'Listener', 'Test$Inner$1', 'Test$Inner', 'Test$Inner2', 'Test$Inner3', 'Test$1', 'Test$1$1', 'Test', 'Private$1', 'Private', ] assert classes == expect, (expect, classes) def test_comments(self): """Test a class with comments""" input = """\ package com.sub.foo; import java.rmi.Naming; import java.rmi.RemoteException; import java.rmi.RMISecurityManager; import java.rmi.server.UnicastRemoteObject; public class Example1 extends UnicastRemoteObject implements Hello { public Example1() throws RemoteException { super(); } public String sayHello() { return "Hello World!"; } public static void main(String args[]) { if (System.getSecurityManager() == null) { System.setSecurityManager(new RMISecurityManager()); } // a comment try { Example1 obj = new Example1(); Naming.rebind("//myhost/HelloServer", obj); System.out.println("HelloServer bound in registry"); } catch (Exception e) { System.out.println("Example1 err: " + e.getMessage()); e.printStackTrace(); } } } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input) assert pkg_dir == os.path.join('com', 'sub', 'foo'), pkg_dir assert classes == ['Example1'], classes def test_arrays(self): """Test arrays of class instances""" input = """\ public class Test { MyClass abc = new MyClass(); MyClass xyz = new MyClass(); MyClass _array[] = new MyClass[] { abc, xyz } } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input) assert pkg_dir is None, pkg_dir assert classes == ['Test'], classes def test_backslash(self): """Test backslash handling""" input = """\ public class MyTabs { private class MyInternal { } private final static String PATH = "images\\\\"; } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input) assert pkg_dir is None, pkg_dir assert classes == ['MyTabs$MyInternal', 'MyTabs'], classes def test_enum(self): """Test the Java 1.5 enum keyword""" input = """\ package p; public enum a {} """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input) assert pkg_dir == 'p', pkg_dir assert classes == ['a'], classes def test_anon_classes(self): """Test anonymous classes""" input = """\ public abstract class TestClass { public void completed() { new Thread() { }.start(); new Thread() { }.start(); } } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input) assert pkg_dir is None, pkg_dir assert classes == ['TestClass$1', 'TestClass$2', 'TestClass'], classes def test_closing_bracket(self): """Test finding a closing bracket instead of an anonymous class""" input = """\ class TestSCons { public static void main(String[] args) { Foo[] fooArray = new Foo[] { new Foo() }; } } class Foo { } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input) assert pkg_dir is None, pkg_dir assert classes == ['TestSCons', 'Foo'], classes def test_dot_class_attributes(self): """Test handling ".class" attributes""" input = """\ public class Test extends Object { static { Class c = Object[].class; Object[] s = new Object[] {}; } } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input) assert classes == ['Test'], classes input = """\ public class A { public class B { public void F(Object[] o) { F(new Object[] {Object[].class}); } public void G(Object[] o) { F(new Object[] {}); } } } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input) assert pkg_dir is None, pkg_dir assert classes == ['A$B', 'A'], classes def test_anonymous_classes_with_parentheses(self): """Test finding anonymous classes marked by parentheses""" input = """\ import java.io.File; public class Foo { public static void main(String[] args) { File f = new File( new File("a") { public String toString() { return "b"; } } to String() ) { public String toString() { return "c"; } }; } } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.4') assert classes == ['Foo$1', 'Foo$2', 'Foo'], classes pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.5') assert classes == ['Foo$1', 'Foo$1$1', 'Foo'], classes pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '6') assert classes == ['Foo$1', 'Foo$1$1', 'Foo'], classes def test_nested_anonymous_inner_classes(self): """Test finding nested anonymous inner classes""" input = """\ // import java.util.*; public class NestedExample { public NestedExample() { Thread t = new Thread() { public void start() { Thread t = new Thread() { public void start() { try {Thread.sleep(200);} catch (Exception e) {} } }; while (true) { try {Thread.sleep(200);} catch (Exception e) {} } } }; } public static void main(String argv[]) { NestedExample e = new NestedExample(); } } """ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.4') expect = [ 'NestedExample$1', 'NestedExample$2', 'NestedExample' ] assert expect == classes, (expect, classes) pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.5') expect = [ 'NestedExample$1', 'NestedExample$1$1', 'NestedExample' ] assert expect == classes, (expect, classes) pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '6') expect = [ 'NestedExample$1', 'NestedExample$1$1', 'NestedExample' ] assert expect == classes, (expect, classes) def test_private_inner_class_instantiation(self): """Test anonymous inner class generated by private instantiation""" input = """\ class test { test() { super(); new inner(); } static class inner { private inner() {} } } """ # This is what we *should* generate, apparently due to the # private instantiation of the inner class, but don't today. #expect = [ 'test$1', 'test$inner', 'test' ] # What our parser currently generates, which doesn't match # what the Java compiler actually generates. expect = [ 'test$inner', 'test' ] pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.4') assert expect == classes, (expect, classes) pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.5') assert expect == classes, (expect, classes) def test_floating_point_numbers(self): """Test floating-point numbers in the input stream""" input = """ // Broken.java class Broken { /** * Detected. */ Object anonymousInnerOK = new Runnable() { public void run () {} }; /** * Detected. */ class InnerOK { InnerOK () { } } { System.out.println("a number: " + 1000.0 + ""); } /** * Not detected. */ Object anonymousInnerBAD = new Runnable() { public void run () {} }; /** * Not detected. */ class InnerBAD { InnerBAD () { } } } """ expect = ['Broken$1', 'Broken$InnerOK', 'Broken$2', 'Broken$InnerBAD', 'Broken'] pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.4') assert expect == classes, (expect, classes) pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.5') assert expect == classes, (expect, classes) def test_genercis(self): """Test that generics don't interfere with detecting anonymous classes""" input = """\ import java.util.Date; import java.util.Comparator; public class Foo { public void foo() { Comparator comp = new Comparator() { static final long serialVersionUID = 1L; public int compare(Date lhs, Date rhs) { return 0; } }; } } """ expect = [ 'Foo$1', 'Foo' ] pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.6') assert expect == classes, (expect, classes) pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '6') assert expect == classes, (expect, classes) if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ parse_javaTestCase ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging/0000775000175000017500000000000013160023044021377 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Tool/packaging/src_zip.py0000664000175000017500000000324313160023044023424 0ustar bdbaddogbdbaddog"""SCons.Tool.Packaging.zip The zip SRC packager. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/packaging/src_zip.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from SCons.Tool.packaging import putintopackageroot def package(env, target, source, PACKAGEROOT, **kw): bld = env['BUILDERS']['Zip'] bld.set_suffix('.zip') target, source = putintopackageroot(target, source, env, PACKAGEROOT, honor_install_location=0) return bld(env, target, source) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging/zip.py0000664000175000017500000000333013160023044022552 0ustar bdbaddogbdbaddog"""SCons.Tool.Packaging.zip The zip SRC packager. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/packaging/zip.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot def package(env, target, source, PACKAGEROOT, **kw): bld = env['BUILDERS']['Zip'] bld.set_suffix('.zip') target, source = stripinstallbuilder(target, source, env) target, source = putintopackageroot(target, source, env, PACKAGEROOT) return bld(env, target, source) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging/__init__.py0000664000175000017500000002456613160023044023525 0ustar bdbaddogbdbaddog"""SCons.Tool.Packaging SCons Packaging Tool. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/packaging/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Environment from SCons.Variables import * from SCons.Errors import * from SCons.Util import is_List, make_path_relative from SCons.Warnings import warn, Warning import os, imp import SCons.Defaults __all__ = [ 'src_targz', 'src_tarbz2', 'src_zip', 'tarbz2', 'targz', 'zip', 'rpm', 'msi', 'ipk' ] # # Utility and Builder function # def Tag(env, target, source, *more_tags, **kw_tags): """ Tag a file with the given arguments, just sets the accordingly named attribute on the file object. TODO: FIXME """ if not target: target=source first_tag=None else: first_tag=source if first_tag: kw_tags[first_tag[0]] = '' if len(kw_tags) == 0 and len(more_tags) == 0: raise UserError("No tags given.") # XXX: sanity checks for x in more_tags: kw_tags[x] = '' if not SCons.Util.is_List(target): target=[target] else: # hmm, sometimes the target list, is a list of a list # make sure it is flattened prior to processing. # TODO: perhaps some bug ?!? target=env.Flatten(target) for t in target: for (k,v) in kw_tags.items(): # all file tags have to start with PACKAGING_, so we can later # differentiate between "normal" object attributes and the # packaging attributes. As the user should not be bothered with # that, the prefix will be added here if missing. if k[:10] != 'PACKAGING_': k='PACKAGING_'+k t.Tag(k, v) def Package(env, target=None, source=None, **kw): """ Entry point for the package tool. """ # check if we need to find the source files ourself if not source: source = env.FindInstalledFiles() if len(source)==0: raise UserError("No source for Package() given") # decide which types of packages shall be built. Can be defined through # four mechanisms: command line argument, keyword argument, # environment argument and default selection( zip or tar.gz ) in that # order. try: kw['PACKAGETYPE']=env['PACKAGETYPE'] except KeyError: pass if not kw.get('PACKAGETYPE'): from SCons.Script import GetOption kw['PACKAGETYPE'] = GetOption('package_type') if kw['PACKAGETYPE'] == None: if 'Tar' in env['BUILDERS']: kw['PACKAGETYPE']='targz' elif 'Zip' in env['BUILDERS']: kw['PACKAGETYPE']='zip' else: raise UserError("No type for Package() given") PACKAGETYPE=kw['PACKAGETYPE'] if not is_List(PACKAGETYPE): PACKAGETYPE=PACKAGETYPE.split(',') # load the needed packagers. def load_packager(type): try: file,path,desc=imp.find_module(type, __path__) return imp.load_module(type, file, path, desc) except ImportError as e: raise EnvironmentError("packager %s not available: %s"%(type,str(e))) packagers=list(map(load_packager, PACKAGETYPE)) # set up targets and the PACKAGEROOT try: # fill up the target list with a default target name until the PACKAGETYPE # list is of the same size as the target list. if not target: target = [] size_diff = len(PACKAGETYPE)-len(target) default_name = "%(NAME)s-%(VERSION)s" if size_diff>0: default_target = default_name%kw target.extend( [default_target]*size_diff ) if 'PACKAGEROOT' not in kw: kw['PACKAGEROOT'] = default_name%kw except KeyError as e: raise SCons.Errors.UserError( "Missing Packagetag '%s'"%e.args[0] ) # setup the source files source=env.arg2nodes(source, env.fs.Entry) # call the packager to setup the dependencies. targets=[] try: for packager in packagers: t=[target.pop(0)] t=packager.package(env,t,source, **kw) targets.extend(t) assert( len(target) == 0 ) except KeyError as e: raise SCons.Errors.UserError( "Missing Packagetag '%s' for %s packager"\ % (e.args[0],packager.__name__) ) except TypeError as e: # this exception means that a needed argument for the packager is # missing. As our packagers get their "tags" as named function # arguments we need to find out which one is missing. from inspect import getargspec args,varargs,varkw,defaults=getargspec(packager.package) if defaults!=None: args=args[:-len(defaults)] # throw away arguments with default values args.remove('env') args.remove('target') args.remove('source') # now remove any args for which we have a value in kw. args=[x for x in args if x not in kw] if len(args)==0: raise # must be a different error, so re-raise elif len(args)==1: raise SCons.Errors.UserError( "Missing Packagetag '%s' for %s packager"\ % (args[0],packager.__name__) ) else: raise SCons.Errors.UserError( "Missing Packagetags '%s' for %s packager"\ % (", ".join(args),packager.__name__) ) target=env.arg2nodes(target, env.fs.Entry) targets.extend(env.Alias( 'package', targets )) return targets # # SCons tool initialization functions # added = None def generate(env): from SCons.Script import AddOption global added if not added: added = 1 AddOption('--package-type', dest='package_type', default=None, type="string", action="store", help='The type of package to create.') try: env['BUILDERS']['Package'] env['BUILDERS']['Tag'] except KeyError: env['BUILDERS']['Package'] = Package env['BUILDERS']['Tag'] = Tag def exists(env): return 1 # XXX def options(opts): opts.AddVariables( EnumVariable( 'PACKAGETYPE', 'the type of package to create.', None, allowed_values=list(map( str, __all__ )), ignorecase=2 ) ) # # Internal utility functions # def copy_attr(f1, f2): """ copies the special packaging file attributes from f1 to f2. """ copyit = lambda x: not hasattr(f2, x) and x[:10] == 'PACKAGING_' if f1._tags: pattrs = [tag for tag in f1._tags if copyit(tag)] for attr in pattrs: f2.Tag(attr, f1.GetTag(attr)) def putintopackageroot(target, source, env, pkgroot, honor_install_location=1): """ Uses the CopyAs builder to copy all source files to the directory given in pkgroot. If honor_install_location is set and the copied source file has an PACKAGING_INSTALL_LOCATION attribute, the PACKAGING_INSTALL_LOCATION is used as the new name of the source file under pkgroot. The source file will not be copied if it is already under the the pkgroot directory. All attributes of the source file will be copied to the new file. """ # make sure the packageroot is a Dir object. if SCons.Util.is_String(pkgroot): pkgroot=env.Dir(pkgroot) if not SCons.Util.is_List(source): source=[source] new_source = [] for file in source: if SCons.Util.is_String(file): file = env.File(file) if file.is_under(pkgroot): new_source.append(file) else: if file.GetTag('PACKAGING_INSTALL_LOCATION') and\ honor_install_location: new_name=make_path_relative(file.GetTag('PACKAGING_INSTALL_LOCATION')) else: new_name=make_path_relative(file.get_path()) new_file=pkgroot.File(new_name) new_file=env.CopyAs(new_file, file)[0] copy_attr(file, new_file) new_source.append(new_file) return (target, new_source) def stripinstallbuilder(target, source, env): """ Strips the install builder action from the source list and stores the final installation location as the "PACKAGING_INSTALL_LOCATION" of the source of the source file. This effectively removes the final installed files from the source list while remembering the installation location. It also warns about files which have no install builder attached. """ def has_no_install_location(file): return not (file.has_builder() and\ hasattr(file.builder, 'name') and\ (file.builder.name=="InstallBuilder" or\ file.builder.name=="InstallAsBuilder")) if len([src for src in source if has_no_install_location(src)]): warn(Warning, "there are files to package which have no\ InstallBuilder attached, this might lead to irreproducible packages") n_source=[] for s in source: if has_no_install_location(s): n_source.append(s) else: for ss in s.sources: n_source.append(ss) copy_attr(s, ss) ss.Tag('PACKAGING_INSTALL_LOCATION', s.get_path()) return (target, n_source) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging/src_targz.py0000664000175000017500000000327313160023044023754 0ustar bdbaddogbdbaddog"""SCons.Tool.Packaging.targz The targz SRC packager. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/packaging/src_targz.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from SCons.Tool.packaging import putintopackageroot def package(env, target, source, PACKAGEROOT, **kw): bld = env['BUILDERS']['Tar'] bld.set_suffix('.tar.gz') target, source = putintopackageroot(target, source, env, PACKAGEROOT, honor_install_location=0) return bld(env, target, source, TARFLAGS='-zc') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging/tarbz2.py0000664000175000017500000000336413160023044023163 0ustar bdbaddogbdbaddog"""SCons.Tool.Packaging.tarbz2 The tarbz2 SRC packager. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot def package(env, target, source, PACKAGEROOT, **kw): bld = env['BUILDERS']['Tar'] bld.set_suffix('.tar.gz') target, source = putintopackageroot(target, source, env, PACKAGEROOT) target, source = stripinstallbuilder(target, source, env) return bld(env, target, source, TARFLAGS='-jc') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging/msi.py0000664000175000017500000004742713160023044022557 0ustar bdbaddogbdbaddog"""SCons.Tool.packaging.msi The msi packager. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/packaging/msi.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import SCons from SCons.Action import Action from SCons.Builder import Builder from xml.dom.minidom import * from xml.sax.saxutils import escape from SCons.Tool.packaging import stripinstallbuilder # # Utility functions # def convert_to_id(s, id_set): """ Some parts of .wxs need an Id attribute (for example: The File and Directory directives. The charset is limited to A-Z, a-z, digits, underscores, periods. Each Id must begin with a letter or with a underscore. Google for "CNDL0015" for information about this. Requirements: * the string created must only contain chars from the target charset. * the string created must have a minimal editing distance from the original string. * the string created must be unique for the whole .wxs file. Observation: * There are 62 chars in the charset. Idea: * filter out forbidden characters. Check for a collision with the help of the id_set. Add the number of the number of the collision at the end of the created string. Furthermore care for a correct start of the string. """ charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyz0123456789_.' if s[0] in '0123456789.': s += '_'+s id = [c for c in s if c in charset] # did we already generate an id for this file? try: return id_set[id][s] except KeyError: # no we did not, so initialize with the id if id not in id_set: id_set[id] = { s : id } # there is a collision, generate an id which is unique by appending # the collision number else: id_set[id][s] = id + str(len(id_set[id])) return id_set[id][s] def is_dos_short_file_name(file): """ Examine if the given file is in the 8.3 form. """ fname, ext = os.path.splitext(file) proper_ext = len(ext) == 0 or (2 <= len(ext) <= 4) # the ext contains the dot proper_fname = file.isupper() and len(fname) <= 8 return proper_ext and proper_fname def gen_dos_short_file_name(file, filename_set): """ See http://support.microsoft.com/default.aspx?scid=kb;en-us;Q142982 These are no complete 8.3 dos short names. The ~ char is missing and replaced with one character from the filename. WiX warns about such filenames, since a collision might occur. Google for "CNDL1014" for more information. """ # guard this to not confuse the generation if is_dos_short_file_name(file): return file fname, ext = os.path.splitext(file) # ext contains the dot # first try if it suffices to convert to upper file = file.upper() if is_dos_short_file_name(file): return file # strip forbidden characters. forbidden = '."/[]:;=, ' fname = [c for c in fname if c not in forbidden] # check if we already generated a filename with the same number: # thisis1.txt, thisis2.txt etc. duplicate, num = not None, 1 while duplicate: shortname = "%s%s" % (fname[:8-len(str(num))].upper(),\ str(num)) if len(ext) >= 2: shortname = "%s%s" % (shortname, ext[:4].upper()) duplicate, num = shortname in filename_set, num+1 assert( is_dos_short_file_name(shortname) ), 'shortname is %s, longname is %s' % (shortname, file) filename_set.append(shortname) return shortname def create_feature_dict(files): """ X_MSI_FEATURE and doc FileTag's can be used to collect files in a hierarchy. This function collects the files into this hierarchy. """ dict = {} def add_to_dict( feature, file ): if not SCons.Util.is_List( feature ): feature = [ feature ] for f in feature: if f not in dict: dict[ f ] = [ file ] else: dict[ f ].append( file ) for file in files: if hasattr( file, 'PACKAGING_X_MSI_FEATURE' ): add_to_dict(file.PACKAGING_X_MSI_FEATURE, file) elif hasattr( file, 'PACKAGING_DOC' ): add_to_dict( 'PACKAGING_DOC', file ) else: add_to_dict( 'default', file ) return dict def generate_guids(root): """ generates globally unique identifiers for parts of the xml which need them. Component tags have a special requirement. Their UUID is only allowed to change if the list of their contained resources has changed. This allows for clean removal and proper updates. To handle this requirement, the uuid is generated with an md5 hashing the whole subtree of a xml node. """ from hashlib import md5 # specify which tags need a guid and in which attribute this should be stored. needs_id = { 'Product' : 'Id', 'Package' : 'Id', 'Component' : 'Guid', } # find all XMl nodes matching the key, retrieve their attribute, hash their # subtree, convert hash to string and add as a attribute to the xml node. for (key,value) in needs_id.items(): node_list = root.getElementsByTagName(key) attribute = value for node in node_list: hash = md5(node.toxml()).hexdigest() hash_str = '%s-%s-%s-%s-%s' % ( hash[:8], hash[8:12], hash[12:16], hash[16:20], hash[20:] ) node.attributes[attribute] = hash_str def string_wxsfile(target, source, env): return "building WiX file %s"%( target[0].path ) def build_wxsfile(target, source, env): """ Compiles a .wxs file from the keywords given in env['msi_spec'] and by analyzing the tree of source nodes and their tags. """ file = open(target[0].get_abspath(), 'w') try: # Create a document with the Wix root tag doc = Document() root = doc.createElement( 'Wix' ) root.attributes['xmlns']='http://schemas.microsoft.com/wix/2003/01/wi' doc.appendChild( root ) filename_set = [] # this is to circumvent duplicates in the shortnames id_set = {} # this is to circumvent duplicates in the ids # Create the content build_wxsfile_header_section(root, env) build_wxsfile_file_section(root, source, env['NAME'], env['VERSION'], env['VENDOR'], filename_set, id_set) generate_guids(root) build_wxsfile_features_section(root, source, env['NAME'], env['VERSION'], env['SUMMARY'], id_set) build_wxsfile_default_gui(root) build_license_file(target[0].get_dir(), env) # write the xml to a file file.write( doc.toprettyxml() ) # call a user specified function if 'CHANGE_SPECFILE' in env: env['CHANGE_SPECFILE'](target, source) except KeyError as e: raise SCons.Errors.UserError( '"%s" package field for MSI is missing.' % e.args[0] ) # # setup function # def create_default_directory_layout(root, NAME, VERSION, VENDOR, filename_set): """ Create the wix default target directory layout and return the innermost directory. We assume that the XML tree delivered in the root argument already contains the Product tag. Everything is put under the PFiles directory property defined by WiX. After that a directory with the 'VENDOR' tag is placed and then a directory with the name of the project and its VERSION. This leads to the following TARGET Directory Layout: C:\\\\ Example: C:\Programme\Company\Product-1.2\ """ doc = Document() d1 = doc.createElement( 'Directory' ) d1.attributes['Id'] = 'TARGETDIR' d1.attributes['Name'] = 'SourceDir' d2 = doc.createElement( 'Directory' ) d2.attributes['Id'] = 'ProgramFilesFolder' d2.attributes['Name'] = 'PFiles' d3 = doc.createElement( 'Directory' ) d3.attributes['Id'] = 'VENDOR_folder' d3.attributes['Name'] = escape( gen_dos_short_file_name( VENDOR, filename_set ) ) d3.attributes['LongName'] = escape( VENDOR ) d4 = doc.createElement( 'Directory' ) project_folder = "%s-%s" % ( NAME, VERSION ) d4.attributes['Id'] = 'MY_DEFAULT_FOLDER' d4.attributes['Name'] = escape( gen_dos_short_file_name( project_folder, filename_set ) ) d4.attributes['LongName'] = escape( project_folder ) d1.childNodes.append( d2 ) d2.childNodes.append( d3 ) d3.childNodes.append( d4 ) root.getElementsByTagName('Product')[0].childNodes.append( d1 ) return d4 # # mandatory and optional file tags # def build_wxsfile_file_section(root, files, NAME, VERSION, VENDOR, filename_set, id_set): """ Builds the Component sections of the wxs file with their included files. Files need to be specified in 8.3 format and in the long name format, long filenames will be converted automatically. Features are specficied with the 'X_MSI_FEATURE' or 'DOC' FileTag. """ root = create_default_directory_layout( root, NAME, VERSION, VENDOR, filename_set ) components = create_feature_dict( files ) factory = Document() def get_directory( node, dir ): """ Returns the node under the given node representing the directory. Returns the component node if dir is None or empty. """ if dir == '' or not dir: return node Directory = node dir_parts = dir.split(os.path.sep) # to make sure that our directory ids are unique, the parent folders are # consecutively added to upper_dir upper_dir = '' # walk down the xml tree finding parts of the directory dir_parts = [d for d in dir_parts if d != ''] for d in dir_parts[:]: already_created = [c for c in Directory.childNodes if c.nodeName == 'Directory' and c.attributes['LongName'].value == escape(d)] if already_created != []: Directory = already_created[0] dir_parts.remove(d) upper_dir += d else: break for d in dir_parts: nDirectory = factory.createElement( 'Directory' ) nDirectory.attributes['LongName'] = escape( d ) nDirectory.attributes['Name'] = escape( gen_dos_short_file_name( d, filename_set ) ) upper_dir += d nDirectory.attributes['Id'] = convert_to_id( upper_dir, id_set ) Directory.childNodes.append( nDirectory ) Directory = nDirectory return Directory for file in files: drive, path = os.path.splitdrive( file.PACKAGING_INSTALL_LOCATION ) filename = os.path.basename( path ) dirname = os.path.dirname( path ) h = { # tagname : default value 'PACKAGING_X_MSI_VITAL' : 'yes', 'PACKAGING_X_MSI_FILEID' : convert_to_id(filename, id_set), 'PACKAGING_X_MSI_LONGNAME' : filename, 'PACKAGING_X_MSI_SHORTNAME' : gen_dos_short_file_name(filename, filename_set), 'PACKAGING_X_MSI_SOURCE' : file.get_path(), } # fill in the default tags given above. for k,v in [ (k, v) for (k,v) in h.items() if not hasattr(file, k) ]: setattr( file, k, v ) File = factory.createElement( 'File' ) File.attributes['LongName'] = escape( file.PACKAGING_X_MSI_LONGNAME ) File.attributes['Name'] = escape( file.PACKAGING_X_MSI_SHORTNAME ) File.attributes['Source'] = escape( file.PACKAGING_X_MSI_SOURCE ) File.attributes['Id'] = escape( file.PACKAGING_X_MSI_FILEID ) File.attributes['Vital'] = escape( file.PACKAGING_X_MSI_VITAL ) # create the Tag under which this file should appear Component = factory.createElement('Component') Component.attributes['DiskId'] = '1' Component.attributes['Id'] = convert_to_id( filename, id_set ) # hang the component node under the root node and the file node # under the component node. Directory = get_directory( root, dirname ) Directory.childNodes.append( Component ) Component.childNodes.append( File ) # # additional functions # def build_wxsfile_features_section(root, files, NAME, VERSION, SUMMARY, id_set): """ This function creates the tag based on the supplied xml tree. This is achieved by finding all s and adding them to a default target. It should be called after the tree has been built completly. We assume that a MY_DEFAULT_FOLDER Property is defined in the wxs file tree. Furthermore a top-level with the name and VERSION of the software will be created. An PACKAGING_X_MSI_FEATURE can either be a string, where the feature DESCRIPTION will be the same as its title or a Tuple, where the first part will be its title and the second its DESCRIPTION. """ factory = Document() Feature = factory.createElement('Feature') Feature.attributes['Id'] = 'complete' Feature.attributes['ConfigurableDirectory'] = 'MY_DEFAULT_FOLDER' Feature.attributes['Level'] = '1' Feature.attributes['Title'] = escape( '%s %s' % (NAME, VERSION) ) Feature.attributes['Description'] = escape( SUMMARY ) Feature.attributes['Display'] = 'expand' for (feature, files) in create_feature_dict(files).items(): SubFeature = factory.createElement('Feature') SubFeature.attributes['Level'] = '1' if SCons.Util.is_Tuple(feature): SubFeature.attributes['Id'] = convert_to_id( feature[0], id_set ) SubFeature.attributes['Title'] = escape(feature[0]) SubFeature.attributes['Description'] = escape(feature[1]) else: SubFeature.attributes['Id'] = convert_to_id( feature, id_set ) if feature=='default': SubFeature.attributes['Description'] = 'Main Part' SubFeature.attributes['Title'] = 'Main Part' elif feature=='PACKAGING_DOC': SubFeature.attributes['Description'] = 'Documentation' SubFeature.attributes['Title'] = 'Documentation' else: SubFeature.attributes['Description'] = escape(feature) SubFeature.attributes['Title'] = escape(feature) # build the componentrefs. As one of the design decision is that every # file is also a component we walk the list of files and create a # reference. for f in files: ComponentRef = factory.createElement('ComponentRef') ComponentRef.attributes['Id'] = convert_to_id( os.path.basename(f.get_path()), id_set ) SubFeature.childNodes.append(ComponentRef) Feature.childNodes.append(SubFeature) root.getElementsByTagName('Product')[0].childNodes.append(Feature) def build_wxsfile_default_gui(root): """ This function adds a default GUI to the wxs file """ factory = Document() Product = root.getElementsByTagName('Product')[0] UIRef = factory.createElement('UIRef') UIRef.attributes['Id'] = 'WixUI_Mondo' Product.childNodes.append(UIRef) UIRef = factory.createElement('UIRef') UIRef.attributes['Id'] = 'WixUI_ErrorProgressText' Product.childNodes.append(UIRef) def build_license_file(directory, spec): """ Creates a License.rtf file with the content of "X_MSI_LICENSE_TEXT" in the given directory """ name, text = '', '' try: name = spec['LICENSE'] text = spec['X_MSI_LICENSE_TEXT'] except KeyError: pass # ignore this as X_MSI_LICENSE_TEXT is optional if name!='' or text!='': file = open( os.path.join(directory.get_path(), 'License.rtf'), 'w' ) file.write('{\\rtf') if text!='': file.write(text.replace('\n', '\\par ')) else: file.write(name+'\\par\\par') file.write('}') file.close() # # mandatory and optional package tags # def build_wxsfile_header_section(root, spec): """ Adds the xml file node which define the package meta-data. """ # Create the needed DOM nodes and add them at the correct position in the tree. factory = Document() Product = factory.createElement( 'Product' ) Package = factory.createElement( 'Package' ) root.childNodes.append( Product ) Product.childNodes.append( Package ) # set "mandatory" default values if 'X_MSI_LANGUAGE' not in spec: spec['X_MSI_LANGUAGE'] = '1033' # select english # mandatory sections, will throw a KeyError if the tag is not available Product.attributes['Name'] = escape( spec['NAME'] ) Product.attributes['Version'] = escape( spec['VERSION'] ) Product.attributes['Manufacturer'] = escape( spec['VENDOR'] ) Product.attributes['Language'] = escape( spec['X_MSI_LANGUAGE'] ) Package.attributes['Description'] = escape( spec['SUMMARY'] ) # now the optional tags, for which we avoid the KeyErrror exception if 'DESCRIPTION' in spec: Package.attributes['Comments'] = escape( spec['DESCRIPTION'] ) if 'X_MSI_UPGRADE_CODE' in spec: Package.attributes['X_MSI_UPGRADE_CODE'] = escape( spec['X_MSI_UPGRADE_CODE'] ) # We hardcode the media tag as our current model cannot handle it. Media = factory.createElement('Media') Media.attributes['Id'] = '1' Media.attributes['Cabinet'] = 'default.cab' Media.attributes['EmbedCab'] = 'yes' root.getElementsByTagName('Product')[0].childNodes.append(Media) # this builder is the entry-point for .wxs file compiler. wxs_builder = Builder( action = Action( build_wxsfile, string_wxsfile ), ensure_suffix = '.wxs' ) def package(env, target, source, PACKAGEROOT, NAME, VERSION, DESCRIPTION, SUMMARY, VENDOR, X_MSI_LANGUAGE, **kw): # make sure that the Wix Builder is in the environment SCons.Tool.Tool('wix').generate(env) # get put the keywords for the specfile compiler. These are the arguments # given to the package function and all optional ones stored in kw, minus # the the source, target and env one. loc = locals() del loc['kw'] kw.update(loc) del kw['source'], kw['target'], kw['env'] # strip the install builder from the source files target, source = stripinstallbuilder(target, source, env) # put the arguments into the env and call the specfile builder. env['msi_spec'] = kw specfile = wxs_builder(* [env, target, source], **kw) # now call the WiX Tool with the built specfile added as a source. msifile = env.WiX(target, specfile) # return the target and source tuple. return (msifile, source+[specfile]) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging/ipk.py0000664000175000017500000001424113160023044022536 0ustar bdbaddogbdbaddog"""SCons.Tool.Packaging.ipk """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/packaging/ipk.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Builder import SCons.Node.FS import os from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot def package(env, target, source, PACKAGEROOT, NAME, VERSION, DESCRIPTION, SUMMARY, X_IPK_PRIORITY, X_IPK_SECTION, SOURCE_URL, X_IPK_MAINTAINER, X_IPK_DEPENDS, **kw): """ This function prepares the packageroot directory for packaging with the ipkg builder. """ SCons.Tool.Tool('ipkg').generate(env) # setup the Ipkg builder bld = env['BUILDERS']['Ipkg'] target, source = stripinstallbuilder(target, source, env) target, source = putintopackageroot(target, source, env, PACKAGEROOT) # This should be overrideable from the construction environment, # which it is by using ARCHITECTURE=. # Guessing based on what os.uname() returns at least allows it # to work for both i386 and x86_64 Linux systems. archmap = { 'i686' : 'i386', 'i586' : 'i386', 'i486' : 'i386', } buildarchitecture = os.uname()[4] buildarchitecture = archmap.get(buildarchitecture, buildarchitecture) if 'ARCHITECTURE' in kw: buildarchitecture = kw['ARCHITECTURE'] # setup the kw to contain the mandatory arguments to this function. # do this before calling any builder or setup function loc=locals() del loc['kw'] kw.update(loc) del kw['source'], kw['target'], kw['env'] # generate the specfile specfile = gen_ipk_dir(PACKAGEROOT, source, env, kw) # override the default target. if str(target[0])=="%s-%s"%(NAME, VERSION): target=[ "%s_%s_%s.ipk"%(NAME, VERSION, buildarchitecture) ] # now apply the Ipkg builder return bld(env, target, specfile, **kw) def gen_ipk_dir(proot, source, env, kw): # make sure the packageroot is a Dir object. if SCons.Util.is_String(proot): proot=env.Dir(proot) # create the specfile builder s_bld=SCons.Builder.Builder( action = build_specfiles, ) # create the specfile targets spec_target=[] control=proot.Dir('CONTROL') spec_target.append(control.File('control')) spec_target.append(control.File('conffiles')) spec_target.append(control.File('postrm')) spec_target.append(control.File('prerm')) spec_target.append(control.File('postinst')) spec_target.append(control.File('preinst')) # apply the builder to the specfile targets s_bld(env, spec_target, source, **kw) # the packageroot directory does now contain the specfiles. return proot def build_specfiles(source, target, env): """ Filter the targets for the needed files and use the variables in env to create the specfile. """ # # At first we care for the CONTROL/control file, which is the main file for ipk. # # For this we need to open multiple files in random order, so we store into # a dict so they can be easily accessed. # # opened_files={} def open_file(needle, haystack): try: return opened_files[needle] except KeyError: file=filter(lambda x: x.get_path().rfind(needle)!=-1, haystack)[0] opened_files[needle]=open(file.get_abspath(), 'w') return opened_files[needle] control_file=open_file('control', target) if 'X_IPK_DESCRIPTION' not in env: env['X_IPK_DESCRIPTION']="%s\n %s"%(env['SUMMARY'], env['DESCRIPTION'].replace('\n', '\n ')) content = """ Package: $NAME Version: $VERSION Priority: $X_IPK_PRIORITY Section: $X_IPK_SECTION Source: $SOURCE_URL Architecture: $ARCHITECTURE Maintainer: $X_IPK_MAINTAINER Depends: $X_IPK_DEPENDS Description: $X_IPK_DESCRIPTION """ control_file.write(env.subst(content)) # # now handle the various other files, which purpose it is to set post-, # pre-scripts and mark files as config files. # # We do so by filtering the source files for files which are marked with # the "config" tag and afterwards we do the same for x_ipk_postrm, # x_ipk_prerm, x_ipk_postinst and x_ipk_preinst tags. # # The first one will write the name of the file into the file # CONTROL/configfiles, the latter add the content of the x_ipk_* variable # into the same named file. # for f in [x for x in source if 'PACKAGING_CONFIG' in dir(x)]: config=open_file('conffiles') config.write(f.PACKAGING_INSTALL_LOCATION) config.write('\n') for str in 'POSTRM PRERM POSTINST PREINST'.split(): name="PACKAGING_X_IPK_%s"%str for f in [x for x in source if name in dir(x)]: file=open_file(name) file.write(env[str]) # # close all opened files for f in list(opened_files.values()): f.close() # call a user specified function if 'CHANGE_SPECFILE' in env: content += env['CHANGE_SPECFILE'](target) return 0 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging/targz.py0000664000175000017500000000336113160023044023103 0ustar bdbaddogbdbaddog"""SCons.Tool.Packaging.targz The targz SRC packager. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/packaging/targz.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot def package(env, target, source, PACKAGEROOT, **kw): bld = env['BUILDERS']['Tar'] bld.set_suffix('.tar.gz') target, source = stripinstallbuilder(target, source, env) target, source = putintopackageroot(target, source, env, PACKAGEROOT) return bld(env, target, source, TARFLAGS='-zc') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging/rpm.py0000664000175000017500000003056313160023044022556 0ustar bdbaddogbdbaddog"""SCons.Tool.Packaging.rpm The rpm packager. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/packaging/rpm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import SCons.Builder import SCons.Tool.rpmutils from SCons.Environment import OverrideEnvironment from SCons.Tool.packaging import stripinstallbuilder, src_targz from SCons.Errors import UserError def package(env, target, source, PACKAGEROOT, NAME, VERSION, PACKAGEVERSION, DESCRIPTION, SUMMARY, X_RPM_GROUP, LICENSE, **kw): # initialize the rpm tool SCons.Tool.Tool('rpm').generate(env) bld = env['BUILDERS']['Rpm'] # Generate a UserError whenever the target name has been set explicitly, # since rpm does not allow for controlling it. This is detected by # checking if the target has been set to the default by the Package() # Environment function. if str(target[0])!="%s-%s"%(NAME, VERSION): raise UserError( "Setting target is not supported for rpm." ) else: # This should be overridable from the construction environment, # which it is by using ARCHITECTURE=. buildarchitecture = SCons.Tool.rpmutils.defaultMachine() if 'ARCHITECTURE' in kw: buildarchitecture = kw['ARCHITECTURE'] fmt = '%s-%s-%s.%s.rpm' srcrpm = fmt % (NAME, VERSION, PACKAGEVERSION, 'src') binrpm = fmt % (NAME, VERSION, PACKAGEVERSION, buildarchitecture) target = [ srcrpm, binrpm ] # get the correct arguments into the kw hash loc=locals() del loc['kw'] kw.update(loc) del kw['source'], kw['target'], kw['env'] # if no "SOURCE_URL" tag is given add a default one. if 'SOURCE_URL' not in kw: kw['SOURCE_URL']=(str(target[0])+".tar.gz").replace('.rpm', '') # mangle the source and target list for the rpmbuild env = OverrideEnvironment(env, kw) target, source = stripinstallbuilder(target, source, env) target, source = addspecfile(target, source, env) target, source = collectintargz(target, source, env) # now call the rpm builder to actually build the packet. return bld(env, target, source, **kw) def collectintargz(target, source, env): """ Puts all source files into a tar.gz file. """ # the rpm tool depends on a source package, until this is changed # this hack needs to be here that tries to pack all sources in. sources = env.FindSourceFiles() # filter out the target we are building the source list for. sources = [s for s in sources if s not in target] # find the .spec file for rpm and add it since it is not necessarily found # by the FindSourceFiles function. sources.extend( [s for s in source if str(s).rfind('.spec')!=-1] ) # sort to keep sources from changing order across builds sources.sort() # as the source contains the url of the source package this rpm package # is built from, we extract the target name tarball = (str(target[0])+".tar.gz").replace('.rpm', '') try: tarball = env['SOURCE_URL'].split('/')[-1] except KeyError as e: raise SCons.Errors.UserError( "Missing PackageTag '%s' for RPM packager" % e.args[0] ) tarball = src_targz.package(env, source=sources, target=tarball, PACKAGEROOT=env['PACKAGEROOT'], ) return (target, tarball) def addspecfile(target, source, env): specfile = "%s-%s" % (env['NAME'], env['VERSION']) bld = SCons.Builder.Builder(action = build_specfile, suffix = '.spec', target_factory = SCons.Node.FS.File) source.extend(bld(env, specfile, source)) return (target,source) def build_specfile(target, source, env): """ Builds a RPM specfile from a dictionary with string metadata and by analyzing a tree of nodes. """ file = open(target[0].get_abspath(), 'w') try: file.write( build_specfile_header(env) ) file.write( build_specfile_sections(env) ) file.write( build_specfile_filesection(env, source) ) file.close() # call a user specified function if 'CHANGE_SPECFILE' in env: env['CHANGE_SPECFILE'](target, source) except KeyError as e: raise SCons.Errors.UserError( '"%s" package field for RPM is missing.' % e.args[0] ) # # mandatory and optional package tag section # def build_specfile_sections(spec): """ Builds the sections of a rpm specfile. """ str = "" mandatory_sections = { 'DESCRIPTION' : '\n%%description\n%s\n\n', } str = str + SimpleTagCompiler(mandatory_sections).compile( spec ) optional_sections = { 'DESCRIPTION_' : '%%description -l %s\n%s\n\n', 'CHANGELOG' : '%%changelog\n%s\n\n', 'X_RPM_PREINSTALL' : '%%pre\n%s\n\n', 'X_RPM_POSTINSTALL' : '%%post\n%s\n\n', 'X_RPM_PREUNINSTALL' : '%%preun\n%s\n\n', 'X_RPM_POSTUNINSTALL' : '%%postun\n%s\n\n', 'X_RPM_VERIFY' : '%%verify\n%s\n\n', # These are for internal use but could possibly be overridden 'X_RPM_PREP' : '%%prep\n%s\n\n', 'X_RPM_BUILD' : '%%build\n%s\n\n', 'X_RPM_INSTALL' : '%%install\n%s\n\n', 'X_RPM_CLEAN' : '%%clean\n%s\n\n', } # Default prep, build, install and clean rules # TODO: optimize those build steps, to not compile the project a second time if 'X_RPM_PREP' not in spec: spec['X_RPM_PREP'] = '[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"' + '\n%setup -q' if 'X_RPM_BUILD' not in spec: spec['X_RPM_BUILD'] = '[ ! -e "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && mkdir "$RPM_BUILD_ROOT"' if 'X_RPM_INSTALL' not in spec: spec['X_RPM_INSTALL'] = 'scons --install-sandbox="$RPM_BUILD_ROOT" "$RPM_BUILD_ROOT"' if 'X_RPM_CLEAN' not in spec: spec['X_RPM_CLEAN'] = '[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"' str = str + SimpleTagCompiler(optional_sections, mandatory=0).compile( spec ) return str def build_specfile_header(spec): """ Builds all sections but the %file of a rpm specfile """ str = "" # first the mandatory sections mandatory_header_fields = { 'NAME' : '%%define name %s\nName: %%{name}\n', 'VERSION' : '%%define version %s\nVersion: %%{version}\n', 'PACKAGEVERSION' : '%%define release %s\nRelease: %%{release}\n', 'X_RPM_GROUP' : 'Group: %s\n', 'SUMMARY' : 'Summary: %s\n', 'LICENSE' : 'License: %s\n', } str = str + SimpleTagCompiler(mandatory_header_fields).compile( spec ) # now the optional tags optional_header_fields = { 'VENDOR' : 'Vendor: %s\n', 'X_RPM_URL' : 'Url: %s\n', 'SOURCE_URL' : 'Source: %s\n', 'SUMMARY_' : 'Summary(%s): %s\n', 'X_RPM_DISTRIBUTION' : 'Distribution: %s\n', 'X_RPM_ICON' : 'Icon: %s\n', 'X_RPM_PACKAGER' : 'Packager: %s\n', 'X_RPM_GROUP_' : 'Group(%s): %s\n', 'X_RPM_REQUIRES' : 'Requires: %s\n', 'X_RPM_PROVIDES' : 'Provides: %s\n', 'X_RPM_CONFLICTS' : 'Conflicts: %s\n', 'X_RPM_BUILDREQUIRES' : 'BuildRequires: %s\n', 'X_RPM_SERIAL' : 'Serial: %s\n', 'X_RPM_EPOCH' : 'Epoch: %s\n', 'X_RPM_AUTOREQPROV' : 'AutoReqProv: %s\n', 'X_RPM_EXCLUDEARCH' : 'ExcludeArch: %s\n', 'X_RPM_EXCLUSIVEARCH' : 'ExclusiveArch: %s\n', 'X_RPM_PREFIX' : 'Prefix: %s\n', # internal use 'X_RPM_BUILDROOT' : 'BuildRoot: %s\n', } # fill in default values: # Adding a BuildRequires renders the .rpm unbuildable under System, which # are not managed by rpm, since the database to resolve this dependency is # missing (take Gentoo as an example) # if not s.has_key('x_rpm_BuildRequires'): # s['x_rpm_BuildRequires'] = 'scons' if 'X_RPM_BUILDROOT' not in spec: spec['X_RPM_BUILDROOT'] = '%{_tmppath}/%{name}-%{version}-%{release}' str = str + SimpleTagCompiler(optional_header_fields, mandatory=0).compile( spec ) return str # # mandatory and optional file tags # def build_specfile_filesection(spec, files): """ builds the %file section of the specfile """ str = '%files\n' if 'X_RPM_DEFATTR' not in spec: spec['X_RPM_DEFATTR'] = '(-,root,root)' str = str + '%%defattr %s\n' % spec['X_RPM_DEFATTR'] supported_tags = { 'PACKAGING_CONFIG' : '%%config %s', 'PACKAGING_CONFIG_NOREPLACE' : '%%config(noreplace) %s', 'PACKAGING_DOC' : '%%doc %s', 'PACKAGING_UNIX_ATTR' : '%%attr %s', 'PACKAGING_LANG_' : '%%lang(%s) %s', 'PACKAGING_X_RPM_VERIFY' : '%%verify %s', 'PACKAGING_X_RPM_DIR' : '%%dir %s', 'PACKAGING_X_RPM_DOCDIR' : '%%docdir %s', 'PACKAGING_X_RPM_GHOST' : '%%ghost %s', } for file in files: # build the tagset tags = {} for k in list(supported_tags.keys()): try: v = file.GetTag(k) if v: tags[k] = v except AttributeError: pass # compile the tagset str = str + SimpleTagCompiler(supported_tags, mandatory=0).compile( tags ) str = str + ' ' str = str + file.GetTag('PACKAGING_INSTALL_LOCATION') str = str + '\n\n' return str class SimpleTagCompiler(object): """ This class is a simple string substition utility: the replacement specfication is stored in the tagset dictionary, something like: { "abc" : "cdef %s ", "abc_" : "cdef %s %s" } the compile function gets a value dictionary, which may look like: { "abc" : "ghij", "abc_gh" : "ij" } The resulting string will be: "cdef ghij cdef gh ij" """ def __init__(self, tagset, mandatory=1): self.tagset = tagset self.mandatory = mandatory def compile(self, values): """ Compiles the tagset and returns a str containing the result """ def is_international(tag): return tag.endswith('_') def get_country_code(tag): return tag[-2:] def strip_country_code(tag): return tag[:-2] replacements = list(self.tagset.items()) str = "" domestic = [t for t in replacements if not is_international(t[0])] for key, replacement in domestic: try: str = str + replacement % values[key] except KeyError as e: if self.mandatory: raise e international = [t for t in replacements if is_international(t[0])] for key, replacement in international: try: x = [t for t in values.items() if strip_country_code(t[0]) == key] int_values_for_key = [(get_country_code(t[0]),t[1]) for t in x] for v in int_values_for_key: str = str + replacement % v except KeyError as e: if self.mandatory: raise e return str # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging/__init__.xml0000664000175000017500000003573513160023044023675 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &b-Package; Builder. Builds software distribution packages. Packages consist of files to install and packaging information. The former may be specified with the &source; parameter and may be left out, in which case the &FindInstalledFiles; function will collect all files that have an &b-Install; or &b-InstallAs; Builder attached. If the ⌖ is not specified it will be deduced from additional information given to this Builder. The packaging information is specified with the help of construction variables documented below. This information is called a tag to stress that some of them can also be attached to files with the &Tag; function. The mandatory ones will complain if they were not specified. They vary depending on chosen target packager. The target packager may be selected with the "PACKAGETYPE" command line option or with the &cv-PACKAGETYPE; construction variable. Currently the following packagers available: * msi - Microsoft Installer * rpm - Redhat Package Manger * ipkg - Itsy Package Management System * tarbz2 - compressed tar * targz - compressed tar * zip - zip file * src_tarbz2 - compressed tar source * src_targz - compressed tar source * src_zip - zip file source An updated list is always available under the "package_type" option when running "scons --help" on a project that has packaging activated. env = Environment(tools=['default', 'packaging']) env.Install('/bin/', 'my_program') env.Package( NAME = 'foo', VERSION = '1.2.3', PACKAGEVERSION = 0, PACKAGETYPE = 'rpm', LICENSE = 'gpl', SUMMARY = 'balalalalal', DESCRIPTION = 'this should be really really long', X_RPM_GROUP = 'Application/fu', SOURCE_URL = 'http://foo.org/foo-1.2.3.tar.gz' ) Specifies the system architecture for which the package is being built. The default is the system architecture of the machine on which SCons is running. This is used to fill in the Architecture: field in an Ipkg control file, and as part of the name of a generated RPM file. A hook for modifying the file that controls the packaging build (the .spec for RPM, the control for Ipkg, the .wxs for MSI). If set, the function will be called after the SCons template for the file has been written. XXX The name of a file containing the change log text to be included in the package. This is included as the %changelog section of the RPM .spec file. A long description of the project being packaged. This is included in the relevant section of the file that controls the packaging build. A language-specific long description for the specified lang. This is used to populate a %description -l section of an RPM .spec file. The abbreviated name of the license under which this project is released (gpl, lpgl, bsd etc.). See http://www.opensource.org/licenses/alphabetical for a list of license names. Specfies the name of the project to package. Specifies the directory where all files in resulting archive will be placed if applicable. The default value is "$NAME-$VERSION". Selects the package type to build. Currently these are available: * msi - Microsoft Installer * rpm - Redhat Package Manger * ipkg - Itsy Package Management System * tarbz2 - compressed tar * targz - compressed tar * zip - zip file * src_tarbz2 - compressed tar source * src_targz - compressed tar source * src_zip - zip file source This may be overridden with the "package_type" command line option. The version of the package (not the underlying project). This is currently only used by the rpm packager and should reflect changes in the packaging, not the underlying project code itself. The URL (web address) of the location from which the project was retrieved. This is used to fill in the Source: field in the controlling information for Ipkg and RPM packages. A short summary of what the project is about. This is used to fill in the Summary: field in the controlling information for Ipkg and RPM packages, and as the Description: field in MSI packages. The person or organization who supply the packaged software. This is used to fill in the Vendor: field in the controlling information for RPM packages, and the Manufacturer: field in the controlling information for MSI packages. The version of the project, specified as a string. This is used to fill in the Depends: field in the controlling information for Ipkg packages. This is used to fill in the Description: field in the controlling information for Ipkg packages. The default value is $SUMMARY\n$DESCRIPTION This is used to fill in the Maintainer: field in the controlling information for Ipkg packages. This is used to fill in the Priority: field in the controlling information for Ipkg packages. This is used to fill in the Section: field in the controlling information for Ipkg packages. This is used to fill in the Language: attribute in the controlling information for MSI packages. The text of the software license in RTF format. Carriage return characters will be replaced with the RTF equivalent \\par. TODO This is used to fill in the AutoReqProv: field in the RPM .spec file. internal, but overridable This is used to fill in the BuildRequires: field in the RPM .spec file. internal, but overridable internal, but overridable This is used to fill in the Conflicts: field in the RPM .spec file. This value is used as the default attributes for the files in the RPM package. The default value is (-,root,root). This is used to fill in the Distribution: field in the RPM .spec file. This is used to fill in the Epoch: field in the controlling information for RPM packages. This is used to fill in the ExcludeArch: field in the RPM .spec file. This is used to fill in the ExclusiveArch: field in the RPM .spec file. This is used to fill in the Group: field in the RPM .spec file. This is used to fill in the Group(lang): field in the RPM .spec file. Note that lang is not literal and should be replaced by the appropriate language code. This is used to fill in the Icon: field in the RPM .spec file. internal, but overridable This is used to fill in the Packager: field in the RPM .spec file. This is used to fill in the Provides: field in the RPM .spec file. This is used to fill in the %post: section in the RPM .spec file. This is used to fill in the %pre: section in the RPM .spec file. This is used to fill in the Prefix: field in the RPM .spec file. internal, but overridable This is used to fill in the %postun: section in the RPM .spec file. This is used to fill in the %preun: section in the RPM .spec file. This is used to fill in the Requires: field in the RPM .spec file. This is used to fill in the Serial: field in the RPM .spec file. This is used to fill in the Url: field in the RPM .spec file. (node, tags) Annotates file or directory Nodes with information about how the &b-link-Package; Builder should package those files or directories. All tags are optional. Examples: # makes sure the built library will be installed with 0644 file # access mode Tag( Library( 'lib.c' ), UNIX_ATTR="0644" ) # marks file2.txt to be a documentation file Tag( 'file2.txt', DOC ) scons-src-3.0.0/src/engine/SCons/Tool/packaging/src_tarbz2.py0000664000175000017500000000330013160023044024020 0ustar bdbaddogbdbaddog"""SCons.Tool.Packaging.tarbz2 The tarbz2 SRC packager. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from SCons.Tool.packaging import putintopackageroot def package(env, target, source, PACKAGEROOT, **kw): bld = env['BUILDERS']['Tar'] bld.set_suffix('.tar.bz2') target, source = putintopackageroot(target, source, env, PACKAGEROOT, honor_install_location=0) return bld(env, target, source, TARFLAGS='-jc') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/rpcgen.xml0000664000175000017500000001005413160023044021453 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for building with RPCGEN. RPCGEN RPCGENFLAGS RPCGENCLIENTFLAGS RPCGENHEADERFLAGS RPCGENSERVICEFLAGS RPCGENXDRFLAGS Generates an RPC client stub (_clnt.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files in the local directory, the command will be executed in the source file's directory by default. # Builds src/rpcif_clnt.c env.RPCGenClient('src/rpcif.x') Generates an RPC header (.h) file from a specified RPC (.x) source file. Because rpcgen only builds output files in the local directory, the command will be executed in the source file's directory by default. # Builds src/rpcif.h env.RPCGenHeader('src/rpcif.x') Generates an RPC server-skeleton (_svc.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files in the local directory, the command will be executed in the source file's directory by default. # Builds src/rpcif_svc.c env.RPCGenClient('src/rpcif.x') Generates an RPC XDR routine (_xdr.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files in the local directory, the command will be executed in the source file's directory by default. # Builds src/rpcif_xdr.c env.RPCGenClient('src/rpcif.x') The RPC protocol compiler. Options passed to the RPC protocol compiler when generating client side stubs. These are in addition to any flags specified in the &cv-link-RPCGENFLAGS; construction variable. General options passed to the RPC protocol compiler. Options passed to the RPC protocol compiler when generating a header file. These are in addition to any flags specified in the &cv-link-RPCGENFLAGS; construction variable. Options passed to the RPC protocol compiler when generating server side stubs. These are in addition to any flags specified in the &cv-link-RPCGENFLAGS; construction variable. Options passed to the RPC protocol compiler when generating XDR routines. These are in addition to any flags specified in the &cv-link-RPCGENFLAGS; construction variable. scons-src-3.0.0/src/engine/SCons/Tool/icl.py0000664000175000017500000000361413160023044020600 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.icl Tool-specific initialization for the Intel C/C++ compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/icl.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Tool.intelc # This has been completely superseded by intelc.py, which can # handle both Windows and Linux versions. def generate(*args, **kw): """Add Builders and construction variables for icl to an Environment.""" return SCons.Tool.intelc.generate(*args, **kw) def exists(*args, **kw): return SCons.Tool.intelc.exists(*args, **kw) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/hpcc.py0000664000175000017500000000346713160023044020754 0ustar bdbaddogbdbaddog"""SCons.Tool.hpcc Tool-specific initialization for HP aCC and cc. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/hpcc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util from . import cc def generate(env): """Add Builders and construction variables for aCC & cc to an Environment.""" cc.generate(env) env['CXX'] = 'aCC' env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS +Z') def exists(env): return env.Detect('aCC') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sunc++.xml0000664000175000017500000000216713160023044021301 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Sun C++ compiler. CXX SHCXX CXXVERSION SHCXXFLAGS SHOBJPREFIX SHOBJSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/hplink.xml0000664000175000017500000000210113160023044021454 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the linker on HP/UX systems. LINKFLAGS SHLINKFLAGS SHLIBSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/javac.xml0000664000175000017500000001614013160023044021263 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &javac; compiler. JAVAC JAVACFLAGS JAVACCOM JAVACLASSSUFFIX JAVASUFFIX JAVABOOTCLASSPATH JAVACLASSPATH JAVASOURCEPATH JAVACCOMSTR Builds one or more Java class files. The sources may be any combination of explicit .java files, or directory trees which will be scanned for .java files. SCons will parse each source .java file to find the classes (including inner classes) defined within that file, and from that figure out the target .class files that will be created. The class files will be placed underneath the specified target directory. SCons will also search each Java file for the Java package name, which it assumes can be found on a line beginning with the string package in the first column; the resulting .class files will be placed in a directory reflecting the specified package name. For example, the file Foo.java defining a single public Foo class and containing a package name of sub.dir will generate a corresponding sub/dir/Foo.class class file. Examples: env.Java(target = 'classes', source = 'src') env.Java(target = 'classes', source = ['src1', 'src2']) env.Java(target = 'classes', source = ['File1.java', 'File2.java']) Java source files can use the native encoding for the underlying OS. Since SCons compiles in simple ASCII mode by default, the compiler will generate warnings about unmappable characters, which may lead to errors as the file is processed further. In this case, the user must specify the LANG environment variable to tell the compiler what encoding is used. For portibility, it's best if the encoding is hard-coded so that the compile will work if it is done on a system with a different encoding. env = Environment() env['ENV']['LANG'] = 'en_GB.UTF-8' Specifies the list of directories that will be added to the &javac; command line via the option. The individual directory names will be separated by the operating system's path separate character (: on UNIX/Linux/POSIX, ; on Windows). The Java compiler. The command line used to compile a directory tree containing Java source files to corresponding Java class files. Any options specified in the &cv-link-JAVACFLAGS; construction variable are included on this command line. The string displayed when compiling a directory tree of Java source files to corresponding Java class files. If this is not set, then &cv-link-JAVACCOM; (the command line) is displayed. env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES") General options that are passed to the Java compiler. The directory in which Java class files may be found. This is stripped from the beginning of any Java .class file names supplied to the JavaH builder. Specifies the list of directories that will be searched for Java .class file. The directories in this list will be added to the &javac; and &javah; command lines via the option. The individual directory names will be separated by the operating system's path separate character (: on UNIX/Linux/POSIX, ; on Windows). Note that this currently just adds the specified directory via the option. &SCons; does not currently search the &cv-JAVACLASSPATH; directories for dependency .class files. The suffix for Java class files; .class by default. Specifies the list of directories that will be searched for input .java file. The directories in this list will be added to the &javac; command line via the option. The individual directory names will be separated by the operating system's path separate character (: on UNIX/Linux/POSIX, ; on Windows). Note that this currently just adds the specified directory via the option. &SCons; does not currently search the &cv-JAVASOURCEPATH; directories for dependency .java files. The suffix for Java files; .java by default. Specifies the Java version being used by the &b-Java; builder. This is not currently used to select one version of the Java compiler vs. another. Instead, you should set this to specify the version of Java supported by your &javac; compiler. The default is 1.4. This is sometimes necessary because Java 1.5 changed the file names that are created for nested anonymous inner classes, which can cause a mismatch with the files that &SCons; expects will be generated by the &javac; compiler. Setting &cv-JAVAVERSION; to 1.5 (or 1.6, as appropriate) can make &SCons; realize that a Java 1.5 or 1.6 build is actually up to date. scons-src-3.0.0/src/engine/SCons/Tool/aixlink.py0000664000175000017500000000541413160023041021465 0ustar bdbaddogbdbaddog"""SCons.Tool.aixlink Tool-specific initialization for the IBM Visual Age linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/aixlink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import SCons.Util from . import aixcc from . import link import SCons.Tool.cxx cplusplus = SCons.Tool.cxx #cplusplus = __import__('cxx', globals(), locals(), []) def smart_linkflags(source, target, env, for_signature): if cplusplus.iscplusplus(source): build_dir = env.subst('$BUILDDIR', target=target, source=source) if build_dir: return '-qtempinc=' + os.path.join(build_dir, 'tempinc') return '' def generate(env): """ Add Builders and construction variables for Visual Age linker to an Environment. """ link.generate(env) env['SMARTLINKFLAGS'] = smart_linkflags env['LINKFLAGS'] = SCons.Util.CLVar('$SMARTLINKFLAGS') env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -qmkshrobj -qsuppress=1501-218') env['SHLIBSUFFIX'] = '.a' def exists(env): # TODO: sync with link.smart_link() to choose a linker linkers = { 'CXX': ['aixc++'], 'CC': ['aixcc'] } alltools = [] for langvar, linktools in linkers.items(): if langvar in env: # use CC over CXX when user specified CC but not CXX return SCons.Tool.FindTool(linktools, env) alltools.extend(linktools) return SCons.Tool.FindTool(alltools, env) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sgiar.py0000664000175000017500000000477313160023044021145 0ustar bdbaddogbdbaddog"""SCons.Tool.sgiar Tool-specific initialization for SGI ar (library archive). If CC exists, static libraries should be built with it, so the prelinker has a chance to resolve C++ template instantiations. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sgiar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Util def generate(env): """Add Builders and construction variables for ar to an Environment.""" SCons.Tool.createStaticLibBuilder(env) if env.Detect('CC'): env['AR'] = 'CC' env['ARFLAGS'] = SCons.Util.CLVar('-ar') env['ARCOM'] = '$AR $ARFLAGS -o $TARGET $SOURCES' else: env['AR'] = 'ar' env['ARFLAGS'] = SCons.Util.CLVar('r') env['ARCOM'] = '$AR $ARFLAGS $TARGET $SOURCES' env['SHLINK'] = '$LINK' env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') env['SHLINKCOM'] = '$SHLINK $SHLINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['LIBPREFIX'] = 'lib' env['LIBSUFFIX'] = '.a' def exists(env): return env.Detect('CC') or env.Detect('ar') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/hpc++.py0000664000175000017500000000314113160023044020724 0ustar bdbaddogbdbaddog"""SCons.Tool.hpc++ Tool-specific initialization for c++ on HP/UX. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/hpc++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" #forward proxy to the preffered cxx version from SCons.Tool.hpcxx import * # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/aixf77.py0000664000175000017500000000523213160023041021131 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.aixf77 Tool-specific initialization for IBM Visual Age f77 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/aixf77.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path #import SCons.Platform.aix from . import f77 # It would be good to look for the AIX F77 package the same way we're now # looking for the C and C++ packages. This should be as easy as supplying # the correct package names in the following list and uncommenting the # SCons.Platform.aix_get_xlc() call in the function below. packages = [] def get_xlf77(env): xlf77 = env.get('F77', 'xlf77') xlf77_r = env.get('SHF77', 'xlf77_r') #return SCons.Platform.aix.get_xlc(env, xlf77, xlf77_r, packages) return (None, xlf77, xlf77_r, None) def generate(env): """ Add Builders and construction variables for the Visual Age FORTRAN compiler to an Environment. """ path, _f77, _shf77, version = get_xlf77(env) if path: _f77 = os.path.join(path, _f77) _shf77 = os.path.join(path, _shf77) f77.generate(env) env['F77'] = _f77 env['SHF77'] = _shf77 def exists(env): path, _f77, _shf77, version = get_xlf77(env) if path and _f77: xlf77 = os.path.join(path, _f77) if os.path.exists(xlf77): return xlf77 return None # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/clangxx.py0000664000175000017500000000613313160023041021471 0ustar bdbaddogbdbaddog# -*- coding: utf-8; -*- """SCons.Tool.clang++ Tool-specific initialization for clang++. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # __revision__ = "src/engine/SCons/Tool/clangxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" # Based on SCons/Tool/g++.py by PaweÅ‚ Tomulik 2014 as a separate tool. # Brought into the SCons mainline by Russel Winder 2017. import os.path import re import subprocess import sys import SCons.Tool import SCons.Util import SCons.Tool.cxx compilers = ['clang++'] def generate(env): """Add Builders and construction variables for clang++ to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) SCons.Tool.cxx.generate(env) env['CXX'] = env.Detect(compilers) or 'clang++' # platform specific settings if env['PLATFORM'] == 'aix': env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc') env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 env['SHOBJSUFFIX'] = '$OBJSUFFIX' elif env['PLATFORM'] == 'hpux': env['SHOBJSUFFIX'] = '.pic.o' elif env['PLATFORM'] == 'sunos': env['SHOBJSUFFIX'] = '.pic.o' # determine compiler version if env['CXX']: pipe = SCons.Action._subproc(env, [env['CXX'], '--version'], stdin='devnull', stderr='devnull', stdout=subprocess.PIPE) if pipe.wait() != 0: return # clang -dumpversion is of no use line = pipe.stdout.readline() if sys.version_info[0] > 2: line = line.decode() match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line) if match: env['CXXVERSION'] = match.group(1) def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/jar.py0000664000175000017500000001007713160023044020606 0ustar bdbaddogbdbaddog"""SCons.Tool.jar Tool-specific initialization for jar. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/jar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Subst import SCons.Util def jarSources(target, source, env, for_signature): """Only include sources that are not a manifest file.""" try: env['JARCHDIR'] except KeyError: jarchdir_set = False else: jarchdir_set = True jarchdir = env.subst('$JARCHDIR', target=target, source=source) if jarchdir: jarchdir = env.fs.Dir(jarchdir) result = [] for src in source: contents = src.get_text_contents() if contents[:16] != "Manifest-Version": if jarchdir_set: _chdir = jarchdir else: try: _chdir = src.attributes.java_classdir except AttributeError: _chdir = None if _chdir: # If we are changing the dir with -C, then sources should # be relative to that directory. src = SCons.Subst.Literal(src.get_path(_chdir)) result.append('-C') result.append(_chdir) result.append(src) return result def jarManifest(target, source, env, for_signature): """Look in sources for a manifest file, if any.""" for src in source: contents = src.get_text_contents() if contents[:16] == "Manifest-Version": return src return '' def jarFlags(target, source, env, for_signature): """If we have a manifest, make sure that the 'm' flag is specified.""" jarflags = env.subst('$JARFLAGS', target=target, source=source) for src in source: contents = src.get_text_contents() if contents[:16] == "Manifest-Version": if not 'm' in jarflags: return jarflags + 'm' break return jarflags def generate(env): """Add Builders and construction variables for jar to an Environment.""" SCons.Tool.CreateJarBuilder(env) env['JAR'] = 'jar' env['JARFLAGS'] = SCons.Util.CLVar('cf') env['_JARFLAGS'] = jarFlags env['_JARMANIFEST'] = jarManifest env['_JARSOURCES'] = jarSources env['_JARCOM'] = '$JAR $_JARFLAGS $TARGET $_JARMANIFEST $_JARSOURCES' env['JARCOM'] = "${TEMPFILE('$_JARCOM','$JARCOMSTR')}" env['JARSUFFIX'] = '.jar' def exists(env): # As reported by Jan Nijtmans in issue #2730, the simple # return env.Detect('jar') # doesn't always work during initialization. For now, we # stop trying to detect an executable (analogous to the # javac Builder). # TODO: Come up with a proper detect() routine...and enable it. return 1 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sunlink.py0000664000175000017500000000501313160023045021510 0ustar bdbaddogbdbaddog"""SCons.Tool.sunlink Tool-specific initialization for the Sun Solaris (Forte) linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sunlink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import SCons.Util from . import link ccLinker = None # search for the acc compiler and linker front end try: dirs = os.listdir('/opt') except (IOError, OSError): # Not being able to read the directory because it doesn't exist # (IOError) or isn't readable (OSError) is okay. dirs = [] for d in dirs: linker = '/opt/' + d + '/bin/CC' if os.path.exists(linker): ccLinker = linker break def generate(env): """Add Builders and construction variables for Forte to an Environment.""" link.generate(env) env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -G') env['RPATHPREFIX'] = '-R' env['RPATHSUFFIX'] = '' env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}' # Support for versioned libraries link._setup_versioned_lib_variables(env, tool = 'sunlink', use_soname = True) env['LINKCALLBACKS'] = link._versioned_lib_callbacks() def exists(env): return ccLinker # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/qt.py0000664000175000017500000003223213160023044020453 0ustar bdbaddogbdbaddog """SCons.Tool.qt Tool-specific initialization for Qt. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/Tool/qt.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import re import SCons.Action import SCons.Builder import SCons.Defaults import SCons.Scanner import SCons.Tool import SCons.Util class ToolQtWarning(SCons.Warnings.Warning): pass class GeneratedMocFileNotIncluded(ToolQtWarning): pass class QtdirNotFound(ToolQtWarning): pass SCons.Warnings.enableWarningClass(ToolQtWarning) header_extensions = [".h", ".hxx", ".hpp", ".hh"] if SCons.Util.case_sensitive_suffixes('.h', '.H'): header_extensions.append('.H') import SCons.Tool.cxx cplusplus = SCons.Tool.cxx #cplusplus = __import__('cxx', globals(), locals(), []) cxx_suffixes = cplusplus.CXXSuffixes def checkMocIncluded(target, source, env): moc = target[0] cpp = source[0] # looks like cpp.includes is cleared before the build stage :-( # not really sure about the path transformations (moc.cwd? cpp.cwd?) :-/ path = SCons.Defaults.CScan.path(env, moc.cwd) includes = SCons.Defaults.CScan(cpp, env, path) if not moc in includes: SCons.Warnings.warn( GeneratedMocFileNotIncluded, "Generated moc file '%s' is not included by '%s'" % (str(moc), str(cpp))) def find_file(filename, paths, node_factory): for dir in paths: node = node_factory(filename, dir) if node.rexists(): return node return None class _Automoc(object): """ Callable class, which works as an emitter for Programs, SharedLibraries and StaticLibraries. """ def __init__(self, objBuilderName): self.objBuilderName = objBuilderName def __call__(self, target, source, env): """ Smart autoscan function. Gets the list of objects for the Program or Lib. Adds objects and builders for the special qt files. """ try: if int(env.subst('$QT_AUTOSCAN')) == 0: return target, source except ValueError: pass try: debug = int(env.subst('$QT_DEBUG')) except ValueError: debug = 0 # some shortcuts used in the scanner splitext = SCons.Util.splitext objBuilder = getattr(env, self.objBuilderName) # some regular expressions: # Q_OBJECT detection q_object_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]') # cxx and c comment 'eater' #comment = re.compile(r'(//.*)|(/\*(([^*])|(\*[^/]))*\*/)') # CW: something must be wrong with the regexp. See also bug #998222 # CURRENTLY THERE IS NO TEST CASE FOR THAT # The following is kind of hacky to get builders working properly (FIXME) objBuilderEnv = objBuilder.env objBuilder.env = env mocBuilderEnv = env.Moc.env env.Moc.env = env # make a deep copy for the result; MocH objects will be appended out_sources = source[:] for obj in source: if not obj.has_builder(): # binary obj file provided if debug: print("scons: qt: '%s' seems to be a binary. Discarded." % str(obj)) continue cpp = obj.sources[0] if not splitext(str(cpp))[1] in cxx_suffixes: if debug: print("scons: qt: '%s' is no cxx file. Discarded." % str(cpp)) # c or fortran source continue #cpp_contents = comment.sub('', cpp.get_text_contents()) if debug: print("scons: qt: Getting contents of %s" % cpp) cpp_contents = cpp.get_text_contents() h=None for h_ext in header_extensions: # try to find the header file in the corresponding source # directory hname = splitext(cpp.name)[0] + h_ext h = find_file(hname, (cpp.get_dir(),), env.File) if h: if debug: print("scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp))) #h_contents = comment.sub('', h.get_text_contents()) h_contents = h.get_text_contents() break if not h and debug: print("scons: qt: no header for '%s'." % (str(cpp))) if h and q_object_search.search(h_contents): # h file with the Q_OBJECT macro found -> add moc_cpp moc_cpp = env.Moc(h) moc_o = objBuilder(moc_cpp) out_sources.append(moc_o) #moc_cpp.target_scanner = SCons.Defaults.CScan if debug: print("scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp))) if cpp and q_object_search.search(cpp_contents): # cpp file with Q_OBJECT macro found -> add moc # (to be included in cpp) moc = env.Moc(cpp) env.Ignore(moc, moc) if debug: print("scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc))) #moc.source_scanner = SCons.Defaults.CScan # restore the original env attributes (FIXME) objBuilder.env = objBuilderEnv env.Moc.env = mocBuilderEnv return (target, out_sources) AutomocShared = _Automoc('SharedObject') AutomocStatic = _Automoc('StaticObject') def _detect(env): """Not really safe, but fast method to detect the QT library""" QTDIR = None if not QTDIR: QTDIR = env.get('QTDIR',None) if not QTDIR: QTDIR = os.environ.get('QTDIR',None) if not QTDIR: moc = env.WhereIs('moc') if moc: QTDIR = os.path.dirname(os.path.dirname(moc)) SCons.Warnings.warn( QtdirNotFound, "Could not detect qt, using moc executable as a hint (QTDIR=%s)" % QTDIR) else: QTDIR = None SCons.Warnings.warn( QtdirNotFound, "Could not detect qt, using empty QTDIR") return QTDIR def uicEmitter(target, source, env): adjustixes = SCons.Util.adjustixes bs = SCons.Util.splitext(str(source[0].name))[0] bs = os.path.join(str(target[0].get_dir()),bs) # first target (header) is automatically added by builder if len(target) < 2: # second target is implementation target.append(adjustixes(bs, env.subst('$QT_UICIMPLPREFIX'), env.subst('$QT_UICIMPLSUFFIX'))) if len(target) < 3: # third target is moc file target.append(adjustixes(bs, env.subst('$QT_MOCHPREFIX'), env.subst('$QT_MOCHSUFFIX'))) return target, source def uicScannerFunc(node, env, path): lookout = [] lookout.extend(env['CPPPATH']) lookout.append(str(node.rfile().dir)) includes = re.findall("(.*?)", node.get_text_contents()) result = [] for incFile in includes: dep = env.FindFile(incFile,lookout) if dep: result.append(dep) return result uicScanner = SCons.Scanner.Base(uicScannerFunc, name = "UicScanner", node_class = SCons.Node.FS.File, node_factory = SCons.Node.FS.File, recursive = 0) def generate(env): """Add Builders and construction variables for qt to an Environment.""" CLVar = SCons.Util.CLVar Action = SCons.Action.Action Builder = SCons.Builder.Builder env.SetDefault(QTDIR = _detect(env), QT_BINPATH = os.path.join('$QTDIR', 'bin'), QT_CPPPATH = os.path.join('$QTDIR', 'include'), QT_LIBPATH = os.path.join('$QTDIR', 'lib'), QT_MOC = os.path.join('$QT_BINPATH','moc'), QT_UIC = os.path.join('$QT_BINPATH','uic'), QT_LIB = 'qt', # may be set to qt-mt QT_AUTOSCAN = 1, # scan for moc'able sources # Some QT specific flags. I don't expect someone wants to # manipulate those ... QT_UICIMPLFLAGS = CLVar(''), QT_UICDECLFLAGS = CLVar(''), QT_MOCFROMHFLAGS = CLVar(''), QT_MOCFROMCXXFLAGS = CLVar('-i'), # suffixes/prefixes for the headers / sources to generate QT_UICDECLPREFIX = '', QT_UICDECLSUFFIX = '.h', QT_UICIMPLPREFIX = 'uic_', QT_UICIMPLSUFFIX = '$CXXFILESUFFIX', QT_MOCHPREFIX = 'moc_', QT_MOCHSUFFIX = '$CXXFILESUFFIX', QT_MOCCXXPREFIX = '', QT_MOCCXXSUFFIX = '.moc', QT_UISUFFIX = '.ui', # Commands for the qt support ... # command to generate header, implementation and moc-file # from a .ui file QT_UICCOM = [ CLVar('$QT_UIC $QT_UICDECLFLAGS -o ${TARGETS[0]} $SOURCE'), CLVar('$QT_UIC $QT_UICIMPLFLAGS -impl ${TARGETS[0].file} ' '-o ${TARGETS[1]} $SOURCE'), CLVar('$QT_MOC $QT_MOCFROMHFLAGS -o ${TARGETS[2]} ${TARGETS[0]}')], # command to generate meta object information for a class # declarated in a header QT_MOCFROMHCOM = ( '$QT_MOC $QT_MOCFROMHFLAGS -o ${TARGETS[0]} $SOURCE'), # command to generate meta object information for a class # declarated in a cpp file QT_MOCFROMCXXCOM = [ CLVar('$QT_MOC $QT_MOCFROMCXXFLAGS -o ${TARGETS[0]} $SOURCE'), Action(checkMocIncluded,None)]) # ... and the corresponding builders uicBld = Builder(action=SCons.Action.Action('$QT_UICCOM', '$QT_UICCOMSTR'), emitter=uicEmitter, src_suffix='$QT_UISUFFIX', suffix='$QT_UICDECLSUFFIX', prefix='$QT_UICDECLPREFIX', source_scanner=uicScanner) mocBld = Builder(action={}, prefix={}, suffix={}) for h in header_extensions: act = SCons.Action.Action('$QT_MOCFROMHCOM', '$QT_MOCFROMHCOMSTR') mocBld.add_action(h, act) mocBld.prefix[h] = '$QT_MOCHPREFIX' mocBld.suffix[h] = '$QT_MOCHSUFFIX' for cxx in cxx_suffixes: act = SCons.Action.Action('$QT_MOCFROMCXXCOM', '$QT_MOCFROMCXXCOMSTR') mocBld.add_action(cxx, act) mocBld.prefix[cxx] = '$QT_MOCCXXPREFIX' mocBld.suffix[cxx] = '$QT_MOCCXXSUFFIX' # register the builders env['BUILDERS']['Uic'] = uicBld env['BUILDERS']['Moc'] = mocBld static_obj, shared_obj = SCons.Tool.createObjBuilders(env) static_obj.add_src_builder('Uic') shared_obj.add_src_builder('Uic') # We use the emitters of Program / StaticLibrary / SharedLibrary # to scan for moc'able files # We can't refer to the builders directly, we have to fetch them # as Environment attributes because that sets them up to be called # correctly later by our emitter. env.AppendUnique(PROGEMITTER =[AutomocStatic], SHLIBEMITTER=[AutomocShared], LDMODULEEMITTER=[AutomocShared], LIBEMITTER =[AutomocStatic], # Of course, we need to link against the qt libraries CPPPATH=["$QT_CPPPATH"], LIBPATH=["$QT_LIBPATH"], LIBS=['$QT_LIB']) def exists(env): return _detect(env) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/qt.xml0000664000175000017500000002332013160023044020621 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for building Qt applications. QTDIR QT_BINPATH QT_CPPPATH QT_LIBPATH QT_MOC QT_UIC QT_LIB QT_AUTOSCAN QT_UICIMPLFLAGS QT_UICDECLFLAGS QT_MOCFROMHFLAGS QT_MOCFROMCXXFLAGS QT_UICDECLPREFIX QT_UICDECLSUFFIX QT_UICIMPLPREFIX QT_UICIMPLSUFFIX QT_MOCHPREFIX QT_MOCHSUFFIX QT_MOCCXXPREFIX QT_MOCCXXSUFFIX QT_UISUFFIX QT_UICCOM QT_MOCFROMHCOM QT_MOCFROMCXXCOM Builds an output file from a moc input file. Moc input files are either header files or cxx files. This builder is only available after using the tool 'qt'. See the &cv-link-QTDIR; variable for more information. Example: env.Moc('foo.h') # generates moc_foo.cc env.Moc('foo.cpp') # generates foo.moc Builds a header file, an implementation file and a moc file from an ui file. and returns the corresponding nodes in the above order. This builder is only available after using the tool 'qt'. Note: you can specify .ui files directly as source files to the &b-Program;, &b-Library; and &b-SharedLibrary; builders without using this builder. Using this builder lets you override the standard naming conventions (be careful: prefixes are always prepended to names of built files; if you don't want prefixes, you may set them to ``). See the &cv-link-QTDIR; variable for more information. Example: env.Uic('foo.ui') # -> ['foo.h', 'uic_foo.cc', 'moc_foo.cc'] env.Uic(target = Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'), source = 'foo.ui') # -> ['include/foo.h', 'gen/uicfoo.cc', 'gen/mocfoo.cc'] The qt tool tries to take this from os.environ. It also initializes all QT_* construction variables listed below. (Note that all paths are constructed with python's os.path.join() method, but are listed here with the '/' separator for easier reading.) In addition, the construction environment variables &cv-link-CPPPATH;, &cv-link-LIBPATH; and &cv-link-LIBS; may be modified and the variables &cv-link-PROGEMITTER;, &cv-link-SHLIBEMITTER; and &cv-link-LIBEMITTER; are modified. Because the build-performance is affected when using this tool, you have to explicitly specify it at Environment creation: Environment(tools=['default','qt']) The qt tool supports the following operations: Automatic moc file generation from header files. You do not have to specify moc files explicitly, the tool does it for you. However, there are a few preconditions to do so: Your header file must have the same filebase as your implementation file and must stay in the same directory. It must have one of the suffixes .h, .hpp, .H, .hxx, .hh. You can turn off automatic moc file generation by setting QT_AUTOSCAN to 0. See also the corresponding &b-Moc;() builder method. Automatic moc file generation from cxx files. As stated in the qt documentation, include the moc file at the end of the cxx file. Note that you have to include the file, which is generated by the transformation ${QT_MOCCXXPREFIX}<basename>${QT_MOCCXXSUFFIX}, by default <basename>.moc. A warning is generated after building the moc file, if you do not include the correct file. If you are using VariantDir, you may need to specify duplicate=1. You can turn off automatic moc file generation by setting QT_AUTOSCAN to 0. See also the corresponding &b-Moc; builder method. Automatic handling of .ui files. The implementation files generated from .ui files are handled much the same as yacc or lex files. Each .ui file given as a source of Program, Library or SharedLibrary will generate three files, the declaration file, the implementation file and a moc file. Because there are also generated headers, you may need to specify duplicate=1 in calls to VariantDir. See also the corresponding &b-Uic; builder method. Turn off scanning for mocable files. Use the Moc Builder to explicitly specify files to run moc on. The path where the qt binaries are installed. The default value is '&cv-link-QTDIR;/bin'. The path where the qt header files are installed. The default value is '&cv-link-QTDIR;/include'. Note: If you set this variable to None, the tool won't change the &cv-link-CPPPATH; construction variable. Prints lots of debugging information while scanning for moc files. Default value is 'qt'. You may want to set this to 'qt-mt'. Note: If you set this variable to None, the tool won't change the &cv-link-LIBS; variable. The path where the qt libraries are installed. The default value is '&cv-link-QTDIR;/lib'. Note: If you set this variable to None, the tool won't change the &cv-link-LIBPATH; construction variable. Default value is '&cv-link-QT_BINPATH;/moc'. Default value is ''. Prefix for moc output files, when source is a cxx file. Default value is '.moc'. Suffix for moc output files, when source is a cxx file. Default value is '-i'. These flags are passed to moc, when moccing a C++ file. Command to generate a moc file from a cpp file. The string displayed when generating a moc file from a cpp file. If this is not set, then &cv-link-QT_MOCFROMCXXCOM; (the command line) is displayed. Command to generate a moc file from a header. The string displayed when generating a moc file from a cpp file. If this is not set, then &cv-link-QT_MOCFROMHCOM; (the command line) is displayed. Default value is ''. These flags are passed to moc, when moccing a header file. Default value is 'moc_'. Prefix for moc output files, when source is a header. Default value is '&cv-link-CXXFILESUFFIX;'. Suffix for moc output files, when source is a header. Default value is '&cv-link-QT_BINPATH;/uic'. Command to generate header files from .ui files. The string displayed when generating header files from .ui files. If this is not set, then &cv-link-QT_UICCOM; (the command line) is displayed. Default value is ''. These flags are passed to uic, when creating a a h file from a .ui file. Default value is ''. Prefix for uic generated header files. Default value is '.h'. Suffix for uic generated header files. Default value is ''. These flags are passed to uic, when creating a cxx file from a .ui file. Default value is 'uic_'. Prefix for uic generated implementation files. Default value is '&cv-link-CXXFILESUFFIX;'. Suffix for uic generated implementation files. Default value is '.ui'. Suffix of designer input files. scons-src-3.0.0/src/engine/SCons/Tool/aixc++.xml0000664000175000017500000000214613160023041021247 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the IMB xlc / Visual Age C++ compiler. CXX SHCXX CXXVERSION SHOBJSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/JavaCommon.py0000664000175000017500000003074613160023041022066 0ustar bdbaddogbdbaddog"""SCons.Tool.JavaCommon Stuff for processing Java. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/JavaCommon.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import re java_parsing = 1 default_java_version = '1.4' if java_parsing: # Parse Java files for class names. # # This is a really cool parser from Charles Crain # that finds appropriate class names in Java source. # A regular expression that will find, in a java file: # newlines; # double-backslashes; # a single-line comment "//"; # single or double quotes preceeded by a backslash; # single quotes, double quotes, open or close braces, semi-colons, # periods, open or close parentheses; # floating-point numbers; # any alphanumeric token (keyword, class name, specifier); # any alphanumeric token surrounded by angle brackets (generics); # the multi-line comment begin and end tokens /* and */; # array declarations "[]". _reToken = re.compile(r'(\n|\\\\|//|\\[\'"]|[\'"\{\}\;\.\(\)]|' + r'\d*\.\d*|[A-Za-z_][\w\$\.]*|<[A-Za-z_]\w+>|' + r'/\*|\*/|\[\])') class OuterState(object): """The initial state for parsing a Java file for classes, interfaces, and anonymous inner classes.""" def __init__(self, version=default_java_version): if not version in ('1.1', '1.2', '1.3','1.4', '1.5', '1.6', '1.7', '1.8', '5', '6'): msg = "Java version %s not supported" % version raise NotImplementedError(msg) self.version = version self.listClasses = [] self.listOutputs = [] self.stackBrackets = [] self.brackets = 0 self.nextAnon = 1 self.localClasses = [] self.stackAnonClassBrackets = [] self.anonStacksStack = [[0]] self.package = None def trace(self): pass def __getClassState(self): try: return self.classState except AttributeError: ret = ClassState(self) self.classState = ret return ret def __getPackageState(self): try: return self.packageState except AttributeError: ret = PackageState(self) self.packageState = ret return ret def __getAnonClassState(self): try: return self.anonState except AttributeError: self.outer_state = self ret = SkipState(1, AnonClassState(self)) self.anonState = ret return ret def __getSkipState(self): try: return self.skipState except AttributeError: ret = SkipState(1, self) self.skipState = ret return ret def __getAnonStack(self): return self.anonStacksStack[-1] def openBracket(self): self.brackets = self.brackets + 1 def closeBracket(self): self.brackets = self.brackets - 1 if len(self.stackBrackets) and \ self.brackets == self.stackBrackets[-1]: self.listOutputs.append('$'.join(self.listClasses)) self.localClasses.pop() self.listClasses.pop() self.anonStacksStack.pop() self.stackBrackets.pop() if len(self.stackAnonClassBrackets) and \ self.brackets == self.stackAnonClassBrackets[-1]: self.__getAnonStack().pop() self.stackAnonClassBrackets.pop() def parseToken(self, token): if token[:2] == '//': return IgnoreState('\n', self) elif token == '/*': return IgnoreState('*/', self) elif token == '{': self.openBracket() elif token == '}': self.closeBracket() elif token in [ '"', "'" ]: return IgnoreState(token, self) elif token == "new": # anonymous inner class if len(self.listClasses) > 0: return self.__getAnonClassState() return self.__getSkipState() # Skip the class name elif token in ['class', 'interface', 'enum']: if len(self.listClasses) == 0: self.nextAnon = 1 self.stackBrackets.append(self.brackets) return self.__getClassState() elif token == 'package': return self.__getPackageState() elif token == '.': # Skip the attribute, it might be named "class", in which # case we don't want to treat the following token as # an inner class name... return self.__getSkipState() return self def addAnonClass(self): """Add an anonymous inner class""" if self.version in ('1.1', '1.2', '1.3', '1.4'): clazz = self.listClasses[0] self.listOutputs.append('%s$%d' % (clazz, self.nextAnon)) elif self.version in ('1.5', '1.6', '1.7', '1.8', '5', '6'): self.stackAnonClassBrackets.append(self.brackets) className = [] className.extend(self.listClasses) self.__getAnonStack()[-1] = self.__getAnonStack()[-1] + 1 for anon in self.__getAnonStack(): className.append(str(anon)) self.listOutputs.append('$'.join(className)) self.nextAnon = self.nextAnon + 1 self.__getAnonStack().append(0) def setPackage(self, package): self.package = package class AnonClassState(object): """A state that looks for anonymous inner classes.""" def __init__(self, old_state): # outer_state is always an instance of OuterState self.outer_state = old_state.outer_state self.old_state = old_state self.brace_level = 0 def parseToken(self, token): # This is an anonymous class if and only if the next # non-whitespace token is a bracket. Everything between # braces should be parsed as normal java code. if token[:2] == '//': return IgnoreState('\n', self) elif token == '/*': return IgnoreState('*/', self) elif token == '\n': return self elif token[0] == '<' and token[-1] == '>': return self elif token == '(': self.brace_level = self.brace_level + 1 return self if self.brace_level > 0: if token == 'new': # look further for anonymous inner class return SkipState(1, AnonClassState(self)) elif token in [ '"', "'" ]: return IgnoreState(token, self) elif token == ')': self.brace_level = self.brace_level - 1 return self if token == '{': self.outer_state.addAnonClass() return self.old_state.parseToken(token) class SkipState(object): """A state that will skip a specified number of tokens before reverting to the previous state.""" def __init__(self, tokens_to_skip, old_state): self.tokens_to_skip = tokens_to_skip self.old_state = old_state def parseToken(self, token): self.tokens_to_skip = self.tokens_to_skip - 1 if self.tokens_to_skip < 1: return self.old_state return self class ClassState(object): """A state we go into when we hit a class or interface keyword.""" def __init__(self, outer_state): # outer_state is always an instance of OuterState self.outer_state = outer_state def parseToken(self, token): # the next non-whitespace token should be the name of the class if token == '\n': return self # If that's an inner class which is declared in a method, it # requires an index prepended to the class-name, e.g. # 'Foo$1Inner' # http://scons.tigris.org/issues/show_bug.cgi?id=2087 if self.outer_state.localClasses and \ self.outer_state.stackBrackets[-1] > \ self.outer_state.stackBrackets[-2]+1: locals = self.outer_state.localClasses[-1] try: idx = locals[token] locals[token] = locals[token]+1 except KeyError: locals[token] = 1 token = str(locals[token]) + token self.outer_state.localClasses.append({}) self.outer_state.listClasses.append(token) self.outer_state.anonStacksStack.append([0]) return self.outer_state class IgnoreState(object): """A state that will ignore all tokens until it gets to a specified token.""" def __init__(self, ignore_until, old_state): self.ignore_until = ignore_until self.old_state = old_state def parseToken(self, token): if self.ignore_until == token: return self.old_state return self class PackageState(object): """The state we enter when we encounter the package keyword. We assume the next token will be the package name.""" def __init__(self, outer_state): # outer_state is always an instance of OuterState self.outer_state = outer_state def parseToken(self, token): self.outer_state.setPackage(token) return self.outer_state def parse_java_file(fn, version=default_java_version): return parse_java(open(fn, 'r').read(), version) def parse_java(contents, version=default_java_version, trace=None): """Parse a .java file and return a double of package directory, plus a list of .class files that compiling that .java file will produce""" package = None initial = OuterState(version) currstate = initial for token in _reToken.findall(contents): # The regex produces a bunch of groups, but only one will # have anything in it. currstate = currstate.parseToken(token) if trace: trace(token, currstate) if initial.package: package = initial.package.replace('.', os.sep) return (package, initial.listOutputs) else: # Don't actually parse Java files for class names. # # We might make this a configurable option in the future if # Java-file parsing takes too long (although it shouldn't relative # to how long the Java compiler itself seems to take...). def parse_java_file(fn): """ "Parse" a .java file. This actually just splits the file name, so the assumption here is that the file name matches the public class name, and that the path to the file is the same as the package name. """ return os.path.split(file) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/icl.xml0000664000175000017500000000203213160023044020741 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Intel C/C++ compiler. Calls the &t-intelc; Tool module to set its variables. scons-src-3.0.0/src/engine/SCons/Tool/msvc.xml0000664000175000017500000003040213160023044021144 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Microsoft Visual C/C++ compiler. CCPDBFLAGS CCPCHFLAGS CC CCFLAGS CFLAGS CCCOM SHCC SHCCFLAGS SHCFLAGS SHCCCOM CXX CXXFLAGS CXXCOM SHCXX SHCXXFLAGS SHCXXCOM CPPDEFPREFIX CPPDEFSUFFIX INCPREFIX INCSUFFIX RC RCFLAGS RCCOM BUILDERS OBJPREFIX OBJSUFFIX SHOBJPREFIX SHOBJSUFFIX CFILESUFFIX CXXFILESUFFIX PCHPDBFLAGS PCHCOM CCCOMSTR SHCCCOMSTR CXXCOMSTR SHCXXCOMSTR PCH PCHSTOP PDB Builds a Microsoft Visual C++ precompiled header. Calling this builder method returns a list of two targets: the PCH as the first element, and the object file as the second element. Normally the object file is ignored. This builder method is only provided when Microsoft Visual C++ is being used as the compiler. The PCH builder method is generally used in conjunction with the PCH construction variable to force object files to use the precompiled header: env['PCH'] = env.PCH('StdAfx.cpp')[0] Builds a Microsoft Visual C++ resource file. This builder method is only provided when Microsoft Visual C++ or MinGW is being used as the compiler. The .res (or .o for MinGW) suffix is added to the target name if no other suffix is given. The source file is scanned for implicit dependencies as though it were a C file. Example: env.RES('resource.rc') Options added to the compiler command line to support building with precompiled headers. The default value expands expands to the appropriate Microsoft Visual C++ command-line options when the &cv-link-PCH; construction variable is set. Options added to the compiler command line to support storing debugging information in a Microsoft Visual C++ PDB file. The default value expands expands to appropriate Microsoft Visual C++ command-line options when the &cv-link-PDB; construction variable is set. The Visual C++ compiler option that SCons uses by default to generate PDB information is . This works correctly with parallel () builds because it embeds the debug information in the intermediate object files, as opposed to sharing a single PDB file between multiple object files. This is also the only way to get debug information embedded into a static library. Using the instead may yield improved link-time performance, although parallel builds will no longer work. You can generate PDB files with the switch by overriding the default &cv-link-CCPDBFLAGS; variable as follows: env['CCPDBFLAGS'] = ['${(PDB and "/Zi /Fd%s" % File(PDB)) or ""}'] An alternative would be to use the to put the debugging information in a separate .pdb file for each object file by overriding the &cv-link-CCPDBFLAGS; variable as follows: env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb' When set to any true value, specifies that SCons should batch compilation of object files when calling the Microsoft Visual C/C++ compiler. All compilations of source files from the same source directory that generate target files in a same output directory and were configured in SCons using the same construction environment will be built in a single call to the compiler. Only source files that have changed since their object files were built will be passed to each compiler invocation (via the &cv-link-CHANGED_SOURCES; construction variable). Any compilations where the object (target) file base name (minus the .obj) does not match the source file base name will be compiled separately. The Microsoft Visual C++ precompiled header that will be used when compiling object files. This variable is ignored by tools other than Microsoft Visual C++. When this variable is defined SCons will add options to the compiler command line to cause it to use the precompiled header, and will also set up the dependencies for the PCH file. Example: env['PCH'] = 'StdAfx.pch' The command line used by the &b-PCH; builder to generated a precompiled header. The string displayed when generating a precompiled header. If this is not set, then &cv-link-PCHCOM; (the command line) is displayed. A construction variable that, when expanded, adds the /yD flag to the command line only if the &cv-PDB; construction variable is set. This variable specifies how much of a source file is precompiled. This variable is ignored by tools other than Microsoft Visual C++, or when the PCH variable is not being used. When this variable is define it must be a string that is the name of the header that is included at the end of the precompiled portion of the source files, or the empty string if the "#pragma hrdstop" construct is being used: env['PCHSTOP'] = 'StdAfx.h' The resource compiler used to build a Microsoft Visual C++ resource file. The command line used to build a Microsoft Visual C++ resource file. The string displayed when invoking the resource compiler to build a Microsoft Visual C++ resource file. If this is not set, then &cv-link-RCCOM; (the command line) is displayed. The flags passed to the resource compiler by the RES builder. An automatically-generated construction variable containing the command-line options for specifying directories to be searched by the resource compiler. The value of &cv-RCINCFLAGS; is created by appending &cv-RCINCPREFIX; and &cv-RCINCSUFFIX; to the beginning and end of each directory in &cv-CPPPATH;. The prefix (flag) used to specify an include directory on the resource compiler command line. This will be appended to the beginning of each directory in the &cv-CPPPATH; construction variable when the &cv-RCINCFLAGS; variable is expanded. The suffix used to specify an include directory on the resource compiler command line. This will be appended to the end of each directory in the &cv-CPPPATH; construction variable when the &cv-RCINCFLAGS; variable is expanded. Sets the preferred version of Microsoft Visual C/C++ to use. If &cv-MSVC_VERSION; is not set, SCons will (by default) select the latest version of Visual C/C++ installed on your system. If the specified version isn't installed, tool initialization will fail. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. Valid values for Windows are 14.0, 14.0Exp, 12.0, 12.0Exp, 11.0, 11.0Exp, 10.0, 10.0Exp, 9.0, 9.0Exp, 8.0, 8.0Exp, 7.1, 7.0, and 6.0. Versions ending in Exp refer to "Express" or "Express for Desktop" editions. Use a batch script to set up Microsoft Visual Studio compiler &cv-MSVC_USE_SCRIPT; overrides &cv-MSVC_VERSION; and &cv-TARGET_ARCH;. If set to the name of a Visual Studio .bat file (e.g. vcvars.bat), SCons will run that bat file and extract the relevant variables from the result (typically %INCLUDE%, %LIB%, and %PATH%). Setting MSVC_USE_SCRIPT to None bypasses the Visual Studio autodetection entirely; use this if you are running SCons in a Visual Studio cmd window and importing the shell's environment variables. Sets the host architecture for Visual Studio compiler. If not set, default to the detected host architecture: note that this may depend on the python you are using. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. Valid values are the same as for &cv-TARGET_ARCH;. This is currently only used on Windows, but in the future it will be used on other OSes as well. Sets the target architecture for Visual Studio compiler (i.e. the arch of the binaries generated by the compiler). If not set, default to &cv-HOST_ARCH;, or, if that is unset, to the architecture of the running machine's OS (note that the python build or architecture has no effect). This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. This is currently only used on Windows, but in the future it will be used on other OSes as well. Valid values for Windows are x86, i386 (for 32 bits); amd64, emt64, x86_64 (for 64 bits); and ia64 (Itanium). For example, if you want to compile 64-bit binaries, you would set TARGET_ARCH='x86_64' in your SCons environment. Build libraries for a Universal Windows Platform (UWP) Application. If &cv-MSVC_UWP_APP; is set, the Visual Studio environment will be set up to point to the Windows Store compatible libraries and Visual Studio runtimes. In doing so, any libraries that are built will be able to be used in a UWP App and published to the Windows Store. This flag will only have an effect with Visual Studio 2015+. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. Valid values are '1' or '0' scons-src-3.0.0/src/engine/SCons/Tool/fortran.xml0000664000175000017500000002354013160023044021654 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for generic POSIX Fortran compilers. FORTRAN FORTRANFLAGS FORTRANCOM SHFORTRAN SHFORTRANFLAGS SHFORTRANCOM SHFORTRANPPCOM FORTRANCOMSTR FORTRANPPCOMSTR SHFORTRANCOMSTR SHFORTRANPPCOMSTR The default Fortran compiler for all versions of Fortran. The command line used to compile a Fortran source file to an object file. By default, any options specified in the &cv-link-FORTRANFLAGS;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANMODFLAG;, and &cv-link-_FORTRANINCFLAGS; construction variables are included on this command line. The string displayed when a Fortran source file is compiled to an object file. If this is not set, then &cv-link-FORTRANCOM; (the command line) is displayed. The list of file extensions for which the FORTRAN dialect will be used. By default, this is ['.f', '.for', '.ftn'] The list of file extensions for which the compilation + preprocessor pass for FORTRAN dialect will be used. By default, this is ['.fpp', '.FPP'] General user-specified options that are passed to the Fortran compiler. Note that this variable does not contain (or similar) include or module search path options that scons generates automatically from &cv-link-FORTRANPATH;. See &cv-link-_FORTRANINCFLAGS; and &cv-link-_FORTRANMODFLAG;, below, for the variables that expand those options. An automatically-generated construction variable containing the Fortran compiler command-line options for specifying directories to be searched for include files and module files. The value of &cv-link-_FORTRANINCFLAGS; is created by prepending/appending &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; to the beginning and end of each directory in &cv-link-FORTRANPATH;. Directory location where the Fortran compiler should place any module files it generates. This variable is empty, by default. Some Fortran compilers will internally append this directory in the search path for module files, as well. The prefix used to specify a module directory on the Fortran compiler command line. This will be appended to the beginning of the directory in the &cv-link-FORTRANMODDIR; construction variables when the &cv-link-_FORTRANMODFLAG; variables is automatically generated. The suffix used to specify a module directory on the Fortran compiler command line. This will be appended to the beginning of the directory in the &cv-link-FORTRANMODDIR; construction variables when the &cv-link-_FORTRANMODFLAG; variables is automatically generated. An automatically-generated construction variable containing the Fortran compiler command-line option for specifying the directory location where the Fortran compiler should place any module files that happen to get generated during compilation. The value of &cv-link-_FORTRANMODFLAG; is created by prepending/appending &cv-link-FORTRANMODDIRPREFIX; and &cv-link-FORTRANMODDIRSUFFIX; to the beginning and end of the directory in &cv-link-FORTRANMODDIR;. The module file prefix used by the Fortran compiler. SCons assumes that the Fortran compiler follows the quasi-standard naming convention for module files of module_name.mod. As a result, this variable is left empty, by default. For situations in which the compiler does not necessarily follow the normal convention, the user may use this variable. Its value will be appended to every module file name as scons attempts to resolve dependencies. The module file suffix used by the Fortran compiler. SCons assumes that the Fortran compiler follows the quasi-standard naming convention for module files of module_name.mod. As a result, this variable is set to ".mod", by default. For situations in which the compiler does not necessarily follow the normal convention, the user may use this variable. Its value will be appended to every module file name as scons attempts to resolve dependencies. The list of directories that the Fortran compiler will search for include files and (for some compilers) module files. The Fortran implicit dependency scanner will search these directories for include files (but not module files since they are autogenerated and, as such, may not actually exist at the time the scan takes place). Don't explicitly put include directory arguments in FORTRANFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in FORTRANPATH will be looked-up relative to the SConscript directory when they are used in a command. To force &scons; to look-up a directory relative to the root of the source tree use #: env = Environment(FORTRANPATH='#/include') The directory look-up can also be forced using the &Dir;() function: include = Dir('include') env = Environment(FORTRANPATH=include) The directory list will be added to command lines through the automatically-generated &cv-link-_FORTRANINCFLAGS; construction variable, which is constructed by appending the values of the &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; construction variables to the beginning and end of each directory in &cv-link-FORTRANPATH;. Any command lines you define that need the FORTRANPATH directory list should include &cv-link-_FORTRANINCFLAGS;: env = Environment(FORTRANCOM="my_compiler $_FORTRANINCFLAGS -c -o $TARGET $SOURCE") The command line used to compile a Fortran source file to an object file after first running the file through the C preprocessor. By default, any options specified in the &cv-link-FORTRANFLAGS;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANMODFLAG;, and &cv-link-_FORTRANINCFLAGS; construction variables are included on this command line. The string displayed when a Fortran source file is compiled to an object file after first running the file through the C preprocessor. If this is not set, then &cv-link-FORTRANPPCOM; (the command line) is displayed. The list of suffixes of files that will be scanned for Fortran implicit dependencies (INCLUDE lines and USE statements). The default list is: [".f", ".F", ".for", ".FOR", ".ftn", ".FTN", ".fpp", ".FPP", ".f77", ".F77", ".f90", ".F90", ".f95", ".F95"] The default Fortran compiler used for generating shared-library objects. The command line used to compile a Fortran source file to a shared-library object file. The string displayed when a Fortran source file is compiled to a shared-library object file. If this is not set, then &cv-link-SHFORTRANCOM; (the command line) is displayed. Options that are passed to the Fortran compiler to generate shared-library objects. The command line used to compile a Fortran source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the &cv-link-SHFORTRANFLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. The string displayed when a Fortran source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then &cv-link-SHFORTRANPPCOM; (the command line) is displayed. scons-src-3.0.0/src/engine/SCons/Tool/pdflatex.py0000664000175000017500000000556613160023044021650 0ustar bdbaddogbdbaddog"""SCons.Tool.pdflatex Tool-specific initialization for pdflatex. Generates .pdf files from .latex or .ltx files There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/pdflatex.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Action import SCons.Util import SCons.Tool.pdf import SCons.Tool.tex PDFLaTeXAction = None def PDFLaTeXAuxFunction(target = None, source= None, env=None): result = SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXAction, target, source, env ) if result != 0: SCons.Tool.tex.check_file_error_message(env['PDFLATEX']) return result PDFLaTeXAuxAction = None def generate(env): """Add Builders and construction variables for pdflatex to an Environment.""" global PDFLaTeXAction if PDFLaTeXAction is None: PDFLaTeXAction = SCons.Action.Action('$PDFLATEXCOM', '$PDFLATEXCOMSTR') global PDFLaTeXAuxAction if PDFLaTeXAuxAction is None: PDFLaTeXAuxAction = SCons.Action.Action(PDFLaTeXAuxFunction, strfunction=SCons.Tool.tex.TeXLaTeXStrFunction) env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes) from . import pdf pdf.generate(env) bld = env['BUILDERS']['PDF'] bld.add_action('.ltx', PDFLaTeXAuxAction) bld.add_action('.latex', PDFLaTeXAuxAction) bld.add_emitter('.ltx', SCons.Tool.tex.tex_pdf_emitter) bld.add_emitter('.latex', SCons.Tool.tex.tex_pdf_emitter) SCons.Tool.tex.generate_common(env) def exists(env): SCons.Tool.tex.generate_darwin(env) return env.Detect('pdflatex') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/xgettext.xml0000664000175000017500000002731513160023045022062 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> This scons tool is a part of scons &t-link-gettext; toolset. It provides scons interface to xgettext(1) program, which extracts internationalized messages from source code. The tool provides &b-POTUpdate; builder to make PO Template files. POTSUFFIX POTUPDATE_ALIAS XGETTEXTCOM XGETTEXTCOMSTR XGETTEXTFLAGS XGETTEXTFROM XGETTEXTFROMPREFIX XGETTEXTFROMSUFFIX XGETTEXTPATH XGETTEXTPATHPREFIX XGETTEXTPATHSUFFIX _XGETTEXTDOMAIN _XGETTEXTFROMFLAGS _XGETTEXTPATHFLAGS POTDOMAIN The builder belongs to &t-link-xgettext; tool. The builder updates target POT file if exists or creates one if it doesn't. The node is not built by default (i.e. it is Ignored from '.'), but only on demand (i.e. when given POT file is required or when special alias is invoked). This builder adds its targe node (messages.pot, say) to a special alias (pot-update by default, see &cv-link-POTUPDATE_ALIAS;) so you can update/create them easily with scons pot-update. The file is not written until there is no real change in internationalized messages (or in comments that enter POT file). You may see xgettext(1) being invoked by the &t-link-xgettext; tool even if there is no real change in internationalized messages (so the POT file is not being updated). This happens every time a source file has changed. In such case we invoke xgettext(1) and compare its output with the content of POT file to decide whether the file should be updated or not. Example 1. Let's create po/ directory and place following SConstruct script there: # SConstruct in 'po/' subdir env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(['foo'], ['../a.cpp', '../b.cpp']) env.POTUpdate(['bar'], ['../c.cpp', '../d.cpp']) Then invoke scons few times: user@host:$ scons # Does not create foo.pot nor bar.pot user@host:$ scons foo.pot # Updates or creates foo.pot user@host:$ scons pot-update # Updates or creates foo.pot and bar.pot user@host:$ scons -c # Does not clean foo.pot nor bar.pot. the results shall be as the comments above say. Example 2. The &b-POTUpdate; builder may be used with no target specified, in which case default target messages.pot will be used. The default target may also be overridden by setting &cv-link-POTDOMAIN; construction variable or providing it as an override to &b-POTUpdate; builder: # SConstruct script env = Environment( tools = ['default', 'xgettext'] ) env['POTDOMAIN'] = "foo" env.POTUpdate(source = ["a.cpp", "b.cpp"]) # Creates foo.pot ... env.POTUpdate(POTDOMAIN = "bar", source = ["c.cpp", "d.cpp"]) # and bar.pot Example 3. The sources may be specified within separate file, for example POTFILES.in: # POTFILES.in in 'po/' subdirectory ../a.cpp ../b.cpp # end of file The name of the file (POTFILES.in) containing the list of sources is provided via &cv-link-XGETTEXTFROM;: # SConstruct file in 'po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in') Example 4. You may use &cv-link-XGETTEXTPATH; to define source search path. Assume, for example, that you have files a.cpp, b.cpp, po/SConstruct, po/POTFILES.in. Then your POT-related files could look as below: # POTFILES.in in 'po/' subdirectory a.cpp b.cpp # end of file # SConstruct file in 'po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH='../') Example 5. Multiple search directories may be defined within a list, i.e. XGETTEXTPATH = ['dir1', 'dir2', ...]. The order in the list determines the search order of source files. The path to the first file found is used. Let's create 0/1/po/SConstruct script: # SConstruct file in '0/1/po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH=['../', '../../']) and 0/1/po/POTFILES.in: # POTFILES.in in '0/1/po/' subdirectory a.cpp # end of file Write two *.cpp files, the first one is 0/a.cpp: /* 0/a.cpp */ gettext("Hello from ../../a.cpp") and the second is 0/1/a.cpp: /* 0/1/a.cpp */ gettext("Hello from ../a.cpp") then run scons. You'll obtain 0/1/po/messages.pot with the message "Hello from ../a.cpp". When you reverse order in $XGETTEXTFOM, i.e. when you write SConscript as # SConstruct file in '0/1/po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH=['../../', '../']) then the messages.pot will contain msgid "Hello from ../../a.cpp" line and not msgid "Hello from ../a.cpp". Suffix used for PO Template files (default: '.pot'). See &t-link-xgettext; tool and &b-link-POTUpdate; builder. Name of the common phony target for all PO Templates created with &b-link-POUpdate; (default: 'pot-update'). See &t-link-xgettext; tool and &b-link-POTUpdate; builder. Path to xgettext(1) program (found via Detect()). See &t-link-xgettext; tool and &b-link-POTUpdate; builder. Complete xgettext command line. See &t-link-xgettext; tool and &b-link-POTUpdate; builder. A string that is shown when xgettext(1) command is invoked (default: '', which means "print &cv-link-XGETTEXTCOM;"). See &t-link-xgettext; tool and &b-link-POTUpdate; builder. Additional flags to xgettext(1). See &t-link-xgettext; tool and &b-link-POTUpdate; builder. Name of file containing list of xgettext(1)'s source files. Autotools' users know this as POTFILES.in so they will in most cases set XGETTEXTFROM="POTFILES.in" here. The &cv-XGETTEXTFROM; files have same syntax and semantics as the well known GNU POTFILES.in. See &t-link-xgettext; tool and &b-link-POTUpdate; builder. List of directories, there xgettext(1) will look for source files (default: []). This variable works only together with &cv-link-XGETTEXTFROM; See also &t-link-xgettext; tool and &b-link-POTUpdate; builder. This flag is used to add single search path to xgettext(1)'s commandline (default: '-D'). (default: '') This flag is used to add single &cv-link-XGETTEXTFROM; file to xgettext(1)'s commandline (default: '-f'). (default: '') Internal "macro". Generates xgettext domain name form source and target (default: '${TARGET.filebase}'). Internal "macro". Genrates list of -D<dir> flags from the &cv-link-XGETTEXTPATH; list. Internal "macro". Generates list of -f<file> flags from &cv-link-XGETTEXTFROM;. scons-src-3.0.0/src/engine/SCons/Tool/as.xml0000664000175000017500000000546313160023041020605 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &as; assembler. AS ASFLAGS ASCOM ASPPFLAGS ASPPCOM CC CPPFLAGS _CPPDEFFLAGS _CPPINCFLAGS The assembler. The command line used to generate an object file from an assembly-language source file. The string displayed when an object file is generated from an assembly-language source file. If this is not set, then &cv-link-ASCOM; (the command line) is displayed. env = Environment(ASCOMSTR = "Assembling $TARGET") General options passed to the assembler. The command line used to assemble an assembly-language source file into an object file after first running the file through the C preprocessor. Any options specified in the &cv-link-ASFLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. The string displayed when an object file is generated from an assembly-language source file after first running the file through the C preprocessor. If this is not set, then &cv-link-ASPPCOM; (the command line) is displayed. env = Environment(ASPPCOMSTR = "Assembling $TARGET") General options when an assembling an assembly-language source file into an object file after first running the file through the C preprocessor. The default is to use the value of &cv-link-ASFLAGS;. scons-src-3.0.0/src/engine/SCons/Tool/clang.py0000664000175000017500000000553613160023041021117 0ustar bdbaddogbdbaddog# -*- coding: utf-8; -*- """SCons.Tool.clang Tool-specific initialization for clang. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # __revision__ = "src/engine/SCons/Tool/clang.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" # Based on SCons/Tool/gcc.py by PaweÅ‚ Tomulik 2014 as a separate tool. # Brought into the SCons mainline by Russel Winder 2017. import os import re import subprocess import sys import SCons.Util import SCons.Tool.cc compilers = ['clang'] def generate(env): """Add Builders and construction variables for clang to an Environment.""" SCons.Tool.cc.generate(env) env['CC'] = env.Detect(compilers) or 'clang' if env['PLATFORM'] in ['cygwin', 'win32']: env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') else: env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC') # determine compiler version if env['CC']: #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'], pipe = SCons.Action._subproc(env, [env['CC'], '--version'], stdin='devnull', stderr='devnull', stdout=subprocess.PIPE) if pipe.wait() != 0: return # clang -dumpversion is of no use line = pipe.stdout.readline() if sys.version_info[0] > 2: line = line.decode() match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line) if match: env['CCVERSION'] = match.group(1) def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/packaging.xml0000664000175000017500000000427013160023044022124 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> A framework for building binary and source packages. Builds a Binary Package of the given source files. env.Package(source = FindInstalledFiles()) The Java archive tool. The directory to which the Java archive tool should change (using the option). The command line used to call the Java archive tool. The string displayed when the Java archive tool is called If this is not set, then &cv-JARCOM; (the command line) is displayed. env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") General options passed to the Java archive tool. By default this is set to to create the necessary jar file. The suffix for Java archives: .jar by default. scons-src-3.0.0/src/engine/SCons/Tool/cc.xml0000664000175000017500000001130713160023041020561 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for generic POSIX C copmilers. FRAMEWORKS FRAMEWORKPATH CC CFLAGS CCFLAGS CCCOM SHCC SHCFLAGS SHCCFLAGS SHCCCOM CPPDEFPREFIX CPPDEFSUFFIX INCPREFIX INCSUFFIX SHOBJSUFFIX CFILESUFFIX PLATFORM The C compiler. The command line used to compile a C source file to a (static) object file. Any options specified in the &cv-link-CFLAGS;, &cv-link-CCFLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. The string displayed when a C source file is compiled to a (static) object file. If this is not set, then &cv-link-CCCOM; (the command line) is displayed. env = Environment(CCCOMSTR = "Compiling static object $TARGET") General options that are passed to the C and C++ compilers. General options that are passed to the C compiler (C only; not C++). User-specified C preprocessor options. These will be included in any command that uses the C preprocessor, including not just compilation of C and C++ source files via the &cv-link-CCCOM;, &cv-link-SHCCCOM;, &cv-link-CXXCOM; and &cv-link-SHCXXCOM; command lines, but also the &cv-link-FORTRANPPCOM;, &cv-link-SHFORTRANPPCOM;, &cv-link-F77PPCOM; and &cv-link-SHF77PPCOM; command lines used to compile a Fortran source file, and the &cv-link-ASPPCOM; command line used to assemble an assembly language source file, after first running each file through the C preprocessor. Note that this variable does not contain (or similar) include search path options that scons generates automatically from &cv-link-CPPPATH;. See &cv-link-_CPPINCFLAGS;, below, for the variable that expands to those options. The list of suffixes of files that will be scanned for C preprocessor implicit dependencies (#include lines). The default list is: [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", ".h", ".H", ".hxx", ".hpp", ".hh", ".F", ".fpp", ".FPP", ".m", ".mm", ".S", ".spp", ".SPP"] The C compiler used for generating shared-library objects. The command line used to compile a C source file to a shared-library object file. Any options specified in the &cv-link-SHCFLAGS;, &cv-link-SHCCFLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. The string displayed when a C source file is compiled to a shared object file. If this is not set, then &cv-link-SHCCCOM; (the command line) is displayed. env = Environment(SHCCCOMSTR = "Compiling shared object $TARGET") Options that are passed to the C and C++ compilers to generate shared-library objects. Options that are passed to the C compiler (only; not C++) to generate shared-library objects. scons-src-3.0.0/src/engine/SCons/Tool/gettext_tool.py0000664000175000017500000000401713160023044022550 0ustar bdbaddogbdbaddog"""gettext tool """ # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/gettext_tool.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" ############################################################################# def generate(env,**kw): import SCons.Tool from SCons.Tool.GettextCommon \ import _translate, tool_list for t in tool_list(env['PLATFORM'], env): env.Tool(t) env.AddMethod(_translate, 'Translate') ############################################################################# ############################################################################# def exists(env): from SCons.Tool.GettextCommon \ import _xgettext_exists, _msginit_exists, \ _msgmerge_exists, _msgfmt_exists try: return _xgettext_exists(env) and _msginit_exists(env) \ and _msgmerge_exists(env) and _msgfmt_exists(env) except: return False ############################################################################# scons-src-3.0.0/src/engine/SCons/Tool/ifl.py0000664000175000017500000000534413160023044020605 0ustar bdbaddogbdbaddog"""SCons.Tool.ifl Tool-specific initialization for the Intel Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/ifl.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults from SCons.Scanner.Fortran import FortranScan from .FortranCommon import add_all_to_env def generate(env): """Add Builders and construction variables for ifl to an Environment.""" fscan = FortranScan("FORTRANPATH") SCons.Tool.SourceFileScanner.add_scanner('.i', fscan) SCons.Tool.SourceFileScanner.add_scanner('.i90', fscan) if 'FORTRANFILESUFFIXES' not in env: env['FORTRANFILESUFFIXES'] = ['.i'] else: env['FORTRANFILESUFFIXES'].append('.i') if 'F90FILESUFFIXES' not in env: env['F90FILESUFFIXES'] = ['.i90'] else: env['F90FILESUFFIXES'].append('.i90') add_all_to_env(env) env['FORTRAN'] = 'ifl' env['SHFORTRAN'] = '$FORTRAN' env['FORTRANCOM'] = '$FORTRAN $FORTRANFLAGS $_FORTRANINCFLAGS /c $SOURCES /Fo$TARGET' env['FORTRANPPCOM'] = '$FORTRAN $FORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANINCFLAGS /c $SOURCES /Fo$TARGET' env['SHFORTRANCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $_FORTRANINCFLAGS /c $SOURCES /Fo$TARGET' env['SHFORTRANPPCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANINCFLAGS /c $SOURCES /Fo$TARGET' def exists(env): return env.Detect('ifl') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/GettextCommon.py0000664000175000017500000004353513160023041022631 0ustar bdbaddogbdbaddog"""SCons.Tool.GettextCommon module Used by several tools of `gettext` toolset. """ # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/GettextCommon.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Warnings import re ############################################################################# class XgettextToolWarning(SCons.Warnings.Warning): pass class XgettextNotFound(XgettextToolWarning): pass class MsginitToolWarning(SCons.Warnings.Warning): pass class MsginitNotFound(MsginitToolWarning): pass class MsgmergeToolWarning(SCons.Warnings.Warning): pass class MsgmergeNotFound(MsgmergeToolWarning): pass class MsgfmtToolWarning(SCons.Warnings.Warning): pass class MsgfmtNotFound(MsgfmtToolWarning): pass ############################################################################# SCons.Warnings.enableWarningClass(XgettextToolWarning) SCons.Warnings.enableWarningClass(XgettextNotFound) SCons.Warnings.enableWarningClass(MsginitToolWarning) SCons.Warnings.enableWarningClass(MsginitNotFound) SCons.Warnings.enableWarningClass(MsgmergeToolWarning) SCons.Warnings.enableWarningClass(MsgmergeNotFound) SCons.Warnings.enableWarningClass(MsgfmtToolWarning) SCons.Warnings.enableWarningClass(MsgfmtNotFound) ############################################################################# ############################################################################# class _POTargetFactory(object): """ A factory of `PO` target files. Factory defaults differ from these of `SCons.Node.FS.FS`. We set `precious` (this is required by builders and actions gettext) and `noclean` flags by default for all produced nodes. """ def __init__(self, env, nodefault=True, alias=None, precious=True , noclean=True): """ Object constructor. **Arguments** - *env* (`SCons.Environment.Environment`) - *nodefault* (`boolean`) - if `True`, produced nodes will be ignored from default target `'.'` - *alias* (`string`) - if provided, produced nodes will be automatically added to this alias, and alias will be set as `AlwaysBuild` - *precious* (`boolean`) - if `True`, the produced nodes will be set as `Precious`. - *noclen* (`boolean`) - if `True`, the produced nodes will be excluded from `Clean`. """ self.env = env self.alias = alias self.precious = precious self.noclean = noclean self.nodefault = nodefault def _create_node(self, name, factory, directory=None, create=1): """ Create node, and set it up to factory settings. """ import SCons.Util node = factory(name, directory, create) node.set_noclean(self.noclean) node.set_precious(self.precious) if self.nodefault: self.env.Ignore('.', node) if self.alias: self.env.AlwaysBuild(self.env.Alias(self.alias, node)) return node def Entry(self, name, directory=None, create=1): """ Create `SCons.Node.FS.Entry` """ return self._create_node(name, self.env.fs.Entry, directory, create) def File(self, name, directory=None, create=1): """ Create `SCons.Node.FS.File` """ return self._create_node(name, self.env.fs.File, directory, create) ############################################################################# ############################################################################# _re_comment = re.compile(r'(#[^\n\r]+)$', re.M) _re_lang = re.compile(r'([a-zA-Z0-9_]+)', re.M) ############################################################################# def _read_linguas_from_files(env, linguas_files=None): """ Parse `LINGUAS` file and return list of extracted languages """ import SCons.Util import SCons.Environment global _re_comment global _re_lang if not SCons.Util.is_List(linguas_files) \ and not SCons.Util.is_String(linguas_files) \ and not isinstance(linguas_files, SCons.Node.FS.Base) \ and linguas_files: # If, linguas_files==True or such, then read 'LINGUAS' file. linguas_files = ['LINGUAS'] if linguas_files is None: return [] fnodes = env.arg2nodes(linguas_files) linguas = [] for fnode in fnodes: contents = _re_comment.sub("", fnode.get_text_contents()) ls = [l for l in _re_lang.findall(contents) if l] linguas.extend(ls) return linguas ############################################################################# ############################################################################# from SCons.Builder import BuilderBase ############################################################################# class _POFileBuilder(BuilderBase): """ `PO` file builder. This is multi-target single-source builder. In typical situation the source is single `POT` file, e.g. `messages.pot`, and there are multiple `PO` targets to be updated from this `POT`. We must run `SCons.Builder.BuilderBase._execute()` separatelly for each target to track dependencies separatelly for each target file. **NOTE**: if we call `SCons.Builder.BuilderBase._execute(.., target, ...)` with target being list of all targets, all targets would be rebuilt each time one of the targets from this list is missing. This would happen, for example, when new language `ll` enters `LINGUAS_FILE` (at this moment there is no `ll.po` file yet). To avoid this, we override `SCons.Builder.BuilerBase._execute()` and call it separatelly for each target. Here we also append to the target list the languages read from `LINGUAS_FILE`. """ # # * The argument for overriding _execute(): We must use environment with # builder overrides applied (see BuilderBase.__init__(). Here it comes for # free. # * The argument against using 'emitter': The emitter is called too late # by BuilderBase._execute(). If user calls, for example: # # env.POUpdate(LINGUAS_FILE = 'LINGUAS') # # the builder throws error, because it is called with target=None, # source=None and is trying to "generate" sources or target list first. # If user calls # # env.POUpdate(['foo', 'baz'], LINGUAS_FILE = 'LINGUAS') # # the env.BuilderWrapper() calls our builder with target=None, # source=['foo', 'baz']. The BuilderBase._execute() then splits execution # and execute iterativelly (recursion) self._execute(None, source[i]). # After that it calls emitter (which is quite too late). The emitter is # also called in each iteration, what makes things yet worse. def __init__(self, env, **kw): if not 'suffix' in kw: kw['suffix'] = '$POSUFFIX' if not 'src_suffix' in kw: kw['src_suffix'] = '$POTSUFFIX' if not 'src_builder' in kw: kw['src_builder'] = '_POTUpdateBuilder' if not 'single_source' in kw: kw['single_source'] = True alias = None if 'target_alias' in kw: alias = kw['target_alias'] del kw['target_alias'] if not 'target_factory' in kw: kw['target_factory'] = _POTargetFactory(env, alias=alias).File BuilderBase.__init__(self, **kw) def _execute(self, env, target, source, *args, **kw): """ Execute builder's actions. Here we append to `target` the languages read from `$LINGUAS_FILE` and apply `SCons.Builder.BuilderBase._execute()` separatelly to each target. The arguments and return value are same as for `SCons.Builder.BuilderBase._execute()`. """ import SCons.Util import SCons.Node linguas_files = None if 'LINGUAS_FILE' in env and env['LINGUAS_FILE']: linguas_files = env['LINGUAS_FILE'] # This prevents endless recursion loop (we'll be invoked once for # each target appended here, we must not extend the list again). env['LINGUAS_FILE'] = None linguas = _read_linguas_from_files(env, linguas_files) if SCons.Util.is_List(target): target.extend(linguas) elif target is not None: target = [target] + linguas else: target = linguas if not target: # Let the SCons.BuilderBase to handle this patologic situation return BuilderBase._execute(self, env, target, source, *args, **kw) # The rest is ours if not SCons.Util.is_List(target): target = [target] result = [] for tgt in target: r = BuilderBase._execute(self, env, [tgt], source, *args, **kw) result.extend(r) if linguas_files is not None: env['LINGUAS_FILE'] = linguas_files return SCons.Node.NodeList(result) ############################################################################# import SCons.Environment ############################################################################# def _translate(env, target=None, source=SCons.Environment._null, *args, **kw): """ Function for `Translate()` pseudo-builder """ if target is None: target = [] pot = env.POTUpdate(None, source, *args, **kw) po = env.POUpdate(target, pot, *args, **kw) return po ############################################################################# ############################################################################# class RPaths(object): """ Callable object, which returns pathnames relative to SCons current working directory. It seems like `SCons.Node.FS.Base.get_path()` returns absolute paths for nodes that are outside of current working directory (`env.fs.getcwd()`). Here, we often have `SConscript`, `POT` and `PO` files within `po/` directory and source files (e.g. `*.c`) outside of it. When generating `POT` template file, references to source files are written to `POT` template, so a translator may later quickly jump to appropriate source file and line from its `PO` editor (e.g. `poedit`). Relative paths in `PO` file are usually interpreted by `PO` editor as paths relative to the place, where `PO` file lives. The absolute paths would make resultant `POT` file nonportable, as the references would be correct only on the machine, where `POT` file was recently re-created. For such reason, we need a function, which always returns relative paths. This is the purpose of `RPaths` callable object. The `__call__` method returns paths relative to current working directory, but we assume, that *xgettext(1)* is run from the directory, where target file is going to be created. Note, that this may not work for files distributed over several hosts or across different drives on windows. We assume here, that single local filesystem holds both source files and target `POT` templates. Intended use of `RPaths` - in `xgettext.py`:: def generate(env): from GettextCommon import RPaths ... sources = '$( ${_concat( "", SOURCES, "", __env__, XgettextRPaths, TARGET, SOURCES)} $)' env.Append( ... XGETTEXTCOM = 'XGETTEXT ... ' + sources, ... XgettextRPaths = RPaths(env) ) """ # NOTE: This callable object returns pathnames of dirs/files relative to # current working directory. The pathname remains relative also for entries # that are outside of current working directory (node, that # SCons.Node.FS.File and siblings return absolute path in such case). For # simplicity we compute path relative to current working directory, this # seems be enough for our purposes (don't need TARGET variable and # SCons.Defaults.Variable_Caller stuff). def __init__(self, env): """ Initialize `RPaths` callable object. **Arguments**: - *env* - a `SCons.Environment.Environment` object, defines *current working dir*. """ self.env = env # FIXME: I'm not sure, how it should be implemented (what the *args are in # general, what is **kw). def __call__(self, nodes, *args, **kw): """ Return nodes' paths (strings) relative to current working directory. **Arguments**: - *nodes* ([`SCons.Node.FS.Base`]) - list of nodes. - *args* - currently unused. - *kw* - currently unused. **Returns**: - Tuple of strings, which represent paths relative to current working directory (for given environment). """ import os import SCons.Node.FS rpaths = () cwd = self.env.fs.getcwd().get_abspath() for node in nodes: rpath = None if isinstance(node, SCons.Node.FS.Base): rpath = os.path.relpath(node.get_abspath(), cwd) # FIXME: Other types possible here? if rpath is not None: rpaths += (rpath,) return rpaths ############################################################################# ############################################################################# def _init_po_files(target, source, env): """ Action function for `POInit` builder. """ nop = lambda target, source, env: 0 if 'POAUTOINIT' in env: autoinit = env['POAUTOINIT'] else: autoinit = False # Well, if everything outside works well, this loop should do single # iteration. Otherwise we are rebuilding all the targets even, if just # one has changed (but is this our fault?). for tgt in target: if not tgt.exists(): if autoinit: action = SCons.Action.Action('$MSGINITCOM', '$MSGINITCOMSTR') else: msg = 'File ' + repr(str(tgt)) + ' does not exist. ' \ + 'If you are a translator, you can create it through: \n' \ + '$MSGINITCOM' action = SCons.Action.Action(nop, msg) status = action([tgt], source, env) if status: return status return 0 ############################################################################# ############################################################################# def _detect_xgettext(env): """ Detects *xgettext(1)* binary """ if 'XGETTEXT' in env: return env['XGETTEXT'] xgettext = env.Detect('xgettext'); if xgettext: return xgettext raise SCons.Errors.StopError(XgettextNotFound, "Could not detect xgettext") return None ############################################################################# def _xgettext_exists(env): return _detect_xgettext(env) ############################################################################# ############################################################################# def _detect_msginit(env): """ Detects *msginit(1)* program. """ if 'MSGINIT' in env: return env['MSGINIT'] msginit = env.Detect('msginit'); if msginit: return msginit raise SCons.Errors.StopError(MsginitNotFound, "Could not detect msginit") return None ############################################################################# def _msginit_exists(env): return _detect_msginit(env) ############################################################################# ############################################################################# def _detect_msgmerge(env): """ Detects *msgmerge(1)* program. """ if 'MSGMERGE' in env: return env['MSGMERGE'] msgmerge = env.Detect('msgmerge'); if msgmerge: return msgmerge raise SCons.Errors.StopError(MsgmergeNotFound, "Could not detect msgmerge") return None ############################################################################# def _msgmerge_exists(env): return _detect_msgmerge(env) ############################################################################# ############################################################################# def _detect_msgfmt(env): """ Detects *msgmfmt(1)* program. """ if 'MSGFMT' in env: return env['MSGFMT'] msgfmt = env.Detect('msgfmt'); if msgfmt: return msgfmt raise SCons.Errors.StopError(MsgfmtNotFound, "Could not detect msgfmt") return None ############################################################################# def _msgfmt_exists(env): return _detect_msgfmt(env) ############################################################################# ############################################################################# def tool_list(platform, env): """ List tools that shall be generated by top-level `gettext` tool """ return ['xgettext', 'msginit', 'msgmerge', 'msgfmt'] ############################################################################# scons-src-3.0.0/src/engine/SCons/Tool/dvips.xml0000664000175000017500000000510513160023044021323 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the dvips utility. DVIPS DVIPSFLAGS PSCOM PSPREFIX PSSUFFIX PSCOMSTR Builds a .ps file from a .dvi input file (or, by extension, a .tex, .ltx, or .latex input file). The suffix specified by the &cv-link-PSSUFFIX; construction variable (.ps by default) is added automatically to the target if it is not already present. Example: # builds from aaa.tex env.PostScript(target = 'aaa.ps', source = 'aaa.tex') # builds bbb.ps from bbb.dvi env.PostScript(target = 'bbb', source = 'bbb.dvi') The TeX DVI file to PostScript converter. General options passed to the TeX DVI file to PostScript converter. The command line used to convert TeX DVI files into a PostScript file. The string displayed when a TeX DVI file is converted into a PostScript file. If this is not set, then &cv-link-PSCOM; (the command line) is displayed. The prefix used for PostScript file names. The prefix used for PostScript file names. scons-src-3.0.0/src/engine/SCons/Tool/hpc++.xml0000664000175000017500000000175613160023044021106 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the compilers aCC on HP/UX systems. scons-src-3.0.0/src/engine/SCons/Tool/tex.py0000664000175000017500000011612413160023045020633 0ustar bdbaddogbdbaddog"""SCons.Tool.tex Tool-specific initialization for TeX. Generates .dvi files from .tex files There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/Tool/tex.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import re import shutil import sys import platform import glob import SCons.Action import SCons.Node import SCons.Node.FS import SCons.Util import SCons.Scanner.LaTeX Verbose = False must_rerun_latex = True # these are files that just need to be checked for changes and then rerun latex check_suffixes = ['.toc', '.lof', '.lot', '.out', '.nav', '.snm'] # these are files that require bibtex or makeindex to be run when they change all_suffixes = check_suffixes + ['.bbl', '.idx', '.nlo', '.glo', '.acn', '.bcf'] # # regular expressions used to search for Latex features # or outputs that require rerunning latex # # search for all .aux files opened by latex (recorded in the .fls file) openout_aux_re = re.compile(r"OUTPUT *(.*\.aux)") # search for all .bcf files opened by latex (recorded in the .fls file) # for use by biber openout_bcf_re = re.compile(r"OUTPUT *(.*\.bcf)") #printindex_re = re.compile(r"^[^%]*\\printindex", re.MULTILINE) #printnomenclature_re = re.compile(r"^[^%]*\\printnomenclature", re.MULTILINE) #printglossary_re = re.compile(r"^[^%]*\\printglossary", re.MULTILINE) # search to find rerun warnings warning_rerun_str = '(^LaTeX Warning:.*Rerun)|(^Package \w+ Warning:.*Rerun)' warning_rerun_re = re.compile(warning_rerun_str, re.MULTILINE) # search to find citation rerun warnings rerun_citations_str = "^LaTeX Warning:.*\n.*Rerun to get citations correct" rerun_citations_re = re.compile(rerun_citations_str, re.MULTILINE) # search to find undefined references or citations warnings undefined_references_str = '(^LaTeX Warning:.*undefined references)|(^Package \w+ Warning:.*undefined citations)' undefined_references_re = re.compile(undefined_references_str, re.MULTILINE) # used by the emitter auxfile_re = re.compile(r".", re.MULTILINE) tableofcontents_re = re.compile(r"^[^%\n]*\\tableofcontents", re.MULTILINE) makeindex_re = re.compile(r"^[^%\n]*\\makeindex", re.MULTILINE) bibliography_re = re.compile(r"^[^%\n]*\\bibliography", re.MULTILINE) bibunit_re = re.compile(r"^[^%\n]*\\begin\{bibunit\}", re.MULTILINE) multibib_re = re.compile(r"^[^%\n]*\\newcites\{([^\}]*)\}", re.MULTILINE) addbibresource_re = re.compile(r"^[^%\n]*\\(addbibresource|addglobalbib|addsectionbib)", re.MULTILINE) listoffigures_re = re.compile(r"^[^%\n]*\\listoffigures", re.MULTILINE) listoftables_re = re.compile(r"^[^%\n]*\\listoftables", re.MULTILINE) hyperref_re = re.compile(r"^[^%\n]*\\usepackage.*\{hyperref\}", re.MULTILINE) makenomenclature_re = re.compile(r"^[^%\n]*\\makenomenclature", re.MULTILINE) makeglossary_re = re.compile(r"^[^%\n]*\\makeglossary", re.MULTILINE) makeglossaries_re = re.compile(r"^[^%\n]*\\makeglossaries", re.MULTILINE) makeacronyms_re = re.compile(r"^[^%\n]*\\makeglossaries", re.MULTILINE) beamer_re = re.compile(r"^[^%\n]*\\documentclass\{beamer\}", re.MULTILINE) regex = r'^[^%\n]*\\newglossary\s*\[([^\]]+)\]?\s*\{([^}]*)\}\s*\{([^}]*)\}\s*\{([^}]*)\}\s*\{([^}]*)\}' newglossary_re = re.compile(regex, re.MULTILINE) biblatex_re = re.compile(r"^[^%\n]*\\usepackage.*\{biblatex\}", re.MULTILINE) newglossary_suffix = [] # search to find all files included by Latex include_re = re.compile(r'^[^%\n]*\\(?:include|input){([^}]*)}', re.MULTILINE) includeOnly_re = re.compile(r'^[^%\n]*\\(?:include){([^}]*)}', re.MULTILINE) # search to find all graphics files included by Latex includegraphics_re = re.compile(r'^[^%\n]*\\(?:includegraphics(?:\[[^\]]+\])?){([^}]*)}', re.MULTILINE) # search to find all files opened by Latex (recorded in .log file) openout_re = re.compile(r"OUTPUT *(.*)") # list of graphics file extensions for TeX and LaTeX TexGraphics = SCons.Scanner.LaTeX.TexGraphics LatexGraphics = SCons.Scanner.LaTeX.LatexGraphics # An Action sufficient to build any generic tex file. TeXAction = None # An action to build a latex file. This action might be needed more # than once if we are dealing with labels and bibtex. LaTeXAction = None # An action to run BibTeX on a file. BibTeXAction = None # An action to run Biber on a file. BiberAction = None # An action to run MakeIndex on a file. MakeIndexAction = None # An action to run MakeIndex (for nomencl) on a file. MakeNclAction = None # An action to run MakeIndex (for glossary) on a file. MakeGlossaryAction = None # An action to run MakeIndex (for acronyms) on a file. MakeAcronymsAction = None # An action to run MakeIndex (for newglossary commands) on a file. MakeNewGlossaryAction = None # Used as a return value of modify_env_var if the variable is not set. _null = SCons.Scanner.LaTeX._null modify_env_var = SCons.Scanner.LaTeX.modify_env_var def check_file_error_message(utility, filename='log'): msg = '%s returned an error, check the %s file\n' % (utility, filename) sys.stdout.write(msg) def FindFile(name,suffixes,paths,env,requireExt=False): if requireExt: name,ext = SCons.Util.splitext(name) # if the user gave an extension use it. if ext: name = name + ext if Verbose: print(" searching for '%s' with extensions: " % name,suffixes) for path in paths: testName = os.path.join(path,name) if Verbose: print(" look for '%s'" % testName) if os.path.isfile(testName): if Verbose: print(" found '%s'" % testName) return env.fs.File(testName) else: name_ext = SCons.Util.splitext(testName)[1] if name_ext: continue # if no suffix try adding those passed in for suffix in suffixes: testNameExt = testName + suffix if Verbose: print(" look for '%s'" % testNameExt) if os.path.isfile(testNameExt): if Verbose: print(" found '%s'" % testNameExt) return env.fs.File(testNameExt) if Verbose: print(" did not find '%s'" % name) return None def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None): """A builder for LaTeX files that checks the output in the aux file and decides how many times to use LaTeXAction, and BibTeXAction.""" global must_rerun_latex # This routine is called with two actions. In this file for DVI builds # with LaTeXAction and from the pdflatex.py with PDFLaTeXAction # set this up now for the case where the user requests a different extension # for the target filename if (XXXLaTeXAction == LaTeXAction): callerSuffix = ".dvi" else: callerSuffix = env['PDFSUFFIX'] basename = SCons.Util.splitext(str(source[0]))[0] basedir = os.path.split(str(source[0]))[0] basefile = os.path.split(str(basename))[1] abspath = os.path.abspath(basedir) targetext = os.path.splitext(str(target[0]))[1] targetdir = os.path.split(str(target[0]))[0] saved_env = {} for var in SCons.Scanner.LaTeX.LaTeX.env_variables: saved_env[var] = modify_env_var(env, var, abspath) # Create base file names with the target directory since the auxiliary files # will be made there. That's because the *COM variables have the cd # command in the prolog. We check # for the existence of files before opening them--even ones like the # aux file that TeX always creates--to make it possible to write tests # with stubs that don't necessarily generate all of the same files. targetbase = os.path.join(targetdir, basefile) # if there is a \makeindex there will be a .idx and thus # we have to run makeindex at least once to keep the build # happy even if there is no index. # Same for glossaries, nomenclature, and acronyms src_content = source[0].get_text_contents() run_makeindex = makeindex_re.search(src_content) and not os.path.isfile(targetbase + '.idx') run_nomenclature = makenomenclature_re.search(src_content) and not os.path.isfile(targetbase + '.nlo') run_glossary = makeglossary_re.search(src_content) and not os.path.isfile(targetbase + '.glo') run_glossaries = makeglossaries_re.search(src_content) and not os.path.isfile(targetbase + '.glo') run_acronyms = makeacronyms_re.search(src_content) and not os.path.isfile(targetbase + '.acn') saved_hashes = {} suffix_nodes = {} for suffix in all_suffixes+sum(newglossary_suffix, []): theNode = env.fs.File(targetbase + suffix) suffix_nodes[suffix] = theNode saved_hashes[suffix] = theNode.get_csig() if Verbose: print("hashes: ",saved_hashes) must_rerun_latex = True # .aux files already processed by BibTex already_bibtexed = [] # # routine to update MD5 hash and compare # def check_MD5(filenode, suffix): global must_rerun_latex # two calls to clear old csig filenode.clear_memoized_values() filenode.ninfo = filenode.new_ninfo() new_md5 = filenode.get_csig() if saved_hashes[suffix] == new_md5: if Verbose: print("file %s not changed" % (targetbase+suffix)) return False # unchanged saved_hashes[suffix] = new_md5 must_rerun_latex = True if Verbose: print("file %s changed, rerunning Latex, new hash = " % (targetbase+suffix), new_md5) return True # changed # generate the file name that latex will generate resultfilename = targetbase + callerSuffix count = 0 while (must_rerun_latex and count < int(env.subst('$LATEXRETRIES'))) : result = XXXLaTeXAction(target, source, env) if result != 0: return result count = count + 1 must_rerun_latex = False # Decide if various things need to be run, or run again. # Read the log file to find warnings/errors logfilename = targetbase + '.log' logContent = '' if os.path.isfile(logfilename): logContent = open(logfilename, "r").read() # Read the fls file to find all .aux files flsfilename = targetbase + '.fls' flsContent = '' auxfiles = [] if os.path.isfile(flsfilename): flsContent = open(flsfilename, "r").read() auxfiles = openout_aux_re.findall(flsContent) # remove duplicates dups = {} for x in auxfiles: dups[x] = 1 auxfiles = list(dups.keys()) bcffiles = [] if os.path.isfile(flsfilename): flsContent = open(flsfilename, "r").read() bcffiles = openout_bcf_re.findall(flsContent) # remove duplicates dups = {} for x in bcffiles: dups[x] = 1 bcffiles = list(dups.keys()) if Verbose: print("auxfiles ",auxfiles) print("bcffiles ",bcffiles) # Now decide if bibtex will need to be run. # The information that bibtex reads from the .aux file is # pass-independent. If we find (below) that the .bbl file is unchanged, # then the last latex saw a correct bibliography. # Therefore only do this once # Go through all .aux files and remember the files already done. for auxfilename in auxfiles: if auxfilename not in already_bibtexed: already_bibtexed.append(auxfilename) target_aux = os.path.join(targetdir, auxfilename) if os.path.isfile(target_aux): content = open(target_aux, "r").read() if content.find("bibdata") != -1: if Verbose: print("Need to run bibtex on ",auxfilename) bibfile = env.fs.File(SCons.Util.splitext(target_aux)[0]) result = BibTeXAction(bibfile, bibfile, env) if result != 0: check_file_error_message(env['BIBTEX'], 'blg') must_rerun_latex = True # Now decide if biber will need to be run. # When the backend for biblatex is biber (by choice or default) the # citation information is put in the .bcf file. # The information that biber reads from the .bcf file is # pass-independent. If we find (below) that the .bbl file is unchanged, # then the last latex saw a correct bibliography. # Therefore only do this once # Go through all .bcf files and remember the files already done. for bcffilename in bcffiles: if bcffilename not in already_bibtexed: already_bibtexed.append(bcffilename) target_bcf = os.path.join(targetdir, bcffilename) if os.path.isfile(target_bcf): content = open(target_bcf, "r").read() if content.find("bibdata") != -1: if Verbose: print("Need to run biber on ",bcffilename) bibfile = env.fs.File(SCons.Util.splitext(target_bcf)[0]) result = BiberAction(bibfile, bibfile, env) if result != 0: check_file_error_message(env['BIBER'], 'blg') must_rerun_latex = True # Now decide if latex will need to be run again due to index. if check_MD5(suffix_nodes['.idx'],'.idx') or (count == 1 and run_makeindex): # We must run makeindex if Verbose: print("Need to run makeindex") idxfile = suffix_nodes['.idx'] result = MakeIndexAction(idxfile, idxfile, env) if result != 0: check_file_error_message(env['MAKEINDEX'], 'ilg') return result # TO-DO: need to add a way for the user to extend this list for whatever # auxiliary files they create in other (or their own) packages # Harder is case is where an action needs to be called -- that should be rare (I hope?) for index in check_suffixes: check_MD5(suffix_nodes[index],index) # Now decide if latex will need to be run again due to nomenclature. if check_MD5(suffix_nodes['.nlo'],'.nlo') or (count == 1 and run_nomenclature): # We must run makeindex if Verbose: print("Need to run makeindex for nomenclature") nclfile = suffix_nodes['.nlo'] result = MakeNclAction(nclfile, nclfile, env) if result != 0: check_file_error_message('%s (nomenclature)' % env['MAKENCL'], 'nlg') #return result # Now decide if latex will need to be run again due to glossary. if check_MD5(suffix_nodes['.glo'],'.glo') or (count == 1 and run_glossaries) or (count == 1 and run_glossary): # We must run makeindex if Verbose: print("Need to run makeindex for glossary") glofile = suffix_nodes['.glo'] result = MakeGlossaryAction(glofile, glofile, env) if result != 0: check_file_error_message('%s (glossary)' % env['MAKEGLOSSARY'], 'glg') #return result # Now decide if latex will need to be run again due to acronyms. if check_MD5(suffix_nodes['.acn'],'.acn') or (count == 1 and run_acronyms): # We must run makeindex if Verbose: print("Need to run makeindex for acronyms") acrfile = suffix_nodes['.acn'] result = MakeAcronymsAction(acrfile, acrfile, env) if result != 0: check_file_error_message('%s (acronyms)' % env['MAKEACRONYMS'], 'alg') return result # Now decide if latex will need to be run again due to newglossary command. for ig in range(len(newglossary_suffix)): if check_MD5(suffix_nodes[newglossary_suffix[ig][2]],newglossary_suffix[ig][2]) or (count == 1): # We must run makeindex if Verbose: print("Need to run makeindex for newglossary") newglfile = suffix_nodes[newglossary_suffix[ig][2]] MakeNewGlossaryAction = SCons.Action.Action("$MAKENEWGLOSSARYCOM ${SOURCE.filebase}%s -s ${SOURCE.filebase}.ist -t ${SOURCE.filebase}%s -o ${SOURCE.filebase}%s" % (newglossary_suffix[ig][2],newglossary_suffix[ig][0],newglossary_suffix[ig][1]), "$MAKENEWGLOSSARYCOMSTR") result = MakeNewGlossaryAction(newglfile, newglfile, env) if result != 0: check_file_error_message('%s (newglossary)' % env['MAKENEWGLOSSARY'], newglossary_suffix[ig][0]) return result # Now decide if latex needs to be run yet again to resolve warnings. if warning_rerun_re.search(logContent): must_rerun_latex = True if Verbose: print("rerun Latex due to latex or package rerun warning") if rerun_citations_re.search(logContent): must_rerun_latex = True if Verbose: print("rerun Latex due to 'Rerun to get citations correct' warning") if undefined_references_re.search(logContent): must_rerun_latex = True if Verbose: print("rerun Latex due to undefined references or citations") if (count >= int(env.subst('$LATEXRETRIES')) and must_rerun_latex): print("reached max number of retries on Latex ,",int(env.subst('$LATEXRETRIES'))) # end of while loop # rename Latex's output to what the target name is if not (str(target[0]) == resultfilename and os.path.isfile(resultfilename)): if os.path.isfile(resultfilename): print("move %s to %s" % (resultfilename, str(target[0]), )) shutil.move(resultfilename,str(target[0])) # Original comment (when TEXPICTS was not restored): # The TEXPICTS enviroment variable is needed by a dvi -> pdf step # later on Mac OSX so leave it # # It is also used when searching for pictures (implicit dependencies). # Why not set the variable again in the respective builder instead # of leaving local modifications in the environment? What if multiple # latex builds in different directories need different TEXPICTS? for var in SCons.Scanner.LaTeX.LaTeX.env_variables: if var == 'TEXPICTS': continue if saved_env[var] is _null: try: del env['ENV'][var] except KeyError: pass # was never set else: env['ENV'][var] = saved_env[var] return result def LaTeXAuxAction(target = None, source= None, env=None): result = InternalLaTeXAuxAction( LaTeXAction, target, source, env ) return result LaTeX_re = re.compile("\\\\document(style|class)") def is_LaTeX(flist,env,abspath): """Scan a file list to decide if it's TeX- or LaTeX-flavored.""" # We need to scan files that are included in case the # \documentclass command is in them. # get path list from both env['TEXINPUTS'] and env['ENV']['TEXINPUTS'] savedpath = modify_env_var(env, 'TEXINPUTS', abspath) paths = env['ENV']['TEXINPUTS'] if SCons.Util.is_List(paths): pass else: # Split at os.pathsep to convert into absolute path paths = paths.split(os.pathsep) # now that we have the path list restore the env if savedpath is _null: try: del env['ENV']['TEXINPUTS'] except KeyError: pass # was never set else: env['ENV']['TEXINPUTS'] = savedpath if Verbose: print("is_LaTeX search path ",paths) print("files to search :",flist) # Now that we have the search path and file list, check each one for f in flist: if Verbose: print(" checking for Latex source ",str(f)) content = f.get_text_contents() if LaTeX_re.search(content): if Verbose: print("file %s is a LaTeX file" % str(f)) return 1 if Verbose: print("file %s is not a LaTeX file" % str(f)) # now find included files inc_files = [ ] inc_files.extend( include_re.findall(content) ) if Verbose: print("files included by '%s': "%str(f),inc_files) # inc_files is list of file names as given. need to find them # using TEXINPUTS paths. # search the included files for src in inc_files: srcNode = FindFile(src,['.tex','.ltx','.latex'],paths,env,requireExt=False) # make this a list since is_LaTeX takes a list. fileList = [srcNode,] if Verbose: print("FindFile found ",srcNode) if srcNode is not None: file_test = is_LaTeX(fileList, env, abspath) # return on first file that finds latex is needed. if file_test: return file_test if Verbose: print(" done scanning ",str(f)) return 0 def TeXLaTeXFunction(target = None, source= None, env=None): """A builder for TeX and LaTeX that scans the source file to decide the "flavor" of the source and then executes the appropriate program.""" # find these paths for use in is_LaTeX to search for included files basedir = os.path.split(str(source[0]))[0] abspath = os.path.abspath(basedir) if is_LaTeX(source,env,abspath): result = LaTeXAuxAction(target,source,env) if result != 0: check_file_error_message(env['LATEX']) else: result = TeXAction(target,source,env) if result != 0: check_file_error_message(env['TEX']) return result def TeXLaTeXStrFunction(target = None, source= None, env=None): """A strfunction for TeX and LaTeX that scans the source file to decide the "flavor" of the source and then returns the appropriate command string.""" if env.GetOption("no_exec"): # find these paths for use in is_LaTeX to search for included files basedir = os.path.split(str(source[0]))[0] abspath = os.path.abspath(basedir) if is_LaTeX(source,env,abspath): result = env.subst('$LATEXCOM',0,target,source)+" ..." else: result = env.subst("$TEXCOM",0,target,source)+" ..." else: result = '' return result def tex_eps_emitter(target, source, env): """An emitter for TeX and LaTeX sources when executing tex or latex. It will accept .ps and .eps graphics files """ (target, source) = tex_emitter_core(target, source, env, TexGraphics) return (target, source) def tex_pdf_emitter(target, source, env): """An emitter for TeX and LaTeX sources when executing pdftex or pdflatex. It will accept graphics files of types .pdf, .jpg, .png, .gif, and .tif """ (target, source) = tex_emitter_core(target, source, env, LatexGraphics) return (target, source) def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files): """ For theFile (a Node) update any file_tests and search for graphics files then find all included files and call ScanFiles recursively for each of them""" content = theFile.get_text_contents() if Verbose: print(" scanning ",str(theFile)) for i in range(len(file_tests_search)): if file_tests[i][0] is None: if Verbose: print("scan i ",i," files_tests[i] ",file_tests[i], file_tests[i][1]) file_tests[i][0] = file_tests_search[i].search(content) if Verbose and file_tests[i][0]: print(" found match for ",file_tests[i][1][-1]) # for newglossary insert the suffixes in file_tests[i] if file_tests[i][0] and file_tests[i][1][-1] == 'newglossary': findresult = file_tests_search[i].findall(content) for l in range(len(findresult)) : (file_tests[i][1]).insert(0,'.'+findresult[l][3]) (file_tests[i][1]).insert(0,'.'+findresult[l][2]) (file_tests[i][1]).insert(0,'.'+findresult[l][0]) suffix_list = ['.'+findresult[l][0],'.'+findresult[l][2],'.'+findresult[l][3] ] newglossary_suffix.append(suffix_list) if Verbose: print(" new suffixes for newglossary ",newglossary_suffix) incResult = includeOnly_re.search(content) if incResult: aux_files.append(os.path.join(targetdir, incResult.group(1))) if Verbose: print("\include file names : ", aux_files) # recursively call this on each of the included files inc_files = [ ] inc_files.extend( include_re.findall(content) ) if Verbose: print("files included by '%s': "%str(theFile),inc_files) # inc_files is list of file names as given. need to find them # using TEXINPUTS paths. for src in inc_files: srcNode = FindFile(src,['.tex','.ltx','.latex'],paths,env,requireExt=False) if srcNode is not None: file_tests = ScanFiles(srcNode, target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files) if Verbose: print(" done scanning ",str(theFile)) return file_tests def tex_emitter_core(target, source, env, graphics_extensions): """An emitter for TeX and LaTeX sources. For LaTeX sources we try and find the common created files that are needed on subsequent runs of latex to finish tables of contents, bibliographies, indices, lists of figures, and hyperlink references. """ basename = SCons.Util.splitext(str(source[0]))[0] basefile = os.path.split(str(basename))[1] targetdir = os.path.split(str(target[0]))[0] targetbase = os.path.join(targetdir, basefile) basedir = os.path.split(str(source[0]))[0] abspath = os.path.abspath(basedir) target[0].attributes.path = abspath # # file names we will make use of in searching the sources and log file # emit_suffixes = ['.aux', '.log', '.ilg', '.blg', '.nls', '.nlg', '.gls', '.glg', '.alg'] + all_suffixes auxfilename = targetbase + '.aux' logfilename = targetbase + '.log' flsfilename = targetbase + '.fls' syncfilename = targetbase + '.synctex.gz' env.SideEffect(auxfilename,target[0]) env.SideEffect(logfilename,target[0]) env.SideEffect(flsfilename,target[0]) env.SideEffect(syncfilename,target[0]) if Verbose: print("side effect :",auxfilename,logfilename,flsfilename,syncfilename) env.Clean(target[0],auxfilename) env.Clean(target[0],logfilename) env.Clean(target[0],flsfilename) env.Clean(target[0],syncfilename) content = source[0].get_text_contents() # set up list with the regular expressions # we use to find features used file_tests_search = [auxfile_re, makeindex_re, bibliography_re, bibunit_re, multibib_re, addbibresource_re, tableofcontents_re, listoffigures_re, listoftables_re, hyperref_re, makenomenclature_re, makeglossary_re, makeglossaries_re, makeacronyms_re, beamer_re, newglossary_re, biblatex_re ] # set up list with the file suffixes that need emitting # when a feature is found file_tests_suff = [['.aux','aux_file'], ['.idx', '.ind', '.ilg','makeindex'], ['.bbl', '.blg','bibliography'], ['.bbl', '.blg','bibunit'], ['.bbl', '.blg','multibib'], ['.bbl', '.blg','.bcf','addbibresource'], ['.toc','contents'], ['.lof','figures'], ['.lot','tables'], ['.out','hyperref'], ['.nlo', '.nls', '.nlg','nomenclature'], ['.glo', '.gls', '.glg','glossary'], ['.glo', '.gls', '.glg','glossaries'], ['.acn', '.acr', '.alg','acronyms'], ['.nav', '.snm', '.out', '.toc','beamer'], ['newglossary',], ['.bcf', '.blg','biblatex'] ] # for newglossary the suffixes are added as we find the command # build the list of lists file_tests = [] for i in range(len(file_tests_search)): file_tests.append( [None, file_tests_suff[i]] ) # TO-DO: need to add a way for the user to extend this list for whatever # auxiliary files they create in other (or their own) packages # get path list from both env['TEXINPUTS'] and env['ENV']['TEXINPUTS'] savedpath = modify_env_var(env, 'TEXINPUTS', abspath) paths = env['ENV']['TEXINPUTS'] if SCons.Util.is_List(paths): pass else: # Split at os.pathsep to convert into absolute path paths = paths.split(os.pathsep) # now that we have the path list restore the env if savedpath is _null: try: del env['ENV']['TEXINPUTS'] except KeyError: pass # was never set else: env['ENV']['TEXINPUTS'] = savedpath if Verbose: print("search path ",paths) # scan all sources for side effect files aux_files = [] file_tests = ScanFiles(source[0], target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files) for (theSearch,suffix_list) in file_tests: # add side effects if feature is present.If file is to be generated,add all side effects if Verbose and theSearch: print("check side effects for ",suffix_list[-1]) if (theSearch != None) or (not source[0].exists() ): file_list = [targetbase,] # for bibunit we need a list of files if suffix_list[-1] == 'bibunit': file_basename = os.path.join(targetdir, 'bu*.aux') file_list = glob.glob(file_basename) # remove the suffix '.aux' for i in range(len(file_list)): file_list.append(SCons.Util.splitext(file_list[i])[0]) # for multibib we need a list of files if suffix_list[-1] == 'multibib': for multibibmatch in multibib_re.finditer(content): if Verbose: print("multibib match ",multibibmatch.group(1)) if multibibmatch != None: baselist = multibibmatch.group(1).split(',') if Verbose: print("multibib list ", baselist) for i in range(len(baselist)): file_list.append(os.path.join(targetdir, baselist[i])) # now define the side effects for file_name in file_list: for suffix in suffix_list[:-1]: env.SideEffect(file_name + suffix,target[0]) if Verbose: print("side effect tst :",file_name + suffix, " target is ",str(target[0])) env.Clean(target[0],file_name + suffix) for aFile in aux_files: aFile_base = SCons.Util.splitext(aFile)[0] env.SideEffect(aFile_base + '.aux',target[0]) if Verbose: print("side effect aux :",aFile_base + '.aux') env.Clean(target[0],aFile_base + '.aux') # read fls file to get all other files that latex creates and will read on the next pass # remove files from list that we explicitly dealt with above if os.path.isfile(flsfilename): content = open(flsfilename, "r").read() out_files = openout_re.findall(content) myfiles = [auxfilename, logfilename, flsfilename, targetbase+'.dvi',targetbase+'.pdf'] for filename in out_files[:]: if filename in myfiles: out_files.remove(filename) env.SideEffect(out_files,target[0]) if Verbose: print("side effect fls :",out_files) env.Clean(target[0],out_files) return (target, source) TeXLaTeXAction = None def generate(env): """Add Builders and construction variables for TeX to an Environment.""" global TeXLaTeXAction if TeXLaTeXAction is None: TeXLaTeXAction = SCons.Action.Action(TeXLaTeXFunction, strfunction=TeXLaTeXStrFunction) env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes) generate_common(env) from . import dvi dvi.generate(env) bld = env['BUILDERS']['DVI'] bld.add_action('.tex', TeXLaTeXAction) bld.add_emitter('.tex', tex_eps_emitter) def generate_darwin(env): try: environ = env['ENV'] except KeyError: environ = {} env['ENV'] = environ if (platform.system() == 'Darwin'): try: ospath = env['ENV']['PATHOSX'] except: ospath = None if ospath: env.AppendENVPath('PATH', ospath) def generate_common(env): """Add internal Builders and construction variables for LaTeX to an Environment.""" # Add OSX system paths so TeX tools can be found # when a list of tools is given the exists() method is not called generate_darwin(env) # A generic tex file Action, sufficient for all tex files. global TeXAction if TeXAction is None: TeXAction = SCons.Action.Action("$TEXCOM", "$TEXCOMSTR") # An Action to build a latex file. This might be needed more # than once if we are dealing with labels and bibtex. global LaTeXAction if LaTeXAction is None: LaTeXAction = SCons.Action.Action("$LATEXCOM", "$LATEXCOMSTR") # Define an action to run BibTeX on a file. global BibTeXAction if BibTeXAction is None: BibTeXAction = SCons.Action.Action("$BIBTEXCOM", "$BIBTEXCOMSTR") # Define an action to run Biber on a file. global BiberAction if BiberAction is None: BiberAction = SCons.Action.Action("$BIBERCOM", "$BIBERCOMSTR") # Define an action to run MakeIndex on a file. global MakeIndexAction if MakeIndexAction is None: MakeIndexAction = SCons.Action.Action("$MAKEINDEXCOM", "$MAKEINDEXCOMSTR") # Define an action to run MakeIndex on a file for nomenclatures. global MakeNclAction if MakeNclAction is None: MakeNclAction = SCons.Action.Action("$MAKENCLCOM", "$MAKENCLCOMSTR") # Define an action to run MakeIndex on a file for glossaries. global MakeGlossaryAction if MakeGlossaryAction is None: MakeGlossaryAction = SCons.Action.Action("$MAKEGLOSSARYCOM", "$MAKEGLOSSARYCOMSTR") # Define an action to run MakeIndex on a file for acronyms. global MakeAcronymsAction if MakeAcronymsAction is None: MakeAcronymsAction = SCons.Action.Action("$MAKEACRONYMSCOM", "$MAKEACRONYMSCOMSTR") try: environ = env['ENV'] except KeyError: environ = {} env['ENV'] = environ # Some Linux platforms have pdflatex set up in a way # that requires that the HOME environment variable be set. # Add it here if defined. v = os.environ.get('HOME') if v: environ['HOME'] = v CDCOM = 'cd ' if platform.system() == 'Windows': # allow cd command to change drives on Windows CDCOM = 'cd /D ' env['TEX'] = 'tex' env['TEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder') env['TEXCOM'] = CDCOM + '${TARGET.dir} && $TEX $TEXFLAGS ${SOURCE.file}' env['PDFTEX'] = 'pdftex' env['PDFTEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder') env['PDFTEXCOM'] = CDCOM + '${TARGET.dir} && $PDFTEX $PDFTEXFLAGS ${SOURCE.file}' env['LATEX'] = 'latex' env['LATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder') env['LATEXCOM'] = CDCOM + '${TARGET.dir} && $LATEX $LATEXFLAGS ${SOURCE.file}' env['LATEXRETRIES'] = 4 env['PDFLATEX'] = 'pdflatex' env['PDFLATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder') env['PDFLATEXCOM'] = CDCOM + '${TARGET.dir} && $PDFLATEX $PDFLATEXFLAGS ${SOURCE.file}' env['BIBTEX'] = 'bibtex' env['BIBTEXFLAGS'] = SCons.Util.CLVar('') env['BIBTEXCOM'] = CDCOM + '${TARGET.dir} && $BIBTEX $BIBTEXFLAGS ${SOURCE.filebase}' env['BIBER'] = 'biber' env['BIBERFLAGS'] = SCons.Util.CLVar('') env['BIBERCOM'] = CDCOM + '${TARGET.dir} && $BIBER $BIBERFLAGS ${SOURCE.filebase}' env['MAKEINDEX'] = 'makeindex' env['MAKEINDEXFLAGS'] = SCons.Util.CLVar('') env['MAKEINDEXCOM'] = CDCOM + '${TARGET.dir} && $MAKEINDEX $MAKEINDEXFLAGS ${SOURCE.file}' env['MAKEGLOSSARY'] = 'makeindex' env['MAKEGLOSSARYSTYLE'] = '${SOURCE.filebase}.ist' env['MAKEGLOSSARYFLAGS'] = SCons.Util.CLVar('-s ${MAKEGLOSSARYSTYLE} -t ${SOURCE.filebase}.glg') env['MAKEGLOSSARYCOM'] = CDCOM + '${TARGET.dir} && $MAKEGLOSSARY ${SOURCE.filebase}.glo $MAKEGLOSSARYFLAGS -o ${SOURCE.filebase}.gls' env['MAKEACRONYMS'] = 'makeindex' env['MAKEACRONYMSSTYLE'] = '${SOURCE.filebase}.ist' env['MAKEACRONYMSFLAGS'] = SCons.Util.CLVar('-s ${MAKEACRONYMSSTYLE} -t ${SOURCE.filebase}.alg') env['MAKEACRONYMSCOM'] = CDCOM + '${TARGET.dir} && $MAKEACRONYMS ${SOURCE.filebase}.acn $MAKEACRONYMSFLAGS -o ${SOURCE.filebase}.acr' env['MAKENCL'] = 'makeindex' env['MAKENCLSTYLE'] = 'nomencl.ist' env['MAKENCLFLAGS'] = '-s ${MAKENCLSTYLE} -t ${SOURCE.filebase}.nlg' env['MAKENCLCOM'] = CDCOM + '${TARGET.dir} && $MAKENCL ${SOURCE.filebase}.nlo $MAKENCLFLAGS -o ${SOURCE.filebase}.nls' env['MAKENEWGLOSSARY'] = 'makeindex' env['MAKENEWGLOSSARYCOM'] = CDCOM + '${TARGET.dir} && $MAKENEWGLOSSARY ' def exists(env): generate_darwin(env) return env.Detect('tex') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/mslib.py0000664000175000017500000000424313160023044021136 0ustar bdbaddogbdbaddog"""SCons.Tool.mslib Tool-specific initialization for lib (MicroSoft library archiver). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/mslib.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Tool.msvs import SCons.Tool.msvc import SCons.Util from .MSCommon import msvc_exists, msvc_setup_env_once def generate(env): """Add Builders and construction variables for lib to an Environment.""" SCons.Tool.createStaticLibBuilder(env) # Set-up ms tools paths msvc_setup_env_once(env) env['AR'] = 'lib' env['ARFLAGS'] = SCons.Util.CLVar('/nologo') env['ARCOM'] = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES','$ARCOMSTR')}" env['LIBPREFIX'] = '' env['LIBSUFFIX'] = '.lib' def exists(env): return msvc_exists() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/ToolTests.py0000664000175000017500000000566113160023041021772 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/ToolTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestUnit import SCons.Errors import SCons.Tool class ToolTestCase(unittest.TestCase): def test_Tool(self): """Test the Tool() function""" class Environment(object): def __init__(self): self.dict = {} def Detect(self, progs): if not SCons.Util.is_List(progs): progs = [ progs ] return progs[0] def Append(self, **kw): self.dict.update(kw) def __getitem__(self, key): return self.dict[key] def __setitem__(self, key, val): self.dict[key] = val def __contains__(self, key): return self.dict.__contains__(key) def has_key(self, key): return key in self.dict def subst(self, string, *args, **kwargs): return string env = Environment() env['BUILDERS'] = {} env['ENV'] = {} env['PLATFORM'] = 'test' t = SCons.Tool.Tool('g++') t(env) assert (env['CXX'] == 'c++' or env['CXX'] == 'g++'), env['CXX'] assert env['INCPREFIX'] == '-I', env['INCPREFIX'] assert env['TOOLS'] == ['g++'], env['TOOLS'] try: SCons.Tool.Tool() except TypeError: pass else: raise try: p = SCons.Tool.Tool('_does_not_exist_') except SCons.Errors.EnvironmentError: pass else: raise if __name__ == "__main__": suite = unittest.makeSuite(ToolTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/gdc.xml0000664000175000017500000001520613160023044020736 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the D language compiler GDC. DC DCOM SHDC SHDCOM DPATH DFLAGS DVERSIONS DDEBUG DINCPREFIX DINCSUFFIX DVERPREFIX DVERSUFFIX DDEBUGPREFIX DDEBUGSUFFIX DFLAGPREFIX DFLAGSUFFIX DFILESUFFIX DLINK DLINKFLAGS DLINKCOM SHDLINK SHDLINKFLAGS SHDLINKCOM DLIBLINKPREFIX DLIBLINKSUFFIX DLIBDIRPREFIX DLIBDIRSUFFIX DLIB DLIBCOM DLIBFLAGPREFIX DLIBFLAGSUFFIX DLINKFLAGPREFIX DLINKFLAGSUFFIX DRPATHPREFIX DRPATHSUFFIX DShLibSonameGenerator SHDLIBVERSION SHDLIBVERSIONFLAGS The D compiler to use. The command line used to compile a D file to an object file. Any options specified in the &cv-link-DFLAGS; construction variable is included on this command line. List of debug tags to enable when compiling. General options that are passed to the D compiler. Name of the lib tool to use for D codes. The command line to use when creating libraries. Name of the linker to use for linking systems including D sources. The command line to use when linking systems including D sources. List of linker flags. List of paths to search for import modules. List of version tags to enable when compiling. The name of the compiler to use when compiling D source destined to be in a shared objects. The command line to use when compiling code to be part of shared objects. The linker to use when creating shared objects for code bases include D sources. The command line to use when generating shared objects. The list of flags to use when generating a shared object. DVERSUFFIX. DVERPREFIX. DLINKFLAGSUFFIX. DLINKFLAGPREFIX. DLIBLINKSUFFIX. DLIBLINKPREFIX. DLIBFLAGSUFFIX. DLIBFLAGPREFIX. DLIBLINKSUFFIX. DLIBLINKPREFIX. DLIBFLAGSUFFIX. DINCPREFIX. DFLAGSUFFIX. DFLAGPREFIX. DFILESUFFIX. DDEBUGPREFIX. DDEBUGSUFFIX. Builds an executable from D sources without first creating individual objects for each file. D sources can be compiled file-by-file as C and C++ source are, and D is integrated into the &scons; Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others will not. scons-src-3.0.0/src/engine/SCons/Tool/hpcc.xml0000664000175000017500000000217713160023044021121 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the aCC on HP/UX systems. Calls the &t-cXX; tool for additional variables. CXX SHCXXFLAGS CXXVERSION scons-src-3.0.0/src/engine/SCons/Tool/cyglink.xml0000664000175000017500000000252413160023041021635 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for cygwin linker/loader. IMPLIBPREFIX IMPLIBSUFFIX LDMODULEVERSIONFLAGS LINKFLAGS RPATHPREFIX RPATHSUFFIX SHLIBPREFIX SHLIBSUFFIX SHLIBVERSIONFLAGS SHLINKCOM SHLINKFLAGS _LDMODULEVERSIONFLAGS _SHLIBVERSIONFLAGS scons-src-3.0.0/src/engine/SCons/Tool/sunf77.xml0000664000175000017500000000217613160023044021334 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the Sun &f77; Fortran compiler. FORTRAN F77 SHFORTRAN SHF77 SHFORTRANFLAGS SHF77FLAGS scons-src-3.0.0/src/engine/SCons/Tool/mslink.py0000664000175000017500000003424513160023044021332 0ustar bdbaddogbdbaddog"""SCons.Tool.mslink Tool-specific initialization for the Microsoft linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/Tool/mslink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import SCons.Action import SCons.Defaults import SCons.Errors import SCons.Platform.win32 import SCons.Tool import SCons.Tool.msvc import SCons.Tool.msvs import SCons.Util from .MSCommon import msvc_setup_env_once, msvc_exists def pdbGenerator(env, target, source, for_signature): try: return ['/PDB:%s' % target[0].attributes.pdb, '/DEBUG'] except (AttributeError, IndexError): return None def _dllTargets(target, source, env, for_signature, paramtp): listCmd = [] dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp) if dll: listCmd.append("/out:%s"%dll.get_string(for_signature)) implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX') if implib: listCmd.append("/implib:%s"%implib.get_string(for_signature)) return listCmd def _dllSources(target, source, env, for_signature, paramtp): listCmd = [] deffile = env.FindIxes(source, "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX") for src in source: # Check explicitly for a non-None deffile so that the __cmp__ # method of the base SCons.Util.Proxy class used for some Node # proxies doesn't try to use a non-existent __dict__ attribute. if deffile and src == deffile: # Treat this source as a .def file. listCmd.append("/def:%s" % src.get_string(for_signature)) else: # Just treat it as a generic source file. listCmd.append(src) return listCmd def windowsShlinkTargets(target, source, env, for_signature): return _dllTargets(target, source, env, for_signature, 'SHLIB') def windowsShlinkSources(target, source, env, for_signature): return _dllSources(target, source, env, for_signature, 'SHLIB') def _windowsLdmodTargets(target, source, env, for_signature): """Get targets for loadable modules.""" return _dllTargets(target, source, env, for_signature, 'LDMODULE') def _windowsLdmodSources(target, source, env, for_signature): """Get sources for loadable modules.""" return _dllSources(target, source, env, for_signature, 'LDMODULE') def _dllEmitter(target, source, env, paramtp): """Common implementation of dll emitter.""" SCons.Tool.msvc.validate_vars(env) extratargets = [] extrasources = [] dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp) no_import_lib = env.get('no_import_lib', 0) if not dll: raise SCons.Errors.UserError('A shared library should have exactly one target with the suffix: %s' % env.subst('$%sSUFFIX' % paramtp)) insert_def = env.subst("$WINDOWS_INSERT_DEF") if not insert_def in ['', '0', 0] and \ not env.FindIxes(source, "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX"): # append a def file to the list of sources extrasources.append( env.ReplaceIxes(dll, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp, "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX")) version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0')) if version_num >= 8.0 and \ (env.get('WINDOWS_INSERT_MANIFEST', 0) or env.get('WINDOWS_EMBED_MANIFEST', 0)): # MSVC 8 and above automatically generate .manifest files that must be installed extratargets.append( env.ReplaceIxes(dll, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp, "WINDOWSSHLIBMANIFESTPREFIX", "WINDOWSSHLIBMANIFESTSUFFIX")) if 'PDB' in env and env['PDB']: pdb = env.arg2nodes('$PDB', target=target, source=source)[0] extratargets.append(pdb) target[0].attributes.pdb = pdb if version_num >= 11.0 and env.get('PCH', 0): # MSVC 11 and above need the PCH object file to be added to the link line, # otherwise you get link error LNK2011. pchobj = SCons.Util.splitext(str(env['PCH']))[0] + '.obj' # print "prog_emitter, version %s, appending pchobj %s"%(version_num, pchobj) if pchobj not in extrasources: extrasources.append(pchobj) if not no_import_lib and \ not env.FindIxes(target, "LIBPREFIX", "LIBSUFFIX"): # Append an import library to the list of targets. extratargets.append( env.ReplaceIxes(dll, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp, "LIBPREFIX", "LIBSUFFIX")) # and .exp file is created if there are exports from a DLL extratargets.append( env.ReplaceIxes(dll, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp, "WINDOWSEXPPREFIX", "WINDOWSEXPSUFFIX")) return (target+extratargets, source+extrasources) def windowsLibEmitter(target, source, env): return _dllEmitter(target, source, env, 'SHLIB') def ldmodEmitter(target, source, env): """Emitter for loadable modules. Loadable modules are identical to shared libraries on Windows, but building them is subject to different parameters (LDMODULE*). """ return _dllEmitter(target, source, env, 'LDMODULE') def prog_emitter(target, source, env): SCons.Tool.msvc.validate_vars(env) extratargets = [] extrasources = [] exe = env.FindIxes(target, "PROGPREFIX", "PROGSUFFIX") if not exe: raise SCons.Errors.UserError("An executable should have exactly one target with the suffix: %s" % env.subst("$PROGSUFFIX")) version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0')) if version_num >= 8.0 and \ (env.get('WINDOWS_INSERT_MANIFEST', 0) or env.get('WINDOWS_EMBED_MANIFEST', 0)): # MSVC 8 and above automatically generate .manifest files that have to be installed extratargets.append( env.ReplaceIxes(exe, "PROGPREFIX", "PROGSUFFIX", "WINDOWSPROGMANIFESTPREFIX", "WINDOWSPROGMANIFESTSUFFIX")) if 'PDB' in env and env['PDB']: pdb = env.arg2nodes('$PDB', target=target, source=source)[0] extratargets.append(pdb) target[0].attributes.pdb = pdb if version_num >= 11.0 and env.get('PCH', 0): # MSVC 11 and above need the PCH object file to be added to the link line, # otherwise you get link error LNK2011. pchobj = SCons.Util.splitext(str(env['PCH']))[0] + '.obj' # print("prog_emitter, version %s, appending pchobj %s"%(version_num, pchobj)) if pchobj not in extrasources: extrasources.append(pchobj) return (target+extratargets,source+extrasources) def RegServerFunc(target, source, env): if 'register' in env and env['register']: ret = regServerAction([target[0]], [source[0]], env) if ret: raise SCons.Errors.UserError("Unable to register %s" % target[0]) else: print("Registered %s sucessfully" % target[0]) return ret return 0 # These are the actual actions run to embed the manifest. # They are only called from the Check versions below. embedManifestExeAction = SCons.Action.Action('$MTEXECOM') embedManifestDllAction = SCons.Action.Action('$MTSHLIBCOM') def embedManifestDllCheck(target, source, env): """Function run by embedManifestDllCheckAction to check for existence of manifest and other conditions, and embed the manifest by calling embedManifestDllAction if so.""" if env.get('WINDOWS_EMBED_MANIFEST', 0): manifestSrc = target[0].get_abspath() + '.manifest' if os.path.exists(manifestSrc): ret = (embedManifestDllAction) ([target[0]],None,env) if ret: raise SCons.Errors.UserError("Unable to embed manifest into %s" % (target[0])) return ret else: print('(embed: no %s.manifest found; not embedding.)'%str(target[0])) return 0 def embedManifestExeCheck(target, source, env): """Function run by embedManifestExeCheckAction to check for existence of manifest and other conditions, and embed the manifest by calling embedManifestExeAction if so.""" if env.get('WINDOWS_EMBED_MANIFEST', 0): manifestSrc = target[0].get_abspath() + '.manifest' if os.path.exists(manifestSrc): ret = (embedManifestExeAction) ([target[0]],None,env) if ret: raise SCons.Errors.UserError("Unable to embed manifest into %s" % (target[0])) return ret else: print('(embed: no %s.manifest found; not embedding.)'%str(target[0])) return 0 embedManifestDllCheckAction = SCons.Action.Action(embedManifestDllCheck, None) embedManifestExeCheckAction = SCons.Action.Action(embedManifestExeCheck, None) regServerAction = SCons.Action.Action("$REGSVRCOM", "$REGSVRCOMSTR") regServerCheck = SCons.Action.Action(RegServerFunc, None) shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES", "$SHLINKCOMSTR")}', '$SHLINKCOMSTR') compositeShLinkAction = shlibLinkAction + regServerCheck + embedManifestDllCheckAction ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES", "$LDMODULECOMSTR")}', '$LDMODULECOMSTR') compositeLdmodAction = ldmodLinkAction + regServerCheck + embedManifestDllCheckAction exeLinkAction = SCons.Action.Action('${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows", "$LINKCOMSTR")}', '$LINKCOMSTR') compositeLinkAction = exeLinkAction + embedManifestExeCheckAction def generate(env): """Add Builders and construction variables for ar to an Environment.""" SCons.Tool.createSharedLibBuilder(env) SCons.Tool.createProgBuilder(env) env['SHLINK'] = '$LINK' env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll') env['_SHLINK_TARGETS'] = windowsShlinkTargets env['_SHLINK_SOURCES'] = windowsShlinkSources env['SHLINKCOM'] = compositeShLinkAction env.Append(SHLIBEMITTER = [windowsLibEmitter]) env.Append(LDMODULEEMITTER = [windowsLibEmitter]) env['LINK'] = 'link' env['LINKFLAGS'] = SCons.Util.CLVar('/nologo') env['_PDB'] = pdbGenerator env['LINKCOM'] = compositeLinkAction env.Append(PROGEMITTER = [prog_emitter]) env['LIBDIRPREFIX']='/LIBPATH:' env['LIBDIRSUFFIX']='' env['LIBLINKPREFIX']='' env['LIBLINKSUFFIX']='$LIBSUFFIX' env['WIN32DEFPREFIX'] = '' env['WIN32DEFSUFFIX'] = '.def' env['WIN32_INSERT_DEF'] = 0 env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}' env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}' env['WINDOWS_INSERT_DEF'] = '${WIN32_INSERT_DEF}' env['WIN32EXPPREFIX'] = '' env['WIN32EXPSUFFIX'] = '.exp' env['WINDOWSEXPPREFIX'] = '${WIN32EXPPREFIX}' env['WINDOWSEXPSUFFIX'] = '${WIN32EXPSUFFIX}' env['WINDOWSSHLIBMANIFESTPREFIX'] = '' env['WINDOWSSHLIBMANIFESTSUFFIX'] = '${SHLIBSUFFIX}.manifest' env['WINDOWSPROGMANIFESTPREFIX'] = '' env['WINDOWSPROGMANIFESTSUFFIX'] = '${PROGSUFFIX}.manifest' env['REGSVRACTION'] = regServerCheck env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32') env['REGSVRFLAGS'] = '/s ' env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}' env['WINDOWS_EMBED_MANIFEST'] = 0 env['MT'] = 'mt' #env['MTFLAGS'] = ['-hashupdate'] env['MTFLAGS'] = SCons.Util.CLVar('/nologo') # Note: use - here to prevent build failure if no manifest produced. # This seems much simpler than a fancy system using a function action to see # if the manifest actually exists before trying to run mt with it. env['MTEXECOM'] = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;1' env['MTSHLIBCOM'] = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;2' # TODO Future work garyo 27-Feb-11 env['_MANIFEST_SOURCES'] = None # _windowsManifestSources # Set-up ms tools paths msvc_setup_env_once(env) # Loadable modules are on Windows the same as shared libraries, but they # are subject to different build parameters (LDMODULE* variables). # Therefore LDMODULE* variables correspond as much as possible to # SHLINK*/SHLIB* ones. SCons.Tool.createLoadableModuleBuilder(env) env['LDMODULE'] = '$SHLINK' env['LDMODULEPREFIX'] = '$SHLIBPREFIX' env['LDMODULESUFFIX'] = '$SHLIBSUFFIX' env['LDMODULEFLAGS'] = '$SHLINKFLAGS' env['_LDMODULE_TARGETS'] = _windowsLdmodTargets env['_LDMODULE_SOURCES'] = _windowsLdmodSources env['LDMODULEEMITTER'] = [ldmodEmitter] env['LDMODULECOM'] = compositeLdmodAction def exists(env): return msvc_exists() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/dvips.py0000664000175000017500000000661713160023044021164 0ustar bdbaddogbdbaddog"""SCons.Tool.dvips Tool-specific initialization for dvips. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/dvips.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Action import SCons.Builder import SCons.Tool.dvipdf import SCons.Util def DviPsFunction(target = None, source= None, env=None): result = SCons.Tool.dvipdf.DviPdfPsFunction(PSAction,target,source,env) return result def DviPsStrFunction(target = None, source= None, env=None): """A strfunction for dvipdf that returns the appropriate command string for the no_exec options.""" if env.GetOption("no_exec"): result = env.subst('$PSCOM',0,target,source) else: result = '' return result PSAction = None DVIPSAction = None PSBuilder = None def generate(env): """Add Builders and construction variables for dvips to an Environment.""" global PSAction if PSAction is None: PSAction = SCons.Action.Action('$PSCOM', '$PSCOMSTR') global DVIPSAction if DVIPSAction is None: DVIPSAction = SCons.Action.Action(DviPsFunction, strfunction = DviPsStrFunction) global PSBuilder if PSBuilder is None: PSBuilder = SCons.Builder.Builder(action = PSAction, prefix = '$PSPREFIX', suffix = '$PSSUFFIX', src_suffix = '.dvi', src_builder = 'DVI', single_source=True) env['BUILDERS']['PostScript'] = PSBuilder env['DVIPS'] = 'dvips' env['DVIPSFLAGS'] = SCons.Util.CLVar('') # I'm not quite sure I got the directories and filenames right for variant_dir # We need to be in the correct directory for the sake of latex \includegraphics eps included files. env['PSCOM'] = 'cd ${TARGET.dir} && $DVIPS $DVIPSFLAGS -o ${TARGET.file} ${SOURCE.file}' env['PSPREFIX'] = '' env['PSSUFFIX'] = '.ps' def exists(env): SCons.Tool.tex.generate_darwin(env) return env.Detect('dvips') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/install.xml0000664000175000017500000000457013160023044021651 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for file and directory installation. INSTALL INSTALLSTR Installs one or more source files or directories in the specified target, which must be a directory. The names of the specified source files or directories remain the same within the destination directory. The sources may be given as a string or as a node returned by a builder. env.Install('/usr/local/bin', source = ['foo', 'bar']) Installs one or more source files or directories to specific names, allowing changing a file or directory name as part of the installation. It is an error if the target and source arguments list different numbers of files or directories. env.InstallAs(target = '/usr/local/bin/foo', source = 'foo_debug') env.InstallAs(target = ['../lib/libfoo.a', '../lib/libbar.a'], source = ['libFOO.a', 'libBAR.a']) Installs a versioned shared library. The symlinks appropriate to the architecture will be generated based on symlinks of the source library. env.InstallVersionedLib(target = '/usr/local/bin/foo', source = 'libxyz.1.5.2.so') scons-src-3.0.0/src/engine/SCons/Tool/nasm.py0000664000175000017500000000513013160023044020762 0ustar bdbaddogbdbaddog"""SCons.Tool.nasm Tool-specific initialization for nasm, the famous Netwide Assembler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/nasm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Util ASSuffixes = ['.s', '.asm', '.ASM'] ASPPSuffixes = ['.spp', '.SPP', '.sx'] if SCons.Util.case_sensitive_suffixes('.s', '.S'): ASPPSuffixes.extend(['.S']) else: ASSuffixes.extend(['.S']) def generate(env): """Add Builders and construction variables for nasm to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) for suffix in ASSuffixes: static_obj.add_action(suffix, SCons.Defaults.ASAction) static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) for suffix in ASPPSuffixes: static_obj.add_action(suffix, SCons.Defaults.ASPPAction) static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) env['AS'] = 'nasm' env['ASFLAGS'] = SCons.Util.CLVar('') env['ASPPFLAGS'] = '$ASFLAGS' env['ASCOM'] = '$AS $ASFLAGS -o $TARGET $SOURCES' env['ASPPCOM'] = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' def exists(env): return env.Detect('nasm') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/cxx.py0000664000175000017500000000655013160023041020632 0ustar bdbaddogbdbaddog"""SCons.Tool.c++ Tool-specific initialization for generic Posix C++ compilers. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/cxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import SCons.Tool import SCons.Defaults import SCons.Util compilers = ['CC', 'c++'] CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm'] if SCons.Util.case_sensitive_suffixes('.c', '.C'): CXXSuffixes.append('.C') def iscplusplus(source): if not source: # Source might be None for unusual cases like SConf. return 0 for s in source: if s.sources: ext = os.path.splitext(str(s.sources[0]))[1] if ext in CXXSuffixes: return 1 return 0 def generate(env): """ Add Builders and construction variables for Visual Age C++ compilers to an Environment. """ import SCons.Tool import SCons.Tool.cc static_obj, shared_obj = SCons.Tool.createObjBuilders(env) for suffix in CXXSuffixes: static_obj.add_action(suffix, SCons.Defaults.CXXAction) shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction) static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) SCons.Tool.cc.add_common_cc_variables(env) if 'CXX' not in env: env['CXX'] = env.Detect(compilers) or compilers[0] env['CXXFLAGS'] = SCons.Util.CLVar('') env['CXXCOM'] = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES' env['SHCXX'] = '$CXX' env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS') env['SHCXXCOM'] = '$SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES' env['CPPDEFPREFIX'] = '-D' env['CPPDEFSUFFIX'] = '' env['INCPREFIX'] = '-I' env['INCSUFFIX'] = '' env['SHOBJSUFFIX'] = '.os' env['OBJSUFFIX'] = '.o' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0 env['CXXFILESUFFIX'] = '.cc' def exists(env): return env.Detect(env.get('CXX', compilers)) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/gcc.py0000664000175000017500000000667513160023044020577 0ustar bdbaddogbdbaddog"""SCons.Tool.gcc Tool-specific initialization for gcc. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/gcc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from . import cc import os import re import subprocess import SCons.Util compilers = ['gcc', 'cc'] def generate(env): """Add Builders and construction variables for gcc to an Environment.""" if 'CC' not in env: env['CC'] = env.Detect(compilers) or compilers[0] cc.generate(env) if env['PLATFORM'] in ['cygwin', 'win32']: env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') else: env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC') # determine compiler version version = detect_version(env, env['CC']) if version: env['CCVERSION'] = version def exists(env): # is executable, and is a GNU compiler (or accepts '--version' at least) return detect_version(env, env.Detect(env.get('CC', compilers))) def detect_version(env, cc): """Return the version of the GNU compiler, or None if it is not a GNU compiler.""" cc = env.subst(cc) if not cc: return None version = None #pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'], pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'], stdin = 'devnull', stderr = 'devnull', stdout = subprocess.PIPE) # -dumpversion was added in GCC 3.0. As long as we're supporting # GCC versions older than that, we should use --version and a # regular expression. #line = pipe.stdout.read().strip() #if line: # version = line line = SCons.Util.to_str(pipe.stdout.readline()) match = re.search(r'[0-9]+(\.[0-9]+)+', line) if match: version = match.group(0) # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer: # So continue with reading to let the child process actually terminate. while SCons.Util.to_str(pipe.stdout.readline()): pass ret = pipe.wait() if ret != 0: return None return version # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/tar.xml0000664000175000017500000000533013160023045020765 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &tar; archiver. TAR TARFLAGS TARCOM TARSUFFIX TARCOMSTR Builds a tar archive of the specified files and/or directories. Unlike most builder methods, the &b-Tar; builder method may be called multiple times for a given target; each additional call adds to the list of entries that will be built into the archive. Any source directories will be scanned for changes to any on-disk files, regardless of whether or not &scons; knows about them from other Builder or function calls. env.Tar('src.tar', 'src') # Create the stuff.tar file. env.Tar('stuff', ['subdir1', 'subdir2']) # Also add "another" to the stuff.tar file. env.Tar('stuff', 'another') # Set TARFLAGS to create a gzip-filtered archive. env = Environment(TARFLAGS = '-c -z') env.Tar('foo.tar.gz', 'foo') # Also set the suffix to .tgz. env = Environment(TARFLAGS = '-c -z', TARSUFFIX = '.tgz') env.Tar('foo') The tar archiver. The command line used to call the tar archiver. The string displayed when archiving files using the tar archiver. If this is not set, then &cv-link-TARCOM; (the command line) is displayed. env = Environment(TARCOMSTR = "Archiving $TARGET") General options passed to the tar archiver. The suffix used for tar file names. scons-src-3.0.0/src/engine/SCons/Tool/dmd.py0000664000175000017500000001425413160023041020574 0ustar bdbaddogbdbaddogfrom __future__ import print_function """SCons.Tool.dmd Tool-specific initialization for the Digital Mars D compiler. (http://digitalmars.com/d) Originally coded by Andy Friesen (andy@ikagames.com) 15 November 2003 Evolved by Russel Winder (russel@winder.org.uk) 2010-02-07 onwards Compiler variables: DC - The name of the D compiler to use. Defaults to dmd or gdmd, whichever is found. DPATH - List of paths to search for import modules. DVERSIONS - List of version tags to enable when compiling. DDEBUG - List of debug tags to enable when compiling. Linker related variables: LIBS - List of library files to link in. DLINK - Name of the linker to use. Defaults to dmd or gdmd, whichever is found. DLINKFLAGS - List of linker flags. Lib tool variables: DLIB - Name of the lib tool to use. Defaults to lib. DLIBFLAGS - List of flags to pass to the lib tool. LIBS - Same as for the linker. (libraries to pull into the .lib) """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/dmd.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import subprocess import SCons.Action import SCons.Builder import SCons.Defaults import SCons.Scanner.D import SCons.Tool import SCons.Tool.DCommon as DCommon def generate(env): static_obj, shared_obj = SCons.Tool.createObjBuilders(env) static_obj.add_action('.d', SCons.Defaults.DAction) shared_obj.add_action('.d', SCons.Defaults.ShDAction) static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter) env['DC'] = env.Detect(['dmd', 'ldmd2', 'gdmd']) or 'dmd' env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -of$TARGET $SOURCES' env['_DINCFLAGS'] = '${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}' env['_DVERFLAGS'] = '${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}' env['_DDEBUGFLAGS'] = '${_concat(DDEBUGPREFIX, DDEBUG, DDEBUGSUFFIX, __env__)}' env['_DFLAGS'] = '${_concat(DFLAGPREFIX, DFLAGS, DFLAGSUFFIX, __env__)}' env['SHDC'] = '$DC' env['SHDCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -fPIC -of$TARGET $SOURCES' env['DPATH'] = ['#/'] env['DFLAGS'] = [] env['DVERSIONS'] = [] env['DDEBUG'] = [] if env['DC']: DCommon.addDPATHToEnv(env, env['DC']) env['DINCPREFIX'] = '-I' env['DINCSUFFIX'] = '' env['DVERPREFIX'] = '-version=' env['DVERSUFFIX'] = '' env['DDEBUGPREFIX'] = '-debug=' env['DDEBUGSUFFIX'] = '' env['DFLAGPREFIX'] = '-' env['DFLAGSUFFIX'] = '' env['DFILESUFFIX'] = '.d' env['DLINK'] = '$DC' env['DLINKFLAGS'] = SCons.Util.CLVar('') env['DLINKCOM'] = '$DLINK -of$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' env['SHDLINK'] = '$DC' env['SHDLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=libphobos2.so') env['SHDLINKCOM'] = '$DLINK -of$TARGET $SHDLINKFLAGS $__SHDLIBVERSIONFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' env['DLIBLINKPREFIX'] = '' if env['PLATFORM'] == 'win32' else '-L-l' env['DLIBLINKSUFFIX'] = '.lib' if env['PLATFORM'] == 'win32' else '' env['_DLIBFLAGS'] = '${_stripixes(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}' env['DLIBDIRPREFIX'] = '-L-L' env['DLIBDIRSUFFIX'] = '' env['_DLIBDIRFLAGS'] = '${_concat(DLIBDIRPREFIX, LIBPATH, DLIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)}' env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr' env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '') # env['_DLIBFLAGS'] = '${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)}' env['DLIBFLAGPREFIX'] = '-' env['DLIBFLAGSUFFIX'] = '' # __RPATH is set to $_RPATH in the platform specification if that # platform supports it. env['DRPATHPREFIX'] = '-L-rpath,' if env['PLATFORM'] == 'darwin' else '-L-rpath=' env['DRPATHSUFFIX'] = '' env['_DRPATH'] = '${_concat(DRPATHPREFIX, RPATH, DRPATHSUFFIX, __env__)}' # Support for versioned libraries env['_SHDLIBVERSIONFLAGS'] = '$SHDLIBVERSIONFLAGS -L-soname=$_SHDLIBSONAME' env['_SHDLIBSONAME'] = '${DShLibSonameGenerator(__env__,TARGET)}' # NOTE: this is a quick hack, the soname will only work if there is # c/c++ linker loaded which provides callback for the ShLibSonameGenerator env['DShLibSonameGenerator'] = SCons.Tool.ShLibSonameGenerator # NOTE: this is only for further reference, currently $SHDLIBVERSION does # not work, the user must use $SHLIBVERSION env['SHDLIBVERSION'] = '$SHLIBVERSION' env['SHDLIBVERSIONFLAGS'] = [] env['BUILDERS']['ProgramAllAtOnce'] = SCons.Builder.Builder( action='$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -of$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS', emitter=DCommon.allAtOnceEmitter, ) def exists(env): return env.Detect(['dmd', 'ldmd2', 'gdmd']) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/javah.xml0000664000175000017500000000647213160023044021277 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &javah; tool. JAVAH JAVAHFLAGS JAVAHCOM JAVACLASSSUFFIX JAVAHCOMSTR JAVACLASSPATH Builds C header and source files for implementing Java native methods. The target can be either a directory in which the header files will be written, or a header file name which will contain all of the definitions. The source can be the names of .class files, the names of .java files to be compiled into .class files by calling the &b-link-Java; builder method, or the objects returned from the &b-Java; builder method. If the construction variable &cv-link-JAVACLASSDIR; is set, either in the environment or in the call to the &b-JavaH; builder method itself, then the value of the variable will be stripped from the beginning of any .class file names. Examples: # builds java_native.h classes = env.Java(target = 'classdir', source = 'src') env.JavaH(target = 'java_native.h', source = classes) # builds include/package_foo.h and include/package_bar.h env.JavaH(target = 'include', source = ['package/foo.class', 'package/bar.class']) # builds export/foo.h and export/bar.h env.JavaH(target = 'export', source = ['classes/foo.class', 'classes/bar.class'], JAVACLASSDIR = 'classes') The Java generator for C header and stub files. The command line used to generate C header and stub files from Java classes. Any options specified in the &cv-link-JAVAHFLAGS; construction variable are included on this command line. The string displayed when C header and stub files are generated from Java classes. If this is not set, then &cv-link-JAVAHCOM; (the command line) is displayed. env = Environment(JAVAHCOMSTR = "Generating header/stub file(s) $TARGETS from $SOURCES") General options passed to the C header and stub file generator for Java classes. scons-src-3.0.0/src/engine/SCons/Tool/m4.xml0000664000175000017500000000400113160023044020510 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &m4; macro processor. M4 M4FLAGS M4COM M4COMSTR Builds an output file from an M4 input file. This uses a default &cv-link-M4FLAGS; value of , which considers all warnings to be fatal and stops on the first warning when using the GNU version of m4. Example: env.M4(target = 'foo.c', source = 'foo.c.m4') The M4 macro preprocessor. The command line used to pass files through the M4 macro preprocessor. The string displayed when a file is passed through the M4 macro preprocessor. If this is not set, then &cv-link-M4COM; (the command line) is displayed. General options passed to the M4 macro preprocessor. scons-src-3.0.0/src/engine/SCons/Tool/mwcc.py0000664000175000017500000001532713160023044020766 0ustar bdbaddogbdbaddog"""SCons.Tool.mwcc Tool-specific initialization for the Metrowerks CodeWarrior compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/mwcc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import SCons.Util def set_vars(env): """Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars MWCW_VERSIONS is set to a list of objects representing installed versions MWCW_VERSION is set to the version object that will be used for building. MWCW_VERSION can be set to a string during Environment construction to influence which version is chosen, otherwise the latest one from MWCW_VERSIONS is used. Returns true if at least one version is found, false otherwise """ desired = env.get('MWCW_VERSION', '') # return right away if the variables are already set if isinstance(desired, MWVersion): return 1 elif desired is None: return 0 versions = find_versions() version = None if desired: for v in versions: if str(v) == desired: version = v elif versions: version = versions[-1] env['MWCW_VERSIONS'] = versions env['MWCW_VERSION'] = version if version is None: return 0 env.PrependENVPath('PATH', version.clpath) env.PrependENVPath('PATH', version.dllpath) ENV = env['ENV'] ENV['CWFolder'] = version.path ENV['LM_LICENSE_FILE'] = version.license plus = lambda x: '+%s' % x ENV['MWCIncludes'] = os.pathsep.join(map(plus, version.includes)) ENV['MWLibraries'] = os.pathsep.join(map(plus, version.libs)) return 1 def find_versions(): """Return a list of MWVersion objects representing installed versions""" versions = [] ### This function finds CodeWarrior by reading from the registry on ### Windows. Some other method needs to be implemented for other ### platforms, maybe something that calls env.WhereIs('mwcc') if SCons.Util.can_read_reg: try: HLM = SCons.Util.HKEY_LOCAL_MACHINE product = 'SOFTWARE\\Metrowerks\\CodeWarrior\\Product Versions' product_key = SCons.Util.RegOpenKeyEx(HLM, product) i = 0 while True: name = product + '\\' + SCons.Util.RegEnumKey(product_key, i) name_key = SCons.Util.RegOpenKeyEx(HLM, name) try: version = SCons.Util.RegQueryValueEx(name_key, 'VERSION') path = SCons.Util.RegQueryValueEx(name_key, 'PATH') mwv = MWVersion(version[0], path[0], 'Win32-X86') versions.append(mwv) except SCons.Util.RegError: pass i = i + 1 except SCons.Util.RegError: pass return versions class MWVersion(object): def __init__(self, version, path, platform): self.version = version self.path = path self.platform = platform self.clpath = os.path.join(path, 'Other Metrowerks Tools', 'Command Line Tools') self.dllpath = os.path.join(path, 'Bin') # The Metrowerks tools don't store any configuration data so they # are totally dumb when it comes to locating standard headers, # libraries, and other files, expecting all the information # to be handed to them in environment variables. The members set # below control what information scons injects into the environment ### The paths below give a normal build environment in CodeWarrior for ### Windows, other versions of CodeWarrior might need different paths. msl = os.path.join(path, 'MSL') support = os.path.join(path, '%s Support' % platform) self.license = os.path.join(path, 'license.dat') self.includes = [msl, support] self.libs = [msl, support] def __str__(self): return self.version CSuffixes = ['.c', '.C'] CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++'] def generate(env): """Add Builders and construction variables for the mwcc to an Environment.""" import SCons.Defaults import SCons.Tool set_vars(env) static_obj, shared_obj = SCons.Tool.createObjBuilders(env) for suffix in CSuffixes: static_obj.add_action(suffix, SCons.Defaults.CAction) shared_obj.add_action(suffix, SCons.Defaults.ShCAction) for suffix in CXXSuffixes: static_obj.add_action(suffix, SCons.Defaults.CXXAction) shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction) env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -nolink -o $TARGET $SOURCES' env['CC'] = 'mwcc' env['CCCOM'] = '$CC $CFLAGS $CCFLAGS $CCCOMFLAGS' env['CXX'] = 'mwcc' env['CXXCOM'] = '$CXX $CXXFLAGS $CCCOMFLAGS' env['SHCC'] = '$CC' env['SHCCFLAGS'] = '$CCFLAGS' env['SHCFLAGS'] = '$CFLAGS' env['SHCCCOM'] = '$SHCC $SHCFLAGS $SHCCFLAGS $CCCOMFLAGS' env['SHCXX'] = '$CXX' env['SHCXXFLAGS'] = '$CXXFLAGS' env['SHCXXCOM'] = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS' env['CFILESUFFIX'] = '.c' env['CXXFILESUFFIX'] = '.cpp' env['CPPDEFPREFIX'] = '-D' env['CPPDEFSUFFIX'] = '' env['INCPREFIX'] = '-I' env['INCSUFFIX'] = '' #env['PCH'] = ? #env['PCHSTOP'] = ? def exists(env): return set_vars(env) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/cc.py0000664000175000017500000000734713160023041020422 0ustar bdbaddogbdbaddog"""SCons.Tool.cc Tool-specific initialization for generic Posix C compilers. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/cc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Tool import SCons.Defaults import SCons.Util CSuffixes = ['.c', '.m'] if not SCons.Util.case_sensitive_suffixes('.c', '.C'): CSuffixes.append('.C') def add_common_cc_variables(env): """ Add underlying common "C compiler" variables that are used by multiple tools (specifically, c++). """ if '_CCCOMCOM' not in env: env['_CCCOMCOM'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS' # It's a hack to test for darwin here, but the alternative # of creating an applecc.py to contain this seems overkill. # Maybe someday the Apple platform will require more setup and # this logic will be moved. env['FRAMEWORKS'] = SCons.Util.CLVar('') env['FRAMEWORKPATH'] = SCons.Util.CLVar('') if env['PLATFORM'] == 'darwin': env['_CCCOMCOM'] = env['_CCCOMCOM'] + ' $_FRAMEWORKPATH' if 'CCFLAGS' not in env: env['CCFLAGS'] = SCons.Util.CLVar('') if 'SHCCFLAGS' not in env: env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') compilers = ['cc'] def generate(env): """ Add Builders and construction variables for C compilers to an Environment. """ static_obj, shared_obj = SCons.Tool.createObjBuilders(env) for suffix in CSuffixes: static_obj.add_action(suffix, SCons.Defaults.CAction) shared_obj.add_action(suffix, SCons.Defaults.ShCAction) static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) add_common_cc_variables(env) if 'CC' not in env: env['CC'] = env.Detect(compilers) or compilers[0] env['CFLAGS'] = SCons.Util.CLVar('') env['CCCOM'] = '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES' env['SHCC'] = '$CC' env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS') env['SHCCCOM'] = '$SHCC -o $TARGET -c $SHCFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES' env['CPPDEFPREFIX'] = '-D' env['CPPDEFSUFFIX'] = '' env['INCPREFIX'] = '-I' env['INCSUFFIX'] = '' env['SHOBJSUFFIX'] = '.os' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0 env['CFILESUFFIX'] = '.c' def exists(env): return env.Detect(env.get('CC', compilers)) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sunlink.xml0000664000175000017500000000206713160023045021666 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Sun linker. SHLINKFLAGS RPATHPREFIX RPATHSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/gs.py0000664000175000017500000000565013160023044020444 0ustar bdbaddogbdbaddog"""SCons.Tool.gs Tool-specific initialization for Ghostscript. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/gs.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Action import SCons.Builder import SCons.Platform import SCons.Util # Ghostscript goes by different names on different platforms... platform = SCons.Platform.platform_default() if platform == 'os2': gs = 'gsos2' elif platform == 'win32': gs = 'gswin32c' else: gs = 'gs' GhostscriptAction = None def generate(env): """Add Builders and construction variables for Ghostscript to an Environment.""" global GhostscriptAction # The following try-except block enables us to use the Tool # in standalone mode (without the accompanying pdf.py), # whenever we need an explicit call of gs via the Gs() # Builder ... try: if GhostscriptAction is None: GhostscriptAction = SCons.Action.Action('$GSCOM', '$GSCOMSTR') from SCons.Tool import pdf pdf.generate(env) bld = env['BUILDERS']['PDF'] bld.add_action('.ps', GhostscriptAction) except ImportError as e: pass gsbuilder = SCons.Builder.Builder(action = SCons.Action.Action('$GSCOM', '$GSCOMSTR')) env['BUILDERS']['Gs'] = gsbuilder env['GS'] = gs env['GSFLAGS'] = SCons.Util.CLVar('-dNOPAUSE -dBATCH -sDEVICE=pdfwrite') env['GSCOM'] = '$GS $GSFLAGS -sOutputFile=$TARGET $SOURCES' def exists(env): if 'PS2PDF' in env: return env.Detect(env['PS2PDF']) else: return env.Detect(gs) or SCons.Util.WhereIs(gs) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/linkloc.xml0000664000175000017500000000265413160023044021637 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the LinkLoc linker for the Phar Lap ETS embedded operating system. SHLINK SHLINKFLAGS SHLINKCOM LINK LINKFLAGS LINKCOM LIBDIRPREFIX LIBDIRSUFFIX LIBLINKPREFIX LIBLINKSUFFIX SHLINKCOMSTR LINKCOMSTR scons-src-3.0.0/src/engine/SCons/Tool/ilink32.xml0000664000175000017500000000231213160023044021446 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Borland ilink32 linker. LINK LINKFLAGS LINKCOM LIBDIRPREFIX LIBDIRSUFFIX LIBLINKPREFIX LIBLINKSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/sunf77.py0000664000175000017500000000414013160023044021155 0ustar bdbaddogbdbaddog"""SCons.Tool.sunf77 Tool-specific initialization for sunf77, the Sun Studio F77 compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sunf77.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util from .FortranCommon import add_all_to_env compilers = ['sunf77', 'f77'] def generate(env): """Add Builders and construction variables for sunf77 to an Environment.""" add_all_to_env(env) fcomp = env.Detect(compilers) or 'f77' env['FORTRAN'] = fcomp env['F77'] = fcomp env['SHFORTRAN'] = '$FORTRAN' env['SHF77'] = '$F77' env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS -KPIC') env['SHF77FLAGS'] = SCons.Util.CLVar('$F77FLAGS -KPIC') def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/gs.xml0000664000175000017500000000525213160023044020612 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> This Tool sets the required construction variables for working with the Ghostscript command. It also registers an appropriate Action with the PDF Builder (&b-link-PDF;), such that the conversion from PS/EPS to PDF happens automatically for the TeX/LaTeX toolchain. Finally, it adds an explicit Ghostscript Builder (&b-link-Gs;) to the environment. GS GSFLAGS GSCOM GSCOMSTR The Ghostscript program used, e.g. to convert PostScript to PDF files. The full Ghostscript command line used for the conversion process. Its default value is $GS $GSFLAGS -sOutputFile=$TARGET $SOURCES. The string displayed when Ghostscript is called for the conversion process. If this is not set (the default), then &cv-link-GSCOM; (the command line) is displayed. General options passed to the Ghostscript program, when converting PostScript to PDF files for example. Its default value is -dNOPAUSE -dBATCH -sDEVICE=pdfwrite A Builder for explicitly calling the gs executable. Depending on the underlying OS, the different names gs, gsos2 and gswin32c are tried. env = Environment(tools=['gs']) env.Gs('cover.jpg','scons-scons.pdf', GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -q') ) scons-src-3.0.0/src/engine/SCons/Tool/nasm.xml0000664000175000017500000000226113160023044021134 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the nasm Netwide Assembler. AS ASFLAGS ASPPFLAGS ASCOM ASPPCOM ASCOMSTR ASPPCOMSTR scons-src-3.0.0/src/engine/SCons/Tool/sgic++.py0000664000175000017500000000315013160023044021077 0ustar bdbaddogbdbaddog"""SCons.Tool.sgic++ Tool-specific initialization for MIPSpro C++ on SGI. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sgic++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" #forward proxy to the preffered cxx version from SCons.Tool.sgicxx import * # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/f08.xml0000664000175000017500000002113113160023044020570 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for generic POSIX Fortran 08 compilers. F08 F08FLAGS F08COM F08PPCOM SHF08 SHF08FLAGS SHF08COM SHF08PPCOM _F08INCFLAGS F08COMSTR F08PPCOMSTR SHF08COMSTR SHF08PPCOMSTR The Fortran 08 compiler. You should normally set the &cv-link-FORTRAN; variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set &cv-link-F08; if you need to use a specific compiler or compiler version for Fortran 08 files. The command line used to compile a Fortran 08 source file to an object file. You only need to set &cv-link-F08COM; if you need to use a specific command line for Fortran 08 files. You should normally set the &cv-link-FORTRANCOM; variable, which specifies the default command line for all Fortran versions. The string displayed when a Fortran 08 source file is compiled to an object file. If this is not set, then &cv-link-F08COM; or &cv-link-FORTRANCOM; (the command line) is displayed. The list of file extensions for which the F08 dialect will be used. By default, this is ['.f08'] The list of file extensions for which the compilation + preprocessor pass for F08 dialect will be used. By default, this is empty General user-specified options that are passed to the Fortran 08 compiler. Note that this variable does not contain (or similar) include search path options that scons generates automatically from &cv-link-F08PATH;. See &cv-link-_F08INCFLAGS; below, for the variable that expands to those options. You only need to set &cv-link-F08FLAGS; if you need to define specific user options for Fortran 08 files. You should normally set the &cv-link-FORTRANFLAGS; variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. An automatically-generated construction variable containing the Fortran 08 compiler command-line options for specifying directories to be searched for include files. The value of &cv-link-_F08INCFLAGS; is created by appending &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; to the beginning and end of each directory in &cv-link-F08PATH;. The list of directories that the Fortran 08 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in &cv-link-F08FLAGS; because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in &cv-link-F08PATH; will be looked-up relative to the SConscript directory when they are used in a command. To force &scons; to look-up a directory relative to the root of the source tree use #: You only need to set &cv-link-F08PATH; if you need to define a specific include path for Fortran 08 files. You should normally set the &cv-link-FORTRANPATH; variable, which specifies the include path for the default Fortran compiler for all Fortran versions. env = Environment(F08PATH='#/include') The directory look-up can also be forced using the &Dir;() function: include = Dir('include') env = Environment(F08PATH=include) The directory list will be added to command lines through the automatically-generated &cv-link-_F08INCFLAGS; construction variable, which is constructed by appending the values of the &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; construction variables to the beginning and end of each directory in &cv-link-F08PATH;. Any command lines you define that need the F08PATH directory list should include &cv-link-_F08INCFLAGS;: env = Environment(F08COM="my_compiler $_F08INCFLAGS -c -o $TARGET $SOURCE") The command line used to compile a Fortran 08 source file to an object file after first running the file through the C preprocessor. Any options specified in the &cv-link-F08FLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. You only need to set &cv-link-F08PPCOM; if you need to use a specific C-preprocessor command line for Fortran 08 files. You should normally set the &cv-link-FORTRANPPCOM; variable, which specifies the default C-preprocessor command line for all Fortran versions. The string displayed when a Fortran 08 source file is compiled to an object file after first running the file through the C preprocessor. If this is not set, then &cv-link-F08PPCOM; or &cv-link-FORTRANPPCOM; (the command line) is displayed. The Fortran 08 compiler used for generating shared-library objects. You should normally set the &cv-link-SHFORTRAN; variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set &cv-link-SHF08; if you need to use a specific compiler or compiler version for Fortran 08 files. The command line used to compile a Fortran 08 source file to a shared-library object file. You only need to set &cv-link-SHF08COM; if you need to use a specific command line for Fortran 08 files. You should normally set the &cv-link-SHFORTRANCOM; variable, which specifies the default command line for all Fortran versions. The string displayed when a Fortran 08 source file is compiled to a shared-library object file. If this is not set, then &cv-link-SHF08COM; or &cv-link-SHFORTRANCOM; (the command line) is displayed. Options that are passed to the Fortran 08 compiler to generated shared-library objects. You only need to set &cv-link-SHF08FLAGS; if you need to define specific user options for Fortran 08 files. You should normally set the &cv-link-SHFORTRANFLAGS; variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. The command line used to compile a Fortran 08 source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the &cv-link-SHF08FLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. You only need to set &cv-link-SHF08PPCOM; if you need to use a specific C-preprocessor command line for Fortran 08 files. You should normally set the &cv-link-SHFORTRANPPCOM; variable, which specifies the default C-preprocessor command line for all Fortran versions. The string displayed when a Fortran 08 source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then &cv-link-SHF08PPCOM; or &cv-link-SHFORTRANPPCOM; (the command line) is displayed. scons-src-3.0.0/src/engine/SCons/Tool/textfile.xml0000664000175000017500000001567013160023045022033 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the &b-Textfile; and &b-Substfile; builders. LINESEPARATOR SUBSTFILEPREFIX SUBSTFILESUFFIX TEXTFILEPREFIX TEXTFILESUFFIX SUBST_DICT The &b-Textfile; builder generates a single text file. The source strings constitute the lines; nested lists of sources are flattened. &cv-LINESEPARATOR; is used to separate the strings. If present, the &cv-SUBST_DICT; construction variable is used to modify the strings before they are written; see the &b-Substfile; description for details. The prefix and suffix specified by the &cv-TEXTFILEPREFIX; and &cv-TEXTFILESUFFIX; construction variables (the null string and .txt by default, respectively) are automatically added to the target if they are not already present. Examples: # builds/writes foo.txt env.Textfile(target = 'foo.txt', source = ['Goethe', 42, 'Schiller']) # builds/writes bar.txt env.Textfile(target = 'bar', source = ['lalala', 'tanteratei'], LINESEPARATOR='|*') # nested lists are flattened automatically env.Textfile(target = 'blob', source = ['lalala', ['Goethe', 42 'Schiller'], 'tanteratei']) # files may be used as input by wraping them in File() env.Textfile(target = 'concat', # concatenate files with a marker between source = [File('concat1'), File('concat2')], LINESEPARATOR = '====================\n') Results are: foo.txt ....8<---- Goethe 42 Schiller ....8<---- (no linefeed at the end) bar.txt: ....8<---- lalala|*tanteratei ....8<---- (no linefeed at the end) blob.txt ....8<---- lalala Goethe 42 Schiller tanteratei ....8<---- (no linefeed at the end) The &b-Substfile; builder creates a single text file from another file or set of files by concatenating them with &cv-LINESEPARATOR; and replacing text using the &cv-SUBST_DICT; construction variable. Nested lists of source files are flattened. See also &b-Textfile;. If a single source file is present with an .in suffix, the suffix is stripped and the remainder is used as the default target name. The prefix and suffix specified by the &cv-SUBSTFILEPREFIX; and &cv-SUBSTFILESUFFIX; construction variables (the null string by default in both cases) are automatically added to the target if they are not already present. If a construction variable named &cv-SUBST_DICT; is present, it may be either a Python dictionary or a sequence of (key,value) tuples. If it is a dictionary it is converted into a list of tuples in an arbitrary order, so if one key is a prefix of another key or if one substitution could be further expanded by another subsitition, it is unpredictable whether the expansion will occur. Any occurrences of a key in the source are replaced by the corresponding value, which may be a Python callable function or a string. If the value is a callable, it is called with no arguments to get a string. Strings are subst-expanded and the result replaces the key. env = Environment(tools = ['default', 'textfile']) env['prefix'] = '/usr/bin' script_dict = {'@prefix@': '/bin', '@exec_prefix@': '$prefix'} env.Substfile('script.in', SUBST_DICT = script_dict) conf_dict = {'%VERSION%': '1.2.3', '%BASE%': 'MyProg'} env.Substfile('config.h.in', conf_dict, SUBST_DICT = conf_dict) # UNPREDICTABLE - one key is a prefix of another bad_foo = {'$foo': '$foo', '$foobar': '$foobar'} env.Substfile('foo.in', SUBST_DICT = bad_foo) # PREDICTABLE - keys are applied longest first good_foo = [('$foobar', '$foobar'), ('$foo', '$foo')] env.Substfile('foo.in', SUBST_DICT = good_foo) # UNPREDICTABLE - one substitution could be futher expanded bad_bar = {'@bar@': '@soap@', '@soap@': 'lye'} env.Substfile('bar.in', SUBST_DICT = bad_bar) # PREDICTABLE - substitutions are expanded in order good_bar = (('@bar@', '@soap@'), ('@soap@', 'lye')) env.Substfile('bar.in', SUBST_DICT = good_bar) # the SUBST_DICT may be in common (and not an override) substutions = {} subst = Environment(tools = ['textfile'], SUBST_DICT = substitutions) substitutions['@foo@'] = 'foo' subst['SUBST_DICT']['@bar@'] = 'bar' subst.Substfile('pgm1.c', [Value('#include "@foo@.h"'), Value('#include "@bar@.h"'), "common.in", "pgm1.in" ]) subst.Substfile('pgm2.c', [Value('#include "@foo@.h"'), Value('#include "@bar@.h"'), "common.in", "pgm2.in" ]) The separator used by the &b-Substfile; and &b-Textfile; builders. This value is used between sources when constructing the target. It defaults to the current system line separator. The dictionary used by the &b-Substfile; or &b-Textfile; builders for substitution values. It can be anything acceptable to the dict() constructor, so in addition to a dictionary, lists of tuples are also acceptable. The prefix used for &b-Substfile; file names, the null string by default. The suffix used for &b-Substfile; file names, the null string by default. The prefix used for &b-Textfile; file names, the null string by default. The suffix used for &b-Textfile; file names; .txt by default. scons-src-3.0.0/src/engine/SCons/Tool/DCommon.xml0000664000175000017500000000326513160023041021534 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> DRPATHPREFIX. DRPATHSUFFIX. DShLibSonameGenerator. SHDLIBVERSION. SHDLIBVERSIONFLAGS. scons-src-3.0.0/src/engine/SCons/Tool/rpm.py0000664000175000017500000001072313160023044020626 0ustar bdbaddogbdbaddog"""SCons.Tool.rpm Tool-specific initialization for rpm. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. The rpm tool calls the rpmbuild command. The first and only argument should a tar.gz consisting of the source file and a specfile. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/rpm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import re import shutil import subprocess import SCons.Builder import SCons.Node.FS import SCons.Util import SCons.Action import SCons.Defaults def get_cmd(source, env): tar_file_with_included_specfile = source if SCons.Util.is_List(source): tar_file_with_included_specfile = source[0] return "%s %s %s"%(env['RPM'], env['RPMFLAGS'], tar_file_with_included_specfile.get_abspath() ) def build_rpm(target, source, env): # create a temporary rpm build root. tmpdir = os.path.join( os.path.dirname( target[0].get_abspath() ), 'rpmtemp' ) if os.path.exists(tmpdir): shutil.rmtree(tmpdir) # now create the mandatory rpm directory structure. for d in ['RPMS', 'SRPMS', 'SPECS', 'BUILD']: os.makedirs( os.path.join( tmpdir, d ) ) # set the topdir as an rpmflag. env.Prepend( RPMFLAGS = '--define \'_topdir %s\'' % tmpdir ) # now call rpmbuild to create the rpm package. handle = subprocess.Popen(get_cmd(source, env), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) output = SCons.Util.to_str(handle.stdout.read()) status = handle.wait() if status: raise SCons.Errors.BuildError( node=target[0], errstr=output, filename=str(target[0]) ) else: # XXX: assume that LC_ALL=C is set while running rpmbuild output_files = re.compile( 'Wrote: (.*)' ).findall( output ) for output, input in zip( output_files, target ): rpm_output = os.path.basename(output) expected = os.path.basename(input.get_path()) assert expected == rpm_output, "got %s but expected %s" % (rpm_output, expected) shutil.copy( output, input.get_abspath() ) # cleanup before leaving. shutil.rmtree(tmpdir) return status def string_rpm(target, source, env): try: return env['RPMCOMSTR'] except KeyError: return get_cmd(source, env) rpmAction = SCons.Action.Action(build_rpm, string_rpm) RpmBuilder = SCons.Builder.Builder(action = SCons.Action.Action('$RPMCOM', '$RPMCOMSTR'), source_scanner = SCons.Defaults.DirScanner, suffix = '$RPMSUFFIX') def generate(env): """Add Builders and construction variables for rpm to an Environment.""" try: bld = env['BUILDERS']['Rpm'] except KeyError: bld = RpmBuilder env['BUILDERS']['Rpm'] = bld env.SetDefault(RPM = 'LC_ALL=C rpmbuild') env.SetDefault(RPMFLAGS = SCons.Util.CLVar('-ta')) env.SetDefault(RPMCOM = rpmAction) env.SetDefault(RPMSUFFIX = '.rpm') def exists(env): return env.Detect('rpmbuild') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/DCommon.py0000664000175000017500000000421613160023041021361 0ustar bdbaddogbdbaddogfrom __future__ import print_function """SCons.Tool.DCommon Common code for the various D tools. Coded by Russel Winder (russel@winder.org.uk) 2012-09-06 """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/DCommon.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path def isD(env, source): if not source: return 0 for s in source: if s.sources: ext = os.path.splitext(str(s.sources[0]))[1] if ext == '.d': return 1 return 0 def addDPATHToEnv(env, executable): dPath = env.WhereIs(executable) if dPath: phobosDir = dPath[:dPath.rindex(executable)] + '/../src/phobos' if os.path.isdir(phobosDir): env.Append(DPATH=[phobosDir]) def allAtOnceEmitter(target, source, env): if env['DC'] in ('ldc2', 'dmd'): env.SideEffect(str(target[0]) + '.o', target[0]) env.Clean(target[0], str(target[0]) + '.o') return target, source # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/javac.py0000664000175000017500000002066713160023044021124 0ustar bdbaddogbdbaddog"""SCons.Tool.javac Tool-specific initialization for javac. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/javac.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import SCons.Action import SCons.Builder from SCons.Node.FS import _my_normcase from SCons.Tool.JavaCommon import parse_java_file import SCons.Util def classname(path): """Turn a string (path name) into a Java class name.""" return os.path.normpath(path).replace(os.sep, '.') def emit_java_classes(target, source, env): """Create and return lists of source java files and their corresponding target class files. """ java_suffix = env.get('JAVASUFFIX', '.java') class_suffix = env.get('JAVACLASSSUFFIX', '.class') target[0].must_be_same(SCons.Node.FS.Dir) classdir = target[0] s = source[0].rentry().disambiguate() if isinstance(s, SCons.Node.FS.File): sourcedir = s.dir.rdir() elif isinstance(s, SCons.Node.FS.Dir): sourcedir = s.rdir() else: raise SCons.Errors.UserError("Java source must be File or Dir, not '%s'" % s.__class__) slist = [] js = _my_normcase(java_suffix) for entry in source: entry = entry.rentry().disambiguate() if isinstance(entry, SCons.Node.FS.File): slist.append(entry) elif isinstance(entry, SCons.Node.FS.Dir): result = SCons.Util.OrderedDict() dirnode = entry.rdir() def find_java_files(arg, dirpath, filenames): java_files = sorted([n for n in filenames if _my_normcase(n).endswith(js)]) mydir = dirnode.Dir(dirpath) java_paths = [mydir.File(f) for f in java_files] for jp in java_paths: arg[jp] = True for dirpath, dirnames, filenames in os.walk(dirnode.get_abspath()): find_java_files(result, dirpath, filenames) entry.walk(find_java_files, result) slist.extend(list(result.keys())) else: raise SCons.Errors.UserError("Java source must be File or Dir, not '%s'" % entry.__class__) version = env.get('JAVAVERSION', '1.4') full_tlist = [] for f in slist: tlist = [] source_file_based = True pkg_dir = None if not f.is_derived(): pkg_dir, classes = parse_java_file(f.rfile().get_abspath(), version) if classes: source_file_based = False if pkg_dir: d = target[0].Dir(pkg_dir) p = pkg_dir + os.sep else: d = target[0] p = '' for c in classes: t = d.File(c + class_suffix) t.attributes.java_classdir = classdir t.attributes.java_sourcedir = sourcedir t.attributes.java_classname = classname(p + c) tlist.append(t) if source_file_based: base = f.name[:-len(java_suffix)] if pkg_dir: t = target[0].Dir(pkg_dir).File(base + class_suffix) else: t = target[0].File(base + class_suffix) t.attributes.java_classdir = classdir t.attributes.java_sourcedir = f.dir t.attributes.java_classname = classname(base) tlist.append(t) for t in tlist: t.set_specific_source([f]) full_tlist.extend(tlist) return full_tlist, slist JavaAction = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR') JavaBuilder = SCons.Builder.Builder(action = JavaAction, emitter = emit_java_classes, target_factory = SCons.Node.FS.Entry, source_factory = SCons.Node.FS.Entry) class pathopt(object): """ Callable object for generating javac-style path options from a construction variable (e.g. -classpath, -sourcepath). """ def __init__(self, opt, var, default=None): self.opt = opt self.var = var self.default = default def __call__(self, target, source, env, for_signature): path = env[self.var] if path and not SCons.Util.is_List(path): path = [path] if self.default: default = env[self.default] if default: if not SCons.Util.is_List(default): default = [default] path = path + default if path: return [self.opt, os.pathsep.join(map(str, path))] else: return [] def Java(env, target, source, *args, **kw): """ A pseudo-Builder wrapper around the separate JavaClass{File,Dir} Builders. """ if not SCons.Util.is_List(target): target = [target] if not SCons.Util.is_List(source): source = [source] # Pad the target list with repetitions of the last element in the # list so we have a target for every source element. target = target + ([target[-1]] * (len(source) - len(target))) java_suffix = env.subst('$JAVASUFFIX') result = [] for t, s in zip(target, source): if isinstance(s, SCons.Node.FS.Base): if isinstance(s, SCons.Node.FS.File): b = env.JavaClassFile else: b = env.JavaClassDir else: if os.path.isfile(s): b = env.JavaClassFile elif os.path.isdir(s): b = env.JavaClassDir elif s[-len(java_suffix):] == java_suffix: b = env.JavaClassFile else: b = env.JavaClassDir result.extend(b(t, s, *args, **kw)) return result def generate(env): """Add Builders and construction variables for javac to an Environment.""" java_file = SCons.Tool.CreateJavaFileBuilder(env) java_class = SCons.Tool.CreateJavaClassFileBuilder(env) java_class_dir = SCons.Tool.CreateJavaClassDirBuilder(env) java_class.add_emitter(None, emit_java_classes) java_class.add_emitter(env.subst('$JAVASUFFIX'), emit_java_classes) java_class_dir.emitter = emit_java_classes env.AddMethod(Java) env['JAVAC'] = 'javac' env['JAVACFLAGS'] = SCons.Util.CLVar('') env['JAVABOOTCLASSPATH'] = [] env['JAVACLASSPATH'] = [] env['JAVASOURCEPATH'] = [] env['_javapathopt'] = pathopt env['_JAVABOOTCLASSPATH'] = '${_javapathopt("-bootclasspath", "JAVABOOTCLASSPATH")} ' env['_JAVACLASSPATH'] = '${_javapathopt("-classpath", "JAVACLASSPATH")} ' env['_JAVASOURCEPATH'] = '${_javapathopt("-sourcepath", "JAVASOURCEPATH", "_JAVASOURCEPATHDEFAULT")} ' env['_JAVASOURCEPATHDEFAULT'] = '${TARGET.attributes.java_sourcedir}' env['_JAVACCOM'] = '$JAVAC $JAVACFLAGS $_JAVABOOTCLASSPATH $_JAVACLASSPATH -d ${TARGET.attributes.java_classdir} $_JAVASOURCEPATH $SOURCES' env['JAVACCOM'] = "${TEMPFILE('$_JAVACCOM','$JAVACCOMSTR')}" env['JAVACLASSSUFFIX'] = '.class' env['JAVASUFFIX'] = '.java' def exists(env): return 1 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/g++.xml0000664000175000017500000000220413160023044020547 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the &gXX; C++ compiler. CXX SHCXXFLAGS SHOBJSUFFIX CXXVERSION scons-src-3.0.0/src/engine/SCons/Tool/f90.xml0000664000175000017500000002110713160023044020574 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for generic POSIX Fortran 90 compilers. F90 F90FLAGS F90COM F90PPCOM SHF90 SHF90FLAGS SHF90COM SHF90PPCOM _F90INCFLAGS F90COMSTR F90PPCOMSTR SHF90COMSTR SHF90PPCOMSTR The Fortran 90 compiler. You should normally set the &cv-link-FORTRAN; variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set &cv-link-F90; if you need to use a specific compiler or compiler version for Fortran 90 files. The command line used to compile a Fortran 90 source file to an object file. You only need to set &cv-link-F90COM; if you need to use a specific command line for Fortran 90 files. You should normally set the &cv-link-FORTRANCOM; variable, which specifies the default command line for all Fortran versions. The string displayed when a Fortran 90 source file is compiled to an object file. If this is not set, then &cv-link-F90COM; or &cv-link-FORTRANCOM; (the command line) is displayed. The list of file extensions for which the F90 dialect will be used. By default, this is ['.f90'] The list of file extensions for which the compilation + preprocessor pass for F90 dialect will be used. By default, this is empty General user-specified options that are passed to the Fortran 90 compiler. Note that this variable does not contain (or similar) include search path options that scons generates automatically from &cv-link-F90PATH;. See &cv-link-_F90INCFLAGS; below, for the variable that expands to those options. You only need to set &cv-link-F90FLAGS; if you need to define specific user options for Fortran 90 files. You should normally set the &cv-link-FORTRANFLAGS; variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. An automatically-generated construction variable containing the Fortran 90 compiler command-line options for specifying directories to be searched for include files. The value of &cv-link-_F90INCFLAGS; is created by appending &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; to the beginning and end of each directory in &cv-link-F90PATH;. The list of directories that the Fortran 90 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in &cv-link-F90FLAGS; because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in &cv-link-F90PATH; will be looked-up relative to the SConscript directory when they are used in a command. To force &scons; to look-up a directory relative to the root of the source tree use #: You only need to set &cv-link-F90PATH; if you need to define a specific include path for Fortran 90 files. You should normally set the &cv-link-FORTRANPATH; variable, which specifies the include path for the default Fortran compiler for all Fortran versions. env = Environment(F90PATH='#/include') The directory look-up can also be forced using the &Dir;() function: include = Dir('include') env = Environment(F90PATH=include) The directory list will be added to command lines through the automatically-generated &cv-link-_F90INCFLAGS; construction variable, which is constructed by appending the values of the &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; construction variables to the beginning and end of each directory in &cv-link-F90PATH;. Any command lines you define that need the F90PATH directory list should include &cv-link-_F90INCFLAGS;: env = Environment(F90COM="my_compiler $_F90INCFLAGS -c -o $TARGET $SOURCE") The command line used to compile a Fortran 90 source file to an object file after first running the file through the C preprocessor. Any options specified in the &cv-link-F90FLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. You only need to set &cv-link-F90PPCOM; if you need to use a specific C-preprocessor command line for Fortran 90 files. You should normally set the &cv-link-FORTRANPPCOM; variable, which specifies the default C-preprocessor command line for all Fortran versions. The string displayed when a Fortran 90 source file is compiled after first running the file through the C preprocessor. If this is not set, then &cv-link-F90PPCOM; or &cv-link-FORTRANPPCOM; (the command line) is displayed. The Fortran 90 compiler used for generating shared-library objects. You should normally set the &cv-link-SHFORTRAN; variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set &cv-link-SHF90; if you need to use a specific compiler or compiler version for Fortran 90 files. The command line used to compile a Fortran 90 source file to a shared-library object file. You only need to set &cv-link-SHF90COM; if you need to use a specific command line for Fortran 90 files. You should normally set the &cv-link-SHFORTRANCOM; variable, which specifies the default command line for all Fortran versions. The string displayed when a Fortran 90 source file is compiled to a shared-library object file. If this is not set, then &cv-link-SHF90COM; or &cv-link-SHFORTRANCOM; (the command line) is displayed. Options that are passed to the Fortran 90 compiler to generated shared-library objects. You only need to set &cv-link-SHF90FLAGS; if you need to define specific user options for Fortran 90 files. You should normally set the &cv-link-SHFORTRANFLAGS; variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. The command line used to compile a Fortran 90 source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the &cv-link-SHF90FLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. You only need to set &cv-link-SHF90PPCOM; if you need to use a specific C-preprocessor command line for Fortran 90 files. You should normally set the &cv-link-SHFORTRANPPCOM; variable, which specifies the default C-preprocessor command line for all Fortran versions. The string displayed when a Fortran 90 source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then &cv-link-SHF90PPCOM; or &cv-link-SHFORTRANPPCOM; (the command line) is displayed. scons-src-3.0.0/src/engine/SCons/Tool/sgiar.xml0000664000175000017500000000231113160023044021277 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the SGI library archiver. AR ARFLAGS ARCOMSTR SHLINK SHLINKFLAGS LIBPREFIX LIBSUFFIX ARCOMSTR SHLINKCOMSTR scons-src-3.0.0/src/engine/SCons/Tool/sunf90.xml0000664000175000017500000000217613160023045021330 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the Sun &f90; Fortran compiler. FORTRAN F90 SHFORTRAN SHF90 SHFORTRANFLAGS SHF90FLAGS scons-src-3.0.0/src/engine/SCons/Tool/sgicxx.py0000664000175000017500000000403413160023044021333 0ustar bdbaddogbdbaddog"""SCons.Tool.sgic++ Tool-specific initialization for MIPSpro C++ on SGI. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sgicxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util import SCons.Tool.cxx cplusplus = SCons.Tool.cxx #cplusplus = __import__('cxx', globals(), locals(), []) def generate(env): """Add Builders and construction variables for SGI MIPS C++ to an Environment.""" cplusplus.generate(env) env['CXX'] = 'CC' env['CXXFLAGS'] = SCons.Util.CLVar('-LANG:std') env['SHCXX'] = '$CXX' env['SHOBJSUFFIX'] = '.o' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 def exists(env): return env.Detect('CC') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/gfortran.xml0000664000175000017500000000237113160023044022022 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the GNU F95/F2003 GNU compiler. FORTRAN F77 F90 F95 SHFORTRAN SHF77 SHF90 SHF95 SHFORTRANFLAGS SHF77FLAGS SHF90FLAGS SHF95FLAGS scons-src-3.0.0/src/engine/SCons/Tool/mingw.xml0000664000175000017500000000307113160023044021317 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for MinGW (Minimal Gnu on Windows). CC SHCCFLAGS CXX SHCXXFLAGS SHLINKFLAGS SHLINKCOM LDMODULECOM AS WINDOWSDEFPREFIX WINDOWSDEFSUFFIX SHOBJSUFFIX RC RCFLAGS RCINCFLAGS RCINCPREFIX RCINCSUFFIX RCCOM OBJSUFFIX LIBPREFIX LIBSUFFIX SHLINKCOMSTR RCCOMSTR scons-src-3.0.0/src/engine/SCons/Tool/dmd.xml0000664000175000017500000001520213160023041020736 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for D language compiler DMD. DC DCOM SHDC SHDCOM DPATH DFLAGS DVERSIONS DDEBUG DINCPREFIX DINCSUFFIX DVERPREFIX DVERSUFFIX DDEBUGPREFIX DDEBUGSUFFIX DFLAGPREFIX DFLAGSUFFIX DFILESUFFIX DLINK DLINKFLAGS DLINKCOM SHDLINK SHDLINKFLAGS SHDLINKCOM DLIBLINKPREFIX DLIBLINKSUFFIX DLIBDIRPREFIX DLIBDIRSUFFIX DLIB DLIBCOM DLIBFLAGPREFIX DLIBFLAGSUFFIX DLINKFLAGPREFIX DLINKFLAGSUFFIX DRPATHPREFIX DRPATHSUFFIX DShLibSonameGenerator SHDLIBVERSION SHDLIBVERSIONFLAGS The D compiler to use. The command line used to compile a D file to an object file. Any options specified in the &cv-link-DFLAGS; construction variable is included on this command line. List of debug tags to enable when compiling. General options that are passed to the D compiler. Name of the lib tool to use for D codes. The command line to use when creating libraries. Name of the linker to use for linking systems including D sources. The command line to use when linking systems including D sources. List of linker flags. List of paths to search for import modules. List of version tags to enable when compiling. The name of the compiler to use when compiling D source destined to be in a shared objects. The command line to use when compiling code to be part of shared objects. The linker to use when creating shared objects for code bases include D sources. The command line to use when generating shared objects. The list of flags to use when generating a shared object. DVERSUFFIX. DVERPREFIX. DLINKFLAGSUFFIX. DLINKFLAGPREFIX. DLIBLINKSUFFIX. DLIBLINKPREFIX. DLIBFLAGSUFFIX. DLIBFLAGPREFIX. DLIBLINKSUFFIX. DLIBLINKPREFIX. DLIBFLAGSUFFIX. DINCPREFIX. DFLAGSUFFIX. DFLAGPREFIX. DFILESUFFIX. DDEBUGPREFIX. DDEBUGSUFFIX. Builds an executable from D sources without first creating individual objects for each file. D sources can be compiled file-by-file as C and C++ source are, and D is integrated into the &scons; Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others will not. scons-src-3.0.0/src/engine/SCons/Tool/__init__.xml0000664000175000017500000003457613160023041021750 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Builds a C source file given a lex (.l) or yacc (.y) input file. The suffix specified by the &cv-link-CFILESUFFIX; construction variable (.c by default) is automatically added to the target if it is not already present. Example: # builds foo.c env.CFile(target = 'foo.c', source = 'foo.l') # builds bar.c env.CFile(target = 'bar', source = 'bar.y') Builds a C++ source file given a lex (.ll) or yacc (.yy) input file. The suffix specified by the &cv-link-CXXFILESUFFIX; construction variable (.cc by default) is automatically added to the target if it is not already present. Example: # builds foo.cc env.CXXFile(target = 'foo.cc', source = 'foo.ll') # builds bar.cc env.CXXFile(target = 'bar', source = 'bar.yy') A synonym for the &b-StaticLibrary; builder method. On most systems, this is the same as &b-SharedLibrary;. On Mac OS X (Darwin) platforms, this creates a loadable module bundle. A synonym for the &b-StaticObject; builder method. Builds an executable given one or more object files or C, C++, D, or Fortran source files. If any C, C++, D or Fortran source files are specified, then they will be automatically compiled to object files using the &b-Object; builder method; see that builder method's description for a list of legal source file suffixes and how they are interpreted. The target executable file prefix (specified by the &cv-link-PROGPREFIX; construction variable; nothing by default) and suffix (specified by the &cv-link-PROGSUFFIX; construction variable; by default, .exe on Windows systems, nothing on POSIX systems) are automatically added to the target if not already present. Example: env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) Builds a shared library (.so on a POSIX system, .dll on Windows) given one or more object files or C, C++, D or Fortran source files. If any source files are given, then they will be automatically compiled to object files. The static library prefix and suffix (if any) are automatically added to the target. The target library file prefix (specified by the &cv-link-SHLIBPREFIX; construction variable; by default, lib on POSIX systems, nothing on Windows systems) and suffix (specified by the &cv-link-SHLIBSUFFIX; construction variable; by default, .dll on Windows systems, .so on POSIX systems) are automatically added to the target if not already present. Example: env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o']) On Windows systems, the &b-SharedLibrary; builder method will always build an import (.lib) library in addition to the shared (.dll) library, adding a .lib library with the same basename if there is not already a .lib file explicitly listed in the targets. On Cygwin systems, the &b-SharedLibrary; builder method will always build an import (.dll.a) library in addition to the shared (.dll) library, adding a .dll.a library with the same basename if there is not already a .dll.a file explicitly listed in the targets. Any object files listed in the source must have been built for a shared library (that is, using the &b-SharedObject; builder method). &scons; will raise an error if there is any mismatch. On some platforms, there is a distinction between a shared library (loaded automatically by the system to resolve external references) and a loadable module (explicitly loaded by user action). For maximum portability, use the &b-LoadableModule; builder for the latter. When the &cv-link-SHLIBVERSION; construction variable is defined a versioned shared library is created. This modifies the &cv-link-SHLINKFLAGS; as required, adds the version number to the library name, and creates the symlinks that are needed. env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o'], SHLIBVERSION='1.5.2') On a POSIX system, versions with a single token create exactly one symlink: libbar.so.6 would have symlinks libbar.so only. On a POSIX system, versions with two or more tokens create exactly two symlinks: libbar.so.2.3.1 would have symlinks libbar.so and libbar.so.2; on a Darwin (OSX) system the library would be libbar.2.3.1.dylib and the link would be libbar.dylib. On Windows systems, specifying register=1 will cause the .dll to be registered after it is built using REGSVR32. The command that is run ("regsvr32" by default) is determined by &cv-link-REGSVR; construction variable, and the flags passed are determined by &cv-link-REGSVRFLAGS;. By default, &cv-link-REGSVRFLAGS; includes the option, to prevent dialogs from popping up and requiring user attention when it is run. If you change &cv-link-REGSVRFLAGS;, be sure to include the option. For example, env.SharedLibrary(target = 'bar', source = ['bar.cxx', 'foo.obj'], register=1) will register bar.dll as a COM object when it is done linking it. Builds an object file for inclusion in a shared library. Source files must have one of the same set of extensions specified above for the &b-StaticObject; builder method. On some platforms building a shared object requires additional compiler option (e.g. for gcc) in addition to those needed to build a normal (static) object, but on some platforms there is no difference between a shared object and a normal (static) one. When there is a difference, SCons will only allow shared objects to be linked into a shared library, and will use a different suffix for shared objects. On platforms where there is no difference, SCons will allow both normal (static) and shared objects to be linked into a shared library, and will use the same suffix for shared and normal (static) objects. The target object file prefix (specified by the &cv-link-SHOBJPREFIX; construction variable; by default, the same as &cv-link-OBJPREFIX;) and suffix (specified by the &cv-link-SHOBJSUFFIX; construction variable) are automatically added to the target if not already present. Examples: env.SharedObject(target = 'ddd', source = 'ddd.c') env.SharedObject(target = 'eee.o', source = 'eee.cpp') env.SharedObject(target = 'fff.obj', source = 'fff.for') Note that the source files will be scanned according to the suffix mappings in the SourceFileScanner object. See the section "Scanner Objects," below, for more information. Builds a static library given one or more object files or C, C++, D or Fortran source files. If any source files are given, then they will be automatically compiled to object files. The static library prefix and suffix (if any) are automatically added to the target. The target library file prefix (specified by the &cv-link-LIBPREFIX; construction variable; by default, lib on POSIX systems, nothing on Windows systems) and suffix (specified by the &cv-link-LIBSUFFIX; construction variable; by default, .lib on Windows systems, .a on POSIX systems) are automatically added to the target if not already present. Example: env.StaticLibrary(target = 'bar', source = ['bar.c', 'foo.o']) Any object files listed in the source must have been built for a static library (that is, using the &b-StaticObject; builder method). &scons; will raise an error if there is any mismatch. Builds a static object file from one or more C, C++, D, or Fortran source files. Source files must have one of the following extensions: .asm assembly language file .ASM assembly language file .c C file .C Windows: C file POSIX: C++ file .cc C++ file .cpp C++ file .cxx C++ file .cxx C++ file .c++ C++ file .C++ C++ file .d D file .f Fortran file .F Windows: Fortran file POSIX: Fortran file + C pre-processor .for Fortran file .FOR Fortran file .fpp Fortran file + C pre-processor .FPP Fortran file + C pre-processor .m Object C file .mm Object C++ file .s assembly language file .S Windows: assembly language file ARM: CodeSourcery Sourcery Lite .sx assembly language file + C pre-processor POSIX: assembly language file + C pre-processor .spp assembly language file + C pre-processor .SPP assembly language file + C pre-processor The target object file prefix (specified by the &cv-link-OBJPREFIX; construction variable; nothing by default) and suffix (specified by the &cv-link-OBJSUFFIX; construction variable; .obj on Windows systems, .o on POSIX systems) are automatically added to the target if not already present. Examples: env.StaticObject(target = 'aaa', source = 'aaa.c') env.StaticObject(target = 'bbb.o', source = 'bbb.c++') env.StaticObject(target = 'ccc.obj', source = 'ccc.f') Note that the source files will be scanned according to the suffix mappings in SourceFileScanner object. See the section "Scanner Objects," below, for more information. The version number of the C compiler. This may or may not be set, depending on the specific C compiler being used. The suffix for C source files. This is used by the internal CFile builder when generating C files from Lex (.l) or YACC (.y) input files. The default suffix, of course, is .c (lower case). On case-insensitive systems (like Windows), SCons also treats .C (upper case) files as C files. The version number of the C++ compiler. This may or may not be set, depending on the specific C++ compiler being used. The suffix for C++ source files. This is used by the internal CXXFile builder when generating C++ files from Lex (.ll) or YACC (.yy) input files. The default suffix is .cc. SCons also treats files with the suffixes .cpp, .cxx, .c++, and .C++ as C++ files, and files with .mm suffixes as Objective C++ files. On case-sensitive systems (Linux, UNIX, and other POSIX-alikes), SCons also treats .C (upper case) files as C++ files. Used to override &cv-link-SHLIBVERSION;/&cv-link-LDMODULEVERSION; when generating versioned import library for a shared library/loadable module. If undefined, the &cv-link-SHLIBVERSION;/&cv-link-LDMODULEVERSION; is used to determine the version of versioned import library. TODO When this construction variable is defined, a versioned loadable module is created by &b-link-LoadableModule; builder. This activates the &cv-link-_LDMODULEVERSIONFLAGS; and thus modifies the &cv-link-LDMODULECOM; as required, adds the version number to the library name, and creates the symlinks that are needed. &cv-link-LDMODULEVERSION; versions should exist in the same format as &cv-link-SHLIBVERSION;. TODO TODO When this construction variable is defined, a versioned shared library is created by &b-link-SharedLibrary; builder. This activates the &cv-link-_SHLIBVERSIONFLAGS; and thus modifies the &cv-link-SHLINKCOM; as required, adds the version number to the library name, and creates the symlinks that are needed. &cv-link-SHLIBVERSION; versions should exist as alpha-numeric, decimal-delimited values as defined by the regular expression "\w+[\.\w+]*". Example &cv-link-SHLIBVERSION; values include '1', '1.2.3', and '1.2.gitaa412c8b'. scons-src-3.0.0/src/engine/SCons/Tool/f95.xml0000664000175000017500000002113113160023044020576 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for generic POSIX Fortran 95 compilers. F95 F95FLAGS F95COM F95PPCOM SHF95 SHF95FLAGS SHF95COM SHF95PPCOM _F95INCFLAGS F95COMSTR F95PPCOMSTR SHF95COMSTR SHF95PPCOMSTR The Fortran 95 compiler. You should normally set the &cv-link-FORTRAN; variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set &cv-link-F95; if you need to use a specific compiler or compiler version for Fortran 95 files. The command line used to compile a Fortran 95 source file to an object file. You only need to set &cv-link-F95COM; if you need to use a specific command line for Fortran 95 files. You should normally set the &cv-link-FORTRANCOM; variable, which specifies the default command line for all Fortran versions. The string displayed when a Fortran 95 source file is compiled to an object file. If this is not set, then &cv-link-F95COM; or &cv-link-FORTRANCOM; (the command line) is displayed. The list of file extensions for which the F95 dialect will be used. By default, this is ['.f95'] The list of file extensions for which the compilation + preprocessor pass for F95 dialect will be used. By default, this is empty General user-specified options that are passed to the Fortran 95 compiler. Note that this variable does not contain (or similar) include search path options that scons generates automatically from &cv-link-F95PATH;. See &cv-link-_F95INCFLAGS; below, for the variable that expands to those options. You only need to set &cv-link-F95FLAGS; if you need to define specific user options for Fortran 95 files. You should normally set the &cv-link-FORTRANFLAGS; variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. An automatically-generated construction variable containing the Fortran 95 compiler command-line options for specifying directories to be searched for include files. The value of &cv-link-_F95INCFLAGS; is created by appending &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; to the beginning and end of each directory in &cv-link-F95PATH;. The list of directories that the Fortran 95 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in &cv-link-F95FLAGS; because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in &cv-link-F95PATH; will be looked-up relative to the SConscript directory when they are used in a command. To force &scons; to look-up a directory relative to the root of the source tree use #: You only need to set &cv-link-F95PATH; if you need to define a specific include path for Fortran 95 files. You should normally set the &cv-link-FORTRANPATH; variable, which specifies the include path for the default Fortran compiler for all Fortran versions. env = Environment(F95PATH='#/include') The directory look-up can also be forced using the &Dir;() function: include = Dir('include') env = Environment(F95PATH=include) The directory list will be added to command lines through the automatically-generated &cv-link-_F95INCFLAGS; construction variable, which is constructed by appending the values of the &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; construction variables to the beginning and end of each directory in &cv-link-F95PATH;. Any command lines you define that need the F95PATH directory list should include &cv-link-_F95INCFLAGS;: env = Environment(F95COM="my_compiler $_F95INCFLAGS -c -o $TARGET $SOURCE") The command line used to compile a Fortran 95 source file to an object file after first running the file through the C preprocessor. Any options specified in the &cv-link-F95FLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. You only need to set &cv-link-F95PPCOM; if you need to use a specific C-preprocessor command line for Fortran 95 files. You should normally set the &cv-link-FORTRANPPCOM; variable, which specifies the default C-preprocessor command line for all Fortran versions. The string displayed when a Fortran 95 source file is compiled to an object file after first running the file through the C preprocessor. If this is not set, then &cv-link-F95PPCOM; or &cv-link-FORTRANPPCOM; (the command line) is displayed. The Fortran 95 compiler used for generating shared-library objects. You should normally set the &cv-link-SHFORTRAN; variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set &cv-link-SHF95; if you need to use a specific compiler or compiler version for Fortran 95 files. The command line used to compile a Fortran 95 source file to a shared-library object file. You only need to set &cv-link-SHF95COM; if you need to use a specific command line for Fortran 95 files. You should normally set the &cv-link-SHFORTRANCOM; variable, which specifies the default command line for all Fortran versions. The string displayed when a Fortran 95 source file is compiled to a shared-library object file. If this is not set, then &cv-link-SHF95COM; or &cv-link-SHFORTRANCOM; (the command line) is displayed. Options that are passed to the Fortran 95 compiler to generated shared-library objects. You only need to set &cv-link-SHF95FLAGS; if you need to define specific user options for Fortran 95 files. You should normally set the &cv-link-SHFORTRANFLAGS; variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. The command line used to compile a Fortran 95 source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the &cv-link-SHF95FLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. You only need to set &cv-link-SHF95PPCOM; if you need to use a specific C-preprocessor command line for Fortran 95 files. You should normally set the &cv-link-SHFORTRANPPCOM; variable, which specifies the default C-preprocessor command line for all Fortran versions. The string displayed when a Fortran 95 source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then &cv-link-SHF95PPCOM; or &cv-link-SHFORTRANPPCOM; (the command line) is displayed. scons-src-3.0.0/src/engine/SCons/Tool/aixcc.xml0000664000175000017500000000210713160023041021261 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the IBM xlc / Visual Age C compiler. CC SHCC CCVERSION scons-src-3.0.0/src/engine/SCons/Tool/wix.py0000664000175000017500000000726113160023045020643 0ustar bdbaddogbdbaddog"""SCons.Tool.wix Tool-specific initialization for wix, the Windows Installer XML Tool. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/wix.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Builder import SCons.Action import os def generate(env): """Add Builders and construction variables for WiX to an Environment.""" if not exists(env): return env['WIXCANDLEFLAGS'] = ['-nologo'] env['WIXCANDLEINCLUDE'] = [] env['WIXCANDLECOM'] = '$WIXCANDLE $WIXCANDLEFLAGS -I $WIXCANDLEINCLUDE -o ${TARGET} ${SOURCE}' env['WIXLIGHTFLAGS'].append( '-nologo' ) env['WIXLIGHTCOM'] = "$WIXLIGHT $WIXLIGHTFLAGS -out ${TARGET} ${SOURCES}" env['WIXSRCSUF'] = '.wxs' env['WIXOBJSUF'] = '.wixobj' object_builder = SCons.Builder.Builder( action = '$WIXCANDLECOM', suffix = '$WIXOBJSUF', src_suffix = '$WIXSRCSUF') linker_builder = SCons.Builder.Builder( action = '$WIXLIGHTCOM', src_suffix = '$WIXOBJSUF', src_builder = object_builder) env['BUILDERS']['WiX'] = linker_builder def exists(env): env['WIXCANDLE'] = 'candle.exe' env['WIXLIGHT'] = 'light.exe' # try to find the candle.exe and light.exe tools and # add the install directory to light libpath. for path in os.environ['PATH'].split(os.pathsep): if not path: continue # workaround for some weird python win32 bug. if path[0] == '"' and path[-1:]=='"': path = path[1:-1] # normalize the path path = os.path.normpath(path) # search for the tools in the PATH environment variable try: files = os.listdir(path) if env['WIXCANDLE'] in files and env['WIXLIGHT'] in files: env.PrependENVPath('PATH', path) # include appropriate flags if running WiX 2.0 if 'wixui.wixlib' in files and 'WixUI_en-us.wxl' in files: env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ), '-loc', os.path.join( path, 'WixUI_en-us.wxl' ) ] else: env['WIXLIGHTFLAGS'] = [] return 1 except OSError: pass # ignore this, could be a stale PATH entry. return None # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/c++.xml0000664000175000017500000000637113160023041020551 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for generic POSIX C++ compilers. CXX CXXFLAGS CXXCOM SHCXX SHCXXFLAGS SHCXXCOM CPPDEFPREFIX CPPDEFSUFFIX INCPREFIX INCSUFFIX SHOBJSUFFIX OBJSUFFIX CXXFILESUFFIX CXXCOMSTR The C++ compiler. The command line used to compile a C++ source file to an object file. Any options specified in the &cv-link-CXXFLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. The string displayed when a C++ source file is compiled to a (static) object file. If this is not set, then &cv-link-CXXCOM; (the command line) is displayed. env = Environment(CXXCOMSTR = "Compiling static object $TARGET") General options that are passed to the C++ compiler. By default, this includes the value of &cv-link-CCFLAGS;, so that setting &cv-CCFLAGS; affects both C and C++ compilation. If you want to add C++-specific flags, you must set or override the value of &cv-link-CXXFLAGS;. The C++ compiler used for generating shared-library objects. The command line used to compile a C++ source file to a shared-library object file. Any options specified in the &cv-link-SHCXXFLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. The string displayed when a C++ source file is compiled to a shared object file. If this is not set, then &cv-link-SHCXXCOM; (the command line) is displayed. env = Environment(SHCXXCOMSTR = "Compiling shared object $TARGET") Options that are passed to the C++ compiler to generate shared-library objects. scons-src-3.0.0/src/engine/SCons/Tool/cvf.xml0000664000175000017500000000263513160023041020756 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Compaq Visual Fortran compiler. FORTRAN FORTRANCOM FORTRANPPCOM SHFORTRANCOM SHFORTRANPPCOM OBJSUFFIX FORTRANMODDIR FORTRANMODDIRPREFIX FORTRANMODDIRSUFFIX FORTRANFLAGS SHFORTRANFLAGS _FORTRANMODFLAG _FORTRANINCFLAGS CPPFLAGS _CPPDEFFLAGS scons-src-3.0.0/src/engine/SCons/Tool/aixcxx.py0000664000175000017500000000463713160023041021340 0ustar bdbaddogbdbaddog"""SCons.Tool.aixc++ Tool-specific initialization for IBM xlC / Visual Age C++ compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/aixcxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import SCons.Platform.aix import SCons.Tool.cxx cplusplus = SCons.Tool.cxx #cplusplus = __import__('cxx', globals(), locals(), []) packages = ['vacpp.cmp.core', 'vacpp.cmp.batch', 'vacpp.cmp.C', 'ibmcxx.cmp'] def get_xlc(env): xlc = env.get('CXX', 'xlC') return SCons.Platform.aix.get_xlc(env, xlc, packages) def generate(env): """Add Builders and construction variables for xlC / Visual Age suite to an Environment.""" path, _cxx, version = get_xlc(env) if path and _cxx: _cxx = os.path.join(path, _cxx) if 'CXX' not in env: env['CXX'] = _cxx cplusplus.generate(env) if version: env['CXXVERSION'] = version def exists(env): path, _cxx, version = get_xlc(env) if path and _cxx: xlc = os.path.join(path, _cxx) if os.path.exists(xlc): return xlc return None # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/latex.xml0000664000175000017500000000462413160023044021320 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &latex; utility. LATEX LATEXFLAGS LATEXCOM LATEXCOMSTR The LaTeX structured formatter and typesetter. The command line used to call the LaTeX structured formatter and typesetter. The string displayed when calling the LaTeX structured formatter and typesetter. If this is not set, then &cv-link-LATEXCOM; (the command line) is displayed. env = Environment(LATEXCOMSTR = "Building $TARGET from LaTeX input $SOURCES") General options passed to the LaTeX structured formatter and typesetter. The maximum number of times that LaTeX will be re-run if the .log generated by the &cv-link-LATEXCOM; command indicates that there are undefined references. The default is to try to resolve undefined references by re-running LaTeX up to three times. List of directories that the LaTeX program will search for include directories. The LaTeX implicit dependency scanner will search these directories for \include and \import files. scons-src-3.0.0/src/engine/SCons/Tool/tex.xml0000664000175000017500000000753213160023045021005 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the TeX formatter and typesetter. TEX TEXFLAGS TEXCOM LATEX LATEXFLAGS LATEXCOM BIBTEX BIBTEXFLAGS BIBTEXCOM MAKEINDEX MAKEINDEXFLAGS MAKEINDEXCOM TEXCOMSTR LATEXCOMSTR BIBTEXCOMSTR MAKEINDEXCOMSTR The bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. The command line used to call the bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. The string displayed when generating a bibliography for TeX or LaTeX. If this is not set, then &cv-link-BIBTEXCOM; (the command line) is displayed. env = Environment(BIBTEXCOMSTR = "Generating bibliography $TARGET") General options passed to the bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. The makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. The command line used to call the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. The string displayed when calling the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. If this is not set, then &cv-link-MAKEINDEXCOM; (the command line) is displayed. General options passed to the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. The TeX formatter and typesetter. The command line used to call the TeX formatter and typesetter. The string displayed when calling the TeX formatter and typesetter. If this is not set, then &cv-link-TEXCOM; (the command line) is displayed. env = Environment(TEXCOMSTR = "Building $TARGET from TeX input $SOURCES") General options passed to the TeX formatter and typesetter. scons-src-3.0.0/src/engine/SCons/Tool/tar.py0000664000175000017500000000470713160023045020624 0ustar bdbaddogbdbaddog"""SCons.Tool.tar Tool-specific initialization for tar. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/tar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Action import SCons.Builder import SCons.Defaults import SCons.Node.FS import SCons.Util tars = ['tar', 'gtar'] TarAction = SCons.Action.Action('$TARCOM', '$TARCOMSTR') TarBuilder = SCons.Builder.Builder(action = TarAction, source_factory = SCons.Node.FS.Entry, source_scanner = SCons.Defaults.DirScanner, suffix = '$TARSUFFIX', multi = 1) def generate(env): """Add Builders and construction variables for tar to an Environment.""" try: bld = env['BUILDERS']['Tar'] except KeyError: bld = TarBuilder env['BUILDERS']['Tar'] = bld env['TAR'] = env.Detect(tars) or 'gtar' env['TARFLAGS'] = SCons.Util.CLVar('-c') env['TARCOM'] = '$TAR $TARFLAGS -f $TARGET $SOURCES' env['TARSUFFIX'] = '.tar' def exists(env): return env.Detect(tars) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/gnulink.py0000664000175000017500000000557013160023044021503 0ustar bdbaddogbdbaddog"""SCons.Tool.gnulink Tool-specific initialization for the gnu linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/gnulink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util import SCons.Tool import os import sys import re from . import link def generate(env): """Add Builders and construction variables for gnulink to an Environment.""" link.generate(env) if env['PLATFORM'] == 'hpux': env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared -fPIC') # __RPATH is set to $_RPATH in the platform specification if that # platform supports it. env['RPATHPREFIX'] = '-Wl,-rpath=' env['RPATHSUFFIX'] = '' env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}' # OpenBSD doesn't usually use SONAME for libraries use_soname = not sys.platform.startswith('openbsd') link._setup_versioned_lib_variables(env, tool = 'gnulink', use_soname = use_soname) env['LINKCALLBACKS'] = link._versioned_lib_callbacks() # For backward-compatibility with older SCons versions env['SHLIBVERSIONFLAGS'] = SCons.Util.CLVar('-Wl,-Bsymbolic') def exists(env): # TODO: sync with link.smart_link() to choose a linker linkers = { 'CXX': ['g++'], 'CC': ['gcc'] } alltools = [] for langvar, linktools in linkers.items(): if langvar in env: # use CC over CXX when user specified CC but not CXX return SCons.Tool.FindTool(linktools, env) alltools.extend(linktools) return SCons.Tool.FindTool(alltools, env) # find CXX or CC # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/gcc.xml0000664000175000017500000000205313160023044020731 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for the &gcc; C compiler. CC SHCCFLAGS CCVERSION scons-src-3.0.0/src/engine/SCons/Tool/aixlink.xml0000664000175000017500000000216213160023041021632 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the IBM Visual Age linker. LINKFLAGS SHLINKFLAGS SHLIBSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/f77.py0000664000175000017500000000376113160023044020437 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.f77 Tool-specific initialization for the generic Posix f77 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/f77.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Scanner.Fortran import SCons.Tool import SCons.Util from SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env compilers = ['f77'] def generate(env): add_all_to_env(env) add_f77_to_env(env) fcomp = env.Detect(compilers) or 'f77' env['F77'] = fcomp env['SHF77'] = fcomp env['FORTRAN'] = fcomp env['SHFORTRAN'] = fcomp def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/gfortran.py0000664000175000017500000000437413160023044021657 0ustar bdbaddogbdbaddog"""SCons.Tool.gfortran Tool-specific initialization for gfortran, the GNU Fortran 95/Fortran 2003 compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/gfortran.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util from . import fortran def generate(env): """Add Builders and construction variables for gfortran to an Environment.""" fortran.generate(env) for dialect in ['F77', 'F90', 'FORTRAN', 'F95', 'F03', 'F08']: env['%s' % dialect] = 'gfortran' env['SH%s' % dialect] = '$%s' % dialect if env['PLATFORM'] in ['cygwin', 'win32']: env['SH%sFLAGS' % dialect] = SCons.Util.CLVar('$%sFLAGS' % dialect) else: env['SH%sFLAGS' % dialect] = SCons.Util.CLVar('$%sFLAGS -fPIC' % dialect) env['INC%sPREFIX' % dialect] = "-I" env['INC%sSUFFIX' % dialect] = "" def exists(env): return env.Detect('gfortran') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/ifort.xml0000664000175000017500000000241613160023044021323 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for newer versions of the Intel Fortran compiler for Linux. FORTRAN F77 F90 F95 SHFORTRAN SHF77 SHF90 SHF95 SHFORTRANFLAGS SHF77FLAGS SHF90FLAGS SHF95FLAGS scons-src-3.0.0/src/engine/SCons/Tool/pdf.py0000664000175000017500000000570213160023044020602 0ustar bdbaddogbdbaddog"""SCons.Tool.pdf Common PDF Builder definition for various other Tool modules that use it. Add an explicit action to run epstopdf to convert .eps files to .pdf """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/pdf.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Builder import SCons.Tool PDFBuilder = None EpsPdfAction = SCons.Action.Action('$EPSTOPDFCOM', '$EPSTOPDFCOMSTR') def generate(env): try: env['BUILDERS']['PDF'] except KeyError: global PDFBuilder if PDFBuilder is None: PDFBuilder = SCons.Builder.Builder(action = {}, source_scanner = SCons.Tool.PDFLaTeXScanner, prefix = '$PDFPREFIX', suffix = '$PDFSUFFIX', emitter = {}, source_ext_match = None, single_source=True) env['BUILDERS']['PDF'] = PDFBuilder env['PDFPREFIX'] = '' env['PDFSUFFIX'] = '.pdf' # put the epstopdf builder in this routine so we can add it after # the pdftex builder so that one is the default for no source suffix def generate2(env): bld = env['BUILDERS']['PDF'] #bld.add_action('.ps', EpsPdfAction) # this is covered by direct Ghostcript action in gs.py bld.add_action('.eps', EpsPdfAction) env['EPSTOPDF'] = 'epstopdf' env['EPSTOPDFFLAGS'] = SCons.Util.CLVar('') env['EPSTOPDFCOM'] = '$EPSTOPDF $EPSTOPDFFLAGS ${SOURCE} --outfile=${TARGET}' def exists(env): # This only puts a skeleton Builder in place, so if someone # references this Tool directly, it's always "available." return 1 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/ar.py0000664000175000017500000000424613160023041020432 0ustar bdbaddogbdbaddog"""SCons.Tool.ar Tool-specific initialization for ar (library archive). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/ar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Util def generate(env): """Add Builders and construction variables for ar to an Environment.""" SCons.Tool.createStaticLibBuilder(env) env['AR'] = 'ar' env['ARFLAGS'] = SCons.Util.CLVar('rc') env['ARCOM'] = '$AR $ARFLAGS $TARGET $SOURCES' env['LIBPREFIX'] = 'lib' env['LIBSUFFIX'] = '.a' if env.get('RANLIB',env.Detect('ranlib')) : env['RANLIB'] = env.get('RANLIB','ranlib') env['RANLIBFLAGS'] = SCons.Util.CLVar('') env['RANLIBCOM'] = '$RANLIB $RANLIBFLAGS $TARGET' def exists(env): return env.Detect('ar') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/msginit.py0000664000175000017500000001111513160023044021476 0ustar bdbaddogbdbaddog""" msginit tool Tool specific initialization of msginit tool. """ # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/msginit.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Warnings import SCons.Builder import re ############################################################################# def _optional_no_translator_flag(env): """ Return '--no-translator' flag if we run *msginit(1)* in non-interactive mode.""" import SCons.Util if 'POAUTOINIT' in env: autoinit = env['POAUTOINIT'] else: autoinit = False if autoinit: return [SCons.Util.CLVar('--no-translator')] else: return [SCons.Util.CLVar('')] ############################################################################# ############################################################################# def _POInitBuilder(env, **kw): """ Create builder object for `POInit` builder. """ import SCons.Action from SCons.Tool.GettextCommon import _init_po_files, _POFileBuilder action = SCons.Action.Action(_init_po_files, None) return _POFileBuilder(env, action=action, target_alias='$POCREATE_ALIAS') ############################################################################# ############################################################################# from SCons.Environment import _null ############################################################################# def _POInitBuilderWrapper(env, target=None, source=_null, **kw): """ Wrapper for _POFileBuilder. We use it to make user's life easier. This wrapper checks for `$POTDOMAIN` construction variable (or override in `**kw`) and treats it appropriatelly. """ if source is _null: if 'POTDOMAIN' in kw: domain = kw['POTDOMAIN'] elif 'POTDOMAIN' in env: domain = env['POTDOMAIN'] else: domain = 'messages' source = [ domain ] # NOTE: Suffix shall be appended automatically return env._POInitBuilder(target, source, **kw) ############################################################################# ############################################################################# def generate(env,**kw): """ Generate the `msginit` tool """ import SCons.Util from SCons.Tool.GettextCommon import _detect_msginit try: env['MSGINIT'] = _detect_msginit(env) except: env['MSGINIT'] = 'msginit' msginitcom = '$MSGINIT ${_MSGNoTranslator(__env__)} -l ${_MSGINITLOCALE}' \ + ' $MSGINITFLAGS -i $SOURCE -o $TARGET' # NOTE: We set POTSUFFIX here, in case the 'xgettext' is not loaded # (sometimes we really don't need it) env.SetDefault( POSUFFIX = ['.po'], POTSUFFIX = ['.pot'], _MSGINITLOCALE = '${TARGET.filebase}', _MSGNoTranslator = _optional_no_translator_flag, MSGINITCOM = msginitcom, MSGINITCOMSTR = '', MSGINITFLAGS = [ ], POAUTOINIT = False, POCREATE_ALIAS = 'po-create' ) env.Append( BUILDERS = { '_POInitBuilder' : _POInitBuilder(env) } ) env.AddMethod(_POInitBuilderWrapper, 'POInit') env.AlwaysBuild(env.Alias('$POCREATE_ALIAS')) ############################################################################# ############################################################################# def exists(env): """ Check if the tool exists """ from SCons.Tool.GettextCommon import _msginit_exists try: return _msginit_exists(env) except: return False ############################################################################# # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/ilink.py0000664000175000017500000000407713160023044021143 0ustar bdbaddogbdbaddog"""SCons.Tool.ilink Tool-specific initialization for the OS/2 ilink linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/ilink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Util def generate(env): """Add Builders and construction variables for ilink to an Environment.""" SCons.Tool.createProgBuilder(env) env['LINK'] = 'ilink' env['LINKFLAGS'] = SCons.Util.CLVar('') env['LINKCOM'] = '$LINK $LINKFLAGS /O:$TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['LIBDIRPREFIX']='/LIBPATH:' env['LIBDIRSUFFIX']='' env['LIBLINKPREFIX']='' env['LIBLINKSUFFIX']='$LIBSUFFIX' def exists(env): return env.Detect('ilink') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sunf95.py0000664000175000017500000000414413160023045021162 0ustar bdbaddogbdbaddog"""SCons.Tool.sunf95 Tool-specific initialization for sunf95, the Sun Studio F95 compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sunf95.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util from .FortranCommon import add_all_to_env compilers = ['sunf95', 'f95'] def generate(env): """Add Builders and construction variables for sunf95 to an Environment.""" add_all_to_env(env) fcomp = env.Detect(compilers) or 'f95' env['FORTRAN'] = fcomp env['F95'] = fcomp env['SHFORTRAN'] = '$FORTRAN' env['SHF95'] = '$F95' env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS -KPIC') env['SHF95FLAGS'] = SCons.Util.CLVar('$F95FLAGS -KPIC') def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/g77.py0000664000175000017500000000463713160023044020443 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.g77 Tool-specific initialization for g77. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/g77.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util from SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env compilers = ['g77', 'f77'] def generate(env): """Add Builders and construction variables for g77 to an Environment.""" add_all_to_env(env) add_f77_to_env(env) fcomp = env.Detect(compilers) or 'g77' if env['PLATFORM'] in ['cygwin', 'win32']: env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS') env['SHF77FLAGS'] = SCons.Util.CLVar('$F77FLAGS') else: env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS -fPIC') env['SHF77FLAGS'] = SCons.Util.CLVar('$F77FLAGS -fPIC') env['FORTRAN'] = fcomp env['SHFORTRAN'] = '$FORTRAN' env['F77'] = fcomp env['SHF77'] = '$F77' env['INCFORTRANPREFIX'] = "-I" env['INCFORTRANSUFFIX'] = "" env['INCF77PREFIX'] = "-I" env['INCF77SUFFIX'] = "" def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sgicc.xml0000664000175000017500000000214213160023044021264 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the SGI C compiler. CXX SHOBJSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/gas.py0000664000175000017500000000365513160023044020610 0ustar bdbaddogbdbaddog"""SCons.Tool.gas Tool-specific initialization for as, the Gnu assembler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/gas.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" try: as_module = __import__('as', globals(), locals(), []) except: as_module = __import__(__package__+'.as', globals(), locals(), ['*']) assemblers = ['as', 'gas'] def generate(env): """Add Builders and construction variables for as to an Environment.""" as_module.generate(env) env['AS'] = env.Detect(assemblers) or 'as' def exists(env): return env.Detect(assemblers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/gxx.py0000664000175000017500000000512413160023044020635 0ustar bdbaddogbdbaddog"""SCons.Tool.g++ Tool-specific initialization for g++. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/gxx.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import re import subprocess import SCons.Tool import SCons.Util from . import gcc from . import cxx compilers = ['g++'] def generate(env): """Add Builders and construction variables for g++ to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) if 'CXX' not in env: env['CXX'] = env.Detect(compilers) or compilers[0] cxx.generate(env) # platform specific settings if env['PLATFORM'] == 'aix': env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS -mminimal-toc') env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 env['SHOBJSUFFIX'] = '$OBJSUFFIX' elif env['PLATFORM'] == 'hpux': env['SHOBJSUFFIX'] = '.pic.o' elif env['PLATFORM'] == 'sunos': env['SHOBJSUFFIX'] = '.pic.o' # determine compiler version version = gcc.detect_version(env, env['CXX']) if version: env['CXXVERSION'] = version def exists(env): # is executable, and is a GNU compiler (or accepts '--version' at least) return gcc.detect_version(env, env.Detect(env.get('CXX', compilers))) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/msgmerge.xml0000664000175000017500000001453013160023044022006 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> This scons tool is a part of scons &t-link-gettext; toolset. It provides scons interface to msgmerge(1) command, which merges two Uniform style .po files together. MSGMERGE MSGMERGECOM MSGMERGECOMSTR MSGMERGEFLAGS POSUFFIX POTSUFFIX POUPDATE_ALIAS POTDOMAIN LINGUAS_FILE POAUTOINIT The builder belongs to &t-link-msgmerge; tool. The builder updates PO files with msgmerge(1), or initializes missing PO files as described in documentation of &t-link-msginit; tool and &b-link-POInit; builder (see also &cv-link-POAUTOINIT;). Note, that &b-POUpdate; does not add its targets to po-create alias as &b-link-POInit; does. Target nodes defined through &b-POUpdate; are not built by default (they're Ignored from '.' node). Instead, they are added automatically to special Alias ('po-update' by default). The alias name may be changed through the &cv-link-POUPDATE_ALIAS; construction variable. You can easily update PO files in your project by scons po-update. Example 1. Update en.po and pl.po from messages.pot template (see also &cv-link-POTDOMAIN;), assuming that the later one exists or there is rule to build it (see &b-link-POTUpdate;): # ... env.POUpdate(['en','pl']) # messages.pot --> [en.po, pl.po] Example 2. Update en.po and pl.po from foo.pot template: # ... env.POUpdate(['en', 'pl'], ['foo']) # foo.pot --> [en.po, pl.pl] Example 3. Update en.po and pl.po from foo.pot (another version): # ... env.POUpdate(['en', 'pl'], POTDOMAIN='foo') # foo.pot -- > [en.po, pl.pl] Example 4. Update files for languages defined in LINGUAS file. The files are updated from messages.pot template: # ... env.POUpdate(LINGUAS_FILE = 1) # needs 'LINGUAS' file Example 5. Same as above, but update from foo.pot template: # ... env.POUpdate(LINGUAS_FILE = 1, source = ['foo']) Example 6. Update en.po and pl.po plus files for languages defined in LINGUAS file. The files are updated from messages.pot template: # produce 'en.po', 'pl.po' + files defined in 'LINGUAS': env.POUpdate(['en', 'pl' ], LINGUAS_FILE = 1) Example 7. Use &cv-link-POAUTOINIT; to automatically initialize PO file if it doesn't exist: # ... env.POUpdate(LINGUAS_FILE = 1, POAUTOINIT = 1) Example 8. Update PO files for languages defined in LINGUAS file. The files are updated from foo.pot template. All necessary settings are pre-configured via environment. # ... env['POAUTOINIT'] = 1 env['LINGUAS_FILE'] = 1 env['POTDOMAIN'] = 'foo' env.POUpdate() Common alias for all PO files being defined with &b-link-POUpdate; builder (default: 'po-update'). See &t-link-msgmerge; tool and &b-link-POUpdate; builder. Absolute path to msgmerge(1) binary as found by Detect(). See &t-link-msgmerge; tool and &b-link-POUpdate; builder. Complete command line to run msgmerge(1) command. See &t-link-msgmerge; tool and &b-link-POUpdate; builder. String to be displayed when msgmerge(1) is invoked (default: '', which means ``print &cv-link-MSGMERGECOM;''). See &t-link-msgmerge; tool and &b-link-POUpdate; builder. Additional flags to msgmerge(1) command. See &t-link-msgmerge; tool and &b-link-POUpdate; builder. scons-src-3.0.0/src/engine/SCons/Tool/gas.xml0000664000175000017500000000202613160023044020747 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &gas; assembler. Calls the &t-as; module. AS scons-src-3.0.0/src/engine/SCons/Tool/386asm.py0000664000175000017500000000422713160023041021050 0ustar bdbaddogbdbaddog"""SCons.Tool.386asm Tool specification for the 386ASM assembler for the Phar Lap ETS embedded operating system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/386asm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from SCons.Tool.PharLapCommon import addPharLapPaths import SCons.Util as_module = __import__('as', globals(), locals(), [], 1) def generate(env): """Add Builders and construction variables for ar to an Environment.""" as_module.generate(env) env['AS'] = '386asm' env['ASFLAGS'] = SCons.Util.CLVar('') env['ASPPFLAGS'] = '$ASFLAGS' env['ASCOM'] = '$AS $ASFLAGS $SOURCES -o $TARGET' env['ASPPCOM'] = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $SOURCES -o $TARGET' addPharLapPaths(env) def exists(env): return env.Detect('386asm') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/pdf.xml0000664000175000017500000000360013160023044020745 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Portable Document Format builder. PDFPREFIX PDFSUFFIX Builds a .pdf file from a .dvi input file (or, by extension, a .tex, .ltx, or .latex input file). The suffix specified by the &cv-link-PDFSUFFIX; construction variable (.pdf by default) is added automatically to the target if it is not already present. Example: # builds from aaa.tex env.PDF(target = 'aaa.pdf', source = 'aaa.tex') # builds bbb.pdf from bbb.dvi env.PDF(target = 'bbb', source = 'bbb.dvi') The prefix used for PDF file names. The suffix used for PDF file names. scons-src-3.0.0/src/engine/SCons/Tool/sgicc.py0000664000175000017500000000350013160023044021113 0ustar bdbaddogbdbaddog"""SCons.Tool.sgicc Tool-specific initialization for MIPSPro cc on SGI. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sgicc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from . import cc def generate(env): """Add Builders and construction variables for gcc to an Environment.""" cc.generate(env) env['CXX'] = 'CC' env['SHOBJSUFFIX'] = '.o' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 def exists(env): return env.Detect('cc') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/hplink.py0000664000175000017500000000450613160023044021317 0ustar bdbaddogbdbaddog"""SCons.Tool.hplink Tool-specific initialization for the HP linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/hplink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import SCons.Util from . import link ccLinker = None # search for the acc compiler and linker front end try: dirs = os.listdir('/opt') except (IOError, OSError): # Not being able to read the directory because it doesn't exist # (IOError) or isn't readable (OSError) is okay. dirs = [] for dir in dirs: linker = '/opt/' + dir + '/bin/aCC' if os.path.exists(linker): ccLinker = linker break def generate(env): """ Add Builders and construction variables for Visual Age linker to an Environment. """ link.generate(env) env['LINKFLAGS'] = SCons.Util.CLVar('-Wl,+s -Wl,+vnocompatwarnings') env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -b') env['SHLIBSUFFIX'] = '.sl' def exists(env): return ccLinker # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/javah.py0000664000175000017500000001104313160023044021115 0ustar bdbaddogbdbaddog"""SCons.Tool.javah Tool-specific initialization for javah. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/javah.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import SCons.Action import SCons.Builder import SCons.Node.FS import SCons.Tool.javac import SCons.Util def emit_java_headers(target, source, env): """Create and return lists of Java stub header files that will be created from a set of class files. """ class_suffix = env.get('JAVACLASSSUFFIX', '.class') classdir = env.get('JAVACLASSDIR') if not classdir: try: s = source[0] except IndexError: classdir = '.' else: try: classdir = s.attributes.java_classdir except AttributeError: classdir = '.' classdir = env.Dir(classdir).rdir() if str(classdir) == '.': c_ = None else: c_ = str(classdir) + os.sep slist = [] for src in source: try: classname = src.attributes.java_classname except AttributeError: classname = str(src) if c_ and classname[:len(c_)] == c_: classname = classname[len(c_):] if class_suffix and classname[-len(class_suffix):] == class_suffix: classname = classname[:-len(class_suffix)] classname = SCons.Tool.javac.classname(classname) s = src.rfile() s.attributes.java_classname = classname slist.append(s) s = source[0].rfile() if not hasattr(s.attributes, 'java_classdir'): s.attributes.java_classdir = classdir if target[0].__class__ is SCons.Node.FS.File: tlist = target else: if not isinstance(target[0], SCons.Node.FS.Dir): target[0].__class__ = SCons.Node.FS.Dir target[0]._morph() tlist = [] for s in source: fname = s.attributes.java_classname.replace('.', '_') + '.h' t = target[0].File(fname) t.attributes.java_lookupdir = target[0] tlist.append(t) return tlist, source def JavaHOutFlagGenerator(target, source, env, for_signature): try: t = target[0] except (AttributeError, IndexError, TypeError): t = target try: return '-d ' + str(t.attributes.java_lookupdir) except AttributeError: return '-o ' + str(t) def getJavaHClassPath(env,target, source, for_signature): path = "${SOURCE.attributes.java_classdir}" if 'JAVACLASSPATH' in env and env['JAVACLASSPATH']: path = SCons.Util.AppendPath(path, env['JAVACLASSPATH']) return "-classpath %s" % (path) def generate(env): """Add Builders and construction variables for javah to an Environment.""" java_javah = SCons.Tool.CreateJavaHBuilder(env) java_javah.emitter = emit_java_headers env['_JAVAHOUTFLAG'] = JavaHOutFlagGenerator env['JAVAH'] = 'javah' env['JAVAHFLAGS'] = SCons.Util.CLVar('') env['_JAVAHCLASSPATH'] = getJavaHClassPath env['JAVAHCOM'] = '$JAVAH $JAVAHFLAGS $_JAVAHOUTFLAG $_JAVAHCLASSPATH ${SOURCES.attributes.java_classname}' env['JAVACLASSSUFFIX'] = '.class' def exists(env): return env.Detect('javah') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sgilink.py0000664000175000017500000000416413160023044021472 0ustar bdbaddogbdbaddog"""SCons.Tool.sgilink Tool-specific initialization for the SGI MIPSPro linker on SGI. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/sgilink.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util from . import link linkers = ['CC', 'cc'] def generate(env): """Add Builders and construction variables for MIPSPro to an Environment.""" link.generate(env) env['LINK'] = env.Detect(linkers) or 'cc' env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') # __RPATH is set to $_RPATH in the platform specification if that # platform supports it. env['RPATHPREFIX'] = '-rpath ' env['RPATHSUFFIX'] = '' env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}' def exists(env): return env.Detect(linkers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/aixc++.py0000664000175000017500000000316713160023041021103 0ustar bdbaddogbdbaddog"""SCons.Tool.aixc++ Tool-specific initialization for IBM xlC / Visual Age C++ compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/aixc++.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" #forward proxy to the preffered cxx version from SCons.Tool.aixcxx import * # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/f95.py0000664000175000017500000000375313160023044020440 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.f95 Tool-specific initialization for the generic Posix f95 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/f95.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Util from . import fortran from SCons.Tool.FortranCommon import add_all_to_env, add_f95_to_env compilers = ['f95'] def generate(env): add_all_to_env(env) add_f95_to_env(env) fcomp = env.Detect(compilers) or 'f95' env['F95'] = fcomp env['SHF95'] = fcomp env['FORTRAN'] = fcomp env['SHFORTRAN'] = fcomp def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/suncc.xml0000664000175000017500000000211013160023044021302 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Sun C compiler. CXX SHCCFLAGS SHOBJPREFIX SHOBJSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/f03.py0000664000175000017500000000375313160023044020425 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.f03 Tool-specific initialization for the generic Posix f03 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/f03.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Defaults import SCons.Tool import SCons.Util from . import fortran from SCons.Tool.FortranCommon import add_all_to_env, add_f03_to_env compilers = ['f03'] def generate(env): add_all_to_env(env) add_f03_to_env(env) fcomp = env.Detect(compilers) or 'f03' env['F03'] = fcomp env['SHF03'] = fcomp env['FORTRAN'] = fcomp env['SHFORTRAN'] = fcomp def exists(env): return env.Detect(compilers) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/ldc.py0000664000175000017500000001422713160023044020575 0ustar bdbaddogbdbaddogfrom __future__ import print_function """SCons.Tool.ldc Tool-specific initialization for the LDC compiler. (https://github.com/ldc-developers/ldc) Developed by Russel Winder (russel@winder.org.uk) 2012-05-09 onwards Compiler variables: DC - The name of the D compiler to use. Defaults to ldc2. DPATH - List of paths to search for import modules. DVERSIONS - List of version tags to enable when compiling. DDEBUG - List of debug tags to enable when compiling. Linker related variables: LIBS - List of library files to link in. DLINK - Name of the linker to use. Defaults to ldc2. DLINKFLAGS - List of linker flags. Lib tool variables: DLIB - Name of the lib tool to use. Defaults to lib. DLIBFLAGS - List of flags to pass to the lib tool. LIBS - Same as for the linker. (libraries to pull into the .lib) """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/ldc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import subprocess import SCons.Action import SCons.Builder import SCons.Defaults import SCons.Scanner.D import SCons.Tool import SCons.Tool.DCommon as DCommon def generate(env): static_obj, shared_obj = SCons.Tool.createObjBuilders(env) static_obj.add_action('.d', SCons.Defaults.DAction) shared_obj.add_action('.d', SCons.Defaults.ShDAction) static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter) env['DC'] = env.Detect('ldc2') or 'ldc2' env['DCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -of=$TARGET $SOURCES' env['_DINCFLAGS'] = '${_concat(DINCPREFIX, DPATH, DINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}' env['_DVERFLAGS'] = '${_concat(DVERPREFIX, DVERSIONS, DVERSUFFIX, __env__)}' env['_DDEBUGFLAGS'] = '${_concat(DDEBUGPREFIX, DDEBUG, DDEBUGSUFFIX, __env__)}' env['_DFLAGS'] = '${_concat(DFLAGPREFIX, DFLAGS, DFLAGSUFFIX, __env__)}' env['SHDC'] = '$DC' env['SHDCOM'] = '$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -c -relocation-model=pic -of=$TARGET $SOURCES' env['DPATH'] = ['#/'] env['DFLAGS'] = [] env['DVERSIONS'] = [] env['DDEBUG'] = [] if env['DC']: DCommon.addDPATHToEnv(env, env['DC']) env['DINCPREFIX'] = '-I=' env['DINCSUFFIX'] = '' env['DVERPREFIX'] = '-version=' env['DVERSUFFIX'] = '' env['DDEBUGPREFIX'] = '-debug=' env['DDEBUGSUFFIX'] = '' env['DFLAGPREFIX'] = '-' env['DFLAGSUFFIX'] = '' env['DFILESUFFIX'] = '.d' env['DLINK'] = '$DC' env['DLINKFLAGS'] = SCons.Util.CLVar('') env['DLINKCOM'] = '$DLINK -of=$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' env['SHDLINK'] = '$DC' env['SHDLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=phobos2-ldc') env['SHDLINKCOM'] = '$DLINK -of=$TARGET $SHDLINKFLAGS $__SHDLIBVERSIONFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS -L-ldruntime-ldc' env['DLIBLINKPREFIX'] = '' if env['PLATFORM'] == 'win32' else '-L-l' env['DLIBLINKSUFFIX'] = '.lib' if env['PLATFORM'] == 'win32' else '' # env['_DLIBFLAGS'] = '${_concat(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, __env__, RDirs, TARGET, SOURCE)}' env['_DLIBFLAGS'] = '${_stripixes(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}' env['DLIBDIRPREFIX'] = '-L-L' env['DLIBDIRSUFFIX'] = '' env['_DLIBDIRFLAGS'] = '${_concat(DLIBDIRPREFIX, LIBPATH, DLIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)}' env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr' env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '') # env['_DLIBFLAGS'] = '${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)}' env['DLIBFLAGPREFIX'] = '-' env['DLIBFLAGSUFFIX'] = '' # __RPATH is set to $_RPATH in the platform specification if that # platform supports it. env['DRPATHPREFIX'] = '-L-Wl,-rpath,' if env['PLATFORM'] == 'darwin' else '-L-rpath=' env['DRPATHSUFFIX'] = '' env['_DRPATH'] = '${_concat(DRPATHPREFIX, RPATH, DRPATHSUFFIX, __env__)}' # Support for versioned libraries env['_SHDLIBVERSIONFLAGS'] = '$SHDLIBVERSIONFLAGS -L-soname=$_SHDLIBSONAME' env['_SHDLIBSONAME'] = '${DShLibSonameGenerator(__env__,TARGET)}' # NOTE: this is a quick hack, the soname will only work if there is # c/c++ linker loaded which provides callback for the ShLibSonameGenerator env['DShLibSonameGenerator'] = SCons.Tool.ShLibSonameGenerator # NOTE: this is only for further reference, currently $SHDLIBVERSION does # not work, the user must use $SHLIBVERSION env['SHDLIBVERSION'] = '$SHLIBVERSION' env['SHDLIBVERSIONFLAGS'] = [] env['BUILDERS']['ProgramAllAtOnce'] = SCons.Builder.Builder( action='$DC $_DINCFLAGS $_DVERFLAGS $_DDEBUGFLAGS $_DFLAGS -of=$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS', emitter=DCommon.allAtOnceEmitter, ) def exists(env): return env.Detect('ldc2') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/f77.xml0000664000175000017500000002167113160023044020607 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Set construction variables for generic POSIX Fortran 77 compilers. F77 F77FLAGS F77COM F77PPCOM F77FILESUFFIXES F77PPFILESUFFIXES FORTRAN FORTRANFLAGS FORTRANCOM SHF77 SHF77FLAGS SHF77COM SHF77PPCOM SHFORTRAN SHFORTRANFLAGS SHFORTRANCOM SHFORTRANPPCOM _F77INCFLAGS F77COMSTR F77PPCOMSTR FORTRANCOMSTR FORTRANPPCOMSTR SHF77COMSTR SHF77PPCOMSTR SHFORTRANCOMSTR SHFORTRANPPCOMSTR The Fortran 77 compiler. You should normally set the &cv-link-FORTRAN; variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set &cv-link-F77; if you need to use a specific compiler or compiler version for Fortran 77 files. The command line used to compile a Fortran 77 source file to an object file. You only need to set &cv-link-F77COM; if you need to use a specific command line for Fortran 77 files. You should normally set the &cv-link-FORTRANCOM; variable, which specifies the default command line for all Fortran versions. The list of file extensions for which the F77 dialect will be used. By default, this is ['.f77'] The list of file extensions for which the compilation + preprocessor pass for F77 dialect will be used. By default, this is empty The string displayed when a Fortran 77 source file is compiled to an object file. If this is not set, then &cv-link-F77COM; or &cv-link-FORTRANCOM; (the command line) is displayed. General user-specified options that are passed to the Fortran 77 compiler. Note that this variable does not contain (or similar) include search path options that scons generates automatically from &cv-link-F77PATH;. See &cv-link-_F77INCFLAGS; below, for the variable that expands to those options. You only need to set &cv-link-F77FLAGS; if you need to define specific user options for Fortran 77 files. You should normally set the &cv-link-FORTRANFLAGS; variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. An automatically-generated construction variable containing the Fortran 77 compiler command-line options for specifying directories to be searched for include files. The value of &cv-link-_F77INCFLAGS; is created by appending &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; to the beginning and end of each directory in &cv-link-F77PATH;. The list of directories that the Fortran 77 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in &cv-link-F77FLAGS; because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in &cv-link-F77PATH; will be looked-up relative to the SConscript directory when they are used in a command. To force &scons; to look-up a directory relative to the root of the source tree use #: You only need to set &cv-link-F77PATH; if you need to define a specific include path for Fortran 77 files. You should normally set the &cv-link-FORTRANPATH; variable, which specifies the include path for the default Fortran compiler for all Fortran versions. env = Environment(F77PATH='#/include') The directory look-up can also be forced using the &Dir;() function: include = Dir('include') env = Environment(F77PATH=include) The directory list will be added to command lines through the automatically-generated &cv-link-_F77INCFLAGS; construction variable, which is constructed by appending the values of the &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; construction variables to the beginning and end of each directory in &cv-link-F77PATH;. Any command lines you define that need the F77PATH directory list should include &cv-link-_F77INCFLAGS;: env = Environment(F77COM="my_compiler $_F77INCFLAGS -c -o $TARGET $SOURCE") The command line used to compile a Fortran 77 source file to an object file after first running the file through the C preprocessor. Any options specified in the &cv-link-F77FLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. You only need to set &cv-link-F77PPCOM; if you need to use a specific C-preprocessor command line for Fortran 77 files. You should normally set the &cv-link-FORTRANPPCOM; variable, which specifies the default C-preprocessor command line for all Fortran versions. The string displayed when a Fortran 77 source file is compiled to an object file after first running the file through the C preprocessor. If this is not set, then &cv-link-F77PPCOM; or &cv-link-FORTRANPPCOM; (the command line) is displayed. The Fortran 77 compiler used for generating shared-library objects. You should normally set the &cv-link-SHFORTRAN; variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set &cv-link-SHF77; if you need to use a specific compiler or compiler version for Fortran 77 files. The command line used to compile a Fortran 77 source file to a shared-library object file. You only need to set &cv-link-SHF77COM; if you need to use a specific command line for Fortran 77 files. You should normally set the &cv-link-SHFORTRANCOM; variable, which specifies the default command line for all Fortran versions. The string displayed when a Fortran 77 source file is compiled to a shared-library object file. If this is not set, then &cv-link-SHF77COM; or &cv-link-SHFORTRANCOM; (the command line) is displayed. Options that are passed to the Fortran 77 compiler to generated shared-library objects. You only need to set &cv-link-SHF77FLAGS; if you need to define specific user options for Fortran 77 files. You should normally set the &cv-link-SHFORTRANFLAGS; variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. The command line used to compile a Fortran 77 source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the &cv-link-SHF77FLAGS; and &cv-link-CPPFLAGS; construction variables are included on this command line. You only need to set &cv-link-SHF77PPCOM; if you need to use a specific C-preprocessor command line for Fortran 77 files. You should normally set the &cv-link-SHFORTRANPPCOM; variable, which specifies the default C-preprocessor command line for all Fortran versions. The string displayed when a Fortran 77 source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then &cv-link-SHF77PPCOM; or &cv-link-SHFORTRANPPCOM; (the command line) is displayed. scons-src-3.0.0/src/engine/SCons/Tool/icc.py0000664000175000017500000000420113160023044020560 0ustar bdbaddogbdbaddog"""engine.SCons.Tool.icc Tool-specific initialization for the OS/2 icc compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/icc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from . import cc def generate(env): """Add Builders and construction variables for the OS/2 to an Environment.""" cc.generate(env) env['CC'] = 'icc' env['CCCOM'] = '$CC $CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET' env['CXXCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET' env['CPPDEFPREFIX'] = '/D' env['CPPDEFSUFFIX'] = '' env['INCPREFIX'] = '/I' env['INCSUFFIX'] = '' env['CFILESUFFIX'] = '.c' env['CXXFILESUFFIX'] = '.cc' def exists(env): return env.Detect('icc') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/xgettext.py0000664000175000017500000003305213160023045021705 0ustar bdbaddogbdbaddog""" xgettext tool Tool specific initialization of `xgettext` tool. """ # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/xgettext.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" ############################################################################# class _CmdRunner(object): """ Callable object, which runs shell command storing its stdout and stderr to variables. It also provides `strfunction()` method, which shall be used by scons Action objects to print command string. """ def __init__(self, command, commandstr=None): self.out = None self.err = None self.status = None self.command = command self.commandstr = commandstr def __call__(self, target, source, env): import SCons.Action import subprocess import os import sys kw = { 'stdin': 'devnull', 'stdout': subprocess.PIPE, 'stderr': subprocess.PIPE, 'universal_newlines': True, 'shell': True } command = env.subst(self.command, target=target, source=source) proc = SCons.Action._subproc(env, command, **kw) self.out, self.err = proc.communicate() self.status = proc.wait() if self.err: sys.stderr.write(unicode(self.err)) return self.status def strfunction(self, target, source, env): import os comstr = self.commandstr if env.subst(comstr, target=target, source=source) == "": comstr = self.command s = env.subst(comstr, target=target, source=source) return s ############################################################################# ############################################################################# def _update_pot_file(target, source, env): """ Action function for `POTUpdate` builder """ import re import os import SCons.Action nop = lambda target, source, env: 0 # Save scons cwd and os cwd (NOTE: they may be different. After the job, we # revert each one to its original state). save_cwd = env.fs.getcwd() save_os_cwd = os.getcwd() chdir = target[0].dir chdir_str = repr(chdir.get_abspath()) # Print chdir message (employ SCons.Action.Action for that. It knows better # than me how to to this correctly). env.Execute(SCons.Action.Action(nop, "Entering " + chdir_str)) # Go to target's directory and do our job env.fs.chdir(chdir, 1) # Go into target's directory try: cmd = _CmdRunner('$XGETTEXTCOM', '$XGETTEXTCOMSTR') action = SCons.Action.Action(cmd, strfunction=cmd.strfunction) status = action([target[0]], source, env) except: # Something went wrong. env.Execute(SCons.Action.Action(nop, "Leaving " + chdir_str)) # Revert working dirs to previous state and re-throw exception. env.fs.chdir(save_cwd, 0) os.chdir(save_os_cwd) raise # Print chdir message. env.Execute(SCons.Action.Action(nop, "Leaving " + chdir_str)) # Revert working dirs to previous state. env.fs.chdir(save_cwd, 0) os.chdir(save_os_cwd) # If the command was not successfull, return error code. if status: return status new_content = cmd.out if not new_content: # When xgettext finds no internationalized messages, no *.pot is created # (because we don't want to bother translators with empty POT files). needs_update = False explain = "no internationalized messages encountered" else: if target[0].exists(): # If the file already exists, it's left unaltered unless its messages # are outdated (w.r.t. to these recovered by xgettext from sources). old_content = target[0].get_text_contents() re_cdate = re.compile(r'^"POT-Creation-Date: .*"$[\r\n]?', re.M) old_content_nocdate = re.sub(re_cdate, "", old_content) new_content_nocdate = re.sub(re_cdate, "", new_content) if (old_content_nocdate == new_content_nocdate): # Messages are up-to-date needs_update = False explain = "messages in file found to be up-to-date" else: # Messages are outdated needs_update = True explain = "messages in file were outdated" else: # No POT file found, create new one needs_update = True explain = "new file" if needs_update: # Print message employing SCons.Action.Action for that. msg = "Writing " + repr(str(target[0])) + " (" + explain + ")" env.Execute(SCons.Action.Action(nop, msg)) f = open(str(target[0]), "w") f.write(new_content) f.close() return 0 else: # Print message employing SCons.Action.Action for that. msg = "Not writing " + repr(str(target[0])) + " (" + explain + ")" env.Execute(SCons.Action.Action(nop, msg)) return 0 ############################################################################# ############################################################################# from SCons.Builder import BuilderBase ############################################################################# class _POTBuilder(BuilderBase): def _execute(self, env, target, source, *args): if not target: if 'POTDOMAIN' in env and env['POTDOMAIN']: domain = env['POTDOMAIN'] else: domain = 'messages' target = [domain] return BuilderBase._execute(self, env, target, source, *args) ############################################################################# ############################################################################# def _scan_xgettext_from_files(target, source, env, files=None, path=None): """ Parses `POTFILES.in`-like file and returns list of extracted file names. """ import re import SCons.Util import SCons.Node.FS if files is None: return 0 if not SCons.Util.is_List(files): files = [files] if path is None: if 'XGETTEXTPATH' in env: path = env['XGETTEXTPATH'] else: path = [] if not SCons.Util.is_List(path): path = [path] path = SCons.Util.flatten(path) dirs = () for p in path: if not isinstance(p, SCons.Node.FS.Base): if SCons.Util.is_String(p): p = env.subst(p, source=source, target=target) p = env.arg2nodes(p, env.fs.Dir) dirs += tuple(p) # cwd is the default search path (when no path is defined by user) if not dirs: dirs = (env.fs.getcwd(),) # Parse 'POTFILE.in' files. re_comment = re.compile(r'^#[^\n\r]*$\r?\n?', re.M) re_emptyln = re.compile(r'^[ \t\r]*$\r?\n?', re.M) re_trailws = re.compile(r'[ \t\r]+$') for f in files: # Find files in search path $XGETTEXTPATH if isinstance(f, SCons.Node.FS.Base) and f.rexists(): contents = f.get_text_contents() contents = re_comment.sub("", contents) contents = re_emptyln.sub("", contents) contents = re_trailws.sub("", contents) depnames = contents.splitlines() for depname in depnames: depfile = SCons.Node.FS.find_file(depname, dirs) if not depfile: depfile = env.arg2nodes(depname, dirs[0].File) env.Depends(target, depfile) return 0 ############################################################################# ############################################################################# def _pot_update_emitter(target, source, env): """ Emitter function for `POTUpdate` builder """ from SCons.Tool.GettextCommon import _POTargetFactory import SCons.Util import SCons.Node.FS if 'XGETTEXTFROM' in env: xfrom = env['XGETTEXTFROM'] else: return target, source if not SCons.Util.is_List(xfrom): xfrom = [xfrom] xfrom = SCons.Util.flatten(xfrom) # Prepare list of 'POTFILE.in' files. files = [] for xf in xfrom: if not isinstance(xf, SCons.Node.FS.Base): if SCons.Util.is_String(xf): # Interpolate variables in strings xf = env.subst(xf, source=source, target=target) xf = env.arg2nodes(xf) files.extend(xf) if files: env.Depends(target, files) _scan_xgettext_from_files(target, source, env, files) return target, source ############################################################################# ############################################################################# from SCons.Environment import _null ############################################################################# def _POTUpdateBuilderWrapper(env, target=None, source=_null, **kw): return env._POTUpdateBuilder(target, source, **kw) ############################################################################# ############################################################################# def _POTUpdateBuilder(env, **kw): """ Creates `POTUpdate` builder object """ import SCons.Action from SCons.Tool.GettextCommon import _POTargetFactory kw['action'] = SCons.Action.Action(_update_pot_file, None) kw['suffix'] = '$POTSUFFIX' kw['target_factory'] = _POTargetFactory(env, alias='$POTUPDATE_ALIAS').File kw['emitter'] = _pot_update_emitter return _POTBuilder(**kw) ############################################################################# ############################################################################# def generate(env, **kw): """ Generate `xgettext` tool """ import SCons.Util from SCons.Tool.GettextCommon import RPaths, _detect_xgettext try: env['XGETTEXT'] = _detect_xgettext(env) except: env['XGETTEXT'] = 'xgettext' # NOTE: sources="$SOURCES" would work as well. However, we use following # construction to convert absolute paths provided by scons onto paths # relative to current working dir. Note, that scons expands $SOURCE(S) to # absolute paths for sources $SOURCE(s) outside of current subtree (e.g. in # "../"). With source=$SOURCE these absolute paths would be written to the # resultant *.pot file (and its derived *.po files) as references to lines in # source code (e.g. referring lines in *.c files). Such references would be # correct (e.g. in poedit) only on machine on which *.pot was generated and # would be of no use on other hosts (having a copy of source code located # in different place in filesystem). sources = '$( ${_concat( "", SOURCES, "", __env__, XgettextRPaths, TARGET' \ + ', SOURCES)} $)' # NOTE: the output from $XGETTEXTCOM command must go to stdout, not to a file. # This is required by the POTUpdate builder's action. xgettextcom = '$XGETTEXT $XGETTEXTFLAGS $_XGETTEXTPATHFLAGS' \ + ' $_XGETTEXTFROMFLAGS -o - ' + sources xgettextpathflags = '$( ${_concat( XGETTEXTPATHPREFIX, XGETTEXTPATH' \ + ', XGETTEXTPATHSUFFIX, __env__, RDirs, TARGET, SOURCES)} $)' xgettextfromflags = '$( ${_concat( XGETTEXTFROMPREFIX, XGETTEXTFROM' \ + ', XGETTEXTFROMSUFFIX, __env__, target=TARGET, source=SOURCES)} $)' env.SetDefault( _XGETTEXTDOMAIN='${TARGET.filebase}', XGETTEXTFLAGS=[], XGETTEXTCOM=xgettextcom, XGETTEXTCOMSTR='', XGETTEXTPATH=[], XGETTEXTPATHPREFIX='-D', XGETTEXTPATHSUFFIX='', XGETTEXTFROM=None, XGETTEXTFROMPREFIX='-f', XGETTEXTFROMSUFFIX='', _XGETTEXTPATHFLAGS=xgettextpathflags, _XGETTEXTFROMFLAGS=xgettextfromflags, POTSUFFIX=['.pot'], POTUPDATE_ALIAS='pot-update', XgettextRPaths=RPaths(env) ) env.Append(BUILDERS={ '_POTUpdateBuilder': _POTUpdateBuilder(env) }) env.AddMethod(_POTUpdateBuilderWrapper, 'POTUpdate') env.AlwaysBuild(env.Alias('$POTUPDATE_ALIAS')) ############################################################################# ############################################################################# def exists(env): """ Check, whether the tool exists """ from SCons.Tool.GettextCommon import _xgettext_exists try: return _xgettext_exists(env) except: return False ############################################################################# # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/mwld.xml0000664000175000017500000000244413160023044021144 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Metrowerks CodeWarrior linker. AR ARCOM LIBDIRPREFIX LIBDIRSUFFIX LIBLINKPREFIX LIBLINKSUFFIX LINK LINKCOM SHLINK SHLINKFLAGS SHLINKCOM scons-src-3.0.0/src/engine/SCons/Tool/yacc.py0000664000175000017500000001100513160023045020742 0ustar bdbaddogbdbaddog"""SCons.Tool.yacc Tool-specific initialization for yacc. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/yacc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import SCons.Defaults import SCons.Tool import SCons.Util YaccAction = SCons.Action.Action("$YACCCOM", "$YACCCOMSTR") def _yaccEmitter(target, source, env, ysuf, hsuf): yaccflags = env.subst("$YACCFLAGS", target=target, source=source) flags = SCons.Util.CLVar(yaccflags) targetBase, targetExt = os.path.splitext(SCons.Util.to_String(target[0])) if '.ym' in ysuf: # If using Objective-C target = [targetBase + ".m"] # the extension is ".m". # If -d is specified on the command line, yacc will emit a .h # or .hpp file with the same name as the .c or .cpp output file. if '-d' in flags: target.append(targetBase + env.subst(hsuf, target=target, source=source)) # If -g is specified on the command line, yacc will emit a .vcg # file with the same base name as the .y, .yacc, .ym or .yy file. if "-g" in flags: base, ext = os.path.splitext(SCons.Util.to_String(source[0])) target.append(base + env.subst("$YACCVCGFILESUFFIX")) # If -v is specified yacc will create the output debug file # which is not really source for any process, but should # be noted and also be cleaned # Bug #2558 if "-v" in flags: env.SideEffect(targetBase+'.output',target[0]) env.Clean(target[0],targetBase+'.output') # With --defines and --graph, the name of the file is totally defined # in the options. fileGenOptions = ["--defines=", "--graph="] for option in flags: for fileGenOption in fileGenOptions: l = len(fileGenOption) if option[:l] == fileGenOption: # A file generating option is present, so add the file # name to the list of targets. fileName = option[l:].strip() target.append(fileName) return (target, source) def yEmitter(target, source, env): return _yaccEmitter(target, source, env, ['.y', '.yacc'], '$YACCHFILESUFFIX') def ymEmitter(target, source, env): return _yaccEmitter(target, source, env, ['.ym'], '$YACCHFILESUFFIX') def yyEmitter(target, source, env): return _yaccEmitter(target, source, env, ['.yy'], '$YACCHXXFILESUFFIX') def generate(env): """Add Builders and construction variables for yacc to an Environment.""" c_file, cxx_file = SCons.Tool.createCFileBuilders(env) # C c_file.add_action('.y', YaccAction) c_file.add_emitter('.y', yEmitter) c_file.add_action('.yacc', YaccAction) c_file.add_emitter('.yacc', yEmitter) # Objective-C c_file.add_action('.ym', YaccAction) c_file.add_emitter('.ym', ymEmitter) # C++ cxx_file.add_action('.yy', YaccAction) cxx_file.add_emitter('.yy', yyEmitter) env['YACC'] = env.Detect('bison') or 'yacc' env['YACCFLAGS'] = SCons.Util.CLVar('') env['YACCCOM'] = '$YACC $YACCFLAGS -o $TARGET $SOURCES' env['YACCHFILESUFFIX'] = '.h' env['YACCHXXFILESUFFIX'] = '.hpp' env['YACCVCGFILESUFFIX'] = '.vcg' def exists(env): return env.Detect(['bison', 'yacc']) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/mwld.py0000664000175000017500000000710313160023044020771 0ustar bdbaddogbdbaddog"""SCons.Tool.mwld Tool-specific initialization for the Metrowerks CodeWarrior linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/mwld.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Tool def generate(env): """Add Builders and construction variables for lib to an Environment.""" SCons.Tool.createStaticLibBuilder(env) SCons.Tool.createSharedLibBuilder(env) SCons.Tool.createProgBuilder(env) env['AR'] = 'mwld' env['ARCOM'] = '$AR $ARFLAGS -library -o $TARGET $SOURCES' env['LIBDIRPREFIX'] = '-L' env['LIBDIRSUFFIX'] = '' env['LIBLINKPREFIX'] = '-l' env['LIBLINKSUFFIX'] = '.lib' env['LINK'] = 'mwld' env['LINKCOM'] = '$LINK $LINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['SHLINK'] = '$LINK' env['SHLINKFLAGS'] = '$LINKFLAGS' env['SHLINKCOM'] = shlib_action env['SHLIBEMITTER']= shlib_emitter env['LDMODULEEMITTER']= shlib_emitter def exists(env): import SCons.Tool.mwcc return SCons.Tool.mwcc.set_vars(env) def shlib_generator(target, source, env, for_signature): cmd = ['$SHLINK', '$SHLINKFLAGS', '-shared'] no_import_lib = env.get('no_import_lib', 0) if no_import_lib: cmd.extend('-noimplib') dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') if dll: cmd.extend(['-o', dll]) implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX') if implib: cmd.extend(['-implib', implib.get_string(for_signature)]) cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS']) return [cmd] def shlib_emitter(target, source, env): dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') no_import_lib = env.get('no_import_lib', 0) if not dll: raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")) if not no_import_lib and \ not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'): # Append an import library to the list of targets. target.append(env.ReplaceIxes(dll, 'SHLIBPREFIX', 'SHLIBSUFFIX', 'LIBPREFIX', 'LIBSUFFIX')) return target, source shlib_action = SCons.Action.Action(shlib_generator, generator=1) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/mslib.xml0000664000175000017500000000224613160023044021307 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Microsoft mslib library archiver. AR ARFLAGS ARCOM LIBPREFIX LIBSUFFIX ARCOMSTR scons-src-3.0.0/src/engine/SCons/Tool/swig.py0000664000175000017500000001655713160023045021015 0ustar bdbaddogbdbaddog"""SCons.Tool.swig Tool-specific initialization for swig. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ from __future__ import print_function # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/swig.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import re import subprocess import SCons.Action import SCons.Defaults import SCons.Tool import SCons.Util import SCons.Node verbose = False swigs = [ 'swig', 'swig3.0', 'swig2.0' ] SwigAction = SCons.Action.Action('$SWIGCOM', '$SWIGCOMSTR') def swigSuffixEmitter(env, source): if '-c++' in SCons.Util.CLVar(env.subst("$SWIGFLAGS", source=source)): return '$SWIGCXXFILESUFFIX' else: return '$SWIGCFILESUFFIX' # Match '%module test', as well as '%module(directors="1") test' # Also allow for test to be quoted (SWIG permits double quotes, but not single) # Also allow for the line to have spaces after test if not quoted _reModule = re.compile(r'%module(\s*\(.*\))?\s+("?)(\S+)\2') def _find_modules(src): """Find all modules referenced by %module lines in `src`, a SWIG .i file. Returns a list of all modules, and a flag set if SWIG directors have been requested (SWIG will generate an additional header file in this case.)""" directors = 0 mnames = [] try: matches = _reModule.findall(open(src).read()) except IOError: # If the file's not yet generated, guess the module name from the file stem matches = [] mnames.append(os.path.splitext(os.path.basename(src))[0]) for m in matches: mnames.append(m[2]) directors = directors or m[0].find('directors') >= 0 return mnames, directors def _add_director_header_targets(target, env): # Directors only work with C++ code, not C suffix = env.subst(env['SWIGCXXFILESUFFIX']) # For each file ending in SWIGCXXFILESUFFIX, add a new target director # header by replacing the ending with SWIGDIRECTORSUFFIX. for x in target[:]: n = x.name d = x.dir if n[-len(suffix):] == suffix: target.append(d.File(n[:-len(suffix)] + env['SWIGDIRECTORSUFFIX'])) def _swigEmitter(target, source, env): swigflags = env.subst("$SWIGFLAGS", target=target, source=source) flags = SCons.Util.CLVar(swigflags) for src in source: src = str(src.rfile()) mnames = None if "-python" in flags and "-noproxy" not in flags: if mnames is None: mnames, directors = _find_modules(src) if directors: _add_director_header_targets(target, env) python_files = [m + ".py" for m in mnames] outdir = env.subst('$SWIGOUTDIR', target=target, source=source) # .py files should be generated in SWIGOUTDIR if specified, # otherwise in the same directory as the target if outdir: python_files = [env.fs.File(os.path.join(outdir, j)) for j in python_files] else: python_files = [target[0].dir.File(m) for m in python_files] target.extend(python_files) if "-java" in flags: if mnames is None: mnames, directors = _find_modules(src) if directors: _add_director_header_targets(target, env) java_files = [[m + ".java", m + "JNI.java"] for m in mnames] java_files = SCons.Util.flatten(java_files) outdir = env.subst('$SWIGOUTDIR', target=target, source=source) if outdir: java_files = [os.path.join(outdir, j) for j in java_files] java_files = list(map(env.fs.File, java_files)) def t_from_s(t, p, s, x): return t.dir tsm = SCons.Node._target_from_source_map tkey = len(tsm) tsm[tkey] = t_from_s for jf in java_files: jf._func_target_from_source = tkey target.extend(java_files) return (target, source) def _get_swig_version(env, swig): """Run the SWIG command line tool to get and return the version number""" swig = env.subst(swig) pipe = SCons.Action._subproc(env, SCons.Util.CLVar(swig) + ['-version'], stdin = 'devnull', stderr = 'devnull', stdout = subprocess.PIPE) if pipe.wait() != 0: return # MAYBE: out = SCons.Util.to_str (pipe.stdout.read()) out = SCons.Util.to_str(pipe.stdout.read()) match = re.search('SWIG Version\s+(\S+).*', out, re.MULTILINE) if match: if verbose: print("Version is:%s"%match.group(1)) return match.group(1) else: if verbose: print("Unable to detect version: [%s]"%out) def generate(env): """Add Builders and construction variables for swig to an Environment.""" c_file, cxx_file = SCons.Tool.createCFileBuilders(env) c_file.suffix['.i'] = swigSuffixEmitter cxx_file.suffix['.i'] = swigSuffixEmitter c_file.add_action('.i', SwigAction) c_file.add_emitter('.i', _swigEmitter) cxx_file.add_action('.i', SwigAction) cxx_file.add_emitter('.i', _swigEmitter) java_file = SCons.Tool.CreateJavaFileBuilder(env) java_file.suffix['.i'] = swigSuffixEmitter java_file.add_action('.i', SwigAction) java_file.add_emitter('.i', _swigEmitter) if 'SWIG' not in env: env['SWIG'] = env.Detect(swigs) or swigs[0] env['SWIGVERSION'] = _get_swig_version(env, env['SWIG']) env['SWIGFLAGS'] = SCons.Util.CLVar('') env['SWIGDIRECTORSUFFIX'] = '_wrap.h' env['SWIGCFILESUFFIX'] = '_wrap$CFILESUFFIX' env['SWIGCXXFILESUFFIX'] = '_wrap$CXXFILESUFFIX' env['_SWIGOUTDIR'] = r'${"-outdir \"%s\"" % SWIGOUTDIR}' env['SWIGPATH'] = [] env['SWIGINCPREFIX'] = '-I' env['SWIGINCSUFFIX'] = '' env['_SWIGINCFLAGS'] = '$( ${_concat(SWIGINCPREFIX, SWIGPATH, SWIGINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' env['SWIGCOM'] = '$SWIG -o $TARGET ${_SWIGOUTDIR} ${_SWIGINCFLAGS} $SWIGFLAGS $SOURCES' def exists(env): swig = env.get('SWIG') or env.Detect(['swig']) return swig # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/sunar.xml0000664000175000017500000000217713160023044021334 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the Sun library archiver. AR ARFLAGS ARCOM LIBPREFIX LIBSUFFIX ARCOMSTR scons-src-3.0.0/src/engine/SCons/Tool/sgic++.xml0000664000175000017500000000217713160023044021257 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the SGI C++ compiler. CXX CXXFLAGS SHCXX SHOBJSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/msgfmt.py0000664000175000017500000001047513160023044021331 0ustar bdbaddogbdbaddog""" msgfmt tool """ # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Tool/msgfmt.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from SCons.Builder import BuilderBase ############################################################################# class _MOFileBuilder(BuilderBase): """ The builder class for `MO` files. The reason for this builder to exists and its purpose is quite simillar as for `_POFileBuilder`. This time, we extend list of sources, not targets, and call `BuilderBase._execute()` only once (as we assume single-target here). """ def _execute(self, env, target, source, *args, **kw): # Here we add support for 'LINGUAS_FILE' keyword. Emitter is not suitable # in this case, as it is called too late (after multiple sources # are handled single_source builder. import SCons.Util from SCons.Tool.GettextCommon import _read_linguas_from_files linguas_files = None if 'LINGUAS_FILE' in env and env['LINGUAS_FILE'] is not None: linguas_files = env['LINGUAS_FILE'] # This should prevent from endless recursion. env['LINGUAS_FILE'] = None # We read only languages. Suffixes shall be added automatically. linguas = _read_linguas_from_files(env, linguas_files) if SCons.Util.is_List(source): source.extend(linguas) elif source is not None: source = [source] + linguas else: source = linguas result = BuilderBase._execute(self,env,target,source,*args, **kw) if linguas_files is not None: env['LINGUAS_FILE'] = linguas_files return result ############################################################################# ############################################################################# def _create_mo_file_builder(env, **kw): """ Create builder object for `MOFiles` builder """ import SCons.Action # FIXME: What factory use for source? Ours or their? kw['action'] = SCons.Action.Action('$MSGFMTCOM','$MSGFMTCOMSTR') kw['suffix'] = '$MOSUFFIX' kw['src_suffix'] = '$POSUFFIX' kw['src_builder'] = '_POUpdateBuilder' kw['single_source'] = True return _MOFileBuilder(**kw) ############################################################################# ############################################################################# def generate(env,**kw): """ Generate `msgfmt` tool """ import SCons.Util from SCons.Tool.GettextCommon import _detect_msgfmt try: env['MSGFMT'] = _detect_msgfmt(env) except: env['MSGFMT'] = 'msgfmt' env.SetDefault( MSGFMTFLAGS = [ SCons.Util.CLVar('-c') ], MSGFMTCOM = '$MSGFMT $MSGFMTFLAGS -o $TARGET $SOURCE', MSGFMTCOMSTR = '', MOSUFFIX = ['.mo'], POSUFFIX = ['.po'] ) env.Append( BUILDERS = { 'MOFiles' : _create_mo_file_builder(env) } ) ############################################################################# ############################################################################# def exists(env): """ Check if the tool exists """ from SCons.Tool.GettextCommon import _msgfmt_exists try: return _msgfmt_exists(env) except: return False ############################################################################# # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/linkloc.py0000664000175000017500000000767513160023044021477 0ustar bdbaddogbdbaddog"""SCons.Tool.linkloc Tool specification for the LinkLoc linker for the Phar Lap ETS embedded operating system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/linkloc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os.path import re import SCons.Action import SCons.Defaults import SCons.Errors import SCons.Tool import SCons.Util from SCons.Tool.MSCommon import msvs_exists, merge_default_version from SCons.Tool.PharLapCommon import addPharLapPaths _re_linker_command = re.compile(r'(\s)@\s*([^\s]+)') def repl_linker_command(m): # Replaces any linker command file directives (e.g. "@foo.lnk") with # the actual contents of the file. try: with open(m.group(2), "r") as f: return m.group(1) + f.read() except IOError: # the linker should return an error if it can't # find the linker command file so we will remain quiet. # However, we will replace the @ with a # so we will not continue # to find it with recursive substitution return m.group(1) + '#' + m.group(2) class LinklocGenerator(object): def __init__(self, cmdline): self.cmdline = cmdline def __call__(self, env, target, source, for_signature): if for_signature: # Expand the contents of any linker command files recursively subs = 1 strsub = env.subst(self.cmdline, target=target, source=source) while subs: strsub, subs = _re_linker_command.subn(repl_linker_command, strsub) return strsub else: return "${TEMPFILE('" + self.cmdline + "')}" def generate(env): """Add Builders and construction variables for ar to an Environment.""" SCons.Tool.createSharedLibBuilder(env) SCons.Tool.createProgBuilder(env) env['SUBST_CMD_FILE'] = LinklocGenerator env['SHLINK'] = '$LINK' env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS') env['SHLINKCOM'] = '${SUBST_CMD_FILE("$SHLINK $SHLINKFLAGS $_LIBDIRFLAGS $_LIBFLAGS -dll $TARGET $SOURCES")}' env['SHLIBEMITTER']= None env['LDMODULEEMITTER']= None env['LINK'] = "linkloc" env['LINKFLAGS'] = SCons.Util.CLVar('') env['LINKCOM'] = '${SUBST_CMD_FILE("$LINK $LINKFLAGS $_LIBDIRFLAGS $_LIBFLAGS -exe $TARGET $SOURCES")}' env['LIBDIRPREFIX']='-libpath ' env['LIBDIRSUFFIX']='' env['LIBLINKPREFIX']='-lib ' env['LIBLINKSUFFIX']='$LIBSUFFIX' # Set-up ms tools paths for default version merge_default_version(env) addPharLapPaths(env) def exists(env): if msvs_exists(): return env.Detect('linkloc') else: return 0 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Tool/pdftex.xml0000664000175000017500000000355113160023044021473 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the &pdftex; utility. PDFTEX PDFTEXFLAGS PDFTEXCOM PDFLATEX PDFLATEXFLAGS PDFLATEXCOM LATEXRETRIES PDFTEXCOMSTR PDFLATEXCOMSTR The &pdftex; utility. The command line used to call the &pdftex; utility. The string displayed when calling the &pdftex; utility. If this is not set, then &cv-link-PDFTEXCOM; (the command line) is displayed. env = Environment(PDFTEXCOMSTR = "Building $TARGET from TeX input $SOURCES") General options passed to the &pdftex; utility. scons-src-3.0.0/src/engine/SCons/Tool/msgfmt.xml0000664000175000017500000000775213160023044021505 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> This scons tool is a part of scons &t-link-gettext; toolset. It provides scons interface to msgfmt(1) command, which generates binary message catalog (MO) from a textual translation description (PO). MOSUFFIX MSGFMT MSGFMTCOM MSGFMTCOMSTR MSGFMTFLAGS POSUFFIX LINGUAS_FILE This builder belongs to &t-link-msgfmt; tool. The builder compiles PO files to MO files. Example 1. Create pl.mo and en.mo by compiling pl.po and en.po: # ... env.MOFiles(['pl', 'en']) Example 2. Compile files for languages defined in LINGUAS file: # ... env.MOFiles(LINGUAS_FILE = 1) Example 3. Create pl.mo and en.mo by compiling pl.po and en.po plus files for languages defined in LINGUAS file: # ... env.MOFiles(['pl', 'en'], LINGUAS_FILE = 1) Example 4. Compile files for languages defined in LINGUAS file (another version): # ... env['LINGUAS_FILE'] = 1 env.MOFiles() Suffix used for MO files (default: '.mo'). See &t-link-msgfmt; tool and &b-link-MOFiles; builder. Absolute path to msgfmt(1) binary, found by Detect(). See &t-link-msgfmt; tool and &b-link-MOFiles; builder. Complete command line to run msgfmt(1) program. See &t-link-msgfmt; tool and &b-link-MOFiles; builder. String to display when msgfmt(1) is invoked (default: '', which means ``print &cv-link-MSGFMTCOM;''). See &t-link-msgfmt; tool and &b-link-MOFiles; builder. Additional flags to msgfmt(1). See &t-link-msgfmt; tool and &b-link-MOFiles; builder. scons-src-3.0.0/src/engine/SCons/Tool/ilink.xml0000664000175000017500000000231613160023044021305 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Sets construction variables for the ilink linker on OS/2 systems. LINK LINKFLAGS LINKCOM LIBDIRPREFIX LIBDIRSUFFIX LIBLINKPREFIX LIBLINKSUFFIX scons-src-3.0.0/src/engine/SCons/Tool/suncc.py0000664000175000017500000000365413160023044021150 0ustar bdbaddogbdbaddog"""SCons.Tool.suncc Tool-specific initialization for Sun Solaris (Forte) CC and cc. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/suncc.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.Util from . import cc def generate(env): """ Add Builders and construction variables for Forte C and C++ compilers to an Environment. """ cc.generate(env) env['CXX'] = 'CC' env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -KPIC') env['SHOBJPREFIX'] = 'so_' env['SHOBJSUFFIX'] = '.o' def exists(env): return env.Detect('CC') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/SConsign.py0000664000175000017500000003261213160023041020634 0ustar bdbaddogbdbaddog"""SCons.SConsign Writing and reading information to the .sconsign file or files. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/SConsign.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import os import pickle import SCons.dblite import SCons.Warnings from SCons.compat import PICKLE_PROTOCOL def corrupt_dblite_warning(filename): SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning, "Ignoring corrupt .sconsign file: %s"%filename) SCons.dblite.ignore_corrupt_dbfiles = 1 SCons.dblite.corruption_warning = corrupt_dblite_warning # XXX Get rid of the global array so this becomes re-entrant. sig_files = [] # Info for the database SConsign implementation (now the default): # "DataBase" is a dictionary that maps top-level SConstruct directories # to open database handles. # "DB_Module" is the Python database module to create the handles. # "DB_Name" is the base name of the database file (minus any # extension the underlying DB module will add). DataBase = {} DB_Module = SCons.dblite DB_Name = ".sconsign" DB_sync_list = [] def Get_DataBase(dir): global DataBase, DB_Module, DB_Name top = dir.fs.Top if not os.path.isabs(DB_Name) and top.repositories: mode = "c" for d in [top] + top.repositories: if dir.is_under(d): try: return DataBase[d], mode except KeyError: path = d.entry_abspath(DB_Name) try: db = DataBase[d] = DB_Module.open(path, mode) except (IOError, OSError): pass else: if mode != "r": DB_sync_list.append(db) return db, mode mode = "r" try: return DataBase[top], "c" except KeyError: db = DataBase[top] = DB_Module.open(DB_Name, "c") DB_sync_list.append(db) return db, "c" except TypeError: print("DataBase =", DataBase) raise def Reset(): """Reset global state. Used by unit tests that end up using SConsign multiple times to get a clean slate for each test.""" global sig_files, DB_sync_list sig_files = [] DB_sync_list = [] normcase = os.path.normcase def write(): global sig_files for sig_file in sig_files: sig_file.write(sync=0) for db in DB_sync_list: try: syncmethod = db.sync except AttributeError: pass # Not all dbm modules have sync() methods. else: syncmethod() try: closemethod = db.close except AttributeError: pass # Not all dbm modules have close() methods. else: closemethod() class SConsignEntry(object): """ Wrapper class for the generic entry in a .sconsign file. The Node subclass populates it with attributes as it pleases. XXX As coded below, we do expect a '.binfo' attribute to be added, but we'll probably generalize this in the next refactorings. """ __slots__ = ("binfo", "ninfo", "__weakref__") current_version_id = 2 def __init__(self): # Create an object attribute from the class attribute so it ends up # in the pickled data in the .sconsign file. #_version_id = self.current_version_id pass def convert_to_sconsign(self): self.binfo.convert_to_sconsign() def convert_from_sconsign(self, dir, name): self.binfo.convert_from_sconsign(dir, name) def __getstate__(self): state = getattr(self, '__dict__', {}).copy() for obj in type(self).mro(): for name in getattr(obj,'__slots__',()): if hasattr(self, name): state[name] = getattr(self, name) state['_version_id'] = self.current_version_id try: del state['__weakref__'] except KeyError: pass return state def __setstate__(self, state): for key, value in state.items(): if key not in ('_version_id','__weakref__'): setattr(self, key, value) class Base(object): """ This is the controlling class for the signatures for the collection of entries associated with a specific directory. The actual directory association will be maintained by a subclass that is specific to the underlying storage method. This class provides a common set of methods for fetching and storing the individual bits of information that make up signature entry. """ def __init__(self): self.entries = {} self.dirty = False self.to_be_merged = {} def get_entry(self, filename): """ Fetch the specified entry attribute. """ return self.entries[filename] def set_entry(self, filename, obj): """ Set the entry. """ self.entries[filename] = obj self.dirty = True def do_not_set_entry(self, filename, obj): pass def store_info(self, filename, node): entry = node.get_stored_info() entry.binfo.merge(node.get_binfo()) self.to_be_merged[filename] = node self.dirty = True def do_not_store_info(self, filename, node): pass def merge(self): for key, node in self.to_be_merged.items(): entry = node.get_stored_info() try: ninfo = entry.ninfo except AttributeError: # This happens with SConf Nodes, because the configuration # subsystem takes direct control over how the build decision # is made and its information stored. pass else: ninfo.merge(node.get_ninfo()) self.entries[key] = entry self.to_be_merged = {} class DB(Base): """ A Base subclass that reads and writes signature information from a global .sconsign.db* file--the actual file suffix is determined by the database module. """ def __init__(self, dir): Base.__init__(self) self.dir = dir db, mode = Get_DataBase(dir) # Read using the path relative to the top of the Repository # (self.dir.tpath) from which we're fetching the signature # information. path = normcase(dir.get_tpath()) try: rawentries = db[path] except KeyError: pass else: try: self.entries = pickle.loads(rawentries) if not isinstance(self.entries, dict): self.entries = {} raise TypeError except KeyboardInterrupt: raise except Exception as e: SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning, "Ignoring corrupt sconsign entry : %s (%s)\n"%(self.dir.get_tpath(), e)) for key, entry in self.entries.items(): entry.convert_from_sconsign(dir, key) if mode == "r": # This directory is actually under a repository, which means # likely they're reaching in directly for a dependency on # a file there. Don't actually set any entry info, so we # won't try to write to that .sconsign.dblite file. self.set_entry = self.do_not_set_entry self.store_info = self.do_not_store_info global sig_files sig_files.append(self) def write(self, sync=1): if not self.dirty: return self.merge() db, mode = Get_DataBase(self.dir) # Write using the path relative to the top of the SConstruct # directory (self.dir.path), not relative to the top of # the Repository; we only write to our own .sconsign file, # not to .sconsign files in Repositories. path = normcase(self.dir.get_internal_path()) for key, entry in self.entries.items(): entry.convert_to_sconsign() db[path] = pickle.dumps(self.entries, PICKLE_PROTOCOL) if sync: try: syncmethod = db.sync except AttributeError: # Not all anydbm modules have sync() methods. pass else: syncmethod() class Dir(Base): def __init__(self, fp=None, dir=None): """ fp - file pointer to read entries from """ Base.__init__(self) if not fp: return self.entries = pickle.load(fp) if not isinstance(self.entries, dict): self.entries = {} raise TypeError if dir: for key, entry in self.entries.items(): entry.convert_from_sconsign(dir, key) class DirFile(Dir): """ Encapsulates reading and writing a per-directory .sconsign file. """ def __init__(self, dir): """ dir - the directory for the file """ self.dir = dir self.sconsign = os.path.join(dir.get_internal_path(), '.sconsign') try: fp = open(self.sconsign, 'rb') except IOError: fp = None try: Dir.__init__(self, fp, dir) except KeyboardInterrupt: raise except: SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning, "Ignoring corrupt .sconsign file: %s"%self.sconsign) global sig_files sig_files.append(self) def write(self, sync=1): """ Write the .sconsign file to disk. Try to write to a temporary file first, and rename it if we succeed. If we can't write to the temporary file, it's probably because the directory isn't writable (and if so, how did we build anything in this directory, anyway?), so try to write directly to the .sconsign file as a backup. If we can't rename, try to copy the temporary contents back to the .sconsign file. Either way, always try to remove the temporary file at the end. """ if not self.dirty: return self.merge() temp = os.path.join(self.dir.get_internal_path(), '.scons%d' % os.getpid()) try: file = open(temp, 'wb') fname = temp except IOError: try: file = open(self.sconsign, 'wb') fname = self.sconsign except IOError: return for key, entry in self.entries.items(): entry.convert_to_sconsign() pickle.dump(self.entries, file, PICKLE_PROTOCOL) file.close() if fname != self.sconsign: try: mode = os.stat(self.sconsign)[0] os.chmod(self.sconsign, 0o666) os.unlink(self.sconsign) except (IOError, OSError): # Try to carry on in the face of either OSError # (things like permission issues) or IOError (disk # or network issues). If there's a really dangerous # issue, it should get re-raised by the calls below. pass try: os.rename(fname, self.sconsign) except OSError: # An OSError failure to rename may indicate something # like the directory has no write permission, but # the .sconsign file itself might still be writable, # so try writing on top of it directly. An IOError # here, or in any of the following calls, would get # raised, indicating something like a potentially # serious disk or network issue. open(self.sconsign, 'wb').write(open(fname, 'rb').read()) os.chmod(self.sconsign, mode) try: os.unlink(temp) except (IOError, OSError): pass ForDirectory = DB def File(name, dbm_module=None): """ Arrange for all signatures to be stored in a global .sconsign.db* file. """ global ForDirectory, DB_Name, DB_Module if name is None: ForDirectory = DirFile DB_Module = None else: ForDirectory = DB DB_Name = name if not dbm_module is None: DB_Module = dbm_module # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/compat/0000775000175000017500000000000013160023045020022 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/compat/_scons_dbm.py0000664000175000017500000000335413160023045022507 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __doc__ = """ dbm compatibility module for Python versions that don't have dbm. This does not not NOT (repeat, *NOT*) provide complete dbm functionality. It's just a stub on which to hang just enough pieces of dbm functionality that the whichdb.whichdb() implementstation in the various 2.X versions of Python won't blow up even if dbm wasn't compiled in. """ __revision__ = "src/engine/SCons/compat/_scons_dbm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" class error(Exception): pass def open(*args, **kw): raise error() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/compat/__init__.py0000664000175000017500000001601213160023045022133 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __doc__ = """ SCons compatibility package for old Python versions This subpackage holds modules that provide backwards-compatible implementations of various things that we'd like to use in SCons but which only show up in later versions of Python than the early, old version(s) we still support. Other code will not generally reference things in this package through the SCons.compat namespace. The modules included here add things to the builtins namespace or the global module list so that the rest of our code can use the objects and names imported here regardless of Python version. The rest of the things here will be in individual compatibility modules that are either: 1) suitably modified copies of the future modules that we want to use; or 2) backwards compatible re-implementations of the specific portions of a future module's API that we want to use. GENERAL WARNINGS: Implementations of functions in the SCons.compat modules are *NOT* guaranteed to be fully compliant with these functions in later versions of Python. We are only concerned with adding functionality that we actually use in SCons, so be wary if you lift this code for other uses. (That said, making these more nearly the same as later, official versions is still a desirable goal, we just don't need to be obsessive about it.) We name the compatibility modules with an initial '_scons_' (for example, _scons_subprocess.py is our compatibility module for subprocess) so that we can still try to import the real module name and fall back to our compatibility module if we get an ImportError. The import_as() function defined below loads the module as the "real" name (without the '_scons'), after which all of the "import {module}" statements in the rest of our code will find our pre-loaded compatibility module. """ __revision__ = "src/engine/SCons/compat/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import sys import imp # Use the "imp" module to protect imports from fixers. PYPY = hasattr(sys, 'pypy_translation_info') def import_as(module, name): """ Imports the specified module (from our local directory) as the specified name, returning the loaded module object. """ dir = os.path.split(__file__)[0] return imp.load_module(name, *imp.find_module(module, [dir])) def rename_module(new, old): """ Attempts to import the old module and load it under the new name. Used for purely cosmetic name changes in Python 3.x. """ try: sys.modules[new] = imp.load_module(old, *imp.find_module(old)) return True except ImportError: return False # TODO: FIXME # In 3.x, 'pickle' automatically loads the fast version if available. rename_module('pickle', 'cPickle') # Default pickle protocol. Higher protocols are more efficient/featureful # but incompatible with older Python versions. On Python 2.7 this is 2. # Negative numbers choose the highest available protocol. import pickle # Was pickle.HIGHEST_PROTOCOL # Changed to 2 so py3.5+'s pickle will be compatible with py2.7. PICKLE_PROTOCOL = 2 # TODO: FIXME # In 3.x, 'profile' automatically loads the fast version if available. rename_module('profile', 'cProfile') # TODO: FIXME # Before Python 3.0, the 'queue' module was named 'Queue'. rename_module('queue', 'Queue') # TODO: FIXME # Before Python 3.0, the 'winreg' module was named '_winreg' rename_module('winreg', '_winreg') # Python 3 moved builtin intern() to sys package # To make porting easier, make intern always live # in sys package (for python 2.7.x) try: sys.intern except AttributeError: # We must be using python 2.7.x so monkey patch # intern into the sys package sys.intern = intern # Preparing for 3.x. UserDict, UserList, UserString are in # collections for 3.x, but standalone in 2.7.x import collections try: collections.UserDict except AttributeError: exec ('from UserDict import UserDict as _UserDict') collections.UserDict = _UserDict del _UserDict try: collections.UserList except AttributeError: exec ('from UserList import UserList as _UserList') collections.UserList = _UserList del _UserList try: collections.UserString except AttributeError: exec ('from UserString import UserString as _UserString') collections.UserString = _UserString del _UserString import shutil try: shutil.SameFileError except AttributeError: class SameFileError(Exception): pass shutil.SameFileError = SameFileError def with_metaclass(meta, *bases): """ Function from jinja2/_compat.py. License: BSD. Use it like this:: class BaseForm(object): pass class FormType(type): pass class Form(with_metaclass(FormType, BaseForm)): pass This requires a bit of explanation: the basic idea is to make a dummy metaclass for one level of class instantiation that replaces itself with the actual metaclass. Because of internal type checks we also need to make sure that we downgrade the custom metaclass for one level to something closer to type (that's why __call__ and __init__ comes back from type etc.). This has the advantage over six.with_metaclass of not introducing dummy classes into the final MRO. """ class metaclass(meta): __call__ = type.__call__ __init__ = type.__init__ def __new__(cls, name, this_bases, d): if this_bases is None: return type.__new__(cls, name, (), d) return meta(name, bases, d) return metaclass('temporary_class', None, {}) class NoSlotsPyPy(type): """ Workaround for PyPy not working well with __slots__ and __class__ assignment. """ def __new__(meta, name, bases, dct): if PYPY and '__slots__' in dct: dct.pop('__slots__') return super(NoSlotsPyPy, meta).__new__(meta, name, bases, dct) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/EnvironmentTests.py0000664000175000017500000043612313160023041022445 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/EnvironmentTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import copy import io import os import sys import unittest from collections import UserDict as UD, UserList as UL import TestCmd import TestUnit from SCons.Environment import * import SCons.Warnings def diff_env(env1, env2): s1 = "env1 = {\n" s2 = "env2 = {\n" d = {} for k in list(env1._dict.keys()) + list(env2._dict.keys()): d[k] = None for k in sorted(d.keys()): if k in env1: if k in env2: if env1[k] != env2[k]: s1 = s1 + " " + repr(k) + " : " + repr(env1[k]) + "\n" s2 = s2 + " " + repr(k) + " : " + repr(env2[k]) + "\n" else: s1 = s1 + " " + repr(k) + " : " + repr(env1[k]) + "\n" elif k in env2: s2 = s2 + " " + repr(k) + " : " + repr(env2[k]) + "\n" s1 = s1 + "}\n" s2 = s2 + "}\n" return s1 + s2 def diff_dict(d1, d2): s1 = "d1 = {\n" s2 = "d2 = {\n" d = {} for k in list(d1.keys()) + list(d2.keys()): d[k] = None for k in sorted(d.keys()): if k in d1: if k in d2: if d1[k] != d2[k]: s1 = s1 + " " + repr(k) + " : " + repr(d1[k]) + "\n" s2 = s2 + " " + repr(k) + " : " + repr(d2[k]) + "\n" else: s1 = s1 + " " + repr(k) + " : " + repr(d1[k]) + "\n" elif k in env2: s2 = s2 + " " + repr(k) + " : " + repr(d2[k]) + "\n" s1 = s1 + "}\n" s2 = s2 + "}\n" return s1 + s2 called_it = {} built_it = {} class Builder(SCons.Builder.BuilderBase): """A dummy Builder class for testing purposes. "Building" a target is simply setting a value in the dictionary. """ def __init__(self, name = None): self.name = name def __call__(self, env, target=None, source=None, **kw): global called_it called_it['target'] = target called_it['source'] = source called_it.update(kw) def execute(self, target = None, **kw): global built_it built_it[target] = 1 scanned_it = {} class Scanner(object): """A dummy Scanner class for testing purposes. "Scanning" a target is simply setting a value in the dictionary. """ def __init__(self, name, skeys=[]): self.name = name self.skeys = skeys def __call__(self, filename): global scanned_it scanned_it[filename] = 1 def __eq__(self, other): try: return self.__dict__ == other.__dict__ except AttributeError: return False def get_skeys(self, env): return self.skeys def __str__(self): return self.name class CLVar(UL): def __init__(self, seq): if isinstance(seq, str): seq = seq.split() UL.__init__(self, seq) def __add__(self, other): return UL.__add__(self, CLVar(other)) def __radd__(self, other): return UL.__radd__(self, CLVar(other)) def __coerce__(self, other): return (self, CLVar(other)) class DummyNode(object): def __init__(self, name): self.name = name def __str__(self): return self.name def rfile(self): return self def get_subst_proxy(self): return self def test_tool( env ): env['_F77INCFLAGS'] = '$( ${_concat(INCPREFIX, F77PATH, INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' class TestEnvironmentFixture(object): def TestEnvironment(self, *args, **kw): if not kw or 'tools' not in kw: kw['tools'] = [test_tool] default_keys = { 'CC' : 'cc', 'CCFLAGS' : '-DNDEBUG', 'ENV' : { 'TMP' : '/tmp' } } for key, value in default_keys.items(): if key not in kw: kw[key] = value if 'BUILDERS' not in kw: static_obj = SCons.Builder.Builder(action = {}, emitter = {}, suffix = '.o', single_source = 1) kw['BUILDERS'] = {'Object' : static_obj} static_obj.add_action('.cpp', 'fake action') env = Environment(*args, **kw) return env class SubstitutionTestCase(unittest.TestCase): def test___init__(self): """Test initializing a SubstitutionEnvironment """ env = SubstitutionEnvironment() assert '__env__' not in env def test___cmp__(self): """Test comparing SubstitutionEnvironments """ env1 = SubstitutionEnvironment(XXX = 'x') env2 = SubstitutionEnvironment(XXX = 'x') env3 = SubstitutionEnvironment(XXX = 'xxx') env4 = SubstitutionEnvironment(XXX = 'x', YYY = 'x') assert env1 == env2 assert env1 != env3 assert env1 != env4 def test___delitem__(self): """Test deleting a variable from a SubstitutionEnvironment """ env1 = SubstitutionEnvironment(XXX = 'x', YYY = 'y') env2 = SubstitutionEnvironment(XXX = 'x') del env1['YYY'] assert env1 == env2 def test___getitem__(self): """Test fetching a variable from a SubstitutionEnvironment """ env = SubstitutionEnvironment(XXX = 'x') assert env['XXX'] == 'x', env['XXX'] def test___setitem__(self): """Test setting a variable in a SubstitutionEnvironment """ env1 = SubstitutionEnvironment(XXX = 'x') env2 = SubstitutionEnvironment(XXX = 'x', YYY = 'y') env1['YYY'] = 'y' assert env1 == env2 def test_get(self): """Test the SubstitutionEnvironment get() method """ env = SubstitutionEnvironment(XXX = 'x') assert env.get('XXX') == 'x', env.get('XXX') assert env.get('YYY') is None, env.get('YYY') def test_has_key(self): """Test the SubstitutionEnvironment has_key() method """ env = SubstitutionEnvironment(XXX = 'x') assert 'XXX' in env assert 'YYY' not in env def test_contains(self): """Test the SubstitutionEnvironment __contains__() method """ env = SubstitutionEnvironment(XXX = 'x') assert 'XXX' in env assert not 'YYY' in env def test_items(self): """Test the SubstitutionEnvironment items() method """ env = SubstitutionEnvironment(XXX = 'x', YYY = 'y') items = list(env.items()) assert len(items) == 2 and ('XXX','x') in items and ('YYY','y') in items, items # Was. This fails under py3 as order changes # assert items == [('XXX','x'), ('YYY','y')], items def test_arg2nodes(self): """Test the arg2nodes method """ env = SubstitutionEnvironment() dict = {} class X(SCons.Node.Node): pass def Factory(name, directory = None, create = 1, dict=dict, X=X): if name not in dict: dict[name] = X() dict[name].name = name return dict[name] nodes = env.arg2nodes("Util.py UtilTests.py", Factory) assert len(nodes) == 1, nodes assert isinstance(nodes[0], X) assert nodes[0].name == "Util.py UtilTests.py" nodes = env.arg2nodes(u"Util.py UtilTests.py", Factory) assert len(nodes) == 1, nodes assert isinstance(nodes[0], X) assert nodes[0].name == u"Util.py UtilTests.py" nodes = env.arg2nodes(["Util.py", "UtilTests.py"], Factory) assert len(nodes) == 2, nodes assert isinstance(nodes[0], X) assert isinstance(nodes[1], X) assert nodes[0].name == "Util.py" assert nodes[1].name == "UtilTests.py" n1 = Factory("Util.py") nodes = env.arg2nodes([n1, "UtilTests.py"], Factory) assert len(nodes) == 2, nodes assert isinstance(nodes[0], X) assert isinstance(nodes[1], X) assert nodes[0].name == "Util.py" assert nodes[1].name == "UtilTests.py" class SConsNode(SCons.Node.Node): pass nodes = env.arg2nodes(SConsNode()) assert len(nodes) == 1, nodes assert isinstance(nodes[0], SConsNode), node class OtherNode(object): pass nodes = env.arg2nodes(OtherNode()) assert len(nodes) == 1, nodes assert isinstance(nodes[0], OtherNode), node def lookup_a(str, F=Factory): if str[0] == 'a': n = F(str) n.a = 1 return n else: return None def lookup_b(str, F=Factory): if str[0] == 'b': n = F(str) n.b = 1 return n else: return None env_ll = SubstitutionEnvironment() env_ll.lookup_list = [lookup_a, lookup_b] nodes = env_ll.arg2nodes(['aaa', 'bbb', 'ccc'], Factory) assert len(nodes) == 3, nodes assert nodes[0].name == 'aaa', nodes[0] assert nodes[0].a == 1, nodes[0] assert not hasattr(nodes[0], 'b'), nodes[0] assert nodes[1].name == 'bbb' assert not hasattr(nodes[1], 'a'), nodes[1] assert nodes[1].b == 1, nodes[1] assert nodes[2].name == 'ccc' assert not hasattr(nodes[2], 'a'), nodes[1] assert not hasattr(nodes[2], 'b'), nodes[1] def lookup_bbbb(str, F=Factory): if str == 'bbbb': n = F(str) n.bbbb = 1 return n else: return None def lookup_c(str, F=Factory): if str[0] == 'c': n = F(str) n.c = 1 return n else: return None nodes = env.arg2nodes(['bbbb', 'ccc'], Factory, [lookup_c, lookup_bbbb, lookup_b]) assert len(nodes) == 2, nodes assert nodes[0].name == 'bbbb' assert not hasattr(nodes[0], 'a'), nodes[1] assert not hasattr(nodes[0], 'b'), nodes[1] assert nodes[0].bbbb == 1, nodes[1] assert not hasattr(nodes[0], 'c'), nodes[0] assert nodes[1].name == 'ccc' assert not hasattr(nodes[1], 'a'), nodes[1] assert not hasattr(nodes[1], 'b'), nodes[1] assert not hasattr(nodes[1], 'bbbb'), nodes[0] assert nodes[1].c == 1, nodes[1] def test_arg2nodes_target_source(self): """Test the arg2nodes method with target= and source= keywords """ targets = [DummyNode('t1'), DummyNode('t2')] sources = [DummyNode('s1'), DummyNode('s2')] env = SubstitutionEnvironment() nodes = env.arg2nodes(['${TARGET}-a', '${SOURCE}-b', '${TARGETS[1]}-c', '${SOURCES[1]}-d'], DummyNode, target=targets, source=sources) names = [n.name for n in nodes] assert names == ['t1-a', 's1-b', 't2-c', 's2-d'], names def test_gvars(self): """Test the base class gvars() method""" env = SubstitutionEnvironment() gvars = env.gvars() assert gvars == {}, gvars def test_lvars(self): """Test the base class lvars() method""" env = SubstitutionEnvironment() lvars = env.lvars() assert lvars == {}, lvars def test_subst(self): """Test substituting construction variables within strings Check various combinations, including recursive expansion of variables into other variables. """ env = SubstitutionEnvironment(AAA = 'a', BBB = 'b') mystr = env.subst("$AAA ${AAA}A $BBBB $BBB") assert mystr == "a aA b", mystr # Changed the tests below to reflect a bug fix in # subst() env = SubstitutionEnvironment(AAA = '$BBB', BBB = 'b', BBBA = 'foo') mystr = env.subst("$AAA ${AAA}A ${AAA}B $BBB") assert mystr == "b bA bB b", mystr env = SubstitutionEnvironment(AAA = '$BBB', BBB = '$CCC', CCC = 'c') mystr = env.subst("$AAA ${AAA}A ${AAA}B $BBB") assert mystr == "c cA cB c", mystr # Lists: env = SubstitutionEnvironment(AAA = ['a', 'aa', 'aaa']) mystr = env.subst("$AAA") assert mystr == "a aa aaa", mystr # Tuples: env = SubstitutionEnvironment(AAA = ('a', 'aa', 'aaa')) mystr = env.subst("$AAA") assert mystr == "a aa aaa", mystr t1 = DummyNode('t1') t2 = DummyNode('t2') s1 = DummyNode('s1') s2 = DummyNode('s2') env = SubstitutionEnvironment(AAA = 'aaa') s = env.subst('$AAA $TARGET $SOURCES', target=[t1, t2], source=[s1, s2]) assert s == "aaa t1 s1 s2", s s = env.subst('$AAA $TARGETS $SOURCE', target=[t1, t2], source=[s1, s2]) assert s == "aaa t1 t2 s1", s # Test callables in the SubstitutionEnvironment def foo(target, source, env, for_signature): assert str(target) == 't', target assert str(source) == 's', source return env["FOO"] env = SubstitutionEnvironment(BAR=foo, FOO='baz') t = DummyNode('t') s = DummyNode('s') subst = env.subst('test $BAR', target=t, source=s) assert subst == 'test baz', subst # Test not calling callables in the SubstitutionEnvironment if 0: # This will take some serious surgery to subst() and # subst_list(), so just leave these tests out until we can # do that. def bar(arg): pass env = SubstitutionEnvironment(BAR=bar, FOO='$BAR') subst = env.subst('$BAR', call=None) assert subst is bar, subst subst = env.subst('$FOO', call=None) assert subst is bar, subst def test_subst_kw(self): """Test substituting construction variables within dictionaries""" env = SubstitutionEnvironment(AAA = 'a', BBB = 'b') kw = env.subst_kw({'$AAA' : 'aaa', 'bbb' : '$BBB'}) assert len(kw) == 2, kw assert kw['a'] == 'aaa', kw['a'] assert kw['bbb'] == 'b', kw['bbb'] def test_subst_list(self): """Test substituting construction variables in command lists """ env = SubstitutionEnvironment(AAA = 'a', BBB = 'b') l = env.subst_list("$AAA ${AAA}A $BBBB $BBB") assert l == [["a", "aA", "b"]], l # Changed the tests below to reflect a bug fix in # subst() env = SubstitutionEnvironment(AAA = '$BBB', BBB = 'b', BBBA = 'foo') l = env.subst_list("$AAA ${AAA}A ${AAA}B $BBB") assert l == [["b", "bA", "bB", "b"]], l env = SubstitutionEnvironment(AAA = '$BBB', BBB = '$CCC', CCC = 'c') l = env.subst_list("$AAA ${AAA}A ${AAA}B $BBB") assert l == [["c", "cA", "cB", "c"]], mystr env = SubstitutionEnvironment(AAA = '$BBB', BBB = '$CCC', CCC = [ 'a', 'b\nc' ]) lst = env.subst_list([ "$AAA", "B $CCC" ]) assert lst == [[ "a", "b"], ["c", "B a", "b"], ["c"]], lst t1 = DummyNode('t1') t2 = DummyNode('t2') s1 = DummyNode('s1') s2 = DummyNode('s2') env = SubstitutionEnvironment(AAA = 'aaa') s = env.subst_list('$AAA $TARGET $SOURCES', target=[t1, t2], source=[s1, s2]) assert s == [["aaa", "t1", "s1", "s2"]], s s = env.subst_list('$AAA $TARGETS $SOURCE', target=[t1, t2], source=[s1, s2]) assert s == [["aaa", "t1", "t2", "s1"]], s # Test callables in the SubstitutionEnvironment def foo(target, source, env, for_signature): assert str(target) == 't', target assert str(source) == 's', source return env["FOO"] env = SubstitutionEnvironment(BAR=foo, FOO='baz') t = DummyNode('t') s = DummyNode('s') lst = env.subst_list('test $BAR', target=t, source=s) assert lst == [['test', 'baz']], lst # Test not calling callables in the SubstitutionEnvironment if 0: # This will take some serious surgery to subst() and # subst_list(), so just leave these tests out until we can # do that. def bar(arg): pass env = SubstitutionEnvironment(BAR=bar, FOO='$BAR') subst = env.subst_list('$BAR', call=None) assert subst is bar, subst subst = env.subst_list('$FOO', call=None) assert subst is bar, subst def test_subst_path(self): """Test substituting a path list """ class MyProxy(object): def __init__(self, val): self.val = val def get(self): return self.val + '-proxy' class MyNode(object): def __init__(self, val): self.val = val def get_subst_proxy(self): return self def __str__(self): return self.val class MyObj(object): def get(self): return self env = SubstitutionEnvironment(FOO='foo', BAR='bar', LIST=['one', 'two'], PROXY=MyProxy('my1')) r = env.subst_path('$FOO') assert r == ['foo'], r r = env.subst_path(['$FOO', 'xxx', '$BAR']) assert r == ['foo', 'xxx', 'bar'], r r = env.subst_path(['$FOO', '$LIST', '$BAR']) assert list(map(str, r)) == ['foo', 'one two', 'bar'], r r = env.subst_path(['$FOO', '$TARGET', '$SOURCE', '$BAR']) assert r == ['foo', '', '', 'bar'], r r = env.subst_path(['$FOO', '$TARGET', '$BAR'], target=MyNode('ttt')) assert list(map(str, r)) == ['foo', 'ttt', 'bar'], r r = env.subst_path(['$FOO', '$SOURCE', '$BAR'], source=MyNode('sss')) assert list(map(str, r)) == ['foo', 'sss', 'bar'], r n = MyObj() r = env.subst_path(['$PROXY', MyProxy('my2'), n]) assert r == ['my1-proxy', 'my2-proxy', n], r class StringableObj(object): def __init__(self, s): self.s = s def __str__(self): return self.s env = SubstitutionEnvironment(FOO=StringableObj("foo"), BAR=StringableObj("bar")) r = env.subst_path([ "${FOO}/bar", "${BAR}/baz" ]) assert r == [ "foo/bar", "bar/baz" ], r r = env.subst_path([ "bar/${FOO}", "baz/${BAR}" ]) assert r == [ "bar/foo", "baz/bar" ], r r = env.subst_path([ "bar/${FOO}/bar", "baz/${BAR}/baz" ]) assert r == [ "bar/foo/bar", "baz/bar/baz" ], r def test_subst_target_source(self): """Test the base environment subst_target_source() method""" env = SubstitutionEnvironment(AAA = 'a', BBB = 'b') mystr = env.subst_target_source("$AAA ${AAA}A $BBBB $BBB") assert mystr == "a aA b", mystr def test_backtick(self): """Test the backtick() method for capturing command output""" env = SubstitutionEnvironment() test = TestCmd.TestCmd(workdir = '') test.write('stdout.py', """\ import sys sys.stdout.write('this came from stdout.py\\n') sys.exit(0) """) test.write('stderr.py', """\ import sys sys.stderr.write('this came from stderr.py\\n') sys.exit(0) """) test.write('fail.py', """\ import sys sys.exit(1) """) test.write('echo.py', """\ import os, sys sys.stdout.write(os.environ['ECHO'] + '\\n') sys.exit(0) """) save_stderr = sys.stderr python = '"' + sys.executable + '"' try: sys.stderr = io.StringIO() cmd = '%s %s' % (python, test.workpath('stdout.py')) output = env.backtick(cmd) errout = sys.stderr.getvalue() assert output == 'this came from stdout.py\n', output assert errout == '', errout sys.stderr = io.StringIO() cmd = '%s %s' % (python, test.workpath('stderr.py')) output = env.backtick(cmd) errout = sys.stderr.getvalue() assert output == '', output assert errout == 'this came from stderr.py\n', errout sys.stderr = io.StringIO() cmd = '%s %s' % (python, test.workpath('fail.py')) try: env.backtick(cmd) except OSError as e: assert str(e) == "'%s' exited 1" % cmd, str(e) else: self.fail("did not catch expected OSError") sys.stderr = io.StringIO() cmd = '%s %s' % (python, test.workpath('echo.py')) env['ENV'] = os.environ.copy() env['ENV']['ECHO'] = 'this came from ECHO' output = env.backtick(cmd) errout = sys.stderr.getvalue() assert output == 'this came from ECHO\n', output assert errout == '', errout finally: sys.stderr = save_stderr def test_AddMethod(self): """Test the AddMethod() method""" env = SubstitutionEnvironment(FOO = 'foo') def func(self): return 'func-' + self['FOO'] assert not hasattr(env, 'func') env.AddMethod(func) r = env.func() assert r == 'func-foo', r assert not hasattr(env, 'bar') env.AddMethod(func, 'bar') r = env.bar() assert r == 'func-foo', r def func2(self, arg=''): return 'func2-' + self['FOO'] + arg env.AddMethod(func2) r = env.func2() assert r == 'func2-foo', r r = env.func2('-xxx') assert r == 'func2-foo-xxx', r env.AddMethod(func2, 'func') r = env.func() assert r == 'func2-foo', r r = env.func('-yyy') assert r == 'func2-foo-yyy', r # Test that clones of clones correctly re-bind added methods. env1 = Environment(FOO = '1') env1.AddMethod(func2) env2 = env1.Clone(FOO = '2') env3 = env2.Clone(FOO = '3') env4 = env3.Clone(FOO = '4') r = env1.func2() assert r == 'func2-1', r r = env2.func2() assert r == 'func2-2', r r = env3.func2() assert r == 'func2-3', r r = env4.func2() assert r == 'func2-4', r # Test that clones don't re-bind an attribute that the user env1 = Environment(FOO = '1') env1.AddMethod(func2) def replace_func2(): return 'replace_func2' env1.func2 = replace_func2 env2 = env1.Clone(FOO = '2') r = env2.func2() assert r == 'replace_func2', r def test_Override(self): "Test overriding construction variables" env = SubstitutionEnvironment(ONE=1, TWO=2, THREE=3, FOUR=4) assert env['ONE'] == 1, env['ONE'] assert env['TWO'] == 2, env['TWO'] assert env['THREE'] == 3, env['THREE'] assert env['FOUR'] == 4, env['FOUR'] env2 = env.Override({'TWO' : '10', 'THREE' :'x $THREE y', 'FOUR' : ['x', '$FOUR', 'y']}) assert env2['ONE'] == 1, env2['ONE'] assert env2['TWO'] == '10', env2['TWO'] assert env2['THREE'] == 'x 3 y', env2['THREE'] assert env2['FOUR'] == ['x', 4, 'y'], env2['FOUR'] assert env['ONE'] == 1, env['ONE'] assert env['TWO'] == 2, env['TWO'] assert env['THREE'] == 3, env['THREE'] assert env['FOUR'] == 4, env['FOUR'] env2.Replace(ONE = "won") assert env2['ONE'] == "won", env2['ONE'] assert env['ONE'] == 1, env['ONE'] def test_ParseFlags(self): """Test the ParseFlags() method """ env = SubstitutionEnvironment() empty = { 'ASFLAGS' : [], 'CFLAGS' : [], 'CCFLAGS' : [], 'CXXFLAGS' : [], 'CPPDEFINES' : [], 'CPPFLAGS' : [], 'CPPPATH' : [], 'FRAMEWORKPATH' : [], 'FRAMEWORKS' : [], 'LIBPATH' : [], 'LIBS' : [], 'LINKFLAGS' : [], 'RPATH' : [], } d = env.ParseFlags(None) assert d == empty, d d = env.ParseFlags('') assert d == empty, d d = env.ParseFlags([]) assert d == empty, d s = "-I/usr/include/fum -I bar -X\n" + \ '-I"C:\\Program Files\\ASCEND\\include" ' + \ "-L/usr/fax -L foo -lxxx -l yyy " + \ '-L"C:\\Program Files\\ASCEND" -lascend ' + \ "-Wa,-as -Wl,-link " + \ "-Wl,-rpath=rpath1 " + \ "-Wl,-R,rpath2 " + \ "-Wl,-Rrpath3 " + \ "-Wp,-cpp " + \ "-std=c99 " + \ "-std=c++0x " + \ "-framework Carbon " + \ "-frameworkdir=fwd1 " + \ "-Ffwd2 " + \ "-F fwd3 " + \ "-dylib_file foo-dylib " + \ "-pthread " + \ "-fopenmp " + \ "-mno-cygwin -mwindows " + \ "-arch i386 -isysroot /tmp " + \ "-isystem /usr/include/foo " + \ "+DD64 " + \ "-DFOO -DBAR=value -D BAZ " d = env.ParseFlags(s) assert d['ASFLAGS'] == ['-as'], d['ASFLAGS'] assert d['CFLAGS'] == ['-std=c99'] assert d['CCFLAGS'] == ['-X', '-Wa,-as', '-pthread', '-fopenmp', '-mno-cygwin', ('-arch', 'i386'), ('-isysroot', '/tmp'), ('-isystem', '/usr/include/foo'), '+DD64'], repr(d['CCFLAGS']) assert d['CXXFLAGS'] == ['-std=c++0x'], repr(d['CXXFLAGS']) assert d['CPPDEFINES'] == ['FOO', ['BAR', 'value'], 'BAZ'], d['CPPDEFINES'] assert d['CPPFLAGS'] == ['-Wp,-cpp'], d['CPPFLAGS'] assert d['CPPPATH'] == ['/usr/include/fum', 'bar', 'C:\\Program Files\\ASCEND\\include'], d['CPPPATH'] assert d['FRAMEWORKPATH'] == ['fwd1', 'fwd2', 'fwd3'], d['FRAMEWORKPATH'] assert d['FRAMEWORKS'] == ['Carbon'], d['FRAMEWORKS'] assert d['LIBPATH'] == ['/usr/fax', 'foo', 'C:\\Program Files\\ASCEND'], d['LIBPATH'] LIBS = list(map(str, d['LIBS'])) assert LIBS == ['xxx', 'yyy', 'ascend'], (d['LIBS'], LIBS) assert d['LINKFLAGS'] == ['-Wl,-link', '-dylib_file', 'foo-dylib', '-pthread', '-fopenmp', '-mno-cygwin', '-mwindows', ('-arch', 'i386'), ('-isysroot', '/tmp'), '+DD64'], repr(d['LINKFLAGS']) assert d['RPATH'] == ['rpath1', 'rpath2', 'rpath3'], d['RPATH'] def test_MergeFlags(self): """Test the MergeFlags() method """ env = SubstitutionEnvironment() env.MergeFlags('') assert 'CCFLAGS' not in env, env['CCFLAGS'] env.MergeFlags('-X') assert env['CCFLAGS'] == ['-X'], env['CCFLAGS'] env.MergeFlags('-X') assert env['CCFLAGS'] == ['-X'], env['CCFLAGS'] env = SubstitutionEnvironment(CCFLAGS=None) env.MergeFlags('-Y') assert env['CCFLAGS'] == ['-Y'], env['CCFLAGS'] env = SubstitutionEnvironment() env.MergeFlags({'A':['aaa'], 'B':['bbb']}) assert env['A'] == ['aaa'], env['A'] assert env['B'] == ['bbb'], env['B'] class BaseTestCase(unittest.TestCase,TestEnvironmentFixture): reserved_variables = [ 'CHANGED_SOURCES', 'CHANGED_TARGETS', 'SOURCE', 'SOURCES', 'TARGET', 'TARGETS', 'UNCHANGED_SOURCES', 'UNCHANGED_TARGETS', ] def test___init__(self): """Test construction Environment creation Create two with identical arguments and check that they compare the same. """ env1 = self.TestEnvironment(XXX = 'x', YYY = 'y') env2 = self.TestEnvironment(XXX = 'x', YYY = 'y') assert env1 == env2, diff_env(env1, env2) assert '__env__' not in env1 assert '__env__' not in env2 def test_variables(self): """Test that variables only get applied once.""" class FakeOptions(object): def __init__(self, key, val): self.calls = 0 self.key = key self.val = val def keys(self): return [self.key] def Update(self, env): env[self.key] = self.val self.calls = self.calls + 1 o = FakeOptions('AAA', 'fake_opt') env = Environment(variables=o, AAA='keyword_arg') assert o.calls == 1, o.calls assert env['AAA'] == 'fake_opt', env['AAA'] def test_get(self): """Test the get() method.""" env = self.TestEnvironment(aaa = 'AAA') x = env.get('aaa') assert x == 'AAA', x x = env.get('aaa', 'XXX') assert x == 'AAA', x x = env.get('bbb') assert x is None, x x = env.get('bbb', 'XXX') assert x == 'XXX', x def test_Builder_calls(self): """Test Builder calls through different environments """ global called_it b1 = Builder() b2 = Builder() env = Environment() env.Replace(BUILDERS = { 'builder1' : b1, 'builder2' : b2 }) called_it = {} env.builder1('in1') assert called_it['target'] is None, called_it assert called_it['source'] == ['in1'], called_it called_it = {} env.builder2(source = 'in2', xyzzy = 1) assert called_it['target'] is None, called_it assert called_it['source'] == ['in2'], called_it assert called_it['xyzzy'] == 1, called_it called_it = {} env.builder1(foo = 'bar') assert called_it['foo'] == 'bar', called_it assert called_it['target'] is None, called_it assert called_it['source'] is None, called_it def test_BuilderWrapper_attributes(self): """Test getting and setting of BuilderWrapper attributes """ b1 = Builder() b2 = Builder() e1 = Environment() e2 = Environment() e1.Replace(BUILDERS = {'b' : b1}) bw = e1.b assert bw.env is e1 bw.env = e2 assert bw.env is e2 assert bw.builder is b1 bw.builder = b2 assert bw.builder is b2 self.assertRaises(AttributeError, getattr, bw, 'foobar') bw.foobar = 42 assert bw.foobar is 42 # This unit test is currently disabled because we don't think the # underlying method it tests (Environment.BuilderWrapper.execute()) # is necessary, but we're leaving the code here for now in case # that's mistaken. def _DO_NOT_test_Builder_execs(self): """Test Builder execution through different environments One environment is initialized with a single Builder object, one with a list of a single Builder object, and one with a list of two Builder objects. """ global built_it b1 = Builder() b2 = Builder() built_it = {} env3 = Environment() env3.Replace(BUILDERS = { 'builder1' : b1, 'builder2' : b2 }) env3.builder1.execute(target = 'out1') env3.builder2.execute(target = 'out2') env3.builder1.execute(target = 'out3') assert built_it['out1'] assert built_it['out2'] assert built_it['out3'] env4 = env3.Clone() assert env4.builder1.env is env4, "builder1.env (%s) == env3 (%s)?" % ( env4.builder1.env, env3) assert env4.builder2.env is env4, "builder2.env (%s) == env3 (%s)?" % ( env4.builder1.env, env3) # Now test BUILDERS as a dictionary. built_it = {} env5 = self.TestEnvironment(BUILDERS={ 'foo' : b1 }) env5['BUILDERS']['bar'] = b2 env5.foo.execute(target='out1') env5.bar.execute(target='out2') assert built_it['out1'] assert built_it['out2'] built_it = {} env6 = Environment() env6['BUILDERS'] = { 'foo' : b1, 'bar' : b2 } env6.foo.execute(target='out1') env6.bar.execute(target='out2') assert built_it['out1'] assert built_it['out2'] def test_Scanners(self): """Test setting SCANNERS in various ways One environment is initialized with a single Scanner object, one with a list of a single Scanner object, and one with a list of two Scanner objects. """ global scanned_it s1 = Scanner(name = 'scanner1', skeys = [".c", ".cc"]) s2 = Scanner(name = 'scanner2', skeys = [".m4"]) s3 = Scanner(name = 'scanner3', skeys = [".m4", ".m5"]) s4 = Scanner(name = 'scanner4', skeys = [None]) # XXX Tests for scanner execution through different environments, # XXX if we ever want to do that some day # scanned_it = {} # env1 = self.TestEnvironment(SCANNERS = s1) # env1.scanner1(filename = 'out1') # assert scanned_it['out1'] # # scanned_it = {} # env2 = self.TestEnvironment(SCANNERS = [s1]) # env1.scanner1(filename = 'out1') # assert scanned_it['out1'] # # scanned_it = {} # env3 = Environment() # env3.Replace(SCANNERS = [s1]) # env3.scanner1(filename = 'out1') # env3.scanner2(filename = 'out2') # env3.scanner1(filename = 'out3') # assert scanned_it['out1'] # assert scanned_it['out2'] # assert scanned_it['out3'] suffixes = [".c", ".cc", ".cxx", ".m4", ".m5"] env = Environment() try: del env['SCANNERS'] except KeyError: pass s = list(map(env.get_scanner, suffixes)) assert s == [None, None, None, None, None], s env = self.TestEnvironment(SCANNERS = []) s = list(map(env.get_scanner, suffixes)) assert s == [None, None, None, None, None], s env.Replace(SCANNERS = [s1]) s = list(map(env.get_scanner, suffixes)) assert s == [s1, s1, None, None, None], s env.Append(SCANNERS = [s2]) s = list(map(env.get_scanner, suffixes)) assert s == [s1, s1, None, s2, None], s env.AppendUnique(SCANNERS = [s3]) s = list(map(env.get_scanner, suffixes)) assert s == [s1, s1, None, s2, s3], s env = env.Clone(SCANNERS = [s2]) s = list(map(env.get_scanner, suffixes)) assert s == [None, None, None, s2, None], s env['SCANNERS'] = [s1] s = list(map(env.get_scanner, suffixes)) assert s == [s1, s1, None, None, None], s env.PrependUnique(SCANNERS = [s2, s1]) s = list(map(env.get_scanner, suffixes)) assert s == [s1, s1, None, s2, None], s env.Prepend(SCANNERS = [s3]) s = list(map(env.get_scanner, suffixes)) assert s == [s1, s1, None, s3, s3], s # Verify behavior of case-insensitive suffix matches on Windows. uc_suffixes = [_.upper() for _ in suffixes] env = Environment(SCANNERS = [s1, s2, s3], PLATFORM = 'linux') s = list(map(env.get_scanner, suffixes)) assert s == [s1, s1, None, s2, s3], s s = list(map(env.get_scanner, uc_suffixes)) assert s == [None, None, None, None, None], s env['PLATFORM'] = 'win32' s = list(map(env.get_scanner, uc_suffixes)) assert s == [s1, s1, None, s2, s3], s # Verify behavior for a scanner returning None (on Windows # where we might try to perform case manipulation on None). env.Replace(SCANNERS = [s4]) s = list(map(env.get_scanner, suffixes)) assert s == [None, None, None, None, None], s def test_ENV(self): """Test setting the external ENV in Environments """ env = Environment() assert 'ENV' in env.Dictionary() env = self.TestEnvironment(ENV = { 'PATH' : '/foo:/bar' }) assert env.Dictionary('ENV')['PATH'] == '/foo:/bar' def test_ReservedVariables(self): """Test warning generation when reserved variable names are set""" reserved_variables = [ 'CHANGED_SOURCES', 'CHANGED_TARGETS', 'SOURCE', 'SOURCES', 'TARGET', 'TARGETS', 'UNCHANGED_SOURCES', 'UNCHANGED_TARGETS', ] warning = SCons.Warnings.ReservedVariableWarning SCons.Warnings.enableWarningClass(warning) old = SCons.Warnings.warningAsException(1) try: env4 = Environment() for kw in self.reserved_variables: exc_caught = None try: env4[kw] = 'xyzzy' except warning: exc_caught = 1 assert exc_caught, "Did not catch ReservedVariableWarning for `%s'" % kw assert kw not in env4, "`%s' variable was incorrectly set" % kw finally: SCons.Warnings.warningAsException(old) def test_FutureReservedVariables(self): """Test warning generation when future reserved variable names are set""" future_reserved_variables = [] warning = SCons.Warnings.FutureReservedVariableWarning SCons.Warnings.enableWarningClass(warning) old = SCons.Warnings.warningAsException(1) try: env4 = Environment() for kw in future_reserved_variables: exc_caught = None try: env4[kw] = 'xyzzy' except warning: exc_caught = 1 assert exc_caught, "Did not catch FutureReservedVariableWarning for `%s'" % kw assert kw in env4, "`%s' variable was not set" % kw finally: SCons.Warnings.warningAsException(old) def test_IllegalVariables(self): """Test that use of illegal variables raises an exception""" env = Environment() def test_it(var, env=env): exc_caught = None try: env[var] = 1 except SCons.Errors.UserError: exc_caught = 1 assert exc_caught, "did not catch UserError for '%s'" % var env['aaa'] = 1 assert env['aaa'] == 1, env['aaa'] test_it('foo/bar') test_it('foo.bar') test_it('foo-bar') def test_autogenerate(dict): """Test autogenerating variables in a dictionary.""" drive, p = os.path.splitdrive(os.getcwd()) def normalize_path(path, drive=drive): if path[0] in '\\/': path = drive + path path = os.path.normpath(path) drive, path = os.path.splitdrive(path) return drive.lower() + path env = dict.TestEnvironment(LIBS = [ 'foo', 'bar', 'baz' ], LIBLINKPREFIX = 'foo', LIBLINKSUFFIX = 'bar') def RDirs(pathlist, fs=env.fs): return fs.Dir('xx').Rfindalldirs(pathlist) env['RDirs'] = RDirs flags = env.subst_list('$_LIBFLAGS', 1)[0] assert flags == ['foobar', 'foobar', 'foobazbar'], flags blat = env.fs.Dir('blat') env.Replace(CPPPATH = [ 'foo', '$FOO/bar', blat ], INCPREFIX = 'foo ', INCSUFFIX = 'bar', FOO = 'baz') flags = env.subst_list('$_CPPINCFLAGS', 1)[0] expect = [ '$(', normalize_path('foo'), normalize_path('xx/foobar'), normalize_path('foo'), normalize_path('xx/baz/bar'), normalize_path('foo'), normalize_path('blatbar'), '$)', ] assert flags == expect, flags env.Replace(F77PATH = [ 'foo', '$FOO/bar', blat ], INCPREFIX = 'foo ', INCSUFFIX = 'bar', FOO = 'baz') flags = env.subst_list('$_F77INCFLAGS', 1)[0] expect = [ '$(', normalize_path('foo'), normalize_path('xx/foobar'), normalize_path('foo'), normalize_path('xx/baz/bar'), normalize_path('foo'), normalize_path('blatbar'), '$)', ] assert flags == expect, flags env.Replace(CPPPATH = '', F77PATH = '', LIBPATH = '') l = env.subst_list('$_CPPINCFLAGS') assert l == [[]], l l = env.subst_list('$_F77INCFLAGS') assert l == [[]], l l = env.subst_list('$_LIBDIRFLAGS') assert l == [[]], l env.fs.Repository('/rep1') env.fs.Repository('/rep2') env.Replace(CPPPATH = [ 'foo', '/__a__/b', '$FOO/bar', blat], INCPREFIX = '-I ', INCSUFFIX = 'XXX', FOO = 'baz') flags = env.subst_list('$_CPPINCFLAGS', 1)[0] expect = [ '$(', '-I', normalize_path('xx/fooXXX'), '-I', normalize_path('/rep1/xx/fooXXX'), '-I', normalize_path('/rep2/xx/fooXXX'), '-I', normalize_path('/__a__/bXXX'), '-I', normalize_path('xx/baz/barXXX'), '-I', normalize_path('/rep1/xx/baz/barXXX'), '-I', normalize_path('/rep2/xx/baz/barXXX'), '-I', normalize_path('blatXXX'), '$)' ] def normalize_if_path(arg, np=normalize_path): if arg not in ('$(','$)','-I'): return np(str(arg)) return arg flags = list(map(normalize_if_path, flags)) assert flags == expect, flags def test_platform(self): """Test specifying a platform callable when instantiating.""" class platform(object): def __str__(self): return "TestPlatform" def __call__(self, env): env['XYZZY'] = 777 def tool(env): env['SET_TOOL'] = 'initialized' assert env['PLATFORM'] == "TestPlatform" env = self.TestEnvironment(platform = platform(), tools = [tool]) assert env['XYZZY'] == 777, env assert env['PLATFORM'] == "TestPlatform" assert env['SET_TOOL'] == "initialized" def test_Default_PLATFORM(self): """Test overriding the default PLATFORM variable""" class platform(object): def __str__(self): return "DefaultTestPlatform" def __call__(self, env): env['XYZZY'] = 888 def tool(env): env['SET_TOOL'] = 'abcde' assert env['PLATFORM'] == "DefaultTestPlatform" import SCons.Defaults save = SCons.Defaults.ConstructionEnvironment.copy() try: import SCons.Defaults SCons.Defaults.ConstructionEnvironment.update({ 'PLATFORM' : platform(), }) env = self.TestEnvironment(tools = [tool]) assert env['XYZZY'] == 888, env assert env['PLATFORM'] == "DefaultTestPlatform" assert env['SET_TOOL'] == "abcde" finally: SCons.Defaults.ConstructionEnvironment = save def test_tools(self): """Test specifying a tool callable when instantiating.""" def t1(env): env['TOOL1'] = 111 def t2(env): env['TOOL2'] = 222 def t3(env): env['AAA'] = env['XYZ'] def t4(env): env['TOOL4'] = 444 env = self.TestEnvironment(tools = [t1, t2, t3], XYZ = 'aaa') assert env['TOOL1'] == 111, env['TOOL1'] assert env['TOOL2'] == 222, env assert env['AAA'] == 'aaa', env t4(env) assert env['TOOL4'] == 444, env test = TestCmd.TestCmd(workdir = '') test.write('faketool.py', """\ def generate(env, **kw): for k, v in kw.items(): env[k] = v def exists(env): return 1 """) env = self.TestEnvironment(tools = [('faketool', {'a':1, 'b':2, 'c':3})], toolpath = [test.workpath('')]) assert env['a'] == 1, env['a'] assert env['b'] == 2, env['b'] assert env['c'] == 3, env['c'] def test_Default_TOOLS(self): """Test overriding the default TOOLS variable""" def t5(env): env['TOOL5'] = 555 def t6(env): env['TOOL6'] = 666 def t7(env): env['BBB'] = env['XYZ'] def t8(env): env['TOOL8'] = 888 import SCons.Defaults save = SCons.Defaults.ConstructionEnvironment.copy() try: SCons.Defaults.ConstructionEnvironment.update({ 'TOOLS' : [t5, t6, t7], }) env = Environment(XYZ = 'bbb') assert env['TOOL5'] == 555, env['TOOL5'] assert env['TOOL6'] == 666, env assert env['BBB'] == 'bbb', env t8(env) assert env['TOOL8'] == 888, env finally: SCons.Defaults.ConstructionEnvironment = save def test_null_tools(self): """Test specifying a tool of None is OK.""" def t1(env): env['TOOL1'] = 111 def t2(env): env['TOOL2'] = 222 env = self.TestEnvironment(tools = [t1, None, t2], XYZ = 'aaa') assert env['TOOL1'] == 111, env['TOOL1'] assert env['TOOL2'] == 222, env assert env['XYZ'] == 'aaa', env env = self.TestEnvironment(tools = [None], XYZ = 'xyz') assert env['XYZ'] == 'xyz', env env = self.TestEnvironment(tools = [t1, '', t2], XYZ = 'ddd') assert env['TOOL1'] == 111, env['TOOL1'] assert env['TOOL2'] == 222, env assert env['XYZ'] == 'ddd', env def test_concat(self): "Test _concat()" e1 = self.TestEnvironment(PRE='pre', SUF='suf', STR='a b', LIST=['a', 'b']) s = e1.subst x = s("${_concat('', '', '', __env__)}") assert x == '', x x = s("${_concat('', [], '', __env__)}") assert x == '', x x = s("${_concat(PRE, '', SUF, __env__)}") assert x == '', x x = s("${_concat(PRE, STR, SUF, __env__)}") assert x == 'prea bsuf', x x = s("${_concat(PRE, LIST, SUF, __env__)}") assert x == 'preasuf prebsuf', x def test_concat_nested(self): "Test _concat() on a nested substitution strings." e = self.TestEnvironment(PRE='pre', SUF='suf', L1=['a', 'b'], L2=['c', 'd'], L3=['$L2']) x = e.subst('$( ${_concat(PRE, L1, SUF, __env__)} $)') assert x == 'preasuf prebsuf', x e.AppendUnique(L1 = ['$L2']) x = e.subst('$( ${_concat(PRE, L1, SUF, __env__)} $)') assert x == 'preasuf prebsuf precsuf predsuf', x e.AppendUnique(L1 = ['$L3']) x = e.subst('$( ${_concat(PRE, L1, SUF, __env__)} $)') assert x == 'preasuf prebsuf precsuf predsuf precsuf predsuf', x def test_gvars(self): """Test the Environment gvars() method""" env = self.TestEnvironment(XXX = 'x', YYY = 'y', ZZZ = 'z') gvars = env.gvars() assert gvars['XXX'] == 'x', gvars['XXX'] assert gvars['YYY'] == 'y', gvars['YYY'] assert gvars['ZZZ'] == 'z', gvars['ZZZ'] def test__update(self): """Test the _update() method""" env = self.TestEnvironment(X = 'x', Y = 'y', Z = 'z') assert env['X'] == 'x', env['X'] assert env['Y'] == 'y', env['Y'] assert env['Z'] == 'z', env['Z'] env._update({'X' : 'xxx', 'TARGET' : 't', 'TARGETS' : 'ttt', 'SOURCE' : 's', 'SOURCES' : 'sss', 'Z' : 'zzz'}) assert env['X'] == 'xxx', env['X'] assert env['Y'] == 'y', env['Y'] assert env['Z'] == 'zzz', env['Z'] assert env['TARGET'] == 't', env['TARGET'] assert env['TARGETS'] == 'ttt', env['TARGETS'] assert env['SOURCE'] == 's', env['SOURCE'] assert env['SOURCES'] == 'sss', env['SOURCES'] def test_Append(self): """Test appending to construction variables in an Environment """ b1 = Environment()['BUILDERS'] b2 = Environment()['BUILDERS'] assert b1 == b2, diff_dict(b1, b2) cases = [ 'a1', 'A1', 'a1A1', 'a2', ['A2'], ['a2', 'A2'], 'a3', UL(['A3']), UL(['a', '3', 'A3']), 'a4', '', 'a4', 'a5', [], ['a5'], 'a6', UL([]), UL(['a', '6']), 'a7', [''], ['a7', ''], 'a8', UL(['']), UL(['a', '8', '']), ['e1'], 'E1', ['e1', 'E1'], ['e2'], ['E2'], ['e2', 'E2'], ['e3'], UL(['E3']), UL(['e3', 'E3']), ['e4'], '', ['e4'], ['e5'], [], ['e5'], ['e6'], UL([]), UL(['e6']), ['e7'], [''], ['e7', ''], ['e8'], UL(['']), UL(['e8', '']), UL(['i1']), 'I1', UL(['i1', 'I', '1']), UL(['i2']), ['I2'], UL(['i2', 'I2']), UL(['i3']), UL(['I3']), UL(['i3', 'I3']), UL(['i4']), '', UL(['i4']), UL(['i5']), [], UL(['i5']), UL(['i6']), UL([]), UL(['i6']), UL(['i7']), [''], UL(['i7', '']), UL(['i8']), UL(['']), UL(['i8', '']), {'d1':1}, 'D1', {'d1':1, 'D1':None}, {'d2':1}, ['D2'], {'d2':1, 'D2':None}, {'d3':1}, UL(['D3']), {'d3':1, 'D3':None}, {'d4':1}, {'D4':1}, {'d4':1, 'D4':1}, {'d5':1}, UD({'D5':1}), UD({'d5':1, 'D5':1}), UD({'u1':1}), 'U1', UD({'u1':1, 'U1':None}), UD({'u2':1}), ['U2'], UD({'u2':1, 'U2':None}), UD({'u3':1}), UL(['U3']), UD({'u3':1, 'U3':None}), UD({'u4':1}), {'U4':1}, UD({'u4':1, 'U4':1}), UD({'u5':1}), UD({'U5':1}), UD({'u5':1, 'U5':1}), '', 'M1', 'M1', '', ['M2'], ['M2'], '', UL(['M3']), UL(['M3']), '', '', '', '', [], [], '', UL([]), UL([]), '', [''], [''], '', UL(['']), UL(['']), [], 'N1', ['N1'], [], ['N2'], ['N2'], [], UL(['N3']), UL(['N3']), [], '', [], [], [], [], [], UL([]), UL([]), [], [''], [''], [], UL(['']), UL(['']), UL([]), 'O1', ['O', '1'], UL([]), ['O2'], ['O2'], UL([]), UL(['O3']), UL(['O3']), UL([]), '', UL([]), UL([]), [], UL([]), UL([]), UL([]), UL([]), UL([]), [''], UL(['']), UL([]), UL(['']), UL(['']), [''], 'P1', ['', 'P1'], [''], ['P2'], ['', 'P2'], [''], UL(['P3']), UL(['', 'P3']), [''], '', [''], [''], [], [''], [''], UL([]), UL(['']), [''], [''], ['', ''], [''], UL(['']), UL(['', '']), UL(['']), 'Q1', ['', 'Q', '1'], UL(['']), ['Q2'], ['', 'Q2'], UL(['']), UL(['Q3']), UL(['', 'Q3']), UL(['']), '', UL(['']), UL(['']), [], UL(['']), UL(['']), UL([]), UL(['']), UL(['']), [''], UL(['', '']), UL(['']), UL(['']), UL(['', '']), ] env = Environment() failed = 0 while cases: input, append, expect = cases[:3] env['XXX'] = copy.copy(input) try: env.Append(XXX = append) except Exception as e: if failed == 0: print() print(" %s Append %s exception: %s" % \ (repr(input), repr(append), e)) failed = failed + 1 else: result = env['XXX'] if result != expect: if failed == 0: print() print(" %s Append %s => %s did not match %s" % \ (repr(input), repr(append), repr(result), repr(expect))) failed = failed + 1 del cases[:3] assert failed == 0, "%d Append() cases failed" % failed env['UL'] = UL(['foo']) env.Append(UL = 'bar') result = env['UL'] assert isinstance(result, UL), repr(result) assert result == ['foo', 'b', 'a', 'r'], result env['CLVar'] = CLVar(['foo']) env.Append(CLVar = 'bar') result = env['CLVar'] assert isinstance(result, CLVar), repr(result) assert result == ['foo', 'bar'], result class C(object): def __init__(self, name): self.name = name def __str__(self): return self.name def __eq__(self, other): raise Exception("should not compare") ccc = C('ccc') env2 = self.TestEnvironment(CCC1 = ['c1'], CCC2 = ccc) env2.Append(CCC1 = ccc, CCC2 = ['c2']) assert env2['CCC1'][0] == 'c1', env2['CCC1'] assert env2['CCC1'][1] is ccc, env2['CCC1'] assert env2['CCC2'][0] is ccc, env2['CCC2'] assert env2['CCC2'][1] == 'c2', env2['CCC2'] env3 = self.TestEnvironment(X = {'x1' : 7}) env3.Append(X = {'x1' : 8, 'x2' : 9}, Y = {'y1' : 10}) assert env3['X'] == {'x1': 8, 'x2': 9}, env3['X'] assert env3['Y'] == {'y1': 10}, env3['Y'] z1 = Builder() z2 = Builder() env4 = self.TestEnvironment(BUILDERS = {'z1' : z1}) env4.Append(BUILDERS = {'z2' : z2}) assert env4['BUILDERS'] == {'z1' : z1, 'z2' : z2}, env4['BUILDERS'] assert hasattr(env4, 'z1') assert hasattr(env4, 'z2') def test_AppendENVPath(self): """Test appending to an ENV path.""" env1 = self.TestEnvironment(ENV = {'PATH': r'C:\dir\num\one;C:\dir\num\two'}, MYENV = {'MYPATH': r'C:\mydir\num\one;C:\mydir\num\two'}) # have to include the pathsep here so that the test will work on UNIX too. env1.AppendENVPath('PATH',r'C:\dir\num\two', sep = ';') env1.AppendENVPath('PATH',r'C:\dir\num\three', sep = ';') env1.AppendENVPath('MYPATH',r'C:\mydir\num\three','MYENV', sep = ';') env1.AppendENVPath('MYPATH',r'C:\mydir\num\one','MYENV', sep = ';') # this should do nothing since delete_existing is 0 env1.AppendENVPath('MYPATH',r'C:\mydir\num\three','MYENV', sep = ';', delete_existing=0) assert(env1['ENV']['PATH'] == r'C:\dir\num\one;C:\dir\num\two;C:\dir\num\three') assert(env1['MYENV']['MYPATH'] == r'C:\mydir\num\two;C:\mydir\num\three;C:\mydir\num\one') test = TestCmd.TestCmd(workdir = '') test.subdir('sub1', 'sub2') p=env1['ENV']['PATH'] env1.AppendENVPath('PATH','#sub1', sep = ';') env1.AppendENVPath('PATH',env1.fs.Dir('sub2'), sep = ';') assert env1['ENV']['PATH'] == p + ';sub1;sub2', env1['ENV']['PATH'] def test_AppendUnique(self): """Test appending to unique values to construction variables This strips values that are already present when lists are involved.""" env = self.TestEnvironment(AAA1 = 'a1', AAA2 = 'a2', AAA3 = 'a3', AAA4 = 'a4', AAA5 = 'a5', BBB1 = ['b1'], BBB2 = ['b2'], BBB3 = ['b3'], BBB4 = ['b4'], BBB5 = ['b5'], CCC1 = '', CCC2 = '', DDD1 = ['a', 'b', 'c']) env['LL1'] = [env.Literal('a literal'), env.Literal('b literal')] env['LL2'] = [env.Literal('c literal'), env.Literal('b literal')] env.AppendUnique(AAA1 = 'a1', AAA2 = ['a2'], AAA3 = ['a3', 'b', 'c', 'c', 'b', 'a3'], # ignore dups AAA4 = 'a4.new', AAA5 = ['a5.new'], BBB1 = 'b1', BBB2 = ['b2'], BBB3 = ['b3', 'c', 'd', 'c', 'b3'], BBB4 = 'b4.new', BBB5 = ['b5.new'], CCC1 = 'c1', CCC2 = ['c2'], DDD1 = 'b', LL1 = env.Literal('a literal'), LL2 = env.Literal('a literal')) assert env['AAA1'] == 'a1a1', env['AAA1'] assert env['AAA2'] == ['a2'], env['AAA2'] assert env['AAA3'] == ['a3', 'b', 'c'], env['AAA3'] assert env['AAA4'] == 'a4a4.new', env['AAA4'] assert env['AAA5'] == ['a5', 'a5.new'], env['AAA5'] assert env['BBB1'] == ['b1'], env['BBB1'] assert env['BBB2'] == ['b2'], env['BBB2'] assert env['BBB3'] == ['b3', 'c', 'd'], env['BBB3'] assert env['BBB4'] == ['b4', 'b4.new'], env['BBB4'] assert env['BBB5'] == ['b5', 'b5.new'], env['BBB5'] assert env['CCC1'] == 'c1', env['CCC1'] assert env['CCC2'] == ['c2'], env['CCC2'] assert env['DDD1'] == ['a', 'b', 'c'], env['DDD1'] assert env['LL1'] == [env.Literal('a literal'), env.Literal('b literal')], env['LL1'] assert env['LL2'] == [env.Literal('c literal'), env.Literal('b literal'), env.Literal('a literal')], [str(x) for x in env['LL2']] env.AppendUnique(DDD1 = 'b', delete_existing=1) assert env['DDD1'] == ['a', 'c', 'b'], env['DDD1'] # b moves to end env.AppendUnique(DDD1 = ['a','b'], delete_existing=1) assert env['DDD1'] == ['c', 'a', 'b'], env['DDD1'] # a & b move to end env.AppendUnique(DDD1 = ['e','f', 'e'], delete_existing=1) assert env['DDD1'] == ['c', 'a', 'b', 'f', 'e'], env['DDD1'] # add last env['CLVar'] = CLVar([]) env.AppendUnique(CLVar = 'bar') result = env['CLVar'] assert isinstance(result, CLVar), repr(result) assert result == ['bar'], result env['CLVar'] = CLVar(['abc']) env.AppendUnique(CLVar = 'bar') result = env['CLVar'] assert isinstance(result, CLVar), repr(result) assert result == ['abc', 'bar'], result env['CLVar'] = CLVar(['bar']) env.AppendUnique(CLVar = 'bar') result = env['CLVar'] assert isinstance(result, CLVar), repr(result) assert result == ['bar'], result def test_Clone(self): """Test construction environment copying Update the copy independently afterwards and check that the original remains intact (that is, no dangling references point to objects in the copied environment). Clone the original with some construction variable updates and check that the original remains intact and the copy has the updated values. """ env1 = self.TestEnvironment(XXX = 'x', YYY = 'y') env2 = env1.Clone() env1copy = env1.Clone() assert env1copy == env1copy assert env2 == env2 env2.Replace(YYY = 'yyy') assert env2 == env2 assert env1 != env2 assert env1 == env1copy env3 = env1.Clone(XXX = 'x3', ZZZ = 'z3') assert env3 == env3 assert env3.Dictionary('XXX') == 'x3' assert env3.Dictionary('YYY') == 'y' assert env3.Dictionary('ZZZ') == 'z3' assert env1 == env1copy # Ensure that lists and dictionaries are # deep copied, but not instances. class TestA(object): pass env1 = self.TestEnvironment(XXX=TestA(), YYY = [ 1, 2, 3 ], ZZZ = { 1:2, 3:4 }) env2=env1.Clone() env2.Dictionary('YYY').append(4) env2.Dictionary('ZZZ')[5] = 6 assert env1.Dictionary('XXX') is env2.Dictionary('XXX') assert 4 in env2.Dictionary('YYY') assert not 4 in env1.Dictionary('YYY') assert 5 in env2.Dictionary('ZZZ') assert 5 not in env1.Dictionary('ZZZ') # env1 = self.TestEnvironment(BUILDERS = {'b1' : Builder()}) assert hasattr(env1, 'b1'), "env1.b1 was not set" assert env1.b1.object == env1, "b1.object doesn't point to env1" env2 = env1.Clone(BUILDERS = {'b2' : Builder()}) assert env2 is env2 assert env2 == env2 assert hasattr(env1, 'b1'), "b1 was mistakenly cleared from env1" assert env1.b1.object == env1, "b1.object was changed" assert not hasattr(env2, 'b1'), "b1 was not cleared from env2" assert hasattr(env2, 'b2'), "env2.b2 was not set" assert env2.b2.object == env2, "b2.object doesn't point to env2" # Ensure that specifying new tools in a copied environment # works. def foo(env): env['FOO'] = 1 def bar(env): env['BAR'] = 2 def baz(env): env['BAZ'] = 3 env1 = self.TestEnvironment(tools=[foo]) env2 = env1.Clone() env3 = env1.Clone(tools=[bar, baz]) assert env1.get('FOO') is 1 assert env1.get('BAR') is None assert env1.get('BAZ') is None assert env2.get('FOO') is 1 assert env2.get('BAR') is None assert env2.get('BAZ') is None assert env3.get('FOO') is 1 assert env3.get('BAR') is 2 assert env3.get('BAZ') is 3 # Ensure that recursive variable substitution when copying # environments works properly. env1 = self.TestEnvironment(CCFLAGS = '-DFOO', XYZ = '-DXYZ') env2 = env1.Clone(CCFLAGS = '$CCFLAGS -DBAR', XYZ = ['-DABC', 'x $XYZ y', '-DDEF']) x = env2.get('CCFLAGS') assert x == '-DFOO -DBAR', x x = env2.get('XYZ') assert x == ['-DABC', 'x -DXYZ y', '-DDEF'], x # Ensure that special properties of a class don't get # lost on copying. env1 = self.TestEnvironment(FLAGS = CLVar('flag1 flag2')) x = env1.get('FLAGS') assert x == ['flag1', 'flag2'], x env2 = env1.Clone() env2.Append(FLAGS = 'flag3 flag4') x = env2.get('FLAGS') assert x == ['flag1', 'flag2', 'flag3', 'flag4'], x x = env1.get('FLAGS') assert x == ['flag1', 'flag2'], x # Ensure that appending directly to a copied CLVar # doesn't modify the original. env1 = self.TestEnvironment(FLAGS = CLVar('flag1 flag2')) x = env1.get('FLAGS') assert x == ['flag1', 'flag2'], x env2 = env1.Clone() env2['FLAGS'] += ['flag3', 'flag4'] x = env2.get('FLAGS') assert x == ['flag1', 'flag2', 'flag3', 'flag4'], x x = env1.get('FLAGS') assert x == ['flag1', 'flag2'], x # Test that the environment stores the toolpath and # re-uses it for copies. test = TestCmd.TestCmd(workdir = '') test.write('xxx.py', """\ def exists(env): 1 def generate(env): env['XXX'] = 'one' """) test.write('yyy.py', """\ def exists(env): 1 def generate(env): env['YYY'] = 'two' """) env = self.TestEnvironment(tools=['xxx'], toolpath=[test.workpath('')]) assert env['XXX'] == 'one', env['XXX'] env = env.Clone(tools=['yyy']) assert env['YYY'] == 'two', env['YYY'] # Test that real_value = [4] def my_tool(env, rv=real_value): assert env['KEY_THAT_I_WANT'] == rv[0] env['KEY_THAT_I_WANT'] = rv[0] + 1 env = self.TestEnvironment() real_value[0] = 5 env = env.Clone(KEY_THAT_I_WANT=5, tools=[my_tool]) assert env['KEY_THAT_I_WANT'] == real_value[0], env['KEY_THAT_I_WANT'] real_value[0] = 6 env = env.Clone(KEY_THAT_I_WANT=6, tools=[my_tool]) assert env['KEY_THAT_I_WANT'] == real_value[0], env['KEY_THAT_I_WANT'] # test for pull request #150 env = self.TestEnvironment() env._dict.pop('BUILDERS') assert ('BUILDERS' in env) is False env2 = env.Clone() def test_Copy(self): """Test copying using the old env.Copy() method""" env1 = self.TestEnvironment(XXX = 'x', YYY = 'y') env2 = env1.Copy() env1copy = env1.Copy() assert env1copy == env1copy assert env2 == env2 env2.Replace(YYY = 'yyy') assert env2 == env2 assert env1 != env2 assert env1 == env1copy def test_Detect(self): """Test Detect()ing tools""" test = TestCmd.TestCmd(workdir = '') test.subdir('sub1', 'sub2') sub1 = test.workpath('sub1') sub2 = test.workpath('sub2') if sys.platform == 'win32': test.write(['sub1', 'xxx'], "sub1/xxx\n") test.write(['sub2', 'xxx'], "sub2/xxx\n") env = self.TestEnvironment(ENV = { 'PATH' : [sub1, sub2] }) x = env.Detect('xxx.exe') assert x is None, x test.write(['sub2', 'xxx.exe'], "sub2/xxx.exe\n") env = self.TestEnvironment(ENV = { 'PATH' : [sub1, sub2] }) x = env.Detect('xxx.exe') assert x == 'xxx.exe', x test.write(['sub1', 'xxx.exe'], "sub1/xxx.exe\n") x = env.Detect('xxx.exe') assert x == 'xxx.exe', x else: test.write(['sub1', 'xxx.exe'], "sub1/xxx.exe\n") test.write(['sub2', 'xxx.exe'], "sub2/xxx.exe\n") env = self.TestEnvironment(ENV = { 'PATH' : [sub1, sub2] }) x = env.Detect('xxx.exe') assert x is None, x sub2_xxx_exe = test.workpath('sub2', 'xxx.exe') os.chmod(sub2_xxx_exe, 0o755) env = self.TestEnvironment(ENV = { 'PATH' : [sub1, sub2] }) x = env.Detect('xxx.exe') assert x == 'xxx.exe', x sub1_xxx_exe = test.workpath('sub1', 'xxx.exe') os.chmod(sub1_xxx_exe, 0o755) x = env.Detect('xxx.exe') assert x == 'xxx.exe', x env = self.TestEnvironment(ENV = { 'PATH' : [] }) x = env.Detect('xxx.exe') assert x is None, x def test_Dictionary(self): """Test retrieval of known construction variables Fetch them from the Dictionary and check for well-known defaults that get inserted. """ env = self.TestEnvironment(XXX = 'x', YYY = 'y', ZZZ = 'z') assert env.Dictionary('XXX') == 'x' assert env.Dictionary('YYY') == 'y' assert env.Dictionary('XXX', 'ZZZ') == ['x', 'z'] xxx, zzz = env.Dictionary('XXX', 'ZZZ') assert xxx == 'x' assert zzz == 'z' assert 'BUILDERS' in env.Dictionary() assert 'CC' in env.Dictionary() assert 'CCFLAGS' in env.Dictionary() assert 'ENV' in env.Dictionary() assert env['XXX'] == 'x' env['XXX'] = 'foo' assert env.Dictionary('XXX') == 'foo' del env['XXX'] assert 'XXX' not in env.Dictionary() def test_FindIxes(self): "Test FindIxes()" env = self.TestEnvironment(LIBPREFIX='lib', LIBSUFFIX='.a', SHLIBPREFIX='lib', SHLIBSUFFIX='.so', PREFIX='pre', SUFFIX='post') paths = [os.path.join('dir', 'libfoo.a'), os.path.join('dir', 'libfoo.so')] assert paths[0] == env.FindIxes(paths, 'LIBPREFIX', 'LIBSUFFIX') assert paths[1] == env.FindIxes(paths, 'SHLIBPREFIX', 'SHLIBSUFFIX') assert None is env.FindIxes(paths, 'PREFIX', 'POST') paths = ['libfoo.a', 'prefoopost'] assert paths[0] == env.FindIxes(paths, 'LIBPREFIX', 'LIBSUFFIX') assert None is env.FindIxes(paths, 'SHLIBPREFIX', 'SHLIBSUFFIX') assert paths[1] == env.FindIxes(paths, 'PREFIX', 'SUFFIX') def test_ParseConfig(self): """Test the ParseConfig() method""" env = self.TestEnvironment(COMMAND='command', ASFLAGS='assembler', CCFLAGS=[''], CPPDEFINES=[], CPPFLAGS=[''], CPPPATH='string', FRAMEWORKPATH=[], FRAMEWORKS=[], LIBPATH=['list'], LIBS='', LINKFLAGS=[''], RPATH=[]) orig_backtick = env.backtick class my_backtick(object): def __init__(self, save_command, output): self.save_command = save_command self.output = output def __call__(self, command): self.save_command.append(command) return self.output try: save_command = [] env.backtick = my_backtick(save_command, "-I/usr/include/fum -I bar -X\n" + \ "-L/usr/fax -L foo -lxxx -l yyy " + \ "-Wa,-as -Wl,-link " + \ "-Wl,-rpath=rpath1 " + \ "-Wl,-R,rpath2 " + \ "-Wl,-Rrpath3 " + \ "-Wp,-cpp abc " + \ "-framework Carbon " + \ "-frameworkdir=fwd1 " + \ "-Ffwd2 " + \ "-F fwd3 " + \ "-pthread " + \ "-mno-cygwin -mwindows " + \ "-arch i386 -isysroot /tmp " + \ "-isystem /usr/include/foo " + \ "+DD64 " + \ "-DFOO -DBAR=value") env.ParseConfig("fake $COMMAND") assert save_command == ['fake command'], save_command assert env['ASFLAGS'] == ['assembler', '-as'], env['ASFLAGS'] assert env['CCFLAGS'] == ['', '-X', '-Wa,-as', '-pthread', '-mno-cygwin', ('-arch', 'i386'), ('-isysroot', '/tmp'), ('-isystem', '/usr/include/foo'), '+DD64'], env['CCFLAGS'] assert env['CPPDEFINES'] == ['FOO', ['BAR', 'value']], env['CPPDEFINES'] assert env['CPPFLAGS'] == ['', '-Wp,-cpp'], env['CPPFLAGS'] assert env['CPPPATH'] == ['string', '/usr/include/fum', 'bar'], env['CPPPATH'] assert env['FRAMEWORKPATH'] == ['fwd1', 'fwd2', 'fwd3'], env['FRAMEWORKPATH'] assert env['FRAMEWORKS'] == ['Carbon'], env['FRAMEWORKS'] assert env['LIBPATH'] == ['list', '/usr/fax', 'foo'], env['LIBPATH'] assert env['LIBS'] == ['xxx', 'yyy', env.File('abc')], env['LIBS'] assert env['LINKFLAGS'] == ['', '-Wl,-link', '-pthread', '-mno-cygwin', '-mwindows', ('-arch', 'i386'), ('-isysroot', '/tmp'), '+DD64'], env['LINKFLAGS'] assert env['RPATH'] == ['rpath1', 'rpath2', 'rpath3'], env['RPATH'] env.backtick = my_backtick([], "-Ibar") env.ParseConfig("fake2") assert env['CPPPATH'] == ['string', '/usr/include/fum', 'bar'], env['CPPPATH'] env.ParseConfig("fake2", unique=0) assert env['CPPPATH'] == ['string', '/usr/include/fum', 'bar', 'bar'], env['CPPPATH'] finally: env.backtick = orig_backtick def test_ParseDepends(self): """Test the ParseDepends() method""" test = TestCmd.TestCmd(workdir = '') test.write('single', """ #file: dependency f0: \ d1 \ d2 \ d3 \ """) test.write('multiple', """ f1: foo f2 f3: bar f4: abc def #file: dependency f5: \ ghi \ jkl \ mno \ """) env = self.TestEnvironment(SINGLE = test.workpath('single')) tlist = [] dlist = [] def my_depends(target, dependency, tlist=tlist, dlist=dlist): tlist.extend(target) dlist.extend(dependency) env.Depends = my_depends env.ParseDepends(test.workpath('does_not_exist')) exc_caught = None try: env.ParseDepends(test.workpath('does_not_exist'), must_exist=1) except IOError: exc_caught = 1 assert exc_caught, "did not catch expected IOError" del tlist[:] del dlist[:] env.ParseDepends('$SINGLE', only_one=1) t = list(map(str, tlist)) d = list(map(str, dlist)) assert t == ['f0'], t assert d == ['d1', 'd2', 'd3'], d del tlist[:] del dlist[:] env.ParseDepends(test.workpath('multiple')) t = list(map(str, tlist)) d = list(map(str, dlist)) assert t == ['f1', 'f2', 'f3', 'f4', 'f5'], t assert d == ['foo', 'bar', 'abc', 'def', 'ghi', 'jkl', 'mno'], d exc_caught = None try: env.ParseDepends(test.workpath('multiple'), only_one=1) except SCons.Errors.UserError: exc_caught = 1 assert exc_caught, "did not catch expected UserError" def test_Platform(self): """Test the Platform() method""" env = self.TestEnvironment(WIN32='win32', NONE='no-such-platform') exc_caught = None try: env.Platform('does_not_exist') except SCons.Errors.UserError: exc_caught = 1 assert exc_caught, "did not catch expected UserError" exc_caught = None try: env.Platform('$NONE') except SCons.Errors.UserError: exc_caught = 1 assert exc_caught, "did not catch expected UserError" env.Platform('posix') assert env['OBJSUFFIX'] == '.o', env['OBJSUFFIX'] env.Platform('$WIN32') assert env['OBJSUFFIX'] == '.obj', env['OBJSUFFIX'] def test_Prepend(self): """Test prepending to construction variables in an Environment """ cases = [ 'a1', 'A1', 'A1a1', 'a2', ['A2'], ['A2', 'a2'], 'a3', UL(['A3']), UL(['A3', 'a', '3']), 'a4', '', 'a4', 'a5', [], ['a5'], 'a6', UL([]), UL(['a', '6']), 'a7', [''], ['', 'a7'], 'a8', UL(['']), UL(['', 'a', '8']), ['e1'], 'E1', ['E1', 'e1'], ['e2'], ['E2'], ['E2', 'e2'], ['e3'], UL(['E3']), UL(['E3', 'e3']), ['e4'], '', ['e4'], ['e5'], [], ['e5'], ['e6'], UL([]), UL(['e6']), ['e7'], [''], ['', 'e7'], ['e8'], UL(['']), UL(['', 'e8']), UL(['i1']), 'I1', UL(['I', '1', 'i1']), UL(['i2']), ['I2'], UL(['I2', 'i2']), UL(['i3']), UL(['I3']), UL(['I3', 'i3']), UL(['i4']), '', UL(['i4']), UL(['i5']), [], UL(['i5']), UL(['i6']), UL([]), UL(['i6']), UL(['i7']), [''], UL(['', 'i7']), UL(['i8']), UL(['']), UL(['', 'i8']), {'d1':1}, 'D1', {'d1':1, 'D1':None}, {'d2':1}, ['D2'], {'d2':1, 'D2':None}, {'d3':1}, UL(['D3']), {'d3':1, 'D3':None}, {'d4':1}, {'D4':1}, {'d4':1, 'D4':1}, {'d5':1}, UD({'D5':1}), UD({'d5':1, 'D5':1}), UD({'u1':1}), 'U1', UD({'u1':1, 'U1':None}), UD({'u2':1}), ['U2'], UD({'u2':1, 'U2':None}), UD({'u3':1}), UL(['U3']), UD({'u3':1, 'U3':None}), UD({'u4':1}), {'U4':1}, UD({'u4':1, 'U4':1}), UD({'u5':1}), UD({'U5':1}), UD({'u5':1, 'U5':1}), '', 'M1', 'M1', '', ['M2'], ['M2'], '', UL(['M3']), UL(['M3']), '', '', '', '', [], [], '', UL([]), UL([]), '', [''], [''], '', UL(['']), UL(['']), [], 'N1', ['N1'], [], ['N2'], ['N2'], [], UL(['N3']), UL(['N3']), [], '', [], [], [], [], [], UL([]), UL([]), [], [''], [''], [], UL(['']), UL(['']), UL([]), 'O1', UL(['O', '1']), UL([]), ['O2'], UL(['O2']), UL([]), UL(['O3']), UL(['O3']), UL([]), '', UL([]), UL([]), [], UL([]), UL([]), UL([]), UL([]), UL([]), [''], UL(['']), UL([]), UL(['']), UL(['']), [''], 'P1', ['P1', ''], [''], ['P2'], ['P2', ''], [''], UL(['P3']), UL(['P3', '']), [''], '', [''], [''], [], [''], [''], UL([]), UL(['']), [''], [''], ['', ''], [''], UL(['']), UL(['', '']), UL(['']), 'Q1', UL(['Q', '1', '']), UL(['']), ['Q2'], UL(['Q2', '']), UL(['']), UL(['Q3']), UL(['Q3', '']), UL(['']), '', UL(['']), UL(['']), [], UL(['']), UL(['']), UL([]), UL(['']), UL(['']), [''], UL(['', '']), UL(['']), UL(['']), UL(['', '']), ] env = Environment() failed = 0 while cases: input, prepend, expect = cases[:3] env['XXX'] = copy.copy(input) try: env.Prepend(XXX = prepend) except Exception as e: if failed == 0: print() print(" %s Prepend %s exception: %s" % \ (repr(input), repr(prepend), e)) failed = failed + 1 else: result = env['XXX'] if result != expect: if failed == 0: print() print(" %s Prepend %s => %s did not match %s" % \ (repr(input), repr(prepend), repr(result), repr(expect))) failed = failed + 1 del cases[:3] assert failed == 0, "%d Prepend() cases failed" % failed env['UL'] = UL(['foo']) env.Prepend(UL = 'bar') result = env['UL'] assert isinstance(result, UL), repr(result) assert result == ['b', 'a', 'r', 'foo'], result env['CLVar'] = CLVar(['foo']) env.Prepend(CLVar = 'bar') result = env['CLVar'] assert isinstance(result, CLVar), repr(result) assert result == ['bar', 'foo'], result env3 = self.TestEnvironment(X = {'x1' : 7}) env3.Prepend(X = {'x1' : 8, 'x2' : 9}, Y = {'y1' : 10}) assert env3['X'] == {'x1': 8, 'x2' : 9}, env3['X'] assert env3['Y'] == {'y1': 10}, env3['Y'] z1 = Builder() z2 = Builder() env4 = self.TestEnvironment(BUILDERS = {'z1' : z1}) env4.Prepend(BUILDERS = {'z2' : z2}) assert env4['BUILDERS'] == {'z1' : z1, 'z2' : z2}, env4['BUILDERS'] assert hasattr(env4, 'z1') assert hasattr(env4, 'z2') def test_PrependENVPath(self): """Test prepending to an ENV path.""" env1 = self.TestEnvironment(ENV = {'PATH': r'C:\dir\num\one;C:\dir\num\two'}, MYENV = {'MYPATH': r'C:\mydir\num\one;C:\mydir\num\two'}) # have to include the pathsep here so that the test will work on UNIX too. env1.PrependENVPath('PATH',r'C:\dir\num\two',sep = ';') env1.PrependENVPath('PATH',r'C:\dir\num\three',sep = ';') env1.PrependENVPath('MYPATH',r'C:\mydir\num\three','MYENV',sep = ';') env1.PrependENVPath('MYPATH',r'C:\mydir\num\one','MYENV',sep = ';') # this should do nothing since delete_existing is 0 env1.PrependENVPath('MYPATH',r'C:\mydir\num\three','MYENV', sep = ';', delete_existing=0) assert(env1['ENV']['PATH'] == r'C:\dir\num\three;C:\dir\num\two;C:\dir\num\one') assert(env1['MYENV']['MYPATH'] == r'C:\mydir\num\one;C:\mydir\num\three;C:\mydir\num\two') test = TestCmd.TestCmd(workdir = '') test.subdir('sub1', 'sub2') p=env1['ENV']['PATH'] env1.PrependENVPath('PATH','#sub1', sep = ';') env1.PrependENVPath('PATH',env1.fs.Dir('sub2'), sep = ';') assert env1['ENV']['PATH'] == 'sub2;sub1;' + p, env1['ENV']['PATH'] def test_PrependUnique(self): """Test prepending unique values to construction variables This strips values that are already present when lists are involved.""" env = self.TestEnvironment(AAA1 = 'a1', AAA2 = 'a2', AAA3 = 'a3', AAA4 = 'a4', AAA5 = 'a5', BBB1 = ['b1'], BBB2 = ['b2'], BBB3 = ['b3'], BBB4 = ['b4'], BBB5 = ['b5'], CCC1 = '', CCC2 = '', DDD1 = ['a', 'b', 'c']) env.PrependUnique(AAA1 = 'a1', AAA2 = ['a2'], AAA3 = ['a3', 'b', 'c', 'b', 'a3'], # ignore dups AAA4 = 'a4.new', AAA5 = ['a5.new'], BBB1 = 'b1', BBB2 = ['b2'], BBB3 = ['b3', 'b', 'c', 'b3'], BBB4 = 'b4.new', BBB5 = ['b5.new'], CCC1 = 'c1', CCC2 = ['c2'], DDD1 = 'b') assert env['AAA1'] == 'a1a1', env['AAA1'] assert env['AAA2'] == ['a2'], env['AAA2'] assert env['AAA3'] == ['c', 'b', 'a3'], env['AAA3'] assert env['AAA4'] == 'a4.newa4', env['AAA4'] assert env['AAA5'] == ['a5.new', 'a5'], env['AAA5'] assert env['BBB1'] == ['b1'], env['BBB1'] assert env['BBB2'] == ['b2'], env['BBB2'] assert env['BBB3'] == ['b', 'c', 'b3'], env['BBB3'] assert env['BBB4'] == ['b4.new', 'b4'], env['BBB4'] assert env['BBB5'] == ['b5.new', 'b5'], env['BBB5'] assert env['CCC1'] == 'c1', env['CCC1'] assert env['CCC2'] == ['c2'], env['CCC2'] assert env['DDD1'] == ['a', 'b', 'c'], env['DDD1'] env.PrependUnique(DDD1 = 'b', delete_existing=1) assert env['DDD1'] == ['b', 'a', 'c'], env['DDD1'] # b moves to front env.PrependUnique(DDD1 = ['a','c'], delete_existing=1) assert env['DDD1'] == ['a', 'c', 'b'], env['DDD1'] # a & c move to front env.PrependUnique(DDD1 = ['d','e','d'], delete_existing=1) assert env['DDD1'] == ['d', 'e', 'a', 'c', 'b'], env['DDD1'] env['CLVar'] = CLVar([]) env.PrependUnique(CLVar = 'bar') result = env['CLVar'] assert isinstance(result, CLVar), repr(result) assert result == ['bar'], result env['CLVar'] = CLVar(['abc']) env.PrependUnique(CLVar = 'bar') result = env['CLVar'] assert isinstance(result, CLVar), repr(result) assert result == ['bar', 'abc'], result env['CLVar'] = CLVar(['bar']) env.PrependUnique(CLVar = 'bar') result = env['CLVar'] assert isinstance(result, CLVar), repr(result) assert result == ['bar'], result def test_Replace(self): """Test replacing construction variables in an Environment After creation of the Environment, of course. """ env1 = self.TestEnvironment(AAA = 'a', BBB = 'b') env1.Replace(BBB = 'bbb', CCC = 'ccc') env2 = self.TestEnvironment(AAA = 'a', BBB = 'bbb', CCC = 'ccc') assert env1 == env2, diff_env(env1, env2) b1 = Builder() b2 = Builder() env3 = self.TestEnvironment(BUILDERS = {'b1' : b1}) assert hasattr(env3, 'b1'), "b1 was not set" env3.Replace(BUILDERS = {'b2' : b2}) assert not hasattr(env3, 'b1'), "b1 was not cleared" assert hasattr(env3, 'b2'), "b2 was not set" def test_ReplaceIxes(self): "Test ReplaceIxes()" env = self.TestEnvironment(LIBPREFIX='lib', LIBSUFFIX='.a', SHLIBPREFIX='lib', SHLIBSUFFIX='.so', PREFIX='pre', SUFFIX='post') assert 'libfoo.a' == env.ReplaceIxes('libfoo.so', 'SHLIBPREFIX', 'SHLIBSUFFIX', 'LIBPREFIX', 'LIBSUFFIX') assert os.path.join('dir', 'libfoo.a') == env.ReplaceIxes(os.path.join('dir', 'libfoo.so'), 'SHLIBPREFIX', 'SHLIBSUFFIX', 'LIBPREFIX', 'LIBSUFFIX') assert 'libfoo.a' == env.ReplaceIxes('prefoopost', 'PREFIX', 'SUFFIX', 'LIBPREFIX', 'LIBSUFFIX') def test_SetDefault(self): """Test the SetDefault method""" env = self.TestEnvironment(tools = []) env.SetDefault(V1 = 1) env.SetDefault(V1 = 2) assert env['V1'] == 1 env['V2'] = 2 env.SetDefault(V2 = 1) assert env['V2'] == 2 def test_Tool(self): """Test the Tool() method""" env = self.TestEnvironment(LINK='link', NONE='no-such-tool') exc_caught = None try: env.Tool('does_not_exist') except SCons.Errors.EnvironmentError: exc_caught = 1 assert exc_caught, "did not catch expected EnvironmentError" exc_caught = None try: env.Tool('$NONE') except SCons.Errors.EnvironmentError: exc_caught = 1 assert exc_caught, "did not catch expected EnvironmentError" # Use a non-existent toolpath directory just to make sure we # can call Tool() with the keyword argument. env.Tool('cc', toolpath=['/no/such/directory']) assert env['CC'] == 'cc', env['CC'] env.Tool('$LINK') assert env['LINK'] == '$SMARTLINK', env['LINK'] # Test that the environment stores the toolpath and # re-uses it for later calls. test = TestCmd.TestCmd(workdir = '') test.write('xxx.py', """\ def exists(env): 1 def generate(env): env['XXX'] = 'one' """) test.write('yyy.py', """\ def exists(env): 1 def generate(env): env['YYY'] = 'two' """) env = self.TestEnvironment(tools=['xxx'], toolpath=[test.workpath('')]) assert env['XXX'] == 'one', env['XXX'] env.Tool('yyy') assert env['YYY'] == 'two', env['YYY'] def test_WhereIs(self): """Test the WhereIs() method""" test = TestCmd.TestCmd(workdir = '') sub1_xxx_exe = test.workpath('sub1', 'xxx.exe') sub2_xxx_exe = test.workpath('sub2', 'xxx.exe') sub3_xxx_exe = test.workpath('sub3', 'xxx.exe') sub4_xxx_exe = test.workpath('sub4', 'xxx.exe') test.subdir('subdir', 'sub1', 'sub2', 'sub3', 'sub4') if sys.platform != 'win32': test.write(sub1_xxx_exe, "\n") os.mkdir(sub2_xxx_exe) test.write(sub3_xxx_exe, "\n") os.chmod(sub3_xxx_exe, 0o777) test.write(sub4_xxx_exe, "\n") os.chmod(sub4_xxx_exe, 0o777) env_path = os.environ['PATH'] pathdirs_1234 = [ test.workpath('sub1'), test.workpath('sub2'), test.workpath('sub3'), test.workpath('sub4'), ] + env_path.split(os.pathsep) pathdirs_1243 = [ test.workpath('sub1'), test.workpath('sub2'), test.workpath('sub4'), test.workpath('sub3'), ] + env_path.split(os.pathsep) path = os.pathsep.join(pathdirs_1234) env = self.TestEnvironment(ENV = {'PATH' : path}) wi = env.WhereIs('xxx.exe') assert wi == test.workpath(sub3_xxx_exe), wi wi = env.WhereIs('xxx.exe', pathdirs_1243) assert wi == test.workpath(sub4_xxx_exe), wi wi = env.WhereIs('xxx.exe', os.pathsep.join(pathdirs_1243)) assert wi == test.workpath(sub4_xxx_exe), wi wi = env.WhereIs('xxx.exe', reject = sub3_xxx_exe) assert wi == test.workpath(sub4_xxx_exe), wi wi = env.WhereIs('xxx.exe', pathdirs_1243, reject = sub3_xxx_exe) assert wi == test.workpath(sub4_xxx_exe), wi path = os.pathsep.join(pathdirs_1243) env = self.TestEnvironment(ENV = {'PATH' : path}) wi = env.WhereIs('xxx.exe') assert wi == test.workpath(sub4_xxx_exe), wi wi = env.WhereIs('xxx.exe', pathdirs_1234) assert wi == test.workpath(sub3_xxx_exe), wi wi = env.WhereIs('xxx.exe', os.pathsep.join(pathdirs_1234)) assert wi == test.workpath(sub3_xxx_exe), wi if sys.platform == 'win32': wi = env.WhereIs('xxx', pathext = '') assert wi is None, wi wi = env.WhereIs('xxx', pathext = '.exe') assert wi == test.workpath(sub4_xxx_exe), wi wi = env.WhereIs('xxx', path = pathdirs_1234, pathext = '.BAT;.EXE') assert wi.lower() == test.workpath(sub3_xxx_exe).lower(), wi # Test that we return a normalized path even when # the path contains forward slashes. forward_slash = test.workpath('') + '/sub3' wi = env.WhereIs('xxx', path = forward_slash, pathext = '.EXE') assert wi.lower() == test.workpath(sub3_xxx_exe).lower(), wi def test_Action(self): """Test the Action() method""" import SCons.Action env = self.TestEnvironment(FOO = 'xyzzy') a = env.Action('foo') assert a, a assert a.__class__ is SCons.Action.CommandAction, a.__class__ a = env.Action('$FOO') assert a, a assert a.__class__ is SCons.Action.CommandAction, a.__class__ a = env.Action('$$FOO') assert a, a assert a.__class__ is SCons.Action.LazyAction, a.__class__ a = env.Action(['$FOO', 'foo']) assert a, a assert a.__class__ is SCons.Action.ListAction, a.__class__ def func(arg): pass a = env.Action(func) assert a, a assert a.__class__ is SCons.Action.FunctionAction, a.__class__ def test_AddPostAction(self): """Test the AddPostAction() method""" env = self.TestEnvironment(FOO='fff', BAR='bbb') n = env.AddPostAction('$FOO', lambda x: x) assert str(n[0]) == 'fff', n[0] n = env.AddPostAction(['ggg', '$BAR'], lambda x: x) assert str(n[0]) == 'ggg', n[0] assert str(n[1]) == 'bbb', n[1] def test_AddPreAction(self): """Test the AddPreAction() method""" env = self.TestEnvironment(FOO='fff', BAR='bbb') n = env.AddPreAction('$FOO', lambda x: x) assert str(n[0]) == 'fff', n[0] n = env.AddPreAction(['ggg', '$BAR'], lambda x: x) assert str(n[0]) == 'ggg', n[0] assert str(n[1]) == 'bbb', n[1] def test_Alias(self): """Test the Alias() method""" env = self.TestEnvironment(FOO='kkk', BAR='lll', EA='export_alias') tgt = env.Alias('new_alias')[0] assert str(tgt) == 'new_alias', tgt assert tgt.sources == [], tgt.sources assert not hasattr(tgt, 'builder'), tgt.builder tgt = env.Alias('None_alias', None)[0] assert str(tgt) == 'None_alias', tgt assert tgt.sources == [], tgt.sources tgt = env.Alias('empty_list', [])[0] assert str(tgt) == 'empty_list', tgt assert tgt.sources == [], tgt.sources tgt = env.Alias('export_alias', [ 'asrc1', '$FOO' ])[0] assert str(tgt) == 'export_alias', tgt assert len(tgt.sources) == 2, list(map(str, tgt.sources)) assert str(tgt.sources[0]) == 'asrc1', list(map(str, tgt.sources)) assert str(tgt.sources[1]) == 'kkk', list(map(str, tgt.sources)) n = env.Alias(tgt, source = ['$BAR', 'asrc4'])[0] assert n is tgt, n assert len(tgt.sources) == 4, list(map(str, tgt.sources)) assert str(tgt.sources[2]) == 'lll', list(map(str, tgt.sources)) assert str(tgt.sources[3]) == 'asrc4', list(map(str, tgt.sources)) n = env.Alias('$EA', 'asrc5')[0] assert n is tgt, n assert len(tgt.sources) == 5, list(map(str, tgt.sources)) assert str(tgt.sources[4]) == 'asrc5', list(map(str, tgt.sources)) t1, t2 = env.Alias(['t1', 't2'], ['asrc6', 'asrc7']) assert str(t1) == 't1', t1 assert str(t2) == 't2', t2 assert len(t1.sources) == 2, list(map(str, t1.sources)) assert str(t1.sources[0]) == 'asrc6', list(map(str, t1.sources)) assert str(t1.sources[1]) == 'asrc7', list(map(str, t1.sources)) assert len(t2.sources) == 2, list(map(str, t2.sources)) assert str(t2.sources[0]) == 'asrc6', list(map(str, t2.sources)) assert str(t2.sources[1]) == 'asrc7', list(map(str, t2.sources)) tgt = env.Alias('add', 's1') tgt = env.Alias('add', 's2')[0] s = list(map(str, tgt.sources)) assert s == ['s1', 's2'], s tgt = env.Alias(tgt, 's3')[0] s = list(map(str, tgt.sources)) assert s == ['s1', 's2', 's3'], s tgt = env.Alias('act', None, "action1")[0] s = str(tgt.builder.action) assert s == "action1", s tgt = env.Alias('act', None, "action2")[0] s = str(tgt.builder.action) assert s == "action1\naction2", s tgt = env.Alias(tgt, None, "action3")[0] s = str(tgt.builder.action) assert s == "action1\naction2\naction3", s def test_AlwaysBuild(self): """Test the AlwaysBuild() method""" env = self.TestEnvironment(FOO='fff', BAR='bbb') t = env.AlwaysBuild('a', 'b$FOO', ['c', 'd'], '$BAR', env.fs.Dir('dir'), env.fs.File('file')) assert t[0].__class__.__name__ == 'Entry' assert t[0].get_internal_path() == 'a' assert t[0].always_build assert t[1].__class__.__name__ == 'Entry' assert t[1].get_internal_path() == 'bfff' assert t[1].always_build assert t[2].__class__.__name__ == 'Entry' assert t[2].get_internal_path() == 'c' assert t[2].always_build assert t[3].__class__.__name__ == 'Entry' assert t[3].get_internal_path() == 'd' assert t[3].always_build assert t[4].__class__.__name__ == 'Entry' assert t[4].get_internal_path() == 'bbb' assert t[4].always_build assert t[5].__class__.__name__ == 'Dir' assert t[5].get_internal_path() == 'dir' assert t[5].always_build assert t[6].__class__.__name__ == 'File' assert t[6].get_internal_path() == 'file' assert t[6].always_build def test_VariantDir(self): """Test the VariantDir() method""" class MyFS(object): def Dir(self, name): return name def VariantDir(self, variant_dir, src_dir, duplicate): self.variant_dir = variant_dir self.src_dir = src_dir self.duplicate = duplicate env = self.TestEnvironment(FOO = 'fff', BAR = 'bbb') env.fs = MyFS() env.VariantDir('build', 'src') assert env.fs.variant_dir == 'build', env.fs.variant_dir assert env.fs.src_dir == 'src', env.fs.src_dir assert env.fs.duplicate == 1, env.fs.duplicate env.VariantDir('build${FOO}', '${BAR}src', 0) assert env.fs.variant_dir == 'buildfff', env.fs.variant_dir assert env.fs.src_dir == 'bbbsrc', env.fs.src_dir assert env.fs.duplicate == 0, env.fs.duplicate def test_Builder(self): """Test the Builder() method""" env = self.TestEnvironment(FOO = 'xyzzy') b = env.Builder(action = 'foo') assert b is not None, b b = env.Builder(action = '$FOO') assert b is not None, b b = env.Builder(action = ['$FOO', 'foo']) assert b is not None, b def func(arg): pass b = env.Builder(action = func) assert b is not None, b b = env.Builder(generator = func) assert b is not None, b def test_CacheDir(self): """Test the CacheDir() method""" env = self.TestEnvironment(CD = 'CacheDir') env.CacheDir('foo') assert env._CacheDir_path == 'foo', env._CacheDir_path env.CacheDir('$CD') assert env._CacheDir_path == 'CacheDir', env._CacheDir_path def test_Clean(self): """Test the Clean() method""" env = self.TestEnvironment(FOO = 'fff', BAR = 'bbb') CT = SCons.Environment.CleanTargets foo = env.arg2nodes('foo')[0] fff = env.arg2nodes('fff')[0] t = env.Clean('foo', 'aaa') l = list(map(str, CT[foo])) assert l == ['aaa'], l t = env.Clean(foo, ['$BAR', 'ccc']) l = list(map(str, CT[foo])) assert l == ['aaa', 'bbb', 'ccc'], l eee = env.arg2nodes('eee')[0] t = env.Clean('$FOO', 'ddd') l = list(map(str, CT[fff])) assert l == ['ddd'], l t = env.Clean(fff, [eee, 'fff']) l = list(map(str, CT[fff])) assert l == ['ddd', 'eee', 'fff'], l def test_Command(self): """Test the Command() method.""" env = Environment() t = env.Command(target='foo.out', source=['foo1.in', 'foo2.in'], action='buildfoo $target $source')[0] assert t.builder is not None assert t.builder.action.__class__.__name__ == 'CommandAction' assert t.builder.action.cmd_list == 'buildfoo $target $source' assert 'foo1.in' in [x.get_internal_path() for x in t.sources] assert 'foo2.in' in [x.get_internal_path() for x in t.sources] sub = env.fs.Dir('sub') t = env.Command(target='bar.out', source='sub', action='buildbar $target $source')[0] assert 'sub' in [x.get_internal_path() for x in t.sources] def testFunc(env, target, source): assert str(target[0]) == 'foo.out' assert 'foo1.in' in list(map(str, source)) and 'foo2.in' in list(map(str, source)), list(map(str, source)) return 0 t = env.Command(target='foo.out', source=['foo1.in','foo2.in'], action=testFunc)[0] assert t.builder is not None assert t.builder.action.__class__.__name__ == 'FunctionAction' t.build() assert 'foo1.in' in [x.get_internal_path() for x in t.sources] assert 'foo2.in' in [x.get_internal_path() for x in t.sources] x = [] def test2(baz, x=x): x.append(baz) env = self.TestEnvironment(TEST2 = test2) t = env.Command(target='baz.out', source='baz.in', action='${TEST2(XYZ)}', XYZ='magic word')[0] assert t.builder is not None t.build() assert x[0] == 'magic word', x t = env.Command(target='${X}.out', source='${X}.in', action = 'foo', X = 'xxx')[0] assert str(t) == 'xxx.out', str(t) assert 'xxx.in' in [x.get_internal_path() for x in t.sources] env = self.TestEnvironment(source_scanner = 'should_not_find_this') t = env.Command(target='file.out', source='file.in', action = 'foo', source_scanner = 'fake')[0] assert t.builder.source_scanner == 'fake', t.builder.source_scanner def test_Configure(self): """Test the Configure() method""" # Configure() will write to a local temporary file. test = TestCmd.TestCmd(workdir = '') save = os.getcwd() try: os.chdir(test.workpath()) env = self.TestEnvironment(FOO = 'xyzzy') def func(arg): pass c = env.Configure() assert c is not None, c c.Finish() c = env.Configure(custom_tests = {'foo' : func, '$FOO' : func}) assert c is not None, c assert hasattr(c, 'foo') assert hasattr(c, 'xyzzy') c.Finish() finally: os.chdir(save) def test_Depends(self): """Test the explicit Depends method.""" env = self.TestEnvironment(FOO = 'xxx', BAR='yyy') env.Dir('dir1') env.Dir('dir2') env.File('xxx.py') env.File('yyy.py') t = env.Depends(target='EnvironmentTest.py', dependency='Environment.py')[0] assert t.__class__.__name__ == 'Entry', t.__class__.__name__ assert t.get_internal_path() == 'EnvironmentTest.py' assert len(t.depends) == 1 d = t.depends[0] assert d.__class__.__name__ == 'Entry', d.__class__.__name__ assert d.get_internal_path() == 'Environment.py' t = env.Depends(target='${FOO}.py', dependency='${BAR}.py')[0] assert t.__class__.__name__ == 'File', t.__class__.__name__ assert t.get_internal_path() == 'xxx.py' assert len(t.depends) == 1 d = t.depends[0] assert d.__class__.__name__ == 'File', d.__class__.__name__ assert d.get_internal_path() == 'yyy.py' t = env.Depends(target='dir1', dependency='dir2')[0] assert t.__class__.__name__ == 'Dir', t.__class__.__name__ assert t.get_internal_path() == 'dir1' assert len(t.depends) == 1 d = t.depends[0] assert d.__class__.__name__ == 'Dir', d.__class__.__name__ assert d.get_internal_path() == 'dir2' def test_Dir(self): """Test the Dir() method""" class MyFS(object): def Dir(self, name): return 'Dir(%s)' % name env = self.TestEnvironment(FOO = 'foodir', BAR = 'bardir') env.fs = MyFS() d = env.Dir('d') assert d == 'Dir(d)', d d = env.Dir('$FOO') assert d == 'Dir(foodir)', d d = env.Dir('${BAR}_$BAR') assert d == 'Dir(bardir_bardir)', d d = env.Dir(['dir1']) assert d == ['Dir(dir1)'], d d = env.Dir(['dir1', 'dir2']) assert d == ['Dir(dir1)', 'Dir(dir2)'], d def test_NoClean(self): """Test the NoClean() method""" env = self.TestEnvironment(FOO='ggg', BAR='hhh') env.Dir('p_hhhb') env.File('p_d') t = env.NoClean('p_a', 'p_${BAR}b', ['p_c', 'p_d'], 'p_$FOO') assert t[0].__class__.__name__ == 'Entry', t[0].__class__.__name__ assert t[0].get_internal_path() == 'p_a' assert t[0].noclean assert t[1].__class__.__name__ == 'Dir', t[1].__class__.__name__ assert t[1].get_internal_path() == 'p_hhhb' assert t[1].noclean assert t[2].__class__.__name__ == 'Entry', t[2].__class__.__name__ assert t[2].get_internal_path() == 'p_c' assert t[2].noclean assert t[3].__class__.__name__ == 'File', t[3].__class__.__name__ assert t[3].get_internal_path() == 'p_d' assert t[3].noclean assert t[4].__class__.__name__ == 'Entry', t[4].__class__.__name__ assert t[4].get_internal_path() == 'p_ggg' assert t[4].noclean def test_Dump(self): """Test the Dump() method""" env = self.TestEnvironment(FOO = 'foo') assert env.Dump('FOO') == "'foo'", env.Dump('FOO') assert len(env.Dump()) > 200, env.Dump() # no args version def test_Environment(self): """Test the Environment() method""" env = self.TestEnvironment(FOO = 'xxx', BAR = 'yyy') e2 = env.Environment(X = '$FOO', Y = '$BAR') assert e2['X'] == 'xxx', e2['X'] assert e2['Y'] == 'yyy', e2['Y'] def test_Execute(self): """Test the Execute() method""" class MyAction(object): def __init__(self, *args, **kw): self.args = args def __call__(self, target, source, env): return "%s executed" % self.args env = Environment() env.Action = MyAction result = env.Execute("foo") assert result == "foo executed", result def test_Entry(self): """Test the Entry() method""" class MyFS(object): def Entry(self, name): return 'Entry(%s)' % name env = self.TestEnvironment(FOO = 'fooentry', BAR = 'barentry') env.fs = MyFS() e = env.Entry('e') assert e == 'Entry(e)', e e = env.Entry('$FOO') assert e == 'Entry(fooentry)', e e = env.Entry('${BAR}_$BAR') assert e == 'Entry(barentry_barentry)', e e = env.Entry(['entry1']) assert e == ['Entry(entry1)'], e e = env.Entry(['entry1', 'entry2']) assert e == ['Entry(entry1)', 'Entry(entry2)'], e def test_File(self): """Test the File() method""" class MyFS(object): def File(self, name): return 'File(%s)' % name env = self.TestEnvironment(FOO = 'foofile', BAR = 'barfile') env.fs = MyFS() f = env.File('f') assert f == 'File(f)', f f = env.File('$FOO') assert f == 'File(foofile)', f f = env.File('${BAR}_$BAR') assert f == 'File(barfile_barfile)', f f = env.File(['file1']) assert f == ['File(file1)'], f f = env.File(['file1', 'file2']) assert f == ['File(file1)', 'File(file2)'], f def test_FindFile(self): """Test the FindFile() method""" env = self.TestEnvironment(FOO = 'fff', BAR = 'bbb') r = env.FindFile('foo', ['no_such_directory']) assert r is None, r # XXX def test_Flatten(self): """Test the Flatten() method""" env = Environment() l = env.Flatten([1]) assert l == [1] l = env.Flatten([1, [2, [3, [4]]]]) assert l == [1, 2, 3, 4], l def test_GetBuildPath(self): """Test the GetBuildPath() method.""" env = self.TestEnvironment(MAGIC = 'xyzzy') p = env.GetBuildPath('foo') assert p == 'foo', p p = env.GetBuildPath('$MAGIC') assert p == 'xyzzy', p def test_Ignore(self): """Test the explicit Ignore method.""" env = self.TestEnvironment(FOO='yyy', BAR='zzz') env.Dir('dir1') env.Dir('dir2') env.File('yyyzzz') env.File('zzzyyy') t = env.Ignore(target='targ.py', dependency='dep.py')[0] assert t.__class__.__name__ == 'Entry', t.__class__.__name__ assert t.get_internal_path() == 'targ.py' assert len(t.ignore) == 1 i = t.ignore[0] assert i.__class__.__name__ == 'Entry', i.__class__.__name__ assert i.get_internal_path() == 'dep.py' t = env.Ignore(target='$FOO$BAR', dependency='$BAR$FOO')[0] assert t.__class__.__name__ == 'File', t.__class__.__name__ assert t.get_internal_path() == 'yyyzzz' assert len(t.ignore) == 1 i = t.ignore[0] assert i.__class__.__name__ == 'File', i.__class__.__name__ assert i.get_internal_path() == 'zzzyyy' t = env.Ignore(target='dir1', dependency='dir2')[0] assert t.__class__.__name__ == 'Dir', t.__class__.__name__ assert t.get_internal_path() == 'dir1' assert len(t.ignore) == 1 i = t.ignore[0] assert i.__class__.__name__ == 'Dir', i.__class__.__name__ assert i.get_internal_path() == 'dir2' def test_Literal(self): """Test the Literal() method""" env = self.TestEnvironment(FOO='fff', BAR='bbb') list = env.subst_list([env.Literal('$FOO'), '$BAR'])[0] assert list == ['$FOO', 'bbb'], list list = env.subst_list(['$FOO', env.Literal('$BAR')])[0] assert list == ['fff', '$BAR'], list def test_Local(self): """Test the Local() method.""" env = self.TestEnvironment(FOO='lll') l = env.Local(env.fs.File('fff')) assert str(l[0]) == 'fff', l[0] l = env.Local('ggg', '$FOO') assert str(l[0]) == 'ggg', l[0] assert str(l[1]) == 'lll', l[1] def test_Precious(self): """Test the Precious() method""" env = self.TestEnvironment(FOO='ggg', BAR='hhh') env.Dir('p_hhhb') env.File('p_d') t = env.Precious('p_a', 'p_${BAR}b', ['p_c', 'p_d'], 'p_$FOO') assert t[0].__class__.__name__ == 'Entry', t[0].__class__.__name__ assert t[0].get_internal_path() == 'p_a' assert t[0].precious assert t[1].__class__.__name__ == 'Dir', t[1].__class__.__name__ assert t[1].get_internal_path() == 'p_hhhb' assert t[1].precious assert t[2].__class__.__name__ == 'Entry', t[2].__class__.__name__ assert t[2].get_internal_path() == 'p_c' assert t[2].precious assert t[3].__class__.__name__ == 'File', t[3].__class__.__name__ assert t[3].get_internal_path() == 'p_d' assert t[3].precious assert t[4].__class__.__name__ == 'Entry', t[4].__class__.__name__ assert t[4].get_internal_path() == 'p_ggg' assert t[4].precious def test_Pseudo(self): """Test the Pseudo() method""" env = self.TestEnvironment(FOO='ggg', BAR='hhh') env.Dir('p_hhhb') env.File('p_d') t = env.Pseudo('p_a', 'p_${BAR}b', ['p_c', 'p_d'], 'p_$FOO') assert t[0].__class__.__name__ == 'Entry', t[0].__class__.__name__ assert t[0].get_internal_path() == 'p_a' assert t[0].pseudo assert t[1].__class__.__name__ == 'Dir', t[1].__class__.__name__ assert t[1].get_internal_path() == 'p_hhhb' assert t[1].pseudo assert t[2].__class__.__name__ == 'Entry', t[2].__class__.__name__ assert t[2].get_internal_path() == 'p_c' assert t[2].pseudo assert t[3].__class__.__name__ == 'File', t[3].__class__.__name__ assert t[3].get_internal_path() == 'p_d' assert t[3].pseudo assert t[4].__class__.__name__ == 'Entry', t[4].__class__.__name__ assert t[4].get_internal_path() == 'p_ggg' assert t[4].pseudo def test_Repository(self): """Test the Repository() method.""" class MyFS(object): def __init__(self): self.list = [] def Repository(self, *dirs): self.list.extend(list(dirs)) def Dir(self, name): return name env = self.TestEnvironment(FOO='rrr', BAR='sss') env.fs = MyFS() env.Repository('/tmp/foo') env.Repository('/tmp/$FOO', '/tmp/$BAR/foo') expect = ['/tmp/foo', '/tmp/rrr', '/tmp/sss/foo'] assert env.fs.list == expect, env.fs.list def test_Scanner(self): """Test the Scanner() method""" def scan(node, env, target, arg): pass env = self.TestEnvironment(FOO = scan) s = env.Scanner('foo') assert s is not None, s s = env.Scanner(function = 'foo') assert s is not None, s if 0: s = env.Scanner('$FOO') assert s is not None, s s = env.Scanner(function = '$FOO') assert s is not None, s def test_SConsignFile(self): """Test the SConsignFile() method""" import SCons.SConsign class MyFS(object): SConstruct_dir = os.sep + 'dir' env = self.TestEnvironment(FOO = 'SConsign', BAR = os.path.join(os.sep, 'File')) env.fs = MyFS() env.Execute = lambda action: None try: fnames = [] dbms = [] def capture(name, dbm_module, fnames=fnames, dbms=dbms): fnames.append(name) dbms.append(dbm_module) save_SConsign_File = SCons.SConsign.File SCons.SConsign.File = capture env.SConsignFile('foo') assert fnames[-1] == os.path.join(os.sep, 'dir', 'foo'), fnames assert dbms[-1] is None, dbms env.SConsignFile('$FOO') assert fnames[-1] == os.path.join(os.sep, 'dir', 'SConsign'), fnames assert dbms[-1] is None, dbms env.SConsignFile('/$FOO') assert fnames[-1] == os.sep + 'SConsign', fnames assert dbms[-1] is None, dbms env.SConsignFile(os.sep + '$FOO') assert fnames[-1] == os.sep + 'SConsign', fnames assert dbms[-1] is None, dbms env.SConsignFile('$BAR', 'x') assert fnames[-1] == os.path.join(os.sep, 'File'), fnames assert dbms[-1] == 'x', dbms env.SConsignFile('__$BAR', 7) assert fnames[-1] == os.path.join(os.sep, 'dir', '__', 'File'), fnames assert dbms[-1] == 7, dbms env.SConsignFile() assert fnames[-1] == os.path.join(os.sep, 'dir', '.sconsign'), fnames assert dbms[-1] is None, dbms env.SConsignFile(None) assert fnames[-1] is None, fnames assert dbms[-1] is None, dbms finally: SCons.SConsign.File = save_SConsign_File def test_SideEffect(self): """Test the SideEffect() method""" env = self.TestEnvironment(LIB='lll', FOO='fff', BAR='bbb') env.File('mylll.pdb') env.Dir('mymmm.pdb') foo = env.Object('foo.obj', 'foo.cpp')[0] bar = env.Object('bar.obj', 'bar.cpp')[0] s = env.SideEffect('mylib.pdb', ['foo.obj', 'bar.obj'])[0] assert s.__class__.__name__ == 'Entry', s.__class__.__name__ assert s.get_internal_path() == 'mylib.pdb' assert s.side_effect assert foo.side_effects == [s] assert bar.side_effects == [s] fff = env.Object('fff.obj', 'fff.cpp')[0] bbb = env.Object('bbb.obj', 'bbb.cpp')[0] s = env.SideEffect('my${LIB}.pdb', ['${FOO}.obj', '${BAR}.obj'])[0] assert s.__class__.__name__ == 'File', s.__class__.__name__ assert s.get_internal_path() == 'mylll.pdb' assert s.side_effect assert fff.side_effects == [s], fff.side_effects assert bbb.side_effects == [s], bbb.side_effects ggg = env.Object('ggg.obj', 'ggg.cpp')[0] ccc = env.Object('ccc.obj', 'ccc.cpp')[0] s = env.SideEffect('mymmm.pdb', ['ggg.obj', 'ccc.obj'])[0] assert s.__class__.__name__ == 'Dir', s.__class__.__name__ assert s.get_internal_path() == 'mymmm.pdb' assert s.side_effect assert ggg.side_effects == [s], ggg.side_effects assert ccc.side_effects == [s], ccc.side_effects def test_SourceCode(self): """Test the SourceCode() method.""" env = self.TestEnvironment(FOO='mmm', BAR='nnn') e = env.SourceCode('foo', None)[0] assert e.get_internal_path() == 'foo' s = e.src_builder() assert s is None, s b = Builder() e = env.SourceCode(e, b)[0] assert e.get_internal_path() == 'foo' s = e.src_builder() assert s is b, s e = env.SourceCode('$BAR$FOO', None)[0] assert e.get_internal_path() == 'nnnmmm' s = e.src_builder() assert s is None, s def test_SourceSignatures(type): """Test the SourceSignatures() method""" import SCons.Errors env = type.TestEnvironment(M = 'MD5', T = 'timestamp') exc_caught = None try: env.SourceSignatures('invalid_type') except SCons.Errors.UserError: exc_caught = 1 assert exc_caught, "did not catch expected UserError" env.SourceSignatures('MD5') assert env.src_sig_type == 'MD5', env.src_sig_type env.SourceSignatures('$M') assert env.src_sig_type == 'MD5', env.src_sig_type env.SourceSignatures('timestamp') assert env.src_sig_type == 'timestamp', env.src_sig_type env.SourceSignatures('$T') assert env.src_sig_type == 'timestamp', env.src_sig_type try: import SCons.Util save_md5 = SCons.Util.md5 SCons.Util.md5 = None try: env.SourceSignatures('MD5') except SCons.Errors.UserError: pass else: self.fail('Did not catch expected UserError') finally: SCons.Util.md5 = save_md5 def test_Split(self): """Test the Split() method""" env = self.TestEnvironment(FOO='fff', BAR='bbb') s = env.Split("foo bar") assert s == ["foo", "bar"], s s = env.Split("$FOO bar") assert s == ["fff", "bar"], s s = env.Split(["foo", "bar"]) assert s == ["foo", "bar"], s s = env.Split(["foo", "${BAR}-bbb"]) assert s == ["foo", "bbb-bbb"], s s = env.Split("foo") assert s == ["foo"], s s = env.Split("$FOO$BAR") assert s == ["fffbbb"], s def test_TargetSignatures(type): """Test the TargetSignatures() method""" import SCons.Errors env = type.TestEnvironment(B = 'build', C = 'content') exc_caught = None try: env.TargetSignatures('invalid_type') except SCons.Errors.UserError: exc_caught = 1 assert exc_caught, "did not catch expected UserError" assert not hasattr(env, '_build_signature') env.TargetSignatures('build') assert env.tgt_sig_type == 'build', env.tgt_sig_type env.TargetSignatures('$B') assert env.tgt_sig_type == 'build', env.tgt_sig_type env.TargetSignatures('content') assert env.tgt_sig_type == 'content', env.tgt_sig_type env.TargetSignatures('$C') assert env.tgt_sig_type == 'content', env.tgt_sig_type env.TargetSignatures('MD5') assert env.tgt_sig_type == 'MD5', env.tgt_sig_type env.TargetSignatures('timestamp') assert env.tgt_sig_type == 'timestamp', env.tgt_sig_type try: import SCons.Util save_md5 = SCons.Util.md5 SCons.Util.md5 = None try: env.TargetSignatures('MD5') except SCons.Errors.UserError: pass else: self.fail('Did not catch expected UserError') try: env.TargetSignatures('content') except SCons.Errors.UserError: pass else: self.fail('Did not catch expected UserError') finally: SCons.Util.md5 = save_md5 def test_Value(self): """Test creating a Value() object """ env = Environment() v1 = env.Value('a') assert v1.value == 'a', v1.value value2 = 'a' v2 = env.Value(value2) assert v2.value == value2, v2.value assert v2.value is value2, v2.value assert not v1 is v2 assert v1.value == v2.value v3 = env.Value('c', 'build-c') assert v3.value == 'c', v3.value def test_Environment_global_variable(type): """Test setting Environment variable to an Environment.Base subclass""" class MyEnv(SCons.Environment.Base): def xxx(self, string): return self.subst(string) SCons.Environment.Environment = MyEnv env = SCons.Environment.Environment(FOO = 'foo') f = env.subst('$FOO') assert f == 'foo', f f = env.xxx('$FOO') assert f == 'foo', f def test_bad_keywords(self): """Test trying to use reserved keywords in an Environment""" added = [] env = self.TestEnvironment(TARGETS = 'targets', SOURCES = 'sources', SOURCE = 'source', TARGET = 'target', CHANGED_SOURCES = 'changed_sources', CHANGED_TARGETS = 'changed_targets', UNCHANGED_SOURCES = 'unchanged_sources', UNCHANGED_TARGETS = 'unchanged_targets', INIT = 'init') bad_msg = '%s is not reserved, but got omitted; see Environment.construction_var_name_ok' added.append('INIT') for x in self.reserved_variables: assert x not in env, env[x] for x in added: assert x in env, bad_msg % x env.Append(TARGETS = 'targets', SOURCES = 'sources', SOURCE = 'source', TARGET = 'target', CHANGED_SOURCES = 'changed_sources', CHANGED_TARGETS = 'changed_targets', UNCHANGED_SOURCES = 'unchanged_sources', UNCHANGED_TARGETS = 'unchanged_targets', APPEND = 'append') added.append('APPEND') for x in self.reserved_variables: assert x not in env, env[x] for x in added: assert x in env, bad_msg % x env.AppendUnique(TARGETS = 'targets', SOURCES = 'sources', SOURCE = 'source', TARGET = 'target', CHANGED_SOURCES = 'changed_sources', CHANGED_TARGETS = 'changed_targets', UNCHANGED_SOURCES = 'unchanged_sources', UNCHANGED_TARGETS = 'unchanged_targets', APPENDUNIQUE = 'appendunique') added.append('APPENDUNIQUE') for x in self.reserved_variables: assert x not in env, env[x] for x in added: assert x in env, bad_msg % x env.Prepend(TARGETS = 'targets', SOURCES = 'sources', SOURCE = 'source', TARGET = 'target', CHANGED_SOURCES = 'changed_sources', CHANGED_TARGETS = 'changed_targets', UNCHANGED_SOURCES = 'unchanged_sources', UNCHANGED_TARGETS = 'unchanged_targets', PREPEND = 'prepend') added.append('PREPEND') for x in self.reserved_variables: assert x not in env, env[x] for x in added: assert x in env, bad_msg % x env.Prepend(TARGETS = 'targets', SOURCES = 'sources', SOURCE = 'source', TARGET = 'target', CHANGED_SOURCES = 'changed_sources', CHANGED_TARGETS = 'changed_targets', UNCHANGED_SOURCES = 'unchanged_sources', UNCHANGED_TARGETS = 'unchanged_targets', PREPENDUNIQUE = 'prependunique') added.append('PREPENDUNIQUE') for x in self.reserved_variables: assert x not in env, env[x] for x in added: assert x in env, bad_msg % x env.Replace(TARGETS = 'targets', SOURCES = 'sources', SOURCE = 'source', TARGET = 'target', CHANGED_SOURCES = 'changed_sources', CHANGED_TARGETS = 'changed_targets', UNCHANGED_SOURCES = 'unchanged_sources', UNCHANGED_TARGETS = 'unchanged_targets', REPLACE = 'replace') added.append('REPLACE') for x in self.reserved_variables: assert x not in env, env[x] for x in added: assert x in env, bad_msg % x copy = env.Clone(TARGETS = 'targets', SOURCES = 'sources', SOURCE = 'source', TARGET = 'target', CHANGED_SOURCES = 'changed_sources', CHANGED_TARGETS = 'changed_targets', UNCHANGED_SOURCES = 'unchanged_sources', UNCHANGED_TARGETS = 'unchanged_targets', COPY = 'copy') for x in self.reserved_variables: assert x not in copy, env[x] for x in added + ['COPY']: assert x in copy, bad_msg % x over = env.Override({'TARGETS' : 'targets', 'SOURCES' : 'sources', 'SOURCE' : 'source', 'TARGET' : 'target', 'CHANGED_SOURCES' : 'changed_sources', 'CHANGED_TARGETS' : 'changed_targets', 'UNCHANGED_SOURCES' : 'unchanged_sources', 'UNCHANGED_TARGETS' : 'unchanged_targets', 'OVERRIDE' : 'override'}) for x in self.reserved_variables: assert x not in over, over[x] for x in added + ['OVERRIDE']: assert x in over, bad_msg % x def test_parse_flags(self): '''Test the Base class parse_flags argument''' # all we have to show is that it gets to MergeFlags internally env = Environment(tools=[], parse_flags = '-X') assert env['CCFLAGS'] == ['-X'], env['CCFLAGS'] env = Environment(tools=[], CCFLAGS=None, parse_flags = '-Y') assert env['CCFLAGS'] == ['-Y'], env['CCFLAGS'] env = Environment(tools=[], CPPDEFINES = 'FOO', parse_flags = '-std=c99 -X -DBAR') assert env['CFLAGS'] == ['-std=c99'], env['CFLAGS'] assert env['CCFLAGS'] == ['-X'], env['CCFLAGS'] assert env['CPPDEFINES'] == ['FOO', 'BAR'], env['CPPDEFINES'] def test_clone_parse_flags(self): '''Test the env.Clone() parse_flags argument''' # all we have to show is that it gets to MergeFlags internally env = Environment(tools = []) env2 = env.Clone(parse_flags = '-X') assert 'CCFLAGS' not in env assert env2['CCFLAGS'] == ['-X'], env2['CCFLAGS'] env = Environment(tools = [], CCFLAGS=None) env2 = env.Clone(parse_flags = '-Y') assert env['CCFLAGS'] is None, env['CCFLAGS'] assert env2['CCFLAGS'] == ['-Y'], env2['CCFLAGS'] env = Environment(tools = [], CPPDEFINES = 'FOO') env2 = env.Clone(parse_flags = '-std=c99 -X -DBAR') assert 'CFLAGS' not in env assert env2['CFLAGS'] == ['-std=c99'], env2['CFLAGS'] assert 'CCFLAGS' not in env assert env2['CCFLAGS'] == ['-X'], env2['CCFLAGS'] assert env['CPPDEFINES'] == 'FOO', env['CPPDEFINES'] assert env2['CPPDEFINES'] == ['FOO','BAR'], env2['CPPDEFINES'] class OverrideEnvironmentTestCase(unittest.TestCase,TestEnvironmentFixture): def setUp(self): env = Environment() env._dict = {'XXX' : 'x', 'YYY' : 'y'} env2 = OverrideEnvironment(env, {'XXX' : 'x2'}) env3 = OverrideEnvironment(env2, {'XXX' : 'x3', 'YYY' : 'y3', 'ZZZ' : 'z3'}) self.envs = [ env, env2, env3 ] def checkpath(self, node, expect): return str(node) == os.path.normpath(expect) def test___init__(self): """Test OverrideEnvironment initialization""" env, env2, env3 = self.envs assert env['XXX'] == 'x', env['XXX'] assert env2['XXX'] == 'x2', env2['XXX'] assert env3['XXX'] == 'x3', env3['XXX'] assert env['YYY'] == 'y', env['YYY'] assert env2['YYY'] == 'y', env2['YYY'] assert env3['YYY'] == 'y3', env3['YYY'] def test___delitem__(self): """Test deleting variables from an OverrideEnvironment""" env, env2, env3 = self.envs del env3['XXX'] assert 'XXX' not in env, "env has XXX?" assert 'XXX' not in env2, "env2 has XXX?" assert 'XXX' not in env3, "env3 has XXX?" del env3['YYY'] assert 'YYY' not in env, "env has YYY?" assert 'YYY' not in env2, "env2 has YYY?" assert 'YYY' not in env3, "env3 has YYY?" del env3['ZZZ'] assert 'ZZZ' not in env, "env has ZZZ?" assert 'ZZZ' not in env2, "env2 has ZZZ?" assert 'ZZZ' not in env3, "env3 has ZZZ?" def test_get(self): """Test the OverrideEnvironment get() method""" env, env2, env3 = self.envs assert env.get('XXX') == 'x', env.get('XXX') assert env2.get('XXX') == 'x2', env2.get('XXX') assert env3.get('XXX') == 'x3', env3.get('XXX') assert env.get('YYY') == 'y', env.get('YYY') assert env2.get('YYY') == 'y', env2.get('YYY') assert env3.get('YYY') == 'y3', env3.get('YYY') assert env.get('ZZZ') is None, env.get('ZZZ') assert env2.get('ZZZ') is None, env2.get('ZZZ') assert env3.get('ZZZ') == 'z3', env3.get('ZZZ') def test_has_key(self): """Test the OverrideEnvironment has_key() method""" env, env2, env3 = self.envs assert 'XXX' in env, 'XXX' in env assert 'XXX' in env2, 'XXX' in env2 assert 'XXX' in env3, 'XXX' in env3 assert 'YYY' in env, 'YYY' in env assert 'YYY' in env2, 'YYY' in env2 assert 'YYY' in env3, 'YYY' in env3 assert 'ZZZ' not in env, 'ZZZ' in env assert 'ZZZ' not in env2, 'ZZZ' in env2 assert 'ZZZ' in env3, 'ZZZ' in env3 def test_contains(self): """Test the OverrideEnvironment __contains__() method""" env, env2, env3 = self.envs assert 'XXX' in env assert 'XXX' in env2 assert 'XXX' in env3 assert 'YYY' in env assert 'YYY' in env2 assert 'YYY' in env3 assert not 'ZZZ' in env assert not 'ZZZ' in env2 assert 'ZZZ' in env3 def test_items(self): """Test the OverrideEnvironment Dictionary() method""" env, env2, env3 = self.envs items = env.Dictionary() assert items == {'XXX' : 'x', 'YYY' : 'y'}, items items = env2.Dictionary() assert items == {'XXX' : 'x2', 'YYY' : 'y'}, items items = env3.Dictionary() assert items == {'XXX' : 'x3', 'YYY' : 'y3', 'ZZZ' : 'z3'}, items def test_items(self): """Test the OverrideEnvironment items() method""" env, env2, env3 = self.envs items = sorted(env.items()) assert items == [('XXX', 'x'), ('YYY', 'y')], items items = sorted(env2.items()) assert items == [('XXX', 'x2'), ('YYY', 'y')], items items = sorted(env3.items()) assert items == [('XXX', 'x3'), ('YYY', 'y3'), ('ZZZ', 'z3')], items def test_gvars(self): """Test the OverrideEnvironment gvars() method""" env, env2, env3 = self.envs gvars = env.gvars() assert gvars == {'XXX' : 'x', 'YYY' : 'y'}, gvars gvars = env2.gvars() assert gvars == {'XXX' : 'x', 'YYY' : 'y'}, gvars gvars = env3.gvars() assert gvars == {'XXX' : 'x', 'YYY' : 'y'}, gvars def test_lvars(self): """Test the OverrideEnvironment lvars() method""" env, env2, env3 = self.envs lvars = env.lvars() assert lvars == {}, lvars lvars = env2.lvars() assert lvars == {'XXX' : 'x2'}, lvars lvars = env3.lvars() assert lvars == {'XXX' : 'x3', 'YYY' : 'y3', 'ZZZ' : 'z3'}, lvars def test_Replace(self): """Test the OverrideEnvironment Replace() method""" env, env2, env3 = self.envs assert env['XXX'] == 'x', env['XXX'] assert env2['XXX'] == 'x2', env2['XXX'] assert env3['XXX'] == 'x3', env3['XXX'] assert env['YYY'] == 'y', env['YYY'] assert env2['YYY'] == 'y', env2['YYY'] assert env3['YYY'] == 'y3', env3['YYY'] env.Replace(YYY = 'y4') assert env['XXX'] == 'x', env['XXX'] assert env2['XXX'] == 'x2', env2['XXX'] assert env3['XXX'] == 'x3', env3['XXX'] assert env['YYY'] == 'y4', env['YYY'] assert env2['YYY'] == 'y4', env2['YYY'] assert env3['YYY'] == 'y3', env3['YYY'] # Tests a number of Base methods through an OverrideEnvironment to # make sure they handle overridden constructionv variables properly. # # The following Base methods also call self.subst(), and so could # theoretically be subject to problems with evaluating overridden # variables, but they're never really called that way in the rest # of our code, so we won't worry about them (at least for now): # # ParseConfig() # ParseDepends() # Platform() # Tool() # # Action() # Alias() # Builder() # CacheDir() # Configure() # Environment() # FindFile() # Scanner() # SourceSignatures() # TargetSignatures() # It's unlikely Clone() will ever be called this way, so let the # other methods test that handling overridden values works. #def test_Clone(self): # """Test the OverrideEnvironment Clone() method""" # pass def test_FindIxes(self): """Test the OverrideEnvironment FindIxes() method""" env, env2, env3 = self.envs x = env.FindIxes(['xaaay'], 'XXX', 'YYY') assert x == 'xaaay', x x = env2.FindIxes(['x2aaay'], 'XXX', 'YYY') assert x == 'x2aaay', x x = env3.FindIxes(['x3aaay3'], 'XXX', 'YYY') assert x == 'x3aaay3', x def test_ReplaceIxes(self): """Test the OverrideEnvironment ReplaceIxes() method""" env, env2, env3 = self.envs x = env.ReplaceIxes('xaaay', 'XXX', 'YYY', 'YYY', 'XXX') assert x == 'yaaax', x x = env2.ReplaceIxes('x2aaay', 'XXX', 'YYY', 'YYY', 'XXX') assert x == 'yaaax2', x x = env3.ReplaceIxes('x3aaay3', 'XXX', 'YYY', 'YYY', 'XXX') assert x == 'y3aaax3', x # It's unlikely WhereIs() will ever be called this way, so let the # other methods test that handling overridden values works. #def test_WhereIs(self): # """Test the OverrideEnvironment WhereIs() method""" # pass def test_Dir(self): """Test the OverrideEnvironment Dir() method""" env, env2, env3 = self.envs x = env.Dir('ddir/$XXX') assert self.checkpath(x, 'ddir/x'), str(x) x = env2.Dir('ddir/$XXX') assert self.checkpath(x, 'ddir/x2'), str(x) x = env3.Dir('ddir/$XXX') assert self.checkpath(x, 'ddir/x3'), str(x) def test_Entry(self): """Test the OverrideEnvironment Entry() method""" env, env2, env3 = self.envs x = env.Entry('edir/$XXX') assert self.checkpath(x, 'edir/x'), str(x) x = env2.Entry('edir/$XXX') assert self.checkpath(x, 'edir/x2'), str(x) x = env3.Entry('edir/$XXX') assert self.checkpath(x, 'edir/x3'), str(x) def test_File(self): """Test the OverrideEnvironment File() method""" env, env2, env3 = self.envs x = env.File('fdir/$XXX') assert self.checkpath(x, 'fdir/x'), str(x) x = env2.File('fdir/$XXX') assert self.checkpath(x, 'fdir/x2'), str(x) x = env3.File('fdir/$XXX') assert self.checkpath(x, 'fdir/x3'), str(x) def test_Split(self): """Test the OverrideEnvironment Split() method""" env, env2, env3 = self.envs env['AAA'] = '$XXX $YYY $ZZZ' x = env.Split('$AAA') assert x == ['x', 'y'], x x = env2.Split('$AAA') assert x == ['x2', 'y'], x x = env3.Split('$AAA') assert x == ['x3', 'y3', 'z3'], x def test_parse_flags(self): '''Test the OverrideEnvironment parse_flags argument''' # all we have to show is that it gets to MergeFlags internally env = SubstitutionEnvironment() env2 = env.Override({'parse_flags' : '-X'}) assert 'CCFLAGS' not in env assert env2['CCFLAGS'] == ['-X'], env2['CCFLAGS'] env = SubstitutionEnvironment(CCFLAGS=None) env2 = env.Override({'parse_flags' : '-Y'}) assert env['CCFLAGS'] is None, env['CCFLAGS'] assert env2['CCFLAGS'] == ['-Y'], env2['CCFLAGS'] env = SubstitutionEnvironment(CPPDEFINES = 'FOO') env2 = env.Override({'parse_flags' : '-std=c99 -X -DBAR'}) assert 'CFLAGS' not in env assert env2['CFLAGS'] == ['-std=c99'], env2['CFLAGS'] assert 'CCFLAGS' not in env assert env2['CCFLAGS'] == ['-X'], env2['CCFLAGS'] assert env['CPPDEFINES'] == 'FOO', env['CPPDEFINES'] assert env2['CPPDEFINES'] == ['FOO','BAR'], env2['CPPDEFINES'] class NoSubstitutionProxyTestCase(unittest.TestCase,TestEnvironmentFixture): def test___init__(self): """Test NoSubstitutionProxy initialization""" env = self.TestEnvironment(XXX = 'x', YYY = 'y') assert env['XXX'] == 'x', env['XXX'] assert env['YYY'] == 'y', env['YYY'] proxy = NoSubstitutionProxy(env) assert proxy['XXX'] == 'x', proxy['XXX'] assert proxy['YYY'] == 'y', proxy['YYY'] def test_attributes(self): """Test getting and setting NoSubstitutionProxy attributes""" env = Environment() setattr(env, 'env_attr', 'value1') proxy = NoSubstitutionProxy(env) setattr(proxy, 'proxy_attr', 'value2') x = getattr(env, 'env_attr') assert x == 'value1', x x = getattr(proxy, 'env_attr') assert x == 'value1', x x = getattr(env, 'proxy_attr') assert x == 'value2', x x = getattr(proxy, 'proxy_attr') assert x == 'value2', x def test_subst(self): """Test the NoSubstitutionProxy.subst() method""" env = self.TestEnvironment(XXX = 'x', YYY = 'y') assert env['XXX'] == 'x', env['XXX'] assert env['YYY'] == 'y', env['YYY'] proxy = NoSubstitutionProxy(env) assert proxy['XXX'] == 'x', proxy['XXX'] assert proxy['YYY'] == 'y', proxy['YYY'] x = env.subst('$XXX') assert x == 'x', x x = proxy.subst('$XXX') assert x == '$XXX', x x = proxy.subst('$YYY', raw=7, target=None, source=None, conv=None, extra_meaningless_keyword_argument=None) assert x == '$YYY', x def test_subst_kw(self): """Test the NoSubstitutionProxy.subst_kw() method""" env = self.TestEnvironment(XXX = 'x', YYY = 'y') assert env['XXX'] == 'x', env['XXX'] assert env['YYY'] == 'y', env['YYY'] proxy = NoSubstitutionProxy(env) assert proxy['XXX'] == 'x', proxy['XXX'] assert proxy['YYY'] == 'y', proxy['YYY'] x = env.subst_kw({'$XXX':'$YYY'}) assert x == {'x':'y'}, x x = proxy.subst_kw({'$XXX':'$YYY'}) assert x == {'$XXX':'$YYY'}, x def test_subst_list(self): """Test the NoSubstitutionProxy.subst_list() method""" env = self.TestEnvironment(XXX = 'x', YYY = 'y') assert env['XXX'] == 'x', env['XXX'] assert env['YYY'] == 'y', env['YYY'] proxy = NoSubstitutionProxy(env) assert proxy['XXX'] == 'x', proxy['XXX'] assert proxy['YYY'] == 'y', proxy['YYY'] x = env.subst_list('$XXX') assert x == [['x']], x x = proxy.subst_list('$XXX') assert x == [[]], x x = proxy.subst_list('$YYY', raw=0, target=None, source=None, conv=None) assert x == [[]], x def test_subst_target_source(self): """Test the NoSubstitutionProxy.subst_target_source() method""" env = self.TestEnvironment(XXX = 'x', YYY = 'y') assert env['XXX'] == 'x', env['XXX'] assert env['YYY'] == 'y', env['YYY'] proxy = NoSubstitutionProxy(env) assert proxy['XXX'] == 'x', proxy['XXX'] assert proxy['YYY'] == 'y', proxy['YYY'] args = ('$XXX $TARGET $SOURCE $YYY',) kw = {'target' : DummyNode('ttt'), 'source' : DummyNode('sss')} x = env.subst_target_source(*args, **kw) assert x == 'x ttt sss y', x x = proxy.subst_target_source(*args, **kw) assert x == ' ttt sss ', x class EnvironmentVariableTestCase(unittest.TestCase): def test_is_valid_construction_var(self): """Testing is_valid_construction_var()""" r = is_valid_construction_var("_a") assert r is not None, r r = is_valid_construction_var("z_") assert r is not None, r r = is_valid_construction_var("X_") assert r is not None, r r = is_valid_construction_var("2a") assert r is None, r r = is_valid_construction_var("a2_") assert r is not None, r r = is_valid_construction_var("/") assert r is None, r r = is_valid_construction_var("_/") assert r is None, r r = is_valid_construction_var("a/") assert r is None, r r = is_valid_construction_var(".b") assert r is None, r r = is_valid_construction_var("_.b") assert r is None, r r = is_valid_construction_var("b1._") assert r is None, r r = is_valid_construction_var("-b") assert r is None, r r = is_valid_construction_var("_-b") assert r is None, r r = is_valid_construction_var("b1-_") assert r is None, r if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ SubstitutionTestCase, BaseTestCase, OverrideEnvironmentTestCase, NoSubstitutionProxyTestCase, EnvironmentVariableTestCase ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/cppTests.py0000664000175000017500000004316013160023045020722 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import absolute_import __revision__ = "src/engine/SCons/cppTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import atexit import sys import unittest import TestUnit import cpp basic_input = """ #include "file1-yes" #include """ substitution_input = """ #define FILE3 "file3-yes" #define FILE4 #include FILE3 #include FILE4 #define XXX_FILE5 YYY_FILE5 #define YYY_FILE5 ZZZ_FILE5 #define ZZZ_FILE5 FILE5 #define FILE5 "file5-yes" #define FILE6 #define XXX_FILE6 YYY_FILE6 #define YYY_FILE6 ZZZ_FILE6 #define ZZZ_FILE6 FILE6 #include XXX_FILE5 #include XXX_FILE6 """ ifdef_input = """ #define DEFINED 0 #ifdef DEFINED #include "file7-yes" #else #include "file7-no" #endif #ifdef NOT_DEFINED #include #else #include #endif """ if_boolean_input = """ #define ZERO 0 #define ONE 1 #if ZERO #include "file9-no" #else #include "file9-yes" #endif #if ONE #include #else #include #endif #if ZERO #include "file11-no-1" #elif ZERO #include "file11-no-2" #else #include "file11-yes" #endif #if ZERO #include #elif ONE #include #else #include #endif #if ONE #include "file13-yes" #elif ZERO #include "file13-no-1" #else #include "file13-no-2" #endif #if ONE #include #elif ONE #include #else #include #endif """ if_defined_input = """ #define DEFINED 0 #if defined(DEFINED) #include "file15-yes" #endif #if ! defined(DEFINED) #include #else #include #endif #if defined DEFINED #include "file17-yes" #endif #if ! defined DEFINED #include #else #include #endif """ expression_input = """ #define ZERO 0 #define ONE 1 #if ZERO && ZERO #include "file19-no" #else #include "file19-yes" #endif #if ZERO && ONE #include #else #include #endif #if ONE && ZERO #include "file21-no" #else #include "file21-yes" #endif #if ONE && ONE #include #else #include #endif #if ZERO || ZERO #include "file23-no" #else #include "file23-yes" #endif #if ZERO || ONE #include #else #include #endif #if ONE || ZERO #include "file25-yes" #else #include "file25-no" #endif #if ONE || ONE #include #else #include #endif #if ONE == ONE #include "file27-yes" #else #include "file27-no" #endif #if ONE != ONE #include #else #include #endif #if ! (ONE == ONE) #include "file29-no" #else #include "file29-yes" #endif #if ! (ONE != ONE) #include #else #include #endif """ undef_input = """ #define UNDEFINE 0 #ifdef UNDEFINE #include "file31-yes" #else #include "file31-no" #endif #undef UNDEFINE #ifdef UNDEFINE #include #else #include #endif """ macro_function_input = """ #define ZERO 0 #define ONE 1 #define FUNC33(x) "file33-yes" #define FUNC34(x) #include FUNC33(ZERO) #include FUNC34(ZERO) #define FILE35 "file35-yes" #define FILE36 #define FUNC35(x, y) FILE35 #define FUNC36(x, y) FILE36 #include FUNC35(ZERO, ONE) #include FUNC36(ZERO, ONE) #define FILE37 "file37-yes" #define FILE38 #define FUNC37a(x, y) FILE37 #define FUNC38a(x, y) FILE38 #define FUNC37b(x, y) FUNC37a(x, y) #define FUNC38b(x, y) FUNC38a(x, y) #define FUNC37c(x, y) FUNC37b(x, y) #define FUNC38c(x, y) FUNC38b(x, y) #include FUNC37c(ZERO, ONE) #include FUNC38c(ZERO, ONE) #define FILE39 "file39-yes" #define FILE40 #define FUNC39a(x0, y0) FILE39 #define FUNC40a(x0, y0) FILE40 #define FUNC39b(x1, y2) FUNC39a(x1, y1) #define FUNC40b(x1, y2) FUNC40a(x1, y1) #define FUNC39c(x2, y2) FUNC39b(x2, y2) #define FUNC40c(x2, y2) FUNC40b(x2, y2) #include FUNC39c(ZERO, ONE) #include FUNC40c(ZERO, ONE) /* Make sure we don't die if the expansion isn't a string. */ #define FUNC_INTEGER(x) 1 /* Make sure one-character names are recognized. */ #define _(x) translate(x) #undef _ """ token_pasting_input = """ #define PASTE_QUOTE(q, name) q##name##-yes##q #define PASTE_ANGLE(name) <##name##-yes> #define FUNC41 PASTE_QUOTE(", file41) #define FUNC42 PASTE_ANGLE(file42) #include FUNC41 #include FUNC42 """ no_space_input = """ #include #include"file44-yes" """ nested_ifs_input = """ #define DEFINED #ifdef NOT_DEFINED #include "file7-no" #ifdef DEFINED #include "file8-no" #else #include "file9-no" #endif #else #include "file7-yes" #endif """ # pp_class = PreProcessor # #pp_class = DumbPreProcessor # pp = pp_class(current = ".", # cpppath = ['/usr/include'], # print_all = 1) # #pp(open(sys.argv[1]).read()) # pp(input) class cppTestCase(unittest.TestCase): def setUp(self): self.cpp = self.cpp_class(current = ".", cpppath = ['/usr/include']) def test_basic(self): """Test basic #include scanning""" expect = self.basic_expect result = self.cpp.process_contents(basic_input) assert expect == result, (expect, result) def test_substitution(self): """Test substitution of #include files using CPP variables""" expect = self.substitution_expect result = self.cpp.process_contents(substitution_input) assert expect == result, (expect, result) def test_ifdef(self): """Test basic #ifdef processing""" expect = self.ifdef_expect result = self.cpp.process_contents(ifdef_input) assert expect == result, (expect, result) def test_if_boolean(self): """Test #if with Boolean values""" expect = self.if_boolean_expect result = self.cpp.process_contents(if_boolean_input) assert expect == result, (expect, result) def test_if_defined(self): """Test #if defined() idioms""" expect = self.if_defined_expect result = self.cpp.process_contents(if_defined_input) assert expect == result, (expect, result) def test_expression(self): """Test #if with arithmetic expressions""" expect = self.expression_expect result = self.cpp.process_contents(expression_input) assert expect == result, (expect, result) def test_undef(self): """Test #undef handling""" expect = self.undef_expect result = self.cpp.process_contents(undef_input) assert expect == result, (expect, result) def test_macro_function(self): """Test using macro functions to express file names""" expect = self.macro_function_expect result = self.cpp.process_contents(macro_function_input) assert expect == result, (expect, result) def test_token_pasting(self): """Test token-pasting to construct file names""" expect = self.token_pasting_expect result = self.cpp.process_contents(token_pasting_input) assert expect == result, (expect, result) def test_no_space(self): """Test no space between #include and the quote""" expect = self.no_space_expect result = self.cpp.process_contents(no_space_input) assert expect == result, (expect, result) def test_nested_ifs(self): expect = self.nested_ifs_expect result = self.cpp.process_contents(nested_ifs_input) assert expect == result, (expect, result) class cppAllTestCase(cppTestCase): def setUp(self): self.cpp = self.cpp_class(current = ".", cpppath = ['/usr/include'], all=1) class PreProcessorTestCase(cppAllTestCase): cpp_class = cpp.PreProcessor basic_expect = [ ('include', '"', 'file1-yes'), ('include', '<', 'file2-yes'), ] substitution_expect = [ ('include', '"', 'file3-yes'), ('include', '<', 'file4-yes'), ('include', '"', 'file5-yes'), ('include', '<', 'file6-yes'), ] ifdef_expect = [ ('include', '"', 'file7-yes'), ('include', '<', 'file8-yes'), ] if_boolean_expect = [ ('include', '"', 'file9-yes'), ('include', '<', 'file10-yes'), ('include', '"', 'file11-yes'), ('include', '<', 'file12-yes'), ('include', '"', 'file13-yes'), ('include', '<', 'file14-yes'), ] if_defined_expect = [ ('include', '"', 'file15-yes'), ('include', '<', 'file16-yes'), ('include', '"', 'file17-yes'), ('include', '<', 'file18-yes'), ] expression_expect = [ ('include', '"', 'file19-yes'), ('include', '<', 'file20-yes'), ('include', '"', 'file21-yes'), ('include', '<', 'file22-yes'), ('include', '"', 'file23-yes'), ('include', '<', 'file24-yes'), ('include', '"', 'file25-yes'), ('include', '<', 'file26-yes'), ('include', '"', 'file27-yes'), ('include', '<', 'file28-yes'), ('include', '"', 'file29-yes'), ('include', '<', 'file30-yes'), ] undef_expect = [ ('include', '"', 'file31-yes'), ('include', '<', 'file32-yes'), ] macro_function_expect = [ ('include', '"', 'file33-yes'), ('include', '<', 'file34-yes'), ('include', '"', 'file35-yes'), ('include', '<', 'file36-yes'), ('include', '"', 'file37-yes'), ('include', '<', 'file38-yes'), ('include', '"', 'file39-yes'), ('include', '<', 'file40-yes'), ] token_pasting_expect = [ ('include', '"', 'file41-yes'), ('include', '<', 'file42-yes'), ] no_space_expect = [ ('include', '<', 'file43-yes'), ('include', '"', 'file44-yes'), ] nested_ifs_expect = [ ('include', '"', 'file7-yes'), ] class DumbPreProcessorTestCase(cppAllTestCase): cpp_class = cpp.DumbPreProcessor basic_expect = [ ('include', '"', 'file1-yes'), ('include', '<', 'file2-yes'), ] substitution_expect = [ ('include', '"', 'file3-yes'), ('include', '<', 'file4-yes'), ('include', '"', 'file5-yes'), ('include', '<', 'file6-yes'), ] ifdef_expect = [ ('include', '"', 'file7-yes'), ('include', '"', 'file7-no'), ('include', '<', 'file8-no'), ('include', '<', 'file8-yes'), ] if_boolean_expect = [ ('include', '"', 'file9-no'), ('include', '"', 'file9-yes'), ('include', '<', 'file10-yes'), ('include', '<', 'file10-no'), ('include', '"', 'file11-no-1'), ('include', '"', 'file11-no-2'), ('include', '"', 'file11-yes'), ('include', '<', 'file12-no-1'), ('include', '<', 'file12-yes'), ('include', '<', 'file12-no-2'), ('include', '"', 'file13-yes'), ('include', '"', 'file13-no-1'), ('include', '"', 'file13-no-2'), ('include', '<', 'file14-yes'), ('include', '<', 'file14-no-1'), ('include', '<', 'file14-no-2'), ] if_defined_expect = [ ('include', '"', 'file15-yes'), ('include', '<', 'file16-no'), ('include', '<', 'file16-yes'), ('include', '"', 'file17-yes'), ('include', '<', 'file18-no'), ('include', '<', 'file18-yes'), ] expression_expect = [ ('include', '"', 'file19-no'), ('include', '"', 'file19-yes'), ('include', '<', 'file20-no'), ('include', '<', 'file20-yes'), ('include', '"', 'file21-no'), ('include', '"', 'file21-yes'), ('include', '<', 'file22-yes'), ('include', '<', 'file22-no'), ('include', '"', 'file23-no'), ('include', '"', 'file23-yes'), ('include', '<', 'file24-yes'), ('include', '<', 'file24-no'), ('include', '"', 'file25-yes'), ('include', '"', 'file25-no'), ('include', '<', 'file26-yes'), ('include', '<', 'file26-no'), ('include', '"', 'file27-yes'), ('include', '"', 'file27-no'), ('include', '<', 'file28-no'), ('include', '<', 'file28-yes'), ('include', '"', 'file29-no'), ('include', '"', 'file29-yes'), ('include', '<', 'file30-yes'), ('include', '<', 'file30-no'), ] undef_expect = [ ('include', '"', 'file31-yes'), ('include', '"', 'file31-no'), ('include', '<', 'file32-no'), ('include', '<', 'file32-yes'), ] macro_function_expect = [ ('include', '"', 'file33-yes'), ('include', '<', 'file34-yes'), ('include', '"', 'file35-yes'), ('include', '<', 'file36-yes'), ('include', '"', 'file37-yes'), ('include', '<', 'file38-yes'), ('include', '"', 'file39-yes'), ('include', '<', 'file40-yes'), ] token_pasting_expect = [ ('include', '"', 'file41-yes'), ('include', '<', 'file42-yes'), ] no_space_expect = [ ('include', '<', 'file43-yes'), ('include', '"', 'file44-yes'), ] nested_ifs_expect = [ ('include', '"', 'file7-no'), ('include', '"', 'file8-no'), ('include', '"', 'file9-no'), ('include', '"', 'file7-yes') ] import os import re import shutil import tempfile tempfile.template = 'cppTests.' if os.name in ('posix', 'nt'): tempfile.template = 'cppTests.' + str(os.getpid()) + '.' else: tempfile.template = 'cppTests.' _Cleanup = [] def _clean(): for dir in _Cleanup: if os.path.exists(dir): shutil.rmtree(dir) atexit.register(_clean) class fileTestCase(unittest.TestCase): cpp_class = cpp.DumbPreProcessor def setUp(self): try: path = tempfile.mktemp(prefix=tempfile.template) except TypeError: # The tempfile.mktemp() function in earlier versions of Python # has no prefix argument, but uses the tempfile.template # value that we set above. path = tempfile.mktemp() _Cleanup.append(path) os.mkdir(path) self.tempdir = path self.orig_cwd = os.getcwd() os.chdir(path) def tearDown(self): os.chdir(self.orig_cwd) shutil.rmtree(self.tempdir) _Cleanup.remove(self.tempdir) def strip_initial_spaces(self, s): lines = s.split('\n') spaces = re.match(' *', lines[0]).group(0) def strip_spaces(l, spaces=spaces): if l[:len(spaces)] == spaces: l = l[len(spaces):] return l return '\n'.join(map(strip_spaces, lines)) def write(self, file, contents): open(file, 'w').write(self.strip_initial_spaces(contents)) def test_basic(self): """Test basic file inclusion""" self.write('f1.h', """\ #include "f2.h" """) self.write('f2.h', """\ #include """) self.write('f3.h', """\ """) p = cpp.DumbPreProcessor(current = os.curdir, cpppath = [os.curdir]) result = p('f1.h') assert result == ['f2.h', 'f3.h'], result def test_current_file(self): """Test use of the .current_file attribute""" self.write('f1.h', """\ #include """) self.write('f2.h', """\ #include "f3.h" """) self.write('f3.h', """\ """) class MyPreProcessor(cpp.DumbPreProcessor): def __init__(self, *args, **kw): cpp.DumbPreProcessor.__init__(self, *args, **kw) self.files = [] def __call__(self, file): self.files.append(file) return cpp.DumbPreProcessor.__call__(self, file) def scons_current_file(self, t): r = cpp.DumbPreProcessor.scons_current_file(self, t) self.files.append(self.current_file) return r p = MyPreProcessor(current = os.curdir, cpppath = [os.curdir]) result = p('f1.h') assert result == ['f2.h', 'f3.h'], result assert p.files == ['f1.h', 'f2.h', 'f3.h', 'f2.h', 'f1.h'], p.files if __name__ == '__main__': suite = unittest.TestSuite() tclasses = [ PreProcessorTestCase, DumbPreProcessorTestCase, fileTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') try: names = list(set(names)) except NameError: pass names.sort() suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Subst.py0000664000175000017500000010441713160023041020214 0ustar bdbaddogbdbaddog"""SCons.Subst SCons string substitution. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Subst.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import collections import re import SCons.Errors from SCons.Util import is_String, is_Sequence # Indexed by the SUBST_* constants below. _strconv = [SCons.Util.to_String_for_subst, SCons.Util.to_String_for_subst, SCons.Util.to_String_for_signature] AllowableExceptions = (IndexError, NameError) def SetAllowableExceptions(*excepts): global AllowableExceptions AllowableExceptions = [_f for _f in excepts if _f] def raise_exception(exception, target, s): name = exception.__class__.__name__ msg = "%s `%s' trying to evaluate `%s'" % (name, exception, s) if target: raise SCons.Errors.BuildError(target[0], msg) else: raise SCons.Errors.UserError(msg) class Literal(object): """A wrapper for a string. If you use this object wrapped around a string, then it will be interpreted as literal. When passed to the command interpreter, all special characters will be escaped.""" def __init__(self, lstr): self.lstr = lstr def __str__(self): return self.lstr def escape(self, escape_func): return escape_func(self.lstr) def for_signature(self): return self.lstr def is_literal(self): return 1 def __eq__(self, other): if not isinstance(other, Literal): return False return self.lstr == other.lstr def __neq__(self, other): return not self.__eq__(other) class SpecialAttrWrapper(object): """This is a wrapper for what we call a 'Node special attribute.' This is any of the attributes of a Node that we can reference from Environment variable substitution, such as $TARGET.abspath or $SOURCES[1].filebase. We implement the same methods as Literal so we can handle special characters, plus a for_signature method, such that we can return some canonical string during signature calculation to avoid unnecessary rebuilds.""" def __init__(self, lstr, for_signature=None): """The for_signature parameter, if supplied, will be the canonical string we return from for_signature(). Else we will simply return lstr.""" self.lstr = lstr if for_signature: self.forsig = for_signature else: self.forsig = lstr def __str__(self): return self.lstr def escape(self, escape_func): return escape_func(self.lstr) def for_signature(self): return self.forsig def is_literal(self): return 1 def quote_spaces(arg): """Generic function for putting double quotes around any string that has white space in it.""" if ' ' in arg or '\t' in arg: return '"%s"' % arg else: return str(arg) class CmdStringHolder(collections.UserString): """This is a special class used to hold strings generated by scons_subst() and scons_subst_list(). It defines a special method escape(). When passed a function with an escape algorithm for a particular platform, it will return the contained string with the proper escape sequences inserted. """ def __init__(self, cmd, literal=None): collections.UserString.__init__(self, cmd) self.literal = literal def is_literal(self): return self.literal def escape(self, escape_func, quote_func=quote_spaces): """Escape the string with the supplied function. The function is expected to take an arbitrary string, then return it with all special characters escaped and ready for passing to the command interpreter. After calling this function, the next call to str() will return the escaped string. """ if self.is_literal(): return escape_func(self.data) elif ' ' in self.data or '\t' in self.data: return quote_func(self.data) else: return self.data def escape_list(mylist, escape_func): """Escape a list of arguments by running the specified escape_func on every object in the list that has an escape() method.""" def escape(obj, escape_func=escape_func): try: e = obj.escape except AttributeError: return obj else: return e(escape_func) return list(map(escape, mylist)) class NLWrapper(object): """A wrapper class that delays turning a list of sources or targets into a NodeList until it's needed. The specified function supplied when the object is initialized is responsible for turning raw nodes into proxies that implement the special attributes like .abspath, .source, etc. This way, we avoid creating those proxies just "in case" someone is going to use $TARGET or the like, and only go through the trouble if we really have to. In practice, this might be a wash performance-wise, but it's a little cleaner conceptually... """ def __init__(self, list, func): self.list = list self.func = func def _return_nodelist(self): return self.nodelist def _gen_nodelist(self): mylist = self.list if mylist is None: mylist = [] elif not is_Sequence(mylist): mylist = [mylist] # The map(self.func) call is what actually turns # a list into appropriate proxies. self.nodelist = SCons.Util.NodeList(list(map(self.func, mylist))) self._create_nodelist = self._return_nodelist return self.nodelist _create_nodelist = _gen_nodelist class Targets_or_Sources(collections.UserList): """A class that implements $TARGETS or $SOURCES expansions by in turn wrapping a NLWrapper. This class handles the different methods used to access the list, calling the NLWrapper to create proxies on demand. Note that we subclass collections.UserList purely so that the is_Sequence() function will identify an object of this class as a list during variable expansion. We're not really using any collections.UserList methods in practice. """ def __init__(self, nl): self.nl = nl def __getattr__(self, attr): nl = self.nl._create_nodelist() return getattr(nl, attr) def __getitem__(self, i): nl = self.nl._create_nodelist() return nl[i] def __getslice__(self, i, j): nl = self.nl._create_nodelist() i = max(i, 0); j = max(j, 0) return nl[i:j] def __str__(self): nl = self.nl._create_nodelist() return str(nl) def __repr__(self): nl = self.nl._create_nodelist() return repr(nl) class Target_or_Source(object): """A class that implements $TARGET or $SOURCE expansions by in turn wrapping a NLWrapper. This class handles the different methods used to access an individual proxy Node, calling the NLWrapper to create a proxy on demand. """ def __init__(self, nl): self.nl = nl def __getattr__(self, attr): nl = self.nl._create_nodelist() try: nl0 = nl[0] except IndexError: # If there is nothing in the list, then we have no attributes to # pass through, so raise AttributeError for everything. raise AttributeError("NodeList has no attribute: %s" % attr) return getattr(nl0, attr) def __str__(self): nl = self.nl._create_nodelist() if nl: return str(nl[0]) return '' def __repr__(self): nl = self.nl._create_nodelist() if nl: return repr(nl[0]) return '' class NullNodeList(SCons.Util.NullSeq): def __call__(self, *args, **kwargs): return '' def __str__(self): return '' NullNodesList = NullNodeList() def subst_dict(target, source): """Create a dictionary for substitution of special construction variables. This translates the following special arguments: target - the target (object or array of objects), used to generate the TARGET and TARGETS construction variables source - the source (object or array of objects), used to generate the SOURCES and SOURCE construction variables """ dict = {} if target: def get_tgt_subst_proxy(thing): try: subst_proxy = thing.get_subst_proxy() except AttributeError: subst_proxy = thing # probably a string, just return it return subst_proxy tnl = NLWrapper(target, get_tgt_subst_proxy) dict['TARGETS'] = Targets_or_Sources(tnl) dict['TARGET'] = Target_or_Source(tnl) # This is a total cheat, but hopefully this dictionary goes # away soon anyway. We just let these expand to $TARGETS # because that's "good enough" for the use of ToolSurrogates # (see test/ToolSurrogate.py) to generate documentation. dict['CHANGED_TARGETS'] = '$TARGETS' dict['UNCHANGED_TARGETS'] = '$TARGETS' else: dict['TARGETS'] = NullNodesList dict['TARGET'] = NullNodesList if source: def get_src_subst_proxy(node): try: rfile = node.rfile except AttributeError: pass else: node = rfile() try: return node.get_subst_proxy() except AttributeError: return node # probably a String, just return it snl = NLWrapper(source, get_src_subst_proxy) dict['SOURCES'] = Targets_or_Sources(snl) dict['SOURCE'] = Target_or_Source(snl) # This is a total cheat, but hopefully this dictionary goes # away soon anyway. We just let these expand to $TARGETS # because that's "good enough" for the use of ToolSurrogates # (see test/ToolSurrogate.py) to generate documentation. dict['CHANGED_SOURCES'] = '$SOURCES' dict['UNCHANGED_SOURCES'] = '$SOURCES' else: dict['SOURCES'] = NullNodesList dict['SOURCE'] = NullNodesList return dict # Constants for the "mode" parameter to scons_subst_list() and # scons_subst(). SUBST_RAW gives the raw command line. SUBST_CMD # gives a command line suitable for passing to a shell. SUBST_SIG # gives a command line appropriate for calculating the signature # of a command line...if this changes, we should rebuild. SUBST_CMD = 0 SUBST_RAW = 1 SUBST_SIG = 2 _rm = re.compile(r'\$[()]') _rm_split = re.compile(r'(\$[()])') # Indexed by the SUBST_* constants above. _regex_remove = [ _rm, None, _rm_split ] def _rm_list(list): return [l for l in list if not l in ('$(', '$)')] def _remove_list(list): result = [] depth = 0 for l in list: if l == '$(': depth += 1 elif l == '$)': depth -= 1 if depth < 0: break elif depth == 0: result.append(l) if depth != 0: return None return result # Indexed by the SUBST_* constants above. _list_remove = [ _rm_list, None, _remove_list ] # Regular expressions for splitting strings and handling substitutions, # for use by the scons_subst() and scons_subst_list() functions: # # The first expression compiled matches all of the $-introduced tokens # that we need to process in some way, and is used for substitutions. # The expressions it matches are: # # "$$" # "$(" # "$)" # "$variable" [must begin with alphabetic or underscore] # "${any stuff}" # # The second expression compiled is used for splitting strings into tokens # to be processed, and it matches all of the tokens listed above, plus # the following that affect how arguments do or don't get joined together: # # " " [white space] # "non-white-space" [without any dollar signs] # "$" [single dollar sign] # _dollar_exps_str = r'\$[\$\(\)]|\$[_a-zA-Z][\.\w]*|\${[^}]*}' _dollar_exps = re.compile(r'(%s)' % _dollar_exps_str) _separate_args = re.compile(r'(%s|\s+|[^\s\$]+|\$)' % _dollar_exps_str) # This regular expression is used to replace strings of multiple white # space characters in the string result from the scons_subst() function. _space_sep = re.compile(r'[\t ]+(?![^{]*})') def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None): """Expand a string or list containing construction variable substitutions. This is the work-horse function for substitutions in file names and the like. The companion scons_subst_list() function (below) handles separating command lines into lists of arguments, so see that function if that's what you're looking for. """ if isinstance(strSubst, str) and strSubst.find('$') < 0: return strSubst class StringSubber(object): """A class to construct the results of a scons_subst() call. This binds a specific construction environment, mode, target and source with two methods (substitute() and expand()) that handle the expansion. """ def __init__(self, env, mode, conv, gvars): self.env = env self.mode = mode self.conv = conv self.gvars = gvars def expand(self, s, lvars): """Expand a single "token" as necessary, returning an appropriate string containing the expansion. This handles expanding different types of things (strings, lists, callables) appropriately. It calls the wrapper substitute() method to re-expand things as necessary, so that the results of expansions of side-by-side strings still get re-evaluated separately, not smushed together. """ if is_String(s): try: s0, s1 = s[:2] except (IndexError, ValueError): return s if s0 != '$': return s if s1 == '$': return '$' elif s1 in '()': return s else: key = s[1:] if key[0] == '{' or '.' in key: if key[0] == '{': key = key[1:-1] try: s = eval(key, self.gvars, lvars) except KeyboardInterrupt: raise except Exception as e: if e.__class__ in AllowableExceptions: return '' raise_exception(e, lvars['TARGETS'], s) else: if key in lvars: s = lvars[key] elif key in self.gvars: s = self.gvars[key] elif not NameError in AllowableExceptions: raise_exception(NameError(key), lvars['TARGETS'], s) else: return '' # Before re-expanding the result, handle # recursive expansion by copying the local # variable dictionary and overwriting a null # string for the value of the variable name # we just expanded. # # This could potentially be optimized by only # copying lvars when s contains more expansions, # but lvars is usually supposed to be pretty # small, and deeply nested variable expansions # are probably more the exception than the norm, # so it should be tolerable for now. lv = lvars.copy() var = key.split('.')[0] lv[var] = '' return self.substitute(s, lv) elif is_Sequence(s): def func(l, conv=self.conv, substitute=self.substitute, lvars=lvars): return conv(substitute(l, lvars)) return list(map(func, s)) elif callable(s): try: s = s(target=lvars['TARGETS'], source=lvars['SOURCES'], env=self.env, for_signature=(self.mode != SUBST_CMD)) except TypeError: # This probably indicates that it's a callable # object that doesn't match our calling arguments # (like an Action). if self.mode == SUBST_RAW: return s s = self.conv(s) return self.substitute(s, lvars) elif s is None: return '' else: return s def substitute(self, args, lvars): """Substitute expansions in an argument or list of arguments. This serves as a wrapper for splitting up a string into separate tokens. """ if is_String(args) and not isinstance(args, CmdStringHolder): args = str(args) # In case it's a UserString. try: def sub_match(match): return self.conv(self.expand(match.group(1), lvars)) result = _dollar_exps.sub(sub_match, args) except TypeError: # If the internal conversion routine doesn't return # strings (it could be overridden to return Nodes, for # example), then the 1.5.2 re module will throw this # exception. Back off to a slower, general-purpose # algorithm that works for all data types. args = _separate_args.findall(args) result = [] for a in args: result.append(self.conv(self.expand(a, lvars))) if len(result) == 1: result = result[0] else: result = ''.join(map(str, result)) return result else: return self.expand(args, lvars) if conv is None: conv = _strconv[mode] # Doing this every time is a bit of a waste, since the Executor # has typically already populated the OverrideEnvironment with # $TARGET/$SOURCE variables. We're keeping this (for now), though, # because it supports existing behavior that allows us to call # an Action directly with an arbitrary target+source pair, which # we use in Tool/tex.py to handle calling $BIBTEX when necessary. # If we dropped that behavior (or found another way to cover it), # we could get rid of this call completely and just rely on the # Executor setting the variables. if 'TARGET' not in lvars: d = subst_dict(target, source) if d: lvars = lvars.copy() lvars.update(d) # We're (most likely) going to eval() things. If Python doesn't # find a __builtins__ value in the global dictionary used for eval(), # it copies the current global values for you. Avoid this by # setting it explicitly and then deleting, so we don't pollute the # construction environment Dictionary(ies) that are typically used # for expansion. gvars['__builtins__'] = __builtins__ ss = StringSubber(env, mode, conv, gvars) result = ss.substitute(strSubst, lvars) try: del gvars['__builtins__'] except KeyError: pass res = result if is_String(result): # Remove $(-$) pairs and any stuff in between, # if that's appropriate. remove = _regex_remove[mode] if remove: if mode == SUBST_SIG: result = _list_remove[mode](remove.split(result)) if result is None: raise SCons.Errors.UserError("Unbalanced $(/$) in: " + res) result = ' '.join(result) else: result = remove.sub('', result) if mode != SUBST_RAW: # Compress strings of white space characters into # a single space. result = _space_sep.sub(' ', result).strip() elif is_Sequence(result): remove = _list_remove[mode] if remove: result = remove(result) if result is None: raise SCons.Errors.UserError("Unbalanced $(/$) in: " + str(res)) return result def scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None): """Substitute construction variables in a string (or list or other object) and separate the arguments into a command list. The companion scons_subst() function (above) handles basic substitutions within strings, so see that function instead if that's what you're looking for. """ class ListSubber(collections.UserList): """A class to construct the results of a scons_subst_list() call. Like StringSubber, this class binds a specific construction environment, mode, target and source with two methods (substitute() and expand()) that handle the expansion. In addition, however, this class is used to track the state of the result(s) we're gathering so we can do the appropriate thing whenever we have to append another word to the result--start a new line, start a new word, append to the current word, etc. We do this by setting the "append" attribute to the right method so that our wrapper methods only need ever call ListSubber.append(), and the rest of the object takes care of doing the right thing internally. """ def __init__(self, env, mode, conv, gvars): collections.UserList.__init__(self, []) self.env = env self.mode = mode self.conv = conv self.gvars = gvars if self.mode == SUBST_RAW: self.add_strip = lambda x: self.append(x) else: self.add_strip = lambda x: None self.in_strip = None self.next_line() def expand(self, s, lvars, within_list): """Expand a single "token" as necessary, appending the expansion to the current result. This handles expanding different types of things (strings, lists, callables) appropriately. It calls the wrapper substitute() method to re-expand things as necessary, so that the results of expansions of side-by-side strings still get re-evaluated separately, not smushed together. """ if is_String(s): try: s0, s1 = s[:2] except (IndexError, ValueError): self.append(s) return if s0 != '$': self.append(s) return if s1 == '$': self.append('$') elif s1 == '(': self.open_strip('$(') elif s1 == ')': self.close_strip('$)') else: key = s[1:] if key[0] == '{' or key.find('.') >= 0: if key[0] == '{': key = key[1:-1] try: s = eval(key, self.gvars, lvars) except KeyboardInterrupt: raise except Exception as e: if e.__class__ in AllowableExceptions: return raise_exception(e, lvars['TARGETS'], s) else: if key in lvars: s = lvars[key] elif key in self.gvars: s = self.gvars[key] elif not NameError in AllowableExceptions: raise_exception(NameError(), lvars['TARGETS'], s) else: return # Before re-expanding the result, handle # recursive expansion by copying the local # variable dictionary and overwriting a null # string for the value of the variable name # we just expanded. lv = lvars.copy() var = key.split('.')[0] lv[var] = '' self.substitute(s, lv, 0) self.this_word() elif is_Sequence(s): for a in s: self.substitute(a, lvars, 1) self.next_word() elif callable(s): try: s = s(target=lvars['TARGETS'], source=lvars['SOURCES'], env=self.env, for_signature=(self.mode != SUBST_CMD)) except TypeError: # This probably indicates that it's a callable # object that doesn't match our calling arguments # (like an Action). if self.mode == SUBST_RAW: self.append(s) return s = self.conv(s) self.substitute(s, lvars, within_list) elif s is None: self.this_word() else: self.append(s) def substitute(self, args, lvars, within_list): """Substitute expansions in an argument or list of arguments. This serves as a wrapper for splitting up a string into separate tokens. """ if is_String(args) and not isinstance(args, CmdStringHolder): args = str(args) # In case it's a UserString. args = _separate_args.findall(args) for a in args: if a[0] in ' \t\n\r\f\v': if '\n' in a: self.next_line() elif within_list: self.append(a) else: self.next_word() else: self.expand(a, lvars, within_list) else: self.expand(args, lvars, within_list) def next_line(self): """Arrange for the next word to start a new line. This is like starting a new word, except that we have to append another line to the result.""" collections.UserList.append(self, []) self.next_word() def this_word(self): """Arrange for the next word to append to the end of the current last word in the result.""" self.append = self.add_to_current_word def next_word(self): """Arrange for the next word to start a new word.""" self.append = self.add_new_word def add_to_current_word(self, x): """Append the string x to the end of the current last word in the result. If that is not possible, then just add it as a new word. Make sure the entire concatenated string inherits the object attributes of x (in particular, the escape function) by wrapping it as CmdStringHolder.""" if not self.in_strip or self.mode != SUBST_SIG: try: current_word = self[-1][-1] except IndexError: self.add_new_word(x) else: # All right, this is a hack and it should probably # be refactored out of existence in the future. # The issue is that we want to smoosh words together # and make one file name that gets escaped if # we're expanding something like foo$EXTENSION, # but we don't want to smoosh them together if # it's something like >$TARGET, because then we'll # treat the '>' like it's part of the file name. # So for now, just hard-code looking for the special # command-line redirection characters... try: last_char = str(current_word)[-1] except IndexError: last_char = '\0' if last_char in '<>|': self.add_new_word(x) else: y = current_word + x # We used to treat a word appended to a literal # as a literal itself, but this caused problems # with interpreting quotes around space-separated # targets on command lines. Removing this makes # none of the "substantive" end-to-end tests fail, # so we'll take this out but leave it commented # for now in case there's a problem not covered # by the test cases and we need to resurrect this. #literal1 = self.literal(self[-1][-1]) #literal2 = self.literal(x) y = self.conv(y) if is_String(y): #y = CmdStringHolder(y, literal1 or literal2) y = CmdStringHolder(y, None) self[-1][-1] = y def add_new_word(self, x): if not self.in_strip or self.mode != SUBST_SIG: literal = self.literal(x) x = self.conv(x) if is_String(x): x = CmdStringHolder(x, literal) self[-1].append(x) self.append = self.add_to_current_word def literal(self, x): try: l = x.is_literal except AttributeError: return None else: return l() def open_strip(self, x): """Handle the "open strip" $( token.""" self.add_strip(x) self.in_strip = 1 def close_strip(self, x): """Handle the "close strip" $) token.""" self.add_strip(x) self.in_strip = None if conv is None: conv = _strconv[mode] # Doing this every time is a bit of a waste, since the Executor # has typically already populated the OverrideEnvironment with # $TARGET/$SOURCE variables. We're keeping this (for now), though, # because it supports existing behavior that allows us to call # an Action directly with an arbitrary target+source pair, which # we use in Tool/tex.py to handle calling $BIBTEX when necessary. # If we dropped that behavior (or found another way to cover it), # we could get rid of this call completely and just rely on the # Executor setting the variables. if 'TARGET' not in lvars: d = subst_dict(target, source) if d: lvars = lvars.copy() lvars.update(d) # We're (most likely) going to eval() things. If Python doesn't # find a __builtins__ value in the global dictionary used for eval(), # it copies the current global values for you. Avoid this by # setting it explicitly and then deleting, so we don't pollute the # construction environment Dictionary(ies) that are typically used # for expansion. gvars['__builtins__'] = __builtins__ ls = ListSubber(env, mode, conv, gvars) ls.substitute(strSubst, lvars, 0) try: del gvars['__builtins__'] except KeyError: pass return ls.data def scons_subst_once(strSubst, env, key): """Perform single (non-recursive) substitution of a single construction variable keyword. This is used when setting a variable when copying or overriding values in an Environment. We want to capture (expand) the old value before we override it, so people can do things like: env2 = env.Clone(CCFLAGS = '$CCFLAGS -g') We do this with some straightforward, brute-force code here... """ if isinstance(strSubst, str) and strSubst.find('$') < 0: return strSubst matchlist = ['$' + key, '${' + key + '}'] val = env.get(key, '') def sub_match(match, val=val, matchlist=matchlist): a = match.group(1) if a in matchlist: a = val if is_Sequence(a): return ' '.join(map(str, a)) else: return str(a) if is_Sequence(strSubst): result = [] for arg in strSubst: if is_String(arg): if arg in matchlist: arg = val if is_Sequence(arg): result.extend(arg) else: result.append(arg) else: result.append(_dollar_exps.sub(sub_match, arg)) else: result.append(arg) return result elif is_String(strSubst): return _dollar_exps.sub(sub_match, strSubst) else: return strSubst # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Environment.xml0000664000175000017500000024260713160023041021574 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> A dictionary mapping the names of the builders available through this environment to underlying Builder objects. Builders named Alias, CFile, CXXFile, DVI, Library, Object, PDF, PostScript, and Program are available by default. If you initialize this variable when an Environment is created: env = Environment(BUILDERS = {'NewBuilder' : foo}) the default Builders will no longer be available. To use a new Builder object in addition to the default Builders, add your new Builder object like this: env = Environment() env.Append(BUILDERS = {'NewBuilder' : foo}) or this: env = Environment() env['BUILDERS]['NewBuilder'] = foo A function that converts a string into a Dir instance relative to the target being built. A dictionary of environment variables to use when invoking commands. When &cv-ENV; is used in a command all list values will be joined using the path separator and any other non-string values will simply be coerced to a string. Note that, by default, &scons; does not propagate the environment in force when you execute &scons; to the commands used to build target files. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time &scons; is invoked. If you want to propagate your environment variables to the commands executed to build target files, you must do so explicitly: import os env = Environment(ENV = os.environ) Note that you can choose only to propagate certain environment variables. A common example is the system PATH environment variable, so that &scons; uses the same utilities as the invoking shell (or other process): import os env = Environment(ENV = {'PATH' : os.environ['PATH']}) A function that converts a string into a File instance relative to the target being built. A list of the available implicit dependency scanners. New file scanners may be added by appending to this list, although the more flexible approach is to associate scanners with a specific Builder. See the sections "Builder Objects" and "Scanner Objects," below, for more information. A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) A list of the names of the Tool specifications that are part of this construction environment. (action, [cmd/str/fun, [var, ...]] [option=value, ...]) Creates an Action object for the specified action. See the section "Action Objects," below, for a complete explanation of the arguments and behavior. Note that the env.Action() form of the invocation will expand construction variables in any argument strings, including the action argument, at the time it is called using the construction variables in the env construction environment through which env.Action() was called. The Action() form delays all variable expansion until the Action object is actually used. (object, function, [name]) (function, [name]) When called with the AddMethod() form, adds the specified function to the specified object as the specified method name. When called with the env.AddMethod() form, adds the specified function to the construction environment env as the specified method name. In both cases, if name is omitted or None, the name of the specified function itself is used for the method name. Examples: # Note that the first argument to the function to # be attached as a method must be the object through # which the method will be called; the Python # convention is to call it 'self'. def my_method(self, arg): print("my_method() got", arg) # Use the global AddMethod() function to add a method # to the Environment class. This AddMethod(Environment, my_method) env = Environment() env.my_method('arg') # Add the function as a method, using the function # name for the method call. env = Environment() env.AddMethod(my_method, 'other_method_name') env.other_method_name('another arg') (target, action) Arranges for the specified action to be performed after the specified target has been built. The specified action(s) may be an Action object, or anything that can be converted into an Action object (see below). When multiple targets are supplied, the action may be called multiple times, once after each action that generates one or more targets in the list. (target, action) Arranges for the specified action to be performed before the specified target is built. The specified action(s) may be an Action object, or anything that can be converted into an Action object (see below). When multiple targets are specified, the action(s) may be called multiple times, once before each action that generates one or more targets in the list. Note that if any of the targets are built in multiple steps, the action will be invoked just before the "final" action that specifically generates the specified target(s). For example, when building an executable program from a specified source .c file via an intermediate object file: foo = Program('foo.c') AddPreAction(foo, 'pre_action') The specified pre_action would be executed before &scons; calls the link command that actually generates the executable program binary foo, not before compiling the foo.c file into an object file. (alias, [targets, [action]]) Creates one or more phony targets that expand to one or more other targets. An optional action (command) or list of actions can be specified that will be executed whenever the any of the alias targets are out-of-date. Returns the Node object representing the alias, which exists outside of any file system. This Node object, or the alias name, may be used as a dependency of any other target, including another alias. &f-Alias; can be called multiple times for the same alias to add additional targets to the alias, or additional actions to the list for this alias. Examples: Alias('install') Alias('install', '/usr/bin') Alias(['install', 'install-lib'], '/usr/local/lib') env.Alias('install', ['/usr/local/bin', '/usr/local/lib']) env.Alias('install', ['/usr/local/man']) env.Alias('update', ['file1', 'file2'], "update_database $SOURCES") (target, ...) Marks each given target so that it is always assumed to be out of date, and will always be rebuilt if needed. Note, however, that &f-AlwaysBuild; does not add its target(s) to the default target list, so the targets will only be built if they are specified on the command line, or are a dependent of a target specified on the command line--but they will always be built if so specified. Multiple targets can be passed in to a single call to &f-AlwaysBuild;. (key=val, [...]) Appends the specified keyword arguments to the end of construction variables in the environment. If the Environment does not have the specified construction variable, it is simply added to the environment. If the values of the construction variable and the keyword argument are the same type, then the two values will be simply added together. Otherwise, the construction variable and the value of the keyword argument are both coerced to lists, and the lists are added together. (See also the Prepend method, below.) Example: env.Append(CCFLAGS = ' -g', FOO = ['foo.yyy']) (name, newpath, [envname, sep, delete_existing]) This appends new path elements to the given path in the specified external environment (ENV by default). This will only add any particular path once (leaving the last one it encounters and ignoring the rest, to preserve path order), and to help assure this, will normalize all paths (using os.path.normpath and os.path.normcase). This can also handle the case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string. If delete_existing is 0, then adding a path that already exists will not move it to the end; it will stay where it is in the list. Example: print 'before:',env['ENV']['INCLUDE'] include_path = '/foo/bar:/foo' env.AppendENVPath('INCLUDE', include_path) print 'after:',env['ENV']['INCLUDE'] yields: before: /foo:/biz after: /biz:/foo/bar:/foo (key=val, [...], delete_existing=0) Appends the specified keyword arguments to the end of construction variables in the environment. If the Environment does not have the specified construction variable, it is simply added to the environment. If the construction variable being appended to is a list, then any value(s) that already exist in the construction variable will not be added again to the list. However, if delete_existing is 1, existing matching values are removed first, so existing values in the arg list move to the end of the list. Example: env.AppendUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) (build_dir, src_dir, [duplicate]) Deprecated synonyms for &f-VariantDir; and env.VariantDir(). The build_dir argument becomes the variant_dir argument of &f-VariantDir; or env.VariantDir(). (action, [arguments]) Creates a Builder object for the specified action. See the section "Builder Objects," below, for a complete explanation of the arguments and behavior. Note that the env.Builder() form of the invocation will expand construction variables in any arguments strings, including the action argument, at the time it is called using the construction variables in the env construction environment through which env.Builder() was called. The &f-Builder; form delays all variable expansion until after the Builder object is actually called. (cache_dir) Specifies that &scons; will maintain a cache of derived files in cache_dir. The derived files in the cache will be shared among all the builds using the same &f-CacheDir; call. Specifying a cache_dir of None disables derived file caching. Calling env.CacheDir() will only affect targets built through the specified construction environment. Calling &f-CacheDir; sets a global default that will be used by all targets built through construction environments that do not have an env.CacheDir() specified. When a CacheDir() is being used and &scons; finds a derived file that needs to be rebuilt, it will first look in the cache to see if a derived file has already been built from identical input files and an identical build action (as incorporated into the MD5 build signature). If so, &scons; will retrieve the file from the cache. If the derived file is not present in the cache, &scons; will rebuild it and then place a copy of the built file in the cache (identified by its MD5 build signature), so that it may be retrieved by other builds that need to build the same derived file from identical inputs. Use of a specified &f-CacheDir; may be disabled for any invocation by using the option. If the option is used, &scons; will place a copy of all derived files in the cache, even if they already existed and were not built by this invocation. This is useful to populate a cache the first time &f-CacheDir; is added to a build, or after using the option. When using &f-CacheDir;, &scons; will report, "Retrieved `file' from cache," unless the option is being used. When the option is used, &scons; will print the action that would have been used to build the file, without any indication that the file was actually retrieved from the cache. This is useful to generate build logs that are equivalent regardless of whether a given derived file has been built in-place or retrieved from the cache. The &f-link-NoCache; method can be used to disable caching of specific files. This can be useful if inputs and/or outputs of some tool are impossible to predict or prohibitively large. (targets, files_or_dirs) This specifies a list of files or directories which should be removed whenever the targets are specified with the command line option. The specified targets may be a list or an individual target. Multiple calls to &f-Clean; are legal, and create new targets or add files and directories to the clean list for the specified targets. Multiple files or directories should be specified either as separate arguments to the &f-Clean; method, or as a list. &f-Clean; will also accept the return value of any of the construction environment Builder methods. Examples: The related &f-link-NoClean; function overrides calling &f-Clean; for the same target, and any targets passed to both functions will not be removed by the option. Examples: Clean('foo', ['bar', 'baz']) Clean('dist', env.Program('hello', 'hello.c')) Clean(['foo', 'bar'], 'something_else_to_clean') In this example, installing the project creates a subdirectory for the documentation. This statement causes the subdirectory to be removed if the project is deinstalled. Clean(docdir, os.path.join(docdir, projectname)) ([key=val, ...]) Returns a separate copy of a construction environment. If there are any keyword arguments specified, they are added to the returned copy, overwriting any existing values for the keywords. Example: env2 = env.Clone() env3 = env.Clone(CCFLAGS = '-g') Additionally, a list of tools and a toolpath may be specified, as in the Environment constructor: def MyTool(env): env['FOO'] = 'bar' env4 = env.Clone(tools = ['msvc', MyTool]) The parse_flags keyword argument is also recognized: # create an environment for compiling programs that use wxWidgets wx_env = env.Clone(parse_flags = '!wx-config --cflags --cxxflags') The &b-Command; "Builder" is actually implemented as a function that looks like a Builder, but actually takes an additional argument of the action from which the Builder should be made. See the &f-link-Command; function description for the calling syntax and details. (target, source, action, [key=val, ...]) Executes a specific action (or list of actions) to build a target file or files. This is more convenient than defining a separate Builder object for a single special-case build. As a special case, the source_scanner keyword argument can be used to specify a Scanner object that will be used to scan the sources. (The global DirScanner object can be used if any of the sources will be directories that must be scanned on-disk for changes to files that aren't already specified in other Builder of function calls.) Any other keyword arguments specified override any same-named existing construction variables. An action can be an external command, specified as a string, or a callable Python object; see "Action Objects," below, for more complete information. Also note that a string specifying an external command may be preceded by an @ (at-sign) to suppress printing the command in question, or by a - (hyphen) to ignore the exit status of the external command. Examples: env.Command('foo.out', 'foo.in', "$FOO_BUILD < $SOURCES > $TARGET") env.Command('bar.out', 'bar.in', ["rm -f $TARGET", "$BAR_BUILD < $SOURCES > $TARGET"], ENV = {'PATH' : '/usr/local/bin/'}) def rename(env, target, source): import os os.rename('.tmp', str(target[0])) env.Command('baz.out', 'baz.in', ["$BAZ_BUILD < $SOURCES > .tmp", rename ]) Note that the &f-Command; function will usually assume, by default, that the specified targets and/or sources are Files, if no other part of the configuration identifies what type of entry it is. If necessary, you can explicitly specify that targets or source nodes should be treated as directoriese by using the &f-link-Dir; or env.Dir() functions. Examples: env.Command('ddd.list', Dir('ddd'), 'ls -l $SOURCE > $TARGET') env['DISTDIR'] = 'destination/directory' env.Command(env.Dir('$DISTDIR')), None, make_distdir) (Also note that SCons will usually automatically create any directory necessary to hold a target file, so you normally don't need to create directories by hand.) (env, [custom_tests, conf_dir, log_file, config_h]) ([custom_tests, conf_dir, log_file, config_h]) Creates a Configure object for integrated functionality similar to GNU autoconf. See the section "Configure Contexts," below, for a complete explanation of the arguments and behavior. ([key=val, ...]) A now-deprecated synonym for env.Clone(). (function) Specifies that all up-to-date decisions for targets built through this construction environment will be handled by the specified function. The function can be one of the following strings that specify the type of decision function to be performed: timestamp-newer Specifies that a target shall be considered out of date and rebuilt if the dependency's timestamp is newer than the target file's timestamp. This is the behavior of the classic Make utility, and make can be used a synonym for timestamp-newer. timestamp-match Specifies that a target shall be considered out of date and rebuilt if the dependency's timestamp is different than the timestamp recorded the last time the target was built. This provides behavior very similar to the classic Make utility (in particular, files are not opened up so that their contents can be checksummed) except that the target will also be rebuilt if a dependency file has been restored to a version with an earlier timestamp, such as can happen when restoring files from backup archives. MD5 Specifies that a target shall be considered out of date and rebuilt if the dependency's content has changed since the last time the target was built, as determined be performing an MD5 checksum on the dependency's contents and comparing it to the checksum recorded the last time the target was built. content can be used as a synonym for MD5. MD5-timestamp Specifies that a target shall be considered out of date and rebuilt if the dependency's content has changed since the last time the target was built, except that dependencies with a timestamp that matches the last time the target was rebuilt will be assumed to be up-to-date and not rebuilt. This provides behavior very similar to the MD5 behavior of always checksumming file contents, with an optimization of not checking the contents of files whose timestamps haven't changed. The drawback is that SCons will not detect if a file's content has changed but its timestamp is the same, as might happen in an automated script that runs a build, updates a file, and runs the build again, all within a single second. Examples: # Use exact timestamp matches by default. Decider('timestamp-match') # Use MD5 content signatures for any targets built # with the attached construction environment. env.Decider('content') In addition to the above already-available functions, the function argument may be an actual Python function that takes the following three arguments: dependency The Node (file) which should cause the target to be rebuilt if it has "changed" since the last tme target was built. target The Node (file) being built. In the normal case, this is what should get rebuilt if the dependency has "changed." prev_ni Stored information about the state of the dependency the last time the target was built. This can be consulted to match various file characteristics such as the timestamp, size, or content signature. The function should return a True (non-zero) value if the dependency has "changed" since the last time the target was built (indicating that the target should be rebuilt), and False (zero) otherwise (indicating that the target should not be rebuilt). Note that the decision can be made using whatever criteria are appopriate. Ignoring some or all of the function arguments is perfectly normal. Example: def my_decider(dependency, target, prev_ni): return not os.path.exists(str(target)) env.Decider(my_decider) (target, dependency) Specifies an explicit dependency; the target will be rebuilt whenever the dependency has changed. Both the specified target and dependency can be a string (usually the path name of a file or directory) or Node objects, or a list of strings or Node objects (such as returned by a Builder call). This should only be necessary for cases where the dependency is not caught by a Scanner for the file. Example: env.Depends('foo', 'other-input-file-for-foo') mylib = env.Library('mylib.c') installed_lib = env.Install('lib', mylib) bar = env.Program('bar.c') # Arrange for the library to be copied into the installation # directory before trying to build the "bar" program. # (Note that this is for example only. A "real" library # dependency would normally be configured through the $LIBS # and $LIBPATH variables, not using an env.Depends() call.) env.Depends(bar, installed_lib) ([vars]) Returns a dictionary object containing copies of all of the construction variables in the environment. If there are any variable names specified, only the specified construction variables are returned in the dictionary. Example: dict = env.Dictionary() cc_dict = env.Dictionary('CC', 'CCFLAGS', 'CCCOM') (name, [directory]) This returns a Directory Node, an object that represents the specified directory name. name can be a relative or absolute path. directory is an optional directory that will be used as the parent directory. If no directory is specified, the current script's directory is used as the parent. If name is a list, SCons returns a list of Dir nodes. Construction variables are expanded in name. Directory Nodes can be used anywhere you would supply a string as a directory name to a Builder method or function. Directory Nodes have attributes and methods that are useful in many situations; see "File and Directory Nodes," below. ([key]) Returns a pretty printable representation of the environment. key, if not None, should be a string containing the name of the variable of interest. This SConstruct: env=Environment() print env.Dump('CCCOM') will print: '$CC -c -o $TARGET $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $SOURCES' While this SConstruct: env=Environment() print env.Dump() will print: { 'AR': 'ar', 'ARCOM': '$AR $ARFLAGS $TARGET $SOURCES\n$RANLIB $RANLIBFLAGS $TARGET', 'ARFLAGS': ['r'], 'AS': 'as', 'ASCOM': '$AS $ASFLAGS -o $TARGET $SOURCES', 'ASFLAGS': [], ... ([key=value, ...]) Return a new construction environment initialized with the specified key=value pairs. (action, [strfunction, varlist]) Executes an Action object. The specified action may be an Action object (see the section "Action Objects," below, for a complete explanation of the arguments and behavior), or it may be a command-line string, list of commands, or executable Python function, each of which will be converted into an Action object and then executed. The exit value of the command or return value of the Python function will be returned. Note that &scons; will print an error message if the executed action fails--that is, exits with or returns a non-zero value. &scons; will not, however, automatically terminate the build if the specified action fails. If you want the build to stop in response to a failed &f-Execute; call, you must explicitly check for a non-zero return value: Execute(Copy('file.out', 'file.in')) if Execute("mkdir sub/dir/ectory"): # The mkdir failed, don't try to build. Exit(1) (name, [directory]) This returns a File Node, an object that represents the specified file name. name can be a relative or absolute path. directory is an optional directory that will be used as the parent directory. If name is a list, SCons returns a list of File nodes. Construction variables are expanded in name. File Nodes can be used anywhere you would supply a string as a file name to a Builder method or function. File Nodes have attributes and methods that are useful in many situations; see "File and Directory Nodes," below. (file, dirs) Search for file in the path specified by dirs. dirs may be a list of directory names or a single directory name. In addition to searching for files that exist in the filesystem, this function also searches for derived files that have not yet been built. Example: foo = env.FindFile('foo', ['dir1', 'dir2']) () Returns the list of targets set up by the &b-link-Install; or &b-link-InstallAs; builders. This function serves as a convenient method to select the contents of a binary package. Example: Install( '/bin', [ 'executable_a', 'executable_b' ] ) # will return the file node list # [ '/bin/executable_a', '/bin/executable_b' ] FindInstalledFiles() Install( '/lib', [ 'some_library' ] ) # will return the file node list # [ '/bin/executable_a', '/bin/executable_b', '/lib/some_library' ] FindInstalledFiles() (node='"."') Returns the list of nodes which serve as the source of the built files. It does so by inspecting the dependency tree starting at the optional argument node which defaults to the '"."'-node. It will then return all leaves of node. These are all children which have no further children. This function is a convenient method to select the contents of a Source Package. Example: Program( 'src/main_a.c' ) Program( 'src/main_b.c' ) Program( 'main_c.c' ) # returns ['main_c.c', 'src/main_a.c', 'SConstruct', 'src/main_b.c'] FindSourceFiles() # returns ['src/main_b.c', 'src/main_a.c' ] FindSourceFiles( 'src' ) As you can see build support files (SConstruct in the above example) will also be returned by this function. (sequence) Takes a sequence (that is, a Python list or tuple) that may contain nested sequences and returns a flattened list containing all of the individual elements in any sequence. This can be helpful for collecting the lists returned by calls to Builders; other Builders will automatically flatten lists specified as input, but direct Python manipulation of these lists does not. Examples: foo = Object('foo.c') bar = Object('bar.c') # Because `foo' and `bar' are lists returned by the Object() Builder, # `objects' will be a list containing nested lists: objects = ['f1.o', foo, 'f2.o', bar, 'f3.o'] # Passing such a list to another Builder is all right because # the Builder will flatten the list automatically: Program(source = objects) # If you need to manipulate the list directly using Python, you need to # call Flatten() yourself, or otherwise handle nested lists: for object in Flatten(objects): print str(object) (file, [...]) Returns the &scons; path name (or names) for the specified file (or files). The specified file or files may be &scons; Nodes or strings representing path names. (pattern, [ondisk, source, strings, exclude]) Returns Nodes (or strings) that match the specified pattern, relative to the directory of the current &SConscript; file. The env.Glob() form performs string substition on pattern and returns whatever matches the resulting expanded pattern. The specified pattern uses Unix shell style metacharacters for matching: * matches everything ? matches any single character [seq] matches any character in seq [!seq] matches any char not in seq If the first character of a filename is a dot, it must be matched explicitly. Character matches do not span directory separators. The &f-Glob; knows about repositories (see the &f-link-Repository; function) and source directories (see the &f-link-VariantDir; function) and returns a Node (or string, if so configured) in the local (SConscript) directory if matching Node is found anywhere in a corresponding repository or source directory. The ondisk argument may be set to False (or any other non-true value) to disable the search for matches on disk, thereby only returning matches among already-configured File or Dir Nodes. The default behavior is to return corresponding Nodes for any on-disk matches found. The source argument may be set to True (or any equivalent value) to specify that, when the local directory is a &f-VariantDir;, the returned Nodes should be from the corresponding source directory, not the local directory. The strings argument may be set to True (or any equivalent value) to have the &f-Glob; function return strings, not Nodes, that represent the matched files or directories. The returned strings will be relative to the local (SConscript) directory. (Note that This may make it easier to perform arbitrary manipulation of file names, but if the returned strings are passed to a different &SConscript; file, any Node translation will be relative to the other &SConscript; directory, not the original &SConscript; directory.) The exclude argument may be set to a pattern or a list of patterns (following the same Unix shell semantics) which must be filtered out of returned elements. Elements matching a least one pattern of this list will be excluded. Examples: Program('foo', Glob('*.c')) Zip('/tmp/everything', Glob('.??*') + Glob('*')) sources = Glob('*.cpp', exclude=['os_*_specific_*.cpp']) + Glob('os_%s_specific_*.cpp'%currentOS) (target, dependency) The specified dependency file(s) will be ignored when deciding if the target file(s) need to be rebuilt. You can also use &f-Ignore; to remove a target from the default build. In order to do this you must specify the directory the target will be built in as the target, and the file you want to skip building as the dependency. Note that this will only remove the dependencies listed from the files built by default. It will still be built if that dependency is needed by another object being built. See the third and forth examples below. Examples: env.Ignore('foo', 'foo.c') env.Ignore('bar', ['bar1.h', 'bar2.h']) env.Ignore('.','foobar.obj') env.Ignore('bar','bar/foobar.obj') (string) The specified string will be preserved as-is and not have construction variables expanded. (targets) The specified targets will have copies made in the local tree, even if an already up-to-date copy exists in a repository. Returns a list of the target Node or Nodes. (arg, [unique]) Merges the specified arg values to the construction environment's construction variables. If the arg argument is not a dictionary, it is converted to one by calling &f-link-env-ParseFlags; on the argument before the values are merged. Note that arg must be a single value, so multiple strings must be passed in as a list, not as separate arguments to &f-env-MergeFlags;. By default, duplicate values are eliminated; you can, however, specify unique=0 to allow duplicate values to be added. When eliminating duplicate values, any construction variables that end with the string PATH keep the left-most unique value. All other construction variables keep the right-most unique value. Examples: # Add an optimization flag to $CCFLAGS. env.MergeFlags('-O3') # Combine the flags returned from running pkg-config with an optimization # flag and merge the result into the construction variables. env.MergeFlags(['!pkg-config gtk+-2.0 --cflags', '-O3']) # Combine an optimization flag with the flags returned from running pkg-config # twice and merge the result into the construction variables. env.MergeFlags(['-O3', '!pkg-config gtk+-2.0 --cflags --libs', '!pkg-config libpng12 --cflags --libs']) (target, ...) Specifies a list of files which should not be cached whenever the &f-link-CacheDir; method has been activated. The specified targets may be a list or an individual target. Multiple files should be specified either as separate arguments to the &f-NoCache; method, or as a list. &f-NoCache; will also accept the return value of any of the construction environment Builder methods. Calling &f-NoCache; on directories and other non-File Node types has no effect because only File Nodes are cached. Examples: NoCache('foo.elf') NoCache(env.Program('hello', 'hello.c')) (target, ...) Specifies a list of files or directories which should not be removed whenever the targets (or their dependencies) are specified with the command line option. The specified targets may be a list or an individual target. Multiple calls to &f-NoClean; are legal, and prevent each specified target from being removed by calls to the option. Multiple files or directories should be specified either as separate arguments to the &f-NoClean; method, or as a list. &f-NoClean; will also accept the return value of any of the construction environment Builder methods. Calling &f-NoClean; for a target overrides calling &f-link-Clean; for the same target, and any targets passed to both functions will not be removed by the option. Examples: NoClean('foo.elf') NoClean(env.Program('hello', 'hello.c')) (command, [function, unique]) Calls the specified function to modify the environment as specified by the output of command. The default function is &f-link-env-MergeFlags;, which expects the output of a typical *-config command (for example, gtk-config) and adds the options to the appropriate construction variables. By default, duplicate values are not added to any construction variables; you can specify unique=0 to allow duplicate values to be added. Interpreted options and the construction variables they affect are as specified for the &f-link-env-ParseFlags; method (which this method calls). See that method's description, below, for a table of options and construction variables. (filename, [must_exist, only_one]) Parses the contents of the specified filename as a list of dependencies in the style of &Make; or mkdep, and explicitly establishes all of the listed dependencies. By default, it is not an error if the specified filename does not exist. The optional must_exist argument may be set to a non-zero value to have scons throw an exception and generate an error if the file does not exist, or is otherwise inaccessible. The optional only_one argument may be set to a non-zero value to have scons thrown an exception and generate an error if the file contains dependency information for more than one target. This can provide a small sanity check for files intended to be generated by, for example, the gcc -M flag, which should typically only write dependency information for one output file into a corresponding .d file. The filename and all of the files listed therein will be interpreted relative to the directory of the &SConscript; file which calls the &f-ParseDepends; function. (flags, ...) Parses one or more strings containing typical command-line flags for GCC tool chains and returns a dictionary with the flag values separated into the appropriate SCons construction variables. This is intended as a companion to the &f-link-env-MergeFlags; method, but allows for the values in the returned dictionary to be modified, if necessary, before merging them into the construction environment. (Note that &f-env-MergeFlags; will call this method if its argument is not a dictionary, so it is usually not necessary to call &f-link-env-ParseFlags; directly unless you want to manipulate the values.) If the first character in any string is an exclamation mark (!), the rest of the string is executed as a command, and the output from the command is parsed as GCC tool chain command-line flags and added to the resulting dictionary. Flag values are translated accordig to the prefix found, and added to the following construction variables: -arch CCFLAGS, LINKFLAGS -D CPPDEFINES -framework FRAMEWORKS -frameworkdir= FRAMEWORKPATH -include CCFLAGS -isysroot CCFLAGS, LINKFLAGS -I CPPPATH -l LIBS -L LIBPATH -mno-cygwin CCFLAGS, LINKFLAGS -mwindows LINKFLAGS -pthread CCFLAGS, LINKFLAGS -std= CFLAGS -Wa, ASFLAGS, CCFLAGS -Wl,-rpath= RPATH -Wl,-R, RPATH -Wl,-R RPATH -Wl, LINKFLAGS -Wp, CPPFLAGS - CCFLAGS + CCFLAGS, LINKFLAGS Any other strings not associated with options are assumed to be the names of libraries and added to the &cv-LIBS; construction variable. Examples (all of which produce the same result): dict = env.ParseFlags('-O2 -Dfoo -Dbar=1') dict = env.ParseFlags('-O2', '-Dfoo', '-Dbar=1') dict = env.ParseFlags(['-O2', '-Dfoo -Dbar=1']) dict = env.ParseFlags('-O2', '!echo -Dfoo -Dbar=1') (string) The &f-Platform; form returns a callable object that can be used to initialize a construction environment using the platform keyword of the &f-Environment; function. Example: env = Environment(platform = Platform('win32')) The &f-env-Platform; form applies the callable object for the specified platform string to the environment through which the method was called. env.Platform('posix') Note that the win32 platform adds the SystemDrive and SystemRoot variables from the user's external environment to the construction environment's &cv-link-ENV; dictionary. This is so that any executed commands that use sockets to connect with other systems (such as fetching source files from external CVS repository specifications like :pserver:anonymous@cvs.sourceforge.net:/cvsroot/scons) will work on Windows systems. (key=val, [...]) Appends the specified keyword arguments to the beginning of construction variables in the environment. If the Environment does not have the specified construction variable, it is simply added to the environment. If the values of the construction variable and the keyword argument are the same type, then the two values will be simply added together. Otherwise, the construction variable and the value of the keyword argument are both coerced to lists, and the lists are added together. (See also the Append method, above.) Example: env.Prepend(CCFLAGS = '-g ', FOO = ['foo.yyy']) (name, newpath, [envname, sep, delete_existing]) This appends new path elements to the given path in the specified external environment (&cv-ENV; by default). This will only add any particular path once (leaving the first one it encounters and ignoring the rest, to preserve path order), and to help assure this, will normalize all paths (using os.path.normpath and os.path.normcase). This can also handle the case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string. If delete_existing is 0, then adding a path that already exists will not move it to the beginning; it will stay where it is in the list. Example: print 'before:',env['ENV']['INCLUDE'] include_path = '/foo/bar:/foo' env.PrependENVPath('INCLUDE', include_path) print 'after:',env['ENV']['INCLUDE'] The above example will print: before: /biz:/foo after: /foo/bar:/foo:/biz (key=val, delete_existing=0, [...]) Appends the specified keyword arguments to the beginning of construction variables in the environment. If the Environment does not have the specified construction variable, it is simply added to the environment. If the construction variable being appended to is a list, then any value(s) that already exist in the construction variable will not be added again to the list. However, if delete_existing is 1, existing matching values are removed first, so existing values in the arg list move to the front of the list. Example: env.PrependUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) (modulename) This returns a Directory Node similar to Dir. The python module / package is looked up and if located the directory is returned for the location. modulename Is a named python package / module to lookup the directory for it's location. If modulename is a list, SCons returns a list of Dir nodes. Construction variables are expanded in modulename. (key=val, [...]) Replaces construction variables in the Environment with the specified keyword arguments. Example: env.Replace(CCFLAGS = '-g', FOO = 'foo.xxx') (directory) Specifies that directory is a repository to be searched for files. Multiple calls to &f-Repository; are legal, and each one adds to the list of repositories that will be searched. To &scons;, a repository is a copy of the source tree, from the top-level directory on down, which may contain both source files and derived files that can be used to build targets in the local source tree. The canonical example would be an official source tree maintained by an integrator. If the repository contains derived files, then the derived files should have been built using &scons;, so that the repository contains the necessary signature information to allow &scons; to figure out when it is appropriate to use the repository copy of a derived file, instead of building one locally. Note that if an up-to-date derived file already exists in a repository, &scons; will not make a copy in the local directory tree. In order to guarantee that a local copy will be made, use the &f-link-Local; method. (target, prerequisite) Specifies an order-only relationship between the specified target file(s) and the specified prerequisite file(s). The prerequisite file(s) will be (re)built, if necessary, before the target file(s), but the target file(s) do not actually depend on the prerequisites and will not be rebuilt simply because the prerequisite file(s) change. Example: env.Requires('foo', 'file-that-must-be-built-before-foo') (function, [argument, keys, path_function, node_class, node_factory, scan_check, recursive]) Creates a Scanner object for the specified function. See the section "Scanner Objects," below, for a complete explanation of the arguments and behavior. (value) By default, &scons; changes its working directory to the directory in which each subsidiary SConscript file lives. This behavior may be disabled by specifying either: SConscriptChdir(0) env.SConscriptChdir(0) in which case &scons; will stay in the top-level directory while reading all SConscript files. (This may be necessary when building from repositories, when all the directories in which SConscript files may be found don't necessarily exist locally.) You may enable and disable this ability by calling SConscriptChdir() multiple times. Example: env = Environment() SConscriptChdir(0) SConscript('foo/SConscript') # will not chdir to foo env.SConscriptChdir(1) SConscript('bar/SConscript') # will chdir to bar ([file, dbm_module]) This tells &scons; to store all file signatures in the specified database file. If the file name is omitted, .sconsign is used by default. (The actual file name(s) stored on disk may have an appropriated suffix appended by the dbm_module.) If file is not an absolute path name, the file is placed in the same directory as the top-level &SConstruct; file. If file is None, then &scons; will store file signatures in a separate .sconsign file in each directory, not in one global database file. (This was the default behavior prior to SCons 0.96.91 and 0.97.) The optional dbm_module argument can be used to specify which Python database module The default is to use a custom SCons.dblite module that uses pickled Python data structures, and which works on all Python versions. Examples: # Explicitly stores signatures in ".sconsign.dblite" # in the top-level SConstruct directory (the # default behavior). SConsignFile() # Stores signatures in the file "etc/scons-signatures" # relative to the top-level SConstruct directory. SConsignFile("etc/scons-signatures") # Stores signatures in the specified absolute file name. SConsignFile("/home/me/SCons/signatures") # Stores signatures in a separate .sconsign file # in each directory. SConsignFile(None) (key=val, [...]) Sets construction variables to default values specified with the keyword arguments if (and only if) the variables are not already set. The following statements are equivalent: env.SetDefault(FOO = 'foo') if 'FOO' not in env: env['FOO'] = 'foo' (side_effect, target) Declares side_effect as a side effect of building target. Both side_effect and target can be a list, a file name, or a node. A side effect is a target file that is created or updated as a side effect of building other targets. For example, a Windows PDB file is created as a side effect of building the .obj files for a static library, and various log files are created updated as side effects of various TeX commands. If a target is a side effect of multiple build commands, &scons; will ensure that only one set of commands is executed at a time. Consequently, you only need to use this method for side-effect targets that are built as a result of multiple build commands. Because multiple build commands may update the same side effect file, by default the side_effect target is not automatically removed when the target is removed by the option. (Note, however, that the side_effect might be removed as part of cleaning the directory in which it lives.) If you want to make sure the side_effect is cleaned whenever a specific target is cleaned, you must specify this explicitly with the &f-link-Clean; or &f-env-Clean; function. (entries, builder) This function and its associate factory functions are deprecated. There is no replacement. The intended use was to keep a local tree in sync with an archive, but in actuality the function only causes the archive to be fetched on the first run. Synchronizing with the archive is best done external to &SCons;. Arrange for non-existent source files to be fetched from a source code management system using the specified builder. The specified entries may be a Node, string or list of both, and may represent either individual source files or directories in which source files can be found. For any non-existent source files, &scons; will search up the directory tree and use the first &f-SourceCode; builder it finds. The specified builder may be None, in which case &scons; will not use a builder to fetch source files for the specified entries, even if a &f-SourceCode; builder has been specified for a directory higher up the tree. &scons; will, by default, fetch files from SCCS or RCS subdirectories without explicit configuration. This takes some extra processing time to search for the necessary source code management files on disk. You can avoid these extra searches and speed up your build a little by disabling these searches as follows: env.SourceCode('.', None) Note that if the specified builder is one you create by hand, it must have an associated construction environment to use when fetching a source file. &scons; provides a set of canned factory functions that return appropriate Builders for various popular source code management systems. Canonical examples of invocation include: env.SourceCode('.', env.BitKeeper('/usr/local/BKsources')) env.SourceCode('src', env.CVS('/usr/local/CVSROOT')) env.SourceCode('/', env.RCS()) env.SourceCode(['f1.c', 'f2.c'], env.SCCS()) env.SourceCode('no_source.c', None) (type) Note: Although it is not yet officially deprecated, use of this function is discouraged. See the &f-link-Decider; function for a more flexible and straightforward way to configure SCons' decision-making. The &f-SourceSignatures; function tells &scons; how to decide if a source file (a file that is not built from any other files) has changed since the last time it was used to build a particular target file. Legal values are MD5 or timestamp. If the environment method is used, the specified type of source signature is only used when deciding whether targets built with that environment are up-to-date or must be rebuilt. If the global function is used, the specified type of source signature becomes the default used for all decisions about whether targets are up-to-date. MD5 means &scons; decides that a source file has changed if the MD5 checksum of its contents has changed since the last time it was used to rebuild a particular target file. timestamp means &scons; decides that a source file has changed if its timestamp (modification time) has changed since the last time it was used to rebuild a particular target file. (Note that although this is similar to the behavior of Make, by default it will also rebuild if the dependency is older than the last time it was used to rebuild the target file.) There is no different between the two behaviors for Python &f-Value; node objects. MD5 signatures take longer to compute, but are more accurate than timestamp signatures. The default value is MD5. Note that the default &f-link-TargetSignatures; setting (see below) is to use this &f-SourceSignatures; setting for any target files that are used to build other target files. Consequently, changing the value of &f-SourceSignatures; will, by default, affect the up-to-date decision for all files in the build (or all files built with a specific construction environment when &f-env-SourceSignatures; is used). (arg) Returns a list of file names or other objects. If arg is a string, it will be split on strings of white-space characters within the string, making it easier to write long lists of file names. If arg is already a list, the list will be returned untouched. If arg is any other type of object, it will be returned as a list containing just the object. Example: files = Split("f1.c f2.c f3.c") files = env.Split("f4.c f5.c f6.c") files = Split(""" f7.c f8.c f9.c """) (input, [raw, target, source, conv]) Performs construction variable interpolation on the specified string or sequence argument input. By default, leading or trailing white space will be removed from the result. and all sequences of white space will be compressed to a single space character. Additionally, any $( and $) character sequences will be stripped from the returned string, The optional raw argument may be set to 1 if you want to preserve white space and $(-$) sequences. The raw argument may be set to 2 if you want to strip all characters between any $( and $) pairs (as is done for signature calculation). If the input is a sequence (list or tuple), the individual elements of the sequence will be expanded, and the results will be returned as a list. The optional target and source keyword arguments must be set to lists of target and source nodes, respectively, if you want the &cv-TARGET;, &cv-TARGETS;, &cv-SOURCE; and &cv-SOURCES; to be available for expansion. This is usually necessary if you are calling &f-env-subst; from within a Python function used as an SCons action. Returned string values or sequence elements are converted to their string representation by default. The optional conv argument may specify a conversion function that will be used in place of the default. For example, if you want Python objects (including SCons Nodes) to be returned as Python objects, you can use the Python λ idiom to pass in an unnamed function that simply returns its unconverted argument. Example: print env.subst("The C compiler is: $CC") def compile(target, source, env): sourceDir = env.subst("${SOURCE.srcdir}", target=target, source=source) source_nodes = env.subst('$EXPAND_TO_NODELIST', conv=lambda x: x) (type) Note: Although it is not yet officially deprecated, use of this function is discouraged. See the &f-link-Decider; function for a more flexible and straightforward way to configure SCons' decision-making. The &f-TargetSignatures; function tells &scons; how to decide if a target file (a file that is built from any other files) has changed since the last time it was used to build some other target file. Legal values are "build"; "content" (or its synonym "MD5"); "timestamp"; or "source". If the environment method is used, the specified type of target signature is only used for targets built with that environment. If the global function is used, the specified type of signature becomes the default used for all target files that don't have an explicit target signature type specified for their environments. "content" (or its synonym "MD5") means &scons; decides that a target file has changed if the MD5 checksum of its contents has changed since the last time it was used to rebuild some other target file. This means &scons; will open up MD5 sum the contents of target files after they're built, and may decide that it does not need to rebuild "downstream" target files if a file was rebuilt with exactly the same contents as the last time. "timestamp" means &scons; decides that a target file has changed if its timestamp (modification time) has changed since the last time it was used to rebuild some other target file. (Note that although this is similar to the behavior of Make, by default it will also rebuild if the dependency is older than the last time it was used to rebuild the target file.) "source" means &scons; decides that a target file has changed as specified by the corresponding &f-SourceSignatures; setting ("MD5" or "timestamp"). This means that &scons; will treat all input files to a target the same way, regardless of whether they are source files or have been built from other files. "build" means &scons; decides that a target file has changed if it has been rebuilt in this invocation or if its content or timestamp have changed as specified by the corresponding &f-SourceSignatures; setting. This "propagates" the status of a rebuilt file so that other "downstream" target files will always be rebuilt, even if the contents or the timestamp have not changed. "build" signatures are fastest because "content" (or "MD5") signatures take longer to compute, but are more accurate than "timestamp" signatures, and can prevent unnecessary "downstream" rebuilds when a target file is rebuilt to the exact same contents as the previous build. The "source" setting provides the most consistent behavior when other target files may be rebuilt from both source and target input files. The default value is "source". Because the default setting is "source", using &f-SourceSignatures; is generally preferable to &f-TargetSignatures;, so that the up-to-date decision will be consistent for all files (or all files built with a specific construction environment). Use of &f-TargetSignatures; provides specific control for how built target files affect their "downstream" dependencies. (string, [toolpath, **kw]) The &f-Tool; form of the function returns a callable object that can be used to initialize a construction environment using the tools keyword of the Environment() method. The object may be called with a construction environment as an argument, in which case the object will add the necessary variables to the construction environment and the name of the tool will be added to the &cv-link-TOOLS; construction variable. Additional keyword arguments are passed to the tool's generate() method. Examples: env = Environment(tools = [ Tool('msvc') ]) env = Environment() t = Tool('msvc') t(env) # adds 'msvc' to the TOOLS variable u = Tool('opengl', toolpath = ['tools']) u(env) # adds 'opengl' to the TOOLS variable The &f-env-Tool; form of the function applies the callable object for the specified tool string to the environment through which the method was called. Additional keyword arguments are passed to the tool's generate() method. env.Tool('gcc') env.Tool('opengl', toolpath = ['build/tools']) (value, [built_value]) Returns a Node object representing the specified Python value. Value Nodes can be used as dependencies of targets. If the result of calling str(value) changes between SCons runs, any targets depending on Value(value) will be rebuilt. (This is true even when using timestamps to decide if files are up-to-date.) When using timestamp source signatures, Value Nodes' timestamps are equal to the system time when the Node is created. The returned Value Node object has a write() method that can be used to "build" a Value Node by setting a new value. The optional built_value argument can be specified when the Value Node is created to indicate the Node should already be considered "built." There is a corresponding read() method that will return the built value of the Node. Examples: env = Environment() def create(target, source, env): # A function that will write a 'prefix=$SOURCE' # string into the file name specified as the # $TARGET. f = open(str(target[0]), 'wb') f.write('prefix=' + source[0].get_contents()) # Fetch the prefix= argument, if any, from the command # line, and use /usr/local as the default. prefix = ARGUMENTS.get('prefix', '/usr/local') # Attach a .Config() builder for the above function action # to the construction environment. env['BUILDERS']['Config'] = Builder(action = create) env.Config(target = 'package-config', source = Value(prefix)) def build_value(target, source, env): # A function that "builds" a Python Value by updating # the the Python value with the contents of the file # specified as the source of the Builder call ($SOURCE). target[0].write(source[0].get_contents()) output = env.Value('before') input = env.Value('after') # Attach a .UpdateValue() builder for the above function # action to the construction environment. env['BUILDERS']['UpdateValue'] = Builder(action = build_value) env.UpdateValue(target = Value(output), source = Value(input)) (variant_dir, src_dir, [duplicate]) Use the &f-VariantDir; function to create a copy of your sources in another location: if a name under variant_dir is not found but exists under src_dir, the file or directory is copied to variant_dir. Target files can be built in a different directory than the original sources by simply refering to the sources (and targets) within the variant tree. &f-VariantDir; can be called multiple times with the same src_dir to set up multiple builds with different options (variants). The src_dir location must be in or underneath the SConstruct file's directory, and variant_dir may not be underneath src_dir. The default behavior is for &scons; to physically duplicate the source files in the variant tree. Thus, a build performed in the variant tree is guaranteed to be identical to a build performed in the source tree even if intermediate source files are generated during the build, or preprocessors or other scanners search for included files relative to the source file, or individual compilers or other invoked tools are hard-coded to put derived files in the same directory as source files. If possible on the platform, the duplication is performed by linking rather than copying; see also the command-line option. Moreover, only the files needed for the build are duplicated; files and directories that are not used are not present in variant_dir. Duplicating the source tree may be disabled by setting the duplicate argument to 0 (zero). This will cause &scons; to invoke Builders using the path names of source files in src_dir and the path names of derived files within variant_dir. This is always more efficient than duplicate=1, and is usually safe for most builds (but see above for cases that may cause problems). Note that &f-VariantDir; works most naturally with a subsidiary SConscript file. However, you would then call the subsidiary SConscript file not in the source directory, but in the variant_dir, regardless of the value of duplicate. This is how you tell &scons; which variant of a source tree to build: # run src/SConscript in two variant directories VariantDir('build/variant1', 'src') SConscript('build/variant1/SConscript') VariantDir('build/variant2', 'src') SConscript('build/variant2/SConscript') See also the &f-link-SConscript; function, described above, for another way to specify a variant directory in conjunction with calling a subsidiary SConscript file. Examples: # use names in the build directory, not the source directory VariantDir('build', 'src', duplicate=0) Program('build/prog', 'build/source.c') # this builds both the source and docs in a separate subtree VariantDir('build', '.', duplicate=0) SConscript(dirs=['build/src','build/doc']) # same as previous example, but only uses SConscript SConscript(dirs='src', variant_dir='build/src', duplicate=0) SConscript(dirs='doc', variant_dir='build/doc', duplicate=0) (program, [path, pathext, reject]) Searches for the specified executable program, returning the full path name to the program if it is found, and returning None if not. Searches the specified path, the value of the calling environment's PATH (env['ENV']['PATH']), or the user's current external PATH (os.environ['PATH']) by default. On Windows systems, searches for executable programs with any of the file extensions listed in the specified pathext, the calling environment's PATHEXT (env['ENV']['PATHEXT']) or the user's current PATHEXT (os.environ['PATHEXT']) by default. Will not select any path name or names in the specified reject list, if any. scons-src-3.0.0/src/engine/SCons/EnvironmentValues.py0000664000175000017500000000552313160023041022576 0ustar bdbaddogbdbaddogimport re _is_valid_var = re.compile(r'[_a-zA-Z]\w*$') _rm = re.compile(r'\$[()]') _remove = re.compile(r'\$\([^\$]*(\$[^\)][^\$]*)*\$\)') # Regular expressions for splitting strings and handling substitutions, # for use by the scons_subst() and scons_subst_list() functions: # # The first expression compiled matches all of the $-introduced tokens # that we need to process in some way, and is used for substitutions. # The expressions it matches are: # # "$$" # "$(" # "$)" # "$variable" [must begin with alphabetic or underscore] # "${any stuff}" # # The second expression compiled is used for splitting strings into tokens # to be processed, and it matches all of the tokens listed above, plus # the following that affect how arguments do or don't get joined together: # # " " [white space] # "non-white-space" [without any dollar signs] # "$" [single dollar sign] # _dollar_exps_str = r'\$[\$\(\)]|\$[_a-zA-Z][\.\w]*|\${[^}]*}' _dollar_exps = re.compile(r'(%s)' % _dollar_exps_str) _separate_args = re.compile(r'(%s|\s+|[^\s\$]+|\$)' % _dollar_exps_str) # This regular expression is used to replace strings of multiple white # space characters in the string result from the scons_subst() function. _space_sep = re.compile(r'[\t ]+(?![^{]*})') class ValueTypes(object): """ Enum to store what type of value the variable holds. """ UNKNOWN = 0 STRING = 1 CALLABLE = 2 VARIABLE = 3 class EnvironmentValue(object): """ Hold a single value. We're going to cache parsed version of the file We're going to keep track of variables which feed into this values evaluation """ def __init__(self, value): self.value = value self.var_type = ValueTypes.UNKNOWN if callable(self.value): self.var_type = ValueTypes.CALLABLE else: self.parse_value() def parse_value(self): """ Scan the string and break into component values """ try: if '$' not in self.value: self._parsed = self.value self.var_type = ValueTypes.STRING else: # Now we need to parse the specified string result = _dollar_exps.sub(sub_match, args) print(result) pass except TypeError: # likely callable? either way we don't parse self._parsed = self.value def parse_trial(self): """ Try alternate parsing methods. :return: """ parts = [] for c in self.value: class EnvironmentValues(object): """ A class to hold all the environment variables """ def __init__(self, **kw): self._dict = {} for k in kw: self._dict[k] = EnvironmentValue(kw[k]) scons-src-3.0.0/src/engine/SCons/Options/0000775000175000017500000000000013160023041020166 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Options/EnumOption.py0000664000175000017500000000367413160023041022647 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Options/EnumOption.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Place-holder for the old SCons.Options module hierarchy This is for backwards compatibility. The new equivalent is the Variables/ class hierarchy. These will have deprecation warnings added (some day), and will then be removed entirely (some day). """ import SCons.Variables import SCons.Warnings warned = False def EnumOption(*args, **kw): global warned if not warned: msg = "The EnumOption() function is deprecated; use the EnumVariable() function instead." SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) warned = True return SCons.Variables.EnumVariable(*args, **kw) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Options/__init__.py0000664000175000017500000000513113160023041022277 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Options/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Place-holder for the old SCons.Options module hierarchy This is for backwards compatibility. The new equivalent is the Variables/ class hierarchy. These will have deprecation warnings added (some day), and will then be removed entirely (some day). """ import SCons.Variables import SCons.Warnings from .BoolOption import BoolOption # okay from .EnumOption import EnumOption # okay from .ListOption import ListOption # naja from .PackageOption import PackageOption # naja from .PathOption import PathOption # okay warned = False class Options(SCons.Variables.Variables): def __init__(self, *args, **kw): global warned if not warned: msg = "The Options class is deprecated; use the Variables class instead." SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) warned = True SCons.Variables.Variables.__init__(self, *args, **kw) def AddOptions(self, *args, **kw): return SCons.Variables.Variables.AddVariables(self, *args, **kw) def UnknownOptions(self, *args, **kw): return SCons.Variables.Variables.UnknownVariables(self, *args, **kw) def FormatOptionHelpText(self, *args, **kw): return SCons.Variables.Variables.FormatVariableHelpText(self, *args, **kw) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Options/PathOption.py0000664000175000017500000000531613160023041022632 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Options/PathOption.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Place-holder for the old SCons.Options module hierarchy This is for backwards compatibility. The new equivalent is the Variables/ class hierarchy. These will have deprecation warnings added (some day), and will then be removed entirely (some day). """ import SCons.Variables import SCons.Warnings warned = False class _PathOptionClass(object): def warn(self): global warned if not warned: msg = "The PathOption() function is deprecated; use the PathVariable() function instead." SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) warned = True def __call__(self, *args, **kw): self.warn() return SCons.Variables.PathVariable(*args, **kw) def PathAccept(self, *args, **kw): self.warn() return SCons.Variables.PathVariable.PathAccept(*args, **kw) def PathIsDir(self, *args, **kw): self.warn() return SCons.Variables.PathVariable.PathIsDir(*args, **kw) def PathIsDirCreate(self, *args, **kw): self.warn() return SCons.Variables.PathVariable.PathIsDirCreate(*args, **kw) def PathIsFile(self, *args, **kw): self.warn() return SCons.Variables.PathVariable.PathIsFile(*args, **kw) def PathExists(self, *args, **kw): self.warn() return SCons.Variables.PathVariable.PathExists(*args, **kw) PathOption = _PathOptionClass() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Options/BoolOption.py0000664000175000017500000000367413160023041022636 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Options/BoolOption.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Place-holder for the old SCons.Options module hierarchy This is for backwards compatibility. The new equivalent is the Variables/ class hierarchy. These will have deprecation warnings added (some day), and will then be removed entirely (some day). """ import SCons.Variables import SCons.Warnings warned = False def BoolOption(*args, **kw): global warned if not warned: msg = "The BoolOption() function is deprecated; use the BoolVariable() function instead." SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) warned = True return SCons.Variables.BoolVariable(*args, **kw) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Options/ListOption.py0000664000175000017500000000367413160023041022656 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Options/ListOption.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Place-holder for the old SCons.Options module hierarchy This is for backwards compatibility. The new equivalent is the Variables/ class hierarchy. These will have deprecation warnings added (some day), and will then be removed entirely (some day). """ import SCons.Variables import SCons.Warnings warned = False def ListOption(*args, **kw): global warned if not warned: msg = "The ListOption() function is deprecated; use the ListVariable() function instead." SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) warned = True return SCons.Variables.ListVariable(*args, **kw) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Options/PackageOption.py0000664000175000017500000000371313160023041023270 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Options/PackageOption.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Place-holder for the old SCons.Options module hierarchy This is for backwards compatibility. The new equivalent is the Variables/ class hierarchy. These will have deprecation warnings added (some day), and will then be removed entirely (some day). """ import SCons.Variables import SCons.Warnings warned = False def PackageOption(*args, **kw): global warned if not warned: msg = "The PackageOption() function is deprecated; use the PackageVariable() function instead." SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) warned = True return SCons.Variables.PackageVariable(*args, **kw) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Conftest.py0000664000175000017500000006723413160023040020705 0ustar bdbaddogbdbaddog"""SCons.Conftest Autoconf-like configuration support; low level implementation of tests. """ # # Copyright (c) 2003 Stichting NLnet Labs # Copyright (c) 2001, 2002, 2003 Steven Knight # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # # The purpose of this module is to define how a check is to be performed. # Use one of the Check...() functions below. # # # A context class is used that defines functions for carrying out the tests, # logging and messages. The following methods and members must be present: # # context.Display(msg) Function called to print messages that are normally # displayed for the user. Newlines are explicitly used. # The text should also be written to the logfile! # # context.Log(msg) Function called to write to a log file. # # context.BuildProg(text, ext) # Function called to build a program, using "ext" for the # file extention. Must return an empty string for # success, an error message for failure. # For reliable test results building should be done just # like an actual program would be build, using the same # command and arguments (including configure results so # far). # # context.CompileProg(text, ext) # Function called to compile a program, using "ext" for # the file extention. Must return an empty string for # success, an error message for failure. # For reliable test results compiling should be done just # like an actual source file would be compiled, using the # same command and arguments (including configure results # so far). # # context.AppendLIBS(lib_name_list) # Append "lib_name_list" to the value of LIBS. # "lib_namelist" is a list of strings. # Return the value of LIBS before changing it (any type # can be used, it is passed to SetLIBS() later.) # # context.PrependLIBS(lib_name_list) # Prepend "lib_name_list" to the value of LIBS. # "lib_namelist" is a list of strings. # Return the value of LIBS before changing it (any type # can be used, it is passed to SetLIBS() later.) # # context.SetLIBS(value) # Set LIBS to "value". The type of "value" is what # AppendLIBS() returned. # Return the value of LIBS before changing it (any type # can be used, it is passed to SetLIBS() later.) # # context.headerfilename # Name of file to append configure results to, usually # "confdefs.h". # The file must not exist or be empty when starting. # Empty or None to skip this (some tests will not work!). # # context.config_h (may be missing). If present, must be a string, which # will be filled with the contents of a config_h file. # # context.vardict Dictionary holding variables used for the tests and # stores results from the tests, used for the build # commands. # Normally contains "CC", "LIBS", "CPPFLAGS", etc. # # context.havedict Dictionary holding results from the tests that are to # be used inside a program. # Names often start with "HAVE_". These are zero # (feature not present) or one (feature present). Other # variables may have any value, e.g., "PERLVERSION" can # be a number and "SYSTEMNAME" a string. # import re # # PUBLIC VARIABLES # LogInputFiles = 1 # Set that to log the input files in case of a failed test LogErrorMessages = 1 # Set that to log Conftest-generated error messages # # PUBLIC FUNCTIONS # # Generic remarks: # - When a language is specified which is not supported the test fails. The # message is a bit different, because not all the arguments for the normal # message are available yet (chicken-egg problem). def CheckBuilder(context, text = None, language = None): """ Configure check to see if the compiler works. Note that this uses the current value of compiler and linker flags, make sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly. "language" should be "C" or "C++" and is used to select the compiler. Default is "C". "text" may be used to specify the code to be build. Returns an empty string for success, an error message for failure. """ lang, suffix, msg = _lang2suffix(language) if msg: context.Display("%s\n" % msg) return msg if not text: text = """ int main() { return 0; } """ context.Display("Checking if building a %s file works... " % lang) ret = context.BuildProg(text, suffix) _YesNoResult(context, ret, None, text) return ret def CheckCC(context): """ Configure check for a working C compiler. This checks whether the C compiler, as defined in the $CC construction variable, can compile a C source file. It uses the current $CCCOM value too, so that it can test against non working flags. """ context.Display("Checking whether the C compiler works... ") text = """ int main() { return 0; } """ ret = _check_empty_program(context, 'CC', text, 'C') _YesNoResult(context, ret, None, text) return ret def CheckSHCC(context): """ Configure check for a working shared C compiler. This checks whether the C compiler, as defined in the $SHCC construction variable, can compile a C source file. It uses the current $SHCCCOM value too, so that it can test against non working flags. """ context.Display("Checking whether the (shared) C compiler works... ") text = """ int foo() { return 0; } """ ret = _check_empty_program(context, 'SHCC', text, 'C', use_shared = True) _YesNoResult(context, ret, None, text) return ret def CheckCXX(context): """ Configure check for a working CXX compiler. This checks whether the CXX compiler, as defined in the $CXX construction variable, can compile a CXX source file. It uses the current $CXXCOM value too, so that it can test against non working flags. """ context.Display("Checking whether the C++ compiler works... ") text = """ int main() { return 0; } """ ret = _check_empty_program(context, 'CXX', text, 'C++') _YesNoResult(context, ret, None, text) return ret def CheckSHCXX(context): """ Configure check for a working shared CXX compiler. This checks whether the CXX compiler, as defined in the $SHCXX construction variable, can compile a CXX source file. It uses the current $SHCXXCOM value too, so that it can test against non working flags. """ context.Display("Checking whether the (shared) C++ compiler works... ") text = """ int main() { return 0; } """ ret = _check_empty_program(context, 'SHCXX', text, 'C++', use_shared = True) _YesNoResult(context, ret, None, text) return ret def _check_empty_program(context, comp, text, language, use_shared = False): """Return 0 on success, 1 otherwise.""" if comp not in context.env or not context.env[comp]: # The compiler construction variable is not set or empty return 1 lang, suffix, msg = _lang2suffix(language) if msg: return 1 if use_shared: return context.CompileSharedObject(text, suffix) else: return context.CompileProg(text, suffix) def CheckFunc(context, function_name, header = None, language = None): """ Configure check for a function "function_name". "language" should be "C" or "C++" and is used to select the compiler. Default is "C". Optional "header" can be defined to define a function prototype, include a header file or anything else that comes before main(). Sets HAVE_function_name in context.havedict according to the result. Note that this uses the current value of compiler and linker flags, make sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly. Returns an empty string for success, an error message for failure. """ # Remarks from autoconf: # - Don't include because on OSF/1 3.0 it includes # which includes which contains a prototype for select. # Similarly for bzero. # - assert.h is included to define __stub macros and hopefully few # prototypes, which can conflict with char $1(); below. # - Override any gcc2 internal prototype to avoid an error. # - We use char for the function declaration because int might match the # return type of a gcc2 builtin and then its argument prototype would # still apply. # - The GNU C library defines this for functions which it implements to # always fail with ENOSYS. Some functions are actually named something # starting with __ and the normal name is an alias. if context.headerfilename: includetext = '#include "%s"' % context.headerfilename else: includetext = '' if not header: header = """ #ifdef __cplusplus extern "C" #endif char %s();""" % function_name lang, suffix, msg = _lang2suffix(language) if msg: context.Display("Cannot check for %s(): %s\n" % (function_name, msg)) return msg text = """ %(include)s #include %(hdr)s int main() { #if defined (__stub_%(name)s) || defined (__stub___%(name)s) fail fail fail #else %(name)s(); #endif return 0; } """ % { 'name': function_name, 'include': includetext, 'hdr': header } context.Display("Checking for %s function %s()... " % (lang, function_name)) ret = context.BuildProg(text, suffix) _YesNoResult(context, ret, "HAVE_" + function_name, text, "Define to 1 if the system has the function `%s'." %\ function_name) return ret def CheckHeader(context, header_name, header = None, language = None, include_quotes = None): """ Configure check for a C or C++ header file "header_name". Optional "header" can be defined to do something before including the header file (unusual, supported for consistency). "language" should be "C" or "C++" and is used to select the compiler. Default is "C". Sets HAVE_header_name in context.havedict according to the result. Note that this uses the current value of compiler and linker flags, make sure $CFLAGS and $CPPFLAGS are set correctly. Returns an empty string for success, an error message for failure. """ # Why compile the program instead of just running the preprocessor? # It is possible that the header file exists, but actually using it may # fail (e.g., because it depends on other header files). Thus this test is # more strict. It may require using the "header" argument. # # Use <> by default, because the check is normally used for system header # files. SCons passes '""' to overrule this. # Include "confdefs.h" first, so that the header can use HAVE_HEADER_H. if context.headerfilename: includetext = '#include "%s"\n' % context.headerfilename else: includetext = '' if not header: header = "" lang, suffix, msg = _lang2suffix(language) if msg: context.Display("Cannot check for header file %s: %s\n" % (header_name, msg)) return msg if not include_quotes: include_quotes = "<>" text = "%s%s\n#include %s%s%s\n\n" % (includetext, header, include_quotes[0], header_name, include_quotes[1]) context.Display("Checking for %s header file %s... " % (lang, header_name)) ret = context.CompileProg(text, suffix) _YesNoResult(context, ret, "HAVE_" + header_name, text, "Define to 1 if you have the <%s> header file." % header_name) return ret def CheckType(context, type_name, fallback = None, header = None, language = None): """ Configure check for a C or C++ type "type_name". Optional "header" can be defined to include a header file. "language" should be "C" or "C++" and is used to select the compiler. Default is "C". Sets HAVE_type_name in context.havedict according to the result. Note that this uses the current value of compiler and linker flags, make sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly. Returns an empty string for success, an error message for failure. """ # Include "confdefs.h" first, so that the header can use HAVE_HEADER_H. if context.headerfilename: includetext = '#include "%s"' % context.headerfilename else: includetext = '' if not header: header = "" lang, suffix, msg = _lang2suffix(language) if msg: context.Display("Cannot check for %s type: %s\n" % (type_name, msg)) return msg # Remarks from autoconf about this test: # - Grepping for the type in include files is not reliable (grep isn't # portable anyway). # - Using "TYPE my_var;" doesn't work for const qualified types in C++. # Adding an initializer is not valid for some C++ classes. # - Using the type as parameter to a function either fails for K&$ C or for # C++. # - Using "TYPE *my_var;" is valid in C for some types that are not # declared (struct something). # - Using "sizeof(TYPE)" is valid when TYPE is actually a variable. # - Using the previous two together works reliably. text = """ %(include)s %(header)s int main() { if ((%(name)s *) 0) return 0; if (sizeof (%(name)s)) return 0; } """ % { 'include': includetext, 'header': header, 'name': type_name } context.Display("Checking for %s type %s... " % (lang, type_name)) ret = context.BuildProg(text, suffix) _YesNoResult(context, ret, "HAVE_" + type_name, text, "Define to 1 if the system has the type `%s'." % type_name) if ret and fallback and context.headerfilename: f = open(context.headerfilename, "a") f.write("typedef %s %s;\n" % (fallback, type_name)) f.close() return ret def CheckTypeSize(context, type_name, header = None, language = None, expect = None): """This check can be used to get the size of a given type, or to check whether the type is of expected size. Arguments: - type : str the type to check - includes : sequence list of headers to include in the test code before testing the type - language : str 'C' or 'C++' - expect : int if given, will test wether the type has the given number of bytes. If not given, will automatically find the size. Returns: status : int 0 if the check failed, or the found size of the type if the check succeeded.""" # Include "confdefs.h" first, so that the header can use HAVE_HEADER_H. if context.headerfilename: includetext = '#include "%s"' % context.headerfilename else: includetext = '' if not header: header = "" lang, suffix, msg = _lang2suffix(language) if msg: context.Display("Cannot check for %s type: %s\n" % (type_name, msg)) return msg src = includetext + header if not expect is None: # Only check if the given size is the right one context.Display('Checking %s is %d bytes... ' % (type_name, expect)) # test code taken from autoconf: this is a pretty clever hack to find that # a type is of a given size using only compilation. This speeds things up # quite a bit compared to straightforward code using TryRun src = src + r""" typedef %s scons_check_type; int main() { static int test_array[1 - 2 * !(((long int) (sizeof(scons_check_type))) == %d)]; test_array[0] = 0; return 0; } """ st = context.CompileProg(src % (type_name, expect), suffix) if not st: context.Display("yes\n") _Have(context, "SIZEOF_%s" % type_name, expect, "The size of `%s', as computed by sizeof." % type_name) return expect else: context.Display("no\n") _LogFailed(context, src, st) return 0 else: # Only check if the given size is the right one context.Message('Checking size of %s ... ' % type_name) # We have to be careful with the program we wish to test here since # compilation will be attempted using the current environment's flags. # So make sure that the program will compile without any warning. For # example using: 'int main(int argc, char** argv)' will fail with the # '-Wall -Werror' flags since the variables argc and argv would not be # used in the program... # src = src + """ #include #include int main() { printf("%d", (int)sizeof(""" + type_name + """)); return 0; } """ st, out = context.RunProg(src, suffix) try: size = int(out) except ValueError: # If cannot convert output of test prog to an integer (the size), # something went wront, so just fail st = 1 size = 0 if not st: context.Display("yes\n") _Have(context, "SIZEOF_%s" % type_name, size, "The size of `%s', as computed by sizeof." % type_name) return size else: context.Display("no\n") _LogFailed(context, src, st) return 0 return 0 def CheckDeclaration(context, symbol, includes = None, language = None): """Checks whether symbol is declared. Use the same test as autoconf, that is test whether the symbol is defined as a macro or can be used as an r-value. Arguments: symbol : str the symbol to check includes : str Optional "header" can be defined to include a header file. language : str only C and C++ supported. Returns: status : bool True if the check failed, False if succeeded.""" # Include "confdefs.h" first, so that the header can use HAVE_HEADER_H. if context.headerfilename: includetext = '#include "%s"' % context.headerfilename else: includetext = '' if not includes: includes = "" lang, suffix, msg = _lang2suffix(language) if msg: context.Display("Cannot check for declaration %s: %s\n" % (symbol, msg)) return msg src = includetext + includes context.Display('Checking whether %s is declared... ' % symbol) src = src + r""" int main() { #ifndef %s (void) %s; #endif ; return 0; } """ % (symbol, symbol) st = context.CompileProg(src, suffix) _YesNoResult(context, st, "HAVE_DECL_" + symbol, src, "Set to 1 if %s is defined." % symbol) return st def CheckLib(context, libs, func_name = None, header = None, extra_libs = None, call = None, language = None, autoadd = 1, append = True): """ Configure check for a C or C++ libraries "libs". Searches through the list of libraries, until one is found where the test succeeds. Tests if "func_name" or "call" exists in the library. Note: if it exists in another library the test succeeds anyway! Optional "header" can be defined to include a header file. If not given a default prototype for "func_name" is added. Optional "extra_libs" is a list of library names to be added after "lib_name" in the build command. To be used for libraries that "lib_name" depends on. Optional "call" replaces the call to "func_name" in the test code. It must consist of complete C statements, including a trailing ";". Both "func_name" and "call" arguments are optional, and in that case, just linking against the libs is tested. "language" should be "C" or "C++" and is used to select the compiler. Default is "C". Note that this uses the current value of compiler and linker flags, make sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly. Returns an empty string for success, an error message for failure. """ # Include "confdefs.h" first, so that the header can use HAVE_HEADER_H. if context.headerfilename: includetext = '#include "%s"' % context.headerfilename else: includetext = '' if not header: header = "" text = """ %s %s""" % (includetext, header) # Add a function declaration if needed. if func_name and func_name != "main": if not header: text = text + """ #ifdef __cplusplus extern "C" #endif char %s(); """ % func_name # The actual test code. if not call: call = "%s();" % func_name # if no function to test, leave main() blank text = text + """ int main() { %s return 0; } """ % (call or "") if call: i = call.find("\n") if i > 0: calltext = call[:i] + ".." elif call[-1] == ';': calltext = call[:-1] else: calltext = call for lib_name in libs: lang, suffix, msg = _lang2suffix(language) if msg: context.Display("Cannot check for library %s: %s\n" % (lib_name, msg)) return msg # if a function was specified to run in main(), say it if call: context.Display("Checking for %s in %s library %s... " % (calltext, lang, lib_name)) # otherwise, just say the name of library and language else: context.Display("Checking for %s library %s... " % (lang, lib_name)) if lib_name: l = [ lib_name ] if extra_libs: l.extend(extra_libs) if append: oldLIBS = context.AppendLIBS(l) else: oldLIBS = context.PrependLIBS(l) sym = "HAVE_LIB" + lib_name else: oldLIBS = -1 sym = None ret = context.BuildProg(text, suffix) _YesNoResult(context, ret, sym, text, "Define to 1 if you have the `%s' library." % lib_name) if oldLIBS != -1 and (ret or not autoadd): context.SetLIBS(oldLIBS) if not ret: return ret return ret def CheckProg(context, prog_name): """ Configure check for a specific program. Check whether program prog_name exists in path. If it is found, returns the path for it, otherwise returns None. """ context.Display("Checking whether %s program exists..." % prog_name) path = context.env.WhereIs(prog_name) if path: context.Display(path + "\n") else: context.Display("no\n") return path # # END OF PUBLIC FUNCTIONS # def _YesNoResult(context, ret, key, text, comment = None): """ Handle the result of a test with a "yes" or "no" result. :Parameters: - `ret` is the return value: empty if OK, error message when not. - `key` is the name of the symbol to be defined (HAVE_foo). - `text` is the source code of the program used for testing. - `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\* \*/). If None, no comment is added. """ if key: _Have(context, key, not ret, comment) if ret: context.Display("no\n") _LogFailed(context, text, ret) else: context.Display("yes\n") def _Have(context, key, have, comment = None): """ Store result of a test in context.havedict and context.headerfilename. :Parameters: - `key` - is a "HAVE_abc" name. It is turned into all CAPITALS and non-alphanumerics are replaced by an underscore. - `have` - value as it should appear in the header file, include quotes when desired and escape special characters! - `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\* \*/). If None, no comment is added. The value of "have" can be: - 1 - Feature is defined, add "#define key". - 0 - Feature is not defined, add "/\* #undef key \*/". Adding "undef" is what autoconf does. Not useful for the compiler, but it shows that the test was done. - number - Feature is defined to this number "#define key have". Doesn't work for 0 or 1, use a string then. - string - Feature is defined to this string "#define key have". """ key_up = key.upper() key_up = re.sub('[^A-Z0-9_]', '_', key_up) context.havedict[key_up] = have if have == 1: line = "#define %s 1\n" % key_up elif have == 0: line = "/* #undef %s */\n" % key_up elif isinstance(have, int): line = "#define %s %d\n" % (key_up, have) else: line = "#define %s %s\n" % (key_up, str(have)) if comment is not None: lines = "\n/* %s */\n" % comment + line else: lines = "\n" + line if context.headerfilename: f = open(context.headerfilename, "a") f.write(lines) f.close() elif hasattr(context,'config_h'): context.config_h = context.config_h + lines def _LogFailed(context, text, msg): """ Write to the log about a failed program. Add line numbers, so that error messages can be understood. """ if LogInputFiles: context.Log("Failed program was:\n") lines = text.split('\n') if len(lines) and lines[-1] == '': lines = lines[:-1] # remove trailing empty line n = 1 for line in lines: context.Log("%d: %s\n" % (n, line)) n = n + 1 if LogErrorMessages: context.Log("Error message: %s\n" % msg) def _lang2suffix(lang): """ Convert a language name to a suffix. When "lang" is empty or None C is assumed. Returns a tuple (lang, suffix, None) when it works. For an unrecognized language returns (None, None, msg). Where: - lang = the unified language name - suffix = the suffix, including the leading dot - msg = an error message """ if not lang or lang in ["C", "c"]: return ("C", ".c", None) if lang in ["c++", "C++", "cpp", "CXX", "cxx"]: return ("C++", ".cpp", None) return None, None, "Unsupported language: %s" % lang # vim: set sw=4 et sts=4 tw=79 fo+=l: # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/JobTests.py0000664000175000017500000004621613160023041020653 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/JobTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import unittest import random import math import sys import time import TestUnit import SCons.Job # a large number num_sines = 10000 # how many parallel jobs to perform for the test num_jobs = 11 # how many tasks to perform for the test num_tasks = num_jobs*5 class DummyLock(object): "fake lock class to use if threads are not supported" def acquire(self): pass def release(self): pass class NoThreadsException(object): "raised by the ParallelTestCase if threads are not supported" def __str__(self): return "the interpreter doesn't support threads" class Task(object): """A dummy task class for testing purposes.""" def __init__(self, i, taskmaster): self.i = i self.taskmaster = taskmaster self.was_executed = 0 self.was_prepared = 0 def prepare(self): self.was_prepared = 1 def _do_something(self): pass def needs_execute(self): return True def execute(self): self.taskmaster.test_case.failUnless(self.was_prepared, "the task wasn't prepared") self.taskmaster.guard.acquire() self.taskmaster.begin_list.append(self.i) self.taskmaster.guard.release() self._do_something() self.was_executed = 1 self.taskmaster.guard.acquire() self.taskmaster.end_list.append(self.i) self.taskmaster.guard.release() def executed(self): self.taskmaster.num_executed = self.taskmaster.num_executed + 1 self.taskmaster.test_case.failUnless(self.was_prepared, "the task wasn't prepared") self.taskmaster.test_case.failUnless(self.was_executed, "the task wasn't really executed") self.taskmaster.test_case.failUnless(isinstance(self, Task), "the task wasn't really a Task instance") def failed(self): self.taskmaster.num_failed = self.taskmaster.num_failed + 1 self.taskmaster.stop = 1 self.taskmaster.test_case.failUnless(self.was_prepared, "the task wasn't prepared") def postprocess(self): self.taskmaster.num_postprocessed = self.taskmaster.num_postprocessed + 1 class RandomTask(Task): def _do_something(self): # do something that will take some random amount of time: for i in range(random.randrange(0, num_sines, 1)): x = math.sin(i) time.sleep(0.01) class ExceptionTask(object): """A dummy task class for testing purposes.""" def __init__(self, i, taskmaster): self.taskmaster = taskmaster self.was_prepared = 0 def prepare(self): self.was_prepared = 1 def needs_execute(self): return True def execute(self): raise Exception def executed(self): self.taskmaster.num_executed = self.taskmaster.num_executed + 1 self.taskmaster.test_case.failUnless(self.was_prepared, "the task wasn't prepared") self.taskmaster.test_case.failUnless(self.was_executed, "the task wasn't really executed") self.taskmaster.test_case.failUnless(self.__class__ is Task, "the task wasn't really a Task instance") def failed(self): self.taskmaster.num_failed = self.taskmaster.num_failed + 1 self.taskmaster.stop = 1 self.taskmaster.test_case.failUnless(self.was_prepared, "the task wasn't prepared") def postprocess(self): self.taskmaster.num_postprocessed = self.taskmaster.num_postprocessed + 1 def exception_set(self): self.taskmaster.exception_set() class Taskmaster(object): """A dummy taskmaster class for testing the job classes.""" def __init__(self, n, test_case, Task): """n is the number of dummy tasks to perform.""" self.test_case = test_case self.stop = None self.num_tasks = n self.num_iterated = 0 self.num_executed = 0 self.num_failed = 0 self.num_postprocessed = 0 self.Task = Task # 'guard' guards 'task_begin_list' and 'task_end_list' try: import threading self.guard = threading.Lock() except: self.guard = DummyLock() # keep track of the order tasks are begun in self.begin_list = [] # keep track of the order tasks are completed in self.end_list = [] def next_task(self): if self.stop or self.all_tasks_are_iterated(): return None else: self.num_iterated = self.num_iterated + 1 return self.Task(self.num_iterated, self) def all_tasks_are_executed(self): return self.num_executed == self.num_tasks def all_tasks_are_iterated(self): return self.num_iterated == self.num_tasks def all_tasks_are_postprocessed(self): return self.num_postprocessed == self.num_tasks def tasks_were_serial(self): "analyze the task order to see if they were serial" serial = 1 # assume the tasks were serial for i in range(num_tasks): serial = serial and (self.begin_list[i] == self.end_list[i] == (i + 1)) return serial def exception_set(self): pass def cleanup(self): pass SaveThreadPool = None ThreadPoolCallList = [] class ParallelTestCase(unittest.TestCase): def runTest(self): "test parallel jobs" try: import threading except: raise NoThreadsException() taskmaster = Taskmaster(num_tasks, self, RandomTask) jobs = SCons.Job.Jobs(num_jobs, taskmaster) jobs.run() self.failUnless(not taskmaster.tasks_were_serial(), "the tasks were not executed in parallel") self.failUnless(taskmaster.all_tasks_are_executed(), "all the tests were not executed") self.failUnless(taskmaster.all_tasks_are_iterated(), "all the tests were not iterated over") self.failUnless(taskmaster.all_tasks_are_postprocessed(), "all the tests were not postprocessed") self.failIf(taskmaster.num_failed, "some task(s) failed to execute") # Verify that parallel jobs will pull all of the completed tasks # out of the queue at once, instead of one by one. We do this by # replacing the default ThreadPool class with one that records the # order in which tasks are put() and get() to/from the pool, and # which sleeps a little bit before call get() to let the initial # tasks complete and get their notifications on the resultsQueue. class SleepTask(Task): def _do_something(self): time.sleep(0.1) global SaveThreadPool SaveThreadPool = SCons.Job.ThreadPool class WaitThreadPool(SaveThreadPool): def put(self, task): ThreadPoolCallList.append('put(%s)' % task.i) return SaveThreadPool.put(self, task) def get(self): time.sleep(0.5) result = SaveThreadPool.get(self) ThreadPoolCallList.append('get(%s)' % result[0].i) return result SCons.Job.ThreadPool = WaitThreadPool try: taskmaster = Taskmaster(3, self, SleepTask) jobs = SCons.Job.Jobs(2, taskmaster) jobs.run() # The key here is that we get(1) and get(2) from the # resultsQueue before we put(3), but get(1) and get(2) can # be in either order depending on how the first two parallel # tasks get scheduled by the operating system. expect = [ ['put(1)', 'put(2)', 'get(1)', 'get(2)', 'put(3)', 'get(3)'], ['put(1)', 'put(2)', 'get(2)', 'get(1)', 'put(3)', 'get(3)'], ] assert ThreadPoolCallList in expect, ThreadPoolCallList finally: SCons.Job.ThreadPool = SaveThreadPool class SerialTestCase(unittest.TestCase): def runTest(self): "test a serial job" taskmaster = Taskmaster(num_tasks, self, RandomTask) jobs = SCons.Job.Jobs(1, taskmaster) jobs.run() self.failUnless(taskmaster.tasks_were_serial(), "the tasks were not executed in series") self.failUnless(taskmaster.all_tasks_are_executed(), "all the tests were not executed") self.failUnless(taskmaster.all_tasks_are_iterated(), "all the tests were not iterated over") self.failUnless(taskmaster.all_tasks_are_postprocessed(), "all the tests were not postprocessed") self.failIf(taskmaster.num_failed, "some task(s) failed to execute") class NoParallelTestCase(unittest.TestCase): def runTest(self): "test handling lack of parallel support" def NoParallel(tm, num, stack_size): raise NameError save_Parallel = SCons.Job.Parallel SCons.Job.Parallel = NoParallel try: taskmaster = Taskmaster(num_tasks, self, RandomTask) jobs = SCons.Job.Jobs(2, taskmaster) self.failUnless(jobs.num_jobs == 1, "unexpected number of jobs %d" % jobs.num_jobs) jobs.run() self.failUnless(taskmaster.tasks_were_serial(), "the tasks were not executed in series") self.failUnless(taskmaster.all_tasks_are_executed(), "all the tests were not executed") self.failUnless(taskmaster.all_tasks_are_iterated(), "all the tests were not iterated over") self.failUnless(taskmaster.all_tasks_are_postprocessed(), "all the tests were not postprocessed") self.failIf(taskmaster.num_failed, "some task(s) failed to execute") finally: SCons.Job.Parallel = save_Parallel class SerialExceptionTestCase(unittest.TestCase): def runTest(self): "test a serial job with tasks that raise exceptions" taskmaster = Taskmaster(num_tasks, self, ExceptionTask) jobs = SCons.Job.Jobs(1, taskmaster) jobs.run() self.failIf(taskmaster.num_executed, "a task was executed") self.failUnless(taskmaster.num_iterated == 1, "exactly one task should have been iterated") self.failUnless(taskmaster.num_failed == 1, "exactly one task should have failed") self.failUnless(taskmaster.num_postprocessed == 1, "exactly one task should have been postprocessed") class ParallelExceptionTestCase(unittest.TestCase): def runTest(self): "test parallel jobs with tasks that raise exceptions" taskmaster = Taskmaster(num_tasks, self, ExceptionTask) jobs = SCons.Job.Jobs(num_jobs, taskmaster) jobs.run() self.failIf(taskmaster.num_executed, "a task was executed") self.failUnless(taskmaster.num_iterated >= 1, "one or more task should have been iterated") self.failUnless(taskmaster.num_failed >= 1, "one or more tasks should have failed") self.failUnless(taskmaster.num_postprocessed >= 1, "one or more tasks should have been postprocessed") #--------------------------------------------------------------------- # Above tested Job object with contrived Task and Taskmaster objects. # Now test Job object with actual Task and Taskmaster objects. import SCons.Taskmaster import SCons.Node import time class DummyNodeInfo(object): def update(self, obj): pass class testnode (SCons.Node.Node): def __init__(self): SCons.Node.Node.__init__(self) self.expect_to_be = SCons.Node.executed self.ninfo = DummyNodeInfo() class goodnode (testnode): def __init__(self): SCons.Node.Node.__init__(self) self.expect_to_be = SCons.Node.up_to_date self.ninfo = DummyNodeInfo() class slowgoodnode (goodnode): def prepare(self): # Delay to allow scheduled Jobs to run while the dispatcher # sleeps. Keep this short because it affects the time taken # by this test. time.sleep(0.15) goodnode.prepare(self) class badnode (goodnode): def __init__(self): goodnode.__init__(self) self.expect_to_be = SCons.Node.failed def build(self, **kw): raise Exception('badnode exception') class slowbadnode (badnode): def build(self, **kw): # Appears to take a while to build, allowing faster builds to # overlap. Time duration is not especially important, but if # it is faster than slowgoodnode then these could complete # while the scheduler is sleeping. time.sleep(0.05) raise Exception('slowbadnode exception') class badpreparenode (badnode): def prepare(self): raise Exception('badpreparenode exception') class _SConsTaskTest(unittest.TestCase): def _test_seq(self, num_jobs): for node_seq in [ [goodnode], [badnode], [slowbadnode], [slowgoodnode], [badpreparenode], [goodnode, badnode], [slowgoodnode, badnode], [goodnode, slowbadnode], [goodnode, goodnode, goodnode, slowbadnode], [goodnode, slowbadnode, badpreparenode, slowgoodnode], [goodnode, slowbadnode, slowgoodnode, badnode] ]: self._do_test(num_jobs, node_seq) def _do_test(self, num_jobs, node_seq): testnodes = [] for tnum in range(num_tasks): testnodes.append(node_seq[tnum % len(node_seq)]()) taskmaster = SCons.Taskmaster.Taskmaster(testnodes, tasker=SCons.Taskmaster.AlwaysTask) jobs = SCons.Job.Jobs(num_jobs, taskmaster) # Exceptions thrown by tasks are not actually propagated to # this level, but are instead stored in the Taskmaster. jobs.run() # Now figure out if tests proceeded correctly. The first test # that fails will shutdown the initiation of subsequent tests, # but any tests currently queued for execution will still be # processed, and any tests that completed before the failure # would have resulted in new tests being queued for execution. # Apply the following operational heuristics of Job.py: # 0) An initial jobset of tasks will be queued before any # good/bad results are obtained (from "execute" of task in # thread). # 1) A goodnode will complete immediately on its thread and # allow another node to be queued for execution. # 2) A badnode will complete immediately and suppress any # subsequent execution queuing, but all currently queued # tasks will still be processed. # 3) A slowbadnode will fail later. It will block slots in # the job queue. Nodes that complete immediately will # allow other nodes to be queued in their place, and this # will continue until either (#2) above or until all job # slots are filled with slowbadnode entries. # One approach to validating this test would be to try to # determine exactly how many nodes executed, how many didn't, # and the results of each, and then to assert failure on any # mismatch (including the total number of built nodes). # However, while this is possible to do for a single-processor # system, it is nearly impossible to predict correctly for a # multi-processor system and still test the characteristics of # delayed execution nodes. Stated another way, multithreading # is inherently non-deterministic unless you can completely # characterize the entire system, and since that's not # possible here, we shouldn't try. # Therefore, this test will simply scan the set of nodes to # see if the node was executed or not and if it was executed # that it obtained the expected value for that node # (i.e. verifying we don't get failure crossovers or # mislabelling of results). for N in testnodes: state = N.get_state() self.failUnless(state in [SCons.Node.no_state, N.expect_to_be], "Node %s got unexpected result: %s" % (N, state)) self.failUnless([N for N in testnodes if N.get_state()], "no nodes ran at all.") class SerialTaskTest(_SConsTaskTest): def runTest(self): "test serial jobs with actual Taskmaster and Task" self._test_seq(1) class ParallelTaskTest(_SConsTaskTest): def runTest(self): "test parallel jobs with actual Taskmaster and Task" self._test_seq(num_jobs) #--------------------------------------------------------------------- def suite(): suite = unittest.TestSuite() suite.addTest(ParallelTestCase()) suite.addTest(SerialTestCase()) suite.addTest(NoParallelTestCase()) suite.addTest(SerialExceptionTestCase()) suite.addTest(ParallelExceptionTestCase()) suite.addTest(SerialTaskTest()) suite.addTest(ParallelTaskTest()) return suite if __name__ == "__main__": runner = TestUnit.cli.get_runner() result = runner().run(suite()) if (len(result.failures) == 0 and len(result.errors) == 1 and isinstance(result.errors[0][0], SerialTestCase) and isinstance(result.errors[0][1][0], NoThreadsException)): sys.exit(2) elif not result.wasSuccessful(): sys.exit(1) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Util.py0000664000175000017500000014752713160023045020046 0ustar bdbaddogbdbaddog"""SCons.Util Various utility functions go here. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Util.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import sys import copy import re import types import codecs import pprint PY3 = sys.version_info[0] == 3 try: from UserDict import UserDict except ImportError as e: from collections import UserDict try: from UserList import UserList except ImportError as e: from collections import UserList from collections import Iterable try: from UserString import UserString except ImportError as e: from collections import UserString # Don't "from types import ..." these because we need to get at the # types module later to look for UnicodeType. # Below not used? # InstanceType = types.InstanceType MethodType = types.MethodType FunctionType = types.FunctionType try: unicode except NameError: UnicodeType = str else: UnicodeType = unicode def dictify(keys, values, result={}): for k, v in zip(keys, values): result[k] = v return result _altsep = os.altsep if _altsep is None and sys.platform == 'win32': # My ActivePython 2.0.1 doesn't set os.altsep! What gives? _altsep = '/' if _altsep: def rightmost_separator(path, sep): return max(path.rfind(sep), path.rfind(_altsep)) else: def rightmost_separator(path, sep): return path.rfind(sep) # First two from the Python Cookbook, just for completeness. # (Yeah, yeah, YAGNI...) def containsAny(str, set): """Check whether sequence str contains ANY of the items in set.""" for c in set: if c in str: return 1 return 0 def containsAll(str, set): """Check whether sequence str contains ALL of the items in set.""" for c in set: if c not in str: return 0 return 1 def containsOnly(str, set): """Check whether sequence str contains ONLY items in set.""" for c in str: if c not in set: return 0 return 1 def splitext(path): "Same as os.path.splitext() but faster." sep = rightmost_separator(path, os.sep) dot = path.rfind('.') # An ext is only real if it has at least one non-digit char if dot > sep and not containsOnly(path[dot:], "0123456789."): return path[:dot],path[dot:] else: return path,"" def updrive(path): """ Make the drive letter (if any) upper case. This is useful because Windows is inconsistent on the case of the drive letter, which can cause inconsistencies when calculating command signatures. """ drive, rest = os.path.splitdrive(path) if drive: path = drive.upper() + rest return path class NodeList(UserList): """This class is almost exactly like a regular list of Nodes (actually it can hold any object), with one important difference. If you try to get an attribute from this list, it will return that attribute from every item in the list. For example: >>> someList = NodeList([ ' foo ', ' bar ' ]) >>> someList.strip() [ 'foo', 'bar' ] """ # def __init__(self, initlist=None): # self.data = [] # # print("TYPE:%s"%type(initlist)) # if initlist is not None: # # XXX should this accept an arbitrary sequence? # if type(initlist) == type(self.data): # self.data[:] = initlist # elif isinstance(initlist, (UserList, NodeList)): # self.data[:] = initlist.data[:] # elif isinstance(initlist, Iterable): # self.data = list(initlist) # else: # self.data = [ initlist,] def __nonzero__(self): return len(self.data) != 0 def __bool__(self): return self.__nonzero__() def __str__(self): return ' '.join(map(str, self.data)) def __iter__(self): return iter(self.data) def __call__(self, *args, **kwargs): result = [x(*args, **kwargs) for x in self.data] return self.__class__(result) def __getattr__(self, name): result = [getattr(x, name) for x in self.data] return self.__class__(result) def __getitem__(self, index): """ This comes for free on py2, but py3 slices of NodeList are returning a list breaking slicing nodelist and refering to properties and methods on contained object """ # return self.__class__(self.data[index]) if isinstance(index, slice): # Expand the slice object using range() # limited by number of items in self.data indices = index.indices(len(self.data)) return self.__class__([self[x] for x in range(*indices)]) else: # Return one item of the tart return self.data[index] _get_env_var = re.compile(r'^\$([_a-zA-Z]\w*|{[_a-zA-Z]\w*})$') def get_environment_var(varstr): """Given a string, first determine if it looks like a reference to a single environment variable, like "$FOO" or "${FOO}". If so, return that variable with no decorations ("FOO"). If not, return None.""" mo=_get_env_var.match(to_String(varstr)) if mo: var = mo.group(1) if var[0] == '{': return var[1:-1] else: return var else: return None class DisplayEngine(object): print_it = True def __call__(self, text, append_newline=1): if not self.print_it: return if append_newline: text = text + '\n' try: sys.stdout.write(UnicodeType(text)) except IOError: # Stdout might be connected to a pipe that has been closed # by now. The most likely reason for the pipe being closed # is that the user has press ctrl-c. It this is the case, # then SCons is currently shutdown. We therefore ignore # IOError's here so that SCons can continue and shutdown # properly so that the .sconsign is correctly written # before SCons exits. pass def set_mode(self, mode): self.print_it = mode def render_tree(root, child_func, prune=0, margin=[0], visited=None): """ Render a tree of nodes into an ASCII tree view. :Parameters: - `root`: the root node of the tree - `child_func`: the function called to get the children of a node - `prune`: don't visit the same node twice - `margin`: the format of the left margin to use for children of root. 1 results in a pipe, and 0 results in no pipe. - `visited`: a dictionary of visited nodes in the current branch if not prune, or in the whole tree if prune. """ rname = str(root) # Initialize 'visited' dict, if required if visited is None: visited = {} children = child_func(root) retval = "" for pipe in margin[:-1]: if pipe: retval = retval + "| " else: retval = retval + " " if rname in visited: return retval + "+-[" + rname + "]\n" retval = retval + "+-" + rname + "\n" if not prune: visited = copy.copy(visited) visited[rname] = 1 for i in range(len(children)): margin.append(i < len(children)-1) retval = retval + render_tree(children[i], child_func, prune, margin, visited) margin.pop() return retval IDX = lambda N: N and 1 or 0 def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None): """ Print a tree of nodes. This is like render_tree, except it prints lines directly instead of creating a string representation in memory, so that huge trees can be printed. :Parameters: - `root` - the root node of the tree - `child_func` - the function called to get the children of a node - `prune` - don't visit the same node twice - `showtags` - print status information to the left of each node line - `margin` - the format of the left margin to use for children of root. 1 results in a pipe, and 0 results in no pipe. - `visited` - a dictionary of visited nodes in the current branch if not prune, or in the whole tree if prune. """ rname = str(root) # Initialize 'visited' dict, if required if visited is None: visited = {} if showtags: if showtags == 2: legend = (' E = exists\n' + ' R = exists in repository only\n' + ' b = implicit builder\n' + ' B = explicit builder\n' + ' S = side effect\n' + ' P = precious\n' + ' A = always build\n' + ' C = current\n' + ' N = no clean\n' + ' H = no cache\n' + '\n') sys.stdout.write(legend) tags = ['['] tags.append(' E'[IDX(root.exists())]) tags.append(' R'[IDX(root.rexists() and not root.exists())]) tags.append(' BbB'[[0,1][IDX(root.has_explicit_builder())] + [0,2][IDX(root.has_builder())]]) tags.append(' S'[IDX(root.side_effect)]) tags.append(' P'[IDX(root.precious)]) tags.append(' A'[IDX(root.always_build)]) tags.append(' C'[IDX(root.is_up_to_date())]) tags.append(' N'[IDX(root.noclean)]) tags.append(' H'[IDX(root.nocache)]) tags.append(']') else: tags = [] def MMM(m): return [" ","| "][m] margins = list(map(MMM, margin[:-1])) children = child_func(root) if prune and rname in visited and children: sys.stdout.write(''.join(tags + margins + ['+-[', rname, ']']) + '\n') return sys.stdout.write(''.join(tags + margins + ['+-', rname]) + '\n') visited[rname] = 1 if children: margin.append(1) idx = IDX(showtags) for C in children[:-1]: print_tree(C, child_func, prune, idx, margin, visited) margin[-1] = 0 print_tree(children[-1], child_func, prune, idx, margin, visited) margin.pop() # Functions for deciding if things are like various types, mainly to # handle UserDict, UserList and UserString like their underlying types. # # Yes, all of this manual testing breaks polymorphism, and the real # Pythonic way to do all of this would be to just try it and handle the # exception, but handling the exception when it's not the right type is # often too slow. # We are using the following trick to speed up these # functions. Default arguments are used to take a snapshot of # the global functions and constants used by these functions. This # transforms accesses to global variable into local variables # accesses (i.e. LOAD_FAST instead of LOAD_GLOBAL). DictTypes = (dict, UserDict) ListTypes = (list, UserList) SequenceTypes = (list, tuple, UserList) # Note that profiling data shows a speed-up when comparing # explicitly with str and unicode instead of simply comparing # with basestring. (at least on Python 2.5.1) try: StringTypes = (str, unicode, UserString) except NameError: StringTypes = (str, UserString) # Empirically, it is faster to check explicitly for str and # unicode than for basestring. try: BaseStringTypes = (str, unicode) except NameError: BaseStringTypes = (str) def is_Dict(obj, isinstance=isinstance, DictTypes=DictTypes): return isinstance(obj, DictTypes) def is_List(obj, isinstance=isinstance, ListTypes=ListTypes): return isinstance(obj, ListTypes) def is_Sequence(obj, isinstance=isinstance, SequenceTypes=SequenceTypes): return isinstance(obj, SequenceTypes) def is_Tuple(obj, isinstance=isinstance, tuple=tuple): return isinstance(obj, tuple) def is_String(obj, isinstance=isinstance, StringTypes=StringTypes): return isinstance(obj, StringTypes) def is_Scalar(obj, isinstance=isinstance, StringTypes=StringTypes, SequenceTypes=SequenceTypes): # Profiling shows that there is an impressive speed-up of 2x # when explicitly checking for strings instead of just not # sequence when the argument (i.e. obj) is already a string. # But, if obj is a not string then it is twice as fast to # check only for 'not sequence'. The following code therefore # assumes that the obj argument is a string most of the time. return isinstance(obj, StringTypes) or not isinstance(obj, SequenceTypes) def do_flatten(sequence, result, isinstance=isinstance, StringTypes=StringTypes, SequenceTypes=SequenceTypes): for item in sequence: if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes): result.append(item) else: do_flatten(item, result) def flatten(obj, isinstance=isinstance, StringTypes=StringTypes, SequenceTypes=SequenceTypes, do_flatten=do_flatten): """Flatten a sequence to a non-nested list. Flatten() converts either a single scalar or a nested sequence to a non-nested list. Note that flatten() considers strings to be scalars instead of sequences like Python would. """ if isinstance(obj, StringTypes) or not isinstance(obj, SequenceTypes): return [obj] result = [] for item in obj: if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes): result.append(item) else: do_flatten(item, result) return result def flatten_sequence(sequence, isinstance=isinstance, StringTypes=StringTypes, SequenceTypes=SequenceTypes, do_flatten=do_flatten): """Flatten a sequence to a non-nested list. Same as flatten(), but it does not handle the single scalar case. This is slightly more efficient when one knows that the sequence to flatten can not be a scalar. """ result = [] for item in sequence: if isinstance(item, StringTypes) or not isinstance(item, SequenceTypes): result.append(item) else: do_flatten(item, result) return result # Generic convert-to-string functions that abstract away whether or # not the Python we're executing has Unicode support. The wrapper # to_String_for_signature() will use a for_signature() method if the # specified object has one. # def to_String(s, isinstance=isinstance, str=str, UserString=UserString, BaseStringTypes=BaseStringTypes): if isinstance(s,BaseStringTypes): # Early out when already a string! return s elif isinstance(s, UserString): # s.data can only be either a unicode or a regular # string. Please see the UserString initializer. return s.data else: return str(s) def to_String_for_subst(s, isinstance=isinstance, str=str, to_String=to_String, BaseStringTypes=BaseStringTypes, SequenceTypes=SequenceTypes, UserString=UserString): # Note that the test cases are sorted by order of probability. if isinstance(s, BaseStringTypes): return s elif isinstance(s, SequenceTypes): l = [] for e in s: l.append(to_String_for_subst(e)) return ' '.join( s ) elif isinstance(s, UserString): # s.data can only be either a unicode or a regular # string. Please see the UserString initializer. return s.data else: return str(s) def to_String_for_signature(obj, to_String_for_subst=to_String_for_subst, AttributeError=AttributeError): try: f = obj.for_signature except AttributeError: if isinstance(obj, dict): # pprint will output dictionary in key sorted order # with py3.5 the order was randomized. In general depending on dictionary order # which was undefined until py3.6 (where it's by insertion order) was not wise. return pprint.pformat(obj, width=1000000) else: return to_String_for_subst(obj) else: return f() # The SCons "semi-deep" copy. # # This makes separate copies of lists (including UserList objects) # dictionaries (including UserDict objects) and tuples, but just copies # references to anything else it finds. # # A special case is any object that has a __semi_deepcopy__() method, # which we invoke to create the copy. Currently only used by # BuilderDict to actually prevent the copy operation (as invalid on that object). # # The dispatch table approach used here is a direct rip-off from the # normal Python copy module. _semi_deepcopy_dispatch = d = {} def semi_deepcopy_dict(x, exclude = [] ): copy = {} for key, val in x.items(): # The regular Python copy.deepcopy() also deepcopies the key, # as follows: # # copy[semi_deepcopy(key)] = semi_deepcopy(val) # # Doesn't seem like we need to, but we'll comment it just in case. if key not in exclude: copy[key] = semi_deepcopy(val) return copy d[dict] = semi_deepcopy_dict def _semi_deepcopy_list(x): return list(map(semi_deepcopy, x)) d[list] = _semi_deepcopy_list def _semi_deepcopy_tuple(x): return tuple(map(semi_deepcopy, x)) d[tuple] = _semi_deepcopy_tuple def semi_deepcopy(x): copier = _semi_deepcopy_dispatch.get(type(x)) if copier: return copier(x) else: if hasattr(x, '__semi_deepcopy__') and callable(x.__semi_deepcopy__): return x.__semi_deepcopy__() elif isinstance(x, UserDict): return x.__class__(semi_deepcopy_dict(x)) elif isinstance(x, UserList): return x.__class__(_semi_deepcopy_list(x)) return x class Proxy(object): """A simple generic Proxy class, forwarding all calls to subject. So, for the benefit of the python newbie, what does this really mean? Well, it means that you can take an object, let's call it 'objA', and wrap it in this Proxy class, with a statement like this proxyObj = Proxy(objA), Then, if in the future, you do something like this x = proxyObj.var1, since Proxy does not have a 'var1' attribute (but presumably objA does), the request actually is equivalent to saying x = objA.var1 Inherit from this class to create a Proxy. Note that, with new-style classes, this does *not* work transparently for Proxy subclasses that use special .__*__() method names, because those names are now bound to the class, not the individual instances. You now need to know in advance which .__*__() method names you want to pass on to the underlying Proxy object, and specifically delegate their calls like this: class Foo(Proxy): __str__ = Delegate('__str__') """ def __init__(self, subject): """Wrap an object as a Proxy object""" self._subject = subject def __getattr__(self, name): """Retrieve an attribute from the wrapped object. If the named attribute doesn't exist, AttributeError is raised""" return getattr(self._subject, name) def get(self): """Retrieve the entire wrapped object""" return self._subject def __eq__(self, other): if issubclass(other.__class__, self._subject.__class__): return self._subject == other return self.__dict__ == other.__dict__ class Delegate(object): """A Python Descriptor class that delegates attribute fetches to an underlying wrapped subject of a Proxy. Typical use: class Foo(Proxy): __str__ = Delegate('__str__') """ def __init__(self, attribute): self.attribute = attribute def __get__(self, obj, cls): if isinstance(obj, cls): return getattr(obj._subject, self.attribute) else: return self # attempt to load the windows registry module: can_read_reg = 0 try: import winreg can_read_reg = 1 hkey_mod = winreg RegOpenKeyEx = winreg.OpenKeyEx RegEnumKey = winreg.EnumKey RegEnumValue = winreg.EnumValue RegQueryValueEx = winreg.QueryValueEx RegError = winreg.error except ImportError: try: import win32api import win32con can_read_reg = 1 hkey_mod = win32con RegOpenKeyEx = win32api.RegOpenKeyEx RegEnumKey = win32api.RegEnumKey RegEnumValue = win32api.RegEnumValue RegQueryValueEx = win32api.RegQueryValueEx RegError = win32api.error except ImportError: class _NoError(Exception): pass RegError = _NoError WinError = None # Make sure we have a definition of WindowsError so we can # run platform-independent tests of Windows functionality on # platforms other than Windows. (WindowsError is, in fact, an # OSError subclass on Windows.) class PlainWindowsError(OSError): pass try: WinError = WindowsError except NameError: WinError = PlainWindowsError if can_read_reg: HKEY_CLASSES_ROOT = hkey_mod.HKEY_CLASSES_ROOT HKEY_LOCAL_MACHINE = hkey_mod.HKEY_LOCAL_MACHINE HKEY_CURRENT_USER = hkey_mod.HKEY_CURRENT_USER HKEY_USERS = hkey_mod.HKEY_USERS def RegGetValue(root, key): """This utility function returns a value in the registry without having to open the key first. Only available on Windows platforms with a version of Python that can read the registry. Returns the same thing as SCons.Util.RegQueryValueEx, except you just specify the entire path to the value, and don't have to bother opening the key first. So: Instead of: k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Windows\CurrentVersion') out = SCons.Util.RegQueryValueEx(k, 'ProgramFilesDir') You can write: out = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir') """ # I would use os.path.split here, but it's not a filesystem # path... p = key.rfind('\\') + 1 keyp = key[:p-1] # -1 to omit trailing slash val = key[p:] k = RegOpenKeyEx(root, keyp) return RegQueryValueEx(k,val) else: HKEY_CLASSES_ROOT = None HKEY_LOCAL_MACHINE = None HKEY_CURRENT_USER = None HKEY_USERS = None def RegGetValue(root, key): raise WinError def RegOpenKeyEx(root, key): raise WinError if sys.platform == 'win32': def WhereIs(file, path=None, pathext=None, reject=[]): if path is None: try: path = os.environ['PATH'] except KeyError: return None if is_String(path): path = path.split(os.pathsep) if pathext is None: try: pathext = os.environ['PATHEXT'] except KeyError: pathext = '.COM;.EXE;.BAT;.CMD' if is_String(pathext): pathext = pathext.split(os.pathsep) for ext in pathext: if ext.lower() == file[-len(ext):].lower(): pathext = [''] break if not is_List(reject) and not is_Tuple(reject): reject = [reject] for dir in path: f = os.path.join(dir, file) for ext in pathext: fext = f + ext if os.path.isfile(fext): try: reject.index(fext) except ValueError: return os.path.normpath(fext) continue return None elif os.name == 'os2': def WhereIs(file, path=None, pathext=None, reject=[]): if path is None: try: path = os.environ['PATH'] except KeyError: return None if is_String(path): path = path.split(os.pathsep) if pathext is None: pathext = ['.exe', '.cmd'] for ext in pathext: if ext.lower() == file[-len(ext):].lower(): pathext = [''] break if not is_List(reject) and not is_Tuple(reject): reject = [reject] for dir in path: f = os.path.join(dir, file) for ext in pathext: fext = f + ext if os.path.isfile(fext): try: reject.index(fext) except ValueError: return os.path.normpath(fext) continue return None else: def WhereIs(file, path=None, pathext=None, reject=[]): import stat if path is None: try: path = os.environ['PATH'] except KeyError: return None if is_String(path): path = path.split(os.pathsep) if not is_List(reject) and not is_Tuple(reject): reject = [reject] for d in path: f = os.path.join(d, file) if os.path.isfile(f): try: st = os.stat(f) except OSError: # os.stat() raises OSError, not IOError if the file # doesn't exist, so in this case we let IOError get # raised so as to not mask possibly serious disk or # network issues. continue if stat.S_IMODE(st[stat.ST_MODE]) & 0o111: try: reject.index(f) except ValueError: return os.path.normpath(f) continue return None def PrependPath(oldpath, newpath, sep = os.pathsep, delete_existing=1, canonicalize=None): """This prepends newpath elements to the given oldpath. Will only add any particular path once (leaving the first one it encounters and ignoring the rest, to preserve path order), and will os.path.normpath and os.path.normcase all paths to help assure this. This can also handle the case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string. Example: Old Path: "/foo/bar:/foo" New Path: "/biz/boom:/foo" Result: "/biz/boom:/foo:/foo/bar" If delete_existing is 0, then adding a path that exists will not move it to the beginning; it will stay where it is in the list. If canonicalize is not None, it is applied to each element of newpath before use. """ orig = oldpath is_list = 1 paths = orig if not is_List(orig) and not is_Tuple(orig): paths = paths.split(sep) is_list = 0 if is_String(newpath): newpaths = newpath.split(sep) elif not is_List(newpath) and not is_Tuple(newpath): newpaths = [ newpath ] # might be a Dir else: newpaths = newpath if canonicalize: newpaths=list(map(canonicalize, newpaths)) if not delete_existing: # First uniquify the old paths, making sure to # preserve the first instance (in Unix/Linux, # the first one wins), and remembering them in normpaths. # Then insert the new paths at the head of the list # if they're not already in the normpaths list. result = [] normpaths = [] for path in paths: if not path: continue normpath = os.path.normpath(os.path.normcase(path)) if normpath not in normpaths: result.append(path) normpaths.append(normpath) newpaths.reverse() # since we're inserting at the head for path in newpaths: if not path: continue normpath = os.path.normpath(os.path.normcase(path)) if normpath not in normpaths: result.insert(0, path) normpaths.append(normpath) paths = result else: newpaths = newpaths + paths # prepend new paths normpaths = [] paths = [] # now we add them only if they are unique for path in newpaths: normpath = os.path.normpath(os.path.normcase(path)) if path and not normpath in normpaths: paths.append(path) normpaths.append(normpath) if is_list: return paths else: return sep.join(paths) def AppendPath(oldpath, newpath, sep = os.pathsep, delete_existing=1, canonicalize=None): """This appends new path elements to the given old path. Will only add any particular path once (leaving the last one it encounters and ignoring the rest, to preserve path order), and will os.path.normpath and os.path.normcase all paths to help assure this. This can also handle the case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string. Example: Old Path: "/foo/bar:/foo" New Path: "/biz/boom:/foo" Result: "/foo/bar:/biz/boom:/foo" If delete_existing is 0, then adding a path that exists will not move it to the end; it will stay where it is in the list. If canonicalize is not None, it is applied to each element of newpath before use. """ orig = oldpath is_list = 1 paths = orig if not is_List(orig) and not is_Tuple(orig): paths = paths.split(sep) is_list = 0 if is_String(newpath): newpaths = newpath.split(sep) elif not is_List(newpath) and not is_Tuple(newpath): newpaths = [ newpath ] # might be a Dir else: newpaths = newpath if canonicalize: newpaths=list(map(canonicalize, newpaths)) if not delete_existing: # add old paths to result, then # add new paths if not already present # (I thought about using a dict for normpaths for speed, # but it's not clear hashing the strings would be faster # than linear searching these typically short lists.) result = [] normpaths = [] for path in paths: if not path: continue result.append(path) normpaths.append(os.path.normpath(os.path.normcase(path))) for path in newpaths: if not path: continue normpath = os.path.normpath(os.path.normcase(path)) if normpath not in normpaths: result.append(path) normpaths.append(normpath) paths = result else: # start w/ new paths, add old ones if not present, # then reverse. newpaths = paths + newpaths # append new paths newpaths.reverse() normpaths = [] paths = [] # now we add them only if they are unique for path in newpaths: normpath = os.path.normpath(os.path.normcase(path)) if path and not normpath in normpaths: paths.append(path) normpaths.append(normpath) paths.reverse() if is_list: return paths else: return sep.join(paths) def AddPathIfNotExists(env_dict, key, path, sep=os.pathsep): """This function will take 'key' out of the dictionary 'env_dict', then add the path 'path' to that key if it is not already there. This treats the value of env_dict[key] as if it has a similar format to the PATH variable...a list of paths separated by tokens. The 'path' will get added to the list if it is not already there.""" try: is_list = 1 paths = env_dict[key] if not is_List(env_dict[key]): paths = paths.split(sep) is_list = 0 if os.path.normcase(path) not in list(map(os.path.normcase, paths)): paths = [ path ] + paths if is_list: env_dict[key] = paths else: env_dict[key] = sep.join(paths) except KeyError: env_dict[key] = path if sys.platform == 'cygwin': def get_native_path(path): """Transforms an absolute path into a native path for the system. In Cygwin, this converts from a Cygwin path to a Windows one.""" return os.popen('cygpath -w ' + path).read().replace('\n', '') else: def get_native_path(path): """Transforms an absolute path into a native path for the system. Non-Cygwin version, just leave the path alone.""" return path display = DisplayEngine() def Split(arg): if is_List(arg) or is_Tuple(arg): return arg elif is_String(arg): return arg.split() else: return [arg] class CLVar(UserList): """A class for command-line construction variables. This is a list that uses Split() to split an initial string along white-space arguments, and similarly to split any strings that get added. This allows us to Do the Right Thing with Append() and Prepend() (as well as straight Python foo = env['VAR'] + 'arg1 arg2') regardless of whether a user adds a list or a string to a command-line construction variable. """ def __init__(self, seq = []): UserList.__init__(self, Split(seq)) def __add__(self, other): return UserList.__add__(self, CLVar(other)) def __radd__(self, other): return UserList.__radd__(self, CLVar(other)) def __coerce__(self, other): return (self, CLVar(other)) def __str__(self): return ' '.join(self.data) # A dictionary that preserves the order in which items are added. # Submitted by David Benjamin to ActiveState's Python Cookbook web site: # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747 # Including fixes/enhancements from the follow-on discussions. class OrderedDict(UserDict): def __init__(self, dict = None): self._keys = [] UserDict.__init__(self, dict) def __delitem__(self, key): UserDict.__delitem__(self, key) self._keys.remove(key) def __setitem__(self, key, item): UserDict.__setitem__(self, key, item) if key not in self._keys: self._keys.append(key) def clear(self): UserDict.clear(self) self._keys = [] def copy(self): dict = OrderedDict() dict.update(self) return dict def items(self): return list(zip(self._keys, list(self.values()))) def keys(self): return self._keys[:] def popitem(self): try: key = self._keys[-1] except IndexError: raise KeyError('dictionary is empty') val = self[key] del self[key] return (key, val) def setdefault(self, key, failobj = None): UserDict.setdefault(self, key, failobj) if key not in self._keys: self._keys.append(key) def update(self, dict): for (key, val) in dict.items(): self.__setitem__(key, val) def values(self): return list(map(self.get, self._keys)) class Selector(OrderedDict): """A callable ordered dictionary that maps file suffixes to dictionary values. We preserve the order in which items are added so that get_suffix() calls always return the first suffix added.""" def __call__(self, env, source, ext=None): if ext is None: try: ext = source[0].get_suffix() except IndexError: ext = "" try: return self[ext] except KeyError: # Try to perform Environment substitution on the keys of # the dictionary before giving up. s_dict = {} for (k,v) in self.items(): if k is not None: s_k = env.subst(k) if s_k in s_dict: # We only raise an error when variables point # to the same suffix. If one suffix is literal # and a variable suffix contains this literal, # the literal wins and we don't raise an error. raise KeyError(s_dict[s_k][0], k, s_k) s_dict[s_k] = (k,v) try: return s_dict[ext][1] except KeyError: try: return self[None] except KeyError: return None if sys.platform == 'cygwin': # On Cygwin, os.path.normcase() lies, so just report back the # fact that the underlying Windows OS is case-insensitive. def case_sensitive_suffixes(s1, s2): return 0 else: def case_sensitive_suffixes(s1, s2): return (os.path.normcase(s1) != os.path.normcase(s2)) def adjustixes(fname, pre, suf, ensure_suffix=False): if pre: path, fn = os.path.split(os.path.normpath(fname)) if fn[:len(pre)] != pre: fname = os.path.join(path, pre + fn) # Only append a suffix if the suffix we're going to add isn't already # there, and if either we've been asked to ensure the specific suffix # is present or there's no suffix on it at all. if suf and fname[-len(suf):] != suf and \ (ensure_suffix or not splitext(fname)[1]): fname = fname + suf return fname # From Tim Peters, # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560 # ASPN: Python Cookbook: Remove duplicates from a sequence # (Also in the printed Python Cookbook.) def unique(s): """Return a list of the elements in s, but without duplicates. For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3], unique("abcabc") some permutation of ["a", "b", "c"], and unique(([1, 2], [2, 3], [1, 2])) some permutation of [[2, 3], [1, 2]]. For best speed, all sequence elements should be hashable. Then unique() will usually work in linear time. If not possible, the sequence elements should enjoy a total ordering, and if list(s).sort() doesn't raise TypeError it's assumed that they do enjoy a total ordering. Then unique() will usually work in O(N*log2(N)) time. If that's not possible either, the sequence elements must support equality-testing. Then unique() will usually work in quadratic time. """ n = len(s) if n == 0: return [] # Try using a dict first, as that's the fastest and will usually # work. If it doesn't work, it will usually fail quickly, so it # usually doesn't cost much to *try* it. It requires that all the # sequence elements be hashable, and support equality comparison. u = {} try: for x in s: u[x] = 1 except TypeError: pass # move on to the next method else: return list(u.keys()) del u # We can't hash all the elements. Second fastest is to sort, # which brings the equal elements together; then duplicates are # easy to weed out in a single pass. # NOTE: Python's list.sort() was designed to be efficient in the # presence of many duplicate elements. This isn't true of all # sort functions in all languages or libraries, so this approach # is more effective in Python than it may be elsewhere. try: t = sorted(s) except TypeError: pass # move on to the next method else: assert n > 0 last = t[0] lasti = i = 1 while i < n: if t[i] != last: t[lasti] = last = t[i] lasti = lasti + 1 i = i + 1 return t[:lasti] del t # Brute force is all that's left. u = [] for x in s: if x not in u: u.append(x) return u # From Alex Martelli, # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560 # ASPN: Python Cookbook: Remove duplicates from a sequence # First comment, dated 2001/10/13. # (Also in the printed Python Cookbook.) def uniquer(seq, idfun=None): if idfun is None: def idfun(x): return x seen = {} result = [] for item in seq: marker = idfun(item) # in old Python versions: # if seen.has_key(marker) # but in new ones: if marker in seen: continue seen[marker] = 1 result.append(item) return result # A more efficient implementation of Alex's uniquer(), this avoids the # idfun() argument and function-call overhead by assuming that all # items in the sequence are hashable. def uniquer_hashables(seq): seen = {} result = [] for item in seq: #if not item in seen: if item not in seen: seen[item] = 1 result.append(item) return result # Recipe 19.11 "Reading Lines with Continuation Characters", # by Alex Martelli, straight from the Python CookBook (2nd edition). def logical_lines(physical_lines, joiner=''.join): logical_line = [] for line in physical_lines: stripped = line.rstrip() if stripped.endswith('\\'): # a line which continues w/the next physical line logical_line.append(stripped[:-1]) else: # a line which does not continue, end of logical line logical_line.append(line) yield joiner(logical_line) logical_line = [] if logical_line: # end of sequence implies end of last logical line yield joiner(logical_line) class LogicalLines(object): """ Wrapper class for the logical_lines method. Allows us to read all "logical" lines at once from a given file object. """ def __init__(self, fileobj): self.fileobj = fileobj def readlines(self): result = [l for l in logical_lines(self.fileobj)] return result class UniqueList(UserList): def __init__(self, seq = []): UserList.__init__(self, seq) self.unique = True def __make_unique(self): if not self.unique: self.data = uniquer_hashables(self.data) self.unique = True def __lt__(self, other): self.__make_unique() return UserList.__lt__(self, other) def __le__(self, other): self.__make_unique() return UserList.__le__(self, other) def __eq__(self, other): self.__make_unique() return UserList.__eq__(self, other) def __ne__(self, other): self.__make_unique() return UserList.__ne__(self, other) def __gt__(self, other): self.__make_unique() return UserList.__gt__(self, other) def __ge__(self, other): self.__make_unique() return UserList.__ge__(self, other) def __cmp__(self, other): self.__make_unique() return UserList.__cmp__(self, other) def __len__(self): self.__make_unique() return UserList.__len__(self) def __getitem__(self, i): self.__make_unique() return UserList.__getitem__(self, i) def __setitem__(self, i, item): UserList.__setitem__(self, i, item) self.unique = False def __getslice__(self, i, j): self.__make_unique() return UserList.__getslice__(self, i, j) def __setslice__(self, i, j, other): UserList.__setslice__(self, i, j, other) self.unique = False def __add__(self, other): result = UserList.__add__(self, other) result.unique = False return result def __radd__(self, other): result = UserList.__radd__(self, other) result.unique = False return result def __iadd__(self, other): result = UserList.__iadd__(self, other) result.unique = False return result def __mul__(self, other): result = UserList.__mul__(self, other) result.unique = False return result def __rmul__(self, other): result = UserList.__rmul__(self, other) result.unique = False return result def __imul__(self, other): result = UserList.__imul__(self, other) result.unique = False return result def append(self, item): UserList.append(self, item) self.unique = False def insert(self, i): UserList.insert(self, i) self.unique = False def count(self, item): self.__make_unique() return UserList.count(self, item) def index(self, item): self.__make_unique() return UserList.index(self, item) def reverse(self): self.__make_unique() UserList.reverse(self) def sort(self, *args, **kwds): self.__make_unique() return UserList.sort(self, *args, **kwds) def extend(self, other): UserList.extend(self, other) self.unique = False class Unbuffered(object): """ A proxy class that wraps a file object, flushing after every write, and delegating everything else to the wrapped object. """ def __init__(self, file): self.file = file self.softspace = 0 ## backward compatibility; not supported in Py3k def write(self, arg): try: self.file.write(arg) self.file.flush() except IOError: # Stdout might be connected to a pipe that has been closed # by now. The most likely reason for the pipe being closed # is that the user has press ctrl-c. It this is the case, # then SCons is currently shutdown. We therefore ignore # IOError's here so that SCons can continue and shutdown # properly so that the .sconsign is correctly written # before SCons exits. pass def __getattr__(self, attr): return getattr(self.file, attr) def make_path_relative(path): """ makes an absolute path name to a relative pathname. """ if os.path.isabs(path): drive_s,path = os.path.splitdrive(path) import re if not drive_s: path=re.compile("/*(.*)").findall(path)[0] else: path=path[1:] assert( not os.path.isabs( path ) ), path return path # The original idea for AddMethod() and RenameFunction() come from the # following post to the ActiveState Python Cookbook: # # ASPN: Python Cookbook : Install bound methods in an instance # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223613 # # That code was a little fragile, though, so the following changes # have been wrung on it: # # * Switched the installmethod() "object" and "function" arguments, # so the order reflects that the left-hand side is the thing being # "assigned to" and the right-hand side is the value being assigned. # # * Changed explicit type-checking to the "try: klass = object.__class__" # block in installmethod() below so that it still works with the # old-style classes that SCons uses. # # * Replaced the by-hand creation of methods and functions with use of # the "new" module, as alluded to in Alex Martelli's response to the # following Cookbook post: # # ASPN: Python Cookbook : Dynamically added methods to a class # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732 def AddMethod(obj, function, name=None): """ Adds either a bound method to an instance or the function itself (or an unbound method in Python 2) to a class. If name is ommited the name of the specified function is used by default. Example:: a = A() def f(self, x, y): self.z = x + y AddMethod(f, A, "add") a.add(2, 4) print(a.z) AddMethod(lambda self, i: self.l[i], a, "listIndex") print(a.listIndex(5)) """ if name is None: name = function.__name__ else: function = RenameFunction(function, name) # Note the Python version checks - WLB # Python 3.3 dropped the 3rd parameter from types.MethodType if hasattr(obj, '__class__') and obj.__class__ is not type: # "obj" is an instance, so it gets a bound method. if sys.version_info[:2] > (3, 2): method = MethodType(function, obj) else: method = MethodType(function, obj, obj.__class__) else: # Handle classes method = function setattr(obj, name, method) def RenameFunction(function, name): """ Returns a function identical to the specified function, but with the specified name. """ return FunctionType(function.__code__, function.__globals__, name, function.__defaults__) md5 = False def MD5signature(s): return str(s) def MD5filesignature(fname, chunksize=65536): with open(fname, "rb") as f: result = f.read() return result try: import hashlib except ImportError: pass else: if hasattr(hashlib, 'md5'): md5 = True def MD5signature(s): m = hashlib.md5() try: m.update(to_bytes(s)) except TypeError as e: m.update(to_bytes(str(s))) return m.hexdigest() def MD5filesignature(fname, chunksize=65536): m = hashlib.md5() f = open(fname, "rb") while True: blck = f.read(chunksize) if not blck: break m.update(to_bytes(blck)) f.close() return m.hexdigest() def MD5collect(signatures): """ Collects a list of signatures into an aggregate signature. signatures - a list of signatures returns - the aggregate signature """ if len(signatures) == 1: return signatures[0] else: return MD5signature(', '.join(signatures)) def silent_intern(x): """ Perform sys.intern() on the passed argument and return the result. If the input is ineligible (e.g. a unicode string) the original argument is returned and no exception is thrown. """ try: return sys.intern(x) except TypeError: return x # From Dinu C. Gherman, # Python Cookbook, second edition, recipe 6.17, p. 277. # Also: # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/68205 # ASPN: Python Cookbook: Null Object Design Pattern #TODO??? class Null(object): class Null(object): """ Null objects always and reliably "do nothing." """ def __new__(cls, *args, **kwargs): if not '_instance' in vars(cls): cls._instance = super(Null, cls).__new__(cls, *args, **kwargs) return cls._instance def __init__(self, *args, **kwargs): pass def __call__(self, *args, **kwargs): return self def __repr__(self): return "Null(0x%08X)" % id(self) def __nonzero__(self): return False def __bool__(self): return False def __getattr__(self, name): return self def __setattr__(self, name, value): return self def __delattr__(self, name): return self class NullSeq(Null): def __len__(self): return 0 def __iter__(self): return iter(()) def __getitem__(self, i): return self def __delitem__(self, i): return self def __setitem__(self, i, v): return self del __revision__ def to_bytes (s): if isinstance (s, (bytes, bytearray)) or bytes is str: return s return bytes (s, 'utf-8') def to_str (s): if bytes is str or is_String(s): return s return str (s, 'utf-8') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/SConf.py0000664000175000017500000011551413160023041020124 0ustar bdbaddogbdbaddog"""SCons.SConf Autoconf-like configuration support. In other words, SConf allows to run tests on the build machine to detect capabilities of system and do some things based on result: generate config files, header files for C/C++, update variables in environment. Tests on the build system can detect if compiler sees header files, if libraries are installed, if some command line options are supported etc. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/SConf.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import io import os import re import sys import traceback import SCons.Action import SCons.Builder import SCons.Errors import SCons.Job import SCons.Node.FS import SCons.Taskmaster import SCons.Util import SCons.Warnings import SCons.Conftest from SCons.Debug import Trace # Turn off the Conftest error logging SCons.Conftest.LogInputFiles = 0 SCons.Conftest.LogErrorMessages = 0 # Set build_type = None build_types = ['clean', 'help'] def SetBuildType(type): global build_type build_type = type # to be set, if we are in dry-run mode dryrun = 0 AUTO=0 # use SCons dependency scanning for up-to-date checks FORCE=1 # force all tests to be rebuilt CACHE=2 # force all tests to be taken from cache (raise an error, if necessary) cache_mode = AUTO def SetCacheMode(mode): """Set the Configure cache mode. mode must be one of "auto", "force", or "cache".""" global cache_mode if mode == "auto": cache_mode = AUTO elif mode == "force": cache_mode = FORCE elif mode == "cache": cache_mode = CACHE else: raise ValueError("SCons.SConf.SetCacheMode: Unknown mode " + mode) progress_display = SCons.Util.display # will be overwritten by SCons.Script def SetProgressDisplay(display): """Set the progress display to use (called from SCons.Script)""" global progress_display progress_display = display SConfFS = None _ac_build_counter = 0 # incremented, whenever TryBuild is called _ac_config_logs = {} # all config.log files created in this build _ac_config_hs = {} # all config.h files created in this build sconf_global = None # current sconf object def _createConfigH(target, source, env): t = open(str(target[0]), "w") defname = re.sub('[^A-Za-z0-9_]', '_', str(target[0]).upper()) t.write("""#ifndef %(DEFNAME)s_SEEN #define %(DEFNAME)s_SEEN """ % {'DEFNAME' : defname}) t.write(source[0].get_contents().decode()) t.write(""" #endif /* %(DEFNAME)s_SEEN */ """ % {'DEFNAME' : defname}) t.close() def _stringConfigH(target, source, env): return "scons: Configure: creating " + str(target[0]) def NeedConfigHBuilder(): if len(_ac_config_hs) == 0: return False else: return True def CreateConfigHBuilder(env): """Called if necessary just before the building targets phase begins.""" action = SCons.Action.Action(_createConfigH, _stringConfigH) sconfigHBld = SCons.Builder.Builder(action=action) env.Append( BUILDERS={'SConfigHBuilder':sconfigHBld} ) for k in list(_ac_config_hs.keys()): env.SConfigHBuilder(k, env.Value(_ac_config_hs[k])) class SConfWarning(SCons.Warnings.Warning): pass SCons.Warnings.enableWarningClass(SConfWarning) # some error definitions class SConfError(SCons.Errors.UserError): def __init__(self,msg): SCons.Errors.UserError.__init__(self,msg) class ConfigureDryRunError(SConfError): """Raised when a file or directory needs to be updated during a Configure process, but the user requested a dry-run""" def __init__(self,target): if not isinstance(target, SCons.Node.FS.File): msg = 'Cannot create configure directory "%s" within a dry-run.' % str(target) else: msg = 'Cannot update configure test "%s" within a dry-run.' % str(target) SConfError.__init__(self,msg) class ConfigureCacheError(SConfError): """Raised when a use explicitely requested the cache feature, but the test is run the first time.""" def __init__(self,target): SConfError.__init__(self, '"%s" is not yet built and cache is forced.' % str(target)) # define actions for building text files def _createSource( target, source, env ): fd = open(str(target[0]), "w") fd.write(source[0].get_contents().decode()) fd.close() def _stringSource( target, source, env ): return (str(target[0]) + ' <-\n |' + source[0].get_contents().decode().replace( '\n', "\n |" ) ) class SConfBuildInfo(SCons.Node.FS.FileBuildInfo): """ Special build info for targets of configure tests. Additional members are result (did the builder succeed last time?) and string, which contains messages of the original build phase. """ __slots__ = ('result', 'string') def __init__(self): self.result = None # -> 0/None -> no error, != 0 error self.string = None # the stdout / stderr output when building the target def set_build_result(self, result, string): self.result = result self.string = string class Streamer(object): """ 'Sniffer' for a file-like writable object. Similar to the unix tool tee. """ def __init__(self, orig): self.orig = orig self.s = io.StringIO() def write(self, str): if self.orig: self.orig.write(str) try: self.s.write(str) except TypeError as e: # "unicode argument expected" bug in IOStream (python 2.x) self.s.write(str.decode()) def writelines(self, lines): for l in lines: self.write(l + '\n') def getvalue(self): """ Return everything written to orig since the Streamer was created. """ return self.s.getvalue() def flush(self): if self.orig: self.orig.flush() self.s.flush() class SConfBuildTask(SCons.Taskmaster.AlwaysTask): """ This is almost the same as SCons.Script.BuildTask. Handles SConfErrors correctly and knows about the current cache_mode. """ def display(self, message): if sconf_global.logstream: sconf_global.logstream.write("scons: Configure: " + message + "\n") def display_cached_string(self, bi): """ Logs the original builder messages, given the SConfBuildInfo instance bi. """ if not isinstance(bi, SConfBuildInfo): SCons.Warnings.warn(SConfWarning, "The stored build information has an unexpected class: %s" % bi.__class__) else: self.display("The original builder output was:\n" + (" |" + str(bi.string)).replace("\n", "\n |")) def failed(self): # check, if the reason was a ConfigureDryRunError or a # ConfigureCacheError and if yes, reraise the exception exc_type = self.exc_info()[0] if issubclass(exc_type, SConfError): raise elif issubclass(exc_type, SCons.Errors.BuildError): # we ignore Build Errors (occurs, when a test doesn't pass) # Clear the exception to prevent the contained traceback # to build a reference cycle. self.exc_clear() else: self.display('Caught exception while building "%s":\n' % self.targets[0]) sys.excepthook(*self.exc_info()) return SCons.Taskmaster.Task.failed(self) def collect_node_states(self): # returns (is_up_to_date, cached_error, cachable) # where is_up_to_date is 1, if the node(s) are up_to_date # cached_error is 1, if the node(s) are up_to_date, but the # build will fail # cachable is 0, if some nodes are not in our cache T = 0 changed = False cached_error = False cachable = True for t in self.targets: if T: Trace('%s' % (t)) bi = t.get_stored_info().binfo if isinstance(bi, SConfBuildInfo): if T: Trace(': SConfBuildInfo') if cache_mode == CACHE: t.set_state(SCons.Node.up_to_date) if T: Trace(': set_state(up_to-date)') else: if T: Trace(': get_state() %s' % t.get_state()) if T: Trace(': changed() %s' % t.changed()) if (t.get_state() != SCons.Node.up_to_date and t.changed()): changed = True if T: Trace(': changed %s' % changed) cached_error = cached_error or bi.result else: if T: Trace(': else') # the node hasn't been built in a SConf context or doesn't # exist cachable = False changed = ( t.get_state() != SCons.Node.up_to_date ) if T: Trace(': changed %s' % changed) if T: Trace('\n') return (not changed, cached_error, cachable) def execute(self): if not self.targets[0].has_builder(): return sconf = sconf_global is_up_to_date, cached_error, cachable = self.collect_node_states() if cache_mode == CACHE and not cachable: raise ConfigureCacheError(self.targets[0]) elif cache_mode == FORCE: is_up_to_date = 0 if cached_error and is_up_to_date: self.display("Building \"%s\" failed in a previous run and all " "its sources are up to date." % str(self.targets[0])) binfo = self.targets[0].get_stored_info().binfo self.display_cached_string(binfo) raise SCons.Errors.BuildError # will be 'caught' in self.failed elif is_up_to_date: self.display("\"%s\" is up to date." % str(self.targets[0])) binfo = self.targets[0].get_stored_info().binfo self.display_cached_string(binfo) elif dryrun: raise ConfigureDryRunError(self.targets[0]) else: # note stdout and stderr are the same here s = sys.stdout = sys.stderr = Streamer(sys.stdout) try: env = self.targets[0].get_build_env() if cache_mode == FORCE: # Set up the Decider() to force rebuilds by saying # that every source has changed. Note that we still # call the environment's underlying source decider so # that the correct .sconsign info will get calculated # and keep the build state consistent. def force_build(dependency, target, prev_ni, env_decider=env.decide_source): env_decider(dependency, target, prev_ni) return True if env.decide_source.__code__ is not force_build.__code__: env.Decider(force_build) env['PSTDOUT'] = env['PSTDERR'] = s try: sconf.cached = 0 self.targets[0].build() finally: sys.stdout = sys.stderr = env['PSTDOUT'] = \ env['PSTDERR'] = sconf.logstream except KeyboardInterrupt: raise except SystemExit: exc_value = sys.exc_info()[1] raise SCons.Errors.ExplicitExit(self.targets[0],exc_value.code) except Exception as e: for t in self.targets: binfo = SConfBuildInfo() binfo.merge(t.get_binfo()) binfo.set_build_result(1, s.getvalue()) sconsign_entry = SCons.SConsign.SConsignEntry() sconsign_entry.binfo = binfo #sconsign_entry.ninfo = self.get_ninfo() # We'd like to do this as follows: # t.store_info(binfo) # However, we need to store it as an SConfBuildInfo # object, and store_info() will turn it into a # regular FileNodeInfo if the target is itself a # regular File. sconsign = t.dir.sconsign() sconsign.set_entry(t.name, sconsign_entry) sconsign.merge() raise e else: for t in self.targets: binfo = SConfBuildInfo() binfo.merge(t.get_binfo()) binfo.set_build_result(0, s.getvalue()) sconsign_entry = SCons.SConsign.SConsignEntry() sconsign_entry.binfo = binfo #sconsign_entry.ninfo = self.get_ninfo() # We'd like to do this as follows: # t.store_info(binfo) # However, we need to store it as an SConfBuildInfo # object, and store_info() will turn it into a # regular FileNodeInfo if the target is itself a # regular File. sconsign = t.dir.sconsign() sconsign.set_entry(t.name, sconsign_entry) sconsign.merge() class SConfBase(object): """This is simply a class to represent a configure context. After creating a SConf object, you can call any tests. After finished with your tests, be sure to call the Finish() method, which returns the modified environment. Some words about caching: In most cases, it is not necessary to cache Test results explicitly. Instead, we use the scons dependency checking mechanism. For example, if one wants to compile a test program (SConf.TryLink), the compiler is only called, if the program dependencies have changed. However, if the program could not be compiled in a former SConf run, we need to explicitly cache this error. """ def __init__(self, env, custom_tests = {}, conf_dir='$CONFIGUREDIR', log_file='$CONFIGURELOG', config_h = None, _depth = 0): """Constructor. Pass additional tests in the custom_tests-dictionary, e.g. custom_tests={'CheckPrivate':MyPrivateTest}, where MyPrivateTest defines a custom test. Note also the conf_dir and log_file arguments (you may want to build tests in the VariantDir, not in the SourceDir) """ global SConfFS if not SConfFS: SConfFS = SCons.Node.FS.default_fs or \ SCons.Node.FS.FS(env.fs.pathTop) if sconf_global is not None: raise SCons.Errors.UserError self.env = env if log_file is not None: log_file = SConfFS.File(env.subst(log_file)) self.logfile = log_file self.logstream = None self.lastTarget = None self.depth = _depth self.cached = 0 # will be set, if all test results are cached # add default tests default_tests = { 'CheckCC' : CheckCC, 'CheckCXX' : CheckCXX, 'CheckSHCC' : CheckSHCC, 'CheckSHCXX' : CheckSHCXX, 'CheckFunc' : CheckFunc, 'CheckType' : CheckType, 'CheckTypeSize' : CheckTypeSize, 'CheckDeclaration' : CheckDeclaration, 'CheckHeader' : CheckHeader, 'CheckCHeader' : CheckCHeader, 'CheckCXXHeader' : CheckCXXHeader, 'CheckLib' : CheckLib, 'CheckLibWithHeader' : CheckLibWithHeader, 'CheckProg' : CheckProg, } self.AddTests(default_tests) self.AddTests(custom_tests) self.confdir = SConfFS.Dir(env.subst(conf_dir)) if config_h is not None: config_h = SConfFS.File(config_h) self.config_h = config_h self._startup() def Finish(self): """Call this method after finished with your tests: env = sconf.Finish() """ self._shutdown() return self.env def Define(self, name, value = None, comment = None): """ Define a pre processor symbol name, with the optional given value in the current config header. If value is None (default), then #define name is written. If value is not none, then #define name value is written. comment is a string which will be put as a C comment in the header, to explain the meaning of the value (appropriate C comments will be added automatically). """ lines = [] if comment: comment_str = "/* %s */" % comment lines.append(comment_str) if value is not None: define_str = "#define %s %s" % (name, value) else: define_str = "#define %s" % name lines.append(define_str) lines.append('') self.config_h_text = self.config_h_text + '\n'.join(lines) def BuildNodes(self, nodes): """ Tries to build the given nodes immediately. Returns 1 on success, 0 on error. """ if self.logstream is not None: # override stdout / stderr to write in log file oldStdout = sys.stdout sys.stdout = self.logstream oldStderr = sys.stderr sys.stderr = self.logstream # the engine assumes the current path is the SConstruct directory ... old_fs_dir = SConfFS.getcwd() old_os_dir = os.getcwd() SConfFS.chdir(SConfFS.Top, change_os_dir=1) # Because we take responsibility here for writing out our # own .sconsign info (see SConfBuildTask.execute(), above), # we override the store_info() method with a null place-holder # so we really control how it gets written. for n in nodes: n.store_info = 0 if not hasattr(n, 'attributes'): n.attributes = SCons.Node.Node.Attrs() n.attributes.keep_targetinfo = 1 ret = 1 try: # ToDo: use user options for calc save_max_drift = SConfFS.get_max_drift() SConfFS.set_max_drift(0) tm = SCons.Taskmaster.Taskmaster(nodes, SConfBuildTask) # we don't want to build tests in parallel jobs = SCons.Job.Jobs(1, tm ) jobs.run() for n in nodes: state = n.get_state() if (state != SCons.Node.executed and state != SCons.Node.up_to_date): # the node could not be built. we return 0 in this case ret = 0 finally: SConfFS.set_max_drift(save_max_drift) os.chdir(old_os_dir) SConfFS.chdir(old_fs_dir, change_os_dir=0) if self.logstream is not None: # restore stdout / stderr sys.stdout = oldStdout sys.stderr = oldStderr return ret def pspawn_wrapper(self, sh, escape, cmd, args, env): """Wrapper function for handling piped spawns. This looks to the calling interface (in Action.py) like a "normal" spawn, but associates the call with the PSPAWN variable from the construction environment and with the streams to which we want the output logged. This gets slid into the construction environment as the SPAWN variable so Action.py doesn't have to know or care whether it's spawning a piped command or not. """ return self.pspawn(sh, escape, cmd, args, env, self.logstream, self.logstream) def TryBuild(self, builder, text = None, extension = ""): """Low level TryBuild implementation. Normally you don't need to call that - you can use TryCompile / TryLink / TryRun instead """ global _ac_build_counter # Make sure we have a PSPAWN value, and save the current # SPAWN value. try: self.pspawn = self.env['PSPAWN'] except KeyError: raise SCons.Errors.UserError('Missing PSPAWN construction variable.') try: save_spawn = self.env['SPAWN'] except KeyError: raise SCons.Errors.UserError('Missing SPAWN construction variable.') nodesToBeBuilt = [] f = "conftest_" + str(_ac_build_counter) pref = self.env.subst( builder.builder.prefix ) suff = self.env.subst( builder.builder.suffix ) target = self.confdir.File(pref + f + suff) try: # Slide our wrapper into the construction environment as # the SPAWN function. self.env['SPAWN'] = self.pspawn_wrapper sourcetext = self.env.Value(text) if text is not None: textFile = self.confdir.File(f + extension) textFileNode = self.env.SConfSourceBuilder(target=textFile, source=sourcetext) nodesToBeBuilt.extend(textFileNode) source = textFileNode else: source = None nodes = builder(target = target, source = source) if not SCons.Util.is_List(nodes): nodes = [nodes] nodesToBeBuilt.extend(nodes) result = self.BuildNodes(nodesToBeBuilt) finally: self.env['SPAWN'] = save_spawn _ac_build_counter = _ac_build_counter + 1 if result: self.lastTarget = nodes[0] else: self.lastTarget = None return result def TryAction(self, action, text = None, extension = ""): """Tries to execute the given action with optional source file contents and optional source file extension , Returns the status (0 : failed, 1 : ok) and the contents of the output file. """ builder = SCons.Builder.Builder(action=action) self.env.Append( BUILDERS = {'SConfActionBuilder' : builder} ) ok = self.TryBuild(self.env.SConfActionBuilder, text, extension) del self.env['BUILDERS']['SConfActionBuilder'] if ok: outputStr = self.lastTarget.get_contents().decode() return (1, outputStr) return (0, "") def TryCompile( self, text, extension): """Compiles the program given in text to an env.Object, using extension as file extension (e.g. '.c'). Returns 1, if compilation was successful, 0 otherwise. The target is saved in self.lastTarget (for further processing). """ return self.TryBuild(self.env.Object, text, extension) def TryLink( self, text, extension ): """Compiles the program given in text to an executable env.Program, using extension as file extension (e.g. '.c'). Returns 1, if compilation was successful, 0 otherwise. The target is saved in self.lastTarget (for further processing). """ return self.TryBuild(self.env.Program, text, extension ) def TryRun(self, text, extension ): """Compiles and runs the program given in text, using extension as file extension (e.g. '.c'). Returns (1, outputStr) on success, (0, '') otherwise. The target (a file containing the program's stdout) is saved in self.lastTarget (for further processing). """ ok = self.TryLink(text, extension) if( ok ): prog = self.lastTarget pname = prog.get_internal_path() output = self.confdir.File(os.path.basename(pname)+'.out') node = self.env.Command(output, prog, [ [ pname, ">", "${TARGET}"] ]) ok = self.BuildNodes(node) if ok: outputStr = SCons.Util.to_str(output.get_contents()) return( 1, outputStr) return (0, "") class TestWrapper(object): """A wrapper around Tests (to ensure sanity)""" def __init__(self, test, sconf): self.test = test self.sconf = sconf def __call__(self, *args, **kw): if not self.sconf.active: raise SCons.Errors.UserError context = CheckContext(self.sconf) ret = self.test(context, *args, **kw) if self.sconf.config_h is not None: self.sconf.config_h_text = self.sconf.config_h_text + context.config_h context.Result("error: no result") return ret def AddTest(self, test_name, test_instance): """Adds test_class to this SConf instance. It can be called with self.test_name(...)""" setattr(self, test_name, SConfBase.TestWrapper(test_instance, self)) def AddTests(self, tests): """Adds all the tests given in the tests dictionary to this SConf instance """ for name in list(tests.keys()): self.AddTest(name, tests[name]) def _createDir( self, node ): dirName = str(node) if dryrun: if not os.path.isdir( dirName ): raise ConfigureDryRunError(dirName) else: if not os.path.isdir( dirName ): os.makedirs( dirName ) def _startup(self): """Private method. Set up logstream, and set the environment variables necessary for a piped build """ global _ac_config_logs global sconf_global global SConfFS self.lastEnvFs = self.env.fs self.env.fs = SConfFS self._createDir(self.confdir) self.confdir.up().add_ignore( [self.confdir] ) if self.logfile is not None and not dryrun: # truncate logfile, if SConf.Configure is called for the first time # in a build if self.logfile in _ac_config_logs: log_mode = "a" else: _ac_config_logs[self.logfile] = None log_mode = "w" fp = open(str(self.logfile), log_mode) self.logstream = SCons.Util.Unbuffered(fp) # logfile may stay in a build directory, so we tell # the build system not to override it with a eventually # existing file with the same name in the source directory self.logfile.dir.add_ignore( [self.logfile] ) tb = traceback.extract_stack()[-3-self.depth] old_fs_dir = SConfFS.getcwd() SConfFS.chdir(SConfFS.Top, change_os_dir=0) self.logstream.write('file %s,line %d:\n\tConfigure(confdir = %s)\n' % (tb[0], tb[1], str(self.confdir)) ) SConfFS.chdir(old_fs_dir) else: self.logstream = None # we use a special builder to create source files from TEXT action = SCons.Action.Action(_createSource, _stringSource) sconfSrcBld = SCons.Builder.Builder(action=action) self.env.Append( BUILDERS={'SConfSourceBuilder':sconfSrcBld} ) self.config_h_text = _ac_config_hs.get(self.config_h, "") self.active = 1 # only one SConf instance should be active at a time ... sconf_global = self def _shutdown(self): """Private method. Reset to non-piped spawn""" global sconf_global, _ac_config_hs if not self.active: raise SCons.Errors.UserError("Finish may be called only once!") if self.logstream is not None and not dryrun: self.logstream.write("\n") self.logstream.close() self.logstream = None # remove the SConfSourceBuilder from the environment blds = self.env['BUILDERS'] del blds['SConfSourceBuilder'] self.env.Replace( BUILDERS=blds ) self.active = 0 sconf_global = None if not self.config_h is None: _ac_config_hs[self.config_h] = self.config_h_text self.env.fs = self.lastEnvFs class CheckContext(object): """Provides a context for configure tests. Defines how a test writes to the screen and log file. A typical test is just a callable with an instance of CheckContext as first argument: def CheckCustom(context, ...): context.Message('Checking my weird test ... ') ret = myWeirdTestFunction(...) context.Result(ret) Often, myWeirdTestFunction will be one of context.TryCompile/context.TryLink/context.TryRun. The results of those are cached, for they are only rebuild, if the dependencies have changed. """ def __init__(self, sconf): """Constructor. Pass the corresponding SConf instance.""" self.sconf = sconf self.did_show_result = 0 # for Conftest.py: self.vardict = {} self.havedict = {} self.headerfilename = None self.config_h = "" # config_h text will be stored here # we don't regenerate the config.h file after each test. That means, # that tests won't be able to include the config.h file, and so # they can't do an #ifdef HAVE_XXX_H. This shouldn't be a major # issue, though. If it turns out, that we need to include config.h # in tests, we must ensure, that the dependencies are worked out # correctly. Note that we can't use Conftest.py's support for config.h, # cause we will need to specify a builder for the config.h file ... def Message(self, text): """Inform about what we are doing right now, e.g. 'Checking for SOMETHING ... ' """ self.Display(text) self.sconf.cached = 1 self.did_show_result = 0 def Result(self, res): """Inform about the result of the test. If res is not a string, displays 'yes' or 'no' depending on whether res is evaluated as true or false. The result is only displayed when self.did_show_result is not set. """ if isinstance(res, str): text = res elif res: text = "yes" else: text = "no" if self.did_show_result == 0: # Didn't show result yet, do it now. self.Display(text + "\n") self.did_show_result = 1 def TryBuild(self, *args, **kw): return self.sconf.TryBuild(*args, **kw) def TryAction(self, *args, **kw): return self.sconf.TryAction(*args, **kw) def TryCompile(self, *args, **kw): return self.sconf.TryCompile(*args, **kw) def TryLink(self, *args, **kw): return self.sconf.TryLink(*args, **kw) def TryRun(self, *args, **kw): return self.sconf.TryRun(*args, **kw) def __getattr__( self, attr ): if( attr == 'env' ): return self.sconf.env elif( attr == 'lastTarget' ): return self.sconf.lastTarget else: raise AttributeError("CheckContext instance has no attribute '%s'" % attr) #### Stuff used by Conftest.py (look there for explanations). def BuildProg(self, text, ext): self.sconf.cached = 1 # TODO: should use self.vardict for $CC, $CPPFLAGS, etc. return not self.TryBuild(self.env.Program, text, ext) def CompileProg(self, text, ext): self.sconf.cached = 1 # TODO: should use self.vardict for $CC, $CPPFLAGS, etc. return not self.TryBuild(self.env.Object, text, ext) def CompileSharedObject(self, text, ext): self.sconf.cached = 1 # TODO: should use self.vardict for $SHCC, $CPPFLAGS, etc. return not self.TryBuild(self.env.SharedObject, text, ext) def RunProg(self, text, ext): self.sconf.cached = 1 # TODO: should use self.vardict for $CC, $CPPFLAGS, etc. st, out = self.TryRun(text, ext) return not st, out def AppendLIBS(self, lib_name_list): oldLIBS = self.env.get( 'LIBS', [] ) self.env.Append(LIBS = lib_name_list) return oldLIBS def PrependLIBS(self, lib_name_list): oldLIBS = self.env.get( 'LIBS', [] ) self.env.Prepend(LIBS = lib_name_list) return oldLIBS def SetLIBS(self, val): oldLIBS = self.env.get( 'LIBS', [] ) self.env.Replace(LIBS = val) return oldLIBS def Display(self, msg): if self.sconf.cached: # We assume that Display is called twice for each test here # once for the Checking for ... message and once for the result. # The self.sconf.cached flag can only be set between those calls msg = "(cached) " + msg self.sconf.cached = 0 progress_display(msg, append_newline=0) self.Log("scons: Configure: " + msg + "\n") def Log(self, msg): if self.sconf.logstream is not None: self.sconf.logstream.write(msg) #### End of stuff used by Conftest.py. def SConf(*args, **kw): if kw.get(build_type, True): kw['_depth'] = kw.get('_depth', 0) + 1 for bt in build_types: try: del kw[bt] except KeyError: pass return SConfBase(*args, **kw) else: return SCons.Util.Null() def CheckFunc(context, function_name, header = None, language = None): res = SCons.Conftest.CheckFunc(context, function_name, header = header, language = language) context.did_show_result = 1 return not res def CheckType(context, type_name, includes = "", language = None): res = SCons.Conftest.CheckType(context, type_name, header = includes, language = language) context.did_show_result = 1 return not res def CheckTypeSize(context, type_name, includes = "", language = None, expect = None): res = SCons.Conftest.CheckTypeSize(context, type_name, header = includes, language = language, expect = expect) context.did_show_result = 1 return res def CheckDeclaration(context, declaration, includes = "", language = None): res = SCons.Conftest.CheckDeclaration(context, declaration, includes = includes, language = language) context.did_show_result = 1 return not res def createIncludesFromHeaders(headers, leaveLast, include_quotes = '""'): # used by CheckHeader and CheckLibWithHeader to produce C - #include # statements from the specified header (list) if not SCons.Util.is_List(headers): headers = [headers] l = [] if leaveLast: lastHeader = headers[-1] headers = headers[:-1] else: lastHeader = None for s in headers: l.append("#include %s%s%s\n" % (include_quotes[0], s, include_quotes[1])) return ''.join(l), lastHeader def CheckHeader(context, header, include_quotes = '<>', language = None): """ A test for a C or C++ header file. """ prog_prefix, hdr_to_check = \ createIncludesFromHeaders(header, 1, include_quotes) res = SCons.Conftest.CheckHeader(context, hdr_to_check, prog_prefix, language = language, include_quotes = include_quotes) context.did_show_result = 1 return not res def CheckCC(context): res = SCons.Conftest.CheckCC(context) context.did_show_result = 1 return not res def CheckCXX(context): res = SCons.Conftest.CheckCXX(context) context.did_show_result = 1 return not res def CheckSHCC(context): res = SCons.Conftest.CheckSHCC(context) context.did_show_result = 1 return not res def CheckSHCXX(context): res = SCons.Conftest.CheckSHCXX(context) context.did_show_result = 1 return not res # Bram: Make this function obsolete? CheckHeader() is more generic. def CheckCHeader(context, header, include_quotes = '""'): """ A test for a C header file. """ return CheckHeader(context, header, include_quotes, language = "C") # Bram: Make this function obsolete? CheckHeader() is more generic. def CheckCXXHeader(context, header, include_quotes = '""'): """ A test for a C++ header file. """ return CheckHeader(context, header, include_quotes, language = "C++") def CheckLib(context, library = None, symbol = "main", header = None, language = None, autoadd = 1): """ A test for a library. See also CheckLibWithHeader. Note that library may also be None to test whether the given symbol compiles without flags. """ if library == []: library = [None] if not SCons.Util.is_List(library): library = [library] # ToDo: accept path for the library res = SCons.Conftest.CheckLib(context, library, symbol, header = header, language = language, autoadd = autoadd) context.did_show_result = 1 return not res # XXX # Bram: Can only include one header and can't use #ifdef HAVE_HEADER_H. def CheckLibWithHeader(context, libs, header, language, call = None, autoadd = 1): # ToDo: accept path for library. Support system header files. """ Another (more sophisticated) test for a library. Checks, if library and header is available for language (may be 'C' or 'CXX'). Call maybe be a valid expression _with_ a trailing ';'. As in CheckLib, we support library=None, to test if the call compiles without extra link flags. """ prog_prefix, dummy = \ createIncludesFromHeaders(header, 0) if libs == []: libs = [None] if not SCons.Util.is_List(libs): libs = [libs] res = SCons.Conftest.CheckLib(context, libs, None, prog_prefix, call = call, language = language, autoadd = autoadd) context.did_show_result = 1 return not res def CheckProg(context, prog_name): """Simple check if a program exists in the path. Returns the path for the application, or None if not found. """ res = SCons.Conftest.CheckProg(context, prog_name) context.did_show_result = 1 return res # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/SConfTests.py0000664000175000017500000007630013160023041021146 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/SConfTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import io import os import re import sys from types import * import unittest import TestCmd import TestUnit sys.stdout = io.StringIO() if sys.platform == 'win32': existing_lib = "msvcrt" else: existing_lib = "m" class SConfTestCase(unittest.TestCase): def setUp(self): # we always want to start with a clean directory self.save_cwd = os.getcwd() self.test = TestCmd.TestCmd(workdir = '') os.chdir(self.test.workpath('')) def tearDown(self): self.test.cleanup() import SCons.SConsign SCons.SConsign.Reset() os.chdir(self.save_cwd) def _resetSConfState(self): # Ok, this is tricky, and i do not know, if everything is sane. # We try to reset scons' state (including all global variables) import SCons.SConsign SCons.SConsign.write() # simulate normal scons-finish for n in list(sys.modules.keys()): if n.split('.')[0] == 'SCons' and n[:12] != 'SCons.compat': m = sys.modules[n] if isinstance(m, ModuleType): # if this is really a scons module, clear its namespace del sys.modules[n] m.__dict__.clear() # we only use SCons.Environment and SCons.SConf for these tests. import SCons.Environment import SCons.SConf self.Environment = SCons.Environment self.SConf = SCons.SConf # and we need a new environment, cause references may point to # old modules (well, at least this is safe ...) self.scons_env = self.Environment.Environment() self.scons_env.AppendENVPath('PATH', os.environ['PATH']) # we want to do some autodetection here # this stuff works with # - cygwin on Windows (using cmd.exe, not bash) # - posix # - msvc on Windows (hopefully) if (not self.scons_env.Detect( self.scons_env.subst('$CXX') ) or not self.scons_env.Detect( self.scons_env.subst('$CC') ) or not self.scons_env.Detect( self.scons_env.subst('$LINK') )): raise Exception("This test needs an installed compiler!") if self.scons_env['CXX'] == 'g++': global existing_lib existing_lib = 'm' if sys.platform in ['cygwin', 'win32']: # On Windows, SCons.Platform.win32 redefines the builtin # file() and open() functions to close the file handles. # This interferes with the unittest.py infrastructure in # some way. Just sidestep the issue by restoring the # original builtin functions whenever we have to reset # all of our global state. import SCons.Platform.win32 try: file = SCons.Platform.win32._builtin_file open = SCons.Platform.win32._builtin_open except AttributeError: pass def _baseTryXXX(self, TryFunc): # TryCompile and TryLink are much the same, so we can test them # in one method, we pass the function as a string ('TryCompile', # 'TryLink'), so we are aware of reloading modules. def checks(self, sconf, TryFuncString): TryFunc = self.SConf.SConfBase.__dict__[TryFuncString] res1 = TryFunc( sconf, "int main() { return 0; }\n", ".c" ) res2 = TryFunc( sconf, '#include "no_std_header.h"\nint main() {return 0; }\n', '.c' ) return (res1,res2) # 1. test initial behaviour (check ok / failed) self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: res = checks( self, sconf, TryFunc ) assert res[0] and not res[1], res finally: sconf.Finish() # 2.1 test the error caching mechanism (no dependencies have changed) self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: res = checks( self, sconf, TryFunc ) assert res[0] and not res[1], res finally: sconf.Finish() # we should have exactly one one error cached log = str(self.test.read( self.test.workpath('config.log') )) expr = re.compile( ".*failed in a previous run and all", re.DOTALL ) firstOcc = expr.match( log ) assert firstOcc is not None, log secondOcc = expr.match( log, firstOcc.end(0) ) assert secondOcc is None, log # 2.2 test the error caching mechanism (dependencies have changed) self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) no_std_header_h = self.test.workpath('config.tests', 'no_std_header.h') test_h = self.test.write( no_std_header_h, "/* we are changing a dependency now */\n" ); try: res = checks( self, sconf, TryFunc ) log = self.test.read( self.test.workpath('config.log') ) assert res[0] and res[1], res finally: sconf.Finish() def test_TryBuild(self): """Test SConf.TryBuild """ # 1 test that we can try a builder that returns a list of nodes self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) import SCons.Builder import SCons.Node class MyBuilder(SCons.Builder.BuilderBase): def __init__(self): self.prefix = '' self.suffix = '' def __call__(self, env, target, source): class MyNode(object): def __init__(self, name): self.name = name self.state = SCons.Node.no_state self.waiting_parents = set() self.side_effects = [] self.builder = None self.prerequisites = None def disambiguate(self): return self def has_builder(self): return 1 def add_pre_action(self, *actions): pass def add_post_action(self, *actions): pass def children(self): return [] def get_state(self): return self.state def set_state(self, state): self.state = state def alter_targets(self): return [], None def depends_on(self, nodes): return None def postprocess(self): pass def clear(self): pass def is_up_to_date(self): return None def prepare(self): pass def push_to_cache(self): pass def retrieve_from_cache(self): return 0 def build(self, **kw): return def built(self): pass def get_stored_info(self): pass def get_executor(self): class Executor(object): def __init__(self, targets): self.targets = targets def get_all_targets(self): return self.targets return Executor([self]) return [MyNode('n1'), MyNode('n2')] try: self.scons_env.Append(BUILDERS = {'SConfActionBuilder' : MyBuilder()}) sconf.TryBuild(self.scons_env.SConfActionBuilder) finally: sconf.Finish() def test_TryCompile(self): """Test SConf.TryCompile """ self._baseTryXXX( "TryCompile" ) #self.SConf.SConf.TryCompile ) def test_TryLink(self): """Test SConf.TryLink """ self._baseTryXXX( "TryLink" ) #self.SConf.SConf.TryLink ) def test_TryRun(self): """Test SConf.TryRun """ def checks(sconf): prog = """ #include int main() { printf( "Hello" ); return 0; } """ res1 = sconf.TryRun( prog, ".c" ) res2 = sconf.TryRun( "not a c program\n", ".c" ) return (res1, res2) self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: res = checks(sconf) assert res[0][0] and res[0][1] == "Hello", res assert not res[1][0] and res[1][1] == "", res finally: sconf.Finish() log = self.test.read( self.test.workpath('config.log') ) # test the caching mechanism self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: res = checks(sconf) assert res[0][0] and res[0][1] == "Hello", res assert not res[1][0] and res[1][1] == "", res finally: sconf.Finish() # we should have exactly one error cached # creating string here because it's bytes by default on py3 log = str(self.test.read( self.test.workpath('config.log') )) expr = re.compile( ".*failed in a previous run and all", re.DOTALL ) firstOcc = expr.match( log ) assert firstOcc is not None, log secondOcc = expr.match( log, firstOcc.end(0) ) assert secondOcc is None, log def test_TryAction(self): """Test SConf.TryAction """ def actionOK(target, source, env): open(str(target[0]), "w").write( "RUN OK\n" ) return None def actionFAIL(target, source, env): return 1 self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: (ret, output) = sconf.TryAction(action=actionOK) assert ret and output.encode('utf-8') == bytearray("RUN OK"+os.linesep,'utf-8'), (ret, output) (ret, output) = sconf.TryAction(action=actionFAIL) assert not ret and output == "", (ret, output) finally: sconf.Finish() def _test_check_compilers(self, comp, func, name): """This is the implementation for CheckCC and CheckCXX tests.""" from copy import deepcopy # Check that Check* works r = func() assert r, "could not find %s ?" % comp # Check that Check* does fail if comp is not available in env oldcomp = deepcopy(self.scons_env[comp]) del self.scons_env[comp] r = func() assert not r, "%s worked wo comp ?" % name # Check that Check* does fail if comp is set but empty self.scons_env[comp] = '' r = func() assert not r, "%s worked with comp = '' ?" % name # Check that Check* does fail if comp is set to buggy executable self.scons_env[comp] = 'thiscccompilerdoesnotexist' r = func() assert not r, "%s worked with comp = thiscompilerdoesnotexist ?" % name # Check that Check* does fail if CFLAGS is buggy self.scons_env[comp] = oldcomp self.scons_env['%sFLAGS' % comp] = '/WX qwertyuiop.c' r = func() assert not r, "%s worked with %sFLAGS = qwertyuiop ?" % (name, comp) def test_CheckCC(self): """Test SConf.CheckCC() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: try: self._test_check_compilers('CC', sconf.CheckCC, 'CheckCC') except AssertionError: sys.stderr.write(self.test.read('config.log', mode='r')) raise finally: sconf.Finish() def test_CheckSHCC(self): """Test SConf.CheckSHCC() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: try: self._test_check_compilers('SHCC', sconf.CheckSHCC, 'CheckSHCC') except AssertionError: sys.stderr.write(self.test.read('config.log', mode='r')) raise finally: sconf.Finish() def test_CheckCXX(self): """Test SConf.CheckCXX() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: try: self._test_check_compilers('CXX', sconf.CheckCXX, 'CheckCXX') except AssertionError: sys.stderr.write(self.test.read('config.log', mode='r')) raise finally: sconf.Finish() def test_CheckSHCXX(self): """Test SConf.CheckSHCXX() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: try: self._test_check_compilers('SHCXX', sconf.CheckSHCXX, 'CheckSHCXX') except AssertionError: sys.stderr.write(self.test.read('config.log', mode='r')) raise finally: sconf.Finish() def test_CheckHeader(self): """Test SConf.CheckHeader() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: # CheckHeader() r = sconf.CheckHeader( "stdio.h", include_quotes="<>", language="C" ) assert r, "did not find stdio.h" r = sconf.CheckHeader( "HopefullyNoHeader.noh", language="C" ) assert not r, "unexpectedly found HopefullyNoHeader.noh" r = sconf.CheckHeader( "vector", include_quotes="<>", language="C++" ) assert r, "did not find vector" r = sconf.CheckHeader( "HopefullyNoHeader.noh", language="C++" ) assert not r, "unexpectedly found HopefullyNoHeader.noh" finally: sconf.Finish() def test_CheckCHeader(self): """Test SConf.CheckCHeader() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: # CheckCHeader() r = sconf.CheckCHeader( "stdio.h", include_quotes="<>" ) assert r, "did not find stdio.h" r = sconf.CheckCHeader( ["math.h", "stdio.h"], include_quotes="<>" ) assert r, "did not find stdio.h, #include math.h first" r = sconf.CheckCHeader( "HopefullyNoCHeader.noh" ) assert not r, "unexpectedly found HopefullyNoCHeader.noh" finally: sconf.Finish() def test_CheckCXXHeader(self): """Test SConf.CheckCXXHeader() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: # CheckCXXHeader() r = sconf.CheckCXXHeader( "vector", include_quotes="<>" ) assert r, "did not find vector" r = sconf.CheckCXXHeader( ["stdio.h", "vector"], include_quotes="<>" ) assert r, "did not find vector, #include stdio.h first" r = sconf.CheckCXXHeader( "HopefullyNoCXXHeader.noh" ) assert not r, "unexpectedly found HopefullyNoCXXHeader.noh" finally: sconf.Finish() def test_CheckLib(self): """Test SConf.CheckLib() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: # CheckLib() r = sconf.CheckLib( existing_lib, "main", autoadd=0 ) assert r, "did not find %s" % existing_lib r = sconf.CheckLib( "hopefullynolib", "main", autoadd=0 ) assert not r, "unexpectedly found hopefullynolib" # CheckLib() with list of libs r = sconf.CheckLib( [existing_lib], "main", autoadd=0 ) assert r, "did not find %s" % existing_lib r = sconf.CheckLib( ["hopefullynolib"], "main", autoadd=0 ) assert not r, "unexpectedly found hopefullynolib" # This is a check that a null list doesn't find functions # that are in libraries that must be explicitly named. # This works on POSIX systems where you have to -lm to # get the math functions, but it fails on Visual Studio # where you apparently get all those functions for free. # Comment out this check until someone who understands # Visual Studio better can come up with a corresponding # test (if that ever really becomes necessary). #r = sconf.CheckLib( [], "sin", autoadd=0 ) #assert not r, "unexpectedly found nonexistent library" r = sconf.CheckLib( [existing_lib,"hopefullynolib"], "main", autoadd=0 ) assert r, "did not find %s,%s " % (existing_lib,r) r = sconf.CheckLib( ["hopefullynolib",existing_lib], "main", autoadd=0 ) assert r, "did not find %s " % existing_lib # CheckLib() with autoadd def libs(env): return env.get('LIBS', []) env = sconf.env.Clone() try: r = sconf.CheckLib( existing_lib, "main", autoadd=1 ) assert r, "did not find main in %s" % existing_lib expect = libs(env) + [existing_lib] got = libs(sconf.env) assert got == expect, "LIBS: expected %s, got %s" % (expect, got) sconf.env = env.Clone() r = sconf.CheckLib( existing_lib, "main", autoadd=0 ) assert r, "did not find main in %s" % existing_lib expect = libs(env) got = libs(sconf.env) assert got == expect, "before and after LIBS were not the same" finally: sconf.env = env finally: sconf.Finish() def test_CheckLibWithHeader(self): """Test SConf.CheckLibWithHeader() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: # CheckLibWithHeader() r = sconf.CheckLibWithHeader( existing_lib, "math.h", "C", autoadd=0 ) assert r, "did not find %s" % existing_lib r = sconf.CheckLibWithHeader( existing_lib, ["stdio.h", "math.h"], "C", autoadd=0 ) assert r, "did not find %s, #include stdio.h first" % existing_lib r = sconf.CheckLibWithHeader( "hopefullynolib", "math.h", "C", autoadd=0 ) assert not r, "unexpectedly found hopefullynolib" # CheckLibWithHeader() with lists of libs r = sconf.CheckLibWithHeader( [existing_lib], "math.h", "C", autoadd=0 ) assert r, "did not find %s" % existing_lib r = sconf.CheckLibWithHeader( [existing_lib], ["stdio.h", "math.h"], "C", autoadd=0 ) assert r, "did not find %s, #include stdio.h first" % existing_lib # This is a check that a null list doesn't find functions # that are in libraries that must be explicitly named. # This works on POSIX systems where you have to -lm to # get the math functions, but it fails on Visual Studio # where you apparently get all those functions for free. # Comment out this check until someone who understands # Visual Studio better can come up with a corresponding # test (if that ever really becomes necessary). #r = sconf.CheckLibWithHeader( [], "math.h", "C", call="sin(3);", autoadd=0 ) #assert not r, "unexpectedly found non-existent library" r = sconf.CheckLibWithHeader( ["hopefullynolib"], "math.h", "C", autoadd=0 ) assert not r, "unexpectedly found hopefullynolib" r = sconf.CheckLibWithHeader( ["hopefullynolib",existing_lib], ["stdio.h", "math.h"], "C", autoadd=0 ) assert r, "did not find %s, #include stdio.h first" % existing_lib r = sconf.CheckLibWithHeader( [existing_lib,"hopefullynolib"], ["stdio.h", "math.h"], "C", autoadd=0 ) assert r, "did not find %s, #include stdio.h first" % existing_lib # CheckLibWithHeader with autoadd def libs(env): return env.get('LIBS', []) env = sconf.env.Clone() try: r = sconf.CheckLibWithHeader( existing_lib, "math.h", "C", autoadd=1 ) assert r, "did not find math.h with %s" % existing_lib expect = libs(env) + [existing_lib] got = libs(sconf.env) assert got == expect, "LIBS: expected %s, got %s" % (expect, got) sconf.env = env.Clone() r = sconf.CheckLibWithHeader( existing_lib, "math.h", "C", autoadd=0 ) assert r, "did not find math.h with %s" % existing_lib expect = libs(env) got = libs(sconf.env) assert got == expect, "before and after LIBS were not the same" finally: sconf.env = env finally: sconf.Finish() def test_CheckFunc(self): """Test SConf.CheckFunc() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: # CheckFunc() r = sconf.CheckFunc('strcpy') assert r, "did not find strcpy" r = sconf.CheckFunc('strcpy', '/* header */ char strcpy();') assert r, "did not find strcpy" r = sconf.CheckFunc('hopefullynofunction') assert not r, "unexpectedly found hopefullynofunction" finally: sconf.Finish() def test_CheckProg(self): """Test SConf.CheckProg() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: if os.name != 'nt': r = sconf.CheckProg('sh') assert r, "/bin/sh" else: r = sconf.CheckProg('cmd.exe') self.assertIn('cmd.exe',r) r = sconf.CheckProg('hopefully-not-a-program') assert r is None finally: sconf.Finish() def test_Define(self): """Test SConf.Define() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log'), config_h = self.test.workpath('config.h')) try: # XXX: we test the generated config.h string. This is not so good, # ideally, we would like to test if the generated file included in # a test program does what we want. # Test defining one symbol wo value sconf.config_h_text = '' sconf.Define('YOP') assert sconf.config_h_text == '#define YOP\n' # Test defining one symbol with integer value sconf.config_h_text = '' sconf.Define('YOP', 1) assert sconf.config_h_text == '#define YOP 1\n' # Test defining one symbol with string value sconf.config_h_text = '' sconf.Define('YOP', '"YIP"') assert sconf.config_h_text == '#define YOP "YIP"\n' # Test defining one symbol with string value sconf.config_h_text = '' sconf.Define('YOP', "YIP") assert sconf.config_h_text == '#define YOP YIP\n' finally: sconf.Finish() def test_CheckTypeSize(self): """Test SConf.CheckTypeSize() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: # CheckTypeSize() # In ANSI C, sizeof(char) == 1. r = sconf.CheckTypeSize('char', expect = 1) assert r == 1, "sizeof(char) != 1 ??" r = sconf.CheckTypeSize('char', expect = 0) assert r == 0, "sizeof(char) == 0 ??" r = sconf.CheckTypeSize('char', expect = 2) assert r == 0, "sizeof(char) == 2 ??" r = sconf.CheckTypeSize('char') assert r == 1, "sizeof(char) != 1 ??" r = sconf.CheckTypeSize('const unsigned char') assert r == 1, "sizeof(const unsigned char) != 1 ??" # Checking C++ r = sconf.CheckTypeSize('const unsigned char', language = 'C++') assert r == 1, "sizeof(const unsigned char) != 1 ??" # Checking Non-existing type r = sconf.CheckTypeSize('thistypedefhasnotchancetosexist_scons') assert r == 0, \ "Checking size of thistypedefhasnotchancetosexist_scons succeeded ?" finally: sconf.Finish() def test_CheckDeclaration(self): """Test SConf.CheckDeclaration() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: # In ANSI C, malloc should be available in stdlib r = sconf.CheckDeclaration('malloc', includes = "#include ") assert r, "malloc not declared ??" # For C++, __cplusplus should be declared r = sconf.CheckDeclaration('__cplusplus', language = 'C++') assert r, "__cplusplus not declared in C++ ??" r = sconf.CheckDeclaration('__cplusplus', language = 'C') assert not r, "__cplusplus declared in C ??" r = sconf.CheckDeclaration('unknown', language = 'Unknown') assert not r, "unknown language was supported ??" finally: sconf.Finish() def test_(self): """Test SConf.CheckType() """ self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: # CheckType() r = sconf.CheckType('off_t', '#include \n') assert r, "did not find off_t" r = sconf.CheckType('hopefullynotypedef_not') assert not r, "unexpectedly found hopefullynotypedef_not" finally: sconf.Finish() def test_CustomChecks(self): """Test Custom Checks """ def CheckCustom(test): test.Message( "Checking UserTest ... " ) prog = """ #include int main() { printf( "Hello" ); return 0; } """ (ret, output) = test.TryRun( prog, ".c" ) test.Result( ret ) assert ret and output == "Hello", (ret, output) return ret self._resetSConfState() sconf = self.SConf.SConf(self.scons_env, custom_tests={'CheckCustom': CheckCustom}, conf_dir=self.test.workpath('config.tests'), log_file=self.test.workpath('config.log')) try: ret = sconf.CheckCustom() assert ret, ret finally: sconf.Finish() if __name__ == "__main__": suite = unittest.makeSuite(SConfTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Memoize.py0000664000175000017500000002252113160023041020514 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/Memoize.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """Memoizer A decorator-based implementation to count hits and misses of the computed values that various methods cache in memory. Use of this modules assumes that wrapped methods be coded to cache their values in a consistent way. In particular, it requires that the class uses a dictionary named "_memo" to store the cached values. Here is an example of wrapping a method that returns a computed value, with no input parameters:: @SCons.Memoize.CountMethodCall def foo(self): try: # Memoization return self._memo['foo'] # Memoization except KeyError: # Memoization pass # Memoization result = self.compute_foo_value() self._memo['foo'] = result # Memoization return result Here is an example of wrapping a method that will return different values based on one or more input arguments:: def _bar_key(self, argument): # Memoization return argument # Memoization @SCons.Memoize.CountDictCall(_bar_key) def bar(self, argument): memo_key = argument # Memoization try: # Memoization memo_dict = self._memo['bar'] # Memoization except KeyError: # Memoization memo_dict = {} # Memoization self._memo['dict'] = memo_dict # Memoization else: # Memoization try: # Memoization return memo_dict[memo_key] # Memoization except KeyError: # Memoization pass # Memoization result = self.compute_bar_value(argument) memo_dict[memo_key] = result # Memoization return result Deciding what to cache is tricky, because different configurations can have radically different performance tradeoffs, and because the tradeoffs involved are often so non-obvious. Consequently, deciding whether or not to cache a given method will likely be more of an art than a science, but should still be based on available data from this module. Here are some VERY GENERAL guidelines about deciding whether or not to cache return values from a method that's being called a lot: -- The first question to ask is, "Can we change the calling code so this method isn't called so often?" Sometimes this can be done by changing the algorithm. Sometimes the *caller* should be memoized, not the method you're looking at. -- The memoized function should be timed with multiple configurations to make sure it doesn't inadvertently slow down some other configuration. -- When memoizing values based on a dictionary key composed of input arguments, you don't need to use all of the arguments if some of them don't affect the return values. """ # A flag controlling whether or not we actually use memoization. use_memoizer = None # Global list of counter objects CounterList = {} class Counter(object): """ Base class for counting memoization hits and misses. We expect that the initialization in a matching decorator will fill in the correct class name and method name that represents the name of the function being counted. """ def __init__(self, cls_name, method_name): """ """ self.cls_name = cls_name self.method_name = method_name self.hit = 0 self.miss = 0 def key(self): return self.cls_name+'.'+self.method_name def display(self): print(" {:7d} hits {:7d} misses {}()".format(self.hit, self.miss, self.key())) def __eq__(self, other): try: return self.key() == other.key() except AttributeError: return True class CountValue(Counter): """ A counter class for simple, atomic memoized values. A CountValue object should be instantiated in a decorator for each of the class's methods that memoizes its return value by simply storing the return value in its _memo dictionary. """ def count(self, *args, **kw): """ Counts whether the memoized value has already been set (a hit) or not (a miss). """ obj = args[0] if self.method_name in obj._memo: self.hit = self.hit + 1 else: self.miss = self.miss + 1 class CountDict(Counter): """ A counter class for memoized values stored in a dictionary, with keys based on the method's input arguments. A CountDict object is instantiated in a decorator for each of the class's methods that memoizes its return value in a dictionary, indexed by some key that can be computed from one or more of its input arguments. """ def __init__(self, cls_name, method_name, keymaker): """ """ Counter.__init__(self, cls_name, method_name) self.keymaker = keymaker def count(self, *args, **kw): """ Counts whether the computed key value is already present in the memoization dictionary (a hit) or not (a miss). """ obj = args[0] try: memo_dict = obj._memo[self.method_name] except KeyError: self.miss = self.miss + 1 else: key = self.keymaker(*args, **kw) if key in memo_dict: self.hit = self.hit + 1 else: self.miss = self.miss + 1 def Dump(title=None): """ Dump the hit/miss count for all the counters collected so far. """ if title: print(title) for counter in sorted(CounterList): CounterList[counter].display() def EnableMemoization(): global use_memoizer use_memoizer = 1 def CountMethodCall(fn): """ Decorator for counting memoizer hits/misses while retrieving a simple value in a class method. It wraps the given method fn and uses a CountValue object to keep track of the caching statistics. Wrapping gets enabled by calling EnableMemoization(). """ if use_memoizer: def wrapper(self, *args, **kwargs): global CounterList key = self.__class__.__name__+'.'+fn.__name__ if key not in CounterList: CounterList[key] = CountValue(self.__class__.__name__, fn.__name__) CounterList[key].count(self, *args, **kwargs) return fn(self, *args, **kwargs) wrapper.__name__= fn.__name__ return wrapper else: return fn def CountDictCall(keyfunc): """ Decorator for counting memoizer hits/misses while accessing dictionary values with a key-generating function. Like CountMethodCall above, it wraps the given method fn and uses a CountDict object to keep track of the caching statistics. The dict-key function keyfunc has to get passed in the decorator call and gets stored in the CountDict instance. Wrapping gets enabled by calling EnableMemoization(). """ def decorator(fn): if use_memoizer: def wrapper(self, *args, **kwargs): global CounterList key = self.__class__.__name__+'.'+fn.__name__ if key not in CounterList: CounterList[key] = CountDict(self.__class__.__name__, fn.__name__, keyfunc) CounterList[key].count(self, *args, **kwargs) return fn(self, *args, **kwargs) wrapper.__name__= fn.__name__ return wrapper else: return fn return decorator # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/dblite.py0000664000175000017500000002123213160023045020354 0ustar bdbaddogbdbaddog# dblite.py module contributed by Ralf W. Grosse-Kunstleve. # Extended for Unicode by Steven Knight. from __future__ import print_function import os import pickle import shutil import time from SCons.compat import PICKLE_PROTOCOL keep_all_files = 00000 ignore_corrupt_dbfiles = 0 def corruption_warning(filename): print("Warning: Discarding corrupt database:", filename) try: unicode except NameError: def is_string(s): return isinstance(s, str) else: def is_string(s): return type(s) in (str, unicode) def is_bytes(s): return isinstance(s, bytes) try: unicode('a') except NameError: def unicode(s): return s dblite_suffix = '.dblite' # TODO: Does commenting this out break switching from py2/3? # if bytes is not str: # dblite_suffix += '.p3' tmp_suffix = '.tmp' class dblite(object): """ Squirrel away references to the functions in various modules that we'll use when our __del__() method calls our sync() method during shutdown. We might get destroyed when Python is in the midst of tearing down the different modules we import in an essentially arbitrary order, and some of the various modules's global attributes may already be wiped out from under us. See the discussion at: http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html """ _open = open _pickle_dump = staticmethod(pickle.dump) _pickle_protocol = PICKLE_PROTOCOL _os_chmod = os.chmod try: _os_chown = os.chown except AttributeError: _os_chown = None _os_rename = os.rename _os_unlink = os.unlink _shutil_copyfile = shutil.copyfile _time_time = time.time def __init__(self, file_base_name, flag, mode): assert flag in (None, "r", "w", "c", "n") if (flag is None): flag = "r" base, ext = os.path.splitext(file_base_name) if ext == dblite_suffix: # There's already a suffix on the file name, don't add one. self._file_name = file_base_name self._tmp_name = base + tmp_suffix else: self._file_name = file_base_name + dblite_suffix self._tmp_name = file_base_name + tmp_suffix self._flag = flag self._mode = mode self._dict = {} self._needs_sync = 00000 if self._os_chown is not None and (os.geteuid() == 0 or os.getuid() == 0): # running as root; chown back to current owner/group when done try: statinfo = os.stat(self._file_name) self._chown_to = statinfo.st_uid self._chgrp_to = statinfo.st_gid except OSError as e: # db file doesn't exist yet. # Check os.environ for SUDO_UID, use if set self._chown_to = int(os.environ.get('SUDO_UID', -1)) self._chgrp_to = int(os.environ.get('SUDO_GID', -1)) else: self._chown_to = -1 # don't chown self._chgrp_to = -1 # don't chgrp if (self._flag == "n"): self._open(self._file_name, "wb", self._mode) else: try: f = self._open(self._file_name, "rb") except IOError as e: if (self._flag != "c"): raise e self._open(self._file_name, "wb", self._mode) else: p = f.read() if len(p) > 0: try: if bytes is not str: self._dict = pickle.loads(p, encoding='bytes') else: self._dict = pickle.loads(p) except (pickle.UnpicklingError, EOFError, KeyError): # Note how we catch KeyErrors too here, which might happen # when we don't have cPickle available (default pickle # throws it). if (ignore_corrupt_dbfiles == 0): raise if (ignore_corrupt_dbfiles == 1): corruption_warning(self._file_name) def close(self): if (self._needs_sync): self.sync() def __del__(self): self.close() def sync(self): self._check_writable() f = self._open(self._tmp_name, "wb", self._mode) self._pickle_dump(self._dict, f, self._pickle_protocol) f.close() # Windows doesn't allow renaming if the file exists, so unlink # it first, chmod'ing it to make sure we can do so. On UNIX, we # may not be able to chmod the file if it's owned by someone else # (e.g. from a previous run as root). We should still be able to # unlink() the file if the directory's writable, though, so ignore # any OSError exception thrown by the chmod() call. try: self._os_chmod(self._file_name, 0o777) except OSError: pass self._os_unlink(self._file_name) self._os_rename(self._tmp_name, self._file_name) if self._os_chown is not None and self._chown_to > 0: # don't chown to root or -1 try: self._os_chown(self._file_name, self._chown_to, self._chgrp_to) except OSError: pass self._needs_sync = 00000 if (keep_all_files): self._shutil_copyfile( self._file_name, self._file_name + "_" + str(int(self._time_time()))) def _check_writable(self): if (self._flag == "r"): raise IOError("Read-only database: %s" % self._file_name) def __getitem__(self, key): return self._dict[key] def __setitem__(self, key, value): self._check_writable() if (not is_string(key)): raise TypeError("key `%s' must be a string but is %s" % (key, type(key))) if (not is_bytes(value)): raise TypeError("value `%s' must be a bytes but is %s" % (value, type(value))) self._dict[key] = value self._needs_sync = 0o001 def keys(self): return list(self._dict.keys()) def has_key(self, key): return key in self._dict def __contains__(self, key): return key in self._dict def iterkeys(self): # Wrapping name in () prevents fixer from "fixing" this return (self._dict.iterkeys)() __iter__ = iterkeys def __len__(self): return len(self._dict) def open(file, flag=None, mode=0o666): return dblite(file, flag, mode) def _exercise(): db = open("tmp", "n") assert len(db) == 0 db["foo"] = "bar" assert db["foo"] == "bar" db[unicode("ufoo")] = unicode("ubar") assert db[unicode("ufoo")] == unicode("ubar") db.sync() db = open("tmp", "c") assert len(db) == 2, len(db) assert db["foo"] == "bar" db["bar"] = "foo" assert db["bar"] == "foo" db[unicode("ubar")] = unicode("ufoo") assert db[unicode("ubar")] == unicode("ufoo") db.sync() db = open("tmp", "r") assert len(db) == 4, len(db) assert db["foo"] == "bar" assert db["bar"] == "foo" assert db[unicode("ufoo")] == unicode("ubar") assert db[unicode("ubar")] == unicode("ufoo") try: db.sync() except IOError as e: assert str(e) == "Read-only database: tmp.dblite" else: raise RuntimeError("IOError expected.") db = open("tmp", "w") assert len(db) == 4 db["ping"] = "pong" db.sync() try: db[(1, 2)] = "tuple" except TypeError as e: assert str(e) == "key `(1, 2)' must be a string but is ", str(e) else: raise RuntimeError("TypeError exception expected") try: db["list"] = [1, 2] except TypeError as e: assert str(e) == "value `[1, 2]' must be a string but is ", str(e) else: raise RuntimeError("TypeError exception expected") db = open("tmp", "r") assert len(db) == 5 db = open("tmp", "n") assert len(db) == 0 dblite._open("tmp.dblite", "w") db = open("tmp", "r") dblite._open("tmp.dblite", "w").write("x") try: db = open("tmp", "r") except pickle.UnpicklingError: pass else: raise RuntimeError("pickle exception expected.") global ignore_corrupt_dbfiles ignore_corrupt_dbfiles = 2 db = open("tmp", "r") assert len(db) == 0 os.unlink("tmp.dblite") try: db = open("tmp", "w") except IOError as e: assert str(e) == "[Errno 2] No such file or directory: 'tmp.dblite'", str(e) else: raise RuntimeError("IOError expected.") if (__name__ == "__main__"): _exercise() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/SubstTests.py0000664000175000017500000012634413160023041021242 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/SubstTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import os import sys import unittest from collections import UserDict import TestUnit import SCons.Errors from SCons.Subst import * class DummyNode(object): """Simple node work-alike.""" def __init__(self, name): self.name = os.path.normpath(name) def __str__(self): return self.name def is_literal(self): return 1 def rfile(self): return self def get_subst_proxy(self): return self class DummyEnv(object): def __init__(self, dict={}): self.dict = dict def Dictionary(self, key = None): if not key: return self.dict return self.dict[key] def __getitem__(self, key): return self.dict[key] def get(self, key, default): return self.dict.get(key, default) def sig_dict(self): dict = self.dict.copy() dict["TARGETS"] = 'tsig' dict["SOURCES"] = 'ssig' return dict def cs(target=None, source=None, env=None, for_signature=None): return 'cs' def cl(target=None, source=None, env=None, for_signature=None): return ['cl'] def CmdGen1(target, source, env, for_signature): # Nifty trick...since Environment references are interpolated, # instantiate an instance of a callable class with this one, # which will then get evaluated. assert str(target) == 't', target assert str(source) == 's', source return "${CMDGEN2('foo', %d)}" % for_signature class CmdGen2(object): def __init__(self, mystr, forsig): self.mystr = mystr self.expect_for_signature = forsig def __call__(self, target, source, env, for_signature): assert str(target) == 't', target assert str(source) == 's', source assert for_signature == self.expect_for_signature, for_signature return [ self.mystr, env.Dictionary('BAR') ] if os.sep == '/': def cvt(str): return str else: def cvt(str): return str.replace('/', os.sep) class SubstTestCase(unittest.TestCase): class MyNode(DummyNode): """Simple node work-alike with some extra stuff for testing.""" def __init__(self, name): DummyNode.__init__(self, name) class Attribute(object): pass self.attribute = Attribute() self.attribute.attr1 = 'attr$1-' + os.path.basename(name) self.attribute.attr2 = 'attr$2-' + os.path.basename(name) def get_stuff(self, extra): return self.name + extra foo = 1 class TestLiteral(object): def __init__(self, literal): self.literal = literal def __str__(self): return self.literal def is_literal(self): return 1 class TestCallable(object): def __init__(self, value): self.value = value def __call__(self): pass def __str__(self): return self.value def function_foo(arg): pass target = [ MyNode("./foo/bar.exe"), MyNode("/bar/baz with spaces.obj"), MyNode("../foo/baz.obj") ] source = [ MyNode("./foo/blah with spaces.cpp"), MyNode("/bar/ack.cpp"), MyNode("../foo/ack.c") ] callable_object_1 = TestCallable('callable-1') callable_object_2 = TestCallable('callable-2') def _defines(defs): l = [] for d in defs: if SCons.Util.is_List(d) or isinstance(d, tuple): l.append(str(d[0]) + '=' + str(d[1])) else: l.append(str(d)) return l loc = { 'xxx' : None, 'NEWLINE' : 'before\nafter', 'null' : '', 'zero' : 0, 'one' : 1, 'BAZ' : 'baz', 'ONE' : '$TWO', 'TWO' : '$THREE', 'THREE' : 'four', 'AAA' : 'a', 'BBB' : 'b', 'CCC' : 'c', 'DO' : DummyNode('do something'), 'FOO' : DummyNode('foo.in'), 'BAR' : DummyNode('bar with spaces.out'), 'CRAZY' : DummyNode('crazy\nfile.in'), # $XXX$HHH should expand to GGGIII, not BADNEWS. 'XXX' : '$FFF', 'FFF' : 'GGG', 'HHH' : 'III', 'FFFIII' : 'BADNEWS', 'THING1' : "$(STUFF$)", 'THING2' : "$THING1", 'LITERAL' : TestLiteral("$XXX"), # Test that we can expand to and return a function. #'FUNCTION' : function_foo, 'CMDGEN1' : CmdGen1, 'CMDGEN2' : CmdGen2, 'LITERALS' : [ Literal('foo\nwith\nnewlines'), Literal('bar\nwith\nnewlines') ], 'NOTHING' : "", 'NONE' : None, # Test various combinations of strings, lists and functions. 'N' : None, 'X' : 'x', 'Y' : '$X', 'R' : '$R', 'S' : 'x y', 'LS' : ['x y'], 'L' : ['x', 'y'], 'TS' : ('x y'), 'T' : ('x', 'y'), 'CS' : cs, 'CL' : cl, 'US' : collections.UserString('us'), # Test function calls within ${}. 'FUNCCALL' : '${FUNC1("$AAA $FUNC2 $BBB")}', 'FUNC1' : lambda x: x, 'FUNC2' : lambda target, source, env, for_signature: ['x$CCC'], # Various tests refactored from ActionTests.py. 'LIST' : [["This", "is", "$(", "$a", "$)", "test"]], # Test recursion. 'RECURSE' : 'foo $RECURSE bar', 'RRR' : 'foo $SSS bar', 'SSS' : '$RRR', # Test callables that don't match the calling arguments. 'CALLABLE1' : callable_object_1, 'CALLABLE2' : callable_object_2, '_defines' : _defines, 'DEFS' : [ ('Q1', '"q1"'), ('Q2', '"$AAA"') ], } def basic_comparisons(self, function, convert): env = DummyEnv(self.loc) cases = self.basic_cases[:] kwargs = {'target' : self.target, 'source' : self.source, 'gvars' : env.Dictionary()} failed = 0 while cases: input, expect = cases[:2] expect = convert(expect) try: result = function(input, env, **kwargs) except Exception as e: fmt = " input %s generated %s (%s)" print(fmt % (repr(input), e.__class__.__name__, repr(e))) failed = failed + 1 else: if result != expect: if failed == 0: print() print(" input %s => \n%s did not match \n%s" % (repr(input), repr(result), repr(expect))) failed = failed + 1 del cases[:2] fmt = "%d %s() cases failed" assert failed == 0, fmt % (failed, function.__name__) class scons_subst_TestCase(SubstTestCase): # Basic tests of substitution functionality. basic_cases = [ # Basics: strings without expansions are left alone, and # the simplest possible expansion to a null-string value. "test", "test", "$null", "", # Test expansion of integer values. "test $zero", "test 0", "test $one", "test 1", # Test multiple re-expansion of values. "test $ONE", "test four", # Test a whole bunch of $TARGET[S] and $SOURCE[S] expansions. "test $TARGETS $SOURCES", "test foo/bar.exe /bar/baz with spaces.obj ../foo/baz.obj foo/blah with spaces.cpp /bar/ack.cpp ../foo/ack.c", "test ${TARGETS[:]} ${SOURCES[0]}", "test foo/bar.exe /bar/baz with spaces.obj ../foo/baz.obj foo/blah with spaces.cpp", "test ${TARGETS[1:]}v", "test /bar/baz with spaces.obj ../foo/baz.objv", "test $TARGET", "test foo/bar.exe", "test $TARGET$NO_SUCH_VAR[0]", "test foo/bar.exe[0]", "test $TARGETS.foo", "test 1 1 1", "test ${SOURCES[0:2].foo}", "test 1 1", "test $SOURCE.foo", "test 1", "test ${TARGET.get_stuff('blah')}", "test foo/bar.exeblah", "test ${SOURCES.get_stuff('blah')}", "test foo/blah with spaces.cppblah /bar/ack.cppblah ../foo/ack.cblah", "test ${SOURCES[0:2].get_stuff('blah')}", "test foo/blah with spaces.cppblah /bar/ack.cppblah", "test ${SOURCES[0:2].get_stuff('blah')}", "test foo/blah with spaces.cppblah /bar/ack.cppblah", "test ${SOURCES.attribute.attr1}", "test attr$1-blah with spaces.cpp attr$1-ack.cpp attr$1-ack.c", "test ${SOURCES.attribute.attr2}", "test attr$2-blah with spaces.cpp attr$2-ack.cpp attr$2-ack.c", # Test adjacent expansions. "foo$BAZ", "foobaz", "foo${BAZ}", "foobaz", # Test that adjacent expansions don't get re-interpreted # together. The correct disambiguated expansion should be: # $XXX$HHH => ${FFF}III => GGGIII # not: # $XXX$HHH => ${FFFIII} => BADNEWS "$XXX$HHH", "GGGIII", # Test double-dollar-sign behavior. "$$FFF$HHH", "$FFFIII", # Test that a Literal will stop dollar-sign substitution. "$XXX $LITERAL $FFF", "GGG $XXX GGG", # Test that we don't blow up even if they subscript # something in ways they "can't." "${FFF[0]}", "G", "${FFF[7]}", "", "${NOTHING[1]}", "", # Test various combinations of strings and lists. #None, '', '', '', 'x', 'x', 'x y', 'x y', '$N', '', '$X', 'x', '$Y', 'x', '$R', '', '$S', 'x y', '$LS', 'x y', '$L', 'x y', '$TS', 'x y', '$T', 'x y', '$S z', 'x y z', '$LS z', 'x y z', '$L z', 'x y z', '$TS z', 'x y z', '$T z', 'x y z', #cs, 'cs', #cl, 'cl', '$CS', 'cs', '$CL', 'cl', # Various uses of UserString. collections.UserString('x'), 'x', collections.UserString('$X'), 'x', collections.UserString('$US'), 'us', '$US', 'us', # Test function calls within ${}. '$FUNCCALL', 'a xc b', # Bug reported by Christoph Wiedemann. cvt('$xxx/bin'), '/bin', # Tests callables that don't match our calling arguments. '$CALLABLE1', 'callable-1', # Test handling of quotes. 'aaa "bbb ccc" ddd', 'aaa "bbb ccc" ddd', ] def test_scons_subst(self): """Test scons_subst(): basic substitution""" return self.basic_comparisons(scons_subst, cvt) subst_cases = [ "test $xxx", "test ", "test", "test", "test $($xxx$)", "test $($)", "test", "test", "test $( $xxx $)", "test $( $)", "test", "test", "test $( $THING2 $)", "test $( $(STUFF$) $)", "test STUFF", "test", "$AAA ${AAA}A $BBBB $BBB", "a aA b", "a aA b", "a aA b", "$RECURSE", "foo bar", "foo bar", "foo bar", "$RRR", "foo bar", "foo bar", "foo bar", # Verify what happens with no target or source nodes. "$TARGET $SOURCES", " ", "", "", "$TARGETS $SOURCE", " ", "", "", # Various tests refactored from ActionTests.py. "${LIST}", "This is $( $) test", "This is test", "This is test", ["|", "$(", "$AAA", "|", "$BBB", "$)", "|", "$CCC", 1], ["|", "$(", "a", "|", "b", "$)", "|", "c", "1"], ["|", "a", "|", "b", "|", "c", "1"], ["|", "|", "c", "1"], ] def test_subst_env(self): """Test scons_subst(): expansion dictionary""" # The expansion dictionary no longer comes from the construction # environment automatically. env = DummyEnv(self.loc) s = scons_subst('$AAA', env) assert s == '', s def test_subst_SUBST_modes(self): """Test scons_subst(): SUBST_* modes""" env = DummyEnv(self.loc) subst_cases = self.subst_cases[:] gvars = env.Dictionary() failed = 0 while subst_cases: input, eraw, ecmd, esig = subst_cases[:4] result = scons_subst(input, env, mode=SUBST_RAW, gvars=gvars) if result != eraw: if failed == 0: print() print(" input %s => RAW %s did not match %s" % (repr(input), repr(result), repr(eraw))) failed = failed + 1 result = scons_subst(input, env, mode=SUBST_CMD, gvars=gvars) if result != ecmd: if failed == 0: print() print(" input %s => CMD %s did not match %s" % (repr(input), repr(result), repr(ecmd))) failed = failed + 1 result = scons_subst(input, env, mode=SUBST_SIG, gvars=gvars) if result != esig: if failed == 0: print() print(" input %s => SIG %s did not match %s" % (repr(input), repr(result), repr(esig))) failed = failed + 1 del subst_cases[:4] assert failed == 0, "%d subst() mode cases failed" % failed def test_subst_target_source(self): """Test scons_subst(): target= and source= arguments""" env = DummyEnv(self.loc) t1 = self.MyNode('t1') t2 = self.MyNode('t2') s1 = self.MyNode('s1') s2 = self.MyNode('s2') result = scons_subst("$TARGET $SOURCES", env, target=[t1, t2], source=[s1, s2]) assert result == "t1 s1 s2", result result = scons_subst("$TARGET $SOURCES", env, target=[t1, t2], source=[s1, s2], gvars={}) assert result == "t1 s1 s2", result result = scons_subst("$TARGET $SOURCES", env, target=[], source=[]) assert result == " ", result result = scons_subst("$TARGETS $SOURCE", env, target=[], source=[]) assert result == " ", result def test_subst_callable_expansion(self): """Test scons_subst(): expanding a callable""" env = DummyEnv(self.loc) gvars = env.Dictionary() newcom = scons_subst("test $CMDGEN1 $SOURCES $TARGETS", env, target=self.MyNode('t'), source=self.MyNode('s'), gvars=gvars) assert newcom == "test foo bar with spaces.out s t", newcom def test_subst_attribute_errors(self): """Test scons_subst(): handling attribute errors""" env = DummyEnv(self.loc) try: class Foo(object): pass scons_subst('${foo.bar}', env, gvars={'foo':Foo()}) except SCons.Errors.UserError as e: expect = [ "AttributeError `bar' trying to evaluate `${foo.bar}'", "AttributeError `Foo instance has no attribute 'bar'' trying to evaluate `${foo.bar}'", "AttributeError `'Foo' instance has no attribute 'bar'' trying to evaluate `${foo.bar}'", "AttributeError `'Foo' object has no attribute 'bar'' trying to evaluate `${foo.bar}'", ] assert str(e) in expect, e else: raise AssertionError("did not catch expected UserError") def test_subst_syntax_errors(self): """Test scons_subst(): handling syntax errors""" env = DummyEnv(self.loc) try: scons_subst('$foo.bar.3.0', env) except SCons.Errors.UserError as e: expect = [ # Python 2.3, 2.4 "SyntaxError `invalid syntax (line 1)' trying to evaluate `$foo.bar.3.0'", # Python 2.5 "SyntaxError `invalid syntax (, line 1)' trying to evaluate `$foo.bar.3.0'", ] assert str(e) in expect, e else: raise AssertionError("did not catch expected UserError") def test_subst_balance_errors(self): """Test scons_subst(): handling syntax errors""" env = DummyEnv(self.loc) try: scons_subst('$(', env, mode=SUBST_SIG) except SCons.Errors.UserError as e: assert str(e) == "Unbalanced $(/$) in: $(", str(e) else: raise AssertionError("did not catch expected UserError") try: scons_subst('$)', env, mode=SUBST_SIG) except SCons.Errors.UserError as e: assert str(e) == "Unbalanced $(/$) in: $)", str(e) else: raise AssertionError("did not catch expected UserError") def test_subst_type_errors(self): """Test scons_subst(): handling type errors""" env = DummyEnv(self.loc) try: scons_subst("${NONE[2]}", env, gvars={'NONE':None}) except SCons.Errors.UserError as e: expect = [ # Python 2.3, 2.4 "TypeError `unsubscriptable object' trying to evaluate `${NONE[2]}'", # Python 2.5, 2.6 "TypeError `'NoneType' object is unsubscriptable' trying to evaluate `${NONE[2]}'", # Python 2.7 and later "TypeError `'NoneType' object is not subscriptable' trying to evaluate `${NONE[2]}'", # Python 2.7 and later under Fedora "TypeError `'NoneType' object has no attribute '__getitem__'' trying to evaluate `${NONE[2]}'", ] assert str(e) in expect, e else: raise AssertionError("did not catch expected UserError") try: def func(a, b, c): pass scons_subst("${func(1)}", env, gvars={'func':func}) except SCons.Errors.UserError as e: expect = [ # Python 2.3, 2.4, 2.5 "TypeError `func() takes exactly 3 arguments (1 given)' trying to evaluate `${func(1)}'", # Python 3.5 (and 3.x?) "TypeError `func() missing 2 required positional arguments: 'b' and 'c'' trying to evaluate `${func(1)}'" ] assert str(e) in expect, repr(str(e)) else: raise AssertionError("did not catch expected UserError") def test_subst_raw_function(self): """Test scons_subst(): fetch function with SUBST_RAW plus conv""" # Test that the combination of SUBST_RAW plus a pass-through # conversion routine allows us to fetch a function through the # dictionary. CommandAction uses this to allow delayed evaluation # of $SPAWN variables. env = DummyEnv(self.loc) gvars = env.Dictionary() x = lambda x: x r = scons_subst("$CALLABLE1", env, mode=SUBST_RAW, conv=x, gvars=gvars) assert r is self.callable_object_1, repr(r) r = scons_subst("$CALLABLE1", env, mode=SUBST_RAW, gvars=gvars) assert r == 'callable-1', repr(r) # Test how we handle overriding the internal conversion routines. def s(obj): return obj n1 = self.MyNode('n1') env = DummyEnv({'NODE' : n1}) gvars = env.Dictionary() node = scons_subst("$NODE", env, mode=SUBST_RAW, conv=s, gvars=gvars) assert node is n1, node node = scons_subst("$NODE", env, mode=SUBST_CMD, conv=s, gvars=gvars) assert node is n1, node node = scons_subst("$NODE", env, mode=SUBST_SIG, conv=s, gvars=gvars) assert node is n1, node def test_subst_overriding_gvars(self): """Test scons_subst(): supplying an overriding gvars dictionary""" env = DummyEnv({'XXX' : 'xxx'}) result = scons_subst('$XXX', env, gvars=env.Dictionary()) assert result == 'xxx', result result = scons_subst('$XXX', env, gvars={'XXX' : 'yyy'}) assert result == 'yyy', result class CLVar_TestCase(unittest.TestCase): def test_CLVar(self): """Test scons_subst() and scons_subst_list() with CLVar objects""" loc = {} loc['FOO'] = 'foo' loc['BAR'] = SCons.Util.CLVar('bar') loc['CALL'] = lambda target, source, env, for_signature: 'call' env = DummyEnv(loc) cmd = SCons.Util.CLVar("test $FOO $BAR $CALL test") newcmd = scons_subst(cmd, env, gvars=env.Dictionary()) assert newcmd == ['test', 'foo', 'bar', 'call', 'test'], newcmd cmd_list = scons_subst_list(cmd, env, gvars=env.Dictionary()) assert len(cmd_list) == 1, cmd_list assert cmd_list[0][0] == "test", cmd_list[0][0] assert cmd_list[0][1] == "foo", cmd_list[0][1] assert cmd_list[0][2] == "bar", cmd_list[0][2] assert cmd_list[0][3] == "call", cmd_list[0][3] assert cmd_list[0][4] == "test", cmd_list[0][4] class scons_subst_list_TestCase(SubstTestCase): basic_cases = [ "$TARGETS", [ ["foo/bar.exe", "/bar/baz with spaces.obj", "../foo/baz.obj"], ], "$SOURCES $NEWLINE $TARGETS", [ ["foo/blah with spaces.cpp", "/bar/ack.cpp", "../foo/ack.c", "before"], ["after", "foo/bar.exe", "/bar/baz with spaces.obj", "../foo/baz.obj"], ], "$SOURCES$NEWLINE", [ ["foo/blah with spaces.cpp", "/bar/ack.cpp", "../foo/ack.cbefore"], ["after"], ], "foo$FFF", [ ["fooGGG"], ], "foo${FFF}", [ ["fooGGG"], ], "test ${SOURCES.attribute.attr1}", [ ["test", "attr$1-blah with spaces.cpp", "attr$1-ack.cpp", "attr$1-ack.c"], ], "test ${SOURCES.attribute.attr2}", [ ["test", "attr$2-blah with spaces.cpp", "attr$2-ack.cpp", "attr$2-ack.c"], ], "$DO --in=$FOO --out=$BAR", [ ["do something", "--in=foo.in", "--out=bar with spaces.out"], ], # This test is now fixed, and works like it should. "$DO --in=$CRAZY --out=$BAR", [ ["do something", "--in=crazy\nfile.in", "--out=bar with spaces.out"], ], # Try passing a list to scons_subst_list(). [ "$SOURCES$NEWLINE", "$TARGETS", "This is a test"], [ ["foo/blah with spaces.cpp", "/bar/ack.cpp", "../foo/ack.cbefore"], ["after", "foo/bar.exe", "/bar/baz with spaces.obj", "../foo/baz.obj", "This is a test"], ], # Test against a former bug in scons_subst_list(). "$XXX$HHH", [ ["GGGIII"], ], # Test double-dollar-sign behavior. "$$FFF$HHH", [ ["$FFFIII"], ], # Test various combinations of strings, lists and functions. None, [[]], [None], [[]], '', [[]], [''], [[]], 'x', [['x']], ['x'], [['x']], 'x y', [['x', 'y']], ['x y'], [['x y']], ['x', 'y'], [['x', 'y']], '$N', [[]], ['$N'], [[]], '$X', [['x']], ['$X'], [['x']], '$Y', [['x']], ['$Y'], [['x']], #'$R', [[]], #['$R'], [[]], '$S', [['x', 'y']], '$S z', [['x', 'y', 'z']], ['$S'], [['x', 'y']], ['$S z'], [['x', 'y z']], # XXX - IS THIS BEST? ['$S', 'z'], [['x', 'y', 'z']], '$LS', [['x y']], '$LS z', [['x y', 'z']], ['$LS'], [['x y']], ['$LS z'], [['x y z']], ['$LS', 'z'], [['x y', 'z']], '$L', [['x', 'y']], '$L z', [['x', 'y', 'z']], ['$L'], [['x', 'y']], ['$L z'], [['x', 'y z']], # XXX - IS THIS BEST? ['$L', 'z'], [['x', 'y', 'z']], cs, [['cs']], [cs], [['cs']], cl, [['cl']], [cl], [['cl']], '$CS', [['cs']], ['$CS'], [['cs']], '$CL', [['cl']], ['$CL'], [['cl']], # Various uses of UserString. collections.UserString('x'), [['x']], [collections.UserString('x')], [['x']], collections.UserString('$X'), [['x']], [collections.UserString('$X')], [['x']], collections.UserString('$US'), [['us']], [collections.UserString('$US')], [['us']], '$US', [['us']], ['$US'], [['us']], # Test function calls within ${}. '$FUNCCALL', [['a', 'xc', 'b']], # Test handling of newlines in white space. 'foo\nbar', [['foo'], ['bar']], 'foo\n\nbar', [['foo'], ['bar']], 'foo \n \n bar', [['foo'], ['bar']], 'foo \nmiddle\n bar', [['foo'], ['middle'], ['bar']], # Bug reported by Christoph Wiedemann. cvt('$xxx/bin'), [['/bin']], # Test variables smooshed together with different prefixes. 'foo$AAA', [['fooa']], '<$AAA', [['<', 'a']], '>$AAA', [['>', 'a']], '|$AAA', [['|', 'a']], # Test callables that don't match our calling arguments. '$CALLABLE2', [['callable-2']], # Test handling of quotes. # XXX Find a way to handle this in the future. #'aaa "bbb ccc" ddd', [['aaa', 'bbb ccc', 'ddd']], '${_defines(DEFS)}', [['Q1="q1"', 'Q2="a"']], ] def test_scons_subst_list(self): """Test scons_subst_list(): basic substitution""" def convert_lists(expect): return [list(map(cvt, l)) for l in expect] return self.basic_comparisons(scons_subst_list, convert_lists) subst_list_cases = [ "test $xxx", [["test"]], [["test"]], [["test"]], "test $($xxx$)", [["test", "$($)"]], [["test"]], [["test"]], "test $( $xxx $)", [["test", "$(", "$)"]], [["test"]], [["test"]], "$AAA ${AAA}A $BBBB $BBB", [["a", "aA", "b"]], [["a", "aA", "b"]], [["a", "aA", "b"]], "$RECURSE", [["foo", "bar"]], [["foo", "bar"]], [["foo", "bar"]], "$RRR", [["foo", "bar"]], [["foo", "bar"]], [["foo", "bar"]], # Verify what happens with no target or source nodes. "$TARGET $SOURCES", [[]], [[]], [[]], "$TARGETS $SOURCE", [[]], [[]], [[]], # Various test refactored from ActionTests.py "${LIST}", [['This', 'is', '$(', '$)', 'test']], [['This', 'is', 'test']], [['This', 'is', 'test']], ["|", "$(", "$AAA", "|", "$BBB", "$)", "|", "$CCC", 1], [["|", "$(", "a", "|", "b", "$)", "|", "c", "1"]], [["|", "a", "|", "b", "|", "c", "1"]], [["|", "|", "c", "1"]], ] def test_subst_env(self): """Test scons_subst_list(): expansion dictionary""" # The expansion dictionary no longer comes from the construction # environment automatically. env = DummyEnv() s = scons_subst_list('$AAA', env) assert s == [[]], s def test_subst_target_source(self): """Test scons_subst_list(): target= and source= arguments""" env = DummyEnv(self.loc) gvars = env.Dictionary() t1 = self.MyNode('t1') t2 = self.MyNode('t2') s1 = self.MyNode('s1') s2 = self.MyNode('s2') result = scons_subst_list("$TARGET $SOURCES", env, target=[t1, t2], source=[s1, s2], gvars=gvars) assert result == [['t1', 's1', 's2']], result result = scons_subst_list("$TARGET $SOURCES", env, target=[t1, t2], source=[s1, s2], gvars={}) assert result == [['t1', 's1', 's2']], result # Test interpolating a callable. _t = DummyNode('t') _s = DummyNode('s') cmd_list = scons_subst_list("testing $CMDGEN1 $TARGETS $SOURCES", env, target=_t, source=_s, gvars=gvars) assert cmd_list == [['testing', 'foo', 'bar with spaces.out', 't', 's']], cmd_list def test_subst_escape(self): """Test scons_subst_list(): escape functionality""" env = DummyEnv(self.loc) gvars = env.Dictionary() def escape_func(foo): return '**' + foo + '**' cmd_list = scons_subst_list("abc $LITERALS xyz", env, gvars=gvars) assert cmd_list == [['abc', 'foo\nwith\nnewlines', 'bar\nwith\nnewlines', 'xyz']], cmd_list c = cmd_list[0][0].escape(escape_func) assert c == 'abc', c c = cmd_list[0][1].escape(escape_func) assert c == '**foo\nwith\nnewlines**', c c = cmd_list[0][2].escape(escape_func) assert c == '**bar\nwith\nnewlines**', c c = cmd_list[0][3].escape(escape_func) assert c == 'xyz', c # We used to treat literals smooshed together like the whole # thing was literal and escape it as a unit. The commented-out # asserts below are in case we ever have to find a way to # resurrect that functionality in some way. cmd_list = scons_subst_list("abc${LITERALS}xyz", env, gvars=gvars) c = cmd_list[0][0].escape(escape_func) #assert c == '**abcfoo\nwith\nnewlines**', c assert c == 'abcfoo\nwith\nnewlines', c c = cmd_list[0][1].escape(escape_func) #assert c == '**bar\nwith\nnewlinesxyz**', c assert c == 'bar\nwith\nnewlinesxyz', c _t = DummyNode('t') cmd_list = scons_subst_list('echo "target: $TARGET"', env, target=_t, gvars=gvars) c = cmd_list[0][0].escape(escape_func) assert c == 'echo', c c = cmd_list[0][1].escape(escape_func) assert c == '"target:', c c = cmd_list[0][2].escape(escape_func) assert c == 't"', c def test_subst_SUBST_modes(self): """Test scons_subst_list(): SUBST_* modes""" env = DummyEnv(self.loc) subst_list_cases = self.subst_list_cases[:] gvars = env.Dictionary() r = scons_subst_list("$TARGET $SOURCES", env, mode=SUBST_RAW, gvars=gvars) assert r == [[]], r failed = 0 while subst_list_cases: input, eraw, ecmd, esig = subst_list_cases[:4] result = scons_subst_list(input, env, mode=SUBST_RAW, gvars=gvars) if result != eraw: if failed == 0: print() print(" input %s => RAW %s did not match %s" % (repr(input), repr(result), repr(eraw))) failed = failed + 1 result = scons_subst_list(input, env, mode=SUBST_CMD, gvars=gvars) if result != ecmd: if failed == 0: print() print(" input %s => CMD %s did not match %s" % (repr(input), repr(result), repr(ecmd))) failed = failed + 1 result = scons_subst_list(input, env, mode=SUBST_SIG, gvars=gvars) if result != esig: if failed == 0: print() print(" input %s => SIG %s did not match %s" % (repr(input), repr(result), repr(esig))) failed = failed + 1 del subst_list_cases[:4] assert failed == 0, "%d subst() mode cases failed" % failed def test_subst_attribute_errors(self): """Test scons_subst_list(): handling attribute errors""" env = DummyEnv() try: class Foo(object): pass scons_subst_list('${foo.bar}', env, gvars={'foo':Foo()}) except SCons.Errors.UserError as e: expect = [ "AttributeError `bar' trying to evaluate `${foo.bar}'", "AttributeError `Foo instance has no attribute 'bar'' trying to evaluate `${foo.bar}'", "AttributeError `'Foo' instance has no attribute 'bar'' trying to evaluate `${foo.bar}'", "AttributeError `'Foo' object has no attribute 'bar'' trying to evaluate `${foo.bar}'", ] assert str(e) in expect, e else: raise AssertionError("did not catch expected UserError") def test_subst_syntax_errors(self): """Test scons_subst_list(): handling syntax errors""" env = DummyEnv() try: scons_subst_list('$foo.bar.3.0', env) except SCons.Errors.UserError as e: expect = [ "SyntaxError `invalid syntax' trying to evaluate `$foo.bar.3.0'", "SyntaxError `invalid syntax (line 1)' trying to evaluate `$foo.bar.3.0'", "SyntaxError `invalid syntax (, line 1)' trying to evaluate `$foo.bar.3.0'", ] assert str(e) in expect, e else: raise AssertionError("did not catch expected SyntaxError") def test_subst_raw_function(self): """Test scons_subst_list(): fetch function with SUBST_RAW plus conv""" # Test that the combination of SUBST_RAW plus a pass-through # conversion routine allows us to fetch a function through the # dictionary. env = DummyEnv(self.loc) gvars = env.Dictionary() x = lambda x: x r = scons_subst_list("$CALLABLE2", env, mode=SUBST_RAW, conv=x, gvars=gvars) assert r == [[self.callable_object_2]], repr(r) r = scons_subst_list("$CALLABLE2", env, mode=SUBST_RAW, gvars=gvars) assert r == [['callable-2']], repr(r) def test_subst_list_overriding_gvars(self): """Test scons_subst_list(): overriding conv()""" env = DummyEnv() def s(obj): return obj n1 = self.MyNode('n1') env = DummyEnv({'NODE' : n1}) gvars=env.Dictionary() node = scons_subst_list("$NODE", env, mode=SUBST_RAW, conv=s, gvars=gvars) assert node == [[n1]], node node = scons_subst_list("$NODE", env, mode=SUBST_CMD, conv=s, gvars=gvars) assert node == [[n1]], node node = scons_subst_list("$NODE", env, mode=SUBST_SIG, conv=s, gvars=gvars) assert node == [[n1]], node def test_subst_list_overriding_gvars(self): """Test scons_subst_list(): supplying an overriding gvars dictionary""" env = DummyEnv({'XXX' : 'xxx'}) result = scons_subst_list('$XXX', env, gvars=env.Dictionary()) assert result == [['xxx']], result result = scons_subst_list('$XXX', env, gvars={'XXX' : 'yyy'}) assert result == [['yyy']], result class scons_subst_once_TestCase(unittest.TestCase): loc = { 'CCFLAGS' : '-DFOO', 'ONE' : 1, 'RECURSE' : 'r $RECURSE r', 'LIST' : ['a', 'b', 'c'], } basic_cases = [ '$CCFLAGS -DBAR', 'OTHER_KEY', '$CCFLAGS -DBAR', '$CCFLAGS -DBAR', 'CCFLAGS', '-DFOO -DBAR', 'x $ONE y', 'ONE', 'x 1 y', 'x $RECURSE y', 'RECURSE', 'x r $RECURSE r y', '$LIST', 'LIST', 'a b c', ['$LIST'], 'LIST', ['a', 'b', 'c'], ['x', '$LIST', 'y'], 'LIST', ['x', 'a', 'b', 'c', 'y'], ['x', 'x $LIST y', 'y'], 'LIST', ['x', 'x a b c y', 'y'], ['x', 'x $CCFLAGS y', 'y'], 'LIST', ['x', 'x $CCFLAGS y', 'y'], ['x', 'x $RECURSE y', 'y'], 'LIST', ['x', 'x $RECURSE y', 'y'], ] def test_subst_once(self): """Test the scons_subst_once() function""" env = DummyEnv(self.loc) cases = self.basic_cases[:] failed = 0 while cases: input, key, expect = cases[:3] result = scons_subst_once(input, env, key) if result != expect: if failed == 0: print() print(" input %s (%s) => %s did not match %s" % (repr(input), repr(key), repr(result), repr(expect))) failed = failed + 1 del cases[:3] assert failed == 0, "%d subst() cases failed" % failed class quote_spaces_TestCase(unittest.TestCase): def test_quote_spaces(self): """Test the quote_spaces() method...""" q = quote_spaces('x') assert q == 'x', q q = quote_spaces('x x') assert q == '"x x"', q q = quote_spaces('x\tx') assert q == '"x\tx"', q class Node(object): def __init__(self, name, children=[]): self.children = children self.name = name def __str__(self): return self.name def exists(self): return 1 def rexists(self): return 1 def has_builder(self): return 1 def has_explicit_builder(self): return 1 def side_effect(self): return 1 def precious(self): return 1 def always_build(self): return 1 def current(self): return 1 class LiteralTestCase(unittest.TestCase): def test_Literal(self): """Test the Literal() function.""" input_list = [ '$FOO', Literal('$BAR') ] gvars = { 'FOO' : 'BAZ', 'BAR' : 'BLAT' } def escape_func(cmd): return '**' + cmd + '**' cmd_list = scons_subst_list(input_list, None, gvars=gvars) cmd_list = escape_list(cmd_list[0], escape_func) assert cmd_list == ['BAZ', '**$BAR**'], cmd_list def test_LiteralEqualsTest(self): """Test that Literals compare for equality properly""" assert Literal('a literal') == Literal('a literal') assert Literal('a literal') != Literal('b literal') class SpecialAttrWrapperTestCase(unittest.TestCase): def test_SpecialAttrWrapper(self): """Test the SpecialAttrWrapper() function.""" input_list = [ '$FOO', SpecialAttrWrapper('$BAR', 'BLEH') ] gvars = { 'FOO' : 'BAZ', 'BAR' : 'BLAT' } def escape_func(cmd): return '**' + cmd + '**' cmd_list = scons_subst_list(input_list, None, gvars=gvars) cmd_list = escape_list(cmd_list[0], escape_func) assert cmd_list == ['BAZ', '**$BAR**'], cmd_list cmd_list = scons_subst_list(input_list, None, mode=SUBST_SIG, gvars=gvars) cmd_list = escape_list(cmd_list[0], escape_func) assert cmd_list == ['BAZ', '**BLEH**'], cmd_list class subst_dict_TestCase(unittest.TestCase): def test_subst_dict(self): """Test substituting dictionary values in an Action """ t = DummyNode('t') s = DummyNode('s') d = subst_dict(target=t, source=s) assert str(d['TARGETS'][0]) == 't', d['TARGETS'] assert str(d['TARGET']) == 't', d['TARGET'] assert str(d['SOURCES'][0]) == 's', d['SOURCES'] assert str(d['SOURCE']) == 's', d['SOURCE'] t1 = DummyNode('t1') t2 = DummyNode('t2') s1 = DummyNode('s1') s2 = DummyNode('s2') d = subst_dict(target=[t1, t2], source=[s1, s2]) TARGETS = sorted([str(x) for x in d['TARGETS']]) assert TARGETS == ['t1', 't2'], d['TARGETS'] assert str(d['TARGET']) == 't1', d['TARGET'] SOURCES = sorted([str(x) for x in d['SOURCES']]) assert SOURCES == ['s1', 's2'], d['SOURCES'] assert str(d['SOURCE']) == 's1', d['SOURCE'] class V(object): # Fake Value node with no rfile() method. def __init__(self, name): self.name = name def __str__(self): return 'v-'+self.name def get_subst_proxy(self): return self class N(V): def rfile(self): return self.__class__('rstr-' + self.name) t3 = N('t3') t4 = DummyNode('t4') t5 = V('t5') s3 = DummyNode('s3') s4 = N('s4') s5 = V('s5') d = subst_dict(target=[t3, t4, t5], source=[s3, s4, s5]) TARGETS = sorted([str(x) for x in d['TARGETS']]) assert TARGETS == ['t4', 'v-t3', 'v-t5'], TARGETS SOURCES = sorted([str(x) for x in d['SOURCES']]) assert SOURCES == ['s3', 'v-rstr-s4', 'v-s5'], SOURCES if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ CLVar_TestCase, LiteralTestCase, SpecialAttrWrapperTestCase, quote_spaces_TestCase, scons_subst_TestCase, scons_subst_list_TestCase, scons_subst_once_TestCase, subst_dict_TestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/__main__.py0000664000175000017500000000017613160023045020635 0ustar bdbaddogbdbaddogimport SCons.Script # this does all the work, and calls sys.exit # with the proper exit status when done. SCons.Script.main() scons-src-3.0.0/src/engine/SCons/Platform/0000775000175000017500000000000013160023041020317 5ustar bdbaddogbdbaddogscons-src-3.0.0/src/engine/SCons/Platform/irix.py0000664000175000017500000000315213160023041021645 0ustar bdbaddogbdbaddog"""SCons.Platform.irix Platform-specific initialization for SGI IRIX systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Platform/irix.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from . import posix def generate(env): posix.generate(env) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Platform/__init__.py0000664000175000017500000002441513160023041022436 0ustar bdbaddogbdbaddog"""SCons.Platform SCons platform selection. This looks for modules that define a callable object that can modify a construction environment as appropriate for a given platform. Note that we take a more simplistic view of "platform" than Python does. We're looking for a single string that determines a set of tool-independent variables with which to initialize a construction environment. Consequently, we'll examine both sys.platform and os.name (and anything else that might come in to play) in order to return some specification which is unique enough for our purposes. Note that because this subsystem just *selects* a callable that can modify a construction environment, it's possible for people to define their own "platform specification" in an arbitrary callable function. No one needs to use or tie in to this subsystem in order to roll their own platform definition. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/engine/SCons/Platform/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import imp import os import sys import tempfile import SCons.Errors import SCons.Subst import SCons.Tool def platform_default(): """Return the platform string for our execution environment. The returned value should map to one of the SCons/Platform/*.py files. Since we're architecture independent, though, we don't care about the machine architecture. """ osname = os.name if osname == 'java': osname = os._osType if osname == 'posix': if sys.platform == 'cygwin': return 'cygwin' elif sys.platform.find('irix') != -1: return 'irix' elif sys.platform.find('sunos') != -1: return 'sunos' elif sys.platform.find('hp-ux') != -1: return 'hpux' elif sys.platform.find('aix') != -1: return 'aix' elif sys.platform.find('darwin') != -1: return 'darwin' else: return 'posix' elif os.name == 'os2': return 'os2' else: return sys.platform def platform_module(name = platform_default()): """Return the imported module for the platform. This looks for a module name that matches the specified argument. If the name is unspecified, we fetch the appropriate default for our execution environment. """ full_name = 'SCons.Platform.' + name if full_name not in sys.modules: if os.name == 'java': eval(full_name) else: try: file, path, desc = imp.find_module(name, sys.modules['SCons.Platform'].__path__) try: mod = imp.load_module(full_name, file, path, desc) finally: if file: file.close() except ImportError: try: import zipimport importer = zipimport.zipimporter( sys.modules['SCons.Platform'].__path__[0] ) mod = importer.load_module(full_name) except ImportError: raise SCons.Errors.UserError("No platform named '%s'" % name) setattr(SCons.Platform, name, mod) return sys.modules[full_name] def DefaultToolList(platform, env): """Select a default tool list for the specified platform. """ return SCons.Tool.tool_list(platform, env) class PlatformSpec(object): def __init__(self, name, generate): self.name = name self.generate = generate def __call__(self, *args, **kw): return self.generate(*args, **kw) def __str__(self): return self.name class TempFileMunge(object): """A callable class. You can set an Environment variable to this, then call it with a string argument, then it will perform temporary file substitution on it. This is used to circumvent the long command line limitation. Example usage: env["TEMPFILE"] = TempFileMunge env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}" By default, the name of the temporary file used begins with a prefix of '@'. This may be configred for other tool chains by setting '$TEMPFILEPREFIX'. env["TEMPFILEPREFIX"] = '-@' # diab compiler env["TEMPFILEPREFIX"] = '-via' # arm tool chain """ def __init__(self, cmd, cmdstr = None): self.cmd = cmd self.cmdstr = cmdstr def __call__(self, target, source, env, for_signature): if for_signature: # If we're being called for signature calculation, it's # because we're being called by the string expansion in # Subst.py, which has the logic to strip any $( $) that # may be in the command line we squirreled away. So we # just return the raw command line and let the upper # string substitution layers do their thing. return self.cmd # Now we're actually being called because someone is actually # going to try to execute the command, so we have to do our # own expansion. cmd = env.subst_list(self.cmd, SCons.Subst.SUBST_CMD, target, source)[0] try: maxline = int(env.subst('$MAXLINELENGTH')) except ValueError: maxline = 2048 length = 0 for c in cmd: length += len(c) length += len(cmd) - 1 if length <= maxline: return self.cmd # Check if we already created the temporary file for this target # It should have been previously done by Action.strfunction() call node = target[0] if SCons.Util.is_List(target) else target cmdlist = getattr(node.attributes, 'tempfile_cmdlist', None) \ if node is not None else None if cmdlist is not None : return cmdlist # We do a normpath because mktemp() has what appears to be # a bug in Windows that will use a forward slash as a path # delimiter. Windows's link mistakes that for a command line # switch and barfs. # # We use the .lnk suffix for the benefit of the Phar Lap # linkloc linker, which likes to append an .lnk suffix if # none is given. (fd, tmp) = tempfile.mkstemp('.lnk', text=True) native_tmp = SCons.Util.get_native_path(os.path.normpath(tmp)) if env.get('SHELL',None) == 'sh': # The sh shell will try to escape the backslashes in the # path, so unescape them. native_tmp = native_tmp.replace('\\', r'\\\\') # In Cygwin, we want to use rm to delete the temporary # file, because del does not exist in the sh shell. rm = env.Detect('rm') or 'del' else: # Don't use 'rm' if the shell is not sh, because rm won't # work with the Windows shells (cmd.exe or command.com) or # Windows path names. rm = 'del' prefix = env.subst('$TEMPFILEPREFIX') if not prefix: prefix = '@' args = list(map(SCons.Subst.quote_spaces, cmd[1:])) os.write(fd, bytearray(" ".join(args) + "\n",'utf-8')) os.close(fd) # XXX Using the SCons.Action.print_actions value directly # like this is bogus, but expedient. This class should # really be rewritten as an Action that defines the # __call__() and strfunction() methods and lets the # normal action-execution logic handle whether or not to # print/execute the action. The problem, though, is all # of that is decided before we execute this method as # part of expanding the $TEMPFILE construction variable. # Consequently, refactoring this will have to wait until # we get more flexible with allowing Actions to exist # independently and get strung together arbitrarily like # Ant tasks. In the meantime, it's going to be more # user-friendly to not let obsession with architectural # purity get in the way of just being helpful, so we'll # reach into SCons.Action directly. if SCons.Action.print_actions: cmdstr = env.subst(self.cmdstr, SCons.Subst.SUBST_RAW, target, source) if self.cmdstr is not None else '' # Print our message only if XXXCOMSTR returns an empty string if len(cmdstr) == 0 : print("Using tempfile "+native_tmp+" for command line:\n"+ str(cmd[0]) + " " + " ".join(args)) # Store the temporary file command list into the target Node.attributes # to avoid creating two temporary files one for print and one for execute. cmdlist = [ cmd[0], prefix + native_tmp + '\n' + rm, native_tmp ] if node is not None: try : setattr(node.attributes, 'tempfile_cmdlist', cmdlist) except AttributeError: pass return cmdlist def Platform(name = platform_default()): """Select a canned Platform specification. """ module = platform_module(name) spec = PlatformSpec(name, module.generate) return spec # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Platform/sunos.py0000664000175000017500000000357713160023041022054 0ustar bdbaddogbdbaddog"""engine.SCons.Platform.sunos Platform-specific initialization for Sun systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Platform/sunos.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from . import posix def generate(env): posix.generate(env) # Based on sunSparc 8:32bit # ARG_MAX=1048320 - 3000 for environment expansion env['MAXLINELENGTH'] = 1045320 env['PKGINFO'] = 'pkginfo' env['PKGCHK'] = '/usr/sbin/pkgchk' env['ENV']['PATH'] = env['ENV']['PATH'] + ':/opt/SUNWspro/bin:/usr/ccs/bin' # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Platform/posix.py0000664000175000017500000001023013160023041022027 0ustar bdbaddogbdbaddog"""SCons.Platform.posix Platform-specific initialization for POSIX (Linux, UNIX, etc.) systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Platform/posix.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import errno import os import os.path import subprocess import sys import select import SCons.Util from SCons.Platform import TempFileMunge exitvalmap = { 2 : 127, 13 : 126, } def escape(arg): "escape shell special characters" slash = '\\' special = '"$' arg = arg.replace(slash, slash+slash) for c in special: arg = arg.replace(c, slash+c) # print("ESCAPE RESULT: %s" % arg) return '"' + arg + '"' def exec_subprocess(l, env): proc = subprocess.Popen(l, env = env, close_fds = True) return proc.wait() def subprocess_spawn(sh, escape, cmd, args, env): return exec_subprocess([sh, '-c', ' '.join(args)], env) def exec_popen3(l, env, stdout, stderr): proc = subprocess.Popen(l, env = env, close_fds = True, stdout = stdout, stderr = stderr) return proc.wait() def piped_env_spawn(sh, escape, cmd, args, env, stdout, stderr): # spawn using Popen3 combined with the env command # the command name and the command's stdout is written to stdout # the command's stderr is written to stderr return exec_popen3([sh, '-c', ' '.join(args)], env, stdout, stderr) def generate(env): # Bearing in mind we have python 2.4 as a baseline, we can just do this: spawn = subprocess_spawn pspawn = piped_env_spawn # Note that this means that 'escape' is no longer used if 'ENV' not in env: env['ENV'] = {} env['ENV']['PATH'] = '/usr/local/bin:/opt/bin:/bin:/usr/bin' env['OBJPREFIX'] = '' env['OBJSUFFIX'] = '.o' env['SHOBJPREFIX'] = '$OBJPREFIX' env['SHOBJSUFFIX'] = '$OBJSUFFIX' env['PROGPREFIX'] = '' env['PROGSUFFIX'] = '' env['LIBPREFIX'] = 'lib' env['LIBSUFFIX'] = '.a' env['SHLIBPREFIX'] = '$LIBPREFIX' env['SHLIBSUFFIX'] = '.so' env['LIBPREFIXES'] = [ '$LIBPREFIX' ] env['LIBSUFFIXES'] = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ] env['PSPAWN'] = pspawn env['SPAWN'] = spawn env['SHELL'] = 'sh' env['ESCAPE'] = escape env['TEMPFILE'] = TempFileMunge env['TEMPFILEPREFIX'] = '@' #Based on LINUX: ARG_MAX=ARG_MAX=131072 - 3000 for environment expansion #Note: specific platforms might rise or lower this value env['MAXLINELENGTH'] = 128072 # This platform supports RPATH specifications. env['__RPATH'] = '$_RPATH' # GDC is GCC family, but DMD and LDC have different options. # Must be able to have GCC and DMD work in the same build, so: env['__DRPATH'] = '$_DRPATH' # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Platform/os2.py0000664000175000017500000000423713160023041021402 0ustar bdbaddogbdbaddog"""SCons.Platform.os2 Platform-specific initialization for OS/2 systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Platform/os2.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from . import win32 def generate(env): if 'ENV' not in env: env['ENV'] = {} env['OBJPREFIX'] = '' env['OBJSUFFIX'] = '.obj' env['SHOBJPREFIX'] = '$OBJPREFIX' env['SHOBJSUFFIX'] = '$OBJSUFFIX' env['PROGPREFIX'] = '' env['PROGSUFFIX'] = '.exe' env['LIBPREFIX'] = '' env['LIBSUFFIX'] = '.lib' env['SHLIBPREFIX'] = '' env['SHLIBSUFFIX'] = '.dll' env['LIBPREFIXES'] = '$LIBPREFIX' env['LIBSUFFIXES'] = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ] env['HOST_OS'] = 'os2' env['HOST_ARCH'] = win32.get_architecture().arch # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Platform/win32.xml0000664000175000017500000000213513160023041022004 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> The maximum number of characters allowed on an external command line. On Win32 systems, link lines longer than this many characters are linked via a temporary file name. scons-src-3.0.0/src/engine/SCons/Platform/aix.py0000664000175000017500000000614013160023041021453 0ustar bdbaddogbdbaddog"""engine.SCons.Platform.aix Platform-specific initialization for IBM AIX systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Platform/aix.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import subprocess from . import posix import SCons.Util import SCons.Action def get_xlc(env, xlc=None, packages=[]): # Use the AIX package installer tool lslpp to figure out where a # given xl* compiler is installed and what version it is. xlcPath = None xlcVersion = None if xlc is None: xlc = env.get('CC', 'xlc') if SCons.Util.is_List(xlc): xlc = xlc[0] for package in packages: # find the installed filename, which may be a symlink as well pipe = SCons.Action._subproc(env, ['lslpp', '-fc', package], stdin = 'devnull', stderr = 'devnull', stdout = subprocess.PIPE) # output of lslpp is something like this: # #Path:Fileset:File # /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/exe/xlCcpp # /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/bin/xlc_r -> /usr/vac/bin/xlc for line in pipe.stdout: if xlcPath: continue # read everything to let lslpp terminate fileset, filename = line.split(':')[1:3] filename = filename.split()[0] if ('/' in xlc and filename == xlc) \ or ('/' not in xlc and filename.endswith('/' + xlc)): xlcVersion = fileset.split()[1] xlcPath, sep, xlc = filename.rpartition('/') pass pass return (xlcPath, xlc, xlcVersion) def generate(env): posix.generate(env) #Based on AIX 5.2: ARG_MAX=24576 - 3000 for environment expansion env['MAXLINELENGTH'] = 21576 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Platform/posix.xml0000664000175000017500000000435313160023041022210 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> A list of paths to search for shared libraries when running programs. Currently only used in the GNU (gnulink), IRIX (sgilink) and Sun (sunlink) linkers. Ignored on platforms and toolchains that don't support it. Note that the paths added to RPATH are not transformed by &scons; in any way: if you want an absolute path, you must make it absolute yourself. An automatically-generated construction variable containing the rpath flags to be used when linking a program with shared libraries. The value of &cv-_RPATH; is created by appending &cv-RPATHPREFIX; and &cv-RPATHSUFFIX; to the beginning and end of each directory in &cv-RPATH;. The prefix used to specify a directory to be searched for shared libraries when running programs. This will be appended to the beginning of each directory in the &cv-RPATH; construction variable when the &cv-_RPATH; variable is automatically generated. The suffix used to specify a directory to be searched for shared libraries when running programs. This will be appended to the end of each directory in the &cv-RPATH; construction variable when the &cv-_RPATH; variable is automatically generated. scons-src-3.0.0/src/engine/SCons/Platform/darwin.py0000664000175000017500000000524613160023041022164 0ustar bdbaddogbdbaddog"""engine.SCons.Platform.darwin Platform-specific initialization for Mac OS X systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Platform/darwin.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from . import posix import os def generate(env): posix.generate(env) env['SHLIBSUFFIX'] = '.dylib' # put macports paths at front to override Apple's versions, fink path is after # For now let people who want Macports or Fink tools specify it! # env['ENV']['PATH'] = '/opt/local/bin:/opt/local/sbin:' + env['ENV']['PATH'] + ':/sw/bin' # Store extra system paths in env['ENV']['PATHOSX'] filelist = ['/etc/paths',] # make sure this works on Macs with Tiger or earlier try: dirlist = os.listdir('/etc/paths.d') except: dirlist = [] for file in dirlist: filelist.append('/etc/paths.d/'+file) for file in filelist: if os.path.isfile(file): f = open(file, 'r') lines = f.readlines() for line in lines: if line: env.AppendENVPath('PATHOSX', line.strip('\n')) f.close() # Not sure why this wasn't the case all along? if env['ENV'].get('PATHOSX', False) and os.environ.get('SCONS_USE_MAC_PATHS', False): env.AppendENVPath('PATH',env['ENV']['PATHOSX']) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Platform/sunos.xml0000664000175000017500000000260713160023041022215 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> On Solaris systems, the package-checking program that will be used (along with &cv-PKGINFO;) to look for installed versions of the Sun PRO C++ compiler. The default is /usr/sbin/pgkchk. On Solaris systems, the package information program that will be used (along with &cv-PKGCHK;) to look for installed versions of the Sun PRO C++ compiler. The default is pkginfo. scons-src-3.0.0/src/engine/SCons/Platform/__init__.xml0000664000175000017500000001303013160023041022575 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> A function that will be called to escape shell special characters in command lines. The function should take one argument: the command line string to escape; and should return the escaped command line. The prefix used for (static) library file names. A default value is set for each platform (posix, win32, os2, etc.), but the value is overridden by individual tools (ar, mslib, sgiar, sunar, tlib, etc.) to reflect the names of the libraries they create. A list of all legal prefixes for library file names. When searching for library dependencies, SCons will look for files with these prefixes, the base library name, and suffixes in the &cv-LIBSUFFIXES; list. The suffix used for (static) library file names. A default value is set for each platform (posix, win32, os2, etc.), but the value is overridden by individual tools (ar, mslib, sgiar, sunar, tlib, etc.) to reflect the names of the libraries they create. A list of all legal suffixes for library file names. When searching for library dependencies, SCons will look for files with prefixes, in the &cv-LIBPREFIXES; list, the base library name, and these suffixes. The prefix used for (static) object file names. The suffix used for (static) object file names. The name of the platform used to create the Environment. If no platform is specified when the Environment is created, &scons; autodetects the platform. env = Environment(tools = []) if env['PLATFORM'] == 'cygwin': Tool('mingw')(env) else: Tool('msvc')(env) The name of the host operating system used to create the Environment. If a platform is specified when creating the Environment, then that Platform's logic will handle setting this value. This value is immutable, and should not be changed by the user after the Environment is initialized. Currently only set for Win32. The name of the host hardware architecture used to create the Environment. If a platform is specified when creating the Environment, then that Platform's logic will handle setting this value. This value is immutable, and should not be changed by the user after the Environment is initialized. Currently only set for Win32. The name of the target operating system for the compiled objects created by this Environment. This defaults to the value of HOST_OS, and the user can override it. Currently only set for Win32. The name of the target hardware architecture for the compiled objects created by this Environment. This defaults to the value of HOST_ARCH, and the user can override it. Currently only set for Win32. The prefix used for executable file names. The suffix used for executable file names. A string naming the shell program that will be passed to the &cv-SPAWN; function. See the &cv-SPAWN; construction variable for more information. The prefix used for shared library file names. The suffix used for shared library file names. The prefix used for shared object file names. The suffix used for shared object file names. The prefix for a temporary file used to execute lines longer than $MAXLINELENGTH. The default is '@'. This may be set for toolchains that use other values, such as '-@' for the diab compiler or '-via' for ARM toolchain. scons-src-3.0.0/src/engine/SCons/Platform/PlatformTests.py0000664000175000017500000001761113160023041023506 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Platform/PlatformTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import collections import unittest import TestUnit import SCons.Errors import SCons.Platform import SCons.Environment import SCons.Action class Environment(collections.UserDict): def Detect(self, cmd): return cmd def AppendENVPath(self, key, value): pass class PlatformTestCase(unittest.TestCase): def test_Platform(self): """Test the Platform() function""" p = SCons.Platform.Platform('cygwin') assert str(p) == 'cygwin', p env = Environment() p(env) assert env['PROGSUFFIX'] == '.exe', env assert env['LIBSUFFIX'] == '.a', env assert env['SHELL'] == 'sh', env p = SCons.Platform.Platform('os2') assert str(p) == 'os2', p env = Environment() p(env) assert env['PROGSUFFIX'] == '.exe', env assert env['LIBSUFFIX'] == '.lib', env p = SCons.Platform.Platform('posix') assert str(p) == 'posix', p env = Environment() p(env) assert env['PROGSUFFIX'] == '', env assert env['LIBSUFFIX'] == '.a', env assert env['SHELL'] == 'sh', env p = SCons.Platform.Platform('irix') assert str(p) == 'irix', p env = Environment() p(env) assert env['PROGSUFFIX'] == '', env assert env['LIBSUFFIX'] == '.a', env assert env['SHELL'] == 'sh', env p = SCons.Platform.Platform('aix') assert str(p) == 'aix', p env = Environment() p(env) assert env['PROGSUFFIX'] == '', env assert env['LIBSUFFIX'] == '.a', env assert env['SHELL'] == 'sh', env p = SCons.Platform.Platform('sunos') assert str(p) == 'sunos', p env = Environment() p(env) assert env['PROGSUFFIX'] == '', env assert env['LIBSUFFIX'] == '.a', env assert env['SHELL'] == 'sh', env p = SCons.Platform.Platform('hpux') assert str(p) == 'hpux', p env = Environment() p(env) assert env['PROGSUFFIX'] == '', env assert env['LIBSUFFIX'] == '.a', env assert env['SHELL'] == 'sh', env p = SCons.Platform.Platform('win32') assert str(p) == 'win32', p env = Environment() p(env) assert env['PROGSUFFIX'] == '.exe', env assert env['LIBSUFFIX'] == '.lib', env assert str try: p = SCons.Platform.Platform('_does_not_exist_') except SCons.Errors.UserError: pass else: raise env = Environment() SCons.Platform.Platform()(env) assert env != {}, env class TempFileMungeTestCase(unittest.TestCase): def test_MAXLINELENGTH(self): """ Test different values for MAXLINELENGTH with the same size command string to ensure that the temp file mechanism kicks in only at MAXLINELENGTH+1, or higher """ # Init class with cmd, such that the fully expanded # string reads "a test command line". # Note, how we're using a command string here that is # actually longer than the substituted one. This is to ensure # that the TempFileMunge class internally really takes the # length of the expanded string into account. defined_cmd = "a $VERY $OVERSIMPLIFIED line" t = SCons.Platform.TempFileMunge(defined_cmd) env = SCons.Environment.SubstitutionEnvironment(tools=[]) # Setting the line length high enough... env['MAXLINELENGTH'] = 1024 env['VERY'] = 'test' env['OVERSIMPLIFIED'] = 'command' expanded_cmd = env.subst(defined_cmd) # Call the tempfile munger cmd = t(None,None,env,0) assert cmd == defined_cmd, cmd # Let MAXLINELENGTH equal the string's length env['MAXLINELENGTH'] = len(expanded_cmd) cmd = t(None,None,env,0) assert cmd == defined_cmd, cmd # Finally, let the actual tempfile mechanism kick in # Disable printing of actions... old_actions = SCons.Action.print_actions SCons.Action.print_actions = 0 env['MAXLINELENGTH'] = len(expanded_cmd)-1 cmd = t(None,None,env,0) # ...and restoring its setting. SCons.Action.print_actions = old_actions assert cmd != defined_cmd, cmd def test_tempfilecreation_once(self): # Init class with cmd, such that the fully expanded # string reads "a test command line". # Note, how we're using a command string here that is # actually longer than the substituted one. This is to ensure # that the TempFileMunge class internally really takes the # length of the expanded string into account. defined_cmd = "a $VERY $OVERSIMPLIFIED line" t = SCons.Platform.TempFileMunge(defined_cmd) env = SCons.Environment.SubstitutionEnvironment(tools=[]) # Setting the line length high enough... env['VERY'] = 'test' env['OVERSIMPLIFIED'] = 'command' expanded_cmd = env.subst(defined_cmd) env['MAXLINELENGTH'] = len(expanded_cmd)-1 # Disable printing of actions... old_actions = SCons.Action.print_actions SCons.Action.print_actions = 0 # Create an instance of object derived class to allow setattrb class Node(object) : class Attrs(object): pass def __init__(self): self.attributes = self.Attrs() target = [Node()] cmd = t(target, None, env, 0) # ...and restoring its setting. SCons.Action.print_actions = old_actions assert cmd != defined_cmd, cmd assert cmd == getattr(target[0].attributes, 'tempfile_cmdlist', None) class PlatformEscapeTestCase(unittest.TestCase): def test_posix_escape(self): """ Check that paths with parens are escaped properly """ import SCons.Platform.posix test_string = "/my (really) great code/main.cpp" output = SCons.Platform.posix.escape(test_string) # We expect the escape function to wrap the string # in quotes, but not escape any internal characters # in the test_string. (Parens doesn't require shell # escaping if their quoted) assert output[1:-1] == test_string if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ PlatformTestCase, TempFileMungeTestCase, PlatformEscapeTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Platform/cygwin.py0000664000175000017500000000401413160023041022170 0ustar bdbaddogbdbaddog"""SCons.Platform.cygwin Platform-specific initialization for Cygwin systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Platform/cygwin.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from . import posix from SCons.Platform import TempFileMunge def generate(env): posix.generate(env) env['PROGPREFIX'] = '' env['PROGSUFFIX'] = '.exe' env['SHLIBPREFIX'] = '' env['SHLIBSUFFIX'] = '.dll' env['LIBPREFIXES'] = [ '$LIBPREFIX', '$SHLIBPREFIX', '$IMPLIBPREFIX' ] env['LIBSUFFIXES'] = [ '$LIBSUFFIX', '$SHLIBSUFFIX', '$IMPLIBSUFFIX' ] env['TEMPFILE'] = TempFileMunge env['TEMPFILEPREFIX'] = '@' env['MAXLINELENGTH'] = 2048 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Platform/win32.py0000664000175000017500000004004213160023041021633 0ustar bdbaddogbdbaddog"""SCons.Platform.win32 Platform-specific initialization for Win32 systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Platform/win32.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import os.path import sys import tempfile from SCons.Platform.posix import exitvalmap from SCons.Platform import TempFileMunge import SCons.Util try: import msvcrt import win32api import win32con msvcrt.get_osfhandle win32api.SetHandleInformation win32con.HANDLE_FLAG_INHERIT except ImportError: parallel_msg = \ "you do not seem to have the pywin32 extensions installed;\n" + \ "\tparallel (-j) builds may not work reliably with open Python files." except AttributeError: parallel_msg = \ "your pywin32 extensions do not support file handle operations;\n" + \ "\tparallel (-j) builds may not work reliably with open Python files." else: parallel_msg = None _builtin_open = open def _scons_open(*args, **kw): fp = _builtin_open(*args, **kw) win32api.SetHandleInformation(msvcrt.get_osfhandle(fp.fileno()), win32con.HANDLE_FLAG_INHERIT, 0) return fp open = _scons_open if sys.version_info.major == 2: _builtin_file = file class _scons_file(_builtin_file): def __init__(self, *args, **kw): _builtin_file.__init__(self, *args, **kw) win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()), win32con.HANDLE_FLAG_INHERIT, 0) file = _scons_file else: import io for io_class in ['BufferedReader', 'BufferedWriter', 'BufferedRWPair', 'BufferedRandom', 'TextIOWrapper']: _builtin_file = getattr(io, io_class) class _scons_file(_builtin_file): def __init__(self, *args, **kw): _builtin_file.__init__(self, *args, **kw) win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()), win32con.HANDLE_FLAG_INHERIT, 0) setattr(io, io_class, _scons_file) if False: # Now swap out shutil.filecopy and filecopy2 for win32 api native CopyFile try: from ctypes import windll import shutil CopyFile = windll.kernel32.CopyFileA SetFileTime = windll.kernel32.SetFileTime _shutil_copy = shutil.copy _shutil_copy2 = shutil.copy2 shutil.copy2 = CopyFile def win_api_copyfile(src,dst): CopyFile(src,dst) os.utime(dst) shutil.copy = win_api_copyfile except AttributeError: parallel_msg = \ "Couldn't override shutil.copy or shutil.copy2 falling back to shutil defaults" try: import threading spawn_lock = threading.Lock() # This locked version of spawnve works around a Windows # MSVCRT bug, because its spawnve is not thread-safe. # Without this, python can randomly crash while using -jN. # See the python bug at http://bugs.python.org/issue6476 # and SCons issue at # http://scons.tigris.org/issues/show_bug.cgi?id=2449 def spawnve(mode, file, args, env): spawn_lock.acquire() try: if mode == os.P_WAIT: ret = os.spawnve(os.P_NOWAIT, file, args, env) else: ret = os.spawnve(mode, file, args, env) finally: spawn_lock.release() if mode == os.P_WAIT: pid, status = os.waitpid(ret, 0) ret = status >> 8 return ret except ImportError: # Use the unsafe method of spawnve. # Please, don't try to optimize this try-except block # away by assuming that the threading module is always present. # In the test test/option-j.py we intentionally call SCons with # a fake threading.py that raises an import exception right away, # simulating a non-existent package. def spawnve(mode, file, args, env): return os.spawnve(mode, file, args, env) # The upshot of all this is that, if you are using Python 1.5.2, # you had better have cmd or command.com in your PATH when you run # scons. def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): # There is no direct way to do that in python. What we do # here should work for most cases: # In case stdout (stderr) is not redirected to a file, # we redirect it into a temporary file tmpFileStdout # (tmpFileStderr) and copy the contents of this file # to stdout (stderr) given in the argument if not sh: sys.stderr.write("scons: Could not find command interpreter, is it in your PATH?\n") return 127 else: # one temporary file for stdout and stderr tmpFileStdout = os.path.normpath(tempfile.mktemp()) tmpFileStderr = os.path.normpath(tempfile.mktemp()) # check if output is redirected stdoutRedirected = 0 stderrRedirected = 0 for arg in args: # are there more possibilities to redirect stdout ? if arg.find( ">", 0, 1 ) != -1 or arg.find( "1>", 0, 2 ) != -1: stdoutRedirected = 1 # are there more possibilities to redirect stderr ? if arg.find( "2>", 0, 2 ) != -1: stderrRedirected = 1 # redirect output of non-redirected streams to our tempfiles if stdoutRedirected == 0: args.append(">" + str(tmpFileStdout)) if stderrRedirected == 0: args.append("2>" + str(tmpFileStderr)) # actually do the spawn try: args = [sh, '/C', escape(' '.join(args)) ] ret = spawnve(os.P_WAIT, sh, args, env) except OSError as e: # catch any error try: ret = exitvalmap[e[0]] except KeyError: sys.stderr.write("scons: unknown OSError exception code %d - %s: %s\n" % (e[0], cmd, e[1])) if stderr is not None: stderr.write("scons: %s: %s\n" % (cmd, e[1])) # copy child output from tempfiles to our streams # and do clean up stuff if stdout is not None and stdoutRedirected == 0: try: stdout.write(open( tmpFileStdout, "r" ).read()) os.remove( tmpFileStdout ) except (IOError, OSError): pass if stderr is not None and stderrRedirected == 0: try: stderr.write(open( tmpFileStderr, "r" ).read()) os.remove( tmpFileStderr ) except (IOError, OSError): pass return ret def exec_spawn(l, env): try: result = spawnve(os.P_WAIT, l[0], l, env) except (OSError, EnvironmentError) as e: try: result = exitvalmap[e.errno] sys.stderr.write("scons: %s: %s\n" % (l[0], e.strerror)) except KeyError: result = 127 if len(l) > 2: if len(l[2]) < 1000: command = ' '.join(l[0:3]) else: command = l[0] else: command = l[0] sys.stderr.write("scons: unknown OSError exception code %d - '%s': %s\n" % (e.errno, command, e.strerror)) return result def spawn(sh, escape, cmd, args, env): if not sh: sys.stderr.write("scons: Could not find command interpreter, is it in your PATH?\n") return 127 return exec_spawn([sh, '/C', escape(' '.join(args))], env) # Windows does not allow special characters in file names anyway, so no # need for a complex escape function, we will just quote the arg, except # that "cmd /c" requires that if an argument ends with a backslash it # needs to be escaped so as not to interfere with closing double quote # that we add. def escape(x): if x[-1] == '\\': x = x + '\\' return '"' + x + '"' # Get the windows system directory name _system_root = None def get_system_root(): global _system_root if _system_root is not None: return _system_root # A resonable default if we can't read the registry val = os.environ.get('SystemRoot', "C:\\WINDOWS") if SCons.Util.can_read_reg: try: # Look for Windows NT system root k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Windows NT\\CurrentVersion') val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot') except SCons.Util.RegError: try: # Okay, try the Windows 9x system root k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Windows\\CurrentVersion') val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot') except KeyboardInterrupt: raise except: pass # Ensure system root is a string and not unicode # (This only matters for py27 were unicode in env passed to POpen fails) val = str(val) _system_root = val return val def get_program_files_dir(): """ Get the location of the program files directory Returns ------- """ # Now see if we can look in the registry... val = '' if SCons.Util.can_read_reg: try: # Look for Windows Program Files directory k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Windows\\CurrentVersion') val, tok = SCons.Util.RegQueryValueEx(k, 'ProgramFilesDir') except SCons.Util.RegError: val = '' pass if val == '': # A reasonable default if we can't read the registry # (Actually, it's pretty reasonable even if we can :-) val = os.path.join(os.path.dirname(get_system_root()),"Program Files") return val class ArchDefinition(object): """ Determine which windows CPU were running on. A class for defining architecture-specific settings and logic. """ def __init__(self, arch, synonyms=[]): self.arch = arch self.synonyms = synonyms SupportedArchitectureList = [ ArchDefinition( 'x86', ['i386', 'i486', 'i586', 'i686'], ), ArchDefinition( 'x86_64', ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'], ), ArchDefinition( 'ia64', ['IA64'], ), ] SupportedArchitectureMap = {} for a in SupportedArchitectureList: SupportedArchitectureMap[a.arch] = a for s in a.synonyms: SupportedArchitectureMap[s] = a def get_architecture(arch=None): """Returns the definition for the specified architecture string. If no string is specified, the system default is returned (as defined by the PROCESSOR_ARCHITEW6432 or PROCESSOR_ARCHITECTURE environment variables). """ if arch is None: arch = os.environ.get('PROCESSOR_ARCHITEW6432') if not arch: arch = os.environ.get('PROCESSOR_ARCHITECTURE') return SupportedArchitectureMap.get(arch, ArchDefinition('', [''])) def generate(env): # Attempt to find cmd.exe (for WinNT/2k/XP) or # command.com for Win9x cmd_interp = '' # First see if we can look in the registry... if SCons.Util.can_read_reg: try: # Look for Windows NT system root k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Windows NT\\CurrentVersion') val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot') cmd_interp = os.path.join(val, 'System32\\cmd.exe') except SCons.Util.RegError: try: # Okay, try the Windows 9x system root k=SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Windows\\CurrentVersion') val, tok = SCons.Util.RegQueryValueEx(k, 'SystemRoot') cmd_interp = os.path.join(val, 'command.com') except KeyboardInterrupt: raise except: pass # For the special case of not having access to the registry, we # use a temporary path and pathext to attempt to find the command # interpreter. If we fail, we try to find the interpreter through # the env's PATH. The problem with that is that it might not # contain an ENV and a PATH. if not cmd_interp: systemroot = get_system_root() tmp_path = systemroot + os.pathsep + \ os.path.join(systemroot,'System32') tmp_pathext = '.com;.exe;.bat;.cmd' if 'PATHEXT' in os.environ: tmp_pathext = os.environ['PATHEXT'] cmd_interp = SCons.Util.WhereIs('cmd', tmp_path, tmp_pathext) if not cmd_interp: cmd_interp = SCons.Util.WhereIs('command', tmp_path, tmp_pathext) if not cmd_interp: cmd_interp = env.Detect('cmd') if not cmd_interp: cmd_interp = env.Detect('command') if 'ENV' not in env: env['ENV'] = {} # Import things from the external environment to the construction # environment's ENV. This is a potential slippery slope, because we # *don't* want to make builds dependent on the user's environment by # default. We're doing this for SystemRoot, though, because it's # needed for anything that uses sockets, and seldom changes, and # for SystemDrive because it's related. # # Weigh the impact carefully before adding other variables to this list. import_env = ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP' ] for var in import_env: v = os.environ.get(var) if v: env['ENV'][var] = v if 'COMSPEC' not in env['ENV']: v = os.environ.get("COMSPEC") if v: env['ENV']['COMSPEC'] = v env.AppendENVPath('PATH', get_system_root() + '\System32') env['ENV']['PATHEXT'] = '.COM;.EXE;.BAT;.CMD' env['OBJPREFIX'] = '' env['OBJSUFFIX'] = '.obj' env['SHOBJPREFIX'] = '$OBJPREFIX' env['SHOBJSUFFIX'] = '$OBJSUFFIX' env['PROGPREFIX'] = '' env['PROGSUFFIX'] = '.exe' env['LIBPREFIX'] = '' env['LIBSUFFIX'] = '.lib' env['SHLIBPREFIX'] = '' env['SHLIBSUFFIX'] = '.dll' env['LIBPREFIXES'] = [ '$LIBPREFIX' ] env['LIBSUFFIXES'] = [ '$LIBSUFFIX' ] env['PSPAWN'] = piped_spawn env['SPAWN'] = spawn env['SHELL'] = cmd_interp env['TEMPFILE'] = TempFileMunge env['TEMPFILEPREFIX'] = '@' env['MAXLINELENGTH'] = 2048 env['ESCAPE'] = escape env['HOST_OS'] = 'win32' env['HOST_ARCH'] = get_architecture().arch # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Platform/hpux.py0000664000175000017500000000333313160023041021657 0ustar bdbaddogbdbaddog"""engine.SCons.Platform.hpux Platform-specific initialization for HP-UX systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Platform/hpux.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" from . import posix def generate(env): posix.generate(env) #Based on HP-UX11i: ARG_MAX=2048000 - 3000 for environment expansion env['MAXLINELENGTH'] = 2045000 # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/ErrorsTests.py0000664000175000017500000000762513160023041021416 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/ErrorsTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import sys import unittest import TestUnit import SCons.Errors class ErrorsTestCase(unittest.TestCase): def test_BuildError(self): """Test the BuildError exception.""" try: raise SCons.Errors.BuildError( errstr = "foo", status=57, filename="file", exc_info=(1,2,3), node = "n", executor="e", action="a", command="c") except SCons.Errors.BuildError as e: assert e.errstr == "foo" assert e.status == 57 assert e.exitstatus == 2, e.exitstatus assert e.filename == "file" assert e.exc_info == (1,2,3) assert e.node == "n" assert e.executor == "e" assert e.action == "a" assert e.command == "c" try: raise SCons.Errors.BuildError("n", "foo", 57, 3, "file", "e", "a", "c", (1,2,3)) except SCons.Errors.BuildError as e: assert e.errstr == "foo", e.errstr assert e.status == 57, e.status assert e.exitstatus == 3, e.exitstatus assert e.filename == "file", e.filename assert e.exc_info == (1,2,3), e.exc_info assert e.node == "n" assert e.executor == "e" assert e.action == "a" assert e.command == "c" try: raise SCons.Errors.BuildError() except SCons.Errors.BuildError as e: assert e.errstr == "Unknown error" assert e.status == 2 assert e.exitstatus == 2 assert e.filename is None assert e.exc_info == (None, None, None) assert e.node is None assert e.executor is None assert e.action is None assert e.command is None def test_InternalError(self): """Test the InternalError exception.""" try: raise SCons.Errors.InternalError("test internal error") except SCons.Errors.InternalError as e: assert e.args == ("test internal error",) def test_UserError(self): """Test the UserError exception.""" try: raise SCons.Errors.UserError("test user error") except SCons.Errors.UserError as e: assert e.args == ("test user error",) def test_ExplicitExit(self): """Test the ExplicitExit exception.""" try: raise SCons.Errors.ExplicitExit("node") except SCons.Errors.ExplicitExit as e: assert e.node == "node" if __name__ == "__main__": suite = unittest.makeSuite(ErrorsTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/PathList.py0000664000175000017500000002022613160023041020637 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/PathList.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """SCons.PathList A module for handling lists of directory paths (the sort of things that get set as CPPPATH, LIBPATH, etc.) with as much caching of data and efficiency as we can, while still keeping the evaluation delayed so that we Do the Right Thing (almost) regardless of how the variable is specified. """ import os import SCons.Memoize import SCons.Node import SCons.Util # # Variables to specify the different types of entries in a PathList object: # TYPE_STRING_NO_SUBST = 0 # string with no '$' TYPE_STRING_SUBST = 1 # string containing '$' TYPE_OBJECT = 2 # other object def node_conv(obj): """ This is the "string conversion" routine that we have our substitutions use to return Nodes, not strings. This relies on the fact that an EntryProxy object has a get() method that returns the underlying Node that it wraps, which is a bit of architectural dependence that we might need to break or modify in the future in response to additional requirements. """ try: get = obj.get except AttributeError: if isinstance(obj, SCons.Node.Node) or SCons.Util.is_Sequence( obj ): result = obj else: result = str(obj) else: result = get() return result class _PathList(object): """ An actual PathList object. """ def __init__(self, pathlist): """ Initializes a PathList object, canonicalizing the input and pre-processing it for quicker substitution later. The stored representation of the PathList is a list of tuples containing (type, value), where the "type" is one of the TYPE_* variables defined above. We distinguish between: strings that contain no '$' and therefore need no delayed-evaluation string substitution (we expect that there will be many of these and that we therefore get a pretty big win from avoiding string substitution) strings that contain '$' and therefore need substitution (the hard case is things like '${TARGET.dir}/include', which require re-evaluation for every target + source) other objects (which may be something like an EntryProxy that needs a method called to return a Node) Pre-identifying the type of each element in the PathList up-front and storing the type in the list of tuples is intended to reduce the amount of calculation when we actually do the substitution over and over for each target. """ if SCons.Util.is_String(pathlist): pathlist = pathlist.split(os.pathsep) elif not SCons.Util.is_Sequence(pathlist): pathlist = [pathlist] pl = [] for p in pathlist: try: found = '$' in p except (AttributeError, TypeError): type = TYPE_OBJECT else: if not found: type = TYPE_STRING_NO_SUBST else: type = TYPE_STRING_SUBST pl.append((type, p)) self.pathlist = tuple(pl) def __len__(self): return len(self.pathlist) def __getitem__(self, i): return self.pathlist[i] def subst_path(self, env, target, source): """ Performs construction variable substitution on a pre-digested PathList for a specific target and source. """ result = [] for type, value in self.pathlist: if type == TYPE_STRING_SUBST: value = env.subst(value, target=target, source=source, conv=node_conv) if SCons.Util.is_Sequence(value): result.extend(SCons.Util.flatten(value)) elif value: result.append(value) elif type == TYPE_OBJECT: value = node_conv(value) if value: result.append(value) elif value: result.append(value) return tuple(result) class PathListCache(object): """ A class to handle caching of PathList lookups. This class gets instantiated once and then deleted from the namespace, so it's used as a Singleton (although we don't enforce that in the usual Pythonic ways). We could have just made the cache a dictionary in the module namespace, but putting it in this class allows us to use the same Memoizer pattern that we use elsewhere to count cache hits and misses, which is very valuable. Lookup keys in the cache are computed by the _PathList_key() method. Cache lookup should be quick, so we don't spend cycles canonicalizing all forms of the same lookup key. For example, 'x:y' and ['x', 'y'] logically represent the same list, but we don't bother to split string representations and treat those two equivalently. (Note, however, that we do, treat lists and tuples the same.) The main type of duplication we're trying to catch will come from looking up the same path list from two different clones of the same construction environment. That is, given env2 = env1.Clone() both env1 and env2 will have the same CPPPATH value, and we can cheaply avoid re-parsing both values of CPPPATH by using the common value from this cache. """ def __init__(self): self._memo = {} def _PathList_key(self, pathlist): """ Returns the key for memoization of PathLists. Note that we want this to be pretty quick, so we don't completely canonicalize all forms of the same list. For example, 'dir1:$ROOT/dir2' and ['$ROOT/dir1', 'dir'] may logically represent the same list if you're executing from $ROOT, but we're not going to bother splitting strings into path elements, or massaging strings into Nodes, to identify that equivalence. We just want to eliminate obvious redundancy from the normal case of re-using exactly the same cloned value for a path. """ if SCons.Util.is_Sequence(pathlist): pathlist = tuple(SCons.Util.flatten(pathlist)) return pathlist @SCons.Memoize.CountDictCall(_PathList_key) def PathList(self, pathlist): """ Returns the cached _PathList object for the specified pathlist, creating and caching a new object as necessary. """ pathlist = self._PathList_key(pathlist) try: memo_dict = self._memo['PathList'] except KeyError: memo_dict = {} self._memo['PathList'] = memo_dict else: try: return memo_dict[pathlist] except KeyError: pass result = _PathList(pathlist) memo_dict[pathlist] = result return result PathList = PathListCache().PathList del PathListCache # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Builder.py0000664000175000017500000010254213160023040020476 0ustar bdbaddogbdbaddog""" SCons.Builder Builder object subsystem. A Builder object is a callable that encapsulates information about how to execute actions to create a target Node (file) from source Nodes (files), and how to create those dependencies for tracking. The main entry point here is the Builder() factory method. This provides a procedural interface that creates the right underlying Builder object based on the keyword arguments supplied and the types of the arguments. The goal is for this external interface to be simple enough that the vast majority of users can create new Builders as necessary to support building new types of files in their configurations, without having to dive any deeper into this subsystem. The base class here is BuilderBase. This is a concrete base class which does, in fact, represent the Builder objects that we (or users) create. There is also a proxy that looks like a Builder: CompositeBuilder This proxies for a Builder with an action that is actually a dictionary that knows how to map file suffixes to a specific action. This is so that we can invoke different actions (compilers, compile options) for different flavors of source files. Builders and their proxies have the following public interface methods used by other modules: - __call__() THE public interface. Calling a Builder object (with the use of internal helper methods) sets up the target and source dependencies, appropriate mapping to a specific action, and the environment manipulation necessary for overridden construction variable. This also takes care of warning about possible mistakes in keyword arguments. - add_emitter() Adds an emitter for a specific file suffix, used by some Tool modules to specify that (for example) a yacc invocation on a .y can create a .h *and* a .c file. - add_action() Adds an action for a specific file suffix, heavily used by Tool modules to add their specific action(s) for turning a source file into an object file to the global static and shared object file Builders. There are the following methods for internal use within this module: - _execute() The internal method that handles the heavily lifting when a Builder is called. This is used so that the __call__() methods can set up warning about possible mistakes in keyword-argument overrides, and *then* execute all of the steps necessary so that the warnings only occur once. - get_name() Returns the Builder's name within a specific Environment, primarily used to try to return helpful information in error messages. - adjust_suffix() - get_prefix() - get_suffix() - get_src_suffix() - set_src_suffix() Miscellaneous stuff for handling the prefix and suffix manipulation we use in turning source file names into target file names. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Builder.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import collections import SCons.Action import SCons.Debug from SCons.Debug import logInstanceCreation from SCons.Errors import InternalError, UserError import SCons.Executor import SCons.Memoize import SCons.Util import SCons.Warnings class _Null(object): pass _null = _Null def match_splitext(path, suffixes = []): if suffixes: matchsuf = [S for S in suffixes if path[-len(S):] == S] if matchsuf: suf = max([(len(_f),_f) for _f in matchsuf])[1] return [path[:-len(suf)], path[-len(suf):]] return SCons.Util.splitext(path) class DictCmdGenerator(SCons.Util.Selector): """This is a callable class that can be used as a command generator function. It holds on to a dictionary mapping file suffixes to Actions. It uses that dictionary to return the proper action based on the file suffix of the source file.""" def __init__(self, dict=None, source_ext_match=1): SCons.Util.Selector.__init__(self, dict) self.source_ext_match = source_ext_match def src_suffixes(self): return list(self.keys()) def add_action(self, suffix, action): """Add a suffix-action pair to the mapping. """ self[suffix] = action def __call__(self, target, source, env, for_signature): if not source: return [] if self.source_ext_match: suffixes = self.src_suffixes() ext = None for src in map(str, source): my_ext = match_splitext(src, suffixes)[1] if ext and my_ext != ext: raise UserError("While building `%s' from `%s': Cannot build multiple sources with different extensions: %s, %s" % (repr(list(map(str, target))), src, ext, my_ext)) ext = my_ext else: ext = match_splitext(str(source[0]), self.src_suffixes())[1] if not ext: #return ext raise UserError("While building `%s': " "Cannot deduce file extension from source files: %s" % (repr(list(map(str, target))), repr(list(map(str, source))))) try: ret = SCons.Util.Selector.__call__(self, env, source, ext) except KeyError as e: raise UserError("Ambiguous suffixes after environment substitution: %s == %s == %s" % (e.args[0], e.args[1], e.args[2])) if ret is None: raise UserError("While building `%s' from `%s': Don't know how to build from a source file with suffix `%s'. Expected a suffix in this list: %s." % \ (repr(list(map(str, target))), repr(list(map(str, source))), ext, repr(list(self.keys())))) return ret class CallableSelector(SCons.Util.Selector): """A callable dictionary that will, in turn, call the value it finds if it can.""" def __call__(self, env, source): value = SCons.Util.Selector.__call__(self, env, source) if callable(value): value = value(env, source) return value class DictEmitter(SCons.Util.Selector): """A callable dictionary that maps file suffixes to emitters. When called, it finds the right emitter in its dictionary for the suffix of the first source file, and calls that emitter to get the right lists of targets and sources to return. If there's no emitter for the suffix in its dictionary, the original target and source are returned. """ def __call__(self, target, source, env): emitter = SCons.Util.Selector.__call__(self, env, source) if emitter: target, source = emitter(target, source, env) return (target, source) class ListEmitter(collections.UserList): """A callable list of emitters that calls each in sequence, returning the result. """ def __call__(self, target, source, env): for e in self.data: target, source = e(target, source, env) return (target, source) # These are a common errors when calling a Builder; # they are similar to the 'target' and 'source' keyword args to builders, # so we issue warnings when we see them. The warnings can, of course, # be disabled. misleading_keywords = { 'targets' : 'target', 'sources' : 'source', } class OverrideWarner(collections.UserDict): """A class for warning about keyword arguments that we use as overrides in a Builder call. This class exists to handle the fact that a single Builder call can actually invoke multiple builders. This class only emits the warnings once, no matter how many Builders are invoked. """ def __init__(self, dict): collections.UserDict.__init__(self, dict) if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.OverrideWarner') self.already_warned = None def warn(self): if self.already_warned: return for k in list(self.keys()): if k in misleading_keywords: alt = misleading_keywords[k] msg = "Did you mean to use `%s' instead of `%s'?" % (alt, k) SCons.Warnings.warn(SCons.Warnings.MisleadingKeywordsWarning, msg) self.already_warned = 1 def Builder(**kw): """A factory for builder objects.""" composite = None if 'generator' in kw: if 'action' in kw: raise UserError("You must not specify both an action and a generator.") kw['action'] = SCons.Action.CommandGeneratorAction(kw['generator'], {}) del kw['generator'] elif 'action' in kw: source_ext_match = kw.get('source_ext_match', 1) if 'source_ext_match' in kw: del kw['source_ext_match'] if SCons.Util.is_Dict(kw['action']): composite = DictCmdGenerator(kw['action'], source_ext_match) kw['action'] = SCons.Action.CommandGeneratorAction(composite, {}) kw['src_suffix'] = composite.src_suffixes() else: kw['action'] = SCons.Action.Action(kw['action']) if 'emitter' in kw: emitter = kw['emitter'] if SCons.Util.is_String(emitter): # This allows users to pass in an Environment # variable reference (like "$FOO") as an emitter. # We will look in that Environment variable for # a callable to use as the actual emitter. var = SCons.Util.get_environment_var(emitter) if not var: raise UserError("Supplied emitter '%s' does not appear to refer to an Environment variable" % emitter) kw['emitter'] = EmitterProxy(var) elif SCons.Util.is_Dict(emitter): kw['emitter'] = DictEmitter(emitter) elif SCons.Util.is_List(emitter): kw['emitter'] = ListEmitter(emitter) result = BuilderBase(**kw) if not composite is None: result = CompositeBuilder(result, composite) return result def _node_errors(builder, env, tlist, slist): """Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate. """ # First, figure out if there are any errors in the way the targets # were specified. for t in tlist: if t.side_effect: raise UserError("Multiple ways to build the same target were specified for: %s" % t) if t.has_explicit_builder(): if not t.env is None and not t.env is env: action = t.builder.action t_contents = t.builder.action.get_contents(tlist, slist, t.env) contents = builder.action.get_contents(tlist, slist, env) if t_contents == contents: msg = "Two different environments were specified for target %s,\n\tbut they appear to have the same action: %s" % (t, action.genstring(tlist, slist, t.env)) SCons.Warnings.warn(SCons.Warnings.DuplicateEnvironmentWarning, msg) else: msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents.decode('utf-8'),contents.decode('utf-8')) raise UserError(msg) if builder.multi: if t.builder != builder: msg = "Two different builders (%s and %s) were specified for the same target: %s" % (t.builder.get_name(env), builder.get_name(env), t) raise UserError(msg) # TODO(batch): list constructed each time! if t.get_executor().get_all_targets() != tlist: msg = "Two different target lists have a target in common: %s (from %s and from %s)" % (t, list(map(str, t.get_executor().get_all_targets())), list(map(str, tlist))) raise UserError(msg) elif t.sources != slist: msg = "Multiple ways to build the same target were specified for: %s (from %s and from %s)" % (t, list(map(str, t.sources)), list(map(str, slist))) raise UserError(msg) if builder.single_source: if len(slist) > 1: raise UserError("More than one source given for single-source builder: targets=%s sources=%s" % (list(map(str,tlist)), list(map(str,slist)))) class EmitterProxy(object): """This is a callable class that can act as a Builder emitter. It holds on to a string that is a key into an Environment dictionary, and will look there at actual build time to see if it holds a callable. If so, we will call that as the actual emitter.""" def __init__(self, var): self.var = SCons.Util.to_String(var) def __call__(self, target, source, env): emitter = self.var # Recursively substitute the variable. # We can't use env.subst() because it deals only # in strings. Maybe we should change that? while SCons.Util.is_String(emitter) and emitter in env: emitter = env[emitter] if callable(emitter): target, source = emitter(target, source, env) elif SCons.Util.is_List(emitter): for e in emitter: target, source = e(target, source, env) return (target, source) def __eq__(self, other): return self.var == other.var def __lt__(self, other): return self.var < other.var class BuilderBase(object): """Base class for Builders, objects that create output nodes (files) from input nodes (files). """ def __init__(self, action = None, prefix = '', suffix = '', src_suffix = '', target_factory = None, source_factory = None, target_scanner = None, source_scanner = None, emitter = None, multi = 0, env = None, single_source = 0, name = None, chdir = _null, is_explicit = 1, src_builder = None, ensure_suffix = False, **overrides): if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.BuilderBase') self._memo = {} self.action = action self.multi = multi if SCons.Util.is_Dict(prefix): prefix = CallableSelector(prefix) self.prefix = prefix if SCons.Util.is_Dict(suffix): suffix = CallableSelector(suffix) self.env = env self.single_source = single_source if 'overrides' in overrides: SCons.Warnings.warn(SCons.Warnings.DeprecatedBuilderKeywordsWarning, "The \"overrides\" keyword to Builder() creation has been deprecated;\n" +\ "\tspecify the items as keyword arguments to the Builder() call instead.") overrides.update(overrides['overrides']) del overrides['overrides'] if 'scanner' in overrides: SCons.Warnings.warn(SCons.Warnings.DeprecatedBuilderKeywordsWarning, "The \"scanner\" keyword to Builder() creation has been deprecated;\n" "\tuse: source_scanner or target_scanner as appropriate.") del overrides['scanner'] self.overrides = overrides self.set_suffix(suffix) self.set_src_suffix(src_suffix) self.ensure_suffix = ensure_suffix self.target_factory = target_factory self.source_factory = source_factory self.target_scanner = target_scanner self.source_scanner = source_scanner self.emitter = emitter # Optional Builder name should only be used for Builders # that don't get attached to construction environments. if name: self.name = name self.executor_kw = {} if not chdir is _null: self.executor_kw['chdir'] = chdir self.is_explicit = is_explicit if src_builder is None: src_builder = [] elif not SCons.Util.is_List(src_builder): src_builder = [ src_builder ] self.src_builder = src_builder def __nonzero__(self): raise InternalError("Do not test for the Node.builder attribute directly; use Node.has_builder() instead") def __bool__(self): return self.__nonzero__() def get_name(self, env): """Attempts to get the name of the Builder. Look at the BUILDERS variable of env, expecting it to be a dictionary containing this Builder, and return the key of the dictionary. If there's no key, then return a directly-configured name (if there is one) or the name of the class (by default).""" try: index = list(env['BUILDERS'].values()).index(self) return list(env['BUILDERS'].keys())[index] except (AttributeError, KeyError, TypeError, ValueError): try: return self.name except AttributeError: return str(self.__class__) def __eq__(self, other): return self.__dict__ == other.__dict__ def splitext(self, path, env=None): if not env: env = self.env if env: suffixes = self.src_suffixes(env) else: suffixes = [] return match_splitext(path, suffixes) def _adjustixes(self, files, pre, suf, ensure_suffix=False): if not files: return [] result = [] if not SCons.Util.is_List(files): files = [files] for f in files: if SCons.Util.is_String(f): f = SCons.Util.adjustixes(f, pre, suf, ensure_suffix) result.append(f) return result def _create_nodes(self, env, target = None, source = None): """Create and return lists of target and source nodes. """ src_suf = self.get_src_suffix(env) target_factory = env.get_factory(self.target_factory) source_factory = env.get_factory(self.source_factory) source = self._adjustixes(source, None, src_suf) slist = env.arg2nodes(source, source_factory) pre = self.get_prefix(env, slist) suf = self.get_suffix(env, slist) if target is None: try: t_from_s = slist[0].target_from_source except AttributeError: raise UserError("Do not know how to create a target from source `%s'" % slist[0]) except IndexError: tlist = [] else: splitext = lambda S: self.splitext(S,env) tlist = [ t_from_s(pre, suf, splitext) ] else: target = self._adjustixes(target, pre, suf, self.ensure_suffix) tlist = env.arg2nodes(target, target_factory, target=target, source=source) if self.emitter: # The emitter is going to do str(node), but because we're # being called *from* a builder invocation, the new targets # don't yet have a builder set on them and will look like # source files. Fool the emitter's str() calls by setting # up a temporary builder on the new targets. new_targets = [] for t in tlist: if not t.is_derived(): t.builder_set(self) new_targets.append(t) orig_tlist = tlist[:] orig_slist = slist[:] target, source = self.emitter(target=tlist, source=slist, env=env) # Now delete the temporary builders that we attached to any # new targets, so that _node_errors() doesn't do weird stuff # to them because it thinks they already have builders. for t in new_targets: if t.builder is self: # Only delete the temporary builder if the emitter # didn't change it on us. t.builder_set(None) # Have to call arg2nodes yet again, since it is legal for # emitters to spit out strings as well as Node instances. tlist = env.arg2nodes(target, target_factory, target=orig_tlist, source=orig_slist) slist = env.arg2nodes(source, source_factory, target=orig_tlist, source=orig_slist) return tlist, slist def _execute(self, env, target, source, overwarn={}, executor_kw={}): # We now assume that target and source are lists or None. if self.src_builder: source = self.src_builder_sources(env, source, overwarn) if self.single_source and len(source) > 1 and target is None: result = [] if target is None: target = [None]*len(source) for tgt, src in zip(target, source): if not tgt is None: tgt = [tgt] if not src is None: src = [src] result.extend(self._execute(env, tgt, src, overwarn)) return SCons.Node.NodeList(result) overwarn.warn() tlist, slist = self._create_nodes(env, target, source) # Check for errors with the specified target/source lists. _node_errors(self, env, tlist, slist) # The targets are fine, so find or make the appropriate Executor to # build this particular list of targets from this particular list of # sources. executor = None key = None if self.multi: try: executor = tlist[0].get_executor(create = 0) except (AttributeError, IndexError): pass else: executor.add_sources(slist) if executor is None: if not self.action: fmt = "Builder %s must have an action to build %s." raise UserError(fmt % (self.get_name(env or self.env), list(map(str,tlist)))) key = self.action.batch_key(env or self.env, tlist, slist) if key: try: executor = SCons.Executor.GetBatchExecutor(key) except KeyError: pass else: executor.add_batch(tlist, slist) if executor is None: executor = SCons.Executor.Executor(self.action, env, [], tlist, slist, executor_kw) if key: SCons.Executor.AddBatchExecutor(key, executor) # Now set up the relevant information in the target Nodes themselves. for t in tlist: t.cwd = env.fs.getcwd() t.builder_set(self) t.env_set(env) t.add_source(slist) t.set_executor(executor) t.set_explicit(self.is_explicit) return SCons.Node.NodeList(tlist) def __call__(self, env, target=None, source=None, chdir=_null, **kw): # We now assume that target and source are lists or None. # The caller (typically Environment.BuilderWrapper) is # responsible for converting any scalar values to lists. if chdir is _null: ekw = self.executor_kw else: ekw = self.executor_kw.copy() ekw['chdir'] = chdir if 'chdir' in ekw and SCons.Util.is_String(ekw['chdir']): ekw['chdir'] = env.subst(ekw['chdir']) if kw: if 'srcdir' in kw: def prependDirIfRelative(f, srcdir=kw['srcdir']): import os.path if SCons.Util.is_String(f) and not os.path.isabs(f): f = os.path.join(srcdir, f) return f if not SCons.Util.is_List(source): source = [source] source = list(map(prependDirIfRelative, source)) del kw['srcdir'] if self.overrides: env_kw = self.overrides.copy() env_kw.update(kw) else: env_kw = kw else: env_kw = self.overrides env = env.Override(env_kw) return self._execute(env, target, source, OverrideWarner(kw), ekw) def adjust_suffix(self, suff): if suff and not suff[0] in [ '.', '_', '$' ]: return '.' + suff return suff def get_prefix(self, env, sources=[]): prefix = self.prefix if callable(prefix): prefix = prefix(env, sources) return env.subst(prefix) def set_suffix(self, suffix): if not callable(suffix): suffix = self.adjust_suffix(suffix) self.suffix = suffix def get_suffix(self, env, sources=[]): suffix = self.suffix if callable(suffix): suffix = suffix(env, sources) return env.subst(suffix) def set_src_suffix(self, src_suffix): if not src_suffix: src_suffix = [] elif not SCons.Util.is_List(src_suffix): src_suffix = [ src_suffix ] self.src_suffix = [callable(suf) and suf or self.adjust_suffix(suf) for suf in src_suffix] def get_src_suffix(self, env): """Get the first src_suffix in the list of src_suffixes.""" ret = self.src_suffixes(env) if not ret: return '' return ret[0] def add_emitter(self, suffix, emitter): """Add a suffix-emitter mapping to this Builder. This assumes that emitter has been initialized with an appropriate dictionary type, and will throw a TypeError if not, so the caller is responsible for knowing that this is an appropriate method to call for the Builder in question. """ self.emitter[suffix] = emitter def add_src_builder(self, builder): """ Add a new Builder to the list of src_builders. This requires wiping out cached values so that the computed lists of source suffixes get re-calculated. """ self._memo = {} self.src_builder.append(builder) def _get_sdict(self, env): """ Returns a dictionary mapping all of the source suffixes of all src_builders of this Builder to the underlying Builder that should be called first. This dictionary is used for each target specified, so we save a lot of extra computation by memoizing it for each construction environment. Note that this is re-computed each time, not cached, because there might be changes to one of our source Builders (or one of their source Builders, and so on, and so on...) that we can't "see." The underlying methods we call cache their computed values, though, so we hope repeatedly aggregating them into a dictionary like this won't be too big a hit. We may need to look for a better way to do this if performance data show this has turned into a significant bottleneck. """ sdict = {} for bld in self.get_src_builders(env): for suf in bld.src_suffixes(env): sdict[suf] = bld return sdict def src_builder_sources(self, env, source, overwarn={}): sdict = self._get_sdict(env) src_suffixes = self.src_suffixes(env) lengths = list(set(map(len, src_suffixes))) def match_src_suffix(name, src_suffixes=src_suffixes, lengths=lengths): node_suffixes = [name[-l:] for l in lengths] for suf in src_suffixes: if suf in node_suffixes: return suf return None result = [] for s in SCons.Util.flatten(source): if SCons.Util.is_String(s): match_suffix = match_src_suffix(env.subst(s)) if not match_suffix and not '.' in s: src_suf = self.get_src_suffix(env) s = self._adjustixes(s, None, src_suf)[0] else: match_suffix = match_src_suffix(s.name) if match_suffix: try: bld = sdict[match_suffix] except KeyError: result.append(s) else: tlist = bld._execute(env, None, [s], overwarn) # If the subsidiary Builder returned more than one # target, then filter out any sources that this # Builder isn't capable of building. if len(tlist) > 1: tlist = [t for t in tlist if match_src_suffix(t.name)] result.extend(tlist) else: result.append(s) source_factory = env.get_factory(self.source_factory) return env.arg2nodes(result, source_factory) def _get_src_builders_key(self, env): return id(env) @SCons.Memoize.CountDictCall(_get_src_builders_key) def get_src_builders(self, env): """ Returns the list of source Builders for this Builder. This exists mainly to look up Builders referenced as strings in the 'BUILDER' variable of the construction environment and cache the result. """ memo_key = id(env) try: memo_dict = self._memo['get_src_builders'] except KeyError: memo_dict = {} self._memo['get_src_builders'] = memo_dict else: try: return memo_dict[memo_key] except KeyError: pass builders = [] for bld in self.src_builder: if SCons.Util.is_String(bld): try: bld = env['BUILDERS'][bld] except KeyError: continue builders.append(bld) memo_dict[memo_key] = builders return builders def _subst_src_suffixes_key(self, env): return id(env) @SCons.Memoize.CountDictCall(_subst_src_suffixes_key) def subst_src_suffixes(self, env): """ The suffix list may contain construction variable expansions, so we have to evaluate the individual strings. To avoid doing this over and over, we memoize the results for each construction environment. """ memo_key = id(env) try: memo_dict = self._memo['subst_src_suffixes'] except KeyError: memo_dict = {} self._memo['subst_src_suffixes'] = memo_dict else: try: return memo_dict[memo_key] except KeyError: pass suffixes = [env.subst(x) for x in self.src_suffix] memo_dict[memo_key] = suffixes return suffixes def src_suffixes(self, env): """ Returns the list of source suffixes for all src_builders of this Builder. This is essentially a recursive descent of the src_builder "tree." (This value isn't cached because there may be changes in a src_builder many levels deep that we can't see.) """ sdict = {} suffixes = self.subst_src_suffixes(env) for s in suffixes: sdict[s] = 1 for builder in self.get_src_builders(env): for s in builder.src_suffixes(env): if s not in sdict: sdict[s] = 1 suffixes.append(s) return suffixes class CompositeBuilder(SCons.Util.Proxy): """A Builder Proxy whose main purpose is to always have a DictCmdGenerator as its action, and to provide access to the DictCmdGenerator's add_action() method. """ def __init__(self, builder, cmdgen): if SCons.Debug.track_instances: logInstanceCreation(self, 'Builder.CompositeBuilder') SCons.Util.Proxy.__init__(self, builder) # cmdgen should always be an instance of DictCmdGenerator. self.cmdgen = cmdgen self.builder = builder __call__ = SCons.Util.Delegate('__call__') def add_action(self, suffix, action): self.cmdgen.add_action(suffix, action) self.set_src_suffix(self.cmdgen.src_suffixes()) def is_a_Builder(obj): """"Returns True if the specified obj is one of our Builder classes. The test is complicated a bit by the fact that CompositeBuilder is a proxy, not a subclass of BuilderBase. """ return (isinstance(obj, BuilderBase) or isinstance(obj, CompositeBuilder) or callable(obj)) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/EnvironmentValuesTest.py0000664000175000017500000000060113160023041023426 0ustar bdbaddogbdbaddogimport unittest from SCons.EnvironmentValues import EnvironmentValues class MyTestCase(unittest.TestCase): def test_simple_environmentValues(self): """Test comparing SubstitutionEnvironments """ env1 = EnvironmentValues(XXX='x') env2 = EnvironmentValues(XXX='x',XX="$X", X1="${X}", X2="$($X$)") if __name__ == '__main__': unittest.main() scons-src-3.0.0/src/engine/SCons/CacheDir.py0000664000175000017500000002563713160023040020563 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/CacheDir.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" __doc__ = """ CacheDir support """ import json import os import stat import sys import SCons.Action import SCons.Warnings cache_enabled = True cache_debug = False cache_force = False cache_show = False cache_readonly = False def CacheRetrieveFunc(target, source, env): t = target[0] fs = t.fs cd = env.get_CacheDir() cachedir, cachefile = cd.cachepath(t) if not fs.exists(cachefile): cd.CacheDebug('CacheRetrieve(%s): %s not in cache\n', t, cachefile) return 1 cd.CacheDebug('CacheRetrieve(%s): retrieving from %s\n', t, cachefile) if SCons.Action.execute_actions: if fs.islink(cachefile): fs.symlink(fs.readlink(cachefile), t.get_internal_path()) else: env.copy_from_cache(cachefile, t.get_internal_path()) st = fs.stat(cachefile) fs.chmod(t.get_internal_path(), stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) return 0 def CacheRetrieveString(target, source, env): t = target[0] fs = t.fs cd = env.get_CacheDir() cachedir, cachefile = cd.cachepath(t) if t.fs.exists(cachefile): return "Retrieved `%s' from cache" % t.get_internal_path() return None CacheRetrieve = SCons.Action.Action(CacheRetrieveFunc, CacheRetrieveString) CacheRetrieveSilent = SCons.Action.Action(CacheRetrieveFunc, None) def CachePushFunc(target, source, env): if cache_readonly: return t = target[0] if t.nocache: return fs = t.fs cd = env.get_CacheDir() cachedir, cachefile = cd.cachepath(t) if fs.exists(cachefile): # Don't bother copying it if it's already there. Note that # usually this "shouldn't happen" because if the file already # existed in cache, we'd have retrieved the file from there, # not built it. This can happen, though, in a race, if some # other person running the same build pushes their copy to # the cache after we decide we need to build it but before our # build completes. cd.CacheDebug('CachePush(%s): %s already exists in cache\n', t, cachefile) return cd.CacheDebug('CachePush(%s): pushing to %s\n', t, cachefile) tempfile = cachefile+'.tmp'+str(os.getpid()) errfmt = "Unable to copy %s to cache. Cache file is %s" if not fs.isdir(cachedir): try: fs.makedirs(cachedir) except EnvironmentError: # We may have received an exception because another process # has beaten us creating the directory. if not fs.isdir(cachedir): msg = errfmt % (str(target), cachefile) raise SCons.Errors.EnvironmentError(msg) try: if fs.islink(t.get_internal_path()): fs.symlink(fs.readlink(t.get_internal_path()), tempfile) else: fs.copy2(t.get_internal_path(), tempfile) fs.rename(tempfile, cachefile) st = fs.stat(t.get_internal_path()) fs.chmod(cachefile, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) except EnvironmentError: # It's possible someone else tried writing the file at the # same time we did, or else that there was some problem like # the CacheDir being on a separate file system that's full. # In any case, inability to push a file to cache doesn't affect # the correctness of the build, so just print a warning. msg = errfmt % (str(target), cachefile) SCons.Warnings.warn(SCons.Warnings.CacheWriteErrorWarning, msg) CachePush = SCons.Action.Action(CachePushFunc, None) # Nasty hack to cut down to one warning for each cachedir path that needs # upgrading. warned = dict() class CacheDir(object): def __init__(self, path): try: import hashlib except ImportError: msg = "No hashlib or MD5 module available, CacheDir() not supported" SCons.Warnings.warn(SCons.Warnings.NoMD5ModuleWarning, msg) path = None self.path = path self.current_cache_debug = None self.debugFP = None self.config = dict() if path is None: return # See if there's a config file in the cache directory. If there is, # use it. If there isn't, and the directory exists and isn't empty, # produce a warning. If the directory doesn't exist or is empty, # write a config file. config_file = os.path.join(path, 'config') if not os.path.exists(config_file): # A note: There is a race hazard here, if two processes start and # attempt to create the cache directory at the same time. However, # python doesn't really give you the option to do exclusive file # creation (it doesn't even give you the option to error on opening # an existing file for writing...). The ordering of events here # as an attempt to alleviate this, on the basis that it's a pretty # unlikely occurence (it'd require two builds with a brand new cache # directory) if os.path.isdir(path) and len(os.listdir(path)) != 0: self.config['prefix_len'] = 1 # When building the project I was testing this on, the warning # was output over 20 times. That seems excessive global warned if self.path not in warned: msg = "Please upgrade your cache by running " +\ " scons-configure-cache.py " + self.path SCons.Warnings.warn(SCons.Warnings.CacheVersionWarning, msg) warned[self.path] = True else: if not os.path.isdir(path): try: os.makedirs(path) except OSError: # If someone else is trying to create the directory at # the same time as me, bad things will happen msg = "Failed to create cache directory " + path raise SCons.Errors.EnvironmentError(msg) self.config['prefix_len'] = 2 if not os.path.exists(config_file): try: with open(config_file, 'w') as config: json.dump(self.config, config) except: msg = "Failed to write cache configuration for " + path raise SCons.Errors.EnvironmentError(msg) else: try: with open(config_file) as config: self.config = json.load(config) except ValueError: msg = "Failed to read cache configuration for " + path raise SCons.Errors.EnvironmentError(msg) def CacheDebug(self, fmt, target, cachefile): if cache_debug != self.current_cache_debug: if cache_debug == '-': self.debugFP = sys.stdout elif cache_debug: self.debugFP = open(cache_debug, 'w') else: self.debugFP = None self.current_cache_debug = cache_debug if self.debugFP: self.debugFP.write(fmt % (target, os.path.split(cachefile)[1])) def is_enabled(self): return cache_enabled and not self.path is None def is_readonly(self): return cache_readonly def cachepath(self, node): """ """ if not self.is_enabled(): return None, None sig = node.get_cachedir_bsig() subdir = sig[:self.config['prefix_len']].upper() dir = os.path.join(self.path, subdir) return dir, os.path.join(dir, sig) def retrieve(self, node): """ This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in built(). Note that there's a special trick here with the execute flag (one that's not normally done for other actions). Basically if the user requested a no_exec (-n) build, then SCons.Action.execute_actions is set to 0 and when any action is called, it does its showing but then just returns zero instead of actually calling the action execution operation. The problem for caching is that if the file does NOT exist in cache then the CacheRetrieveString won't return anything to show for the task, but the Action.__call__ won't call CacheRetrieveFunc; instead it just returns zero, which makes the code below think that the file *was* successfully retrieved from the cache, therefore it doesn't do any subsequent building. However, the CacheRetrieveString didn't print anything because it didn't actually exist in the cache, and no more build actions will be performed, so the user just sees nothing. The fix is to tell Action.__call__ to always execute the CacheRetrieveFunc and then have the latter explicitly check SCons.Action.execute_actions itself. """ if not self.is_enabled(): return False env = node.get_build_env() if cache_show: if CacheRetrieveSilent(node, [], env, execute=1) == 0: node.build(presub=0, execute=0) return True else: if CacheRetrieve(node, [], env, execute=1) == 0: return True return False def push(self, node): if self.is_readonly() or not self.is_enabled(): return return CachePush(node, [], node.get_build_env()) def push_if_forced(self, node): if cache_force: return self.push(node) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/TaskmasterTests.py0000664000175000017500000011143713160023041022255 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import division __revision__ = "src/engine/SCons/TaskmasterTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import copy import sys import unittest import TestUnit import SCons.Taskmaster import SCons.Errors built_text = None cache_text = [] visited_nodes = [] executed = None scan_called = 0 class Node(object): def __init__(self, name, kids = [], scans = []): self.name = name self.kids = kids self.scans = scans self.cached = 0 self.scanned = 0 self.scanner = None self.targets = [self] self.prerequisites = None class Builder(object): def targets(self, node): return node.targets self.builder = Builder() self.bsig = None self.csig = None self.state = SCons.Node.no_state self.prepared = None self.ref_count = 0 self.waiting_parents = set() self.waiting_s_e = set() self.side_effect = 0 self.side_effects = [] self.alttargets = [] self.postprocessed = None self._bsig_val = None self._current_val = 0 self.always_build = None def disambiguate(self): return self def push_to_cache(self): pass def retrieve_from_cache(self): global cache_text if self.cached: cache_text.append(self.name + " retrieved") return self.cached def make_ready(self): pass def prepare(self): self.prepared = 1 self.get_binfo() def build(self): global built_text built_text = self.name + " built" def remove(self): pass # The following four methods new_binfo(), del_binfo(), # get_binfo(), clear() as well as its calls have been added # to support the cached_execute() test (issue #2720). # They are full copies (or snippets) of their actual # counterparts in the Node class... def new_binfo(self): binfo = "binfo" return binfo def del_binfo(self): """Delete the build info from this node.""" try: delattr(self, 'binfo') except AttributeError: pass def get_binfo(self): """Fetch a node's build information.""" try: return self.binfo except AttributeError: pass binfo = self.new_binfo() self.binfo = binfo return binfo def clear(self): # The del_binfo() call here isn't necessary for normal execution, # but is for interactive mode, where we might rebuild the same # target and need to start from scratch. self.del_binfo() def built(self): global built_text if not self.cached: built_text = built_text + " really" # Clear the implicit dependency caches of any Nodes # waiting for this Node to be built. for parent in self.waiting_parents: parent.implicit = None self.clear() def release_target_info(self): pass def has_builder(self): return not self.builder is None def is_derived(self): return self.has_builder or self.side_effect def alter_targets(self): return self.alttargets, None def visited(self): global visited_nodes visited_nodes.append(self.name) def children(self): if not self.scanned: self.scan() self.scanned = 1 return self.kids def scan(self): global scan_called scan_called = scan_called + 1 self.kids = self.kids + self.scans self.scans = [] def scanner_key(self): return self.name def add_to_waiting_parents(self, node): wp = self.waiting_parents if node in wp: return 0 wp.add(node) return 1 def get_state(self): return self.state def set_state(self, state): self.state = state def set_bsig(self, bsig): self.bsig = bsig def set_csig(self, csig): self.csig = csig def store_csig(self): pass def store_bsig(self): pass def is_pseudo_derived(self): pass def is_up_to_date(self): return self._current_val def depends_on(self, nodes): for node in nodes: if node in self.kids: return 1 return 0 def __str__(self): return self.name def postprocess(self): self.postprocessed = 1 self.waiting_parents = set() def get_executor(self): if not hasattr(self, 'executor'): class Executor(object): def prepare(self): pass def get_action_targets(self): return self.targets def get_all_targets(self): return self.targets def get_all_children(self): result = [] for node in self.targets: result.extend(node.children()) return result def get_all_prerequisites(self): return [] def get_action_side_effects(self): return [] self.executor = Executor() self.executor.targets = self.targets return self.executor class OtherError(Exception): pass class MyException(Exception): pass class TaskmasterTestCase(unittest.TestCase): def test_next_task(self): """Test fetching the next task """ global built_text n1 = Node("n1") tm = SCons.Taskmaster.Taskmaster([n1, n1]) t = tm.next_task() t.prepare() t.execute() t = tm.next_task() assert t is None n1 = Node("n1") n2 = Node("n2") n3 = Node("n3", [n1, n2]) tm = SCons.Taskmaster.Taskmaster([n3]) t = tm.next_task() t.prepare() t.execute() assert built_text == "n1 built", built_text t.executed() t.postprocess() t = tm.next_task() t.prepare() t.execute() assert built_text == "n2 built", built_text t.executed() t.postprocess() t = tm.next_task() t.prepare() t.execute() assert built_text == "n3 built", built_text t.executed() t.postprocess() assert tm.next_task() is None built_text = "up to date: " top_node = n3 class MyTask(SCons.Taskmaster.Task): def execute(self): global built_text if self.targets[0].get_state() == SCons.Node.up_to_date: if self.top: built_text = self.targets[0].name + " up-to-date top" else: built_text = self.targets[0].name + " up-to-date" else: self.targets[0].build() n1.set_state(SCons.Node.no_state) n1._current_val = 1 n2.set_state(SCons.Node.no_state) n2._current_val = 1 n3.set_state(SCons.Node.no_state) n3._current_val = 1 tm = SCons.Taskmaster.Taskmaster(targets = [n3], tasker = MyTask) t = tm.next_task() t.prepare() t.execute() assert built_text == "n1 up-to-date", built_text t.executed() t.postprocess() t = tm.next_task() t.prepare() t.execute() assert built_text == "n2 up-to-date", built_text t.executed() t.postprocess() t = tm.next_task() t.prepare() t.execute() assert built_text == "n3 up-to-date top", built_text t.executed() t.postprocess() assert tm.next_task() is None n1 = Node("n1") n2 = Node("n2") n3 = Node("n3", [n1, n2]) n4 = Node("n4") n5 = Node("n5", [n3, n4]) tm = SCons.Taskmaster.Taskmaster([n5]) t1 = tm.next_task() assert t1.get_target() == n1 t2 = tm.next_task() assert t2.get_target() == n2 t4 = tm.next_task() assert t4.get_target() == n4 t4.executed() t4.postprocess() t1.executed() t1.postprocess() t2.executed() t2.postprocess() t3 = tm.next_task() assert t3.get_target() == n3 t3.executed() t3.postprocess() t5 = tm.next_task() assert t5.get_target() == n5, t5.get_target() t5.executed() t5.postprocess() assert tm.next_task() is None n4 = Node("n4") n4.set_state(SCons.Node.executed) tm = SCons.Taskmaster.Taskmaster([n4]) assert tm.next_task() is None n1 = Node("n1") n2 = Node("n2", [n1]) tm = SCons.Taskmaster.Taskmaster([n2,n2]) t = tm.next_task() t.executed() t.postprocess() t = tm.next_task() assert tm.next_task() is None n1 = Node("n1") n2 = Node("n2") n3 = Node("n3", [n1], [n2]) tm = SCons.Taskmaster.Taskmaster([n3]) t = tm.next_task() target = t.get_target() assert target == n1, target t.executed() t.postprocess() t = tm.next_task() target = t.get_target() assert target == n2, target t.executed() t.postprocess() t = tm.next_task() target = t.get_target() assert target == n3, target t.executed() t.postprocess() assert tm.next_task() is None n1 = Node("n1") n2 = Node("n2") n3 = Node("n3", [n1, n2]) n4 = Node("n4", [n3]) n5 = Node("n5", [n3]) global scan_called scan_called = 0 tm = SCons.Taskmaster.Taskmaster([n4]) t = tm.next_task() assert t.get_target() == n1 t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n2 t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n3 t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n4 t.executed() t.postprocess() assert tm.next_task() is None assert scan_called == 4, scan_called tm = SCons.Taskmaster.Taskmaster([n5]) t = tm.next_task() assert t.get_target() == n5, t.get_target() t.executed() assert tm.next_task() is None assert scan_called == 5, scan_called n1 = Node("n1") n2 = Node("n2") n3 = Node("n3") n4 = Node("n4", [n1,n2,n3]) n5 = Node("n5", [n4]) n3.side_effect = 1 n1.side_effects = n2.side_effects = n3.side_effects = [n4] tm = SCons.Taskmaster.Taskmaster([n1,n2,n3,n4,n5]) t = tm.next_task() assert t.get_target() == n1 assert n4.state == SCons.Node.executing, n4.state t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n2 t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n3 t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n4 t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n5 assert not tm.next_task() t.executed() t.postprocess() n1 = Node("n1") n2 = Node("n2") n3 = Node("n3") n4 = Node("n4", [n1,n2,n3]) def reverse(dependencies): dependencies.reverse() return dependencies tm = SCons.Taskmaster.Taskmaster([n4], order=reverse) t = tm.next_task() assert t.get_target() == n3, t.get_target() t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n2, t.get_target() t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n1, t.get_target() t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n4, t.get_target() t.executed() t.postprocess() n5 = Node("n5") n6 = Node("n6") n7 = Node("n7") n6.alttargets = [n7] tm = SCons.Taskmaster.Taskmaster([n5]) t = tm.next_task() assert t.get_target() == n5 t.executed() t.postprocess() tm = SCons.Taskmaster.Taskmaster([n6]) t = tm.next_task() assert t.get_target() == n7 t.executed() t.postprocess() t = tm.next_task() assert t.get_target() == n6 t.executed() t.postprocess() n1 = Node("n1") n2 = Node("n2", [n1]) n1.set_state(SCons.Node.failed) tm = SCons.Taskmaster.Taskmaster([n2]) assert tm.next_task() is None n1 = Node("n1") n2 = Node("n2") n1.targets = [n1, n2] n1._current_val = 1 tm = SCons.Taskmaster.Taskmaster([n1]) t = tm.next_task() t.executed() t.postprocess() s = n1.get_state() assert s == SCons.Node.executed, s s = n2.get_state() assert s == SCons.Node.executed, s def test_make_ready_out_of_date(self): """Test the Task.make_ready() method's list of out-of-date Nodes """ ood = [] def TaskGen(tm, targets, top, node, ood=ood): class MyTask(SCons.Taskmaster.Task): def make_ready(self): SCons.Taskmaster.Task.make_ready(self) self.ood.extend(self.out_of_date) t = MyTask(tm, targets, top, node) t.ood = ood return t n1 = Node("n1") c2 = Node("c2") c2._current_val = 1 n3 = Node("n3") c4 = Node("c4") c4._current_val = 1 a5 = Node("a5") a5._current_val = 1 a5.always_build = 1 tm = SCons.Taskmaster.Taskmaster(targets = [n1, c2, n3, c4, a5], tasker = TaskGen) del ood[:] t = tm.next_task() assert ood == [n1], ood del ood[:] t = tm.next_task() assert ood == [], ood del ood[:] t = tm.next_task() assert ood == [n3], ood del ood[:] t = tm.next_task() assert ood == [], ood del ood[:] t = tm.next_task() assert ood == [a5], ood def test_make_ready_exception(self): """Test handling exceptions from Task.make_ready() """ class MyTask(SCons.Taskmaster.Task): def make_ready(self): raise MyException("from make_ready()") n1 = Node("n1") tm = SCons.Taskmaster.Taskmaster(targets = [n1], tasker = MyTask) t = tm.next_task() exc_type, exc_value, exc_tb = t.exception assert exc_type == MyException, repr(exc_type) assert str(exc_value) == "from make_ready()", exc_value def test_make_ready_all(self): """Test the make_ready_all() method""" class MyTask(SCons.Taskmaster.Task): make_ready = SCons.Taskmaster.Task.make_ready_all n1 = Node("n1") c2 = Node("c2") c2._current_val = 1 n3 = Node("n3") c4 = Node("c4") c4._current_val = 1 tm = SCons.Taskmaster.Taskmaster(targets = [n1, c2, n3, c4]) t = tm.next_task() target = t.get_target() assert target is n1, target assert target.state == SCons.Node.executing, target.state t = tm.next_task() target = t.get_target() assert target is c2, target assert target.state == SCons.Node.up_to_date, target.state t = tm.next_task() target = t.get_target() assert target is n3, target assert target.state == SCons.Node.executing, target.state t = tm.next_task() target = t.get_target() assert target is c4, target assert target.state == SCons.Node.up_to_date, target.state t = tm.next_task() assert t is None n1 = Node("n1") c2 = Node("c2") n3 = Node("n3") c4 = Node("c4") tm = SCons.Taskmaster.Taskmaster(targets = [n1, c2, n3, c4], tasker = MyTask) t = tm.next_task() target = t.get_target() assert target is n1, target assert target.state == SCons.Node.executing, target.state t = tm.next_task() target = t.get_target() assert target is c2, target assert target.state == SCons.Node.executing, target.state t = tm.next_task() target = t.get_target() assert target is n3, target assert target.state == SCons.Node.executing, target.state t = tm.next_task() target = t.get_target() assert target is c4, target assert target.state == SCons.Node.executing, target.state t = tm.next_task() assert t is None def test_children_errors(self): """Test errors when fetching the children of a node. """ class StopNode(Node): def children(self): raise SCons.Errors.StopError("stop!") class ExitNode(Node): def children(self): sys.exit(77) n1 = StopNode("n1") tm = SCons.Taskmaster.Taskmaster([n1]) t = tm.next_task() exc_type, exc_value, exc_tb = t.exception assert exc_type == SCons.Errors.StopError, repr(exc_type) assert str(exc_value) == "stop!", exc_value n2 = ExitNode("n2") tm = SCons.Taskmaster.Taskmaster([n2]) t = tm.next_task() exc_type, exc_value = t.exception assert exc_type == SCons.Errors.ExplicitExit, repr(exc_type) assert exc_value.node == n2, exc_value.node assert exc_value.status == 77, exc_value.status def test_cycle_detection(self): """Test detecting dependency cycles """ n1 = Node("n1") n2 = Node("n2", [n1]) n3 = Node("n3", [n2]) n1.kids = [n3] tm = SCons.Taskmaster.Taskmaster([n3]) try: t = tm.next_task() except SCons.Errors.UserError as e: assert str(e) == "Dependency cycle: n3 -> n1 -> n2 -> n3", str(e) else: assert 'Did not catch expected UserError' def test_next_top_level_candidate(self): """Test the next_top_level_candidate() method """ n1 = Node("n1") n2 = Node("n2", [n1]) n3 = Node("n3", [n2]) tm = SCons.Taskmaster.Taskmaster([n3]) t = tm.next_task() assert t.targets == [n1], t.targets t.fail_stop() assert t.targets == [n3], list(map(str, t.targets)) assert t.top == 1, t.top def test_stop(self): """Test the stop() method Both default and overridden in a subclass. """ global built_text n1 = Node("n1") n2 = Node("n2") n3 = Node("n3", [n1, n2]) tm = SCons.Taskmaster.Taskmaster([n3]) t = tm.next_task() t.prepare() t.execute() assert built_text == "n1 built", built_text t.executed() t.postprocess() assert built_text == "n1 built really", built_text tm.stop() assert tm.next_task() is None class MyTM(SCons.Taskmaster.Taskmaster): def stop(self): global built_text built_text = "MyTM.stop()" SCons.Taskmaster.Taskmaster.stop(self) n1 = Node("n1") n2 = Node("n2") n3 = Node("n3", [n1, n2]) built_text = None tm = MyTM([n3]) tm.next_task().execute() assert built_text == "n1 built" tm.stop() assert built_text == "MyTM.stop()" assert tm.next_task() is None def test_executed(self): """Test when a task has been executed """ global built_text global visited_nodes n1 = Node("n1") tm = SCons.Taskmaster.Taskmaster([n1]) t = tm.next_task() built_text = "xxx" visited_nodes = [] n1.set_state(SCons.Node.executing) t.executed() s = n1.get_state() assert s == SCons.Node.executed, s assert built_text == "xxx really", built_text assert visited_nodes == ['n1'], visited_nodes n2 = Node("n2") tm = SCons.Taskmaster.Taskmaster([n2]) t = tm.next_task() built_text = "should_not_change" visited_nodes = [] n2.set_state(None) t.executed() s = n2.get_state() assert s is None, s assert built_text == "should_not_change", built_text assert visited_nodes == ['n2'], visited_nodes n3 = Node("n3") n4 = Node("n4") n3.targets = [n3, n4] tm = SCons.Taskmaster.Taskmaster([n3]) t = tm.next_task() visited_nodes = [] n3.set_state(SCons.Node.up_to_date) n4.set_state(SCons.Node.executing) t.executed() s = n3.get_state() assert s == SCons.Node.up_to_date, s s = n4.get_state() assert s == SCons.Node.executed, s assert visited_nodes == ['n3', 'n4'], visited_nodes def test_prepare(self): """Test preparation of multiple Nodes for a task """ n1 = Node("n1") n2 = Node("n2") tm = SCons.Taskmaster.Taskmaster([n1, n2]) t = tm.next_task() # This next line is moderately bogus. We're just reaching # in and setting the targets for this task to an array. The # "right" way to do this would be to have the next_task() call # set it up by having something that approximates a real Builder # return this list--but that's more work than is probably # warranted right now. n1.get_executor().targets = [n1, n2] t.prepare() assert n1.prepared assert n2.prepared n3 = Node("n3") n4 = Node("n4") tm = SCons.Taskmaster.Taskmaster([n3, n4]) t = tm.next_task() # More bogus reaching in and setting the targets. n3.set_state(SCons.Node.up_to_date) n3.get_executor().targets = [n3, n4] t.prepare() assert n3.prepared assert n4.prepared # If the Node has had an exception recorded while it was getting # prepared, then prepare() should raise that exception. class MyException(Exception): pass built_text = None n5 = Node("n5") tm = SCons.Taskmaster.Taskmaster([n5]) t = tm.next_task() t.exception_set((MyException, "exception value")) exc_caught = None exc_actually_caught = None exc_value = None try: t.prepare() except MyException as e: exc_caught = 1 exc_value = e except Exception as e: exc_actually_caught = e pass assert exc_caught, "did not catch expected MyException: %s"%exc_actually_caught assert str(exc_value) == "exception value", exc_value assert built_text is None, built_text # Regression test, make sure we prepare not only # all targets, but their side effects as well. n6 = Node("n6") n7 = Node("n7") n8 = Node("n8") n9 = Node("n9") n10 = Node("n10") n6.side_effects = [ n8 ] n7.side_effects = [ n9, n10 ] tm = SCons.Taskmaster.Taskmaster([n6, n7]) t = tm.next_task() # More bogus reaching in and setting the targets. n6.get_executor().targets = [n6, n7] t.prepare() assert n6.prepared assert n7.prepared assert n8.prepared assert n9.prepared assert n10.prepared # Make sure we call an Executor's prepare() method. class ExceptionExecutor(object): def prepare(self): raise Exception("Executor.prepare() exception") def get_all_targets(self): return self.nodes def get_all_children(self): result = [] for node in self.nodes: result.extend(node.children()) return result def get_all_prerequisites(self): return [] def get_action_side_effects(self): return [] n11 = Node("n11") n11.executor = ExceptionExecutor() n11.executor.nodes = [n11] tm = SCons.Taskmaster.Taskmaster([n11]) t = tm.next_task() try: t.prepare() except Exception as e: assert str(e) == "Executor.prepare() exception", e else: raise AssertionError("did not catch expected exception") def test_execute(self): """Test executing a task """ global built_text global cache_text n1 = Node("n1") tm = SCons.Taskmaster.Taskmaster([n1]) t = tm.next_task() t.execute() assert built_text == "n1 built", built_text def raise_UserError(): raise SCons.Errors.UserError n2 = Node("n2") n2.build = raise_UserError tm = SCons.Taskmaster.Taskmaster([n2]) t = tm.next_task() try: t.execute() except SCons.Errors.UserError: pass else: raise TestFailed("did not catch expected UserError") def raise_BuildError(): raise SCons.Errors.BuildError n3 = Node("n3") n3.build = raise_BuildError tm = SCons.Taskmaster.Taskmaster([n3]) t = tm.next_task() try: t.execute() except SCons.Errors.BuildError: pass else: raise TestFailed("did not catch expected BuildError") # On a generic (non-BuildError) exception from a Builder, # the target should throw a BuildError exception with the # args set to the exception value, instance, and traceback. def raise_OtherError(): raise OtherError n4 = Node("n4") n4.build = raise_OtherError tm = SCons.Taskmaster.Taskmaster([n4]) t = tm.next_task() try: t.execute() except SCons.Errors.BuildError as e: assert e.node == n4, e.node assert e.errstr == "OtherError : ", e.errstr assert len(e.exc_info) == 3, e.exc_info exc_traceback = sys.exc_info()[2] assert isinstance(e.exc_info[2], type(exc_traceback)), e.exc_info[2] else: raise TestFailed("did not catch expected BuildError") built_text = None cache_text = [] n5 = Node("n5") n6 = Node("n6") n6.cached = 1 tm = SCons.Taskmaster.Taskmaster([n5]) t = tm.next_task() # This next line is moderately bogus. We're just reaching # in and setting the targets for this task to an array. The # "right" way to do this would be to have the next_task() call # set it up by having something that approximates a real Builder # return this list--but that's more work than is probably # warranted right now. t.targets = [n5, n6] t.execute() assert built_text == "n5 built", built_text assert cache_text == [], cache_text built_text = None cache_text = [] n7 = Node("n7") n8 = Node("n8") n7.cached = 1 n8.cached = 1 tm = SCons.Taskmaster.Taskmaster([n7]) t = tm.next_task() # This next line is moderately bogus. We're just reaching # in and setting the targets for this task to an array. The # "right" way to do this would be to have the next_task() call # set it up by having something that approximates a real Builder # return this list--but that's more work than is probably # warranted right now. t.targets = [n7, n8] t.execute() assert built_text is None, built_text assert cache_text == ["n7 retrieved", "n8 retrieved"], cache_text def test_cached_execute(self): """Test executing a task with cached targets """ # In issue #2720 Alexei Klimkin detected that the previous # workflow for execute() led to problems in a multithreaded build. # We have: # task.prepare() # task.execute() # task.executed() # -> node.visited() # for the Serial flow, but # - Parallel - - Worker - # task.prepare() # requestQueue.put(task) # task = requestQueue.get() # task.execute() # resultQueue.put(task) # task = resultQueue.get() # task.executed() # ->node.visited() # in parallel. Since execute() used to call built() when a target # was cached, it could unblock dependent nodes before the binfo got # restored again in visited(). This resulted in spurious # "file not found" build errors, because files fetched from cache would # be seen as not up to date and wouldn't be scanned for implicit # dependencies. # # The following test ensures that execute() only marks targets as cached, # but the actual call to built() happens in executed() only. # Like this, the binfo should still be intact after calling execute()... global cache_text n1 = Node("n1") # Mark the node as being cached n1.cached = 1 tm = SCons.Taskmaster.Taskmaster([n1]) t = tm.next_task() t.prepare() t.execute() assert cache_text == ["n1 retrieved"], cache_text # If no binfo exists anymore, something has gone wrong... has_binfo = hasattr(n1, 'binfo') assert has_binfo == True, has_binfo def test_exception(self): """Test generic Taskmaster exception handling """ n1 = Node("n1") tm = SCons.Taskmaster.Taskmaster([n1]) t = tm.next_task() t.exception_set((1, 2)) exc_type, exc_value = t.exception assert exc_type == 1, exc_type assert exc_value == 2, exc_value t.exception_set(3) assert t.exception == 3 try: 1//0 except: # Moved from below t.exception_set(None) #pass # import pdb; pdb.set_trace() # Having this here works for python 2.x, # but it is a tuple (None, None, None) when called outside # an except statement # t.exception_set(None) exc_type, exc_value, exc_tb = t.exception assert exc_type is ZeroDivisionError, "Expecting ZeroDevisionError got:%s"%exc_type exception_values = [ "integer division or modulo", "integer division or modulo by zero", ] assert str(exc_value) in exception_values, exc_value class Exception1(Exception): pass # Previously value was None, but while PY2 None = "", in Py3 None != "", so set to "" t.exception_set((Exception1, "")) try: t.exception_raise() except: exc_type, exc_value = sys.exc_info()[:2] assert exc_type == Exception1, exc_type assert str(exc_value) == '', "Expecting empty string got:%s (type %s)"%(exc_value,type(exc_value)) else: assert 0, "did not catch expected exception" class Exception2(Exception): pass t.exception_set((Exception2, "xyzzy")) try: t.exception_raise() except: exc_type, exc_value = sys.exc_info()[:2] assert exc_type == Exception2, exc_type assert str(exc_value) == "xyzzy", exc_value else: assert 0, "did not catch expected exception" class Exception3(Exception): pass try: 1//0 except: tb = sys.exc_info()[2] t.exception_set((Exception3, "arg", tb)) try: t.exception_raise() except: exc_type, exc_value, exc_tb = sys.exc_info() assert exc_type == Exception3, exc_type assert str(exc_value) == "arg", exc_value import traceback x = traceback.extract_tb(tb)[-1] y = traceback.extract_tb(exc_tb)[-1] assert x == y, "x = %s, y = %s" % (x, y) else: assert 0, "did not catch expected exception" def test_postprocess(self): """Test postprocessing targets to give them a chance to clean up """ n1 = Node("n1") tm = SCons.Taskmaster.Taskmaster([n1]) t = tm.next_task() assert not n1.postprocessed t.postprocess() assert n1.postprocessed n2 = Node("n2") n3 = Node("n3") tm = SCons.Taskmaster.Taskmaster([n2, n3]) assert not n2.postprocessed assert not n3.postprocessed t = tm.next_task() t.postprocess() assert n2.postprocessed assert not n3.postprocessed t = tm.next_task() t.postprocess() assert n2.postprocessed assert n3.postprocessed def test_trace(self): """Test Taskmaster tracing """ import io trace = io.StringIO() n1 = Node("n1") n2 = Node("n2") n3 = Node("n3", [n1, n2]) tm = SCons.Taskmaster.Taskmaster([n1, n1, n3], trace=trace) t = tm.next_task() t.prepare() t.execute() t.postprocess() n1.set_state(SCons.Node.executed) t = tm.next_task() t.prepare() t.execute() t.postprocess() n2.set_state(SCons.Node.executed) t = tm.next_task() t.prepare() t.execute() t.postprocess() t = tm.next_task() assert t is None value = trace.getvalue() expect = """\ Taskmaster: Looking for a node to evaluate Taskmaster: Considering node and its children: Taskmaster: Evaluating Task.make_ready_current(): node Task.prepare(): node Task.execute(): node Task.postprocess(): node Taskmaster: Looking for a node to evaluate Taskmaster: Considering node and its children: Taskmaster: already handled (executed) Taskmaster: Considering node and its children: Taskmaster: Taskmaster: Taskmaster: adjusted ref count: , child 'n2' Taskmaster: Considering node and its children: Taskmaster: Evaluating Task.make_ready_current(): node Task.prepare(): node Task.execute(): node Task.postprocess(): node Task.postprocess(): removing Task.postprocess(): adjusted parent ref count Taskmaster: Looking for a node to evaluate Taskmaster: Considering node and its children: Taskmaster: Taskmaster: Taskmaster: Evaluating Task.make_ready_current(): node Task.prepare(): node Task.execute(): node Task.postprocess(): node Taskmaster: Looking for a node to evaluate Taskmaster: No candidate anymore. """ assert value == expect, value if __name__ == "__main__": suite = unittest.makeSuite(TaskmasterTestCase, 'test_') TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/SConsignTests.py0000664000175000017500000002727513160023041021670 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/SConsignTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import sys import unittest import TestCmd import TestUnit import SCons.dblite import SCons.SConsign class BuildInfo(object): def merge(self, object): pass class DummySConsignEntry(object): def __init__(self, name): self.name = name self.binfo = BuildInfo() def convert_to_sconsign(self): self.c_to_s = 1 def convert_from_sconsign(self, dir, name): self.c_from_s = 1 class FS(object): def __init__(self, top): self.Top = top self.Top.repositories = [] class DummyNode(object): def __init__(self, path='not_a_valid_path', binfo=None): self.path = path self.tpath = path self.fs = FS(self) self.binfo = binfo def get_stored_info(self): return self.binfo def get_binfo(self): return self.binfo def get_internal_path(self): return self.path def get_tpath(self): return self.tpath class SConsignTestCase(unittest.TestCase): def setUp(self): self.save_cwd = os.getcwd() self.test = TestCmd.TestCmd(workdir = '') os.chdir(self.test.workpath('')) def tearDown(self): self.test.cleanup() SCons.SConsign.Reset() os.chdir(self.save_cwd) class BaseTestCase(SConsignTestCase): def test_Base(self): aaa = DummySConsignEntry('aaa') bbb = DummySConsignEntry('bbb') bbb.arg1 = 'bbb arg1' ccc = DummySConsignEntry('ccc') ccc.arg2 = 'ccc arg2' f = SCons.SConsign.Base() f.set_entry('aaa', aaa) f.set_entry('bbb', bbb) #f.merge() e = f.get_entry('aaa') assert e == aaa, e assert e.name == 'aaa', e.name e = f.get_entry('bbb') assert e == bbb, e assert e.name == 'bbb', e.name assert e.arg1 == 'bbb arg1', e.arg1 assert not hasattr(e, 'arg2'), e f.set_entry('bbb', ccc) e = f.get_entry('bbb') assert e.name == 'ccc', e.name assert not hasattr(e, 'arg1'), e assert e.arg2 == 'ccc arg2', e.arg1 ddd = DummySConsignEntry('ddd') eee = DummySConsignEntry('eee') fff = DummySConsignEntry('fff') fff.arg = 'fff arg' f = SCons.SConsign.Base() f.set_entry('ddd', ddd) f.set_entry('eee', eee) e = f.get_entry('ddd') assert e == ddd, e assert e.name == 'ddd', e.name e = f.get_entry('eee') assert e == eee, e assert e.name == 'eee', e.name assert not hasattr(e, 'arg'), e f.set_entry('eee', fff) e = f.get_entry('eee') assert e.name == 'fff', e.name assert e.arg == 'fff arg', e.arg def test_store_info(self): aaa = DummySConsignEntry('aaa') bbb = DummySConsignEntry('bbb') bbb.arg1 = 'bbb arg1' ccc = DummySConsignEntry('ccc') ccc.arg2 = 'ccc arg2' f = SCons.SConsign.Base() f.store_info('aaa', DummyNode('aaa', aaa)) f.store_info('bbb', DummyNode('bbb', bbb)) try: e = f.get_entry('aaa') except KeyError: pass else: raise Exception("unexpected entry %s" % e) try: e = f.get_entry('bbb') except KeyError: pass else: raise Exception("unexpected entry %s" % e) f.merge() e = f.get_entry('aaa') assert e == aaa, "aaa = %s, e = %s" % (aaa, e) assert e.name == 'aaa', e.name e = f.get_entry('bbb') assert e == bbb, "bbb = %s, e = %s" % (bbb, e) assert e.name == 'bbb', e.name assert e.arg1 == 'bbb arg1', e.arg1 assert not hasattr(e, 'arg2'), e f.store_info('bbb', DummyNode('bbb', ccc)) e = f.get_entry('bbb') assert e == bbb, e assert e.name == 'bbb', e.name assert e.arg1 == 'bbb arg1', e.arg1 assert not hasattr(e, 'arg2'), e f.merge() e = f.get_entry('bbb') assert e.name == 'ccc', e.name assert not hasattr(e, 'arg1'), e assert e.arg2 == 'ccc arg2', e.arg1 ddd = DummySConsignEntry('ddd') eee = DummySConsignEntry('eee') fff = DummySConsignEntry('fff') fff.arg = 'fff arg' f = SCons.SConsign.Base() f.store_info('ddd', DummyNode('ddd', ddd)) f.store_info('eee', DummyNode('eee', eee)) f.merge() e = f.get_entry('ddd') assert e == ddd, e assert e.name == 'ddd', e.name e = f.get_entry('eee') assert e == eee, e assert e.name == 'eee', e.name assert not hasattr(e, 'arg'), e f.store_info('eee', DummyNode('eee', fff)) e = f.get_entry('eee') assert e == eee, e assert e.name == 'eee', e.name assert not hasattr(e, 'arg'), e f.merge() e = f.get_entry('eee') assert e.name == 'fff', e.name assert e.arg == 'fff arg', e.arg class SConsignDBTestCase(SConsignTestCase): def test_SConsignDB(self): save_DataBase = SCons.SConsign.DataBase SCons.SConsign.DataBase = {} try: d1 = SCons.SConsign.DB(DummyNode('dir1')) d1.set_entry('aaa', DummySConsignEntry('aaa name')) d1.set_entry('bbb', DummySConsignEntry('bbb name')) aaa = d1.get_entry('aaa') assert aaa.name == 'aaa name' bbb = d1.get_entry('bbb') assert bbb.name == 'bbb name' d2 = SCons.SConsign.DB(DummyNode('dir2')) d2.set_entry('ccc', DummySConsignEntry('ccc name')) d2.set_entry('ddd', DummySConsignEntry('ddd name')) ccc = d2.get_entry('ccc') assert ccc.name == 'ccc name' ddd = d2.get_entry('ddd') assert ddd.name == 'ddd name' d31 = SCons.SConsign.DB(DummyNode('dir3/sub1')) d31.set_entry('eee', DummySConsignEntry('eee name')) d31.set_entry('fff', DummySConsignEntry('fff name')) eee = d31.get_entry('eee') assert eee.name == 'eee name' fff = d31.get_entry('fff') assert fff.name == 'fff name' d32 = SCons.SConsign.DB(DummyNode('dir3%ssub2' % os.sep)) d32.set_entry('ggg', DummySConsignEntry('ggg name')) d32.set_entry('hhh', DummySConsignEntry('hhh name')) ggg = d32.get_entry('ggg') assert ggg.name == 'ggg name' hhh = d32.get_entry('hhh') assert hhh.name == 'hhh name' finally: SCons.SConsign.DataBase = save_DataBase class SConsignDirFileTestCase(SConsignTestCase): def test_SConsignDirFile(self): bi_foo = DummySConsignEntry('foo') bi_bar = DummySConsignEntry('bar') f = SCons.SConsign.DirFile(DummyNode()) f.set_entry('foo', bi_foo) f.set_entry('bar', bi_bar) e = f.get_entry('foo') assert e == bi_foo, e assert e.name == 'foo', e.name e = f.get_entry('bar') assert e == bi_bar, e assert e.name == 'bar', e.name assert not hasattr(e, 'arg'), e bbb = DummySConsignEntry('bbb') bbb.arg = 'bbb arg' f.set_entry('bar', bbb) e = f.get_entry('bar') assert e.name == 'bbb', e.name assert e.arg == 'bbb arg', e.arg class SConsignFileTestCase(SConsignTestCase): def test_SConsignFile(self): test = self.test file = test.workpath('sconsign_file') assert SCons.SConsign.DataBase == {}, SCons.SConsign.DataBase assert SCons.SConsign.DB_Name == ".sconsign", SCons.SConsign.DB_Name assert SCons.SConsign.DB_Module is SCons.dblite, SCons.SConsign.DB_Module SCons.SConsign.File(file) assert SCons.SConsign.DataBase == {}, SCons.SConsign.DataBase assert SCons.SConsign.DB_Name is file, SCons.SConsign.DB_Name assert SCons.SConsign.DB_Module is SCons.dblite, SCons.SConsign.DB_Module SCons.SConsign.File(None) assert SCons.SConsign.DataBase == {}, SCons.SConsign.DataBase assert SCons.SConsign.DB_Name is file, SCons.SConsign.DB_Name assert SCons.SConsign.DB_Module is None, SCons.SConsign.DB_Module class Fake_DBM(object): def open(self, name, mode): self.name = name self.mode = mode return self def __getitem__(self, key): pass def __setitem__(self, key, value): pass fake_dbm = Fake_DBM() SCons.SConsign.File(file, fake_dbm) assert SCons.SConsign.DataBase == {}, SCons.SConsign.DataBase assert SCons.SConsign.DB_Name is file, SCons.SConsign.DB_Name assert SCons.SConsign.DB_Module is fake_dbm, SCons.SConsign.DB_Module assert not hasattr(fake_dbm, 'name'), fake_dbm assert not hasattr(fake_dbm, 'mode'), fake_dbm SCons.SConsign.ForDirectory(DummyNode(test.workpath('dir'))) assert not SCons.SConsign.DataBase is None, SCons.SConsign.DataBase assert fake_dbm.name == file, fake_dbm.name assert fake_dbm.mode == "c", fake_dbm.mode class writeTestCase(SConsignTestCase): def test_write(self): test = self.test file = test.workpath('sconsign_file') class Fake_DBM(object): def __getitem__(self, key): return None def __setitem__(self, key, value): pass def open(self, name, mode): self.sync_count = 0 return self def sync(self): self.sync_count = self.sync_count + 1 fake_dbm = Fake_DBM() SCons.SConsign.DataBase = {} SCons.SConsign.File(file, fake_dbm) f = SCons.SConsign.DB(DummyNode()) bi_foo = DummySConsignEntry('foo') bi_bar = DummySConsignEntry('bar') f.set_entry('foo', bi_foo) f.set_entry('bar', bi_bar) SCons.SConsign.write() assert bi_foo.c_to_s, bi_foo.c_to_s assert bi_bar.c_to_s, bi_bar.c_to_s assert fake_dbm.sync_count == 1, fake_dbm.sync_count if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ BaseTestCase, SConsignDBTestCase, SConsignDirFileTestCase, SConsignFileTestCase, writeTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/UtilTests.py0000664000175000017500000007205413160023045021061 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/UtilTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat import io import os import sys import unittest from collections import UserDict, UserList, UserString import TestCmd import TestUnit import SCons.Errors from SCons.Util import * try: eval('unicode') except NameError: HasUnicode = False else: HasUnicode = True class OutBuffer(object): def __init__(self): self.buffer = "" def write(self, str): self.buffer = self.buffer + str class dictifyTestCase(unittest.TestCase): def test_dictify(self): """Test the dictify() function""" r = SCons.Util.dictify(['a', 'b', 'c'], [1, 2, 3]) assert r == {'a':1, 'b':2, 'c':3}, r r = {} SCons.Util.dictify(['a'], [1], r) SCons.Util.dictify(['b'], [2], r) SCons.Util.dictify(['c'], [3], r) assert r == {'a':1, 'b':2, 'c':3}, r class UtilTestCase(unittest.TestCase): def test_splitext(self): assert splitext('foo') == ('foo','') assert splitext('foo.bar') == ('foo','.bar') assert splitext(os.path.join('foo.bar', 'blat')) == (os.path.join('foo.bar', 'blat'),'') class Node(object): def __init__(self, name, children=[]): self.children = children self.name = name self.nocache = None def __str__(self): return self.name def exists(self): return 1 def rexists(self): return 1 def has_builder(self): return 1 def has_explicit_builder(self): return 1 def side_effect(self): return 1 def precious(self): return 1 def always_build(self): return 1 def is_up_to_date(self): return 1 def noclean(self): return 1 def tree_case_1(self): """Fixture for the render_tree() and print_tree() tests.""" windows_h = self.Node("windows.h") stdlib_h = self.Node("stdlib.h") stdio_h = self.Node("stdio.h") bar_c = self.Node("bar.c", [stdlib_h, windows_h]) bar_o = self.Node("bar.o", [bar_c]) foo_c = self.Node("foo.c", [stdio_h]) foo_o = self.Node("foo.o", [foo_c]) foo = self.Node("foo", [foo_o, bar_o]) expect = """\ +-foo +-foo.o | +-foo.c | +-stdio.h +-bar.o +-bar.c +-stdlib.h +-windows.h """ lines = expect.split('\n')[:-1] lines = ['[E BSPACN ]'+l for l in lines] withtags = '\n'.join(lines) + '\n' return foo, expect, withtags def tree_case_2(self, prune=1): """Fixture for the render_tree() and print_tree() tests.""" types_h = self.Node('types.h') malloc_h = self.Node('malloc.h') stdlib_h = self.Node('stdlib.h', [types_h, malloc_h]) bar_h = self.Node('bar.h', [stdlib_h]) blat_h = self.Node('blat.h', [stdlib_h]) blat_c = self.Node('blat.c', [blat_h, bar_h]) blat_o = self.Node('blat.o', [blat_c]) expect = """\ +-blat.o +-blat.c +-blat.h | +-stdlib.h | +-types.h | +-malloc.h +-bar.h """ if prune: expect += """ +-[stdlib.h] """ else: expect += """ +-stdlib.h +-types.h +-malloc.h """ lines = expect.split('\n')[:-1] lines = ['[E BSPACN ]'+l for l in lines] withtags = '\n'.join(lines) + '\n' return blat_o, expect, withtags def test_render_tree(self): """Test the render_tree() function""" def get_children(node): return node.children node, expect, withtags = self.tree_case_1() actual = render_tree(node, get_children) assert expect == actual, (expect, actual) node, expect, withtags = self.tree_case_2() actual = render_tree(node, get_children, 1) assert expect == actual, (expect, actual) # Ensure that we can call render_tree on the same Node # again. This wasn't possible in version 2.4.1 and earlier # due to a bug in render_tree (visited was set to {} as default # parameter) actual = render_tree(node, get_children, 1) assert expect == actual, (expect, actual) def test_print_tree(self): """Test the print_tree() function""" def get_children(node): return node.children save_stdout = sys.stdout try: node, expect, withtags = self.tree_case_1() if sys.version_info.major < 3: IOStream = io.BytesIO else: IOStream = io.StringIO sys.stdout = IOStream() print_tree(node, get_children) actual = sys.stdout.getvalue() assert expect == actual, (expect, actual) sys.stdout = IOStream() print_tree(node, get_children, showtags=1) actual = sys.stdout.getvalue() assert withtags == actual, (withtags, actual) # Test that explicitly setting prune to zero works # the same as the default (see above) node, expect, withtags = self.tree_case_2(prune=0) sys.stdout = IOStream() print_tree(node, get_children, 0) actual = sys.stdout.getvalue() assert expect == actual, (expect, actual) sys.stdout = IOStream() print_tree(node, get_children, 0, showtags=1) actual = sys.stdout.getvalue() assert withtags == actual, (withtags, actual) # Test output with prune=1 node, expect, withtags = self.tree_case_2(prune=1) sys.stdout = IOStream() print_tree(node, get_children, 1) actual = sys.stdout.getvalue() assert expect == actual, (expect, actual) # Ensure that we can call print_tree on the same Node # again. This wasn't possible in version 2.4.1 and earlier # due to a bug in print_tree (visited was set to {} as default # parameter) sys.stdout = IOStream() print_tree(node, get_children, 1) actual = sys.stdout.getvalue() assert expect == actual, (expect, actual) sys.stdout = IOStream() print_tree(node, get_children, 1, showtags=1) actual = sys.stdout.getvalue() assert withtags == actual, (withtags, actual) finally: sys.stdout = save_stdout def test_is_Dict(self): assert is_Dict({}) assert is_Dict(UserDict()) # os.environ is not a dictionary in python 3 if sys.version_info < (3,0): assert is_Dict(os.environ) try: class mydict(dict): pass except TypeError: pass else: assert is_Dict(mydict({})) assert not is_Dict([]) assert not is_Dict(()) assert not is_Dict("") if HasUnicode: exec("assert not is_Dict(u'')") def test_is_List(self): assert is_List([]) assert is_List(UserList()) try: class mylist(list): pass except TypeError: pass else: assert is_List(mylist([])) assert not is_List(()) assert not is_List({}) assert not is_List("") if HasUnicode: exec("assert not is_List(u'')") def test_is_String(self): assert is_String("") if HasUnicode: exec("assert is_String(u'')") assert is_String(UserString('')) try: class mystr(str): pass except TypeError: pass else: assert is_String(mystr('')) assert not is_String({}) assert not is_String([]) assert not is_String(()) def test_is_Tuple(self): assert is_Tuple(()) try: class mytuple(tuple): pass except TypeError: pass else: assert is_Tuple(mytuple(())) assert not is_Tuple([]) assert not is_Tuple({}) assert not is_Tuple("") if HasUnicode: exec("assert not is_Tuple(u'')") def test_to_String(self): """Test the to_String() method.""" assert to_String(1) == "1", to_String(1) assert to_String([ 1, 2, 3]) == str([1, 2, 3]), to_String([1,2,3]) assert to_String("foo") == "foo", to_String("foo") s1=UserString('blah') assert to_String(s1) == s1, s1 assert to_String(s1) == 'blah', s1 class Derived(UserString): pass s2 = Derived('foo') assert to_String(s2) == s2, s2 assert to_String(s2) == 'foo', s2 if HasUnicode: s3=UserString(unicode('bar')) assert to_String(s3) == s3, s3 assert to_String(s3) == unicode('bar'), s3 assert isinstance(to_String(s3), unicode), \ type(to_String(s3)) if HasUnicode: s4 = unicode('baz') assert to_String(s4) == unicode('baz'), to_String(s4) assert isinstance(to_String(s4), unicode), \ type(to_String(s4)) def test_WhereIs(self): test = TestCmd.TestCmd(workdir = '') sub1_xxx_exe = test.workpath('sub1', 'xxx.exe') sub2_xxx_exe = test.workpath('sub2', 'xxx.exe') sub3_xxx_exe = test.workpath('sub3', 'xxx.exe') sub4_xxx_exe = test.workpath('sub4', 'xxx.exe') test.subdir('subdir', 'sub1', 'sub2', 'sub3', 'sub4') if sys.platform != 'win32': test.write(sub1_xxx_exe, "\n") os.mkdir(sub2_xxx_exe) test.write(sub3_xxx_exe, "\n") os.chmod(sub3_xxx_exe, 0o777) test.write(sub4_xxx_exe, "\n") os.chmod(sub4_xxx_exe, 0o777) env_path = os.environ['PATH'] try: pathdirs_1234 = [ test.workpath('sub1'), test.workpath('sub2'), test.workpath('sub3'), test.workpath('sub4'), ] + env_path.split(os.pathsep) pathdirs_1243 = [ test.workpath('sub1'), test.workpath('sub2'), test.workpath('sub4'), test.workpath('sub3'), ] + env_path.split(os.pathsep) os.environ['PATH'] = os.pathsep.join(pathdirs_1234) wi = WhereIs('xxx.exe') assert wi == test.workpath(sub3_xxx_exe), wi wi = WhereIs('xxx.exe', pathdirs_1243) assert wi == test.workpath(sub4_xxx_exe), wi wi = WhereIs('xxx.exe', os.pathsep.join(pathdirs_1243)) assert wi == test.workpath(sub4_xxx_exe), wi wi = WhereIs('xxx.exe',reject = sub3_xxx_exe) assert wi == test.workpath(sub4_xxx_exe), wi wi = WhereIs('xxx.exe', pathdirs_1243, reject = sub3_xxx_exe) assert wi == test.workpath(sub4_xxx_exe), wi os.environ['PATH'] = os.pathsep.join(pathdirs_1243) wi = WhereIs('xxx.exe') assert wi == test.workpath(sub4_xxx_exe), wi wi = WhereIs('xxx.exe', pathdirs_1234) assert wi == test.workpath(sub3_xxx_exe), wi wi = WhereIs('xxx.exe', os.pathsep.join(pathdirs_1234)) assert wi == test.workpath(sub3_xxx_exe), wi if sys.platform == 'win32': wi = WhereIs('xxx', pathext = '') assert wi is None, wi wi = WhereIs('xxx', pathext = '.exe') assert wi == test.workpath(sub4_xxx_exe), wi wi = WhereIs('xxx', path = pathdirs_1234, pathext = '.BAT;.EXE') assert wi.lower() == test.workpath(sub3_xxx_exe).lower(), wi # Test that we return a normalized path even when # the path contains forward slashes. forward_slash = test.workpath('') + '/sub3' wi = WhereIs('xxx', path = forward_slash, pathext = '.EXE') assert wi.lower() == test.workpath(sub3_xxx_exe).lower(), wi del os.environ['PATH'] wi = WhereIs('xxx.exe') assert wi is None, wi finally: os.environ['PATH'] = env_path def test_get_env_var(self): """Testing get_environment_var().""" assert get_environment_var("$FOO") == "FOO", get_environment_var("$FOO") assert get_environment_var("${BAR}") == "BAR", get_environment_var("${BAR}") assert get_environment_var("$FOO_BAR1234") == "FOO_BAR1234", get_environment_var("$FOO_BAR1234") assert get_environment_var("${BAR_FOO1234}") == "BAR_FOO1234", get_environment_var("${BAR_FOO1234}") assert get_environment_var("${BAR}FOO") == None, get_environment_var("${BAR}FOO") assert get_environment_var("$BAR ") == None, get_environment_var("$BAR ") assert get_environment_var("FOO$BAR") == None, get_environment_var("FOO$BAR") assert get_environment_var("$FOO[0]") == None, get_environment_var("$FOO[0]") assert get_environment_var("${some('complex expression')}") == None, get_environment_var("${some('complex expression')}") def test_Proxy(self): """Test generic Proxy class.""" class Subject(object): def foo(self): return 1 def bar(self): return 2 s=Subject() s.baz = 3 class ProxyTest(Proxy): def bar(self): return 4 p=ProxyTest(s) assert p.foo() == 1, p.foo() assert p.bar() == 4, p.bar() assert p.baz == 3, p.baz p.baz = 5 s.baz = 6 assert p.baz == 5, p.baz assert p.get() == s, p.get() def test_display(self): old_stdout = sys.stdout sys.stdout = OutBuffer() display("line1") display.set_mode(0) display("line2") display.set_mode(1) display("line3") display("line4\n", append_newline=0) display.set_mode(0) display("dont print1") display("dont print2\n", append_newline=0) display.set_mode(1) assert sys.stdout.buffer == "line1\nline3\nline4\n" sys.stdout = old_stdout def test_get_native_path(self): """Test the get_native_path() function.""" import tempfile filename = tempfile.mktemp() str = '1234567890 ' + filename try: open(filename, 'w').write(str) assert open(get_native_path(filename)).read() == str finally: try: os.unlink(filename) except OSError: pass def test_PrependPath(self): """Test prepending to a path""" p1 = r'C:\dir\num\one;C:\dir\num\two' p2 = r'C:\mydir\num\one;C:\mydir\num\two' # have to include the pathsep here so that the test will work on UNIX too. p1 = PrependPath(p1,r'C:\dir\num\two',sep = ';') p1 = PrependPath(p1,r'C:\dir\num\three',sep = ';') p2 = PrependPath(p2,r'C:\mydir\num\three',sep = ';') p2 = PrependPath(p2,r'C:\mydir\num\one',sep = ';') assert(p1 == r'C:\dir\num\three;C:\dir\num\two;C:\dir\num\one') assert(p2 == r'C:\mydir\num\one;C:\mydir\num\three;C:\mydir\num\two') def test_AppendPath(self): """Test appending to a path.""" p1 = r'C:\dir\num\one;C:\dir\num\two' p2 = r'C:\mydir\num\one;C:\mydir\num\two' # have to include the pathsep here so that the test will work on UNIX too. p1 = AppendPath(p1,r'C:\dir\num\two',sep = ';') p1 = AppendPath(p1,r'C:\dir\num\three',sep = ';') p2 = AppendPath(p2,r'C:\mydir\num\three',sep = ';') p2 = AppendPath(p2,r'C:\mydir\num\one',sep = ';') assert(p1 == r'C:\dir\num\one;C:\dir\num\two;C:\dir\num\three') assert(p2 == r'C:\mydir\num\two;C:\mydir\num\three;C:\mydir\num\one') def test_PrependPathPreserveOld(self): """Test prepending to a path while preserving old paths""" p1 = r'C:\dir\num\one;C:\dir\num\two' # have to include the pathsep here so that the test will work on UNIX too. p1 = PrependPath(p1,r'C:\dir\num\two',sep = ';', delete_existing=0) p1 = PrependPath(p1,r'C:\dir\num\three',sep = ';') assert(p1 == r'C:\dir\num\three;C:\dir\num\one;C:\dir\num\two') def test_AppendPathPreserveOld(self): """Test appending to a path while preserving old paths""" p1 = r'C:\dir\num\one;C:\dir\num\two' # have to include the pathsep here so that the test will work on UNIX too. p1 = AppendPath(p1,r'C:\dir\num\one',sep = ';', delete_existing=0) p1 = AppendPath(p1,r'C:\dir\num\three',sep = ';') assert(p1 == r'C:\dir\num\one;C:\dir\num\two;C:\dir\num\three') def test_addPathIfNotExists(self): """Test the AddPathIfNotExists() function""" env_dict = { 'FOO' : os.path.normpath('/foo/bar') + os.pathsep + \ os.path.normpath('/baz/blat'), 'BAR' : os.path.normpath('/foo/bar') + os.pathsep + \ os.path.normpath('/baz/blat'), 'BLAT' : [ os.path.normpath('/foo/bar'), os.path.normpath('/baz/blat') ] } AddPathIfNotExists(env_dict, 'FOO', os.path.normpath('/foo/bar')) AddPathIfNotExists(env_dict, 'BAR', os.path.normpath('/bar/foo')) AddPathIfNotExists(env_dict, 'BAZ', os.path.normpath('/foo/baz')) AddPathIfNotExists(env_dict, 'BLAT', os.path.normpath('/baz/blat')) AddPathIfNotExists(env_dict, 'BLAT', os.path.normpath('/baz/foo')) assert env_dict['FOO'] == os.path.normpath('/foo/bar') + os.pathsep + \ os.path.normpath('/baz/blat'), env_dict['FOO'] assert env_dict['BAR'] == os.path.normpath('/bar/foo') + os.pathsep + \ os.path.normpath('/foo/bar') + os.pathsep + \ os.path.normpath('/baz/blat'), env_dict['BAR'] assert env_dict['BAZ'] == os.path.normpath('/foo/baz'), env_dict['BAZ'] assert env_dict['BLAT'] == [ os.path.normpath('/baz/foo'), os.path.normpath('/foo/bar'), os.path.normpath('/baz/blat') ], env_dict['BLAT' ] def test_CLVar(self): """Test the command-line construction variable class""" f = SCons.Util.CLVar('a b') r = f + 'c d' assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', 'c', 'd'], r.data assert str(r) == 'a b c d', str(r) r = f + ' c d' assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', 'c', 'd'], r.data assert str(r) == 'a b c d', str(r) r = f + ['c d'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', 'c d'], r.data assert str(r) == 'a b c d', str(r) r = f + [' c d'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', ' c d'], r.data assert str(r) == 'a b c d', str(r) r = f + ['c', 'd'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', 'c', 'd'], r.data assert str(r) == 'a b c d', str(r) r = f + [' c', 'd'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', ' c', 'd'], r.data assert str(r) == 'a b c d', str(r) f = SCons.Util.CLVar(['a b']) r = f + 'c d' assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a b', 'c', 'd'], r.data assert str(r) == 'a b c d', str(r) r = f + ' c d' assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a b', 'c', 'd'], r.data assert str(r) == 'a b c d', str(r) r = f + ['c d'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a b', 'c d'], r.data assert str(r) == 'a b c d', str(r) r = f + [' c d'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a b', ' c d'], r.data assert str(r) == 'a b c d', str(r) r = f + ['c', 'd'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a b', 'c', 'd'], r.data assert str(r) == 'a b c d', str(r) r = f + [' c', 'd'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a b', ' c', 'd'], r.data assert str(r) == 'a b c d', str(r) f = SCons.Util.CLVar(['a', 'b']) r = f + 'c d' assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', 'c', 'd'], r.data assert str(r) == 'a b c d', str(r) r = f + ' c d' assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', 'c', 'd'], r.data assert str(r) == 'a b c d', str(r) r = f + ['c d'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', 'c d'], r.data assert str(r) == 'a b c d', str(r) r = f + [' c d'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', ' c d'], r.data assert str(r) == 'a b c d', str(r) r = f + ['c', 'd'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', 'c', 'd'], r.data assert str(r) == 'a b c d', str(r) r = f + [' c', 'd'] assert isinstance(r, SCons.Util.CLVar), type(r) assert r.data == ['a', 'b', ' c', 'd'], r.data assert str(r) == 'a b c d', str(r) def test_Selector(self): """Test the Selector class""" class MyNode(object): def __init__(self, name): self.name = name def __str__(self): return self.name def get_suffix(self): return os.path.splitext(self.name)[1] s = Selector({'a' : 'AAA', 'b' : 'BBB'}) assert s['a'] == 'AAA', s['a'] assert s['b'] == 'BBB', s['b'] exc_caught = None try: x = s['c'] except KeyError: exc_caught = 1 assert exc_caught, "should have caught a KeyError" s['c'] = 'CCC' assert s['c'] == 'CCC', s['c'] class DummyEnv(UserDict): def subst(self, key): if key[0] == '$': return self[key[1:]] return key env = DummyEnv() s = Selector({'.d' : 'DDD', '.e' : 'EEE'}) ret = s(env, []) assert ret is None, ret ret = s(env, [MyNode('foo.d')]) assert ret == 'DDD', ret ret = s(env, [MyNode('bar.e')]) assert ret == 'EEE', ret ret = s(env, [MyNode('bar.x')]) assert ret is None, ret s[None] = 'XXX' ret = s(env, [MyNode('bar.x')]) assert ret == 'XXX', ret env = DummyEnv({'FSUFF' : '.f', 'GSUFF' : '.g'}) s = Selector({'$FSUFF' : 'FFF', '$GSUFF' : 'GGG'}) ret = s(env, [MyNode('foo.f')]) assert ret == 'FFF', ret ret = s(env, [MyNode('bar.g')]) assert ret == 'GGG', ret def test_adjustixes(self): """Test the adjustixes() function""" r = adjustixes('file', 'pre-', '-suf') assert r == 'pre-file-suf', r r = adjustixes('pre-file', 'pre-', '-suf') assert r == 'pre-file-suf', r r = adjustixes('file-suf', 'pre-', '-suf') assert r == 'pre-file-suf', r r = adjustixes('pre-file-suf', 'pre-', '-suf') assert r == 'pre-file-suf', r r = adjustixes('pre-file.xxx', 'pre-', '-suf') assert r == 'pre-file.xxx', r r = adjustixes('dir/file', 'pre-', '-suf') assert r == os.path.join('dir', 'pre-file-suf'), r def test_containsAny(self): """Test the containsAny() function""" assert containsAny('*.py', '*?[]') assert not containsAny('file.txt', '*?[]') def test_containsAll(self): """Test the containsAll() function""" assert containsAll('43221', '123') assert not containsAll('134', '123') def test_containsOnly(self): """Test the containsOnly() function""" assert containsOnly('.83', '0123456789.') assert not containsOnly('43221', '123') def test_LogicalLines(self): """Test the LogicalLines class""" content = u""" foo \ bar \ baz foo bling \ bling \ bling bling """ fobj = io.StringIO(content) lines = LogicalLines(fobj).readlines() assert lines == [ '\n', 'foo bar baz\n', 'foo\n', 'bling bling \\ bling\n', 'bling\n', ], lines def test_intern(self): s1 = silent_intern("spam") # TODO: Python 3.x does not have a unicode() global function if sys.version[0] == '2': s2 = silent_intern(unicode("unicode spam")) s3 = silent_intern(42) s4 = silent_intern("spam") assert id(s1) == id(s4) class MD5TestCase(unittest.TestCase): def test_collect(self): """Test collecting a list of signatures into a new signature value """ s = list(map(MD5signature, ('111', '222', '333'))) assert '698d51a19d8a121ce581499d7b701668' == MD5collect(s[0:1]) assert '8980c988edc2c78cc43ccb718c06efd5' == MD5collect(s[0:2]) assert '53fd88c84ff8a285eb6e0a687e55b8c7' == MD5collect(s) def test_MD5signature(self): """Test generating a signature""" s = MD5signature('111') assert '698d51a19d8a121ce581499d7b701668' == s, s s = MD5signature('222') assert 'bcbe3365e6ac95ea2c0343a2395834dd' == s, s class NodeListTestCase(unittest.TestCase): def test_simple_attributes(self): """Test simple attributes of a NodeList class""" class TestClass(object): def __init__(self, name, child=None): self.child = child self.bar = name t1 = TestClass('t1', TestClass('t1child')) t2 = TestClass('t2', TestClass('t2child')) t3 = TestClass('t3') nl = NodeList([t1, t2, t3]) assert nl.bar == [ 't1', 't2', 't3' ], nl.bar assert nl[0:2].child.bar == [ 't1child', 't2child' ], \ nl[0:2].child.bar def test_callable_attributes(self): """Test callable attributes of a NodeList class""" class TestClass(object): def __init__(self, name, child=None): self.child = child self.bar = name def foo(self): return self.bar + "foo" def getself(self): return self t1 = TestClass('t1', TestClass('t1child')) t2 = TestClass('t2', TestClass('t2child')) t3 = TestClass('t3') nl = NodeList([t1, t2, t3]) assert nl.foo() == [ 't1foo', 't2foo', 't3foo' ], nl.foo() assert nl.bar == [ 't1', 't2', 't3' ], nl.bar assert nl.getself().bar == [ 't1', 't2', 't3' ], nl.getself().bar assert nl[0:2].child.foo() == [ 't1childfoo', 't2childfoo' ], \ nl[0:2].child.foo() assert nl[0:2].child.bar == [ 't1child', 't2child' ], \ nl[0:2].child.bar def test_null(self): """Test a null NodeList""" nl = NodeList([]) r = str(nl) assert r == '', r for node in nl: raise Exception("should not enter this loop") class flattenTestCase(unittest.TestCase): def test_scalar(self): """Test flattening a scalar""" result = flatten('xyz') assert result == ['xyz'], result if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ dictifyTestCase, flattenTestCase, MD5TestCase, NodeListTestCase, UtilTestCase, ] for tclass in tclasses: names = unittest.getTestCaseNames(tclass, 'test_') suite.addTests(list(map(tclass, names))) TestUnit.run(suite) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/SCons/Environment.py0000664000175000017500000027547213160023040021431 0ustar bdbaddogbdbaddog"""SCons.Environment Base class for construction Environments. These are the primary objects used to communicate dependency and construction information to the build engine. Keyword arguments supplied when the construction Environment is created are construction variables used to initialize the Environment """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. __revision__ = "src/engine/SCons/Environment.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import copy import os import sys import re import shlex from collections import UserDict import SCons.Action import SCons.Builder import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Defaults import SCons.Errors import SCons.Memoize import SCons.Node import SCons.Node.Alias import SCons.Node.FS import SCons.Node.Python import SCons.Platform import SCons.SConf import SCons.SConsign import SCons.Subst import SCons.Tool import SCons.Util import SCons.Warnings class _Null(object): pass _null = _Null _warn_copy_deprecated = True _warn_source_signatures_deprecated = True _warn_target_signatures_deprecated = True CleanTargets = {} CalculatorArgs = {} semi_deepcopy = SCons.Util.semi_deepcopy semi_deepcopy_dict = SCons.Util.semi_deepcopy_dict # Pull UserError into the global name space for the benefit of # Environment().SourceSignatures(), which has some import statements # which seem to mess up its ability to reference SCons directly. UserError = SCons.Errors.UserError def alias_builder(env, target, source): pass AliasBuilder = SCons.Builder.Builder(action = alias_builder, target_factory = SCons.Node.Alias.default_ans.Alias, source_factory = SCons.Node.FS.Entry, multi = 1, is_explicit = None, name='AliasBuilder') def apply_tools(env, tools, toolpath): # Store the toolpath in the Environment. if toolpath is not None: env['toolpath'] = toolpath if not tools: return # Filter out null tools from the list. for tool in [_f for _f in tools if _f]: if SCons.Util.is_List(tool) or isinstance(tool, tuple): toolname = tool[0] toolargs = tool[1] # should be a dict of kw args tool = env.Tool(toolname, **toolargs) else: env.Tool(tool) # These names are (or will be) controlled by SCons; users should never # set or override them. This warning can optionally be turned off, # but scons will still ignore the illegal variable names even if it's off. reserved_construction_var_names = [ 'CHANGED_SOURCES', 'CHANGED_TARGETS', 'SOURCE', 'SOURCES', 'TARGET', 'TARGETS', 'UNCHANGED_SOURCES', 'UNCHANGED_TARGETS', ] future_reserved_construction_var_names = [ #'HOST_OS', #'HOST_ARCH', #'HOST_CPU', ] def copy_non_reserved_keywords(dict): result = semi_deepcopy(dict) for k in list(result.keys()): if k in reserved_construction_var_names: msg = "Ignoring attempt to set reserved variable `$%s'" SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % k) del result[k] return result def _set_reserved(env, key, value): msg = "Ignoring attempt to set reserved variable `$%s'" SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % key) def _set_future_reserved(env, key, value): env._dict[key] = value msg = "`$%s' will be reserved in a future release and setting it will become ignored" SCons.Warnings.warn(SCons.Warnings.FutureReservedVariableWarning, msg % key) def _set_BUILDERS(env, key, value): try: bd = env._dict[key] for k in list(bd.keys()): del bd[k] except KeyError: bd = BuilderDict(kwbd, env) env._dict[key] = bd for k, v in value.items(): if not SCons.Builder.is_a_Builder(v): raise SCons.Errors.UserError('%s is not a Builder.' % repr(v)) bd.update(value) def _del_SCANNERS(env, key): del env._dict[key] env.scanner_map_delete() def _set_SCANNERS(env, key, value): env._dict[key] = value env.scanner_map_delete() def _delete_duplicates(l, keep_last): """Delete duplicates from a sequence, keeping the first or last.""" seen=set() result=[] if keep_last: # reverse in & out, then keep first l.reverse() for i in l: try: if i not in seen: result.append(i) seen.add(i) except TypeError: # probably unhashable. Just keep it. result.append(i) if keep_last: result.reverse() return result # The following is partly based on code in a comment added by Peter # Shannon at the following page (there called the "transplant" class): # # ASPN : Python Cookbook : Dynamically added methods to a class # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732 # # We had independently been using the idiom as BuilderWrapper, but # factoring out the common parts into this base class, and making # BuilderWrapper a subclass that overrides __call__() to enforce specific # Builder calling conventions, simplified some of our higher-layer code. class MethodWrapper(object): """ A generic Wrapper class that associates a method (which can actually be any callable) with an object. As part of creating this MethodWrapper object an attribute with the specified (by default, the name of the supplied method) is added to the underlying object. When that new "method" is called, our __call__() method adds the object as the first argument, simulating the Python behavior of supplying "self" on method calls. We hang on to the name by which the method was added to the underlying base class so that we can provide a method to "clone" ourselves onto a new underlying object being copied (without which we wouldn't need to save that info). """ def __init__(self, object, method, name=None): if name is None: name = method.__name__ self.object = object self.method = method self.name = name setattr(self.object, name, self) def __call__(self, *args, **kwargs): nargs = (self.object,) + args return self.method(*nargs, **kwargs) def clone(self, new_object): """ Returns an object that re-binds the underlying "method" to the specified new object. """ return self.__class__(new_object, self.method, self.name) class BuilderWrapper(MethodWrapper): """ A MethodWrapper subclass that that associates an environment with a Builder. This mainly exists to wrap the __call__() function so that all calls to Builders can have their argument lists massaged in the same way (treat a lone argument as the source, treat two arguments as target then source, make sure both target and source are lists) without having to have cut-and-paste code to do it. As a bit of obsessive backwards compatibility, we also intercept attempts to get or set the "env" or "builder" attributes, which were the names we used before we put the common functionality into the MethodWrapper base class. We'll keep this around for a while in case people shipped Tool modules that reached into the wrapper (like the Tool/qt.py module does, or did). There shouldn't be a lot attribute fetching or setting on these, so a little extra work shouldn't hurt. """ def __call__(self, target=None, source=_null, *args, **kw): if source is _null: source = target target = None if target is not None and not SCons.Util.is_List(target): target = [target] if source is not None and not SCons.Util.is_List(source): source = [source] return MethodWrapper.__call__(self, target, source, *args, **kw) def __repr__(self): return '' % repr(self.name) def __str__(self): return self.__repr__() def __getattr__(self, name): if name == 'env': return self.object elif name == 'builder': return self.method else: raise AttributeError(name) def __setattr__(self, name, value): if name == 'env': self.object = value elif name == 'builder': self.method = value else: self.__dict__[name] = value # This allows a Builder to be executed directly # through the Environment to which it's attached. # In practice, we shouldn't need this, because # builders actually get executed through a Node. # But we do have a unit test for this, and can't # yet rule out that it would be useful in the # future, so leave it for now. #def execute(self, **kw): # kw['env'] = self.env # self.builder.execute(**kw) class BuilderDict(UserDict): """This is a dictionary-like class used by an Environment to hold the Builders. We need to do this because every time someone changes the Builders in the Environment's BUILDERS dictionary, we must update the Environment's attributes.""" def __init__(self, dict, env): # Set self.env before calling the superclass initialization, # because it will end up calling our other methods, which will # need to point the values in this dictionary to self.env. self.env = env UserDict.__init__(self, dict) def __semi_deepcopy__(self): # These cannot be copied since they would both modify the same builder object, and indeed # just copying would modify the original builder raise TypeError( 'cannot semi_deepcopy a BuilderDict' ) def __setitem__(self, item, val): try: method = getattr(self.env, item).method except AttributeError: pass else: self.env.RemoveMethod(method) UserDict.__setitem__(self, item, val) BuilderWrapper(self.env, val, item) def __delitem__(self, item): UserDict.__delitem__(self, item) delattr(self.env, item) def update(self, dict): for i, v in dict.items(): self.__setitem__(i, v) _is_valid_var = re.compile(r'[_a-zA-Z]\w*$') def is_valid_construction_var(varstr): """Return if the specified string is a legitimate construction variable. """ return _is_valid_var.match(varstr) class SubstitutionEnvironment(object): """Base class for different flavors of construction environments. This class contains a minimal set of methods that handle construction variable expansion and conversion of strings to Nodes, which may or may not be actually useful as a stand-alone class. Which methods ended up in this class is pretty arbitrary right now. They're basically the ones which we've empirically determined are common to the different construction environment subclasses, and most of the others that use or touch the underlying dictionary of construction variables. Eventually, this class should contain all the methods that we determine are necessary for a "minimal" interface to the build engine. A full "native Python" SCons environment has gotten pretty heavyweight with all of the methods and Tools and construction variables we've jammed in there, so it would be nice to have a lighter weight alternative for interfaces that don't need all of the bells and whistles. (At some point, we'll also probably rename this class "Base," since that more reflects what we want this class to become, but because we've released comments that tell people to subclass Environment.Base to create their own flavors of construction environment, we'll save that for a future refactoring when this class actually becomes useful.) """ def __init__(self, **kw): """Initialization of an underlying SubstitutionEnvironment class. """ if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.SubstitutionEnvironment') self.fs = SCons.Node.FS.get_default_fs() self.ans = SCons.Node.Alias.default_ans self.lookup_list = SCons.Node.arg2nodes_lookups self._dict = kw.copy() self._init_special() self.added_methods = [] #self._memo = {} def _init_special(self): """Initial the dispatch tables for special handling of special construction variables.""" self._special_del = {} self._special_del['SCANNERS'] = _del_SCANNERS self._special_set = {} for key in reserved_construction_var_names: self._special_set[key] = _set_reserved for key in future_reserved_construction_var_names: self._special_set[key] = _set_future_reserved self._special_set['BUILDERS'] = _set_BUILDERS self._special_set['SCANNERS'] = _set_SCANNERS # Freeze the keys of self._special_set in a list for use by # methods that need to check. (Empirically, list scanning has # gotten better than dict.has_key() in Python 2.5.) self._special_set_keys = list(self._special_set.keys()) def __eq__(self, other): return self._dict == other._dict def __delitem__(self, key): special = self._special_del.get(key) if special: special(self, key) else: del self._dict[key] def __getitem__(self, key): return self._dict[key] def __setitem__(self, key, value): # This is heavily used. This implementation is the best we have # according to the timings in bench/env.__setitem__.py. # # The "key in self._special_set_keys" test here seems to perform # pretty well for the number of keys we have. A hard-coded # list works a little better in Python 2.5, but that has the # disadvantage of maybe getting out of sync if we ever add more # variable names. Using self._special_set.has_key() works a # little better in Python 2.4, but is worse than this test. # So right now it seems like a good trade-off, but feel free to # revisit this with bench/env.__setitem__.py as needed (and # as newer versions of Python come out). if key in self._special_set_keys: self._special_set[key](self, key, value) else: # If we already have the entry, then it's obviously a valid # key and we don't need to check. If we do check, using a # global, pre-compiled regular expression directly is more # efficient than calling another function or a method. if key not in self._dict \ and not _is_valid_var.match(key): raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value def get(self, key, default=None): """Emulates the get() method of dictionaries.""" return self._dict.get(key, default) def has_key(self, key): return key in self._dict def __contains__(self, key): return self._dict.__contains__(key) def items(self): return list(self._dict.items()) def arg2nodes(self, args, node_factory=_null, lookup_list=_null, **kw): if node_factory is _null: node_factory = self.fs.File if lookup_list is _null: lookup_list = self.lookup_list if not args: return [] args = SCons.Util.flatten(args) nodes = [] for v in args: if SCons.Util.is_String(v): n = None for l in lookup_list: n = l(v) if n is not None: break if n is not None: if SCons.Util.is_String(n): # n = self.subst(n, raw=1, **kw) kw['raw'] = 1 n = self.subst(n, **kw) if node_factory: n = node_factory(n) if SCons.Util.is_List(n): nodes.extend(n) else: nodes.append(n) elif node_factory: # v = node_factory(self.subst(v, raw=1, **kw)) kw['raw'] = 1 v = node_factory(self.subst(v, **kw)) if SCons.Util.is_List(v): nodes.extend(v) else: nodes.append(v) else: nodes.append(v) return nodes def gvars(self): return self._dict def lvars(self): return {} def subst(self, string, raw=0, target=None, source=None, conv=None, executor=None): """Recursively interpolates construction variables from the Environment into the specified string, returning the expanded result. Construction variables are specified by a $ prefix in the string and begin with an initial underscore or alphabetic character followed by any number of underscores or alphanumeric characters. The construction variable names may be surrounded by curly braces to separate the name from trailing characters. """ gvars = self.gvars() lvars = self.lvars() lvars['__env__'] = self if executor: lvars.update(executor.get_lvars()) return SCons.Subst.scons_subst(string, self, raw, target, source, gvars, lvars, conv) def subst_kw(self, kw, raw=0, target=None, source=None): nkw = {} for k, v in kw.items(): k = self.subst(k, raw, target, source) if SCons.Util.is_String(v): v = self.subst(v, raw, target, source) nkw[k] = v return nkw def subst_list(self, string, raw=0, target=None, source=None, conv=None, executor=None): """Calls through to SCons.Subst.scons_subst_list(). See the documentation for that function.""" gvars = self.gvars() lvars = self.lvars() lvars['__env__'] = self if executor: lvars.update(executor.get_lvars()) return SCons.Subst.scons_subst_list(string, self, raw, target, source, gvars, lvars, conv) def subst_path(self, path, target=None, source=None): """Substitute a path list, turning EntryProxies into Nodes and leaving Nodes (and other objects) as-is.""" if not SCons.Util.is_List(path): path = [path] def s(obj): """This is the "string conversion" routine that we have our substitutions use to return Nodes, not strings. This relies on the fact that an EntryProxy object has a get() method that returns the underlying Node that it wraps, which is a bit of architectural dependence that we might need to break or modify in the future in response to additional requirements.""" try: get = obj.get except AttributeError: obj = SCons.Util.to_String_for_subst(obj) else: obj = get() return obj r = [] for p in path: if SCons.Util.is_String(p): p = self.subst(p, target=target, source=source, conv=s) if SCons.Util.is_List(p): if len(p) == 1: p = p[0] else: # We have an object plus a string, or multiple # objects that we need to smush together. No choice # but to make them into a string. p = ''.join(map(SCons.Util.to_String_for_subst, p)) else: p = s(p) r.append(p) return r subst_target_source = subst def backtick(self, command): import subprocess # common arguments kw = { 'stdin' : 'devnull', 'stdout' : subprocess.PIPE, 'stderr' : subprocess.PIPE, 'universal_newlines' : True, } # if the command is a list, assume it's been quoted # othewise force a shell if not SCons.Util.is_List(command): kw['shell'] = True # run constructed command p = SCons.Action._subproc(self, command, **kw) out,err = p.communicate() status = p.wait() if err: sys.stderr.write(u"" + err) if status: raise OSError("'%s' exited %d" % (command, status)) return out def AddMethod(self, function, name=None): """ Adds the specified function as a method of this construction environment with the specified name. If the name is omitted, the default name is the name of the function itself. """ method = MethodWrapper(self, function, name) self.added_methods.append(method) def RemoveMethod(self, function): """ Removes the specified function's MethodWrapper from the added_methods list, so we don't re-bind it when making a clone. """ self.added_methods = [dm for dm in self.added_methods if not dm.method is function] def Override(self, overrides): """ Produce a modified environment whose variables are overridden by the overrides dictionaries. "overrides" is a dictionary that will override the variables of this environment. This function is much more efficient than Clone() or creating a new Environment because it doesn't copy the construction environment dictionary, it just wraps the underlying construction environment, and doesn't even create a wrapper object if there are no overrides. """ if not overrides: return self o = copy_non_reserved_keywords(overrides) if not o: return self overrides = {} merges = None for key, value in o.items(): if key == 'parse_flags': merges = value else: overrides[key] = SCons.Subst.scons_subst_once(value, self, key) env = OverrideEnvironment(self, overrides) if merges: env.MergeFlags(merges) return env def ParseFlags(self, *flags): """ Parse the set of flags and return a dict with the flags placed in the appropriate entry. The flags are treated as a typical set of command-line flags for a GNU-like toolchain and used to populate the entries in the dict immediately below. If one of the flag strings begins with a bang (exclamation mark), it is assumed to be a command and the rest of the string is executed; the result of that evaluation is then added to the dict. """ dict = { 'ASFLAGS' : SCons.Util.CLVar(''), 'CFLAGS' : SCons.Util.CLVar(''), 'CCFLAGS' : SCons.Util.CLVar(''), 'CXXFLAGS' : SCons.Util.CLVar(''), 'CPPDEFINES' : [], 'CPPFLAGS' : SCons.Util.CLVar(''), 'CPPPATH' : [], 'FRAMEWORKPATH' : SCons.Util.CLVar(''), 'FRAMEWORKS' : SCons.Util.CLVar(''), 'LIBPATH' : [], 'LIBS' : [], 'LINKFLAGS' : SCons.Util.CLVar(''), 'RPATH' : [], } def do_parse(arg): # if arg is a sequence, recurse with each element if not arg: return if not SCons.Util.is_String(arg): for t in arg: do_parse(t) return # if arg is a command, execute it if arg[0] == '!': arg = self.backtick(arg[1:]) # utility function to deal with -D option def append_define(name, dict = dict): t = name.split('=') if len(t) == 1: dict['CPPDEFINES'].append(name) else: dict['CPPDEFINES'].append([t[0], '='.join(t[1:])]) # Loop through the flags and add them to the appropriate option. # This tries to strike a balance between checking for all possible # flags and keeping the logic to a finite size, so it doesn't # check for some that don't occur often. It particular, if the # flag is not known to occur in a config script and there's a way # of passing the flag to the right place (by wrapping it in a -W # flag, for example) we don't check for it. Note that most # preprocessor options are not handled, since unhandled options # are placed in CCFLAGS, so unless the preprocessor is invoked # separately, these flags will still get to the preprocessor. # Other options not currently handled: # -iqoutedir (preprocessor search path) # -u symbol (linker undefined symbol) # -s (linker strip files) # -static* (linker static binding) # -shared* (linker dynamic binding) # -symbolic (linker global binding) # -R dir (deprecated linker rpath) # IBM compilers may also accept -qframeworkdir=foo params = shlex.split(arg) append_next_arg_to = None # for multi-word args for arg in params: if append_next_arg_to: if append_next_arg_to == 'CPPDEFINES': append_define(arg) elif append_next_arg_to == '-include': t = ('-include', self.fs.File(arg)) dict['CCFLAGS'].append(t) elif append_next_arg_to == '-isysroot': t = ('-isysroot', arg) dict['CCFLAGS'].append(t) dict['LINKFLAGS'].append(t) elif append_next_arg_to == '-isystem': t = ('-isystem', arg) dict['CCFLAGS'].append(t) elif append_next_arg_to == '-arch': t = ('-arch', arg) dict['CCFLAGS'].append(t) dict['LINKFLAGS'].append(t) else: dict[append_next_arg_to].append(arg) append_next_arg_to = None elif not arg[0] in ['-', '+']: dict['LIBS'].append(self.fs.File(arg)) elif arg == '-dylib_file': dict['LINKFLAGS'].append(arg) append_next_arg_to = 'LINKFLAGS' elif arg[:2] == '-L': if arg[2:]: dict['LIBPATH'].append(arg[2:]) else: append_next_arg_to = 'LIBPATH' elif arg[:2] == '-l': if arg[2:]: dict['LIBS'].append(arg[2:]) else: append_next_arg_to = 'LIBS' elif arg[:2] == '-I': if arg[2:]: dict['CPPPATH'].append(arg[2:]) else: append_next_arg_to = 'CPPPATH' elif arg[:4] == '-Wa,': dict['ASFLAGS'].append(arg[4:]) dict['CCFLAGS'].append(arg) elif arg[:4] == '-Wl,': if arg[:11] == '-Wl,-rpath=': dict['RPATH'].append(arg[11:]) elif arg[:7] == '-Wl,-R,': dict['RPATH'].append(arg[7:]) elif arg[:6] == '-Wl,-R': dict['RPATH'].append(arg[6:]) else: dict['LINKFLAGS'].append(arg) elif arg[:4] == '-Wp,': dict['CPPFLAGS'].append(arg) elif arg[:2] == '-D': if arg[2:]: append_define(arg[2:]) else: append_next_arg_to = 'CPPDEFINES' elif arg == '-framework': append_next_arg_to = 'FRAMEWORKS' elif arg[:14] == '-frameworkdir=': dict['FRAMEWORKPATH'].append(arg[14:]) elif arg[:2] == '-F': if arg[2:]: dict['FRAMEWORKPATH'].append(arg[2:]) else: append_next_arg_to = 'FRAMEWORKPATH' elif arg in ['-mno-cygwin', '-pthread', '-openmp', '-fopenmp']: dict['CCFLAGS'].append(arg) dict['LINKFLAGS'].append(arg) elif arg == '-mwindows': dict['LINKFLAGS'].append(arg) elif arg[:5] == '-std=': if arg[5:].find('++')!=-1: key='CXXFLAGS' else: key='CFLAGS' dict[key].append(arg) elif arg[0] == '+': dict['CCFLAGS'].append(arg) dict['LINKFLAGS'].append(arg) elif arg in ['-include', '-isysroot', '-isystem', '-arch']: append_next_arg_to = arg else: dict['CCFLAGS'].append(arg) for arg in flags: do_parse(arg) return dict def MergeFlags(self, args, unique=1, dict=None): """ Merge the dict in args into the construction variables of this env, or the passed-in dict. If args is not a dict, it is converted into a dict using ParseFlags. If unique is not set, the flags are appended rather than merged. """ if dict is None: dict = self if not SCons.Util.is_Dict(args): args = self.ParseFlags(args) if not unique: self.Append(**args) return self for key, value in args.items(): if not value: continue try: orig = self[key] except KeyError: orig = value else: if not orig: orig = value elif value: # Add orig and value. The logic here was lifted from # part of env.Append() (see there for a lot of comments # about the order in which things are tried) and is # used mainly to handle coercion of strings to CLVar to # "do the right thing" given (e.g.) an original CCFLAGS # string variable like '-pipe -Wall'. try: orig = orig + value except (KeyError, TypeError): try: add_to_orig = orig.append except AttributeError: value.insert(0, orig) orig = value else: add_to_orig(value) t = [] if key[-4:] == 'PATH': ### keep left-most occurence for v in orig: if v not in t: t.append(v) else: ### keep right-most occurence orig.reverse() for v in orig: if v not in t: t.insert(0, v) self[key] = t return self def default_decide_source(dependency, target, prev_ni): f = SCons.Defaults.DefaultEnvironment().decide_source return f(dependency, target, prev_ni) def default_decide_target(dependency, target, prev_ni): f = SCons.Defaults.DefaultEnvironment().decide_target return f(dependency, target, prev_ni) def default_copy_from_cache(src, dst): f = SCons.Defaults.DefaultEnvironment().copy_from_cache return f(src, dst) class Base(SubstitutionEnvironment): """Base class for "real" construction Environments. These are the primary objects used to communicate dependency and construction information to the build engine. Keyword arguments supplied when the construction Environment is created are construction variables used to initialize the Environment. """ ####################################################################### # This is THE class for interacting with the SCons build engine, # and it contains a lot of stuff, so we're going to try to keep this # a little organized by grouping the methods. ####################################################################### ####################################################################### # Methods that make an Environment act like a dictionary. These have # the expected standard names for Python mapping objects. Note that # we don't actually make an Environment a subclass of UserDict for # performance reasons. Note also that we only supply methods for # dictionary functionality that we actually need and use. ####################################################################### def __init__(self, platform=None, tools=None, toolpath=None, variables=None, parse_flags = None, **kw): """ Initialization of a basic SCons construction environment, including setting up special construction variables like BUILDER, PLATFORM, etc., and searching for and applying available Tools. Note that we do *not* call the underlying base class (SubsitutionEnvironment) initialization, because we need to initialize things in a very specific order that doesn't work with the much simpler base class initialization. """ if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.Base') self._memo = {} self.fs = SCons.Node.FS.get_default_fs() self.ans = SCons.Node.Alias.default_ans self.lookup_list = SCons.Node.arg2nodes_lookups self._dict = semi_deepcopy(SCons.Defaults.ConstructionEnvironment) self._init_special() self.added_methods = [] # We don't use AddMethod, or define these as methods in this # class, because we *don't* want these functions to be bound # methods. They need to operate independently so that the # settings will work properly regardless of whether a given # target ends up being built with a Base environment or an # OverrideEnvironment or what have you. self.decide_target = default_decide_target self.decide_source = default_decide_source self.copy_from_cache = default_copy_from_cache self._dict['BUILDERS'] = BuilderDict(self._dict['BUILDERS'], self) if platform is None: platform = self._dict.get('PLATFORM', None) if platform is None: platform = SCons.Platform.Platform() if SCons.Util.is_String(platform): platform = SCons.Platform.Platform(platform) self._dict['PLATFORM'] = str(platform) platform(self) self._dict['HOST_OS'] = self._dict.get('HOST_OS',None) self._dict['HOST_ARCH'] = self._dict.get('HOST_ARCH',None) # Now set defaults for TARGET_{OS|ARCH} self._dict['TARGET_OS'] = self._dict.get('TARGET_OS',None) self._dict['TARGET_ARCH'] = self._dict.get('TARGET_ARCH',None) # Apply the passed-in and customizable variables to the # environment before calling the tools, because they may use # some of them during initialization. if 'options' in kw: # Backwards compatibility: they may stll be using the # old "options" keyword. variables = kw['options'] del kw['options'] self.Replace(**kw) keys = list(kw.keys()) if variables: keys = keys + list(variables.keys()) variables.Update(self) save = {} for k in keys: try: save[k] = self._dict[k] except KeyError: # No value may have been set if they tried to pass in a # reserved variable name like TARGETS. pass SCons.Tool.Initializers(self) if tools is None: tools = self._dict.get('TOOLS', None) if tools is None: tools = ['default'] apply_tools(self, tools, toolpath) # Now restore the passed-in and customized variables # to the environment, since the values the user set explicitly # should override any values set by the tools. for key, val in save.items(): self._dict[key] = val # Finally, apply any flags to be merged in if parse_flags: self.MergeFlags(parse_flags) ####################################################################### # Utility methods that are primarily for internal use by SCons. # These begin with lower-case letters. ####################################################################### def get_builder(self, name): """Fetch the builder with the specified name from the environment. """ try: return self._dict['BUILDERS'][name] except KeyError: return None def get_CacheDir(self): try: path = self._CacheDir_path except AttributeError: path = SCons.Defaults.DefaultEnvironment()._CacheDir_path try: if path == self._last_CacheDir_path: return self._last_CacheDir except AttributeError: pass cd = SCons.CacheDir.CacheDir(path) self._last_CacheDir_path = path self._last_CacheDir = cd return cd def get_factory(self, factory, default='File'): """Return a factory function for creating Nodes for this construction environment. """ name = default try: is_node = issubclass(factory, SCons.Node.FS.Base) except TypeError: # The specified factory isn't a Node itself--it's # most likely None, or possibly a callable. pass else: if is_node: # The specified factory is a Node (sub)class. Try to # return the FS method that corresponds to the Node's # name--that is, we return self.fs.Dir if they want a Dir, # self.fs.File for a File, etc. try: name = factory.__name__ except AttributeError: pass else: factory = None if not factory: # They passed us None, or we picked up a name from a specified # class, so return the FS method. (Note that we *don't* # use our own self.{Dir,File} methods because that would # cause env.subst() to be called twice on the file name, # interfering with files that have $$ in them.) factory = getattr(self.fs, name) return factory @SCons.Memoize.CountMethodCall def _gsm(self): try: return self._memo['_gsm'] except KeyError: pass result = {} try: scanners = self._dict['SCANNERS'] except KeyError: pass else: # Reverse the scanner list so that, if multiple scanners # claim they can scan the same suffix, earlier scanners # in the list will overwrite later scanners, so that # the result looks like a "first match" to the user. if not SCons.Util.is_List(scanners): scanners = [scanners] else: scanners = scanners[:] # copy so reverse() doesn't mod original scanners.reverse() for scanner in scanners: for k in scanner.get_skeys(self): if k and self['PLATFORM'] == 'win32': k = k.lower() result[k] = scanner self._memo['_gsm'] = result return result def get_scanner(self, skey): """Find the appropriate scanner given a key (usually a file suffix). """ if skey and self['PLATFORM'] == 'win32': skey = skey.lower() return self._gsm().get(skey) def scanner_map_delete(self, kw=None): """Delete the cached scanner map (if we need to). """ try: del self._memo['_gsm'] except KeyError: pass def _update(self, dict): """Update an environment's values directly, bypassing the normal checks that occur when users try to set items. """ self._dict.update(dict) def get_src_sig_type(self): try: return self.src_sig_type except AttributeError: t = SCons.Defaults.DefaultEnvironment().src_sig_type self.src_sig_type = t return t def get_tgt_sig_type(self): try: return self.tgt_sig_type except AttributeError: t = SCons.Defaults.DefaultEnvironment().tgt_sig_type self.tgt_sig_type = t return t ####################################################################### # Public methods for manipulating an Environment. These begin with # upper-case letters. The essential characteristic of methods in # this section is that they do *not* have corresponding same-named # global functions. For example, a stand-alone Append() function # makes no sense, because Append() is all about appending values to # an Environment's construction variables. ####################################################################### def Append(self, **kw): """Append values to existing construction variables in an Environment. """ kw = copy_non_reserved_keywords(kw) for key, val in kw.items(): # It would be easier on the eyes to write this using # "continue" statements whenever we finish processing an item, # but Python 1.5.2 apparently doesn't let you use "continue" # within try:-except: blocks, so we have to nest our code. try: if key == 'CPPDEFINES' and SCons.Util.is_String(self._dict[key]): self._dict[key] = [self._dict[key]] orig = self._dict[key] except KeyError: # No existing variable in the environment, so just set # it to the new value. if key == 'CPPDEFINES' and SCons.Util.is_String(val): self._dict[key] = [val] else: self._dict[key] = val else: try: # Check if the original looks like a dictionary. # If it is, we can't just try adding the value because # dictionaries don't have __add__() methods, and # things like UserList will incorrectly coerce the # original dict to a list (which we don't want). update_dict = orig.update except AttributeError: try: # Most straightforward: just try to add them # together. This will work in most cases, when the # original and new values are of compatible types. self._dict[key] = orig + val except (KeyError, TypeError): try: # Check if the original is a list. add_to_orig = orig.append except AttributeError: # The original isn't a list, but the new # value is (by process of elimination), # so insert the original in the new value # (if there's one to insert) and replace # the variable with it. if orig: val.insert(0, orig) self._dict[key] = val else: # The original is a list, so append the new # value to it (if there's a value to append). if val: add_to_orig(val) else: # The original looks like a dictionary, so update it # based on what we think the value looks like. if SCons.Util.is_List(val): if key == 'CPPDEFINES': tmp = [] for (k, v) in orig.items(): if v is not None: tmp.append((k, v)) else: tmp.append((k,)) orig = tmp orig += val self._dict[key] = orig else: for v in val: orig[v] = None else: try: update_dict(val) except (AttributeError, TypeError, ValueError): if SCons.Util.is_Dict(val): for k, v in val.items(): orig[k] = v else: orig[val] = None self.scanner_map_delete(kw) # allow Dirs and strings beginning with # for top-relative # Note this uses the current env's fs (in self). def _canonicalize(self, path): if not SCons.Util.is_String(path): # typically a Dir path = str(path) if path and path[0] == '#': path = str(self.fs.Dir(path)) return path def AppendENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep, delete_existing=1): """Append path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string. If delete_existing is 0, a newpath which is already in the path will not be moved to the end (it will be left where it is). """ orig = '' if envname in self._dict and name in self._dict[envname]: orig = self._dict[envname][name] nv = SCons.Util.AppendPath(orig, newpath, sep, delete_existing, canonicalize=self._canonicalize) if envname not in self._dict: self._dict[envname] = {} self._dict[envname][name] = nv def AppendUnique(self, delete_existing=0, **kw): """Append values to existing construction variables in an Environment, if they're not already there. If delete_existing is 1, removes existing values first, so values move to end. """ kw = copy_non_reserved_keywords(kw) for key, val in kw.items(): if SCons.Util.is_List(val): val = _delete_duplicates(val, delete_existing) if key not in self._dict or self._dict[key] in ('', None): self._dict[key] = val elif SCons.Util.is_Dict(self._dict[key]) and \ SCons.Util.is_Dict(val): self._dict[key].update(val) elif SCons.Util.is_List(val): dk = self._dict[key] if key == 'CPPDEFINES': tmp = [] for i in val: if SCons.Util.is_List(i): if len(i) >= 2: tmp.append((i[0], i[1])) else: tmp.append((i[0],)) elif SCons.Util.is_Tuple(i): tmp.append(i) else: tmp.append((i,)) val = tmp # Construct a list of (key, value) tuples. if SCons.Util.is_Dict(dk): tmp = [] for (k, v) in dk.items(): if v is not None: tmp.append((k, v)) else: tmp.append((k,)) dk = tmp elif SCons.Util.is_String(dk): dk = [(dk,)] else: tmp = [] for i in dk: if SCons.Util.is_List(i): if len(i) >= 2: tmp.append((i[0], i[1])) else: tmp.append((i[0],)) elif SCons.Util.is_Tuple(i): tmp.append(i) else: tmp.append((i,)) dk = tmp else: if not SCons.Util.is_List(dk): dk = [dk] if delete_existing: dk = [x for x in dk if x not in val] else: val = [x for x in val if x not in dk] self._dict[key] = dk + val else: dk = self._dict[key] if SCons.Util.is_List(dk): if key == 'CPPDEFINES': tmp = [] for i in dk: if SCons.Util.is_List(i): if len(i) >= 2: tmp.append((i[0], i[1])) else: tmp.append((i[0],)) elif SCons.Util.is_Tuple(i): tmp.append(i) else: tmp.append((i,)) dk = tmp # Construct a list of (key, value) tuples. if SCons.Util.is_Dict(val): tmp = [] for (k, v) in val.items(): if v is not None: tmp.append((k, v)) else: tmp.append((k,)) val = tmp elif SCons.Util.is_String(val): val = [(val,)] if delete_existing: dk = list(filter(lambda x, val=val: x not in val, dk)) self._dict[key] = dk + val else: dk = [x for x in dk if x not in val] self._dict[key] = dk + val else: # By elimination, val is not a list. Since dk is a # list, wrap val in a list first. if delete_existing: dk = list(filter(lambda x, val=val: x not in val, dk)) self._dict[key] = dk + [val] else: if not val in dk: self._dict[key] = dk + [val] else: if key == 'CPPDEFINES': if SCons.Util.is_String(dk): dk = [dk] elif SCons.Util.is_Dict(dk): tmp = [] for (k, v) in dk.items(): if v is not None: tmp.append((k, v)) else: tmp.append((k,)) dk = tmp if SCons.Util.is_String(val): if val in dk: val = [] else: val = [val] elif SCons.Util.is_Dict(val): tmp = [] for i,j in val.items(): if j is not None: tmp.append((i,j)) else: tmp.append(i) val = tmp if delete_existing: dk = [x for x in dk if x not in val] self._dict[key] = dk + val self.scanner_map_delete(kw) def Clone(self, tools=[], toolpath=None, parse_flags = None, **kw): """Return a copy of a construction Environment. The copy is like a Python "deep copy"--that is, independent copies are made recursively of each objects--except that a reference is copied when an object is not deep-copyable (like a function). There are no references to any mutable objects in the original Environment. """ builders = self._dict.get('BUILDERS', {}) clone = copy.copy(self) # BUILDERS is not safe to do a simple copy clone._dict = semi_deepcopy_dict(self._dict, ['BUILDERS']) clone._dict['BUILDERS'] = BuilderDict(builders, clone) # Check the methods added via AddMethod() and re-bind them to # the cloned environment. Only do this if the attribute hasn't # been overwritten by the user explicitly and still points to # the added method. clone.added_methods = [] for mw in self.added_methods: if mw == getattr(self, mw.name): clone.added_methods.append(mw.clone(clone)) clone._memo = {} # Apply passed-in variables before the tools # so the tools can use the new variables kw = copy_non_reserved_keywords(kw) new = {} for key, value in kw.items(): new[key] = SCons.Subst.scons_subst_once(value, self, key) clone.Replace(**new) apply_tools(clone, tools, toolpath) # apply them again in case the tools overwrote them clone.Replace(**new) # Finally, apply any flags to be merged in if parse_flags: clone.MergeFlags(parse_flags) if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.EnvironmentClone') return clone def Copy(self, *args, **kw): global _warn_copy_deprecated if _warn_copy_deprecated: msg = "The env.Copy() method is deprecated; use the env.Clone() method instead." SCons.Warnings.warn(SCons.Warnings.DeprecatedCopyWarning, msg) _warn_copy_deprecated = False return self.Clone(*args, **kw) def _changed_build(self, dependency, target, prev_ni): if dependency.changed_state(target, prev_ni): return 1 return self.decide_source(dependency, target, prev_ni) def _changed_content(self, dependency, target, prev_ni): return dependency.changed_content(target, prev_ni) def _changed_source(self, dependency, target, prev_ni): target_env = dependency.get_build_env() type = target_env.get_tgt_sig_type() if type == 'source': return target_env.decide_source(dependency, target, prev_ni) else: return target_env.decide_target(dependency, target, prev_ni) def _changed_timestamp_then_content(self, dependency, target, prev_ni): return dependency.changed_timestamp_then_content(target, prev_ni) def _changed_timestamp_newer(self, dependency, target, prev_ni): return dependency.changed_timestamp_newer(target, prev_ni) def _changed_timestamp_match(self, dependency, target, prev_ni): return dependency.changed_timestamp_match(target, prev_ni) def _copy_from_cache(self, src, dst): return self.fs.copy(src, dst) def _copy2_from_cache(self, src, dst): return self.fs.copy2(src, dst) def Decider(self, function): copy_function = self._copy2_from_cache if function in ('MD5', 'content'): if not SCons.Util.md5: raise UserError("MD5 signatures are not available in this version of Python.") function = self._changed_content elif function == 'MD5-timestamp': function = self._changed_timestamp_then_content elif function in ('timestamp-newer', 'make'): function = self._changed_timestamp_newer copy_function = self._copy_from_cache elif function == 'timestamp-match': function = self._changed_timestamp_match elif not callable(function): raise UserError("Unknown Decider value %s" % repr(function)) # We don't use AddMethod because we don't want to turn the # function, which only expects three arguments, into a bound # method, which would add self as an initial, fourth argument. self.decide_target = function self.decide_source = function self.copy_from_cache = copy_function def Detect(self, progs): """Return the first available program in progs. """ if not SCons.Util.is_List(progs): progs = [ progs ] for prog in progs: path = self.WhereIs(prog) if path: return prog return None def Dictionary(self, *args): if not args: return self._dict dlist = [self._dict[x] for x in args] if len(dlist) == 1: dlist = dlist[0] return dlist def Dump(self, key = None): """ Using the standard Python pretty printer, return the contents of the scons build environment as a string. If the key passed in is anything other than None, then that will be used as an index into the build environment dictionary and whatever is found there will be fed into the pretty printer. Note that this key is case sensitive. """ import pprint pp = pprint.PrettyPrinter(indent=2) if key: dict = self.Dictionary(key) else: dict = self.Dictionary() return pp.pformat(dict) def FindIxes(self, paths, prefix, suffix): """ Search a list of paths for something that matches the prefix and suffix. paths - the list of paths or nodes. prefix - construction variable for the prefix. suffix - construction variable for the suffix. """ suffix = self.subst('$'+suffix) prefix = self.subst('$'+prefix) for path in paths: dir,name = os.path.split(str(path)) if name[:len(prefix)] == prefix and name[-len(suffix):] == suffix: return path def ParseConfig(self, command, function=None, unique=1): """ Use the specified function to parse the output of the command in order to modify the current environment. The 'command' can be a string or a list of strings representing a command and its arguments. 'Function' is an optional argument that takes the environment, the output of the command, and the unique flag. If no function is specified, MergeFlags, which treats the output as the result of a typical 'X-config' command (i.e. gtk-config), will merge the output into the appropriate variables. """ if function is None: def parse_conf(env, cmd, unique=unique): return env.MergeFlags(cmd, unique) function = parse_conf if SCons.Util.is_List(command): command = ' '.join(command) command = self.subst(command) return function(self, self.backtick(command)) def ParseDepends(self, filename, must_exist=None, only_one=0): """ Parse a mkdep-style file for explicit dependencies. This is completely abusable, and should be unnecessary in the "normal" case of proper SCons configuration, but it may help make the transition from a Make hierarchy easier for some people to swallow. It can also be genuinely useful when using a tool that can write a .d file, but for which writing a scanner would be too complicated. """ filename = self.subst(filename) try: fp = open(filename, 'r') except IOError: if must_exist: raise return lines = SCons.Util.LogicalLines(fp).readlines() lines = [l for l in lines if l[0] != '#'] tdlist = [] for line in lines: try: target, depends = line.split(':', 1) except (AttributeError, ValueError): # Throws AttributeError if line isn't a string. Can throw # ValueError if line doesn't split into two or more elements. pass else: tdlist.append((target.split(), depends.split())) if only_one: targets = [] for td in tdlist: targets.extend(td[0]) if len(targets) > 1: raise SCons.Errors.UserError( "More than one dependency target found in `%s': %s" % (filename, targets)) for target, depends in tdlist: self.Depends(target, depends) def Platform(self, platform): platform = self.subst(platform) return SCons.Platform.Platform(platform)(self) def Prepend(self, **kw): """Prepend values to existing construction variables in an Environment. """ kw = copy_non_reserved_keywords(kw) for key, val in kw.items(): # It would be easier on the eyes to write this using # "continue" statements whenever we finish processing an item, # but Python 1.5.2 apparently doesn't let you use "continue" # within try:-except: blocks, so we have to nest our code. try: orig = self._dict[key] except KeyError: # No existing variable in the environment, so just set # it to the new value. self._dict[key] = val else: try: # Check if the original looks like a dictionary. # If it is, we can't just try adding the value because # dictionaries don't have __add__() methods, and # things like UserList will incorrectly coerce the # original dict to a list (which we don't want). update_dict = orig.update except AttributeError: try: # Most straightforward: just try to add them # together. This will work in most cases, when the # original and new values are of compatible types. self._dict[key] = val + orig except (KeyError, TypeError): try: # Check if the added value is a list. add_to_val = val.append except AttributeError: # The added value isn't a list, but the # original is (by process of elimination), # so insert the the new value in the original # (if there's one to insert). if val: orig.insert(0, val) else: # The added value is a list, so append # the original to it (if there's a value # to append). if orig: add_to_val(orig) self._dict[key] = val else: # The original looks like a dictionary, so update it # based on what we think the value looks like. if SCons.Util.is_List(val): for v in val: orig[v] = None else: try: update_dict(val) except (AttributeError, TypeError, ValueError): if SCons.Util.is_Dict(val): for k, v in val.items(): orig[k] = v else: orig[val] = None self.scanner_map_delete(kw) def PrependENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep, delete_existing=1): """Prepend path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string. If delete_existing is 0, a newpath which is already in the path will not be moved to the front (it will be left where it is). """ orig = '' if envname in self._dict and name in self._dict[envname]: orig = self._dict[envname][name] nv = SCons.Util.PrependPath(orig, newpath, sep, delete_existing, canonicalize=self._canonicalize) if envname not in self._dict: self._dict[envname] = {} self._dict[envname][name] = nv def PrependUnique(self, delete_existing=0, **kw): """Prepend values to existing construction variables in an Environment, if they're not already there. If delete_existing is 1, removes existing values first, so values move to front. """ kw = copy_non_reserved_keywords(kw) for key, val in kw.items(): if SCons.Util.is_List(val): val = _delete_duplicates(val, not delete_existing) if key not in self._dict or self._dict[key] in ('', None): self._dict[key] = val elif SCons.Util.is_Dict(self._dict[key]) and \ SCons.Util.is_Dict(val): self._dict[key].update(val) elif SCons.Util.is_List(val): dk = self._dict[key] if not SCons.Util.is_List(dk): dk = [dk] if delete_existing: dk = [x for x in dk if x not in val] else: val = [x for x in val if x not in dk] self._dict[key] = val + dk else: dk = self._dict[key] if SCons.Util.is_List(dk): # By elimination, val is not a list. Since dk is a # list, wrap val in a list first. if delete_existing: dk = [x for x in dk if x not in val] self._dict[key] = [val] + dk else: if not val in dk: self._dict[key] = [val] + dk else: if delete_existing: dk = [x for x in dk if x not in val] self._dict[key] = val + dk self.scanner_map_delete(kw) def Replace(self, **kw): """Replace existing construction variables in an Environment with new construction variables and/or values. """ try: kwbd = kw['BUILDERS'] except KeyError: pass else: kwbd = BuilderDict(kwbd,self) del kw['BUILDERS'] self.__setitem__('BUILDERS', kwbd) kw = copy_non_reserved_keywords(kw) self._update(semi_deepcopy(kw)) self.scanner_map_delete(kw) def ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix): """ Replace old_prefix with new_prefix and old_suffix with new_suffix. env - Environment used to interpolate variables. path - the path that will be modified. old_prefix - construction variable for the old prefix. old_suffix - construction variable for the old suffix. new_prefix - construction variable for the new prefix. new_suffix - construction variable for the new suffix. """ old_prefix = self.subst('$'+old_prefix) old_suffix = self.subst('$'+old_suffix) new_prefix = self.subst('$'+new_prefix) new_suffix = self.subst('$'+new_suffix) dir,name = os.path.split(str(path)) if name[:len(old_prefix)] == old_prefix: name = name[len(old_prefix):] if name[-len(old_suffix):] == old_suffix: name = name[:-len(old_suffix)] return os.path.join(dir, new_prefix+name+new_suffix) def SetDefault(self, **kw): for k in list(kw.keys()): if k in self._dict: del kw[k] self.Replace(**kw) def _find_toolpath_dir(self, tp): return self.fs.Dir(self.subst(tp)).srcnode().get_abspath() def Tool(self, tool, toolpath=None, **kw): if SCons.Util.is_String(tool): tool = self.subst(tool) if toolpath is None: toolpath = self.get('toolpath', []) toolpath = list(map(self._find_toolpath_dir, toolpath)) tool = SCons.Tool.Tool(tool, toolpath, **kw) tool(self) def WhereIs(self, prog, path=None, pathext=None, reject=[]): """Find prog in the path. """ if path is None: try: path = self['ENV']['PATH'] except KeyError: pass elif SCons.Util.is_String(path): path = self.subst(path) if pathext is None: try: pathext = self['ENV']['PATHEXT'] except KeyError: pass elif SCons.Util.is_String(pathext): pathext = self.subst(pathext) prog = SCons.Util.CLVar(self.subst(prog)) # support "program --with-args" path = SCons.Util.WhereIs(prog[0], path, pathext, reject) if path: return path return None ####################################################################### # Public methods for doing real "SCons stuff" (manipulating # dependencies, setting attributes on targets, etc.). These begin # with upper-case letters. The essential characteristic of methods # in this section is that they all *should* have corresponding # same-named global functions. ####################################################################### def Action(self, *args, **kw): def subst_string(a, self=self): if SCons.Util.is_String(a): a = self.subst(a) return a nargs = list(map(subst_string, args)) nkw = self.subst_kw(kw) return SCons.Action.Action(*nargs, **nkw) def AddPreAction(self, files, action): nodes = self.arg2nodes(files, self.fs.Entry) action = SCons.Action.Action(action) uniq = {} for executor in [n.get_executor() for n in nodes]: uniq[executor] = 1 for executor in list(uniq.keys()): executor.add_pre_action(action) return nodes def AddPostAction(self, files, action): nodes = self.arg2nodes(files, self.fs.Entry) action = SCons.Action.Action(action) uniq = {} for executor in [n.get_executor() for n in nodes]: uniq[executor] = 1 for executor in list(uniq.keys()): executor.add_post_action(action) return nodes def Alias(self, target, source=[], action=None, **kw): tlist = self.arg2nodes(target, self.ans.Alias) if not SCons.Util.is_List(source): source = [source] source = [_f for _f in source if _f] if not action: if not source: # There are no source files and no action, so just # return a target list of classic Alias Nodes, without # any builder. The externally visible effect is that # this will make the wrapping Script.BuildTask class # say that there's "Nothing to be done" for this Alias, # instead of that it's "up to date." return tlist # No action, but there are sources. Re-call all the target # builders to add the sources to each target. result = [] for t in tlist: bld = t.get_builder(AliasBuilder) result.extend(bld(self, t, source)) return result nkw = self.subst_kw(kw) nkw.update({ 'action' : SCons.Action.Action(action), 'source_factory' : self.fs.Entry, 'multi' : 1, 'is_explicit' : None, }) bld = SCons.Builder.Builder(**nkw) # Apply the Builder separately to each target so that the Aliases # stay separate. If we did one "normal" Builder call with the # whole target list, then all of the target Aliases would be # associated under a single Executor. result = [] for t in tlist: # Calling the convert() method will cause a new Executor to be # created from scratch, so we have to explicitly initialize # it with the target's existing sources, plus our new ones, # so nothing gets lost. b = t.get_builder() if b is None or b is AliasBuilder: b = bld else: nkw['action'] = b.action + action b = SCons.Builder.Builder(**nkw) t.convert() result.extend(b(self, t, t.sources + source)) return result def AlwaysBuild(self, *targets): tlist = [] for t in targets: tlist.extend(self.arg2nodes(t, self.fs.Entry)) for t in tlist: t.set_always_build() return tlist def BuildDir(self, *args, **kw): msg = """BuildDir() and the build_dir keyword have been deprecated;\n\tuse VariantDir() and the variant_dir keyword instead.""" SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg) if 'build_dir' in kw: kw['variant_dir'] = kw['build_dir'] del kw['build_dir'] return self.VariantDir(*args, **kw) def Builder(self, **kw): nkw = self.subst_kw(kw) return SCons.Builder.Builder(**nkw) def CacheDir(self, path): import SCons.CacheDir if path is not None: path = self.subst(path) self._CacheDir_path = path def Clean(self, targets, files): global CleanTargets tlist = self.arg2nodes(targets, self.fs.Entry) flist = self.arg2nodes(files, self.fs.Entry) for t in tlist: try: CleanTargets[t].extend(flist) except KeyError: CleanTargets[t] = flist def Configure(self, *args, **kw): nargs = [self] if args: nargs = nargs + self.subst_list(args)[0] nkw = self.subst_kw(kw) nkw['_depth'] = kw.get('_depth', 0) + 1 try: nkw['custom_tests'] = self.subst_kw(nkw['custom_tests']) except KeyError: pass return SCons.SConf.SConf(*nargs, **nkw) def Command(self, target, source, action, **kw): """Builds the supplied target files from the supplied source files using the supplied action. Action may be any type that the Builder constructor will accept for an action.""" bkw = { 'action' : action, 'target_factory' : self.fs.Entry, 'source_factory' : self.fs.Entry, } try: bkw['source_scanner'] = kw['source_scanner'] except KeyError: pass else: del kw['source_scanner'] bld = SCons.Builder.Builder(**bkw) return bld(self, target, source, **kw) def Depends(self, target, dependency): """Explicity specify that 'target's depend on 'dependency'.""" tlist = self.arg2nodes(target, self.fs.Entry) dlist = self.arg2nodes(dependency, self.fs.Entry) for t in tlist: t.add_dependency(dlist) return tlist def Dir(self, name, *args, **kw): """ """ s = self.subst(name) if SCons.Util.is_Sequence(s): result=[] for e in s: result.append(self.fs.Dir(e, *args, **kw)) return result return self.fs.Dir(s, *args, **kw) def PyPackageDir(self, modulename): s = self.subst(modulename) if SCons.Util.is_Sequence(s): result=[] for e in s: result.append(self.fs.PyPackageDir(e)) return result return self.fs.PyPackageDir(s) def NoClean(self, *targets): """Tags a target so that it will not be cleaned by -c""" tlist = [] for t in targets: tlist.extend(self.arg2nodes(t, self.fs.Entry)) for t in tlist: t.set_noclean() return tlist def NoCache(self, *targets): """Tags a target so that it will not be cached""" tlist = [] for t in targets: tlist.extend(self.arg2nodes(t, self.fs.Entry)) for t in tlist: t.set_nocache() return tlist def Entry(self, name, *args, **kw): """ """ s = self.subst(name) if SCons.Util.is_Sequence(s): result=[] for e in s: result.append(self.fs.Entry(e, *args, **kw)) return result return self.fs.Entry(s, *args, **kw) def Environment(self, **kw): return SCons.Environment.Environment(**self.subst_kw(kw)) def Execute(self, action, *args, **kw): """Directly execute an action through an Environment """ action = self.Action(action, *args, **kw) result = action([], [], self) if isinstance(result, SCons.Errors.BuildError): errstr = result.errstr if result.filename: errstr = result.filename + ': ' + errstr sys.stderr.write("scons: *** %s\n" % errstr) return result.status else: return result def File(self, name, *args, **kw): """ """ s = self.subst(name) if SCons.Util.is_Sequence(s): result=[] for e in s: result.append(self.fs.File(e, *args, **kw)) return result return self.fs.File(s, *args, **kw) def FindFile(self, file, dirs): file = self.subst(file) nodes = self.arg2nodes(dirs, self.fs.Dir) return SCons.Node.FS.find_file(file, tuple(nodes)) def Flatten(self, sequence): return SCons.Util.flatten(sequence) def GetBuildPath(self, files): result = list(map(str, self.arg2nodes(files, self.fs.Entry))) if SCons.Util.is_List(files): return result else: return result[0] def Glob(self, pattern, ondisk=True, source=False, strings=False, exclude=None): return self.fs.Glob(self.subst(pattern), ondisk, source, strings, exclude) def Ignore(self, target, dependency): """Ignore a dependency.""" tlist = self.arg2nodes(target, self.fs.Entry) dlist = self.arg2nodes(dependency, self.fs.Entry) for t in tlist: t.add_ignore(dlist) return tlist def Literal(self, string): return SCons.Subst.Literal(string) def Local(self, *targets): ret = [] for targ in targets: if isinstance(targ, SCons.Node.Node): targ.set_local() ret.append(targ) else: for t in self.arg2nodes(targ, self.fs.Entry): t.set_local() ret.append(t) return ret def Precious(self, *targets): tlist = [] for t in targets: tlist.extend(self.arg2nodes(t, self.fs.Entry)) for t in tlist: t.set_precious() return tlist def Pseudo(self, *targets): tlist = [] for t in targets: tlist.extend(self.arg2nodes(t, self.fs.Entry)) for t in tlist: t.set_pseudo() return tlist def Repository(self, *dirs, **kw): dirs = self.arg2nodes(list(dirs), self.fs.Dir) self.fs.Repository(*dirs, **kw) def Requires(self, target, prerequisite): """Specify that 'prerequisite' must be built before 'target', (but 'target' does not actually depend on 'prerequisite' and need not be rebuilt if it changes).""" tlist = self.arg2nodes(target, self.fs.Entry) plist = self.arg2nodes(prerequisite, self.fs.Entry) for t in tlist: t.add_prerequisite(plist) return tlist def Scanner(self, *args, **kw): nargs = [] for arg in args: if SCons.Util.is_String(arg): arg = self.subst(arg) nargs.append(arg) nkw = self.subst_kw(kw) return SCons.Scanner.Base(*nargs, **nkw) def SConsignFile(self, name=".sconsign", dbm_module=None): if name is not None: name = self.subst(name) if not os.path.isabs(name): name = os.path.join(str(self.fs.SConstruct_dir), name) if name: name = os.path.normpath(name) sconsign_dir = os.path.dirname(name) if sconsign_dir and not os.path.exists(sconsign_dir): self.Execute(SCons.Defaults.Mkdir(sconsign_dir)) SCons.SConsign.File(name, dbm_module) def SideEffect(self, side_effect, target): """Tell scons that side_effects are built as side effects of building targets.""" side_effects = self.arg2nodes(side_effect, self.fs.Entry) targets = self.arg2nodes(target, self.fs.Entry) for side_effect in side_effects: if side_effect.multiple_side_effect_has_builder(): raise SCons.Errors.UserError("Multiple ways to build the same target were specified for: %s" % str(side_effect)) side_effect.add_source(targets) side_effect.side_effect = 1 self.Precious(side_effect) for target in targets: target.side_effects.append(side_effect) return side_effects def SourceCode(self, entry, builder): """Arrange for a source code builder for (part of) a tree.""" msg = """SourceCode() has been deprecated and there is no replacement. \tIf you need this function, please contact scons-dev@scons.org""" SCons.Warnings.warn(SCons.Warnings.DeprecatedSourceCodeWarning, msg) entries = self.arg2nodes(entry, self.fs.Entry) for entry in entries: entry.set_src_builder(builder) return entries def SourceSignatures(self, type): global _warn_source_signatures_deprecated if _warn_source_signatures_deprecated: msg = "The env.SourceSignatures() method is deprecated;\n" + \ "\tconvert your build to use the env.Decider() method instead." SCons.Warnings.warn(SCons.Warnings.DeprecatedSourceSignaturesWarning, msg) _warn_source_signatures_deprecated = False type = self.subst(type) self.src_sig_type = type if type == 'MD5': if not SCons.Util.md5: raise UserError("MD5 signatures are not available in this version of Python.") self.decide_source = self._changed_content elif type == 'timestamp': self.decide_source = self._changed_timestamp_match else: raise UserError("Unknown source signature type '%s'" % type) def Split(self, arg): """This function converts a string or list into a list of strings or Nodes. This makes things easier for users by allowing files to be specified as a white-space separated list to be split. The input rules are: - A single string containing names separated by spaces. These will be split apart at the spaces. - A single Node instance - A list containing either strings or Node instances. Any strings in the list are not split at spaces. In all cases, the function returns a list of Nodes and strings.""" if SCons.Util.is_List(arg): return list(map(self.subst, arg)) elif SCons.Util.is_String(arg): return self.subst(arg).split() else: return [self.subst(arg)] def TargetSignatures(self, type): global _warn_target_signatures_deprecated if _warn_target_signatures_deprecated: msg = "The env.TargetSignatures() method is deprecated;\n" + \ "\tconvert your build to use the env.Decider() method instead." SCons.Warnings.warn(SCons.Warnings.DeprecatedTargetSignaturesWarning, msg) _warn_target_signatures_deprecated = False type = self.subst(type) self.tgt_sig_type = type if type in ('MD5', 'content'): if not SCons.Util.md5: raise UserError("MD5 signatures are not available in this version of Python.") self.decide_target = self._changed_content elif type == 'timestamp': self.decide_target = self._changed_timestamp_match elif type == 'build': self.decide_target = self._changed_build elif type == 'source': self.decide_target = self._changed_source else: raise UserError("Unknown target signature type '%s'"%type) def Value(self, value, built_value=None): """ """ return SCons.Node.Python.Value(value, built_value) def VariantDir(self, variant_dir, src_dir, duplicate=1): variant_dir = self.arg2nodes(variant_dir, self.fs.Dir)[0] src_dir = self.arg2nodes(src_dir, self.fs.Dir)[0] self.fs.VariantDir(variant_dir, src_dir, duplicate) def FindSourceFiles(self, node='.'): """ returns a list of all source files. """ node = self.arg2nodes(node, self.fs.Entry)[0] sources = [] def build_source(ss): for s in ss: if isinstance(s, SCons.Node.FS.Dir): build_source(s.all_children()) elif s.has_builder(): build_source(s.sources) elif isinstance(s.disambiguate(), SCons.Node.FS.File): sources.append(s) build_source(node.all_children()) def final_source(node): while (node != node.srcnode()): node = node.srcnode() return node sources = list(map( final_source, sources )); # remove duplicates return list(set(sources)) def FindInstalledFiles(self): """ returns the list of all targets of the Install and InstallAs Builder. """ from SCons.Tool import install if install._UNIQUE_INSTALLED_FILES is None: install._UNIQUE_INSTALLED_FILES = SCons.Util.uniquer_hashables(install._INSTALLED_FILES) return install._UNIQUE_INSTALLED_FILES class OverrideEnvironment(Base): """A proxy that overrides variables in a wrapped construction environment by returning values from an overrides dictionary in preference to values from the underlying subject environment. This is a lightweight (I hope) proxy that passes through most use of attributes to the underlying Environment.Base class, but has just enough additional methods defined to act like a real construction environment with overridden values. It can wrap either a Base construction environment, or another OverrideEnvironment, which can in turn nest arbitrary OverrideEnvironments... Note that we do *not* call the underlying base class (SubsitutionEnvironment) initialization, because we get most of those from proxying the attributes of the subject construction environment. But because we subclass SubstitutionEnvironment, this class also has inherited arg2nodes() and subst*() methods; those methods can't be proxied because they need *this* object's methods to fetch the values from the overrides dictionary. """ def __init__(self, subject, overrides={}): if SCons.Debug.track_instances: logInstanceCreation(self, 'Environment.OverrideEnvironment') self.__dict__['__subject'] = subject self.__dict__['overrides'] = overrides # Methods that make this class act like a proxy. def __getattr__(self, name): return getattr(self.__dict__['__subject'], name) def __setattr__(self, name, value): setattr(self.__dict__['__subject'], name, value) # Methods that make this class act like a dictionary. def __getitem__(self, key): try: return self.__dict__['overrides'][key] except KeyError: return self.__dict__['__subject'].__getitem__(key) def __setitem__(self, key, value): if not is_valid_construction_var(key): raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self.__dict__['overrides'][key] = value def __delitem__(self, key): try: del self.__dict__['overrides'][key] except KeyError: deleted = 0 else: deleted = 1 try: result = self.__dict__['__subject'].__delitem__(key) except KeyError: if not deleted: raise result = None return result def get(self, key, default=None): """Emulates the get() method of dictionaries.""" try: return self.__dict__['overrides'][key] except KeyError: return self.__dict__['__subject'].get(key, default) def has_key(self, key): try: self.__dict__['overrides'][key] return 1 except KeyError: return key in self.__dict__['__subject'] def __contains__(self, key): if self.__dict__['overrides'].__contains__(key): return 1 return self.__dict__['__subject'].__contains__(key) def Dictionary(self): """Emulates the items() method of dictionaries.""" d = self.__dict__['__subject'].Dictionary().copy() d.update(self.__dict__['overrides']) return d def items(self): """Emulates the items() method of dictionaries.""" return list(self.Dictionary().items()) # Overridden private construction environment methods. def _update(self, dict): """Update an environment's values directly, bypassing the normal checks that occur when users try to set items. """ self.__dict__['overrides'].update(dict) def gvars(self): return self.__dict__['__subject'].gvars() def lvars(self): lvars = self.__dict__['__subject'].lvars() lvars.update(self.__dict__['overrides']) return lvars # Overridden public construction environment methods. def Replace(self, **kw): kw = copy_non_reserved_keywords(kw) self.__dict__['overrides'].update(semi_deepcopy(kw)) # The entry point that will be used by the external world # to refer to a construction environment. This allows the wrapper # interface to extend a construction environment for its own purposes # by subclassing SCons.Environment.Base and then assigning the # class to SCons.Environment.Environment. Environment = Base def NoSubstitutionProxy(subject): """ An entry point for returning a proxy subclass instance that overrides the subst*() methods so they don't actually perform construction variable substitution. This is specifically intended to be the shim layer in between global function calls (which don't want construction variable substitution) and the DefaultEnvironment() (which would substitute variables if left to its own devices). We have to wrap this in a function that allows us to delay definition of the class until it's necessary, so that when it subclasses Environment it will pick up whatever Environment subclass the wrapper interface might have assigned to SCons.Environment.Environment. """ class _NoSubstitutionProxy(Environment): def __init__(self, subject): self.__dict__['__subject'] = subject def __getattr__(self, name): return getattr(self.__dict__['__subject'], name) def __setattr__(self, name, value): return setattr(self.__dict__['__subject'], name, value) def executor_to_lvars(self, kwdict): if 'executor' in kwdict: kwdict['lvars'] = kwdict['executor'].get_lvars() del kwdict['executor'] else: kwdict['lvars'] = {} def raw_to_mode(self, dict): try: raw = dict['raw'] except KeyError: pass else: del dict['raw'] dict['mode'] = raw def subst(self, string, *args, **kwargs): return string def subst_kw(self, kw, *args, **kwargs): return kw def subst_list(self, string, *args, **kwargs): nargs = (string, self,) + args nkw = kwargs.copy() nkw['gvars'] = {} self.executor_to_lvars(nkw) self.raw_to_mode(nkw) return SCons.Subst.scons_subst_list(*nargs, **nkw) def subst_target_source(self, string, *args, **kwargs): nargs = (string, self,) + args nkw = kwargs.copy() nkw['gvars'] = {} self.executor_to_lvars(nkw) self.raw_to_mode(nkw) return SCons.Subst.scons_subst(*nargs, **nkw) return _NoSubstitutionProxy(subject) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/engine/MANIFEST.in0000664000175000017500000000727313160023040017254 0ustar bdbaddogbdbaddogSCons/__init__.py SCons/Action.py SCons/Builder.py SCons/compat/*.py SCons/CacheDir.py SCons/Conftest.py SCons/cpp.py SCons/dblite.py SCons/Debug.py SCons/Defaults.py SCons/Environment.py SCons/Errors.py SCons/Executor.py SCons/Job.py SCons/exitfuncs.py SCons/Memoize.py SCons/Node/__init__.py SCons/Node/Alias.py SCons/Node/FS.py SCons/Node/Python.py SCons/Options/*.py SCons/PathList.py SCons/Platform/__init__.py SCons/Platform/aix.py SCons/Platform/cygwin.py SCons/Platform/darwin.py SCons/Platform/hpux.py SCons/Platform/irix.py SCons/Platform/os2.py SCons/Platform/posix.py SCons/Platform/sunos.py SCons/Platform/win32.py SCons/Scanner/__init__.py SCons/Scanner/C.py SCons/Scanner/D.py SCons/Scanner/Dir.py SCons/Scanner/Fortran.py SCons/Scanner/IDL.py SCons/Scanner/LaTeX.py SCons/Scanner/Prog.py SCons/Scanner/RC.py SCons/Scanner/SWIG.py SCons/SConf.py SCons/SConsign.py SCons/Script/__init__.py SCons/Script/Interactive.py SCons/Script/Main.py SCons/Script/SConscript.py SCons/Script/SConsOptions.py SCons/Subst.py SCons/Taskmaster.py SCons/Tool/__init__.py SCons/Tool/386asm.py SCons/Tool/aixc++.py SCons/Tool/aixcxx.py SCons/Tool/aixcc.py SCons/Tool/aixf77.py SCons/Tool/aixlink.py SCons/Tool/applelink.py SCons/Tool/ar.py SCons/Tool/as.py SCons/Tool/bcc32.py SCons/Tool/c++.py SCons/Tool/cxx.py SCons/Tool/cc.py SCons/Tool/cyglink.py SCons/Tool/clang.py SCons/Tool/clangxx.py SCons/Tool/cvf.py SCons/Tool/DCommon.py SCons/Tool/default.py SCons/Tool/dmd.py SCons/Tool/docbook/__init__.py SCons/Tool/dvi.py SCons/Tool/dvipdf.py SCons/Tool/dvips.py SCons/Tool/f03.py SCons/Tool/f08.py SCons/Tool/f77.py SCons/Tool/f90.py SCons/Tool/f95.py SCons/Tool/filesystem.py SCons/Tool/fortran.py SCons/Tool/FortranCommon.py SCons/Tool/g++.py SCons/Tool/gxx.py SCons/Tool/g77.py SCons/Tool/gas.py SCons/Tool/gcc.py SCons/Tool/gdc.py SCons/Tool/gfortran.py SCons/Tool/gnulink.py SCons/Tool/gs.py SCons/Tool/hpc++.py SCons/Tool/hpcxx.py SCons/Tool/hpcc.py SCons/Tool/hplink.py SCons/Tool/icc.py SCons/Tool/icl.py SCons/Tool/ifl.py SCons/Tool/ifort.py SCons/Tool/ilink.py SCons/Tool/ilink32.py SCons/Tool/install.py SCons/Tool/intelc.py SCons/Tool/ipkg.py SCons/Tool/jar.py SCons/Tool/JavaCommon.py SCons/Tool/javac.py SCons/Tool/javah.py SCons/Tool/latex.py SCons/Tool/ldc.py SCons/Tool/lex.py SCons/Tool/link.py SCons/Tool/linkloc.py SCons/Tool/MSCommon/__init__.py SCons/Tool/MSCommon/arch.py SCons/Tool/MSCommon/common.py SCons/Tool/MSCommon/netframework.py SCons/Tool/MSCommon/sdk.py SCons/Tool/MSCommon/vs.py SCons/Tool/MSCommon/vc.py SCons/Tool/m4.py SCons/Tool/masm.py SCons/Tool/midl.py SCons/Tool/mingw.py SCons/Tool/mslib.py SCons/Tool/mslink.py SCons/Tool/mssdk.py SCons/Tool/msvc.py SCons/Tool/msvs.py SCons/Tool/mwcc.py SCons/Tool/mwld.py SCons/Tool/nasm.py SCons/Tool/packaging/*.py SCons/Tool/pdf.py SCons/Tool/pdflatex.py SCons/Tool/pdftex.py SCons/Tool/PharLapCommon.py SCons/Tool/qt.py SCons/Tool/rmic.py SCons/Tool/rpcgen.py SCons/Tool/rpm.py SCons/Tool/rpmutils.py SCons/Tool/sgiar.py SCons/Tool/sgic++.py SCons/Tool/sgicxx.py SCons/Tool/sgicc.py SCons/Tool/sgilink.py SCons/Tool/sunar.py SCons/Tool/sunc++.py SCons/Tool/suncxx.py SCons/Tool/suncc.py SCons/Tool/sunf77.py SCons/Tool/sunf90.py SCons/Tool/sunf95.py SCons/Tool/sunlink.py SCons/Tool/swig.py SCons/Tool/tar.py SCons/Tool/tex.py SCons/Tool/textfile.py SCons/Tool/tlib.py SCons/Tool/wix.py SCons/Tool/yacc.py SCons/Tool/zip.py SCons/Util.py SCons/Variables/__init__.py SCons/Variables/BoolVariable.py SCons/Variables/EnumVariable.py SCons/Variables/ListVariable.py SCons/Variables/PackageVariable.py SCons/Variables/PathVariable.py SCons/Warnings.py SCons/Tool/GettextCommon.py SCons/Tool/gettext_tool.py SCons/Tool/msgfmt.py SCons/Tool/msginit.py SCons/Tool/msgmerge.py SCons/Tool/xgettext.py scons-src-3.0.0/src/engine/MANIFEST-xml.in0000664000175000017500000000031113160023040020034 0ustar bdbaddogbdbaddogSCons/*.xml SCons/Platform/*.xml SCons/Scanner/__init__.xml SCons/Script/*.xml SCons/Tool/*.xml SCons/Tool/docbook/__init__.xml SCons/Tool/docbook/utils/xmldepend.xsl SCons/Tool/packaging/__init__.xml scons-src-3.0.0/src/test_interrupts.py0000664000175000017500000001174313160023045020103 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function __revision__ = "src/test_interrupts.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" """ Verify that the SCons source code contains only correct handling of keyboard interrupts (e.g. Ctrl-C). """ import os import os.path import re import time import TestSCons test = TestSCons.TestSCons() # We do not want statements of the form: # try: # # do something, e.g. # return a['x'] # except: # # do the exception handling # a['x'] = getx() # return a['x'] # # The code above may catch a KeyboardInterrupt exception, which was not # intended by the programmer. We check for these situations in all python # source files. try: cwd = os.environ['SCONS_CWD'] except KeyError: scons_lib_dir = os.environ['SCONS_LIB_DIR'] MANIFEST = os.path.join(scons_lib_dir, 'MANIFEST.in') else: #cwd = os.getcwd() scons_lib_dir = os.path.join(cwd, 'build', 'scons') MANIFEST = os.path.join(scons_lib_dir, 'MANIFEST') # We expect precisely this many uncaught KeyboardInterrupt exceptions # from the files in the following dictionary. expected_uncaught = { 'engine/SCons/Job.py' : 5, 'engine/SCons/Script/Main.py' : 1, 'engine/SCons/Taskmaster.py' : 3, } try: fp = open(MANIFEST) except IOError: test.skip_test('%s does not exist; skipping test.\n' % MANIFEST) else: files = fp.read().split() files = [f for f in files if f[-3:] == '.py'] # some regexps to parse the python files tryexc_pat = re.compile( r'^(?P(?P *)(try|except)( [^\n]*)?:.*)',re.MULTILINE) keyboardint_pat = re.compile(r' *except +([^,],)*KeyboardInterrupt([ ,][^\n]*)?:[^\n]*') exceptall_pat = re.compile(r' *except(?: *| +Exception *, *[^: ]+):[^\n]*') uncaughtKeyboardInterrupt = 0 for f in files: contents = open(os.path.join(scons_lib_dir, f)).read() try_except_lines = {} lastend = 0 while True: match = tryexc_pat.search( contents, lastend ) if match is None: break #print match.groups() lastend = match.end() try: indent_list = try_except_lines[match.group('indent')] except: indent_list = [] line_num = 1 + contents[:match.start()].count('\n') indent_list.append( (line_num, match.group('try_or_except') ) ) try_except_lines[match.group('indent')] = indent_list uncaught_this_file = [] for indent in list(try_except_lines.keys()): exc_keyboardint_seen = 0 exc_all_seen = 0 for (l,statement) in try_except_lines[indent] + [(-1,indent + 'try')]: #print "%4d %s" % (l,statement), m1 = keyboardint_pat.match(statement) m2 = exceptall_pat.match(statement) if statement.find(indent + 'try') == 0: if exc_all_seen and not exc_keyboardint_seen: uncaught_this_file.append(line) exc_keyboardint_seen = 0 exc_all_seen = 0 line = l #print " -> reset" elif m1 is not None: exc_keyboardint_seen = 1 #print " -> keyboard -> ", m1.groups() elif m2 is not None: exc_all_seen = 1 #print " -> all -> ", m2.groups() else: pass #print "Warning: unknown statement %s" % statement expected_num = expected_uncaught.get(f, 0) if expected_num != len(uncaught_this_file): uncaughtKeyboardInterrupt = 1 msg = "%s: expected %d uncaught interrupts, got %d:" print(msg % (f, expected_num, len(uncaught_this_file))) for line in uncaught_this_file: print(" File %s:%d: Uncaught KeyboardInterrupt!" % (f,line)) test.fail_test(uncaughtKeyboardInterrupt) test.pass_test() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/Announce.txt0000664000175000017500000016027713160023040016564 0ustar bdbaddogbdbaddog SCons - a software construction tool Release Notes This is SCons, a tool for building software (and other files). SCons is implemented in Python, and its "configuration files" are actually Python scripts, allowing you to use the full power of a real scripting language to solve build problems. You do not, however, need to know Python to use SCons effectively. Please go to http://scons.org/pages/download.html to get the latest production release of SCons. So that everyone using SCons can help each other learn how to use it more effectively, please go to http://scons.org/lists.html#users to sign up for the scons-users mailing list. RELEASE 3.0.0 - Mon, 18 Sep 2017 08:32:04 -0700 Please consult the RELEASE.txt file for a summary of changes since the last release and consult the CHANGES.txt file for complete a list of changes since last release. This announcement highlights only the important changes. Please note the following important changes since release 2.5.1: *IT IS NOT READY FOR PRODUCTION USE* This is the initial release supporting both python 3.5+ and 2.7.x and pypy There are some important changes: - Any print statements must now use python 3 syntax of "print()" - All node content should be in bytes. This is the default in python 2.7.x, in Python 3 all strings are by default unicode. byte and/or bytearray should be used if you construct content for return by a custom node type's get_content() method. - This is some (as yet unresolved issue) using Literal()'s in some context with Python 3 - pypy should be supported, please report any issues to the user's mailing list. - Currently if you switch back and forth between python 2.7.x and 3.5+ you will need to remove your sconsign file. This should be resolves shortly, but regardless switching between python 2.7.x and 3.5+ will not use compatible sconsigns and as such incremental builds should be expected to rebuild anything changed since the previous scons run with the same version of python. - It is likely that migrating from 2.5.1 -> 3.0.0 alpha will cause rebuilds due to the significant number of changes in the codebase. - Removed deprecated tools CVS, Perforce, BitKeeper, RCS, SCCS, Subversion. - Removed deprecated module SCons.Sig - See CHANGES.txt for more details on other changes - 3.0.0 should be slightly faster than 2.5.1. Changes yielded a 15% speed up for null incremental builds. - Updated D language scanner support to latest: 2.071.1. - python -m SCons should now run SCons if it's installed PYTHONPATH Please note the following important changes since release 2.4.1: We're enhancing implicit language scanning functionality to improve correctness. SCons now honors scanner keys for implicit dependencies and correctly changes scanner type (if necessary) when traversing implicit dependency trees. This enhancement resolves missing dependencies with built-in scanners including SWIG (#2264) and QT: * http://scons.tigris.org/issues/show_bug.cgi?id=2264 - This enhancement broadens the horizon for handling heterogeneous data flow environments (E.G. software builds): - http://article.gmane.org/gmane.comp.programming.tools.scons.user/26596 - SCons may find new (and correct) dependencies in cross-langauge contexts. - Update may cause rebuilds, especially in heterogeneous data environments. - Update may find previously missed dependencies errors (E.G. cycles). - Discovered in some QT test cases. - SCons handles the SCANNERS variable differently. - Previously, the Install builder would scan implicit dependencies for a scanner found in SCANNERS (but not for built-in scanners), but now the Install builder will not scan recursively regardless in order to optimize Install behaviour and bring orthogonality to previous behaviour. - SCons handles cache directories a bit differently/ - Cache files are now stored in 256 subdirectories in the cache directory by default (this stresses NFS less). Existing cache directories will remain as current, but SCons will prompt you to run scons-configure-cache which will allow you to migrate to the new layout, or confirm you want to use the existing layout. - New external tool scons-configurecache which allows some configuration of how files in the cache are controlled. Please note the following important changes since release 2.4.0: - Fix to swig tool - pick-up 'swig', 'swig3.0' and 'swig2.0' (in order). - Fix to swig tool - respect env['SWIG'] provided by user. - Fix for Bug # 2791 - Setup.py fails unnecessarily under Jython. - Fixed license of SVG titlepage files in the context of Debian packaging, such that they allow for commercial use too (#2985). - InstallVersionedLib now available in the DefaultEnvironment context. - Improves orthogonality of use cases between different Install functions. - Added new configure check, CheckProg, to check for existence of a program. - Fix for issue #2840 - Fix for two environments specifying same target with different actions not throwing hard error. Instead SCons was incorrectly issuing a warning and continuing. - Add support `Microsoft Visual C++ Compiler for Python 2.7' Compiler can be obtained at: https://www.microsoft.com/en-us/download/details.aspx?id=44266 - Fixed tigris issue #3011: Glob() excludes didn't work when used with VariantDir(duplicate=0) - Fix bug 2831 and allow Help() text to be appended to AddOption() help. - Reimplemented versioning for shared libraries, with the following effects - Fixed tigris issues #3001, #3006. - Fixed several other issues not reported to tigris, including: issues with versioned libraries in subdirectories with tricky names, issues with versioned libraries and variant directories, issue with soname not being injected to library when using D linkers, - Switched to direct symlinks instead of daisy-chained ones -- soname and development symlinks point directly to the versioned shared library now), for rationale see: https://www.debian.org/doc/debian-policy/ch-sharedlibs.html https://fedoraproject.org/wiki/Packaging:Guidelines#Devel_Packages https://bitbucket.org/scons/scons/pull-requests/247/new-versioned-libraries-gnulink-cyglink/diff#comment-10063929 - New construction variables to allow override default behavior: SONAME, SHLIBVERSIONFLAGS, _SHLIBVERSIONFLAGS, SHLIBNOVERSIONSYMLINKS, LDMODULEVERSION, LDMODULEVERSIONFLAGS, _LDMODULEVERSIONFLAGS, LDMODULENOVERSIONSYMLINKS. - Changed logic used to configure the versioning machinery from platform-centric to linker-oriented. - The SHLIBVERSION/LDMODULEVERSION variables are no longer validated by SCons (more freedom to users). - InstallVersionedLib() doesn't use SHLIBVERSION anymore. - Enchanced docs for the library versioning stuff. - New tests for versioned libraries. - Library versioning is currently implemented for the following linker tools: 'cyglink', 'gnulink', 'sunlink'. Please note the following important changes since release 2.3.6: - Switch several core classes to use "slots" to reduce memory usage. (PR #2180, #2178, #2198) Please note the following important changes since release 2.3.5: - Support for Visual Studio 2015 Please note the following important changes since release 2.3.4: - Documentation fixes for libraries.xml and builders-writing.xml (#2989 and #2990) - Extended docs for InstallVersionedLib/SharedLibrary, and added SKIP_WIN_PACKAGES argument to build script bootstrap.py (PR #230, #3002). - Fixed symlink support (PR #227, #2395). - Updated debug-count test case (PR #229). - Fixed incomplete LIBS flattening and substitution in Program scanner(PR #205, #2954). - Added new method rentry_exists_on_disk to Node.FS (PR #193). - Fixed several D tests under the different OS. - Add support for f08 file extensions for Fortran 2008 code. - Show --config choices if no argument is specified (PR #202). - Fixed build crash when XML toolchain isn't installed, and activated compression for ZIP archives. - Fix for VersionedSharedLibrary under 'sunos' platform. - Fixed dll link with precompiled headers on MSVC 2012 - Added an 'exclude' parameter to Glob() - Support for multiple cmdargs (one per variant) in VS project files. - Various improvements for TempFileMunge class. - Added an implementation for Visual Studio users files (PR #209). - Added support for the 'PlatformToolset' tag in VS project files (#2978). - Added support for '-isystem' to ParseFlags. Please note the following important changes since release 2.3.3: -- Fix for EnsureSConsVersion regression in 2.3.3. -- Fix for interactive mode with Configure contexts Please note the following important changes since release 2.3.2: -- On Windows, .def files did not work as sources to shared libraries or executables, due to a regression which is corrected in 2.3.3. Please note the following important changes since release 2.3.0: -- BitKeeper, CVS, Perforce, RCS, SCCS are deprecated from the default toolset and will be removed from the default toolset in future SCons versions to speed up SCons initialization. The tools themselves continue to be supported. -- Support for Visual Studio 12.0Exp and 2013 -- Revamp of D language support, focusing on D v2. D v1 is now deprecated. -- Fixed NoClean() for multi-target builders. -- RPM and m4 are no longer in the default toolset on Windows. Should improve startup speed. -- TeX fixes: -synctex=1 and cleaning auxiliary files. -- Fixes to the Docbook tool. Please note the following important changes since release 2.3.0: -- Fix failure to relink when LINKCOM or libs change, introduced in 2.3.0. -- Fix MSVC defaulting TARGET_ARCH to HOST_ARCH and other MSVC issues. -- Reduced memory consumption in large builds, which should speed them up as well. -- Add new cyglink linker for use with cygwin. -- Fix leaking file handles to subprocesses -- Support read-only cache (--cache-readonly) -- Add Pseudo command to mark targets that shouldn't exist after building Please note the following important changes since release 2.2.0: -- SUPPORT FOR PYTHON VERSIONS BEFORE 2.7 IS NOW DEPRECATED ***IMPORTANT***: This release is the last version of SCons to support Python versions older than 2.7. This release will warn if you are running on Python 2.6 or older; future releases will probably not work at all, as we are moving toward supporting Python 3. Use --warn=no-python-version to suppress the warning if needed. -- A lot of python pre-2.4 compatibility code was removed in this release. 2.4 is the official floor for SCons, but this release will likely enforce it more rigidly. -- Spawning subprocesses on Windows should now be more reliable with -jN -- MSVC10 and MSVC11 support improved, and fixed MSVS11 solution generation. -- Various TeX/LaTeX builder improvements -- Support for versioned shared libs on Linux and Mac, via SHLIBVERSION and InstallVersionedLib. -- WiX builder updates Please note the following important changes since release 2.1.0: -- New gettext toolset for internationalization -- Support for Visual Studio 11 -- Support for Intel C/C++ compiler v12 on Linux and Mac -- LaTeX support for multibib, biblatex and biber Please note the following important changes since release 2.0.0: -- Support for Windows manifest generation -- SCons now searches sitewide dirs for site_scons -- Support for Latex bibunits package has been added along with support for tex files generated by other builders Please note the following important changes since release 1.3.0: -- SUPPORT FOR PYTHON VERSIONS PRIOR TO 2.4 HAS BEEN REMOVED Although SCons is still tested with Python 2.3, use of Python versions prior to 2.4 is deprecated. -- DEPRECATED FEATURES WILL GENERATE MANDATORY WARNINGS IN 2.0.0 In keeping with our deprecation cycle, the following deprecated features will still be supported in 2.0.0 but will generate mandatory, non-disableable warnings: -- The overrides= keyword argument to the Builder() call. -- The scanner= keyword argument to the Builder() call. -- The BuildDir() function and env.BuildDir() method. -- The env.Copy() method. -- The SourceSignatures() function and env.SourceSignatures() method. -- The TargetSignatures() function and env.TargetSignatures() method. -- The Sig module (now an unnused stub). -- The --debug=dtree, --debug=stree and --debug=tree options. -- The --debug=nomemoizer option. -- The Options object and the related BoolOption(), EnumOption(), ListOption(), PackageOption() and PathOption() functions. The mandatory warnings will be issued in order to make sure users of 1.3.0 notice *prior* to the release of SCons 2.0.0, that these features will be removed. In SCons 2.0.0 these features will no longer work at all, and will instead generate specific fatal errors when anyone tries to use them. Please note the following important changes since release 1.2.0: -- MICROSOFT VISUAL STUDIO VERSION/ARCH DETECTION HAS CHANGED The way SCons detects Visual Studio on Windows has changed in 1.3. By default, it should now use the latest installed Visual Studio version on your machine, and compile for 32 or 64 bits according to whether your OS is 32 or 64 bits (32/64 bit Python makes no difference). Two new variables control Visual Studio: MSVC_VERSION and TARGET_ARCH. These variables ONLY take effect when passed to the Environment() constructor; setting them later has no effect. To use a non-default Visual Studio version, set MSVC_VERSION to e.g. "8.0" or "7.1". Setting it to "xxx" (or any nonexistent value) will make it print out the valid versions on your system. To use a non-default architecture, set TARGET_ARCH to "x86" or "x86_64" (various synonyms are accepted). Note that if you use MSVS_VERSION to build Visual Studio projects from your SConstructs, MSVS_VERSION must be set to the same version as MSVC_VERSION. Support for HOST_OS,HOST_ARCH,TARGET_OS, TARGET_ARCH has been added to allow specifying different target arch than the host system. This is only supported for Visual Studio/Visual C++ at this time. -- Support for Latex glossaries and acronyms has been added -- VISUAL C/C++ PRECOMPILED HEADERS WILL BE REBUILT Precompiled header files built with Visual C/C++ will be rebuilt after upgrading from 1.2.0 to a later release. This rebuild is normal and will occur because the command line defined by the $PCHCOM construction variable has had the $CCFLAGS variable added, and has been rearranged to put the "/Fo" output flag towards the beginning of the line, consistent with the related command lines for $CCCOM, $CXXCOM, etc. -- CHANGES TO SOME LINKER COMMAND LINES WILL CAUSE RELINKING Changes to the command line definitions for the Microsoft link.exe linker, the OS/2 ilink linker and the Phar Lap linkloc linker will cause targets built with those tools be to be rebuilt after upgrading from 1.2.0 to a later release. This relink is normal and will occur because the command lines for these tools have been redefined to remove unnecessary nested $( and $) character strings. -- MSVS_USE_MFC_DIRS and MSVS_IGNORE_IDE_PATHS are obsoleted and have no effect. Please note the following important changes since release 1.1.0: -- THE $CHANGED_SOURCES, $CHANGED_TARGETS, $UNCHANGED_SOURCES AND $UNCHANGED_TARGETS VARIABLES WILL BECOME RESERVED A future release (probably 1.3.0) will make the construction variable names $CHANGED_SOURCES, $CHANGED_TARGETS, $UNCHANGED_SOURCES and $UNCHANGED_TARGETS into reserved construction variable names controlled by SCons itself (like the current $SOURCE, $TARGETS, etc.). Setting these variable names in the current release will generate a warning but still set the variables. When they become reserved variable names, they will generate a different warning message and attempts to set these variables will be ignored. SCons configurations that happen to use these variable names should be changed to use different variable names, in order to ensure that the configuration continues to work with future versions of SCons. -- THE Options OBJECT AND RELATED FUNCTIONS NOW GENERATE WARNINGS Use of the Options object, and related functions BoolOption(), EnumOption(), ListOption(), PackageOption() and PathOption() were announced as deprecated in release 0.98.1. Since then, however, no warning messages were ever implemented for the use of these deprecated functions. By default, release 1.2.0 prints warning messages when these deprecated features are used. Warnings about all deprecated features may be suppressed by using the --warn=no-deprecated command-line option: $ scons --warn=no-deprecated Or by using the appropriate SetOption() call in any SConscript file: SetOption('warn', 'no-deprecated') You may optionally disable just warnings about the deprecation of the Options object and its related functions as follows: SetOption('warn', 'no-deprecated-options') The current plan is for these warnings to become mandatory (non-suppressible) in release 1.3.0, and for the use of Options and its related functions to generate errors in release 2.0. Please note the following important changes since release 0.98.4: -- scons.bat NOW RETURNS THE REAL SCONS EXIT STATUS The scons.bat script shipped with SCons used to exit with a status of 1 when it detected any failed (non-zero) exit status from the underlying Python execution of SCons itself. The scons.bat script now exits with the actual status returned by SCons. -- SCONS NOW WARNS WHEN TRYING TO LINK C++ AND FORTRAN OBJECT FILES Some C++ toolchains do not understand Fortran runtimes and create unpredictable executables when linking C++ and Fortran object files together. SCons now issues a warning if you try to link C++ and Fortran object files into the same executable: scons: warning: Using $CXX to link Fortran and C++ code together. This may generate a buggy executable if the '/usr/bin/gcc' compiler does not know how to deal with Fortran runtimes. The warning may be suppressed with either the --warning=no-link or --warning=no-fortran-cxx-mix command line options, or by adding either of the following lines to a SConscript file: SetOption('warn', 'no-link') SetOption('warn', 'no-fortran-cxx-mix') Please note the following important changes since release 0.98: -- SCONS NO LONGER SETS THE GNU TOOLCHAIN -fPIC FLAG IN $SHCXXFLAGS The GNU toolchain support in previous versions of SCons would add the -fPIC flag to the $SHCXXFLAGS construction variable. The -fPIC flag has now been removed from the default $SHCXXFLAGS setting. Instead, the $SHCXXCOM construction variable (the default SCons command line for compiling shared objects from C++ source files) has been changed to add the $SHCCFLAGS variable, which contains the -fPIC flag. This change was made in order to make the behavior of the default C++ compilation line including $SHCCFLAGS consistent with the default C compilation line including $CCFLAGS. This change should have no impact on configurations that use the default $SHCXXCOM command line. It may have an impact on configurations that were using the default $SHCXXFLAGS value *without* the $SHCCFLAGS variable to get the -fPIC flag into a custom command line. You can fix these by adding the $SHCCFLAGS to the custom command line. Adding $SHCCFLAGS is backwards compatible with older SCons releases, although it might cause the -fPIC flag to be repeated on the command line if you execute it on an older version of SCons that sets -fPIC in both the $SHCCLAFGS and $SHCXXFLAGS variables. Duplicating the -fPIC flag on the g++ command line will not cause any compilation problems, but the change to the command line may cause SCons to rebuild object files. -- FORTRAN NOW COMPILES .f FILES WITH gfortran BY DEFAULT The Fortran Tool modules have had a major overhaul with the intent of making them work as-is for most configurations. In general, most configurations that use default settings should not see any noticeable difference. One configuration that has changed is if you have both a gfortran and g77 compiler installed. In this case, previous versions of SCons would, by default, use g77 by default to compile files with a .f suffix, while SCons 0.98.1 will use the gfortran compiler by default. The old behavior may be preserved by explicitly initializing construction environments with the 'g77' Tool module: env = Environment(tools = ['g77', 'default']) The above code is backwards compatible to older versions of SCons. If you notice any other changes in the behavior of default Fortran support, please let us know so we can document them in these release notes for other users. Please note the following important changes since release 0.97.0d20071212: -- SUPPORT FOR PYTHON VERSIONS BEFORE 2.2 IS NOW DEPRECATED SCons now prints the following warning when it is run by any Python 1.5, 2.0 or 2.1 release or sub-release: scons: warning: Support for pre-2.2 Python (VERSION) is deprecated. If this will cause hardship, contact scons-dev@scons.org You may disable all warnings about deprecated features by adding the option "--warn=no-deprecated" to the command line or to the $SCONSFLAGS environment variable: $ scons --warn=no-deprecated Using '--warn=no-deprecated' is compatible with earlier versions of SCons. You may also, as of this version of SCons, disable all warnings about deprecated features by adding the following to any SConscript file: SetOption('warn', 'no-deprecated') You may disable only the specific warning about running under a deprecated Python version by adding the following to any SConscript file: SetOption('warn', 'no-python-version') The warning may also be suppressed on the command line: $ scons --warn=no-python-version Or by specifying the --warn=no-python-version option in the $SCONSFLAGS environment variable. Using SetOption('warn', ...), and the 'no-python-version' command-line option for suppressing this specific warning, are *not* backwards-compatible to earlier versions of SCons. -- THE env.Copy() METHOD IS NOW OFFICIALLY DEPRECATED The env.Copy() method is now officially deprecated and will be removed in a future release. Using the env.Copy() method now generates the following message: scons: warning: The env.Copy() method is deprecated; use the env.Clone() method instead. You may disable all warnings about deprecated features by adding the option "--warn=no-deprecated" to the command line or to the $SCONSFLAGS environment variable: $ scons --warn=no-deprecated Using '--warn=no-deprecated' is compatible with earlier versions of SCons. You may also, as of this version of SCons, disable all warnings about deprecated features by adding the following to any SConscript file: SetOption('warn', 'no-deprecated') You may disable only the specific warning about the deprecated env.Copy() method by adding the following to any SConscript file: SetOption('warn', 'no-deprecated-copy') The warning may also be suppressed on the command line: $ scons --warn=no-deprecated-copy Or by specifying the --warn=no-deprecated-copy option in the $SCONSFLAGS environment variable. Using SetOption('warn', ...), and the 'no-deprecated-copy' command-line option for suppressing this specific warning, are *not* backwards-compatible to earlier versions of SCons. -- THE --debug=dtree, --debug=stree AND --debug=tree OPTIONS ARE DEPRECATED The --debug=dtree, --debug=stree and --debug=tree methods are now officially deprecated and will be removed in a future release. Using these options now generate a warning message recommending use of the --tree=derived, --tree=all,status and --tree=all options, respectively. You may disable these warnings, and all warnings about deprecated features, by adding the option "--warn=no-deprecated" to the command line or to the $SCONSFLAGS environment variable: $ scons --warn=no-deprecated Using '--warn=no-deprecated' is compatible with earlier versions of SCons. -- THE TargetSignatures() AND SourceSignatures() FUNCTIONS ARE DEPRECATED The TargetSignatures() and SourceSignatures() functions, and their corresponding env.TargetSignatures() and env.SourceSignatures() methods, are now officially deprecated and will be be removed in a future release. Using ahy of these functions or methods now generates a message similar to the following: scons: warning: The env.TargetSignatures() method is deprecated; convert your build to use the env.Decider() method instead. You may disable all warnings about deprecated features by adding the option "--warn=no-deprecated" to the command line or to the $SCONSFLAGS environment variable: $ scons --warn=no-deprecated Using '--warn=no-deprecated' is compatible with earlier versions of SCons. You may also, as of this version of SCons, disable all warnings about deprecated features by adding the following to any SConscript file: SetOption('warn', 'no-deprecated') You may disable only the specific warning about the use of TargetSignatures() or SourceSignatures() by adding the following to any SConscript file: SetOption('warn', 'no-deprecated-target-signatures') SetOption('warn', 'no-deprecated-source-signatures') The warnings may also be suppressed on the command line: $ scons --warn=no-deprecated-target-signatures --warn=no-deprecated-source-signatures Or by specifying these options in the $SCONSFLAGS environment variable. Using SetOption('warn', ...), or the command-line options for suppressing these warnings, is *not* backwards-compatible to earlier versions of SCons. -- File(), Dir() and Entry() NOW RETURN A LIST WHEN THE INPUT IS A SEQUENCE Previously, if these methods were passed a list, the list was substituted and stringified, then passed as a single string to create a File/Dir/Entry Node. This rarely if ever worked with more than one element in the list. They now return a list of Nodes when passed a list. One case that works differently now is a passing in a single-element sequence; that formerly was stringified (returning its only element) and then a single Node would be returned. Now a single-element list containing the Node will be returned, for consistency. -- THE env.subst() METHOD NOW RETURNS A LIST WHEN THE INPUT IS A SEQUENCE The env.subst() method now returns a list with the elements expanded when given a list as input. Previously, the env.subst() method would always turn its result into a string. This behavior was changed because it interfered with being able to include things like lists within the expansion of variables like $CPPPATH and then have SCons understand that the elements of the "internal" lists still needed to be treated separately. This would cause a $CPPPATH list like ['subdir1', 'subdir'] to show up in a command line as "-Isubdir1 subdir". -- THE Jar() BUILDER NOW USES THE Java() BUILDER CLASSDIR BY DEFAULT By default, the Jar() Builder will now use the class directory specified when the Java() builder is called. So the following input: classes = env.Java('classes', 'src') env.Jar('out.jar', classes) Will cause "-C classes" to be passed the "jar" command invocation, and the Java classes in the "out.jar" file will not be prefixed "classes/". Explicitly setting the $JARCHDIR variable overrides this default behavior. The old behavior of not passing any -C option to the "jar" command can be preserved by explicitly setting $JARCHDIR to None: env = Environment(JARCHDIR = None) The above setting is compatible with older versions of SCons. Please note the following important changes since release 0.97.0d20070918: -- SCons REDEFINES PYTHON open() AND file() ON Windows TO NOT PASS ON OPEN FILE HANDLES TO CREATED PROCESSES On Windows systems, SCons now redefines the Python open() and file() functions so that, if the Python Win32 extensions are available, the file handles for any opened files will *not* be inherited by subprocesses, such as the spawned compilers and other tools invoked to build the software. This prevents certain race conditions where a file handle for a file opened by Python (either in a Python function action, or directly in a SConscript file) could be inherited and help open by a subprocess, interfering with the ability of other processes to create or modify the file. In general, this should not cause problems for the vast majority of configurations. The only time this would be a problem would be in the unlikely event that a process spawned by SCons specifically *expected* to use an inherited file handle opened by SCons. If the Python Win32 extensions are not installed or are an earlier version that does not have the ability to disable file handle inheritance, SCons will print a warning message when the -j option is used. The warning message may be suppressed by specifying --warn=no-parallel-support. Please note the following important changes since release 0.97.0d20070809: -- "content" SIGNATURES ARE NOW THE DEFAULT BEHAVIOR The default behavior of SCons is now to use the MD5 checksum of all file contents to decide if any files have changed and should cause rebuilds of their source files. This means that SCons may decide not to rebuild "downstream" targets if a a given input file is rebuilt to the exact same contents as the last time. The old behavior may preserved by explicity specifying: TargetSignatures("build") In any of your SConscript files. -- TARGETS NOW IMPLICITLY DEPEND ON THE COMMAND THAT BUILDS THEM For all targets built by calling external commands (such as a compiler or other utility), SCons now adds an implicit dependency on the command(s) used to build the target. This will cause rebuilds of all targets built by external commands when running SCons in a tree built by previous version of SCons, in order to update the recorded signatures. The old behavior of not having targets depend on the external commands that build them can be preserved by setting a new $IMPLICIT_COMMAND_DEPENDENCIES construction variable to a non-True value: env = Environment(IMPLICIT_COMMAND_DEPENDENCIES = 0) or by adding Ignore() calls for any targets where the behavior is desired: Ignore('/usr/bin/gcc', 'foo.o') Both of these settings are compatible with older versions of SCons. -- CHANGING SourceSignature() MAY CAUSE "UNECESSARY" REBUILDS If you change the SourceSignature() value from 'timestamp' to 'MD5', SCons will now rebuild targets that were already up-to-date with respect to their source files. This will happen because SCons did not record the content signatures of the input source files when the target was last built--it only recorded the timestamps--and it must record them to make sure the signature information is correct. However, the content of source files may have changed since the last timestamp build was performed, and SCons would not have any way to verify that. (It would have had to open up the file and record a content signature, which is one of the things you're trying to avoid by specifying use of timestamps....) So in order to make sure the built targets reflect the contents of the source files, the targets must be rebuilt. Change the SourceSignature() value from 'MD5' to 'timestamp' should correctly not rebuild target files, because the timestamp of the files is always recorded. In previous versions of SCons, changing the SourceSignature() value would lead to unpredictable behavior, usually including rebuilding targets. -- THE Return() FUNCTION NOW ACTUALLY RETURNS IMMEDIATELY The Return() function now immediately stops processing the SConscript file in which it appears and returns the values of the variables named in its arguments. It used to continue processing the rest of the SConscript file, and then return the values of the specified variables at the point the Return() function was called. The old behavior may be requested by adding a "stop=False" keyword argument to the Return() call: Return('value', stop=False) The "stop=" keyword argument is *not* compatible with SCons versions 0.97.0d20070809 or earlier. Please note the following important changes since release 0.97: -- env.CacheDir() NOW ONLY AFFECTS CONSTRUCTION ENVIRONMENT TARGETS The env.CacheDir() method now only causes derived files to be retrieved from the specified cache directory for targets built with the specified specified construction environment ("env"). Previously, any call to env.CacheDir() or CacheDir() would modify a global setting and cause all built targets to be retrieved from the specified cache directory. This behavior was changed so that env.CacheDir() would be consistent with other construction environment methods, which only affect targets built with the specified construction environment. The old behavior of changing the global behavior may be preserved by changing any env.CacheDir() calls to: CacheDir('/path/to/cache/directory') The above change is backwards-compatible and works in all earlier versions of SCons that support CacheDir(). -- INTERPRETATION OF SUFFIX-LESS SOURCE ARGUMENTS HAS CHANGED The interpretation of source arguments (files) without suffixes has changed in one specific configuration. Previously, if a Builder had a src_suffix specified (indicating that source files without suffixes should have that suffix appended), the suffix would only be applied to suffix-less source arguments if the Builder did *not* have one or more attached source Builders (that is, the Builder was not a "multi-stage" Builder). So in the following configuration: build_foo = Builder(src_suffix = '.foo') build_bar = Builder(src_suffix = '.bar', src_builder = build_bar) env = Environment(BUILDERS = { 'Foo' : build_foo, 'Boo' : build_bar, }) env.Foo('tgt1', 'src1') env.Bar('tgt2', 'src2') SCons would have expected to find a source file 'src1.foo' for the env.Foo() call, but a source file 'src2' for the env.Bar() call. This behavior has now been made consistent, so that the two above calls would expect source files named 'src1.foo' and 'src2.bar', respectively. Note that, if genuinely desired, the old behavior of building from a source file without a suffix at all (when the Builder has a src_suffix *and* a src_builder) can be specified explicity by turning the string into a File Node directly: env.Bar('tgt2', File('src2')) The above use of File() is backwards-compatible and will work on earlier versions of SCons. -- THE DEFAULT EXECUTION PATH FOR Solaris HAS CHANGED On Solaris systems, SCons now adds the "/opt/SUNWspro/bin" directory to the default execution $PATH variable before the "/usr/ccs/bin" directory. This was done to reflect the fact that /opt/SUNWspro/ is the default for SUN tools, but it may cause a different compiler to be used if you have compilers installed in both directories. -- GENERATED config.h FILES NOW SAY "#define HAVE_{FEATURE} 1" When generating a "config.h" file, SCons now defines values that record the existence of a feature with a "1" value: #define HAVE_FEATURE 1 Instead of printing the line without a "1", as it used to: #define HAVE_FEATURE This should not cause any problems in the normal use of "#ifdef HAVE_{FEATURE}" statements interpreted by a C preprocessor, but might cause a compatibility issue if a script or other utility looks for an exact match of the previous text. Please note the following planned, future changes: -- THE Options OBJECT AND RELATED FUNCTIONS WILL BE DEPRECATED The Options object is being replaced by a new Variables object, which uses a new Variables.AddVariable() method where the previous interface used Options.AddOptions(). Similarly, the following utility functions are being replaced by the following similarly-named functions: BoolOption() BoolVariable() EnumOption() EnumVariable() ListOption() ListVariable() PackageOption() PackageVariable() PathOption() PathVariable() And also related, the options= keyword argument when creating construction environments with the Environment() functions is being replaced with a variables= keyword argument. In some future release a deprecation warning will be added to existing uses of the Options object, its methods, the above utility functions, and the options= keyword argument of the Environment() function. At some point after the deprecation warning is added, the Options object, related functions and options= keyword argument will be removed entirely. You can prepare for this by changing all your uses of the Options object and related functions to the Variables object and the new function names, and changing any uses of the options= keyword argument to variables=. NOTE: CONVERTING TO USING THE NEW Variables OBJECT OR THE RELATED *Variable() FUNCTIONS, OR USING THE NEW variable= KEYWORD ARGUMENT, IS NOT BACKWARDS COMPATIBLE TO VERSIONS OF SCons BEFORE 0.98. YOUR SConscript FILES WILL NOT WORK ON EARLIER VERSIONS OF SCons AFTER MAKING THIS CHANGE. If you change SConscript files in software that you make available for download or otherwise distribute, other users may try to build your software with an earlier version of SCons that does not have the Variables object or related *Variable() functions. We recommend preparing for this in one of two ways: -- Make your SConscript files backwards-compatible by modifying your calls with Python try:-except: blocks as follows: try: vars = Variables('custom.py', ARGUMENTS) vars.AddVariables( BoolVariable('WARNINGS', 'cmopile with -Wall', 1), EnumVariable('DEBUG', 'debug version', 'no' allowed_values=('yes', 'no', 'full'), map={}, ignorecase=0), ListVariable('SHAREDLIBS', 'libraries to build shared', 'all', names = list_of_libs), PackageVariable('X11', 'use X11 from here', '/usr/bin/X11'), PathVariable('QTDIR', 'root of Qt', qtdir), ) except NameError: vars = Options('custom.py', ARGUMENTS) vars.AddOptions( BoolOption('WARNINGS', 'cmopile with -Wall', 1), EnumOption('DEBUG', 'debug version', 'no' allowed_values=('yes', 'no', 'full'), map={}, ignorecase=0), ListOption('SHAREDLIBS', 'libraries to build shared', 'all', names = list_of_libs), PackageOption('X11', 'use X11 from here', '/usr/bin/X11'), PathOption('QTDIR', 'root of Qt', qtdir), ) Additionally, you can check for availability of the new variables= keyword argument as follows: try: env = Environment(variables=vars) except TypeError: env = Environment(options=vars) (Note that we plan to maintain the existing Options object name for some time, to ensure backwards compatibility, so in practice it may be easier to just continue to use the old name until you're reasonably sure you won't have people trying to build your software with versions of SCons earlier than 0.98.1.) -- Use the EnsureSConsVersion() function to provide a descriptive error message if your SConscript files are executed by an earlier version of SCons: EnsureSConsVersion(0, 98, 1) -- THE BuildDir() METHOD AND FUNCTION WILL BE DEPRECATED The env.BuildDir() method and BuildDir() function are being replaced by the new env.VariantDir() method and VariantDir() function. In some future release a deprecation warning will be added to existing uses of the env.BuildDir() method and BuildDir() function. At some point after the deprecation warning, the env.Builder() method and BuildDir() function will either be removed entirely or have their behavior changed. You can prepare for this by changing all your uses of the env.BuildDir() method to env.VariantDir() and uses of the global BuildDir() function to VariantDir(). If you use a named keyword argument of "build_dir" when calling env.BuildDir() or BuildDir(): env.BuildDir(build_dir='opt', src_dir='src') The keyword must be changed to "variant_dir": env.VariantDir(variant_dir='opt', src_dir='src') NOTE: CHANGING USES OF env.BuildDir() AND BuildDir() to env.VariantDir() AND VariantDir() IS NOT BACKWARDS COMPATIBLE TO VERSIONS OF SCons BEFORE 0.98. YOUR SConscript FILES WILL NOT WORK ON EARLIER VERSIONS OF SCons AFTER MAKING THIS CHANGE. If you change SConscript files in software that you make available for download or otherwise distribute, other users may try to build your software with an earlier version of SCons that does not have the env.VariantDir() method or VariantDir() fnction. We recommend preparing for this in one of two ways: -- Make your SConscript files backwards-compatible by including the following code near the beginning of your top-level SConstruct file: import SCons.Environment try: SCons.Environment.Environment.VariantDir except AttributeError: SCons.Environment.Environment.VariantDir = \ SCons.Environment.Environment.BuildDir -- Use the EnsureSConsVersion() function to provide a descriptive error message if your SConscript files are executed by an earlier version of SCons: EnsureSConsVersion(0, 98) -- THE SConscript() "build_dir" KEYWORD ARGUMENT WILL BE DEPRECATED The "build_dir" keyword argument of the SConscript function and env.SConscript() method are being replaced by a new "variant_dir" keyword argument. In some future release a deprecation warning will be added to existing uses of the SConscript()/env.SConscript() "build_dir" keyword argument. At some point after the deprecation warning, support for this keyword argument will be removed entirely. You can prepare for this by changing all your uses of the SConscript()/env.SConscript() 'build_dir" keyword argument: SConscript('src/SConscript', build_dir='opt') To use the new "variant_dir" keyword argument: SConscript('src/SConscript', variant_dir='opt') NOTE: USING THE NEW "variant_dir" KEYWORD IS NOT BACKWARDS COMPATIBLE TO VERSIONS OF SCons BEFORE 0.98. YOUR SConscript FILES WILL NOT WORK ON EARLIER VERSIONS OF SCons AFTER MAKING THIS CHANGE. If you change SConscript files in software that you make available for download or otherwise distribute, other users may try to build your software with an earlier version of SCons that does not support the "variant_dir" keyword. If you can insist that users use a recent version of SCons that supports "variant_dir", we recommend using the EnsureSConsVersion() function to provide a descriptive error message if your SConscript files are executed by an earlier version of SCons: EnsureSConsVersion(0, 98) If you want to make sure that your SConscript files will still work with earlier versions of SCons, then your best bet is to continue to use the "build_dir" keyword until the support is removed (which, in all likelihood, won't happen for quite some time). -- SCANNER NAMES HAVE BEEN DEPRECATED AND WILL BE REMOVED Several internal variable names in SCons.Defaults for various pre-made default Scanner objects have been deprecated and will be removed in a future revision. In their place are several new global variable names that are now part of the publicly-supported interface: NEW NAME DEPRECATED NAME -------- ---------------------------- CScanner SCons.Defaults.CScan DSCanner SCons.Defaults.DScan SourceFileScanner SCons.Defaults.ObjSourceScan ProgramScanner SCons.Defaults.ProgScan Of these, only ObjSourceScan was probably used at all, to add new mappings of file suffixes to other scanners for use by the Object() Builder. This should now be done as follows: SourceFileScanner.add_scanner('.x', XScanner) -- THE env.Copy() METHOD WILL CHANGE OR GO AWAY ENTIRELY The env.Copy() method (to make a copy of a construction environment) is being replaced by the env.Clone() method. As of SCons 0.98, a deprecation warning has been added to current uses of the env.Copy() method. At some point in the future, the env.Copy() method will either be removed entirely or have its behavior changed. You can prepare for this by changing all your uses of env.Copy() to env.Clone(), which has the exact same calling arguments. NOTE: CHANGING USES OF env.Copy() TO env.Clone() WILL MAKE YOUR SConscript FILES NOT WORK ON VERSIONS OF SCons BEFORE 0.96.93. If you change SConscript files in software that you make available for download or otherwise distribute, other users may try to build your software with an earlier version of SCons that does not have the env.Clone() method. We recommend preparing for this in one of two ways: -- Make your SConscript files backwards-compatible by including the following code near the beginning of your top-level SConstruct file: import SCons.Environment try: SCons.Environment.Environment.Clone except AttributeError: SCons.Environment.Environment.Clone = \ SCons.Environment.Environment.Copy -- Use the EnsureSConsVersion() function to provide a descriptive error message if your SConscript files are executed by an earlier version of SCons: EnsureSConsVersion(0, 96, 93) -- THE CheckLib Configure TEST WILL CHANGE BEHAVIOR The CheckLib() Configure test appends the lib(s) to the Environment's LIBS list in 1.3 and earlier. In 1.3 there is a new CheckLib argument, append, which defaults to True to preserve the old behavior. In a future release, append will be changed to default to False, to conform with autoconf and user expectations, since it is usually used to build up library lists in a right-to-left way. SCons is developed with an extensive regression test suite, and a rigorous development methodology for continually improving that suite. Because of this, SCons is of sufficient quality that you can use it for real work. The interfaces in release 1.0 will *not* be knowingly changed in any new, future 1.x release. If an interface change should ever become necessary due to extraordinary circumstances, the change and an appropriate transition strategy will be documented in these RELEASE notes. As you use SCons, please heed the following: - Please report any bugs or other problems that you find to our bug tracker at our SourceForge project page: http://sourceforge.net/tracker/?func=add&group_id=30337&atid=398971 We have a reliable bug-fixing methodology already in place and strive to respond to problems relatively quickly. - Documentation is spottier than we'd like. You may need to dive into the source code to figure out how to do something. Asking questions on the scons-users mailing list is also welcome. We will be addressing the documentation in upcoming releases, but would be more than glad to have your assistance in correcting this problem... :-) - The "SCons Design" documentation on the SCons web site is very out of date, as we made significant changes to portions of the interface as we figured out what worked and what didn't during the extensive beta implementation. The "SCons Design" document should be used only for historical purposes, or for just an extremely general understanding of SCons' architectural goals. - There may be performance issues. Improving SCons performance is an ongoing priority. If you still find the performance unacceptable, we would very much like to hear from you and learn more about your configuration so we can optimize the right things. - Error messages don't always exist where they'd be helpful. Please let us know about any errors you ran into that would have benefitted from a (more) descriptive message. KNOWN PROBLEMS IN THIS RELEASE: For a complete list of known problems, consult the SCons Issue Tracker at tigris.org: http://scons.tigris.org/project_issues.html - Support for parallel builds (-j) does not work on WIN32 systems prior to *official* Python release 2.2 (not 2.2 pre-releases). Prior to Python 2.2, there is a bug in Python's Win32 implementation such that when a thread spawns an external command, it blocks all threads from running. This breaks the SCons multithreading architecture used to support -j builds. We have included a patch file, os_spawnv_fix.diff, that you can use if you you want to fix your version of Python to support parallel builds in SCons. - Again, the "SCons Design" documentation on the SCons web site is out of date. Take what you read there with a grain of salt. - On Win32 systems, you must put a space between the redirection characters < and >, and the specified files (or construction variable expansions): command < $SOURCE > $TARGET If you don't supply a space (for example, "<$SOURCE"), SCons will not recognize the redirection. - MSVC .res files are not rebuilt when icons change. - The -c option does not clean up .sconsign files or directories created as part of the build, and also does not clean up SideEffect files (for example, Visual Studio .pdb files). - When using multiple Repositories, changing the name of an include file can cause an old version of the file to be used. - There is currently no way to force use of a relative path (../*) for directories outside the top-level SConstruct file. - The Jar() Builder will, on its second or subsequent invocation, package up the .sconsign files that SCons uses to track signatures. You can work around this by using the SConsignFile() function to collect all of the .sconsign information into a single file outside of the directory being packaged by Jar(). - SCons does not currently have a way to detect that an intermediate file has been corrupted from outside and should be rebuilt. - Unicode characters in path names do not work in all circumstances. - SCons does not currently automatically check out SConstruct or SConscript files from SCCS, RCS or BitKeeper. - No support yet for the following planned command-line options: -d -e -l --list-actions --list-derived --list-where -o --override -p -r -R -w --write-filenames -W --warn-undefined-variables Thank you for your interest, and please let us know how we can help improve SCons for your needs. -- The SCons Development Team Gary Oberbrunner and Bill Deegan, maintainers Thanks to all the contributors for all your help! Copyright (c) 2001 - 2017 The SCons Foundation src/Announce.txt rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog scons-src-3.0.0/src/setup.py0000664000175000017500000005267413160023045015775 0ustar bdbaddogbdbaddog# # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ NOTE: Installed SCons is not importable like usual Python packages. It is executed explicitly with command line scripts. This allows multiple SCons versions to coexist within single Python installation, which is critical for enterprise build cases. Explicit invokation is necessary to avoid confusion over which version of SCons is active. By default SCons is installed into versioned directory, e.g. site-packages/scons-2.1.0.alpha.20101125 and much of the stuff below is dedicated to make it happen on various platforms. """ from __future__ import print_function __revision__ = "src/setup.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import os import stat import sys Version = "3.0.0" man_pages = [ 'scons.1', 'sconsign.1', 'scons-time.1', ] # change to setup.py directory if it was executed from other dir (head, tail) = os.path.split(sys.argv[0]) if head: os.chdir(head) sys.argv[0] = tail # flag if setup.py is run on win32 or _for_ win32 platform, # (when building windows installer on linux, for example) is_win32 = 0 if not sys.platform == 'win32': try: if sys.argv[1] == 'bdist_wininst': is_win32 = 1 except IndexError: pass else: is_win32 = 1 import distutils import distutils.core import distutils.command.install import distutils.command.install_data import distutils.command.install_lib import distutils.command.install_scripts import distutils.command.build_scripts import distutils.msvccompiler def get_build_version(): """ monkey patch distutils msvc version if we're not on windows. We need to use vc version 9 for python 2.7.x and it defaults to 6 for non-windows platforms and there is no way to override it besides monkey patching""" return 9 distutils.msvccompiler.get_build_version = get_build_version _install = distutils.command.install.install _install_data = distutils.command.install_data.install_data _install_lib = distutils.command.install_lib.install_lib _install_scripts = distutils.command.install_scripts.install_scripts _build_scripts = distutils.command.build_scripts.build_scripts class _options(object): pass Options = _options() Installed = [] def set_explicitly(name, args): """ Return if the installation directory was set explicitly by the user on the command line. This is complicated by the fact that "install --install-lib=/foo" gets turned into "install_lib --install-dir=/foo" internally. """ if args[0] == "install_" + name: s = "--install-dir=" else: # The command is something else (usually "install") s = "--install-%s=" % name set = 0 length = len(s) for a in args[1:]: if a[:length] == s: set = 1 break return set class install(_install): user_options = _install.user_options + [ ('no-scons-script', None, "don't install 'scons', only install 'scons-%s'" % Version), ('no-version-script', None, "don't install 'scons-%s', only install 'scons'" % Version), ('install-bat', None, "install 'scons.bat' script"), ('no-install-bat', None, "do not install 'scons.bat' script"), ('install-man', None, "install SCons man pages"), ('no-install-man', None, "do not install SCons man pages"), ('standard-lib', None, "install SCons library in standard Python location"), ('standalone-lib', None, "install SCons library in separate standalone directory"), ('version-lib', None, "install SCons library in version-numbered directory"), ] boolean_options = _install.boolean_options + [ 'no-scons-script', 'no-version-script', 'install-bat', 'no-install-bat', 'install-man', 'no-install-man', 'standard-lib', 'standalone-lib', 'version-lib' ] if hasattr(os, 'link'): user_options.append( ('hardlink-scons', None, "hard link 'scons' to the version-numbered script, don't make a separate 'scons' copy"), ) boolean_options.append('hardlink-script') if hasattr(os, 'symlink'): user_options.append( ('symlink-scons', None, "make 'scons' a symbolic link to the version-numbered script, don't make a separate 'scons' copy"), ) boolean_options.append('symlink-script') def initialize_options(self): _install.initialize_options(self) self.no_scons_script = 0 self.no_version_script = 0 self.install_bat = 0 self.no_install_bat = not is_win32 self.install_man = 0 self.no_install_man = is_win32 self.standard_lib = 0 self.standalone_lib = 0 self.version_lib = 0 self.hardlink_scons = 0 self.symlink_scons = 0 # Don't warn about having to put the library directory in the # search path. self.warn_dir = 0 def finalize_options(self): _install.finalize_options(self) if self.install_bat: Options.install_bat = 1 else: Options.install_bat = not self.no_install_bat if self.install_man: Options.install_man = 1 else: Options.install_man = not self.no_install_man Options.standard_lib = self.standard_lib Options.standalone_lib = self.standalone_lib Options.version_lib = self.version_lib Options.install_scons_script = not self.no_scons_script Options.install_version_script = not self.no_version_script Options.hardlink_scons = self.hardlink_scons Options.symlink_scons = self.symlink_scons def get_scons_prefix(libdir, is_win32): """ Return the right prefix for SCons library installation. Find this by starting with the library installation directory (.../site-packages, most likely) and crawling back up until we reach a directory name beginning with "python" (or "Python"). """ drive, head = os.path.splitdrive(libdir) while head: if head == os.sep: break head, tail = os.path.split(head) if tail.lower()[:6] == "python": # Found the Python library directory... if is_win32: # ...on Win32 systems, "scons" goes in the directory: # C:\PythonXX => C:\PythonXX\scons return os.path.join(drive + head, tail) else: # ...on other systems, "scons" goes above the directory: # /usr/lib/pythonX.X => /usr/lib/scons return os.path.join(drive + head) return libdir def force_to_usr_local(self): """ A hack to decide if we need to "force" the installation directories to be under /usr/local. This is because Mac Os X Tiger and Leopard, by default, put the libraries and scripts in their own directories under /Library or /System/Library. """ return (sys.platform[:6] == 'darwin' and (self.install_dir[:9] == '/Library/' or self.install_dir[:16] == '/System/Library/')) class install_lib(_install_lib): def finalize_options(self): _install_lib.finalize_options(self) if force_to_usr_local(self): self.install_dir = '/usr/local/lib' args = self.distribution.script_args if not set_explicitly("lib", args): # They didn't explicitly specify the installation # directory for libraries... is_win32 = sys.platform == "win32" or args[0] == 'bdist_wininst' prefix = get_scons_prefix(self.install_dir, is_win32) if Options.standalone_lib: # ...but they asked for a standalone directory. self.install_dir = os.path.join(prefix, "scons") elif Options.version_lib or not Options.standard_lib: # ...they asked for a version-specific directory, # or they get it by default. self.install_dir = os.path.join(prefix, "scons-%s" % Version) msg = "Installed SCons library modules into %s" % self.install_dir Installed.append(msg) class install_scripts(_install_scripts): def finalize_options(self): _install_scripts.finalize_options(self) if force_to_usr_local(self): self.install_dir = '/usr/local/bin' self.build_dir = os.path.join('build', 'scripts') msg = "Installed SCons scripts into %s" % self.install_dir Installed.append(msg) def do_nothing(self, *args, **kw): pass def hardlink_scons(self, src, dst, ver): try: os.unlink(dst) except OSError: pass os.link(ver, dst) def symlink_scons(self, src, dst, ver): try: os.unlink(dst) except OSError: pass os.symlink(os.path.split(ver)[1], dst) def copy_scons(self, src, dst, *args): try: os.unlink(dst) except OSError: pass self.copy_file(src, dst) self.outfiles.append(dst) def run(self): # --- distutils copy/paste --- if not self.skip_build: self.run_command('build_scripts') # --- /distutils copy/paste --- # Custom SCons installation stuff. if Options.hardlink_scons: create_basename_script = self.hardlink_scons elif Options.symlink_scons: create_basename_script = self.symlink_scons elif Options.install_scons_script: create_basename_script = self.copy_scons else: create_basename_script = self.do_nothing if Options.install_version_script: create_version_script = self.copy_scons else: create_version_script = self.do_nothing inputs = self.get_inputs() bat_scripts = [x for x in inputs if x[-4:] == '.bat'] non_bat_scripts = [x for x in inputs if x[-4:] != '.bat'] self.outfiles = [] self.mkpath(self.install_dir) for src in non_bat_scripts: base = os.path.basename(src) scons = os.path.join(self.install_dir, base) scons_ver = scons + '-' + Version if is_win32: scons += '.py' scons_ver += '.py' create_version_script(src, scons_ver) create_basename_script(src, scons, scons_ver) if Options.install_bat: if is_win32: bat_install_dir = get_scons_prefix(self.install_dir, is_win32) else: bat_install_dir = self.install_dir for src in bat_scripts: scons_bat = os.path.join(bat_install_dir, 'scons.bat') scons_version_bat = os.path.join(bat_install_dir, 'scons-' + Version + '.bat') self.copy_scons(src, scons_bat) self.copy_scons(src, scons_version_bat) # --- distutils copy/paste --- if hasattr(os, 'chmod') and hasattr(os, 'stat'): # Set the executable bits (owner, group, and world) on # all the scripts we just installed. for file in self.get_outputs(): if self.dry_run: # log.info("changing mode of %s", file) pass else: # Use symbolic versions of permissions so this script doesn't fail to parse under python3.x exec_and_read_permission = stat.S_IXOTH | stat.S_IXUSR | stat.S_IXGRP | stat.S_IROTH | stat.S_IRUSR | stat.S_IRGRP mode_mask = 4095 # Octal 07777 used because python3 has different octal syntax than python 2 mode = ((os.stat(file)[stat.ST_MODE]) | exec_and_read_permission) & mode_mask # log.info("changing mode of %s to %o", file, mode) os.chmod(file, mode) # --- /distutils copy/paste --- class build_scripts(_build_scripts): def finalize_options(self): _build_scripts.finalize_options(self) self.build_dir = os.path.join('build', 'scripts') class install_data(_install_data): def initialize_options(self): _install_data.initialize_options(self) def finalize_options(self): _install_data.finalize_options(self) if force_to_usr_local(self): self.install_dir = '/usr/local' if Options.install_man: if is_win32: dir = 'Doc' else: dir = os.path.join('man', 'man1') self.data_files = [(dir, man_pages)] man_dir = os.path.join(self.install_dir, dir) msg = "Installed SCons man pages into %s" % man_dir Installed.append(msg) else: self.data_files = [] description = "Open Source next-generation build tool." long_description = """Open Source next-generation build tool. Improved, cross-platform substitute for the classic Make utility. In short, SCons is an easier, more reliable and faster way to build software.""" scripts = [ 'script/scons', 'script/sconsign', 'script/scons-time', 'script/scons-configure-cache', # We include scons.bat in the list of scripts, even on UNIX systems, # because we provide an option to allow it be installed explicitly, # for example if you're installing from UNIX on a share that's # accessible to Windows and you want the scons.bat. 'script/scons.bat', ] arguments = { 'name': "scons", 'version': Version, 'description': description, 'long_description': long_description, 'author': 'Steven Knight', 'author_email': 'knight@baldmt.com', 'url': "http://www.scons.org/", 'packages': ["SCons", "SCons.compat", "SCons.Node", "SCons.Options", "SCons.Platform", "SCons.Scanner", "SCons.Script", "SCons.Tool", "SCons.Tool.docbook", "SCons.Tool.MSCommon", "SCons.Tool.packaging", "SCons.Variables", ], 'package_dir': {'': 'engine', 'SCons.Tool.docbook': 'engine/SCons/Tool/docbook'}, 'package_data': {'SCons.Tool.docbook': ['docbook-xsl-1.76.1/*', 'docbook-xsl-1.76.1/common/*', 'docbook-xsl-1.76.1/docsrc/*', 'docbook-xsl-1.76.1/eclipse/*', 'docbook-xsl-1.76.1/epub/*', 'docbook-xsl-1.76.1/epub/bin/*', 'docbook-xsl-1.76.1/epub/bin/lib/*', 'docbook-xsl-1.76.1/epub/bin/xslt/*', 'docbook-xsl-1.76.1/extensions/*', 'docbook-xsl-1.76.1/fo/*', 'docbook-xsl-1.76.1/highlighting/*', 'docbook-xsl-1.76.1/html/*', 'docbook-xsl-1.76.1/htmlhelp/*', 'docbook-xsl-1.76.1/images/*', 'docbook-xsl-1.76.1/images/callouts/*', 'docbook-xsl-1.76.1/images/colorsvg/*', 'docbook-xsl-1.76.1/javahelp/*', 'docbook-xsl-1.76.1/lib/*', 'docbook-xsl-1.76.1/manpages/*', 'docbook-xsl-1.76.1/params/*', 'docbook-xsl-1.76.1/profiling/*', 'docbook-xsl-1.76.1/roundtrip/*', 'docbook-xsl-1.76.1/slides/browser/*', 'docbook-xsl-1.76.1/slides/fo/*', 'docbook-xsl-1.76.1/slides/graphics/*', 'docbook-xsl-1.76.1/slides/graphics/active/*', 'docbook-xsl-1.76.1/slides/graphics/inactive/*', 'docbook-xsl-1.76.1/slides/graphics/toc/*', 'docbook-xsl-1.76.1/slides/html/*', 'docbook-xsl-1.76.1/slides/htmlhelp/*', 'docbook-xsl-1.76.1/slides/keynote/*', 'docbook-xsl-1.76.1/slides/keynote/xsltsl/*', 'docbook-xsl-1.76.1/slides/svg/*', 'docbook-xsl-1.76.1/slides/xhtml/*', 'docbook-xsl-1.76.1/template/*', 'docbook-xsl-1.76.1/tests/*', 'docbook-xsl-1.76.1/tools/bin/*', 'docbook-xsl-1.76.1/tools/make/*', 'docbook-xsl-1.76.1/webhelp/*', 'docbook-xsl-1.76.1/webhelp/docs/*', 'docbook-xsl-1.76.1/webhelp/docs/common/*', 'docbook-xsl-1.76.1/webhelp/docs/common/css/*', 'docbook-xsl-1.76.1/webhelp/docs/common/images/*', 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/*', 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/*', 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/images/*', 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/*', 'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/images/*', 'docbook-xsl-1.76.1/webhelp/docs/content/*', 'docbook-xsl-1.76.1/webhelp/docs/content/search/*', 'docbook-xsl-1.76.1/webhelp/docs/content/search/stemmers/*', 'docbook-xsl-1.76.1/webhelp/docsrc/*', 'docbook-xsl-1.76.1/webhelp/template/*', 'docbook-xsl-1.76.1/webhelp/template/common/*', 'docbook-xsl-1.76.1/webhelp/template/common/css/*', 'docbook-xsl-1.76.1/webhelp/template/common/images/*', 'docbook-xsl-1.76.1/webhelp/template/common/jquery/*', 'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/*', 'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/images/*', 'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/*', 'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/images/*', 'docbook-xsl-1.76.1/webhelp/template/content/search/*', 'docbook-xsl-1.76.1/webhelp/template/content/search/stemmers/*', 'docbook-xsl-1.76.1/webhelp/xsl/*', 'docbook-xsl-1.76.1/website/*', 'docbook-xsl-1.76.1/xhtml/*', 'docbook-xsl-1.76.1/xhtml-1_1/*', 'utils/*']}, 'data_files': [('man/man1', man_pages)], 'scripts': scripts, 'cmdclass': {'install': install, 'install_lib': install_lib, 'install_data': install_data, 'install_scripts': install_scripts, 'build_scripts': build_scripts} } distutils.core.setup(**arguments) if Installed: for i in Installed: print(i) # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/MANIFEST.in0000664000175000017500000000000013160023040015764 0ustar bdbaddogbdbaddogscons-src-3.0.0/src/CHANGES.txt0000664000175000017500000063766713160023040016102 0ustar bdbaddogbdbaddog SCons - a software construction tool Change Log RELEASE 3.0.0 - Mon, 18 Sep 2017 08:32:04 -0700 NOTE: This is a major release. You should expect that some targets may rebuild when upgrading. Significant changes in some python action signatures. Also switching between PY 2.7 and PY 3.5, 3.6 will cause rebuilds. From William Blevins: - Updated D language scanner support to latest: 2.071.1. (PR #1924) https://dlang.org/spec/module.html accessed 11 August 2016 - Enhancements: - Added support for selective imports: "import A : B, C;" -> A - Added support for renamed imports. "import B = A;" -> A - Supports valid combinations: "import A, B, CCC = C, DDD = D : EEE = FFF;" -> A, B, C, D - Notes: - May find new (previously missed) Dlang dependencies. - May cause rebuild after upgrade due to dependency changes. - Updated Fortran-related tests to pass under GCC 5/6. - Fixed SCons.Tool.Packaging.rpm.package source nondeterminism across builds. From William Deegan: - Removed deprecated tools CVS, Perforce, BitKeeper, RCS, SCCS, Subversion. - Removed deprecated module SCons.Sig - Added prioritized list of xsltproc tools to docbook. The order will now be as follows: xsltproc, saxon, saxon-xslt, xalan (with first being highest priority, first tool found is used) - Fixed MSVSProject example code (http://scons.tigris.org/issues/show_bug.cgi?id=2979) - Defined MS SDK 10.0 and Changed VS 2015 to use SDK 10.0 - Changes to Action Function and Action Class signiture creation. NOTE: This will cause rebuilds for many builds when upgrading to SCons 3.0 - Fixed Bug #3027 - "Cross Compiling issue: cannot override ranlib" - Fixed Bug #3020 - "Download link in user guide wrong. python setup.py install --version-lib broken" - Fixed Bug #2486 - Added SetOption('silent',True) - Previously this value was not allowed to be set. - Fixed Bug #3040 - Non-unicode character in CHANGES.txt - Fixed Bug #2622 - AlwaysBuild + MSVC regression. - Fixed Bug #3025 - (Credit to Florian : User flow86 on tigris) - Fix typo JAVACLASSSUFIX should have been JAVACLASSSUFFIX From Ibrahim Esmat: - Added the capability to build Windows Store Compatible libraries that can be used with Universal Windows Platform (UWP) Apps and published to the store From Daniel Holth: - Add basic support for PyPy (by deleting __slots__ from Node with a metaclass on PyPy); wrap most-used open() calls in 'with' statements to avoid too many open files. - Add __main__.py for `python -m SCons` in case it is on PYTHONPATH. - Always use highest available pickle protocol for efficiency. - Remove unused command line fallback for the zip tool. From Gaurav Juvekar: - Fix issue #2832: Expand construction variables in 'chdir' argument of builders. (PR #463) - Fix issue #2910: Make --tree=all handle Unicode. (PR #427) - Fix issue #2788: Fix typo in documentation example for sconf. (PR #388) From Alexey Klimkin: - Use memoization to optimize PATH evaluation across all dependencies per node. (PR #345) - Use set() where it is applicable (PR #344) From M. Limber: - Fixed msvs.py for Visual Studio Express editions that would report "Error : ValueError: invalid literal for float(): 10.0Exp". From Rick Lupton: - Update LaTeX scanner to understand \import and related commands From Steve Robinson: - Add support for Visual Studio 2017. This support requires vswhere.exe a helper tool installed with newer installs of 2017. SCons expects it to be located at "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" It can be downloaded separately at https://github.com/Microsoft/vswhere From Tom Tanner: - Allow nested $( ... $) sections From PaweÅ‚ Tomulik: - Fixed the issue with LDMODULEVERSIONFLAGS reported by Tim Jenness (https://pairlist4.pair.net/pipermail/scons-users/2016-May/004893.html). An error was causing "-Wl,Bsymbolic" being added to linker's command-line even when there was no specified value in LDMODULEVERSION and thus no need for the flags to be specified. - Added LoadableModule to the list of global functions (DefaultEnvironment builders). From Manish Vachharajani: - Update debian rules, compat, and control to not use features deprecated or obsolete in later versions of debhelpers - Update python version to 2.7 in debian/control From Richard Viney: - Fixed PCHPDBFLAGS causing a deprecation warning on MSVC v8 and later when using PCHs and PDBs together. From Richard West: - Added nested / namespace tool support - Added a small fix to the python3 tool loader when loading a tool as a package - Added additional documentation to the user manual on using toolpaths with the environment This includes the use of sys.path to search for tools installed via pip or package managers - Added support for a PyPackageDir function for use with the toolpath From Russel Winder: - Reordered the default D tools from "dmd, gdc, ldc" to "dmd, ldc, gdc". - Add a ProgramAllAtOnce builder to the dmd, ldc, and gdc tools. (PR #448) - Remove a file name exception for very old Fedora LDC installation. - gdc can now handle building shared objects (tested for version 6.3.0). - Remove establishing the SharedLibrary builder in the dmd, ldc, and gdc tools, must now include the ar tool to get this builder as is required for other compiler tools. - Add clang and clang++ tools based on PaweÅ‚ Tomulik's work. RELEASE 2.5.1 - Mon, 03 Nov 2016 13:37:42 -0400 From William Deegan: - Add scons-configure-cache.py to packaging. It was omitted From Alexey Klimkin: - Use memoization to optimize PATH evaluation across all dependencies per node. (PR #345) RELEASE 2.5.0 - Mon, 09 Apr 2016 11:27:42 -0700 From Dirk Baechle: - Removed a lot of compatibility methods and workarounds for Python versions < 2.7, in order to prepare the work towards a combined 2.7/3.x version. (PR #284) Also fixed the default arguments for the print_tree and render_tree methods. (PR #284, too) From William Blevins: - Added support for cross-language dependency scanning; SCons now respects scanner keys for implicit dependencies. - Notes for SCons users with heterogeneous systems. - May find new (previously missed) dependencies. - May cause rebuild after upgrade due to dependency changes. - May find new dependency errors (EG. cycles). - Discovered in some of the SCons QT tests. - Resolved missing cross-language dependencies for SWIG bindings (fixes #2264). - Corrected typo in User Guide for Scanner keyword. (PR #2959) - Install builder interacts with scanner found in SCANNERS differently. - Previous: Install builder recursively scanned implicit dependencies for scanners from SCANNER, but not for built-in (default) scanners. - Current: Install builder will not scan for implicit dependencies via either scanner source. This optimizes some Install builder behavior and brings orthogonality to Install builder scanning behavior. From William Deegan: - Add better messaging when two environments have different actions for the same target (Bug #2024) - Fix issue only with MSVC and Always build where targets marked AlwaysBuild wouldn't make it into CHANGED_SOURCES and thus yield an empty compile command line. (Bug #2622) - Fix posix platform escaping logic to properly handle paths with parens in them "()". (Bug #2225) From Jakub Pola: - Intel Compiler 2016 (Linux/Mac) update for tool directories. From Adarsh Sanjeev: - Fix for issue #2494: Added string support for Chmod function. From Tom Tanner: - change cache to use 2 character subdirectories, rather than one character, so as not to give huge directories for large caches, a situation which causes issues for NFS. For existing caches, you will need to run the scons-configure-cache.py script to update them to the new format. You will get a warning every time you build until you co this. - Fix a bunch of unit tests on windows RELEASE 2.4.1 - Mon, 07 Nov 2015 10:37:21 -0700 From Arfrever Frehtes Taifersar Arahesis: - Fix for Bug # 2791 - Setup.py fails unnecessarily under Jython. From Dirk Baechle: - Fixed license of SVG titlepage files in the context of Debian packaging, such that they allow for commercial use too (#2985). From William Blevins: - InstallVersionedLib now available in the DefaultEnvironment context. - Improves orthogonality of use cases between different Install functions. From Carnë Draug: - Added new configure check, CheckProg, to check for existence of a program. From Andrew Featherstone: - Fix for issue #2840 - Fix for two environments specifying same target with different actions not throwing hard error. Instead SCons was incorrectly issuing a warning and continuing. From Hiroaki Itoh : - Add support `Microsoft Visual C++ Compiler for Python 2.7' Compiler can be obtained at: https://www.microsoft.com/en-us/download/details.aspx?id=44266 From Florian Miedniak: - Fixed tigris issue #3011: Glob() excludes didn't work when used with VariantDir(duplicate=0) From William Roberts: - Fix bug 2831 and allow Help() text to be appended to AddOption() help. From PaweÅ‚ Tomulik: - Reimplemented versioning for shared libraries, with the following effects - Fixed tigris issues #3001, #3006. - Fixed several other issues not reported to tigris, including: issues with versioned libraries in subdirectories with tricky names, issues with versioned libraries and variant directories, issue with soname not being injected to library when using D linkers, - Switched to direct symlinks instead of daisy-chained ones -- soname and development symlinks point directly to the versioned shared library now), for rationale see: https://www.debian.org/doc/debian-policy/ch-sharedlibs.html https://fedoraproject.org/wiki/Packaging:Guidelines#Devel_Packages https://bitbucket.org/scons/scons/pull-requests/247/new-versioned-libraries-gnulink-cyglink/diff#comment-10063929 - New construction variables to allow override default behavior: SONAME, SHLIBVERSIONFLAGS, _SHLIBVERSIONFLAGS, SHLIBNOVERSIONSYMLINKS, LDMODULEVERSION, LDMODULEVERSIONFLAGS, _LDMODULEVERSIONFLAGS, LDMODULENOVERSIONSYMLINKS. - Changed logic used to configure the versioning machinery from platform-centric to linker-oriented. - The SHLIBVERSION/LDMODULEVERSION variables are no longer validated by SCons (more freedom to users). - InstallVersionedLib() doesn't use SHLIBVERSION anymore. - Enchanced docs for the library versioning stuff. - New tests for versioned libraries. - Library versioning is currently implemented for the following linker tools: 'cyglink', 'gnulink', 'sunlink'. - Fix to swig tool - pick-up 'swig', 'swig3.0' and 'swig2.0' (in order). - Fix to swig tool - respect env['SWIG'] provided by user. RELEASE 2.4.0 - Mon, 21 Sep 2015 08:56:00 -0700 From Dirk Baechle: - Switched several core classes to use "slots", to reduce the overall memory consumption in large projects (fixes #2180, #2178, #2198) - Memoizer counting uses decorators now, instead of the old metaclasses approach. From Andrew Featherstone - Fixed typo in SWIGPATH description RELEASE 2.3.6 - Mon, 31 Jul 2015 14:35:03 -0700 From Rob Smith: - Added support for Visual Studio 2015 RELEASE 2.3.5 - Mon, 17 Jun 2015 21:07:32 -0700 From Stephen Pollard: - Documentation fixes for libraries.xml and builders-writing.xml (#2989 and #2990) From William Deegan: - Extended docs for InstallVersionedLib/SharedLibrary, and added SKIP_WIN_PACKAGES argument to build script bootstrap.py (PR #230, #3002). From William Blevins: - Fixed symlink support (PR #227, #2395). - Updated debug-count test case (PR #229). From Alexey Klimkin: - Fixed incomplete LIBS flattening and substitution in Program scanner(PR #205, #2954). From Dirk Baechle: - Added new method rentry_exists_on_disk to Node.FS (PR #193). From Russel Winder: - Fixed several D tests under the different OS. - Add support for f08 file extensions for Fortran 2008 code. From Anatoly Techtonik: - Show --config choices if no argument is specified (PR #202). - Fixed build crash when XML toolchain isn't installed, and activated compression for ZIP archives. From Alexandre Feblot: - Fix for VersionedSharedLibrary under 'sunos' platform. - Fixed dll link with precompiled headers on MSVC 2012 - Added an 'exclude' parameter to Glob() From Laurent Marchelli: - Support for multiple cmdargs (one per variant) in VS project files. - Various improvements for TempFileMunge class. - Added an implementation for Visual Studio users files (PR #209). From Dan Pidcock: - Added support for the 'PlatformToolset' tag in VS project files (#2978). From James McCoy: - Added support for '-isystem' to ParseFlags. RELEASE 2.3.4 - Mon, 27 Sep 2014 12:50:35 -0400 From Bernhard Walle and Dirk Baechle: - Fixed the interactive mode, in connection with Configure contexts (#2971). From Anatoly Techtonik: - Fix EnsureSConsVersion warning when running packaged version From Russel Winder: - Fix D tools for building shared libraries RELEASE 2.3.3 - Sun, 24 Aug 2014 21:08:33 -0400 From Roland Stark: - Fixed false line length calculation in the TempFileMunge class (#2970). From Gary Oberbrunner: - Improve SWIG detection From Russel Winder: - Fix regression on Windows in D language update From Neal Becker and Stefan Zimmermann: - Python 3 port and compatibility From Anatoly Techtonik: - Do not fail on EnsureSConsVersion when running from checkout From Kendrick Boyd and Rob Managan: - Fixed the newglossary action to work with VariantDir (LaTeX). From Manuel Francisco Naranjo: - Added a default for the BUILDERS environment variable, to prevent not defined exception on a Clone(). From Andrew Featherstone: - Added description of CheckTypeSize method (#1991). - Fixed handling of CPPDEFINE var in Append() for several list-dict combinations (#2900). From William Blevins: - Added test for Java derived-source dependency tree generation. - Added Copy Action symlink soft-copy support (#2395). - Various contributions to the documentation (UserGuide). RELEASE 2.3.2 From Dirk Baechle: - Update XML doc editor configuration - Fix: Allow varlist to be specified as list of strings for Actions (#2754) From veon on bitbucket: - Fixed handling of nested ifs in CPP scanner PreProcessor class. From Shane Gannon: - Support for Visual Studio 2013 (12.0) From Michael Haubenwallner: - Respect user's CC/CXX values; don't always overwrite in generate() - Delegate linker Tool.exists() to CC/CXX Tool.exists(). From Rob Managan: - Updated the TeX builder to support use of the -synctex=1 option and the files it creates. - Updated the TeX builder to correctly clean auxiliary files when the biblatex package is used. From Gary Oberbrunner: - get default RPM architecture more robustly when building RPMs From Amir Szekely: - Fixed NoClean() for multi-target builders (#2353). From PaweÅ‚ Tomulik: - Fix SConf tests that write output From Russel Winder: - Revamp of the D language support. Tools for DMD, GDC and LDC provided and integrated with the C and C++ linking. NOTE: This is only tested with D v2. Support for D v1 is now deprecated. From Anatoly Techtonik: - Several improvements for running scons.py from source: * engine files form source directory take priority over all other importable versions * message about scons.py running from source is removed to fix tests that were failing because of this extra line in the output * error message when SCons import fails now lists lookup paths - Remove support for QMTest harness from runtest.py - Remove RPM and m4 from default tools on Windows - BitKeeper, CVS, Perforce, RCS, SCCS are deprecated from default tools and will be removed in future SCons versions to speed up SCons initialization (it will still be possible to use these tools explicitly) From Sye van der Veen: - Support for Visual Studio 12.0Exp, and fixes for earlier MSVS versions. RELEASE 2.3.1 From Andrew Featherstone: - Added support for EPUB output format to the DocBook tool. From Tom Tanner: - Stop leaking file handles to subprocesses by switching to using subprocess always. - Allow multiple options to be specified with --debug=a,b,c - Add support for a readonly cache (--cache-readonly) - Always print stats if requested - Generally try harder to print out a message on build errors - Adds a switch to warn on missing targets - Add Pseudo command to mark targets which should not exist after they are built. From Bogdan Tenea: - Check for 8.3 filenames on cygwin as well as win32 to make variant_dir work properly. From Alexandre Feblot: - Make sure SharedLibrary depends on all dependent libs (by depending on SHLINKCOM) From Stefan Sperling: - Fixed the setup of linker flags for a versioned SharedLibrary under OpenBSD (#2916). From Antonio Cavallo: - Improve error if Visual Studio bat file not found. From Manuel Francisco Naranjo: - Allow Subst.Literal string objects to be compared with each other, so they work better in AddUnique() and Remove(). From David Rothenberger: - Added cyglink linker that uses Cygwin naming conventions for shared libraries and automatically generates import libraries. From Dirk Baechle: - Update bootstrap.py so it can be used from any dir, to run SCons from a source (non-installed) dir. - Count statistics of instances are now collected only when the --debug=count command-line option is used (#2922). - Added release_target_info() to File nodes, which helps to reduce memory consumption in clean builds and update runs of large projects. - Fixed the handling of long options in the command-line parsing (#2929). - Fixed misspelled variable in intelc.py (#2928). From Gary Oberbrunner: - Test harness: fail_test() can now print a message to help debugging. From Anatoly Techtonik: - Require rpmbuild when building SCons package. - Print full stack on certain errors, for debugging. - Improve documentation for Textfile builder. From William Deegan: - VS2012 & VS2010 Resolve initialization issues by adding path to reg.exe in shell used to run batch files. - MSVC Support fixed defaulting TARGET_ARCH to HOST_ARCH. It should be None if not explicitly set. - MSVC Fixed issue where if more than one Architectures compilers are detected, it would take the last one found, and not the first. From Philipp Kraus: - Added optional ZIPROOT to Zip tool. From Dirk Baechle: - Replaced old SGML-based documentation toolchain with a more modern approach, that also requires less external dependencies (programs and Python packages). Added a customized Docbook XSD for strict validation of all input XML files. From Luca Falavigna: - Fixed spelling errors in MAN pages (#2897). From Michael McDougall: - Fixed description of ignore_case for EnumVariable in the MAN page (#2774). RELEASE 2.3.0 - Mon, 02 Mar 2013 13:22:29 -0400 From Anatoly Techtonik: - Added ability to run scripts/scons.py directly from source checkout - Hide deprecated --debug={dtree,stree,tree} from --help output - Error messages from option parser now include hints about valid choices - Cleaned up some Python 1.5 and pre-2.3 code, so don't expect SCons to run on anything less than Python 2.4 anymore - Several fixes for runtest.py: * exit with an error if no tests were found * removed --noqmtest option - this behavior is by default * replaced `-o FILE --xml` combination with `--xml FILE` * changed `-o, --output FILE` option to capture stdout/stderr output from runtest.py - Remove os_spawnv_fix.diff patch required to enable parallel builds support prior to Python 2.2 From Juan Lang: - Fix WiX Tool to use .wixobj rather than .wxiobj for compiler output - Support building with WiX releases after 2.0 From Alexey Klimkin: - Fix nested LIBPATH expansion by flattening sequences in subst_path. From eyan on Bitbucket: - Print target name with command execution time with --debug=time From Thomas Berg and Evgeny Podjachev: - Fix subprocess spawning on Windows. Work around a Windows bug that can crash python occasionally when using -jN. (#2449) From Dirk Baechle: - Updated test framework to support dir and file fixtures and added ability to test external (out-of-tree) tools (#2862). See doc in QMTest/test-framework.rst. - Fixed several errors in the test suite (Java paths, MSVS version detection, Tool import), additionally * provided MinGW command-line support for the CXX, AS and Fortran tests, * refactored the detection of the gcc version and the according Fortran startup library, * provided a new module rpmutils.py, wrapping the RPM naming rules for target files and further hardware-dependent info (compatibility, compiler flags, ...), * added new test methods must_exist_one_of() and must_not_exist_any_of() and * removed Aegis support from runtest.py. (#2872) From Gary Oberbrunner: - Add -jN support to runtest.py to run tests in parallel - Add MSVC10 and MSVC11 support to get_output low-level bat script runner. - Fix MSVS solution generation for VS11, and fixed tests. From Rob Managan: - Updated the TeX builder to support the \newglossary command in LaTeX's glossaries package and the files it creates. - Improve support for new versions of biblatex in the TeX builder so biber is called automatically if biblatex requires it. - Add SHLIBVERSION as an option that tells SharedLibrary to build a versioned shared library and create the required symlinks. Add builder InstallVersionedLib to create the required symlinks installing a versioned shared library. RELEASE 2.2.0 - Mon, 05 Aug 2012 15:37:48 +0000 From dubcanada on Bitbucket: - Fix 32-bit Visual Express C++ on 64-bit Windows (generate 32-bit code) From PaweÅ‚ Tomulik: - Added gettext toolset - Fixed FindSourceFiles to find final sources (leaf nodes). From Greg Ward: - Allow Node objects in Java path (#2825) From Joshua Hughes: - Make Windows not redefine builtin file as un-inheritable (#2857) - Fix WINDOWS_INSERT_DEF on MinGW (Windows) (#2856) From smallbub on Bitbucket: - Fix LINKCOMSTR, SHLINKCOMSTR, and LDMODULECOMSTR on Windows (#2833). From Mortoray: - Make -s (silent mode) be silent about entering subdirs (#2976). - Fix cloning of builders when cloning environment (#2821). From Gary Oberbrunner: - Show valid Visual Studio architectures in error message when user passes invalid arch. From Alexey Petruchik: - Support for Microsoft Visual Studio 11 (both using it and generating MSVS11 solution files). From Alexey Klimkin: - Fixed the Taskmaster, curing spurious build failures in multi-threaded runs (#2720). From Dirk Baechle: - Improved documentation of command-line variables (#2809). - Fixed scons-doc.py to properly convert main XML files (#2812). From Rob Managan: - Updated the TeX builder to support LaTeX's multibib package. - Updated the TeX builder to support LaTeX's biblatex package. - Added support for using biber instead of bibtex by setting env['BIBTEX'] = 'biber' From Arve Knudsen: - Test for FORTRANPPFILESUFFIXES (#2129). RELEASE 2.1.0 - Mon, 09 Sep 2011 20:54:57 -0700 From Anton Lazarev: - Fix Windows resource compiler scanner to accept DOS line endings. From Matthias: - Update MSVS documents to remove note indicating that only one project is currently supported per solution file. From Grzegorz BizoÅ„: - Fix long compile lines in batch mode by using TEMPFILE - Fix MSVC_BATCH=False (was treating it as true) From Justin Gullingsrud: - support -std=c++0x and related CXXFLAGS in pkgconfig (ParseFlags) From Vincent Beffara: - Support -dylib_file in pkgconfig (ParseFlags) From Gary Oberbrunner and Sohail Somani: - new construction variable WINDOWS_EMBED_MANIFEST to automatically embed manifests in Windows EXEs and DLLs. From Gary Oberbrunner: - Fix Visual Studio project generation when CPPPATH contains Dir nodes - Ensure Visual Studio project is regenerated when CPPPATH or CPPDEFINES change - Fix unicode error when using non-ASCII filenames with Copy or Install - Put RPATH in LINKCOM rather than LINKFLAGS so resetting LINKFLAGS doesn't kill RPATH - Fix precompiled headers on Windows when variant dir name has spaces. - Adding None to an Action no longer fails (just returns original action) - New --debug=prepare option to show each target as it's being prepared, whether or not anything needs to be done for it. - New debug option --debug=duplicate to print a line for each unlink/relink (or copy) of a variant file from its source file. - Improve error message for EnumVariables to show legal values. - Fix Intel compiler to sort versions >9 correctly (esp. on Linux) - Fix Install() when the source and target are directories and the target directory exists. From David Garcia Garzon: - Fix Delete to be able to delete broken symlinks and dir symlinks. From Imran Fanaswala and Robert Lehr: - Handle .output file generated by bison/yacc properly. Cleaning it when necessary. From Antoine Dechaume: - Handle SWIG file where there is whitespace after the module name properly. Previously the generated files would include the whitespace. From Dmitry R.: - Handle Environment in case __semi_deepcopy is None From Benoit Belley: - Much improved support for Windows UNC paths (\\SERVERNAME). From Jean-Baptiste Lab: - Fix problems with appending CPPDEFINES that contain dictionaries, and related issues with Parse/MergeFlags and CPPDEFINES. From Allen Weeks: - Fix for an issue with implicit-cache with multiple targets when dependencies are removed on disk. From Evgeny Podjachev and Alexey Petruchick: - Support generation of Microsoft Visual Studio 2008 (9.0) and 2010 (10.0) project and solution files. From Ken Deeter: - Fix a problem when FS Entries which are actually Dirs have builders. From Luca Falavigna: - Support Fortran 03 From Gary Oberbrunner: - Print the path to the SCons package in scons --version From Jean-Fran�ois Colson: - Improve Microsoft Visual Studio Solution generation, and fix various errors in the generated solutions especially when using MSVS_SCC_PROVIDER, and when generating multiple projects. The construction variable MSVS_SCC_PROJECT_BASE_PATH, which never worked properly, is removed. Users can use the new variable MSVS_SCC_CONNECTION_ROOT instead if desired. From Anatoly Techtonik: - Use subprocess in bootstrap.py instead of os.execve to avoid losing output control on Windows (http://bugs.python.org/issue9148) - Revert patch for adding SCons to App Paths, because standard cmd shell doesn't search there. This is confusing, because `scons` can be executed from explorer, but fail to start from console. - Fix broken installation with easy_install on Windows (issue #2051) SCons traditionally installed in a way that allowed to run multiple versions side by side. This custom logic was incompatible with easy_install way of doing things. - Use epydoc module for generating API docs in HTML if command line utility is not found in PATH. Actual for Windows. From Alexander Goomenyuk: - Add .sx to assembly source scanner list so .sx files get their header file dependencies detected. From Arve Knudsen: - Set module metadata when loading site_scons/site_init.py so it is treated as a proper module; __doc__, __file__ and __name__ now refer to the site_init.py file. From Russel Winder: - Users Guide updates explaining that Tools can be packages as well as python modules. From Gary Oberbrunner: - New systemwide and per-user site_scons dirs. From Dirk Baechle: - XML fixes in User's Guide. - Fixed the detection of 'jar' and 'rmic' during the initialization of the respective Tools (#2730). - Improved docs for custom Decider functions and custom Scanner objects (#2711, #2713). - Corrected SWIG module names for generated *.i files (#2707). From Joe Zuntz: - Fixed a case-sensitivity problem with Fortran modules. From Bauke Conijn: - Added Users Guide example for auto-generated source code From Steven Knight: - Fix explicit dependencies (Depends()) on Nodes that don't have attached Builders. - Fix use of the global Alias() function with command actions. From Matt Hughes: - Fix the ability to append to default $*FLAGS values (which are implemented as CLVar instances) in a copied construction environment without affecting the original construction environment's value. From Rob Managan: - Updated the TeX command strings to include a /D on Windows in case the new directory is on a different drive letter. - Fixed the LaTeX scanner so dependencies are found in commands that are broken across lines with a comment or have embedded spaces. - The TeX builders should now work with tex files that are generated by another program. Thanks to Hans-Martin von Gaudecker for isolating the cause of this bug. - Added support for INDEXSTYLE environment variable so makeindex can find style files. - Added support for the bibunits package so we call bibtex on all the bu*.aux files. - Add support of finding path information on OSX for TeX applications MacPorts and Fink paths need to be added by the user From Russel Winder: - Add support for DMD version 2 (the phobos2 library). From William Deegan: - Add initial support for VS/VC 2010 (express and non-express versions) - Remove warning for not finding MS VC/VS install. "scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly" - Add support for Linux 3.0 RELEASE 2.0.1 - Mon, 15 Aug 2010 15:46:32 -0700 From Dirk Baechle: - Fix XML in documentation. From Joe Zuntz: - Fixed a case-sensitivity problem with Fortran modules. From Bauke Conijn: - Added Users Guide example for auto-generated source code From Steven Knight: - Fix explicit dependencies (Depends()) on Nodes that don't have attached Builders. From Matt Hughes: - Fix the ability to append to default $*FLAGS values (which are implemented as CLVar instances) in a copied construction environment without affecting the original construction environment's value. From Rob Managan: - Updated the TeX command strings to include a /D on Windows in case the new directory is on a different drive letter. - Fixed the LaTeX scanner so dependencies are found in commands that are broken across lines with a comment or have embedded spaces. RELEASE 2.0.0.final.0 - Mon, 14 Jun 2010 22:01:37 -0700 From Dirk Baechle: - Fix XML in documentation. From Steven Knight: - Provide forward compatibility for the 'profile' module. - Provide forward compatibility for the 'pickle' module. - Provide forward compatibility for the 'io' module. - Provide forward compatibility for the 'queue' module. - Provide forward compatibility for the 'collections' module. - Provide forward compatibility for the 'builtins' module. - Provide forward compatibility for 'sys.intern()'. - Convert to os.walk() from of os.path.walk(). - Remove compatibility logic no longer needed. - Add a '-3' option to runtest to print 3.x incompatibility warnings. - Convert old-style classes into new-style classes. - Fix "Ignoring corrupt sconsign entry" warnings when building in a tree with a pre-2.0 .sconsign file. - Fix propagation from environment of VS*COMNTOOLS to resolve issues initializing MSVC/MSVS/SDK issues. - Handle detecting Visual C++ on Python verions with upper-case platform architectures like 'AMD64'. From W. Trevor King: - Revisions to README. From Greg Noel: - Apply numerous Python fixers to update code to more modern idioms. Find where fixers should be applied to code in test strings and apply the fixers there, too. - Write a fixer to convert string functions to string methods. - Modify the 'dict' fixer to be less conservative. - Modify the 'apply' fixer to handle more cases. - Create a modified 'types' fixer that converts types to 2.x equivalents rather than 3.x equivalents. - Write a 'division' fixer to highlight uses of the old-style division operator. Correct usage where needed. - Add forward compatibility for the new 'memoryview' function (which replaces the 'buffer' function). - Add forward compatibility for the 'winreg' module. - Remove no-longer-needed 'platform' module. - Run tests with the '-3' option to Python 2.6 and clear up various reported incompatibilities. - Comb out code paths specialized to Pythons older than 2.4. - Update deprecation warnings; most now become mandatory. - Start deprecation cycle for BuildDir() and build_dir. - Start deprecation cycle for SourceCode() and related factories - Fixed a problem with is_Dict() not identifying some objects derived from UserDict. From Jim Randall: - Document the AllowSubstExceptions() function in the User's Guide. From William Deegan: - Migrate MSVC/MSVS/SDK improvements from 1.3 branch. RELEASE 1.3.0 - Tue, 23 Mar 2010 21:44:19 -0400 From Steven Knight: - Update man page and documentation. From William Deegan (plus minor patch from Gary Oberbrunner): - Support Visual Studio 8.0 Express RELEASE 1.2.0.d20100306 - Sat, 06 Mar 2010 16:18:33 -0800 From Luca Falavigna: - Fix typos in the man page. From Gottfried Ganssauge: - Support execution when SCons is installed via easy_install. From Steven Knight: - Make the messages for Configure checks of compilers consistent. - Issue an error message if a BUILDERS entry is not a Builder object or a callable wrapper. From Rob Managan: - Update tex builder to handle the case where a \input{foo} command tries to work with a directory named foo instead of the file foo.tex. The builder now ignores a directory and continues searching to find the correct file. Thanks to Lennart Sauerbeck for the test case and initial patch Also allow the \include of files in subdirectories when variantDir is used with duplicate=0. Previously latex would crash since the directory in which the .aux file is written was not created. Thanks to Stefan Hepp for finding this and part of the solution. From James Teh: - Patches to fix some issues using MS SDK V7.0 From William Deegan: - Lots of testing and minor patches to handle mixed MS VC and SDK installations, as well as having only the SDK installed. RELEASE 1.2.0.d20100117 - Sun, 17 Jan 2010 14:26:59 -0800 From Jim Randall: - Fixed temp filename race condition on Windows with long cmd lines. From David Cournapeau: - Fixed tryRun when sconf directory is in a variant dir. - Do not add -fPIC for ifort tool on non-posix platforms (darwin and windows). - Fix bug 2294 (spurious CheckCC failures). - Fix scons bootstrap process on windows 64 (wrong wininst name) From William Deegan: - Final merge from vs_revamp branch to main - Added definition and usage of HOST_OS, HOST_ARCH, TARGET_OS, TARGET_ARCH, currently only defined/used by Visual Studio Compilers. This will be rolled out to other platforms/tools in the future. - Add check for python >= 3.0.0 and exit gracefully. For 1.3 python >= 1.5.2 and < 3.0.0 are supported - Fix bug 1944 - Handle non-existent .i file in swig emitter, previously it would crash with an IOError exception. Now it will try to make an educated guess on the module name based on the filename. From Lukas Erlinghagen: - Have AddOption() remove variables from the list of seen-but-unknown variables (which are reported later). - An option name and aliases can now be specified as a tuple. From Hartmut Goebel: - Textfile builder. From Jared Grubb: - use "is/is not" in comparisons with None instead of "==" or "!=". From Jim Hunziker: - Avoid adding -gphobos to a command line multiple times when initializing use of the DMD compiler. From Jason Kenney: - Sugguested HOST/TARGET OS/ARCH separation. From Steven Knight: - Fix the -n option when used with VariantDir(duplicate=1) and the variant directory doesn't already exist. - Fix scanning of Unicode files for both UTF-16 endian flavors. - Fix a TypeError on #include of file names with Unicode characters. - Fix an exception if a null command-line argument is passed in. - Evaluate Requires() prerequisites before a Node's direct children (sources and dependencies). From Greg Noel: - Remove redundant __metaclass__ initializations in Environment.py. - Correct the documentation of text returned by sconf.Result(). - Document that filenames with '.' as the first character are ignored by Glob() by default (matching UNIX glob semantics). - Fix SWIG testing infrastructure to work on Mac OS X. - Restructure a test that occasionally hung so that the test would detect when it was stuck and fail instead. - Substfile builder. From Gary Oberbrunner: - When reporting a target that SCons doesn't know how to make, specify whether it's a File, Dir, etc. From Ben Webb: - Fix use of $SWIGOUTDIR when generating Python wrappers. - Add $SWIGDIRECTORSUFFIX and $SWIGVERSION construction variables. From Rob Managan: - Add -recorder flag to Latex commands and updated internals to use the output to find files TeX creates. This allows the MiKTeX installations to find the created files - Notify user of Latex errors that would get buried in the Latex output - Remove LATEXSUFFIXES from environments that don't initialize Tex. - Add support for the glossaries package for glossaries and acronyms - Fix problem that pdftex, latex, and pdflatex tools by themselves did not create the actions for bibtex, makeindex,... by creating them and other environment settings in one routine called by all four tex tools. - Fix problem with filenames of sideeffects when the user changes the name of the output file from the latex default - Add scanning of files included in Latex by means of \lstinputlisting{} Patch from Stefan Hepp. - Change command line for epstopdf to use --outfile= instead of -o since this works on all platforms. Patch from Stefan Hepp. - Change scanner to properly search for included file from the directory of the main file instead of the file it is included from. Also update the emitter to add the .aux file associated with \include{filename} commands. This makes sure the required directories if any are created for variantdir cases. Half of the patch from Stefan Hepp. RELEASE 1.2.0.d20090223 - Mon, 23 Feb 2009 08:41:06 -0800 From Stanislav Baranov: - Make suffix-matching for scanners case-insensitive on Windows. From David Cournapeau: - Change the way SCons finds versions of Visual C/C++ and Visual Studio to find and use the Microsoft v*vars.bat files. From Robert P. J. Day: - User's Guide updates. From Dan Eaton: - Fix generation of Visual Studio 8 project files on x64 platforms. From Allan Erskine: - Set IncludeSearchPath and PreprocessorDefinitions in generated Visual Studio 8 project files, to help IntelliSense work. From Mateusz Gruca: - Fix deletion of broken symlinks by the --clean option. From Steven Knight: - Fix the error message when use of a non-existent drive on Windows is detected. - Add sources for files whose targets don't exist in $CHANGED_SOURCES. - Detect implicit dependencies on commands even when the command is quoted. - Fix interaction of $CHANGED_SOURCES with the --config=force option. - Fix finding #include files when the string contains escaped backslashes like "C:\\some\\include.h". - Pass $CCFLAGS to Visual C/C++ precompiled header compilation. - Remove unnecessary nested $( $) around $_LIBDIRFLAGS on link lines for the Microsoft linker, the OS/2 ilink linker and the Phar Lap linkloc linker. - Spell the Windows environment variables consistently "SystemDrive" and "SystemRoot" instead of "SYSTEMDRIVE" and "SYSTEMROOT". RELEASE 1.2.0.d20090113 - Tue, 13 Jan 2009 02:50:30 -0800 From Stanislav Baranov, Ted Johnson and Steven Knight: - Add support for batch compilation of Visual Studio C/C++ source files, controlled by a new $MSVC_BATCH construction variable. From Steven Knight: - Print the message, "scons: Build interrupted." on error output, not standard output. - Add a --warn=future-deprecated option for advance warnings about deprecated features that still have warnings hidden by default. - Fix use of $SOURCE and $SOURCES attributes when there are no sources specified in the Builder call. - Add support for new $CHANGED_SOURCES, $CHANGED_TARGETS, $UNCHANGED_SOURCES and $UNCHANGED_TARGETS variables. - Add general support for batch builds through new batch_key= and targets= keywords to Action object creation. From Arve Knudsen: - Make linker tools differentiate properly between SharedLibrary and LoadableModule. - Document TestCommon.shobj_prefix variable. - Support $SWIGOUTDIR values with spaces. From Rob Managan: - Don't automatically try to build .pdf graphics files for .eps files in \includegraphics{} calls in TeX/LaTeX files when building with the PDF builder (and thus using pdflatex). From Gary Oberbrunner: - Allow AppendENVPath() and PrependENVPath() to interpret '#' for paths relative to the top-level SConstruct directory. - Use the Borland ilink -e option to specify the output file name. - Document that the msvc Tool module uses $PCH, $PCHSTOP and $PDB. - Allow WINDOWS_INSERT_DEF=0 to disable --output-def when linking under MinGW. From Zia Sobhani: - Fix typos in the User's Guide. From Greg Spencer: - Support implicit dependency scanning of files encoded in utf-8 and utf-16. From Roberto de Vecchi: - Remove $CCFLAGS from the the default definitions of $CXXFLAGS for Visual C/C++ and MIPSpro C++ on SGI so, they match other tools and avoid flag duplication on C++ command lines. From Ben Webb: - Handle quoted module names in SWIG source files. - Emit *_wrap.h when SWIG generates header file for directors From Matthew Wesley: - Copy file attributes so we identify, and can link a shared library from, shared object files in a Repository. RELEASE 1.2.0 - Sat, 20 Dec 2008 22:47:29 -0800 From Steven Knight: - Don't fail if can't import a _subprocess module on Windows. - Add warnings for use of the deprecated Options object. RELEASE 1.1.0.d20081207 - Sun, 07 Dec 2008 19:17:23 -0800 From Benoit Belley: - Improve the robustness of GetBuildFailures() by refactoring SCons exception handling (especially BuildError exceptions). - Have the --taskmastertrace= option print information about individual Task methods, not just the Taskmaster control flow. - Eliminate some spurious dependency cycles by being more aggressive about pruning pending children from the Taskmaster walk. - Suppress mistaken reports of a dependency cycle when a child left on the pending list is a single Node in EXECUTED state. From David Cournapeau: - Fix $FORTRANMODDIRPREFIX for the ifort (Intel Fortran) tool. From Brad Fitzpatrick: - Don't pre-generate an exception message (which will likely be ignored anyway) when an EntryProxy re-raises an AttributeError. From Jared Grubb: - Clean up coding style and white space in Node/FS.py. - Fix a typo in the documentation for $_CPPDEFFLAGS. - Issue 2401: Fix usage of comparisons with None. From Ludwig H�hne: - Handle Java inner classes declared within a method. From Steven Knight: - Fix label placement by the "scons-time.py func" subcommand when a profile value was close to (or equal to) 0.0. - Fix env.Append() and env.Prepend()'s ability to add a string to list-like variables like $CCFLAGS under Python 2.6. - Other Python2.6 portability: don't use "as" (a Python 2.6 keyword). Don't use the deprecated Exception.message attribute. - Support using the -f option to search for a different top-level file name when walking up with the -D, -U or -u options. - Fix use of VariantDir when the -n option is used and doesn't, therefore, actually create the variant directory. - Fix a stack trace from the --debug=includes option when passed a static or shared library as an argument. - Speed up the internal find_file() function (used for searching CPPPATH, LIBPATH, etc.). - Add support for using the Python "in" keyword on construction environments (for example, if "CPPPATH" in env: ...). - Fix use of Glob() when a repository or source directory contains an in-memory Node without a corresponding on-disk file or directory. - Add a warning about future reservation of $CHANGED_SOURCES, $CHANGED_TARGETS, $UNCHANGED_SOURCES and $UNCHANGED_TARGETS. - Enable by default the existing warnings about setting the resource $SOURCE, $SOURCES, $TARGET and $TARGETS variable. From Rob Managan: - Scan for TeX files in the paths specified in the $TEXINPUTS construction variable and the $TEXINPUTS environment variable. - Configure the PDF() and PostScript() Builders as single_source so they know each source file generates a separate target file. - Add $EPSTOPDF, $EPSTOPDFFLAGS and $EPSTOPDFCOM - Add .tex as a valid extension for the PDF() builder. - Add regular expressions to find \input, \include and \includegraphics. - Support generating a .pdf file from a .eps source. - Recursive scan included input TeX files. - Handle requiring searched-for TeX input graphics files to have extensions (to avoid trying to build a .eps from itself, e.g.). From Greg Noel: - Make the Action() function handle positional parameters consistently. - Clarify use of Configure.CheckType(). - Make the File.{Dir,Entry,File}() methods create their entries relative to the calling File's directory, not the SConscript directory. - Use the Python os.devnull variable to discard error output when looking for the $CC or $CXX version. - Mention LoadableModule() in the SharedLibrary() documentation. From Gary Oberbrunner: - Update the User's Guide to clarify use of the site_scons/ directory and the site_init.py module. - Make env.AppendUnique() and env.PrependUnique remove duplicates within a passed-in list being added, too. From Randall Spangler: - Fix Glob() so an on-disk file or directory beginning with '#' doesn't throw an exception. RELEASE 1.1.0 - Thu, 09 Oct 2008 08:33:47 -0700 From Chris AtLee - Use the specified environment when checking for the GCC compiler version. From Ian P. Cardenas: - Fix Glob() polluting LIBPATH by returning copy of list From David Cournapeau: - Add CheckCC, CheckCXX, CheckSHCC and CheckSHCXX tests to configuration contexts. - Have the --profile= argument use the much faster cProfile module (if it's available in the running Python version). - Reorder MSVC compilation arguments so the /Fo is first. From Bill Deegan: - Add scanning Windows resource (.rc) files for implicit dependencies. From John Gozde: - When scanning for a #include file, don't use a directory that has the same name as the file. From Ralf W. Grosse-Kunstleve - Suppress error output when checking for the GCC compiler version. From Jared Grubb: - Fix VariantDir duplication of #included files in subdirectories. From Ludwig H�hne: - Reduce memory usage when a directory is used as a dependency of another Node (such as an Alias) by returning a concatenation of the children's signatures + names, not the children's contents, as the directory contents. - Raise AttributeError, not KeyError, when a Builder can't be found. - Invalidate cached Node information (such as the contenst returned by the get_contents() method) when calling actions with Execute(). - Avoid object reference cycles from frame objects. - Reduce memory usage from Null Executor objects. - Compute MD5 checksums of large files without reading the entire file contents into memory. Add a new --md5-chunksize option to control the size of each chunk read into memory. From Steven Knight: - Fix the ability of the add_src_builder() method to add a new source builder to any other builder. - Avoid an infinite loop on non-Windows systems trying to find the SCons library directory if the Python library directory does not begin with the string "python". - Search for the SCons library directory in "scons-local" (with no version number) after "scons-local-{VERSION}". From Rob Managan: - Fix the user's ability to interrupt the TeX build chain. - Fix the TeX builder's allowing the user to specify the target name, instead of always using its default output name based on the source. - Iterate building TeX output files until all warning are gone and the auxiliary files stop changing, or until we reach the (configurable) maximum number of retries. - Add TeX scanner support for: glossaries, nomenclatures, lists of figures, lists of tables, hyperref and beamer. - Use the $BIBINPUTS, $BSTINPUTS, $TEXINPUTS and $TEXPICTS construction variables as search paths for the relevant types of input file. - Fix building TeX with VariantDir(duplicate=0) in effect. - Fix the LaTeX scanner to search for graphics on the TEXINPUTS path. - Have the PDFLaTeX scanner search for .gif files as well. From Greg Noel: - Fix typos and format bugs in the man page. - Add a first draft of a wrapper module for Python's subprocess module. - Refactor use of the SCons.compat module so other modules don't have to import it individually. - Add .sx as a suffix for assembly language files that use the C preprocessor. From Gary Oberbrunner: - Make Glob() sort the returned list of Files or Nodes to prevent spurious rebuilds. - Add a delete_existing keyword argument to the AppendENVPath() and PrependENVPath() Environment methods. - Add ability to use "$SOURCE" when specifying a target to a builder From Damyan Pepper: - Add a test case to verify that SConsignFile() files can be created in previously non-existent subdirectories. From Jim Randall: - Make the subdirectory in which the SConsignFile() file will live, if the subdirectory doesn't already exist. From Ali Tofigh: - Add a test to verify duplication of files in VariantDir subdirectories. RELEASE 1.0.1 - Sat, 06 Sep 2008 07:29:34 -0700 From Greg Noel: - Add a FindFile() section to the User's Guide. - Fix the FindFile() documentation in the man page. - Fix formatting errors in the Package() description in the man page. - Escape parentheses that appear within variable names when spawning command lines using os.system(). RELEASE 1.0.0 - XXX From Jared Grubb: - Clear the Node state when turning a generic Entry into a Dir. From Ludwig H�hne: - Fix sporadic output-order failures in test/GetBuildFailures/parallel.py. - Document the ParseDepends() function in the User's Guide. From khomenko: - Create a separate description and long_description for RPM packages. From Steven Knight: - Document the GetLaunchDir() function in the User's Guide. - Have the env.Execute() method print an error message if the executed command fails. - Add a script for creating a standard SCons development system on Ubuntu Hardy. Rewrite subsidiary scripts for install Python and SCons versions in Python (from shell). From Greg Noel: - Handle yacc/bison on newer Mac OS X versions creating file.hpp, not file.cpp.h. - In RPCGEN tests, ignore stderr messages from older versions of rpcgen on some versions of Mac OS X. - Fix typos in man page descriptions of Tag() and Package(), and in the scons-time man page. - Fix documentation of SConf.CheckLibWithHeader and other SConf methods. - Update documentation of SConscript(variant_dir) usage. - Fix SWIG tests for (some versions of) Mac OS X. From Jonas Olsson: - Print the warning about -j on Windows being potentially unreliable if the pywin32 extensions are unavailable or lack file handle operations. From Jim Randall: - Fix the env.WhereIs() method to expand construction variables. From Rogier Schouten: - Enable building of shared libraries with the Bordand ilink32 linker. RELEASE 1.0.0 - Sat, 09 Aug 2008 12:19:44 -0700 From Luca Falavigna: - Fix SCons man page indentation under Debian's man page macros. From Steven Knight: - Clarify the man page description of the SConscript(src_dir) argument. - User's Guide updates: - Document the BUILD_TARGETS, COMMAND_LINE_TARGETS and DEFAULT_TARGETS variables. - Document the AddOption(), GetOption() and SetOption() functions. - Document the Requires() function; convert to the Variables object, its UnknownOptions() method, and its associated BoolVariable(), EnumVariable(), ListVariable(), PackageVariable() and PathVariable() functions. - Document the Progress() function. - Reorganize the chapter and sections describing the different types of environments and how they interact. Document the SetDefault() method. Document the PrependENVPath() and AppendENVPath() functions. - Reorganize the command-line arguments chapter. Document the ARGLIST variable. - Collect some miscellaneous sections into a chapter about configuring build output. - Man page updates: - Document suggested use of the Visual C/C++ /FC option to fix the ability to double-click on file names in compilation error messages. - Document the need to use Clean() for any SideEffect() files that must be explicitly removed when their targets are removed. - Explicitly document use of Node lists as input to Dependency(). From Greg Noel: - Document MergeFlags(), ParseConfig(), ParseFlags() and SideEffect() in the User's Guide. From Gary Oberbrunner: - Document use of the GetBuildFailures() function in the User's Guide. From Adam Simpkins: - Add man page text clarifying the behavior of AddPreAction() and AddPostAction() when called with multiple targets. From Alexey Zezukin: - Fix incorrectly swapped man page descriptions of the --warn= options for duplicate-environment and missing-sconscript. RELEASE 0.98.5 - Sat, 07 Jun 2008 08:20:35 -0700 From Benoit Belley: - Fix the Intel C++ compiler ABI specification for EMT64 processors. From David Cournapeau: - Issue a (suppressable) warning, not an error, when trying to link C++ and Fortran object files into the same executable. From Steven Knight: - Update the scons.bat file so that it returns the real exit status from SCons, even though it uses setlocal + endlocal. - Fix the --interactive post-build messages so it doesn't get stuck mistakenly reporting failures after any individual build fails. - Fix calling File() as a File object method in some circumstances. - Fix setup.py installation on Mac OS X so SCons gets installed under /usr/lcoal by default, not in the Mac OS X Python framework. RELEASE 0.98.4 - Sat, 17 May 2008 22:14:46 -0700 From Benoit Belley: - Fix calculation of signatures for Python function actions with closures in Python versions before 2.5. From David Cournapeau: - Fix the initialization of $SHF77FLAGS so it includes $F77FLAGS. From Jonas Olsson: - Fix a syntax error in the Intel C compiler support on Windows. From Steven Knight: - Change how we represent Python Value Nodes when printing and when stored in .sconsign files (to avoid blowing out memory by storing huge strings in .sconsign files after multiple runs using Configure contexts cause the Value strings to be re-escaped each time). - Fix a regression in not executing configuration checks after failure of any configuration check that used the same compiler or other tool. - Handle multiple destinations in Visual Studio 8 settings for the analogues to the INCLUDE, LIBRARY and PATH variables. From Greg Noel: - Update man page text for VariantDir(). RELEASE 0.98.3 - Tue, 29 Apr 2008 22:40:12 -0700 From Greg Noel: - Fix use of $CXXFLAGS when building C++ shared object files. From Steven Knight: - Fix a regression when a Builder's source_scanner doesn't select a more specific scanner for the suffix of a specified source file. - Fix the Options object backwards compatibility so people can still "import SCons.Options.{Bool,Enum,List,Package,Path}Option" submodules. - Fix searching for implicit dependencies when an Entry Node shows up in the search path list. From Stefano: - Fix expansion of $FORTRANMODDIR in the default Fortran command line(s) when it's set to something like ${TARGET.dir}. RELEASE 0.98.2 - Sun, 20 Apr 2008 23:38:56 -0700 From Steven Knight: - Fix a bug in Fortran suffix computation that would cause SCons to run out of memory on Windows systems. - Fix being able to specify --interactive mode command lines with \ (backslash) path name separators on Windows. From Gary Oberbrunner: - Document Glob() in the User's Guide. RELEASE 0.98.1 - Fri, 18 Apr 2008 19:11:58 -0700 From Benoit Belley: - Speed up the SCons.Util.to_string*() functions. - Optimize various Node intialization and calculations. - Optimize Executor scanning code. - Optimize Taskmaster execution, including dependency-cycle checking. - Fix the --debug=stree option so it prints its tree once, not twice. From Johan Boul�: - Fix the ability to use LoadableModule() under MinGW. From David Cournapeau: - Various missing Fortran-related construction variables have been added. - SCons now uses the program specified in the $FORTRAN construction variable to link Fortran object files. - Fortran compilers on Linux (Intel, g77 and gfortran) now add the -fPIC option by default when compilling shared objects. - New 'sunf77', 'sunf90' and 'sunf95' Tool modules have been added to support Sun Fortran compilers. On Solaris, the Sun Fortran compilers are used in preference to other compilers by default. - Fortran support now uses gfortran in preference to g77. - Fortran file suffixes are now configurable through the $F77FILESUFFIXES, $F90FILESUFFIXES, $F95FILESUFFIXES and $FORTRANFILESUFFIXES variables. From Steven Knight: - Make the -d, -e, -w and --no-print-directory options "Ignored for compatibility." (We're not going to implement them.) - Fix a serious inefficiency in how SCons checks for whether any source files are missing when a Builder call creates many targets from many input source files. - In Java projects, make the target .class files depend only on the specific source .java files where the individual classes are defined. - Don't store duplicate source file entries in the .sconsign file so we don't endlessly rebuild the target(s) for no reason. - Add a Variables object as the first step towards deprecating the Options object name. Similarly, add BoolVariable(), EnumVariable(), ListVariable(), PackageVariable() and PathVariable() functions as first steps towards replacing BoolOption(), EnumOption(), ListOption(), PackageOption() and PathOption(). - Change the options= keyword argument to the Environment() function to variables=, to avoid confusion with SCons command-line options. Continue supporting the options= keyword for backwards compatibility. - When $SWIGFLAGS contains the -python flag, expect the generated .py file to be in the same (sub)directory as the target. - When compiling C++ files, allow $CCFLAGS settings to show up on the command line even when $CXXFLAGS has been redefined. - Fix --interactive with -u/-U/-D when a VariantDir() is used. From Anatoly Techtonik: - Have the scons.bat file add the script execution directory to its local %PATH% on Windows, so the Python executable can be found. From Mike Wake: - Fix passing variable names as a list to the Return() function. From Matthew Wesley: - Add support for the GDC 'D' language compiler. RELEASE 0.98 - Sun, 30 Mar 2008 23:33:05 -0700 From Benoit Belley: - Fix the --keep-going flag so it builds all possible targets even when a later top-level target depends on a child that failed its build. - Fix being able to use $PDB and $WINDWOWS_INSERT_MANIFEST together. - Don't crash if un-installing the Intel C compiler leaves left-over, dangling entries in the Windows registry. - Improve support for non-standard library prefixes and suffixes by stripping all prefixes/suffixes from file name string as appropriate. - Reduce the default stack size for -j worker threads to 256 Kbytes. Provide user control over this value by adding --stack-size and --warn=stack-size options, and a SetOption('stack_size') function. - Fix a crash on Linux systems when trying to use the Intel C compiler and no /opt/intel_cc_* directories are found. - Improve using Python functions as actions by incorporating into a FunctionAction's signature: - literal values referenced by the byte code. - values of default arguments - code of nested functions - values of variables captured by closures - names of referenced global variables and functions - Fix the closing message when --clean and --keep-going are both used and no errors occur. - Add support for the Intel C compiler on Mac OS X. - Speed up reading SConscript files by about 20% (for some configurations) by: 1) optimizing the SCons.Util.is_*() and SCons.Util.flatten() functions; 2) avoiding unnecessary os.stat() calls by using a File's .suffix attribute directly instead of stringifying it. From Jérôme Berger: - Have the D language scanner search for .di files as well as .d files. - Add a find_include_names() method to the Scanner.Classic class to abstract out how included names can be generated by subclasses. - Allow the D language scanner to detect multiple modules imported by a single statement. From Konstantin Bozhikov: - Support expansion of construction variables that contain or refer to lists of other variables or Nodes within expansions like $CPPPATH. - Change variable substitution (the env.subst() method) so that an input sequence (list or tuple) is preserved as a list in the output. From David Cournapeau: - Add a CheckDeclaration() call to configure contexts. - Improve the CheckTypeSize() code. - Add a Define() call to configure contexts, to add arbitrary #define lines to a generated configure header file. - Add a "gfortran" Tool module for the GNU F95/F2003 compiler. - Avoid use of -rpath with the Mac OS X linker. - Add comment lines to the generated config.h file to describe what the various #define/#undef lines are doing. From Steven Knight: - Support the ability to subclass the new-style "str" class as input to Builders. - Improve the performance of our type-checking by using isinstance() with new-style classes. - Fix #include (and other $*PATH variables searches) of files with absolute path names. Don't die if they don't exist (due to being #ifdef'ed out or the like). - Fix --interactive mode when Default(None) is used. - Fix --debug=memoizer to work around a bug in base Python 2.2 metaclass initialization (by just not allowing Memoization in Python versions that have the bug). - Have the "scons-time time" subcommand handle empty log files, and log files that contain no results specified by the --which option. - Fix the max Y of vertical bars drawn by "scons-time --fmt=gnuplot". - On Mac OS X, account for the fact that the header file generated from a C++ file will be named (e.g.) file.cpp.h, not file.hpp. - Fix floating-point numbers confusing the Java parser about generated .class file names in some configurations. - Document (nearly) all the values you can now fetch with GetOption(). - Fix use of file names containing strings of multiple spaces when using ActionFactory instances like the Copy() or Move() function. - Fix a 0.97 regression when using a variable expansion (like $OBJSUFFIX) in a source file name to a builder with attached source builders that match suffix (like Program()+Object()). - Have the Java parser recognize generics (surrounded by angle brackets) so they don't interfere with identifying anonymous inner classes. - Avoid an infinite loop when trying to use saved copies of the env.Install() or env.InstallAs() after replacing the method attributes. - Improve the performance of setting construction variables. - When cloning a construction environment, avoid over-writing an attribute for an added method if the user explicitly replaced it. - Add a warning about deprecated support for Python 1.5, 2.0 and 2.1. - Fix being able to SetOption('warn', ...) in SConscript files. - Add a warning about env.Copy() being deprecated. - Add warnings about the --debug={dtree,stree,tree} options being deprecated. - Add VariantDir() as the first step towards deprecating BuildDir(). Add the keyword argument "variant_dir" as the replacement for "build_dir". - Add warnings about the {Target,Source}Signatures() methods and functions being deprecated. From Rob Managan: - Enhance TeX and LaTeX support to work with BuildDir(duplicate=0). - Re-run LaTeX when it issues a package warning that it must be re-run. From Leanid Nazdrynau: - Have the Copy() action factory preserve file modes and times when copying individual files. From Jan Nijtmans: - If $JARCHDIR isn't set explicitly, use the .java_classdir attribute that was set when the Java() Builder built the .class files. From Greg Noel: - Document the Dir(), File() and Entry() methods of Dir and File Nodes. - Add the parse_flags option when creating Environments From Gary Oberbrunner: - Make File(), Dir() and Entry() return a list of Nodes when passed a list of names, instead of trying to make a string from the name list and making a Node from that string. - Fix the ability to build an Alias in --interactive mode. - Fix the ability to hash the contents of actions for nested Python functions on Python versions where the inability to pickle them returns a TypeError (instead of the documented PicklingError). From Jonas Olsson: - Fix use of the Intel C compiler when the top compiler directory, but not the compiler version, is specified. - Handle Intel C compiler network license files (port@system). From Jim Randall: - Fix how Python Value Nodes are printed in --debug=explain output. From Adam Simpkins: - Add a --interactive option that starts a session for building (or cleaning) targets without re-reading the SConscript files every time. - Fix use of readline command-line editing in --interactive mode. - Have the --interactive mode "build" command with no arguments build the specified Default() targets. - Fix the Chmod(), Delete(), Mkdir() and Touch() Action factories to take a list (of Nodes or strings) as arguments. From Vaclav Smilauer: - Fix saving and restoring an Options value of 'all' on Python versions where all() is a builtin function. From Daniel Svensson: - Code correction in SCons.Util.is_List(). From Ben Webb: - Support the SWIG %module statement with following modifiers in parenthese (e.g., '%module(directors="1")'). RELEASE 0.97.0d20071212 - Wed, 12 Dec 2007 09:29:32 -0600 From Benoit Belley: - Fix occasional spurious rebuilds and inefficiency when using --implicit-cache and Builders that produce multiple targets. - Allow SCons to not have to know about the builders of generated files when BuildDir(duplicate=0) is used, potentially allowing some SConscript files to be ignored for smaller builds. From David Cournapeau: - Add a CheckTypeSize() call to configure contexts. From Ken Deeter: - Make the "contents" of Alias Nodes a concatenation of the children's content signatures (MD5 checksums), not a concatenation of the children's contents, to avoid using large amounts of memory during signature calculation. From Malte Helmert: - Fix a lot of typos in the man page and User's Guide. From Geoffrey Irving: - Speed up conversion of paths in .sconsign files to File or Dir Nodes. From Steven Knight: - Add an Options.UnknownOptions() method that returns any settings (from the command line, or whatever dictionary was passed in) that aren't known to the Options object. - Add a Glob() function. - When removing targets with the -c option, use the absolute path (to avoid problems interpreting BuildDir() when the top-level directory is the source directory). - Fix problems with Install() and InstallAs() when called through a clone (of a clone, ...) of a cloned construction environment. - When executing a file containing Options() settings, add the file's directory to sys.path (so modules can be imported from there) and explicity set __name__ to the name of the file so the statement's in the file can deduce the location if they need to. - Fix an O(n^2) performance problem when adding sources to a target through calls to a multi Builder (including Aliases). - Redefine the $WINDOWSPROGMANIFESTSUFFIX and $WINDOWSSHLIBMANIFESTSUFFIX variables so they pick up changes to the underlying $SHLIBSUFFIX and $PROGSUFFIX variables. - Add a GetBuildFailures() function that can be called from functions registered with the Python atexit module to print summary information about any failures encountered while building. - Return a NodeList object, not a Python list, when a single_source Builder like Object() is called with more than one file. - When searching for implicit dependency files in the directories in a $*PATH list, don't create Dir Nodes for directories that don't actually exist on-disk. - Add a Requires() function to allow the specification of order-only prerequisites, which will be updated before specified "downstream" targets but which don't actually cause the target to be rebuilt. - Restore the FS.{Dir,File,Entry}.rel_path() method. - Make the default behavior of {Source,Target}Signatures('timestamp') be equivalent to 'timestamp-match', not 'timestamp-newer'. - Fix use of CacheDir with Decider('timestamp-newer') by updating the modification time when copying files from the cache. - Fix random issues with parallel (-j) builds on Windows when Python holds open file handles (especially for SCons temporary files, or targets built by Python function actions) across process creation. From Maxim Kartashev: - Fix test scripts when run on Solaris. From Gary Oberbrunner: - Fix Glob() when a pattern is in an explicitly-named subdirectory. From Philipp Scholl: - Fix setting up targets if multiple Package builders are specified at once. RELEASE 0.97.0d20070918 - Tue, 18 Sep 2007 10:51:27 -0500 From Steven Knight: - Fix the wix Tool module to handle null entries in $PATH variables. - Move the documentation of Install() and InstallAs() from the list of functions to the list of Builders (now that they're implemented as such). - Allow env.CacheDir() to be set per construction environment. The global CacheDir() function now sets an overridable global default. - Add an env.Decider() method and a Node.Decider() method that allow flexible specification of an arbitrary function to decide if a given dependency has changed since the last time a target was built. - Don't execute Configure actions (while reading SConscript files) when cleaning (-c) or getting help (-h or -H). - Add to each target an implicit dependency on the external command(s) used to build the target, as found by searching env['ENV']['PATH'] for the first argument on each executed command line. - Add support for a $IMPLICIT_COMMAND_DEPENDENCIES construction variabe that can be used to disable the automatic implicit dependency on executed commands. - Add an "ensure_suffix" keyword to Builder() definitions that, when true, will add the configured suffix to the targets even if it looks like they already have a different suffix. - Add a Progress() function that allows for calling a function or string (or list of strings) to display progress while walking the DAG. - Allow ParseConfig(), MergeFlags() and ParseFlags() to handle output from a *config command with quoted path names that contain spaces. - Make the Return() function stop processing the SConscript file and return immediately. Add a "stop=" keyword argument that can be set to False to preserve the old behavior. - Fix use of exitstatfunc on an Action. - Introduce all man page function examples with "Example:" or "Examples:". - When a file gets added to a directory, make sure the directory gets re-scanned for the new implicit dependency. - Fix handling a file that's specified multiple times in a target list so that it doesn't cause dependent Nodes to "disappear" from the dependency graph walk. From Carsten Koch: - Avoid race conditions with same-named files and directory creation when pushing copies of files to CacheDir(). From Tzvetan Mikov: - Handle $ in Java class names. From Gary Oberbrunner: - Add support for the Intel C compiler on Windows64. - On SGI IRIX, have $SHCXX use $CXX by default (like other platforms). From Sohail Somani: - When Cloning a construction environment, set any variables before applying tools (so the tool module can access the configured settings) and re-set them after (so they end up matching what the user set). From Matthias Troffaes: - Make sure extra auxiliary files generated by some LaTeX packages and not ending in .aux also get deleted by scons -c. From Greg Ward: - Add a $JAVABOOTCLASSPATH variable for directories to be passed to the javac -bootclasspath option. From Christoph Wiedemann: - Add implicit dependencies on the commands used to build a target. RELEASE 0.97.0d20070809 - Fri, 10 Aug 2007 10:51:27 -0500 From Lars Albertsson: - Don't error if a #include line happens to match a directory somewhere on a path (like $CPPPATH, $FORTRANPATH, etc.). From Mark Bertoglio: - Fix listing multiple projects in Visual Studio 7.[01] solution files, including generating individual project GUIDs instead of re-using the solution GUID. From Jean Brouwers: - Add /opt/SUNWspro/bin to the default execution PATH on Solaris. From Allan Erskine: - Only expect the Microsoft IDL compiler to emit *_p.c and *_data.c files if the /proxy and /dlldata switches are used (respectively). From Steven Knight: - Have --debug=explain report if a target is being rebuilt because AlwaysBuild() is specified (instead of "unknown reasons"). - Support {Get,Set}Option('help') to make it easier for SConscript files to tell if a help option (-h, --help, etc.) has been specified. - Support {Get,Set}Option('random') so random-dependency interaction with CacheDir() is controllable from SConscript files. - Add a new AddOption() function to support user-defined command- line flags (like --prefix=, --force, etc.). - Replace modified Optik version with new optparse compatibility module for command line processing in Scripts/SConsOptions.py - Push and retrieve built symlinks to/from a CacheDir() as actual symlinks, not by copying the file contents. - Fix how the Action module handles stringifying the shared library generator in the Tool/mingw.py module. - When generating a config.h file, print "#define HAVE_{FEATURE} 1" instad of just "#define HAVE_{FEATURE}", for more compatibility with Autoconf-style projects. - Fix expansion of $TARGET, $TARGETS, $SOURCE and $SOURCES keywords in Visual C/C++ PDB file names. - Fix locating Visual C/C++ PDB files in build directories. - Support an env.AddMethod() method and an AddMethod() global function for adding a new method, respectively, to a construction environment or an arbitrary object (such as a class). - Fix the --debug=time option when the -j option is specified and all files are up to date. - Add a $SWIGOUTDIR variable to allow setting the swig -outdir option, and use it to identify files created by the swig -java option. - Add a $SWIGPATH variable that specifies the path to be searched for included SWIG files, Also add related $SWIGINCPREFIX and $SWIGINCSUFFIX variables that specify the prefix and suffix to be be added to each $SWIGPATH directory when expanded on the SWIG command line. - More efficient copying of construction environments (mostly borrowed from copy.deepcopy() in the standard Python library). - When printing --tree=prune output, don't print [brackets] around source files, only do so for built targets with children. - Fix interpretation of Builder source arguments when the Builder has a src_suffix *and* a source_builder and the argument has no suffix. - Fix use of expansions like ${TARGET.dir} or ${SOURCE.dir} in the following construction variables: $FORTRANMODDIR, $JARCHDIR, $JARFLAGS, $LEXFLAGS, $SWIGFLAGS, $SWIGOUTDIR and $YACCFLAGS. - Fix dependencies on Java files generated by SWIG so they can be detected and built in one pass. - Fix SWIG when used with a BuildDir(). From Leanid Nazdrynau: - When applying Tool modules after a construction environment has already been created, don't overwrite existing $CFILESUFFIX and $CXXFILESUFFIX value. - Support passing the Java() builder a list of explicit .java files (not only a list of directories to be scanned for .java files). - Support passing .java files to the Jar() and JavaH() builders, which then use the builder underlying the Java() builder to turn them into .class files. (That is, the Jar()-Java() chain of builders become multi-step, like the Program()-Object()-CFile() builders.) - Support passing SWIG .i files to the Java builders (Java(), Jar(), JavaH()), to cause intermediate .java files to be created automatically. - Add $JAVACLASSPATH and $JAVASOURCEPATH variables, that get added to the javac "-classpath" and "-sourcepath" options. (Note that SCons does *not* currently search these paths for implicit dependencies.) - Commonize initialization of Java-related builders. From Jan Nijtmans: - Find Java anonymous classes when the next token after the name is an open parenthesis. From Gary Oberbrunner: - Fix a code example in the man page. From Tilo Prutz: - Add support for the file names that Java 1.5 (and 1.6) generates for nested anonymous inner classes, which are different from Java 1.4. From Adam Simpkins: - Allow worker threads to terminate gracefully when all jobs are finished. From Sohail Somani: - Add LaTeX scanner support for finding dependencies specified with the \usepackage{} directive. RELEASE 0.97 - Thu, 17 May 2007 08:59:41 -0500 From Steven Knight: - Fix a bug that would make parallel builds stop in their tracks if Nodes that depended on lists that contained some Nodes built together caused the reference count to drop below 0 if the Nodes were visited and commands finished in the wrong order. - Make sure the DirEntryScanner doesn't choke if it's handed something that's not a directory (Node.FS.Dir) Node. RELEASE 0.96.96 - Thu, 12 Apr 2007 12:36:25 -0500 NOTE: This is (Yet) a(nother) pre-release of 0.97 for testing purposes. From Joe Bloggs: - Man page fix: remove cut-and-paste sentence in NoCache() description. From Dmitry Grigorenko and Gary Oberbrunner: - Use the Intel C++ compiler, not $CC, to link C++ source. From Helmut Grohne: - Fix the man page example of propagating a user's external environment. From Steven Knight: - Back out (most of) the Windows registry installer patch, which seems to not work on some versions of Windows. - Don't treat Java ".class" attributes as defining an inner class. - Fix detecting an erroneous Java anonymous class when the first non-skipped token after a "new" keyword is a closing brace. - Fix a regression when a CPPDEFINES list contains a tuple, the second item of which (the option value) is a construction variable expansion (e.g. $VALUE) and the value of the variable isn't a string. - Improve the error message if an IOError (like trying to read a directory as a file) occurs while deciding if a node is up-to-date. - Fix "maximum recursion" / "unhashable type" errors in $CPPPATH PathList expansion if a subsidiary expansion yields a stringable, non-Node object. - Generate API documentation from the docstrings (using epydoc). - Fix use of --debug=presub with Actions for out-of-the-box Builders. - Fix handling nested lists within $CPPPATH, $LIBPATH, etc. - Fix a "builders_used" AttributeError that real-world Qt initialization triggered in the refactored suffix handling for Builders. - Make the reported --debug=time timings meaningful when used with -j. Better documentation of what the times mean. - User Guide updates: --random, AlwaysBuild(), --tree=, --debug=findlibs, --debug=presub, --debug=stacktrace, --taskmastertrace. - Document (in both man page and User's Guide) that --implicit-cache ignores changes in $CPPPATH, $LIBPATH, etc. From Jean-Baptiste Lab: - Remove hard-coded dependency on Python 2.2 from Debian packaging files. From Jeff Mahovsky: - Handle spaces in the build target name in Visual Studio project files. From Rob Managan: - Re-run LaTeX after BibTeX has been re-run in response to a changed .bib file. From Joel B. Mohler: - Make additional TeX auxiliary files (.toc, .idx and .bbl files) Precious so their removal doesn't affect whether the necessary sections are included in output PDF or PostScript files. From Gary Oberbrunner: - Fix the ability to import modules in the site_scons directory from a subdirectory. From Adam Simpkins: - Make sure parallel (-j) builds all targets even if they show up multiple times in the child list (as a source and a dependency). From Matthias Troffaes: - Don't re-run TeX if the triggering strings (\makeindex, \bibliography \tableofcontents) are commented out. From Richard Viney: - Fix use of custom include and lib paths with Visual Studio 8. - Select the default .NET Framework SDK Dir based on the version of Visual Studio being used. RELEASE 0.96.95 - Mon, 12 Feb 2007 20:25:16 -0600 From Anatoly Techtonik: - Add the scons.org URL and a package description to the setup.py arguments. - Have the Windows installer add a registry entry for scons.bat in the "App Paths" key, so scons.bat can be executed without adding the directory to the %PATH%. (Python itself works this way.) From Anonymous: - Fix looking for default paths in Visual Studio 8.0 (and later). - Add -lm to the list of default D libraries for linking. From Matt Doar: - Provide a more complete write-your-own-Scanner example in the man page. From Ralf W. Grosse-Kunstleve: - Contributed upstream Python change to our copied subprocess.py module for more efficient standard input processing. From Steven Knight: - Fix the Node.FS.Base.rel_path() method when the two nodes are on different drive letters. (This caused an infinite loop when trying to write .sconsign files.) - Fully support Scanners that use a dictionary to map file suffixes to other scanners. - Support delayed evaluation of the $SPAWN variable to allow selection of a function via ${} string expansions. - Add --srcdir as a synonym for -Y/--repository. - Document limitations of #include "file.h" with Repository(). - Fix use of a toolpath under the source directory of a BuildDir(). - Fix env.Install() with a file name portion that begins with '#'. - Fix ParseConfig()'s handling of multiple options in a string that's replaced a *FLAGS construction variable. - Have the C++ tools initialize common C compilation variables ($CCFLAGS, $SHCCFLAGS and $_CCCOMCOM) even if the 'cc' Tool isn't loaded. From Leanid Nazdrynau: - Fix detection of Java anonymous classes if a newline precedes the opening brace. From Gary Oberbrunner: - Document use of ${} to execute arbitrary Python code. - Add support for: 1) automatically adding a site_scons subdirectory (in the top-level SConstruct directory) to sys.path (PYTHONPATH); 2) automatically importing site_scons/site_init.py; 3) automatically adding site_scons/site_tools to the toolpath. From John Pye: - Change ParseConfig() to preserve white space in arguments passed in as a list. From a smith: - Fix adding explicitly-named Java inner class files (and any other file names that may contain a '$') to Jar files. From David Vitek: - Add a NoCache() function to mark targets as unsuitable for propagating to (or retrieving from) a CacheDir(). From Ben Webb: - If the swig -noproxy option is used, it won't generate a .py file, so don't emit it as a target that we expect to be built. RELEASE 0.96.94 - Sun, 07 Jan 2007 18:36:20 -0600 NOTE: This is a pre-release of 0.97 for testing purposes. From Anonymous: - Allow arbitrary white space after a SWIG %module declaration. From Paul: - When compiling resources under MinGW, make sure there's a space between the --include-dir option and its argument. From Jay Kint: - Alleviate long command line issues on Windows by executing command lines directly via os.spawnv() if the command line doesn't need shell interpretation (has no pipes, redirection, etc.). From Walter Franzini: - Exclude additional Debian packaging files from the copyright check. From Fawad Halim: - Handle the conflict between the impending Python 2.6 'as' keyword and our Tool/as.py module name. From Steven Knight: - Speed up the Node.FS.Dir.rel_path() method used to generate path names that get put into the .sconsign* file(s). - Optimize Node.FS.Base.get_suffix() by computing the suffix once, up front, when we set the Node's name. (Duh...) - Reduce the Memoizer's responsibilities to simply counting hits and misses when the --debug=memoizer option is used, not to actually handling the key calculation and memoization itself. This speeds up some configurations significantly, and should cause no functional differences. - Add a new scons-time script with subcommands for generating consistent timing output from SCons configurations, extracting various information from those timings, and displaying them in different formats. - Reduce some unnecessary stat() calls from on-disk entry type checks. - Fix SideEffect() when used with -j, which was badly broken in 0.96.93. - Propagate TypeError exceptions when evaluating construction variable expansions up the stack, so users can see what's going on. - When disambiguating a Node.FS.Entry into a Dir or File, don't look in the on-disk source directory until we've confirmed there's no on-disk entry locally and there *is* one in the srcdir. This avoids creating a phantom Node that can interfere with dependencies on directory contents. - Add an AllowSubstExceptions() function that gives the SConscript files control over what exceptions cause a string to expand to '' vs. terminating processing with an error. - Allow the f90.py and f95.py Tool modules to compile earlier source source files of earlier Fortran version. - Fix storing signatures of files retrieved from CacheDir() so they're correctly identified as up-to-date next invocation. - Make sure lists of computed source suffixes cached by Builder objects don't persist across changes to the list of source Builders (so the addition of suffixes like .ui by the qt.py Tool module take effect). - Enhance the bootstrap.py script to allow it to be used to execute SCons more easily from a checked-out source tree. From Ben Leslie: - Fix post-Memoizer value caching misspellings in Node.FS._doLookup(). From Rob Managan, Dmitry Mikhin and Joel B. Mohler: - Handle TeX/LaTeX files in subdirectories by changing directory before invoking TeX/LaTeX. - Scan LaTeX files for \bibliography lines. - Support multiple file names in a "\bibliography{file1,file2}" string. - Handle TeX warnings about undefined citations. - Support re-running LaTeX if necessary due to a Table of Contents. From Dmitry Mikhin: - Return LaTeX if "Rerun to get citations correct" shows up on the next line after the "Warning:" string. From Gary Oberbrunner: - Add #include lines to fix portability issues in two tests. - Eliminate some unnecessary os.path.normpath() calls. - Add a $CFLAGS variable for C-specific options, leaving $CCFLAGS for options common to C and C++. From Tom Parker: - Have the error message print the missing file that Qt can't find. From John Pye: - Fix env.MergeFlags() appending to construction variable value of None. From Steve Robbins: - Fix the "sconsign" script when the .sconsign.dblite file is explicitly specified on the command line (and not intuited from the old way of calling it with just ".sconsign"). From Jose Pablo Ezequiel "Pupeno" Fernandez Silva: - Give the 'lex' tool knowledge of the additional target files produced by the flex "--header-file=" and "--tables-file=" options. - Give the 'yacc' tool knowledge of the additional target files produced by the bison "-g", "--defines=" and "--graph=" options. - Generate intermediate files with Objective C file suffixes (.m) when the lex and yacc source files have appropriate suffixes (.lm and .ym). From Sohail Somain: - Have the mslink.py Tool only look for a 'link' executable on Windows systems. From Vaclav Smilauer: - Add support for a "srcdir" keyword argument when calling a Builder, which will add a srcdir prefix to all non-relative string sources. From Jonathan Ultis: - Allow Options converters to take the construction environment as an optional argument. RELEASE 0.96.93 - Mon, 06 Nov 2006 00:44:11 -0600 NOTE: This is a pre-release of 0.97 for testing purposes. From Anonymous: - Allow Python Value Nodes to be Builder targets. From Matthias: - Only filter Visual Studio common filename prefixes on complete directory names. From Chad Austin: - Fix the build of the SCons documentation on systems that don't have "python" in the $PATH. From Ken Boortz: - Enhance ParseConfig() to recognize options that begin with '+'. From John Calcote, Elliot Murphy: - Document ways to override the CCPDBFLAGS variable to use the Microsoft linker's /Zi option instead of the default /Z7. From Christopher Drexler: - Make SCons aware bibtex must be called if any \include files cause creation of a bibliography. - Make SCons aware that "\bilbiography" in TeX source files means that related .bbl and .blg bibliography files will be created. (NOTE: This still needs to search for the string in \include files.) From David Gruener: - Fix inconsistent handling of Action strfunction arguments. - Preserve white space in display Action strfunction strings. From James Y. Knight and Gerard Patel: - Support creation of shared object files from assembly language. From Steven Knight: - Speed up the Taskmaster significantly by avoiding unnecessary re-scans of Nodes to find out if there's work to be done, having it track the currently-executed top-level target directly and not through its presence on the target list, and eliminating some other minor list(s), method(s) and manipulation. - Fix the expansion of $TARGET and $SOURCE in the expansion of $INSTALLSTR displayed for non-environment calls to InstallAs(). - Fix the ability to have an Alias() call refer to a directory name that's not identified as a directory until later. - Enhance runtest.py with an option to use QMTest as the harness. This will become the default behavior as we add more functionality to the QMTest side. - Let linking on mingw use the default function that chooses $CC (gcc) or $CXX (g++) depending on whether there are any C++ source files. - Work around a bug in early versions of the Python 2.4 profile module that caused the --profile= option to fail. - Only call Options validators and converters once when initializing a construction environment. - Fix the ability of env.Append() and env.Prepend(), in all known Python versions, to handle different input value types when the construction variable being updated is a dictionary. - Add a --cache-debug option for information about what files it's looking for in a CacheDir(). - Document the difference in construction variable expansion between {Action,Builder}() and env.{Action,Builder}(). - Change the name of env.Copy() to env.Clone(), keeping the old name around for backwards compatibility (with the intention of eventually phasing it out to avoid confusion with the Copy() Action factory). From Arve Knudsen: - Support cleaning and scanning SWIG-generated files. From Carsten Koch: - Allow selection of Visual Studio version by setting $MSVS_VERSION after construction environment initialization. From Jean-Baptiste Lab: - Try using zipimport if we can't import Tool or Platform modules using the normal "imp" module. This allows SCons to be packaged using py2exe's all-in-one-zip-file approach. From Ben Liblit: - Do not re-scan files if the scanner returns no implicit dependencies. From Sanjoy Mahajan: - Change use of $SOURCES to $SOURCE in all TeX-related Tool modules. From Joel B. Mohler: - Make SCons aware that "\makeindex" in TeX source files means that related .ilg, .ind and .idx index files will be created. (NOTE: This still needs to search for the string in \include files.) - Prevent scanning the TeX .aux file for additional files from trying to remove it twice when the -c option is used. From Leanid Nazdrynau: - Give the MSVC RES (resource) Builder a src_builder list and a .rc src_suffix so other builders can generate .rc files. From Matthew A. Nicholson: - Enhance Install() and InstallAs() to handle directory trees as sources. From Jan Nijtmans: - Don't use the -fPIC flag when using gcc on Windows (e.g. MinGW). From Greg Noel: - Add an env.ParseFlags() method that provides separate logic for parsing GNU tool chain flags into a dictionary. - Add an env.MergeFlags() method to apply an arbitrary dictionary of flags to a construction environment's variables. From Gary Oberbrunner: - Fix parsing tripartite Intel C compiler version numbers on Linux. - Extend the ParseConfig() function to recognize -arch and -isysroot options. - Have the error message list the known suffixes when a Builder call can't build a source file with an unknown suffix. From Karol Pietrzak: - Avoid recursive calls to main() in the program snippet used by the SConf subsystem to test linking against libraries. This changes the default behavior of CheckLib() and CheckLibWithHeader() to print "Checking for C library foo..." instead of "Checking for main() in C library foo...". From John Pye: - Throw an exception if a command called by ParseConfig() or ParseFlags() returns an error. From Stefan Seefeld: - Initial infrastructure for running SCons tests under QMTest. From Sohail Somani: - Fix tests that fail due to gcc warnings. From Dobes Vandermeer: - In stack traces, print the full paths of SConscript files. From Atul Varma: - Fix detection of Visual C++ Express Edition. From Dobes Vandermeer: - Let the src_dir option to the SConscript() function affect all the the source file paths, instead of treating all source files paths as relative to the SConscript directory itself. From Nicolas Vigier: - Fix finding Fortran modules in build directories. - Fix use of BuildDir() when the source file in the source directory is a symlink with a relative path. From Edward Wang: - Fix the Memoizer when the SCons Python modules are executed from .pyo files at different locations from where they were compiled. From Johan Zander: - Fix missing os.path.join() when constructing the $FRAMEWORKSDKDIR/bin. RELEASE 0.96.92 - Mon, 10 Apr 2006 21:08:22 -0400 NOTE: This was a pre-release of 0.97 for testing purposes. From Anonymous: - Fix the intelc.py Tool module to not throw an exception if the only installed version is something other than ia32. - Set $CCVERSION when using gcc. From Matthias: - Support generating project and solution files for Microsoft Visual Studio version 8. - Support generating more than one project file for a Microsoft Visual Studio solution file. - Add support for a support "runfile" parameter to Microsoft Visual Studio project file creation. - Put the project GUID, not the solution GUID, in the right spot in the solution file. From Erling Andersen: - Fix interpretation of Node.FS objects wrapped in Proxy instances, allowing expansion of things like ${File(TARGET)} in command lines. From Stanislav Baranov: - Add a separate MSVSSolution() Builder, with support for the following new construction variables: $MSVSBUILDCOM, $MSVSCLEANCOM, $MSVSENCODING, $MSVSREBUILDCOM, $MSVSSCONS, $MSVSSCONSCOM, $MSVSSCONSFLAGS, $MSVSSCONSCRIPT and $MSVSSOLUTIONCOM. From Ralph W. Grosse-Kunstleve and Patrick Mezard: - Remove unneceesary (and incorrect) SCons.Util strings on some function calls in SCons.Util. From Bob Halley: - Fix C/C++ compiler selection on AIX to not always use the external $CC environment variable. From August Hörandl: - Add a scanner for \include and \import files, with support for searching a directory list in $TEXINPUTS (imported from the external environment). - Support $MAKEINDEX, $MAKEINDEXCOM, $MAKEINDEXCOMSTR and $MAKEINDEXFLAGS for generating indices from .idx files. From Steven Johnson: - Add a NoClean() Environment method and function to override removal of targets during a -c clean, including documentation and tests. From Steven Knight: - Check for whether files exist on disk by listing the directory contents, not calling os.path.exists() file by file. This is somewhat more efficient in general, and may be significantly more efficient on Windows. - Minor speedups in the internal is_Dict(), is_List() and is_String() functions. - Fix a signature refactoring bug that caused Qt header files to get re-generated every time. - Don't fail when writing signatures if the .sconsign.dblite file is owned by a different user (e.g. root) from a previous run. - When deleting variables from stacked OverrideEnvironments, don't throw a KeyError if we were able to delte the variable from any Environment in the stack. - Get rid of the last indentation tabs in the SCons source files and add -tt to the Python invocations in the packaging build and the tests so they don't creep back in. - In Visual Studio project files, put quotes around the -C directory so everything works even if the path has spaces in it. - The Intel Fortran compiler uses -object:$TARGET, not "-o $TARGET", when building object files on Windows. Have the the ifort Tool modify the default command lines appropriately. - Document the --debug=explain option in the man page. (How did we miss this?) - Add a $LATEXRETRIES variable to allow configuration of the number of times LaTex can be re-called to try to resolve undefined references. - Change the order of the arguments to Configure.Checklib() to match the documentation. - Handle signature calculation properly when the Python function used for a FunctionAction is an object method. - On Windows, assume that absolute path names without a drive letter refer to the drive on which the SConstruct file lives. - Add /usr/ccs/bin to the end of the the default external execution PATH on Solaris. - Add $PKGCHK and $PKGINFO variables for use on Solaris when searching for the SunPRO C++ compiler. Make the default value for $PKGCHK be /usr/sbin/pgkchk (since /usr/sbin isn't usually on the external execution $PATH). - Fix a man page example of overriding variables when calling SharedLibrary() to also set the $LIBSUFFIXES variable. - Add a --taskmastertrace=FILE option to give some insight on how the taskmaster decides what Node to build next. - Changed the names of the old $WIN32DEFPREFIX, $WIN32DEFSUFFIX, $WIN32DLLPREFIX and $WIN32IMPLIBPREFIX construction variables to new $WINDOWSDEFPREFIX, $WINDOWSDEFSUFFIX, $WINDOWSDLLPREFIX and $WINDOWSIMPLIBPREFIX construction variables. The old names are now deprecated, but preserved for backwards compatibility. - Fix (?) a runtest.py hang on Windows when the --xml option is used. - Change the message when an error occurs trying to interact with the file system to report the target(s) in square brackets (as before) and the actual file or directory that encountered the error afterwards. From Chen Lee: - Add x64 support for Microsoft Visual Studio 8. From Baptiste Lepilleur: - Support the --debug=memory option on Windows when the Python version has the win32process and win32api modules. - Add support for Visual Studio 2005 Pro. - Fix portability issues in various tests: test/Case.py, Test/Java/{JAR,JARCHDIR,JARFLAGS,JAVAC,JAVACFLAGS,JAVAH,RMIC}.py, test/MSVS/vs-{6.0,7.0,7.1,8.0}-exec.py, test/Repository/{Java,JavaH,RMIC}.py, test/QT/{generated-ui,installed,up-to-date,warnings}.py, test/ZIP/ZIP.py. - Ignore pkgchk errors on Solaris when searching for the C++ compiler. - Speed up the SCons/EnvironmentTests.py unit tests. - Add a --verbose= option to runtest.py to print executed commands and their output at various levels. From Christian Maaser: - Add support for Visual Studio Express Editions. - Add support for Visual Studio 8 *.manifest files, includng new $WINDOWS_INSERT_MANIFEST, $WINDOWSPROGMANIFESTSUFFIX, $WINDOWSPROGMANIFESTPREFIX, $WINDOWSPROGMANIFESTSUFFIX, $WINDOWSSHLIBMANIFESTPREFIX and $WINDOWSSHLIBMANIFESTSUFFIX construction variables. From Adam MacBeth: - Fix detection of additional Java inner classes following use of a "new" keyword inside an inner class. From Sanjoy Mahajan: - Correct TeX-related command lines to just $SOURCE, not $SOURCES From Patrick Mezard: - Execute build commands for a command-line target if any of the files built along with the target is out of date or non-existent, not just if the command-line target itself is out of date. - Fix the -n option when used with -c to print all of the targets that will be removed for a multi-target Builder call. - If there's no file in the source directory, make sure there isn't one in the build directory, too, to avoid dangling files left over from previous runs when a source file is removed. - Allow AppendUnique() and PrependUnique() to append strings (and other atomic objects) to lists. From Joel B. Mohler: - Extend latex.py, pdflatex.py, pdftex.py and tex.py so that building from both TeX and LaTeX files uses the same logic to call $BIBTEX when it's necessary, to call $MAKEINDEX when it's necessary, and to call $TEX or $LATEX multiple times to handle undefined references. - Add an emitter to the various TeX builders so that the generated .aux and .log files also get deleted by the -c option. From Leanid Nazdrynau: - Fix the Qt UIC scanner to work with generated .ui files (by using the FindFile() function instead of checking by-hand for the file). From Jan Nieuwenhuizen: - Fix a problem with interpreting quoted argument lists on command lines. From Greg Noel: - Add /sw/bin to the default execution PATH on Mac OS X. From Kian Win Ong: - When building a .jar file and there is a $JARCHDIR, put the -C in front of each .class file on the command line. - Recognize the Java 1.5 enum keyword. From Asfand Yar Qazi: - Add /opt/bin to the default execution PATH on all POSIX platforms (between /usr/local/bin and /bin). From Jon Rafkind: - Fix the use of Configure() contexts from nested subsidiary SConscript files. From Christoph Schulz: - Add support for $CONFIGUREDIR and $CONFIGURELOG variables to control the directory and logs for configuration tests. - Add support for a $INSTALLSTR variable. - Add support for $RANLIBCOM and $RANLIBCOMSTR variables (which fixes a bug when setting $ARCOMSTR). From Amir Szekely: - Add use of $CPPDEFINES to $RCCOM (resource file compilation) on MinGW. From Erick Tryzelaar: - Fix the error message when trying to report that a given option is not gettable/settable from an SConscript file. From Dobes Vandermeer: - Add support for SCC and other settings in Microsoft Visual Studio project and solution files: $MSVS_PROJECT_BASE_PATH, $MSVS_PROJECT_GUID, $MSVS_SCC_AUX_PATH, $MSVS_SCC_LOCAL_PATH, $MSVS_SCC_PROJECT_NAME, $MSVS_SCC_PROVIDER, - Add support for using a $SCONS_HOME variable (imported from the external environment, or settable internally) to put a shortened SCons execution line in the Visual Studio project file. From David J. Van Maren: - Only filter common prefixes from source files names in Visual Studio project files if the prefix is a complete (sub)directory name. From Thad Ward: - If $MSVSVERSIONS is already set, don't overwrite it with information from the registry. RELEASE 0.96.91 - Thu, 08 Sep 2005 07:18:23 -0400 NOTE: This was a pre-release of 0.97 for testing purposes. From Chad Austin: - Have the environment store the toolpath and re-use it to find Tools modules during later Copy() or Tool() calls (unless overridden). - Normalize the directory path names in SConsignFile() database files so the same signature file can interoperate on Windows and non-Windows systems. - Make --debug=stacktrace print a stacktrace when a UserError is thrown. - Remove an old, erroneous cut-and-paste comment in Scanner/Dir.py. From Stanislav Baranov: - Make it possible to support with custom Alias (sub-)classes. - Allow Builders to take empty source lists when called. - Allow access to both TARGET and SOURCE in $*PATH expansions. - Allow SConscript files to modify BUILD_TARGETS. From Timothee Besset: - Add support for Objective C/C++ .m and .mm file suffixes (for Mac OS X). From Charles Crain - Fix the PharLap linkloc.py module to use target+source arguments when calling env.subst(). From Bjorn Eriksson: - Fix an incorrect Command() keyword argument in the man page. - Add a $TEMPFILEPREFIX variable to control the prefix or flag used to pass a long-command-line-execution tempfile to a command. From Steven Knight: - Enhanced the SCons setup.py script to install man pages on UNIX/Linux systems. - Add support for an Options.FormatOptionHelpText() method that can be overridden to customize the format of Options help text. - Add a global name for the Entry class (which had already been documented). - Fix re-scanning of generated source files for implicit dependencies when the -j option is used. - Fix a dependency problem that caused $LIBS scans to not be added to all of the targets in a multiple-target builder call, which could cause out-of-order builds when the -j option is used. - Store the paths of source files and dependencies in the .sconsign* file(s) relative to the target's directory, not relative to the top-level SConstruct directory. This starts to make it possible to subdivide the dependency tree arbitrarily by putting an SConstruct file in every directory and using content signatures. - Add support for $YACCHFILESUFFIX and $YACCHXXFILESUFFIX variables that accomodate parser generators that write header files to a different suffix than the hard-coded .hpp when the -d option is used. - The default behavior is now to store signature information in a single .sconsign.dblite file in the top-level SConstruct directory. The old behavior of a separate .sconsign file in each directory can be specified by calling SConsignFile(None). - Remove line number byte codes within the signature calculation of Python function actions, so that changing the location of an otherwise unmodified Python function doesn't cause rebuilds. - Fix AddPreAction() and AddPostAction() when an action has more than one target file: attach the actions to the Executor, not the Node. - Allow the source directory of a BuildDir / build_dir to be outside of the top-level SConstruct directory tree. - Add a --debug=nomemoizer option that disables the Memoizer for clearer looks at the counts and profiles of the underlying function calls, not the Memoizer wrappers. - Print various --debug= stats even if we exit early (e.g. using -h). - Really only use the cached content signature value if the file is older than --max-drift, not just if --max-drift is set. - Remove support for conversion from old (pre 0.96) .sconsign formats. - Add support for a --diskcheck option to enable or disable various on-disk checks: that File and Dir nodes match on-disk entries; whether an RCS file exists for a missing source file; whether an SCCS file exists for a missing source file. - Add a --raw argument to the sconsign script, so it can print a raw representation of each entry's NodeInfo dictionary. - Add the 'f90' and 'f95' tools to the list of Fortran compilers searched for by default. - Add the +Z option by default when compiling shared objects on HP-UX. From Chen Lee: - Handle Visual Studio project and solution files in Unicode. From Sanjoy Mahajan: - Fix a bad use of Copy() in an example in the man page, and a bad regular expression example in the man page and User's Guide. From Shannon Mann: - Have the Visual Studio project file(s) echo "Starting SCons" before executing SCons, mainly to work around a quote-stripping bug in (some versions of?) the Windows cmd command executor. From Georg Mischler: - Remove the space after the -o option when invoking the Borland BCC compiler; some versions apparently require that the file name argument be concatenated with the option. From Leanid Nazdrynau: - Fix the Java parser's handling of backslashes in strings. From Greg Noel: - Add construction variables to support frameworks on Mac OS X: $FRAMEWORKS, $FRAMEWORKPREFIX, $FRAMEWORKPATH, $FRAMEWORKPATHPREFIX. - Re-order link lines so the -o option always comes right after the command name. From Gary Oberbrunner: - Add support for Intel C++ beta 9.0 (both 32 and 64 bit versions). - Document the new $FRAMEWORK* variables for Mac OS X. From Karol Pietrzak: - Add $RPATH (-R) support to the Sun linker Tool (sunlink). - Add a description of env.subst() to the man page. From Chris Prince: - Look in the right directory, not always the local directory, for a same-named file or directory conflict on disk. - On Windows, preserve the external environment's %SYSTEMDRIVE% variable, too. From Craig Scott: - Have the Fortran module emitter look for Fortan modules to be created relative to $FORTRANMODDIR, not the top-level directory. - When saving Options to a file, run default values through the converter before comparing them with the set values. This correctly suppresses Boolean Option values from getting written to the saved file when they're one of the many synonyms for a default True or False value. - Fix the Fortran Scanner's ability to handle a module being used in the same file in which it is defined. From Steve-o: - Add the -KPIC option by default when compiling shared objects on Solaris. - Change the default suffix for Solaris objects to .o, to conform to Sun WorkShop's expectations. Change the profix to so_ so they can still be differentiated from static objects in the same directory. From Amir Szekely: - When calling the resource compiler on MinGW, add --include-dir and the source directory so it finds the source file. - Update EnsureSConsVersion() to support revision numbers. From Greg Ward: - Fix a misplaced line in the man page. RELEASE 0.96.90 - Tue, 15 Feb 2005 21:21:12 +0000 NOTE: This was a pre-release of 0.97 for testing purposes. From Anonymous: - Fix Java parsing to avoid erroneously identifying a new array of class instances as an anonymous inner class. - Fix a typo in the man page description of PathIsDirCreate. From Chad Austin: - Allow Help() to be called multiple times, appending to the help text each call. - Allow Tools found on a toolpath to import Python modules from their local directory. From Steve Christensen: - Handle exceptions from Python functions as build actions. - Add a set of canned PathOption validators: PathExists (the default), PathIsFile, PathIsDir and PathIsDirCreate. From Matthew Doar: - Add support for .lex and .yacc file suffixes for Lex and Yacc files. From Eric Frias: - Huge performance improvement: wrap the tuples representing an include path in an object, so that the time it takes to hash the path doesn't grow porportionally to the length of the path. From Gottfried Ganssauge: - Fix SCons on SuSE/AMD-64 Linux by having the wrapper script also check for the build engine in the parent directory of the Python library directory (/usr/lib64 instead of /usr/lib). From Stephen Kennedy: - Speed up writing the .sconsign file at the end of a run by only calling sync() once at the end, not after every entry. From Steven Knight: - When compiling with Microsoft Visual Studio, don't include the ATL and MFC directories in the default INCLUDE and LIB environment variables. - Remove the following deprecated features: the ParseConfig() global function (deprecated in 0.93); the misspelled "validater" keyword to the Options.Add() method (deprecated in 0.91); the SetBuildSignatureType(), SetContentSignatureType(), SetJobs() and GetJobs() global functions (deprecated in 0.14). - Fix problems with corrupting the .sconsign.dblite file when interrupting builds by writing to a temporary file and renaming, not writing the file directly. - Fix a 0.96 regression where when running with -k, targets built from walking dependencies later on the command line would not realize that a dependency had failed an earlier build attempt, and would try to rebuild the dependent targets. - Change the final messages when using -k and errors occur from "{building,cleaning} terminated because of errors" to "done {building,cleaning} targets (errors occurred during {build,clean})." - Allow Configure.CheckFunc() to take an optional header argument (already supported by Conftest.py) to specify text at the top of the compiled test file. - Fix the --debug=explain output when a Python function action changed so it prints a meaningful string, not the binary representation of the function contents. - Allow a ListOption's default value(s) to be a Python list of specified values, not just a string containing a comma-separated list of names. - Add a ParseDepends() function that will parse up a list of explicit dependencies from a "make depend" style file. - Support the ability to change directory when executing an Action through "chdir" keyword arguments to Action and Builder creation and calls. - Fix handling of Action ojects (and other callables that don't match our calling arguments) in construction variable expansions. - On Win32, install scons.bat in the Python directory when installing from setup.py. (The bdist_wininst installer was already doing this.) - Fix env.SConscript() when called with a list of SConscipt files. (The SConscript() global function already worked properly.) - Add a missing newline to the end of the --debug=explain "unknown reasons" message. - Enhance ParseConfig() to work properly for spaces in between the -I, -L and -l options and their arguments. - Packaging build fix: Rebuild the files that are use to report the --version of SCons whenever the development version number changes. - Fix the ability to specify a target_factory of Dir() to a Builder, which the default create-a-directory Builder was interfering with. - Mark a directory as built if it's created as part of the preparation for another target, to avoid trying to build it again when it comes up in the target list. - Allow a function with the right calling signature to be put directly in an Environment's BUILDERS dictionary, making for easier creation and use of wrappers (pseudo-Builders) that call other Builders. - On Python 2.x, wrap lists of Nodes returned by Builders in a UserList object that adds a method that makes str() object return a string with all of the Nodes expanded to their path names. (Builders under Python 1.5.2 still return lists to avoid TypeErrors when trying to extend() list, so Python 1.5.2 doesn't get pretty-printing of Node lists, but everything should still function.) - Allow Aliases to have actions that will be executed whenever any of the expanded Alias targets are out of date. - Fix expansion of env.Command() overrides within target and source file names. - Support easier customization of what's displayed by various default actions by adding lots of new construction variables: $ARCOMSTR, $ASCOMSTR, $ASPPCOMSTR, $BIBTEXCOMSTR, $BITKEEPERCOMSTR, $CCCOMSTR, $CVSCOMSTR, $CXXCOMSTR, $DCOMSTR, $DVIPDFCOMSTR, $F77COMSTR, $F90COMSTR, $F95COMSTR, $FORTRANCOMSTR, $GSCOMSTR, $JARCOMSTR, $JAVACCOMSTR, $JAVAHCOMSTR, $LATEXCOMSTR, $LEXCOMSTR, $LINKCOMSTR, $M4COMSTR, $MIDLCOMSTR, $P4COMSTR, $PCHCOMSTR, $PDFLATEXCOMSTR, $PDFTEXCOMSTR, $PSCOMSTR, $QT_MOCFROMCXXCOMSTR, $QT_MOCFROMHCOMSTR, $QT_UICCOMSTR, $RCCOMSTR, $REGSVRCOMSTR, $RCS_COCOMSTR, $RMICCOMSTR, $SCCSCOMSTR, $SHCCCOMSTR, $SHCXXCOMSTR, $SHF77COMSTR, $SHF90COMSTR, $SHF95COMSTR, $SHFORTRANCOMSTR, $SHLINKCOMSTR, $SWIGCOMSTR, $TARCOMSTR, $TEXCOMSTR, $YACCCOMSTR and $ZIPCOMSTR. - Add an optional "map" keyword argument to ListOption() that takes a dictionary to map user-specified values to legal values from the list (like EnumOption() already doee). - Add specific exceptions to try:-except: blocks without any listed, so that they won't catch and mask keyboard interrupts. - Make --debug={tree,dtree,stree} print something even when there's a build failure. - Fix how Scanners sort the found dependencies so that it doesn't matter whether the dependency file is in a Repository or not. This may cause recompilations upon upgrade to this version. - Make AlwaysBuild() work with Alias and Python value Nodes (making it much simpler to support aliases like "clean" that just invoke an arbitrary action). - Have env.ParseConfig() use AppendUnique() by default to suppress duplicate entries from multiple calls. Add a "unique" keyword argument to allow the old behavior to be specified. - Allow the library modules imported by an SConscript file to get at all of the normally-available global functions and variables by saying "from SCons.Script import *". - Add a --debug=memoizer option to print Memoizer hit/mass statistics. - Allow more than one --debug= option to be set at a time. - Change --debug=count to report object counts before and after reading SConscript files and before and after building targets. - Change --debug=memory output to line up the numbers and to better match (more or less) the headers on the --debug=count columns. - Speed things up when there are lists of targets and/or sources by getting rid of some N^2 walks of the lists involved. - Cache evaluation of LazyActions so we don't create a new object for each invocation. - When scanning, don't create Nodes for include files that don't actually exist on disk. - Make supported global variables CScanner, DScanner, ProgramScanner and SourceFileScanner. Make SourceFileScanner.add_scanner() a supported part of the public interface. Keep the old SCons.Defaults.*Scan names around for a while longer since some people were already using them. - By default, don't scan directories for on-disk files. Add a DirScanner global scanner that can be used in Builders or Command() calls that want source directory trees scanned for on-disk changes. Have the Tar() and Zip() Builders use the new DirScanner to preserve the behavior of rebuilding a .tar or .zip file if any file or directory under a source tree changes. Add Command() support for a source_scanner keyword argument to Command() that can be set to DirScanner to get this behavior. - Documentation changes: Explain that $CXXFLAGS contains $CCFLAGS by default. Fix a bad target_factory example in the man page. Add appendices to the User's Guide to cover the available Tools, Builders and construction variables. Comment out the build of the old Python 10 paper, which doesn't build on all systems and is old enough at this point that it probably isn't worth the effort to make it do so. From Wayne Lee: - Avoid "maximum recursion limit" errors when removing $(-$) pairs from long command lines. From Clive Levinson: - Make ParseConfig() recognize and add -mno-cygwin to $LINKFLAGS and $CCFLAGS, and -mwindows to $LINKFLAGS. From Michael McCracken: - Add a new "applelink" tool to handle the things like Frameworks and bundles that Apple has added to gcc for linking. - Use more appropriate default search lists of linkers, compilers and and other tools for the 'darwin' platform. - Add a LoadableModule Builder that builds a bundle on Mac OS X (Darwin) and a shared library on other systems. - Improve SWIG tests for use on Mac OS X (Darwin). From Elliot Murphy: - Enhance the tests to guarantee persistence of ListOption values in saved options files. - Supply the help text when -h is used with the -u, -U or -D options. From Christian Neeb: - Fix the Java parser's handling of string definitions to avoid ignoring subsequent code. From Han-Wen Nienhuys: - Optimize variable expansion by: using the re.sub() method (when possible); not using "eval" for variables for which we can fetch the value directory; avoiding slowing substitution logic when there's no '$' in the string. From Gary Oberbrunner: - Add an Environment.Dump() method to print the contents of a construction environment. - Allow $LIBS (and similar variables) to contain explicit File Nodes. - Change ParseConfig to add the found library names directly to the $LIBS variable, instead of returning them. - Add ParseConfig() support for the -framework GNU linker option. - Add a PRINT_CMD_LINE_FUNC construction variable to allow people to filter (or log) command-line output. - Print an internal Python stack trace in response to an otherwise unexplained error when --debug=stacktrace is specified. - Add a --debug=findlibs option to print what's happening when the scanner is searching for libraries. - Allow Tool specifications to be passed a dictionary of keyword arguments. - Support an Options default value of None, in which case the variable will not be added to the construction environment unless it's set explicitly by the user or from an Options file. - Avoid copying __builtin__ values into a construction environment's dictionary when evaluating construction variables. - Add a new cross-platform intelc.py Tool that can detect and configure the Intel C++ v8 compiler on both Windows, where it's named icl, and Linux, where it's named icc. It also checks that the directory specified in the Windows registry exists, and sets a new $INTEL_C_COMPILER_VERSION construction variable to identify the version being used. (Niall Douglas contributed an early prototype of parts of this module.) - Fix the private Conftest._Have() function so it doesn't change non-alphanumeric characters to underscores. - Supply a better error message when a construction variable expansion has an unknown attribute. - Documentation changes: Update the man page to describe use of filenames or Nodes in $LIBS. From Chris Pawling: - Have the linkloc tool use $MSVS_VERSION to select the Microsoft Visual Studio version to use. From Kevin Quick: - Fix the Builder name returned from ListBuilders and other instances of subclasses of the BuilderBase class. - Add Builders and construction variables to support rpcgen: RPCGenClient(), RPCGenHeader(), RPCGenService(), RPCGenXDR(), $RPCGEN, $RPCGENFLAGS, $RPCGENCLIENTFLAGS, $RPCGENHEADERFLAGS, $RPCGENSERVICEFLAGS, $RPCGENXDRFLAGS. - Update the man page to document that prefix and suffix Builder keyword arguments can be strings, callables or dictionaries. - Provide more info in the error message when a user tries to build a target multiple ways. - Fix Delete() when a file doesn't exist and must_exist=1. (We were unintentionally dependent on a bug in versions of the Python shutil.py module prior to Python 2.3, which would generate an exception for a nonexistent file even when ignore_errors was set.) - Only replace a Node's builder with a non-null source builder. - Fix a stack trace when a suffix selection dictionary is passed an empty source file list. - Allow optional names to be attached to Builders, for default Builders that don't get attached to construction environments. - Fix problems with Parallel Task Exception handling. - Build targets in an associated BuildDir even if there are targets or subdirectories locally in the source directory. - If a FunctionAction has a callable class as its underlying Python function, use its strfunction() method (if any) to display the action. - Fix handling when BuildDir() exists but is unwriteable. Add "Stop." to those error messages for consistency. - Catch incidents of bad builder creation (without an action) and supply meaningful error messages. - Fix handling of src_suffix values that aren't extensions (don't begin with a '.'). - Don't retrieve files from a CacheDir, but report what would happen, when the -n option is used. - Use the source_scanner from the target Node, not the source node itself. - Internal Scanners fixes: Make sure Scanners are only passed Nodes. Fix how a Scanner.Selector called its base class initialization. Make comparisons of Scanner objects more robust. Add a name to an internal default ObjSourceScanner. - Add a deprecated warning for use of the old "scanner" keyword argument to Builder creation. - Improve the --debug=explain message when the build action changes. - Test enhancements in SourceCode.py, option-n.py, midl.py. Better Command() and Scanner test coverage. Improved test infrastructure for -c output. - Refactor the interface between Action and Executor objects to treat Actions atomically. - The --debug=presub option will now report the pre-substitution each action seprately, instead of reporting the entire list before executing the actions one by one. - The --debug=explain option explaining a changed action will now (more correctly) show pre-substitution action strings, instead of the commands with substituted file names. - A Node (file) will now be rebuilt if its PreAction or PostAction actions change. - Python Function actions now have their calling signature (target, source, env) reported correctly when displayed. - Fix BuildDir()/build_dir handling when the build_dir is underneath the source directory and trying to use entries from the build_dir as sources for other targets in the build-dir. - Fix hard-coding of JDK path names in various Java tests. - Handle Python stack traces consistently (stop at the SConscript stack frame, by default) even if the Python source code isn't available. - Improve the performance of the --debug={tree,dtree} options. - Add --debug=objects logging of creation of OverrideWarner, EnvironmentCopy and EnvironmentOverride objects. - Fix command-line expansion of Python Value Nodes. - Internal cleanups: Remove an unnecessary scan argument. Associate Scanners only with Builders, not nodes. Apply overrides once when a Builder is called, not in multiple places. Cache results from the Node.FS.get_suffix() and Node.get_build_env() methods. Use the Python md5 modules' hexdigest() method, if there is one. Have Taskmaster call get_stat() once for each Node and re-use the value instead of calling it each time it needs the value. Have Node.depends_on() re-use the list from the children() method instead of calling it multiple times. - Use the correct scanner if the same source file is used for targets in two different environments with the same path but different scanners. - Collect logic for caching values in memory in a Memoizer class, which cleans up a lot of special-case code in various methods and caches additional values to speed up most configurations. - Add a PathAccept validator to the list of new canned PathOption validators. From Jeff Squyres: - Documentation changes: Use $CPPDEFINES instead of $CCFLAGS in man page examples. From Levi Stephen: - Allow $JARCHDIR to be expanded to other construction variables. From Christoph Wiedemann: - Add an Environment.SetDefault() method that only sets values if they aren't already set. - Have the qt.py Tool not override variables already set by the user. - Add separate $QT_BINPATH, $QT_CPPPATH and $QT_LIBPATH variables so these can be set individually, instead of being hard-wired relative to $QTDIR. - The %TEMP% and %TMP% external environment variables are now propagated automatically to the command execution environment on Windows systems. - A new --config= command-line option allows explicit control of of when the Configure() tests are run: --config=force forces all checks to be run, --config=cache uses all previously cached values, --config=auto (the default) runs tests only when dependency analysis determines it's necessary. - The Configure() subsystem can now write a config.h file with values like HAVE_STDIO_H, HAVE_LIBM, etc. - The Configure() subsystem now executes its checks silently when the -Q option is specified. - The Configure() subsystem now reports if a test result is being taken from cache, and prints the standard output and error output of tests even when cached. - Configure() test results are now reported as "yes" or "no" instead of "ok" or "failed." - Fixed traceback printing when calling the env.Configure() method instead of the Configure() global function. - The Configure() subsystem now caches build failures in a .sconsign file in the subdirectory, not a .cache file. This may cause tests to be re-executed the first time after you install 0.97. - Additional significant internal cleanups in the Configure() subsystem and its tests. - Have the Qt Builder make uic-generated files dependent on the .ui.h file, if one exists. - Add a test to make sure that SCons source code does not contain try:-except: blocks that catch all errors, which potentially catch and mask keyboard interrupts. - Fix us of TargetSignatures('content') with the SConf subsystem. From Russell Yanofsky: - Add support for the Metrowerks Codewarrior compiler and linker (mwcc and mwld). RELEASE 0.96.1 - Mon, 23 Aug 2004 12:55:50 +0000 From Craig Bachelor: - Handle white space in the executable Python path name within in MSVS project files by quoting the path. - Correct the format of a GUID string in a solution (.dsw) file so MSVS can correctly "build enable" a project. From Steven Knight: - Add a must_exist flag to Delete() to let the user control whether it's an error if the specified entry doesn't exist. The default behavior is now to silently do nothing if it doesn't exist. - Package up the new Platform/darwin.py, mistakenly left out of 0.96. - Make the scons.bat REM statements into @REM so they aren't printed. - Make the SCons packaging SConscript files platform independent. From Anthony Roach: - Fix scanning of pre-compiled header (.pch) files for #includes, broken in 0.96. RELEASE 0.96 - Wed, 18 Aug 2004 13:36:40 +0000 From Chad Austin: - Make the CacheDir() directory if it doesn't already exist. - Allow construction variable substitutions in $LIBS specifications. - Allow the emitter argument to a Builder() to be or expand to a list of emitter functions, which will be called in sequence. - Suppress null values in construction variables like $LIBS that use the internal _concat() function. - Remove .dll files from the construction variables searched for libraries that can be fed to Win32 compilers. From Chad Austin and Christoph Wiedemann: - Add support for a $RPATH variable to supply a list of directories to search for shared libraries when linking a program. Used by the GNU and IRIX linkers (gnulink and sgilink). From Charles Crain: - Restore the ability to do construction variable substitutions in all kinds of *PATH variables, even when the substitution returns a Node or other object. From Tom Epperly: - Allow the Java() Builder to take more than one source directory. From Ralf W. Grosse-Kunstleve: - Have SConsignFile() use, by default, a custom "dblite.py" that we can control and guarantee to work on all Python versions (or nearly so). From Jonathan Gurley: - Add support for the newer "ifort" versions of the Intel Fortran Compiler for Linux. From Bob Halley: - Make the new *FLAGS variable type work with copied Environments. From Chris Hoeppler: - Initialize the name of a Scanner.Classic scanner correctly. From James Juhasz: - Add support for the .dylib shared library suffix and the -dynamiclib linker option on Mac OS X. From Steven Knight: - Add an Execute() method for executing actions directly. - Support passing environment override keyword arguments to Command(). - Fix use of $MSVS_IGNORE_IDE_PATHS, which was broken when we added support for $MSVS_USE_MFC_DIRS last release. - Make env.Append() and env.Prepend() act like the underlying Python behavior when the variable being appended to is a UserList object. - Fix a regression that prevented the Command() global function in 0.95 from working with command-line strings as actions. - Fix checking out a file from a source code management system when the env.SourceCode() method was called with an individual file name or node, not a directory name or node. - Enhance the Task.make_ready() method to create a list of the out-of-date Nodes for the task for use by the wrapping interface. - Allow Scanners to pull the list of suffixes from the construction environment when the "skeys" keyword argument is a string containing a construction variable to be expanded. - Support new $CPPSUFFIXES, $DSUFFIXES $FORTRANSUFFIXES, and $IDLSUFFIXES. construction variables that contain the default list of suffixes to be scanned by a given type of scanner, allowing these suffix lists to be easily added to or overridden. - Speed up Node creation when calling a Builder by comparing whether two Environments are the same object, not if their underlying dictionaries are equivalent. - Add a --debug=explain option that reports the reason(s) why SCons thinks it must rebuild something. - Add support for functions that return platform-independent Actions to Chmod(), Copy(), Delete(), Mkdir(), Move() and Touch() files and/or directories. Like any other Actions, the returned Action object may be executed directly using the Execute() global function or env.Execute() environment method, or may be used as a Builder action or in an env.Command() action list. - Add support for the strfunction argument to all types of Actions: CommandAction, ListAction, and CommandGeneratorAction. - Speed up turning file system Nodes into strings by caching the values after we're finished reading the SConscript files. - Have ParseConfig() recognize and supporting adding the -Wa, -Wl, and -Wp, flags to ASFLAGS, LINKFLAGS and CPPFLAGS, respectively. - Change the .sconsign format and the checks for whether a Node is up-to-date to make dependency checks more efficient and correct. - Add wrapper Actions to SCons.Defaults for $ASCOM, $ASPPCOM, $LINKCOM, $SHLINKCOM, $ARCOM, $LEXCOM and $YACCCOM. This makes it possible to replace the default print behavior with a custom strfunction() for each of these. - When a Node has been built, don't walk the whole tree back to delete the parents's implicit dependencies, let returning up the normal Taskmaster descent take care of it for us. - Add documented support for separate target_scanner and source_scanner arguments to Builder creation, which allows different scanners to be applied to source files - Don't re-install or (re-generate) .h files when a subsidiary #included .h file changes. This eliminates incorrect circular dependencies with .h files generated from other source files. - Slim down the internal Sig.Calculator class by eliminating methods whose functionality is now covered by Node methods. - Document use of the target_factory and source_factory keyword arguments when creating Builder objects. Enhance Dir Nodes so that they can be created with user-specified Builder objects. - Don't blow up with stack trace when the external $PATH environment variable isn't set. - Make Builder calls return lists all the time, even if there's only one target. This keeps things consistent and easier to program to across platforms. - Add a Flatten() function to make it easier to deal with the Builders all returning lists of targets, not individual targets. - Performance optimizations in Node.FS.__doLookup(). - Man page fixes: formatting typos, misspellings, bad example. - User's Guide fixes: Fix the signatures of the various example *Options() calls. Triple-quote properly a multi-line Split example. - User's Guide additions: Chapter describing File and Directory Nodes. Section describing declarative nature of SCons functions in SConscript files. Better organization and clarification of points raised by Robert P. J. Day. Chapter describing SConf (Autoconf-like) functionality. Chapter describing how to install Python and SCons. Chapter describing Java builds. From Chris Murray: - Add a .win32 attribute to force file names to expand with Windows backslash path separators. - Fix escaping file names on command lines when the expansion is concatenated with another string. - Add support for Fortran 90 and Fortran 95. This adds $FORTRAN* variables that specify a default compiler, command-line, flags, etc. for all Fortran versions, plus separate $F90* and $F95* variables for when different compilers/flags/etc. must be specified for different Fortran versions. - Have individual tools that create libraries override the default $LIBPREFIX and $LIBSUFFIX values set by the platform. This makes it easier to use Microsoft Visual Studio tools on a CygWin platform. From Gary Oberbrunner: - Add a --debug=presub option to print actions prior to substitution. - Add a warning upon use of the override keywords "targets" and "sources" when calling Builders. These are usually mistakes which are otherwise silently (and confusingly) turned into construction variable overrides. - Try to find the ICL license file path name in the external environment and the registry before resorting to the hard-coded path name. - Add support for fetching command-line keyword=value arguments in order from an ARGLIST list. - Avoid stack traces when trying to read dangling symlinks. - Treat file "extensions" that only contain digits as part of the file basename. This supports version numbers as part of shared library names, for example. - Avoid problems when there are null entries (None or '') in tool lists or CPPPATH. - Add an example and explanation of how to use "tools = ['default', ..." when creating a construction environment. - Add a section describing File and Directory Nodes and some of their attributes and methods. - Have ParseConfig() add a returned -pthread flag to both $CCFLAGS and $LINKFLAGS. - Fix some test portability issues on Mac OS X (darwin). From Simon Perkins: - Fix a bug introduced in building shared libraries under MinGW. From Kevin Quick: - Handling SCons exceptions according to Pythonic standards. - Fix test/chained-build.py on systems that execute within one second. - Fix tests on systems where 'ar' warns about archive creation. From Anthony Roach: - Fix use of the --implicit-cache option with timestamp signatures. - If Visual Studio is installed, assume the C/C++ compiler, the linker and the MIDL compiler that comes with it are available, too. - Better error messages when evaluating a construction variable expansion yields a Python syntax error. - Change the generation of PDB files when using Visual Studio from compile time to link time. From sam th: - Allow SConf.CheckLib() to search a list of libraries, like the Autoconf AC_SEARCH_LIBS macro. - Allow the env.WhereIs() method to take a "reject" argument to let it weed out specific path names. From Christoph Wiedemann: - Add new Moc() and Uic() Builders for more explicit control over Qt builds, plus new construction variables to control them: $QT_AUTOSCAN, $QT_DEBUG, $QT_MOCCXXPREFIX, $QT_MOCCXXSUFFIX, $QT_MOCHPREFIX, $QT_MOCHSUFFIX, $QT_UICDECLPREFIX, $QT_UICDECLSUFFIX, $QT_UICIMPLPREFIX, $QT_UICIMPLSUFFIX and $QT_UISUFFIX. - Add a new single_source keyword argument for Builders that enforces a single source file on calls to the Builder. RELEASE 0.95 - Mon, 08 Mar 2004 06:43:20 -0600 From Chad Austin: - Replace print statements with calls to sys.stdout.write() so output lines stay together when -j is used. - Add portability fixes for a number of tests. - Accomodate the fact that Cygwin's os.path.normcase() lies about the underlying system being case-sensitive. - Fix an incorrect _concat() call in the $RCINCFLAGS definition for the mingw Tool. - Fix a problem with the msvc tool with Python versions prior to 2.3. - Add support for a "toolpath" Tool() and Environment keyword that allows Tool modules to be found in specified local directories. - Work around Cygwin Python's silly fiction that it's using a case-sensitive file system. - More robust handling of data in VCComponents.dat. - If the "env" command is available, spawn commands with the more general "env -" instead of "env -i". From Kerim Borchaev: - Fix a typo in a msvc.py's registry lookup: "VCComponents.dat", not "VSComponents.dat". From Chris Burghart: - Fix the ability to save/restore a PackageOption to a file. From Steve Christensen: - Update the MSVS .NET and MSVC 6.0/7.0 path detection. From David M. Cooke: - Make the Fortran scanner case-insensitive for the INCLUDE string. From Charles Crain: - If no version of MSVC is detected but the tool is specified, use the MSVC 6.0 paths by default. - Ignore any "6.1" version of MSVC found in the registry; this is a phony version number (created by later service packs?) and would throw off the logic if the user had any non-default paths configure. - Correctly detect if the user has independently configured the MSVC "include," "lib" or "path" in the registry and use the appropriate values. Previously, SCons would only use the values if all three were set in the registry. - Make sure side-effect nodes are prepare()d before building their corresponding target. - Preserve the ability to call BuildDir() multiple times with the same target and source directory arguments. From Andy Friesen: - Add support for the Digital Mars "D" programming language. From Scott Lystig Fritchie: - Fix the ability to use a custom _concat() function in the construction environment when calling _stripixes(). - Make the message about ignoring a missing SConscript file into a suppressable Warning, not a hard-coded sys.stderr.write(). - If a builder can be called multiple times for a target (because the sources and overrides are identical, or it's a builder with the "multi" flag set), allow the builder to be called through multiple environments so long as the builders have the same signature for the environments in questions (that is, they're the same action). From Bob Halley: - When multiple targets are built by a single action, retrieve all of them from cache, not just the first target, and exec the build command if any of the targets isn't present in the cache. From Zephaniah Hull: - Fix command-line ARGUMENTS with multiple = in them. From Steven Knight: - Fix EnsureSConsVersion() so it checks against the SCons version, not the Python version, on Pythons with sys.version_info. - Don't swallow the AttributeError when someone uses an expansion like $TARGET.bak, so we can supply a more informative error message. - Fix an odd double-quote escape sequence in the man page. - Fix looking up a naked drive letter as a directory (Dir('C:')). - Support using File nodes in the LIBS construction variable. - Allow the LIBS construction variable to be a single string or File node, not a list, when only one library is needed. - Fix typos in the man page: JAVACHDIR => JARCHDIR; add "for_signature" to the __call__() example in the "Variable Substitution" section. - Correct error message spellings of "non-existant" to "non-existent." - When scanning for libraries to link with, don't append $LIBPREFIXES or $LIBSUFFIXES values to the $LIBS values if they're already present. - Add a ZIPCOMPRESSION construction variable to control whether the internal Python action for the Zip Builder compresses the file or not. The default value is zipfile.ZIP_DEFLATED, which generates a compressed file. - Refactor construction variable expansion to support recursive expansion of variables (e.g. CCFLAGS = "$CCFLAGS -g") without going into an infinite loop. Support this in all construction variable overrides, as well as when copying Environments. - Fix calling Configure() from more than one subsidiary SConscript file. - Fix the env.Action() method so it returns the correct type of Action for its argument(s). - Fix specifying .class files as input to JavaH with the .class suffix when they weren't generated using the Java Builder. - Make the check for whether all of the objects going into a SharedLibrary() are shared work even if the object was built in a previous run. - Supply meaningful error messages, not stack traces, if we try to add a non-Node as a source, dependency, or ignored dependency of a Node. - Generate MSVS Project files that re-invoke SCons properly regardless of whether the file was built via scons.bat or scons.py. (Thanks to Niall Douglas for contributing code and testing.) - Fix TestCmd.py, runtest.py and specific tests to accomodate being run from directories whose paths include white space. - Provide a more useful error message if a construction variable expansion contains a syntax error during evaluation. - Fix transparent checkout of implicit dependency files from SCCS and RCS. - Added new --debug=count, --debug=memory and --debug=objects options. --debug=count and --debug=objects only print anything when run under Python 2.1 or later. - Deprecate the "overrides" keyword argument to Builder() creation in favor of using keyword argument values directly (like we do for builder execution and the like). - Always use the Builder overrides in substitutions, not just if there isn't a target-specific environment. - Add new "rsrcpath" and "rsrcdir" and attributes to $TARGET/$SOURCE, so Builder command lines can find things in Repository source directories when using BuildDir. - Fix the M4 Builder so that it chdirs to the Repository directory when the input file is in the source directory of a BuildDir. - Save memory at build time by allowing Nodes to delete their build environments after they've been built. - Add AppendUnique() and PrependUnique() Environment methods, which add values to construction variables like Append() and Prepend() do, but suppress any duplicate elements in the list. - Allow the 'qt' tool to still be used successfully from a copied Environment. The include and library directories previously ended up having the same string re-appended to the end, yielding an incorrect path name. - Supply a more descriptive error message when the source for a target can't be found. - Initialize all *FLAGS variables with objects do the right thing with appending flags as strings or lists. - Make things like ${TARGET.dir} work in *PATH construction variables. - Allow a $MSVS_USE_MFC_DIRS construction variable to control whether ATL and MFC directories are included in the default INCLUDE and LIB paths. - Document the dbm_module argument to the SConsignFile() function. From Vincent Risi: - Add support for the bcc32, ilink32 and tlib Borland tools. From Anthony Roach: - Supply an error message if the user tries to configure a BuildDir for a directory that already has one. - Remove documentation of the still-unimplemented -e option. - Add -H help text listing the legal --debug values. - Don't choke if a construction variable is a non-string value. - Build Type Libraries in the target directory, not the source directory. - Add an appendix to the User's Guide showing how to accomplish various common tasks in Python. From Greg Spencer: - Add support for Microsoft Visual Studio 2003 (version 7.1). - Evaluate $MSVSPROJECTSUFFIX and $MSVSSOLUTIONSUFFIX when the Builder is invoked, not when the tool is initialized. From Christoph Wiedemann: - When compiling Qt, make sure the moc_*.cc files are compiled using the flags from the environment used to specify the target, not the environment that first has the Qt Builders attached. RELEASE 0.94 - Fri, 07 Nov 2003 05:29:48 -0600 From Hartmut Goebel: - Add several new types of canned functions to help create options: BoolOption(), EnumOption(), ListOption(), PackageOption(), PathOption(). From Steven Knight: - Fix use of CPPDEFINES with C++ source files. - Fix env.Append() when the operand is an object with a __cmp__() method (like a Scanner instance). - Fix subclassing the Environment and Scanner classes. - Add BUILD_TARGETS, COMMAND_LINE_TARGETS and DEFAULT_TARGETS variables. From Steve Leblanc: - SGI fixes: Fix C++ compilation, add a separate Tool/sgic++.py module. From Gary Oberbrunner: - Fix how the man page un-indents after examples in some browsers. From Vincent Risi: - Fix the C and C++ tool specifications for AIX. RELEASE 0.93 - Thu, 23 Oct 2003 07:26:55 -0500 From J.T. Conklin: - On POSIX, execute commands with the more modern os.spawnvpe() function, if it's available. - Scan .S, .spp and .SPP files for C preprocessor dependencies. - Refactor the Job.Parallel() class to use a thread pool without a condition variable. This improves parallel build performance and handles keyboard interrupts properly when -j is used. From Charles Crain: - Add support for a JARCHDIR variable to control changing to a directory using the jar -C option. - Add support for detecting Java manifest files when using jar, and specifying them using the jar m flag. - Fix some Python 2.2 specific things in various tool modules. - Support directories as build sources, so that a rebuild of a target can be triggered if anything underneath the directory changes. - Have the scons.bat and scons.py files look for the SCons modules in site-packages as well. From Christian Engel: - Support more flexible inclusion of separate C and C++ compilers. - Use package management tools on AIX and Solaris to find where the comilers are installed, and what version they are. - Add support for CCVERSION and CXXVERSION variables for a number of C and C++ compilers. From Sergey Fogel: - Add test cases for the new capabilities to run bibtex and to rerun latex as needed. From Ralf W. Grosse-Kunstleve: - Accomodate anydbm modules that don't have a sync() method. - Allow SConsignFile() to take an argument specifying the DBM module to be used. From Stephen Kennedy: - Add support for a configurable global .sconsign.dbm file which can be used to avoid cluttering each directory with an individual .sconsign file. From John Johnson: - Fix (re-)scanning of dependencies in generated or installed header files. From Steven Knight: - The -Q option suppressed too many messages; fix it so that it only suppresses the Reading/Building messages. - Support #include when there's no space before the opening quote or angle bracket. - Accomodate alphanumeric version strings in EnsurePythonVersion(). - Support arbitrary expansion of construction variables within file and directory arguments to Builder calls and Environment methods. - Add Environment-method versions of the following global functions: Action(), AddPostAction(), AddPreAction(), Alias(), Builder(), BuildDir(), CacheDir(), Clean(), Configure(), Default(), EnsurePythonVersion(), EnsureSConsVersion(), Environment(), Exit(), Export(), FindFile(), GetBuildPath(), GetOption(), Help(), Import(), Literal(), Local(), Platform(), Repository(), Scanner(), SConscriptChdir(), SConsignFile(), SetOption(), SourceSignatures(), Split(), TargetSignatures(), Tool(), Value(). - Add the following global functions that correspond to the same-named Environment methods: AlwaysBuild(), Command(), Depends(), Ignore(), Install(), InstallAs(), Precious(), SideEffect() and SourceCode(). - Add the following global functions that correspond to the default Builder methods supported by SCons: CFile(), CXXFile(), DVI(), Jar(), Java(), JavaH(), Library(), M4(), MSVSProject(), Object(), PCH(), PDF(), PostScript(), Program(), RES(), RMIC(), SharedLibrary(), SharedObject(), StaticLibrary(), StaticObject(), Tar(), TypeLibrary() and Zip(). - Rearrange the man page to show construction environment methods and global functions in the same list, and to explain the difference. - Alphabetize the explanations of the builder methods in the man page. - Rename the Environment.Environment class to Enviroment.Base. Allow the wrapping interface to extend an Environment by using its own subclass of Environment.Base and setting a new Environment.Environment variable as the calling entry point. - Deprecate the ParseConfig() global function in favor of a same-named construction environment method. - Allow the Environment.WhereIs() method to take explicit path and pathext arguments (like the underlying SCons.Util.WhereIs() function). - Remove the long-obsolete {Get,Set}CommandHandler() functions. - Enhance env.Append() to suppress null values when appropriate. - Fix ParseConfig() so it works regardless of initial construction variable values. Extend CheckHeader(), CheckCHeader(), CheckCXXHeader() and CheckLibWithHeader() to accept a list of header files that will be #included in the test. The last one in the list is assumed to be the one being checked for. (Prototype code contributed by Gerard Patel and Niall Douglas). - Supply a warning when -j is used and threading isn't built in to the current version of Python. - First release of the User's Guide (finally, and despite a lot of things still missing from it...). From Clark McGrew: - Generalize the action for .tex files so that it will decide whether a file is TeX or LaTeX, check the .aux output to decide if it should run bibtex, and check the .log output to re-run LaTeX if needed. From Bram Moolenaar: - Split the non-SCons-specific functionality from SConf.py to a new, re-usable Conftest.py module. From Gary Oberbrunner: - Allow a directory to be the target or source or dependency of a Depends(), Ignore(), Precious() or SideEffect() call. From Gerard Patel: - Use the %{_mandir} macro when building our RPM package. From Marko Rauhamaa: - Have the closing message say "...terminated because of errors" if there were any. From Anthony Roach: - On Win32 systems, only use "rm" to delete files if Cygwin is being used. ("rm" doesn't understand Win32-format path names.) From Christoph Wiedemann: - Fix test/SWIG.py to find the Python include directory in all cases. - Fix a bug in detection of Qt installed on the local system. - Support returning Python 2.3 BooleanType values from Configure checks. - Provide an error message if someone mistakenly tries to call a Configure check from within a Builder function. - Support calling a Builder when a Configure context is still open. - Handle interrupts better by eliminating all try:-except: blocks which caught any and all exceptions, including KeyboardInterrupt. - Add a --duplicate= option to control how files are duplicated. RELEASE 0.92 - Wed, 20 Aug 2003 03:45:28 -0500 From Charles Crain and Gary Oberbrunner: - Fix Tool import problems with the Intel and PharLap linkers. From Steven Knight - Refactor the DictCmdGenerator class to be a Selector subclass. - Allow the DefaultEnvironment() function to take arguments and pass them to instantiation of the default construction environment. - Update the Debian package so it uses Python 2.2 and more closely resembles the currently official Debian packaging info. From Gerard Patel - When the yacc -d flag is used, take the .h file base name from the target .c file, not the source (matching what yacc does). RELEASE 0.91 - Thu, 14 Aug 2003 13:00:44 -0500 From Chad Austin: - Support specifying a list of tools when calling Environment.Copy(). - Give a Value Nodes a timestamp of the system time when they're created, so they'll work when using timestamp-based signatures. - Add a DefaultEnvironment() function that only creates a default environment on-demand (for fetching source files, e.g.). - Portability fix for test/M4.py. From Steven Knight: - Tighten up the scons -H help output. - When the input yacc file ends in .yy and the -d flag is specified, recognize that a .hpp file (not a .h file) will be created. - Make builder prefixes work correctly when deducing a target from a source file name in another directory. - Documentation fixes: typo in the man page; explain up-front about not propagating the external environment. - Use "cvs co -d" instead of "cvs co -p >" when checking out something from CVS with a specified module name. This avoids zero-length files when there is a checkout error. - Add an "sconsign" script to print the contents of .sconsign files. - Speed up maintaining the various lists of Node children by using dictionaries to avoid "x in list" searches. - Cache the computed list of Node children minus those being Ignored so it's only calculated once. - Fix use of the --cache-show option when building a Program() (or using any other arbitrary action) by making sure all Action instances have strfunction() methods. - Allow the source of Command() to be a directory. - Better error handling of things like raw TypeErrors in SConscripts. - When installing using "setup.py install --prefix=", suppress the distutils warning message about adding the (incorrect) library directory to your search path. - Correct the spelling of the "validater" option to "validator." Add a DeprecatedWarning when the old spelling is used. - Allow a Builder's emitter to be a dictionary that maps source file suffixes to emitter functions, using the suffix of the first file in the source list to pick the right one. - Refactor the creation of the Program, *Object and *Library Builders so that they're moved out of SCons.Defaults and created on demand. - Don't split SConscript file names on white space. - Document the SConscript function's "dirs" and "name" keywords. - Remove the internal (and superfluous) SCons.Util.argmunge() function. - Add /TP to the default CXXFLAGS for msvc, so it can compile all of the suffixes we use as C++ files. - Allow the "prefix" and "suffix" attributes of a Builder to be callable objects that return generated strings, or dictionaries that map a source file suffix to the right prefix/suffix. - Support a MAXLINELINELENGTH construction variable on Win32 systems to control when a temporary file is used for long command lines. - Make how we build .rpm packages not depend on the installation locations from the distutils being used. - When deducing a target Node, create it directly from the first source Node, not by trying to create the right string to pass to arg2nodes(). - Add support for SWIG. From Bram Moolenaar: - Test portability fixes for FreeBSD. From Gary Oberbrunner: - Report the target being built in error messages when building multiple sources from different extensions, or when the target file extension can't be deduced, or when we don't have an action for a file suffix. - Provide helpful error messages when the arguments to env.Install() are incorrect. - Fix the value returned by the Node.prevsiginfo() method to conform to a previous change when checking whether a node is current. - Supply a stack trace if the Taskmaster catches an exception. - When using a temporary file for a long link line on Win32 systems, (also) print the command line that is being executed through the temporary file. - Initialize the LIB environment variable when using the Intel compiler (icl). - Documentation fixes: better explain the AlwaysBuild() function. From Laurent Pelecq: - When the -debug=pdb option is specified, use pdb.Pdb().runcall() to call pdb directly, don't call Python recursively. From Ben Scott: - Add support for a platform-independent CPPDEFINES variable. From Christoph Wiedemann: - Have the g++ Tool actually use g++ in preference to c++. - Have the gcc Tool actually use gcc in preference to cc. - Add a gnutools.py test of the GNU tool chain. - Be smarter about linking: use $CC by default and $CXX only if we're linking with any C++ objects. - Avoid SCons hanging when a piped command has a lot of output to read. - Add QT support for preprocessing .ui files into .c files. RELEASE 0.90 - Wed, 25 Jun 2003 14:24:52 -0500 From Chad Austin: - Fix the _concat() documentation, and add a test for it. - Portability fixes for non-GNU versions of lex and yacc. From Matt Balvin: - Fix handling of library prefixes when the subdirectory matches the prefix. From Timothee Bessett: - Add an M4 Builder. From Charles Crain: - Use '.lnk' as the suffix on the temporary file for linking long command lines (necessary for the Phar Lap linkloc linker). - Save non-string Options values as their actual type. - Save Options string values that contain a single quote correctly. - Save any Options values that are changed from the default Environment values, not just ones changed on the command line or in an Options file. - Make closing the Options file descriptor exception-safe. From Steven Knight: - SCons now enforces (with an error) that construction variables must have the same form as valid Python identifiers. - Fix man page bugs: remove duplicate AddPostAction() description; document no_import_lib; mention that CPPFLAGS does not contain $_CPPINCFLAGS; mention that F77FLAGS does not contain $_F77INCFLAGS; mention that LINKFLAGS and SHLINKFLAGS contains neither $_LIBFLAGS nor $_LIBDIRFLAGS. - Eliminate a dependency on the distutils.fancy_getopt module by copying and pasting its wrap_text() function directly. - Make the Script.Options() subclass match the underlying base class implementation. - When reporting a target is up to date, quote the target like make (backquote-quote) instead of with double quotes. - Fix handling of ../* targets when using -U, -D or -u. From Steve Leblanc: - Don't update the .sconsign files when run with -n. From Gary Oberbrunner: - Add support for the Intel C Compiler (icl.exe). From Anthony Roach - Fix Import('*'). From David Snopek - Fix use of SConf in paths with white space in them. - Add CheckFunc and CheckType functionality to SConf. - Fix use of SConf with Builders that return a list of nodes. From David Snopek and Christoph Wiedemann - Fix use of the SConf subsystem with SConscriptChdir(). From Greg Spencer - Check for the existence of MS Visual Studio on disk before using it, to avoid getting fooled by leftover junk in the registry. - Add support for MSVC++ .NET. - Add support for MS Visual Studio project files (DSP, DSW, SLN and VCPROJ files). From Christoph Wiedemann - SConf now works correctly when the -n and -q options are used. RELEASE 0.14 - Wed, 21 May 2003 05:16:32 -0500 From Chad Austin: - Use .dll (not .so) for shared libraries on Cygwin; use -fPIC when compiling them. - Use 'rm' to remove files under Cygwin. - Add a PLATFORM variable to construction environments. - Remove the "platform" argument from tool specifications. - Propogate PYTHONPATH when running the regression tests so distutils can be found in non-standard locations. - Using MSVC long command-line linking when running Cygwin. - Portability fixes for a lot of tests. - Add a Value Node class for dependencies on in-core Python values. From Allen Bierbaum: - Pass an Environment to the Options validator method, and add an Options.Save() method. From Steve Christensen: - Add an optional sort function argument to the GenerateHelpText() Options function. - Evaluate the "varlist" variables when computing the signature of a function action. From Charles Crain: - Parse the source .java files for class names (including inner class names) to figure out the target .class files that will be created. - Make Java support work with Repositories and SConscriptChdir(0). - Pass Nodes, not strings, to Builder emitter functions. - Refactor command-line interpolation and signature calculation so we can use real Node attributes. From Steven Knight: - Add Java support (javac, javah, jar and rmic). - Propagate the external SYSTEMROOT environment variable into ENV on Win32 systems, so external commands that use sockets will work. - Add a .posix attribute to PathList expansions. - Check out CVS source files using POSIX path names (forward slashes as separators) even on Win32. - Add Node.clear() and Node.FS.Entry.clear() methods to wipe out a Node's state, allowing it to be re-evaluated by continuous integration build interfaces. - Change the name of the Set{Build,Content}SignatureType() functions to {Target,Source}Signatures(). Deprecate the old names but support them for backwards compatibility. - Add internal SCons.Node.FS.{Dir,File}.Entry() methods. - Interpolate the null string if an out-of-range subscript is used for a construction variable. - Fix the internal Link function so that it properly links or copies files in subsidiary BuildDir directories. - Refactor the internal representation of a single execution instance of an action to eliminate redundant signature calculations. - Eliminate redundant signature calculations for Nodes. - Optimize out calling hasattr() before accessing attributes. - Say "Cleaning targets" (not "Building...") when the -c option is used. From Damyan Pepper: - Quote the "Entering directory" message like Make. From Stefan Reichor: - Add support for using Ghostscript to convert Postscript to PDF files. From Anthony Roach: - Add a standalone "Alias" function (separate from an Environment). - Make Export() work for local variables. - Support passing a dictionary to Export(). - Support Import('*') to import everything that's been Export()ed. - Fix an undefined exitvalmap on Win32 systems. - Support new SetOption() and GetOption() functions for setting various command-line options from with an SConscript file. - Deprecate the old SetJobs() and GetJobs() functions in favor of using the new generic {Set,Get}Option() functions. - Fix a number of tests that searched for a Fortran compiler using the external PATH instead of what SCons would use. - Fix the interaction of SideEffect() and BuildDir() so that (for example) PDB files get put correctly in a BuildDir(). From David Snopek: - Contribute the "Autoscons" code for Autoconf-like checking for the existence of libraries, header files and the like. - Have the Tool() function add the tool name to the $TOOLS construction variable. From Greg Spencer: - Support the C preprocessor #import statement. - Allow the SharedLibrary() Builder on Win32 systems to be able to register a newly-built dll using regsvr32. - Add a Builder for Windows type library (.tlb) files from IDL files. - Add an IDL scanner. - Refactor the Fortran, C and IDL scanners to share common logic. - Add .srcpath and .srcdir attributes to $TARGET and $SOURCE. From Christoph Wiedemann: - Integrate David Snopek's "Autoscons" code as the new SConf configuration subsystem, including caching of values between runs (using normal SCons dependency mechanisms), tests, and documentation. RELEASE 0.13 - Mon, 31 Mar 2003 20:22:00 -0600 From Charles Crain: - Fix a bug when BuildDir(duplicate=0) is used and SConscript files are called from within other SConscript files. - Support (older) versions of Perforce which don't set the Windows registry. RELEASE 0.12 - Thu, 27 Mar 2003 23:52:09 -0600 From Charles Crain: - Added support for the Perforce source code management system. - Fix str(Node.FS) so that it returns a path relative to the calling SConscript file's directory, not the top-level directory. - Added support for a separate src_dir argument to SConscript() that allows explicit specification of where the source files for an SConscript file can be found. - Support more easily re-usable flavors of command generators by calling callable variables when strings are expanded. From Steven Knight: - Added an INSTALL construction variable that can be set to a function to control how the Install() and InstallAs() Builders install files. The default INSTALL function now copies, not links, files. - Remove deprecated features: the "name" argument to Builder objects, and the Environment.Update() method. - Add an Environment.SourceCode() method to support fetching files from source code systems. Add factory methods that create Builders to support BitKeeper, CVS, RCS, and SCCS. Add support for fetching files from RCS or SCCS transparently (like GNU Make). - Make the internal to_String() function more efficient. - Make the error message the same as other build errors when there's a problem unlinking a target file in preparation for it being built. - Make TARGET, TARGETS, SOURCE and SOURCES reserved variable names and warn if the user tries to set them in a construction environment. - Add support for Tar and Zip files. - Better documentation of the different ways to export variables to a subsidiary SConscript file. Fix documentation bugs in a tools example, places that still assumed SCons split strings on white space, and typos. - Support fetching arbitrary files from the TARGETS or SOURCES lists (e.g. ${SOURCES[2]}) when calculating the build signature of a command. - Don't silently swallow exceptions thrown by Scanners (or other exceptions while finding a node's dependent children). - Push files to CacheDir() before calling the superclass built() method (which may clear the build signature as part of clearing cached implicit dependencies, if the file has a source scanner). (Bug reported by Jeff Petkau.) - Raise an internal error if we attempt to push a file to CacheDir() with a build signature of None. - Add an explicit Exit() function for terminating early. - Change the documentation to correctly describe that the -f option doesn't change to the directory in which the specified file lives. - Support changing directories locally with SConscript directory path names relative to any SConstruct file specified with -f. This allows you to build in another directory by simply changing there and pointing at the SConstruct file in another directory. - Change the default SConscriptChdir() behavior to change to the SConscript directory while it's being read. - Fix an exception thrown when the -U option was used with no Default() target specified. - Fix -u so that it builds things in corresponding build directories when used in a source directory. From Lachlan O'Dea: - Add SharedObject() support to the masm tool. - Fix WhereIs() to return normalized paths. From Jeff Petkau: - Don't copy a built file to a CacheDir() if it's already there. - Avoid partial copies of built files in a CacheDir() by copying to a temporary file and renaming. From Anthony Roach: - Fix incorrect dependency-cycle errors when an Aliased source doesn't exist. RELEASE 0.11 - Tue, 11 Feb 2003 05:24:33 -0600 From Chad Austin: - Add support for IRIX and the SGI MIPSPro tool chain. - Support using the MSVC tool chain when running Cygwin Python. From Michael Cook: - Avoid losing signal bits in the exit status from a command, helping terminate builds on interrupt (CTRL+C). From Charles Crain: - Added new AddPreAction() and AddPostAction() functions that support taking additional actions before or after building specific targets. - Add support for the PharLap ETS tool chain. From Steven Knight: - Allow Python function Actions to specify a list of construction variables that should be included in the Action's signature. - Allow libraries in the LIBS variable to explicitly include the prefix and suffix, even when using the GNU linker. (Bug reported by Neal Becker.) - Use DOS-standard CR-LF line endings in the scons.bat file. (Bug reported by Gary Ruben.) - Doc changes: Eliminate description of deprecated "name" keyword argument from Builder definition (reported by Gary Ruben). - Support using env.Append() on BUILDERS (and other dictionaries). (Bug reported by Bj=F6rn Bylander.) - Setting the BUILDERS construction variable now properly clears the previous Builder attributes from the construction Environment. (Bug reported by Bj=F6rn Bylander.) - Fix adding a prefix to a file when the target isn't specified. (Bug reported by Esa Ilari Vuokko.) - Clean up error messages from problems duplicating into read-only BuildDir directories or into read-only files. - Add a CommandAction.strfunction() method, and add an "env" argument to the FunctionAction.strfunction() method, so that all Action objects have strfunction() methods, and the functions for building and returning a string both take the same arguments. - Add support for new CacheDir() functionality to share derived files between builds, with related options --cache-disable, --cache-force, and --cache-show. - Change the default behavior when no targets are specified to build everything in the current directory and below (like Make). This can be disabled by specifying Default(None) in an SConscript. - Revamp SCons installation to fix a case-sensitive installation on Win32 systems, and to add SCons-specific --standard-lib, --standalone-lib, and --version-lib options for easier user control of where the libraries get installed. - Fix the ability to directly import and use Platform and Tool modules that have been implicitly imported into an Environment(). - Add support for allowing an embedding interface to annotate a node when it's created. - Extend the SConscript() function to accept build_dir and duplicate keyword arguments that function like a BuildDir() call. From Steve Leblanc: - Fix the output of -c -n when directories are involved, so it matches -c. From Anthony Roach: - Use a different shared object suffix (.os) when using gcc so shared and static objects can exist side-by-side in the same directory. - Allow the same object files on Win32 to be linked into either shared or static libraries. - Cache implicit cache values when using --implicit-cache. RELEASE 0.10 - Thu, 16 Jan 2003 04:11:46 -0600 From Derrick 'dman' Hudson: - Support Repositories on other file systems by symlinking or copying files when hard linking won't work. From Steven Knight: - Remove Python bytecode (*.pyc) files from the scons-local packages. - Have FunctionActions print a description of what they're doing (a representation of the Python call). - Fix the Install() method so that, like other actions, it prints what would have happened when the -n option is used. - Don't create duplicate source files in a BuildDir when the -n option is used. - Refactor the Scanner interface to eliminate unnecessary Scanner calls and make it easier to write efficient scanners. - Added a "recursive" flag to Scanner creation that specifies the Scanner should be invoked recursively on dependency files returned by the scanner. - Significant performance improvement from using a more efficient check, throughout the code, for whether a Node has a Builder. - Fix specifying only the source file to MultiStepBuilders such as the Program Builder. (Bug reported by Dean Bair.) - Fix an exception when building from a file with the same basename as the subdirectory in which it lives. (Bug reported by Gerard Patel.) - Fix automatic deduction of a target file name when there are multiple source files specified; the target is now deduced from just the first source file in the list. - Documentation fixes: better initial explanation of SConscript files; fix a misformatted "table" in the StaticObject explanation. From Steven Knight and Steve Leblanc: - Fix the -c option so it will remove symlinks. From Steve Leblanc: - Add a Clean() method to support removing user-specified targets when using the -c option. - Add a development script for running SCons through PyChecker. - Clean up things found by PyChecker (mostly unnecessary imports). - Add a script to use HappyDoc to create HTML class documentation. From Lachlan O'Dea: - Make the Environment.get() method return None by default. From Anthony Roach: - Add SetJobs() and GetJobs() methods to allow configuration of the number of default jobs (still overridden by -j). - Convert the .sconsign file format from ASCII to a pickled Python data structure. - Error message cleanups: Made consistent the format of error messages (now all start with "scons: ***") and warning messages (now all start with "scons: warning:"). Caught more cases with the "Do not know how to build" error message. - Added support for the MinGW tool chain. - Added a --debug=includes option. RELEASE 0.09 - Thu, 5 Dec 2002 04:48:25 -0600 From Chad Austin: - Add a Prepend() method to Environments, to append values to the beginning of construction variables. From Matt Balvin: - Add long command-line support to the "lib" Tool (Microsoft library archiver), too. From Charles Crain: - Allow $$ in a string to be passed through as $. - Support file names with odd characters in them. - Add support for construction variable substition on scanner directories (in CPPPATH, F77PATH, LIBPATH, etc.). From Charles Crain and Steven Knight: - Add Repository() functionality, including the -Y option. From Steven Knight: - Fix auto-deduction of target names so that deduced targets end up in the same subdirectory as the source. - Don't remove source files specified on the command line! - Suport the Intel Fortran Compiler (ifl.exe). - Supply an error message if there are no command-line or Default() targets specified. - Fix the ASPPCOM values for the GNU assembler. (Bug reported by Brett Polivka.) - Fix an exception thrown when a Default() directory was specified when using the -U option. - Issue a warning when -c can't remove a target. - Eliminate unnecessary Scanner calls by checking for the existence of a file before scanning it. (This adds a generic hook to check an arbitrary condition before scanning.) - Add explicit messages to tell when we're "Reading SConscript files ...," "done reading SConscript files," "Building targets," and "done building targets." Add a -Q option to supress these. - Add separate $SHOBJPREFIX and $SHOBJSUFFIX construction variables (by default, the same as $OBJPREFIX and $OBJSUFFIX). - Add Make-like error messages when asked to build a source file, and before trying to build a file that doesn't have all its source files (including when an invalid drive letter is used on WIN32). - Add an scons-local-{version} package (in both .tar.gz and .zip flavors) to help people who want to ship SCons as a stand-alone build tool in their software packages. - Prevent SCons from unlinking files in certain situations when the -n option is used. - Change the name of Tool/lib.py to Tool/mslib.py. From Steven Knight and Anthony Roach: - Man page: document the fact that Builder calls return Node objects. From Steve LeBlanc: - Refactor option processing to use our own version of Greg Ward's Optik module, modified to run under Python 1.5.2. - Add a ParseConfig() command to modify an environment based on parsing output from a *-config command. From Jeff Petkau: - Fix interpretation of '#/../foo' on Win32 systems. From Anthony Roach: - Fixed use of command lines with spaces in their arguments, and use of Nodes with spaces in their string representation. - Make access and modification times of files in a BuildDir match the source file, even when hard linking isn't available. - Make -U be case insensitive on Win32 systems. - Issue a warning and continue when finding a corrupt .sconsign file. - Fix using an alias as a dependency of a target so that if one of the alias' dependencies gets rebuilt, the resulting target will, too. - Fix differently ordered targets causing unnecessary rebuilds on case insensitive systems. - Use os.system() to execute external commands whenever the "env" utility is available, which is much faster than fork()/exec(), and fixes the -j option on several platforms. - Fix use of -j with multiple targets. - Add an Options() object for friendlier accomodation of command- line arguments. - Add support for Microsoft VC++ precompiled header (.pch) files, debugger (.pdb) files, and resource (.rc) files. - Don't compute the $_CPPINCFLAGS, $_F77INCFLAGS, $_LIBFLAGS and $_LIBDIRFLAGS variables each time a command is executed, define them so they're computed only as needed. Add a new _concat function to the Environment that allows people to define their own similar variables. - Fix dependency scans when $LIBS is overridden. - Add EnsurePythonVersion() and EnsureSConsVersion() functions. - Fix the overly-verbose stack trace on ListBuilder build errors. - Add a SetContentSignatureType() function, allowing use of file timestamps instead of MD5 signatures. - Make -U and Default('source') fail gracefully. - Allow the File() and Dir() methods to take a path-name string as the starting directory, in addition to a Dir object. - Allow the command handler to be selected via the SPAWN, SHELL and ESCAPE construction variables. - Allow construction variables to be overridden when a Builder is called. From sam th: - Dynamically check for the existence of utilities with which to initialize Environments by default. RELEASE 0.08 - Mon, 15 Jul 2002 12:08:51 -0500 From Charles Crain: - Fixed a bug with relative CPPPATH dirs when using BuildDir(). (Bug reported by Bob Summerwill.) - Added a warnings framework and a --warn option to enable or disable warnings. - Make the C scanner warn users if files referenced by #include directives cannot be found and --warn=dependency is specified. - The BUILDERS construction variable should now be a dictionary that maps builder names to actions. Existing uses of lists, and the Builder name= keyword argument, generate warnings about use of deprecated features. - Removed the "shared" keyword argument from the Object and Library builders. - Added separated StaticObject, SharedObject, StaticLibrary and SharedLibrary builders. Made Object and Library synonyms for StaticObject and StaticLibrary, respectively. - Add LIBS and LIBPATH dependencies for shared libraries. - Removed support for the prefix, suffix and src_suffix arguments to Builder() to be callable functions. - Fix handling file names with multiple dots. - Allow a build directory to be outside of the SConstruct tree. - Add a FindFile() function that searches for a file node with a specified name. - Add $CPPFLAGS to the shared-object command lines for g++ and gcc. From Charles Crain and Steven Knight: - Add a "tools=" keyword argument to Environment instantiation, and a separate Tools() method, for more flexible specification of tool-specific environment changes. From Steven Knight: - Add a "platform=" keyword argument to Environment instantiation, and a separate Platform() method, for more flexible specification of platform-specific environment changes. - Updated README instructions and setup.py code to catch an installation failure from not having distutils installed. - Add descriptions to the -H help text for -D, -u and -U so people can tell them apart. - Remove the old feature of automatically splitting strings of file names on white space. - Add a dependency Scanner for native Fortran "include" statements, using a new "F77PATH" construction variable. - Fix C #include scanning to detect file names with characters like '-' in them. - Add more specific version / build output to the -v option. - Add support for the GNU as, Microsoft masm, and nasm assemblers. - Allow the "target" argument to a Builder call to be omitted, in which case the target(s) are deduced from the source file(s) and the Builder's specified suffix. - Add a tar archive builder. - Add preliminary support for the OS/2 Platform, including the icc and ilink Tools. From Jeff Petkau: - Fix --implicit-cache if the scanner returns an empty list. From Anthony Roach: - Add a "multi" keyword argument to Builder creation that specifies it's okay to call the builder multiple times for a target. - Set a "multi" on Aliases so multiple calls will append to an Alias. - Fix emitter functions' use of path names when using BuildDir or in subdirectories. - Fix --implicit-cache causing redundant rebuilds when the header file list changed. - Fix --implicit-cache when a file has no implicit dependencies and its source is generated. - Make the drive letters on Windows always be the same case, so that changes in the case of drive letters don't cause a rebuild. - Fall back to importing the SCons.TimeStamp module if the SCons.MD5 module can't be imported. - Fix interrupt handling to guarantee that a single interrupt will halt SCons both when using -j and not. - Fix .sconsign signature storage so that output files of one build can be safely used as input files to another build. - Added a --debug=time option to print SCons execution times. - Print an error message if a file can't be unlinked before being built, rather than just silently terminating the build. - Add a SideEffect() method that can be used to tell the build engine that a given file is created as a side effect of building a target. A file can be specified as a side effect of more than one build comand, in which case the commands will not be executed simultaneously. - Significant performance gains from not using our own version of the inefficient stock os.path.splitext() method, caching source suffix computation, code cleanup in MultiStepBuilder.__call__(), and replicating some logic in scons_subst(). - Add --implicit-deps-changed and --implicit-deps-unchanged options. - Add a GetLaunchDir() function. - Add a SetBuildSignatureType() function. From Zed Shaw: - Add an Append() method to Environments, to append values to construction variables. - Change the name of Update() to Replace(). Keep Update() as a deprecated synonym, at least for now. From Terrel Shumway: - Use a $PYTHON construction variable, initialized to sys.executable, when using Python to build parts of the SCons packages. - Use sys.prefix, not sys.exec_prefix, to find pdb.py. RELEASE 0.07 - Thu, 2 May 2002 13:37:16 -0500 From Chad Austin: - Changes to build SCons packages on IRIX (and other *NIces). - Don't create a directory Node when a file already exists there, and vice versa. - Add 'dirs' and 'names' keyword arguments to SConscript for easier specification of subsidiary SConscript files. From Charles Crain: - Internal cleanup of environment passing to function Actions. - Builders can now take arbitrary keyword arguments to create attributes to be passed to: command generator functions, FunctionAction functions, Builder emitter functions (below), and prefix/suffix generator functions (below). - Command generator functions can now return ANYTHING that can be converted into an Action (a function, a string, a CommandGenerator instance, even an ActionBase instance). - Actions now call get_contents() with the actual target and source nodes used for the build. - A new DictCmdGenerator class replaces CompositeBuilder to support more flexible Builder behavior internally. - Builders can now take an emitter= keyword argument. An emitter is a function that takes target, source, and env argument, then return a 2-tuple of (new sources, new targets). The emitter is called when the Builder is __call__'ed, allowing a user to modify source and target lists. - The prefix, suffix and src_suffix Builder arguments now take a callable as well a string. The callable is passed the Environment and any extra Builder keyword arguments and is expected to return the appropriate prefix or suffix. - CommandActions can now be a string, a list of command + argument strings, or a list of commands (strings or lists). - Added shared library support. The Object and Library Builders now take a "shared=1" keyword argument to specify that a shared object or shared library should be built. It is an error to try to build static objects into a shared library or vice versa. - Win32 support for .def files has been added. Added the Win32-specific construction variables $WIN32DEFPREFIX, $WIN32DEFSUFFIX, $WIN32DLLPREFIX and $WIN32IMPLIBPREFIX. When building a .dll, the new construction variable $WIN32_INSERT_DEF, controls whether the appropriately-named .def file is inserted into the target list (if not already present). A .lib file is always added to a Library build if not present in the list of targets. - ListBuilder now passes all targets to the action, not just the first. - Fix so that -c now deletes generated yacc .h files. - Builder actions and emitter functions can now be initialized, through construction variables, to things other than strings. - Make top-relative '#/dir' lookups work like '#dir'. - Fix for relative CPPPATH directories in subsidiary SConscript files (broken in 0.06). - Add a for_signature argument to command generators, so that generators that need to can return distinct values for the command signature and for executing the command. From Alex Jacques: - Create a better scons.bat file from a py2bat.py script on the Python mailing list two years ago (modeled after pl2bat.pl). From Steven Knight: - Fix so that -c -n does *not* remove the targets! - Man page: Add a hierarchical libraries + Program example. - Support long MSVC linker command lines through a builder action that writes to a temporary file and uses the magic MSVC "link @file" argument syntax if the line is longer than 2K characters. - Fix F77 command-line options on Win32 (use /Fo instead of -o). - Use the same action to build from .c (lower case) and .C (upper case) files on case-insensitive systems like Win32. - Support building a PDF file directly from a TeX or LaTeX file using pdftex or pdflatex. - Add a -x option to runtest.py to specify the script being tested. A -X option indicates it's an executable, not a script to feed to the Python interpreter. - Add a Split() function (identical to SCons.Util.argmunge()) for use in the next release, when Builders will no longer automatically split strings on white space. From Steve Leblanc: - Add the SConscriptChdir() method. From Anthony Roach: - Fix --debug=tree when used with directory targets. - Significant internal restructuring of Scanners and Taskmaster. - Added new --debug=dtree option. - Fixes for --profile option. - Performance improvement in construction variable substitution. - Implemented caching of content signatures, plus added --max-drift option to control caching. - Implemented caching of dependency signatures, enabled by new --implicit-cache option. - Added abspath construction variable modifier. - Added $SOURCE variable as a synonym for $SOURCES[0]. - Write out .sconsign files on error or interrupt so intermediate build results are saved. - Change the -U option to -D. Make a new -U that builds just the targets from the local SConscript file. - Fixed use of sys.path so Python modules can be imported from the SConscript directory. - Fix for using Aliases with the -u, -U and -D options. - Fix so that Nodes can be passed to SConscript files. From Moshe Zadka: - Changes for official Debian packaging. RELEASE 0.06 - Thu, 28 Mar 2002 01:24:29 -0600 From Charles Crain: - Fix command generators to expand construction variables. - Make FunctionAction arguments be Nodes, not strings. From Stephen Kennedy: - Performance: Use a dictionary, not a list, for a Node's parents. From Steven Knight: - Add .zip files to the packages we build. - Man page: document LIBS, fix a typo, document ARGUMENTS. - Added RANLIB and RANLIBFLAGS construction variables. Only use them in ARCOM if there's a "ranlib" program on the system. - Add a configurable CFILESUFFIX for the Builder of .l and .y files into C files. - Add a CXXFile Builder that turns .ll and .yy files into .cc files (configurable via a CXXFILESUFFIX construction variable). - Use the POSIX-standard lex -t flag, not the GNU-specific -o flag. (Bug reported by Russell Christensen.) - Fixed an exception when CPPPATH or LIBPATH is a null string. (Bug reported by Richard Kiss.) - Add a --profile=FILE option to make profiling SCons easier. - Modify the new DVI builder to create .dvi files from LaTeX (.ltx and .latex) files. - Add support for Aliases (phony targets). - Add a WhereIs() method for searching for path names to executables. - Add PDF and PostScript document builders. - Add support for compiling Fortran programs from a variety of suffixes (a la GNU Make): .f, .F, .for, .FOR, .fpp and .FPP - Support a CPPFLAGS variable on all default commands that use the C preprocessor. From Steve Leblanc: - Add support for the -U option. - Allow CPPPATH, LIBPATH and LIBS to be specified as white-space separated strings. - Add a document builder to create .dvi files from TeX (.tex) files. From Anthony Roach: - Fix: Construction variables with values of 0 were incorrectly interpolated as ''. - Support env['VAR'] to fetch construction variable values. - Man page: document Precious(). RELEASE 0.05 - Thu, 21 Feb 2002 16:50:03 -0600 From Chad Austin: - Set PROGSUFFIX to .exe under Cygwin. From Charles Crain: - Allow a library to specified as a command-line source file, not just in the LIBS construction variable. - Compensate for a bug in os.path.normpath() that returns '' for './' on WIN32. - More performance optimizations: cache #include lines from files, eliminate unnecessary calls. - If a prefix or suffix contains white space, treat the resulting concatenation as separate arguments. - Fix irregularities in the way we fetch DevStudio information from the Windows registry, and in our registry error handling. From Steven Knight: - Flush stdout after print so it intermixes correctly with stderr when redirected. - Allow Scanners to return a list of strings, and document how to write your own Scanners. - Look up implicit (scanned) dependencies relative to the directory of file being scanned. - Make writing .sconsign files more robust by first trying to write to a temp file that gets renamed. - Create all of the directories for a list of targets before trying to build any of the targets. - WIN32 portability fixes in tests. - Allow the list of variables exported to an SConscript file to be a UserList, too. - Document the overlooked LIBPATH construction variable. (Bug reported by Eicke Godehardt.) - Fix so that Ignore() ignores indirect, implicit dependencies (included files), not just direct dependencies. - Put the man page in the Debian distribution. - Run HTML docs through tidy to clean up the HTML (for Konqueror). - Add preliminary support for Unicode strings. - Efficiency: don't scan dependencies more than once during the walk of a tree. - Fix the -c option so it doesn't stop removing targets if one doesn't already exist. (Bug reported by Paul Connell.) - Fix the --debug=pdb option when run on Windows NT. (Bug reported by Paul Connell.) - Add support for the -q option. From Steve Leblanc: - Add support for the -u option. - Add .cc and .hh file suffixes to the C Scanner. From Anthony Roach: - Make the scons script return an error code on failures. - Add support for using code to generate a command to build a target. RELEASE 0.04 - Wed, 30 Jan 2002 11:09:42 -0600 From Charles Crain: - Significant performance improvements in the Node.FS and Scanner subsystems. - Fix signatures of binary files on Win32 systems. - Allow LIBS and LIBPATH to be strings, not just arrays. - Print a traceback if a Python-function builder throws an exception. From Steven Knight: - Fix using a directory as a Default(), and allow Default() to support white space in file names for strings in arrays. - Man page updates: corrected some mistakes, documented various missing Environment methods, alphabetized the construction variables and other functions, defined begin and end macros for the example sections, regularized white space separation, fixed the use of Export() in the Multiple Variants example. - Function action fixes: None is now a successful return value. Exceptions are now reported. Document function actions. - Add 'Action' and 'Scanner' to the global keywords so SConscript files can use them too. - Removed the Wrapper class between Nodes and Walkers. - Add examples using Library, LIBS, and LIBPATH. - The C Scanner now always returns a sorted list of dependencies so order changes don't cause unnecessary rebuilds. - Strip $(-$) bracketed text from command lines. Use this to surround $_INCDIRS and $_LIBDIRS so we don't rebuild in response to changes to -I or -L options. - Add the Ignore() method to ignore dependencies. - Provide an error message when a nonexistent target is specified on the command line. - Remove targets before building them, and add an Environment Precious() method to override that. - Eliminate redundant calls to the same builder when the target is a list of targets: Add a ListBuilder class that wraps Builders to handle lists atomically. Extend the Task class to support building and updating multiple targets in a single Task. Simplify the interface between Task and Taskmaster. - Add a --debug=pdb option to re-run SCons under the Python debugger. - Only compute a build signature once for each node. - Changes to our sys.path[] manipulation to support installation into an arbitrary --prefix value. From Steve Leblanc: - Add var=value command-line arguments. RELEASE 0.03 - Fri, 11 Jan 2002 01:09:30 -0600 From Charles Crain: - Performance improvements in the Node.FS and Sig.Calculator classes. - Add the InstallAs() method. - Execute commands through an external interpreter (sh, cmd.exe, or command.com) to handle redirection metacharacters. - Allow the user to supply a command handler. From Steven Knight: - Search both /usr/lib and /usr/local/lib for scons directories by adding them both to sys.path, with whichever is in sys.prefix first. - Fix interpreting strings of multiple white-space separated file names as separate file names, allowing prefixes and suffixes to be appended to each individually. - Refactor to move CompositeBuilder initialization logic from the factory wrapper to the __init__() method, and allow a Builder to have both an action and a src_builder (or array of them). - Refactor BuilderBase.__call__() to separate Node creation/lookup from initialization of the Node's builder information. - Add a CFile Builder object that supports turning lex (.l) and yacc (.y) files into .c files. - Document: variable interpretation attributes; how to propogate the user's environment variables to executed commands; how to build variants in multiple BuildDirs. - Collect String, Dict, and List type-checking in common utility routines so we can accept User{String,Dict,List}s all over. - Put the Action factory and classes into their own module. - Use one CPlusPlusAction in the Object Builder's action dictionary, instead of letting it create multiple identical instances. - Document the Install() and InstallAs() methods. From Steve Leblanc: - Require that a Builder be given a name argument, supplying a useful error message when it isn't. From Anthony Roach: - Add a "duplicate" keyword argument to BuildDir() that can be set to prevent linking/copying source files into build directories. - Add a "--debug=tree" option to print an ASCII dependency tree. - Fetch the location of the Microsoft Visual C++ compiler(s) from the Registry, instead of hard-coding the location. - Made Scanner objects take Nodes, not path names. - Have the C Scanner cache the #include file names instead of (re-)scanning the file each time it's called. - Created a separate class for parent "nodes" of file system roots, eliminating the need for separate is-parent-null checks everywhere. - Removed defined __hash__() and __cmp() methods from FS.Entry, in favor of Python's more efficient built-in identity comparisons. RELEASE 0.02 - Sun, 23 Dec 2001 19:05:09 -0600 From Charles Crain: - Added the Install(), BuildDir(), and Export() methods. - Fix the -C option by delaying setting the top of the FS tree. - Avoid putting the directory path on the libraries in the LIBS construction variable. - Added a GetBuildPath() method to return the full path to the Node for a specified string. - Fixed variable substitution in CPPPATH and LIBPATH. From Steven Knight: - Fixed the version comment in the scons.bat (the UNIX geek used # instead of @rem). - Fix to setup.py so it doesn't require a sys.argv[1] argument. - Provide make-like warning message for "command not found" and similar errors. - Added an EXAMPLES section to the man page. - Make Default() targets properly relative to their SConscript file's subdirectory. From Anthony Roach: - Documented CXXFLAGS, CXXCOM, and CPPPATH. - Fixed SCONS_LIB_DIR to work as documented. - Made Default() accept Nodes as arguments. - Changed Export() to make it easier to use. - Added the Import() and Return() methods. RELEASE 0.01 - Thu Dec 13 19:25:23 CST 2001 A brief overview of important functionality available in release 0.01: - C and C++ compilation on POSIX and Windows NT. - Automatic scanning of C/C++ source files for #include dependencies. - Support for building libraries; setting construction variables allows creation of shared libraries. - Library and C preprocessor search paths. - File changes detected using MD5 signatures. - User-definable Builder objects for building files. - User-definable Scanner objects for scanning for dependencies. - Parallel build (-j) support. - Dependency cycles detected. - Linux packages available in RPM and Debian format. - Windows installer available. Copyright (c) 2001 - 2017 The SCons Foundation src/CHANGES.txt rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog scons-src-3.0.0/src/test_setup.py0000664000175000017500000002701413160023045017022 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/test_setup.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" """ Test how the setup.py script installs SCons. Note that this is an installation test, not a functional test, so the name of this script doesn't end in *Tests.py. """ import os import os.path import shutil import sys try: WindowsError except NameError: WindowsError = OSError import TestSCons version = TestSCons.TestSCons.scons_version scons_version = 'scons-%s' % version python = TestSCons.python class MyTestSCons(TestSCons.TestSCons): _lib_modules = [ # A representative smattering of build engine modules. '__init__.py', 'Action.py', 'Builder.py', 'Environment.py', 'Util.py', ] _base_scripts = [ 'scons', 'sconsign', ] _version_scripts = [ 'scons-%s' % version, 'sconsign-%s' % version, ] _bat_scripts = [ 'scons.bat', ] _bat_version_scripts = [ 'scons-%s.bat' % version, ] _man_pages = [ 'scons.1', 'sconsign.1', ] def __init__(self): TestSCons.TestSCons.__init__(self) self.root = self.workpath('root') self.prefix = self.root + os.path.splitdrive(sys.prefix)[1] if sys.platform == 'win32': self.bin_dir = os.path.join(self.prefix, 'Scripts') self.bat_dir = self.prefix self.standalone_lib = os.path.join(self.prefix, 'scons') self.standard_lib = os.path.join(self.prefix, 'Lib', 'site-packages', '') self.version_lib = os.path.join(self.prefix, scons_version) self.man_dir = os.path.join(self.prefix, 'Doc') else: self.bin_dir = os.path.join(self.prefix, 'bin') self.bat_dir = self.bin_dir self.lib_dir = os.path.join(self.prefix, 'lib') self.standalone_lib = os.path.join(self.lib_dir, 'scons') self.standard_lib = os.path.join(self.lib_dir, 'python%s' % sys.version[:3], 'site-packages', '') self.version_lib = os.path.join(self.lib_dir, scons_version) self.man_dir = os.path.join(self.prefix, 'man', 'man1') self.prepend_bin_dir = lambda p: os.path.join(self.bin_dir, p) self.prepend_bat_dir = lambda p: os.path.join(self.bat_dir, p) self.prepend_man_dir = lambda p: os.path.join(self.man_dir, p) def run(self, *args, **kw): kw['chdir'] = scons_version kw['program'] = python kw['stderr'] = None return TestSCons.TestSCons.run(self, *args, **kw) def remove(self, dir): try: shutil.rmtree(dir) except (OSError, WindowsError): pass def stdout_lines(self): return self.stdout().split('\n') def lib_line(self, lib): return 'Installed SCons library modules into %s' % lib def lib_paths(self, lib_dir): return [os.path.join(lib_dir, 'SCons', p) for p in self._lib_modules] def scripts_line(self): return 'Installed SCons scripts into %s' % self.bin_dir def base_script_paths(self): scripts = self._base_scripts return list(map(self.prepend_bin_dir, scripts)) def version_script_paths(self): scripts = self._version_scripts return list(map(self.prepend_bin_dir, scripts)) def bat_script_paths(self): scripts = self._bat_scripts + self._bat_version_scripts return list(map(self.prepend_bat_dir, scripts)) def man_page_line(self): return 'Installed SCons man pages into %s' % self.man_dir def man_page_paths(self): return list(map(self.prepend_man_dir, self._man_pages)) def must_have_installed(self, paths): for p in paths: self.must_exist(p) def must_not_have_installed(self, paths): for p in paths: self.must_not_exist(p) try: cwd = os.environ['SCONS_CWD'] except KeyError: cwd = os.getcwd() test = MyTestSCons() test.subdir(test.root) tar_gz = os.path.join(cwd, 'build', 'dist', '%s.tar.gz' % scons_version) zip = os.path.join(cwd, 'build', 'dist', '%s.zip' % scons_version) if os.path.isfile(zip): try: import zipfile except ImportError: pass else: zf = zipfile.ZipFile(zip, 'r') for name in zf.namelist(): dir = os.path.dirname(name) try: os.makedirs(dir) except: pass # if the file exists, then delete it before writing # to it so that we don't end up trying to write to a symlink: if os.path.isfile(name) or os.path.islink(name): os.unlink(name) if not os.path.isdir(name): open(name, 'w').write(zf.read(name)) if not os.path.isdir(scons_version) and os.path.isfile(tar_gz): # Unpack the .tar.gz file. This should create the scons_version/ # subdirectory from which we execute the setup.py script therein. os.system("gunzip -c %s | tar xf -" % tar_gz) if not os.path.isdir(scons_version): print("Cannot test package installation, found none of the following packages:") print("\t" + tar_gz) print("\t" + zip) test.no_result(1) # Verify that a virgin installation installs the version library, # the scripts and (on UNIX/Linux systems) the man pages. test.run(arguments = 'setup.py install --root=%s' % test.root) test.fail_test(not test.lib_line(test.version_lib) in test.stdout_lines()) test.must_have_installed(test.lib_paths(test.version_lib)) # Verify that --standard-lib installs into the Python standard library. test.run(arguments = 'setup.py install --root=%s --standard-lib' % test.root) test.fail_test(not test.lib_line(test.standard_lib) in test.stdout_lines()) test.must_have_installed(test.lib_paths(test.standard_lib)) # Verify that --standalone-lib installs the standalone library. test.run(arguments = 'setup.py install --root=%s --standalone-lib' % test.root) test.fail_test(not test.lib_line(test.standalone_lib) in test.stdout_lines()) test.must_have_installed(test.lib_paths(test.standalone_lib)) # Verify that --version-lib installs into a version-specific library directory. test.run(arguments = 'setup.py install --root=%s --version-lib' % test.root) test.fail_test(not test.lib_line(test.version_lib) in test.stdout_lines()) # Now that all of the libraries are in place, # verify that a default installation still installs the version library. test.run(arguments = 'setup.py install --root=%s' % test.root) test.fail_test(not test.lib_line(test.version_lib) in test.stdout_lines()) test.remove(test.version_lib) # Now with only the standard and standalone libraries in place, # verify that a default installation still installs the version library. test.run(arguments = 'setup.py install --root=%s' % test.root) test.fail_test(not test.lib_line(test.version_lib) in test.stdout_lines()) test.remove(test.version_lib) test.remove(test.standalone_lib) # Now with only the standard libraries in place, # verify that a default installation still installs the version library. test.run(arguments = 'setup.py install --root=%s' % test.root) test.fail_test(not test.lib_line(test.version_lib) in test.stdout_lines()) # test.run(arguments = 'setup.py install --root=%s' % test.root) test.fail_test(not test.scripts_line() in test.stdout_lines()) if sys.platform == 'win32': test.must_have_installed(test.base_script_paths()) test.must_have_installed(test.version_script_paths()) test.must_have_installed(test.bat_script_paths()) else: test.must_have_installed(test.base_script_paths()) test.must_have_installed(test.version_script_paths()) test.must_not_have_installed(test.bat_script_paths()) test.remove(test.prefix) test.run(arguments = 'setup.py install --root=%s --no-install-bat' % test.root) test.fail_test(not test.scripts_line() in test.stdout_lines()) test.must_have_installed(test.base_script_paths()) test.must_have_installed(test.version_script_paths()) test.must_not_have_installed(test.bat_script_paths()) test.remove(test.prefix) test.run(arguments = 'setup.py install --root=%s --install-bat' % test.root) test.fail_test(not test.scripts_line() in test.stdout_lines()) test.must_have_installed(test.base_script_paths()) test.must_have_installed(test.version_script_paths()) test.must_have_installed(test.bat_script_paths()) test.remove(test.prefix) test.run(arguments = 'setup.py install --root=%s --no-scons-script' % test.root) test.fail_test(not test.scripts_line() in test.stdout_lines()) test.must_not_have_installed(test.base_script_paths()) test.must_have_installed(test.version_script_paths()) # Doesn't matter whether we installed the .bat scripts or not. test.remove(test.prefix) test.run(arguments = 'setup.py install --root=%s --no-version-script' % test.root) test.fail_test(not test.scripts_line() in test.stdout_lines()) test.must_have_installed(test.base_script_paths()) test.must_not_have_installed(test.version_script_paths()) # Doesn't matter whether we installed the .bat scripts or not. test.remove(test.man_dir) test.run(arguments = 'setup.py install --root=%s' % test.root) if sys.platform == 'win32': test.fail_test(test.man_page_line() in test.stdout_lines()) test.must_not_have_installed(test.man_page_paths()) else: test.fail_test(not test.man_page_line() in test.stdout_lines()) test.must_have_installed(test.man_page_paths()) test.remove(test.man_dir) test.run(arguments = 'setup.py install --root=%s --no-install-man' % test.root) test.fail_test(test.man_page_line() in test.stdout_lines()) test.must_not_have_installed(test.man_page_paths()) test.remove(test.man_dir) test.run(arguments = 'setup.py install --root=%s --install-man' % test.root) test.fail_test(not test.man_page_line() in test.stdout_lines()) test.must_have_installed(test.man_page_paths()) # Verify that we don't warn about the directory in which we've # installed the modules when using a non-standard prefix. other_prefix = test.workpath('other-prefix') test.subdir(other_prefix) test.run(arguments = 'setup.py install --prefix=%s' % other_prefix) test.fail_test(test.stderr().find("you'll have to change the search path yourself") != -1) # All done. test.pass_test() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/test_strings.py0000664000175000017500000002000213160023045017341 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # from __future__ import print_function __revision__ = "src/test_strings.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" """ Verify that we have proper strings like Copyright notices on all the right files in our distributions. Note that this is a source file and packaging test, not a functional test, so the name of this script doesn't end in *Tests.py. """ import fnmatch import os import os.path import re import TestCmd import TestSCons # Use TestCmd, not TestSCons, so we don't chdir to a temporary directory. test = TestCmd.TestCmd() scons_version = TestSCons.SConsVersion def build_path(*args): return os.path.join('build', *args) build_scons = build_path('scons') build_local = build_path('scons-local', 'scons-local-'+scons_version) build_src = build_path('scons-src') class Checker(object): def __init__(self, directory, search_list = [], remove_list = [], remove_patterns = []): self.directory = directory self.search_list = search_list self.remove_dict = {} for r in remove_list: self.remove_dict[os.path.join(directory, r)] = 1 self.remove_patterns = remove_patterns def directory_exists(self): return os.path.exists(self.directory) def remove_this(self, name, path): if self.remove_dict.get(path): return 1 else: for pattern in self.remove_patterns: if fnmatch.fnmatch(name, pattern): return 1 return 0 def search_this(self, path): if self.search_list: for pattern in self.search_list: if fnmatch.fnmatch(path, pattern): return 1 return None else: return os.path.isfile(path) def find_missing(self): result = [] for dirpath, dirnames, filenames in os.walk(self.directory): if '.svn' in dirnames: dirnames.remove('.svn') for dname in dirnames[:]: dpath = os.path.join(dirpath, dname) if self.remove_this(dname, dpath): dirnames.remove(dname) for fname in filenames: fpath = os.path.join(dirpath, fname) if self.search_this(fpath) and not self.remove_this(fname, fpath): body = open(fpath, 'r').read() for expr in self.expressions: if not expr.search(body): msg = '%s: missing %s' % (fpath, repr(expr.pattern)) result.append(msg) return result class CheckUnexpandedStrings(Checker): expressions = [ re.compile('Copyright (c) 2001 - 2017 The SCons Foundation'), re.compile('src/test_strings.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog'), ] def must_be_built(self): return None class CheckPassTest(Checker): expressions = [ re.compile(r'\.pass_test()'), ] def must_be_built(self): return None class CheckExpandedCopyright(Checker): expressions = [ re.compile('Copyright.*The SCons Foundation'), ] def must_be_built(self): return 1 check_list = [ CheckUnexpandedStrings( 'src', search_list = [ '*.py' ], remove_list = [ 'engine/SCons/compat/_scons_sets.py', 'engine/SCons/compat/_scons_subprocess.py', 'engine/SCons/Conftest.py', 'engine/SCons/dblite.py', ], ), CheckUnexpandedStrings( 'test', search_list = [ '*.py' ], ), CheckPassTest( 'test', search_list = [ '*.py' ], remove_list = [ 'Fortran/common.py', ], ), CheckExpandedCopyright( build_scons, remove_list = [ 'build', 'build-stamp', 'configure-stamp', 'debian', 'dist', 'gentoo', 'engine/SCons/compat/_scons_sets.py', 'engine/SCons/compat/_scons_subprocess.py', 'engine/SCons/Conftest.py', 'engine/SCons/dblite.py', 'MANIFEST', 'setup.cfg', ], # We run epydoc on the *.py files, which generates *.pyc files. remove_patterns = [ '*.pyc', ] ), CheckExpandedCopyright( build_local, remove_list = [ 'SCons/compat/_scons_sets.py', 'SCons/compat/_scons_subprocess.py', 'SCons/Conftest.py', 'SCons/dblite.py', 'scons-%s.egg-info' % scons_version, ], ), CheckExpandedCopyright( build_src, remove_list = [ 'bench/timeit.py', 'bin', 'config', 'debian', 'gentoo', 'doc/design', 'doc/MANIFEST', 'doc/python10', 'doc/reference', 'doc/developer/MANIFEST', 'doc/man/MANIFEST', 'doc/user/cons.pl', 'doc/user/MANIFEST', 'doc/user/SCons-win32-install-1.jpg', 'doc/user/SCons-win32-install-2.jpg', 'doc/user/SCons-win32-install-3.jpg', 'doc/user/SCons-win32-install-4.jpg', 'examples', 'gentoo', 'QMTest/classes.qmc', 'QMTest/configuration', 'QMTest/TestCmd.py', 'QMTest/TestCmdTests.py', 'QMTest/TestCommon.py', 'QMTest/TestCommonTests.py', 'src/MANIFEST.in', 'src/setup.cfg', 'src/engine/MANIFEST.in', 'src/engine/MANIFEST-xml.in', 'src/engine/setup.cfg', 'src/engine/SCons/compat/_scons_sets.py', 'src/engine/SCons/compat/_scons_subprocess.py', 'src/engine/SCons/Conftest.py', 'src/engine/SCons/dblite.py', 'src/script/MANIFEST.in', 'src/script/setup.cfg', 'test/Fortran/.exclude_tests', 'timings/changelog.html', 'timings/ElectricCloud/genscons.pl', 'timings/graph.html', 'timings/index.html', 'review.py', ], remove_patterns = [ '*.js', ] ), ] missing_strings = [] not_built = [] for collector in check_list: if collector.directory_exists(): missing_strings.extend(collector.find_missing()) elif collector.must_be_built(): not_built.append(collector.directory) if missing_strings: print("Found the following files with missing strings:") print("\t" + "\n\t".join(missing_strings)) test.fail_test(1) if not_built: print("Cannot check all strings, the following have apparently not been built:") print("\t" + "\n\t".join(not_built)) test.no_result(1) test.pass_test() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/src/README.txt0000664000175000017500000002014713160023040015742 0ustar bdbaddogbdbaddog SCons - a software construction tool Version 3.0.0 This is SCons, a tool for building software (and other files). SCons is implemented in Python, and its "configuration files" are actually Python scripts, allowing you to use the full power of a real scripting language to solve build problems. You do not, however, need to know Python to use SCons effectively. See the RELEASE.txt file for notes about this specific release, including known problems. See the CHANGES.txt file for a list of changes since the previous release. LATEST VERSION ============== Before going further, you can check that this package you have is the latest version by checking the SCons download page at: http://www.scons.org/download.html EXECUTION REQUIREMENTS ====================== Running SCons requires Python version 2.7.*. Currently it does not run on the Python 3.x release. There should be no other dependencies or requirements to run SCons. (There is, however, an additional requirement to *install* SCons from this particular package; see the next section.) By default, SCons knows how to search for available programming tools on various systems--see the SCons man page for details. You may, of course, override the default SCons choices made by appropriate configuration of Environment construction variables. INSTALLATION REQUIREMENTS ========================= Nothing special. INSTALLATION ============ Assuming your system satisfies the installation requirements in the previous section, install SCons from this package simply by running the provided Python-standard setup script as follows: # python setup.py install By default, the above command will do the following: -- Install the version-numbered "scons-3.0.0" and "sconsign-3.0.0" scripts in the default system script directory (/usr/bin or C:\Python*\Scripts, for example). This can be disabled by specifying the "--no-version-script" option on the command line. -- Install scripts named "scons" and "sconsign" scripts in the default system script directory (/usr/bin or C:\Python*\Scripts, for example). This can be disabled by specifying the "--no-scons-script" option on the command line, which is useful if you want to install and experiment with a new version before making it the default on your system. On UNIX or Linux systems, you can have the "scons" and "sconsign" scripts be hard links or symbolic links to the "scons-3.0.0" and "sconsign-3.0.0" scripts by specifying the "--hardlink-scons" or "--symlink-scons" options on the command line. -- Install "scons-3.0.0.bat" and "scons.bat" wrapper scripts in the Python prefix directory on Windows (C:\Python*, for example). This can be disabled by specifying the "--no-install-bat" option on the command line. On UNIX or Linux systems, the "--install-bat" option may be specified to have "scons-3.0.0.bat" and "scons.bat" files installed in the default system script directory, which is useful if you want to install SCons in a shared file system directory that can be used to execute SCons from both UNIX/Linux and Windows systems. -- Install the SCons build engine (a Python module) in an appropriate version-numbered SCons library directory (/usr/lib/scons-3.0.0 or C:\Python*\scons-3.0.0, for example). See below for more options related to installing the build engine library. -- Install the troff-format man pages in an appropriate directory on UNIX or Linux systems (/usr/share/man/man1 or /usr/man/man1, for example). This can be disabled by specifying the "--no-install-man" option on the command line. The man pages can be installed on Windows systems by specifying the "--install-man" option on the command line. Note that, by default, SCons does not install its build engine library in the standard Python library directories. If you want to be able to use the SCons library modules (the build engine) in other Python scripts, specify the "--standard-lib" option on the command line, as follows: # python setup.py install --standard-lib This will install the build engine in the standard Python library directory (/usr/lib/python*/site-packages or C:\Python*\Lib\site-packages). Alternatively, you can have SCons install its build engine library in a hard-coded standalone library directory, instead of the default version-numbered directory, by specifying the "--standalone-lib" option on the command line, as follows: # python setup.py install --standalone-lib This is usually not recommended, however. Note that, to install SCons in any of the above system directories, you should have system installation privileges (that is, "root" or "Administrator") when running the setup.py script. If you don't have system installation privileges, you can use the --prefix option to specify an alternate installation location, such as your home directory: $ python setup.py install --prefix=$HOME This will install SCons in the appropriate locations relative to $HOME--that is, the scons script itself $HOME/bin and the associated library in $HOME/lib/scons, for example. DOCUMENTATION ============= See the RELEASE.txt file for notes about this specific release, including known problems. See the CHANGES.txt file for a list of changes since the previous release. The scons.1 man page is included in this package, and contains a section of small examples for getting started using SCons. Additional documentation for SCons is available at: http://www.scons.org/doc.html LICENSING ========= SCons is distributed under the MIT license, a full copy of which is available in the LICENSE.txt file. The MIT license is an approved Open Source license, which means: This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative. More information about OSI certifications and Open Source software is available at: http://www.opensource.org/ REPORTING BUGS ============== Please report bugs by following the detailed instructions on our Bug Submission page: http://scons.tigris.org/bug-submission.html You can also send mail to the SCons developers' mailing list: scons-dev@scons.org But even if you send email to the mailing list please make sure that you ALSO submit a bug report to the project page bug tracker, because bug reports in email often get overlooked in the general flood of messages. MAILING LISTS ============= An active mailing list for users of SCons is available. You may send questions or comments to the list at: scons-users@scons.org You may subscribe to the mailing list by sending email to: scons-users-join@scons.org There is also a low-volume mailing list available for announcements about SCons. Subscribe by sending email to: announce-subscribe@scons.tigris.org There are other mailing lists available for SCons developers, for notification of SCons code changes, and for notification of updated bug reports and project documents. Please see our mailing lists page for details. DONATIONS ========= If you find SCons helpful, please consider making a donation (of cash, software, or hardware) to support continued work on the project. Information is available at: http://www.scons.org/donate.html FOR MORE INFORMATION ==================== Check the SCons web site at: http://www.scons.org/ AUTHOR INFO =========== SCons was originally written by Steven Knight, knight at baldmt dot com. Since around 2010 it has been maintained by the SCons development team, co-managed by Bill Deegan and Gary Oberbrunner, with many contributors, including but not at all limited to: - Chad Austin - Dirk Baechle - Charles Crain - William Deegan - Steve Leblanc - Rob Managan - Greg Noel - Gary Oberbrunner - Anthony Roach - Greg Spencer - Tom Tanner - Anatoly Techtonik - Christoph Wiedemann - Russel Winder \... and many others. Copyright (c) 2001 - 2015 The SCons Foundation scons-src-3.0.0/bootstrap.py0000775000175000017500000001726313160023037016062 0ustar bdbaddogbdbaddog#!/usr/bin/env python # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # import os import os.path import sys import glob import subprocess import filecmp import shutil __doc__ = """bootstrap.py Execute SCons from this source tree. It copies Python scripts and modules from src/ subdirectory into a subdirectory named "bootstrap/" (by default), and executes SCons from there with the supplied command-line arguments. This is a minimal build of SCons to bootstrap the full build of all the packages, as specified in our local SConstruct file. Some options are specific to this bootstrap.py script and are *not* passed on to the SCons script. All of these begin with the string "bootstrap_": --bootstrap_dir=DIR Sets the name of the directory into which the SCons files will be copied. The default is "bootstrap" in the local subdirectory. --bootstrap_force Forces a copy of all necessary files. By default, the bootstrap.py script only updates the bootstrap copy if the content of the source copy is different. --bootstrap_src=DIR Searches for the SCons files relative to the specified DIR, then relative to the directory in which this bootstrap.py script is found. --bootstrap_update Only updates the bootstrap subdirectory, and then exits. In addition to the above, the bootstrap.py script understands the following SCons options: -C, --directory Changes to the specified directory before invoking SCons. Because we change directory right away to the specified directory, the SCons script itself doesn't need to, so this option gets "eaten" by the bootstrap.py script. """ def parseManifestLines(basedir, lines): """ Scans the single lines of a MANIFEST file, and returns the list of source files. Has basic support for recursive globs '**', filename wildcards of the form '*.xml' and comment lines, starting with a '#'. """ sources = [] basewd = os.path.abspath(basedir) for l in lines: if l.startswith('#'): # Skip comments continue l = l.rstrip('\n') if l.endswith('**'): # Glob all files recursively globwd = os.path.dirname(os.path.join(basewd, l)) for path, dirs, files in os.walk(globwd): for f in files: fpath = os.path.join(globwd, path, f) sources.append(os.path.relpath(fpath, basewd)) elif '*' in l: # Glob file pattern files = glob.glob(os.path.join(basewd, l)) for f in files: sources.append(os.path.relpath(f, basewd)) else: sources.append(l) return sources def main(): script_dir = os.path.abspath(os.path.dirname(__file__)) bootstrap_dir = os.path.join(script_dir, 'bootstrap') pass_through_args = [] update_only = None requires_an_argument = 'bootstrap.py: %s requires an argument\n' search = [script_dir] def find(file, search=search): for dir in search: f = os.path.join(dir, file) if os.path.exists(f): return os.path.normpath(f) sys.stderr.write("could not find `%s' in search path:\n" % file) sys.stderr.write("\t" + "\n\t".join(search) + "\n") sys.exit(2) def must_copy(dst, src): if not os.path.exists(dst): return 1 return not filecmp.cmp(dst,src) # Note: We don't use the getopt module to process the command-line # arguments because we'd have to teach it about all of the SCons options. command_line_args = sys.argv[1:] while command_line_args: arg = command_line_args.pop(0) if arg == '--bootstrap_dir': try: bootstrap_dir = command_line_args.pop(0) except IndexError: sys.stderr.write(requires_an_argument % arg) sys.exit(1) elif arg[:16] == '--bootstrap_dir=': bootstrap_dir = arg[16:] elif arg == '--bootstrap_force': def must_copy(dst, src): return 1 elif arg == '--bootstrap_src': try: search.insert(0, command_line_args.pop(0)) except IndexError: sys.stderr.write(requires_an_argument % arg) sys.exit(1) elif arg[:16] == '--bootstrap_src=': search.insert(0, arg[16:]) elif arg == '--bootstrap_update': update_only = 1 elif arg in ('-C', '--directory'): try: dir = command_line_args.pop(0) except IndexError: sys.stderr.write(requires_an_argument % arg) sys.exit(1) else: os.chdir(dir) elif arg[:2] == '-C': os.chdir(arg[2:]) elif arg[:12] == '--directory=': os.chdir(arg[12:]) else: pass_through_args.append(arg) scons_py = os.path.join('src', 'script', 'scons.py') src_engine = os.path.join('src', 'engine') MANIFEST_in = find(os.path.join(src_engine, 'MANIFEST.in')) MANIFEST_xml_in = find(os.path.join(src_engine, 'MANIFEST-xml.in')) manifest_files = [os.path.join(src_engine, x) for x in parseManifestLines(os.path.join(script_dir, src_engine), open(MANIFEST_in).readlines())] manifest_xml_files = [os.path.join(src_engine, x) for x in parseManifestLines(os.path.join(script_dir, src_engine), open(MANIFEST_xml_in).readlines())] files = [ scons_py ] + manifest_files + manifest_xml_files for file in files: src = find(file) dst = os.path.join(bootstrap_dir, file) if must_copy(dst, src): dir = os.path.split(dst)[0] if not os.path.isdir(dir): os.makedirs(dir) try: os.unlink(dst) except: pass shutil.copyfile(src,dst) if update_only: sys.exit(0) args = [ sys.executable, os.path.join(bootstrap_dir, scons_py) ] + pass_through_args sys.stdout.write(" ".join(args) + '\n') sys.stdout.flush() os.environ['SCONS_LIB_DIR'] = os.path.join(bootstrap_dir, src_engine) sys.exit(subprocess.Popen(args, env=os.environ).wait()) if __name__ == "__main__": main() # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4: scons-src-3.0.0/doc/0000775000175000017500000000000013160023040014216 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/MANIFEST0000664000175000017500000000001213160023037015346 0ustar bdbaddogbdbaddogscons.mod scons-src-3.0.0/doc/man/0000775000175000017500000000000013160023040014771 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/man/MANIFEST0000664000175000017500000000044713160023040016127 0ustar bdbaddogbdbaddog# We don't use a wildcard for the XML files # here, because it would pull in the created # ones as well... scons.xml sconsign.xml scons-time.xml *.xsl *.css SConstruct cover.jpg titlepage/bricks.jpg titlepage/mapnik_final_colors.svg titlepage/SCons_path.svg titlepage/SConsBuildBricks_path.svg scons-src-3.0.0/doc/man/html.xsl0000664000175000017500000000415113160023040016466 0ustar bdbaddogbdbaddog /appendix toc,title article/appendix nop /article toc,title book toc,title,figure,table,example,equation /chapter toc,title part toc,title /preface toc,title reference title /sect1 toc /sect2 toc /sect3 toc /sect4 toc /sect5 toc /section toc set toc,title scons-src-3.0.0/doc/man/epub.xsl0000664000175000017500000000270513160023040016460 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/man/scons-time.xml0000664000175000017500000012217113160023040017600 0ustar bdbaddogbdbaddog SCONS-TIME 1 SCons 3.0.0 SCons 3.0.0 scons-time generate and display SCons timing information scons-time subcommand options arguments Generating Timing Information scons-time run [] [PROJECT] [FILE] [NUMBER] [OUTDIR] [STRING] [PYTHON] [DIR] [SCONS] [URL] [ARGUMENTS] Extracting Function Timings scons-time func [] [DIR] [FILE] [FORMAT] [NAME] [STRING] [NUMBER] [] [ARGUMENTS] Extracting Memory Statistics scons-time mem [] [DIR] [FILE] [FORMAT] [STRING] [STAGE] [NUMBER] [TITLE] [ARGUMENTS] Extracting Object Counts scons-time obj [] [DIR] [FILE] [FORMAT] [STRING] [STAGE] [NUMBER] [TITLE] [ARGUMENTS] Extracting Execution Times scons-time time [] [DIR] [FILE] [FORMAT] [STRING] [NUMBER] [TITLE] [WHICH] [ARGUMENTS] Help Text scons-time help SUBCOMMAND [...] DESCRIPTION The scons-time command runs an SCons configuration through a standard set of profiled timings and can extract and graph information from the resulting profiles and log files of those timings. The action to be performed by the scons-time script is specified by a subcommand, the first argument on the command line. See the SUBCOMMANDS section below for information about the operation of specific subcommands. The basic way to use scons-time is to run the scons-time run subcommand (possibly multiple times) to generate profile and log file output, and then use one of the other subcommands to display the results captured in the profiles and log files for a particular kind of information: function timings (the scons-time func subcommand), total memory used (the scons-time mem subcommand), object counts (the scons-time obj subcommand) and overall execution time (the scons-time time subcommand). Options exist to place and find the profiles and log files in separate directories, to generate the output in a format suitable for graphing with the gnuplot1 program, and so on. There are two basic ways the scons-time run subcommand is intended to be used to gather timing statistics for a configuration. One is to use the option to test a configuration against a list of revisions from the SCons Subversion repository. This will generate a profile and timing log file for every revision listed with the option, and can be used to look at the impact of committed changes to the SCons code base on a particular configuration over time. The other way is to profile incremental changes to a local SCons code base during a development cycle--that is, to look at the performance impact of changes you're making in the local tree. In this mode, you run the scons-time run subcommand without the option, in which case it simply looks in the profile/log file output directory (the current directory by default) and automatically figures out the next run number for the output profile and log file. Used in this way, the development cycle goes something like: make a change to SCons; run scons-time run to profile it against a specific configuration; make another change to SCons; run scons-time run again to profile it; etc. OPTIONS The scons-time command only supports a few global options: -h, --help Displays the global help text and exits, identical to the scons-time help subcommand. -V, --version Displays the scons-time version and exits. Most functionality is controlled by options to the individual subcommands. See the next section for information about individual subcommand options. SUBCOMMANDS The scons-time command supports the following individual subcommands. The func Subcommand scons-time func [] [DIR] [FILE] [FORMAT] [NAME] [STRING] [NUMBER] [] [ARGUMENTS] The scons-time func subcommand displays timing information for a specific Python function within SCons. By default, it extracts information about the _main() function, which includes the Python profiler timing for all of SCons. The scons-time func subcommand extracts function timing information from all the specified file arguments, which should be Python profiler output files. (Normally, these would be *.prof files generated by the scons-time run subcommand, but they can actually be generated by any Python profiler invocation.) All file name arguments will be globbed for on-disk files. If no arguments are specified, then function timing information will be extracted from all *.prof files, or the subset of them with a prefix specified by the option. Options include: -C DIRECTORY, --chdir=DIRECTORY Changes to the specified DIRECTORY before looking for the specified files (or files that match the specified patterns). -f FILE, --file=FILE Reads configuration information from the specified FILE. -fmt=FORMAT, --format=FORMAT Reports the output in the specified FORMAT. The formats currently supported are ascii (the default) and gnuplot. --func=NAME Extracts timings for the specified function NAME. The default is to report cumulative timings for the _main() function, which contains the entire SCons run. -h, --help Displays help text for the scons-time func subcommand. -p STRING, --prefix=STRING Specifies the prefix string for profiles from which to extract function timing information. This will be used to search for profiles if no arguments are specified on the command line. -t NUMBER, --tail=NUMBER Only extracts function timings from the last NUMBER files. The help Subcommand scons-time help SUBCOMMAND [...] The help subcommand prints help text for any other subcommands listed as later arguments on the command line. The mem Subcommand scons-time mem [] [DIR] [FILE] [FORMAT] [STRING] [STAGE] [NUMBER] [TITLE] [ARGUMENTS] The scons-time mem subcommand displays how much memory SCons uses. The scons-time mem subcommand extracts memory use information from all the specified file arguments, which should be files containing output from running SCons with the option. (Normally, these would be *.log files generated by the scons-time run subcommand.) All file name arguments will be globbed for on-disk files. If no arguments are specified, then memory information will be extracted from all *.log files, or the subset of them with a prefix specified by the option. -C DIR, --chdir=DIR Changes to the specified DIRECTORY before looking for the specified files (or files that match the specified patterns). -f FILE, --file=FILE Reads configuration information from the specified FILE. -fmt=FORMAT, --format=FORMAT Reports the output in the specified FORMAT. The formats currently supported are ascii (the default) and gnuplot. -h, --help Displays help text for the scons-time mem subcommand. -p STRING, --prefix=STRING Specifies the prefix string for log files from which to extract memory usage information. This will be used to search for log files if no arguments are specified on the command line. --stage=STAGE Prints the memory used at the end of the specified STAGE: pre-read (before the SConscript files are read), post-read , (after the SConscript files are read), pre-build (before any targets are built) or post-build (after any targets are built). If no option is specified, the default behavior is post-build, which reports the final amount of memory used by SCons during each run. -t NUMBER, --tail=NUMBER Only reports memory statistics from the last NUMBER files. The obj Subcommand scons-time obj [] [DIR] [FILE] [FORMAT] [STRING] [STAGE] [NUMBER] [TITLE] [ARGUMENTS] The scons-time obj subcommand displays how many objects of a specific named type are created by SCons. The scons-time obj subcommand extracts object counts from all the specified file arguments, which should be files containing output from running SCons with the option. (Normally, these would be *.log files generated by the scons-time run subcommand.) All file name arguments will be globbed for on-disk files. If no arguments are specified, then object counts will be extracted from all *.log files, or the subset of them with a prefix specified by the option. -C DIR, --chdir=DIR Changes to the specified DIRECTORY before looking for the specified files (or files that match the specified patterns). -f FILE, --file=FILE Reads configuration information from the specified FILE. -fmt=FORMAT, --format=FORMAT Reports the output in the specified FORMAT. The formats currently supported are ascii (the default) and gnuplot. -h, --help Displays help text for the scons-time obj subcommand. -p STRING, --prefix=STRING Specifies the prefix string for log files from which to extract object counts. This will be used to search for log files if no arguments are specified on the command line. --stage=STAGE Prints the object count at the end of the specified STAGE: pre-read (before the SConscript files are read), post-read , (after the SConscript files are read), pre-build (before any targets are built) or post-build (after any targets are built). If no option is specified, the default behavior is post-build, which reports the final object count during each run. -t NUMBER, --tail=NUMBER Only reports object counts from the last NUMBER files. The run Subcommand scons-time run [] [PROJECT] [FILE] [NUMBER] [OUTDIR] [STRING] [PYTHON] [DIR] [SCONS] [URL] [ARGUMENTS] The scons-time run subcommand is the basic subcommand for profiling a specific configuration against a version of SCons. The configuration to be tested is specified as a list of files or directories that will be unpacked or copied into a temporary directory in which SCons will be invoked. The scons-time run subcommand understands file suffixes like .tar, .tar.gz, .tgz and .zip and will unpack their contents into a temporary directory. If more than one argument is specified, each one will be unpacked or copied into the temporary directory "on top of" the previous archives or directories, so the expectation is that multiple specified archives share the same directory layout. Once the file or directory arguments are unpacked or copied to the temporary directory, the scons-time run subcommand runs the requested version of SCons against the configuration three times: Startup SCons is run with the option so that just the SConscript files are read, and then the default help text is printed. This profiles just the perceived "overhead" of starting up SCons and processing the SConscript files. Full build SCons is run to build everything specified in the configuration. Specific targets to be passed in on the command l ine may be specified by the targets keyword in a configuration file; see below for details. Rebuild SCons is run again on the same just-built directory. If the dependencies in the SCons configuration are correct, this should be an up-to-date, "do nothing" rebuild. Each invocation captures the output log file and a profile. The scons-time run subcommand supports the following options: --aegis=PROJECT Specifies the Aegis PROJECT from which the version(s) of scons being timed will be extracted. When is specified, the NUMBER option specifies delta numbers that will be tested. Output from each invocation run will be placed in file names that match the Aegis delta numbers. If the option is not specified, then the default behavior is to time the tip of the specified PROJECT. -f FILE, --file=FILE Reads configuration information from the specified FILE. This often provides a more convenient way to specify and collect parameters associated with a specific timing configuration than specifying them on the command line. See the CONFIGURATION FILE section below for information about the configuration file parameters. -h, --help Displays help text for the scons-time run subcommand. -n, --no-exec Do not execute commands, just printing the command-line equivalents of what would be executed. Note that the scons-time script actually executes its actions in Python, where possible, for portability. The commands displayed are UNIX equivalents of what it's doing. --number=NUMBER Specifies the run number to be used in the names of the log files and profile outputs generated by this run. When used in conjunction with the PROJECT option, NUMBER specifies one or more comma-separated Aegis delta numbers that will be retrieved automatically from the specified Aegis PROJECT. When used in conjunction with the URL option, NUMBER specifies one or more comma-separated Subversion revision numbers that will be retrieved automatically from the Subversion repository at the specified URL. Ranges of delta or revision numbers may be specified be separating two numbers with a hyphen (-). Example: % scons-time run --svn=http://scons.tigris.org/svn/trunk --num=1247,1249-1252 . -p STRING, --prefix=STRING Specifies the prefix string to be used for all of the log files and profiles generated by this run. The default is derived from the first specified argument: if the first argument is a directory, the default prefix is the name of the directory; if the first argument is an archive (tar or zip file), the default prefix is the the base name of the archive, that is, what remains after stripping the archive suffix (.tgz, .tar.gz or .zip). --python=PYTHON Specifies a path to the Python executable to be used for the timing runs. The default is to use the same Python executable that is running the scons-time command itself. -q, --quiet Suppresses display of the command lines being executed. -s DIR, --subdir=DIR Specifies the name of directory or subdirectory from which the commands should be executed. The default is XXX --scons=SCONS Specifies a path to the SCons script to be used for the timing runs. The default is XXX --svn=URL, --subversion=URL Specifies the URL of the Subversion repository from which the version(s) of scons being timed will be extracted. When is specified, the NUMBER option specifies revision numbers that will be tested. Output from each invocation run will be placed in file names that match the Subversion revision numbers. If the option is not specified, then the default behavior is to time the HEAD of the specified URL. -v, --verbose Displays the output from individual commands to the screen (in addition to capturing the output in log files). The time Subcommand scons-time time [] [DIR] [FILE] [FORMAT] [STRING] [NUMBER] [TITLE] [WHICH] [ARGUMENTS] The scons-time time subcommand displays SCons execution times as reported by the scons --debug=time option. The scons-time time subcommand extracts SCons timing from all the specified file arguments, which should be files containing output from running SCons with the option. (Normally, these would be *.log files generated by the scons-time run subcommand.) All file name arguments will be globbed for on-disk files. If no arguments are specified, then execution timings will be extracted from all *.log files, or the subset of them with a prefix specified by the option. -C DIR, --chdir=DIR Changes to the specified DIRECTORY before looking for the specified files (or files that match the specified patterns). -f FILE, --file=FILE Reads configuration information from the specified FILE. -fmt=FORMAT, --format=FORMAT Reports the output in the specified FORMAT. The formats currently supported are ascii (the default) and gnuplot. -h, --help Displays help text for the scons-time time subcommand. -p STRING, --prefix=STRING Specifies the prefix string for log files from which to extract execution timings. This will be used to search for log files if no arguments are specified on the command line. -t NUMBER, --tail=NUMBER Only reports object counts from the last NUMBER files. --which=WHICH Prints the execution time for the specified WHICH value: total (the total execution time), SConscripts (total execution time for the SConscript files themselves), SCons (exectuion time in SCons code itself) or commands (execution time of the commands and other actions used to build targets). If no option is specified, the default behavior is total, which reports the total execution time for each run. CONFIGURATION FILE Various scons-time subcommands can read information from a specified configuration file when passed the or options. The configuration file is actually executed as a Python script. Setting Python variables in the configuration file controls the behavior of the scons-time script more conveniently than having to specify command-line options or arguments for every run, and provides a handy way to "shrink-wrap" the necessary information for producing (and reporting) consistent timing runs for a given configuration. aegis The Aegis executable for extracting deltas. The default is simply aegis. aegis_project The Aegis project from which deltas should be extracted. The default is whatever is specified with the command-line option. archive_list A list of archives (files or directories) that will be copied to the temporary directory in which SCons will be invoked. .tar, .tar.gz, .tgz and .zip files will have their contents unpacked in the temporary directory. Directory trees and files will be copied as-is. initial_commands A list of commands that will be executed before the actual timed scons runs. This can be used for commands that are necessary to prepare the source tree-for example, creating a configuration file that should not be part of the timed run. key_location The location of the key on Gnuplot graphing information generated with the option. The default is bottom left. prefix The file name prefix to be used when running or extracting timing for this configuration. python The path name of the Python executable to be used when running or extracting information for this configuration. The default is the same version of Python used to run the SCons scons The path name of the SCons script to be used when running or extracting information for this configuration. The default is simply scons. scons_flags The scons flags used when running SCons to collect timing information. The default value is . scons_lib_dir scons_wrapper startup_targets subdir The subdirectory of the project into which the scons-time script should change before executing the SCons commands to time. subversion_url The Subversion URL from svn The subversion executable used to check out revisions of SCons to be timed. The default is simple svn. svn_co_flag tar targets A string containing the targets that should be added to the command line of every timed scons run. This can be used to restrict what's being timed to a subset of the full build for the configuration. targets0 targets1 targets2 title unzip verbose vertical_bars Example Here is an example scons-time configuration file for a hypothetical sample project: # The project doesn't use SCons natively (yet), so we're # timing a separate set of SConscript files that we lay # on top of the vanilla unpacked project tarball. arguments = ['project-1.2.tgz', 'project-SConscripts.tar'] # The subdirectory name contains the project version number, # so tell scons-time to chdir there before building. subdir = 'project-1.2' # Set the prefix so output log files and profiles are named: # project-000-[012].{log,prof} # project-001-[012].{log,prof} # etc. prefix = 'project' # The SConscript files being tested don't do any SConf # configuration, so run their normal ./configure script # before we invoke SCons. initial_commands = [ './configure', ] # Only time building the bin/project executable. targets = 'bin/project' # Time against SCons revisions of the branches/core branch subversion_url = 'http://scons.tigris.org/svn/scons/branches/core' ENVIRONMENT The scons-time script uses the following environment variables: PRESERVE If this value is set, the scons-time script will not remove the temporary directory or directories in which it builds the specified configuration or downloads a specific version of SCons. SEE ALSO gnuplot1, scons1 AUTHORS Steven Knight <knight at baldmt dot com> scons-src-3.0.0/doc/man/scons_title.xsl0000664000175000017500000111600513160023040020053 0ustar bdbaddogbdbaddog 1 1 1 1 200mm 205.9mm 190mm 195.9mm 180mm 185.9mm 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 scons-titlepage-first scons-titlepage-odd scons-titlepage-even scons-chapter-first scons-chapter-odd scons-chapter-even scons-titlepage-first-draft fixed no-repeat center center scons-titlepage-odd-draft fixed no-repeat center center scons-titlepage-even-draft fixed no-repeat center center scons-chapter-first-draft fixed no-repeat center center scons-chapter-odd-draft fixed no-repeat center center scons-chapter-even-draft fixed no-repeat center center scons-titlepage-even scons-titlepage-odd body-even-draft body-odd-draft scons-chapter-even scons-chapter-odd scons-chapter-even-draft scons-chapter-odd-draft bold #C51410 always center after 0pt 0pt 24pt #C51410 bold always left after 0pt 0pt 0.7em 6 5 4 3 2 1 0pt 1 1 3 3 3 1 proportional-column-width( header ) proportional-column-width( header ) proportional-column-width( header ) baseline baseline baseline 0pt 1 1 3 3 3 1 proportional-column-width( footer ) proportional-column-width( footer ) proportional-column-width( footer ) baseline baseline baseline 0.5pt solid #C51410 0.5pt solid #C51410 1 0 1 1 0 1 scons-src-3.0.0/doc/man/pdf.xsl0000664000175000017500000000532413160023040016276 0ustar bdbaddogbdbaddog 0pt /appendix toc,title article/appendix nop /article toc,title book toc,title,figure,table,example,equation /chapter toc,title part toc,title /preface toc,title reference toc,title /sect1 toc /sect2 toc /sect3 toc /sect4 toc /sect5 toc /section toc set toc,title bold scons-src-3.0.0/doc/man/sconsign.xml0000664000175000017500000001612413160023040017342 0ustar bdbaddogbdbaddog SCONSIGN 1 SCons 3.0.0 SCons 3.0.0 sconsign print SCons .sconsign file information sconsign options file ... DESCRIPTION The sconsign command displays the contents of one or more .sconsign files specified by the user. By default, sconsign dumps the entire contents of the specified file(s). Each entry is printed in the following format: file: signature timestamp length implicit_dependency_1: signature timestamp length implicit_dependency_2: signature timestamp length action_signature [action string] None is printed in place of any missing timestamp, bsig, or csig values for any entry or any of its dependencies. If the entry has no implicit dependencies, or no build action, the lines are simply omitted. By default, sconsign assumes that any file arguments that end with a .dbm suffix contains signature entries for more than one directory (that is, was specified by the SConsignFile () function). Any file argument that does not end in .dbm is assumed to be a traditional .sconsign file containing the signature entries for a single directory. An explicit format may be specified using the or options. OPTIONS Various options control what information is printed and the format: -a, --act, --action Prints the build action information for all entries or the specified entries. -c, --csig Prints the content signature (csig) information for all entries or the specified entries. -d DIRECTORY, --dir=DIRECTORY When the signatures are being read from a .dbm file, or the or options are used, prints information about only the signatures for entries in the specified DIRECTORY. -e ENTRY, --entry=ENTRY Prints information about only the specified ENTRY. Multiple -e options may be used, in which case information about each ENTRY is printed in the order in which the options are specified on the command line. -f FORMAT, --format=FORMAT The file(s) to be printed are in the specified FORMAT. Legal values are dbm (the DBM format used when the SConsignFile() function is used) or sconsign (the default format used for an individual .sconsign file in each directory). -h, --help Prints a help message and exits. -i, --implicit Prints the list of cached implicit dependencies for all entries or the the specified entries. --raw Prints a pretty-printed representation of the raw Python dictionary that holds build information about individual entry (both the entry itself or its implicit dependencies). An entry's build action is still printed in its usual format. -r, --readable Prints timestamps in a human-readable string, enclosed in single quotes. -t, --timestamp Prints the timestamp information for all entries or the specified entries. -v, --verbose Prints labels identifying each field being printed. ENVIRONMENT SCONS_LIB_DIR Specifies the directory that contains the SCons Python module directory (e.g. /home/aroach/scons-src-0.01/src/engine). on the command line. SEE ALSO scons, scons User Manual, scons Design Document, scons source code. AUTHORS Steven Knight <knight at baldmt dot com> scons-src-3.0.0/doc/man/SConstruct0000664000175000017500000000473113160023040017030 0ustar bdbaddogbdbaddog# # SConstruct file for building SCons documentation. # # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import os env = Environment(ENV={'PATH' : os.environ['PATH']}, tools=['docbook','gs','zip'], toolpath=['../../src/engine/SCons/Tool'], DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') has_pdf = False if (env.WhereIs('fop') or env.WhereIs('xep')): has_pdf = True # Helper function, combining all the steps for a single target def createManPages(env, target): env.DocbookXInclude('%s_xi.xml' % target, '%s.xml' % target) env.DocbookXslt('%s_db.xml' % target, '%s_xi.xml' % target, xsl='../xslt/to_docbook.xslt') env.DocbookHtml('scons-%s.html' % target,'%s_db.xml' % target) env.DocbookMan('%s.1' % target, '%s_db.xml' % target) if has_pdf: env.DocbookPdf('scons-%s.pdf' % target,'%s_db.xml' % target) # # Create MAN pages # createManPages(env, "scons") createManPages(env, "sconsign") createManPages(env, "scons-time") has_gs = False if env.WhereIs('gs'): has_gs = True # # Create the EPUB format # if has_gs and has_pdf: jpg = env.Gs('OEBPS/cover.jpg','scons-scons.pdf', GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -dJPEGQ=100 -r72x72 -q') epub = env.DocbookEpub('scons-man.epub', 'scons_db.xml', xsl='epub.xsl') env.Depends(epub, jpg) scons-src-3.0.0/doc/man/cover.jpg0000664000175000017500000000046213157757627016652 0ustar bdbaddogbdbaddogÿØÿàJFIFHHÿþCreated with GIMPÿÛCÿÛCÿÀ "ÿÄ ÿÄÿÄÿÄÿÚ ?¿€ÿÙscons-src-3.0.0/doc/man/scons.xml0000664000175000017500000064715013160023040016655 0ustar bdbaddogbdbaddog %version; %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> SCons &buildversion; MAN page Steven Knight Steven Knight and the SCons Development Team 2004 - 2016 2004 - 2016 The SCons Foundation version &buildversion; SCons &buildversion; MAN page SCONS 1 SCons 3.0.0 SCons 3.0.0 scons a software construction tool scons options name=val targets DESCRIPTION The scons utility builds software (or other files) by determining which component pieces must be rebuilt and executing the necessary commands to rebuild them. By default, scons searches for a file named SConstruct, Sconstruct, or sconstruct (in that order) in the current directory and reads its configuration from the first file found. An alternate file name may be specified via the option. The SConstruct file can specify subsidiary configuration files using the SConscript() function. By convention, these subsidiary files are named SConscript, although any name may be used. (Because of this naming convention, the term "SConscript files" is sometimes used to refer generically to all scons configuration files, regardless of actual file name.) The configuration files specify the target files to be built, and (optionally) the rules to build those targets. Reasonable default rules exist for building common software components (executable programs, object files, libraries), so that for most software projects, only the target and input files need be specified. Before reading the SConstruct file, scons looks for a directory named site_scons in various system directories (see below) and the directory containing the SConstruct file; for each of those dirs which exists, site_scons is prepended to sys.path, the file site_scons/site_init.py, is evaluated if it exists, and the directory site_scons/site_tools is prepended to the default toolpath if it exists. See the and options for more details. scons reads and executes the SConscript files as Python scripts, so you may use normal Python scripting capabilities (such as flow control, data manipulation, and imported Python libraries) to handle complicated build situations. scons, however, reads and executes all of the SConscript files before it begins building any targets. To make this obvious, scons prints the following messages about what it is doing: $ scons foo.out scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... cp foo.in foo.out scons: done building targets. $ The status messages (everything except the line that reads "cp foo.in foo.out") may be suppressed using the option. scons does not automatically propagate the external environment used to execute scons to the commands used to build target files. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time scons is invoked. This also means that if the compiler or other commands that you want to use to build your target files are not in standard system locations, scons will not find them unless you explicitly set the PATH to include those locations. Whenever you create an scons construction environment, you can propagate the value of PATH from your external environment as follows: import os env = Environment(ENV = {'PATH' : os.environ['PATH']}) Similarly, if the commands use external environment variables like $PATH, $HOME, $JAVA_HOME, $LANG, $SHELL, $TERM, etc., these variables can also be explicitly propagated: import os env = Environment(ENV = {'PATH' : os.environ['PATH'], 'HOME' : os.environ['HOME']}) Or you may explicitly propagate the invoking user's complete external environment: import os env = Environment(ENV = os.environ) This comes at the expense of making your build dependent on the user's environment being set correctly, but it may be more convenient for many configurations. scons can scan known input files automatically for dependency information (for example, #include statements in C or C++ files) and will rebuild dependent files appropriately whenever any "included" input file changes. scons supports the ability to define new scanners for unknown input file types. scons knows how to fetch files automatically from SCCS or RCS subdirectories using SCCS, RCS or BitKeeper. scons is normally executed in a top-level directory containing a SConstruct file, optionally specifying as command-line arguments the target file or files to be built. By default, the command scons will build all target files in or below the current directory. Explicit default targets (to be built when no targets are specified on the command line) may be defined the SConscript file(s) using the Default() function, described below. Even when Default() targets are specified in the SConscript file(s), all target files in or below the current directory may be built by explicitly specifying the current directory (.) as a command-line target: scons . Building all target files, including any files outside of the current directory, may be specified by supplying a command-line target of the root directory (on POSIX systems): scons / or the path name(s) of the volume(s) in which all the targets should be built (on Windows systems): scons C:\ D:\ To build only specific targets, supply them as command-line arguments: scons foo bar in which case only the specified targets will be built (along with any derived files on which they depend). Specifying "cleanup" targets in SConscript files is not usually necessary. The flag removes all files necessary to build the specified target: scons -c . to remove all target files, or: scons -c build export to remove target files under build and export. Additional files or directories to remove can be specified using the Clean() function. Conversely, targets that would normally be removed by the invocation can be prevented from being removed by using the NoClean() function. A subset of a hierarchical tree may be built by remaining at the top-level directory (where the SConstruct file lives) and specifying the subdirectory as the target to be built: scons src/subdir or by changing directory and invoking scons with the option, which traverses up the directory hierarchy until it finds the SConstruct file, and then builds targets relatively to the current subdirectory: cd src/subdir scons -u . scons supports building multiple targets in parallel via a option that takes, as its argument, the number of simultaneous tasks that may be spawned: scons -j 4 builds four targets in parallel, for example. scons can maintain a cache of target (derived) files that can be shared between multiple builds. When caching is enabled in a SConscript file, any target files built by scons will be copied to the cache. If an up-to-date target file is found in the cache, it will be retrieved from the cache instead of being rebuilt locally. Caching behavior may be disabled and controlled in other ways by the , , , and command-line options. The option is useful to prevent multiple builds from trying to update the cache simultaneously. Values of variables to be passed to the SConscript file(s) may be specified on the command line: scons debug=1 . These variables are available in SConscript files through the ARGUMENTS dictionary, and can be used in the SConscript file(s) to modify the build in any way: if ARGUMENTS.get('debug', 0): env = Environment(CCFLAGS = '-g') else: env = Environment() The command-line variable arguments are also available in the ARGLIST list, indexed by their order on the command line. This allows you to process them in order rather than by name, if necessary. ARGLIST[0] returns a tuple containing (argname, argvalue). A Python exception is thrown if you try to access a list member that does not exist. scons requires Python version 2.7 or later. There should be no other dependencies or requirements to run scons. By default, scons knows how to search for available programming tools on various systems. On Windows systems, scons searches in order for the Microsoft Visual C++ tools, the MinGW tool chain, the Intel compiler tools, and the PharLap ETS compiler. On OS/2 systems, scons searches in order for the OS/2 compiler, the GCC tool chain, and the Microsoft Visual C++ tools, On SGI IRIX, IBM AIX, Hewlett Packard HP-UX, and Sun Solaris systems, scons searches for the native compiler tools (MIPSpro, Visual Age, aCC, and Forte tools respectively) and the GCC tool chain. On all other platforms, including POSIX (Linux and UNIX) platforms, scons searches in order for the GCC tool chain, the Microsoft Visual C++ tools, and the Intel compiler tools. You may, of course, override these default values by appropriate configuration of Environment construction variables. OPTIONS In general, scons supports the same command-line options as GNU make, and many of those supported by cons. -b Ignored for compatibility with non-GNU versions of make. -c, --clean, --remove Clean up by removing all target files for which a construction command is specified. Also remove any files or directories associated to the construction command using the Clean() function. Will not remove any targets specified by the NoClean() function. --cache-debug=file Print debug information about the CacheDir() derived-file caching to the specified file. If file is - (a hyphen), the debug information are printed to the standard output. The printed messages describe what signature file names are being looked for in, retrieved from, or written to the CacheDir() directory tree. --cache-disable, --no-cache Disable the derived-file caching specified by CacheDir(). scons will neither retrieve files from the cache nor copy files to the cache. --cache-force, --cache-populate When using CacheDir(), populate a cache by copying any already-existing, up-to-date derived files to the cache, in addition to files built by this invocation. This is useful to populate a new cache with all the current derived files, or to add to the cache any derived files recently built with caching disabled via the option. --cache-readonly Use the cache (if enabled) for reading, but do not not update the cache with changed files. --cache-show When using CacheDir() and retrieving a derived file from the cache, show the command that would have been executed to build the file, instead of the usual report, "Retrieved `file' from cache." This will produce consistent output for build logs, regardless of whether a target file was rebuilt or retrieved from the cache. --config=mode This specifies how the Configure call should use or generate the results of configuration tests. The option should be specified from among the following choices: --config=auto scons will use its normal dependency mechanisms to decide if a test must be rebuilt or not. This saves time by not running the same configuration tests every time you invoke scons, but will overlook changes in system header files or external commands (such as compilers) if you don't specify those dependecies explicitly. This is the default behavior. --config=force If this option is specified, all configuration tests will be re-run regardless of whether the cached results are out of date. This can be used to explicitly force the configuration tests to be updated in response to an otherwise unconfigured change in a system header file or compiler. --config=cache If this option is specified, no configuration tests will be rerun and all results will be taken from cache. Note that scons will still consider it an error if --config=cache is specified and a necessary test does not yet have any results in the cache. -C directory, --directory=directory Change to the specified directory before searching for the SConstruct, Sconstruct, or sconstruct file, or doing anything else. Multiple options are interpreted relative to the previous one, and the right-most option wins. (This option is nearly equivalent to , except that it will search for SConstruct, Sconstruct, or sconstruct in the specified directory.) -D Works exactly the same way as the option except for the way default targets are handled. When this option is used and no targets are specified on the command line, all default targets are built, whether or not they are below the current directory. --debug=type Debug the build process. type[,type...] specifies what type of debugging. Multiple types may be specified, separated by commas. The following types are valid: --debug=count Print how many objects are created of the various classes used internally by SCons before and after reading the SConscript files and before and after building targets. This is not supported when SCons is executed with the Python (optimized) option or when the SCons modules have been compiled with optimization (that is, when executing from *.pyo files). --debug=duplicate Print a line for each unlink/relink (or copy) of a variant file from its source file. Includes debugging info for unlinking stale variant files, as well as unlinking old targets before building them. --debug=dtree A synonym for the newer option. This will be deprecated in some future release and ultimately removed. --debug=explain Print an explanation of precisely why scons is deciding to (re-)build any targets. (Note: this does not print anything for targets that are not rebuilt.) --debug=findlibs Instruct the scanner that searches for libraries to print a message about each potential library name it is searching for, and about the actual libraries it finds. --debug=includes Print the include tree after each top-level target is built. This is generally used to find out what files are included by the sources of a given derived file: $ scons --debug=includes foo.o --debug=memoizer Prints a summary of hits and misses using the Memoizer, an internal subsystem that counts how often SCons uses cached values in memory instead of recomputing them each time they're needed. --debug=memory Prints how much memory SCons uses before and after reading the SConscript files and before and after building targets. --debug=nomemoizer A deprecated option preserved for backwards compatibility. --debug=objects Prints a list of the various objects of the various classes used internally by SCons. --debug=pdb Re-run SCons under the control of the pdb Python debugger. --debug=prepare Print a line each time any target (internal or external) is prepared for building. scons prints this for each target it considers, even if that target is up to date (see also --debug=explain). This can help debug problems with targets that aren't being built; it shows whether scons is at least considering them or not. --debug=presub Print the raw command line used to build each target before the construction environment variables are substituted. Also shows which targets are being built by this command. Output looks something like this: $ scons --debug=presub Building myprog.o with action(s): $SHCC $SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES ... --debug=stacktrace Prints an internal Python stack trace when encountering an otherwise unexplained error. --debug=stree A synonym for the newer option. This will be deprecated in some future release and ultimately removed. --debug=time Prints various time profiling information: the time spent executing each individual build command; the total build time (time SCons ran from beginning to end); the total time spent reading and executing SConscript files; the total time spent SCons itself spend running (that is, not counting reading and executing SConscript files); and both the total time spent executing all build commands and the elapsed wall-clock time spent executing those build commands. (When scons is executed without the option, the elapsed wall-clock time will typically be slightly longer than the total time spent executing all the build commands, due to the SCons processing that takes place in between executing each command. When scons is executed with the option, and your build configuration allows good parallelization, the elapsed wall-clock time should be significantly smaller than the total time spent executing all the build commands, since multiple build commands and intervening SCons processing should take place in parallel.) --debug=tree A synonym for the newer option. This will be deprecated in some future release and ultimately removed. --diskcheck=types Enable specific checks for whether or not there is a file on disk where the SCons configuration expects a directory (or vice versa), and whether or not RCS or SCCS sources exist when searching for source and include files. The types argument can be set to: all, to enable all checks explicitly (the default behavior); none, to disable all such checks; match, to check that files and directories on disk match SCons' expected configuration; rcs, to check for the existence of an RCS source for any missing source or include files; sccs, to check for the existence of an SCCS source for any missing source or include files. Multiple checks can be specified separated by commas; for example, would still check for SCCS and RCS sources, but disable the check for on-disk matches of files and directories. Disabling some or all of these checks can provide a performance boost for large configurations, or when the configuration will check for files and/or directories across networked or shared file systems, at the slight increased risk of an incorrect build or of not handling errors gracefully (if include files really should be found in SCCS or RCS, for example, or if a file really does exist where the SCons configuration expects a directory). --duplicate=ORDER There are three ways to duplicate files in a build tree: hard links, soft (symbolic) links and copies. The default behaviour of SCons is to prefer hard links to soft links to copies. You can specify different behaviours with this option. ORDER must be one of hard-soft-copy (the default), soft-hard-copy, hard-copy, soft-copy or copy. SCons will attempt to duplicate files using the mechanisms in the specified order. -f file, --file=file, --makefile=file, --sconstruct=file Use file as the initial SConscript file. Multiple options may be specified, in which case scons will read all of the specified files. -h, --help Print a local help message for this build, if one is defined in the SConscript file(s), plus a line that describes the option for command-line option help. If no local help message is defined, prints the standard help message about command-line options. Exits after displaying the appropriate message. -H, --help-options Print the standard help message about command-line options and exit. -i, --ignore-errors Ignore all errors from commands executed to rebuild files. -I directory, --include-dir=directory Specifies a directory to search for imported Python modules. If several options are used, the directories are searched in the order specified. --implicit-cache Cache implicit dependencies. This causes scons to use the implicit (scanned) dependencies from the last time it was run instead of scanning the files for implicit dependencies. This can significantly speed up SCons, but with the following limitations: scons will not detect changes to implicit dependency search paths (e.g. CPPPATH, LIBPATH) that would ordinarily cause different versions of same-named files to be used. scons will miss changes in the implicit dependencies in cases where a new implicit dependency is added earlier in the implicit dependency search path (e.g. CPPPATH, LIBPATH) than a current implicit dependency with the same name. --implicit-deps-changed Forces SCons to ignore the cached implicit dependencies. This causes the implicit dependencies to be rescanned and recached. This implies . --implicit-deps-unchanged Force SCons to ignore changes in the implicit dependencies. This causes cached implicit dependencies to always be used. This implies . --interactive Starts SCons in interactive mode. The SConscript files are read once and a scons>>> prompt is printed. Targets may now be rebuilt by typing commands at interactive prompt without having to re-read the SConscript files and re-initialize the dependency graph from scratch. SCons interactive mode supports the following commands:
        build[OPTIONS] [TARGETS] ... Builds the specified TARGETS (and their dependencies) with the specified SCons command-line OPTIONS. b and scons are synonyms. The following SCons command-line options affect the build command: --cache-debug=FILE --cache-disable, --no-cache --cache-force, --cache-populate --cache-readonly --cache-show --debug=TYPE -i, --ignore-errors -j N, --jobs=N -k, --keep-going -n, --no-exec, --just-print, --dry-run, --recon -Q -s, --silent, --quiet --taskmastertrace=FILE --tree=OPTIONS Any other SCons command-line options that are specified do not cause errors but have no effect on the build command (mainly because they affect how the SConscript files are read, which only happens once at the beginning of interactive mode). clean[OPTIONS] [TARGETS] ... Cleans the specified TARGETS (and their dependencies) with the specified options. c is a synonym. This command is itself a synonym for build --clean exit Exits SCons interactive mode. You can also exit by terminating input (CTRL+D on UNIX or Linux systems, CTRL+Z on Windows systems). help[COMMAND] Provides a help message about the commands available in SCons interactive mode. If COMMAND is specified, h and ? are synonyms. shell[COMMANDLINE] Executes the specified COMMANDLINE in a subshell. If no COMMANDLINE is specified, executes the interactive command interpreter specified in the SHELL environment variable (on UNIX and Linux systems) or the COMSPEC environment variable (on Windows systems). sh and ! are synonyms. version Prints SCons version information.
        An empty line repeats the last typed command. Command-line editing can be used if the readline module is available. $ scons --interactive scons: Reading SConscript files ... scons: done reading SConscript files. scons>>> build -n prog scons>>> exit -j N, --jobs=N Specifies the number of jobs (commands) to run simultaneously. If there is more than one option, the last one is effective. -k, --keep-going Continue as much as possible after an error. The target that failed and those that depend on it will not be remade, but other targets specified on the command line will still be processed. -m Ignored for compatibility with non-GNU versions of make. --max-drift=SECONDS Set the maximum expected drift in the modification time of files to SECONDS. This value determines how long a file must be unmodified before its cached content signature will be used instead of calculating a new content signature (MD5 checksum) of the file's contents. The default value is 2 days, which means a file must have a modification time of at least two days ago in order to have its cached content signature used. A negative value means to never cache the content signature and to ignore the cached value if there already is one. A value of 0 means to always use the cached signature, no matter how old the file is. --md5-chunksize=KILOBYTES Set the block size used to compute MD5 signatures to KILOBYTES. This value determines the size of the chunks which are read in at once when computing MD5 signatures. Files below that size are fully stored in memory before performing the signature computation while bigger files are read in block-by-block. A huge block-size leads to high memory consumption while a very small block-size slows down the build considerably. The default value is to use a chunk size of 64 kilobytes, which should be appropriate for most uses. -n, --just-print, --dry-run, --recon No execute. Print the commands that would be executed to build any out-of-date target files, but do not execute the commands. --no-site-dir Prevents the automatic addition of the standard site_scons dirs to sys.path. Also prevents loading the site_scons/site_init.py modules if they exist, and prevents adding their site_scons/site_tools dirs to the toolpath. --profile=file Run SCons under the Python profiler and save the results in the specified file. The results may be analyzed using the Python pstats module. -q, --question Do not run any commands, or print anything. Just return an exit status that is zero if the specified targets are already up to date, non-zero otherwise. -Q Quiets SCons status messages about reading SConscript files, building targets and entering directories. Commands that are executed to rebuild target files are still printed. --random Build dependencies in a random order. This is useful when building multiple trees simultaneously with caching enabled, to prevent multiple builds from simultaneously trying to build or retrieve the same target files. -s, --silent, --quiet Silent. Do not print commands that are executed to rebuild target files. Also suppresses SCons status messages. -S, --no-keep-going, --stop Ignored for compatibility with GNU make. --site-dir=dir Uses the named dir as the site dir rather than the default site_scons dirs. This dir will get prepended to sys.path, the module dir/site_init.py will get loaded if it exists, and dir/site_tools will get added to the default toolpath. The default set of site_scons dirs used when is not specified depends on the system platform, as follows. Note that the directories are examined in the order given, from most generic to most specific, so the last-executed site_init.py file is the most specific one (which gives it the chance to override everything else), and the dirs are prepended to the paths, again so the last dir examined comes first in the resulting path. Windows: %ALLUSERSPROFILE/Application Data/scons/site_scons %USERPROFILE%/Local Settings/Application Data/scons/site_scons %APPDATA%/scons/site_scons %HOME%/.scons/site_scons ./site_scons Mac OS X: /Library/Application Support/SCons/site_scons /opt/local/share/scons/site_scons (for MacPorts) /sw/share/scons/site_scons (for Fink) $HOME/Library/Application Support/SCons/site_scons $HOME/.scons/site_scons ./site_scons Solaris: /opt/sfw/scons/site_scons /usr/share/scons/site_scons $HOME/.scons/site_scons ./site_scons Linux, HPUX, and other Posix-like systems: /usr/share/scons/site_scons $HOME/.scons/site_scons ./site_scons --stack-size=KILOBYTES Set the size stack used to run threads to KILOBYTES. This value determines the stack size of the threads used to run jobs. These are the threads that execute the actions of the builders for the nodes that are out-of-date. Note that this option has no effect unless the num_jobs option, which corresponds to -j and --jobs, is larger than one. Using a stack size that is too small may cause stack overflow errors. This usually shows up as segmentation faults that cause scons to abort before building anything. Using a stack size that is too large will cause scons to use more memory than required and may slow down the entire build process. The default value is to use a stack size of 256 kilobytes, which should be appropriate for most uses. You should not need to increase this value unless you encounter stack overflow errors. -t, --touch Ignored for compatibility with GNU make. (Touching a file to make it appear up-to-date is unnecessary when using scons.) --taskmastertrace=file Prints trace information to the specified file about how the internal Taskmaster object evaluates and controls the order in which Nodes are built. A file name of - may be used to specify the standard output. -tree=options Prints a tree of the dependencies after each top-level target is built. This prints out some or all of the tree, in various formats, depending on the options specified: --tree=all Print the entire dependency tree after each top-level target is built. This prints out the complete dependency tree, including implicit dependencies and ignored dependencies. --tree=derived Restricts the tree output to only derived (target) files, not source files. --tree=status Prints status information for each displayed node. --tree=prune Prunes the tree to avoid repeating dependency information for nodes that have already been displayed. Any node that has already been displayed will have its name printed in [square brackets], as an indication that the dependencies for that node can be found by searching for the relevant output higher up in the tree. Multiple options may be specified, separated by commas: # Prints only derived files, with status information: scons --tree=derived,status # Prints all dependencies of target, with status information # and pruning dependencies of already-visited Nodes: scons --tree=all,prune,status target -u, --up, --search-up Walks up the directory structure until an SConstruct , Sconstruct or sconstruct file is found, and uses that as the top of the directory tree. If no targets are specified on the command line, only targets at or below the current directory will be built. -U Works exactly the same way as the option except for the way default targets are handled. When this option is used and no targets are specified on the command line, all default targets that are defined in the SConscript(s) in the current directory are built, regardless of what directory the resultant targets end up in. -v, --version Print the scons version, copyright information, list of authors, and any other relevant information. Then exit. -w, --print-directory Print a message containing the working directory before and after other processing. --no-print-directory Turn off -w, even if it was turned on implicitly. --warn=type, --warn=no-type Enable or disable warnings. type specifies the type of warnings to be enabled or disabled: --warn=all, --warn=no-all Enables or disables all warnings. --warn=cache-version, --warn=no-cache-version Enables or disables warnings about the cache directory not using the latest configuration information CacheDir(). These warnings are enabled by default. --warn=cache-write-error, --warn=no-cache-write-error Enables or disables warnings about errors trying to write a copy of a built file to a specified CacheDir(). These warnings are disabled by default. --warn=corrupt-sconsign, --warn=no-corrupt-sconsign Enables or disables warnings about unfamiliar signature data in .sconsign files. These warnings are enabled by default. --warn=dependency, --warn=no-dependency Enables or disables warnings about dependencies. These warnings are disabled by default. --warn=deprecated, --warn=no-deprecated Enables or disables all warnings about use of currently deprecated features. These warnings are enabled by default. Note that the option does not disable warnings about absolutely all deprecated features. Warnings for some deprecated features that have already been through several releases with deprecation warnings may be mandatory for a release or two before they are officially no longer supported by SCons. Warnings for some specific deprecated features may be enabled or disabled individually; see below.
        --warn=deprecated-copy, --warn=no-deprecated-copy Enables or disables warnings about use of the deprecated env.Copy() method. --warn=deprecated-source-signatures, --warn=no-deprecated-source-signatures Enables or disables warnings about use of the deprecated SourceSignatures() function or env.SourceSignatures() method. --warn=deprecated-target-signatures, --warn=no-deprecated-target-signatures Enables or disables warnings about use of the deprecated TargetSignatures() function or env.TargetSignatures() method.
        --warn=duplicate-environment, --warn=no-duplicate-environment Enables or disables warnings about attempts to specify a build of a target with two different construction environments that use the same action. These warnings are enabled by default. --warn=fortran-cxx-mix, --warn=no-fortran-cxx-mix Enables or disables the specific warning about linking Fortran and C++ object files in a single executable, which can yield unpredictable behavior with some compilers. --warn=future-deprecated, --warn=no-future-deprecated Enables or disables warnings about features that will be deprecated in the future. These warnings are disabled by default. Enabling this warning is especially recommended for projects that redistribute SCons configurations for other users to build, so that the project can be warned as soon as possible about to-be-deprecated features that may require changes to the configuration. --warn=link, --warn=no-link Enables or disables warnings about link steps. --warn=misleading-keywords, --warn=no-misleading-keywords Enables or disables warnings about use of the misspelled keywords targets and sources when calling Builders. (Note the last s characters, the correct spellings are target and source.) These warnings are enabled by default. --warn=missing-sconscript, --warn=no-missing-sconscript Enables or disables warnings about missing SConscript files. These warnings are enabled by default. --warn=no-md5-module, --warn=no-no-md5-module Enables or disables warnings about the version of Python not having an MD5 checksum module available. These warnings are enabled by default. --warn=no-metaclass-support, --warn=no-no-metaclass-support Enables or disables warnings about the version of Python not supporting metaclasses when the option is used. These warnings are enabled by default. --warn=no-object-count, --warn=no-no-object-count Enables or disables warnings about the feature not working when scons is run with the python option or from optimized Python (.pyo) modules. --warn=no-parallel-support, --warn=no-no-parallel-support Enables or disables warnings about the version of Python not being able to support parallel builds when the option is used. These warnings are enabled by default. --warn=python-version, --warn=no-python-version Enables or disables the warning about running SCons with a deprecated version of Python. These warnings are enabled by default. --warn=reserved-variable, --warn=no-reserved-variable Enables or disables warnings about attempts to set the reserved construction variable names CHANGED_SOURCES, CHANGED_TARGETS, TARGET, TARGETS, SOURCE, SOURCES, UNCHANGED_SOURCES or UNCHANGED_TARGETS. These warnings are disabled by default. --warn=stack-size, --warn=no-stack-size Enables or disables warnings about requests to set the stack size that could not be honored. These warnings are enabled by default. --warn=target_not_build, --warn=no-target_not_built Enables or disables warnings about a build rule not building the expected targets. These warnings are not currently enabled by default. -Y repository, --repository=repository, --srcdir=repository Search the specified repository for any input and target files not found in the local directory hierarchy. Multiple options may be specified, in which case the repositories are searched in the order specified.
        CONFIGURATION FILE REFERENCE Construction Environments A construction environment is the basic means by which the SConscript files communicate build information to scons. A new construction environment is created using the Environment function: env = Environment() Variables, called construction variables, may be set in a construction environment either by specifying them as keywords when the object is created or by assigning them a value after the object is created: env = Environment(FOO = 'foo') env['BAR'] = 'bar' As a convenience, construction variables may also be set or modified by the parse_flags keyword argument, which applies the ParseFlags method (described below) to the argument value after all other processing is completed. This is useful either if the exact content of the flags is unknown (for example, read from a control file) or if the flags are distributed to a number of construction variables. env = Environment(parse_flags = '-Iinclude -DEBUG -lm') This example adds 'include' to CPPPATH, 'EBUG' to CPPDEFINES, and 'm' to LIBS. By default, a new construction environment is initialized with a set of builder methods and construction variables that are appropriate for the current platform. An optional platform keyword argument may be used to specify that an environment should be initialized for a different platform: env = Environment(platform = 'cygwin') env = Environment(platform = 'os2') env = Environment(platform = 'posix') env = Environment(platform = 'win32') Specifying a platform initializes the appropriate construction variables in the environment to use and generate file names with prefixes and suffixes appropriate for the platform. Note that the win32 platform adds the SystemDrive and SystemRoot variables from the user's external environment to the construction environment's ENV dictionary. This is so that any executed commands that use sockets to connect with other systems (such as fetching source files from external CVS repository specifications like :pserver:anonymous@cvs.sourceforge.net:/cvsroot/scons) will work on Windows systems. The platform argument may be function or callable object, in which case the Environment() method will call the specified argument to update the new construction environment: def my_platform(env): env['VAR'] = 'xyzzy' env = Environment(platform = my_platform) Additionally, a specific set of tools with which to initialize the environment may be specified as an optional keyword argument: env = Environment(tools = ['msvc', 'lex']) Non-built-in tools may be specified using the toolpath argument: env = Environment(tools = ['default', 'foo'], toolpath = ['tools']) This looks for a tool specification in tools/foo.py (as well as using the ordinary default tools for the platform). foo.py should have two functions: generate(env, **kw) and exists(env). The generate() function modifies the passed-in environment to set up variables so that the tool can be executed; it may use any keyword arguments that the user supplies (see below) to vary its initialization. The exists() function should return a true value if the tool is available. Tools in the toolpath are used before any of the built-in ones. For example, adding gcc.py to the toolpath would override the built-in gcc tool. Also note that the toolpath is stored in the environment for use by later calls to Clone() and Tool() methods: base = Environment(toolpath=['custom_path']) derived = base.Clone(tools=['custom_tool']) derived.CustomBuilder() The elements of the tools list may also be functions or callable objects, in which case the Environment() method will call the specified elements to update the new construction environment: def my_tool(env): env['XYZZY'] = 'xyzzy' env = Environment(tools = [my_tool]) The individual elements of the tools list may also themselves be two-element lists of the form (toolname, kw_dict). SCons searches for the toolname specification file as described above, and passes kw_dict, which must be a dictionary, as keyword arguments to the tool's generate function. The generate function can use the arguments to modify the tool's behavior by setting up the environment in different ways or otherwise changing its initialization. # in tools/my_tool.py: def generate(env, **kw): # Sets MY_TOOL to the value of keyword argument 'arg1' or 1. env['MY_TOOL'] = kw.get('arg1', '1') def exists(env): return 1 # in SConstruct: env = Environment(tools = ['default', ('my_tool', {'arg1': 'abc'})], toolpath=['tools']) The tool definition (i.e. my_tool()) can use the PLATFORM variable from the environment it receives to customize the tool for different platforms. If no tool list is specified, then SCons will auto-detect the installed tools using the PATH variable in the ENV construction variable and the platform name when the Environment is constructed. Changing the PATH variable after the Environment is constructed will not cause the tools to be redetected. One feature now present within Scons is the ability to have nested tools. Tools which can be located within a subdirectory in the toolpath. With a nested tool name the dot represents a directory seperator # namespaced builder env = Environment(ENV = os.environ, tools = ['SubDir1.SubDir2.SomeTool']) env.SomeTool(targets, sources) # Search Paths # SCons\Tool\SubDir1\SubDir2\SomeTool.py # SCons\Tool\SubDir1\SubDir2\SomeTool\__init__.py # .\site_scons\site_tools\SubDir1\SubDir2\SomeTool.py # .\site_scons\site_tools\SubDir1\SubDir2\SomeTool\__init__.py SCons supports the following tool specifications out of the box: Additionally, there is a "tool" named default which configures the environment with a default set of tools for the current platform. On posix and cygwin platforms the GNU tools (e.g. gcc) are preferred by SCons, on Windows the Microsoft tools (e.g. msvc) followed by MinGW are preferred by SCons, and in OS/2 the IBM tools (e.g. icc) are preferred by SCons. Builder Methods Build rules are specified by calling a construction environment's builder methods. The arguments to the builder methods are target (a list of targets to be built, usually file names) and source (a list of sources to be built, usually file names). Because long lists of file names can lead to a lot of quoting, scons supplies a Split() global function and a same-named environment method that split a single string into a list, separated on strings of white-space characters. (These are similar to the split() member function of Python strings but work even if the input isn't a string.) Like all Python arguments, the target and source arguments to a builder method can be specified either with or without the "target" and "source" keywords. When the keywords are omitted, the target is first, followed by the source. The following are equivalent examples of calling the Program builder method: env.Program('bar', ['bar.c', 'foo.c']) env.Program('bar', Split('bar.c foo.c')) env.Program('bar', env.Split('bar.c foo.c')) env.Program(source = ['bar.c', 'foo.c'], target = 'bar') env.Program(target = 'bar', Split('bar.c foo.c')) env.Program(target = 'bar', env.Split('bar.c foo.c')) env.Program('bar', source = 'bar.c foo.c'.split()) Target and source file names that are not absolute path names (that is, do not begin with / on POSIX systems or \fR on Windows systems, with or without an optional drive letter) are interpreted relative to the directory containing the SConscript file being read. An initial # (hash mark) on a path name means that the rest of the file name is interpreted relative to the directory containing the top-level SConstruct file, even if the # is followed by a directory separator character (slash or backslash). Examples: # The comments describing the targets that will be built # assume these calls are in a SConscript file in the # a subdirectory named "subdir". # Builds the program "subdir/foo" from "subdir/foo.c": env.Program('foo', 'foo.c') # Builds the program "/tmp/bar" from "subdir/bar.c": env.Program('/tmp/bar', 'bar.c') # An initial '#' or '#/' are equivalent; the following # calls build the programs "foo" and "bar" (in the # top-level SConstruct directory) from "subdir/foo.c" and # "subdir/bar.c", respectively: env.Program('#foo', 'foo.c') env.Program('#/bar', 'bar.c') # Builds the program "other/foo" (relative to the top-level # SConstruct directory) from "subdir/foo.c": env.Program('#other/foo', 'foo.c') When the target shares the same base name as the source and only the suffix varies, and if the builder method has a suffix defined for the target file type, then the target argument may be omitted completely, and scons will deduce the target file name from the source file name. The following examples all build the executable program bar (on POSIX systems) or bar.exe (on Windows systems) from the bar.c source file: env.Program(target = 'bar', source = 'bar.c') env.Program('bar', source = 'bar.c') env.Program(source = 'bar.c') env.Program('bar.c') As a convenience, a srcdir keyword argument may be specified when calling a Builder. When specified, all source file strings that are not absolute paths will be interpreted relative to the specified srcdir. The following example will build the build/prog (or build/prog.exe on Windows) program from the files src/f1.c and src/f2.c: env.Program('build/prog', ['f1.c', 'f2.c'], srcdir='src') It is possible to override or add construction variables when calling a builder method by passing additional keyword arguments. These overridden or added variables will only be in effect when building the target, so they will not affect other parts of the build. For example, if you want to add additional libraries for just one program: env.Program('hello', 'hello.c', LIBS=['gl', 'glut']) or generate a shared library with a non-standard suffix: env.SharedLibrary('word', 'word.cpp', SHLIBSUFFIX='.ocx', LIBSUFFIXES=['.ocx']) (Note that both the $SHLIBSUFFIX and $LIBSUFFIXES variables must be set if you want SCons to search automatically for dependencies on the non-standard library names; see the descriptions of these variables, below, for more information.) It is also possible to use the parse_flags keyword argument in an override: env = Program('hello', 'hello.c', parse_flags = '-Iinclude -DEBUG -lm') This example adds 'include' to CPPPATH, 'EBUG' to CPPDEFINES, and 'm' to LIBS. Although the builder methods defined by scons are, in fact, methods of a construction environment object, they may also be called without an explicit environment: Program('hello', 'hello.c') SharedLibrary('word', 'word.cpp') In this case, the methods are called internally using a default construction environment that consists of the tools and values that scons has determined are appropriate for the local system. Builder methods that can be called without an explicit environment may be called from custom Python modules that you import into an SConscript file by adding the following to the Python module: from SCons.Script import * All builder methods return a list-like object containing Nodes that represent the target or targets that will be built. A Node is an internal SCons object which represents build targets or sources. The returned Node-list object can be passed to other builder methods as source(s) or passed to any SCons function or method where a filename would normally be accepted. For example, if it were necessary to add a specific flag when compiling one specific object file: bar_obj_list = env.StaticObject('bar.c', CPPDEFINES='-DBAR') env.Program(source = ['foo.c', bar_obj_list, 'main.c']) Using a Node in this way makes for a more portable build by avoiding having to specify a platform-specific object suffix when calling the Program() builder method. Note that Builder calls will automatically "flatten" the source and target file lists, so it's all right to have the bar_obj list return by the StaticObject() call in the middle of the source file list. If you need to manipulate a list of lists returned by Builders directly using Python, you can either build the list by hand: foo = Object('foo.c') bar = Object('bar.c') objects = ['begin.o'] + foo + ['middle.o'] + bar + ['end.o'] for object in objects: print(str(object)) Or you can use the Flatten() function supplied by scons to create a list containing just the Nodes, which may be more convenient: foo = Object('foo.c') bar = Object('bar.c') objects = Flatten(['begin.o', foo, 'middle.o', bar, 'end.o']) for object in objects: print(str(object)) Note also that because Builder calls return a list-like object, not an actual Python list, you should not use the Python += operator to append Builder results to a Python list. Because the list and the object are different types, Python will not update the original list in place, but will instead create a new Node-list object containing the concatenation of the list elements and the Builder results. This will cause problems for any other Python variables in your SCons configuration that still hold on to a reference to the original list. Instead, use the Python .extend() method to make sure the list is updated in-place. Example: object_files = [] # Do NOT use += as follows: # # object_files += Object('bar.c') # # It will not update the object_files list in place. # # Instead, use the .extend() method: object_files.extend(Object('bar.c')) The path name for a Node's file may be used by passing the Node to the Python-builtin str() function: bar_obj_list = env.StaticObject('bar.c', CPPDEFINES='-DBAR') print("The path to bar_obj is:", str(bar_obj_list[0])) Note again that because the Builder call returns a list, we have to access the first element in the list (bar_obj_list[0]) to get at the Node that actually represents the object file. Builder calls support a chdir keyword argument that specifies that the Builder's action(s) should be executed after changing directory. If the chdir argument is a string or a directory Node, scons will change to the specified directory. If the chdir is not a string or Node and is non-zero, then scons will change to the target file's directory. # scons will change to the "sub" subdirectory # before executing the "cp" command. env.Command('sub/dir/foo.out', 'sub/dir/foo.in', "cp dir/foo.in dir/foo.out", chdir='sub') # Because chdir is not a string, scons will change to the # target's directory ("sub/dir") before executing the # "cp" command. env.Command('sub/dir/foo.out', 'sub/dir/foo.in', "cp foo.in foo.out", chdir=1) Note that scons will not automatically modify its expansion of construction variables like $TARGET and $SOURCE when using the chdir keyword argument--that is, the expanded file names will still be relative to the top-level SConstruct directory, and consequently incorrect relative to the chdir directory. If you use the chdir keyword argument, you will typically need to supply a different command line using expansions like ${TARGET.file} and ${SOURCE.file} to use just the filename portion of the targets and source. scons provides the following builder methods: All targets of builder methods automatically depend on their sources. An explicit dependency can be specified using the Depends method of a construction environment (see below). In addition, scons automatically scans source files for various programming languages, so the dependencies do not need to be specified explicitly. By default, SCons can C source files, C++ source files, Fortran source files with .F (POSIX systems only), .fpp, or .FPP file extensions, and assembly language files with .S (POSIX systems only), .spp, or .SPP files extensions for C preprocessor dependencies. SCons also has default support for scanning D source files, You can also write your own Scanners to add support for additional source file types. These can be added to the default Scanner object used by the Object(), StaticObject(), and SharedObject() Builders by adding them to the SourceFileScanner object. See the section "Scanner Objects" below, for more information about defining your own Scanner objects and using the SourceFileScanner object. Methods and Functions to Do Things In addition to Builder methods, scons provides a number of other construction environment methods and global functions to manipulate the build configuration. Usually, a construction environment method and global function with the same name both exist so that you don't have to remember whether to a specific bit of functionality must be called with or without a construction environment. In the following list, if you call something as a global function it looks like: Function(arguments) and if you call something through a construction environment it looks like: env.Function(arguments) If you can call the functionality in both ways, then both forms are listed. Global functions may be called from custom Python modules that you import into an SConscript file by adding the following to the Python module: from SCons.Script import * Except where otherwise noted, the same-named construction environment method and global function provide the exact same functionality. The only difference is that, where appropriate, calling the functionality through a construction environment will substitute construction variables into any supplied strings. For example: env = Environment(FOO = 'foo') Default('$FOO') env.Default('$FOO') In the above example, the first call to the global Default() function will actually add a target named $FOO to the list of default targets, while the second call to the env.Default() construction environment method will expand the value and add a target named foo to the list of default targets. For more on construction variable expansion, see the next section on construction variables. Construction environment methods and global functions supported by scons include: SConscript Variables In addition to the global functions and methods, scons supports a number of Python variables that can be used in SConscript files to affect how you want the build to be performed. These variables may be accessed from custom Python modules that you import into an SConscript file by adding the following to the Python module: from SCons.Script import * ARGLIST A list keyword=value arguments specified on the command line. Each element in the list is a tuple containing the (keyword,value) of the argument. The separate keyword and value elements of the tuple can be accessed by subscripting for element [0] and [1] of the tuple, respectively. Example: print("first keyword, value =", ARGLIST[0][0], ARGLIST[0][1]) print("second keyword, value =", ARGLIST[1][0], ARGLIST[1][1]) third_tuple = ARGLIST[2] print("third keyword, value =", third_tuple[0], third_tuple[1]) for key, value in ARGLIST: # process key and value ARGUMENTS A dictionary of all the keyword=value arguments specified on the command line. The dictionary is not in order, and if a given keyword has more than one value assigned to it on the command line, the last (right-most) value is the one in the ARGUMENTS dictionary. Example: if ARGUMENTS.get('debug', 0): env = Environment(CCFLAGS = '-g') else: env = Environment() BUILD_TARGETS A list of the targets which scons will actually try to build, regardless of whether they were specified on the command line or via the Default() function or method. The elements of this list may be strings or nodes, so you should run the list through the Python str function to make sure any Node path names are converted to strings. Because this list may be taken from the list of targets specified using the Default() function or method, the contents of the list may change on each successive call to Default(). See the DEFAULT_TARGETS list, below, for additional information. Example: if 'foo' in BUILD_TARGETS: print("Don't forget to test the `foo' program!") if 'special/program' in BUILD_TARGETS: SConscript('special') Note that the BUILD_TARGETS list only contains targets expected listed on the command line or via calls to the Default() function or method. It does not contain all dependent targets that will be built as a result of making the sure the explicitly-specified targets are up to date. COMMAND_LINE_TARGETS A list of the targets explicitly specified on the command line. If there are no targets specified on the command line, the list is empty. This can be used, for example, to take specific actions only when a certain target or targets is explicitly being built. Example: if 'foo' in COMMAND_LINE_TARGETS: print("Don't forget to test the `foo' program!") if 'special/program' in COMMAND_LINE_TARGETS: SConscript('special') DEFAULT_TARGETS A list of the target nodes that have been specified using the Default() function or method. The elements of the list are nodes, so you need to run them through the Python str function to get at the path name for each Node. Example: print(str(DEFAULT_TARGETS[0])) if 'foo' in map(str, DEFAULT_TARGETS): print("Don't forget to test the `foo' program!") The contents of the DEFAULT_TARGETS list change on on each successive call to the Default() function: print(map(str, DEFAULT_TARGETS)) # originally [] Default('foo') print(map(str, DEFAULT_TARGETS)) # now a node ['foo'] Default('bar') print(map(str, DEFAULT_TARGETS)) # now a node ['foo', 'bar'] Default(None) print(map(str, DEFAULT_TARGETS)) # back to [] Consequently, be sure to use DEFAULT_TARGETS only after you've made all of your Default() calls, or else simply be careful of the order of these statements in your SConscript files so that you don't look for a specific default target before it's actually been added to the list. Construction Variables A construction environment has an associated dictionary of construction variables that are used by built-in or user-supplied build rules. Construction variables must follow the same rules for Python identifiers: the initial character must be an underscore or letter, followed by any number of underscores, letters, or digits. A number of useful construction variables are automatically defined by scons for each supported platform, and additional construction variables can be defined by the user. The following is a list of the automatically defined construction variables: Construction variables can be retrieved and set using the Dictionary method of the construction environment: dict = env.Dictionary() dict["CC"] = "cc" or using the [] operator: env["CC"] = "cc" Construction variables can also be passed to the construction environment constructor: env = Environment(CC="cc") or when copying a construction environment using the Clone method: env2 = env.Clone(CC="cl.exe") Configure Contexts scons supports configure contexts, an integrated mechanism similar to the various AC_CHECK macros in GNU autoconf for testing for the existence of C header files, libraries, etc. In contrast to autoconf, scons does not maintain an explicit cache of the tested values, but uses its normal dependency tracking to keep the checked values up to date. However, users may override this behaviour with the command line option. The following methods can be used to perform checks: Configure(env, [custom_tests, conf_dir, log_file, config_h, clean, help]) env.Configure([custom_tests, conf_dir, log_file, config_h, clean, help]) This creates a configure context, which can be used to perform checks. env specifies the environment for building the tests. This environment may be modified when performing checks. custom_tests is a dictionary containing custom tests. See also the section about custom tests below. By default, no custom tests are added to the configure context. conf_dir specifies a directory where the test cases are built. Note that this directory is not used for building normal targets. The default value is the directory #/.sconf_temp. log_file specifies a file which collects the output from commands that are executed to check for the existence of header files, libraries, etc. The default is the file #/config.log. If you are using the VariantDir() method, you may want to specify a subdirectory under your variant directory. config_h specifies a C header file where the results of tests will be written, e.g. #define HAVE_STDIO_H, #define HAVE_LIBM, etc. The default is to not write a config.h file. You can specify the same config.h file in multiple calls to Configure, in which case scons will concatenate all results in the specified file. Note that SCons uses its normal dependency checking to decide if it's necessary to rebuild the specified config_h file. This means that the file is not necessarily re-built each time scons is run, but is only rebuilt if its contents will have changed and some target that depends on the config_h file is being built. The optional clean and help arguments can be used to suppress execution of the configuration tests when the or options are used, respectively. The default behavior is always to execute configure context tests, since the results of the tests may affect the list of targets to be cleaned or the help text. If the configure tests do not affect these, then you may add the clean=False or help=False arguments (or both) to avoid unnecessary test execution. A created Configure instance has the following associated methods: SConf.Finish(context) sconf.Finish() This method should be called after configuration is done. It returns the environment as modified by the configuration checks performed. After this method is called, no further checks can be performed with this configuration context. However, you can create a new Configure context to perform additional checks. Only one context should be active at a time. The following Checks are predefined. (This list will likely grow larger as time goes by and developers contribute new useful tests.) SConf.CheckHeader(context, header, [include_quotes, language]) sconf.CheckHeader(header, [include_quotes, language]) Checks if header is usable in the specified language. header may be a list, in which case the last item in the list is the header file to be checked, and the previous list items are header files whose #include lines should precede the header line being checked for. The optional argument include_quotes must be a two character string, where the first character denotes the opening quote and the second character denotes the closing quote. By default, both characters are " (double quote). The optional argument language should be either C or C++ and selects the compiler to be used for the check. Returns 1 on success and 0 on failure. SConf.CheckCHeader(context, header, [include_quotes]) sconf.CheckCHeader(header, [include_quotes]) This is a wrapper around SConf.CheckHeader which checks if header is usable in the C language. header may be a list, in which case the last item in the list is the header file to be checked, and the previous list items are header files whose #include lines should precede the header line being checked for. The optional argument include_quotes must be a two character string, where the first character denotes the opening quote and the second character denotes the closing quote (both default to \N'34'). Returns 1 on success and 0 on failure. SConf.CheckCXXHeader(context, header, [include_quotes]) sconf.CheckCXXHeader(header, [include_quotes]) This is a wrapper around SConf.CheckHeader which checks if header is usable in the C++ language. header may be a list, in which case the last item in the list is the header file to be checked, and the previous list items are header files whose #include lines should precede the header line being checked for. The optional argument include_quotes must be a two character string, where the first character denotes the opening quote and the second character denotes the closing quote (both default to \N'34'). Returns 1 on success and 0 on failure. SConf.CheckFunc(context,, function_name, [header, language]) sconf.CheckFunc(function_name, [header, language]) Checks if the specified C or C++ function is available. function_name is the name of the function to check for. The optional header argument is a string that will be placed at the top of the test file that will be compiled to check if the function exists; the default is: #ifdef __cplusplus extern "C" #endif char function_name(); The optional language argument should be C or C++ and selects the compiler to be used for the check; the default is "C". SConf.CheckLib(context, [library, symbol, header, language, autoadd=1]) sconf.CheckLib([library, symbol, header, language, autoadd=1]) Checks if library provides symbol. If the value of autoadd is 1 and the library provides the specified symbol, appends the library to the LIBS construction environment variable. library may also be None (the default), in which case symbol is checked with the current LIBS variable, or a list of library names, in which case each library in the list will be checked for symbol. If symbol is not set or is None, then SConf.CheckLib() just checks if you can link against the specified library. The optional language argument should be C or C++ and selects the compiler to be used for the check; the default is "C". The default value for autoadd is 1. This method returns 1 on success and 0 on error. SConf.CheckLibWithHeader(context, library, header, language, [call, autoadd]) sconf.CheckLibWithHeader(library, header, language, [call, autoadd]) In contrast to the SConf.CheckLib call, this call provides a more sophisticated way to check against libraries. Again, library specifies the library or a list of libraries to check. header specifies a header to check for. header may be a list, in which case the last item in the list is the header file to be checked, and the previous list items are header files whose #include lines should precede the header line being checked for. language may be one of 'C','c','CXX','cxx','C++' and 'c++'. call can be any valid expression (with a trailing ';'). If call is not set, the default simply checks that you can link against the specified library. autoadd specifies whether to add the library to the environment (only if the check succeeds). This method returns 1 on success and 0 on error. SConf.CheckType(context, type_name, [includes, language]) sconf.CheckType(type_name, [includes, language]) Checks for the existence of a type defined by typedef. type_name specifies the typedef name to check for. includes is a string containing one or more #include lines that will be inserted into the program that will be run to test for the existence of the type. The optional language argument should be C or C++ and selects the compiler to be used for the check; the default is "C". Example: sconf.CheckType('foo_type', '#include "my_types.h"', 'C++') Configure.CheckCC(self) Checks whether the C compiler (as defined by the CC construction variable) works by trying to compile a small source file. By default, SCons only detects if there is a program with the correct name, not if it is a functioning compiler. This uses the exact same command than the one used by the object builder for C source file, so it can be used to detect if a particular compiler flag works or not. Configure.CheckCXX(self) Checks whether the C++ compiler (as defined by the CXX construction variable) works by trying to compile a small source file. By default, SCons only detects if there is a program with the correct name, not if it is a functioning compiler. This uses the exact same command than the one used by the object builder for CXX source files, so it can be used to detect if a particular compiler flag works or not. Configure.CheckSHCC(self) Checks whether the C compiler (as defined by the SHCC construction variable) works by trying to compile a small source file. By default, SCons only detects if there is a program with the correct name, not if it is a functioning compiler. This uses the exact same command than the one used by the object builder for C source file, so it can be used to detect if a particular compiler flag works or not. This does not check whether the object code can be used to build a shared library, only that the compilation (not link) succeeds. Configure.CheckSHCXX(self) Checks whether the C++ compiler (as defined by the SHCXX construction variable) works by trying to compile a small source file. By default, SCons only detects if there is a program with the correct name, not if it is a functioning compiler. This uses the exact same command than the one used by the object builder for CXX source files, so it can be used to detect if a particular compiler flag works or not. This does not check whether the object code can be used to build a shared library, only that the compilation (not link) succeeds. Example of a typical Configure usage: env = Environment() conf = Configure( env ) if not conf.CheckCHeader( 'math.h' ): print('We really need math.h!') Exit(1) if conf.CheckLibWithHeader( 'qt', 'qapp.h', 'c++', 'QApplication qapp(0,0);' ): # do stuff for qt - usage, e.g. conf.env.Append( CPPFLAGS = '-DWITH_QT' ) env = conf.Finish() SConf.CheckTypeSize(context, type_name, [header, language, expect]) sconf.CheckTypeSize(type_name, [header, language, expect]) Checks for the size of a type defined by typedef. type_name specifies the typedef name to check for. The optional header argument is a string that will be placed at the top of the test file that will be compiled to check if the function exists; the default is empty. The optional language argument should be C or C++ and selects the compiler to be used for the check; the default is "C". The optional expect argument should be an integer. If this argument is used, the function will only check whether the type given in type_name has the expected size (in bytes). For example, CheckTypeSize('short', expect = 2) will return success only if short is two bytes. SConf.CheckDeclaration(context, symbol, [includes, language]) sconf.CheckDeclaration(symbol, [includes, language]) Checks if the specified symbol is declared. includes is a string containing one or more #include lines that will be inserted into the program that will be run to test for the existence of the type. The optional language argument should be C or C++ and selects the compiler to be used for the check; the default is "C". SConf.Define(context, symbol, [value, comment]) sconf.Define(symbol, [value, comment]) This function does not check for anything, but defines a preprocessor symbol that will be added to the configuration header file. It is the equivalent of AC_DEFINE, and defines the symbol name with the optional value and the optional comment comment. Examples: env = Environment() conf = Configure( env ) # Puts the following line in the config header file: # #define A_SYMBOL conf.Define('A_SYMBOL') # Puts the following line in the config header file: # #define A_SYMBOL 1 conf.Define('A_SYMBOL', 1) Be careful about quoting string values, though: env = Environment() conf = Configure( env ) # Puts the following line in the config header file: # #define A_SYMBOL YA conf.Define('A_SYMBOL', "YA") # Puts the following line in the config header file: # #define A_SYMBOL "YA" conf.Define('A_SYMBOL', '"YA"') For comment: env = Environment() conf = Configure( env ) # Puts the following lines in the config header file: # /* Set to 1 if you have a symbol */ # #define A_SYMBOL 1 conf.Define('A_SYMBOL', 1, 'Set to 1 if you have a symbol') You can define your own custom checks. in addition to the predefined checks. These are passed in a dictionary to the Configure function. This dictionary maps the names of the checks to user defined Python callables (either Python functions or class instances implementing the __call__ method). The first argument of the call is always a CheckContext instance followed by the arguments, which must be supplied by the user of the check. These CheckContext instances define the following methods: CheckContext.Message(self, text) Usually called before the check is started. text will be displayed to the user, e.g. 'Checking for library X...' CheckContext.Result(self,, res) Usually called after the check is done. res can be either an integer or a string. In the former case, 'yes' (res != 0) or 'no' (res == 0) is displayed to the user, in the latter case the given string is displayed. CheckContext.TryCompile(self, text, extension) Checks if a file with the specified extension (e.g. '.c') containing text can be compiled using the environment's Object builder. Returns 1 on success and 0 on failure. CheckContext.TryLink(self, text, extension) Checks, if a file with the specified extension (e.g. '.c') containing text can be compiled using the environment's Program builder. Returns 1 on success and 0 on failure. CheckContext.TryRun(self, text, extension) Checks, if a file with the specified extension (e.g. '.c') containing text can be compiled using the environment's Program builder. On success, the program is run. If the program executes successfully (that is, its return status is 0), a tuple (1, outputStr) is returned, where outputStr is the standard output of the program. If the program fails execution (its return status is non-zero), then (0, '') is returned. CheckContext.TryAction(self, action, [text, extension]) Checks if the specified action with an optional source file (contents text , extension extension = '' ) can be executed. action may be anything which can be converted to a scons Action. On success, (1, outputStr) is returned, where outputStr is the content of the target file. On failure (0, '') is returned. CheckContext.TryBuild(self, builder, [text, extension]) Low level implementation for testing specific builds; the methods above are based on this method. Given the Builder instance builder and the optional text of a source file with optional extension, this method returns 1 on success and 0 on failure. In addition, self.lastTarget is set to the build target node, if the build was successful. Example for implementing and using custom tests: def CheckQt(context, qtdir): context.Message( 'Checking for qt ...' ) lastLIBS = context.env['LIBS'] lastLIBPATH = context.env['LIBPATH'] lastCPPPATH= context.env['CPPPATH'] context.env.Append(LIBS = 'qt', LIBPATH = qtdir + '/lib', CPPPATH = qtdir + '/include' ) ret = context.TryLink(""" #include <qapp.h> int main(int argc, char **argv) { QApplication qapp(argc, argv); return 0; } """) if not ret: context.env.Replace(LIBS = lastLIBS, LIBPATH=lastLIBPATH, CPPPATH=lastCPPPATH) context.Result( ret ) return ret env = Environment() conf = Configure( env, custom_tests = { 'CheckQt' : CheckQt } ) if not conf.CheckQt('/usr/lib/qt'): print('We really need qt!') Exit(1) env = conf.Finish() Command-Line Construction Variables Often when building software, some variables must be specified at build time. For example, libraries needed for the build may be in non-standard locations, or site-specific compiler options may need to be passed to the compiler. scons provides a Variables object to support overriding construction variables on the command line: $ scons VARIABLE=foo The variable values can also be specified in a text-based SConscript file. To create a Variables object, call the Variables() function: Variables([files], [args]) This creates a Variables object that will read construction variables from the file or list of filenames specified in files. If no files are specified, or the files argument is None, then no files will be read. The optional argument args is a dictionary of values that will override anything read from the specified files; it is primarily intended to be passed the ARGUMENTS dictionary that holds variables specified on the command line. Example: vars = Variables('custom.py') vars = Variables('overrides.py', ARGUMENTS) vars = Variables(None, {FOO:'expansion', BAR:7}) Variables objects have the following methods: Add(key, [help, default, validator, converter]) This adds a customizable construction variable to the Variables object. key is the name of the variable. help is the help text for the variable. default is the default value of the variable; if the default value is None and there is no explicit value specified, the construction variable will not be added to the construction environment. validator is called to validate the value of the variable, and should take three arguments: key, value, and environment. The recommended way to handle an invalid value is to raise an exception (see example below). converter is called to convert the value before putting it in the environment, and should take either a value, or the value and environment, as parameters. The converter must return a value, which will be converted into a string before being validated by the validator (if any) and then added to the environment. Examples: vars.Add('CC', 'The C compiler') def validate_color(key, val, env): if not val in ['red', 'blue', 'yellow']: raise Exception("Invalid color value '%s'" % val) vars.Add('COLOR', validator=valid_color) AddVariables(list) A wrapper script that adds multiple customizable construction variables to a Variables object. list is a list of tuple or list objects that contain the arguments for an individual call to the Add method. opt.AddVariables( ('debug', '', 0), ('CC', 'The C compiler'), ('VALIDATE', 'An option for testing validation', 'notset', validator, None), ) Update(env, [args]) This updates a construction environment env with the customized construction variables. Any specified variables that are not configured for the Variables object will be saved and may be retrieved with the UnknownVariables() method, below. Normally this method is not called directly, but is called indirectly by passing the Variables object to the Environment() function: env = Environment(variables=vars) The text file(s) that were specified when the Variables object was created are executed as Python scripts, and the values of (global) Python variables set in the file are added to the construction environment. Example: CC = 'my_cc' UnknownVariables() Returns a dictionary containing any variables that were specified either in the files or the dictionary with which the Variables object was initialized, but for which the Variables object was not configured. env = Environment(variables=vars) for key, value in vars.UnknownVariables(): print("unknown variable: %s=%s" % (key, value)) Save(filename, env) This saves the currently set variables into a script file named filename that can be used on the next invocation to automatically load the current settings. This method combined with the Variables method can be used to support caching of variables between runs. env = Environment() vars = Variables(['variables.cache', 'custom.py']) vars.Add(...) vars.Update(env) vars.Save('variables.cache', env) GenerateHelpText(env, [sort]) This generates help text documenting the customizable construction variables suitable to passing in to the Help() function. env is the construction environment that will be used to get the actual values of customizable variables. Calling with an optional sort function will cause the output to be sorted by the specified argument. The specific sort function should take two arguments and return -1, 0 or 1 (like the standard Python cmp function). Help(vars.GenerateHelpText(env)) Help(vars.GenerateHelpText(env, sort=cmp)) FormatVariableHelpText(env, opt, help, default, actual) This method returns a formatted string containing the printable help text for one option. It is normally not called directly, but is called by the GenerateHelpText() method to create the returned help text. It may be overridden with your own function that takes the arguments specified above and returns a string of help text formatted to your liking. Note that the GenerateHelpText() will not put any blank lines or extra characters in between the entries, so you must add those characters to the returned string if you want the entries separated. def my_format(env, opt, help, default, actual): fmt = "\n%s: default=%s actual=%s (%s)\n" return fmt % (opt, default. actual, help) vars.FormatVariableHelpText = my_format To make it more convenient to work with customizable Variables, scons provides a number of functions that make it easy to set up various types of Variables: BoolVariable(key, help, default) Return a tuple of arguments to set up a Boolean option. The option will use the specified name key, have a default value of default, and display the specified help text. The option will interpret the values y, yes, t, true, 1, on and all as true, and the values n, no, f, false, 0, off and none as false. EnumVariable(key, help, default, allowed_values, [map, ignorecase]) Return a tuple of arguments to set up an option whose value may be one of a specified list of legal enumerated values. The option will use the specified name key, have a default value of default, and display the specified help text. The option will only support those values in the allowed_values list. The optional map argument is a dictionary that can be used to convert input values into specific legal values in the allowed_values list. If the value of ignore_case is 0 (the default), then the values are case-sensitive. If the value of ignore_case is 1, then values will be matched case-insensitive. If the value of ignore_case is 2, then values will be matched case-insensitive, and all input values will be converted to lower case. ListVariable(key, help, default, names, [,map]) Return a tuple of arguments to set up an option whose value may be one or more of a specified list of legal enumerated values. The option will use the specified name key, have a default value of default, and display the specified help text. The option will only support the values all, none, or the values in the names list. More than one value may be specified, with all values separated by commas. The default may be a string of comma-separated default values, or a list of the default values. The optional map argument is a dictionary that can be used to convert input values into specific legal values in the names list. PackageVariable(key, help, default) Return a tuple of arguments to set up an option whose value is a path name of a package that may be enabled, disabled or given an explicit path name. The option will use the specified name key, have a default value of default, and display the specified help text. The option will support the values yes, true, on, enable or search, in which case the specified default will be used, or the option may be set to an arbitrary string (typically the path name to a package that is being enabled). The option will also support the values no, false, off or disable to disable use of the specified option. PathVariable(key, help, default, [validator]) Return a tuple of arguments to set up an option whose value is expected to be a path name. The option will use the specified name key, have a default value of default, and display the specified help text. An additional validator may be specified that will be called to verify that the specified path is acceptable. SCons supplies the following ready-made validators: PathVariable.PathExists (the default), which verifies that the specified path exists; PathVariable.PathIsFile, which verifies that the specified path is an existing file; PathVariable.PathIsDir, which verifies that the specified path is an existing directory; PathVariable.PathIsDirCreate, which verifies that the specified path is a directory and will create the specified directory if the path does not exist; and PathVariable.PathAccept, which simply accepts the specific path name argument without validation, and which is suitable if you want your users to be able to specify a directory path that will be created as part of the build process, for example. You may supply your own validator function, which must take three arguments (key, the name of the variable to be set; val, the specified value being checked; and env, the construction environment) and should raise an exception if the specified value is not acceptable. These functions make it convenient to create a number of variables with consistent behavior in a single call to the AddVariables method: vars.AddVariables( BoolVariable('warnings', 'compilation with -Wall and similiar', 1), EnumVariable('debug', 'debug output and symbols', 'no' allowed_values=('yes', 'no', 'full'), map={}, ignorecase=0), # case sensitive ListVariable('shared', 'libraries to build as shared libraries', 'all', names = list_of_libs), PackageVariable('x11', 'use X11 installed here (yes = search some places)', 'yes'), PathVariable('qtdir', 'where the root of Qt is installed', qtdir), PathVariable('foopath', 'where the foo library is installed', foopath, PathVariable.PathIsDir), ) File and Directory Nodes The File() and Dir() functions return File and Dir Nodes, respectively. python objects, respectively. Those objects have several user-visible attributes and methods that are often useful: path The build path of the given file or directory. This path is relative to the top-level directory (where the SConstruct file is found). The build path is the same as the source path if variant_dir is not being used. abspath The absolute build path of the given file or directory. srcnode() The srcnode() method returns another File or Dir object representing the source path of the given File or Dir. The # Get the current build dir's path, relative to top. Dir('.').path # Current dir's absolute path Dir('.').abspath # Next line is always '.', because it is the top dir's path relative to itself. Dir('#.').path File('foo.c').srcnode().path # source path of the given source file. # Builders also return File objects: foo = env.Program('foo.c') print("foo will be built in %s"%foo.path) A Dir Node or File Node can also be used to create file and subdirectory Nodes relative to the generating Node. A Dir Node will place the new Nodes within the directory it represents. A File node will place the new Nodes within its parent directory (that is, "beside" the file in question). If d is a Dir (directory) Node and f is a File (file) Node, then these methods are available: d.Dir(name) Returns a directory Node for a subdirectory of d named name. d.File(name) Returns a file Node for a file within d named name. d.Entry(name) Returns an unresolved Node within d named name. f.Dir(name) Returns a directory named name within the parent directory of f. f.File(name) Returns a file named name within the parent directory of f. f.Entry(name) Returns an unresolved Node named name within the parent directory of f. For example: # Get a Node for a file within a directory incl = Dir('include') f = incl.File('header.h') # Get a Node for a subdirectory within a directory dist = Dir('project-3.2.1) src = dist.Dir('src') # Get a Node for a file in the same directory cfile = File('sample.c') hfile = cfile.File('sample.h') # Combined example docs = Dir('docs') html = docs.Dir('html') index = html.File('index.html') css = index.File('app.css') EXTENDING SCONS Builder Objects scons can be extended to build different types of targets by adding new Builder objects to a construction environment. In general, you should only need to add a new Builder object when you want to build a new type of file or other external target. If you just want to invoke a different compiler or other tool to build a Program, Object, Library, or any other type of output file for which scons already has an existing Builder, it is generally much easier to use those existing Builders in a construction environment that sets the appropriate construction variables (CC, LINK, etc.). Builder objects are created using the Builder function. The Builder function accepts the following arguments: action The command line string used to build the target from the source. action can also be: a list of strings representing the command to be executed and its arguments (suitable for enclosing white space in an argument), a dictionary mapping source file name suffixes to any combination of command line strings (if the builder should accept multiple source file extensions), a Python function; an Action object (see the next section); or a list of any of the above. An action function takes three arguments: source - a list of source nodes, target - a list of target nodes, env - the construction environment. prefix The prefix that will be prepended to the target file name. This may be specified as a:
        * string, * callable object - a function or other callable that takes two arguments (a construction environment and a list of sources) and returns a prefix, * dictionary - specifies a mapping from a specific source suffix (of the first source specified) to a corresponding target prefix. Both the source suffix and target prefix specifications may use environment variable substitution, and the target prefix (the 'value' entries in the dictionary) may also be a callable object. The default target prefix may be indicated by a dictionary entry with a key value of None.
        b = Builder("build_it < $SOURCE > $TARGET", prefix = "file-") def gen_prefix(env, sources): return "file-" + env['PLATFORM'] + '-' b = Builder("build_it < $SOURCE > $TARGET", prefix = gen_prefix) b = Builder("build_it < $SOURCE > $TARGET", suffix = { None: "file-", "$SRC_SFX_A": gen_prefix }) suffix The suffix that will be appended to the target file name. This may be specified in the same manner as the prefix above. If the suffix is a string, then scons will append a '.' to the beginning of the suffix if it's not already there. The string returned by callable object (or obtained from the dictionary) is untouched and must append its own '.' to the beginning if one is desired. b = Builder("build_it < $SOURCE > $TARGET" suffix = "-file") def gen_suffix(env, sources): return "." + env['PLATFORM'] + "-file" b = Builder("build_it < $SOURCE > $TARGET", suffix = gen_suffix) b = Builder("build_it < $SOURCE > $TARGET", suffix = { None: ".sfx1", "$SRC_SFX_A": gen_suffix }) ensure_suffix When set to any true value, causes scons to add the target suffix specified by the suffix keyword to any target strings that have a different suffix. (The default behavior is to leave untouched any target file name that looks like it already has any suffix.) b1 = Builder("build_it < $SOURCE > $TARGET" suffix = ".out") b2 = Builder("build_it < $SOURCE > $TARGET" suffix = ".out", ensure_suffix) env = Environment() env['BUILDERS']['B1'] = b1 env['BUILDERS']['B2'] = b2 # Builds "foo.txt" because ensure_suffix is not set. env.B1('foo.txt', 'foo.in') # Builds "bar.txt.out" because ensure_suffix is set. env.B2('bar.txt', 'bar.in') src_suffix The expected source file name suffix. This may be a string or a list of strings. target_scanner A Scanner object that will be invoked to find implicit dependencies for this target file. This keyword argument should be used for Scanner objects that find implicit dependencies based only on the target file and the construction environment, not for implicit dependencies based on source files. (See the section "Scanner Objects" below, for information about creating Scanner objects.) source_scanner A Scanner object that will be invoked to find implicit dependencies in any source files used to build this target file. This is where you would specify a scanner to find things like #include lines in source files. The pre-built DirScanner Scanner object may be used to indicate that this Builder should scan directory trees for on-disk changes to files that scons does not know about from other Builder or function calls. (See the section "Scanner Objects" below, for information about creating your own Scanner objects.) target_factory A factory function that the Builder will use to turn any targets specified as strings into SCons Nodes. By default, SCons assumes that all targets are files. Other useful target_factory values include Dir, for when a Builder creates a directory target, and Entry, for when a Builder can create either a file or directory target. Example: MakeDirectoryBuilder = Builder(action=my_mkdir, target_factory=Dir) env = Environment() env.Append(BUILDERS = {'MakeDirectory':MakeDirectoryBuilder}) env.MakeDirectory('new_directory', []) Note that the call to the MakeDirectory Builder needs to specify an empty source list to make the string represent the builder's target; without that, it would assume the argument is the source, and would try to deduce the target name from it, which in the absence of an automatically-added prefix or suffix would lead to a matching target and source name and a circular dependency. source_factory A factory function that the Builder will use to turn any sources specified as strings into SCons Nodes. By default, SCons assumes that all source are files. Other useful source_factory values include Dir, for when a Builder uses a directory as a source, and Entry, for when a Builder can use files or directories (or both) as sources. Example: CollectBuilder = Builder(action=my_mkdir, source_factory=Entry) env = Environment() env.Append(BUILDERS = {'Collect':CollectBuilder}) env.Collect('archive', ['directory_name', 'file_name']) emitter A function or list of functions to manipulate the target and source lists before dependencies are established and the target(s) are actually built. emitter can also be a string containing a construction variable to expand to an emitter function or list of functions, or a dictionary mapping source file suffixes to emitter functions. (Only the suffix of the first source file is used to select the actual emitter function from an emitter dictionary.) An emitter function takes three arguments: source - a list of source nodes, target - a list of target nodes, env - the construction environment. An emitter must return a tuple containing two lists, the list of targets to be built by this builder, and the list of sources for this builder. Example: def e(target, source, env): return (target + ['foo.foo'], source + ['foo.src']) # Simple association of an emitter function with a Builder. b = Builder("my_build < $TARGET > $SOURCE", emitter = e) def e2(target, source, env): return (target + ['bar.foo'], source + ['bar.src']) # Simple association of a list of emitter functions with a Builder. b = Builder("my_build < $TARGET > $SOURCE", emitter = [e, e2]) # Calling an emitter function through a construction variable. env = Environment(MY_EMITTER = e) b = Builder("my_build < $TARGET > $SOURCE", emitter = '$MY_EMITTER') # Calling a list of emitter functions through a construction variable. env = Environment(EMITTER_LIST = [e, e2]) b = Builder("my_build < $TARGET > $SOURCE", emitter = '$EMITTER_LIST') # Associating multiple emitters with different file # suffixes using a dictionary. def e_suf1(target, source, env): return (target + ['another_target_file'], source) def e_suf2(target, source, env): return (target, source + ['another_source_file']) b = Builder("my_build < $TARGET > $SOURCE", emitter = {'.suf1' : e_suf1, '.suf2' : e_suf2}) multi Specifies whether this builder is allowed to be called multiple times for the same target file(s). The default is 0, which means the builder can not be called multiple times for the same target file(s). Calling a builder multiple times for the same target simply adds additional source files to the target; it is not allowed to change the environment associated with the target, specify addition environment overrides, or associate a different builder with the target. env A construction environment that can be used to fetch source code using this Builder. (Note that this environment is not used for normal builds of normal target files, which use the environment that was used to call the Builder for the target file.) generator A function that returns a list of actions that will be executed to build the target(s) from the source(s). The returned action(s) may be an Action object, or anything that can be converted into an Action object (see the next section). The generator function takes four arguments: source - a list of source nodes, target - a list of target nodes, env - the construction environment, for_signature - a Boolean value that specifies whether the generator is being called for generating a build signature (as opposed to actually executing the command). Example: def g(source, target, env, for_signature): return [["gcc", "-c", "-o"] + target + source] b = Builder(generator=g) The generator and action arguments must not both be used for the same Builder. src_builder Specifies a builder to use when a source file name suffix does not match any of the suffixes of the builder. Using this argument produces a multi-stage builder. single_source Specifies that this builder expects exactly one source file per call. Giving more than one source file without target files results in implicitly calling the builder multiple times (once for each source given). Giving multiple source files together with target files results in a UserError exception. The generator and action arguments must not both be used for the same Builder. source_ext_match When the specified action argument is a dictionary, the default behavior when a builder is passed multiple source files is to make sure that the extensions of all the source files match. If it is legal for this builder to be called with a list of source files with different extensions, this check can be suppressed by setting source_ext_match to None or some other non-true value. When source_ext_match is disable, scons will use the suffix of the first specified source file to select the appropriate action from the action dictionary. In the following example, the setting of source_ext_match prevents scons from exiting with an error due to the mismatched suffixes of foo.in and foo.extra. b = Builder(action={'.in' : 'build $SOURCES > $TARGET'}, source_ext_match = None) env = Environment(BUILDERS = {'MyBuild':b}) env.MyBuild('foo.out', ['foo.in', 'foo.extra']) env A construction environment that can be used to fetch source code using this Builder. (Note that this environment is not used for normal builds of normal target files, which use the environment that was used to call the Builder for the target file.) b = Builder(action="build < $SOURCE > $TARGET") env = Environment(BUILDERS = {'MyBuild' : b}) env.MyBuild('foo.out', 'foo.in', my_arg = 'xyzzy') chdir A directory from which scons will execute the action(s) specified for this Builder. If the chdir argument is a string or a directory Node, scons will change to the specified directory. If the chdir is not a string or Node and is non-zero, then scons will change to the target file's directory. Note that scons will not automatically modify its expansion of construction variables like $TARGET and $SOURCE when using the chdir keyword argument--that is, the expanded file names will still be relative to the top-level SConstruct directory, and consequently incorrect relative to the chdir directory. Builders created using chdir keyword argument, will need to use construction variable expansions like ${TARGET.file} and ${SOURCE.file} to use just the filename portion of the targets and source. b = Builder(action="build < ${SOURCE.file} > ${TARGET.file}", chdir=1) env = Environment(BUILDERS = {'MyBuild' : b}) env.MyBuild('sub/dir/foo.out', 'sub/dir/foo.in') WARNING: Python only keeps one current directory location for all of the threads. This means that use of the chdir argument will not work with the SCons option, because individual worker threads spawned by SCons interfere with each other when they start changing directory. Any additional keyword arguments supplied when a Builder object is created (that is, when the Builder() function is called) will be set in the executing construction environment when the Builder object is called. The canonical example here would be to set a construction variable to the repository of a source code system. Any additional keyword arguments supplied when a Builder object is called will only be associated with the target created by that particular Builder call (and any other files built as a result of the call). These extra keyword arguments are passed to the following functions: command generator functions, function Actions, and emitter functions.
        Action Objects The Builder() function will turn its action keyword argument into an appropriate internal Action object. You can also explicitly create Action objects using the Action() global function, which can then be passed to the Builder() function. This can be used to configure an Action object more flexibly, or it may simply be more efficient than letting each separate Builder object create a separate Action when multiple Builder objects need to do the same thing. The Action() global function returns an appropriate object for the action represented by the type of the first argument: Action If the first argument is already an Action object, the object is simply returned. String If the first argument is a string, a command-line Action is returned. Note that the command-line string may be preceded by an @ (at-sign) to suppress printing of the specified command line, or by a - (hyphen) to ignore the exit status from the specified command: Action('$CC -c -o $TARGET $SOURCES') # Doesn't print the line being executed. Action('@build $TARGET $SOURCES') # Ignores return value Action('-build $TARGET $SOURCES') List If the first argument is a list, then a list of Action objects is returned. An Action object is created as necessary for each element in the list. If an element within the list is itself a list, the internal list is the command and arguments to be executed via the command line. This allows white space to be enclosed in an argument by defining a command in a list within a list: Action([['cc', '-c', '-DWHITE SPACE', '-o', '$TARGET', '$SOURCES']]) Function If the first argument is a Python function, a function Action is returned. The Python function must take three keyword arguments, target (a Node object representing the target file), source (a Node object representing the source file) and env (the construction environment used for building the target file). The target and source arguments may be lists of Node objects if there is more than one target file or source file. The actual target and source file name(s) may be retrieved from their Node objects via the built-in Python str() function: target_file_name = str(target) source_file_names = map(lambda x: str(x), source) The function should return 0 or None to indicate a successful build of the target file(s). The function may raise an exception or return a non-zero exit status to indicate an unsuccessful build. def build_it(target = None, source = None, env = None): # build the target from the source return 0 a = Action(build_it) If the action argument is not one of the above, None is returned. The second argument is optional and is used to define the output which is printed when the Action is actually performed. In the absence of this parameter, or if it's an empty string, a default output depending on the type of the action is used. For example, a command-line action will print the executed command. The argument must be either a Python function or a string. In the first case, it's a function that returns a string to be printed to describe the action being executed. The function may also be specified by the strfunction= keyword argument. Like a function to build a file, this function must take three keyword arguments: target (a Node object representing the target file), source (a Node object representing the source file) and env (a construction environment). The target and source arguments may be lists of Node objects if there is more than one target file or source file. In the second case, you provide the string itself. The string may also be specified by the cmdstr= keyword argument. The string typically contains variables, notably $TARGET(S) and $SOURCE(S), or consists of just a single variable, which is optionally defined somewhere else. SCons itself heavily uses the latter variant. Examples: def build_it(target, source, env): # build the target from the source return 0 def string_it(target, source, env): return "building '%s' from '%s'" % (target[0], source[0]) # Use a positional argument. f = Action(build_it, string_it) s = Action(build_it, "building '$TARGET' from '$SOURCE'") # Alternatively, use a keyword argument. f = Action(build_it, strfunction=string_it) s = Action(build_it, cmdstr="building '$TARGET' from '$SOURCE'") # You can provide a configurable variable. l = Action(build_it, '$STRINGIT') The third and succeeding arguments, if present, may either be a construction variable or a list of construction variables whose values will be included in the signature of the Action when deciding whether a target should be rebuilt because the action changed. The variables may also be specified by a varlist= keyword parameter; if both are present, they are combined. This is necessary whenever you want a target to be rebuilt when a specific construction variable changes. This is not often needed for a string action, as the expanded variables will normally be part of the command line, but may be needed if a Python function action uses the value of a construction variable when generating the command line. def build_it(target, source, env): # build the target from the 'XXX' construction variable open(target[0], 'w').write(env['XXX']) return 0 # Use positional arguments. a = Action(build_it, '$STRINGIT', ['XXX']) # Alternatively, use a keyword argument. a = Action(build_it, varlist=['XXX']) The Action() global function can be passed the following optional keyword arguments to modify the Action object's behavior: chdir The chdir keyword argument specifies that scons will execute the action after changing to the specified directory. If the chdir argument is a string or a directory Node, scons will change to the specified directory. If the chdir argument is not a string or Node and is non-zero, then scons will change to the target file's directory. Note that scons will not automatically modify its expansion of construction variables like $TARGET and $SOURCE when using the chdir keyword argument--that is, the expanded file names will still be relative to the top-level SConstruct directory, and consequently incorrect relative to the chdir directory. Builders created using chdir keyword argument, will need to use construction variable expansions like ${TARGET.file} and ${SOURCE.file} to use just the filename portion of the targets and source. a = Action("build < ${SOURCE.file} > ${TARGET.file}", chdir=1) exitstatfunc The Action() global function also takes an exitstatfunc keyword argument which specifies a function that is passed the exit status (or return value) from the specified action and can return an arbitrary or modified value. This can be used, for example, to specify that an Action object's return value should be ignored under special conditions and SCons should, therefore, consider that the action always suceeds: def always_succeed(s): # Always return 0, which indicates success. return 0 a = Action("build < ${SOURCE.file} > ${TARGET.file}", exitstatfunc=always_succeed) batch_key The batch_key keyword argument can be used to specify that the Action can create multiple target files by processing multiple independent source files simultaneously. (The canonical example is "batch compilation" of multiple object files by passing multiple source files to a single invocation of a compiler such as Microsoft's Visual C / C++ compiler.) If the batch_key argument is any non-False, non-callable Python value, the configured Action object will cause scons to collect all targets built with the Action object and configured with the same construction environment into single invocations of the Action object's command line or function. Command lines will typically want to use the CHANGED_SOURCES construction variable (and possibly CHANGED_TARGETS as well) to only pass to the command line those sources that have actually changed since their targets were built. Example: a = Action('build $CHANGED_SOURCES', batch_key=True) The batch_key argument may also be a callable function that returns a key that will be used to identify different "batches" of target files to be collected for batch building. A batch_key function must take the following arguments: action The action object. env The construction environment configured for the target. target The list of targets for a particular configured action. source The list of source for a particular configured action. The returned key should typically be a tuple of values derived from the arguments, using any appropriate logic to decide how multiple invocations should be batched. For example, a batch_key function may decide to return the value of a specific construction variable from the env argument which will cause scons to batch-build targets with matching values of that variable, or perhaps return the id() of the entire construction environment, in which case scons will batch-build all targets configured with the same construction environment. Returning None indicates that the particular target should not be part of any batched build, but instead will be built by a separate invocation of action's command or function. Example: def batch_key(action, env, target, source): tdir = target[0].dir if tdir.name == 'special': # Don't batch-build any target # in the special/ subdirectory. return None return (id(action), id(env), tdir) a = Action('build $CHANGED_SOURCES', batch_key=batch_key) Miscellaneous Action Functions scons supplies a number of functions that arrange for various common file and directory manipulations to be performed. These are similar in concept to "tasks" in the Ant build tool, although the implementation is slightly different. These functions do not actually perform the specified action at the time the function is called, but instead return an Action object that can be executed at the appropriate time. (In Object-Oriented terminology, these are actually Action Factory functions that return Action objects.) In practice, there are two natural ways that these Action Functions are intended to be used. First, if you need to perform the action at the time the SConscript file is being read, you can use the Execute global function to do so: Execute(Touch('file')) Second, you can use these functions to supply Actions in a list for use by the Command method. This can allow you to perform more complicated sequences of file manipulation without relying on platform-specific external commands: that env = Environment(TMPBUILD = '/tmp/builddir') env.Command('foo.out', 'foo.in', [Mkdir('$TMPBUILD'), Copy('$TMPBUILD', '${SOURCE.dir}'), "cd $TMPBUILD && make", Delete('$TMPBUILD')]) Chmod(dest, mode) Returns an Action object that changes the permissions on the specified dest file or directory to the specified mode which can be octal or string, similar to the bash command. Examples: Execute(Chmod('file', 0755)) env.Command('foo.out', 'foo.in', [Copy('$TARGET', '$SOURCE'), Chmod('$TARGET', 0755)]) Execute(Chmod('file', "ugo+w")) env.Command('foo.out', 'foo.in', [Copy('$TARGET', '$SOURCE'), Chmod('$TARGET', "ugo+w")]) Copy(dest, src) Returns an Action object that will copy the src source file or directory to the dest destination file or directory. Examples: Execute(Copy('foo.output', 'foo.input')) env.Command('bar.out', 'bar.in', Copy('$TARGET', '$SOURCE')) Delete(entry, [must_exist]) Returns an Action that deletes the specified entry, which may be a file or a directory tree. If a directory is specified, the entire directory tree will be removed. If the must_exist flag is set, then a Python error will be thrown if the specified entry does not exist; the default is must_exist=0, that is, the Action will silently do nothing if the entry does not exist. Examples: Execute(Delete('/tmp/buildroot')) env.Command('foo.out', 'foo.in', [Delete('${TARGET.dir}'), MyBuildAction]) Execute(Delete('file_that_must_exist', must_exist=1)) Mkdir(dir) Returns an Action that creates the specified directory dir . Examples: Execute(Mkdir('/tmp/outputdir')) env.Command('foo.out', 'foo.in', [Mkdir('/tmp/builddir'), Copy('/tmp/builddir/foo.in', '$SOURCE'), "cd /tmp/builddir && make", Copy('$TARGET', '/tmp/builddir/foo.out')]) Move(dest, src) Returns an Action that moves the specified src file or directory to the specified dest file or directory. Examples: Execute(Move('file.destination', 'file.source')) env.Command('output_file', 'input_file', [MyBuildAction, Move('$TARGET', 'file_created_by_MyBuildAction')]) Touch(file) Returns an Action that updates the modification time on the specified file. Examples: Execute(Touch('file_to_be_touched')) env.Command('marker', 'input_file', [MyBuildAction, Touch('$TARGET')]) Variable Substitution Before executing a command, scons performs construction variable interpolation on the strings that make up the command line of builders. Variables are introduced by a $ prefix. Besides construction variables, scons provides the following variables for each command execution: CHANGED_SOURCES The file names of all sources of the build command that have changed since the target was last built. CHANGED_TARGETS The file names of all targets that would be built from sources that have changed since the target was last built. SOURCE The file name of the source of the build command, or the file name of the first source if multiple sources are being built. SOURCES The file names of the sources of the build command. TARGET The file name of the target being built, or the file name of the first target if multiple targets are being built. TARGETS The file names of all targets being built. UNCHANGED_SOURCES The file names of all sources of the build command that have not changed since the target was last built. UNCHANGED_TARGETS The file names of all targets that would be built from sources that have not changed since the target was last built. (Note that the above variables are reserved and may not be set in a construction environment.) For example, given the construction variable CC='cc', targets=['foo'], and sources=['foo.c', 'bar.c']: action='$CC -c -o $TARGET $SOURCES' would produce the command line: cc -c -o foo foo.c bar.c Variable names may be surrounded by curly braces ({}) to separate the name from the trailing characters. Within the curly braces, a variable name may have a Python slice subscript appended to select one or more items from a list. In the previous example, the string: ${SOURCES[1]} would produce: bar.c Additionally, a variable name may have the following special modifiers appended within the enclosing curly braces to modify the interpolated string: base The base path of the file name, including the directory path but excluding any suffix. dir The name of the directory in which the file exists. file The file name, minus any directory portion. filebase Just the basename of the file, minus any suffix and minus the directory. suffix Just the file suffix. abspath The absolute path name of the file. posix The POSIX form of the path, with directories separated by / (forward slashes) not backslashes. This is sometimes necessary on Windows systems when a path references a file on other (POSIX) systems. srcpath The directory and file name to the source file linked to this file through VariantDir(). If this file isn't linked, it just returns the directory and filename unchanged. srcdir The directory containing the source file linked to this file through VariantDir(). If this file isn't linked, it just returns the directory part of the filename. rsrcpath The directory and file name to the source file linked to this file through VariantDir(). If the file does not exist locally but exists in a Repository, the path in the Repository is returned. If this file isn't linked, it just returns the directory and filename unchanged. rsrcdir The Repository directory containing the source file linked to this file through VariantDir(). If this file isn't linked, it just returns the directory part of the filename. For example, the specified target will expand as follows for the corresponding modifiers: $TARGET => sub/dir/file.x ${TARGET.base} => sub/dir/file ${TARGET.dir} => sub/dir ${TARGET.file} => file.x ${TARGET.filebase} => file ${TARGET.suffix} => .x ${TARGET.abspath} => /top/dir/sub/dir/file.x SConscript('src/SConscript', variant_dir='sub/dir') $SOURCE => sub/dir/file.x ${SOURCE.srcpath} => src/file.x ${SOURCE.srcdir} => src Repository('/usr/repository') $SOURCE => sub/dir/file.x ${SOURCE.rsrcpath} => /usr/repository/src/file.x ${SOURCE.rsrcdir} => /usr/repository/src Note that curly braces braces may also be used to enclose arbitrary Python code to be evaluated. (In fact, this is how the above modifiers are substituted, they are simply attributes of the Python objects that represent TARGET, SOURCES, etc.) See the section "Python Code Substitution" below, for more thorough examples of how this can be used. Lastly, a variable name may be a callable Python function associated with a construction variable in the environment. The function should take four arguments: target - a list of target nodes, source - a list of source nodes, env - the construction environment, for_signature - a Boolean value that specifies whether the function is being called for generating a build signature. SCons will insert whatever the called function returns into the expanded string: def foo(target, source, env, for_signature): return "bar" # Will expand $BAR to "bar baz" env=Environment(FOO=foo, BAR="$FOO baz") You can use this feature to pass arguments to a Python function by creating a callable class that stores one or more arguments in an object, and then uses them when the __call__() method is called. Note that in this case, the entire variable expansion must be enclosed by curly braces so that the arguments will be associated with the instantiation of the class: class foo(object): def __init__(self, arg): self.arg = arg def __call__(self, target, source, env, for_signature): return self.arg + " bar" # Will expand $BAR to "my argument bar baz" env=Environment(FOO=foo, BAR="${FOO('my argument')} baz") The special pseudo-variables $( and $) may be used to surround parts of a command line that may change without causing a rebuild--that is, which are not included in the signature of target files built with this command. All text between $( and $) will be removed from the command line before it is added to file signatures, and the $( and $) will be removed before the command is executed. For example, the command line: echo Last build occurred $( $TODAY $). > $TARGET would execute the command: echo Last build occurred $TODAY. > $TARGET but the command signature added to any target files would be: echo Last build occurred . > $TARGET Python Code Substitution Any python code within ${-} pairs gets evaluated by python 'eval', with the python globals set to the current environment's set of construction variables. So in the following case: env['COND'] = 0 env.Command('foo.out', 'foo.in', '''echo ${COND==1 and 'FOO' or 'BAR'} > $TARGET''') the command executed will be either echo FOO > foo.out or echo BAR > foo.out according to the current value of env['COND'] when the command is executed. The evaluation occurs when the target is being built, not when the SConscript is being read. So if env['COND'] is changed later in the SConscript, the final value will be used. Here's a more interesting example. Note that all of COND, FOO, and BAR are environment variables, and their values are substituted into the final command. FOO is a list, so its elements are interpolated separated by spaces. env=Environment() env['COND'] = 0 env['FOO'] = ['foo1', 'foo2'] env['BAR'] = 'barbar' env.Command('foo.out', 'foo.in', 'echo ${COND==1 and FOO or BAR} > $TARGET') # Will execute this: # echo foo1 foo2 > foo.out SCons uses the following rules when converting construction variables into command lines: String When the value is a string it is interpreted as a space delimited list of command line arguments. List When the value is a list it is interpreted as a list of command line arguments. Each element of the list is converted to a string. Other Anything that is not a list or string is converted to a string and interpreted as a single command line argument. Newline Newline characters (\n) delimit lines. The newline parsing is done after all other parsing, so it is not possible for arguments (e.g. file names) to contain embedded newline characters. This limitation will likely go away in a future version of SCons. Scanner Objects You can use the Scanner function to define objects to scan new file types for implicit dependencies. The Scanner function accepts the following arguments: function This can be either: 1) a Python function that will process the Node (file) and return a list of File Nodes representing the implicit dependencies (file names) found in the contents; or: 2) a dictionary that maps keys (typically the file suffix, but see below for more discussion) to other Scanners that should be called. If the argument is actually a Python function, the function must take three or four arguments: def scanner_function(node, env, path): def scanner_function(node, env, path, arg=None): The node argument is the internal SCons node representing the file. Use str(node) to fetch the name of the file, and node.get_contents() to fetch contents of the file. Note that the file is not guaranteed to exist before the scanner is called, so the scanner function should check that if there's any chance that the scanned file might not exist (for example, if it's built from other files). The env argument is the construction environment for the scan. Fetch values from it using the env.Dictionary() method. The path argument is a tuple (or list) of directories that can be searched for files. This will usually be the tuple returned by the path_function argument (see below). The arg argument is the argument supplied when the scanner was created, if any. name The name of the Scanner. This is mainly used to identify the Scanner internally. argument An optional argument that, if specified, will be passed to the scanner function (described above) and the path function (specified below). skeys An optional list that can be used to determine which scanner should be used for a given Node. In the usual case of scanning for file names, this argument will be a list of suffixes for the different file types that this Scanner knows how to scan. If the argument is a string, then it will be expanded into a list by the current environment. path_function A Python function that takes four or five arguments: a construction environment, a Node for the directory containing the SConscript file in which the first target was defined, a list of target nodes, a list of source nodes, and an optional argument supplied when the scanner was created. The path_function returns a tuple of directories that can be searched for files to be returned by this Scanner object. (Note that the FindPathDirs() function can be used to return a ready-made path_function for a given construction variable name, instead of having to write your own function from scratch.) node_class The class of Node that should be returned by this Scanner object. Any strings or other objects returned by the scanner function that are not of this class will be run through the node_factory function. node_factory A Python function that will take a string or other object and turn it into the appropriate class of Node to be returned by this Scanner object. scan_check An optional Python function that takes two arguments, a Node (file) and a construction environment, and returns whether the Node should, in fact, be scanned for dependencies. This check can be used to eliminate unnecessary calls to the scanner function when, for example, the underlying file represented by a Node does not yet exist. recursive An optional flag that specifies whether this scanner should be re-invoked on the dependency files returned by the scanner. When this flag is not set, the Node subsystem will only invoke the scanner on the file being scanned, and not (for example) also on the files specified by the #include lines in the file being scanned. recursive may be a callable function, in which case it will be called with a list of Nodes found and should return a list of Nodes that should be scanned recursively; this can be used to select a specific subset of Nodes for additional scanning. Note that scons has a global SourceFileScanner object that is used by the Object(), SharedObject(), and StaticObject() builders to decide which scanner should be used for different file extensions. You can using the SourceFileScanner.add_scanner() method to add your own Scanner object to the scons infrastructure that builds target programs or libraries from a list of source files of different types: def xyz_scan(node, env, path): contents = node.get_text_contents() # Scan the contents and return the included files. XYZScanner = Scanner(xyz_scan) SourceFileScanner.add_scanner('.xyz', XYZScanner) env.Program('my_prog', ['file1.c', 'file2.f', 'file3.xyz'])
        SYSTEM-SPECIFIC BEHAVIOR SCons and its configuration files are very portable, due largely to its implementation in Python. There are, however, a few portability issues waiting to trap the unwary. .C file suffix SCons handles the upper-case .C file suffix differently, depending on the capabilities of the underlying system. On a case-sensitive system such as Linux or UNIX, SCons treats a file with a .C suffix as a C++ source file. On a case-insensitive system such as Windows, SCons treats a file with a .C suffix as a C source file. .F file suffix SCons handles the upper-case .F file suffix differently, depending on the capabilities of the underlying system. On a case-sensitive system such as Linux or UNIX, SCons treats a file with a .F suffix as a Fortran source file that is to be first run through the standard C preprocessor. On a case-insensitive system such as Windows, SCons treats a file with a .F suffix as a Fortran source file that should not be run through the C preprocessor. Windows: Cygwin Tools and Cygwin Python vs. Windows Pythons Cygwin supplies a set of tools and utilities that let users work on a Windows system using a more POSIX-like environment. The Cygwin tools, including Cygwin Python, do this, in part, by sharing an ability to interpret UNIX-like path names. For example, the Cygwin tools will internally translate a Cygwin path name like /cygdrive/c/mydir to an equivalent Windows pathname of C:/mydir (equivalent to C:\mydir). Versions of Python that are built for native Windows execution, such as the python.org and ActiveState versions, do not have the Cygwin path name semantics. This means that using a native Windows version of Python to build compiled programs using Cygwin tools (such as gcc, bison, and flex) may yield unpredictable results. "Mixing and matching" in this way can be made to work, but it requires careful attention to the use of path names in your SConscript files. In practice, users can sidestep the issue by adopting the following rules: When using gcc, use the Cygwin-supplied Python interpreter to run SCons; when using Microsoft Visual C/C++ (or some other Windows compiler) use the python.org or ActiveState version of Python to run SCons. Windows: scons.bat file On Windows systems, SCons is executed via a wrapper scons.bat file. This has (at least) two ramifications: First, Windows command-line users that want to use variable assignment on the command line may have to put double quotes around the assignments: scons "FOO=BAR" "BAZ=BLEH" Second, the Cygwin shell does not recognize this file as being the same as an scons command issued at the command-line prompt. You can work around this either by executing scons.bat from the Cygwin command line, or by creating a wrapper shell script named scons . MinGW The MinGW bin directory must be in your PATH environment variable or the PATH variable under the ENV construction variable for SCons to detect and use the MinGW tools. When running under the native Windows Python interpreter, SCons will prefer the MinGW tools over the Cygwin tools, if they are both installed, regardless of the order of the bin directories in the PATH variable. If you have both MSVC and MinGW installed and you want to use MinGW instead of MSVC, then you must explicitly tell SCons to use MinGW by passing tools=['mingw'] to the Environment() function, because SCons will prefer the MSVC tools over the MinGW tools. EXAMPLES To help you get started using SCons, this section contains a brief overview of some common tasks. Basic Compilation From a Single Source File env = Environment() env.Program(target = 'foo', source = 'foo.c') Note: Build the file by specifying the target as an argument ("scons foo" or "scons foo.exe"). or by specifying a dot ("scons ."). Basic Compilation From Multiple Source Files env = Environment() env.Program(target = 'foo', source = Split('f1.c f2.c f3.c')) Setting a Compilation Flag env = Environment(CCFLAGS = '-g') env.Program(target = 'foo', source = 'foo.c') Search The Local Directory For .h Files Note: You do not need to set CCFLAGS to specify -I options by hand. SCons will construct the right -I options from CPPPATH. env = Environment(CPPPATH = ['.']) env.Program(target = 'foo', source = 'foo.c') Search Multiple Directories For .h Files env = Environment(CPPPATH = ['include1', 'include2']) env.Program(target = 'foo', source = 'foo.c') Building a Static Library env = Environment() env.StaticLibrary(target = 'foo', source = Split('l1.c l2.c')) env.StaticLibrary(target = 'bar', source = ['l3.c', 'l4.c']) Building a Shared Library env = Environment() env.SharedLibrary(target = 'foo', source = ['l5.c', 'l6.c']) env.SharedLibrary(target = 'bar', source = Split('l7.c l8.c')) Linking a Local Library Into a Program env = Environment(LIBS = 'mylib', LIBPATH = ['.']) env.Library(target = 'mylib', source = Split('l1.c l2.c')) env.Program(target = 'prog', source = ['p1.c', 'p2.c']) Defining Your Own Builder Object Notice that when you invoke the Builder, you can leave off the target file suffix, and SCons will add it automatically. bld = Builder(action = 'pdftex < $SOURCES > $TARGET' suffix = '.pdf', src_suffix = '.tex') env = Environment(BUILDERS = {'PDFBuilder' : bld}) env.PDFBuilder(target = 'foo.pdf', source = 'foo.tex') # The following creates "bar.pdf" from "bar.tex" env.PDFBuilder(target = 'bar', source = 'bar') Note also that the above initialization overwrites the default Builder objects, so the Environment created above can not be used call Builders like env.Program(), env.Object(), env.StaticLibrary(), etc. Adding Your Own Builder Object to an Environment bld = Builder(action = 'pdftex < $SOURCES > $TARGET' suffix = '.pdf', src_suffix = '.tex') env = Environment() env.Append(BUILDERS = {'PDFBuilder' : bld}) env.PDFBuilder(target = 'foo.pdf', source = 'foo.tex') env.Program(target = 'bar', source = 'bar.c') You also can use other Pythonic techniques to add to the BUILDERS construction variable, such as: env = Environment() env['BUILDERS]['PDFBuilder'] = bld Defining Your Own Scanner Object The following example shows an extremely simple scanner (the kfile_scan() function) that doesn't use a search path at all and simply returns the file names present on any include lines in the scanned file. This would implicitly assume that all included files live in the top-level directory: import re include_re = re.compile(r'^include\s+(\S+)$', re.M) def kfile_scan(node, env, path, arg): contents = node.get_text_contents() includes = include_re.findall(contents) return env.File(includes) kscan = Scanner(name = 'kfile', function = kfile_scan, argument = None, skeys = ['.k']) scanners = Environment().Dictionary('SCANNERS') env = Environment(SCANNERS = scanners + [kscan]) env.Command('foo', 'foo.k', 'kprocess < $SOURCES > $TARGET') bar_in = File('bar.in') env.Command('bar', bar_in, 'kprocess $SOURCES > $TARGET') bar_in.target_scanner = kscan It is important to note that you have to return a list of File nodes from the scan function, simple strings for the file names won't do. As in the examples we are showing here, you can use the File() function of your current Environment in order to create nodes on the fly from a sequence of file names with relative paths. Here is a similar but more complete example that searches a path of directories (specified as the MYPATH construction variable) for files that actually exist: import re import os include_re = re.compile(r'^include\s+(\S+)$', re.M) def my_scan(node, env, path, arg): contents = node.get_text_contents() includes = include_re.findall(contents) if includes == []: return [] results = [] for inc in includes: for dir in path: file = str(dir) + os.sep + inc if os.path.exists(file): results.append(file) break return env.File(results) scanner = Scanner(name = 'myscanner', function = my_scan, argument = None, skeys = ['.x'], path_function = FindPathDirs('MYPATH') ) scanners = Environment().Dictionary('SCANNERS') env = Environment(SCANNERS = scanners + [scanner], MYPATH = ['incs']) env.Command('foo', 'foo.x', 'xprocess < $SOURCES > $TARGET') The FindPathDirs() function used in the previous example returns a function (actually a callable Python object) that will return a list of directories specified in the $MYPATH construction variable. It lets SCons detect the file incs/foo.inc , even if foo.x contains the line include foo.inc only. If you need to customize how the search path is derived, you would provide your own path_function argument when creating the Scanner object, as follows: # MYPATH is a list of directories to search for files in def pf(env, dir, target, source, arg): top_dir = Dir('#').abspath results = [] if 'MYPATH' in env: for p in env['MYPATH']: results.append(top_dir + os.sep + p) return results scanner = Scanner(name = 'myscanner', function = my_scan, argument = None, skeys = ['.x'], path_function = pf ) Creating a Hierarchical Build Notice that the file names specified in a subdirectory's SConscript file are relative to that subdirectory. SConstruct: env = Environment() env.Program(target = 'foo', source = 'foo.c') SConscript('sub/SConscript') sub/SConscript: env = Environment() # Builds sub/foo from sub/foo.c env.Program(target = 'foo', source = 'foo.c') SConscript('dir/SConscript') sub/dir/SConscript: env = Environment() # Builds sub/dir/foo from sub/dir/foo.c env.Program(target = 'foo', source = 'foo.c') Sharing Variables Between SConscript Files You must explicitly Export() and Import() variables that you want to share between SConscript files. SConstruct: env = Environment() env.Program(target = 'foo', source = 'foo.c') Export("env") SConscript('subdirectory/SConscript') subdirectory/SConscript: Import("env") env.Program(target = 'foo', source = 'foo.c') Building Multiple Variants From the Same Source Use the variant_dir keyword argument to the SConscript function to establish one or more separate variant build directory trees for a given source directory: SConstruct: cppdefines = ['FOO'] Export("cppdefines") SConscript('src/SConscript', variant_dir='foo') cppdefines = ['BAR'] Export("cppdefines") SConscript('src/SConscript', variant_dir='bar') src/SConscript: Import("cppdefines") env = Environment(CPPDEFINES = cppdefines) env.Program(target = 'src', source = 'src.c') Note the use of the Export() method to set the "cppdefines" variable to a different value each time we call the SConscript function. Hierarchical Build of Two Libraries Linked With a Program SConstruct: env = Environment(LIBPATH = ['#libA', '#libB']) Export('env') SConscript('libA/SConscript') SConscript('libB/SConscript') SConscript('Main/SConscript') libA/SConscript: Import('env') env.Library('a', Split('a1.c a2.c a3.c')) libB/SConscript: Import('env') env.Library('b', Split('b1.c b2.c b3.c')) Main/SConscript: Import('env') e = env.Copy(LIBS = ['a', 'b']) e.Program('foo', Split('m1.c m2.c m3.c')) The '#' in the LIBPATH directories specify that they're relative to the top-level directory, so they don't turn into "Main/libA" when they're used in Main/SConscript. Specifying only 'a' and 'b' for the library names allows SCons to append the appropriate library prefix and suffix for the current platform (for example, 'liba.a' on POSIX systems, 'a.lib' on Windows). Customizing construction variables from the command line. The following would allow the C compiler to be specified on the command line or in the file custom.py. vars = Variables('custom.py') vars.Add('CC', 'The C compiler.') env = Environment(variables=vars) Help(vars.GenerateHelpText(env)) The user could specify the C compiler on the command line: scons "CC=my_cc" or in the custom.py file: CC = 'my_cc' or get documentation on the options: $ scons -h CC: The C compiler. default: None actual: cc Using Microsoft Visual C++ precompiled headers Since windows.h includes everything and the kitchen sink, it can take quite some time to compile it over and over again for a bunch of object files, so Microsoft provides a mechanism to compile a set of headers once and then include the previously compiled headers in any object file. This technology is called precompiled headers. The general recipe is to create a file named "StdAfx.cpp" that includes a single header named "StdAfx.h", and then include every header you want to precompile in "StdAfx.h", and finally include "StdAfx.h" as the first header in all the source files you are compiling to object files. For example: StdAfx.h: #include <windows.h> #include <my_big_header.h> StdAfx.cpp: #include <StdAfx.h> Foo.cpp: #include <StdAfx.h> /* do some stuff */ Bar.cpp: #include <StdAfx.h> /* do some other stuff */ SConstruct: env=Environment() env['PCHSTOP'] = 'StdAfx.h' env['PCH'] = env.PCH('StdAfx.cpp')[0] env.Program('MyApp', ['Foo.cpp', 'Bar.cpp']) For more information see the document for the PCH builder, and the PCH and PCHSTOP construction variables. To learn about the details of precompiled headers consult the MSDN documentation for /Yc, /Yu, and /Yp. Using Microsoft Visual C++ external debugging information Since including debugging information in programs and shared libraries can cause their size to increase significantly, Microsoft provides a mechanism for including the debugging information in an external file called a PDB file. SCons supports PDB files through the PDB construction variable. SConstruct: env=Environment() env['PDB'] = 'MyApp.pdb' env.Program('MyApp', ['Foo.cpp', 'Bar.cpp']) For more information see the document for the PDB construction variable. ENVIRONMENT SCONS_LIB_DIR Specifies the directory that contains the SCons Python module directory (e.g. /home/aroach/scons-src-0.01/src/engine). SCONSFLAGS A string of options that will be used by scons in addition to those passed on the command line. SEE ALSO scons User Manual, scons Design Document, scons source code. AUTHORS Originally: Steven Knight <knight@baldmt.com> and Anthony Roach <aroach@electriceyeball.com> Since 2010: The SCons Development Team <scons-dev@scons.org>
        scons-src-3.0.0/doc/man/titlepage/0000775000175000017500000000000013160023040016747 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/man/titlepage/SCons_path.svg0000664000175000017500000002743513160023040021544 0ustar bdbaddogbdbaddog SCons - Build your software, better (SCons Logo) image/svg+xml SCons - Build your software, better (SCons Logo) 2011-05-19 Dirk Baechle Dirk Baechle <dl9obn@darc.de> en SCons software build tool software construction tool Based on the SCons (Constructs using) logo by Hartmut Goebel <h.goebel@goebel-consult.de>. scons-src-3.0.0/doc/man/titlepage/SConsBuildBricks_path.svg0000664000175000017500000007440413160023040023660 0ustar bdbaddogbdbaddog image/svg+xml 2008-05-18 Hartmut Goebel Hartmut Goebel <h.goebel@goebel-consult.de> en SCons software build tool software construction tool Based on the pixeled SCons logo (author unknown). scons-src-3.0.0/doc/man/titlepage/mapnik_final_colors.svg0000664000175000017500000061234113160023040023510 0ustar bdbaddogbdbaddog SCons, Book titlepage background image/svg+xml SCons, Book titlepage background 2013-04-15 Dirk Baechle Dirk Baechle <dl9obn@darc.de> en SCons software build tool software construction tool Based on a SCons dependency tree of the Mapnik project (www.mapnik.org) ./src/agg_renderer.os ./agg/src ./src/graphics.os ./src/font_set.os ./agg/src/agg_vcgen_markers_term.o ./src/params.os ./agg/src/agg_image_filters.o ./bindings/python/mapnik_symbolizer.os ./src/memory.os ./bindings/python/mapnik_font_engine.os ./plugins/input/shape/dbffile.os ./agg/src/agg_line_aa_basics.o ./src/save_map.os ./bindings/python/mapnik_view_transform.os ./src/color.os ./agg/libagg.a ./src/font_engine_freetype.os ./src/stroke.os ./bindings/python/mapnik_image.os ./src/image_util.os ./bindings/python/mapnik_datasource_cache.os ./agg/include ./bindings/python/mapnik_rule.os ./agg/src/agg_bezier_arc.o ./bindings/python/mapnik_featureset.os ./agg/src/agg_arc.o ./plugins/input/shape/shapefile.os ./plugins/input/raster/raster_datasource.os ./plugins/input/raster/raster_featureset.os ./src/unicode.os ./bindings/python/mapnik/ogcserver ./bindings/python/mapnik_map.os ./src/arrow.os ./plugins ./plugins/input/raster/raster.input ./agg/src/agg_vcgen_contour.o ./agg/src/agg_trans_warp_magnifier.o ./bindings/python/mapnik_datasource.os ./plugins/input/shape/shape_featureset.os ./src/load_map.os ./bindings/python/mapnik_point_symbolizer.os ./src/line_pattern_symbolizer.os ./bindings/python/mapnik ./plugins/input/raster ./src/map.os ./src/wkb.os ./agg/src/agg_vcgen_stroke.o ./agg/src/agg_gsv_text.o ./plugins/input/shape/shape.os ./bindings ./src ./bindings/python/mapnik_filter.os ./agg/src/agg_vcgen_bspline.o ./bindings/python/mapnik_coord.os ./src/envelope.os ./agg/src/agg_vpgen_segmentator.o ./bindings/python/mapnik_layer.os ./bindings/python/mapnik_line_symbolizer.os ./src/shield_symbolizer.os ./agg/src/agg_trans_double_path.o ./src/projection.os ./src/tiff_reader.os ./bindings/python/mapnik_proj_transform.os ./bindings/python/mapnik_style.os ./bindings/python/mapnik_shield_symbolizer.os ./src/image_reader.os ./agg/src/agg_bspline.o ./agg/src/agg_trans_single_path.o ./plugins/input/raster/raster_info.os ./agg/src/agg_vcgen_dash.o ./bindings/python/mapnik_projection.os ./bindings/python/mapnik_image_view.os ./src/distance.os ./src/datasource_cache.os ./bindings/python/mapnik_parameters.os ./src/plugin.os ./agg/src/agg_arrowhead.o ./bindings/python/mapnik_feature.os ./agg/src/agg_embedded_raster_fonts.o ./src/libmapnik.so ./src/placement_finder.os ./agg/src/agg_sqrt_tables.o ./agg/src/agg_vpgen_clip_polyline.o ./bindings/python/mapnik_raster_symbolizer.os ./agg/src/agg_line_profile_aa.o ./bindings/python/mapnik_line_pattern_symbolizer.os ./bindings/python/mapnik_color.os ./src/proj_transform.os ./src/memory_datasource.os ./plugins/input ./bindings/python/mapnik_python.os ./src/png_reader.os ./bindings/python/mapnik_envelope.os ./bindings/python/mapnik_stroke.os ./plugins/input/shape/shape.input ./bindings/python/mapnik_query.os ./src/point_symbolizer.os ./src/filter_factory.os ./bindings/python/mapnik_polygon_symbolizer.os ./agg/src/agg_vcgen_smooth_poly1.o ./plugins/input/shape/shape_index_featureset.os ./bindings/python/python_cairo.os ./src/symbolizer.os ./bindings/python/_mapnik.so ./agg/src/agg_trans_affine.o ./src/polygon_pattern_symbolizer.os ./bindings/python/mapnik_polygon_pattern_symbolizer.os ./agg/src/agg_curves.o ./src/text_symbolizer.os ./src/scale_denominator.os ./plugins/input/shape/shape_io.os ./src/layer.os ./agg ./src/libxml2_loader.os ./agg/src/agg_vpgen_clip_polygon.o ./plugins/input/shape ./bindings/python/mapnik_geometry.os ./bindings/python/mapnik_text_symbolizer.os ./agg/src/agg_rounded_rect.o ./bindings/python scons-src-3.0.0/doc/man/titlepage/bricks.jpg0000775000175000017500000010776713157757627021012 0ustar bdbaddogbdbaddogÿØÿàJFIFHHÿáExifMM*ÿþCreated with The GIMPÿÛCÿÛCÿÀc0"ÿÄ  ÿÄM!1A"Qa#2Bq$3R‘Cb¡±Á %4Dr‚ÑðS’ácƒ²Âñ5Es¢“ÿÄÿÄC!1AQaq"‘¡±2ÁðBRÑ#3r²Âá4ñCSb‚’5Ust³ÒÿÚ ?ÿuŽtúÿ,F9̾_Ë$HDªžúÛâY9qðÇÎàÍ5_ÖÜ:ñ扄“ÔúÃE ”¾_Ëù§\b«† m ö.xÙoÃ’/_ã‰) n­°¨Dˆ›ßÅË÷§.]8`Zs¯ïKBÝUS_ÊÃoÈx}<1ˆôlÉuwG¨PInžàœ:p·ç~˜ ”ŽÜÜEùðK^ÿEãåËž'wÙ{Ú—«w⊗¿Šq^?^>8„qÍwMÛ¬èã¬}Þ$¶N?.IÒÉ|*kD%åoÜR }_ß|zWÌ™^‘™¿"zíqvFã¤öôÄ^aCÝÔÜ£ÆÝoÇ h'6•CÊI6íA– RDq¦ÑC¥ÛTñN=o…{-‚š©{Ëtüõ*[÷¢a‰Ÿ%ê'd<È‹ªÜ0àëȺŠKÏ’òý›xÝr¬ž§Ö4“ó}ð0)1dT|•!Âq…!-ã$¿túð^õùªtºA9—ê0…·…æã‹¢¢6¾ÕĶž6óDD·KrÃZ—GŽ•3&¤²?|l–Ò¼~²"~cò¹NlÅÝÑ¢4qï\MJ©òÙ‚ð¶VOSë B ¨­\rn›™·ï¨9úŠcÑã~b¢½qå œí‘¢8­q’zÁnˆIÙËâTE±r±¢§K`â«%•2bi¿=f(j«ÒÊdJŸ4åe\ÖI²!Ái°!'$6ネD®5«Ÿ6ˆyp· &4Ÿò农ƒÒ!fË¥EV¥5kzõFhÃÜ÷—ÝòÔœ<“EÁ hQŽŸ™R‘™J[Õy0Ê–îñPeÇ ÷Ñú¤$ãÀ‡½È± ûðÁ—©¶ãl® m¶¸ˆªŠ[ü\ù{ʸ q"´çõsN%qÕ“î*¥×ìþhWEãïêñÇ‘ò§ùSè#0Ç•3o9:+ŽÏ`]r*±?„·.e­Ç¡ßÙ¨¤ù€€çÇ|WåC–TÈmHjEßì§£ìÎFWIEXø-«‡âà|5`j¥P¡§e…5ùí¢´ÖÿÝlETQSölˆ©ÃÝTðLV¦–u6’é¾S t˜ûÇ U©.”NIÇ»Ó «æ?zAFèðÂß–7sœj^^aäÔã +jzä"¥’ÆIÏ¢ìiN˜^Ê6¥FW%·À c;#C`Š(KaºÙ UOÍJø‹ÌVó5sµTjfõ+„§1ÀÐDå’É£ ¸wPñ,oÒ¨ª-ïgI 5$$ÝÇž”Øðl–WÇ­´øPzayß/ß’]Ï>"Ëei´QV@–ÜXíŒÉT÷Íþí¡Í@GÍUo~Tí jq‰/6úTk -Js–¢Ëwa» T穱QÕ¸&Ú{¸lÕdÐ)ÑÖj´Ñޝ›úQòQ2ÙR—ë]Þ¦œýSjðãžÕ¬ñDÈ#b•R)ñšŽàÕ{}Ü%'V¿òÈQÏüMâ`o¥YÒ½>†ó†b¨²Fíóâ CÒ¢"©ÌEÃ.|öŸOó!Ï' öúx< {Nž™j¦/¼¥_ˆ!ÈýÖŽ¬fl甜§Li¢™!øÌ¨#1‡L4tW¸„ÛnÖövöIvþVœý˜ê•JsRg * ÆŽ¢Ü¶$hnShemÀ‘¤röEpMz®9ìç¥Miªƒ’{ U¶^[Ém*:ÅAAøQE<ùð¾ùƒl³…{Ö5“ÌÔ° ®à ‹hëq좢(é—R"?ŠøV³eÖ*XR®¢VlHèö/¯ãyN™*ÝàBnx0Ó®{ú9*•(Ò3*·Û$´ñH*|È]ªðÅlGõ^úê¾ó𽼃¹’¹›š©Â*C'ÂŽÒ¬zd(ñ–_fxwª´ø±þÞ ™+ºø™ë0î`‘WÙ½:™2¢þk¦f ®FW˜ÑvWT•W@“—àm dŸŠÃ‰*m…SU•GœQeËFỹ–³N:´oMøëlP¼,H1ÆÔRVSÕ$ÏËÞìÚÍfзµO15-ºl@ݸÁǨs ìÏž*0ÞG ½[f_f’!H‰L‘œr\Uõƒ’ÓÂúÜSáÞ]ÍG#µÜáI¥Á¥ÑŽL™® aQŸMwsEaÙ@¹M“#«ç¾Rq~ˆÇ§ìý²J~m¤Ê§ÓåII6'ºå†ñQA5þÖ2QÔwámÄ%ÁÍaÅ>ƒH¦zÖ#0Øp˜‘"A$`ê@{VÉËïl—ÙºFݱ§NHH>{; ï{u~#Ì5,(-Iž^X,–à†äЗÉYª¯•ެʬfz¼§Nntèu)“çD#FÀEt­€ ò.õ×µ¡PjFìé5Ö"ÅV—³Â§FªÅ5sJ *9øž4W¯ŽÙËeð()P®Ó#ÇI–ÚŠm=¼pžuçÍf©$ÌŸM7°ºˆW$,æl¯³Œ½e;™)TÄ¢Ér݃³©{BœüËñ²•^4ôĵI¬ZŠ·AÞ%^7áÌxˆ§$¢Û¤nöwo¦žMèVëqeÔeÕçEËð&¬±:c¦© IQ™ì«ÖqT pT²wm|ÉX¢ÉVœ¦öÁmÑ”ëçÜšñ)k’¤ÿ´T3U Õ{7¥º‰ ¦íe[*”ê}rŸ5¡’0Ê"¤µyglˆ¯ÈwõŠñ¢¹o Owë2zBSëÈÌOÑã¦ÂQ0eÃ>ÌÓ¢ª}Ç ^z¿j>D·bE\Ò&Îþ±Ùa aÓ“ç^„Ue5:‰-¼ ïl·FcÞÚDæt{""I§WgWjY©á&+qê ,T¨ÂcÙ6B†:/¬lâÜpýG%åGÚ¨Ö³dfèæàÈ [›‹)Aö£?ÆèôTy"9n˜„ÖRÍÒB(ñuÝÃqé“§»W©Î%MÔã²›¡iÆôé÷”‹¼K‚òÊÛËNªg ã¼EàåÑ¡Eªv’dÐHMfÕ£IŒë ;·ÖöÂd›ÐdµD‡©C½³ô±ûNОªe–’C 8‚åº3>y˜ÛËù݇Z–âÓê.Pêo¸#53¶·>#ŽšÄpª*Ú§‡»Ós¤Vs~ÂËAH ÁŠ©.Jo«œ4BRÚ‹úõ$$$wÑQSž%úAlë/qºI•.,ÛDóTæŒæ—hRVnËòšEdÈ£ ‹ç»Fô’@f¿Ihõ‰r#µIy¸zS²¦?¹Þ#n(‰³>è”G§Þ¯µá¯$ìÍ£>LÀ†ÜüþQƒœ³i­¹Iý§K!‰g êìÿmÜÑaߥ¯d>×5(Ô¶ã*Fµ¡¼"Ѝ@±ïÝGÜÖàýè8/_Úc~ˆÍ šMAÊmAÈè ±É‘ÒsU· þ×ñû@;/À‰¡,Šu'm•ŠÏck+Rê³æ¸·ªciÑw‰4Ú¢&¥#×ÍÍj7LѪ° U¡®i¨f)ù„€Uâ¢Ëœ­ÂUDVšf%7í!v­^¤]Áš‘˼’§ØS>"WÅß‘a_»Æ'mÚdS.Uÿ|ñF–o¬]Z¾ÓrEâÔj€sžy‡ +S_íò©hN¶÷Dq´¹«fÉpÛÊU\Ÿ;-¼Q')k FdsUÒR¡˜jHŸ«±Š¢ŠõE^Å,f.JÌεÛaW"9Ú[R+%$¥ÏuDPœ~-?í#»u ¶½mí –Û7=ëã3u.‰³ú{ߤ÷ž§ÔA†’™)øtú{O»(œ`"%*­¸*Lž«e°W‰Â•©òtË¥LŠa:]*C‹&ÎE˜g×lzˆtñ!u=„‚¤ÐÍm[N:ÅÂ8µ6á?*>bj¤L)SaÃ#íÅIªèœ¼{ÛTm:wmk¦4é9/.åãÖf¦”™ÂèHdZŠ}ZªEÝ“Tmïj„ßkUõ6iÝ$Å‹¶ü­•Ž-ŸzÊ:xK©Nm™µ7cL«?1ø*MÎõQ]Œ&/«æÉiô'›2[”ö‹3>¥*<ùmº¢<íK-ÏuØŒ’ƒt–~J»!¡mÇ¢5¦Aº(®Š#Æyû Ir›‚KjÏ_—qš]¡¾”¨›©)&ïr—>~NÚÅʮà •>›—™HjoEYRhÛö¡ÀÇ âm–öR”•ÅæFHW+áCµ}²ç-šÀËp)ó2Ûu,ÇP¦ÑÒ­*G©Ø„|‘Õ2wÏ ß·s~:]D[j[FMŽåiõéS E­0‚šT§©íÔsÀ;’•!ÿj¯“f—º¥¥,"–«û+Ë;AÚf}§çŠ„ŠdúœšKõ˜4 ý+,Ó÷RX¬L™K’ôɰJ–4i´¦©O›{ÇQÙDã¦å-!JeÏÿ–”C0¶7w9‰ûChïSÙ–Hçr3†È~&5½<+tµ™³,å 7@ÍŠÍ]§–D9!ÇÛCv•K` ðÑ"A޾ã¯9¨Ü#'nP¢Ì¨¸Önqªó0g4sØ­åø”ú„º‘qq†aý²Kq‘”ï.éD{ª˜[z\eʤ܅•Ë0L¬W³þÕ›b§MŒþ^{+P(Ôú³«¼˜ì¡ÓÆhEHHÌz¤HS) S) í.$7œ±ÞŠY~]^“IËÕÊUO0H§ÅaÇêq´@‰L‚ÒÔ^¨(ÿùoxM2_¬FÅoÇ'Î÷†žMÞl´y”§7áÎ%ÊA\™“?å“q}Ûy4$ó5ÌÒö` äWªòjaVkæáh0Ù$Ó!¯´z˜I¢ ‰šXç “m7d)€ýœÑó”ÚR¨µyïÓé5™2jÕ<ª0ÍgLŠÈ1*|ϲÔ„ÓaO¦¦¶[Œ1Û´æûCF$½—vQ3ÓiUYs(ëN›@õ6`Íu‰òÜ—2A²¿w@Ò7H¯dÿÖbge;4ÚcÐà3PŒóU©T™ Ò¨šä»JŽóí·Õïj"¶¬†¯ÕˆªwUdí*_q2[hÝÄÏà=-ÐTûíÔEú Ôÿ¼hƦU[nhåŠy‹1cÌÇQ—¿©&kà' =%/a…¼’zÞy¿f뺤%·‹†–Ê2:›ZzVmš­MöYÍ·ÔÛ¬F‡ ØmøtŠ•E¾ãÏ£Clû8Å.ó%€¼¹T¯Q³C”ŠÖBÌeLßÀ!iº^q‹* FeÉoV¹xÈÆÉoH§ySY4é™ö&[ÌUÊ^Ë9„+Óêo³©™iaÓ)¯ïš±à¿*[TØñÕ¶7ç¨ÚR"H9J÷ĤèHðÕø³?†bÆ-Æ;¢ÖåÊ(W²>dqè2¡UäÔZƒ %7/Õ³1ÅÖ„ßRJ?[AªjNînìê&ìÓ?äø9o>KŒ»X™3mR–ÛÙË).$æ2 žÇ=N\_·H¬Ny€Ÿ „ç}aËa–:»èÏB©?S•PJ“4ú©Ám©Ùƒhµ¹ríN{Ι¬ ½K•íÝÀ…`ýà({" UM¦Ñr|³fø°bT鹎0Çõ…z©G’ÑH²$¸S¨a!=^°¡! »oZŒ.9í ñKiQ‰»-`’€¦:î§ï/¡„6uWÃÖM,m9~;ßã˺”ÌÉ(!§ hΨëP»*ñŸ¨SÝÞ¹.”êë†f…¬ã¯Ô´†Ø<-—lü›š³hÁL†Ž¸Ý`¼TÚë©Å.Üñp§:ÛˆMU/g!bè`'äÊ­o5D-È•49§O­½F§6ì•bJè(R)·|‘@D%-î/‹ÃÌpÿÏ•hZ+-ÑòFUy «„‰•ˆe")FHè Û’¢KûElͰtœºG5(àˆÛAŽ6FÃ5Lµ0T ®D0-Þ:i¬tS¶¯Ã†±†þ·Þb‹fÜÛ0O;/ìï0RF­ú=–ò~P¨æµ ¨™tÐdZ´l·ýI8I$ênSßxŠËûK’0œ²^Æ2Ĉu¹¹×`L™Vˆø…rƒ u,Ib Ä/³¶$2Б¡ö¢£oªÈq_ö۱짶¬ÀÕ/4fuʱé~ÇPÉF¤IG‘%_öùJB¶Vœû¥»vÛå­ˆz.lš¹”åæJõ]¹ó`׿Õ^¯½V®!ï¤GfgØ·q]UŠJ7CèeÞ%Ç«i¶d´î&ÓÒ™Ã|Ç^]ù‡h*j•º©–’¦( Ý’ëãï¾,„Ý»ú;dWáS"Tf¹P&å-TãB•S©Ì2ž•vm"Öé·¾n ©ÙÅ%A`DZmà "GŠÙ¶Úèa–ÛuQ.N÷•pÕì½NŒd-4‚za²qçš«bŠ„zÙöK ­£•¬]ä\iA&’i ”?x(é¼À;õÆ¢7ªœ%(q³¡´%6‰´Ù´ªÔ.Í‘|©E§S©2!·. Eá Ž8(¨>êZÞwD_ª]z_Èïeùtîó½ÿÝüñ*ãÌ“š5j²ýÚt¿ÿ«Ýz*/^xó” *èÞ<J_óæ¿è9tU^ªˆ^}WóEãŒJùó+Ò37äOAý±¹TF#9¿÷‘ƒÓóÞ§ñ·_§SÈâ•%=c¸èÈ0q¦Ä_К÷Ul=:ßÅn½x*Þ]ó* Mš¶ì¯t]kçÖ÷ù/ÎÎz-=¢Dm¦‘§d4*á+!(¥¹rN¼ñ•dõ>±ªp:H‡ZÆå¦¢C<§$ ž¥­†‘”FÌDú¥ÅP¯È‘9cÒµS•<eÀkJŠ6u$†èë©oPï⨾$+ºÌm‚&Ì,ŽHk—çø‹¥9ð<ð'Ćé>ä©RÀûkî{ÌÄAA _š§úáudõ>°Âp:H ¨ÄQ- yw¢çµtmÙûÝäÿõŠ£eûBVEÀŠD² L=¦"#ãk’]VÝ4¢ÛæŸL1j'DC–m±”ˆÑ—ö’jÖhËüM uÒ£ÁØìÐ[G) ²„DRÎáj]½}Í"žHœx®Ÿ§wÖNAéÎÑq,‰C5TÊP§ Kr+qDöfªÚø¨ay=êlWNœÓ’&iSC5âÁ';N⮂áï óÃ&§Pe¨O6òвïtZ7ˆâû­Ú? :…U{ʺ¾,'³Iº\g“L8ò”ô×CZU.Á §ÔʶK⤤¼ðOßâ …^p«Ãq˜m¹ À´™´¹tEáùÙmÕ 9u9NŠ´¨‚rBTÕu⪼y©*ªx"ù`‘ñ‘&A¸L‚«„ã—l4Œˆ‡H¯+"¥øq[¯\F±@¨Ôq¸ppÀ•HÆÚUŠ[ä‹e¿ÞÉŠ M(«æ7:Ü€Hk7å¤ ³S5e ùA tãÜöó<4¨µ?W8‡&/k4Ö_…/Á~‰o$¶«]¡É¦Œƒq§!²ëhQËÞ`ÈxüÎæœ¸x`6M¯²á:TòlLÏÞ²%ø¯ÓÅÈ—Ä ­É‹5ËAÐrŠ–EDòº*¯]J¼ï…gË¥¨äåí«±ú ~—fB*¤1ã~/öøëÜGQ©0àÌ8ÄÛ¢EpŠWÝ>:SJ§" ªxŠôÂÚ«^8—iÓM {6áýÖøqg¢¡_çÏæS˜Ž@SÞ~LÚr 4¬ {·ÏY+–)ï*¡]ýÔ°ôà¬ç‘YšD4a¤FÜw|rLWmÞÓ¦ÉÔPPz`b˜X€…À 5á |IÔßQÏ_ÃÎ6+¹Ý·Ùìn=Ur°æõÙ vaaP×HîxhBæŸV¿‹Ù&| ïÓ9Eš|1$h÷»Ê‡üB]âñøü-€‡un—',6)èH¡º÷ÏMà¿”m<‡9{-Öê»ÎÇi°Ã1÷ Ç¹ºEmÿt†Åׂâ6Ôá riŸ6|súiК…-Æ ÓÇtÜzë J|˜2áU¦ G™SIOŒGôGm‘}ÀM ¼®)¨¼KR¯TQ:åR¯E‘L8Çz!«¥ ÷ªÝw‰¹)!¡ rT4$· :ô5ç%XpÖ °ç6ߺo8J¢ŸâT$Sýµ$ðÄmb€TögÌÒé´6¦Á @Ѝ‰§¦ñ{ÊT¯d½±ÌÊmëaÃt{}"èvÙkõ×ÎYËh•i¸°cögœu´qÞÏ­ShWR{ÃÆâ¿†ÉÑp—2§9ç‘Z‘%çÍèæªê0ÂïLÍZøt ˆ—â!Rø°ý«APÜo-1žB=ÓïïÅ4*†­Ï #šwžzï×SaÓ߆LI¥E§#ï–U1R@MÙ~üvÖ–RÅDÔ IL›ðy±½˜žO *MIQ)Á.:qÏ!å»1eÔjW 2Ù •up“’|í¶] ¨Øª¬QÌQÄÐÅGH¢*[ðU¿%áÓs;7K£²šIs˜}Ã&XœÇg’Òªª¸ÅìNj&ÿDña`ÝY™±É‚ã4‡!ÖËûJ*éCó²"ìéà¶àõ,Úšys7M´õ{¹ÔrxB®Dy/ÞÛ ìüݯ;e¾©dÊ5IN/c6ŽH¢¨{È*—T[øªªóåeålKËõHµ%b) ´`ñ~¡²2U%}Jë˼«á‡¼¶û+gRf1DCPl†(··—y;ÉÂ*_žb«XZÍ©$@p‰Ö\c[N®¡D.7K*^ܸ§LuuQ@,0újÇÒ (’@)}ÒNpn1Ê!šÉ}’<©K04pnQ£r4²l ÂÒĪ+⨫XÔøíÏ'¦¿)‰OIiØ•&‹[m{Õ´B^}Ô[ò+¢òň­R© Ñ–XÓ;1¥´ó/8:x@PÃÓ¼:WÅQK |Àì3`™o{l¶í  ®(6BŽ‚á}D¤gàdIÆØå6…uT⤻(o ÜŽFv’ŸÜ"Z‡äA±äø_Ï7‰˜ÛWÍy>€¢Ü3s¯K2&Xkw1°iÓi¢—!=ä&„? JÅ <íé=œ²…9Y¥Ñ™Ë•J¶¹­‘m&¬Já¿ylˆJ.©…=G<æfB»MÊÓܧœX̲r⇗Cê’.]Þ 'T^·ÅvÎUz„ùí%F·P«8ŽŠÌ—P÷À¬:›e|Q, ψ¦ ³¶Z§„ÔT6êR’pÈãÔZS´Ä²S'çI)/ÄX縰‰üÝ·¦æ¹R«ç*’8KÙê3~®v0¸)¬NQVê‹Ââ¨]pœÍ5Éï„hg˜ªÅséRþغÅãB‘úÍå¯oÕßwnââf»%Š…V•I¢Ód´©ÈsûQªˆ“Ž*ò#"V“þ^Œ|欹#³Ï^²QiˆA¿q„q°]B„¨}t­ÓÉR×áŠäR‚Á­aŒAåMU\÷$›ÜpqÇ—ù…|•¤2¬Lu§³€‹3\• š‘.–IMÒS ¨¡vW½¨\QÅïßX÷I0-3.®÷zÅM™„܇;K¯†íÈ‚n‘ 0= @‘μ–ø&z¤ÎXlnkÍR) RQH û«&`#DÏá#]@[Q^¸ äKX÷4í½1‹è gàër‚I˜²}â³)’]îSbnü¬fZ£û1ÉR3®fŽÍ2tòr]‡7e*Œó#m\Þò]Ù¡úèãÇoþ'¹J ¹™¹õiùÒ§1ÔÞ¥eZ>$Ý€©qî’¨§»­§gÌÅ´ ·l­ÔfÔ SØ*}e1Ù©ÔæfÐÙ_t&Õ×WãxÜ?ŠØV7KrTgô“Äl ÷“‘*ñO%æ—éçÇ)6m=:f€V¬Y[¡üHôÌ%Uµª¦©HC²TÀÓN`¹u‰*žÔ³‹ôå¢I¥¤×j¦Òô‰µ'7HŽ_Ç¡Çð qÓÆ*‹Pí1ùC6¡SyÄu˜úµ!‘¢•øýÚª­ÃE¾céò{p¬>óª¨"+Ô¬–ëák¦Y++¤½W¬fGÞOa¥D¦BHº¨ºF»´‡¿ö›´î‰jð[\tà•“©)÷ …LtƘëÁ•§—WYP‰¯Ý°7àÍl;3ñ¼MQN±Ø¢H‘6¡K†Ñ¡»!ùš›p‘Â' 6Ýã4#ø¯‹™³ì·O˰¢W*tÙýhÄ!Fr£Gj¢ìW5#‚–ª4ŽT×YÞ­Ü`›u¯dmÚ·å,¦U5‹X•êh²Ûg =U†ö›DMÊ¡±ìÕ×@t´ò' Å« ‘§ÔâÊ܉¦ù³Y€Ìª¤xS;R²€ßª£Gû{M¨"+šø™©¸ÃÇ?.¢–tÅ#ò¨Ž6 vúk˜é¾¦H -ÚbµÀbîÖç‡M´mÚƒ³øL”%U¡çJªE,ÃV~1Ê:3dâ2ëèÄBbhkÁTµ iTÅÌ[CÌyš¥MS0UëÓÜbÕŠ·mß‚4Ú²>@"î£|ÇY–‚ë5:ƒó ¤éUEæ)H‘%çœYd·åÚA®õU×t]ìÄ,M”vxUÒQz˜Üb§ºL³F¦žáÅ%3íÛÉT×Á ÉdLWøšJUL”aœ]L:äÚ"­µ•bTÒÒÂÊ@°6=í £e´,ÏHW*3i›Ø•V§À$œ1̪ ír+ÞÔi­£–| L{¤8µ3ÑkµÝīě.lFFM!’Üå°VYW«B•í¡FŒZÙŽh·&€æX©UlÕ^boè&K¦ƒre µ5§ m!4®/n_½Võ(•îî­ÜÅØÍ6¡–©ÀÜjÅ9ÙÓÚf-AÙ3;-*˜æ˜fA2­ð–àÇÄŠƒ„QWïfɘã÷*é¼ÙÉíG•H)¤L÷/¾ aˆ±ï°ÿxðô´¡@qÉõ¨Vjðè³rå&ŠUÚÄš‚U‘ žüùîoo›U$Ô”ð„/bØ·÷b)‡¢–P¯Tsùž¶ü¡SrJ•IËíÕ*é2ꮵé/JÀ›qˆ¦(ŠçµqGx÷¶#Å&ô‰Ú*–Ñ$Žõš•F‘]hÞªÆouôöŒü´½ÿ÷µ—úî,j'¥ã´œ·Re„©Òj&m6’)óû4Z˜ ae /û˜¼†u…àÙLu^ä)Tê‰QÊAá/¬s*¨PR‚ÏhyŒþbzAç #›n:¥^]F°Õ’í8¡Ó¥ ï 0Ã-5G§J¬Rd ËÀªÌÜ8lˆÄ]0 $ûÛëÔÊÐÕh”°¡ºÄiÔš\JO¬&̦³!¢Ñ¡2 Äh²¦HCßL,¶ÛÒ^xÇP’Q<š ?/2fZ´z#räTÜ™&Åí•zB˸F²ÝðUGdz-Oós»'íµ’¨:•js!Sª)Neù*û1¤2ÿµz3ËyJÚtÍ8âÚ›=5’“K”2plAü;Øæ+l™JU=J§žÂŠˆÝ‹[=ö×H¹QŽ\‰˜ó~Z™“e@‰.¨þb‰yV-ãÞiàßõ-9·˜&Ý6 ÿ_¾„NµÜq0K³M´4ÃÛ[Ï4 ËY¨£ÓË´Z¥N™N¡kjK/-UÉÎÓ~Ù2[ziGÚÝ݉ËûQ»„NÓ}*òÝ+'9G]=¡çzõ¤Ìš=I”¨s§¾ÔrÄZ¤ÉJƒ´è 3´G^: ™ <ìÔfø šŸ"¨µz=:¥T¤µ±°¹é>¨)"Tåi#ÅmÚ1µÇa€ŠÉ©3TPdÉ™âU,‰s«*Z1}HOÞ÷æÑ¼’š•{š`ÊAÜqg)a¼ì8´›͹™¸UœÙR¢BS~šQiÕ(çWƒWgZ«4õf¢äšIÀˆÔŽ ¿TIÀÄ\FÒ䬳:‹ºÔZ¤Õ^Sm$X”ù2XtΠ]®J£¯Qy§ßq·J–Â2O‹î>ho¸)‘*Ìå‘Õ+µò›§éb õõ@²ô5(°“uúº1™d5~·Nùx9Äûgt*»¹=Ê}0;Wj™iõnÚM$7»EÍ:ÇŽ6j2tŒÛIˆò¨Ðµ’‚*O½EÀ´ÎÐάGê1·×.rÔò 7}䨒zç íÌ^vM'$RÊ´þhjlHe[iºfâT#ºÒ¸Í¤8ßDP»fk¿&´”n®â…3A¥Ó3ms1V§VêU:»Á1ÂÍs'“, ¹ØË4˜]Öôc;<­Òzøè×'e*NG‡.¡˜mNyæŠz²==dEiÕž2¿¾¬T4lÒÝÇÚø1ÎJ£TÚ„šƒÔ'ªy©¨¯•B¯Q‡DkFöOiÿƒzÛB§Zþìæ¨ë÷Xµ´iM-‘8€%!öènºsñ„6q3æ¨1`£¡lënï®a¬Õz&U…SžÄD®?ý²­RATªOÎuÖ ¤ïªdöZmbÂüý›"]Û¨ e;1mP¹\ÏYS.T$Ô€¹4×IÚsÉ7f–\xÑP¸ 5†Ì͹­ñpÊ#$ezNhuªP敦]xiÓó, ;t·ãÞMZ{þ×4îßGdµ|=ÔKí;ñé´Ö¨¬ÓBŒK9,8"Œ´ÌmʬqV‹- ñ ñ"°Ú«Ž¦¤T"—EF%kCn«´“cbÄr×Å¡º¹»•”è¹ ÝàÀqáÄED©Ën •%ËÙ¾¯—Æ©.LeΕQõ„ÐŒ +*¹“Ú°öQÞ.ìE¤}‚5‚›l¿&E„Ëù¢{S’b]¦!¹òÝUyÃ8´ï±‚ïŒ7>𠛾؜À3y2°zQiRYN¹:½&°2ŸiÉ/e’%eëy»îoÁÒ$€3Ù ^ µ[ +U*ýr"$Ú“ò^ŠÌFÜKoŠs~Ò"é/‘bcneâÆþ”S²¡SYaØðiï;¿n4˜™±…µQm·[ã¥AG[_‰§ºá%µ­¾e ©/µæÙôz{/LìÒ<Š„-ˆ‚ɉ—ã§o˜åmC²ƒŽYGZ+~ÏF,=Ê”Q­êUÎÄŽK …E¤4mñÞz½˜¬û);Å4pDy¡"ÉWþ³³Iž§8m)¿*SŠ›}Ô0ét˜L+‰PFKÝ+ŸïZóÅ9;$­RÇav nߘlkÝ ÏÚóÁþ?üKÿĸjÿy¯é}°y’*‰™h0¤FÐÚUéYœwm#"Ìq L¡d[FÚh_ql@;ºt æJÍÛ"Û+ôº>JÏ4¸¬56C§³W•B¨NžmoT5ˆÒ^²#"ã!©­ ›Q5ÌÙ+eOÃÍ5ê|Ë ˜cAK¦UR¿ åvvÁ¾ç÷uDE^Ik߀ç̃—a±2VW‡/-I€HRš•.zºO ºÜ{$[ši÷QPK¼+„cSÔ—U”X«ù¬m†Ïû;À“µêiR¸H ,›`±ÊjŽ8¢^D/]@iQR~ôEÖ…Ý? N‰ˆ—ëQŲ—uúDzZgZÜö2F[¯Ò#Ä&ä ‰L@ÑXˆá: ½'ãP@ez2Ls“/ç\éNšõ:NhÌãðfDœë—iÑ G{ںы¢…Ä…ÄTEL6iOd ­M©f*¯¬gVn-S»dT"(넪¿‰Ã"+uçnƒbÍ¡ ]-÷‚K çãlÞ%TûA"±JBÜ,+uZ9p k›êÑý•ŸA!pNéZÜüüx§ÓŽ^•½#öºQH¸%¸%Õýq(ç¾!ÿÛˆWtê->ý×WòýÖ·Öøú4pjÉê}cBA¨®£T[—ä–áóãËÏΔªšQì> ©oo÷ã‰'ÉHÈ Ú’×·É-åÇòÄ$À݉‡çÊÜ9~üz1]§z…¿y5-ï~,œSÁ-ÿnƒš H@Úê‹ã{]>h\øãÝòÔ$^#üSùcL Ã!d}Ô_⪶üÕ–=NAéȈÀ ¾Biùªªq¿…¹§®ªHBãˆ^ö»¯ÕS÷*ªá¹&2¶1Õàh{ýÇ ÞUTã’ðù[ zØ’<é «¯8š‡ÝTCQK|‘ä¿@#ç=OôˆÚoÈžƒûb9¾Ñ»{qm:[ÞøÛ‡‡_Ëè/Dj UiË:‘XÔ=·!{y_Šõ[Ùp‹„Б6ÎïV³x¥Ð×yáàH—áùáŽív—„cÖ1âî[œa>ü±A]\í®Ú‡öI0xÕ8¤ɨº±Ìš#D.ñGÖªŠª©rø•Q‡ Ó Éo¶ŽFI °O='R.FèÞ–AO¢_®5_ÎT&Ûn{ft#?}uw–üz*ª;¹àQìå–»H8&.¢ßÚ t1 pUBø¬H½x/—ÀŒ”’Oø?¬f åÈ#<ó‚À’ÊDT²¥·i»n":§Õ}RÔò¸êiÐŽ{=1õÒÈV.¹"ßÁxp\{¿œ2œ“v±mKnʼ8ª"pðåþ¸›ò©;¡‰¦HÑð|ÃvÉ].ªt¶•]+⢫ÕpÒ,;´ûÓÈâ.tàt‘»[’i È$ÍÐEWCC`‚¨<-ÁéÕzñ¾3héZ¯Èƒ}Ò<ÝÜXßrˆ‚<|’È]5êú¸jy¶Šôw*Ý$i_NWlt~w)k_Ëù"¡GŒSkRf0Ã.?¡ýÖc…¿/(]Jª®—™Uh˜Qn+,n­–Ïþ"+‘ø8¥á€Ùp¨ä¾°>ÐÀ8BòIíZ”µ®ïÉÞ^8;¨æ¢m:CP‚eCÔ¼4¦”án7DEçÍp¥ªVh:^r J6’UÓ ÷‚Љb±õï!-Ó’Ý:cY*20ÖéfðïÕŸLüO?¿üažæÈí/>Kp˜Ë‹ºÜðVSÙ¯»À-{q¶®«…”\’sš m›®Š–©Òª7B·éÔ©ÑJÝ0ä¬O§;RnlרHÁíô*êᣧ;yó¾&RMã¡£ñØi[5Ú}Ë*ÞëûKrãÏW94Ukî}ùæð réÕ1JQº”Iês ¿ëÎÕú³H“F¤JyÉO¼$ãqôéѹԂ«Ü^\ï×ÇñãNÏ“©m•9Ê­T¨’"„wš‰÷îOAEhXá÷:4£¿µ­zpÞÚÆq)šu&™!¶šiõ‘)ö‹Y¼£} «…ÔEDÃJ"yWS¨OzYg¤]ÇV®j*J¨«ä¢¨¸QTER&)_2œž¤‚[ï-«AE`—Q- ùPÈ †I´Ô6fw¤Vâ£S#DÜ€A‰\€&€ÂNo»£z÷ƒ¦i|+±ª9m‰Åh@a_ ÜÆq¢'G¦¢q¿͵\ ²õ¶rBCk[ŠÙ8ßic[ÎÍâ`Ž[  ° §4Á_üo–)RêÙpÎrö‡{C!¢"<º*m‡K/ñsRñÇ&º4ÍZ“'ç /|X÷xiÖ:)Õ-¦NùÚbÅ®Aäqù¢ŸJ™V@|7’÷7…!¿?f¦­“®Ý5bžúB"1Er¨Ëªá‚jDì÷îð$Ú¶¾à­­m%r¨å^¢n§rlÝA@m|PoûW®«™ÙSàÌ&IÒU) Á,*£Ó‚'Í,¼í‡éöJ˜o¾ð{‹€Íýt…¦íP&,$öB•»v³ÛË»…£ãj® /ÅHR7ž¾àkrvTDqU´Nî³ÔIÕP­ÇyS.”™dRYFòöMƶ…UÁ.¨Š‹{Û½©’àc2O'ÜÞÉ“Û \׼Јˆ‚º“š  §—+pĶTÚ}+-¡1%îÐ&ÙsöjJEÇÆÊ_/ã†gÐOM<ÁNûÀjúZçÓÇ„WÈTùj©ºK6`G7Ç镸 >ô–I —¡Æ0) ކÛEï "<,¢ IÕQUyásKË ¶äÉSÛv4ÐаÄ}ã²€O}$º¡©§€(§L9´œ©,ä¤Êžé]sY÷ydNŸ˜ØQÜËÞø±&æÖvxTµˆu¸Ž¤fÉàŒëhÉÌP"âMôÐH +ñ¡|IŽ~e>ÔJK¸ Ú¸n~6ÑrME.’7OËq†ýK×½£´üØŒ KD¥S®Þô]ÜGpyˆ#_ ·}Ñò»€d¼×YOÊYñÛ¦‰,v›Wd°ÉknBZÀbJ¼tŽ”. bEN(˜°y—.jÕ9[?´…Öà§ÇޏÕW>ŽD´ÈB·ÁHÝ[¾ð³tÞ˘QFmןšU:k ¾uw‘ÈÜ](\¹¢'‡<f9ÕŒÉXšˆÔhäSÜ¿ ÷ HeÔm×^ü*Ž/‚’øbÇeªÆÎ¥0ãU ´AsvÒiw¢h¾(¡¥S®•NxÛŸOÙd¥}Ç+TÂÌM›û²DtÒáÒèH¼¸Ý¯&±rf­Ggâ¥>\>œ}G# K”‰ÈBS^””²KZÁ’n1Œ¸óŠmNÊŽfQ8òã³.52Sp’, L(FMJØÌhŽÞÇd³nkl®@¸ÌÉ‘é¢4ÄVXŒËwÒS…*KÄÚ¨ ¶Ý:Ðõ*" £W[[z›íæ’ g¸OR¨•jcmºü€hõ¸à£‡©ºó[x'œt¨”Í–ÈxYmøÌ¬‰M8¤ûúIDT—GDRºøª­ñ´êꥠ‚„EÎè:–ï#iR)²•-+ Vã´FKæìí§Er¥eI¢I" ¢¾fgN5ä£Já+„KÕ=n7àÙÙs#Ì­½ ¨M,}Ê*´ßTý¸@U73»ª”F9<©©=ì\Œ½”²ÈÅ+TeEº«MÊö© ‘Ûñ殡¯H¾Ù5÷m¸^ÐMq3D¤GÊô·Ù£ÌjC/¹0˜uvEm¹Ï²¥¦3Ï"¸M´¦­¨—Ý#IqÆG=å]‹·_™. ‰B&÷tÉ8Û‚nÝÖÀ‘QâBæ¶ÆkhYU£(ñ*´I,ö§¤#[á†Ú™(7Û&§ÏÂò/+a=ŸMW*´,ï1S‡Ð¸bAt{ޱRº¦Žu4ư`Ärà\3Ûœ ö“±š…%Ê|Ç3 !Ùù€˜FŠ»¢q_Y!ÆÎ jAçpнxÔ²U&%=2›M¨É©ËMDçïuÀdäý‡DØý­Ò—\hfºý5ÜÆ“¨óí>ÃÒÞ‹ÜtÌÈ”‘Šª€þÊ'Ë™j›X¯Ô¦S‚5GJG[wrÚdQŽÚ|:´N¤„\—‡oQ6ªJä¨]ÒœtM›ÙáB ,ÉŠE»*)~bÝïôî´ü¶Tù° É‰P’@®¤Ó1§«lºÏUŸe÷"Òª‡2UÕÞUÁ·Y­? ‹¾vLz081BTI@Šƒ7í)¹§€ox¨«k»PÁÕ&"¹"WªG¤½*ãR­ëÖüýis2%ç¾E¸óîª'E\mÉscÈQÚ€Ô‡_aÅŸTnDð˜ìG#yHYöI¬È´éæT»×L&ºåo+x:œ½žî9qo(pQ‚îîéÅò,ÚçQrÝ&d‹™êS0P2Ãpßj$i4¹gê혶ÛÎÓÓîÔ5²?¬e[sãÅ¡ÊÑ3¤Šg93D|F¢rF,¼ÕJjÑ©Ž¼â˜FÊîõ ¡ŠsT¹w”¬¼ÙæÇ³6L(Ó¢ÓäFŠäæJ )GÕg¨ ²úœß´ª8ˆ&ó’ {4 XzQÏ9’²ó™Þ³I–1d"7M”mGµ²úÂCÌû-ìa³M(§lQ{È·‰µ+äNAAÞpàÛ$06äEïk^(lÚ ò¦¤†'x `±çË—s6“™o?çHðò½O6?“2yÍ6RSÙŽôª´PSq‡ö²Oëy¿Yw·D[û8·‹¡³Jöcؼ ”uGBŸX§+/W*.ѪkJó/¾Ôob)¥ÔV,k'®êšà~™gù)U¢zÇ3Véä×bbz¿W¢½!ÆAÝ̆©©½ Ss{* ¶ì0·ý ®çLÚõw>fIù¡Èí”zN[ŒQh”JìpcFö1* (5YNûBˆ.ûd“KPeÐK>jÃ9_Öµkë.ð—`oP(–èn¢ƒ‘s)»”}æ9Q¥H‰H‘£ì¤ãˆðö8Öâ‘ÙZº’­Ý¾ùÄ6v3E6>^¦öÖ]I !À‚ëc"3n(îÈÚ>ަ¿t\Aê ê;*ÔàeæßŒF:n̵Äe¦Üt§—WLŒœm8ÙS¦%L]MDébIð¶÷5YøkÜJRçnɘ‰¿ÂK¥ù7p×äñÓ]‹íc71µ˜Àõ)iù/5eètÖëÒ{¤‡T¤H˜q ïh«¸eµT.¾ïuS{\ô¾ÉŠÅ_#=´Ø;_T¥W¦Shg*°Ô–c!†Ù(q)pÚ7õ‰5gPÑQ×U§Æ›åŽ×6….¬™w%Ð+2¤ K¤îänÏÖP›A £=´늵\Z&£.<÷ÞYèû…!d·”]êk.© ÇM¹”áŽãdΛ"A‘Wr´‡,ruŽ3jÍJg&}1º »›¹ý-˜¾ósÏe¨WÒ•Un%-‰ I§A¤,pŸWZn ¯Mr,¹ìSœz˜ë.d%º°Ô·8Ù2Ý|Úvdš”Šµ:dh˜X‡üÏëg^h^ÓÃ}´®ä[Twõƒe\WÚu^¡[ò£ÊPyÐPl;B8 ‚¨³á¥-Ôl½q㟳Õ[=Ô#,à¶Y‰AÅ€¬°êÈÄ6ô‡1%m€Gz+šË¯ „¹Ü#wð·84#ûEJí*êUÔ[Ssç9-Úz¡Sªfê‹£‹äûr7•® f§Bÿò" `Nþ¤…[äƒÏÕSj†å8g„FB2J49ÛQÚgxêü$é6N£i÷(hÒÛw€aiun.6¼ôè…ÓÒá¥yñç×5”—"ºÅÅz÷•:ùßÇÏ”·‘à[é )[Ê*üÄ«ÇëÛâfîË»çÂ÷çÉ-ÝÏ’…ãŸÏ­¿w4ýÜo‚ …©áP"2" ¨ºª­¾¨¿†Ô]wÿÏ® $“ϺØhÓ¡wœ8Ýn–ù"Ú÷éǦ:Edõ>±:5R©—Tãôàž ÕÈ©à«üw–ª@Ék²ªxñýÖ½¹ñ¶!gÆ2xù*ráÎÜ~Ÿí1ˆô Œu3l×ÝUáô[/?•ø`y(hÛ$o6ª¤\×J*%þ‰dãÉ1àÈ6€Mj"ããr%[|•m×\{—g¹î#è=ÉïñK-¼ø'¦=NAé j¤ñp[ehO éDÓÅÓT·’'?<TÍÁ(†=Ô^WD^\ºÝpÃn9¼ÛŽ'‘¥¸ó«ÇÞC$²òëŸ$ó ®´¨ÕÕm¨Ü4åî¸áòñOö¸²zŸXÌEíªˆ7ï Öâ.¼8ø/– +M’¸*VÔ©Æß$·’påã×ðV㢮ëFý=î|–÷º¢óåòLVÞ¤Ôm¯YßG»ï//ú_Ž1+æ?̯HôÊjê}xª¿æ©çå©íwK—‡$ñOåÏï-È×Å?öâNëx:¹ÙoáõúZØb¬ž§ÖK¦¥oŠØþj«ò·õÄsíꎋ¼Go©5­øØ—ørúybv~+§—zßšß÷àfKÏ]O» õï/ÿÒÛÏ÷ “ÔúÆ ~K\Kóÿãýê§Ë®{8Ù>¡!kO2#AI¡wîÜЪŸõ‰¢ù§?+g Ë6rä9½Ï.|±æz)FuRÚjÙ׌ ŪP⤪j¨Ãò!¦á¸–¡m7b“àÔ‚%o‰ _ÅÅ+žê*2’40hÕ”e­Óh$ªI¥¾•n«nñ*—Å‹G›ò,^]pÝqÑGM–7‘D°¡6]nˆ„väæ´è–®l†]ŠFü}:GC Mq¡q”AéìÌ­Ì•WåÉ"¶žTés•%*VË;sNB:ÕÑÔL“2ZAÝK„ëaa݈ç%\Û$z28©»p=Õº"­¾WT_;øpª¤vÐYíVÿ&¡EEÿ¥S§]1c3nËêPÎb0¨ýŸyUˆÎoT\""u?EÞßñ-ÉmuÂEýžæw¦ˆ1N”.¾$ËÎ’|mÞ5h‚º¬½Q5u\u4Õ4«ÝWæMm@8ïÿV¢–©Èo””¿KZÝï©c›Bv¦ÃÈ$|Û^)üÓ…¹-üp 1½BáiÓÂÛËq[&›§Š–ãnXhfœ¹\¢(D–Ëè¤Fᢎ„`Õ¥ 6[hPÓÕ×L.$Ó¦šˆ²dÞ÷Ré/xT•UoË‚ªÝ:qûè7 qq>‚ P(@Øä0º©´6]'¬î½äëáùr¿K`¢ÝÝpè=μÁ?.~ †UB…PŒøƒÏûÊWðïqN‹ÑS•š[Œ¸mŠê2T¹]8êTþ?šy.<éâŸ/½„g´?0ñûá œw›B/Ú/µ/ú|üÖËlUA¹8¼.ŸÁŸDúqæœ0ÛªÑ&¨õà¼zÝ‘<ùÿªrÀ-V“ T›ÔVTRæ‹{ÛòK'Í1§Ä$6µ˜âÃÂê’I%Èrâç—.¤©ÆÔ¦©Á¥µ¾‚—ðø°>(Ø´û½9/N<üýß›^u î´n28[‡4TüÑWÿœT2õM³BZ~è,ª…óN+ùßò^<8Ô\±:Ó˜ƒ …Πm9 :Ó.ŠØwÖáîòä—TúªÞÝzà&¦oHwh‹bK’\P¸üï{pçá‡S/T$1jâºío%T[ü­lL¢OQÖš•Ä%ïYUU/t·º©Ë¥±° ÞÁîÖÖ2Ê /k èÂÞ^P¨R–û¯€¼ö–ím>ï[tN<øó¾+‡0uŽùþêÛï÷và—îrKÿß®jÔiû÷÷f-…ÒÀ>è®”½¾kuùªà ¯H–¥)u7{‚øª'–þin¶Æ<å÷¨ñ€ç-½“Çë÷%)o‰pºj×ÂÉñ|WKsåÅ:cIÙsÚ ¶ûätª?£ªü=8Ý<ítN<&]¤¼àïî†ê?.7åæ‹ÿ|G-:L›£{Ý«mïD[qüW¿×®B\Ødè>õY;ûß‹Ï÷«µöN%Fd{{ÚewRȈ¶ùÿùb vk̉Uªn’ª\ÆWt­n\>wæœ/~&oQ&ñíÛåºD]‚_íç–ç8]§ô$¤+Ûñ"þõ['˜Õ‘Á<ì8þ­ß™õ€•vE†p1cT­¼»Ñ›P"DEqJW²Y/eè(‰ò²®7»˜PâÌ“Çê•Þî÷U8|¸_òã‰Ç©n²›¡eýjJœ#ëã©U;ÖºôóNWÆ¡Óå°JЩk+]’ :‘ ..‹«‚ñBEëŒ<¾(ñLl>0€YWì¦ÐÛ½¼£ñœñš˜ƒ.˜u7ûË+­k×bDD¶®j„©©9ÚöNX†ý Ì@mK} ÈžCÝ •ëËž™5‹ª%Õåÿó#ù|iôúãYü¿P2$œʉÙõûÈ„½äN<þ‹ÃË ¢u'¼XVë…ãÙÈ ÿks1‘&°Üo^ì7ºðˆDÌùŒnû²qÆŽâ†ýµTT·±ó²]:­ÖöUÁlÝ®gZ­ÔÒ’Ø¡²È²•²Å:mœ–㥼«»—R³P¹¸j¢¹!Y 1ØÜ0ÓQÚ‹JA˜åö;•±¸ƒ¢úÕOÝ訇dù_®>›¤ÉT®6BO™ õèD¼ø'^x8ŸDoÙ:¸#•ñöâ3»Z›2íl+KDgé-aã0]ÝÛp×¾ÈÇ>&«Å¡qÑß#‹¬lå‡V”œ3!RŒò²Et5cÞK-¾}:_Ÿi~˜Þ3í< ÂPl®ãD{…p•Uî·(—ä–LTgâ4Žª2$ëWM&^ñpãtý’¸§¬½1%qEqÑÓtåÑ8'O+§Í1™›?f¤ oZîÀ¨ïaµ¶“%˜5Æ,ß}8^ó;éË]]ŒÔ4!œ ˜‚ *9Ì®hKn:UTz&<¨ÞžÆœN¥J‚Ô‰jF7R×xÛj«eÿ¥RÝl·¶)”ŽÛŠ ý„‘Ïñ-þœÿݱý5³yÂkš’¨ÛððÓåÊßÉola?eî§Kµƒë×ǕΡ´ŠB­p ¸»·­üG ôï*HÝ>—àf\"¼3ŽÚÔ`6¯™¸n‘(¿íStf­&®zGº©cŸþ¦HÚÔ»2¨Ä’ MG‘ ©LÞ¤”UCÿ) ¢~Ê|±È±§¨Š!_R^üüUS—–<Ö™©Å>ÚÅ×àD¿/ôºàeì²I4;ײÿ5ÑëåýµµSÙv{!šín:°Ž¯Ó¿¤S Ó£Íd¶iVªI¨8NΓXª5ý¡г¹öWnÈ ¡>Õr¾4ÜþÜŸ>[ÔvoR(àÜxg2<‚ГÞÕP,£ÞådDî¢c•Ï x §ý(‰Ëé×c¾6sÿRôåŒþÊÙŸû~o¯éý¹µ8.\úyGLê~ÙDš|)y ÈuŠN>ԆؽÑewI¥UUtó[ª÷•q]«^‘ÏÕÒc¨ÛQ%Uš•!†·'gRà›«wt6 µ§R*êÅPìˆ*¨œ oà¼WåÉ1æôR°êà·ãù¯Éyqù/Ž 'dÑÊ;ôéÜR˜î½’÷#L\›·v¤ÐQ;äH`Üüm,Ã~>|‡ PËIòšHè·%~4ÔB_ÿ·iä>8…™š`>îùÙJëŽ8FN¼D¤¼åÊþ˜W”}ÛÀ^\—§?írã­Tÿ¯îUK~îžWL>)Ëë ‚ IuM†K¨ñÖÑ 4ø¼6ýÈ>WáûÓÇçY†Ëew•\Õ©|;Ë©>vOôé€7¢9¥wni+/ [ÃóóÆ»,¸ŠHóÿíy[éÏÿŒgáútaú·œϹ¶§OÐÃC×ÐÝhu=Æã¼^8Y>ˆ6òñ¶'eVh)3mNV]ãŽæD‰õEO§%넲6¤ ½ÞO\xßýøxcȘÒ6Õ©Äæ·à·[¢xpDúx®1*Ÿ´«jlÜü8f¶qïùy˜þí &:;_ê‹×ÿ?AIŠ=äzܾ‰ûü¸ô8¤ ¿uEÜð¿&Ÿù—½þn<ñ áIn$·d}¡eE¿üE"[þû§O¦ Xœ'L·HVÐKÍÅDAT_’¢K[ÏÙÍÙ ¶:ÕO\Ñ~E}\|zp¿£0;8Üm—šÝ2Ü@6ŠÉÇX м©øsÀ-iþÐË%«[„ßñÒ()ù¢*¯‘/ƒz„;áòÖ©ä|Û¥PN^(7¿ž*®´ãL¸Íýš"#‡Wëñªê·íxàùÏSý"=Ù}Þæó»î•çÇùýq¤Í=Ùïn», !ï?ynª¼~I×N¶Ãþ]ŽB¥"xKP²·}-%‘RÞ-{|WEå€:µ.žO¢Óæ4öñ4¬rkvB‚šUOÅ{*óà‹§¥ñ¯Ä'Äþ‘ŸryøˆKÍ‹Çõ\½{s[}:/ CJŠí“Hˆ§üÁä¿éeº/š/d˜s]R}æ#•îM,ÍzmÉuuÔ–;tÕn˜Ùwg´W4Ê`M¡!W5ë½ÕWÞNv½— [¢`*®Ý%< aãSDU{^÷mb¾Hƒ%û¶ž–\Hx ÝlŸá÷W…¸/,@Ë£Ïi·ioƒ%ï/»ÇÍ,¿_Å—L…œÐ›Y‚+*ãÄ» €é_RÙCšsániÇð7#ËšªLÔã´É¾ãNœÚ–ÙoID˜Uà\‰*¯5À qsŒž`é¡,1Ä(ÙÎdªS%Mn‚‹Êó]Q‹˜i_­ù¦U|µZ¦’Ô—4#e&>°² ",sꪨº¼é~²„ktTj#™Éט¨<Ä2ŒísCoîYm–ÕáÄÇMúà*¡IªÎ[™˜à¾ {ÇkëtÜ.á‘ù‹@þ\.ªâç< â‚àÖïåLà ›¤Tˆ .2 ŸÐGˆ'; ß­ð8îG¯"’8Ê1%Î÷?z‰ñ,Ÿ+ßOìY1aßʵV¤~¼ÜrTCa¨#àãN.öÂïÇÀ‘ü–ãÒØªe’Ÿ¢µZm¥pw*a*~÷Q&¢UÜû?}ISOO{½{$½§Rw\%íŒZÙ¾ÍΙL@*#x€N3g×§”WY»3®+"«6 ºíÛy¦ÖHªª¼O©Zʼ¬ª¨¸‡Z3"ÒÒç·W’mäÛ¦AÝŸ²o¤_¼*6Tü#aãl;bìÛ2דO…˜ÐÙŠhØÇ^m]Óï ö¤ºî—?un(š1¿3cù†xñ¨5[f/¸TtÉršå|Hm¨\ô6 v¥H'³®m|sûqÞqCL ’À¶ð–…JË”9mA‰D„sÜŒStVµIjhªöuïï«£Dð$¶ Ë1²Û­¸”:ƒ‚ÚM"‹dÔ ‰Á¥±AN[ÂEsãÇã{ÍnWR¬•*twÍÀÞ×{T·T—õùðЖû½W$(mR’@Ü'i(,ËeÍë¬Ô’©,$FEhâReERDêÍ}Æø%Ô4 ºÉŠ©›,©Ü€H{9m.|wwÓ£BS&`0p- fHs§Nu$Sò¥JKqÛ]â<ÇfrV¤U"V~h•[øÀÖÚ°ªÌùºe2JGc+Ô9ï­“-EpBäºí¯‚Š¥¸bìå­¤zGF¦Â¦eꃯ„x4ª\82röI•5éQ)±c‘B~ µ¸È“E«yí@û¸]í»µ<û º.~‘ ¨ MÏ~+1#IJ¼ÈèÓ(å6,xÓYt†Ø¹©Þ¸*ózÀ2 ^ÏÙÒ¥‰’ëJf¨LK>êËo$r×<9AäTTLiiùQ`ü¬ÿN±ÏÚÆÐ*4§]©žAœùŒgâHxb'gpÉ[!O&Ô­ñ)yáTÚÕJœ¤É ° ó²ã8’b¢¤@u¥&Û^?d'þnxè•S%gŒÇ³9›2slÔºW¬V£Õ¤;•¨MTdTeÌg{™*×ñu#âM7-.¬“cìˆÂâ±Îô<…I¬g}¹E§Âm nœÛ†Ø¢,!v­×íwÒâ°Þøt¼:„Љ‰R)Œ©fJ”¹…ÞS¢”¹åpý5…fK¨›1ipDh5×¥¼›PdÕ(õYÁ^›Nâ e\ *Ø dâGäŠj kД”ºññűPÕ‹O©8äTe‰.Òt7DE PzqEU[qU¿TÅÑÉ{9¥eIss[ÛžZ)Ùp*IWZµ;fV^ƒZ¥Õ(Ò/HÎp*AQû(TSysäÒ"nÈwM£+Û©–gDslt©ÊWªmåÊ6^ˆn@hÒ=WF¥±.IŽÕMe•¿õIÌ—ŸD³wS“Äñ ánöå’…nÒRÀàܼ¡!V¬Â”òÁ &\š¶€V•ý˜‘¡Ö]9𑝸¿%›Ù6<ùOÔj2̦⪠4ïõ`&Ò‰ýéM”z/w§ åL§JËùG:åöSgYÌ3Q˜sM3)¹˜i.Ex&O¦Óëmɤ…åÆ=ù°/Õ4“ª„Ø++@£d-›çgókÙfÉsŽ]ÕD©4ZÞj—;òd6¦©Ü½6–Ú¼*jP[Ô g%Å9OM›H´N•/ãÕ,L !.Y îØ½­¨Õº~QLÙ3ð)[;.Σk‡l뎠G.sFIÊ5–REJ›Ji˜ÌlÓèG1¢«…su—½¢"­ÏQ}î­êwM0«wd9jôÆB{̓®4ÑT©`¤†ôðQG E^¸êæÙòNÍóÍAšõÑ‹%R`WhP½Y“v½ (õ(ó©q^©0Ü*êC˜ÚIŽó­„Ë6"hÚ÷G1P[¡OH“²õ.˜ÓJ ´Ã±å™4&¤ÓÒ$¼šÍÀÝ|Üt=$j3l*§f­§Ú**˜ÚWÇù'‹¡GEOR„*£g¤&RB4vHH¿Ç¡aPØÎ\ŒnG¥,‰l5$…§[ÝTÐVڜ՟eIÕ>øü*„]õ,%«»õ”÷…Ê 6Œ ˸UèÉj®U*¿VóF¦ A\Z˜õ 52r™AV‰ Ñyæëà(ˆh„ÂnÖë{iòBï_Tý’æðZÌÿ ÕçÜ5úk2ëFì™>°r:3/?í&"¦õÂ÷\CTîÛØÚ²{_K›†W£ká%Ql¹ËÜ5û³M z6ä¦3[­…L£‹èÚH¬ÏFY¨*´q¢·ð¶fm~!Ò}pM#a‰t|Ÿ-éÉs¦u"ªOåú$$£Óhw‹2ê&yטwÀÓý¤ÜkÔt}ÓŠäMr7=±û\Ù†yR‡6]&8£¯Ri˰“N©NŸ*rˆÓâ·#ì‚–ŠýT8Cu\Š}öŽÃY÷dùMi™“*W2Öo?ÂÌT¨ô™r¯N—C‰N¢mºÄyôênX›"ªóS$ÐÚvgé 5\xspæ®;R×íZ‰†¢~Ñ"X$¥ÜpEµ¿Xrªƒe ivp3R“˜…joÇ™ä^ŽU½ö\´º¥c-ÃÃ&UL S¨Õ<ÉS£K¢n½O5ÚÍNµ$ËÓ)P^pã<Ú¶Ü© Òép•1úÞÆvI”iížp¢ìÆ£ž*yL–•ååí <ÕA*‘A¹ 3˜áÄ¡úÆ=%X­ÃÌ'UvŽQ¥2T5jª®6ÌØüMŠÌ¡Sò.Ôbí}šuB2·^ÎP ÔjÌæ }EµE“±ökqE¬¦ú0ãR+rîóFQäbeqÏPô=Ìó¥•V·”+ÍV93" HÄ‚ó®èG"Â>ZIV+(¤*B$*†[í-¿YA,{Ý w' ä€äî©”îäý÷+ÑlzZ…±ÙÀC㓽¾ß™r¢…]–Ü«l÷-e¶2¾Q¤Ñ©MåXò£Ù’ 4©b•Òä\ÄõJC²VKuù®,ýÃ¤Ô {àL³èõèýP¬ a2 2¸(’â2¥š35€ù¾ÅV(ºU¡Ìô¡'"ͨÓ䡤õIÇHY{J¡vÓd£ôú½ /…^#Ö‘>#råpxâB@Þ¤L‹Êi[û(¢6/pŧÎ^‹þ Ìʉ@Íž–mÒ%QC<7˜šÈ®cYݺP*Ò2M.—^ËùzE-ª¨ÑËoU=aPi¡¨ –û`¼Ú+E´«ë$ª}>Þ2ÊC„ ,É#Mòá‡çlújqðó¶rL²Y% \X"ø×…ZÌ ô`§Ã›2N˲ÄzÖ™™YÛ;ÓãF§6Ñ[aœáXjcDà¶àÔd$–È^$a\Xì‰OGhÑ¥R`loe üé‘;3ògObe´‡\Enõ9§<¨¯:o¾zÒVô²­€ËfOF«vóžÉùÒ­H2Þ`¤3:™¾E¦ÈŒå8FC))ÕG·-êe…qZŽã¬n…sdiqhÉÙMG-ω-Á¯¹ Ë7Mª7>C±Þ~ku×[&’ölv*¥‚3mY‰$›×eÔûE] ªBö‘ZÔYKÊQ,TüÍÆx ˜Ýu;»5%;£vÚ0oÃÿ:ƾ\¢ìÊ4癉³S)Ð ¾úÔ(Ôø9¹é2%R1”‘Ì™4æMÖ.-9÷ I Òú8½™ÜÈéP‚—’¶k*©"¢tÐf5!ˆUZœd9»%2;¤Ë€Ñ6­8Ût8ÂDÙ*#ê[÷}Ý£åŠsséRêC 2!±ÿSËj£)7CKu·[j°¢ÃÒ)JG#!§~D”¼‡evi±íœçzxÏR³õ*‡SÊ´¨²ƒœiÙ–=s8zÊ tÈù[,½I¢Ö²ÊĦ±=ªá.aªeyIêë8Ü—¥<Œ©õ5j3eN*˜‡uT­lHÉca˜it´r%¦@—»¼”ЗÝ,M°Ø.ÍÝmü¹˜òVΪôо`ÙæÌhRàLXµ,—¦;ðÍTÆ¥ÐGYûMUõ›enÓx¨’5½dúÚ†ÓÞÚhË[[gc9j¦„Ì4ZS9S×ôÉ9j“->ðìñxSØõ\(Ñ÷Ù™ŽÜ^ò³¬–[8Éô,áµ*6Zs1ìÏ'³™gâ±›sˆÅ¥ä¹ "²&Wªqrõrl±¦Èˆñ½Wµ<`M¨;Oe÷ZŒÜ‡.fFôU§fz&vÚÒÓÑ›#E˹·4åtÊY§hìÑ«UÏÑènUÑìK¨Ð³ ÏSVÉ•ƒ–kz³×õØÝîÙ¦7jÔtÞÕm:_u²)B¤Šµ •©`o«y– ää¹ ÝÉ*Š}‹D¹*ZIVêJšî¦€ÙvQáR*OÎ˱¦rÙ D¢•Zfº39'%C—@«•J™Qp¨TlÍ=éYÓƒêÆkqitâI«!¥9 g6ón•²ì˜ÜX‘eœ¹Ÿi™fªÄV©ôúƒ,L¨SN-\¨Ò¢T1¨¥6%J‹H­7–è¢=µ½”T U'溮ßö1S•hy³#”ö©MÍ5ª¨Òéðê#œÉÊ´H´Y»;«¡öZ mª±$ÇÐg:yÈÌÚ£ý¹Ÿh”|»R£zFz'·ZÍ4̱©Ñ=+v&Þ`§0á°N@¯Ó§f™!ee«Uxt÷ÈÓÒLwPiÁHÙÕÓÌU4‹¶f,¨…*RÁ”¥8.öA?.»­w€Î­Ø¨“êýÚ' ä§vèJ™-m×lyÅ^­ì»Ñ£hp•š¶Är5©5\ųŠ5¬L®Ê:Õ^—%ú]fÍ#P‡-DFá, 1ÛƒÚê‹i`´¥ú?ú,å‰Y­ÜÕ²¦á͇BÍ,·úajÁ%œÎúƒ™v²îU¤­ ¯—*ùz;®ÉªÌª×*a^©Æ•ˆT¸Ž±H‚°ô‰¬ÆsÎcÙ:–KÌ™“+ÔæÐ¥f<ŸU ÝByÚS« £Ó*´*RL¨¶ŠoC€ £ âÀéæ—T¯œx¥ :9VY ŒÙ´X“j¦ü]7E‹«±ÀDÝ nÐ{#Zt]Ý*뀟´6ÖÍ&–±%¬v¹s 3e©,…—ùÒl£ùÌ ;/e-!hQTµ¤+I7I¹Ô1‹++/z)ìó"3Gÿ€9­›s}}5©õ©´êåN‚ÔÚ…"L4¼õ=úÕ¥ ñ¢Ç›*TC§²ÈDo8:Ë-åÈuë8ú7ì§¡æ›Lå<ÊrŠ8S`$ªd)Á’²ÕÜ¾Ùæ ÀóÑœp%( &´Ô"Š¿U«0«”šµgJÂïR[ÏϤVêm«Œ¢4¥®I’누ڊ%Aó¶€ÒЈ†bÍyë3Ö…ÚÖ@’Ë2ÍäF²ÔXÀÛmš¶ÚSYŠÄiÀÙ4rw¬”‚xÕ KQhŸi+Pãd³’§ [SrNü éÙ{.XÍ_¼·¢··nàYùßÅâ¿U}2TÊœ&r´= œj )7:%BE•&“tóÄ~™Jt=¸;¼lç®’EPA\ËèK§³OCÚ+4òŸ2[aVòô˜NÁv +%‰OÍ….¡×s»±7-Ý"B„¸&Óv§4c§S`@ÈTG)5 ’$D…@˜Ã1 Q£³Éë¨.«:Ý3ìîH'IÞ$Kˆ\»•6‘"¬µ¬Ï3£Ò(NÀ«Ä¢RژĩÊ0i&q=‡¬£”Ûn*oÞG¤ý¥ÇSSûYW'÷“ö€–›î¤¹P!,ÇUõÄùþÍlʃº6~¥‹†wßñÅßC¶»—Ç4åÜ©75剕vhг[®A¨Õe€¿ úŽ–ªuYí¹ÚF‰O¹º®ª—µR²r¯³Üß”ê/Òó~Y¯åi1$GâÖè“inÇÉhv:µ?í1ßlÑEÖO¸Û¨b͘F±×ÏŸ¶Å›$ΔçjœÌ9CP=ô1íÎv¶[”G*Ubèr\Wµ¾°{àê-ÜÀÝ#:աЪ:ó'-ªƒîWgeš’W¥Dt©·ºnWØ}fãrÖ´F÷¬œíSûtÞJÜ%–ìøb.2ÃK‡{Þ%Nö9"ÒÒPY(¿dhœd`ß-­—BÌ‹’À¾ë;ãuV×qy¢%„áéxt .ñVA[îÓ²§4óRãÁWùc¥ûLb´\±CË4mžäÌT¡Í {•*1× ±]ƒ˜2p« H™//eçc­i$jKG0f$Ùhìù2]sb¡ÒÒrí:H­K¨×y°<ÉØ.ÑÍ·|ÈGbPeªÚ”vn,“ÝA”ÃîÅŠl ×—í JUSpBIKß ünìZ$+ÙJð¢š|…YøÖÇé˜æ|Œ¸ãL9¾RW.š› Ь¥®*£níÇIÞÜP¯× Ò5!ûVíhÝ£|¸»¶½¹ùñ¾.ƒ~‡û\Ì’j2äI§c¼ø]ª}m‰3’;„ÛÇç£D§¨6ãfÓêÓ(ˆè9­ÇÍ ç&rg 7¤>|©I¡eœ‹&]B$ä ž^†Ãd$¨© äÕ£>„íã ª8…mCc'å{S°æI\Ñ^¹`†.–fMÛœ^ÆÄB3½œÚ¢r¨wÔ,U¢ˆa¼Z×7/|=¨!Åu¤]ѸJ¢Â‘k%[)uÒHHœ­nXÔX͵­L\pø)w©Rëe·Š­Ó¡_Ž:©RþŠJÚ\P9¹>‚é !öx™º#ï‰#–&!H“ uÝQ·ŽëïéqL&ýÞ•Õ‘¶6kpI[vmzŸ lD‰}w–¸ó5ÿ ÆÉ€kv)þÐ,@/fb×rG–6b-ŸìžÒUþ7¹âA¶‡VâÜ#–J:UI˜D›Å±¡%Ë»Ý[ßåtò¶< "4ón nÅÄ^çá²ÙWêH«ÿkã©ñ£/ÒY3Pã弓:¸‚²[£~œRßšhØ&½Ó=ª'š**ßõÿèÒô­Žr_gduI`É*¹X¥Ï&ˆ›Ñ—º&÷R·ÔD•xáäûS³JRS^7JC¸ 6¥Øt¾°°ö_iÀŒ§>¾ã˜o2(è¢{ö[§4ãuúpTòDëÑcÃtÓ«¿[‘ª ùñTO/.¶ã+…œývý“UéuÍŠm2 cd2g-Ku¶t€¢Ç ìÄ$ˆ†ŠÚ" ’k]z¬’“² ¡”–¥JΘ꺷Y~¨Ö…ïoÅ/dEEÔ¼8ÝoŠ”ûWgM´Ú»…"ÄÜ믂‹1- ÎØ;JEÆÏ~ãÿK[-þ^ANßê{–á,.Š—D¿×ÿŒy7Cz·ˆ7ºÛÂê¿Ç‚ÞýpÈ~S²G•J’Ù·q 8²B¨¼‰·½ ’%¯«Þ^òwKÑò…VMÒ% ©#J];5:{Šª¼ìL®ï‚ÝO%º/yý«H ¶í‡gOùïî…¿eVÎd© `è ØÚÂÝA¹°íå.B¸ZZ.ðEsÆÈˆ—ù%‘n«Ëdž5™Î¼äb#s¿æ‰Ï¨ª/é‚ÙM©*¯ˆ‡îN’pñ·Lh"iO/ßuÇT¬ž§Ö$DLƒ®½»i¥H¥ÁUQ,J·ý«þìCÏeRGQÚ}ÔUDU·ÍUUxð[òêKOovÊ;ÿ4N²éþßËŸL~? MÑ=Þ­H½î÷éá˃§ ô€8ïnRT—GM‡H:{ˆžvµ­Ép¹ë”%¬€—½ÃЉ8ù!Y~XnAMhï°m±%K_Ú^ä©ÇÍT|xx`:(Åv[ˆÓfr…[2û¦Å°3š‰¯EUëMÇr½fêd©›®9¤]Œâ¨øw•¯—Dç…eX;+›»¡iÒª]P /þ«}>¸z×&ÑM×F<·e¾º¢œ¦ïÙš5Nóaó+‰þÞ¬"ëHnKpA±iPÐt§»Ýùˆ(kþ%áÏ“‘ÔúFfü‰è?¶=i¨ô§ãûU‡U“É^ßæºñù® žŒÉ)«¥©,ˆ⨖þ)n?ÁWt¶™‘‘ÂR2EoÁ5-¿1Ký~X3õ5TAµCTµÓ¼·Uù’*§’ü° ¯ÅßýÐÅ6Ðzˆuµ±¶C¥¶D¤#ž(ˆ¿.\¹ôã…Ót¥ªU…–°K5t^j€¨‹ÿJЧӦöŒ,¬i-*¡)ǵ˜UtÉÅÓkÛ‰X¿kWŽ!%D‘–,Aˆ/?©Õ7ˆ D%~\UrÛ— j‘?ÊŸA +'©õ9­Â§"²Ó±ÁDCþ^‘DNž_ôÄY-³=\Vµ0â" qö]ÔBü‹WɆ7&S^ q†oÀøÞÚ—‰ùð5+x§–=˜¥Jb+¢ãW2D¹s½Ñ-ù%“æŸL&¯˜Á“ÐzF¼ˆ±åºc¿Ú—uvè¥ÓMøi²§‚ÛÏ ¼ÇQb¥0Yl÷M0ó©$5ëQ$p´÷íÆã¤¼®‰órD†Üy…A %øþ8¨4éñß¼<°¤Ì”™2;EB QÛA~A-?õîÇ'X2ãn,+d+øI1¬fõça‰‘›o8ã1HY1cXª/ïuµì¼­eNœF©TöiùµU^‡¢ –DA¸tE²*x¢¡/™¸£uY}TQTQ/d^*¢–½ôÇéãÈ$¥Hí Ö_Ô ·óm÷ ¾–Eë€+'©õF½h†£¾xÃx,+`Ü~Ñ£pˆ(º-ÝS¶óÏ]ïÇ©O|L58ðXD·‚ˆB…d.¶¿ºq¶J$”ŠåVDgx¶ÆñÔæ)rà«tK§‚*'Lx,Þ„Û¤Û±UÅR¯‡%÷ÕHzZöOD^¸J|æØ$8×>¥±pĉ.]ìož-þ¸„™> ”—#BA ¨ß4$¤J+ÿU“ÊÝ9­¥N– žžã*ªHÒó”BJ&âüŒI‡$ÃþÍ¡ M5 ÞBÉsgMÄR×O…SÊØÒ©eùo(³¡¢Ží÷5ï  ªuN(<<Ï Ìž7ÀHsÜúœ†=Ç??ða•W›ÛY¦O’ȱuÈ/z2{ÊÚ¢xªÛþØôŠ®ÒÕÀô©e ;ç÷WÅT“ÉV꿵,8dÑ£vxð f†2_EþÐŽ'Õ׉ªtÒ£Ç  ¸Õ/-Õ_q÷A{$WJÝ €Å uUDdEÇ JUDå¤Ç@ÂýÝl@ƒ¤0€ÂÙjy‘¦]asV[Œµ ?¢Ÿ Rªžè~n¼êõtÍzáZ¬æ©î‘~“J)ÒÀtÔ®à‚&#ÒúQ5~Ö¤òÆžd’RØËáye6ޏôª "½ÞœÉãÅ|ð¼¬1.;¢A š’if‰“ÖÞ›"“ëÅWjN˜ª”²Rà _ÎTà¡|ž<_@}`Z¼µ»ÙfJF\1vRhC!2ã˾…;ß JûòfÈÕ& .š (€ž´à¥5pº¢Y•–él2äÒªSÞqǦT…Z/Ü+„š‹O–²$/Ú¾—,?$ȤͦÁ`štÉ]wy-ÀMð÷E4qï‚ø°qT)À,ÿ_>0’g¨€HrÍ{¶¹Õùñè/E£×g0DBÞ£nµ}rt¸bCÖ“BáÈoÑ1¢ÖR•¯!×ÞqLÚCŽOHÐãdØŠ)óD"1^ ¨½WÊ9Ó†p㿚tE–Ÿq­ËFBª*6œ‘CüJŠ_šÝ.ƒC캣 '*k$gî‘\]ãhÀpx5}¢”Š}¬ÃSv™-óuø Õ¤,WE˜M²:"HNÀP,z8¡÷Èñ+Teç ŒÖç¸tÀ9/;رÀç¬ÝرØ'³Œ({¾$hFåœRÆëUŠ $É]@ÛT…(=ب€‚ˆž:•.«â¾7Âv·™k¬Ct  HóÁ÷Ì!ޤBÿöŠ£‰~hiÃæ©SçËø†Ý-†°îûã’ÔBD¼“Ùùƒ¶žLþLa³´Küñ”Ü›EÉseZ¼O N9žì*j>â¼ýF$w½ªñÃWT½÷ÕÂé&SÓ_h”|ž´Ú–@É9¶§4P%æÛ—åâã3à<‡!U¢ÅBt)£ µi¸Ô…OSŠfUŠŸNZÕ]\ì³Þ•½ÖÛ »¼GQl¤ëñíÝÝSñ ‰yâc3eYU[jePX‡K†.n`Æì¨®“o¹ÇÜp” |E|±½Bé7žË›àçÞ2X®Ò ÝUÒֱǔm3é)´º4J­J,lµGè@U [‹® léŒW¦¿*L&'8%'tëç¬D -è:¡úLí¾I¸sœ›H†åÊRÁËyr±­Kˆ¶ÃÏÒd¸Ò8–Y¯Îo$“îŽ$¥lÙZ€€1¡Í•)ñ““ÚœŽÁ"™5Ô•.â§U%ã‚Ú2+$©™o«´©N€Ã ëj¢è¼ûþÔ…·PÛ¹òA².›bDÔ]€!ínú }EcUÙ½Ø>rÇôòƒ;`Û:ÍLÏ–é9F–üŸ°±Qb‡—N{d©¹˜u5ƒ•¢KHÂzX­UÝ0lQªxÛ}2ZÕ!Ôr¹È’„ãò†Ÿ.[-Sè]†Ÿ2¡Q…OlÑ54£MtI$‘8ª_9J£Àz5B…`Ç3nMºfá˜ÄÍ›UlHD´òQQ.ò.­Ë§Ñ‘]—  À,çérf-?µ¢«â^=©IÙ(ðµ÷wá‰î'€gÐ X3[<ø?:g*JFîäi›ñÔD;›Z­Ã;2æú^]õSñJ¯ÖbÓ•˜Sméʔ̣N›QÅ*FBØêiwçÏMˆ’³lš>Â2M«2YÕáT¥g7kÌÓ«ÒjQ¥S™­EŸh0ã·PgULîÕ8 ½Ð(´^•SÍûY¬Ñv]‘œEY¿¬©´šlóXÌ"z©ãcÙ< ¿Ô>öòëÞU¼TØ”<ˆ¤Ù“(ñ#T1¡;<‚›7©CP~©6â—ݸ$ݲµ’èä  XH4Áœn°ÝŰÏoÖ•Vg­@8bZíwÈ¿Kó íiõ¡$Œã³ÚeL©ã.}3*VfR( Ê– !hðdf`Ì/ËÕ½C”/Ö% Ì9 ´‘™â0¦«íÝb³Uw Ar +%Š+u™”7ÛfrŠý䉖©¬I‚Â^1I ÄŠË­¨œGo ݨQò6kÙó€)ZªEcC§7PßMSqn±Žˆ ¥A9+;µÅ[­äŠõbôD«Òª5Á§ƒ†1˜ÜM§º­ ”Ê[/%îãÎ=~h®Û…° fIJMM;ɨ~;$•0ߎ]‹xNª‚ÁîXX\žý«zZdr#Ò(Û«Áˆ9.:ìföŸ(ª«Xn™+Ói…g#I§K}$M…¨åÙ ¾Ä3•=Æ t6öõC¨¹1ŸÐìËTŠOÈHöª”]ì•uã(ÍšÖ2}.¦nGŽMÇ2=L͵ Q§dyÆhT¥Î¢fzÑÄW1TæHÖP« ¶2ѵ©'öh)ÀÓm~±°ø±§MË“©ÀËÔG¤›µæ¥Džîå’&ZFMÆ…Õ IÏ×¹w¿X¸ÒwÁµ¶zwC3¶,Úž‡¯ý1‰U{ææÊ7s¡Ë çÖØ[cUìSêÛ'­åã’UgÊUF\ª´Ã®x®Sû%6lè¤yg#ˆU3TSa`ši¶vIÉÙ'7K1ÉYJ±]K"DøÙWbQóK|H5IËW®9:Ö§Ó…ªu2}A׎%×Õ¤àì0…¦Ë¤Fr—·~`›2h¥%£~ ЏÀz®}7ÚϨh!0‡q°$d,ËaLñó6Êaç*ŽK¯ÐÝœÎV«5Ù3ߤJM>ïµ\—ìµ)úÜq ŽÚ¡É[:ÿÚ ËëK±vFЮ§4$n’Çw,qambݽ¡SG&lËI –:“«œxúÖ]´ÿHÝ/g;\Í (l£fÕl¿•æ%,ó9j£J­H«µ9Îe–ªO»ƒ<åB’ß©š@y‡>þÝ¡éì¯ý#Û%ÌPDv‹°ü®ä¥}›Àflúco± E×{LmÝY¸$ãË/ÅÒò¸’;L”zSéïèÑô ‰éu´ –tÚ5æL™*«Y§ÅËù|ŠŽvÍW×ç;/Rs{^52EE'VŸj>Y§8ÛÑfæ(n°äfº µ/è‡ôËYX*Oi³a×V$ÊrƒWÊ’ûî½.Ÿ$.½ ±aÔH]’)=©"’æ ö§»‘°hÝ”K%‰B‰A²B™Á±nÌr¶´UTŠÔ¢Z¦(¡ Ò…Bpö דZ¼V½:ýžõ…>'££²Ì¡ÇVÚ£f ¬FUûÇ#q¼¼ÈGFØP$mHKR™ ™GeïL˜H—-øVâÇ;ÌH™Ï±KgKBƒ.}Oô2Vê—møÛ÷.ãDÞ 4RNÌÈóëô\Ï5ê]H$ÎJ Viö˵ªc #HnV¿¹ÖÍG¸Ý—R-¹/š¤G2®É«©!˜ÔšYºBÅo·@¥ÈZZÍT%vžõÝ­¸âwÍò^ \;¨‹iÓ³åÏ•*Q˜…Ì”ïžÉ ž Xpî³K¨Ú¨•6mIJýÙ#y*ÝüV–6¹l˜væÏO<1;&°:u¸Ã JÝZ:ÄyÄp­ #ǢЧ“*h¦Óç VS:$‚èx üÉý"S¨Æ2¶ÎöC’d‘B­KÊ Vj±®ºÙFª®±[ŽÛŒ‚€‰Á‰¨4 ïSMŒ´µ©ÊÔhoH¿’O¼ªZ8¦ûŠ*Âû2iEAÐß¹mí°áɾÛ1¸íF‘³mz&I )™j¨ä3˜¦HÓ„¶Þ‘?ÛE劳é}ž¥&dÚ36j»Så[Ë$n¥9¸êmhò«=¡®SJ­ä’ÒÑ€”ÝN4 ,}[ÿF?K¼Wsä|ÓµM¦Ts=".C>¯ÌK,Eƒ¨Ú@‡MºÐ3WM±@QQQSEC&¦pô…ϲó©ùS=Qéloœ:| ­ ªj”wP5eˆÍJS"#°°BD]dŠd‰ lK>eÊâåDÖd̈ìiÕ']&ĆŸö¢*Іê—3R!îªaq™£åì½*Xm9Ó`ÕQ¡(´J< †hÌQštàƒ%bÕbE :¬¸Þ—¦Á¨„…l„ô§1ðÔ•uåRösKRÉ@ ì:Jlü7$‡'$˜è‘6¶žüTÍò”€W¼ûÄ$¬êA¶škÙŸÒ!·ºtÁ¤A=œÊ6¤8”vyÛ%ÍÓ½Ý>µXÛ‚Ô¤î廪!¢•õ­ëØ×¥æSÎò(”­­B—ÜEÌ,¿K¦"»Y¬§$·äÁuý. Öqá#PŠ¢Â4Ê nwôv¥1¼‡²M¢OÍ®Õé J­Ô¶³–€ýUVI§Ri[3¦?¥ÔÒ–*+RyØm:ÜW'%V 73dŠ„dšÆBÌsÜõ‘­ç ]*hªŒ4…Ú;ǘA¶¯¶+ІHD("¢îÓØ;6d¡$ìðó˜—Sj2ž!€…&ѨLùOG)²iS¨=jÑ 5–,mÓÊ´ÃjƶH ‘»Iô—ô†W•–!RdD“& ŸZdê¼™Uv£™²åB Šüª\aGVc›Oš+`Ù;¥Õp““v´Ö}dÐf…†Ê‹ÍzŽ5eïà‘’8ÛõÏp"☧° ÈÙ®ò†²NçpÚ¼¹Põ­nÿáÅ_-äª-$*Y¦³Y‘6\\Ç_Ÿ©¯O¨ÔêS'2é¸ûƱۧHSŠÊ7˜†ëž+lgg26œ!²fäZ%(Ú‘Qq»s¼Ž€¼½EPÅ®;U;lÙwg™jÎ2Öu™ uQº{õ,¹N”úÈ‘"´uz—ꈀÅa>ñ ÏŒOk~c‰[3d¤“=0IÞB2’Nl“rlxZöjevÓ ­Ú,+ÌÍ­ÿÌ1$NÍõª3ÍÓbWh4hÙr}s/Ì2'LŽËsj©Û§EiÜR» JÄo²¶Î[ÛU"‰œÂiŽ CÌTy”˜²m©ì%^6á–Þ©‹>Î,ÇI¤xÜ}ÂWI5bƒKÛÎÞ3fnËTl™òlê@E­@‘—œ¤n!Ïct Sã­ÖªàîÙ˜–Ôò}dÙö—µ‘QÌY*¡S¯Á£“‘ävø1QÖäÙÛå·ÛÒò6·ªSÚ¥þa§hË»CÍRrè™ Ùµ Õ¤éëS(¾ÂX¡©¶w`~ÑÇ4lAjùÛ1À=—@ªÇ~t—¨3¶TpÜÔ§ ¦‰í›Uû¹‰F·±Ã&Å)9N ªŽ\¡eæÙ }÷R]ê…ÊHÒDõLôªoÏZªÃVúMNÔ¤÷H¦ y Û h‘À]¸iˆà¤¢µu3—<Ÿv©«P¹fQ~<=GX¦³³~ØéHTW6„´YmÄ“TªÀ1œ’]~t1ˆ³Ž[ÍË‘‡Jy [3‹éE™Ê"Ån Í;-ê«“êT*›·øHº\GÙóÐ(#Óܤl'V'ÖçVòõN›Lw±½êÒöV^ÜeÆÜEàà€¸>À8{Þñ5i9:– 9/Qœ|Ád;SŸ(¦¶Ó„ÛBÃl{.ãb-"P²÷¯‰¿”vK'²'ÃÊ2‹–Qg-s4Š@;’±jêR³žmÊÑ÷m"VæûDSÔ»òöI­™j ² D [¾h[nÍÕ{~Õ³ Í&œáAb<†ØÙ‚Ž´ßpP嶪á§ IÕïâÏ–K©²NËO*«j0éÒ"º¯*)*¸é+ÞÕDœRq½«0ÓÝÓüèìbµ6¸ú÷‡›Ù@§M§Eø4F+ø•øêÄ*úº…ÏLŠgÞ˜_¼›·ˆ»ßŒQ£O¹“1FîåÏW{·.ZòŠxöÒ6ï{ÙzMuš,gäk˜Õ2–U"UA7Q龩“¼'ˆƒÛž€ o»£@ÙªÑ$S2ÚÉ”õZK”¶jsj1Ú8ϸ⫠â+ FmSv`‹¡†íeÔH¤Ey÷ å˜u(‘` ¹uµ±¤gßSÑ[²U]äD¢ˆ­~”8¢â·mDsÞwKÙ¬lÐòâ"Ï®H¥°¦¦l-‡x}Aéî §L+.LäÌRj”{* ܶ@,:³cALÄÌH›º»`^Ài¬H¼x»×ü+üñ˜Ì~ÃÎÑ šÿ‰ÏýKãøÂ_ÏŒÀ“ÔúÇ ºó¢ÑŠ""•“ʯñÀþ¥L½%Ä^û’E º’"Y/Ó’"xðÆc1ˆ:p:H^ö’ÿ7ñ\ UU@ŒÅtš:Š„œÑRÖ\f3VOSëz;ÎÈ®GyãW!iÊ×T„öDN")ä˜k—%ù/ðÆc0­F;¾Š†¤e?ˆ@åcîÇüßú‹Q’í>‹ø×ø®3…ÓÐzCÑ-¦ÒƒAMJ«uãÑÝz[‰ïøSø.3€«'©õ@Äþèàsø.ò@f¨­”Þu Í5’q¿’"c1˜ï—Êʺ«ÔDtX‘Œ\3d‰²¹*q[*¢]~H‰ôÄ%‹Jšýp¥AaòƒM&"˜­Ø}%PÕ *w¯ÇÓˌ’¾sÔýa©¸îW ‚ìƒF¥ÔsžNƒ: bH™÷˜pWC UTL¬¨·EåeDòÀuJ$f\}Ö™q‡œe¢TPi³FÀ´ˆŠ]‚c1˜Ú¯ÿNGÿdÿPÉÈê}"¶Z'¢8 *d&¤KÍU\$¾6N,rlLš.؉u¿.^6ýØÌf$/æ=Þ‚(' ôˆ ÏD$$N<ô"ߊߟUí·¸qÆ„Û$­´â˜"Upï{ÝVøÌf1+*ê}Df*%jS’ζ@¬Ž^þñ)/檪«óÂÚªˆ3I´àÚ4àèøl¤ª©ošóçŒÆa…dõ>°dõ>±)°fŸ!¦…´W—Jr¹B%ã~dª«þ˜ƒÉtØ3n²¢´ú¤#$WVÊ„¨‹ÁS’"c1˜B·åÞ°Y ocí覕Uâ·["pKªÝl‰uâ¼q˜ÌlÕ'¯ÐÆò¿‚¸NÒ X¢ÌžÊîæ6Óz$FÍ¢'{­‘è¶²cë"I~±>¦õQÅžçj¦-ä ¸—hSº©§€¢%´Û†3€WéÝ“§ý°ÝÚTÙ,N…;‰1ÊŽÑ3¶£‰6lº¦+¹UBR+ñãuñÁ tÈêT0£xŸ£ñÜšŽõèHtîdEsy×.õµÙ,‰˜Ìs_<¾ƒûbÔŒ'ïðˆÑÈ•)Ñjt†ãÊu¦À' o.Ap࿪ýq#[uǛ͕INr4⤕²:ŠÜa∞舢p䉌Æ`2ÿÖ'¯Ö7VOSë+g³6‰&£*KÎqjbrMQ\!a¥ŽÊ*¢"*6ËM¶<8§Ï#~äúe 0’L*¦b¦³PŽè7- ‘3@;qÔ¨6K**-‘öLf3Ú 9¶¿X2p:HÐÚ¤T¸ô&iÐâÃmâ}·Qˆìì4"F­P[i°N÷LÓ BjŸR¨7šåS2’•±'Œ€d6 FHªº@üDS’&3„ò'ùG †ÐzEjk0Ö“:e†R£!‰—ê•Í¢Š 3A]’‚–pER÷K',5iÔšlúC“¥ÂŽüÙ~¦‘&Q#ï<ëÒÍÇttš‘ªó²pDDDDLÆaZ¿—þÓëÈÓþÈðÈ#ìÍZÈÜÊ •ÈQN"8K¨”ndEĖײY×Òm¶èû/ÍÒ)5ç)1X7l‰§DÀU1../[Ùy[1˜¯²þYÈéL)Yü)~±Ù_è­Ù^ÏZôN£WYÊÔö*íäZ|À¨G)LH2s›ï!3  ÒyÂ%µ•Mx' Y¡å¹N؆y•”ÌimlnEE&4䄘sfæü¢Ä™ËW–L’q‹0‰!×A¶DhA°LÆc¢ØW—´^ÿ¿œo{ï›Ç1SiÔmg—-ÚÏÙòÿénF§"Ó¨£­K0‹ŽH¢ ¸ãFj𒪡8F-n­f¼ÃµœŸ³øûF©»›Xt³ªmÇІ1Z$ì°ˆ¨‚‰çk¯UÆc0¤ËJ˜EŽò®3ø5Ì>Ž‘£¦ÚEÐôKÙ¶Ï'1´Iµ,‹”*²¨ÍT’–íc-Ñêý‹QtQ ©C”ßRjãÃ’"c˜^‘~{f‘œk™dsõ^[¦ŠÂ§eê3Tê Ÿ·•˜TŠ,(ø€e©ç»[òÈÿãGÿšc甿*?‘?Òa_\D9o‰ éíòJ" ‰š"" "%¬œ¹ó^8‰ÊFQ†¨L´K1UjÉ<¤¡Æüxøùã1˜ß‘=öÁ•“Ôúź:]ROj ùÊn#PÁËZ;jùˆiAá©UxÝ|ñ&Mw[% W4æºHó¿!DDòLf3™üz_äOôˆ$¿áLê}b¹mZ¥<åÕÄ¥:¢ëŠ®&®¢Ób7²tDDK[–9Zd·¨ÓÅÙ/˜Dc+¦ˆ¬*¥Ú°ª&•ºÞÜxóÆc1#kñ&ç_Q‘þ]ÿÙscons-src-3.0.0/doc/man/epub.css0000664000175000017500000000104413160023040016435 0ustar bdbaddogbdbaddog/* This defines styles and classes used in the book */ body { } code { font-family: monospace; } h1, h2, h3, h4, h5, h6 { text-align: center; margin-bottom:2em;} h1.title { } h2.author { } p{ padding:0; margin:0; text-indent:2em; } blockquote{ margin-left:3em; margin-right:3em; } .caption{ text-align:center; font-style:italic; margin-bottom:1em; margin-top:.2em; font-size:.8em; } blockquote > p{ text-indent:0; margin-bottom:1em; } img{ display:block; margin-left: auto; margin-right: auto; text-align:center; margin-top:1em; } scons-src-3.0.0/doc/man/scons.css0000664000175000017500000000735213160023040016637 0ustar bdbaddogbdbaddogbody { background: #ffffff; margin: 10px; padding: 0; font-family:palatino, georgia, verdana, arial, sans-serif; } a:link { color: #80572a; } a:link:hover { color: #d72816; text-decoration: none; } tt { color: #a14447; } pre { background: #e0e0e0; } #main { border: 1px solid; border-color: black; background-color: white; background-image: url(../images/sconsback.png); background-repeat: repeat-y 50% 0; background-position: right top; margin: 30px auto; width: 750px; } #banner { background-image: url(../images/scons-banner.jpg); border-bottom: 1px solid; height: 95px; } #menu { font-family: sans-serif; font-size: small; line-height: 0.9em; float: right; width: 220px; clear: both; margin-top: 10px; } #menu li { margin-bottom: 7px; } #menu li li { margin-bottom: 2px; } #menu li.submenuitems { margin-bottom: 2px; } #menu a { text-decoration: none; } #footer { border-top: 1px solid black; text-align: center; font-size: small; color: #822; margin-top: 4px; background: #eee; } ul.hack { list-style-position:inside; } ul.menuitems { list-style-type: none; } ul.submenuitems { list-style-type: none; font-size: smaller; margin-left: 0; padding-left: 16px; } ul.subsubmenuitems { list-style-type: none; font-size: smaller; margin-left: 0; padding-left: 16px; } ol.upper-roman { list-style-type: upper-roman; } ol.decimal { list-style-type: decimal; } #currentpage { font-weight: bold; } #bodycontent { margin: 15px; width: 520px; font-size: small; line-height: 1.5em; } #bodycontent li { margin-bottom: 6px; list-style-type: square; } #sconsdownloadtable downloadtable { display: table; margin-left: 5%; border-spacing: 12px 3px; } #sconsdownloadtable downloadrow { display: table-row; } #sconsdownloadtable downloadentry { display: table-cell; text-align: center; vertical-align: bottom; } #sconsdownloadtable downloaddescription { display: table-cell; font-weight: bold; text-align: left; } #sconsdownloadtable downloadversion { display: table-cell; font-weight: bold; text-align: center; } #sconsdocversiontable sconsversiontable { display: table; margin-left: 10%; border-spacing: 12px 3px; } #sconsdocversiontable sconsversionrow { display: table-row; } #sconsdocversiontable docformat { display: table-cell; font-weight: bold; text-align: center; vertical-align: bottom; } #sconsdocversiontable sconsversion { display: table-cell; font-weight: bold; text-align: left; } #sconsdocversiontable docversion { display: table-cell; font-weight: bold; text-align: center; } #osrating { margin-left: 35px; } h2 { color: #272; color: #c01714; font-family: sans-serif; font-weight: normal; } h2.pagetitle { font-size: xx-large; } h3 { margin-bottom: 10px; } .date { font-size: small; color: gray; } .link { margin-bottom: 22px; } .linkname { } .linkdesc { margin: 10px; margin-top: 0; } .quote { margin-top: 20px; margin-bottom: 10px; background: #f8f8f8; border: 1px solid; border-color: #ddd; } .quotetitle { font-weight: bold; font-size: large; margin: 10px; } .quotedesc { margin-left: 20px; margin-right: 10px; margin-bottom: 15px; } .quotetext { margin-top: 20px; margin-left: 20px; margin-right: 10px; font-style: italic; } .quoteauthor { font-size: small; text-align: right; margin-top: 10px; margin-right: 7px; } .sconslogo { font-style: normal; font-weight: bold; color: #822; } .downloadlink { } .downloaddescription { margin-left: 1em; margin-bottom: 0.4em; } scons-src-3.0.0/doc/overview.rst0000664000175000017500000001556513160023040016632 0ustar bdbaddogbdbaddog============================= SCons Documentation Toolchain ============================= Introduction ============ This text tries to give an overview of the current SCons documentation toolchain. The interested user should be able to better understand where and how the text he writes is processed. It is also a reference for core developers and the release team. .. image:: images/overview.png The diagram above roughly shows the steps that we currently need for creating all the MAN pages, User manuals and reference documents. You may think: "Geeez, that looks so complicated. Why can't they simply convert XML files to PDF with Docbook, or use reST?" Please be patient, and continue reading. Things will get a little clearer soon. Our toolchain doesn't only produce HTML and PDF files that are nice to look at, it also performs a lot of processing under the covers. We try to have our documentation as consistent as possible to the current behaviour of the source code, but this requires some extra steps. So let's start right at the top... Writer's view ============= The toolchain is set up, such that the User has a very restricted view on this whole "document processing thingy". All he should be concerned about is to edit existing text or write new sections and paragraphs. Sometimes even a completely new chapter has to be added, in general he can fire up his XML editor of choice and type away. If he is a really nice user, he cares about validating his XML files against our special "SCons Docbook DTD/XSD". Either during typing, supported by his XML editor, or by executing a special script :: python bin/docs-validate.py from the top source folder afterwards. Preferably both. Everything's looking okay, all validation passed? Good, then he simply commits his new work, and creates a pull request on Bitbucket. That's it! Additionally, he can create the single documents on his side if he wants to get a feel for how the final result looks (and who doesn't?). Each of the document folders (``design``, ``developer``, ``man``, ``python10``, ``reference``, and ``user``) contains an ``SConstruct`` file along with the actual XML files. You can call :: python ../../src/script/scons.py from within the directory, and have the MAN pages or HTML created...even PDF, if you have a renderer installed (``fop``, ``xep`` or ``jw``). Validation ========== Just a few more words about the validation step. We are using our own DTD/XSD as a kind of hook, which only exists to link our own SCons documentation tags into the normal Docbook XSD. For the output, we always have an intermediary step (see diagram above), where we rewrite tags like ``cvar`` into a block of Docbook formatting elements representing it. The toolchain, and all the Python scripts supporting it, are based on the prerequisite that all documents are valid against the SCons Docbook XSD. This step guarantees that we can accept the pull request of a user/writer with all his changes, and can create the documentation for a new release of SCons without any problems at a later time. Entities ======== We are using entities for special keywords like ``SCons`` that should appear with the same formatting throughout the text. These are kept in a single file ``doc/scons.mod`` which gets included by the documents. Additionally, for each Tool, Builder, Cvar and Function, a bunch of linkends in the form of entities get defined. They can be used in the MAN page and the User manual. When you add an XML file in the ``src/engine/Tools`` folder, e.g. for a tool named ``foobar``, you can use the two entities *t-foobar* which prints the name of the Tool, and *t-link-foobar* which is a link to the description of the Tool in the Appendix of the User guide's text. By calling the script :: python bin/docs-update-generated.py you can recreate the lists of entities (``*.mod``) in the ``generated`` folder, if required. At the same time, this will generate the ``*.gen`` files, which list the full description of all the Builders, Tools, Functions and CVars for the MAN page and the guide's appendix. For more information about how to properly describe these elements, refer to the start of the Python script ``bin/SConsDoc.py``. It explains the available tags and the exact syntax in detail. Examples ======== In the User Guide, we support automatically created examples. This means that the output of the specified source files and SConstructs, is generated by running them with the current SCons version. We do this to ensure that the output displayed in the manual, is identical to what you get when you run the example on the command-line. A short description about how these examples have to be defined, can be found at the start of the file ``bin/SConsExamples.py``. Call :: python bin/docs-create-example-outputs.py from the top level source folder, to run all examples through SCons. Before this script starts to generate any output, it checks whether the names of all defined examples are unique. Another important prerequisite is, that for every example all the single ``scons_output`` blocks need to have a ``suffix`` attribute defined. These suffixes also have to be unique, within each example. All example output files (``*.xml``) get written to the folder ``doc/generated/examples``, together with all files defined via the ``scons_example_file`` tag. They are put under version control, too. Like this, it is easier to compare whether the output got broken for a new version of SCons. Note, that these output files are not actually needed for editing the documents. When loading the User manual into an XML editor, you will always see the example's definition. Only when you create some output, the files from ``doc/generated/examples`` get XIncluded and all special ``scons*`` tags are transformed into Docbook elements. Directories =========== Documents are in the folders ``design``, ``developer``, ``man``, ``python10``, ``reference``, and ``user``. *editor_configs* Prepared configuration sets for the validating WYSIWYG XML editors XmlMind and Serna. You'll probably want to try the latter, because the XXE config requires you to have a full version (costing a few hundred bucks) and is therefore untested. For installing the Serna config, simply copy the ``scons`` folder into the ``plugins`` directory of your installation. Likewise, the XXE files from the ``xmlmind`` folder have to be copied into ``~/.xxe4/`` under Linux. *generated* Entity lists and outputs of the UserGuide examples. They get generated by the update scripts ``bin/docs-update-generated.py`` and ``bin/docs-create-example-outputs.py``. *images* Images for the ``overview.rst`` document. *xsd* The SCons Docbook schema (XSD), based on the Docbook v4.5 DTD/XSD. *xslt* XSLT transformation scripts for converting the special SCons tags like ``scons_output`` to valid Docbook during document processing. scons-src-3.0.0/doc/images/0000775000175000017500000000000013160023040015463 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/images/overview.graphml0000664000175000017500000006055613160023040020721 0ustar bdbaddogbdbaddog User's view Folder 1 XML files (src/user/man/...) XML validation Writer Creating entity lists Check that example names are unique Create example outputs Resolve XIncludes for text and examples Create HTML, PDF, Man Install in proper place for packaging Create API doc (Epydoc) get validated switching to Docbook edits/creates <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="57px" height="65px" viewBox="0 0 57 65" enable-background="new 0 0 57 65" xml:space="preserve"> <g> <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="26.5396" y1="-732.5005" x2="27.7805" y2="-762.2984" gradientTransform="matrix(1 0 0 -1 0.1201 -708.5371)"> <stop offset="0.2711" style="stop-color:#FFAB4F"/> <stop offset="1" style="stop-color:#FFD28F"/> </linearGradient> <path fill="url(#SVGID_1_)" stroke="#ED9135" stroke-miterlimit="10" d="M49.529,51.225c-4.396-4.396-10.951-5.884-12.063-6.109 V37.8H19.278c0,0,0.038,6.903,0,6.868c0,0-6.874,0.997-12.308,6.432C1.378,56.691,0.5,62.77,0.5,62.77 c0,1.938,1.575,3.492,3.523,3.492h48.51c1.947,0,3.521-1.558,3.521-3.492C56.055,62.768,54.211,55.906,49.529,51.225z"/> <radialGradient id="face_x5F_white_1_" cx="27.7827" cy="-734.2632" r="23.424" fx="23.2131" fy="-736.753" gradientTransform="matrix(1 0 0 -1 0.1201 -708.5371)" gradientUnits="userSpaceOnUse"> <stop offset="0" style="stop-color:#FFD28F"/> <stop offset="1" style="stop-color:#FFAB4F"/> </radialGradient> <path id="face_x5F_white_3_" fill="url(#face_x5F_white_1_)" stroke="#ED9135" stroke-miterlimit="10" d="M43.676,23.357 c0.086,10.2-6.738,18.52-15.246,18.586c-8.503,0.068-15.467-8.146-15.553-18.344C12.794,13.4,19.618,5.079,28.123,5.012 C36.627,4.945,43.59,13.158,43.676,23.357z"/> <linearGradient id="face_highlight_1_" gradientUnits="userSpaceOnUse" x1="2941.4297" y1="5677.457" x2="2965.0596" y2="5770.9087" gradientTransform="matrix(0.275 0 0 0.2733 -783.3976 -1543.4047)"> <stop offset="0" style="stop-color:#FFFFFF;stop-opacity:0.42"/> <stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0.2067"/> </linearGradient> <path id="face_highlight_3_" fill="url(#face_highlight_1_)" d="M27.958,6.333c-6.035,0.047-10.747,4.493-12.787,10.386 c-0.664,1.919-0.294,4.043,0.98,5.629c2.73,3.398,5.729,6.283,9.461,8.088c3.137,1.518,7.535,2.385,11.893,1.247 c2.274-0.592,3.988-2.459,4.375-4.766c0.183-1.094,0.293-2.289,0.283-3.553C42.083,13.952,36.271,6.268,27.958,6.333z"/> <path fill="#CC9869" stroke="#99724F" stroke-linecap="round" stroke-linejoin="round" d="M32.215,9.938 c0,0,5.688,2.75,7.688,8.125c2.104,5.652,4.123,8.232,4.188,8c1.875-6.794,1.063-21.438-10.17-21.587 c-20.455-7.663-25.58,11.962-23.893,19.65c1.078,4.911,2.234,6.686,3.938,8.08C13.966,32.205,15.028,17.563,32.215,9.938z"/> <radialGradient id="collar_x5F_body_2_" cx="15.1587" cy="-765.7056" r="32.4004" gradientTransform="matrix(1 0 0 -1 0.1201 -708.5371)" gradientUnits="userSpaceOnUse"> <stop offset="0" style="stop-color:#B0E8FF"/> <stop offset="1" style="stop-color:#74AEEE"/> </radialGradient> <path id="collar_x5F_body_1_" fill="url(#collar_x5F_body_2_)" stroke="#5491CF" d="M0.5,62.768c0,1.938,1.575,3.494,3.523,3.494 h48.51c1.947,0,3.521-1.559,3.521-3.494c0,0-1.844-6.861-6.525-11.543c-4.815-4.813-11.244-6.146-11.244-6.146 c-1.771,1.655-5.61,2.802-10.063,2.802c-4.453,0-8.292-1.146-10.063-2.802c0,0-5.755,0.586-11.189,6.021 C1.378,56.689,0.5,62.768,0.5,62.768z"/> <radialGradient id="collar_x5F_r_2_" cx="31.5" cy="-755.832" r="9.2834" gradientTransform="matrix(1 0 0 -1 0.1201 -708.5371)" gradientUnits="userSpaceOnUse"> <stop offset="0" style="stop-color:#80CCFF"/> <stop offset="1" style="stop-color:#74AEEE"/> </radialGradient> <path id="collar_x5F_r_1_" fill="url(#collar_x5F_r_2_)" stroke="#5491CF" d="M38.159,41.381c0,0-0.574,2.369-3.013,4.441 c-2.108,1.795-5.783,2.072-5.783,2.072l3.974,6.217c0,0,2.957-1.637,5.009-3.848c1.922-2.072,1.37-5.479,1.37-5.479L38.159,41.381z "/> <radialGradient id="collar_x5F_l_2_" cx="19.1377" cy="-755.873" r="9.2837" gradientTransform="matrix(1 0 0 -1 0.1201 -708.5371)" gradientUnits="userSpaceOnUse"> <stop offset="0" style="stop-color:#80CCFF"/> <stop offset="1" style="stop-color:#74AEEE"/> </radialGradient> <path id="collar_x5F_l_1_" fill="url(#collar_x5F_l_2_)" stroke="#5491CF" d="M18.63,41.422c0,0,0.576,2.369,3.012,4.441 c2.109,1.793,5.785,2.072,5.785,2.072l-3.974,6.217c0,0-2.957-1.637-5.007-3.85c-1.922-2.072-1.37-5.48-1.37-5.48L18.63,41.422z"/> <radialGradient id="Knob2_2_" cx="27.8872" cy="7.9414" r="0.9669" gradientTransform="matrix(1 0 0 -1 0.04 64.1543)" gradientUnits="userSpaceOnUse"> <stop offset="0" style="stop-color:#80CCFF"/> <stop offset="1" style="stop-color:#74AEEE"/> </radialGradient> <circle id="Knob2_1_" fill="url(#Knob2_2_)" stroke="#5491CF" cx="28.258" cy="56.254" r="0.584"/> <radialGradient id="Knob1_2_" cx="27.9253" cy="1.6973" r="0.9669" gradientTransform="matrix(1 0 0 -1 0.04 64.1543)" gradientUnits="userSpaceOnUse"> <stop offset="0" style="stop-color:#80CCFF"/> <stop offset="1" style="stop-color:#74AEEE"/> </radialGradient> <circle id="Knob1_1_" fill="url(#Knob1_2_)" stroke="#5491CF" cx="28.296" cy="62.499" r="0.584"/> </g> </svg> scons-src-3.0.0/doc/reference/0000775000175000017500000000000013160023040016154 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/reference/MANIFEST0000664000175000017500000000077613160023040017317 0ustar bdbaddogbdbaddog# We don't use a wildcard for the XML files # here, because it would pull in the created # ones as well... Alias.xml CFile.xml CXXFile.xml Command.xml Install.xml InstallAs.xml Library.xml Object.xml PCH.xml PDF.xml PostScript.xml Program.xml RES.xml SharedLibrary.xml SharedObject.xml StaticLibrary.xml StaticObject.xml copyright.xml errors.xml main.xml preface.xml *.xsl scons.css SConstruct titlepage/bricks.jpg titlepage/mapnik_final_colors.svg titlepage/SCons_path.svg titlepage/SConsBuildBricks_path.svg scons-src-3.0.0/doc/reference/StaticObject.xml0000664000175000017500000000315213160023040021255 0ustar bdbaddogbdbaddog %scons; ]>
        The StaticObject Builder X
        The &StaticObject; Method X
        scons-src-3.0.0/doc/reference/html.xsl0000664000175000017500000000375013160023040017655 0ustar bdbaddogbdbaddog /appendix toc,title article/appendix nop /article toc,title book toc,title,figure,table,example,equation /chapter toc,title part toc,title /preface toc,title reference toc,title /sect1 toc /sect2 toc /sect3 toc /sect4 toc /sect5 toc /section toc set toc,title scons-src-3.0.0/doc/reference/PDF.xml0000664000175000017500000000311713160023040017311 0ustar bdbaddogbdbaddog %scons; ]>
        The PDF Builder X
        The &PDF; Method X
        scons-src-3.0.0/doc/reference/CFile.xml0000664000175000017500000000312513160023040017661 0ustar bdbaddogbdbaddog %scons; ]>
        The CFile Builder X
        The &CFile; Method X
        scons-src-3.0.0/doc/reference/PostScript.xml0000664000175000017500000000313513160023040021012 0ustar bdbaddogbdbaddog %scons; ]>
        The PDF Builder X
        The &PostScript; Method X
        scons-src-3.0.0/doc/reference/Install.xml0000664000175000017500000000313313160023040020304 0ustar bdbaddogbdbaddog %scons; ]>
        The Install Builder X
        The &Install; Method X
        scons-src-3.0.0/doc/reference/SharedObject.xml0000664000175000017500000000315213160023040021234 0ustar bdbaddogbdbaddog %scons; ]>
        The SharedObject Builder X
        The &SharedObject; Method X
        scons-src-3.0.0/doc/reference/RES.xml0000664000175000017500000000311713160023040017331 0ustar bdbaddogbdbaddog %scons; ]>
        The RES Builder X
        The &RES; Method X
        scons-src-3.0.0/doc/reference/scons_title.xsl0000664000175000017500000110564613160023040021247 0ustar bdbaddogbdbaddog 1 1 1 1 200mm 205.9mm 190mm 195.9mm 180mm 185.9mm 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 scons-titlepage-first scons-titlepage-odd scons-titlepage-even scons-chapter-first scons-chapter-odd scons-chapter-even scons-titlepage-first-draft fixed no-repeat center center scons-titlepage-odd-draft fixed no-repeat center center scons-titlepage-even-draft fixed no-repeat center center scons-chapter-first-draft fixed no-repeat center center scons-chapter-odd-draft fixed no-repeat center center scons-chapter-even-draft fixed no-repeat center center scons-titlepage-even scons-titlepage-odd body-even-draft body-odd-draft scons-chapter-even scons-chapter-odd scons-chapter-even-draft scons-chapter-odd-draft bold #C51410 always center after 0pt 0pt 24pt #C51410 bold always left after 0pt 0pt 0.7em 6 5 4 3 2 1 0pt 1 1 3 3 3 1 proportional-column-width( header ) proportional-column-width( header ) proportional-column-width( header ) baseline baseline baseline 0pt 1 1 3 3 3 1 proportional-column-width( footer ) proportional-column-width( footer ) proportional-column-width( footer ) baseline baseline baseline 0.5pt solid #C51410 0.5pt solid #C51410 1 0 1 1 0 1 scons-src-3.0.0/doc/reference/main.xml0000664000175000017500000000711113160023040017622 0ustar bdbaddogbdbaddog %version; %scons; ]> SCons &buildversion; Reference Manual Steven Knight Steven Knight 2003 2003 Steven Knight version &buildversion; Builder Reference scons-src-3.0.0/doc/reference/pdf.xsl0000664000175000017500000000510713160023040017460 0ustar bdbaddogbdbaddog 0pt /appendix toc,title article/appendix nop /article toc,title book toc,title,figure,table,example,equation /chapter toc,title part toc,title /preface toc,title reference toc,title /sect1 toc /sect2 toc /sect3 toc /sect4 toc /sect5 toc /section toc set toc,title bold scons-src-3.0.0/doc/reference/Program.xml0000664000175000017500000000640313160023040020310 0ustar bdbaddogbdbaddog %scons; ]>
        The Program Builder X
        The &Program; Builder X
        scons-src-3.0.0/doc/reference/SConstruct0000664000175000017500000000365413160023040020216 0ustar bdbaddogbdbaddog# # SConstruct file for building SCons documentation. # # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import os env = Environment(ENV={'PATH' : os.environ['PATH']}, tools=['docbook'], toolpath=['../../src/engine/SCons/Tool'], DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_HTMLCHUNKED='chtml.xsl', DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') has_pdf = False if (env.WhereIs('fop') or env.WhereIs('xep')): has_pdf = True # # Create document # env.DocbookXInclude('reference_xi.xml', 'main.xml') env.DocbookXslt('reference.xml', 'reference_xi.xml', xsl='../xslt/to_docbook.xslt') env.DocbookHtml('index.html','reference.xml') env.DocbookHtmlChunked('index.html', 'reference.xml', base_dir='scons-reference/') if has_pdf: env.DocbookPdf('scons-reference.pdf','reference.xml') scons-src-3.0.0/doc/reference/Command.xml0000664000175000017500000000522213160023040020255 0ustar bdbaddogbdbaddog %scons; ]>
        The Command Builder X
        The &Command; Method X
        scons-src-3.0.0/doc/reference/errors.xml0000664000175000017500000000311713160023040020214 0ustar bdbaddogbdbaddog %scons; ]> Errors Generated by &SCons; X
        X X
        scons-src-3.0.0/doc/reference/chtml.xsl0000664000175000017500000000404013160023040020011 0ustar bdbaddogbdbaddog /appendix toc,title article/appendix nop /article toc,title book toc,title,figure,table,example,equation /chapter toc,title part toc,title /preface toc,title reference toc,title /sect1 toc /sect2 toc /sect3 toc /sect4 toc /sect5 toc /section toc set toc,title scons-src-3.0.0/doc/reference/PCH.xml0000664000175000017500000000311713160023040017312 0ustar bdbaddogbdbaddog %scons; ]>
        The PCH Builder X
        The &PCH; Method X
        scons-src-3.0.0/doc/reference/copyright.xml0000664000175000017500000000303613160023040020710 0ustar bdbaddogbdbaddog %scons; ]>
        SCons User's Guide Copyright (c) 2003 Steven Knight
        scons-src-3.0.0/doc/reference/Alias.xml0000664000175000017500000000312513160023040017730 0ustar bdbaddogbdbaddog %scons; ]>
        The Alias Builder X
        The &Alias; Method X
        scons-src-3.0.0/doc/reference/titlepage/0000775000175000017500000000000013160023040020132 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/reference/titlepage/SCons_path.svg0000664000175000017500000002743513160023040022727 0ustar bdbaddogbdbaddog SCons - Build your software, better (SCons Logo) image/svg+xml SCons - Build your software, better (SCons Logo) 2011-05-19 Dirk Baechle Dirk Baechle <dl9obn@darc.de> en SCons software build tool software construction tool Based on the SCons (Constructs using) logo by Hartmut Goebel <h.goebel@goebel-consult.de>. scons-src-3.0.0/doc/reference/titlepage/SConsBuildBricks_path.svg0000664000175000017500000007440413160023040025043 0ustar bdbaddogbdbaddog image/svg+xml 2008-05-18 Hartmut Goebel Hartmut Goebel <h.goebel@goebel-consult.de> en SCons software build tool software construction tool Based on the pixeled SCons logo (author unknown). scons-src-3.0.0/doc/reference/titlepage/mapnik_final_colors.svg0000664000175000017500000061234113160023040024673 0ustar bdbaddogbdbaddog SCons, Book titlepage background image/svg+xml SCons, Book titlepage background 2013-04-15 Dirk Baechle Dirk Baechle <dl9obn@darc.de> en SCons software build tool software construction tool Based on a SCons dependency tree of the Mapnik project (www.mapnik.org) ./src/agg_renderer.os ./agg/src ./src/graphics.os ./src/font_set.os ./agg/src/agg_vcgen_markers_term.o ./src/params.os ./agg/src/agg_image_filters.o ./bindings/python/mapnik_symbolizer.os ./src/memory.os ./bindings/python/mapnik_font_engine.os ./plugins/input/shape/dbffile.os ./agg/src/agg_line_aa_basics.o ./src/save_map.os ./bindings/python/mapnik_view_transform.os ./src/color.os ./agg/libagg.a ./src/font_engine_freetype.os ./src/stroke.os ./bindings/python/mapnik_image.os ./src/image_util.os ./bindings/python/mapnik_datasource_cache.os ./agg/include ./bindings/python/mapnik_rule.os ./agg/src/agg_bezier_arc.o ./bindings/python/mapnik_featureset.os ./agg/src/agg_arc.o ./plugins/input/shape/shapefile.os ./plugins/input/raster/raster_datasource.os ./plugins/input/raster/raster_featureset.os ./src/unicode.os ./bindings/python/mapnik/ogcserver ./bindings/python/mapnik_map.os ./src/arrow.os ./plugins ./plugins/input/raster/raster.input ./agg/src/agg_vcgen_contour.o ./agg/src/agg_trans_warp_magnifier.o ./bindings/python/mapnik_datasource.os ./plugins/input/shape/shape_featureset.os ./src/load_map.os ./bindings/python/mapnik_point_symbolizer.os ./src/line_pattern_symbolizer.os ./bindings/python/mapnik ./plugins/input/raster ./src/map.os ./src/wkb.os ./agg/src/agg_vcgen_stroke.o ./agg/src/agg_gsv_text.o ./plugins/input/shape/shape.os ./bindings ./src ./bindings/python/mapnik_filter.os ./agg/src/agg_vcgen_bspline.o ./bindings/python/mapnik_coord.os ./src/envelope.os ./agg/src/agg_vpgen_segmentator.o ./bindings/python/mapnik_layer.os ./bindings/python/mapnik_line_symbolizer.os ./src/shield_symbolizer.os ./agg/src/agg_trans_double_path.o ./src/projection.os ./src/tiff_reader.os ./bindings/python/mapnik_proj_transform.os ./bindings/python/mapnik_style.os ./bindings/python/mapnik_shield_symbolizer.os ./src/image_reader.os ./agg/src/agg_bspline.o ./agg/src/agg_trans_single_path.o ./plugins/input/raster/raster_info.os ./agg/src/agg_vcgen_dash.o ./bindings/python/mapnik_projection.os ./bindings/python/mapnik_image_view.os ./src/distance.os ./src/datasource_cache.os ./bindings/python/mapnik_parameters.os ./src/plugin.os ./agg/src/agg_arrowhead.o ./bindings/python/mapnik_feature.os ./agg/src/agg_embedded_raster_fonts.o ./src/libmapnik.so ./src/placement_finder.os ./agg/src/agg_sqrt_tables.o ./agg/src/agg_vpgen_clip_polyline.o ./bindings/python/mapnik_raster_symbolizer.os ./agg/src/agg_line_profile_aa.o ./bindings/python/mapnik_line_pattern_symbolizer.os ./bindings/python/mapnik_color.os ./src/proj_transform.os ./src/memory_datasource.os ./plugins/input ./bindings/python/mapnik_python.os ./src/png_reader.os ./bindings/python/mapnik_envelope.os ./bindings/python/mapnik_stroke.os ./plugins/input/shape/shape.input ./bindings/python/mapnik_query.os ./src/point_symbolizer.os ./src/filter_factory.os ./bindings/python/mapnik_polygon_symbolizer.os ./agg/src/agg_vcgen_smooth_poly1.o ./plugins/input/shape/shape_index_featureset.os ./bindings/python/python_cairo.os ./src/symbolizer.os ./bindings/python/_mapnik.so ./agg/src/agg_trans_affine.o ./src/polygon_pattern_symbolizer.os ./bindings/python/mapnik_polygon_pattern_symbolizer.os ./agg/src/agg_curves.o ./src/text_symbolizer.os ./src/scale_denominator.os ./plugins/input/shape/shape_io.os ./src/layer.os ./agg ./src/libxml2_loader.os ./agg/src/agg_vpgen_clip_polygon.o ./plugins/input/shape ./bindings/python/mapnik_geometry.os ./bindings/python/mapnik_text_symbolizer.os ./agg/src/agg_rounded_rect.o ./bindings/python scons-src-3.0.0/doc/reference/titlepage/bricks.jpg0000775000175000017500000010776713157757627022175 0ustar bdbaddogbdbaddogÿØÿàJFIFHHÿáExifMM*ÿþCreated with The GIMPÿÛCÿÛCÿÀc0"ÿÄ  ÿÄM!1A"Qa#2Bq$3R‘Cb¡±Á %4Dr‚ÑðS’ácƒ²Âñ5Es¢“ÿÄÿÄC!1AQaq"‘¡±2ÁðBRÑ#3r²Âá4ñCSb‚’5Ust³ÒÿÚ ?ÿuŽtúÿ,F9̾_Ë$HDªžúÛâY9qðÇÎàÍ5_ÖÜ:ñ扄“ÔúÃE ”¾_Ëù§\b«† m ö.xÙoÃ’/_ã‰) n­°¨Dˆ›ßÅË÷§.]8`Zs¯ïKBÝUS_ÊÃoÈx}<1ˆôlÉuwG¨PInžàœ:p·ç~˜ ”ŽÜÜEùðK^ÿEãåËž'wÙ{Ú—«w⊗¿Šq^?^>8„qÍwMÛ¬èã¬}Þ$¶N?.IÒÉ|*kD%åoÜR }_ß|zWÌ™^‘™¿"zíqvFã¤öôÄ^aCÝÔÜ£ÆÝoÇ h'6•CÊI6íA– RDq¦ÑC¥ÛTñN=o…{-‚š©{Ëtüõ*[÷¢a‰Ÿ%ê'd<È‹ªÜ0àëȺŠKÏ’òý›xÝr¬ž§Ö4“ó}ð0)1dT|•!Âq…!-ã$¿túð^õùªtºA9—ê0…·…æã‹¢¢6¾ÕĶž6óDD·KrÃZ—GŽ•3&¤²?|l–Ò¼~²"~cò¹NlÅÝÑ¢4qï\MJ©òÙ‚ð¶VOSë B ¨­\rn›™·ï¨9úŠcÑã~b¢½qå œí‘¢8­q’zÁnˆIÙËâTE±r±¢§K`â«%•2bi¿=f(j«ÒÊdJŸ4åe\ÖI²!Ái°!'$6ネD®5«Ÿ6ˆyp· &4Ÿò农ƒÒ!fË¥EV¥5kzõFhÃÜ÷—ÝòÔœ<“EÁ hQŽŸ™R‘™J[Õy0Ê–îñPeÇ ÷Ñú¤$ãÀ‡½È± ûðÁ—©¶ãl® m¶¸ˆªŠ[ü\ù{ʸ q"´çõsN%qÕ“î*¥×ìþhWEãïêñÇ‘ò§ùSè#0Ç•3o9:+ŽÏ`]r*±?„·.e­Ç¡ßÙ¨¤ù€€çÇ|WåC–TÈmHjEßì§£ìÎFWIEXø-«‡âà|5`j¥P¡§e…5ùí¢´ÖÿÝlETQSölˆ©ÃÝTðLV¦–u6’é¾S t˜ûÇ U©.”NIÇ»Ó «æ?zAFèðÂß–7sœj^^aäÔã +jzä"¥’ÆIÏ¢ìiN˜^Ê6¥FW%·À c;#C`Š(KaºÙ UOÍJø‹ÌVó5sµTjfõ+„§1ÀÐDå’É£ ¸wPñ,oÒ¨ª-ïgI 5$$ÝÇž”Øðl–WÇ­´øPzayß/ß’]Ï>"Ëei´QV@–ÜXíŒÉT÷Íþí¡Í@GÍUo~Tí jq‰/6úTk -Js–¢Ëwa» T穱QÕ¸&Ú{¸lÕdÐ)ÑÖj´Ñޝ›úQòQ2ÙR—ë]Þ¦œýSjðãžÕ¬ñDÈ#b•R)ñšŽàÕ{}Ü%'V¿òÈQÏüMâ`o¥YÒ½>†ó†b¨²Fíóâ CÒ¢"©ÌEÃ.|öŸOó!Ï' öúx< {Nž™j¦/¼¥_ˆ!ÈýÖŽ¬fl甜§Li¢™!øÌ¨#1‡L4tW¸„ÛnÖövöIvþVœý˜ê•JsRg * ÆŽ¢Ü¶$hnShemÀ‘¤röEpMz®9ìç¥Miªƒ’{ U¶^[Ém*:ÅAAøQE<ùð¾ùƒl³…{Ö5“ÌÔ° ®à ‹hëq좢(é—R"?ŠøV³eÖ*XR®¢VlHèö/¯ãyN™*ÝàBnx0Ó®{ú9*•(Ò3*·Û$´ñH*|È]ªðÅlGõ^úê¾ó𽼃¹’¹›š©Â*C'ÂŽÒ¬zd(ñ–_fxwª´ø±þÞ ™+ºø™ë0î`‘WÙ½:™2¢þk¦f ®FW˜ÑvWT•W@“—àm dŸŠÃ‰*m…SU•GœQeËFỹ–³N:´oMøëlP¼,H1ÆÔRVSÕ$ÏËÞìÚÍfзµO15-ºl@ݸÁǨs ìÏž*0ÞG ½[f_f’!H‰L‘œr\Uõƒ’ÓÂúÜSáÞ]ÍG#µÜáI¥Á¥ÑŽL™® aQŸMwsEaÙ@¹M“#«ç¾Rq~ˆÇ§ìý²J~m¤Ê§ÓåII6'ºå†ñQA5þÖ2QÔwámÄ%ÁÍaÅ>ƒH¦zÖ#0Øp˜‘"A$`ê@{VÉËïl—ÙºFݱ§NHH>{; ï{u~#Ì5,(-Iž^X,–à†äЗÉYª¯•ެʬfz¼§Nntèu)“çD#FÀEt­€ ò.õ×µ¡PjFìé5Ö"ÅV—³Â§FªÅ5sJ *9øž4W¯ŽÙËeð()P®Ó#ÇI–ÚŠm=¼pžuçÍf©$ÌŸM7°ºˆW$,æl¯³Œ½e;™)TÄ¢Ér݃³©{BœüËñ²•^4ôĵI¬ZŠ·AÞ%^7áÌxˆ§$¢Û¤nöwo¦žMèVëqeÔeÕçEËð&¬±:c¦© IQ™ì«ÖqT pT²wm|ÉX¢ÉVœ¦öÁmÑ”ëçÜšñ)k’¤ÿ´T3U Õ{7¥º‰ ¦íe[*”ê}rŸ5¡’0Ê"¤µyglˆ¯ÈwõŠñ¢¹o Owë2zBSëÈÌOÑã¦ÂQ0eÃ>ÌÓ¢ª}Ç ^z¿j>D·bE\Ò&Îþ±Ùa aÓ“ç^„Ue5:‰-¼ ïl·FcÞÚDæt{""I§WgWjY©á&+qê ,T¨ÂcÙ6B†:/¬lâÜpýG%åGÚ¨Ö³dfèæàÈ [›‹)Aö£?ÆèôTy"9n˜„ÖRÍÒB(ñuÝÃqé“§»W©Î%MÔã²›¡iÆôé÷”‹¼K‚òÊÛËNªg ã¼EàåÑ¡Eªv’dÐHMfÕ£IŒë ;·ÖöÂd›ÐdµD‡©C½³ô±ûNОªe–’C 8‚åº3>y˜ÛËù݇Z–âÓê.Pêo¸#53¶·>#ŽšÄpª*Ú§‡»Ós¤Vs~ÂËAH ÁŠ©.Jo«œ4BRÚ‹úõ$$$wÑQSž%úAlë/qºI•.,ÛDóTæŒæ—hRVnËòšEdÈ£ ‹ç»Fô’@f¿Ihõ‰r#µIy¸zS²¦?¹Þ#n(‰³>è”G§Þ¯µá¯$ìÍ£>LÀ†ÜüþQƒœ³i­¹Iý§K!‰g êìÿmÜÑaߥ¯d>×5(Ô¶ã*Fµ¡¼"Ѝ@±ïÝGÜÖàýè8/_Úc~ˆÍ šMAÊmAÈè ±É‘ÒsU· þ×ñû@;/À‰¡,Šu'm•ŠÏck+Rê³æ¸·ªciÑw‰4Ú¢&¥#×ÍÍj7LѪ° U¡®i¨f)ù„€Uâ¢Ëœ­ÂUDVšf%7í!v­^¤]Áš‘˼’§ØS>"WÅß‘a_»Æ'mÚdS.Uÿ|ñF–o¬]Z¾ÓrEâÔj€sžy‡ +S_íò©hN¶÷Dq´¹«fÉpÛÊU\Ÿ;-¼Q')k FdsUÒR¡˜jHŸ«±Š¢ŠõE^Å,f.JÌεÛaW"9Ú[R+%$¥ÏuDPœ~-?í#»u ¶½mí –Û7=ëã3u.‰³ú{ߤ÷ž§ÔA†’™)øtú{O»(œ`"%*­¸*Lž«e°W‰Â•©òtË¥LŠa:]*C‹&ÎE˜g×lzˆtñ!u=„‚¤ÐÍm[N:ÅÂ8µ6á?*>bj¤L)SaÃ#íÅIªèœ¼{ÛTm:wmk¦4é9/.åãÖf¦”™ÂèHdZŠ}ZªEÝ“Tmïj„ßkUõ6iÝ$Å‹¶ü­•Ž-ŸzÊ:xK©Nm™µ7cL«?1ø*MÎõQ]Œ&/«æÉiô'›2[”ö‹3>¥*<ùmº¢<íK-ÏuØŒ’ƒt–~J»!¡mÇ¢5¦Aº(®Š#Æyû Ir›‚KjÏ_—qš]¡¾”¨›©)&ïr—>~NÚÅʮà •>›—™HjoEYRhÛö¡ÀÇ âm–öR”•ÅæFHW+áCµ}²ç-šÀËp)ó2Ûu,ÇP¦ÑÒ­*G©Ø„|‘Õ2wÏ ß·s~:]D[j[FMŽåiõéS E­0‚šT§©íÔsÀ;’•!ÿj¯“f—º¥¥,"–«û+Ë;AÚf}§çŠ„ŠdúœšKõ˜4 ý+,Ó÷RX¬L™K’ôɰJ–4i´¦©O›{ÇQÙDã¦å-!JeÏÿ–”C0¶7w9‰ûChïSÙ–Hçr3†È~&5½<+tµ™³,å 7@ÍŠÍ]§–D9!ÇÛCv•K` ðÑ"A޾ã¯9¨Ü#'nP¢Ì¨¸Önqªó0g4sØ­åø”ú„º‘qq†aý²Kq‘”ï.éD{ª˜[z\eʤ܅•Ë0L¬W³þÕ›b§MŒþ^{+P(Ôú³«¼˜ì¡ÓÆhEHHÌz¤HS) S) í.$7œ±ÞŠY~]^“IËÕÊUO0H§ÅaÇêq´@‰L‚ÒÔ^¨(ÿùoxM2_¬FÅoÇ'Î÷†žMÞl´y”§7áÎ%ÊA\™“?å“q}Ûy4$ó5ÌÒö` äWªòjaVkæáh0Ù$Ó!¯´z˜I¢ ‰šXç “m7d)€ýœÑó”ÚR¨µyïÓé5™2jÕ<ª0ÍgLŠÈ1*|ϲÔ„ÓaO¦¦¶[Œ1Û´æûCF$½—vQ3ÓiUYs(ëN›@õ6`Íu‰òÜ—2A²¿w@Ò7H¯dÿÖbge;4ÚcÐà3PŒóU©T™ Ò¨šä»JŽóí·Õïj"¶¬†¯ÕˆªwUdí*_q2[hÝÄÏà=-ÐTûíÔEú Ôÿ¼hƦU[nhåŠy‹1cÌÇQ—¿©&kà' =%/a…¼’zÞy¿f뺤%·‹†–Ê2:›ZzVmš­MöYÍ·ÔÛ¬F‡ ØmøtŠ•E¾ãÏ£Clû8Å.ó%€¼¹T¯Q³C”ŠÖBÌeLßÀ!iº^q‹* FeÉoV¹xÈÆÉoH§ySY4é™ö&[ÌUÊ^Ë9„+Óêo³©™iaÓ)¯ïš±à¿*[TØñÕ¶7ç¨ÚR"H9J÷ĤèHðÕø³?†bÆ-Æ;¢ÖåÊ(W²>dqè2¡UäÔZƒ %7/Õ³1ÅÖ„ßRJ?[AªjNînìê&ìÓ?äø9o>KŒ»X™3mR–ÛÙË).$æ2 žÇ=N\_·H¬Ny€Ÿ „ç}aËa–:»èÏB©?S•PJ“4ú©Ám©Ùƒhµ¹ríN{Ι¬ ½K•íÝÀ…`ýà({" UM¦Ñr|³fø°bT鹎0Çõ…z©G’ÑH²$¸S¨a!=^°¡! »oZŒ.9í ñKiQ‰»-`’€¦:î§ï/¡„6uWÃÖM,m9~;ßã˺”ÌÉ(!§ hΨëP»*ñŸ¨SÝÞ¹.”êë†f…¬ã¯Ô´†Ø<-—lü›š³hÁL†Ž¸Ý`¼TÚë©Å.Üñp§:ÛˆMU/g!bè`'äÊ­o5D-È•49§O­½F§6ì•bJè(R)·|‘@D%-î/‹ÃÌpÿÏ•hZ+-ÑòFUy «„‰•ˆe")FHè Û’¢KûElͰtœºG5(àˆÛAŽ6FÃ5Lµ0T ®D0-Þ:i¬tS¶¯Ã†±†þ·Þb‹fÜÛ0O;/ìï0RF­ú=–ò~P¨æµ ¨™tÐdZ´l·ýI8I$ênSßxŠËûK’0œ²^Æ2Ĉu¹¹×`L™Vˆø…rƒ u,Ib Ä/³¶$2Б¡ö¢£oªÈq_ö۱짶¬ÀÕ/4fuʱé~ÇPÉF¤IG‘%_öùJB¶Vœû¥»vÛå­ˆz.lš¹”åæJõ]¹ó`׿Õ^¯½V®!ï¤GfgØ·q]UŠJ7CèeÞ%Ç«i¶d´î&ÓÒ™Ã|Ç^]ù‡h*j•º©–’¦( Ý’ëãï¾,„Ý»ú;dWáS"Tf¹P&å-TãB•S©Ì2ž•vm"Öé·¾n ©ÙÅ%A`DZmà "GŠÙ¶Úèa–ÛuQ.N÷•pÕì½NŒd-4‚za²qçš«bŠ„zÙöK ­£•¬]ä\iA&’i ”?x(é¼À;õÆ¢7ªœ%(q³¡´%6‰´Ù´ªÔ.Í‘|©E§S©2!·. Eá Ž8(¨>êZÞwD_ª]z_Èïeùtîó½ÿÝüñ*ãÌ“š5j²ýÚt¿ÿ«Ýz*/^xó” *èÞ<J_óæ¿è9tU^ªˆ^}WóEãŒJùó+Ò37äOAý±¹TF#9¿÷‘ƒÓóÞ§ñ·_§SÈâ•%=c¸èÈ0q¦Ä_К÷Ul=:ßÅn½x*Þ]ó* Mš¶ì¯t]kçÖ÷ù/ÎÎz-=¢Dm¦‘§d4*á+!(¥¹rN¼ñ•dõ>±ªp:H‡ZÆå¦¢C<§$ ž¥­†‘”FÌDú¥ÅP¯È‘9cÒµS•<eÀkJŠ6u$†èë©oPï⨾$+ºÌm‚&Ì,ŽHk—çø‹¥9ð<ð'Ćé>ä©RÀûkî{ÌÄAA _š§úáudõ>°Âp:H ¨ÄQ- yw¢çµtmÙûÝäÿõŠ£eûBVEÀŠD² L=¦"#ãk’]VÝ4¢ÛæŸL1j'DC–m±”ˆÑ—ö’jÖhËüM uÒ£ÁØìÐ[G) ²„DRÎáj]½}Í"žHœx®Ÿ§wÖNAéÎÑq,‰C5TÊP§ Kr+qDöfªÚø¨ay=êlWNœÓ’&iSC5âÁ';N⮂áï óÃ&§Pe¨O6òвïtZ7ˆâû­Ú? :…U{ʺ¾,'³Iº\g“L8ò”ô×CZU.Á §ÔʶK⤤¼ðOßâ …^p«Ãq˜m¹ À´™´¹tEáùÙmÕ 9u9NŠ´¨‚rBTÕu⪼y©*ªx"ù`‘ñ‘&A¸L‚«„ã—l4Œˆ‡H¯+"¥øq[¯\F±@¨Ôq¸ppÀ•HÆÚUŠ[ä‹e¿ÞÉŠ M(«æ7:Ü€Hk7å¤ ³S5e ùA tãÜöó<4¨µ?W8‡&/k4Ö_…/Á~‰o$¶«]¡É¦Œƒq§!²ëhQËÞ`ÈxüÎæœ¸x`6M¯²á:TòlLÏÞ²%ø¯ÓÅÈ—Ä ­É‹5ËAÐrŠ–EDòº*¯]J¼ï…gË¥¨äåí«±ú ~—fB*¤1ã~/öøëÜGQ©0àÌ8ÄÛ¢EpŠWÝ>:SJ§" ªxŠôÂÚ«^8—iÓM {6áýÖøqg¢¡_çÏæS˜Ž@SÞ~LÚr 4¬ {·ÏY+–)ï*¡]ýÔ°ôà¬ç‘YšD4a¤FÜw|rLWmÞÓ¦ÉÔPPz`b˜X€…À 5á |IÔßQÏ_ÃÎ6+¹Ý·Ùìn=Ur°æõÙ vaaP×HîxhBæŸV¿‹Ù&| ïÓ9Eš|1$h÷»Ê‡üB]âñøü-€‡un—',6)èH¡º÷ÏMà¿”m<‡9{-Öê»ÎÇi°Ã1÷ Ç¹ºEmÿt†Åׂâ6Ôá riŸ6|súiК…-Æ ÓÇtÜzë J|˜2áU¦ G™SIOŒGôGm‘}ÀM ¼®)¨¼KR¯TQ:åR¯E‘L8Çz!«¥ ÷ªÝw‰¹)!¡ rT4$· :ô5ç%XpÖ °ç6ߺo8J¢ŸâT$Sýµ$ðÄmb€TögÌÒé´6¦Á @Ѝ‰§¦ñ{ÊT¯d½±ÌÊmëaÃt{}"èvÙkõ×ÎYËh•i¸°cögœu´qÞÏ­ShWR{ÃÆâ¿†ÉÑp—2§9ç‘Z‘%çÍèæªê0ÂïLÍZøt ˆ—â!Rø°ý«APÜo-1žB=ÓïïÅ4*†­Ï #šwžzï×SaÓ߆LI¥E§#ï–U1R@MÙ~üvÖ–RÅDÔ IL›ðy±½˜žO *MIQ)Á.:qÏ!å»1eÔjW 2Ù •up“’|í¶] ¨Øª¬QÌQÄÐÅGH¢*[ðU¿%áÓs;7K£²šIs˜}Ã&XœÇg’Òªª¸ÅìNj&ÿDña`ÝY™±É‚ã4‡!ÖËûJ*éCó²"ìéà¶àõ,Úšys7M´õ{¹ÔrxB®Dy/ÞÛ ìüݯ;e¾©dÊ5IN/c6ŽH¢¨{È*—T[øªªóåeålKËõHµ%b) ´`ñ~¡²2U%}Jë˼«á‡¼¶û+gRf1DCPl†(··—y;ÉÂ*_žb«XZÍ©$@p‰Ö\c[N®¡D.7K*^ܸ§LuuQ@,0újÇÒ (’@)}ÒNpn1Ê!šÉ}’<©K04pnQ£r4²l ÂÒĪ+⨫XÔøíÏ'¦¿)‰OIiØ•&‹[m{Õ´B^}Ô[ò+¢òň­R© Ñ–XÓ;1¥´ó/8:x@PÃÓ¼:WÅQK |Àì3`™o{l¶í  ®(6BŽ‚á}D¤gàdIÆØå6…uT⤻(o ÜŽFv’ŸÜ"Z‡äA±äø_Ï7‰˜ÛWÍy>€¢Ü3s¯K2&Xkw1°iÓi¢—!=ä&„? JÅ <íé=œ²…9Y¥Ñ™Ë•J¶¹­‘m&¬Já¿ylˆJ.©…=G<æfB»MÊÓܧœX̲r⇗Cê’.]Þ 'T^·ÅvÎUz„ùí%F·P«8ŽŠÌ—P÷À¬:›e|Q, ψ¦ ³¶Z§„ÔT6êR’pÈãÔZS´Ä²S'çI)/ÄX縰‰üÝ·¦æ¹R«ç*’8KÙê3~®v0¸)¬NQVê‹Ââ¨]pœÍ5Éï„hg˜ªÅséRþغÅãB‘úÍå¯oÕßwnââf»%Š…V•I¢Ód´©ÈsûQªˆ“Ž*ò#"V“þ^Œ|欹#³Ï^²QiˆA¿q„q°]B„¨}t­ÓÉR×áŠäR‚Á­aŒAåMU\÷$›ÜpqÇ—ù…|•¤2¬Lu§³€‹3\• š‘.–IMÒS ¨¡vW½¨\QÅïßX÷I0-3.®÷zÅM™„܇;K¯†íÈ‚n‘ 0= @‘μ–ø&z¤ÎXlnkÍR) RQH û«&`#DÏá#]@[Q^¸ äKX÷4í½1‹è gàër‚I˜²}â³)’]îSbnü¬fZ£û1ÉR3®fŽÍ2tòr]‡7e*Œó#m\Þò]Ù¡úèãÇoþ'¹J ¹™¹õiùÒ§1ÔÞ¥eZ>$Ý€©qî’¨§»­§gÌÅ´ ·l­ÔfÔ SØ*}e1Ù©ÔæfÐÙ_t&Õ×WãxÜ?ŠØV7KrTgô“Äl ÷“‘*ñO%æ—éçÇ)6m=:f€V¬Y[¡üHôÌ%Uµª¦©HC²TÀÓN`¹u‰*žÔ³‹ôå¢I¥¤×j¦Òô‰µ'7HŽ_Ç¡Çð qÓÆ*‹Pí1ùC6¡SyÄu˜úµ!‘¢•øýÚª­ÃE¾céò{p¬>óª¨"+Ô¬–ëák¦Y++¤½W¬fGÞOa¥D¦BHº¨ºF»´‡¿ö›´î‰jð[\tà•“©)÷ …LtƘëÁ•§—WYP‰¯Ý°7àÍl;3ñ¼MQN±Ø¢H‘6¡K†Ñ¡»!ùš›p‘Â' 6Ýã4#ø¯‹™³ì·O˰¢W*tÙýhÄ!Fr£Gj¢ìW5#‚–ª4ŽT×YÞ­Ü`›u¯dmÚ·å,¦U5‹X•êh²Ûg =U†ö›DMÊ¡±ìÕ×@t´ò' Å« ‘§ÔâÊ܉¦ù³Y€Ìª¤xS;R²€ßª£Gû{M¨"+šø™©¸ÃÇ?.¢–tÅ#ò¨Ž6 vúk˜é¾¦H -ÚbµÀbîÖç‡M´mÚƒ³øL”%U¡çJªE,ÃV~1Ê:3dâ2ëèÄBbhkÁTµ iTÅÌ[CÌyš¥MS0UëÓÜbÕŠ·mß‚4Ú²>@"î£|ÇY–‚ë5:ƒó ¤éUEæ)H‘%çœYd·åÚA®õU×t]ìÄ,M”vxUÒQz˜Üb§ºL³F¦žáÅ%3íÛÉT×Á ÉdLWøšJUL”aœ]L:äÚ"­µ•bTÒÒÂÊ@°6=í £e´,ÏHW*3i›Ø•V§À$œ1̪ ír+ÞÔi­£–| L{¤8µ3ÑkµÝīě.lFFM!’Üå°VYW«B•í¡FŒZÙŽh·&€æX©UlÕ^boè&K¦ƒre µ5§ m!4®/n_½Võ(•îî­ÜÅØÍ6¡–©ÀÜjÅ9ÙÓÚf-AÙ3;-*˜æ˜fA2­ð–àÇÄŠƒ„QWïfɘã÷*é¼ÙÉíG•H)¤L÷/¾ aˆ±ï°ÿxðô´¡@qÉõ¨Vjðè³rå&ŠUÚÄš‚U‘ žüùîoo›U$Ô”ð„/bØ·÷b)‡¢–P¯Tsùž¶ü¡SrJ•IËíÕ*é2ꮵé/JÀ›qˆ¦(ŠçµqGx÷¶#Å&ô‰Ú*–Ñ$Žõš•F‘]hÞªÆouôöŒü´½ÿ÷µ—úî,j'¥ã´œ·Re„©Òj&m6’)óû4Z˜ ae /û˜¼†u…àÙLu^ä)Tê‰QÊAá/¬s*¨PR‚ÏhyŒþbzAç #›n:¥^]F°Õ’í8¡Ó¥ ï 0Ã-5G§J¬Rd ËÀªÌÜ8lˆÄ]0 $ûÛëÔÊÐÕh”°¡ºÄiÔš\JO¬&̦³!¢Ñ¡2 Äh²¦HCßL,¶ÛÒ^xÇP’Q<š ?/2fZ´z#räTÜ™&Åí•zB˸F²ÝðUGdz-Oós»'íµ’¨:•js!Sª)Neù*û1¤2ÿµz3ËyJÚtÍ8âÚ›=5’“K”2plAü;Øæ+l™JU=J§žÂŠˆÝ‹[=ö×H¹QŽ\‰˜ó~Z™“e@‰.¨þb‰yV-ãÞiàßõ-9·˜&Ý6 ÿ_¾„NµÜq0K³M´4ÃÛ[Ï4 ËY¨£ÓË´Z¥N™N¡kjK/-UÉÎÓ~Ù2[ziGÚÝ݉ËûQ»„NÓ}*òÝ+'9G]=¡çzõ¤Ìš=I”¨s§¾ÔrÄZ¤ÉJƒ´è 3´G^: ™ <ìÔfø šŸ"¨µz=:¥T¤µ±°¹é>¨)"Tåi#ÅmÚ1µÇa€ŠÉ©3TPdÉ™âU,‰s«*Z1}HOÞ÷æÑ¼’š•{š`ÊAÜqg)a¼ì8´›͹™¸UœÙR¢BS~šQiÕ(çWƒWgZ«4õf¢äšIÀˆÔŽ ¿TIÀÄ\FÒ䬳:‹ºÔZ¤Õ^Sm$X”ù2XtΠ]®J£¯Qy§ßq·J–Â2O‹î>ho¸)‘*Ìå‘Õ+µò›§éb õõ@²ô5(°“uúº1™d5~·Nùx9Äûgt*»¹=Ê}0;Wj™iõnÚM$7»EÍ:ÇŽ6j2tŒÛIˆò¨Ðµ’‚*O½EÀ´ÎÐάGê1·×.rÔò 7}䨒zç íÌ^vM'$RÊ´þhjlHe[iºfâT#ºÒ¸Í¤8ßDP»fk¿&´”n®â…3A¥Ó3ms1V§VêU:»Á1ÂÍs'“, ¹ØË4˜]Öôc;<­Òzøè×'e*NG‡.¡˜mNyæŠz²==dEiÕž2¿¾¬T4lÒÝÇÚø1ÎJ£TÚ„šƒÔ'ªy©¨¯•B¯Q‡DkFöOiÿƒzÛB§Zþìæ¨ë÷Xµ´iM-‘8€%!öènºsñ„6q3æ¨1`£¡lënï®a¬Õz&U…SžÄD®?ý²­RATªOÎuÖ ¤ïªdöZmbÂüý›"]Û¨ e;1mP¹\ÏYS.T$Ô€¹4×IÚsÉ7f–\xÑP¸ 5†Ì͹­ñpÊ#$ezNhuªP敦]xiÓó, ;t·ãÞMZ{þ×4îßGdµ|=ÔKí;ñé´Ö¨¬ÓBŒK9,8"Œ´ÌmʬqV‹- ñ ñ"°Ú«Ž¦¤T"—EF%kCn«´“cbÄr×Å¡º¹»•”è¹ ÝàÀqáÄED©Ën •%ËÙ¾¯—Æ©.LeΕQõ„ÐŒ +*¹“Ú°öQÞ.ìE¤}‚5‚›l¿&E„Ëù¢{S’b]¦!¹òÝUyÃ8´ï±‚ïŒ7>𠛾؜À3y2°zQiRYN¹:½&°2ŸiÉ/e’%eëy»îoÁÒ$€3Ù ^ µ[ +U*ýr"$Ú“ò^ŠÌFÜKoŠs~Ò"é/‘bcneâÆþ”S²¡SYaØðiï;¿n4˜™±…µQm·[ã¥AG[_‰§ºá%µ­¾e ©/µæÙôz{/LìÒ<Š„-ˆ‚ɉ—ã§o˜åmC²ƒŽYGZ+~ÏF,=Ê”Q­êUÎÄŽK …E¤4mñÞz½˜¬û);Å4pDy¡"ÉWþ³³Iž§8m)¿*SŠ›}Ô0ét˜L+‰PFKÝ+ŸïZóÅ9;$­RÇav nߘlkÝ ÏÚóÁþ?üKÿĸjÿy¯é}°y’*‰™h0¤FÐÚUéYœwm#"Ìq L¡d[FÚh_ql@;ºt æJÍÛ"Û+ôº>JÏ4¸¬56C§³W•B¨NžmoT5ˆÒ^²#"ã!©­ ›Q5ÌÙ+eOÃÍ5ê|Ë ˜cAK¦UR¿ åvvÁ¾ç÷uDE^Ik߀ç̃—a±2VW‡/-I€HRš•.zºO ºÜ{$[ši÷QPK¼+„cSÔ—U”X«ù¬m†Ïû;À“µêiR¸H ,›`±ÊjŽ8¢^D/]@iQR~ôEÖ…Ý? N‰ˆ—ëQŲ—uúDzZgZÜö2F[¯Ò#Ä&ä ‰L@ÑXˆá: ½'ãP@ez2Ls“/ç\éNšõ:NhÌãðfDœë—iÑ G{ںы¢…Ä…ÄTEL6iOd ­M©f*¯¬gVn-S»dT"(넪¿‰Ã"+uçnƒbÍ¡ ]-÷‚K çãlÞ%TûA"±JBÜ,+uZ9p k›êÑý•ŸA!pNéZÜüüx§ÓŽ^•½#öºQH¸%¸%Õýq(ç¾!ÿÛˆWtê->ý×WòýÖ·Öøú4pjÉê}cBA¨®£T[—ä–áóãËÏΔªšQì> ©oo÷ã‰'ÉHÈ Ú’×·É-åÇòÄ$À݉‡çÊÜ9~üz1]§z…¿y5-ï~,œSÁ-ÿnƒš H@Úê‹ã{]>h\øãÝòÔ$^#üSùcL Ã!d}Ô_⪶üÕ–=NAéȈÀ ¾Biùªªq¿…¹§®ªHBãˆ^ö»¯ÕS÷*ªá¹&2¶1Õàh{ýÇ ÞUTã’ðù[ zØ’<é «¯8š‡ÝTCQK|‘ä¿@#ç=OôˆÚoÈžƒûb9¾Ñ»{qm:[ÞøÛ‡‡_Ëè/Dj UiË:‘XÔ=·!{y_Šõ[Ùp‹„Б6ÎïV³x¥Ð×yáàH—áùáŽív—„cÖ1âî[œa>ü±A]\í®Ú‡öI0xÕ8¤ɨº±Ìš#D.ñGÖªŠª©rø•Q‡ Ó Éo¶ŽFI °O='R.FèÞ–AO¢_®5_ÎT&Ûn{ft#?}uw–üz*ª;¹àQìå–»H8&.¢ßÚ t1 pUBø¬H½x/—ÀŒ”’Oø?¬f åÈ#<ó‚À’ÊDT²¥·i»n":§Õ}RÔò¸êiÐŽ{=1õÒÈV.¹"ßÁxp\{¿œ2œ“v±mKnʼ8ª"pðåþ¸›ò©;¡‰¦HÑð|ÃvÉ].ªt¶•]+⢫ÕpÒ,;´ûÓÈâ.tàt‘»[’i È$ÍÐEWCC`‚¨<-ÁéÕzñ¾3héZ¯Èƒ}Ò<ÝÜXßrˆ‚<|’È]5êú¸jy¶Šôw*Ý$i_NWlt~w)k_Ëù"¡GŒSkRf0Ã.?¡ýÖc…¿/(]Jª®—™Uh˜Qn+,n­–Ïþ"+‘ø8¥á€Ùp¨ä¾°>ÐÀ8BòIíZ”µ®ïÉÞ^8;¨æ¢m:CP‚eCÔ¼4¦”án7DEçÍp¥ªVh:^r J6’UÓ ÷‚Љb±õï!-Ó’Ý:cY*20ÖéfðïÕŸLüO?¿üažæÈí/>Kp˜Ë‹ºÜðVSÙ¯»À-{q¶®«…”\’sš m›®Š–©Òª7B·éÔ©ÑJÝ0ä¬O§;RnlרHÁíô*êᣧ;yó¾&RMã¡£ñØi[5Ú}Ë*ÞëûKrãÏW94Ukî}ùæð réÕ1JQº”Iês ¿ëÎÕú³H“F¤JyÉO¼$ãqôéѹԂ«Ü^\ï×ÇñãNÏ“©m•9Ê­T¨’"„wš‰÷îOAEhXá÷:4£¿µ­zpÞÚÆq)šu&™!¶šiõ‘)ö‹Y¼£} «…ÔEDÃJ"yWS¨OzYg¤]ÇV®j*J¨«ä¢¨¸QTER&)_2œž¤‚[ï-«AE`—Q- ùPÈ †I´Ô6fw¤Vâ£S#DÜ€A‰\€&€ÂNo»£z÷ƒ¦i|+±ª9m‰Åh@a_ ÜÆq¢'G¦¢q¿͵\ ²õ¶rBCk[ŠÙ8ßic[ÎÍâ`Ž[  ° §4Á_üo–)RêÙpÎrö‡{C!¢"<º*m‡K/ñsRñÇ&º4ÍZ“'ç /|X÷xiÖ:)Õ-¦NùÚbÅ®Aäqù¢ŸJ™V@|7’÷7…!¿?f¦­“®Ý5bžúB"1Er¨Ëªá‚jDì÷îð$Ú¶¾à­­m%r¨å^¢n§rlÝA@m|PoûW®«™ÙSàÌ&IÒU) Á,*£Ó‚'Í,¼í‡éöJ˜o¾ð{‹€Íýt…¦íP&,$öB•»v³ÛË»…£ãj® /ÅHR7ž¾àkrvTDqU´Nî³ÔIÕP­ÇyS.”™dRYFòöMƶ…UÁ.¨Š‹{Û½©’àc2O'ÜÞÉ“Û \׼Јˆ‚º“š  §—+pĶTÚ}+-¡1%îÐ&ÙsöjJEÇÆÊ_/ã†gÐOM<ÁNûÀjúZçÓÇ„WÈTùj©ºK6`G7Ç镸 >ô–I —¡Æ0) ކÛEï "<,¢ IÕQUyásKË ¶äÉSÛv4ÐаÄ}ã²€O}$º¡©§€(§L9´œ©,ä¤Êžé]sY÷ydNŸ˜ØQÜËÞø±&æÖvxTµˆu¸Ž¤fÉàŒëhÉÌP"âMôÐH +ñ¡|IŽ~e>ÔJK¸ Ú¸n~6ÑrME.’7OËq†ýK×½£´üØŒ KD¥S®Þô]ÜGpyˆ#_ ·}Ñò»€d¼×YOÊYñÛ¦‰,v›Wd°ÉknBZÀbJ¼tŽ”. bEN(˜°y—.jÕ9[?´…Öà§ÇޏÕW>ŽD´ÈB·ÁHÝ[¾ð³tÞ˘QFmןšU:k ¾uw‘ÈÜ](\¹¢'‡<f9ÕŒÉXšˆÔhäSÜ¿ ÷ HeÔm×^ü*Ž/‚’øbÇeªÆÎ¥0ãU ´AsvÒiw¢h¾(¡¥S®•NxÛŸOÙd¥}Ç+TÂÌM›û²DtÒáÒèH¼¸Ý¯&±rf­Ggâ¥>\>œ}G# K”‰ÈBS^””²KZÁ’n1Œ¸óŠmNÊŽfQ8òã³.52Sp’, L(FMJØÌhŽÞÇd³nkl®@¸ÌÉ‘é¢4ÄVXŒËwÒS…*KÄÚ¨ ¶Ý:Ðõ*" £W[[z›íæ’ g¸OR¨•jcmºü€hõ¸à£‡©ºó[x'œt¨”Í–ÈxYmøÌ¬‰M8¤ûúIDT—GDRºøª­ñ´êꥠ‚„EÎè:–ï#iR)²•-+ Vã´FKæìí§Er¥eI¢I" ¢¾fgN5ä£Já+„KÕ=n7àÙÙs#Ì­½ ¨M,}Ê*´ßTý¸@U73»ª”F9<©©=ì\Œ½”²ÈÅ+TeEº«MÊö© ‘Ûñ殡¯H¾Ù5÷m¸^ÐMq3D¤GÊô·Ù£ÌjC/¹0˜uvEm¹Ï²¥¦3Ï"¸M´¦­¨—Ý#IqÆG=å]‹·_™. ‰B&÷tÉ8Û‚nÝÖÀ‘QâBæ¶ÆkhYU£(ñ*´I,ö§¤#[á†Ú™(7Û&§ÏÂò/+a=ŸMW*´,ï1S‡Ð¸bAt{ޱRº¦Žu4ư`Ärà\3Ûœ ö“±š…%Ê|Ç3 !Ùù€˜FŠ»¢q_Y!ÆÎ jAçpнxÔ²U&%=2›M¨É©ËMDçïuÀdäý‡DØý­Ò—\hfºý5ÜÆ“¨óí>ÃÒÞ‹ÜtÌÈ”‘Šª€þÊ'Ë™j›X¯Ô¦S‚5GJG[wrÚdQŽÚ|:´N¤„\—‡oQ6ªJä¨]ÒœtM›ÙáB ,ÉŠE»*)~bÝïôî´ü¶Tù° É‰P’@®¤Ó1§«lºÏUŸe÷"Òª‡2UÕÞUÁ·Y­? ‹¾vLz081BTI@Šƒ7í)¹§€ox¨«k»PÁÕ&"¹"WªG¤½*ãR­ëÖüýis2%ç¾E¸óîª'E\mÉscÈQÚ€Ô‡_aÅŸTnDð˜ìG#yHYöI¬È´éæT»×L&ºåo+x:œ½žî9qo(pQ‚îîéÅò,ÚçQrÝ&d‹™êS0P2Ãpßj$i4¹gê혶ÛÎÓÓîÔ5²?¬e[sãÅ¡ÊÑ3¤Šg93D|F¢rF,¼ÕJjÑ©Ž¼â˜FÊîõ ¡ŠsT¹w”¬¼ÙæÇ³6L(Ó¢ÓäFŠäæJ )GÕg¨ ²úœß´ª8ˆ&ó’ {4 XzQÏ9’²ó™Þ³I–1d"7M”mGµ²úÂCÌû-ìa³M(§lQ{È·‰µ+äNAAÞpàÛ$06äEïk^(lÚ ò¦¤†'x `±çË—s6“™o?çHðò½O6?“2yÍ6RSÙŽôª´PSq‡ö²Oëy¿Yw·D[û8·‹¡³Jöcؼ ”uGBŸX§+/W*.ѪkJó/¾Ôob)¥ÔV,k'®êšà~™gù)U¢zÇ3Véä×bbz¿W¢½!ÆAÝ̆©©½ Ss{* ¶ì0·ý ®çLÚõw>fIù¡Èí”zN[ŒQh”JìpcFö1* (5YNûBˆ.ûd“KPeÐK>jÃ9_Öµkë.ð—`oP(–èn¢ƒ‘s)»”}æ9Q¥H‰H‘£ì¤ãˆðö8Öâ‘ÙZº’­Ý¾ùÄ6v3E6>^¦öÖ]I !À‚ëc"3n(îÈÚ>ަ¿t\Aê ê;*ÔàeæßŒF:n̵Äe¦Üt§—WLŒœm8ÙS¦%L]MDébIð¶÷5YøkÜJRçnɘ‰¿ÂK¥ù7p×äñÓ]‹íc71µ˜Àõ)iù/5eètÖëÒ{¤‡T¤H˜q ïh«¸eµT.¾ïuS{\ô¾ÉŠÅ_#=´Ø;_T¥W¦Shg*°Ô–c!†Ù(q)pÚ7õ‰5gPÑQ×U§Æ›åŽ×6….¬™w%Ð+2¤ K¤îänÏÖP›A £=´늵\Z&£.<÷ÞYèû…!d·”]êk.© ÇM¹”áŽãdΛ"A‘Wr´‡,ruŽ3jÍJg&}1º »›¹ý-˜¾ósÏe¨WÒ•Un%-‰ I§A¤,pŸWZn ¯Mr,¹ìSœz˜ë.d%º°Ô·8Ù2Ý|Úvdš”Šµ:dh˜X‡üÏëg^h^ÓÃ}´®ä[Twõƒe\WÚu^¡[ò£ÊPyÐPl;B8 ‚¨³á¥-Ôl½q㟳Õ[=Ô#,à¶Y‰AÅ€¬°êÈÄ6ô‡1%m€Gz+šË¯ „¹Ü#wð·84#ûEJí*êUÔ[Ssç9-Úz¡Sªfê‹£‹äûr7•® f§Bÿò" `Nþ¤…[äƒÏÕSj†å8g„FB2J49ÛQÚgxêü$é6N£i÷(hÒÛw€aiun.6¼ôè…ÓÒá¥yñç×5”—"ºÅÅz÷•:ùßÇÏ”·‘à[é )[Ê*üÄ«ÇëÛâfîË»çÂ÷çÉ-ÝÏ’…ãŸÏ­¿w4ýÜo‚ …©áP"2" ¨ºª­¾¨¿†Ô]wÿÏ® $“ϺØhÓ¡wœ8Ýn–ù"Ú÷éǦ:Edõ>±:5R©—Tãôàž ÕÈ©à«üw–ª@Ék²ªxñýÖ½¹ñ¶!gÆ2xù*ráÎÜ~Ÿí1ˆô Œu3l×ÝUáô[/?•ø`y(hÛ$o6ª¤\×J*%þ‰dãÉ1àÈ6€Mj"ããr%[|•m×\{—g¹î#è=ÉïñK-¼ø'¦=NAé j¤ñp[ehO éDÓÅÓT·’'?<TÍÁ(†=Ô^WD^\ºÝpÃn9¼ÛŽ'‘¥¸ó«ÇÞC$²òëŸ$ó ®´¨ÕÕm¨Ü4åî¸áòñOö¸²zŸXÌEíªˆ7ï Öâ.¼8ø/– +M’¸*VÔ©Æß$·’påã×ðV㢮ëFý=î|–÷º¢óåòLVÞ¤Ôm¯YßG»ï//ú_Ž1+æ?̯HôÊjê}xª¿æ©çå©íwK—‡$ñOåÏï-È×Å?öâNëx:¹ÙoáõúZØb¬ž§ÖK¦¥oŠØþj«ò·õÄsíꎋ¼Go©5­øØ—ørúybv~+§—zßšß÷àfKÏ]O» õï/ÿÒÛÏ÷ “ÔúÆ ~K\Kóÿãýê§Ë®{8Ù>¡!kO2#AI¡wîÜЪŸõ‰¢ù§?+g Ë6rä9½Ï.|±æz)FuRÚjÙ׌ ŪP⤪j¨Ãò!¦á¸–¡m7b“àÔ‚%o‰ _ÅÅ+žê*2’40hÕ”e­Óh$ªI¥¾•n«nñ*—Å‹G›ò,^]pÝqÑGM–7‘D°¡6]nˆ„väæ´è–®l†]ŠFü}:GC Mq¡q”AéìÌ­Ì•WåÉ"¶žTés•%*VË;sNB:ÕÑÔL“2ZAÝK„ëaa݈ç%\Û$z28©»p=Õº"­¾WT_;øpª¤vÐYíVÿ&¡EEÿ¥S§]1c3nËêPÎb0¨ýŸyUˆÎoT\""u?EÞßñ-ÉmuÂEýžæw¦ˆ1N”.¾$ËÎ’|mÞ5h‚º¬½Q5u\u4Õ4«ÝWæMm@8ïÿV¢–©Èo””¿KZÝï©c›Bv¦ÃÈ$|Û^)üÓ…¹-üp 1½BáiÓÂÛËq[&›§Š–ãnXhfœ¹\¢(D–Ëè¤Fᢎ„`Õ¥ 6[hPÓÕ×L.$Ó¦šˆ²dÞ÷Ré/xT•UoË‚ªÝ:qûè7 qq>‚ P(@Øä0º©´6]'¬î½äëáùr¿K`¢ÝÝpè=μÁ?.~ †UB…PŒøƒÏûÊWðïqN‹ÑS•š[Œ¸mŠê2T¹]8êTþ?šy.<éâŸ/½„g´?0ñûá œw›B/Ú/µ/ú|üÖËlUA¹8¼.ŸÁŸDúqæœ0ÛªÑ&¨õà¼zÝ‘<ùÿªrÀ-V“ T›ÔVTRæ‹{ÛòK'Í1§Ä$6µ˜âÃÂê’I%Èrâç—.¤©ÆÔ¦©Á¥µ¾‚—ðø°>(Ø´û½9/N<üýß›^u î´n28[‡4TüÑWÿœT2õM³BZ~è,ª…óN+ùßò^<8Ô\±:Ó˜ƒ …Πm9 :Ó.ŠØwÖáîòä—TúªÞÝzà&¦oHwh‹bK’\P¸üï{pçá‡S/T$1jâºío%T[ü­lL¢OQÖš•Ä%ïYUU/t·º©Ë¥±° ÞÁîÖÖ2Ê /k èÂÞ^P¨R–û¯€¼ö–ím>ï[tN<øó¾+‡0uŽùþêÛï÷và—îrKÿß®jÔiû÷÷f-…ÒÀ>è®”½¾kuùªà ¯H–¥)u7{‚øª'–þin¶Æ<å÷¨ñ€ç-½“Çë÷%)o‰pºj×ÂÉñ|WKsåÅ:cIÙsÚ ¶ûätª?£ªü=8Ý<ítN<&]¤¼àïî†ê?.7åæ‹ÿ|G-:L›£{Ý«mïD[qüW¿×®B\Ødè>õY;ûß‹Ï÷«µöN%Fd{{ÚewRȈ¶ùÿùb vk̉Uªn’ª\ÆWt­n\>wæœ/~&oQ&ñíÛåºD]‚_íç–ç8]§ô$¤+Ûñ"þõ['˜Õ‘Á<ì8þ­ß™õ€•vE†p1cT­¼»Ñ›P"DEqJW²Y/eè(‰ò²®7»˜PâÌ“Çê•Þî÷U8|¸_òã‰Ç©n²›¡eýjJœ#ëã©U;ÖºôóNWÆ¡Óå°JЩk+]’ :‘ ..‹«‚ñBEëŒ<¾(ñLl>0€YWì¦ÐÛ½¼£ñœñš˜ƒ.˜u7ûË+­k×bDD¶®j„©©9ÚöNX†ý Ì@mK} ÈžCÝ •ëËž™5‹ª%Õåÿó#ù|iôúãYü¿P2$œʉÙõûÈ„½äN<þ‹ÃË ¢u'¼XVë…ãÙÈ ÿks1‘&°Üo^ì7ºðˆDÌùŒnû²qÆŽâ†ýµTT·±ó²]:­ÖöUÁlÝ®gZ­ÔÒ’Ø¡²È²•²Å:mœ–㥼«»—R³P¹¸j¢¹!Y 1ØÜ0ÓQÚ‹JA˜åö;•±¸ƒ¢úÕOÝ訇dù_®>›¤ÉT®6BO™ õèD¼ø'^x8ŸDoÙ:¸#•ñöâ3»Z›2íl+KDgé-aã0]ÝÛp×¾ÈÇ>&«Å¡qÑß#‹¬lå‡V”œ3!RŒò²Et5cÞK-¾}:_Ÿi~˜Þ3í< ÂPl®ãD{…p•Uî·(—ä–LTgâ4Žª2$ëWM&^ñpãtý’¸§¬½1%qEqÑÓtåÑ8'O+§Í1™›?f¤ oZîÀ¨ïaµ¶“%˜5Æ,ß}8^ó;éË]]ŒÔ4!œ ˜‚ *9Ì®hKn:UTz&<¨ÞžÆœN¥J‚Ô‰jF7R×xÛj«eÿ¥RÝl·¶)”ŽÛŠ ý„‘Ïñ-þœÿݱý5³yÂkš’¨ÛððÓåÊßÉola?eî§Kµƒë×ǕΡ´ŠB­p ¸»·­üG ôï*HÝ>—àf\"¼3ŽÚÔ`6¯™¸n‘(¿íStf­&®zGº©cŸþ¦HÚÔ»2¨Ä’ MG‘ ©LÞ¤”UCÿ) ¢~Ê|±È±§¨Š!_R^üüUS—–<Ö™©Å>ÚÅ×àD¿/ôºàeì²I4;ײÿ5ÑëåýµµSÙv{!šín:°Ž¯Ó¿¤S Ó£Íd¶iVªI¨8NΓXª5ý¡г¹öWnÈ ¡>Õr¾4ÜþÜŸ>[ÔvoR(àÜxg2<‚ГÞÕP,£ÞådDî¢c•Ï x §ý(‰Ëé×c¾6sÿRôåŒþÊÙŸû~o¯éý¹µ8.\úyGLê~ÙDš|)y ÈuŠN>ԆؽÑewI¥UUtó[ª÷•q]«^‘ÏÕÒc¨ÛQ%Uš•!†·'gRà›«wt6 µ§R*êÅPìˆ*¨œ oà¼WåÉ1æôR°êà·ãù¯Éyqù/Ž 'dÑÊ;ôéÜR˜î½’÷#L\›·v¤ÐQ;äH`Üüm,Ã~>|‡ PËIòšHè·%~4ÔB_ÿ·iä>8…™š`>îùÙJëŽ8FN¼D¤¼åÊþ˜W”}ÛÀ^\—§?írã­Tÿ¯îUK~îžWL>)Ëë ‚ IuM†K¨ñÖÑ 4ø¼6ýÈ>WáûÓÇçY†Ëew•\Õ©|;Ë©>vOôé€7¢9¥wni+/ [ÃóóÆ»,¸ŠHóÿíy[éÏÿŒgáútaú·œϹ¶§OÐÃC×ÐÝhu=Æã¼^8Y>ˆ6òñ¶'eVh)3mNV]ãŽæD‰õEO§%넲6¤ ½ÞO\xßýøxcȘÒ6Õ©Äæ·à·[¢xpDúx®1*Ÿ´«jlÜü8f¶qïùy˜þí &:;_ê‹×ÿ?AIŠ=äzܾ‰ûü¸ô8¤ ¿uEÜð¿&Ÿù—½þn<ñ áIn$·d}¡eE¿üE"[þû§O¦ Xœ'L·HVÐKÍÅDAT_’¢K[ÏÙÍÙ ¶:ÕO\Ñ~E}\|zp¿£0;8Üm—šÝ2Ü@6ŠÉÇX м©øsÀ-iþÐË%«[„ßñÒ()ù¢*¯‘/ƒz„;áòÖ©ä|Û¥PN^(7¿ž*®´ãL¸Íýš"#‡Wëñªê·íxàùÏSý"=Ù}Þæó»î•çÇùýq¤Í=Ùïn», !ï?ynª¼~I×N¶Ãþ]ŽB¥"xKP²·}-%‘RÞ-{|WEå€:µ.žO¢Óæ4öñ4¬rkvB‚šUOÅ{*óà‹§¥ñ¯Ä'Äþ‘ŸryøˆKÍ‹Çõ\½{s[}:/ CJŠí“Hˆ§üÁä¿éeº/š/d˜s]R}æ#•îM,ÍzmÉuuÔ–;tÕn˜Ùwg´W4Ê`M¡!W5ë½ÕWÞNv½— [¢`*®Ý%< aãSDU{^÷mb¾Hƒ%û¶ž–\Hx ÝlŸá÷W…¸/,@Ë£Ïi·ioƒ%ï/»ÇÍ,¿_Å—L…œÐ›Y‚+*ãÄ» €é_RÙCšsániÇð7#ËšªLÔã´É¾ãNœÚ–ÙoID˜Uà\‰*¯5À qsŒž`é¡,1Ä(ÙÎdªS%Mn‚‹Êó]Q‹˜i_­ù¦U|µZ¦’Ô—4#e&>°² ",sꪨº¼é~²„ktTj#™Éט¨<Ä2ŒísCoîYm–ÕáÄÇMúà*¡IªÎ[™˜à¾ {ÇkëtÜ.á‘ù‹@þ\.ªâç< â‚àÖïåLà ›¤Tˆ .2 ŸÐGˆ'; ß­ð8îG¯"’8Ê1%Î÷?z‰ñ,Ÿ+ßOìY1aßʵV¤~¼ÜrTCa¨#àãN.öÂïÇÀ‘ü–ãÒØªe’Ÿ¢µZm¥pw*a*~÷Q&¢UÜû?}ISOO{½{$½§Rw\%íŒZÙ¾ÍΙL@*#x€N3g×§”WY»3®+"«6 ºíÛy¦ÖHªª¼O©Zʼ¬ª¨¸‡Z3"ÒÒç·W’mäÛ¦AÝŸ²o¤_¼*6Tü#aãl;bìÛ2דO…˜ÐÙŠhØÇ^m]Óï ö¤ºî—?un(š1¿3cù†xñ¨5[f/¸TtÉršå|Hm¨\ô6 v¥H'³®m|sûqÞqCL ’À¶ð–…JË”9mA‰D„sÜŒStVµIjhªöuïï«£Dð$¶ Ë1²Û­¸”:ƒ‚ÚM"‹dÔ ‰Á¥±AN[ÂEsãÇã{ÍnWR¬•*twÍÀÞ×{T·T—õùðЖû½W$(mR’@Ü'i(,ËeÍë¬Ô’©,$FEhâReERDêÍ}Æø%Ô4 ºÉŠ©›,©Ü€H{9m.|wwÓ£BS&`0p- fHs§Nu$Sò¥JKqÛ]â<ÇfrV¤U"V~h•[øÀÖÚ°ªÌùºe2JGc+Ô9ï­“-EpBäºí¯‚Š¥¸bìå­¤zGF¦Â¦eꃯ„x4ª\82röI•5éQ)±c‘B~ µ¸È“E«yí@û¸]í»µ<û º.~‘ ¨ MÏ~+1#IJ¼ÈèÓ(å6,xÓYt†Ø¹©Þ¸*ózÀ2 ^ÏÙÒ¥‰’ëJf¨LK>êËo$r×<9AäTTLiiùQ`ü¬ÿN±ÏÚÆÐ*4§]©žAœùŒgâHxb'gpÉ[!O&Ô­ñ)yáTÚÕJœ¤É ° ó²ã8’b¢¤@u¥&Û^?d'þnxè•S%gŒÇ³9›2slÔºW¬V£Õ¤;•¨MTdTeÌg{™*×ñu#âM7-.¬“cìˆÂâ±Îô<…I¬g}¹E§Âm nœÛ†Ø¢,!v­×íwÒâ°Þøt¼:„Љ‰R)Œ©fJ”¹…ÞS¢”¹åpý5…fK¨›1ipDh5×¥¼›PdÕ(õYÁ^›Nâ e\ *Ø dâGäŠj kД”ºññűPÕ‹O©8äTe‰.Òt7DE PzqEU[qU¿TÅÑÉ{9¥eIss[ÛžZ)Ùp*IWZµ;fV^ƒZ¥Õ(Ò/HÎp*AQû(TSysäÒ"nÈwM£+Û©–gDslt©ÊWªmåÊ6^ˆn@hÒ=WF¥±.IŽÕMe•¿õIÌ—ŸD³wS“Äñ ánöå’…nÒRÀàܼ¡!V¬Â”òÁ &\š¶€V•ý˜‘¡Ö]9𑝸¿%›Ù6<ùOÔj2̦⪠4ïõ`&Ò‰ýéM”z/w§ åL§JËùG:åöSgYÌ3Q˜sM3)¹˜i.Ex&O¦Óëmɤ…åÆ=ù°/Õ4“ª„Ø++@£d-›çgókÙfÉsŽ]ÕD©4ZÞj—;òd6¦©Ü½6–Ú¼*jP[Ô g%Å9OM›H´N•/ãÕ,L !.Y îØ½­¨Õº~QLÙ3ð)[;.Σk‡l뎠G.sFIÊ5–REJ›Ji˜ÌlÓèG1¢«…su—½¢"­ÏQ}î­êwM0«wd9jôÆB{̓®4ÑT©`¤†ôðQG E^¸êæÙòNÍóÍAšõÑ‹%R`WhP½Y“v½ (õ(ó©q^©0Ü*êC˜ÚIŽó­„Ë6"hÚ÷G1P[¡OH“²õ.˜ÓJ ´Ã±å™4&¤ÓÒ$¼šÍÀÝ|Üt=$j3l*§f­§Ú**˜ÚWÇù'‹¡GEOR„*£g¤&RB4vHH¿Ç¡aPØÎ\ŒnG¥,‰l5$…§[ÝTÐVڜ՟eIÕ>øü*„]õ,%«»õ”÷…Ê 6Œ ˸UèÉj®U*¿VóF¦ A\Z˜õ 52r™AV‰ Ñyæëà(ˆh„ÂnÖë{iòBï_Tý’æðZÌÿ ÕçÜ5úk2ëFì™>°r:3/?í&"¦õÂ÷\CTîÛØÚ²{_K›†W£ká%Ql¹ËÜ5û³M z6ä¦3[­…L£‹èÚH¬ÏFY¨*´q¢·ð¶fm~!Ò}pM#a‰t|Ÿ-éÉs¦u"ªOåú$$£Óhw‹2ê&yטwÀÓý¤ÜkÔt}ÓŠäMr7=±û\Ù†yR‡6]&8£¯Ri˰“N©NŸ*rˆÓâ·#ì‚–ŠýT8Cu\Š}öŽÃY÷dùMi™“*W2Öo?ÂÌT¨ô™r¯N—C‰N¢mºÄyôênX›"ªóS$ÐÚvgé 5\xspæ®;R×íZ‰†¢~Ñ"X$¥ÜpEµ¿Xrªƒe ivp3R“˜…joÇ™ä^ŽU½ö\´º¥c-ÃÃ&UL S¨Õ<ÉS£K¢n½O5ÚÍNµ$ËÓ)P^pã<Ú¶Ü© Òép•1úÞÆvI”iížp¢ìÆ£ž*yL–•ååí <ÕA*‘A¹ 3˜áÄ¡úÆ=%X­ÃÌ'UvŽQ¥2T5jª®6ÌØüMŠÌ¡Sò.Ôbí}šuB2·^ÎP ÔjÌæ }EµE“±ökqE¬¦ú0ãR+rîóFQäbeqÏPô=Ìó¥•V·”+ÍV93" HÄ‚ó®èG"Â>ZIV+(¤*B$*†[í-¿YA,{Ý w' ä€äî©”îäý÷+ÑlzZ…±ÙÀC㓽¾ß™r¢…]–Ü«l÷-e¶2¾Q¤Ñ©MåXò£Ù’ 4©b•Òä\ÄõJC²VKuù®,ýÃ¤Ô {àL³èõèýP¬ a2 2¸(’â2¥š35€ù¾ÅV(ºU¡Ìô¡'"ͨÓ䡤õIÇHY{J¡vÓd£ôú½ /…^#Ö‘>#råpxâB@Þ¤L‹Êi[û(¢6/pŧÎ^‹þ Ìʉ@Íž–mÒ%QC<7˜šÈ®cYݺP*Ò2M.—^ËùzE-ª¨ÑËoU=aPi¡¨ –û`¼Ú+E´«ë$ª}>Þ2ÊC„ ,É#Mòá‡çlújqðó¶rL²Y% \X"ø×…ZÌ ô`§Ã›2N˲ÄzÖ™™YÛ;ÓãF§6Ñ[aœáXjcDà¶àÔd$–È^$a\Xì‰OGhÑ¥R`loe üé‘;3ògObe´‡\Enõ9§<¨¯:o¾zÒVô²­€ËfOF«vóžÉùÒ­H2Þ`¤3:™¾E¦ÈŒå8FC))ÕG·-êe…qZŽã¬n…sdiqhÉÙMG-ω-Á¯¹ Ë7Mª7>C±Þ~ku×[&’ölv*¥‚3mY‰$›×eÔûE] ªBö‘ZÔYKÊQ,TüÍÆx ˜Ýu;»5%;£vÚ0oÃÿ:ƾ\¢ìÊ4癉³S)Ð ¾úÔ(Ôø9¹é2%R1”‘Ì™4æMÖ.-9÷ I Òú8½™ÜÈéP‚—’¶k*©"¢tÐf5!ˆUZœd9»%2;¤Ë€Ñ6­8Ût8ÂDÙ*#ê[÷}Ý£åŠsséRêC 2!±ÿSËj£)7CKu·[j°¢ÃÒ)JG#!§~D”¼‡evi±íœçzxÏR³õ*‡SÊ´¨²ƒœiÙ–=s8zÊ tÈù[,½I¢Ö²ÊĦ±=ªá.aªeyIêë8Ü—¥<Œ©õ5j3eN*˜‡uT­lHÉca˜it´r%¦@—»¼”ЗÝ,M°Ø.ÍÝmü¹˜òVΪôо`ÙæÌhRàLXµ,—¦;ðÍTÆ¥ÐGYûMUõ›enÓx¨’5½dúÚ†ÓÞÚhË[[gc9j¦„Ì4ZS9S×ôÉ9j“->ðìñxSØõ\(Ñ÷Ù™ŽÜ^ò³¬–[8Éô,áµ*6Zs1ìÏ'³™gâ±›sˆÅ¥ä¹ "²&Wªqrõrl±¦Èˆñ½Wµ<`M¨;Oe÷ZŒÜ‡.fFôU§fz&vÚÒÓÑ›#E˹·4åtÊY§hìÑ«UÏÑènUÑìK¨Ð³ ÏSVÉ•ƒ–kz³×õØÝîÙ¦7jÔtÞÕm:_u²)B¤Šµ •©`o«y– ää¹ ÝÉ*Š}‹D¹*ZIVêJšî¦€ÙvQáR*OÎ˱¦rÙ D¢•Zfº39'%C—@«•J™Qp¨TlÍ=éYÓƒêÆkqitâI«!¥9 g6ón•²ì˜ÜX‘eœ¹Ÿi™fªÄV©ôúƒ,L¨SN-\¨Ò¢T1¨¥6%J‹H­7–è¢=µ½”T U'溮ßö1S•hy³#”ö©MÍ5ª¨Òéðê#œÉÊ´H´Y»;«¡öZ mª±$ÇÐg:yÈÌÚ£ý¹Ÿh”|»R£zFz'·ZÍ4̱©Ñ=+v&Þ`§0á°N@¯Ó§f™!ee«Uxt÷ÈÓÒLwPiÁHÙÕÓÌU4‹¶f,¨…*RÁ”¥8.öA?.»­w€Î­Ø¨“êýÚ' ä§vèJ™-m×lyÅ^­ì»Ñ£hp•š¶Är5©5\ųŠ5¬L®Ê:Õ^—%ú]fÍ#P‡-DFá, 1ÛƒÚê‹i`´¥ú?ú,å‰Y­ÜÕ²¦á͇BÍ,·úajÁ%œÎúƒ™v²îU¤­ ¯—*ùz;®ÉªÌª×*a^©Æ•ˆT¸Ž±H‚°ô‰¬ÆsÎcÙ:–KÌ™“+ÔæÐ¥f<ŸU ÝByÚS« £Ó*´*RL¨¶ŠoC€ £ âÀéæ—T¯œx¥ :9VY ŒÙ´X“j¦ü]7E‹«±ÀDÝ nÐ{#Zt]Ý*뀟´6ÖÍ&–±%¬v¹s 3e©,…—ùÒl£ùÌ ;/e-!hQTµ¤+I7I¹Ô1‹++/z)ìó"3Gÿ€9­›s}}5©õ©´êåN‚ÔÚ…"L4¼õ=úÕ¥ ñ¢Ç›*TC§²ÈDo8:Ë-åÈuë8ú7ì§¡æ›Lå<ÊrŠ8S`$ªd)Á’²ÕÜ¾Ùæ ÀóÑœp%( &´Ô"Š¿U«0«”šµgJÂïR[ÏϤVêm«Œ¢4¥®I’누ڊ%Aó¶€ÒЈ†bÍyë3Ö…ÚÖ@’Ë2ÍäF²ÔXÀÛmš¶ÚSYŠÄiÀÙ4rw¬”‚xÕ KQhŸi+Pãd³’§ [SrNü éÙ{.XÍ_¼·¢··nàYùßÅâ¿U}2TÊœ&r´= œj )7:%BE•&“tóÄ~™Jt=¸;¼lç®’EPA\ËèK§³OCÚ+4òŸ2[aVòô˜NÁv +%‰OÍ….¡×s»±7-Ý"B„¸&Óv§4c§S`@ÈTG)5 ’$D…@˜Ã1 Q£³Éë¨.«:Ý3ìîH'IÞ$Kˆ\»•6‘"¬µ¬Ï3£Ò(NÀ«Ä¢RژĩÊ0i&q=‡¬£”Ûn*oÞG¤ý¥ÇSSûYW'÷“ö€–›î¤¹P!,ÇUõÄùþÍlʃº6~¥‹†wßñÅßC¶»—Ç4åÜ©75剕vhг[®A¨Õe€¿ úŽ–ªuYí¹ÚF‰O¹º®ª—µR²r¯³Üß”ê/Òó~Y¯åi1$GâÖè“inÇÉhv:µ?í1ßlÑEÖO¸Û¨b͘F±×ÏŸ¶Å›$ΔçjœÌ9CP=ô1íÎv¶[”G*Ubèr\Wµ¾°{àê-ÜÀÝ#:աЪ:ó'-ªƒîWgeš’W¥Dt©·ºnWØ}fãrÖ´F÷¬œíSûtÞJÜ%–ìøb.2ÃK‡{Þ%Nö9"ÒÒPY(¿dhœd`ß-­—BÌ‹’À¾ë;ãuV×qy¢%„áéxt .ñVA[îÓ²§4óRãÁWùc¥ûLb´\±CË4mžäÌT¡Í {•*1× ±]ƒ˜2p« H™//eçc­i$jKG0f$Ùhìù2]sb¡ÒÒrí:H­K¨×y°<ÉØ.ÑÍ·|ÈGbPeªÚ”vn,“ÝA”ÃîÅŠl ×—í JUSpBIKß ünìZ$+ÙJð¢š|…YøÖÇé˜æ|Œ¸ãL9¾RW.š› Ь¥®*£níÇIÞÜP¯× Ò5!ûVíhÝ£|¸»¶½¹ùñ¾.ƒ~‡û\Ì’j2äI§c¼ø]ª}m‰3’;„ÛÇç£D§¨6ãfÓêÓ(ˆè9­ÇÍ ç&rg 7¤>|©I¡eœ‹&]B$ä ž^†Ãd$¨© äÕ£>„íã ª8…mCc'å{S°æI\Ñ^¹`†.–fMÛœ^ÆÄB3½œÚ¢r¨wÔ,U¢ˆa¼Z×7/|=¨!Åu¤]ѸJ¢Â‘k%[)uÒHHœ­nXÔX͵­L\pø)w©Rëe·Š­Ó¡_Ž:©RþŠJÚ\P9¹>‚é !öx™º#ï‰#–&!H“ uÝQ·ŽëïéqL&ýÞ•Õ‘¶6kpI[vmzŸ lD‰}w–¸ó5ÿ ÆÉ€kv)þÐ,@/fb×rG–6b-ŸìžÒUþ7¹âA¶‡VâÜ#–J:UI˜D›Å±¡%Ë»Ý[ßåtò¶< "4ón nÅÄ^çá²ÙWêH«ÿkã©ñ£/ÒY3Pã弓:¸‚²[£~œRßšhØ&½Ó=ª'š**ßõÿèÒô­Žr_gduI`É*¹X¥Ï&ˆ›Ñ—º&÷R·ÔD•xáäûS³JRS^7JC¸ 6¥Øt¾°°ö_iÀŒ§>¾ã˜o2(è¢{ö[§4ãuúpTòDëÑcÃtÓ«¿[‘ª ùñTO/.¶ã+…œývý“UéuÍŠm2 cd2g-Ku¶t€¢Ç ìÄ$ˆ†ŠÚ" ’k]z¬’“² ¡”–¥JΘ꺷Y~¨Ö…ïoÅ/dEEÔ¼8ÝoŠ”ûWgM´Ú»…"ÄÜ믂‹1- ÎØ;JEÆÏ~ãÿK[-þ^ANßê{–á,.Š—D¿×ÿŒy7Cz·ˆ7ºÛÂê¿Ç‚ÞýpÈ~S²G•J’Ù·q 8²B¨¼‰·½ ’%¯«Þ^òwKÑò…VMÒ% ©#J];5:{Šª¼ìL®ï‚ÝO%º/yý«H ¶í‡gOùïî…¿eVÎd© `è ØÚÂÝA¹°íå.B¸ZZ.ðEsÆÈˆ—ù%‘n«Ëdž5™Î¼äb#s¿æ‰Ï¨ª/é‚ÙM©*¯ˆ‡îN’pñ·Lh"iO/ßuÇT¬ž§Ö$DLƒ®½»i¥H¥ÁUQ,J·ý«þìCÏeRGQÚ}ÔUDU·ÍUUxð[òêKOovÊ;ÿ4N²éþßËŸL~? MÑ=Þ­H½î÷éá˃§ ô€8ïnRT—GM‡H:{ˆžvµ­Ép¹ë”%¬€—½ÃЉ8ù!Y~XnAMhï°m±%K_Ú^ä©ÇÍT|xx`:(Åv[ˆÓfr…[2û¦Å°3š‰¯EUëMÇr½fêd©›®9¤]Œâ¨øw•¯—Dç…eX;+›»¡iÒª]P /þ«}>¸z×&ÑM×F<·e¾º¢œ¦ïÙš5Nóaó+‰þÞ¬"ëHnKpA±iPÐt§»Ýùˆ(kþ%áÏ“‘ÔúFfü‰è?¶=i¨ô§ãûU‡U“É^ßæºñù® žŒÉ)«¥©,ˆ⨖þ)n?ÁWt¶™‘‘ÂR2EoÁ5-¿1Ký~X3õ5TAµCTµÓ¼·Uù’*§’ü° ¯ÅßýÐÅ6Ðzˆuµ±¶C¥¶D¤#ž(ˆ¿.\¹ôã…Ót¥ªU…–°K5t^j€¨‹ÿJЧӦöŒ,¬i-*¡)ǵ˜UtÉÅÓkÛ‰X¿kWŽ!%D‘–,Aˆ/?©Õ7ˆ D%~\UrÛ— j‘?ÊŸA +'©õ9­Â§"²Ó±ÁDCþ^‘DNž_ôÄY-³=\Vµ0â" qö]ÔBü‹WɆ7&S^ q†oÀøÞÚ—‰ùð5+x§–=˜¥Jb+¢ãW2D¹s½Ñ-ù%“æŸL&¯˜Á“ÐzF¼ˆ±åºc¿Ú—uvè¥ÓMøi²§‚ÛÏ ¼ÇQb¥0Yl÷M0ó©$5ëQ$p´÷íÆã¤¼®‰órD†Üy…A %øþ8¨4éñß¼<°¤Ì”™2;EB QÛA~A-?õîÇ'X2ãn,+d+øI1¬fõça‰‘›o8ã1HY1cXª/ïuµì¼­eNœF©TöiùµU^‡¢ –DA¸tE²*x¢¡/™¸£uY}TQTQ/d^*¢–½ôÇéãÈ$¥Hí Ö_Ô ·óm÷ ¾–Eë€+'©õF½h†£¾xÃx,+`Ü~Ñ£pˆ(º-ÝS¶óÏ]ïÇ©O|L58ðXD·‚ˆB…d.¶¿ºq¶J$”ŠåVDgx¶ÆñÔæ)rà«tK§‚*'Lx,Þ„Û¤Û±UÅR¯‡%÷ÕHzZöOD^¸J|æØ$8×>¥±pĉ.]ìož-þ¸„™> ”—#BA ¨ß4$¤J+ÿU“ÊÝ9­¥N– žžã*ªHÒó”BJ&âüŒI‡$ÃþÍ¡ M5 ÞBÉsgMÄR×O…SÊØÒ©eùo(³¡¢Ží÷5ï  ªuN(<<Ï Ìž7ÀHsÜúœ†=Ç??ða•W›ÛY¦O’ȱuÈ/z2{ÊÚ¢xªÛþØôŠ®ÒÕÀô©e ;ç÷WÅT“ÉV꿵,8dÑ£vxð f†2_EþÐŽ'Õ׉ªtÒ£Ç  ¸Õ/-Õ_q÷A{$WJÝ €Å uUDdEÇ JUDå¤Ç@ÂýÝl@ƒ¤0€ÂÙjy‘¦]asV[Œµ ?¢Ÿ Rªžè~n¼êõtÍzáZ¬æ©î‘~“J)ÒÀtÔ®à‚&#ÒúQ5~Ö¤òÆžd’RØËáye6ޏôª "½ÞœÉãÅ|ð¼¬1.;¢A š’if‰“ÖÞ›"“ëÅWjN˜ª”²Rà _ÎTà¡|ž<_@}`Z¼µ»ÙfJF\1vRhC!2ã˾…;ß JûòfÈÕ& .š (€ž´à¥5pº¢Y•–él2äÒªSÞqǦT…Z/Ü+„š‹O–²$/Ú¾—,?$ȤͦÁ`štÉ]wy-ÀMð÷E4qï‚ø°qT)À,ÿ_>0’g¨€HrÍ{¶¹Õùñè/E£×g0DBÞ£nµ}rt¸bCÖ“BáÈoÑ1¢ÖR•¯!×ÞqLÚCŽOHÐãdØŠ)óD"1^ ¨½WÊ9Ó†p㿚tE–Ÿq­ËFBª*6œ‘CüJŠ_šÝ.ƒC캣 '*k$gî‘\]ãhÀpx5}¢”Š}¬ÃSv™-óuø Õ¤,WE˜M²:"HNÀP,z8¡÷Èñ+Teç ŒÖç¸tÀ9/;رÀç¬ÝرØ'³Œ({¾$hFåœRÆëUŠ $É]@ÛT…(=ب€‚ˆž:•.«â¾7Âv·™k¬Ct  HóÁ÷Ì!ޤBÿöŠ£‰~hiÃæ©SçËø†Ý-†°îûã’ÔBD¼“Ùùƒ¶žLþLa³´Küñ”Ü›EÉseZ¼O N9žì*j>â¼ýF$w½ªñÃWT½÷ÕÂé&SÓ_h”|ž´Ú–@É9¶§4P%æÛ—åâã3à<‡!U¢ÅBt)£ µi¸Ô…OSŠfUŠŸNZÕ]\ì³Þ•½ÖÛ »¼GQl¤ëñíÝÝSñ ‰yâc3eYU[jePX‡K†.n`Æì¨®“o¹ÇÜp” |E|±½Bé7žË›àçÞ2X®Ò ÝUÒֱǔm3é)´º4J­J,lµGè@U [‹® léŒW¦¿*L&'8%'tëç¬D -è:¡úLí¾I¸sœ›H†åÊRÁËyr±­Kˆ¶ÃÏÒd¸Ò8–Y¯Îo$“îŽ$¥lÙZ€€1¡Í•)ñ““ÚœŽÁ"™5Ô•.â§U%ã‚Ú2+$©™o«´©N€Ã ëj¢è¼ûþÔ…·PÛ¹òA².›bDÔ]€!ínú }EcUÙ½Ø>rÇôòƒ;`Û:ÍLÏ–é9F–üŸ°±Qb‡—N{d©¹˜u5ƒ•¢KHÂzX­UÝ0lQªxÛ}2ZÕ!Ôr¹È’„ãò†Ÿ.[-Sè]†Ÿ2¡Q…OlÑ54£MtI$‘8ª_9J£Àz5B…`Ç3nMºfá˜ÄÍ›UlHD´òQQ.ò.­Ë§Ñ‘]—  À,çérf-?µ¢«â^=©IÙ(ðµ÷wá‰î'€gÐ X3[<ø?:g*JFîäi›ñÔD;›Z­Ã;2æú^]õSñJ¯ÖbÓ•˜Sméʔ̣N›QÅ*FBØêiwçÏMˆ’³lš>Â2M«2YÕáT¥g7kÌÓ«ÒjQ¥S™­EŸh0ã·PgULîÕ8 ½Ð(´^•SÍûY¬Ñv]‘œEY¿¬©´šlóXÌ"z©ãcÙ< ¿Ô>öòëÞU¼TØ”<ˆ¤Ù“(ñ#T1¡;<‚›7©CP~©6â—ݸ$ݲµ’èä  XH4Áœn°ÝŰÏoÖ•Vg­@8bZíwÈ¿Kó íiõ¡$Œã³ÚeL©ã.}3*VfR( Ê– !hðdf`Ì/ËÕ½C”/Ö% Ì9 ´‘™â0¦«íÝb³Uw Ar +%Š+u™”7ÛfrŠý䉖©¬I‚Â^1I ÄŠË­¨œGo ݨQò6kÙó€)ZªEcC§7PßMSqn±Žˆ ¥A9+;µÅ[­äŠõbôD«Òª5Á§ƒ†1˜ÜM§º­ ”Ê[/%îãÎ=~h®Û…° fIJMM;ɨ~;$•0ߎ]‹xNª‚ÁîXX\žý«zZdr#Ò(Û«Áˆ9.:ìföŸ(ª«Xn™+Ói…g#I§K}$M…¨åÙ ¾Ä3•=Æ t6öõC¨¹1ŸÐìËTŠOÈHöª”]ì•uã(ÍšÖ2}.¦nGŽMÇ2=L͵ Q§dyÆhT¥Î¢fzÑÄW1TæHÖP« ¶2ѵ©'öh)ÀÓm~±°ø±§MË“©ÀËÔG¤›µæ¥Džîå’&ZFMÆ…Õ IÏ×¹w¿X¸ÒwÁµ¶zwC3¶,Úž‡¯ý1‰U{ææÊ7s¡Ë çÖØ[cUìSêÛ'­åã’UgÊUF\ª´Ã®x®Sû%6lè¤yg#ˆU3TSa`ši¶vIÉÙ'7K1ÉYJ±]K"DøÙWbQóK|H5IËW®9:Ö§Ó…ªu2}A׎%×Õ¤àì0…¦Ë¤Fr—·~`›2h¥%£~ ЏÀz®}7ÚϨh!0‡q°$d,ËaLñó6Êaç*ŽK¯ÐÝœÎV«5Ù3ߤJM>ïµ\—ìµ)úÜq ŽÚ¡É[:ÿÚ ËëK±vFЮ§4$n’Çw,qambݽ¡SG&lËI –:“«œxúÖ]´ÿHÝ/g;\Í (l£fÕl¿•æ%,ó9j£J­H«µ9Îe–ªO»ƒ<åB’ß©š@y‡>þÝ¡éì¯ý#Û%ÌPDv‹°ü®ä¥}›Àflúco± E×{LmÝY¸$ãË/ÅÒò¸’;L”zSéïèÑô ‰éu´ –tÚ5æL™*«Y§ÅËù|ŠŽvÍW×ç;/Rs{^52EE'VŸj>Y§8ÛÑfæ(n°äfº µ/è‡ôËYX*Oi³a×V$ÊrƒWÊ’ûî½.Ÿ$.½ ±aÔH]’)=©"’æ ö§»‘°hÝ”K%‰B‰A²B™Á±nÌr¶´UTŠÔ¢Z¦(¡ Ò…Bpö דZ¼V½:ýžõ…>'££²Ì¡ÇVÚ£f ¬FUûÇ#q¼¼ÈGFØP$mHKR™ ™GeïL˜H—-øVâÇ;ÌH™Ï±KgKBƒ.}Oô2Vê—møÛ÷.ãDÞ 4RNÌÈóëô\Ï5ê]H$ÎJ Viö˵ªc #HnV¿¹ÖÍG¸Ý—R-¹/š¤G2®É«©!˜ÔšYºBÅo·@¥ÈZZÍT%vžõÝ­¸âwÍò^ \;¨‹iÓ³åÏ•*Q˜…Ì”ïžÉ ž Xpî³K¨Ú¨•6mIJýÙ#y*ÝüV–6¹l˜væÏO<1;&°:u¸Ã JÝZ:ÄyÄp­ #ǢЧ“*h¦Óç VS:$‚èx üÉý"S¨Æ2¶ÎöC’d‘B­KÊ Vj±®ºÙFª®±[ŽÛŒ‚€‰Á‰¨4 ïSMŒ´µ©ÊÔhoH¿’O¼ªZ8¦ûŠ*Âû2iEAÐß¹mí°áɾÛ1¸íF‘³mz&I )™j¨ä3˜¦HÓ„¶Þ‘?ÛE劳é}ž¥&dÚ36j»Så[Ë$n¥9¸êmhò«=¡®SJ­ä’ÒÑ€”ÝN4 ,}[ÿF?K¼Wsä|ÓµM¦Ts=".C>¯ÌK,Eƒ¨Ú@‡MºÐ3WM±@QQQSEC&¦pô…ϲó©ùS=Qéloœ:| ­ ªj”wP5eˆÍJS"#°°BD]dŠd‰ lK>eÊâåDÖd̈ìiÕ']&ĆŸö¢*Іê—3R!îªaq™£åì½*Xm9Ó`ÕQ¡(´J< †hÌQštàƒ%bÕbE :¬¸Þ—¦Á¨„…l„ô§1ðÔ•uåRösKRÉ@ ì:Jlü7$‡'$˜è‘6¶žüTÍò”€W¼ûÄ$¬êA¶škÙŸÒ!·ºtÁ¤A=œÊ6¤8”vyÛ%ÍÓ½Ý>µXÛ‚Ô¤î廪!¢•õ­ëØ×¥æSÎò(”­­B—ÜEÌ,¿K¦"»Y¬§$·äÁuý. Öqá#PŠ¢Â4Ê nwôv¥1¼‡²M¢OÍ®Õé J­Ô¶³–€ýUVI§Ri[3¦?¥ÔÒ–*+RyØm:ÜW'%V 73dŠ„dšÆBÌsÜõ‘­ç ]*hªŒ4…Ú;ǘA¶¯¶+ІHD("¢îÓØ;6d¡$ìðó˜—Sj2ž!€…&ѨLùOG)²iS¨=jÑ 5–,mÓÊ´ÃjƶH ‘»Iô—ô†W•–!RdD“& ŸZdê¼™Uv£™²åB Šüª\aGVc›Oš+`Ù;¥Õp““v´Ö}dÐf…†Ê‹ÍzŽ5eïà‘’8ÛõÏp"☧° ÈÙ®ò†²NçpÚ¼¹Põ­nÿáÅ_-äª-$*Y¦³Y‘6\\Ç_Ÿ©¯O¨ÔêS'2é¸ûƱۧHSŠÊ7˜†ëž+lgg26œ!²fäZ%(Ú‘Qq»s¼Ž€¼½EPÅ®;U;lÙwg™jÎ2Öu™ uQº{õ,¹N”úÈ‘"´uz—ꈀÅa>ñ ÏŒOk~c‰[3d¤“=0IÞB2’Nl“rlxZöjevÓ ­Ú,+ÌÍ­ÿÌ1$NÍõª3ÍÓbWh4hÙr}s/Ì2'LŽËsj©Û§EiÜR» JÄo²¶Î[ÛU"‰œÂiŽ CÌTy”˜²m©ì%^6á–Þ©‹>Î,ÇI¤xÜ}ÂWI5bƒKÛÎÞ3fnËTl™òlê@E­@‘—œ¤n!Ïct Sã­ÖªàîÙ˜–Ôò}dÙö—µ‘QÌY*¡S¯Á£“‘ävø1QÖäÙÛå·ÛÒò6·ªSÚ¥þa§hË»CÍRrè™ Ùµ Õ¤éëS(¾ÂX¡©¶w`~ÑÇ4lAjùÛ1À=—@ªÇ~t—¨3¶TpÜÔ§ ¦‰í›Uû¹‰F·±Ã&Å)9N ªŽ\¡eæÙ }÷R]ê…ÊHÒDõLôªoÏZªÃVúMNÔ¤÷H¦ y Û h‘À]¸iˆà¤¢µu3—<Ÿv©«P¹fQ~<=GX¦³³~ØéHTW6„´YmÄ“TªÀ1œ’]~t1ˆ³Ž[ÍË‘‡Jy [3‹éE™Ê"Ån Í;-ê«“êT*›·øHº\GÙóÐ(#Óܤl'V'ÖçVòõN›Lw±½êÒöV^ÜeÆÜEàà€¸>À8{Þñ5i9:– 9/Qœ|Ád;SŸ(¦¶Ó„ÛBÃl{.ãb-"P²÷¯‰¿”vK'²'ÃÊ2‹–Qg-s4Š@;’±jêR³žmÊÑ÷m"VæûDSÔ»òöI­™j ² D [¾h[nÍÕ{~Õ³ Í&œáAb<†ØÙ‚Ž´ßpP嶪á§ IÕïâÏ–K©²NËO*«j0éÒ"º¯*)*¸é+ÞÕDœRq½«0ÓÝÓüèìbµ6¸ú÷‡›Ù@§M§Eø4F+ø•øêÄ*úº…ÏLŠgÞ˜_¼›·ˆ»ßŒQ£O¹“1FîåÏW{·.ZòŠxöÒ6ï{ÙzMuš,gäk˜Õ2–U"UA7Q龩“¼'ˆƒÛž€ o»£@ÙªÑ$S2ÚÉ”õZK”¶jsj1Ú8ϸ⫠â+ FmSv`‹¡†íeÔH¤Ey÷ å˜u(‘` ¹uµ±¤gßSÑ[²U]äD¢ˆ­~”8¢â·mDsÞwKÙ¬lÐòâ"Ï®H¥°¦¦l-‡x}Aéî §L+.LäÌRj”{* ܶ@,:³cALÄÌH›º»`^Ài¬H¼x»×ü+üñ˜Ì~ÃÎÑ šÿ‰ÏýKãøÂ_ÏŒÀ“ÔúÇ ºó¢ÑŠ""•“ʯñÀþ¥L½%Ä^û’E º’"Y/Ó’"xðÆc1ˆ:p:H^ö’ÿ7ñ\ UU@ŒÅtš:Š„œÑRÖ\f3VOSëz;ÎÈ®GyãW!iÊ×T„öDN")ä˜k—%ù/ðÆc0­F;¾Š†¤e?ˆ@åcîÇüßú‹Q’í>‹ø×ø®3…ÓÐzCÑ-¦ÒƒAMJ«uãÑÝz[‰ïøSø.3€«'©õ@Äþèàsø.ò@f¨­”Þu Í5’q¿’"c1˜ï—Êʺ«ÔDtX‘Œ\3d‰²¹*q[*¢]~H‰ôÄ%‹Jšýp¥AaòƒM&"˜­Ø}%PÕ *w¯ÇÓˌ’¾sÔýa©¸îW ‚ìƒF¥ÔsžNƒ: bH™÷˜pWC UTL¬¨·EåeDòÀuJ$f\}Ö™q‡œe¢TPi³FÀ´ˆŠ]‚c1˜Ú¯ÿNGÿdÿPÉÈê}"¶Z'¢8 *d&¤KÍU\$¾6N,rlLš.؉u¿.^6ýØÌf$/æ=Þ‚(' ôˆ ÏD$$N<ô"ߊߟUí·¸qÆ„Û$­´â˜"Upï{ÝVøÌf1+*ê}Df*%jS’ζ@¬Ž^þñ)/檪«óÂÚªˆ3I´àÚ4àèøl¤ª©ošóçŒÆa…dõ>°dõ>±)°fŸ!¦…´W—Jr¹B%ã~dª«þ˜ƒÉtØ3n²¢´ú¤#$WVÊ„¨‹ÁS’"c1˜B·åÞ°Y ocí覕Uâ·["pKªÝl‰uâ¼q˜ÌlÕ'¯ÐÆò¿‚¸NÒ X¢ÌžÊîæ6Óz$FÍ¢'{­‘è¶²cë"I~±>¦õQÅžçj¦-ä ¸—hSº©§€¢%´Û†3€WéÝ“§ý°ÝÚTÙ,N…;‰1ÊŽÑ3¶£‰6lº¦+¹UBR+ñãuñÁ tÈêT0£xŸ£ñÜšŽõèHtîdEsy×.õµÙ,‰˜Ìs_<¾ƒûbÔŒ'ïðˆÑÈ•)Ñjt†ãÊu¦À' o.Ap࿪ýq#[uǛ͕INr4⤕²:ŠÜa∞舢p䉌Æ`2ÿÖ'¯Ö7VOSë+g³6‰&£*KÎqjbrMQ\!a¥ŽÊ*¢"*6ËM¶<8§Ï#~äúe 0’L*¦b¦³PŽè7- ‘3@;qÔ¨6K**-‘öLf3Ú 9¶¿X2p:HÐÚ¤T¸ô&iÐâÃmâ}·Qˆìì4"F­P[i°N÷LÓ BjŸR¨7šåS2’•±'Œ€d6 FHªº@üDS’&3„ò'ùG †ÐzEjk0Ö“:e†R£!‰—ê•Í¢Š 3A]’‚–pER÷K',5iÔšlúC“¥ÂŽüÙ~¦‘&Q#ï<ëÒÍÇttš‘ªó²pDDDDLÆaZ¿—þÓëÈÓþÈðÈ#ìÍZÈÜÊ •ÈQN"8K¨”ndEĖײY×Òm¶èû/ÍÒ)5ç)1X7l‰§DÀU1../[Ùy[1˜¯²þYÈéL)Yü)~±Ù_è­Ù^ÏZôN£WYÊÔö*íäZ|À¨G)LH2s›ï!3  ÒyÂ%µ•Mx' Y¡å¹N؆y•”ÌimlnEE&4䄘sfæü¢Ä™ËW–L’q‹0‰!×A¶DhA°LÆc¢ØW—´^ÿ¿œo{ï›Ç1SiÔmg—-ÚÏÙòÿénF§"Ó¨£­K0‹ŽH¢ ¸ãFj𒪡8F-n­f¼ÃµœŸ³øûF©»›Xt³ªmÇІ1Z$ì°ˆ¨‚‰çk¯UÆc0¤ËJ˜EŽò®3ø5Ì>Ž‘£¦ÚEÐôKÙ¶Ï'1´Iµ,‹”*²¨ÍT’–íc-Ñêý‹QtQ ©C”ßRjãÃ’"c˜^‘~{f‘œk™dsõ^[¦ŠÂ§eê3Tê Ÿ·•˜TŠ,(ø€e©ç»[òÈÿãGÿšc甿*?‘?Òa_\D9o‰ éíòJ" ‰š"" "%¬œ¹ó^8‰ÊFQ†¨L´K1UjÉ<¤¡Æüxøùã1˜ß‘=öÁ•“Ôúź:]ROj ùÊn#PÁËZ;jùˆiAá©UxÝ|ñ&Mw[% W4æºHó¿!DDòLf3™üz_äOôˆ$¿áLê}b¹mZ¥<åÕÄ¥:¢ëŠ®&®¢Ób7²tDDK[–9Zd·¨ÓÅÙ/˜Dc+¦ˆ¬*¥Ú°ª&•ºÞÜxóÆc1#kñ&ç_Q‘þ]ÿÙscons-src-3.0.0/doc/reference/StaticLibrary.xml0000664000175000017500000000315513160023040021456 0ustar bdbaddogbdbaddog %scons; ]>
        The StaticLibrary Builder X
        The &StaticLibrary; Method X
        scons-src-3.0.0/doc/reference/InstallAs.xml0000664000175000017500000000314113160023040020567 0ustar bdbaddogbdbaddog %scons; ]>
        The InstallAs Builder X
        The &InstallAs; Method X
        scons-src-3.0.0/doc/reference/Object.xml0000664000175000017500000000600213160023040020102 0ustar bdbaddogbdbaddog %scons; ]>
        The Object Builder X
        The &Object; Method X
        scons-src-3.0.0/doc/reference/preface.xml0000664000175000017500000000361413160023040020307 0ustar bdbaddogbdbaddog %scons; ]> Preface X
        Why &SCons;? X
        History X
        Conventions X
        Acknowledgements X
        Contact X
        scons-src-3.0.0/doc/reference/SharedLibrary.xml0000664000175000017500000000315513160023040021435 0ustar bdbaddogbdbaddog %scons; ]>
        The SharedLibrary Builder X
        The &SharedLibrary; Method X
        scons-src-3.0.0/doc/reference/scons.css0000664000175000017500000000735213160023040020022 0ustar bdbaddogbdbaddogbody { background: #ffffff; margin: 10px; padding: 0; font-family:palatino, georgia, verdana, arial, sans-serif; } a:link { color: #80572a; } a:link:hover { color: #d72816; text-decoration: none; } tt { color: #a14447; } pre { background: #e0e0e0; } #main { border: 1px solid; border-color: black; background-color: white; background-image: url(../images/sconsback.png); background-repeat: repeat-y 50% 0; background-position: right top; margin: 30px auto; width: 750px; } #banner { background-image: url(../images/scons-banner.jpg); border-bottom: 1px solid; height: 95px; } #menu { font-family: sans-serif; font-size: small; line-height: 0.9em; float: right; width: 220px; clear: both; margin-top: 10px; } #menu li { margin-bottom: 7px; } #menu li li { margin-bottom: 2px; } #menu li.submenuitems { margin-bottom: 2px; } #menu a { text-decoration: none; } #footer { border-top: 1px solid black; text-align: center; font-size: small; color: #822; margin-top: 4px; background: #eee; } ul.hack { list-style-position:inside; } ul.menuitems { list-style-type: none; } ul.submenuitems { list-style-type: none; font-size: smaller; margin-left: 0; padding-left: 16px; } ul.subsubmenuitems { list-style-type: none; font-size: smaller; margin-left: 0; padding-left: 16px; } ol.upper-roman { list-style-type: upper-roman; } ol.decimal { list-style-type: decimal; } #currentpage { font-weight: bold; } #bodycontent { margin: 15px; width: 520px; font-size: small; line-height: 1.5em; } #bodycontent li { margin-bottom: 6px; list-style-type: square; } #sconsdownloadtable downloadtable { display: table; margin-left: 5%; border-spacing: 12px 3px; } #sconsdownloadtable downloadrow { display: table-row; } #sconsdownloadtable downloadentry { display: table-cell; text-align: center; vertical-align: bottom; } #sconsdownloadtable downloaddescription { display: table-cell; font-weight: bold; text-align: left; } #sconsdownloadtable downloadversion { display: table-cell; font-weight: bold; text-align: center; } #sconsdocversiontable sconsversiontable { display: table; margin-left: 10%; border-spacing: 12px 3px; } #sconsdocversiontable sconsversionrow { display: table-row; } #sconsdocversiontable docformat { display: table-cell; font-weight: bold; text-align: center; vertical-align: bottom; } #sconsdocversiontable sconsversion { display: table-cell; font-weight: bold; text-align: left; } #sconsdocversiontable docversion { display: table-cell; font-weight: bold; text-align: center; } #osrating { margin-left: 35px; } h2 { color: #272; color: #c01714; font-family: sans-serif; font-weight: normal; } h2.pagetitle { font-size: xx-large; } h3 { margin-bottom: 10px; } .date { font-size: small; color: gray; } .link { margin-bottom: 22px; } .linkname { } .linkdesc { margin: 10px; margin-top: 0; } .quote { margin-top: 20px; margin-bottom: 10px; background: #f8f8f8; border: 1px solid; border-color: #ddd; } .quotetitle { font-weight: bold; font-size: large; margin: 10px; } .quotedesc { margin-left: 20px; margin-right: 10px; margin-bottom: 15px; } .quotetext { margin-top: 20px; margin-left: 20px; margin-right: 10px; font-style: italic; } .quoteauthor { font-size: small; text-align: right; margin-top: 10px; margin-right: 7px; } .sconslogo { font-style: normal; font-weight: bold; color: #822; } .downloadlink { } .downloaddescription { margin-left: 1em; margin-bottom: 0.4em; } scons-src-3.0.0/doc/reference/Library.xml0000664000175000017500000001233713160023040020310 0ustar bdbaddogbdbaddog %scons; ]>
        The Library Builder
        Linking With a Library env = Environment(CC = 'gcc', LIBS = 'world') env.Program('hello.c') % scons gcc -c hello.c -o hello.o gcc -c world.c -o world.o gcc -o hello hello.o -lworld
        Creating a Library env = Environment(CC = 'gcc', LIBS = 'world') env.Program('hello.c') env.Library('world.c') % scons gcc -c hello.c -o hello.o gcc -c world.c -o world.o ar r libworld.a world.o ar: creating libworld.a ranlib libworld.a gcc -o hello hello.o libworld.a
        The &Library; Builder X
        scons-src-3.0.0/doc/reference/CXXFile.xml0000664000175000017500000000313313160023040020140 0ustar bdbaddogbdbaddog %scons; ]>
        The CXXFile Builder X
        The &CXXFile; Method X
        scons-src-3.0.0/doc/scons.mod0000664000175000017500000010444513160023040016054 0ustar bdbaddogbdbaddog Aegis"> Ant"> ar"> as"> Autoconf"> Automake"> bison"> cc"> Cons"> cp"> csh"> f77"> f90"> f95"> gas"> gcc"> g77"> gXX"> Jam"> jar"> javac"> javah"> latex"> lex"> m4"> Make"> Make++"> pdflatex"> pdftex"> Python"> ranlib"> rmic"> SCons"> ScCons"> sleep"> swig"> tar"> tex"> touch"> yacc"> zip"> Action"> ActionBase"> CommandAction"> FunctionAction"> ListAction"> Builder"> BuilderBase"> CompositeBuilder"> MultiStepBuilder"> Job"> Jobs"> Serial"> Parallel"> Node"> Node.FS"> Scanner"> Sig"> Signature"> Taskmaster"> TimeStamp"> Walker"> Wrapper"> --config"> --debug=explain"> --debug=findlibs"> --debug=includes"> --debug=prepare"> --debug=presub"> --debug=stacktrace"> --implicit-cache"> --implicit-deps-changed"> --implicit-deps-unchanged"> --profile"> --taskmastertrace"> --tree"> -Q"> implicit_cache"> implicit_deps_changed"> implicit_deps_unchanged"> build"> Makefile"> Makefiles"> scons"> SConscript"> SConstruct"> Sconstruct"> sconstruct"> .sconsign"> src"> Add"> AddMethod"> AddPostAction"> AddPreAction"> AddOption"> AddOptions"> AddVariables"> Alias"> Aliases"> AllowSubstExceptions"> AlwaysBuild"> Append"> AppendENVPath"> AppendUnique"> BoolOption"> BoolVariable"> Build"> CacheDir"> Chmod"> Clean"> Clone"> Command"> Configure"> Copy"> Decider"> Default"> DefaultEnvironment"> DefaultRules"> Delete"> Depends"> Dir"> Dump"> Duplicate"> Entry"> EnumOption"> EnumVariable"> EnsurePythonVersion"> EnsureSConsVersion"> Environment"> Execute"> Exit"> Export"> File"> FindFile"> FindInstalledFiles"> FindPathDirs"> Finish"> Flatten"> GenerateHelpText"> GetBuildFailures"> GetBuildPath"> GetLaunchDir"> GetOption"> Glob"> Help"> Ignore"> Import"> Install"> InstallAs"> Link"> ListOption"> ListVariable"> Local"> MergeFlags"> Mkdir"> Module"> Move"> NoClean"> NoCache"> Objects"> Options"> Variables"> PackageOption"> PackageVariable"> ParseConfig"> ParseDepends"> ParseFlags"> PathOption"> PathOption.PathAccept"> PathOption.PathExists"> PathOption.PathIsDir"> PathOption.PathIsDirCreate"> PathOption.PathIsFile"> PathVariable"> PathVariable.PathAccept"> PathVariable.PathExists"> PathVariable.PathIsDir"> PathVariable.PathIsDirCreate"> PathVariable.PathIsFile"> Precious"> Prepend"> PrependENVPath"> PrependUnique"> Progress"> PyPackageDir"> Replace"> Repository"> Requires"> Return"> RuleSet"> Salt"> SetBuildSignatureType"> SetContentSignatureType"> SetDefault"> SetOption"> SideEffect"> SourceSignature"> SourceSignatures"> Split"> Tag"> TargetSignatures"> Task"> Touch"> UnknownOptions"> UnknownVariables"> subst"> Message"> Result"> CheckCHeader"> CheckCXXHeader"> CheckFunc"> CheckHeader"> CheckLib"> CheckLibWithHeader"> CheckProg"> CheckType"> CheckTypeSize"> TryAction"> TryBuild"> TryCompile"> TryLink"> TryRun"> IndexError"> NameError"> str"> zipfile"> Cache"> ARGLIST"> ARGUMENTS"> BUILD_TARGETS"> COMMAND_LINE_TARGETS"> DEFAULT_TARGETS"> BUILDERMAP"> COLOR"> COLORS"> CONFIG"> CPPDEFINES"> RELEASE"> RELEASE_BUILD"> SCANNERMAP"> TARFLAGS"> TARSUFFIX"> PATH"> PYTHONPATH"> SCONSFLAGS"> allowed_values"> build_dir"> map"> ignorecase"> options"> exports"> source"> target"> variables"> variant_dir"> all"> none"> BuildDir"> CFile"> CXXFile"> DVI"> Jar"> Java"> JavaH"> Library"> Object"> PCH"> PDF"> PostScript"> Program"> RES"> RMIC"> SharedLibrary"> SharedObject"> StaticLibrary"> StaticObject"> Substfile"> Tar"> Textfile"> VariantDir"> Zip"> Make"> builder function"> build action"> build actions"> builder method"> Configure Contexts"> configure context"> Construction Environment"> Construction Environments"> Construction environment"> Construction environments"> construction environment"> construction environments"> Construction Variable"> Construction Variables"> Construction variable"> Construction variables"> construction variable"> construction variables"> CPPPATH"> Dictionary"> Emitter"> emitter"> factory"> Generator"> generator"> Nodes"> signature"> build signature"> true"> false"> typedef"> action="> batch_key="> cmdstr="> exitstatfunc="> strfunction="> varlist="> bar"> common1.c"> common2.c"> custom.py"> goodbye"> goodbye.o"> goodbye.obj"> file.dll"> file.in"> file.lib"> file.o"> file.obj"> file.out"> foo"> foo.o"> foo.obj"> hello"> hello.c"> hello.exe"> hello.h"> hello.o"> hello.obj"> libfile_a"> libfile_so"> new_hello"> new_hello.exe"> prog"> prog1"> prog2"> prog.c"> prog.exe"> stdio.h"> +"> #"> announce@scons.tigris.org"> scons-dev@scons.org"> scons-users@scons.org"> scons-src-3.0.0/doc/generated/0000775000175000017500000000000013160023040016154 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/generated/functions.mod0000664000175000017500000011571613160023040020700 0ustar bdbaddogbdbaddog Action"> AddMethod"> AddOption"> AddPostAction"> AddPreAction"> Alias"> AllowSubstExceptions"> AlwaysBuild"> Append"> AppendENVPath"> AppendUnique"> BuildDir"> Builder"> CacheDir"> Clean"> Clone"> Command"> Configure"> Copy"> Decider"> Default"> DefaultEnvironment"> Depends"> Dictionary"> Dir"> Dump"> EnsurePythonVersion"> EnsureSConsVersion"> Environment"> Execute"> Exit"> Export"> File"> FindFile"> FindInstalledFiles"> FindPathDirs"> FindSourceFiles"> Flatten"> GetBuildFailures"> GetBuildPath"> GetLaunchDir"> GetOption"> Glob"> Help"> Ignore"> Import"> Literal"> Local"> MergeFlags"> NoCache"> NoClean"> ParseConfig"> ParseDepends"> ParseFlags"> Platform"> Precious"> Prepend"> PrependENVPath"> PrependUnique"> Progress"> Pseudo"> PyPackageDir"> Replace"> Repository"> Requires"> Return"> Scanner"> SConscript"> SConscriptChdir"> SConsignFile"> SetDefault"> SetOption"> SideEffect"> SourceCode"> SourceSignatures"> Split"> subst"> Tag"> TargetSignatures"> Tool"> Value"> VariantDir"> WhereIs"> env.Action"> env.AddMethod"> env.AddOption"> env.AddPostAction"> env.AddPreAction"> env.Alias"> env.AllowSubstExceptions"> env.AlwaysBuild"> env.Append"> env.AppendENVPath"> env.AppendUnique"> env.BuildDir"> env.Builder"> env.CacheDir"> env.Clean"> env.Clone"> env.Command"> env.Configure"> env.Copy"> env.Decider"> env.Default"> env.DefaultEnvironment"> env.Depends"> env.Dictionary"> env.Dir"> env.Dump"> env.EnsurePythonVersion"> env.EnsureSConsVersion"> env.Environment"> env.Execute"> env.Exit"> env.Export"> env.File"> env.FindFile"> env.FindInstalledFiles"> env.FindPathDirs"> env.FindSourceFiles"> env.Flatten"> env.GetBuildFailures"> env.GetBuildPath"> env.GetLaunchDir"> env.GetOption"> env.Glob"> env.Help"> env.Ignore"> env.Import"> env.Literal"> env.Local"> env.MergeFlags"> env.NoCache"> env.NoClean"> env.ParseConfig"> env.ParseDepends"> env.ParseFlags"> env.Platform"> env.Precious"> env.Prepend"> env.PrependENVPath"> env.PrependUnique"> env.Progress"> env.Pseudo"> env.PyPackageDir"> env.Replace"> env.Repository"> env.Requires"> env.Return"> env.Scanner"> env.SConscript"> env.SConscriptChdir"> env.SConsignFile"> env.SetDefault"> env.SetOption"> env.SideEffect"> env.SourceCode"> env.SourceSignatures"> env.Split"> env.subst"> env.Tag"> env.TargetSignatures"> env.Tool"> env.Value"> env.VariantDir"> env.WhereIs"> Action"> AddMethod"> AddOption"> AddPostAction"> AddPreAction"> Alias"> AllowSubstExceptions"> AlwaysBuild"> Append"> AppendENVPath"> AppendUnique"> BuildDir"> Builder"> CacheDir"> Clean"> Clone"> Command"> Configure"> Copy"> Decider"> Default"> DefaultEnvironment"> Depends"> Dictionary"> Dir"> Dump"> EnsurePythonVersion"> EnsureSConsVersion"> Environment"> Execute"> Exit"> Export"> File"> FindFile"> FindInstalledFiles"> FindPathDirs"> FindSourceFiles"> Flatten"> GetBuildFailures"> GetBuildPath"> GetLaunchDir"> GetOption"> Glob"> Help"> Ignore"> Import"> Literal"> Local"> MergeFlags"> NoCache"> NoClean"> ParseConfig"> ParseDepends"> ParseFlags"> Platform"> Precious"> Prepend"> PrependENVPath"> PrependUnique"> Progress"> Pseudo"> PyPackageDir"> Replace"> Repository"> Requires"> Return"> Scanner"> SConscript"> SConscriptChdir"> SConsignFile"> SetDefault"> SetOption"> SideEffect"> SourceCode"> SourceSignatures"> Split"> subst"> Tag"> TargetSignatures"> Tool"> Value"> VariantDir"> WhereIs"> env.Action"> env.AddMethod"> env.AddOption"> env.AddPostAction"> env.AddPreAction"> env.Alias"> env.AllowSubstExceptions"> env.AlwaysBuild"> env.Append"> env.AppendENVPath"> env.AppendUnique"> env.BuildDir"> env.Builder"> env.CacheDir"> env.Clean"> env.Clone"> env.Command"> env.Configure"> env.Copy"> env.Decider"> env.Default"> env.DefaultEnvironment"> env.Depends"> env.Dictionary"> env.Dir"> env.Dump"> env.EnsurePythonVersion"> env.EnsureSConsVersion"> env.Environment"> env.Execute"> env.Exit"> env.Export"> env.File"> env.FindFile"> env.FindInstalledFiles"> env.FindPathDirs"> env.FindSourceFiles"> env.Flatten"> env.GetBuildFailures"> env.GetBuildPath"> env.GetLaunchDir"> env.GetOption"> env.Glob"> env.Help"> env.Ignore"> env.Import"> env.Literal"> env.Local"> env.MergeFlags"> env.NoCache"> env.NoClean"> env.ParseConfig"> env.ParseDepends"> env.ParseFlags"> env.Platform"> env.Precious"> env.Prepend"> env.PrependENVPath"> env.PrependUnique"> env.Progress"> env.Pseudo"> env.PyPackageDir"> env.Replace"> env.Repository"> env.Requires"> env.Return"> env.Scanner"> env.SConscript"> env.SConscriptChdir"> env.SConsignFile"> env.SetDefault"> env.SetOption"> env.SideEffect"> env.SourceCode"> env.SourceSignatures"> env.Split"> env.subst"> env.Tag"> env.TargetSignatures"> env.Tool"> env.Value"> env.VariantDir"> env.WhereIs"> scons-src-3.0.0/doc/generated/builders.gen0000664000175000017500000031601213160023037020471 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> CFile() env.CFile() Builds a C source file given a lex (.l) or yacc (.y) input file. The suffix specified by the $CFILESUFFIX construction variable (.c by default) is automatically added to the target if it is not already present. Example: # builds foo.c env.CFile(target = 'foo.c', source = 'foo.l') # builds bar.c env.CFile(target = 'bar', source = 'bar.y') Command() env.Command() The Command "Builder" is actually implemented as a function that looks like a Builder, but actually takes an additional argument of the action from which the Builder should be made. See the Command function description for the calling syntax and details. CXXFile() env.CXXFile() Builds a C++ source file given a lex (.ll) or yacc (.yy) input file. The suffix specified by the $CXXFILESUFFIX construction variable (.cc by default) is automatically added to the target if it is not already present. Example: # builds foo.cc env.CXXFile(target = 'foo.cc', source = 'foo.ll') # builds bar.cc env.CXXFile(target = 'bar', source = 'bar.yy') DocbookEpub() env.DocbookEpub() A pseudo-Builder, providing a Docbook toolchain for EPUB output. env = Environment(tools=['docbook']) env.DocbookEpub('manual.epub', 'manual.xml') or simply env = Environment(tools=['docbook']) env.DocbookEpub('manual') DocbookHtml() env.DocbookHtml() A pseudo-Builder, providing a Docbook toolchain for HTML output. env = Environment(tools=['docbook']) env.DocbookHtml('manual.html', 'manual.xml') or simply env = Environment(tools=['docbook']) env.DocbookHtml('manual') DocbookHtmlChunked() env.DocbookHtmlChunked() A pseudo-Builder, providing a Docbook toolchain for chunked HTML output. It supports the base.dir parameter. The chunkfast.xsl file (requires "EXSLT") is used as the default stylesheet. Basic syntax: env = Environment(tools=['docbook']) env.DocbookHtmlChunked('manual') where manual.xml is the input file. If you use the root.filename parameter in your own stylesheets you have to specify the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: env = Environment(tools=['docbook']) env.DocbookHtmlChunked('mymanual.html', 'manual', xsl='htmlchunk.xsl') Some basic support for the base.dir is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: env = Environment(tools=['docbook']) env.DocbookHtmlChunked('manual', xsl='htmlchunk.xsl', base_dir='output/') Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! DocbookHtmlhelp() env.DocbookHtmlhelp() A pseudo-Builder, providing a Docbook toolchain for HTMLHELP output. Its basic syntax is: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual') where manual.xml is the input file. If you use the root.filename parameter in your own stylesheets you have to specify the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('mymanual.html', 'manual', xsl='htmlhelp.xsl') Some basic support for the base.dir parameter is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/') Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! DocbookMan() env.DocbookMan() A pseudo-Builder, providing a Docbook toolchain for Man page output. Its basic syntax is: env = Environment(tools=['docbook']) env.DocbookMan('manual') where manual.xml is the input file. Note, that you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source. DocbookPdf() env.DocbookPdf() A pseudo-Builder, providing a Docbook toolchain for PDF output. env = Environment(tools=['docbook']) env.DocbookPdf('manual.pdf', 'manual.xml') or simply env = Environment(tools=['docbook']) env.DocbookPdf('manual') DocbookSlidesHtml() env.DocbookSlidesHtml() A pseudo-Builder, providing a Docbook toolchain for HTML slides output. env = Environment(tools=['docbook']) env.DocbookSlidesHtml('manual') If you use the titlefoil.html parameter in your own stylesheets you have to give the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: env = Environment(tools=['docbook']) env.DocbookSlidesHtml('mymanual.html','manual', xsl='slideshtml.xsl') Some basic support for the base.dir parameter is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: env = Environment(tools=['docbook']) env.DocbookSlidesHtml('manual', xsl='slideshtml.xsl', base_dir='output/') Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! DocbookSlidesPdf() env.DocbookSlidesPdf() A pseudo-Builder, providing a Docbook toolchain for PDF slides output. env = Environment(tools=['docbook']) env.DocbookSlidesPdf('manual.pdf', 'manual.xml') or simply env = Environment(tools=['docbook']) env.DocbookSlidesPdf('manual') DocbookXInclude() env.DocbookXInclude() A pseudo-Builder, for resolving XIncludes in a separate processing step. env = Environment(tools=['docbook']) env.DocbookXInclude('manual_xincluded.xml', 'manual.xml') DocbookXslt() env.DocbookXslt() A pseudo-Builder, applying a given XSL transformation to the input file. env = Environment(tools=['docbook']) env.DocbookXslt('manual_transformed.xml', 'manual.xml', xsl='transform.xslt') Note, that this builder requires the xsl parameter to be set. DVI() env.DVI() Builds a .dvi file from a .tex, .ltx or .latex input file. If the source file suffix is .tex, scons will examine the contents of the file; if the string \documentclass or \documentstyle is found, the file is assumed to be a LaTeX file and the target is built by invoking the $LATEXCOM command line; otherwise, the $TEXCOM command line is used. If the file is a LaTeX file, the DVI builder method will also examine the contents of the .aux file and invoke the $BIBTEX command line if the string bibdata is found, start $MAKEINDEX to generate an index if a .ind file is found and will examine the contents .log file and re-run the $LATEXCOM command if the log file says it is necessary. The suffix .dvi (hard-coded within TeX itself) is automatically added to the target if it is not already present. Examples: # builds from aaa.tex env.DVI(target = 'aaa.dvi', source = 'aaa.tex') # builds bbb.dvi env.DVI(target = 'bbb', source = 'bbb.ltx') # builds from ccc.latex env.DVI(target = 'ccc.dvi', source = 'ccc.latex') Gs() env.Gs() A Builder for explicitly calling the gs executable. Depending on the underlying OS, the different names gs, gsos2 and gswin32c are tried. env = Environment(tools=['gs']) env.Gs('cover.jpg','scons-scons.pdf', GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -q') ) Install() env.Install() Installs one or more source files or directories in the specified target, which must be a directory. The names of the specified source files or directories remain the same within the destination directory. The sources may be given as a string or as a node returned by a builder. env.Install('/usr/local/bin', source = ['foo', 'bar']) InstallAs() env.InstallAs() Installs one or more source files or directories to specific names, allowing changing a file or directory name as part of the installation. It is an error if the target and source arguments list different numbers of files or directories. env.InstallAs(target = '/usr/local/bin/foo', source = 'foo_debug') env.InstallAs(target = ['../lib/libfoo.a', '../lib/libbar.a'], source = ['libFOO.a', 'libBAR.a']) InstallVersionedLib() env.InstallVersionedLib() Installs a versioned shared library. The symlinks appropriate to the architecture will be generated based on symlinks of the source library. env.InstallVersionedLib(target = '/usr/local/bin/foo', source = 'libxyz.1.5.2.so') Jar() env.Jar() Builds a Java archive (.jar) file from the specified list of sources. Any directories in the source list will be searched for .class files). Any .java files in the source list will be compiled to .class files by calling the Java Builder. If the $JARCHDIR value is set, the jar command will change to the specified directory using the option. If $JARCHDIR is not set explicitly, SCons will use the top of any subdirectory tree in which Java .class were built by the Java Builder. If the contents any of the source files begin with the string Manifest-Version, the file is assumed to be a manifest and is passed to the jar command with the option set. env.Jar(target = 'foo.jar', source = 'classes') env.Jar(target = 'bar.jar', source = ['bar1.java', 'bar2.java']) Java() env.Java() Builds one or more Java class files. The sources may be any combination of explicit .java files, or directory trees which will be scanned for .java files. SCons will parse each source .java file to find the classes (including inner classes) defined within that file, and from that figure out the target .class files that will be created. The class files will be placed underneath the specified target directory. SCons will also search each Java file for the Java package name, which it assumes can be found on a line beginning with the string package in the first column; the resulting .class files will be placed in a directory reflecting the specified package name. For example, the file Foo.java defining a single public Foo class and containing a package name of sub.dir will generate a corresponding sub/dir/Foo.class class file. Examples: env.Java(target = 'classes', source = 'src') env.Java(target = 'classes', source = ['src1', 'src2']) env.Java(target = 'classes', source = ['File1.java', 'File2.java']) Java source files can use the native encoding for the underlying OS. Since SCons compiles in simple ASCII mode by default, the compiler will generate warnings about unmappable characters, which may lead to errors as the file is processed further. In this case, the user must specify the LANG environment variable to tell the compiler what encoding is used. For portibility, it's best if the encoding is hard-coded so that the compile will work if it is done on a system with a different encoding. env = Environment() env['ENV']['LANG'] = 'en_GB.UTF-8' JavaH() env.JavaH() Builds C header and source files for implementing Java native methods. The target can be either a directory in which the header files will be written, or a header file name which will contain all of the definitions. The source can be the names of .class files, the names of .java files to be compiled into .class files by calling the Java builder method, or the objects returned from the Java builder method. If the construction variable $JAVACLASSDIR is set, either in the environment or in the call to the JavaH builder method itself, then the value of the variable will be stripped from the beginning of any .class file names. Examples: # builds java_native.h classes = env.Java(target = 'classdir', source = 'src') env.JavaH(target = 'java_native.h', source = classes) # builds include/package_foo.h and include/package_bar.h env.JavaH(target = 'include', source = ['package/foo.class', 'package/bar.class']) # builds export/foo.h and export/bar.h env.JavaH(target = 'export', source = ['classes/foo.class', 'classes/bar.class'], JAVACLASSDIR = 'classes') Library() env.Library() A synonym for the StaticLibrary builder method. LoadableModule() env.LoadableModule() On most systems, this is the same as SharedLibrary. On Mac OS X (Darwin) platforms, this creates a loadable module bundle. M4() env.M4() Builds an output file from an M4 input file. This uses a default $M4FLAGS value of , which considers all warnings to be fatal and stops on the first warning when using the GNU version of m4. Example: env.M4(target = 'foo.c', source = 'foo.c.m4') Moc() env.Moc() Builds an output file from a moc input file. Moc input files are either header files or cxx files. This builder is only available after using the tool 'qt'. See the $QTDIR variable for more information. Example: env.Moc('foo.h') # generates moc_foo.cc env.Moc('foo.cpp') # generates foo.moc MOFiles() env.MOFiles() This builder belongs to msgfmt tool. The builder compiles PO files to MO files. Example 1. Create pl.mo and en.mo by compiling pl.po and en.po: # ... env.MOFiles(['pl', 'en']) Example 2. Compile files for languages defined in LINGUAS file: # ... env.MOFiles(LINGUAS_FILE = 1) Example 3. Create pl.mo and en.mo by compiling pl.po and en.po plus files for languages defined in LINGUAS file: # ... env.MOFiles(['pl', 'en'], LINGUAS_FILE = 1) Example 4. Compile files for languages defined in LINGUAS file (another version): # ... env['LINGUAS_FILE'] = 1 env.MOFiles() MSVSProject() env.MSVSProject() Builds a Microsoft Visual Studio project file, and by default builds a solution file as well. This builds a Visual Studio project file, based on the version of Visual Studio that is configured (either the latest installed version, or the version specified by $MSVS_VERSION in the Environment constructor). For Visual Studio 6, it will generate a .dsp file. For Visual Studio 7 (.NET) and later versions, it will generate a .vcproj file. By default, this also generates a solution file for the specified project, a .dsw file for Visual Studio 6 or a .sln file for Visual Studio 7 (.NET). This behavior may be disabled by specifying auto_build_solution=0 when you call MSVSProject, in which case you presumably want to build the solution file(s) by calling the MSVSSolution Builder (see below). The MSVSProject builder takes several lists of filenames to be placed into the project file. These are currently limited to srcs, incs, localincs, resources, and misc. These are pretty self-explanatory, but it should be noted that these lists are added to the $SOURCES construction variable as strings, NOT as SCons File Nodes. This is because they represent file names to be added to the project file, not the source files used to build the project file. The above filename lists are all optional, although at least one must be specified for the resulting project file to be non-empty. In addition to the above lists of values, the following values may be specified: target The name of the target .dsp or .vcproj file. The correct suffix for the version of Visual Studio must be used, but the $MSVSPROJECTSUFFIX construction variable will be defined to the correct value (see example below). variant The name of this particular variant. For Visual Studio 7 projects, this can also be a list of variant names. These are typically things like "Debug" or "Release", but really can be anything you want. For Visual Studio 7 projects, they may also specify a target platform separated from the variant name by a | (vertical pipe) character: Debug|Xbox. The default target platform is Win32. Multiple calls to MSVSProject with different variants are allowed; all variants will be added to the project file with their appropriate build targets and sources. cmdargs Additional command line arguments for the different variants. The number of cmdargs entries must match the number of variant entries, or be empty (not specified). If you give only one, it will automatically be propagated to all variants. buildtarget An optional string, node, or list of strings or nodes (one per build variant), to tell the Visual Studio debugger what output target to use in what build variant. The number of buildtarget entries must match the number of variant entries. runfile The name of the file that Visual Studio 7 and later will run and debug. This appears as the value of the Output field in the resulting Visual Studio project file. If this is not specified, the default is the same as the specified buildtarget value. Note that because SCons always executes its build commands from the directory in which the SConstruct file is located, if you generate a project file in a different directory than the SConstruct directory, users will not be able to double-click on the file name in compilation error messages displayed in the Visual Studio console output window. This can be remedied by adding the Visual C/C++ /FC compiler option to the $CCFLAGS variable so that the compiler will print the full path name of any files that cause compilation errors. Example usage: barsrcs = ['bar.cpp'] barincs = ['bar.h'] barlocalincs = ['StdAfx.h'] barresources = ['bar.rc','resource.h'] barmisc = ['bar_readme.txt'] dll = env.SharedLibrary(target = 'bar.dll', source = barsrcs) buildtarget = [s for s in dll if str(s).endswith('dll')] env.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'], srcs = barsrcs, incs = barincs, localincs = barlocalincs, resources = barresources, misc = barmisc, buildtarget = buildtarget, variant = 'Release') Starting with version 2.4 of SCons it's also possible to specify the optional argument DebugSettings, which creates files for debugging under Visual Studio: DebugSettings A dictionary of debug settings that get written to the .vcproj.user or the .vcxproj.user file, depending on the version installed. As it is done for cmdargs (see above), you can specify a DebugSettings dictionary per variant. If you give only one, it will be propagated to all variants. Currently, only Visual Studio v9.0 and Visual Studio version v11 are implemented, for other versions no file is generated. To generate the user file, you just need to add a DebugSettings dictionary to the environment with the right parameters for your MSVS version. If the dictionary is empty, or does not contain any good value, no file will be generated.Following is a more contrived example, involving the setup of a project for variants and DebugSettings:# Assuming you store your defaults in a file vars = Variables('variables.py') msvcver = vars.args.get('vc', '9') # Check command args to force one Microsoft Visual Studio version if msvcver == '9' or msvcver == '11': env = Environment(MSVC_VERSION=msvcver+'.0', MSVC_BATCH=False) else: env = Environment() AddOption('--userfile', action='store_true', dest='userfile', default=False, help="Create Visual Studio Project user file") # # 1. Configure your Debug Setting dictionary with options you want in the list # of allowed options, for instance if you want to create a user file to launch # a specific application for testing your dll with Microsoft Visual Studio 2008 (v9): # V9DebugSettings = { 'Command':'c:\\myapp\\using\\thisdll.exe', 'WorkingDirectory': 'c:\\myapp\\using\\', 'CommandArguments': '-p password', # 'Attach':'false', # 'DebuggerType':'3', # 'Remote':'1', # 'RemoteMachine': None, # 'RemoteCommand': None, # 'HttpUrl': None, # 'PDBPath': None, # 'SQLDebugging': None, # 'Environment': '', # 'EnvironmentMerge':'true', # 'DebuggerFlavor': None, # 'MPIRunCommand': None, # 'MPIRunArguments': None, # 'MPIRunWorkingDirectory': None, # 'ApplicationCommand': None, # 'ApplicationArguments': None, # 'ShimCommand': None, # 'MPIAcceptMode': None, # 'MPIAcceptFilter': None, } # # 2. Because there are a lot of different options depending on the Microsoft # Visual Studio version, if you use more than one version you have to # define a dictionary per version, for instance if you want to create a user # file to launch a specific application for testing your dll with Microsoft # Visual Studio 2012 (v11): # V10DebugSettings = { 'LocalDebuggerCommand': 'c:\\myapp\\using\\thisdll.exe', 'LocalDebuggerWorkingDirectory': 'c:\\myapp\\using\\', 'LocalDebuggerCommandArguments': '-p password', # 'LocalDebuggerEnvironment': None, # 'DebuggerFlavor': 'WindowsLocalDebugger', # 'LocalDebuggerAttach': None, # 'LocalDebuggerDebuggerType': None, # 'LocalDebuggerMergeEnvironment': None, # 'LocalDebuggerSQLDebugging': None, # 'RemoteDebuggerCommand': None, # 'RemoteDebuggerCommandArguments': None, # 'RemoteDebuggerWorkingDirectory': None, # 'RemoteDebuggerServerName': None, # 'RemoteDebuggerConnection': None, # 'RemoteDebuggerDebuggerType': None, # 'RemoteDebuggerAttach': None, # 'RemoteDebuggerSQLDebugging': None, # 'DeploymentDirectory': None, # 'AdditionalFiles': None, # 'RemoteDebuggerDeployDebugCppRuntime': None, # 'WebBrowserDebuggerHttpUrl': None, # 'WebBrowserDebuggerDebuggerType': None, # 'WebServiceDebuggerHttpUrl': None, # 'WebServiceDebuggerDebuggerType': None, # 'WebServiceDebuggerSQLDebugging': None, } # # 3. Select the dictionary you want depending on the version of visual Studio # Files you want to generate. # if not env.GetOption('userfile'): dbgSettings = None elif env.get('MSVC_VERSION', None) == '9.0': dbgSettings = V9DebugSettings elif env.get('MSVC_VERSION', None) == '11.0': dbgSettings = V10DebugSettings else: dbgSettings = None # # 4. Add the dictionary to the DebugSettings keyword. # barsrcs = ['bar.cpp', 'dllmain.cpp', 'stdafx.cpp'] barincs = ['targetver.h'] barlocalincs = ['StdAfx.h'] barresources = ['bar.rc','resource.h'] barmisc = ['ReadMe.txt'] dll = env.SharedLibrary(target = 'bar.dll', source = barsrcs) env.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'], srcs = barsrcs, incs = barincs, localincs = barlocalincs, resources = barresources, misc = barmisc, buildtarget = [dll[0]] * 2, variant = ('Debug|Win32', 'Release|Win32'), cmdargs = 'vc=%s' % msvcver, DebugSettings = (dbgSettings, {})) MSVSSolution() env.MSVSSolution() Builds a Microsoft Visual Studio solution file. This builds a Visual Studio solution file, based on the version of Visual Studio that is configured (either the latest installed version, or the version specified by $MSVS_VERSION in the construction environment). For Visual Studio 6, it will generate a .dsw file. For Visual Studio 7 (.NET), it will generate a .sln file. The following values must be specified: target The name of the target .dsw or .sln file. The correct suffix for the version of Visual Studio must be used, but the value $MSVSSOLUTIONSUFFIX will be defined to the correct value (see example below). variant The name of this particular variant, or a list of variant names (the latter is only supported for MSVS 7 solutions). These are typically things like "Debug" or "Release", but really can be anything you want. For MSVS 7 they may also specify target platform, like this "Debug|Xbox". Default platform is Win32. projects A list of project file names, or Project nodes returned by calls to the MSVSProject Builder, to be placed into the solution file. It should be noted that these file names are NOT added to the $SOURCES environment variable in form of files, but rather as strings. This is because they represent file names to be added to the solution file, not the source files used to build the solution file. Example Usage: env.MSVSSolution(target = 'Bar' + env['MSVSSOLUTIONSUFFIX'], projects = ['bar' + env['MSVSPROJECTSUFFIX']], variant = 'Release') Object() env.Object() A synonym for the StaticObject builder method. Package() env.Package() Builds a Binary Package of the given source files. env.Package(source = FindInstalledFiles()) Builds software distribution packages. Packages consist of files to install and packaging information. The former may be specified with the source parameter and may be left out, in which case the FindInstalledFiles function will collect all files that have an Install or InstallAs Builder attached. If the target is not specified it will be deduced from additional information given to this Builder. The packaging information is specified with the help of construction variables documented below. This information is called a tag to stress that some of them can also be attached to files with the Tag function. The mandatory ones will complain if they were not specified. They vary depending on chosen target packager. The target packager may be selected with the "PACKAGETYPE" command line option or with the $PACKAGETYPE construction variable. Currently the following packagers available: * msi - Microsoft Installer * rpm - Redhat Package Manger * ipkg - Itsy Package Management System * tarbz2 - compressed tar * targz - compressed tar * zip - zip file * src_tarbz2 - compressed tar source * src_targz - compressed tar source * src_zip - zip file source An updated list is always available under the "package_type" option when running "scons --help" on a project that has packaging activated. env = Environment(tools=['default', 'packaging']) env.Install('/bin/', 'my_program') env.Package( NAME = 'foo', VERSION = '1.2.3', PACKAGEVERSION = 0, PACKAGETYPE = 'rpm', LICENSE = 'gpl', SUMMARY = 'balalalalal', DESCRIPTION = 'this should be really really long', X_RPM_GROUP = 'Application/fu', SOURCE_URL = 'http://foo.org/foo-1.2.3.tar.gz' ) PCH() env.PCH() Builds a Microsoft Visual C++ precompiled header. Calling this builder method returns a list of two targets: the PCH as the first element, and the object file as the second element. Normally the object file is ignored. This builder method is only provided when Microsoft Visual C++ is being used as the compiler. The PCH builder method is generally used in conjunction with the PCH construction variable to force object files to use the precompiled header: env['PCH'] = env.PCH('StdAfx.cpp')[0] PDF() env.PDF() Builds a .pdf file from a .dvi input file (or, by extension, a .tex, .ltx, or .latex input file). The suffix specified by the $PDFSUFFIX construction variable (.pdf by default) is added automatically to the target if it is not already present. Example: # builds from aaa.tex env.PDF(target = 'aaa.pdf', source = 'aaa.tex') # builds bbb.pdf from bbb.dvi env.PDF(target = 'bbb', source = 'bbb.dvi') POInit() env.POInit() This builder belongs to msginit tool. The builder initializes missing PO file(s) if $POAUTOINIT is set. If $POAUTOINIT is not set (default), POInit prints instruction for user (that is supposed to be a translator), telling how the PO file should be initialized. In normal projects you should not use POInit and use POUpdate instead. POUpdate chooses intelligently between msgmerge(1) and msginit(1). POInit always uses msginit(1) and should be regarded as builder for special purposes or for temporary use (e.g. for quick, one time initialization of a bunch of PO files) or for tests. Target nodes defined through POInit are not built by default (they're Ignored from '.' node) but are added to special Alias ('po-create' by default). The alias name may be changed through the $POCREATE_ALIAS construction variable. All PO files defined through POInit may be easily initialized by scons po-create. Example 1. Initialize en.po and pl.po from messages.pot: # ... env.POInit(['en', 'pl']) # messages.pot --> [en.po, pl.po] Example 2. Initialize en.po and pl.po from foo.pot: # ... env.POInit(['en', 'pl'], ['foo']) # foo.pot --> [en.po, pl.po] Example 3. Initialize en.po and pl.po from foo.pot but using $POTDOMAIN construction variable: # ... env.POInit(['en', 'pl'], POTDOMAIN='foo') # foo.pot --> [en.po, pl.po] Example 4. Initialize PO files for languages defined in LINGUAS file. The files will be initialized from template messages.pot: # ... env.POInit(LINGUAS_FILE = 1) # needs 'LINGUAS' file Example 5. Initialize en.po and pl.pl PO files plus files for languages defined in LINGUAS file. The files will be initialized from template messages.pot: # ... env.POInit(['en', 'pl'], LINGUAS_FILE = 1) Example 6. You may preconfigure your environment first, and then initialize PO files: # ... env['POAUTOINIT'] = 1 env['LINGUAS_FILE'] = 1 env['POTDOMAIN'] = 'foo' env.POInit() which has same efect as: # ... env.POInit(POAUTOINIT = 1, LINGUAS_FILE = 1, POTDOMAIN = 'foo') PostScript() env.PostScript() Builds a .ps file from a .dvi input file (or, by extension, a .tex, .ltx, or .latex input file). The suffix specified by the $PSSUFFIX construction variable (.ps by default) is added automatically to the target if it is not already present. Example: # builds from aaa.tex env.PostScript(target = 'aaa.ps', source = 'aaa.tex') # builds bbb.ps from bbb.dvi env.PostScript(target = 'bbb', source = 'bbb.dvi') POTUpdate() env.POTUpdate() The builder belongs to xgettext tool. The builder updates target POT file if exists or creates one if it doesn't. The node is not built by default (i.e. it is Ignored from '.'), but only on demand (i.e. when given POT file is required or when special alias is invoked). This builder adds its targe node (messages.pot, say) to a special alias (pot-update by default, see $POTUPDATE_ALIAS) so you can update/create them easily with scons pot-update. The file is not written until there is no real change in internationalized messages (or in comments that enter POT file). You may see xgettext(1) being invoked by the xgettext tool even if there is no real change in internationalized messages (so the POT file is not being updated). This happens every time a source file has changed. In such case we invoke xgettext(1) and compare its output with the content of POT file to decide whether the file should be updated or not. Example 1. Let's create po/ directory and place following SConstruct script there: # SConstruct in 'po/' subdir env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(['foo'], ['../a.cpp', '../b.cpp']) env.POTUpdate(['bar'], ['../c.cpp', '../d.cpp']) Then invoke scons few times: user@host:$ scons # Does not create foo.pot nor bar.pot user@host:$ scons foo.pot # Updates or creates foo.pot user@host:$ scons pot-update # Updates or creates foo.pot and bar.pot user@host:$ scons -c # Does not clean foo.pot nor bar.pot. the results shall be as the comments above say. Example 2. The POTUpdate builder may be used with no target specified, in which case default target messages.pot will be used. The default target may also be overridden by setting $POTDOMAIN construction variable or providing it as an override to POTUpdate builder: # SConstruct script env = Environment( tools = ['default', 'xgettext'] ) env['POTDOMAIN'] = "foo" env.POTUpdate(source = ["a.cpp", "b.cpp"]) # Creates foo.pot ... env.POTUpdate(POTDOMAIN = "bar", source = ["c.cpp", "d.cpp"]) # and bar.pot Example 3. The sources may be specified within separate file, for example POTFILES.in: # POTFILES.in in 'po/' subdirectory ../a.cpp ../b.cpp # end of file The name of the file (POTFILES.in) containing the list of sources is provided via $XGETTEXTFROM: # SConstruct file in 'po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in') Example 4. You may use $XGETTEXTPATH to define source search path. Assume, for example, that you have files a.cpp, b.cpp, po/SConstruct, po/POTFILES.in. Then your POT-related files could look as below: # POTFILES.in in 'po/' subdirectory a.cpp b.cpp # end of file # SConstruct file in 'po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH='../') Example 5. Multiple search directories may be defined within a list, i.e. XGETTEXTPATH = ['dir1', 'dir2', ...]. The order in the list determines the search order of source files. The path to the first file found is used. Let's create 0/1/po/SConstruct script: # SConstruct file in '0/1/po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH=['../', '../../']) and 0/1/po/POTFILES.in: # POTFILES.in in '0/1/po/' subdirectory a.cpp # end of file Write two *.cpp files, the first one is 0/a.cpp: /* 0/a.cpp */ gettext("Hello from ../../a.cpp") and the second is 0/1/a.cpp: /* 0/1/a.cpp */ gettext("Hello from ../a.cpp") then run scons. You'll obtain 0/1/po/messages.pot with the message "Hello from ../a.cpp". When you reverse order in $XGETTEXTFOM, i.e. when you write SConscript as # SConstruct file in '0/1/po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH=['../../', '../']) then the messages.pot will contain msgid "Hello from ../../a.cpp" line and not msgid "Hello from ../a.cpp". POUpdate() env.POUpdate() The builder belongs to msgmerge tool. The builder updates PO files with msgmerge(1), or initializes missing PO files as described in documentation of msginit tool and POInit builder (see also $POAUTOINIT). Note, that POUpdate does not add its targets to po-create alias as POInit does. Target nodes defined through POUpdate are not built by default (they're Ignored from '.' node). Instead, they are added automatically to special Alias ('po-update' by default). The alias name may be changed through the $POUPDATE_ALIAS construction variable. You can easily update PO files in your project by scons po-update. Example 1. Update en.po and pl.po from messages.pot template (see also $POTDOMAIN), assuming that the later one exists or there is rule to build it (see POTUpdate): # ... env.POUpdate(['en','pl']) # messages.pot --> [en.po, pl.po] Example 2. Update en.po and pl.po from foo.pot template: # ... env.POUpdate(['en', 'pl'], ['foo']) # foo.pot --> [en.po, pl.pl] Example 3. Update en.po and pl.po from foo.pot (another version): # ... env.POUpdate(['en', 'pl'], POTDOMAIN='foo') # foo.pot -- > [en.po, pl.pl] Example 4. Update files for languages defined in LINGUAS file. The files are updated from messages.pot template: # ... env.POUpdate(LINGUAS_FILE = 1) # needs 'LINGUAS' file Example 5. Same as above, but update from foo.pot template: # ... env.POUpdate(LINGUAS_FILE = 1, source = ['foo']) Example 6. Update en.po and pl.po plus files for languages defined in LINGUAS file. The files are updated from messages.pot template: # produce 'en.po', 'pl.po' + files defined in 'LINGUAS': env.POUpdate(['en', 'pl' ], LINGUAS_FILE = 1) Example 7. Use $POAUTOINIT to automatically initialize PO file if it doesn't exist: # ... env.POUpdate(LINGUAS_FILE = 1, POAUTOINIT = 1) Example 8. Update PO files for languages defined in LINGUAS file. The files are updated from foo.pot template. All necessary settings are pre-configured via environment. # ... env['POAUTOINIT'] = 1 env['LINGUAS_FILE'] = 1 env['POTDOMAIN'] = 'foo' env.POUpdate() Program() env.Program() Builds an executable given one or more object files or C, C++, D, or Fortran source files. If any C, C++, D or Fortran source files are specified, then they will be automatically compiled to object files using the Object builder method; see that builder method's description for a list of legal source file suffixes and how they are interpreted. The target executable file prefix (specified by the $PROGPREFIX construction variable; nothing by default) and suffix (specified by the $PROGSUFFIX construction variable; by default, .exe on Windows systems, nothing on POSIX systems) are automatically added to the target if not already present. Example: env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) ProgramAllAtOnce() env.ProgramAllAtOnce() Builds an executable from D sources without first creating individual objects for each file. D sources can be compiled file-by-file as C and C++ source are, and D is integrated into the scons Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others will not. Builds an executable from D sources without first creating individual objects for each file. D sources can be compiled file-by-file as C and C++ source are, and D is integrated into the scons Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others will not. Builds an executable from D sources without first creating individual objects for each file. D sources can be compiled file-by-file as C and C++ source are, and D is integrated into the scons Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others will not. RES() env.RES() Builds a Microsoft Visual C++ resource file. This builder method is only provided when Microsoft Visual C++ or MinGW is being used as the compiler. The .res (or .o for MinGW) suffix is added to the target name if no other suffix is given. The source file is scanned for implicit dependencies as though it were a C file. Example: env.RES('resource.rc') RMIC() env.RMIC() Builds stub and skeleton class files for remote objects from Java .class files. The target is a directory relative to which the stub and skeleton class files will be written. The source can be the names of .class files, or the objects return from the Java builder method. If the construction variable $JAVACLASSDIR is set, either in the environment or in the call to the RMIC builder method itself, then the value of the variable will be stripped from the beginning of any .class file names. classes = env.Java(target = 'classdir', source = 'src') env.RMIC(target = 'outdir1', source = classes) env.RMIC(target = 'outdir2', source = ['package/foo.class', 'package/bar.class']) env.RMIC(target = 'outdir3', source = ['classes/foo.class', 'classes/bar.class'], JAVACLASSDIR = 'classes') RPCGenClient() env.RPCGenClient() Generates an RPC client stub (_clnt.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files in the local directory, the command will be executed in the source file's directory by default. # Builds src/rpcif_clnt.c env.RPCGenClient('src/rpcif.x') RPCGenHeader() env.RPCGenHeader() Generates an RPC header (.h) file from a specified RPC (.x) source file. Because rpcgen only builds output files in the local directory, the command will be executed in the source file's directory by default. # Builds src/rpcif.h env.RPCGenHeader('src/rpcif.x') RPCGenService() env.RPCGenService() Generates an RPC server-skeleton (_svc.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files in the local directory, the command will be executed in the source file's directory by default. # Builds src/rpcif_svc.c env.RPCGenClient('src/rpcif.x') RPCGenXDR() env.RPCGenXDR() Generates an RPC XDR routine (_xdr.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files in the local directory, the command will be executed in the source file's directory by default. # Builds src/rpcif_xdr.c env.RPCGenClient('src/rpcif.x') SharedLibrary() env.SharedLibrary() Builds a shared library (.so on a POSIX system, .dll on Windows) given one or more object files or C, C++, D or Fortran source files. If any source files are given, then they will be automatically compiled to object files. The static library prefix and suffix (if any) are automatically added to the target. The target library file prefix (specified by the $SHLIBPREFIX construction variable; by default, lib on POSIX systems, nothing on Windows systems) and suffix (specified by the $SHLIBSUFFIX construction variable; by default, .dll on Windows systems, .so on POSIX systems) are automatically added to the target if not already present. Example: env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o']) On Windows systems, the SharedLibrary builder method will always build an import (.lib) library in addition to the shared (.dll) library, adding a .lib library with the same basename if there is not already a .lib file explicitly listed in the targets. On Cygwin systems, the SharedLibrary builder method will always build an import (.dll.a) library in addition to the shared (.dll) library, adding a .dll.a library with the same basename if there is not already a .dll.a file explicitly listed in the targets. Any object files listed in the source must have been built for a shared library (that is, using the SharedObject builder method). scons will raise an error if there is any mismatch. On some platforms, there is a distinction between a shared library (loaded automatically by the system to resolve external references) and a loadable module (explicitly loaded by user action). For maximum portability, use the LoadableModule builder for the latter. When the $SHLIBVERSION construction variable is defined a versioned shared library is created. This modifies the $SHLINKFLAGS as required, adds the version number to the library name, and creates the symlinks that are needed. env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o'], SHLIBVERSION='1.5.2') On a POSIX system, versions with a single token create exactly one symlink: libbar.so.6 would have symlinks libbar.so only. On a POSIX system, versions with two or more tokens create exactly two symlinks: libbar.so.2.3.1 would have symlinks libbar.so and libbar.so.2; on a Darwin (OSX) system the library would be libbar.2.3.1.dylib and the link would be libbar.dylib. On Windows systems, specifying register=1 will cause the .dll to be registered after it is built using REGSVR32. The command that is run ("regsvr32" by default) is determined by $REGSVR construction variable, and the flags passed are determined by $REGSVRFLAGS. By default, $REGSVRFLAGS includes the option, to prevent dialogs from popping up and requiring user attention when it is run. If you change $REGSVRFLAGS, be sure to include the option. For example, env.SharedLibrary(target = 'bar', source = ['bar.cxx', 'foo.obj'], register=1) will register bar.dll as a COM object when it is done linking it. SharedObject() env.SharedObject() Builds an object file for inclusion in a shared library. Source files must have one of the same set of extensions specified above for the StaticObject builder method. On some platforms building a shared object requires additional compiler option (e.g. for gcc) in addition to those needed to build a normal (static) object, but on some platforms there is no difference between a shared object and a normal (static) one. When there is a difference, SCons will only allow shared objects to be linked into a shared library, and will use a different suffix for shared objects. On platforms where there is no difference, SCons will allow both normal (static) and shared objects to be linked into a shared library, and will use the same suffix for shared and normal (static) objects. The target object file prefix (specified by the $SHOBJPREFIX construction variable; by default, the same as $OBJPREFIX) and suffix (specified by the $SHOBJSUFFIX construction variable) are automatically added to the target if not already present. Examples: env.SharedObject(target = 'ddd', source = 'ddd.c') env.SharedObject(target = 'eee.o', source = 'eee.cpp') env.SharedObject(target = 'fff.obj', source = 'fff.for') Note that the source files will be scanned according to the suffix mappings in the SourceFileScanner object. See the section "Scanner Objects," below, for more information. StaticLibrary() env.StaticLibrary() Builds a static library given one or more object files or C, C++, D or Fortran source files. If any source files are given, then they will be automatically compiled to object files. The static library prefix and suffix (if any) are automatically added to the target. The target library file prefix (specified by the $LIBPREFIX construction variable; by default, lib on POSIX systems, nothing on Windows systems) and suffix (specified by the $LIBSUFFIX construction variable; by default, .lib on Windows systems, .a on POSIX systems) are automatically added to the target if not already present. Example: env.StaticLibrary(target = 'bar', source = ['bar.c', 'foo.o']) Any object files listed in the source must have been built for a static library (that is, using the StaticObject builder method). scons will raise an error if there is any mismatch. StaticObject() env.StaticObject() Builds a static object file from one or more C, C++, D, or Fortran source files. Source files must have one of the following extensions: .asm assembly language file .ASM assembly language file .c C file .C Windows: C file POSIX: C++ file .cc C++ file .cpp C++ file .cxx C++ file .cxx C++ file .c++ C++ file .C++ C++ file .d D file .f Fortran file .F Windows: Fortran file POSIX: Fortran file + C pre-processor .for Fortran file .FOR Fortran file .fpp Fortran file + C pre-processor .FPP Fortran file + C pre-processor .m Object C file .mm Object C++ file .s assembly language file .S Windows: assembly language file ARM: CodeSourcery Sourcery Lite .sx assembly language file + C pre-processor POSIX: assembly language file + C pre-processor .spp assembly language file + C pre-processor .SPP assembly language file + C pre-processor The target object file prefix (specified by the $OBJPREFIX construction variable; nothing by default) and suffix (specified by the $OBJSUFFIX construction variable; .obj on Windows systems, .o on POSIX systems) are automatically added to the target if not already present. Examples: env.StaticObject(target = 'aaa', source = 'aaa.c') env.StaticObject(target = 'bbb.o', source = 'bbb.c++') env.StaticObject(target = 'ccc.obj', source = 'ccc.f') Note that the source files will be scanned according to the suffix mappings in SourceFileScanner object. See the section "Scanner Objects," below, for more information. Substfile() env.Substfile() The Substfile builder creates a single text file from another file or set of files by concatenating them with $LINESEPARATOR and replacing text using the $SUBST_DICT construction variable. Nested lists of source files are flattened. See also Textfile. If a single source file is present with an .in suffix, the suffix is stripped and the remainder is used as the default target name. The prefix and suffix specified by the $SUBSTFILEPREFIX and $SUBSTFILESUFFIX construction variables (the null string by default in both cases) are automatically added to the target if they are not already present. If a construction variable named $SUBST_DICT is present, it may be either a Python dictionary or a sequence of (key,value) tuples. If it is a dictionary it is converted into a list of tuples in an arbitrary order, so if one key is a prefix of another key or if one substitution could be further expanded by another subsitition, it is unpredictable whether the expansion will occur. Any occurrences of a key in the source are replaced by the corresponding value, which may be a Python callable function or a string. If the value is a callable, it is called with no arguments to get a string. Strings are subst-expanded and the result replaces the key. env = Environment(tools = ['default', 'textfile']) env['prefix'] = '/usr/bin' script_dict = {'@prefix@': '/bin', '@exec_prefix@': '$prefix'} env.Substfile('script.in', SUBST_DICT = script_dict) conf_dict = {'%VERSION%': '1.2.3', '%BASE%': 'MyProg'} env.Substfile('config.h.in', conf_dict, SUBST_DICT = conf_dict) # UNPREDICTABLE - one key is a prefix of another bad_foo = {'$foo': '$foo', '$foobar': '$foobar'} env.Substfile('foo.in', SUBST_DICT = bad_foo) # PREDICTABLE - keys are applied longest first good_foo = [('$foobar', '$foobar'), ('$foo', '$foo')] env.Substfile('foo.in', SUBST_DICT = good_foo) # UNPREDICTABLE - one substitution could be futher expanded bad_bar = {'@bar@': '@soap@', '@soap@': 'lye'} env.Substfile('bar.in', SUBST_DICT = bad_bar) # PREDICTABLE - substitutions are expanded in order good_bar = (('@bar@', '@soap@'), ('@soap@', 'lye')) env.Substfile('bar.in', SUBST_DICT = good_bar) # the SUBST_DICT may be in common (and not an override) substutions = {} subst = Environment(tools = ['textfile'], SUBST_DICT = substitutions) substitutions['@foo@'] = 'foo' subst['SUBST_DICT']['@bar@'] = 'bar' subst.Substfile('pgm1.c', [Value('#include "@foo@.h"'), Value('#include "@bar@.h"'), "common.in", "pgm1.in" ]) subst.Substfile('pgm2.c', [Value('#include "@foo@.h"'), Value('#include "@bar@.h"'), "common.in", "pgm2.in" ]) Tar() env.Tar() Builds a tar archive of the specified files and/or directories. Unlike most builder methods, the Tar builder method may be called multiple times for a given target; each additional call adds to the list of entries that will be built into the archive. Any source directories will be scanned for changes to any on-disk files, regardless of whether or not scons knows about them from other Builder or function calls. env.Tar('src.tar', 'src') # Create the stuff.tar file. env.Tar('stuff', ['subdir1', 'subdir2']) # Also add "another" to the stuff.tar file. env.Tar('stuff', 'another') # Set TARFLAGS to create a gzip-filtered archive. env = Environment(TARFLAGS = '-c -z') env.Tar('foo.tar.gz', 'foo') # Also set the suffix to .tgz. env = Environment(TARFLAGS = '-c -z', TARSUFFIX = '.tgz') env.Tar('foo') Textfile() env.Textfile() The Textfile builder generates a single text file. The source strings constitute the lines; nested lists of sources are flattened. $LINESEPARATOR is used to separate the strings. If present, the $SUBST_DICT construction variable is used to modify the strings before they are written; see the Substfile description for details. The prefix and suffix specified by the $TEXTFILEPREFIX and $TEXTFILESUFFIX construction variables (the null string and .txt by default, respectively) are automatically added to the target if they are not already present. Examples: # builds/writes foo.txt env.Textfile(target = 'foo.txt', source = ['Goethe', 42, 'Schiller']) # builds/writes bar.txt env.Textfile(target = 'bar', source = ['lalala', 'tanteratei'], LINESEPARATOR='|*') # nested lists are flattened automatically env.Textfile(target = 'blob', source = ['lalala', ['Goethe', 42 'Schiller'], 'tanteratei']) # files may be used as input by wraping them in File() env.Textfile(target = 'concat', # concatenate files with a marker between source = [File('concat1'), File('concat2')], LINESEPARATOR = '====================\n') Results are: foo.txt ....8<---- Goethe 42 Schiller ....8<---- (no linefeed at the end) bar.txt: ....8<---- lalala|*tanteratei ....8<---- (no linefeed at the end) blob.txt ....8<---- lalala Goethe 42 Schiller tanteratei ....8<---- (no linefeed at the end) Translate() env.Translate() This pseudo-builder belongs to gettext toolset. The builder extracts internationalized messages from source files, updates POT template (if necessary) and then updates PO translations (if necessary). If $POAUTOINIT is set, missing PO files will be automatically created (i.e. without translator person intervention). The variables $LINGUAS_FILE and $POTDOMAIN are taken into acount too. All other construction variables used by POTUpdate, and POUpdate work here too. Example 1. The simplest way is to specify input files and output languages inline in a SCons script when invoking Translate # SConscript in 'po/' directory env = Environment( tools = ["default", "gettext"] ) env['POAUTOINIT'] = 1 env.Translate(['en','pl'], ['../a.cpp','../b.cpp']) Example 2. If you wish, you may also stick to conventional style known from autotools, i.e. using POTFILES.in and LINGUAS files # LINGUAS en pl #end # POTFILES.in a.cpp b.cpp # end # SConscript env = Environment( tools = ["default", "gettext"] ) env['POAUTOINIT'] = 1 env['XGETTEXTPATH'] = ['../'] env.Translate(LINGUAS_FILE = 1, XGETTEXTFROM = 'POTFILES.in') The last approach is perhaps the recommended one. It allows easily split internationalization/localization onto separate SCons scripts, where a script in source tree is responsible for translations (from sources to PO files) and script(s) under variant directories are responsible for compilation of PO to MO files to and for installation of MO files. The "gluing factor" synchronizing these two scripts is then the content of LINGUAS file. Note, that the updated POT and PO files are usually going to be committed back to the repository, so they must be updated within the source directory (and not in variant directories). Additionaly, the file listing of po/ directory contains LINGUAS file, so the source tree looks familiar to translators, and they may work with the project in their usual way. Example 3. Let's prepare a development tree as below project/ + SConstruct + build/ + src/ + po/ + SConscript + SConscript.i18n + POTFILES.in + LINGUAS with build being variant directory. Write the top-level SConstruct script as follows # SConstruct env = Environment( tools = ["default", "gettext"] ) VariantDir('build', 'src', duplicate = 0) env['POAUTOINIT'] = 1 SConscript('src/po/SConscript.i18n', exports = 'env') SConscript('build/po/SConscript', exports = 'env') the src/po/SConscript.i18n as # src/po/SConscript.i18n Import('env') env.Translate(LINGUAS_FILE=1, XGETTEXTFROM='POTFILES.in', XGETTEXTPATH=['../']) and the src/po/SConscript # src/po/SConscript Import('env') env.MOFiles(LINGUAS_FILE = 1) Such setup produces POT and PO files under source tree in src/po/ and binary MO files under variant tree in build/po/. This way the POT and PO files are separated from other output files, which must not be committed back to source repositories (e.g. MO files). In above example, the PO files are not updated, nor created automatically when you issue scons '.' command. The files must be updated (created) by hand via scons po-update and then MO files can be compiled by running scons '.'. TypeLibrary() env.TypeLibrary() Builds a Windows type library (.tlb) file from an input IDL file (.idl). In addition, it will build the associated interface stub and proxy source files, naming them according to the base name of the .idl file. For example, env.TypeLibrary(source="foo.idl") Will create foo.tlb, foo.h, foo_i.c, foo_p.c and foo_data.c files. Uic() env.Uic() Builds a header file, an implementation file and a moc file from an ui file. and returns the corresponding nodes in the above order. This builder is only available after using the tool 'qt'. Note: you can specify .ui files directly as source files to the Program, Library and SharedLibrary builders without using this builder. Using this builder lets you override the standard naming conventions (be careful: prefixes are always prepended to names of built files; if you don't want prefixes, you may set them to ``). See the $QTDIR variable for more information. Example: env.Uic('foo.ui') # -> ['foo.h', 'uic_foo.cc', 'moc_foo.cc'] env.Uic(target = Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'), source = 'foo.ui') # -> ['include/foo.h', 'gen/uicfoo.cc', 'gen/mocfoo.cc'] Zip() env.Zip() Builds a zip archive of the specified files and/or directories. Unlike most builder methods, the Zip builder method may be called multiple times for a given target; each additional call adds to the list of entries that will be built into the archive. Any source directories will be scanned for changes to any on-disk files, regardless of whether or not scons knows about them from other Builder or function calls. env.Zip('src.zip', 'src') # Create the stuff.zip file. env.Zip('stuff', ['subdir1', 'subdir2']) # Also add "another" to the stuff.tar file. env.Zip('stuff', 'another') scons-src-3.0.0/doc/generated/tools.mod0000664000175000017500000004742513160023040020031 0ustar bdbaddogbdbaddog 386asm"> aixc++"> aixcc"> aixf77"> aixlink"> applelink"> ar"> as"> bcc32"> cc"> clang"> clangxx"> cvf"> cXX"> cyglink"> default"> dmd"> docbook"> dvi"> dvipdf"> dvips"> f03"> f08"> f77"> f90"> f95"> fortran"> g++"> g77"> gas"> gcc"> gdc"> gettext"> gfortran"> gnulink"> gs"> hpc++"> hpcc"> hplink"> icc"> icl"> ifl"> ifort"> ilink"> ilink32"> install"> intelc"> jar"> javac"> javah"> latex"> ldc"> lex"> link"> linkloc"> m4"> masm"> midl"> mingw"> msgfmt"> msginit"> msgmerge"> mslib"> mslink"> mssdk"> msvc"> msvs"> mwcc"> mwld"> nasm"> Packaging"> packaging"> pdf"> pdflatex"> pdftex"> qt"> rmic"> rpcgen"> sgiar"> sgic++"> sgicc"> sgilink"> sunar"> sunc++"> suncc"> sunf77"> sunf90"> sunf95"> sunlink"> swig"> tar"> tex"> textfile"> tlib"> xgettext"> yacc"> zip"> 386asm"> aixc++"> aixcc"> aixf77"> aixlink"> applelink"> ar"> as"> bcc32"> cc"> clang"> clangxx"> cvf"> cXX"> cyglink"> default"> dmd"> docbook"> dvi"> dvipdf"> dvips"> f03"> f08"> f77"> f90"> f95"> fortran"> g++"> g77"> gas"> gcc"> gdc"> gettext"> gfortran"> gnulink"> gs"> hpc++"> hpcc"> hplink"> icc"> icl"> ifl"> ifort"> ilink"> ilink32"> install"> intelc"> jar"> javac"> javah"> latex"> ldc"> lex"> link"> linkloc"> m4"> masm"> midl"> mingw"> msgfmt"> msginit"> msgmerge"> mslib"> mslink"> mssdk"> msvc"> msvs"> mwcc"> mwld"> nasm"> Packaging"> packaging"> pdf"> pdflatex"> pdftex"> qt"> rmic"> rpcgen"> sgiar"> sgic++"> sgicc"> sgilink"> sunar"> sunc++"> suncc"> sunf77"> sunf90"> sunf95"> sunlink"> swig"> tar"> tex"> textfile"> tlib"> xgettext"> yacc"> zip"> scons-src-3.0.0/doc/generated/examples/0000775000175000017500000000000013160023040017772 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/generated/examples/fileremoval_precious-ex1_1.xml0000664000175000017500000000055713160023040025654 0ustar bdbaddogbdbaddog % scons -Q cc -o f1.o -c f1.c cc -o f2.o -c f2.c cc -o f3.o -c f3.c ar rc libfoo.a f1.o f2.o f3.o scons-src-3.0.0/doc/generated/examples/lesssimple_ex3_2.xml0000664000175000017500000000075213160023040023700 0ustar bdbaddogbdbaddog C:\>scons -Q cl /Fofile1.obj /c file1.c /nologo cl /Fofile2.obj /c file2.c /nologo cl /Foprog.obj /c prog.c /nologo link /nologo /OUT:program.exe prog.obj file1.obj file2.obj embedManifestExeCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/depends_no-Requires_1.xml0000664000175000017500000000117213160023040024650 0ustar bdbaddogbdbaddog % scons -Q hello cc -o hello.o -c hello.c cc -o version.o -c version.c cc -o hello hello.o version.o % sleep 1 % scons -Q hello cc -o version.o -c version.c cc -o hello hello.o version.o % sleep 1 % scons -Q hello cc -o version.o -c version.c cc -o hello hello.o version.o scons-src-3.0.0/doc/generated/examples/builderswriting_ex2_1.xml0000664000175000017500000000064713160023037024744 0ustar bdbaddogbdbaddog % scons -Q AttributeError: 'SConsEnvironment' object has no attribute 'Program': File "/home/my/project/SConstruct", line 4: env.Program('hello.c') scons-src-3.0.0/doc/generated/examples/separate_builddir_1.xml0000664000175000017500000000067713160023040024430 0ustar bdbaddogbdbaddog % ls src hello.c % scons -Q cc -o build/hello.o -c build/hello.c cc -o build/hello build/hello.o % ls build hello hello.c hello.o scons-src-3.0.0/doc/generated/examples/commandline_COMMAND_LINE_TARGETS_1.xml0000664000175000017500000000066313160023037026373 0ustar bdbaddogbdbaddog % scons -Q cc -o foo.o -c foo.c cc -o foo foo.o % scons -Q bar Don't forget to copy `bar' to the archive! cc -o bar.o -c bar.c cc -o bar bar.o scons-src-3.0.0/doc/generated/examples/install_ex5_1.xml0000664000175000017500000000074213160023040023166 0ustar bdbaddogbdbaddog % scons -Q install cc -o goodbye.o -c goodbye.c cc -o goodbye goodbye.o Install file: "goodbye" as "/usr/bin/goodbye-new" cc -o hello.o -c hello.c cc -o hello hello.o Install file: "hello" as "/usr/bin/hello-new" scons-src-3.0.0/doc/generated/examples/environments_missing3_1.xml0000664000175000017500000000050713160023040025301 0ustar bdbaddogbdbaddog % scons -Q value is: -><- scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/commandline_AddOption_2.xml0000664000175000017500000000055113160023037025173 0ustar bdbaddogbdbaddog % scons -Q -n --prefix=/tmp/install Install file: "foo.in" as "/tmp/install/usr/bin/foo.in" scons-src-3.0.0/doc/generated/examples/environments_ex2_1.xml0000664000175000017500000000055113160023040024242 0ustar bdbaddogbdbaddog % scons -Q cc -o bar.o -c -g bar.c cc -o bar bar.o cc -o foo.o -c -O2 foo.c cc -o foo foo.o scons-src-3.0.0/doc/generated/examples/troubleshoot_tree2_2.xml0000664000175000017500000000163413160023040024573 0ustar bdbaddogbdbaddog % scons -Q --tree=prune cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c ar rc libfoo.a f1.o f2.o f3.o ranlib libfoo.a cc -o prog1.o -c -I. prog1.c cc -o prog1 prog1.o -L. -lfoo cc -o prog2.o -c -I. prog2.c cc -o prog2 prog2.o -L. -lfoo +-. +-SConstruct +-f1.c +-f1.o | +-f1.c | +-inc.h +-f2.c +-f2.o | +-f2.c | +-inc.h +-f3.c +-f3.o | +-f3.c | +-inc.h +-inc.h +-libfoo.a | +-[f1.o] | +-[f2.o] | +-[f3.o] +-prog1 | +-prog1.o | | +-prog1.c | | +-inc.h | +-[libfoo.a] +-prog1.c +-[prog1.o] +-prog2 | +-prog2.o | | +-prog2.c | | +-inc.h | +-[libfoo.a] +-prog2.c +-[prog2.o] scons-src-3.0.0/doc/generated/examples/libraries_objects_1.xml0000664000175000017500000000056113160023040024423 0ustar bdbaddogbdbaddog % scons -Q cc -o f1.o -c f1.c cc -o f3.o -c f3.c ar rc libfoo.a f1.o f2.o f3.o f4.o ranlib libfoo.a scons-src-3.0.0/doc/generated/examples/troubleshoot_tree1_2.xml0000664000175000017500000000053113160023040024565 0ustar bdbaddogbdbaddog % scons -Q --tree=all f2.o cc -o f2.o -c -I. f2.c +-f2.o +-f2.c +-inc.h scons-src-3.0.0/doc/generated/examples/troubleshoot_explain1_2.xml0000664000175000017500000000056113160023040025271 0ustar bdbaddogbdbaddog % scons -Q --debug=explain scons: building `file.out' because it doesn't exist cp file.in file.oout scons-src-3.0.0/doc/generated/examples/simple_ex1_4.xml0000664000175000017500000000062113160023040023004 0ustar bdbaddogbdbaddog C:\>scons -Q cl /Fohello.obj /c hello.c /nologo link /nologo /OUT:hello.exe hello.obj embedManifestExeCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/commandline_DEFAULT_TARGETS_2_1.xml0000664000175000017500000000107613160023037026012 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... DEFAULT_TARGETS is now ['prog1'] DEFAULT_TARGETS is now ['prog1', 'prog2'] scons: done reading SConscript files. scons: Building targets ... cc -o prog1.o -c prog1.c cc -o prog1 prog1.o cc -o prog2.o -c prog2.c cc -o prog2 prog2.o scons: done building targets. scons-src-3.0.0/doc/generated/examples/misc_Exit_1.xml0000664000175000017500000000063013160023040022657 0ustar bdbaddogbdbaddog % scons -Q FUTURE=1 The FUTURE option is not supported yet! % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/troubleshoot_tree1_6.xml0000664000175000017500000000146013160023040024573 0ustar bdbaddogbdbaddog % scons -Q --tree=derived,status cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c cc -o prog f1.o f2.o f3.o E = exists R = exists in repository only b = implicit builder B = explicit builder S = side effect P = precious A = always build C = current N = no clean H = no cache [E b ]+-. [E B C ] +-f1.o [E B C ] +-f2.o [E B C ] +-f3.o [E B C ] +-prog [E B C ] +-f1.o [E B C ] +-f2.o [E B C ] +-f3.o scons-src-3.0.0/doc/generated/examples/hierarchy_Return_1.xml0000664000175000017500000000060713160023040024254 0ustar bdbaddogbdbaddog % scons -Q cc -o bar/bar.o -c bar/bar.c cc -o foo/foo.o -c foo/foo.c ar rc libprog.a foo/foo.o bar/bar.o ranlib libprog.a scons-src-3.0.0/doc/generated/examples/commandline_EnumVariable_1.xml0000664000175000017500000000077313160023037025671 0ustar bdbaddogbdbaddog % scons -Q COLOR=red foo.o cc -o foo.o -c -DCOLOR="red" foo.c % scons -Q COLOR=blue foo.o cc -o foo.o -c -DCOLOR="blue" foo.c % scons -Q COLOR=green foo.o cc -o foo.o -c -DCOLOR="green" foo.c scons-src-3.0.0/doc/generated/examples/commandline_Default4_1.xml0000664000175000017500000000076413160023037024767 0ustar bdbaddogbdbaddog % scons -Q scons: *** No targets specified and no Default() targets found. Stop. Found nothing to build % scons -Q . cc -o prog1.o -c prog1.c cc -o prog1 prog1.o cc -o prog2.o -c prog2.c cc -o prog2 prog2.o scons-src-3.0.0/doc/generated/examples/factories_Copy1_1.xml0000664000175000017500000000046413160023040023772 0ustar bdbaddogbdbaddog % scons -Q Copy("file.out", "file.in") scons-src-3.0.0/doc/generated/examples/addmethod_ex2_2.xml0000664000175000017500000000071013160023037023450 0ustar bdbaddogbdbaddog C:\>scons -Q rc /fores.res res.rc cl /Fotest_stuff.obj /c test_stuff.c /nologo link /nologo /OUT:tests\test_stuff.exe test_stuff.obj res.res embedManifestExeCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/troubleshoot_Dump_ENV_1.xml0000664000175000017500000000065513160023040025170 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... File "/home/my/project/SConstruct", line 2 print env.Dump('ENV') ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/simple_ex1_3.xml0000664000175000017500000000102213160023040022777 0ustar bdbaddogbdbaddog C:\>scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... cl /Fohello.obj /c hello.c /nologo link /nologo /OUT:hello.exe hello.obj embedManifestExeCheck(target, source, env) scons: done building targets. scons-src-3.0.0/doc/generated/examples/alias_ex1_1.xml0000664000175000017500000000056713160023037022620 0ustar bdbaddogbdbaddog % scons -Q install cc -o hello.o -c hello.c cc -o hello hello.o Install file: "hello" as "/usr/bin/hello" scons-src-3.0.0/doc/generated/examples/depends_ex1_6.xml0000664000175000017500000000064213160023040023142 0ustar bdbaddogbdbaddog % scons -Q --implicit-cache hello cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello scons: `hello' is up to date. scons-src-3.0.0/doc/generated/examples/commandline_BUILD_TARGETS_1_1.xml0000664000175000017500000000111213160023037025553 0ustar bdbaddogbdbaddog % scons -Q BUILD_TARGETS is ['prog1'] cc -o prog1.o -c prog1.c cc -o prog1 prog1.o % scons -Q prog2 BUILD_TARGETS is ['prog2'] cc -o prog2.o -c prog2.c cc -o prog2 prog2.o % scons -Q -c . BUILD_TARGETS is ['.'] Removed prog1.o Removed prog1 Removed prog2.o Removed prog2 scons-src-3.0.0/doc/generated/examples/depends_mixing_1.xml0000664000175000017500000000104213160023040023726 0ustar bdbaddogbdbaddog % scons -Q cc -o program1.o -c -I. program1.c cc -o prog-MD5 program1.o cc -o program2.o -c -I. program2.c cc -o prog-timestamp program2.o % touch inc.h % scons -Q cc -o program2.o -c -I. program2.c cc -o prog-timestamp program2.o scons-src-3.0.0/doc/generated/examples/libraries_SharedLibrary_1.xml0000664000175000017500000000057613160023040025533 0ustar bdbaddogbdbaddog % scons -Q cc -o f1.os -c f1.c cc -o f2.os -c f2.c cc -o f3.os -c f3.c cc -o libfoo.so -shared f1.os f2.os f3.os scons-src-3.0.0/doc/generated/examples/commandline_Variables1_1.xml0000664000175000017500000000060613160023037025303 0ustar bdbaddogbdbaddog % scons -Q RELEASE=1 cc -o bar.o -c -DRELEASE_BUILD=1 bar.c cc -o foo.o -c -DRELEASE_BUILD=1 foo.c cc -o foo foo.o bar.o scons-src-3.0.0/doc/generated/examples/troubleshoot_tree1_5.xml0000664000175000017500000000071713160023040024576 0ustar bdbaddogbdbaddog % scons -Q --tree=derived cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c cc -o prog f1.o f2.o f3.o +-. +-f1.o +-f2.o +-f3.o +-prog +-f1.o +-f2.o +-f3.o scons-src-3.0.0/doc/generated/examples/sourcecode_sccs_1.xml0000664000175000017500000000065513160023040024110 0ustar bdbaddogbdbaddog % scons -Q AttributeError: 'SConsEnvironment' object has no attribute 'SCCS': File "/home/my/project/SConstruct", line 2: env.SourceCode('.', env.SCCS()) scons-src-3.0.0/doc/generated/examples/troubleshoot_tree1_4.xml0000664000175000017500000000225513160023040024574 0ustar bdbaddogbdbaddog % scons -Q --tree=status cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c cc -o prog f1.o f2.o f3.o E = exists R = exists in repository only b = implicit builder B = explicit builder S = side effect P = precious A = always build C = current N = no clean H = no cache [E b ]+-. [E C ] +-SConstruct [E C ] +-f1.c [E B C ] +-f1.o [E C ] | +-f1.c [E C ] | +-inc.h [E C ] +-f2.c [E B C ] +-f2.o [E C ] | +-f2.c [E C ] | +-inc.h [E C ] +-f3.c [E B C ] +-f3.o [E C ] | +-f3.c [E C ] | +-inc.h [E C ] +-inc.h [E B C ] +-prog [E B C ] +-f1.o [E C ] | +-f1.c [E C ] | +-inc.h [E B C ] +-f2.o [E C ] | +-f2.c [E C ] | +-inc.h [E B C ] +-f3.o [E C ] +-f3.c [E C ] +-inc.h scons-src-3.0.0/doc/generated/examples/misc_FindFile1a_1.xml0000664000175000017500000000054113160023040023651 0ustar bdbaddogbdbaddog % scons -Q None <class 'SCons.Node.FS.File'> exists scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/repositories_ex3_1.xml0000664000175000017500000000052613160023040024245 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c /usr/repository2/hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/nodes_ex1_2.xml0000664000175000017500000000070613160023040022625 0ustar bdbaddogbdbaddog C:\>scons -Q cl /Fogoodbye.obj /c goodbye.c -DGOODBYE cl /Fohello.obj /c hello.c -DHELLO link /nologo /OUT:hello.exe hello.obj goodbye.obj embedManifestExeCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/buildersbuiltin_ex1_1.xml0000664000175000017500000000052613160023037024722 0ustar bdbaddogbdbaddog % scons -Q . tar -c -f out1.tar file1 file2 tar -c -f out2.tar directory scons-src-3.0.0/doc/generated/examples/environments_Replace-nonexistent_1.xml0000664000175000017500000000050713160023040027474 0ustar bdbaddogbdbaddog % scons -Q NEW_VARIABLE = xyzzy scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/hierarchy_ex1_prog2_SConscript0000664000175000017500000000012113160023040025722 0ustar bdbaddogbdbaddog env = Environment() env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c']) scons-src-3.0.0/doc/generated/examples/commandline_SetOption_2.xml0000664000175000017500000000056013160023037025236 0ustar bdbaddogbdbaddog % export NUM_CPU="4" % scons -Q running with -j 4 scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/commandline_SetOption_3.xml0000664000175000017500000000071013160023037025234 0ustar bdbaddogbdbaddog % scons -Q -j 7 running with -j 7 scons: `.' is up to date. % export NUM_CPU="4" % scons -Q -j 3 running with -j 3 scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/environments_Prepend-nonexistent_1.xml0000664000175000017500000000050713160023040027516 0ustar bdbaddogbdbaddog % scons -Q NEW_VARIABLE = added scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/builderswriting_ex7_1.xml0000664000175000017500000000051513160023037024743 0ustar bdbaddogbdbaddog % scons -Q foobuild file.foo new_target - file.input new_source scons-src-3.0.0/doc/generated/examples/lesssimple_ex3_1.xml0000664000175000017500000000060613160023040023675 0ustar bdbaddogbdbaddog % scons -Q cc -o file1.o -c file1.c cc -o file2.o -c file2.c cc -o prog.o -c prog.c cc -o program prog.o file1.o file2.o scons-src-3.0.0/doc/generated/examples/depends_ignore_explicit_1.xml0000664000175000017500000000071513160023040025625 0ustar bdbaddogbdbaddog % scons -Q scons: `.' is up to date. % scons -Q hello cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello scons: `hello' is up to date. scons-src-3.0.0/doc/generated/examples/commandline_PathVariable_2.xml0000664000175000017500000000066613160023037025663 0ustar bdbaddogbdbaddog % scons -Q CONFIG=/does/not/exist foo.o scons: *** Path for option CONFIG does not exist: /does/not/exist File "/home/my/project/SConstruct", line 6, in <module> scons-src-3.0.0/doc/generated/examples/output_ex1_1.xml0000664000175000017500000000077513160023040023062 0ustar bdbaddogbdbaddog % scons -h scons: Reading SConscript files ... scons: done reading SConscript files. Type: 'scons program' to build the production program, 'scons debug' to build the debug version. Use scons -H for help about command-line options. scons-src-3.0.0/doc/generated/examples/commandline_BoolVariable_4.xml0000664000175000017500000000052313160023037025654 0ustar bdbaddogbdbaddog % scons -Q RELEASE=f foo.o cc -o foo.o -c -DRELEASE_BUILD=False foo.c scons-src-3.0.0/doc/generated/examples/caching_ex1_5.xml0000664000175000017500000000117513160023037023123 0ustar bdbaddogbdbaddog % scons -Q --cache-disable cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q -c Removed hello.o Removed hello % scons -Q --cache-disable cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q --cache-force scons: `.' is up to date. % scons -Q scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/addmethod_ex1_1.xml0000664000175000017500000000063613160023037023455 0ustar bdbaddogbdbaddog % scons -Q / cc -o hello.o -c hello.c cc -o hello hello.o Install file: "hello" as "/usr/bin/hello" Install file: "hello" as "install/bin/hello" scons-src-3.0.0/doc/generated/examples/depends_ex1_8.xml0000664000175000017500000000065313160023040023146 0ustar bdbaddogbdbaddog % scons -Q --implicit-deps-unchanged hello cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello scons: `hello' is up to date. scons-src-3.0.0/doc/generated/examples/lesssimple_target_2.xml0000664000175000017500000000062513160023040024466 0ustar bdbaddogbdbaddog C:\>scons -Q cl /Fohello.obj /c hello.c /nologo link /nologo /OUT:new_hello.exe hello.obj embedManifestExeCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/builderswriting_MY_EMITTER_1.xml0000664000175000017500000000057213160023037025761 0ustar bdbaddogbdbaddog % scons -Q my_command file1.input modify1.in > file1.foo my_command file2.input modify2.in > file2.foo scons-src-3.0.0/doc/generated/examples/commandline_EnumVariable_ic2_1.xml0000664000175000017500000000077313160023037026426 0ustar bdbaddogbdbaddog % scons -Q COLOR=Red foo.o cc -o foo.o -c -DCOLOR="red" foo.c % scons -Q COLOR=nAvY foo.o cc -o foo.o -c -DCOLOR="blue" foo.c % scons -Q COLOR=GREEN foo.o cc -o foo.o -c -DCOLOR="green" foo.c scons-src-3.0.0/doc/generated/examples/nodes_print_2.xml0000664000175000017500000000071613160023040023265 0ustar bdbaddogbdbaddog C:\>scons -Q The object file is: hello.obj The program file is: hello.exe cl /Fohello.obj /c hello.c /nologo link /nologo /OUT:hello.exe hello.obj embedManifestExeCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/commandline_ARGUMENTS_1.xml0000664000175000017500000000104713160023037024657 0ustar bdbaddogbdbaddog % scons -Q debug=0 cc -o prog.o -c prog.c cc -o prog prog.o % scons -Q debug=0 scons: `.' is up to date. % scons -Q debug=1 cc -o prog.o -c -g prog.c cc -o prog prog.o % scons -Q debug=1 scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/separate_duplicate0_1.xml0000664000175000017500000000066413160023040024660 0ustar bdbaddogbdbaddog % ls src hello.c % scons -Q cc -o build/hello.o -c src/hello.c cc -o build/hello build/hello.o % ls build hello hello.o scons-src-3.0.0/doc/generated/examples/commandline_Default2_1.xml0000664000175000017500000000070313160023037024756 0ustar bdbaddogbdbaddog % scons -Q cc -o prog1.o -c prog1.c cc -o prog1 prog1.o cc -o prog3.o -c prog3.c cc -o prog3 prog3.o % scons -Q . cc -o prog2.o -c prog2.c cc -o prog2 prog2.o scons-src-3.0.0/doc/generated/examples/nodes_print_1.xml0000664000175000017500000000057413160023040023266 0ustar bdbaddogbdbaddog % scons -Q The object file is: hello.o The program file is: hello cc -o hello.o -c hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/sideeffect_simple_1.xml0000664000175000017500000000073513160023040024413 0ustar bdbaddogbdbaddog % scons -Q --jobs=2 File "/home/my/project/SConstruct", line 4 'echo >$TARGET data1; echo >log updated file1')) ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/troubleshoot_tree2_1.xml0000664000175000017500000000243113160023040024566 0ustar bdbaddogbdbaddog % scons -Q --tree=all cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c ar rc libfoo.a f1.o f2.o f3.o ranlib libfoo.a cc -o prog1.o -c -I. prog1.c cc -o prog1 prog1.o -L. -lfoo cc -o prog2.o -c -I. prog2.c cc -o prog2 prog2.o -L. -lfoo +-. +-SConstruct +-f1.c +-f1.o | +-f1.c | +-inc.h +-f2.c +-f2.o | +-f2.c | +-inc.h +-f3.c +-f3.o | +-f3.c | +-inc.h +-inc.h +-libfoo.a | +-f1.o | | +-f1.c | | +-inc.h | +-f2.o | | +-f2.c | | +-inc.h | +-f3.o | +-f3.c | +-inc.h +-prog1 | +-prog1.o | | +-prog1.c | | +-inc.h | +-libfoo.a | +-f1.o | | +-f1.c | | +-inc.h | +-f2.o | | +-f2.c | | +-inc.h | +-f3.o | +-f3.c | +-inc.h +-prog1.c +-prog1.o | +-prog1.c | +-inc.h +-prog2 | +-prog2.o | | +-prog2.c | | +-inc.h | +-libfoo.a | +-f1.o | | +-f1.c | | +-inc.h | +-f2.o | | +-f2.c | | +-inc.h | +-f3.o | +-f3.c | +-inc.h +-prog2.c +-prog2.o +-prog2.c +-inc.h scons-src-3.0.0/doc/generated/examples/nodes_GetBuildPath_1.xml0000664000175000017500000000051513160023040024441 0ustar bdbaddogbdbaddog % scons -Q ['foo.c', 'sub/dir/value'] scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/builderscommands_ex1_1.xml0000664000175000017500000000047613160023037025061 0ustar bdbaddogbdbaddog % scons -Q sed 's/x/y/' < foo.in > foo.out scons-src-3.0.0/doc/generated/examples/separate_builddir_sconscript_1.xml0000664000175000017500000000072713160023040026673 0ustar bdbaddogbdbaddog % ls src SConscript hello.c % scons -Q cc -o build/hello.o -c build/hello.c cc -o build/hello build/hello.o % ls build SConscript hello hello.c hello.o scons-src-3.0.0/doc/generated/examples/environments_ex8_1.xml0000664000175000017500000000051713160023040024252 0ustar bdbaddogbdbaddog % scons -Q cc -o foo.o -c -DMY_VALUE -DLAST foo.c cc -o foo foo.o scons-src-3.0.0/doc/generated/examples/troubleshoot_tree1_3.xml0000664000175000017500000000061713160023040024573 0ustar bdbaddogbdbaddog % scons -Q --tree=all f1.o f3.o cc -o f1.o -c -I. f1.c +-f1.o +-f1.c +-inc.h cc -o f3.o -c -I. f3.c +-f3.o +-f3.c +-inc.h scons-src-3.0.0/doc/generated/examples/factories_Chmod_1.xml0000664000175000017500000000051413160023040024025 0ustar bdbaddogbdbaddog % scons -Q Copy("file.out", "file.in") Chmod("file.out", 0755) scons-src-3.0.0/doc/generated/examples/output_ex2_1.xml0000664000175000017500000000101613160023040023050 0ustar bdbaddogbdbaddog C:\>scons -h scons: Reading SConscript files ... scons: done reading SConscript files. Type: 'scons program' to build the production program. Type: 'scons windebug' to build the Windows debug version. Use scons -H for help about command-line options. scons-src-3.0.0/doc/generated/examples/simple_declarative_1.xml0000664000175000017500000000111613160023040024567 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... Calling Program('hello.c') Calling Program('goodbye.c') Finished calling Program() scons: done reading SConscript files. scons: Building targets ... cc -o goodbye.o -c goodbye.c cc -o goodbye goodbye.o cc -o hello.o -c hello.c cc -o hello hello.o scons: done building targets. scons-src-3.0.0/doc/generated/examples/repositories_quote1_1.xml0000664000175000017500000000055513160023040024766 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c -I. -I/usr/repository1 /usr/repository1/hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/misc_FindFile1d_1.xml0000664000175000017500000000053413160023040023656 0ustar bdbaddogbdbaddog % scons -Q sub1/multiple sub2/multiple sub3/multiple scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/misc_FindFile3_1.xml0000664000175000017500000000047513160023040023520 0ustar bdbaddogbdbaddog % scons -Q build/leaf scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/libraries_ex3_1.xml0000664000175000017500000000054113160023040023467 0ustar bdbaddogbdbaddog % scons -Q cc -o prog.o -c prog.c cc -o prog prog.o -L/usr/lib -L/usr/local/lib -lm scons-src-3.0.0/doc/generated/examples/separate_builddir_sconscript_SConstruct0000664000175000017500000000010213160023040030026 0ustar bdbaddogbdbaddog VariantDir('build', 'src') SConscript('build/SConscript') scons-src-3.0.0/doc/generated/examples/libraries_ex3_2.xml0000664000175000017500000000067513160023040023500 0ustar bdbaddogbdbaddog C:\>scons -Q cl /Foprog.obj /c prog.c /nologo link /nologo /OUT:prog.exe /LIBPATH:\usr\lib /LIBPATH:\usr\local\lib m.lib prog.obj embedManifestExeCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/factories_Touch_1.xml0000664000175000017500000000050613160023040024056 0ustar bdbaddogbdbaddog % scons -Q Copy("file.out", "file.in") Touch("file.out") scons-src-3.0.0/doc/generated/examples/simple_clean_1.xml0000664000175000017500000000121213160023040023363 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... cc -o hello.o -c hello.c cc -o hello hello.o scons: done building targets. % scons -c scons: Reading SConscript files ... scons: done reading SConscript files. scons: Cleaning targets ... Removed hello.o Removed hello scons: done cleaning targets. scons-src-3.0.0/doc/generated/examples/repositories_ex4_1.xml0000664000175000017500000000066413160023040024251 0ustar bdbaddogbdbaddog % cd /usr/repository1 % scons -Q cc -o file1.o -c file1.c cc -o file2.o -c file2.c cc -o hello.o -c hello.c cc -o hello hello.o file1.o file2.o scons-src-3.0.0/doc/generated/examples/libraries_ex2_1.xml0000664000175000017500000000067013160023040023471 0ustar bdbaddogbdbaddog % scons -Q cc -o f1.o -c f1.c cc -o f2.o -c f2.c cc -o f3.o -c f3.c ar rc libfoo.a f1.o f2.o f3.o ranlib libfoo.a cc -o prog.o -c prog.c cc -o prog prog.o -L. -lfoo -lbar scons-src-3.0.0/doc/generated/examples/troubleshoot_Dump_ENV_2.xml0000664000175000017500000000066213160023040025167 0ustar bdbaddogbdbaddog C:\>scons scons: Reading SConscript files ... File "/home/my/project/SConstruct", line 2 print env.Dump('ENV') ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/factories_Copy2_1.xml0000664000175000017500000000046413160023040023773 0ustar bdbaddogbdbaddog % scons -Q Copy("file.out", "file.in") scons-src-3.0.0/doc/generated/examples/install_ex1_1.xml0000664000175000017500000000063213160023040023160 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q /usr/bin Install file: "hello" as "/usr/bin/hello" scons-src-3.0.0/doc/generated/examples/environments_Append-nonexistent_1.xml0000664000175000017500000000050713160023040027330 0ustar bdbaddogbdbaddog % scons -Q NEW_VARIABLE = added scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/depends_newer_1.xml0000664000175000017500000000064313160023040023561 0ustar bdbaddogbdbaddog % scons -Q hello.o cc -o hello.o -c hello.c % touch hello.c % scons -Q hello.o cc -o hello.o -c hello.c scons-src-3.0.0/doc/generated/examples/simple_ex1_2.xml0000664000175000017500000000102213160023040022776 0ustar bdbaddogbdbaddog C:\>scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... cl /Fohello.obj /c hello.c /nologo link /nologo /OUT:hello.exe hello.obj embedManifestExeCheck(target, source, env) scons: done building targets. scons-src-3.0.0/doc/generated/examples/install_ex3_1.xml0000664000175000017500000000073213160023040023163 0ustar bdbaddogbdbaddog % scons -Q install cc -o goodbye.o -c goodbye.c cc -o goodbye goodbye.o Install file: "goodbye" as "/usr/bin/goodbye" cc -o hello.o -c hello.c cc -o hello hello.o Install file: "hello" as "/usr/bin/hello" scons-src-3.0.0/doc/generated/examples/commandline_ListVariable_2.xml0000664000175000017500000000065513160023037025700 0ustar bdbaddogbdbaddog % scons -Q COLORS=all foo.o cc -o foo.o -c -DCOLORS="red green blue" foo.c % scons -Q COLORS=none foo.o cc -o foo.o -c -DCOLORS="" foo.c scons-src-3.0.0/doc/generated/examples/nodes_ex1_1.xml0000664000175000017500000000057613160023040022631 0ustar bdbaddogbdbaddog % scons -Q cc -o goodbye.o -c -DGOODBYE goodbye.c cc -o hello.o -c -DHELLO hello.c cc -o hello hello.o goodbye.o scons-src-3.0.0/doc/generated/examples/buildersbuiltin_ex4_1.xml0000664000175000017500000000047713160023037024732 0ustar bdbaddogbdbaddog % scons -Q . zip(["out.zip"], ["file1", "file2"]) scons-src-3.0.0/doc/generated/examples/output_ex2_2.xml0000664000175000017500000000071513160023040023056 0ustar bdbaddogbdbaddog % scons -h scons: Reading SConscript files ... scons: done reading SConscript files. Type: 'scons program' to build the production program. Use scons -H for help about command-line options. scons-src-3.0.0/doc/generated/examples/output_gbf2_1.xml0000664000175000017500000000101713160023040023173 0ustar bdbaddogbdbaddog % scons -Q scons: `.' is up to date. Build succeeded. % scons -Q fail=1 scons: *** [target] Source `source' not found, needed by target `target'. FAILED!!!! Failed building target: Source `source' not found, needed by target `target'. scons-src-3.0.0/doc/generated/examples/commandline_EnumVariable_3.xml0000664000175000017500000000154113160023037025665 0ustar bdbaddogbdbaddog % scons -Q COLOR=Red foo.o scons: *** Invalid value for option COLOR: Red. Valid values are: ('red', 'green', 'blue') File "/home/my/project/SConstruct", line 5, in <module> % scons -Q COLOR=BLUE foo.o scons: *** Invalid value for option COLOR: BLUE. Valid values are: ('red', 'green', 'blue') File "/home/my/project/SConstruct", line 5, in <module> % scons -Q COLOR=nAvY foo.o scons: *** Invalid value for option COLOR: nAvY. Valid values are: ('red', 'green', 'blue') File "/home/my/project/SConstruct", line 5, in <module> scons-src-3.0.0/doc/generated/examples/hierarchy_ex3_1.xml0000664000175000017500000000074313160023040023475 0ustar bdbaddogbdbaddog % scons -Q cc -o src/prog/foo2.o -c src/prog/foo2.c cc -o src/prog/main.o -c src/prog/main.c cc -o /usr/joe/lib/foo1.o -c /usr/joe/lib/foo1.c cc -o src/prog/prog src/prog/main.o /usr/joe/lib/foo1.o src/prog/foo2.o scons-src-3.0.0/doc/generated/examples/simple_ex1_1.xml0000664000175000017500000000070613160023040023005 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... cc -o hello.o -c hello.c cc -o hello hello.o scons: done building targets. scons-src-3.0.0/doc/generated/examples/mergeflags_MergeFlags3_1.xml0000664000175000017500000000061313160023040025227 0ustar bdbaddogbdbaddog % scons -Q File "/home/my/project/SConstruct", line 5 print env['CCFLAGS'] ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/commandline_PathVariable_1.xml0000664000175000017500000000067313160023037025660 0ustar bdbaddogbdbaddog % scons -Q foo.o cc -o foo.o -c -DCONFIG_FILE="/etc/my_config" foo.c % scons -Q CONFIG=/usr/local/etc/other_config foo.o scons: `foo.o' is up to date. scons-src-3.0.0/doc/generated/examples/libraries_SharedLibrary_2.xml0000664000175000017500000000100613160023040025521 0ustar bdbaddogbdbaddog C:\>scons -Q cl /Fof1.obj /c f1.c /nologo cl /Fof2.obj /c f2.c /nologo cl /Fof3.obj /c f3.c /nologo link /nologo /dll /out:foo.dll /implib:foo.lib f1.obj f2.obj f3.obj RegServerFunc(target, source, env) embedManifestDllCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/troubleshoot_explain3_1.xml0000664000175000017500000000142013160023040025265 0ustar bdbaddogbdbaddog % scons -Q cc -o file1.o -c -I. file1.c cc -o file2.o -c -I. file2.c cc -o file3.o -c -I. file3.c cc -o prog file1.o file2.o file3.o % [CHANGE THE CONTENTS OF hello.h] % scons -Q --debug=explain scons: rebuilding `file1.o' because `hello.h' changed cc -o file1.o -c -I. file1.c scons: rebuilding `file3.o' because `hello.h' changed cc -o file3.o -c -I. file3.c scons: rebuilding `prog' because: `file1.o' changed `file3.o' changed cc -o prog file1.o file2.o file3.o scons-src-3.0.0/doc/generated/examples/parseflags_ex1_2.xml0000664000175000017500000000060413160023040023641 0ustar bdbaddogbdbaddog C:\>scons -Q File "/home/my/project/SConstruct", line 5 print k, v ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/commandline_BoolVariable_3.xml0000664000175000017500000000052413160023037025654 0ustar bdbaddogbdbaddog % scons -Q RELEASE=no foo.o cc -o foo.o -c -DRELEASE_BUILD=False foo.c scons-src-3.0.0/doc/generated/examples/variants_ex_1.xml0000664000175000017500000000153313160023040023261 0ustar bdbaddogbdbaddog % scons -Q OS=linux Install file: "build/linux/world/world.h" as "export/linux/include/world.h" cc -o build/linux/hello/hello.o -c -Iexport/linux/include build/linux/hello/hello.c cc -o build/linux/world/world.o -c -Iexport/linux/include build/linux/world/world.c ar rc build/linux/world/libworld.a build/linux/world/world.o ranlib build/linux/world/libworld.a Install file: "build/linux/world/libworld.a" as "export/linux/lib/libworld.a" cc -o build/linux/hello/hello build/linux/hello/hello.o -Lexport/linux/lib -lworld Install file: "build/linux/hello/hello" as "export/linux/bin/hello" scons-src-3.0.0/doc/generated/examples/separate_ex1_1.xml0000664000175000017500000000072713160023040023323 0ustar bdbaddogbdbaddog % ls src SConscript hello.c % scons -Q cc -o build/hello.o -c build/hello.c cc -o build/hello build/hello.o % ls build SConscript hello hello.c hello.o scons-src-3.0.0/doc/generated/examples/depends_Requires_1.xml0000664000175000017500000000147613160023037024253 0ustar bdbaddogbdbaddog % scons -Q hello cc -o version.o -c version.c cc -o hello.o -c hello.c cc -o hello version.o hello.o % sleep 1 % scons -Q hello cc -o version.o -c version.c scons: `hello' is up to date. % sleep 1 % [CHANGE THE CONTENTS OF hello.c] % scons -Q hello cc -o version.o -c version.c cc -o hello.o -c hello.c cc -o hello version.o hello.o % sleep 1 % scons -Q hello cc -o version.o -c version.c scons: `hello' is up to date. scons-src-3.0.0/doc/generated/examples/factories_Delete2_1.xml0000664000175000017500000000050713160023040024261 0ustar bdbaddogbdbaddog % scons -Q Delete("file.out") Copy("file.out", "file.in") scons-src-3.0.0/doc/generated/examples/environments_Replace2_1.xml0000664000175000017500000000103713160023040025201 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... CCFLAGS = -DDEFINE1 CCFLAGS = -DDEFINE2 scons: done reading SConscript files. scons: Building targets ... cc -o bar.o -c -DDEFINE2 bar.c cc -o bar bar.o cc -o foo.o -c -DDEFINE2 foo.c cc -o foo foo.o scons: done building targets. scons-src-3.0.0/doc/generated/examples/output_Progress-TARGET_1.xml0000664000175000017500000000073113160023040025145 0ustar bdbaddogbdbaddog % scons -Q Evaluating SConstruct Evaluating f1.c Evaluating f1.o cc -o f1.o -c f1.c Evaluating f1 cc -o f1 f1.o Evaluating f2.c Evaluating f2.o cc -o f2.o -c f2.c Evaluating f2 cc -o f2 f2.o Evaluating . scons-src-3.0.0/doc/generated/examples/commandline_EnumVariable_ic1_1.xml0000664000175000017500000000112213160023037026412 0ustar bdbaddogbdbaddog % scons -Q COLOR=Red foo.o cc -o foo.o -c -DCOLOR="Red" foo.c % scons -Q COLOR=BLUE foo.o cc -o foo.o -c -DCOLOR="BLUE" foo.c % scons -Q COLOR=nAvY foo.o cc -o foo.o -c -DCOLOR="blue" foo.c % scons -Q COLOR=green foo.o cc -o foo.o -c -DCOLOR="green" foo.c scons-src-3.0.0/doc/generated/examples/libraries_ex2_2.xml0000664000175000017500000000105513160023040023470 0ustar bdbaddogbdbaddog C:\>scons -Q cl /Fof1.obj /c f1.c /nologo cl /Fof2.obj /c f2.c /nologo cl /Fof3.obj /c f3.c /nologo lib /nologo /OUT:foo.lib f1.obj f2.obj f3.obj cl /Foprog.obj /c prog.c /nologo link /nologo /OUT:prog.exe /LIBPATH:. foo.lib bar.lib prog.obj embedManifestExeCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/depends_ex5_1.xml0000664000175000017500000000055113160023040023140 0ustar bdbaddogbdbaddog % scons -Q hello cc -o hello.o -c -Iinclude -I/home/project/inc hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/builderswriting_ex6_1.xml0000664000175000017500000000047713160023037024751 0ustar bdbaddogbdbaddog % scons -Q foobuild < file.input > file.foo scons-src-3.0.0/doc/generated/examples/builderswriting_ex3_1.xml0000664000175000017500000000055413160023037024742 0ustar bdbaddogbdbaddog % scons -Q foobuild < file.input > file.foo cc -o hello.o -c hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/troubleshoot_Dump_2.xml0000664000175000017500000000065513160023040024461 0ustar bdbaddogbdbaddog C:\>scons scons: Reading SConscript files ... File "/home/my/project/SConstruct", line 2 print env.Dump() ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/factories_Copy3_1.xml0000664000175000017500000000054113160023040023770 0ustar bdbaddogbdbaddog % scons -Q Copy("tempfile", "file.in") modify tempfile Copy("file.out", "tempfile") scons-src-3.0.0/doc/generated/examples/addmethod_ex2_1.xml0000664000175000017500000000053713160023037023456 0ustar bdbaddogbdbaddog % scons -Q cc -o test_stuff.o -c test_stuff.c cc -o tests/test_stuff test_stuff.o scons-src-3.0.0/doc/generated/examples/install_ex2_1.xml0000664000175000017500000000063113160023040023160 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q install Install file: "hello" as "/usr/bin/hello" scons-src-3.0.0/doc/generated/examples/depends_ex1_4.xml0000664000175000017500000000070713160023037023150 0ustar bdbaddogbdbaddog % scons -Q hello cc -o hello.o -c hello.c cc -o hello hello.o % [CHANGE THE CONTENTS OF hello.c] % scons -Q hello cc -o hello.o -c hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/depends_include_SConstruct0000664000175000017500000000005213160023040025226 0ustar bdbaddogbdbaddog Program('hello.c', CPPPATH = '.') scons-src-3.0.0/doc/generated/examples/caching_ex-random_1.xml0000664000175000017500000000063313160023037024312 0ustar bdbaddogbdbaddog % scons -Q cc -o f2.o -c f2.c cc -o f4.o -c f4.c cc -o f3.o -c f3.c cc -o f5.o -c f5.c cc -o f1.o -c f1.c cc -o prog f1.o f2.o f3.o f4.o f5.o scons-src-3.0.0/doc/generated/examples/java_java-classes_2.xml0000664000175000017500000000115513160023040024314 0ustar bdbaddogbdbaddog % scons -Q javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java % scons -Q -c classes Removed classes/Example1.class Removed classes/AdditionalClass1.class Removed classes/Example2$Inner2.class Removed classes/Example2.class Removed classes/Example3.class Removed classes/AdditionalClass3.class scons-src-3.0.0/doc/generated/examples/commandline_Variables_Help_1.xml0000664000175000017500000000062313160023037026171 0ustar bdbaddogbdbaddog % scons -Q -h RELEASE: Set to 1 to build for release default: 0 actual: 0 Use scons -H for help about command-line options. scons-src-3.0.0/doc/generated/examples/lesssimple_target_1.xml0000664000175000017500000000051113160023040024457 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o new_hello hello.o scons-src-3.0.0/doc/generated/examples/buildersbuiltin_libs_2.xml0000664000175000017500000000076713160023037025166 0ustar bdbaddogbdbaddog C:\>scons -Q cl /Fogoodbye.obj /c goodbye.c /nologo cl /Fohello.obj /c hello.c /nologo link /nologo /OUT:hello.exe /LIBPATH:\usr\dir1 /LIBPATH:dir2 foo1.lib foo2.lib hello.obj goodbye.obj embedManifestExeCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/depends_ex1_1.xml0000664000175000017500000000060113160023037023136 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/sideeffect_parallel_1.xml0000664000175000017500000000052513160023040024713 0ustar bdbaddogbdbaddog % scons -Q --jobs=2 echo > file1.out data1 echo > file2.out data2 scons-src-3.0.0/doc/generated/examples/buildersbuiltin_ex2_1.xml0000664000175000017500000000047413160023037024725 0ustar bdbaddogbdbaddog % scons -Q . tar -c -z -f out.tar.gz directory scons-src-3.0.0/doc/generated/examples/sourcecode_rcs_1.xml0000664000175000017500000000065313160023040023742 0ustar bdbaddogbdbaddog % scons -Q AttributeError: 'SConsEnvironment' object has no attribute 'RCS': File "/home/my/project/SConstruct", line 2: env.SourceCode('.', env.RCS()) scons-src-3.0.0/doc/generated/examples/environments_ex1_1.xml0000664000175000017500000000050313160023040024236 0ustar bdbaddogbdbaddog % scons -Q gcc -o foo.o -c -O2 foo.c gcc -o foo foo.o scons-src-3.0.0/doc/generated/examples/parseflags_ex1_1.xml0000664000175000017500000000057713160023040023651 0ustar bdbaddogbdbaddog % scons -Q File "/home/my/project/SConstruct", line 5 print k, v ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/depends_include_1.xml0000664000175000017500000000102513160023040024057 0ustar bdbaddogbdbaddog % scons -Q hello cc -o hello.o -c -I. hello.c cc -o hello hello.o % scons -Q hello scons: `hello' is up to date. % [CHANGE THE CONTENTS OF hello.h] % scons -Q hello cc -o hello.o -c -I. hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/troubleshoot_stacktrace_1.xml0000664000175000017500000000054213160023040025672 0ustar bdbaddogbdbaddog % scons -Q scons: *** [prog.o] Source `prog.c' not found, needed by target `prog.o'. scons-src-3.0.0/doc/generated/examples/environments_Replace1_1.xml0000664000175000017500000000050713160023040025201 0ustar bdbaddogbdbaddog % scons -Q cc -o foo.o -c -DDEFINE2 foo.c cc -o foo foo.o scons-src-3.0.0/doc/generated/examples/factories_Delete1_1.xml0000664000175000017500000000056413160023040024263 0ustar bdbaddogbdbaddog % scons -Q Delete("tempfile") Copy("tempfile", "file.in") modify tempfile Copy("file.out", "tempfile") scons-src-3.0.0/doc/generated/examples/simple_java_1.xml0000664000175000017500000000071113160023040023225 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... javac -d classes -sourcepath src src/hello.java scons: done building targets. scons-src-3.0.0/doc/generated/examples/commandline_BoolVariable_1.xml0000664000175000017500000000052413160023037025652 0ustar bdbaddogbdbaddog % scons -Q RELEASE=yes foo.o cc -o foo.o -c -DRELEASE_BUILD=True foo.c scons-src-3.0.0/doc/generated/examples/commandline_DEFAULT_TARGETS_1_1.xml0000664000175000017500000000074313160023037026011 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... DEFAULT_TARGETS is ['prog1'] scons: done reading SConscript files. scons: Building targets ... cc -o prog1.o -c prog1.c cc -o prog1 prog1.o scons: done building targets. scons-src-3.0.0/doc/generated/examples/commandline_EnumVariable_2.xml0000664000175000017500000000071313160023037025664 0ustar bdbaddogbdbaddog % scons -Q COLOR=magenta foo.o scons: *** Invalid value for option COLOR: magenta. Valid values are: ('red', 'green', 'blue') File "/home/my/project/SConstruct", line 5, in <module> scons-src-3.0.0/doc/generated/examples/depends_ex1_2.xml0000664000175000017500000000062113160023037023141 0ustar bdbaddogbdbaddog % scons -Q hello cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello scons: `hello' is up to date. scons-src-3.0.0/doc/generated/examples/environments_ex6b_2.xml0000664000175000017500000000062213160023040024410 0ustar bdbaddogbdbaddog C:\>scons -Q key = OBJSUFFIX, value = .obj key = LIBSUFFIX, value = .lib key = PROGSUFFIX, value = .exe scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/variants_ex_2.xml0000664000175000017500000000171413160023040023263 0ustar bdbaddogbdbaddog C:\>scons -Q OS=windows Install file: "build/windows/world/world.h" as "export/windows/include/world.h" cl /Fobuild\windows\hello\hello.obj /c build\windows\hello\hello.c /nologo /Iexport\windows\include cl /Fobuild\windows\world\world.obj /c build\windows\world\world.c /nologo /Iexport\windows\include lib /nologo /OUT:build\windows\world\world.lib build\windows\world\world.obj Install file: "build/windows/world/world.lib" as "export/windows/lib/world.lib" link /nologo /OUT:build\windows\hello\hello.exe /LIBPATH:export\windows\lib world.lib build\windows\hello\hello.obj embedManifestExeCheck(target, source, env) Install file: "build/windows/hello/hello.exe" as "export/windows/bin/hello.exe" scons-src-3.0.0/doc/generated/examples/environments_missing1_1.xml0000664000175000017500000000050713160023040025277 0ustar bdbaddogbdbaddog % scons -Q value is: -><- scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/parseflags_ex3_1.xml0000664000175000017500000000057713160023040023653 0ustar bdbaddogbdbaddog % scons -Q File "/home/my/project/SConstruct", line 5 print k, v ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/libraries_ex1_2.xml0000664000175000017500000000064213160023040023470 0ustar bdbaddogbdbaddog C:\>scons -Q cl /Fof1.obj /c f1.c /nologo cl /Fof2.obj /c f2.c /nologo cl /Fof3.obj /c f3.c /nologo lib /nologo /OUT:foo.lib f1.obj f2.obj f3.obj scons-src-3.0.0/doc/generated/examples/builderswriting_ex4_1.xml0000664000175000017500000000055213160023037024741 0ustar bdbaddogbdbaddog % scons -Q foobuild < file1.input > file1.foo foobuild < file2.input > file2.foo scons-src-3.0.0/doc/generated/examples/builderswriting_ex1_1.xml0000664000175000017500000000047713160023037024744 0ustar bdbaddogbdbaddog % scons -Q foobuild < file.input > file.foo scons-src-3.0.0/doc/generated/examples/caching_ex1_4.xml0000664000175000017500000000121013160023037023110 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q -c Removed hello.o Removed hello % scons -Q Retrieved `hello.o' from cache Retrieved `hello' from cache % scons -Q -c Removed hello.o Removed hello % scons -Q --cache-disable cc -o hello.o -c hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/libraries_ex1_1.xml0000664000175000017500000000057713160023040023476 0ustar bdbaddogbdbaddog % scons -Q cc -o f1.o -c f1.c cc -o f2.o -c f2.c cc -o f3.o -c f3.c ar rc libfoo.a f1.o f2.o f3.o ranlib libfoo.a scons-src-3.0.0/doc/generated/examples/misc_Flatten2_1.xml0000664000175000017500000000064313160023040023431 0ustar bdbaddogbdbaddog % scons -Q AttributeError: 'NodeList' object has no attribute 'abspath': File "/home/my/project/SConstruct", line 8: print(object_file.abspath) scons-src-3.0.0/doc/generated/examples/sourcecode_bitkeeper_1.xml0000664000175000017500000000066713160023040025132 0ustar bdbaddogbdbaddog % scons -Q AttributeError: 'SConsEnvironment' object has no attribute 'BitKeeper': File "/home/my/project/SConstruct", line 2: env.SourceCode('.', env.BitKeeper()) scons-src-3.0.0/doc/generated/examples/java_jar2_1.xml0000664000175000017500000000107013160023040022571 0ustar bdbaddogbdbaddog % scons -Q javac -d classes -sourcepath prog1 prog1/Example1.java prog1/Example2.java javac -d classes -sourcepath prog2 prog2/Example3.java prog2/Example4.java jar cf prog1.jar -C classes Example1.class -C classes Example2.class jar cf prog2.jar -C classes Example3.class -C classes Example4.class scons-src-3.0.0/doc/generated/examples/fileremoval_noclean-ex1_1.xml0000664000175000017500000000107413160023040025435 0ustar bdbaddogbdbaddog % scons -Q cc -o f1.o -c f1.c cc -o f2.o -c f2.c cc -o f3.o -c f3.c ar rc libfoo.a f1.o f2.o f3.o % scons -c scons: Reading SConscript files ... scons: done reading SConscript files. scons: Cleaning targets ... Removed f1.o Removed f2.o Removed f3.o scons: done cleaning targets. scons-src-3.0.0/doc/generated/examples/simple_Object_1.xml0000664000175000017500000000066213160023040023517 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... cc -o hello.o -c hello.c scons: done building targets. scons-src-3.0.0/doc/generated/examples/troubleshoot_tree1_1.xml0000664000175000017500000000122513160023040024565 0ustar bdbaddogbdbaddog % scons -Q --tree=all cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c cc -o prog f1.o f2.o f3.o +-. +-SConstruct +-f1.c +-f1.o | +-f1.c | +-inc.h +-f2.c +-f2.o | +-f2.c | +-inc.h +-f3.c +-f3.o | +-f3.c | +-inc.h +-inc.h +-prog +-f1.o | +-f1.c | +-inc.h +-f2.o | +-f2.c | +-inc.h +-f3.o +-f3.c +-inc.h scons-src-3.0.0/doc/generated/examples/simple_Object_2.xml0000664000175000017500000000070113160023040023512 0ustar bdbaddogbdbaddog C:\>scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... cl /Fohello.obj /c hello.c /nologo scons: done building targets. scons-src-3.0.0/doc/generated/examples/misc_FindFile2_1.xml0000664000175000017500000000047313160023040023515 0ustar bdbaddogbdbaddog % scons -Q leaf derived cat > derived leaf scons-src-3.0.0/doc/generated/examples/commandline_SetOption_1.xml0000664000175000017500000000050413160023037025233 0ustar bdbaddogbdbaddog % scons -Q running with -j 2 scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/lesssimple_ex4_1.xml0000664000175000017500000000060313160023040023673 0ustar bdbaddogbdbaddog % scons -Q cc -o bar1.o -c bar1.c cc -o bar2.o -c bar2.c cc -o bar bar1.o bar2.o cc -o foo.o -c foo.c cc -o foo foo.o scons-src-3.0.0/doc/generated/examples/java_JAVACLASSDIR_1.xml0000664000175000017500000000074513160023040023611 0ustar bdbaddogbdbaddog % scons -Q javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java javah -d native -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3 scons-src-3.0.0/doc/generated/examples/misc_FindFile1b_1.xml0000664000175000017500000000063113160023040023652 0ustar bdbaddogbdbaddog % scons -Q nonesuch.h: None config.h: config.h private.h: src/include/private.h dist.h: include/dist.h scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/java_RMIC_1.xml0000664000175000017500000000067113160023040022473 0ustar bdbaddogbdbaddog % scons -Q javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java rmic -d outdir -classpath classes pkg.sub.Example1 pkg.sub.Example2 scons-src-3.0.0/doc/generated/examples/environments_ex5_1.xml0000664000175000017500000000065413160023040024251 0ustar bdbaddogbdbaddog % scons -Q gcc -o foo.o -c foo.c gcc -o foo foo.o gcc -o foo-dbg.o -c -g foo.c gcc -o foo-dbg foo-dbg.o gcc -o foo-opt.o -c -O2 foo.c gcc -o foo-opt foo-opt.o scons-src-3.0.0/doc/generated/examples/commandline_PackageVariable_1.xml0000664000175000017500000000117213160023037026312 0ustar bdbaddogbdbaddog % scons -Q foo.o cc -o foo.o -c -DPACKAGE="/opt/location" foo.c % scons -Q PACKAGE=/usr/local/location foo.o cc -o foo.o -c -DPACKAGE="/usr/local/location" foo.c % scons -Q PACKAGE=yes foo.o cc -o foo.o -c -DPACKAGE="True" foo.c % scons -Q PACKAGE=no foo.o cc -o foo.o -c -DPACKAGE="False" foo.c scons-src-3.0.0/doc/generated/examples/java_java-classes_1.xml0000664000175000017500000000067113160023040024315 0ustar bdbaddogbdbaddog % scons -Q javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java % scons -Q classes scons: `classes' is up to date. scons-src-3.0.0/doc/generated/examples/depends_ex1_7.xml0000664000175000017500000000065113160023040023143 0ustar bdbaddogbdbaddog % scons -Q --implicit-deps-changed hello cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello scons: `hello' is up to date. scons-src-3.0.0/doc/generated/examples/commandline_Variables_custom_py_2_1.xml0000664000175000017500000000057413160023037027551 0ustar bdbaddogbdbaddog % scons -Q cc -o bar.o -c -DRELEASE_BUILD=0 bar.c cc -o foo.o -c -DRELEASE_BUILD=0 foo.c cc -o foo foo.o bar.o scons-src-3.0.0/doc/generated/examples/sourcecode_cvs_1.xml0000664000175000017500000000067313160023040023750 0ustar bdbaddogbdbaddog % scons -Q AttributeError: 'SConsEnvironment' object has no attribute 'CVS': File "/home/my/project/SConstruct", line 2: env.SourceCode('.', env.CVS('/usr/local/CVS')) scons-src-3.0.0/doc/generated/examples/factories_Move_1.xml0000664000175000017500000000054113160023040023701 0ustar bdbaddogbdbaddog % scons -Q Copy("tempfile", "file.in") modify tempfile Move("file.out", "tempfile") scons-src-3.0.0/doc/generated/examples/buildersbuiltin_ex3_1.xml0000664000175000017500000000047113160023037024723 0ustar bdbaddogbdbaddog % scons -Q . tar -c -z -f out.tgz directory scons-src-3.0.0/doc/generated/examples/repositories_CPPPATH_1.xml0000664000175000017500000000053413160023040024644 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c -I. -I/usr/repository1 hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/depends_ex1_5.xml0000664000175000017500000000071413160023037023147 0ustar bdbaddogbdbaddog % scons -Q hello cc -o hello.o -c hello.c cc -o hello hello.o % [CHANGE A COMMENT IN hello.c] % scons -Q hello cc -o hello.o -c hello.c scons: `hello' is up to date. scons-src-3.0.0/doc/generated/examples/commandline_Variables_custom_py_1_custom.py0000664000175000017500000000002613160023037030542 0ustar bdbaddogbdbaddog RELEASE = 1 scons-src-3.0.0/doc/generated/examples/fileremoval_clean-ex1_1.xml0000664000175000017500000000056513160023040025104 0ustar bdbaddogbdbaddog % scons -Q build -o foo.out foo.in % scons -Q -c Removed foo.out Removed foo.log scons-src-3.0.0/doc/generated/examples/commandline_ListVariable_3.xml0000664000175000017500000000067413160023037025702 0ustar bdbaddogbdbaddog % scons -Q COLORS=magenta foo.o scons: *** Error converting option: COLORS Invalid value(s) for option: magenta File "/home/my/project/SConstruct", line 5, in <module> scons-src-3.0.0/doc/generated/examples/java_java_1.xml0000664000175000017500000000055713160023040022665 0ustar bdbaddogbdbaddog % scons -Q javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java scons-src-3.0.0/doc/generated/examples/repositories_ex2_1.xml0000664000175000017500000000052613160023040024244 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c /usr/repository1/hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/factories_Mkdir_1.xml0000664000175000017500000000073313160023040024044 0ustar bdbaddogbdbaddog % scons -Q Delete("tempdir") Mkdir("tempdir") Copy("tempdir/file.in", "file.in") process tempdir Move("file.out", "tempdir/output_file") scons: *** [file.out] tempdir/output_file: No such file or directory scons-src-3.0.0/doc/generated/examples/troubleshoot_explain1_1.xml0000664000175000017500000000063313160023040025270 0ustar bdbaddogbdbaddog % scons -Q cp file.in file.oout % scons -Q cp file.in file.oout % scons -Q cp file.in file.oout scons-src-3.0.0/doc/generated/examples/troubleshoot_taskmastertrace_1.xml0000664000175000017500000000650013160023040026743 0ustar bdbaddogbdbaddog % scons -Q --taskmastertrace=- prog Taskmaster: Looking for a node to evaluate Taskmaster: Considering node <no_state 0 'prog'> and its children: Taskmaster: <no_state 0 'prog.o'> Taskmaster: adjusted ref count: <pending 1 'prog'>, child 'prog.o' Taskmaster: Considering node <no_state 0 'prog.o'> and its children: Taskmaster: <no_state 0 'prog.c'> Taskmaster: <no_state 0 'inc.h'> Taskmaster: adjusted ref count: <pending 1 'prog.o'>, child 'prog.c' Taskmaster: adjusted ref count: <pending 2 'prog.o'>, child 'inc.h' Taskmaster: Considering node <no_state 0 'prog.c'> and its children: Taskmaster: Evaluating <pending 0 'prog.c'> Task.make_ready_current(): node <pending 0 'prog.c'> Task.prepare(): node <up_to_date 0 'prog.c'> Task.executed_with_callbacks(): node <up_to_date 0 'prog.c'> Task.postprocess(): node <up_to_date 0 'prog.c'> Task.postprocess(): removing <up_to_date 0 'prog.c'> Task.postprocess(): adjusted parent ref count <pending 1 'prog.o'> Taskmaster: Looking for a node to evaluate Taskmaster: Considering node <no_state 0 'inc.h'> and its children: Taskmaster: Evaluating <pending 0 'inc.h'> Task.make_ready_current(): node <pending 0 'inc.h'> Task.prepare(): node <up_to_date 0 'inc.h'> Task.executed_with_callbacks(): node <up_to_date 0 'inc.h'> Task.postprocess(): node <up_to_date 0 'inc.h'> Task.postprocess(): removing <up_to_date 0 'inc.h'> Task.postprocess(): adjusted parent ref count <pending 0 'prog.o'> Taskmaster: Looking for a node to evaluate Taskmaster: Considering node <pending 0 'prog.o'> and its children: Taskmaster: <up_to_date 0 'prog.c'> Taskmaster: <up_to_date 0 'inc.h'> Taskmaster: Evaluating <pending 0 'prog.o'> Task.make_ready_current(): node <pending 0 'prog.o'> Task.prepare(): node <executing 0 'prog.o'> Task.execute(): node <executing 0 'prog.o'> cc -o prog.o -c -I. prog.c Task.executed_with_callbacks(): node <executing 0 'prog.o'> Task.postprocess(): node <executed 0 'prog.o'> Task.postprocess(): removing <executed 0 'prog.o'> Task.postprocess(): adjusted parent ref count <pending 0 'prog'> Taskmaster: Looking for a node to evaluate Taskmaster: Considering node <pending 0 'prog'> and its children: Taskmaster: <executed 0 'prog.o'> Taskmaster: Evaluating <pending 0 'prog'> Task.make_ready_current(): node <pending 0 'prog'> Task.prepare(): node <executing 0 'prog'> Task.execute(): node <executing 0 'prog'> cc -o prog prog.o Task.executed_with_callbacks(): node <executing 0 'prog'> Task.postprocess(): node <executed 0 'prog'> Taskmaster: Looking for a node to evaluate Taskmaster: No candidate anymore. scons-src-3.0.0/doc/generated/examples/depends_ex1_3.xml0000664000175000017500000000067013160023037023146 0ustar bdbaddogbdbaddog % scons -Q hello cc -o hello.o -c hello.c cc -o hello hello.o % touch hello.c % scons -Q hello scons: `hello' is up to date. scons-src-3.0.0/doc/generated/examples/builderswriting_ex5_1.xml0000664000175000017500000000050513160023037024740 0ustar bdbaddogbdbaddog % scons -Q build_function(["file.foo"], ["file.input"]) scons-src-3.0.0/doc/generated/examples/depends_parsedep_1.xml0000664000175000017500000000071013160023040024237 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c -MD -MF hello.d -I. hello.c cc -o hello hello.o % [CHANGE CONTENTS OF foo.h] % scons -Q cc -o hello.o -c -MD -MF hello.d -I. hello.c scons-src-3.0.0/doc/generated/examples/EnumVariable_map_1.xml0000664000175000017500000000051513160023037024152 0ustar bdbaddogbdbaddog % scons -Q COLOR=navy foo.o cc -o foo.o -c -DCOLOR="blue" foo.c scons-src-3.0.0/doc/generated/examples/environments_ex4_1.xml0000664000175000017500000000060113160023040024240 0ustar bdbaddogbdbaddog % scons -Q cc -o foo-dbg.o -c -g foo.c cc -o foo-dbg foo-dbg.o cc -o foo-opt.o -c -O2 foo.c cc -o foo-opt foo-opt.o scons-src-3.0.0/doc/generated/examples/commandline_AddOption_1.xml0000664000175000017500000000050713160023037025173 0ustar bdbaddogbdbaddog % scons -Q -n Install file: "foo.in" as "/usr/bin/foo.in" scons-src-3.0.0/doc/generated/examples/depends_macroinc_1.xml0000664000175000017500000000064513160023040024236 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c -I. hello.c cc -o hello hello.o % [CHANGE CONTENTS OF foo.h] % scons -Q scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/troubleshoot_explain2_1.xml0000664000175000017500000000120413160023040025264 0ustar bdbaddogbdbaddog % scons -Q cc -o file1.o -c file1.c cc -o file2.o -c file2.c cc -o file3.o -c file3.c cc -o prog file1.o file2.o file3.o % [CHANGE THE CONTENTS OF file2.c] % scons -Q --debug=explain scons: rebuilding `file2.o' because `file2.c' changed cc -o file2.o -c file2.c scons: rebuilding `prog' because `file2.o' changed cc -o prog file1.o file2.o file3.o scons-src-3.0.0/doc/generated/examples/repositories_ex1_1.xml0000664000175000017500000000050513160023040024240 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/caching_ex1_1.xml0000664000175000017500000000074613160023037023122 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q -c Removed hello.o Removed hello % scons -Q Retrieved `hello.o' from cache Retrieved `hello' from cache scons-src-3.0.0/doc/generated/examples/environments_ex3_1.xml0000664000175000017500000000273113160023040024245 0ustar bdbaddogbdbaddog % scons -Q UnicodeDecodeError: 'utf8' codec can't decode byte 0xc2 in position 547: invalid continuation byte: File "/home/my/project/SConstruct", line 6: dbg.Program('foo', 'foo.c') File "bootstrap/src/engine/SCons/Environment.py", line 260: return MethodWrapper.__call__(self, target, source, *args, **kw) File "bootstrap/src/engine/SCons/Environment.py", line 224: return self.method(*nargs, **kwargs) File "bootstrap/src/engine/SCons/Builder.py", line 635: return self._execute(env, target, source, OverrideWarner(kw), ekw) File "bootstrap/src/engine/SCons/Builder.py", line 541: source = self.src_builder_sources(env, source, overwarn) File "bootstrap/src/engine/SCons/Builder.py", line 748: tlist = bld._execute(env, None, [s], overwarn) File "bootstrap/src/engine/SCons/Builder.py", line 557: _node_errors(self, env, tlist, slist) File "bootstrap/src/engine/SCons/Builder.py", line 303: msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents.decode('utf-8'),contents.decode('utf-8')) File "/usr/lib/python2.7/encodings/utf_8.py", line 16: return codecs.utf_8_decode(input, errors, True) scons-src-3.0.0/doc/generated/examples/parseflags_ex2_1.xml0000664000175000017500000000057713160023040023652 0ustar bdbaddogbdbaddog % scons -Q File "/home/my/project/SConstruct", line 5 print k, v ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/depends_match_1.xml0000664000175000017500000000066313160023040023537 0ustar bdbaddogbdbaddog % scons -Q hello.o cc -o hello.o -c hello.c % touch -t 198901010000 hello.c % scons -Q hello.o cc -o hello.o -c hello.c scons-src-3.0.0/doc/generated/examples/commandline_BoolVariable_5.xml0000664000175000017500000000070713160023037025661 0ustar bdbaddogbdbaddog % scons -Q RELEASE=bad_value foo.o scons: *** Error converting option: RELEASE Invalid value for boolean option: bad_value File "/home/my/project/SConstruct", line 4, in <module> scons-src-3.0.0/doc/generated/examples/alias_ex2_1.xml0000664000175000017500000000156513160023037022620 0ustar bdbaddogbdbaddog % scons -Q install-bin cc -o foo.o -c foo.c cc -o foo foo.o Install file: "foo" as "/usr/bin/foo" % scons -Q install-lib cc -o bar.o -c bar.c ar rc libbar.a bar.o ranlib libbar.a Install file: "libbar.a" as "/usr/lib/libbar.a" % scons -Q -c / Removed foo.o Removed foo Removed /usr/bin/foo Removed bar.o Removed libbar.a Removed /usr/lib/libbar.a % scons -Q install cc -o foo.o -c foo.c cc -o foo foo.o Install file: "foo" as "/usr/bin/foo" cc -o bar.o -c bar.c ar rc libbar.a bar.o ranlib libbar.a Install file: "libbar.a" as "/usr/lib/libbar.a" scons-src-3.0.0/doc/generated/examples/commandline_BoolVariable_2.xml0000664000175000017500000000052213160023037025651 0ustar bdbaddogbdbaddog % scons -Q RELEASE=t foo.o cc -o foo.o -c -DRELEASE_BUILD=True foo.c scons-src-3.0.0/doc/generated/examples/java_javah_1.xml0000664000175000017500000000074513160023040023034 0ustar bdbaddogbdbaddog % scons -Q javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java javah -d native -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3 scons-src-3.0.0/doc/generated/examples/commandline_Default3_1.xml0000664000175000017500000000113013160023037024752 0ustar bdbaddogbdbaddog % scons -Q cc -o prog1/foo.o -c prog1/foo.c cc -o prog1/main.o -c prog1/main.c cc -o prog1/main prog1/main.o prog1/foo.o % scons -Q scons: `prog1' is up to date. % scons -Q . cc -o prog2/bar.o -c prog2/bar.c cc -o prog2/main.o -c prog2/main.c cc -o prog2/main prog2/main.o prog2/bar.o scons-src-3.0.0/doc/generated/examples/caching_ex1_2.xml0000664000175000017500000000074413160023037023121 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q -c Removed hello.o Removed hello % scons -Q --cache-show cc -o hello.o -c hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/lesssimple_ex5_1.xml0000664000175000017500000000074513160023040023703 0ustar bdbaddogbdbaddog % scons -Q cc -o bar1.o -c bar1.c cc -o bar2.o -c bar2.c cc -o common1.o -c common1.c cc -o common2.o -c common2.c cc -o bar bar1.o bar2.o common1.o common2.o cc -o foo.o -c foo.c cc -o foo foo.o common1.o common2.o scons-src-3.0.0/doc/generated/examples/environments_missing2_1.xml0000664000175000017500000000062413160023040025300 0ustar bdbaddogbdbaddog % scons -Q scons: *** NameError `MISSING' trying to evaluate `$MISSING' File "/home/my/project/SConstruct", line 3, in <module> scons-src-3.0.0/doc/generated/examples/hierarchy_ex1_prog1_SConscript0000664000175000017500000000012113160023040025721 0ustar bdbaddogbdbaddog env = Environment() env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c']) scons-src-3.0.0/doc/generated/examples/sideeffect_shared_1.xml0000664000175000017500000000057313160023040024370 0ustar bdbaddogbdbaddog % scons -Q --jobs=2 ./build --log logfile.txt file1.in file1.out ./build --log logfile.txt file2.in file2.out scons-src-3.0.0/doc/generated/examples/misc_Flatten1_1.xml0000664000175000017500000000055413160023040023431 0ustar bdbaddogbdbaddog % scons -Q cc -o prog1.o -c prog1.c cc -o prog2.o -c -DFOO prog2.c cc -o prog1 prog1.o prog2.o scons-src-3.0.0/doc/generated/examples/commandline_Variables_custom_py_1_1.xml0000664000175000017500000000057413160023037027550 0ustar bdbaddogbdbaddog % scons -Q cc -o bar.o -c -DRELEASE_BUILD=1 bar.c cc -o foo.o -c -DRELEASE_BUILD=1 foo.c cc -o foo foo.o bar.o scons-src-3.0.0/doc/generated/examples/java_jar1_1.xml0000664000175000017500000000070413160023040022573 0ustar bdbaddogbdbaddog % scons -Q javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java scons: *** [test.jar] Source `classes.class' not found, needed by target `test.jar'. scons-src-3.0.0/doc/generated/examples/depends_include_hello.h0000664000175000017500000000004213160023040024447 0ustar bdbaddogbdbaddog #define string "world" scons-src-3.0.0/doc/generated/examples/separate_glob_builddir_sconscript_1.xml0000664000175000017500000000101513160023040027665 0ustar bdbaddogbdbaddog % ls src SConscript f1.c f2.c f2.h % scons -Q cc -o build/f1.o -c build/f1.c cc -o build/f2.o -c build/f2.c cc -o build/hello build/f1.o build/f2.o % ls build SConscript f1.c f1.o f2.c f2.h f2.o hello scons-src-3.0.0/doc/generated/examples/misc_FindFile2_2.xml0000664000175000017500000000047313160023040023516 0ustar bdbaddogbdbaddog % scons -Q leaf derived cat > derived leaf scons-src-3.0.0/doc/generated/examples/commandline_ARGLIST_1.xml0000664000175000017500000000063313160023037024417 0ustar bdbaddogbdbaddog % scons -Q define=FOO cc -o prog.o -c -DFOO prog.c % scons -Q define=FOO define=BAR cc -o prog.o -c -DFOO -DBAR prog.c scons-src-3.0.0/doc/generated/examples/java_javah_file_1.xml0000664000175000017500000000074713160023040024035 0ustar bdbaddogbdbaddog % scons -Q javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java javah -o native.h -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3 scons-src-3.0.0/doc/generated/examples/commandline_SCONSFLAGS_1.xml0000664000175000017500000000103613160023037024752 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... ... [build output] ... scons: done building targets. % export SCONSFLAGS="-Q" % scons ... [build output] ... scons-src-3.0.0/doc/generated/examples/hierarchy_ex1_1.xml0000664000175000017500000000113413160023040023466 0ustar bdbaddogbdbaddog % scons -Q cc -o prog1/foo1.o -c prog1/foo1.c cc -o prog1/foo2.o -c prog1/foo2.c cc -o prog1/main.o -c prog1/main.c cc -o prog1/prog1 prog1/main.o prog1/foo1.o prog1/foo2.o cc -o prog2/bar1.o -c prog2/bar1.c cc -o prog2/bar2.o -c prog2/bar2.c cc -o prog2/main.o -c prog2/main.c cc -o prog2/prog2 prog2/main.o prog2/bar1.o prog2/bar2.o scons-src-3.0.0/doc/generated/examples/factories_Execute_1.xml0000664000175000017500000000072313160023040024377 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... Mkdir("/tmp/my_temp_directory") scons: done reading SConscript files. scons: Building targets ... scons: `.' is up to date. scons: done building targets. scons-src-3.0.0/doc/generated/examples/buildersbuiltin_libs_1.xml0000664000175000017500000000061513160023037025155 0ustar bdbaddogbdbaddog % scons -Q cc -o goodbye.o -c goodbye.c cc -o hello.o -c hello.c cc -o hello hello.o goodbye.o -L/usr/dir1 -Ldir2 -lfoo1 -lfoo2 scons-src-3.0.0/doc/generated/examples/troubleshoot_explain1_3.xml0000664000175000017500000000073513160023040025275 0ustar bdbaddogbdbaddog % scons -Q --warn=target-not-built cp file.in file.oout scons: warning: Cannot find target file.out after building File "/home/bdbaddog/devel/scons/as_scons/src/script/scons.py", line 201, in <module> scons-src-3.0.0/doc/generated/examples/commandline_UnknownVariables_1.xml0000664000175000017500000000050713160023037026602 0ustar bdbaddogbdbaddog % scons -Q NOT_KNOWN=foo Unknown variables: ['NOT_KNOWN'] scons-src-3.0.0/doc/generated/examples/environments_ex6_1.xml0000664000175000017500000000047413160023040024252 0ustar bdbaddogbdbaddog % scons -Q CC is: cc scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/hierarchy_ex2_1.xml0000664000175000017500000000071013160023040023466 0ustar bdbaddogbdbaddog % scons -Q cc -o lib/foo1.o -c lib/foo1.c cc -o src/prog/foo2.o -c src/prog/foo2.c cc -o src/prog/main.o -c src/prog/main.c cc -o src/prog/prog src/prog/main.o lib/foo1.o src/prog/foo2.o scons-src-3.0.0/doc/generated/examples/troubleshoot_findlibs_1.xml0000664000175000017500000000145013160023040025337 0ustar bdbaddogbdbaddog % scons -Q --debug=findlibs findlibs: looking for 'libfoo.a' in 'libs1' ... findlibs: ... FOUND 'libfoo.a' in 'libs1' findlibs: looking for 'libfoo.so' in 'libs1' ... findlibs: looking for 'libfoo.so' in 'libs2' ... findlibs: looking for 'libbar.a' in 'libs1' ... findlibs: looking for 'libbar.a' in 'libs2' ... findlibs: ... FOUND 'libbar.a' in 'libs2' findlibs: looking for 'libbar.so' in 'libs1' ... findlibs: looking for 'libbar.so' in 'libs2' ... cc -o prog.o -c prog.c cc -o prog prog.o -Llibs1 -Llibs2 -lfoo -lbar scons-src-3.0.0/doc/generated/examples/mergeflags_MergeFlags1_1.xml0000664000175000017500000000061313160023040025225 0ustar bdbaddogbdbaddog % scons -Q File "/home/my/project/SConstruct", line 5 print env['CCFLAGS'] ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/tasks_ex1_main.cpp0000664000175000017500000000002413160023040023400 0ustar bdbaddogbdbaddog #include "test.h" scons-src-3.0.0/doc/generated/examples/lesssimple_ex2_1.xml0000664000175000017500000000060313160023040023671 0ustar bdbaddogbdbaddog % scons -Q cc -o file1.o -c file1.c cc -o file2.o -c file2.c cc -o prog.o -c prog.c cc -o prog prog.o file1.o file2.o scons-src-3.0.0/doc/generated/examples/depends_ex5_2.xml0000664000175000017500000000067113160023040023144 0ustar bdbaddogbdbaddog C:\>scons -Q hello.exe cl /Fohello.obj /c hello.c /nologo /Iinclude /I\home\project\inc link /nologo /OUT:hello.exe hello.obj embedManifestExeCheck(target, source, env) scons-src-3.0.0/doc/generated/examples/commandline_ListVariable_1.xml0000664000175000017500000000070413160023037025672 0ustar bdbaddogbdbaddog % scons -Q COLORS=red,blue foo.o cc -o foo.o -c -DCOLORS="red blue" foo.c % scons -Q COLORS=blue,green,red foo.o cc -o foo.o -c -DCOLORS="blue green red" foo.c scons-src-3.0.0/doc/generated/examples/repositories_CPPPATH3_1.xml0000664000175000017500000000063413160023040024730 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c -Idir1 -I/r1/dir1 -I/r2/dir1 -Idir2 -I/r1/dir2 -I/r2/dir2 -Idir3 -I/r1/dir3 -I/r2/dir3 hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/commandline_Default1_1.xml0000664000175000017500000000074413160023037024762 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q scons: `hello' is up to date. % scons -Q goodbye cc -o goodbye.o -c goodbye.c cc -o goodbye goodbye.o scons-src-3.0.0/doc/generated/examples/depends_AlwaysBuild_2.xml0000664000175000017500000000061713160023037024671 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello.o scons: `hello.o' is up to date. scons-src-3.0.0/doc/generated/examples/nodes_exists_1.xml0000664000175000017500000000053313160023040023444 0ustar bdbaddogbdbaddog % scons -Q hello does not exist! cc -o hello.o -c hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/environments_ex6b_1.xml0000664000175000017500000000060513160023040024410 0ustar bdbaddogbdbaddog % scons -Q key = OBJSUFFIX, value = .o key = LIBSUFFIX, value = .a key = PROGSUFFIX, value = scons: `.' is up to date. scons-src-3.0.0/doc/generated/examples/depends_AlwaysBuild_1.xml0000664000175000017500000000057313160023037024671 0ustar bdbaddogbdbaddog % scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/environments_ex9_1.xml0000664000175000017500000000052013160023040024245 0ustar bdbaddogbdbaddog % scons -Q cc -o foo.o -c -DFIRST -DMY_VALUE foo.c cc -o foo foo.o scons-src-3.0.0/doc/generated/examples/tasks_ex1_1.xml0000664000175000017500000000060513160023040022637 0ustar bdbaddogbdbaddog % scons -Q cat < test.bar > test.h cc -o app main.cpp cat < foo.bar2 > foo.cpp cc -o app2 main2.cpp foo.cpp scons-src-3.0.0/doc/generated/examples/mergeflags_MergeFlags2_1.xml0000664000175000017500000000061313160023040025226 0ustar bdbaddogbdbaddog % scons -Q File "/home/my/project/SConstruct", line 5 print env['CPPPATH'] ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/hierarchy_Return_foo_SConscript0000664000175000017500000000010013160023040026233 0ustar bdbaddogbdbaddog Import('env') obj = env.Object('foo.c') Return('obj') scons-src-3.0.0/doc/generated/examples/troubleshoot_stacktrace_2.xml0000664000175000017500000000152213160023040025672 0ustar bdbaddogbdbaddog % scons -Q --debug=stacktrace scons: *** [prog.o] Source `prog.c' not found, needed by target `prog.o'. scons: internal stack trace: File "bootstrap/src/engine/SCons/Job.py", line 199, in start task.prepare() File "bootstrap/src/engine/SCons/Script/Main.py", line 175, in prepare return SCons.Taskmaster.OutOfDateTask.prepare(self) File "bootstrap/src/engine/SCons/Taskmaster.py", line 198, in prepare executor.prepare() File "bootstrap/src/engine/SCons/Executor.py", line 430, in prepare raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0])) scons-src-3.0.0/doc/generated/examples/troubleshoot_Dump_1.xml0000664000175000017500000000065013160023040024453 0ustar bdbaddogbdbaddog % scons scons: Reading SConscript files ... File "/home/my/project/SConstruct", line 2 print env.Dump() ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/simple_clean_2.xml0000664000175000017500000000134113160023040023367 0ustar bdbaddogbdbaddog C:\>scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... cl /Fohello.obj /c hello.c /nologo link /nologo /OUT:hello.exe hello.obj embedManifestExeCheck(target, source, env) scons: done building targets. C:\>scons -c scons: Reading SConscript files ... scons: done reading SConscript files. scons: Cleaning targets ... Removed hello.obj Removed hello.exe scons: done cleaning targets. scons-src-3.0.0/doc/generated/examples/builderscommands_ex2_1.xml0000664000175000017500000000046713160023037025062 0ustar bdbaddogbdbaddog % scons -Q build(["foo.out"], ["foo.in"]) scons-src-3.0.0/doc/generated/examples/commandline_Default1_2.xml0000664000175000017500000000057413160023037024764 0ustar bdbaddogbdbaddog % scons -Q . cc -o goodbye.o -c goodbye.c cc -o goodbye goodbye.o cc -o hello.o -c hello.c cc -o hello hello.o scons-src-3.0.0/doc/generated/examples/parseflags_ex4_1.xml0000664000175000017500000000057713160023040023654 0ustar bdbaddogbdbaddog % scons -Q File "/home/my/project/SConstruct", line 5 print k, v ^ SyntaxError: invalid syntax scons-src-3.0.0/doc/generated/examples/install_ex4_1.xml0000664000175000017500000000057313160023040023167 0ustar bdbaddogbdbaddog % scons -Q install cc -o hello.o -c hello.c cc -o hello hello.o Install file: "hello" as "/usr/bin/hello-new" scons-src-3.0.0/doc/generated/builders.mod0000664000175000017500000006343413160023037020506 0ustar bdbaddogbdbaddog CFile"> Command"> CXXFile"> DocbookEpub"> DocbookHtml"> DocbookHtmlChunked"> DocbookHtmlhelp"> DocbookMan"> DocbookPdf"> DocbookSlidesHtml"> DocbookSlidesPdf"> DocbookXInclude"> DocbookXslt"> DVI"> Gs"> Install"> InstallAs"> InstallVersionedLib"> Jar"> Java"> JavaH"> Library"> LoadableModule"> M4"> Moc"> MOFiles"> MSVSProject"> MSVSSolution"> Object"> Package"> PCH"> PDF"> POInit"> PostScript"> POTUpdate"> POUpdate"> Program"> ProgramAllAtOnce"> RES"> RMIC"> RPCGenClient"> RPCGenHeader"> RPCGenService"> RPCGenXDR"> SharedLibrary"> SharedObject"> StaticLibrary"> StaticObject"> Substfile"> Tar"> Textfile"> Translate"> TypeLibrary"> Uic"> Zip"> env.CFile"> env.Command"> env.CXXFile"> env.DocbookEpub"> env.DocbookHtml"> env.DocbookHtmlChunked"> env.DocbookHtmlhelp"> env.DocbookMan"> env.DocbookPdf"> env.DocbookSlidesHtml"> env.DocbookSlidesPdf"> env.DocbookXInclude"> env.DocbookXslt"> env.DVI"> env.Gs"> env.Install"> env.InstallAs"> env.InstallVersionedLib"> env.Jar"> env.Java"> env.JavaH"> env.Library"> env.LoadableModule"> env.M4"> env.Moc"> env.MOFiles"> env.MSVSProject"> env.MSVSSolution"> env.Object"> env.Package"> env.PCH"> env.PDF"> env.POInit"> env.PostScript"> env.POTUpdate"> env.POUpdate"> env.Program"> env.ProgramAllAtOnce"> env.RES"> env.RMIC"> env.RPCGenClient"> env.RPCGenHeader"> env.RPCGenService"> env.RPCGenXDR"> env.SharedLibrary"> env.SharedObject"> env.StaticLibrary"> env.StaticObject"> env.Substfile"> env.Tar"> env.Textfile"> env.Translate"> env.TypeLibrary"> env.Uic"> env.Zip"> CFile"> Command"> CXXFile"> DocbookEpub"> DocbookHtml"> DocbookHtmlChunked"> DocbookHtmlhelp"> DocbookMan"> DocbookPdf"> DocbookSlidesHtml"> DocbookSlidesPdf"> DocbookXInclude"> DocbookXslt"> DVI"> Gs"> Install"> InstallAs"> InstallVersionedLib"> Jar"> Java"> JavaH"> Library"> LoadableModule"> M4"> Moc"> MOFiles"> MSVSProject"> MSVSSolution"> Object"> Package"> PCH"> PDF"> POInit"> PostScript"> POTUpdate"> POUpdate"> Program"> ProgramAllAtOnce"> RES"> RMIC"> RPCGenClient"> RPCGenHeader"> RPCGenService"> RPCGenXDR"> SharedLibrary"> SharedObject"> StaticLibrary"> StaticObject"> Substfile"> Tar"> Textfile"> Translate"> TypeLibrary"> Uic"> Zip"> env.CFile"> env.Command"> env.CXXFile"> env.DocbookEpub"> env.DocbookHtml"> env.DocbookHtmlChunked"> env.DocbookHtmlhelp"> env.DocbookMan"> env.DocbookPdf"> env.DocbookSlidesHtml"> env.DocbookSlidesPdf"> env.DocbookXInclude"> env.DocbookXslt"> env.DVI"> env.Gs"> env.Install"> env.InstallAs"> env.InstallVersionedLib"> env.Jar"> env.Java"> env.JavaH"> env.Library"> env.LoadableModule"> env.M4"> env.Moc"> env.MOFiles"> env.MSVSProject"> env.MSVSSolution"> env.Object"> env.Package"> env.PCH"> env.PDF"> env.POInit"> env.PostScript"> env.POTUpdate"> env.POUpdate"> env.Program"> env.ProgramAllAtOnce"> env.RES"> env.RMIC"> env.RPCGenClient"> env.RPCGenHeader"> env.RPCGenService"> env.RPCGenXDR"> env.SharedLibrary"> env.SharedObject"> env.StaticLibrary"> env.StaticObject"> env.Substfile"> env.Tar"> env.Textfile"> env.Translate"> env.TypeLibrary"> env.Uic"> env.Zip"> scons-src-3.0.0/doc/generated/tools.gen0000664000175000017500000016073613160023040020024 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> 386asm Sets construction variables for the 386ASM assembler for the Phar Lap ETS embedded operating system. Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-CC;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. aixc++ Sets construction variables for the IMB xlc / Visual Age C++ compiler. Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXX;, &cv-link-SHOBJSUFFIX;. aixcc Sets construction variables for the IBM xlc / Visual Age C compiler. Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCC;. aixf77 Sets construction variables for the IBM Visual Age f77 Fortran compiler. Sets: &cv-link-F77;, &cv-link-SHF77;. aixlink Sets construction variables for the IBM Visual Age linker. Sets: &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINKFLAGS;. applelink Sets construction variables for the Apple linker (similar to the GNU linker). Sets: &cv-link-FRAMEWORKPATHPREFIX;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LINKCOM;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-_FRAMEWORKPATH;, &cv-link-_FRAMEWORKS;.Uses: &cv-link-FRAMEWORKSFLAGS;. ar Sets construction variables for the ar library archiver. Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-RANLIB;, &cv-link-RANLIBCOM;, &cv-link-RANLIBFLAGS;. as Sets construction variables for the as assembler. Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-CC;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. bcc32 Sets construction variables for the bcc32 compiler. Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. cc Sets construction variables for generic POSIX C copmilers. Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-PLATFORM;. clang Set construction variables for the Clang C compiler. Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. clangxx Set construction variables for the Clang C++ compiler. Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME;. cvf Sets construction variables for the Compaq Visual Fortran compiler. Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANMODDIR;, &cv-link-FORTRANMODDIRPREFIX;, &cv-link-FORTRANMODDIRSUFFIX;, &cv-link-FORTRANPPCOM;, &cv-link-OBJSUFFIX;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;, &cv-link-_FORTRANMODFLAG;. cXX Sets construction variables for generic POSIX C++ compilers. Sets: &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-CXXFLAGS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-OBJSUFFIX;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-CXXCOMSTR;. cyglink Set construction variables for cygwin linker/loader. Sets: &cv-link-IMPLIBPREFIX;, &cv-link-IMPLIBSUFFIX;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LINKFLAGS;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLIBPREFIX;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLIBVERSIONFLAGS;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-_LDMODULEVERSIONFLAGS;, &cv-link-_SHLIBVERSIONFLAGS;. default Sets variables by calling a default list of Tool modules for the platform on which SCons is running. dmd Sets construction variables for D language compiler DMD. Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. docbook This tool tries to make working with Docbook in SCons a little easier. It provides several toolchains for creating different output formats, like HTML or PDF. Contained in the package is a distribution of the Docbook XSL stylesheets as of version 1.76.1. As long as you don't specify your own stylesheets for customization, these official versions are picked as default...which should reduce the inevitable setup hassles for you. Implicit dependencies to images and XIncludes are detected automatically if you meet the HTML requirements. The additional stylesheet utils/xmldepend.xsl by Paul DuBois is used for this purpose. Note, that there is no support for XML catalog resolving offered! This tool calls the XSLT processors and PDF renderers with the stylesheets you specified, that's it. The rest lies in your hands and you still have to know what you're doing when resolving names via a catalog. For activating the tool "docbook", you have to add its name to the Environment constructor, like this env = Environment(tools=['docbook']) On its startup, the Docbook tool tries to find a required xsltproc processor, and a PDF renderer, e.g. fop. So make sure that these are added to your system's environment PATH and can be called directly, without specifying their full path. For the most basic processing of Docbook to HTML, you need to have installed the Python lxml binding to libxml2, or the direct Python bindings for libxml2/libxslt, or a standalone XSLT processor, currently detected are xsltproc, saxon, saxon-xslt and xalan. Rendering to PDF requires you to have one of the applications fop or xep installed. Creating a HTML or PDF document is very simple and straightforward. Say env = Environment(tools=['docbook']) env.DocbookHtml('manual.html', 'manual.xml') env.DocbookPdf('manual.pdf', 'manual.xml') to get both outputs from your XML source manual.xml. As a shortcut, you can give the stem of the filenames alone, like this: env = Environment(tools=['docbook']) env.DocbookHtml('manual') env.DocbookPdf('manual') and get the same result. Target and source lists are also supported: env = Environment(tools=['docbook']) env.DocbookHtml(['manual.html','reference.html'], ['manual.xml','reference.xml']) or even env = Environment(tools=['docbook']) env.DocbookHtml(['manual','reference']) Whenever you leave out the list of sources, you may not specify a file extension! The Tool uses the given names as file stems, and adds the suffixes for target and source files accordingly. The rules given above are valid for the Builders DocbookHtml, DocbookPdf, DocbookEpub, DocbookSlidesPdf and DocbookXInclude. For the DocbookMan transformation you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source. The Builders DocbookHtmlChunked, DocbookHtmlhelp and DocbookSlidesHtml are special, in that: they create a large set of files, where the exact names and their number depend on the content of the source file, and the main target is always named index.html, i.e. the output name for the XSL transformation is not picked up by the stylesheets. As a result, there is simply no use in specifying a target HTML name. So the basic syntax for these builders is always: env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual') If you want to use a specific XSL file, you can set the additional xsl parameter to your Builder call as follows: env.DocbookHtml('other.html', 'manual.xml', xsl='html.xsl') Since this may get tedious if you always use the same local naming for your customized XSL files, e.g. html.xsl for HTML and pdf.xsl for PDF output, a set of variables for setting the default XSL name is provided. These are: DOCBOOK_DEFAULT_XSL_HTML DOCBOOK_DEFAULT_XSL_HTMLCHUNKED DOCBOOK_DEFAULT_XSL_HTMLHELP DOCBOOK_DEFAULT_XSL_PDF DOCBOOK_DEFAULT_XSL_EPUB DOCBOOK_DEFAULT_XSL_MAN DOCBOOK_DEFAULT_XSL_SLIDESPDF DOCBOOK_DEFAULT_XSL_SLIDESHTML and you can set them when constructing your environment: env = Environment(tools=['docbook'], DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') env.DocbookHtml('manual') # now uses html.xsl Sets: &cv-link-DOCBOOK_DEFAULT_XSL_EPUB;, &cv-link-DOCBOOK_DEFAULT_XSL_HTML;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP;, &cv-link-DOCBOOK_DEFAULT_XSL_MAN;, &cv-link-DOCBOOK_DEFAULT_XSL_PDF;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESHTML;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESPDF;, &cv-link-DOCBOOK_FOP;, &cv-link-DOCBOOK_FOPCOM;, &cv-link-DOCBOOK_FOPFLAGS;, &cv-link-DOCBOOK_XMLLINT;, &cv-link-DOCBOOK_XMLLINTCOM;, &cv-link-DOCBOOK_XMLLINTFLAGS;, &cv-link-DOCBOOK_XSLTPROC;, &cv-link-DOCBOOK_XSLTPROCCOM;, &cv-link-DOCBOOK_XSLTPROCFLAGS;, &cv-link-DOCBOOK_XSLTPROCPARAMS;.Uses: &cv-link-DOCBOOK_FOPCOMSTR;, &cv-link-DOCBOOK_XMLLINTCOMSTR;, &cv-link-DOCBOOK_XSLTPROCCOMSTR;. dvi Attaches the DVI builder to the construction environment. dvipdf Sets construction variables for the dvipdf utility. Sets: &cv-link-DVIPDF;, &cv-link-DVIPDFCOM;, &cv-link-DVIPDFFLAGS;.Uses: &cv-link-DVIPDFCOMSTR;. dvips Sets construction variables for the dvips utility. Sets: &cv-link-DVIPS;, &cv-link-DVIPSFLAGS;, &cv-link-PSCOM;, &cv-link-PSPREFIX;, &cv-link-PSSUFFIX;.Uses: &cv-link-PSCOMSTR;. f03 Set construction variables for generic POSIX Fortran 03 compilers. Sets: &cv-link-F03;, &cv-link-F03COM;, &cv-link-F03FLAGS;, &cv-link-F03PPCOM;, &cv-link-SHF03;, &cv-link-SHF03COM;, &cv-link-SHF03FLAGS;, &cv-link-SHF03PPCOM;, &cv-link-_F03INCFLAGS;.Uses: &cv-link-F03COMSTR;, &cv-link-F03PPCOMSTR;, &cv-link-SHF03COMSTR;, &cv-link-SHF03PPCOMSTR;. f08 Set construction variables for generic POSIX Fortran 08 compilers. Sets: &cv-link-F08;, &cv-link-F08COM;, &cv-link-F08FLAGS;, &cv-link-F08PPCOM;, &cv-link-SHF08;, &cv-link-SHF08COM;, &cv-link-SHF08FLAGS;, &cv-link-SHF08PPCOM;, &cv-link-_F08INCFLAGS;.Uses: &cv-link-F08COMSTR;, &cv-link-F08PPCOMSTR;, &cv-link-SHF08COMSTR;, &cv-link-SHF08PPCOMSTR;. f77 Set construction variables for generic POSIX Fortran 77 compilers. Sets: &cv-link-F77;, &cv-link-F77COM;, &cv-link-F77FILESUFFIXES;, &cv-link-F77FLAGS;, &cv-link-F77PPCOM;, &cv-link-F77PPFILESUFFIXES;, &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANFLAGS;, &cv-link-SHF77;, &cv-link-SHF77COM;, &cv-link-SHF77FLAGS;, &cv-link-SHF77PPCOM;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANFLAGS;, &cv-link-SHFORTRANPPCOM;, &cv-link-_F77INCFLAGS;.Uses: &cv-link-F77COMSTR;, &cv-link-F77PPCOMSTR;, &cv-link-FORTRANCOMSTR;, &cv-link-FORTRANPPCOMSTR;, &cv-link-SHF77COMSTR;, &cv-link-SHF77PPCOMSTR;, &cv-link-SHFORTRANCOMSTR;, &cv-link-SHFORTRANPPCOMSTR;. f90 Set construction variables for generic POSIX Fortran 90 compilers. Sets: &cv-link-F90;, &cv-link-F90COM;, &cv-link-F90FLAGS;, &cv-link-F90PPCOM;, &cv-link-SHF90;, &cv-link-SHF90COM;, &cv-link-SHF90FLAGS;, &cv-link-SHF90PPCOM;, &cv-link-_F90INCFLAGS;.Uses: &cv-link-F90COMSTR;, &cv-link-F90PPCOMSTR;, &cv-link-SHF90COMSTR;, &cv-link-SHF90PPCOMSTR;. f95 Set construction variables for generic POSIX Fortran 95 compilers. Sets: &cv-link-F95;, &cv-link-F95COM;, &cv-link-F95FLAGS;, &cv-link-F95PPCOM;, &cv-link-SHF95;, &cv-link-SHF95COM;, &cv-link-SHF95FLAGS;, &cv-link-SHF95PPCOM;, &cv-link-_F95INCFLAGS;.Uses: &cv-link-F95COMSTR;, &cv-link-F95PPCOMSTR;, &cv-link-SHF95COMSTR;, &cv-link-SHF95PPCOMSTR;. fortran Set construction variables for generic POSIX Fortran compilers. Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANFLAGS;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-FORTRANCOMSTR;, &cv-link-FORTRANPPCOMSTR;, &cv-link-SHFORTRANCOMSTR;, &cv-link-SHFORTRANPPCOMSTR;. g++ Set construction variables for the gXX C++ compiler. Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;. g77 Set construction variables for the g77 Fortran compiler. Calls the f77 Tool module to set variables. gas Sets construction variables for the gas assembler. Calls the as module. Sets: &cv-link-AS;. gcc Set construction variables for the gcc C compiler. Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. gdc Sets construction variables for the D language compiler GDC. Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. gettext This is actually a toolset, which supports internationalization and localization of software being constructed with SCons. The toolset loads following tools: xgettext - to extract internationalized messages from source code to POT file(s), msginit - may be optionally used to initialize PO files, msgmerge - to update PO files, that already contain translated messages, msgfmt - to compile textual PO file to binary installable MO file. When you enable gettext, it internally loads all abovementioned tools, so you're encouraged to see their individual documentation. Each of the above tools provides its own builder(s) which may be used to perform particular activities related to software internationalization. You may be however interested in top-level builder Translate described few paragraphs later. To use gettext tools add 'gettext' tool to your environment: env = Environment( tools = ['default', 'gettext'] ) gfortran Sets construction variables for the GNU F95/F2003 GNU compiler. Sets: &cv-link-F77;, &cv-link-F90;, &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. gnulink Set construction variables for GNU linker/loader. Sets: &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLIBVERSIONFLAGS;, &cv-link-SHLINKFLAGS;, &cv-link-_LDMODULESONAME;, &cv-link-_SHLIBSONAME;. gs This Tool sets the required construction variables for working with the Ghostscript command. It also registers an appropriate Action with the PDF Builder (PDF), such that the conversion from PS/EPS to PDF happens automatically for the TeX/LaTeX toolchain. Finally, it adds an explicit Ghostscript Builder (Gs) to the environment. Sets: &cv-link-GS;, &cv-link-GSCOM;, &cv-link-GSFLAGS;.Uses: &cv-link-GSCOMSTR;. hpc++ Set construction variables for the compilers aCC on HP/UX systems. hpcc Set construction variables for the aCC on HP/UX systems. Calls the cXX tool for additional variables. Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;. hplink Sets construction variables for the linker on HP/UX systems. Sets: &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINKFLAGS;. icc Sets construction variables for the icc compiler on OS/2 systems. Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CFILESUFFIX;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;.Uses: &cv-link-CCFLAGS;, &cv-link-CFLAGS;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. icl Sets construction variables for the Intel C/C++ compiler. Calls the intelc Tool module to set its variables. ifl Sets construction variables for the Intel Fortran compiler. Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANPPCOM;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;. ifort Sets construction variables for newer versions of the Intel Fortran compiler for Linux. Sets: &cv-link-F77;, &cv-link-F90;, &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. ilink Sets construction variables for the ilink linker on OS/2 systems. Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;. ilink32 Sets construction variables for the Borland ilink32 linker. Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;. install Sets construction variables for file and directory installation. Sets: &cv-link-INSTALL;, &cv-link-INSTALLSTR;. intelc Sets construction variables for the Intel C/C++ compiler (Linux and Windows, version 7 and later). Calls the gcc or msvc (on Linux and Windows, respectively) to set underlying variables. Sets: &cv-link-AR;, &cv-link-CC;, &cv-link-CXX;, &cv-link-INTEL_C_COMPILER_VERSION;, &cv-link-LINK;. jar Sets construction variables for the jar utility. Sets: &cv-link-JAR;, &cv-link-JARCOM;, &cv-link-JARFLAGS;, &cv-link-JARSUFFIX;.Uses: &cv-link-JARCOMSTR;. javac Sets construction variables for the javac compiler. Sets: &cv-link-JAVABOOTCLASSPATH;, &cv-link-JAVAC;, &cv-link-JAVACCOM;, &cv-link-JAVACFLAGS;, &cv-link-JAVACLASSPATH;, &cv-link-JAVACLASSSUFFIX;, &cv-link-JAVASOURCEPATH;, &cv-link-JAVASUFFIX;.Uses: &cv-link-JAVACCOMSTR;. javah Sets construction variables for the javah tool. Sets: &cv-link-JAVACLASSSUFFIX;, &cv-link-JAVAH;, &cv-link-JAVAHCOM;, &cv-link-JAVAHFLAGS;.Uses: &cv-link-JAVACLASSPATH;, &cv-link-JAVAHCOMSTR;. latex Sets construction variables for the latex utility. Sets: &cv-link-LATEX;, &cv-link-LATEXCOM;, &cv-link-LATEXFLAGS;.Uses: &cv-link-LATEXCOMSTR;. ldc Sets construction variables for the D language compiler LDC2. Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. lex Sets construction variables for the lex lexical analyser. Sets: &cv-link-LEX;, &cv-link-LEXCOM;, &cv-link-LEXFLAGS;.Uses: &cv-link-LEXCOMSTR;. link Sets construction variables for generic POSIX linkers. Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULENOVERSIONSYMLINKS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LDMODULEVERSION;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-__LDMODULEVERSIONFLAGS;, &cv-link-__SHLIBVERSIONFLAGS;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. linkloc Sets construction variables for the LinkLoc linker for the Phar Lap ETS embedded operating system. Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;.Uses: &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. m4 Sets construction variables for the m4 macro processor. Sets: &cv-link-M4;, &cv-link-M4COM;, &cv-link-M4FLAGS;.Uses: &cv-link-M4COMSTR;. masm Sets construction variables for the Microsoft assembler. Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. midl Sets construction variables for the Microsoft IDL compiler. Sets: &cv-link-MIDL;, &cv-link-MIDLCOM;, &cv-link-MIDLFLAGS;.Uses: &cv-link-MIDLCOMSTR;. mingw Sets construction variables for MinGW (Minimal Gnu on Windows). Sets: &cv-link-AS;, &cv-link-CC;, &cv-link-CXX;, &cv-link-LDMODULECOM;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-OBJSUFFIX;, &cv-link-RC;, &cv-link-RCCOM;, &cv-link-RCFLAGS;, &cv-link-RCINCFLAGS;, &cv-link-RCINCPREFIX;, &cv-link-RCINCSUFFIX;, &cv-link-SHCCFLAGS;, &cv-link-SHCXXFLAGS;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-WINDOWSDEFPREFIX;, &cv-link-WINDOWSDEFSUFFIX;.Uses: &cv-link-RCCOMSTR;, &cv-link-SHLINKCOMSTR;. msgfmt This scons tool is a part of scons gettext toolset. It provides scons interface to msgfmt(1) command, which generates binary message catalog (MO) from a textual translation description (PO). Sets: &cv-link-MOSUFFIX;, &cv-link-MSGFMT;, &cv-link-MSGFMTCOM;, &cv-link-MSGFMTCOMSTR;, &cv-link-MSGFMTFLAGS;, &cv-link-POSUFFIX;.Uses: &cv-link-LINGUAS_FILE;. msginit This scons tool is a part of scons gettext toolset. It provides scons interface to msginit(1) program, which creates new PO file, initializing the meta information with values from user's environment (or options). Sets: &cv-link-MSGINIT;, &cv-link-MSGINITCOM;, &cv-link-MSGINITCOMSTR;, &cv-link-MSGINITFLAGS;, &cv-link-POAUTOINIT;, &cv-link-POCREATE_ALIAS;, &cv-link-POSUFFIX;, &cv-link-POTSUFFIX;, &cv-link-_MSGINITLOCALE;.Uses: &cv-link-LINGUAS_FILE;, &cv-link-POAUTOINIT;, &cv-link-POTDOMAIN;. msgmerge This scons tool is a part of scons gettext toolset. It provides scons interface to msgmerge(1) command, which merges two Uniform style .po files together. Sets: &cv-link-MSGMERGE;, &cv-link-MSGMERGECOM;, &cv-link-MSGMERGECOMSTR;, &cv-link-MSGMERGEFLAGS;, &cv-link-POSUFFIX;, &cv-link-POTSUFFIX;, &cv-link-POUPDATE_ALIAS;.Uses: &cv-link-LINGUAS_FILE;, &cv-link-POAUTOINIT;, &cv-link-POTDOMAIN;. mslib Sets construction variables for the Microsoft mslib library archiver. Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. mslink Sets construction variables for the Microsoft linker. Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-REGSVR;, &cv-link-REGSVRCOM;, &cv-link-REGSVRFLAGS;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-WIN32DEFPREFIX;, &cv-link-WIN32DEFSUFFIX;, &cv-link-WIN32EXPPREFIX;, &cv-link-WIN32EXPSUFFIX;, &cv-link-WINDOWSDEFPREFIX;, &cv-link-WINDOWSDEFSUFFIX;, &cv-link-WINDOWSEXPPREFIX;, &cv-link-WINDOWSEXPSUFFIX;, &cv-link-WINDOWSPROGMANIFESTPREFIX;, &cv-link-WINDOWSPROGMANIFESTSUFFIX;, &cv-link-WINDOWSSHLIBMANIFESTPREFIX;, &cv-link-WINDOWSSHLIBMANIFESTSUFFIX;, &cv-link-WINDOWS_INSERT_DEF;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-REGSVRCOMSTR;, &cv-link-SHLINKCOMSTR;. mssdk Sets variables for Microsoft Platform SDK and/or Windows SDK. Note that unlike most other Tool modules, mssdk does not set construction variables, but sets the environment variables in the environment SCons uses to execute the Microsoft toolchain: %INCLUDE%, %LIB%, %LIBPATH% and %PATH%. Uses: &cv-link-MSSDK_DIR;, &cv-link-MSSDK_VERSION;, &cv-link-MSVS_VERSION;. msvc Sets construction variables for the Microsoft Visual C/C++ compiler. Sets: &cv-link-BUILDERS;, &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CCPCHFLAGS;, &cv-link-CCPDBFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-CXXFLAGS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-OBJPREFIX;, &cv-link-OBJSUFFIX;, &cv-link-PCHCOM;, &cv-link-PCHPDBFLAGS;, &cv-link-RC;, &cv-link-RCCOM;, &cv-link-RCFLAGS;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-CCCOMSTR;, &cv-link-CXXCOMSTR;, &cv-link-PCH;, &cv-link-PCHSTOP;, &cv-link-PDB;, &cv-link-SHCCCOMSTR;, &cv-link-SHCXXCOMSTR;. msvs Sets construction variables for Microsoft Visual Studio. Sets: &cv-link-MSVSBUILDCOM;, &cv-link-MSVSCLEANCOM;, &cv-link-MSVSENCODING;, &cv-link-MSVSPROJECTCOM;, &cv-link-MSVSREBUILDCOM;, &cv-link-MSVSSCONS;, &cv-link-MSVSSCONSCOM;, &cv-link-MSVSSCONSCRIPT;, &cv-link-MSVSSCONSFLAGS;, &cv-link-MSVSSOLUTIONCOM;. mwcc Sets construction variables for the Metrowerks CodeWarrior compiler. Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CFILESUFFIX;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-MWCW_VERSION;, &cv-link-MWCW_VERSIONS;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;.Uses: &cv-link-CCCOMSTR;, &cv-link-CXXCOMSTR;, &cv-link-SHCCCOMSTR;, &cv-link-SHCXXCOMSTR;. mwld Sets construction variables for the Metrowerks CodeWarrior linker. Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;. nasm Sets construction variables for the nasm Netwide Assembler. Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;. Packaging Sets construction variables for the Package Builder. packaging A framework for building binary and source packages. pdf Sets construction variables for the Portable Document Format builder. Sets: &cv-link-PDFPREFIX;, &cv-link-PDFSUFFIX;. pdflatex Sets construction variables for the pdflatex utility. Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;.Uses: &cv-link-PDFLATEXCOMSTR;. pdftex Sets construction variables for the pdftex utility. Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;, &cv-link-PDFTEX;, &cv-link-PDFTEXCOM;, &cv-link-PDFTEXFLAGS;.Uses: &cv-link-PDFLATEXCOMSTR;, &cv-link-PDFTEXCOMSTR;. qt Sets construction variables for building Qt applications. Sets: &cv-link-QTDIR;, &cv-link-QT_AUTOSCAN;, &cv-link-QT_BINPATH;, &cv-link-QT_CPPPATH;, &cv-link-QT_LIB;, &cv-link-QT_LIBPATH;, &cv-link-QT_MOC;, &cv-link-QT_MOCCXXPREFIX;, &cv-link-QT_MOCCXXSUFFIX;, &cv-link-QT_MOCFROMCXXCOM;, &cv-link-QT_MOCFROMCXXFLAGS;, &cv-link-QT_MOCFROMHCOM;, &cv-link-QT_MOCFROMHFLAGS;, &cv-link-QT_MOCHPREFIX;, &cv-link-QT_MOCHSUFFIX;, &cv-link-QT_UIC;, &cv-link-QT_UICCOM;, &cv-link-QT_UICDECLFLAGS;, &cv-link-QT_UICDECLPREFIX;, &cv-link-QT_UICDECLSUFFIX;, &cv-link-QT_UICIMPLFLAGS;, &cv-link-QT_UICIMPLPREFIX;, &cv-link-QT_UICIMPLSUFFIX;, &cv-link-QT_UISUFFIX;. rmic Sets construction variables for the rmic utility. Sets: &cv-link-JAVACLASSSUFFIX;, &cv-link-RMIC;, &cv-link-RMICCOM;, &cv-link-RMICFLAGS;.Uses: &cv-link-RMICCOMSTR;. rpcgen Sets construction variables for building with RPCGEN. Sets: &cv-link-RPCGEN;, &cv-link-RPCGENCLIENTFLAGS;, &cv-link-RPCGENFLAGS;, &cv-link-RPCGENHEADERFLAGS;, &cv-link-RPCGENSERVICEFLAGS;, &cv-link-RPCGENXDRFLAGS;. sgiar Sets construction variables for the SGI library archiver. Sets: &cv-link-AR;, &cv-link-ARCOMSTR;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKFLAGS;.Uses: &cv-link-ARCOMSTR;, &cv-link-SHLINKCOMSTR;. sgic++ Sets construction variables for the SGI C++ compiler. Sets: &cv-link-CXX;, &cv-link-CXXFLAGS;, &cv-link-SHCXX;, &cv-link-SHOBJSUFFIX;. sgicc Sets construction variables for the SGI C compiler. Sets: &cv-link-CXX;, &cv-link-SHOBJSUFFIX;. sgilink Sets construction variables for the SGI linker. Sets: &cv-link-LINK;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLINKFLAGS;. sunar Sets construction variables for the Sun library archiver. Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. sunc++ Sets construction variables for the Sun C++ compiler. Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXX;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;. suncc Sets construction variables for the Sun C compiler. Sets: &cv-link-CXX;, &cv-link-SHCCFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;. sunf77 Set construction variables for the Sun f77 Fortran compiler. Sets: &cv-link-F77;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. sunf90 Set construction variables for the Sun f90 Fortran compiler. Sets: &cv-link-F90;, &cv-link-FORTRAN;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. sunf95 Set construction variables for the Sun f95 Fortran compiler. Sets: &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. sunlink Sets construction variables for the Sun linker. Sets: &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLINKFLAGS;. swig Sets construction variables for the SWIG interface generator. Sets: &cv-link-SWIG;, &cv-link-SWIGCFILESUFFIX;, &cv-link-SWIGCOM;, &cv-link-SWIGCXXFILESUFFIX;, &cv-link-SWIGDIRECTORSUFFIX;, &cv-link-SWIGFLAGS;, &cv-link-SWIGINCPREFIX;, &cv-link-SWIGINCSUFFIX;, &cv-link-SWIGPATH;, &cv-link-SWIGVERSION;, &cv-link-_SWIGINCFLAGS;.Uses: &cv-link-SWIGCOMSTR;. tar Sets construction variables for the tar archiver. Sets: &cv-link-TAR;, &cv-link-TARCOM;, &cv-link-TARFLAGS;, &cv-link-TARSUFFIX;.Uses: &cv-link-TARCOMSTR;. tex Sets construction variables for the TeX formatter and typesetter. Sets: &cv-link-BIBTEX;, &cv-link-BIBTEXCOM;, &cv-link-BIBTEXFLAGS;, &cv-link-LATEX;, &cv-link-LATEXCOM;, &cv-link-LATEXFLAGS;, &cv-link-MAKEINDEX;, &cv-link-MAKEINDEXCOM;, &cv-link-MAKEINDEXFLAGS;, &cv-link-TEX;, &cv-link-TEXCOM;, &cv-link-TEXFLAGS;.Uses: &cv-link-BIBTEXCOMSTR;, &cv-link-LATEXCOMSTR;, &cv-link-MAKEINDEXCOMSTR;, &cv-link-TEXCOMSTR;. textfile Set construction variables for the Textfile and Substfile builders. Sets: &cv-link-LINESEPARATOR;, &cv-link-SUBSTFILEPREFIX;, &cv-link-SUBSTFILESUFFIX;, &cv-link-TEXTFILEPREFIX;, &cv-link-TEXTFILESUFFIX;.Uses: &cv-link-SUBST_DICT;. tlib Sets construction variables for the Borlan tib library archiver. Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. xgettext This scons tool is a part of scons gettext toolset. It provides scons interface to xgettext(1) program, which extracts internationalized messages from source code. The tool provides POTUpdate builder to make PO Template files. Sets: &cv-link-POTSUFFIX;, &cv-link-POTUPDATE_ALIAS;, &cv-link-XGETTEXTCOM;, &cv-link-XGETTEXTCOMSTR;, &cv-link-XGETTEXTFLAGS;, &cv-link-XGETTEXTFROM;, &cv-link-XGETTEXTFROMPREFIX;, &cv-link-XGETTEXTFROMSUFFIX;, &cv-link-XGETTEXTPATH;, &cv-link-XGETTEXTPATHPREFIX;, &cv-link-XGETTEXTPATHSUFFIX;, &cv-link-_XGETTEXTDOMAIN;, &cv-link-_XGETTEXTFROMFLAGS;, &cv-link-_XGETTEXTPATHFLAGS;.Uses: &cv-link-POTDOMAIN;. yacc Sets construction variables for the yacc parse generator. Sets: &cv-link-YACC;, &cv-link-YACCCOM;, &cv-link-YACCFLAGS;, &cv-link-YACCHFILESUFFIX;, &cv-link-YACCHXXFILESUFFIX;, &cv-link-YACCVCGFILESUFFIX;.Uses: &cv-link-YACCCOMSTR;. zip Sets construction variables for the zip archiver. Sets: &cv-link-ZIP;, &cv-link-ZIPCOM;, &cv-link-ZIPCOMPRESSION;, &cv-link-ZIPFLAGS;, &cv-link-ZIPSUFFIX;.Uses: &cv-link-ZIPCOMSTR;. scons-src-3.0.0/doc/generated/functions.gen0000664000175000017500000043137413160023040020673 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Action(action, [cmd/str/fun, [var, ...]] [option=value, ...]) env.Action(action, [cmd/str/fun, [var, ...]] [option=value, ...]) Creates an Action object for the specified action. See the section "Action Objects," below, for a complete explanation of the arguments and behavior. Note that the env.Action() form of the invocation will expand construction variables in any argument strings, including the action argument, at the time it is called using the construction variables in the env construction environment through which env.Action() was called. The Action() form delays all variable expansion until the Action object is actually used. AddMethod(object, function, [name]) env.AddMethod(function, [name]) When called with the AddMethod() form, adds the specified function to the specified object as the specified method name. When called with the env.AddMethod() form, adds the specified function to the construction environment env as the specified method name. In both cases, if name is omitted or None, the name of the specified function itself is used for the method name. Examples: # Note that the first argument to the function to # be attached as a method must be the object through # which the method will be called; the Python # convention is to call it 'self'. def my_method(self, arg): print("my_method() got", arg) # Use the global AddMethod() function to add a method # to the Environment class. This AddMethod(Environment, my_method) env = Environment() env.my_method('arg') # Add the function as a method, using the function # name for the method call. env = Environment() env.AddMethod(my_method, 'other_method_name') env.other_method_name('another arg') AddOption(arguments) This function adds a new command-line option to be recognized. The specified arguments are the same as supported by the standard Python optparse.add_option() method (with a few additional capabilities noted below); see the documentation for optparse for a thorough discussion of its option-processing capabities. In addition to the arguments and values supported by the optparse.add_option() method, the SCons AddOption function allows you to set the nargs keyword value to '?' (a string with just the question mark) to indicate that the specified long option(s) take(s) an optional argument. When nargs = '?' is passed to the AddOption function, the const keyword argument may be used to supply the "default" value that should be used when the option is specified on the command line without an explicit argument. If no default= keyword argument is supplied when calling AddOption, the option will have a default value of None. Once a new command-line option has been added with AddOption, the option value may be accessed using GetOption or env.GetOption(). The value may also be set, using SetOption or env.SetOption(), if conditions in a SConscript require overriding any default value. Note, however, that a value specified on the command line will always override a value set by any SConscript file. Any specified help= strings for the new option(s) will be displayed by the or options (the latter only if no other help text is specified in the SConscript files). The help text for the local options specified by AddOption will appear below the SCons options themselves, under a separate Local Options heading. The options will appear in the help text in the order in which the AddOption calls occur. Example: AddOption('--prefix', dest='prefix', nargs=1, type='string', action='store', metavar='DIR', help='installation prefix') env = Environment(PREFIX = GetOption('prefix')) AddPostAction(target, action) env.AddPostAction(target, action) Arranges for the specified action to be performed after the specified target has been built. The specified action(s) may be an Action object, or anything that can be converted into an Action object (see below). When multiple targets are supplied, the action may be called multiple times, once after each action that generates one or more targets in the list. AddPreAction(target, action) env.AddPreAction(target, action) Arranges for the specified action to be performed before the specified target is built. The specified action(s) may be an Action object, or anything that can be converted into an Action object (see below). When multiple targets are specified, the action(s) may be called multiple times, once before each action that generates one or more targets in the list. Note that if any of the targets are built in multiple steps, the action will be invoked just before the "final" action that specifically generates the specified target(s). For example, when building an executable program from a specified source .c file via an intermediate object file: foo = Program('foo.c') AddPreAction(foo, 'pre_action') The specified pre_action would be executed before scons calls the link command that actually generates the executable program binary foo, not before compiling the foo.c file into an object file. Alias(alias, [targets, [action]]) env.Alias(alias, [targets, [action]]) Creates one or more phony targets that expand to one or more other targets. An optional action (command) or list of actions can be specified that will be executed whenever the any of the alias targets are out-of-date. Returns the Node object representing the alias, which exists outside of any file system. This Node object, or the alias name, may be used as a dependency of any other target, including another alias. Alias can be called multiple times for the same alias to add additional targets to the alias, or additional actions to the list for this alias. Examples: Alias('install') Alias('install', '/usr/bin') Alias(['install', 'install-lib'], '/usr/local/lib') env.Alias('install', ['/usr/local/bin', '/usr/local/lib']) env.Alias('install', ['/usr/local/man']) env.Alias('update', ['file1', 'file2'], "update_database $SOURCES") AllowSubstExceptions([exception, ...]) Specifies the exceptions that will be allowed when expanding construction variables. By default, any construction variable expansions that generate a NameError or IndexError exception will expand to a '' (a null string) and not cause scons to fail. All exceptions not in the specified list will generate an error message and terminate processing. If AllowSubstExceptions is called multiple times, each call completely overwrites the previous list of allowed exceptions. Example: # Requires that all construction variable names exist. # (You may wish to do this if you want to enforce strictly # that all construction variables must be defined before use.) AllowSubstExceptions() # Also allow a string containing a zero-division expansion # like '${1 / 0}' to evalute to ''. AllowSubstExceptions(IndexError, NameError, ZeroDivisionError) AlwaysBuild(target, ...) env.AlwaysBuild(target, ...) Marks each given target so that it is always assumed to be out of date, and will always be rebuilt if needed. Note, however, that AlwaysBuild does not add its target(s) to the default target list, so the targets will only be built if they are specified on the command line, or are a dependent of a target specified on the command line--but they will always be built if so specified. Multiple targets can be passed in to a single call to AlwaysBuild. env.Append(key=val, [...]) Appends the specified keyword arguments to the end of construction variables in the environment. If the Environment does not have the specified construction variable, it is simply added to the environment. If the values of the construction variable and the keyword argument are the same type, then the two values will be simply added together. Otherwise, the construction variable and the value of the keyword argument are both coerced to lists, and the lists are added together. (See also the Prepend method, below.) Example: env.Append(CCFLAGS = ' -g', FOO = ['foo.yyy']) env.AppendENVPath(name, newpath, [envname, sep, delete_existing]) This appends new path elements to the given path in the specified external environment (ENV by default). This will only add any particular path once (leaving the last one it encounters and ignoring the rest, to preserve path order), and to help assure this, will normalize all paths (using os.path.normpath and os.path.normcase). This can also handle the case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string. If delete_existing is 0, then adding a path that already exists will not move it to the end; it will stay where it is in the list. Example: print 'before:',env['ENV']['INCLUDE'] include_path = '/foo/bar:/foo' env.AppendENVPath('INCLUDE', include_path) print 'after:',env['ENV']['INCLUDE'] yields: before: /foo:/biz after: /biz:/foo/bar:/foo env.AppendUnique(key=val, [...], delete_existing=0) Appends the specified keyword arguments to the end of construction variables in the environment. If the Environment does not have the specified construction variable, it is simply added to the environment. If the construction variable being appended to is a list, then any value(s) that already exist in the construction variable will not be added again to the list. However, if delete_existing is 1, existing matching values are removed first, so existing values in the arg list move to the end of the list. Example: env.AppendUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) BuildDir(build_dir, src_dir, [duplicate]) env.BuildDir(build_dir, src_dir, [duplicate]) Deprecated synonyms for VariantDir and env.VariantDir(). The build_dir argument becomes the variant_dir argument of VariantDir or env.VariantDir(). Builder(action, [arguments]) env.Builder(action, [arguments]) Creates a Builder object for the specified action. See the section "Builder Objects," below, for a complete explanation of the arguments and behavior. Note that the env.Builder() form of the invocation will expand construction variables in any arguments strings, including the action argument, at the time it is called using the construction variables in the env construction environment through which env.Builder() was called. The Builder form delays all variable expansion until after the Builder object is actually called. CacheDir(cache_dir) env.CacheDir(cache_dir) Specifies that scons will maintain a cache of derived files in cache_dir. The derived files in the cache will be shared among all the builds using the same CacheDir call. Specifying a cache_dir of None disables derived file caching. Calling env.CacheDir() will only affect targets built through the specified construction environment. Calling CacheDir sets a global default that will be used by all targets built through construction environments that do not have an env.CacheDir() specified. When a CacheDir() is being used and scons finds a derived file that needs to be rebuilt, it will first look in the cache to see if a derived file has already been built from identical input files and an identical build action (as incorporated into the MD5 build signature). If so, scons will retrieve the file from the cache. If the derived file is not present in the cache, scons will rebuild it and then place a copy of the built file in the cache (identified by its MD5 build signature), so that it may be retrieved by other builds that need to build the same derived file from identical inputs. Use of a specified CacheDir may be disabled for any invocation by using the option. If the option is used, scons will place a copy of all derived files in the cache, even if they already existed and were not built by this invocation. This is useful to populate a cache the first time CacheDir is added to a build, or after using the option. When using CacheDir, scons will report, "Retrieved `file' from cache," unless the option is being used. When the option is used, scons will print the action that would have been used to build the file, without any indication that the file was actually retrieved from the cache. This is useful to generate build logs that are equivalent regardless of whether a given derived file has been built in-place or retrieved from the cache. The NoCache method can be used to disable caching of specific files. This can be useful if inputs and/or outputs of some tool are impossible to predict or prohibitively large. Clean(targets, files_or_dirs) env.Clean(targets, files_or_dirs) This specifies a list of files or directories which should be removed whenever the targets are specified with the command line option. The specified targets may be a list or an individual target. Multiple calls to Clean are legal, and create new targets or add files and directories to the clean list for the specified targets. Multiple files or directories should be specified either as separate arguments to the Clean method, or as a list. Clean will also accept the return value of any of the construction environment Builder methods. Examples: The related NoClean function overrides calling Clean for the same target, and any targets passed to both functions will not be removed by the option. Examples: Clean('foo', ['bar', 'baz']) Clean('dist', env.Program('hello', 'hello.c')) Clean(['foo', 'bar'], 'something_else_to_clean') In this example, installing the project creates a subdirectory for the documentation. This statement causes the subdirectory to be removed if the project is deinstalled. Clean(docdir, os.path.join(docdir, projectname)) env.Clone([key=val, ...]) Returns a separate copy of a construction environment. If there are any keyword arguments specified, they are added to the returned copy, overwriting any existing values for the keywords. Example: env2 = env.Clone() env3 = env.Clone(CCFLAGS = '-g') Additionally, a list of tools and a toolpath may be specified, as in the Environment constructor: def MyTool(env): env['FOO'] = 'bar' env4 = env.Clone(tools = ['msvc', MyTool]) The parse_flags keyword argument is also recognized: # create an environment for compiling programs that use wxWidgets wx_env = env.Clone(parse_flags = '!wx-config --cflags --cxxflags') Command(target, source, action, [key=val, ...]) env.Command(target, source, action, [key=val, ...]) Executes a specific action (or list of actions) to build a target file or files. This is more convenient than defining a separate Builder object for a single special-case build. As a special case, the source_scanner keyword argument can be used to specify a Scanner object that will be used to scan the sources. (The global DirScanner object can be used if any of the sources will be directories that must be scanned on-disk for changes to files that aren't already specified in other Builder of function calls.) Any other keyword arguments specified override any same-named existing construction variables. An action can be an external command, specified as a string, or a callable Python object; see "Action Objects," below, for more complete information. Also note that a string specifying an external command may be preceded by an @ (at-sign) to suppress printing the command in question, or by a - (hyphen) to ignore the exit status of the external command. Examples: env.Command('foo.out', 'foo.in', "$FOO_BUILD < $SOURCES > $TARGET") env.Command('bar.out', 'bar.in', ["rm -f $TARGET", "$BAR_BUILD < $SOURCES > $TARGET"], ENV = {'PATH' : '/usr/local/bin/'}) def rename(env, target, source): import os os.rename('.tmp', str(target[0])) env.Command('baz.out', 'baz.in', ["$BAZ_BUILD < $SOURCES > .tmp", rename ]) Note that the Command function will usually assume, by default, that the specified targets and/or sources are Files, if no other part of the configuration identifies what type of entry it is. If necessary, you can explicitly specify that targets or source nodes should be treated as directoriese by using the Dir or env.Dir() functions. Examples: env.Command('ddd.list', Dir('ddd'), 'ls -l $SOURCE > $TARGET') env['DISTDIR'] = 'destination/directory' env.Command(env.Dir('$DISTDIR')), None, make_distdir) (Also note that SCons will usually automatically create any directory necessary to hold a target file, so you normally don't need to create directories by hand.) Configure(env, [custom_tests, conf_dir, log_file, config_h]) env.Configure([custom_tests, conf_dir, log_file, config_h]) Creates a Configure object for integrated functionality similar to GNU autoconf. See the section "Configure Contexts," below, for a complete explanation of the arguments and behavior. env.Copy([key=val, ...]) A now-deprecated synonym for env.Clone(). Decider(function) env.Decider(function) Specifies that all up-to-date decisions for targets built through this construction environment will be handled by the specified function. The function can be one of the following strings that specify the type of decision function to be performed: timestamp-newer Specifies that a target shall be considered out of date and rebuilt if the dependency's timestamp is newer than the target file's timestamp. This is the behavior of the classic Make utility, and make can be used a synonym for timestamp-newer. timestamp-match Specifies that a target shall be considered out of date and rebuilt if the dependency's timestamp is different than the timestamp recorded the last time the target was built. This provides behavior very similar to the classic Make utility (in particular, files are not opened up so that their contents can be checksummed) except that the target will also be rebuilt if a dependency file has been restored to a version with an earlier timestamp, such as can happen when restoring files from backup archives. MD5 Specifies that a target shall be considered out of date and rebuilt if the dependency's content has changed since the last time the target was built, as determined be performing an MD5 checksum on the dependency's contents and comparing it to the checksum recorded the last time the target was built. content can be used as a synonym for MD5. MD5-timestamp Specifies that a target shall be considered out of date and rebuilt if the dependency's content has changed since the last time the target was built, except that dependencies with a timestamp that matches the last time the target was rebuilt will be assumed to be up-to-date and not rebuilt. This provides behavior very similar to the MD5 behavior of always checksumming file contents, with an optimization of not checking the contents of files whose timestamps haven't changed. The drawback is that SCons will not detect if a file's content has changed but its timestamp is the same, as might happen in an automated script that runs a build, updates a file, and runs the build again, all within a single second. Examples: # Use exact timestamp matches by default. Decider('timestamp-match') # Use MD5 content signatures for any targets built # with the attached construction environment. env.Decider('content') In addition to the above already-available functions, the function argument may be an actual Python function that takes the following three arguments: dependency The Node (file) which should cause the target to be rebuilt if it has "changed" since the last tme target was built. target The Node (file) being built. In the normal case, this is what should get rebuilt if the dependency has "changed." prev_ni Stored information about the state of the dependency the last time the target was built. This can be consulted to match various file characteristics such as the timestamp, size, or content signature. The function should return a True (non-zero) value if the dependency has "changed" since the last time the target was built (indicating that the target should be rebuilt), and False (zero) otherwise (indicating that the target should not be rebuilt). Note that the decision can be made using whatever criteria are appopriate. Ignoring some or all of the function arguments is perfectly normal. Example: def my_decider(dependency, target, prev_ni): return not os.path.exists(str(target)) env.Decider(my_decider) Default(targets) env.Default(targets) This specifies a list of default targets, which will be built by scons if no explicit targets are given on the command line. Multiple calls to Default are legal, and add to the list of default targets. Multiple targets should be specified as separate arguments to the Default method, or as a list. Default will also accept the Node returned by any of a construction environment's builder methods. Examples: Default('foo', 'bar', 'baz') env.Default(['a', 'b', 'c']) hello = env.Program('hello', 'hello.c') env.Default(hello) An argument to Default of None will clear all default targets. Later calls to Default will add to the (now empty) default-target list like normal. The current list of targets added using the Default function or method is available in the DEFAULT_TARGETS list; see below. DefaultEnvironment([args]) Creates and returns a default construction environment object. This construction environment is used internally by SCons in order to execute many of the global functions in this list, and to fetch source files transparently from source code management systems. Depends(target, dependency) env.Depends(target, dependency) Specifies an explicit dependency; the target will be rebuilt whenever the dependency has changed. Both the specified target and dependency can be a string (usually the path name of a file or directory) or Node objects, or a list of strings or Node objects (such as returned by a Builder call). This should only be necessary for cases where the dependency is not caught by a Scanner for the file. Example: env.Depends('foo', 'other-input-file-for-foo') mylib = env.Library('mylib.c') installed_lib = env.Install('lib', mylib) bar = env.Program('bar.c') # Arrange for the library to be copied into the installation # directory before trying to build the "bar" program. # (Note that this is for example only. A "real" library # dependency would normally be configured through the $LIBS # and $LIBPATH variables, not using an env.Depends() call.) env.Depends(bar, installed_lib) env.Dictionary([vars]) Returns a dictionary object containing copies of all of the construction variables in the environment. If there are any variable names specified, only the specified construction variables are returned in the dictionary. Example: dict = env.Dictionary() cc_dict = env.Dictionary('CC', 'CCFLAGS', 'CCCOM') Dir(name, [directory]) env.Dir(name, [directory]) This returns a Directory Node, an object that represents the specified directory name. name can be a relative or absolute path. directory is an optional directory that will be used as the parent directory. If no directory is specified, the current script's directory is used as the parent. If name is a list, SCons returns a list of Dir nodes. Construction variables are expanded in name. Directory Nodes can be used anywhere you would supply a string as a directory name to a Builder method or function. Directory Nodes have attributes and methods that are useful in many situations; see "File and Directory Nodes," below. env.Dump([key]) Returns a pretty printable representation of the environment. key, if not None, should be a string containing the name of the variable of interest. This SConstruct: env=Environment() print env.Dump('CCCOM') will print: '$CC -c -o $TARGET $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $SOURCES' While this SConstruct: env=Environment() print env.Dump() will print: { 'AR': 'ar', 'ARCOM': '$AR $ARFLAGS $TARGET $SOURCES\n$RANLIB $RANLIBFLAGS $TARGET', 'ARFLAGS': ['r'], 'AS': 'as', 'ASCOM': '$AS $ASFLAGS -o $TARGET $SOURCES', 'ASFLAGS': [], ... EnsurePythonVersion(major, minor) env.EnsurePythonVersion(major, minor) Ensure that the Python version is at least major.minor. This function will print out an error message and exit SCons with a non-zero exit code if the actual Python version is not late enough. Example: EnsurePythonVersion(2,2) EnsureSConsVersion(major, minor, [revision]) env.EnsureSConsVersion(major, minor, [revision]) Ensure that the SCons version is at least major.minor, or major.minor.revision. if revision is specified. This function will print out an error message and exit SCons with a non-zero exit code if the actual SCons version is not late enough. Examples: EnsureSConsVersion(0,14) EnsureSConsVersion(0,96,90) Environment([key=value, ...]) env.Environment([key=value, ...]) Return a new construction environment initialized with the specified key=value pairs. Execute(action, [strfunction, varlist]) env.Execute(action, [strfunction, varlist]) Executes an Action object. The specified action may be an Action object (see the section "Action Objects," below, for a complete explanation of the arguments and behavior), or it may be a command-line string, list of commands, or executable Python function, each of which will be converted into an Action object and then executed. The exit value of the command or return value of the Python function will be returned. Note that scons will print an error message if the executed action fails--that is, exits with or returns a non-zero value. scons will not, however, automatically terminate the build if the specified action fails. If you want the build to stop in response to a failed Execute call, you must explicitly check for a non-zero return value: Execute(Copy('file.out', 'file.in')) if Execute("mkdir sub/dir/ectory"): # The mkdir failed, don't try to build. Exit(1) Exit([value]) env.Exit([value]) This tells scons to exit immediately with the specified value. A default exit value of 0 (zero) is used if no value is specified. Export(vars) env.Export(vars) This tells scons to export a list of variables from the current SConscript file to all other SConscript files. The exported variables are kept in a global collection, so subsequent calls to Export will over-write previous exports that have the same name. Multiple variable names can be passed to Export as separate arguments or as a list. Keyword arguments can be used to provide names and their values. A dictionary can be used to map variables to a different name when exported. Both local variables and global variables can be exported. Examples: env = Environment() # Make env available for all SConscript files to Import(). Export("env") package = 'my_name' # Make env and package available for all SConscript files:. Export("env", "package") # Make env and package available for all SConscript files: Export(["env", "package"]) # Make env available using the name debug: Export(debug = env) # Make env available using the name debug: Export({"debug":env}) Note that the SConscript function supports an exports argument that makes it easier to to export a variable or set of variables to a single SConscript file. See the description of the SConscript function, below. File(name, [directory]) env.File(name, [directory]) This returns a File Node, an object that represents the specified file name. name can be a relative or absolute path. directory is an optional directory that will be used as the parent directory. If name is a list, SCons returns a list of File nodes. Construction variables are expanded in name. File Nodes can be used anywhere you would supply a string as a file name to a Builder method or function. File Nodes have attributes and methods that are useful in many situations; see "File and Directory Nodes," below. FindFile(file, dirs) env.FindFile(file, dirs) Search for file in the path specified by dirs. dirs may be a list of directory names or a single directory name. In addition to searching for files that exist in the filesystem, this function also searches for derived files that have not yet been built. Example: foo = env.FindFile('foo', ['dir1', 'dir2']) FindInstalledFiles() env.FindInstalledFiles() Returns the list of targets set up by the Install or InstallAs builders. This function serves as a convenient method to select the contents of a binary package. Example: Install( '/bin', [ 'executable_a', 'executable_b' ] ) # will return the file node list # [ '/bin/executable_a', '/bin/executable_b' ] FindInstalledFiles() Install( '/lib', [ 'some_library' ] ) # will return the file node list # [ '/bin/executable_a', '/bin/executable_b', '/lib/some_library' ] FindInstalledFiles() FindPathDirs(variable) Returns a function (actually a callable Python object) intended to be used as the path_function of a Scanner object. The returned object will look up the specified variable in a construction environment and treat the construction variable's value as a list of directory paths that should be searched (like $CPPPATH, $LIBPATH, etc.). Note that use of FindPathDirs is generally preferable to writing your own path_function for the following reasons: 1) The returned list will contain all appropriate directories found in source trees (when VariantDir is used) or in code repositories (when Repository or the option are used). 2) scons will identify expansions of variable that evaluate to the same list of directories as, in fact, the same list, and avoid re-scanning the directories for files, when possible. Example: def my_scan(node, env, path, arg): # Code to scan file contents goes here... return include_files scanner = Scanner(name = 'myscanner', function = my_scan, path_function = FindPathDirs('MYPATH')) FindSourceFiles(node='"."') env.FindSourceFiles(node='"."') Returns the list of nodes which serve as the source of the built files. It does so by inspecting the dependency tree starting at the optional argument node which defaults to the '"."'-node. It will then return all leaves of node. These are all children which have no further children. This function is a convenient method to select the contents of a Source Package. Example: Program( 'src/main_a.c' ) Program( 'src/main_b.c' ) Program( 'main_c.c' ) # returns ['main_c.c', 'src/main_a.c', 'SConstruct', 'src/main_b.c'] FindSourceFiles() # returns ['src/main_b.c', 'src/main_a.c' ] FindSourceFiles( 'src' ) As you can see build support files (SConstruct in the above example) will also be returned by this function. Flatten(sequence) env.Flatten(sequence) Takes a sequence (that is, a Python list or tuple) that may contain nested sequences and returns a flattened list containing all of the individual elements in any sequence. This can be helpful for collecting the lists returned by calls to Builders; other Builders will automatically flatten lists specified as input, but direct Python manipulation of these lists does not. Examples: foo = Object('foo.c') bar = Object('bar.c') # Because `foo' and `bar' are lists returned by the Object() Builder, # `objects' will be a list containing nested lists: objects = ['f1.o', foo, 'f2.o', bar, 'f3.o'] # Passing such a list to another Builder is all right because # the Builder will flatten the list automatically: Program(source = objects) # If you need to manipulate the list directly using Python, you need to # call Flatten() yourself, or otherwise handle nested lists: for object in Flatten(objects): print str(object) GetBuildFailures() Returns a list of exceptions for the actions that failed while attempting to build targets. Each element in the returned list is a BuildError object with the following attributes that record various aspects of the build failure: .node The node that was being built when the build failure occurred. .status The numeric exit status returned by the command or Python function that failed when trying to build the specified Node. .errstr The SCons error string describing the build failure. (This is often a generic message like "Error 2" to indicate that an executed command exited with a status of 2.) .filename The name of the file or directory that actually caused the failure. This may be different from the .node attribute. For example, if an attempt to build a target named sub/dir/target fails because the sub/dir directory could not be created, then the .node attribute will be sub/dir/target but the .filename attribute will be sub/dir. .executor The SCons Executor object for the target Node being built. This can be used to retrieve the construction environment used for the failed action. .action The actual SCons Action object that failed. This will be one specific action out of the possible list of actions that would have been executed to build the target. .command The actual expanded command that was executed and failed, after expansion of $TARGET, $SOURCE, and other construction variables. Note that the GetBuildFailures function will always return an empty list until any build failure has occurred, which means that GetBuildFailures will always return an empty list while the SConscript files are being read. Its primary intended use is for functions that will be executed before SCons exits by passing them to the standard Python atexit.register() function. Example: import atexit def print_build_failures(): from SCons.Script import GetBuildFailures for bf in GetBuildFailures(): print("%s failed: %s" % (bf.node, bf.errstr)) atexit.register(print_build_failures) GetBuildPath(file, [...]) env.GetBuildPath(file, [...]) Returns the scons path name (or names) for the specified file (or files). The specified file or files may be scons Nodes or strings representing path names. GetLaunchDir() env.GetLaunchDir() Returns the absolute path name of the directory from which scons was initially invoked. This can be useful when using the , or options, which internally change to the directory in which the SConstruct file is found. GetOption(name) env.GetOption(name) This function provides a way to query the value of SCons options set on scons command line (or set using the SetOption function). The options supported are: cache_debug which corresponds to --cache-debug; cache_disable which corresponds to --cache-disable; cache_force which corresponds to --cache-force; cache_show which corresponds to --cache-show; clean which corresponds to -c, --clean and --remove; config which corresponds to --config; directory which corresponds to -C and --directory; diskcheck which corresponds to --diskcheck duplicate which corresponds to --duplicate; file which corresponds to -f, --file, --makefile and --sconstruct; help which corresponds to -h and --help; ignore_errors which corresponds to --ignore-errors; implicit_cache which corresponds to --implicit-cache; implicit_deps_changed which corresponds to --implicit-deps-changed; implicit_deps_unchanged which corresponds to --implicit-deps-unchanged; interactive which corresponds to --interact and --interactive; keep_going which corresponds to -k and --keep-going; max_drift which corresponds to --max-drift; no_exec which corresponds to -n, --no-exec, --just-print, --dry-run and --recon; no_site_dir which corresponds to --no-site-dir; num_jobs which corresponds to -j and --jobs; profile_file which corresponds to --profile; question which corresponds to -q and --question; random which corresponds to --random; repository which corresponds to -Y, --repository and --srcdir; silent which corresponds to -s, --silent and --quiet; site_dir which corresponds to --site-dir; stack_size which corresponds to --stack-size; taskmastertrace_file which corresponds to --taskmastertrace; and warn which corresponds to --warn and --warning. See the documentation for the corresponding command line object for information about each specific option. Glob(pattern, [ondisk, source, strings, exclude]) env.Glob(pattern, [ondisk, source, strings, exclude]) Returns Nodes (or strings) that match the specified pattern, relative to the directory of the current SConscript file. The env.Glob() form performs string substition on pattern and returns whatever matches the resulting expanded pattern. The specified pattern uses Unix shell style metacharacters for matching: * matches everything ? matches any single character [seq] matches any character in seq [!seq] matches any char not in seq If the first character of a filename is a dot, it must be matched explicitly. Character matches do not span directory separators. The Glob knows about repositories (see the Repository function) and source directories (see the VariantDir function) and returns a Node (or string, if so configured) in the local (SConscript) directory if matching Node is found anywhere in a corresponding repository or source directory. The ondisk argument may be set to False (or any other non-true value) to disable the search for matches on disk, thereby only returning matches among already-configured File or Dir Nodes. The default behavior is to return corresponding Nodes for any on-disk matches found. The source argument may be set to True (or any equivalent value) to specify that, when the local directory is a VariantDir, the returned Nodes should be from the corresponding source directory, not the local directory. The strings argument may be set to True (or any equivalent value) to have the Glob function return strings, not Nodes, that represent the matched files or directories. The returned strings will be relative to the local (SConscript) directory. (Note that This may make it easier to perform arbitrary manipulation of file names, but if the returned strings are passed to a different SConscript file, any Node translation will be relative to the other SConscript directory, not the original SConscript directory.) The exclude argument may be set to a pattern or a list of patterns (following the same Unix shell semantics) which must be filtered out of returned elements. Elements matching a least one pattern of this list will be excluded. Examples: Program('foo', Glob('*.c')) Zip('/tmp/everything', Glob('.??*') + Glob('*')) sources = Glob('*.cpp', exclude=['os_*_specific_*.cpp']) + Glob('os_%s_specific_*.cpp'%currentOS) Help(text, append=False) env.Help(text, append=False) This specifies help text to be printed if the argument is given to scons. If Help is called multiple times, the text is appended together in the order that Help is called. With append set to False, any Help text generated with AddOption is clobbered. If append is True, the AddOption help is prepended to the help string, thus preserving the message. Ignore(target, dependency) env.Ignore(target, dependency) The specified dependency file(s) will be ignored when deciding if the target file(s) need to be rebuilt. You can also use Ignore to remove a target from the default build. In order to do this you must specify the directory the target will be built in as the target, and the file you want to skip building as the dependency. Note that this will only remove the dependencies listed from the files built by default. It will still be built if that dependency is needed by another object being built. See the third and forth examples below. Examples: env.Ignore('foo', 'foo.c') env.Ignore('bar', ['bar1.h', 'bar2.h']) env.Ignore('.','foobar.obj') env.Ignore('bar','bar/foobar.obj') Import(vars) env.Import(vars) This tells scons to import a list of variables into the current SConscript file. This will import variables that were exported with Export or in the exports argument to SConscript. Variables exported by SConscript have precedence. Multiple variable names can be passed to Import as separate arguments or as a list. The variable "*" can be used to import all variables. Examples: Import("env") Import("env", "variable") Import(["env", "variable"]) Import("*") Literal(string) env.Literal(string) The specified string will be preserved as-is and not have construction variables expanded. Local(targets) env.Local(targets) The specified targets will have copies made in the local tree, even if an already up-to-date copy exists in a repository. Returns a list of the target Node or Nodes. env.MergeFlags(arg, [unique]) Merges the specified arg values to the construction environment's construction variables. If the arg argument is not a dictionary, it is converted to one by calling env.ParseFlags on the argument before the values are merged. Note that arg must be a single value, so multiple strings must be passed in as a list, not as separate arguments to env.MergeFlags. By default, duplicate values are eliminated; you can, however, specify unique=0 to allow duplicate values to be added. When eliminating duplicate values, any construction variables that end with the string PATH keep the left-most unique value. All other construction variables keep the right-most unique value. Examples: # Add an optimization flag to $CCFLAGS. env.MergeFlags('-O3') # Combine the flags returned from running pkg-config with an optimization # flag and merge the result into the construction variables. env.MergeFlags(['!pkg-config gtk+-2.0 --cflags', '-O3']) # Combine an optimization flag with the flags returned from running pkg-config # twice and merge the result into the construction variables. env.MergeFlags(['-O3', '!pkg-config gtk+-2.0 --cflags --libs', '!pkg-config libpng12 --cflags --libs']) NoCache(target, ...) env.NoCache(target, ...) Specifies a list of files which should not be cached whenever the CacheDir method has been activated. The specified targets may be a list or an individual target. Multiple files should be specified either as separate arguments to the NoCache method, or as a list. NoCache will also accept the return value of any of the construction environment Builder methods. Calling NoCache on directories and other non-File Node types has no effect because only File Nodes are cached. Examples: NoCache('foo.elf') NoCache(env.Program('hello', 'hello.c')) NoClean(target, ...) env.NoClean(target, ...) Specifies a list of files or directories which should not be removed whenever the targets (or their dependencies) are specified with the command line option. The specified targets may be a list or an individual target. Multiple calls to NoClean are legal, and prevent each specified target from being removed by calls to the option. Multiple files or directories should be specified either as separate arguments to the NoClean method, or as a list. NoClean will also accept the return value of any of the construction environment Builder methods. Calling NoClean for a target overrides calling Clean for the same target, and any targets passed to both functions will not be removed by the option. Examples: NoClean('foo.elf') NoClean(env.Program('hello', 'hello.c')) env.ParseConfig(command, [function, unique]) Calls the specified function to modify the environment as specified by the output of command. The default function is env.MergeFlags, which expects the output of a typical *-config command (for example, gtk-config) and adds the options to the appropriate construction variables. By default, duplicate values are not added to any construction variables; you can specify unique=0 to allow duplicate values to be added. Interpreted options and the construction variables they affect are as specified for the env.ParseFlags method (which this method calls). See that method's description, below, for a table of options and construction variables. ParseDepends(filename, [must_exist, only_one]) env.ParseDepends(filename, [must_exist, only_one]) Parses the contents of the specified filename as a list of dependencies in the style of Make or mkdep, and explicitly establishes all of the listed dependencies. By default, it is not an error if the specified filename does not exist. The optional must_exist argument may be set to a non-zero value to have scons throw an exception and generate an error if the file does not exist, or is otherwise inaccessible. The optional only_one argument may be set to a non-zero value to have scons thrown an exception and generate an error if the file contains dependency information for more than one target. This can provide a small sanity check for files intended to be generated by, for example, the gcc -M flag, which should typically only write dependency information for one output file into a corresponding .d file. The filename and all of the files listed therein will be interpreted relative to the directory of the SConscript file which calls the ParseDepends function. env.ParseFlags(flags, ...) Parses one or more strings containing typical command-line flags for GCC tool chains and returns a dictionary with the flag values separated into the appropriate SCons construction variables. This is intended as a companion to the env.MergeFlags method, but allows for the values in the returned dictionary to be modified, if necessary, before merging them into the construction environment. (Note that env.MergeFlags will call this method if its argument is not a dictionary, so it is usually not necessary to call env.ParseFlags directly unless you want to manipulate the values.) If the first character in any string is an exclamation mark (!), the rest of the string is executed as a command, and the output from the command is parsed as GCC tool chain command-line flags and added to the resulting dictionary. Flag values are translated accordig to the prefix found, and added to the following construction variables: -arch CCFLAGS, LINKFLAGS -D CPPDEFINES -framework FRAMEWORKS -frameworkdir= FRAMEWORKPATH -include CCFLAGS -isysroot CCFLAGS, LINKFLAGS -I CPPPATH -l LIBS -L LIBPATH -mno-cygwin CCFLAGS, LINKFLAGS -mwindows LINKFLAGS -pthread CCFLAGS, LINKFLAGS -std= CFLAGS -Wa, ASFLAGS, CCFLAGS -Wl,-rpath= RPATH -Wl,-R, RPATH -Wl,-R RPATH -Wl, LINKFLAGS -Wp, CPPFLAGS - CCFLAGS + CCFLAGS, LINKFLAGS Any other strings not associated with options are assumed to be the names of libraries and added to the $LIBS construction variable. Examples (all of which produce the same result): dict = env.ParseFlags('-O2 -Dfoo -Dbar=1') dict = env.ParseFlags('-O2', '-Dfoo', '-Dbar=1') dict = env.ParseFlags(['-O2', '-Dfoo -Dbar=1']) dict = env.ParseFlags('-O2', '!echo -Dfoo -Dbar=1') Platform(string) The Platform form returns a callable object that can be used to initialize a construction environment using the platform keyword of the Environment function. Example: env = Environment(platform = Platform('win32')) The env.Platform form applies the callable object for the specified platform string to the environment through which the method was called. env.Platform('posix') Note that the win32 platform adds the SystemDrive and SystemRoot variables from the user's external environment to the construction environment's $ENV dictionary. This is so that any executed commands that use sockets to connect with other systems (such as fetching source files from external CVS repository specifications like :pserver:anonymous@cvs.sourceforge.net:/cvsroot/scons) will work on Windows systems. Precious(target, ...) env.Precious(target, ...) Marks each given target as precious so it is not deleted before it is rebuilt. Normally scons deletes a target before building it. Multiple targets can be passed in to a single call to Precious. env.Prepend(key=val, [...]) Appends the specified keyword arguments to the beginning of construction variables in the environment. If the Environment does not have the specified construction variable, it is simply added to the environment. If the values of the construction variable and the keyword argument are the same type, then the two values will be simply added together. Otherwise, the construction variable and the value of the keyword argument are both coerced to lists, and the lists are added together. (See also the Append method, above.) Example: env.Prepend(CCFLAGS = '-g ', FOO = ['foo.yyy']) env.PrependENVPath(name, newpath, [envname, sep, delete_existing]) This appends new path elements to the given path in the specified external environment ($ENV by default). This will only add any particular path once (leaving the first one it encounters and ignoring the rest, to preserve path order), and to help assure this, will normalize all paths (using os.path.normpath and os.path.normcase). This can also handle the case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string. If delete_existing is 0, then adding a path that already exists will not move it to the beginning; it will stay where it is in the list. Example: print 'before:',env['ENV']['INCLUDE'] include_path = '/foo/bar:/foo' env.PrependENVPath('INCLUDE', include_path) print 'after:',env['ENV']['INCLUDE'] The above example will print: before: /biz:/foo after: /foo/bar:/foo:/biz env.PrependUnique(key=val, delete_existing=0, [...]) Appends the specified keyword arguments to the beginning of construction variables in the environment. If the Environment does not have the specified construction variable, it is simply added to the environment. If the construction variable being appended to is a list, then any value(s) that already exist in the construction variable will not be added again to the list. However, if delete_existing is 1, existing matching values are removed first, so existing values in the arg list move to the front of the list. Example: env.PrependUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) Progress(callable, [interval]) Progress(string, [interval, file, overwrite]) Progress(list_of_strings, [interval, file, overwrite]) Allows SCons to show progress made during the build by displaying a string or calling a function while evaluating Nodes (e.g. files). If the first specified argument is a Python callable (a function or an object that has a __call__() method), the function will be called once every interval times a Node is evaluated. The callable will be passed the evaluated Node as its only argument. (For future compatibility, it's a good idea to also add *args and **kw as arguments to your function or method. This will prevent the code from breaking if SCons ever changes the interface to call the function with additional arguments in the future.) An example of a simple custom progress function that prints a string containing the Node name every 10 Nodes: def my_progress_function(node, *args, **kw): print('Evaluating node %s!' % node) Progress(my_progress_function, interval=10) A more complicated example of a custom progress display object that prints a string containing a count every 100 evaluated Nodes. Note the use of \r (a carriage return) at the end so that the string will overwrite itself on a display: import sys class ProgressCounter(object): count = 0 def __call__(self, node, *args, **kw): self.count += 100 sys.stderr.write('Evaluated %s nodes\r' % self.count) Progress(ProgressCounter(), interval=100) If the first argument Progress is a string, the string will be displayed every interval evaluated Nodes. The default is to print the string on standard output; an alternate output stream may be specified with the file= argument. The following will print a series of dots on the error output, one dot for every 100 evaluated Nodes: import sys Progress('.', interval=100, file=sys.stderr) If the string contains the verbatim substring $TARGET, it will be replaced with the Node. Note that, for performance reasons, this is not a regular SCons variable substition, so you can not use other variables or use curly braces. The following example will print the name of every evaluated Node, using a \r (carriage return) to cause each line to overwritten by the next line, and the overwrite= keyword argument to make sure the previously-printed file name is overwritten with blank spaces: import sys Progress('$TARGET\r', overwrite=True) If the first argument to Progress is a list of strings, then each string in the list will be displayed in rotating fashion every interval evaluated Nodes. This can be used to implement a "spinner" on the user's screen as follows: Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5) Pseudo(target, ...) env.Pseudo(target, ...) This indicates that each given target should not be created by the build rule, and if the target is created, an error will be generated. This is similar to the gnu make .PHONY target. However, in the vast majority of cases, an Alias is more appropriate. Multiple targets can be passed in to a single call to Pseudo. PyPackageDir(modulename) env.PyPackageDir(modulename) This returns a Directory Node similar to Dir. The python module / package is looked up and if located the directory is returned for the location. modulename Is a named python package / module to lookup the directory for it's location. If modulename is a list, SCons returns a list of Dir nodes. Construction variables are expanded in modulename. env.Replace(key=val, [...]) Replaces construction variables in the Environment with the specified keyword arguments. Example: env.Replace(CCFLAGS = '-g', FOO = 'foo.xxx') Repository(directory) env.Repository(directory) Specifies that directory is a repository to be searched for files. Multiple calls to Repository are legal, and each one adds to the list of repositories that will be searched. To scons, a repository is a copy of the source tree, from the top-level directory on down, which may contain both source files and derived files that can be used to build targets in the local source tree. The canonical example would be an official source tree maintained by an integrator. If the repository contains derived files, then the derived files should have been built using scons, so that the repository contains the necessary signature information to allow scons to figure out when it is appropriate to use the repository copy of a derived file, instead of building one locally. Note that if an up-to-date derived file already exists in a repository, scons will not make a copy in the local directory tree. In order to guarantee that a local copy will be made, use the Local method. Requires(target, prerequisite) env.Requires(target, prerequisite) Specifies an order-only relationship between the specified target file(s) and the specified prerequisite file(s). The prerequisite file(s) will be (re)built, if necessary, before the target file(s), but the target file(s) do not actually depend on the prerequisites and will not be rebuilt simply because the prerequisite file(s) change. Example: env.Requires('foo', 'file-that-must-be-built-before-foo') Return([vars..., stop=]) By default, this stops processing the current SConscript file and returns to the calling SConscript file the values of the variables named in the vars string arguments. Multiple strings contaning variable names may be passed to Return. Any strings that contain white space The optional stop= keyword argument may be set to a false value to continue processing the rest of the SConscript file after the Return call. This was the default behavior prior to SCons 0.98. However, the values returned are still the values of the variables in the named vars at the point Return is called. Examples: # Returns without returning a value. Return() # Returns the value of the 'foo' Python variable. Return("foo") # Returns the values of the Python variables 'foo' and 'bar'. Return("foo", "bar") # Returns the values of Python variables 'val1' and 'val2'. Return('val1 val2') Scanner(function, [argument, keys, path_function, node_class, node_factory, scan_check, recursive]) env.Scanner(function, [argument, keys, path_function, node_class, node_factory, scan_check, recursive]) Creates a Scanner object for the specified function. See the section "Scanner Objects," below, for a complete explanation of the arguments and behavior. SConscript(scripts, [exports, variant_dir, duplicate]) env.SConscript(scripts, [exports, variant_dir, duplicate]) SConscript(dirs=subdirs, [name=script, exports, variant_dir, duplicate]) env.SConscript(dirs=subdirs, [name=script, exports, variant_dir, duplicate]) This tells scons to execute one or more subsidiary SConscript (configuration) files. Any variables returned by a called script using Return will be returned by the call to SConscript. There are two ways to call the SConscript function. The first way you can call SConscript is to explicitly specify one or more scripts as the first argument. A single script may be specified as a string; multiple scripts must be specified as a list (either explicitly or as created by a function like Split). Examples: SConscript('SConscript') # run SConscript in the current directory SConscript('src/SConscript') # run SConscript in the src directory SConscript(['src/SConscript', 'doc/SConscript']) config = SConscript('MyConfig.py') The second way you can call SConscript is to specify a list of (sub)directory names as a dirs=subdirs keyword argument. In this case, scons will, by default, execute a subsidiary configuration file named SConscript in each of the specified directories. You may specify a name other than SConscript by supplying an optional name=script keyword argument. The first three examples below have the same effect as the first three examples above: SConscript(dirs='.') # run SConscript in the current directory SConscript(dirs='src') # run SConscript in the src directory SConscript(dirs=['src', 'doc']) SConscript(dirs=['sub1', 'sub2'], name='MySConscript') The optional exports argument provides a list of variable names or a dictionary of named values to export to the script(s). These variables are locally exported only to the specified script(s), and do not affect the global pool of variables used by the Export function. The subsidiary script(s) must use the Import function to import the variables. Examples: foo = SConscript('sub/SConscript', exports='env') SConscript('dir/SConscript', exports=['env', 'variable']) SConscript(dirs='subdir', exports='env variable') SConscript(dirs=['one', 'two', 'three'], exports='shared_info') If the optional variant_dir argument is present, it causes an effect equivalent to the VariantDir method described below. (If variant_dir is not present, the duplicate argument is ignored.) The variant_dir argument is interpreted relative to the directory of the calling SConscript file. See the description of the VariantDir function below for additional details and restrictions. If variant_dir is present, the source directory is the directory in which the SConscript file resides and the SConscript file is evaluated as if it were in the variant_dir directory: SConscript('src/SConscript', variant_dir = 'build') is equivalent to VariantDir('build', 'src') SConscript('build/SConscript') This later paradigm is often used when the sources are in the same directory as the SConstruct: SConscript('SConscript', variant_dir = 'build') is equivalent to VariantDir('build', '.') SConscript('build/SConscript') Here are some composite examples: # collect the configuration information and use it to build src and doc shared_info = SConscript('MyConfig.py') SConscript('src/SConscript', exports='shared_info') SConscript('doc/SConscript', exports='shared_info') # build debugging and production versions. SConscript # can use Dir('.').path to determine variant. SConscript('SConscript', variant_dir='debug', duplicate=0) SConscript('SConscript', variant_dir='prod', duplicate=0) # build debugging and production versions. SConscript # is passed flags to use. opts = { 'CPPDEFINES' : ['DEBUG'], 'CCFLAGS' : '-pgdb' } SConscript('SConscript', variant_dir='debug', duplicate=0, exports=opts) opts = { 'CPPDEFINES' : ['NODEBUG'], 'CCFLAGS' : '-O' } SConscript('SConscript', variant_dir='prod', duplicate=0, exports=opts) # build common documentation and compile for different architectures SConscript('doc/SConscript', variant_dir='build/doc', duplicate=0) SConscript('src/SConscript', variant_dir='build/x86', duplicate=0) SConscript('src/SConscript', variant_dir='build/ppc', duplicate=0) SConscriptChdir(value) env.SConscriptChdir(value) By default, scons changes its working directory to the directory in which each subsidiary SConscript file lives. This behavior may be disabled by specifying either: SConscriptChdir(0) env.SConscriptChdir(0) in which case scons will stay in the top-level directory while reading all SConscript files. (This may be necessary when building from repositories, when all the directories in which SConscript files may be found don't necessarily exist locally.) You may enable and disable this ability by calling SConscriptChdir() multiple times. Example: env = Environment() SConscriptChdir(0) SConscript('foo/SConscript') # will not chdir to foo env.SConscriptChdir(1) SConscript('bar/SConscript') # will chdir to bar SConsignFile([file, dbm_module]) env.SConsignFile([file, dbm_module]) This tells scons to store all file signatures in the specified database file. If the file name is omitted, .sconsign is used by default. (The actual file name(s) stored on disk may have an appropriated suffix appended by the dbm_module.) If file is not an absolute path name, the file is placed in the same directory as the top-level SConstruct file. If file is None, then scons will store file signatures in a separate .sconsign file in each directory, not in one global database file. (This was the default behavior prior to SCons 0.96.91 and 0.97.) The optional dbm_module argument can be used to specify which Python database module The default is to use a custom SCons.dblite module that uses pickled Python data structures, and which works on all Python versions. Examples: # Explicitly stores signatures in ".sconsign.dblite" # in the top-level SConstruct directory (the # default behavior). SConsignFile() # Stores signatures in the file "etc/scons-signatures" # relative to the top-level SConstruct directory. SConsignFile("etc/scons-signatures") # Stores signatures in the specified absolute file name. SConsignFile("/home/me/SCons/signatures") # Stores signatures in a separate .sconsign file # in each directory. SConsignFile(None) env.SetDefault(key=val, [...]) Sets construction variables to default values specified with the keyword arguments if (and only if) the variables are not already set. The following statements are equivalent: env.SetDefault(FOO = 'foo') if 'FOO' not in env: env['FOO'] = 'foo' SetOption(name, value) env.SetOption(name, value) This function provides a way to set a select subset of the scons command line options from a SConscript file. The options supported are: clean which corresponds to -c, --clean and --remove; duplicate which corresponds to --duplicate; help which corresponds to -h and --help; implicit_cache which corresponds to --implicit-cache; max_drift which corresponds to --max-drift; no_exec which corresponds to -n, --no-exec, --just-print, --dry-run and --recon; num_jobs which corresponds to -j and --jobs; random which corresponds to --random; and silent which corresponds to --silent. stack_size which corresponds to --stack-size. See the documentation for the corresponding command line object for information about each specific option. Example: SetOption('max_drift', 1) SideEffect(side_effect, target) env.SideEffect(side_effect, target) Declares side_effect as a side effect of building target. Both side_effect and target can be a list, a file name, or a node. A side effect is a target file that is created or updated as a side effect of building other targets. For example, a Windows PDB file is created as a side effect of building the .obj files for a static library, and various log files are created updated as side effects of various TeX commands. If a target is a side effect of multiple build commands, scons will ensure that only one set of commands is executed at a time. Consequently, you only need to use this method for side-effect targets that are built as a result of multiple build commands. Because multiple build commands may update the same side effect file, by default the side_effect target is not automatically removed when the target is removed by the option. (Note, however, that the side_effect might be removed as part of cleaning the directory in which it lives.) If you want to make sure the side_effect is cleaned whenever a specific target is cleaned, you must specify this explicitly with the Clean or env.Clean function. SourceCode(entries, builder) env.SourceCode(entries, builder) This function and its associate factory functions are deprecated. There is no replacement. The intended use was to keep a local tree in sync with an archive, but in actuality the function only causes the archive to be fetched on the first run. Synchronizing with the archive is best done external to SCons. Arrange for non-existent source files to be fetched from a source code management system using the specified builder. The specified entries may be a Node, string or list of both, and may represent either individual source files or directories in which source files can be found. For any non-existent source files, scons will search up the directory tree and use the first SourceCode builder it finds. The specified builder may be None, in which case scons will not use a builder to fetch source files for the specified entries, even if a SourceCode builder has been specified for a directory higher up the tree. scons will, by default, fetch files from SCCS or RCS subdirectories without explicit configuration. This takes some extra processing time to search for the necessary source code management files on disk. You can avoid these extra searches and speed up your build a little by disabling these searches as follows: env.SourceCode('.', None) Note that if the specified builder is one you create by hand, it must have an associated construction environment to use when fetching a source file. scons provides a set of canned factory functions that return appropriate Builders for various popular source code management systems. Canonical examples of invocation include: env.SourceCode('.', env.BitKeeper('/usr/local/BKsources')) env.SourceCode('src', env.CVS('/usr/local/CVSROOT')) env.SourceCode('/', env.RCS()) env.SourceCode(['f1.c', 'f2.c'], env.SCCS()) env.SourceCode('no_source.c', None) SourceSignatures(type) env.SourceSignatures(type) Note: Although it is not yet officially deprecated, use of this function is discouraged. See the Decider function for a more flexible and straightforward way to configure SCons' decision-making. The SourceSignatures function tells scons how to decide if a source file (a file that is not built from any other files) has changed since the last time it was used to build a particular target file. Legal values are MD5 or timestamp. If the environment method is used, the specified type of source signature is only used when deciding whether targets built with that environment are up-to-date or must be rebuilt. If the global function is used, the specified type of source signature becomes the default used for all decisions about whether targets are up-to-date. MD5 means scons decides that a source file has changed if the MD5 checksum of its contents has changed since the last time it was used to rebuild a particular target file. timestamp means scons decides that a source file has changed if its timestamp (modification time) has changed since the last time it was used to rebuild a particular target file. (Note that although this is similar to the behavior of Make, by default it will also rebuild if the dependency is older than the last time it was used to rebuild the target file.) There is no different between the two behaviors for Python Value node objects. MD5 signatures take longer to compute, but are more accurate than timestamp signatures. The default value is MD5. Note that the default TargetSignatures setting (see below) is to use this SourceSignatures setting for any target files that are used to build other target files. Consequently, changing the value of SourceSignatures will, by default, affect the up-to-date decision for all files in the build (or all files built with a specific construction environment when env.SourceSignatures is used). Split(arg) env.Split(arg) Returns a list of file names or other objects. If arg is a string, it will be split on strings of white-space characters within the string, making it easier to write long lists of file names. If arg is already a list, the list will be returned untouched. If arg is any other type of object, it will be returned as a list containing just the object. Example: files = Split("f1.c f2.c f3.c") files = env.Split("f4.c f5.c f6.c") files = Split(""" f7.c f8.c f9.c """) env.subst(input, [raw, target, source, conv]) Performs construction variable interpolation on the specified string or sequence argument input. By default, leading or trailing white space will be removed from the result. and all sequences of white space will be compressed to a single space character. Additionally, any $( and $) character sequences will be stripped from the returned string, The optional raw argument may be set to 1 if you want to preserve white space and $(-$) sequences. The raw argument may be set to 2 if you want to strip all characters between any $( and $) pairs (as is done for signature calculation). If the input is a sequence (list or tuple), the individual elements of the sequence will be expanded, and the results will be returned as a list. The optional target and source keyword arguments must be set to lists of target and source nodes, respectively, if you want the $TARGET, $TARGETS, $SOURCE and $SOURCES to be available for expansion. This is usually necessary if you are calling env.subst from within a Python function used as an SCons action. Returned string values or sequence elements are converted to their string representation by default. The optional conv argument may specify a conversion function that will be used in place of the default. For example, if you want Python objects (including SCons Nodes) to be returned as Python objects, you can use the Python Λ idiom to pass in an unnamed function that simply returns its unconverted argument. Example: print env.subst("The C compiler is: $CC") def compile(target, source, env): sourceDir = env.subst("${SOURCE.srcdir}", target=target, source=source) source_nodes = env.subst('$EXPAND_TO_NODELIST', conv=lambda x: x) Tag(node, tags) Annotates file or directory Nodes with information about how the Package Builder should package those files or directories. All tags are optional. Examples: # makes sure the built library will be installed with 0644 file # access mode Tag( Library( 'lib.c' ), UNIX_ATTR="0644" ) # marks file2.txt to be a documentation file Tag( 'file2.txt', DOC ) TargetSignatures(type) env.TargetSignatures(type) Note: Although it is not yet officially deprecated, use of this function is discouraged. See the Decider function for a more flexible and straightforward way to configure SCons' decision-making. The TargetSignatures function tells scons how to decide if a target file (a file that is built from any other files) has changed since the last time it was used to build some other target file. Legal values are "build"; "content" (or its synonym "MD5"); "timestamp"; or "source". If the environment method is used, the specified type of target signature is only used for targets built with that environment. If the global function is used, the specified type of signature becomes the default used for all target files that don't have an explicit target signature type specified for their environments. "content" (or its synonym "MD5") means scons decides that a target file has changed if the MD5 checksum of its contents has changed since the last time it was used to rebuild some other target file. This means scons will open up MD5 sum the contents of target files after they're built, and may decide that it does not need to rebuild "downstream" target files if a file was rebuilt with exactly the same contents as the last time. "timestamp" means scons decides that a target file has changed if its timestamp (modification time) has changed since the last time it was used to rebuild some other target file. (Note that although this is similar to the behavior of Make, by default it will also rebuild if the dependency is older than the last time it was used to rebuild the target file.) "source" means scons decides that a target file has changed as specified by the corresponding SourceSignatures setting ("MD5" or "timestamp"). This means that scons will treat all input files to a target the same way, regardless of whether they are source files or have been built from other files. "build" means scons decides that a target file has changed if it has been rebuilt in this invocation or if its content or timestamp have changed as specified by the corresponding SourceSignatures setting. This "propagates" the status of a rebuilt file so that other "downstream" target files will always be rebuilt, even if the contents or the timestamp have not changed. "build" signatures are fastest because "content" (or "MD5") signatures take longer to compute, but are more accurate than "timestamp" signatures, and can prevent unnecessary "downstream" rebuilds when a target file is rebuilt to the exact same contents as the previous build. The "source" setting provides the most consistent behavior when other target files may be rebuilt from both source and target input files. The default value is "source". Because the default setting is "source", using SourceSignatures is generally preferable to TargetSignatures, so that the up-to-date decision will be consistent for all files (or all files built with a specific construction environment). Use of TargetSignatures provides specific control for how built target files affect their "downstream" dependencies. Tool(string, [toolpath, **kw]) env.Tool(string, [toolpath, **kw]) The Tool form of the function returns a callable object that can be used to initialize a construction environment using the tools keyword of the Environment() method. The object may be called with a construction environment as an argument, in which case the object will add the necessary variables to the construction environment and the name of the tool will be added to the $TOOLS construction variable. Additional keyword arguments are passed to the tool's generate() method. Examples: env = Environment(tools = [ Tool('msvc') ]) env = Environment() t = Tool('msvc') t(env) # adds 'msvc' to the TOOLS variable u = Tool('opengl', toolpath = ['tools']) u(env) # adds 'opengl' to the TOOLS variable The env.Tool form of the function applies the callable object for the specified tool string to the environment through which the method was called. Additional keyword arguments are passed to the tool's generate() method. env.Tool('gcc') env.Tool('opengl', toolpath = ['build/tools']) Value(value, [built_value]) env.Value(value, [built_value]) Returns a Node object representing the specified Python value. Value Nodes can be used as dependencies of targets. If the result of calling str(value) changes between SCons runs, any targets depending on Value(value) will be rebuilt. (This is true even when using timestamps to decide if files are up-to-date.) When using timestamp source signatures, Value Nodes' timestamps are equal to the system time when the Node is created. The returned Value Node object has a write() method that can be used to "build" a Value Node by setting a new value. The optional built_value argument can be specified when the Value Node is created to indicate the Node should already be considered "built." There is a corresponding read() method that will return the built value of the Node. Examples: env = Environment() def create(target, source, env): # A function that will write a 'prefix=$SOURCE' # string into the file name specified as the # $TARGET. f = open(str(target[0]), 'wb') f.write('prefix=' + source[0].get_contents()) # Fetch the prefix= argument, if any, from the command # line, and use /usr/local as the default. prefix = ARGUMENTS.get('prefix', '/usr/local') # Attach a .Config() builder for the above function action # to the construction environment. env['BUILDERS']['Config'] = Builder(action = create) env.Config(target = 'package-config', source = Value(prefix)) def build_value(target, source, env): # A function that "builds" a Python Value by updating # the the Python value with the contents of the file # specified as the source of the Builder call ($SOURCE). target[0].write(source[0].get_contents()) output = env.Value('before') input = env.Value('after') # Attach a .UpdateValue() builder for the above function # action to the construction environment. env['BUILDERS']['UpdateValue'] = Builder(action = build_value) env.UpdateValue(target = Value(output), source = Value(input)) VariantDir(variant_dir, src_dir, [duplicate]) env.VariantDir(variant_dir, src_dir, [duplicate]) Use the VariantDir function to create a copy of your sources in another location: if a name under variant_dir is not found but exists under src_dir, the file or directory is copied to variant_dir. Target files can be built in a different directory than the original sources by simply refering to the sources (and targets) within the variant tree. VariantDir can be called multiple times with the same src_dir to set up multiple builds with different options (variants). The src_dir location must be in or underneath the SConstruct file's directory, and variant_dir may not be underneath src_dir. The default behavior is for scons to physically duplicate the source files in the variant tree. Thus, a build performed in the variant tree is guaranteed to be identical to a build performed in the source tree even if intermediate source files are generated during the build, or preprocessors or other scanners search for included files relative to the source file, or individual compilers or other invoked tools are hard-coded to put derived files in the same directory as source files. If possible on the platform, the duplication is performed by linking rather than copying; see also the command-line option. Moreover, only the files needed for the build are duplicated; files and directories that are not used are not present in variant_dir. Duplicating the source tree may be disabled by setting the duplicate argument to 0 (zero). This will cause scons to invoke Builders using the path names of source files in src_dir and the path names of derived files within variant_dir. This is always more efficient than duplicate=1, and is usually safe for most builds (but see above for cases that may cause problems). Note that VariantDir works most naturally with a subsidiary SConscript file. However, you would then call the subsidiary SConscript file not in the source directory, but in the variant_dir, regardless of the value of duplicate. This is how you tell scons which variant of a source tree to build: # run src/SConscript in two variant directories VariantDir('build/variant1', 'src') SConscript('build/variant1/SConscript') VariantDir('build/variant2', 'src') SConscript('build/variant2/SConscript') See also the SConscript function, described above, for another way to specify a variant directory in conjunction with calling a subsidiary SConscript file. Examples: # use names in the build directory, not the source directory VariantDir('build', 'src', duplicate=0) Program('build/prog', 'build/source.c') # this builds both the source and docs in a separate subtree VariantDir('build', '.', duplicate=0) SConscript(dirs=['build/src','build/doc']) # same as previous example, but only uses SConscript SConscript(dirs='src', variant_dir='build/src', duplicate=0) SConscript(dirs='doc', variant_dir='build/doc', duplicate=0) WhereIs(program, [path, pathext, reject]) env.WhereIs(program, [path, pathext, reject]) Searches for the specified executable program, returning the full path name to the program if it is found, and returning None if not. Searches the specified path, the value of the calling environment's PATH (env['ENV']['PATH']), or the user's current external PATH (os.environ['PATH']) by default. On Windows systems, searches for executable programs with any of the file extensions listed in the specified pathext, the calling environment's PATHEXT (env['ENV']['PATHEXT']) or the user's current PATHEXT (os.environ['PATHEXT']) by default. Will not select any path name or names in the specified reject list, if any. scons-src-3.0.0/doc/generated/variables.gen0000664000175000017500000114260313160023040020626 0ustar bdbaddogbdbaddog %scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> __LDMODULEVERSIONFLAGS This construction variable automatically introduces $_LDMODULEVERSIONFLAGS if $LDMODULEVERSION is set. Othervise it evaluates to an empty string. __SHLIBVERSIONFLAGS This construction variable automatically introduces $_SHLIBVERSIONFLAGS if $SHLIBVERSION is set. Othervise it evaluates to an empty string. AR The static library archiver. ARCHITECTURE Specifies the system architecture for which the package is being built. The default is the system architecture of the machine on which SCons is running. This is used to fill in the Architecture: field in an Ipkg control file, and as part of the name of a generated RPM file. ARCOM The command line used to generate a static library from object files. ARCOMSTR The string displayed when an object file is generated from an assembly-language source file. If this is not set, then $ARCOM (the command line) is displayed. env = Environment(ARCOMSTR = "Archiving $TARGET") ARFLAGS General options passed to the static library archiver. AS The assembler. ASCOM The command line used to generate an object file from an assembly-language source file. ASCOMSTR The string displayed when an object file is generated from an assembly-language source file. If this is not set, then $ASCOM (the command line) is displayed. env = Environment(ASCOMSTR = "Assembling $TARGET") ASFLAGS General options passed to the assembler. ASPPCOM The command line used to assemble an assembly-language source file into an object file after first running the file through the C preprocessor. Any options specified in the $ASFLAGS and $CPPFLAGS construction variables are included on this command line. ASPPCOMSTR The string displayed when an object file is generated from an assembly-language source file after first running the file through the C preprocessor. If this is not set, then $ASPPCOM (the command line) is displayed. env = Environment(ASPPCOMSTR = "Assembling $TARGET") ASPPFLAGS General options when an assembling an assembly-language source file into an object file after first running the file through the C preprocessor. The default is to use the value of $ASFLAGS. BIBTEX The bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. BIBTEXCOM The command line used to call the bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. BIBTEXCOMSTR The string displayed when generating a bibliography for TeX or LaTeX. If this is not set, then $BIBTEXCOM (the command line) is displayed. env = Environment(BIBTEXCOMSTR = "Generating bibliography $TARGET") BIBTEXFLAGS General options passed to the bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. BUILDERS A dictionary mapping the names of the builders available through this environment to underlying Builder objects. Builders named Alias, CFile, CXXFile, DVI, Library, Object, PDF, PostScript, and Program are available by default. If you initialize this variable when an Environment is created: env = Environment(BUILDERS = {'NewBuilder' : foo}) the default Builders will no longer be available. To use a new Builder object in addition to the default Builders, add your new Builder object like this: env = Environment() env.Append(BUILDERS = {'NewBuilder' : foo}) or this: env = Environment() env['BUILDERS]['NewBuilder'] = foo CC The C compiler. CCCOM The command line used to compile a C source file to a (static) object file. Any options specified in the $CFLAGS, $CCFLAGS and $CPPFLAGS construction variables are included on this command line. CCCOMSTR The string displayed when a C source file is compiled to a (static) object file. If this is not set, then $CCCOM (the command line) is displayed. env = Environment(CCCOMSTR = "Compiling static object $TARGET") CCFLAGS General options that are passed to the C and C++ compilers. CCPCHFLAGS Options added to the compiler command line to support building with precompiled headers. The default value expands expands to the appropriate Microsoft Visual C++ command-line options when the $PCH construction variable is set. CCPDBFLAGS Options added to the compiler command line to support storing debugging information in a Microsoft Visual C++ PDB file. The default value expands expands to appropriate Microsoft Visual C++ command-line options when the $PDB construction variable is set. The Visual C++ compiler option that SCons uses by default to generate PDB information is . This works correctly with parallel () builds because it embeds the debug information in the intermediate object files, as opposed to sharing a single PDB file between multiple object files. This is also the only way to get debug information embedded into a static library. Using the instead may yield improved link-time performance, although parallel builds will no longer work. You can generate PDB files with the switch by overriding the default $CCPDBFLAGS variable as follows: env['CCPDBFLAGS'] = ['${(PDB and "/Zi /Fd%s" % File(PDB)) or ""}'] An alternative would be to use the to put the debugging information in a separate .pdb file for each object file by overriding the $CCPDBFLAGS variable as follows: env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb' CCVERSION The version number of the C compiler. This may or may not be set, depending on the specific C compiler being used. CFILESUFFIX The suffix for C source files. This is used by the internal CFile builder when generating C files from Lex (.l) or YACC (.y) input files. The default suffix, of course, is .c (lower case). On case-insensitive systems (like Windows), SCons also treats .C (upper case) files as C files. CFLAGS General options that are passed to the C compiler (C only; not C++). CHANGE_SPECFILE A hook for modifying the file that controls the packaging build (the .spec for RPM, the control for Ipkg, the .wxs for MSI). If set, the function will be called after the SCons template for the file has been written. XXX CHANGED_SOURCES A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) CHANGED_TARGETS A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) CHANGELOG The name of a file containing the change log text to be included in the package. This is included as the %changelog section of the RPM .spec file. _concat A function used to produce variables like $_CPPINCFLAGS. It takes four or five arguments: a prefix to concatenate onto each element, a list of elements, a suffix to concatenate onto each element, an environment for variable interpolation, and an optional function that will be called to transform the list before concatenation. env['_CPPINCFLAGS'] = '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs)} $)', CONFIGUREDIR The name of the directory in which Configure context test files are written. The default is .sconf_temp in the top-level directory containing the SConstruct file. CONFIGURELOG The name of the Configure context log file. The default is config.log in the top-level directory containing the SConstruct file. _CPPDEFFLAGS An automatically-generated construction variable containing the C preprocessor command-line options to define values. The value of $_CPPDEFFLAGS is created by appending $CPPDEFPREFIX and $CPPDEFSUFFIX to the beginning and end of each definition in $CPPDEFINES. CPPDEFINES A platform independent specification of C preprocessor definitions. The definitions will be added to command lines through the automatically-generated $_CPPDEFFLAGS construction variable (see above), which is constructed according to the type of value of $CPPDEFINES: If $CPPDEFINES is a string, the values of the $CPPDEFPREFIX and $CPPDEFSUFFIX construction variables will be added to the beginning and end. # Will add -Dxyz to POSIX compiler command lines, # and /Dxyz to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES='xyz') If $CPPDEFINES is a list, the values of the $CPPDEFPREFIX and $CPPDEFSUFFIX construction variables will be appended to the beginning and end of each element in the list. If any element is a list or tuple, then the first item is the name being defined and the second item is its value: # Will add -DB=2 -DA to POSIX compiler command lines, # and /DB=2 /DA to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES=[('B', 2), 'A']) If $CPPDEFINES is a dictionary, the values of the $CPPDEFPREFIX and $CPPDEFSUFFIX construction variables will be appended to the beginning and end of each item from the dictionary. The key of each dictionary item is a name being defined to the dictionary item's corresponding value; if the value is None, then the name is defined without an explicit value. Note that the resulting flags are sorted by keyword to ensure that the order of the options on the command line is consistent each time scons is run. # Will add -DA -DB=2 to POSIX compiler command lines, # and /DA /DB=2 to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES={'B':2, 'A':None}) CPPDEFPREFIX The prefix used to specify preprocessor definitions on the C compiler command line. This will be appended to the beginning of each definition in the $CPPDEFINES construction variable when the $_CPPDEFFLAGS variable is automatically generated. CPPDEFSUFFIX The suffix used to specify preprocessor definitions on the C compiler command line. This will be appended to the end of each definition in the $CPPDEFINES construction variable when the $_CPPDEFFLAGS variable is automatically generated. CPPFLAGS User-specified C preprocessor options. These will be included in any command that uses the C preprocessor, including not just compilation of C and C++ source files via the $CCCOM, $SHCCCOM, $CXXCOM and $SHCXXCOM command lines, but also the $FORTRANPPCOM, $SHFORTRANPPCOM, $F77PPCOM and $SHF77PPCOM command lines used to compile a Fortran source file, and the $ASPPCOM command line used to assemble an assembly language source file, after first running each file through the C preprocessor. Note that this variable does not contain (or similar) include search path options that scons generates automatically from $CPPPATH. See $_CPPINCFLAGS, below, for the variable that expands to those options. _CPPINCFLAGS An automatically-generated construction variable containing the C preprocessor command-line options for specifying directories to be searched for include files. The value of $_CPPINCFLAGS is created by appending $INCPREFIX and $INCSUFFIX to the beginning and end of each directory in $CPPPATH. CPPPATH The list of directories that the C preprocessor will search for include directories. The C/C++ implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in CCFLAGS or CXXFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in CPPPATH will be looked-up relative to the SConscript directory when they are used in a command. To force scons to look-up a directory relative to the root of the source tree use #: env = Environment(CPPPATH='#/include') The directory look-up can also be forced using the Dir() function: include = Dir('include') env = Environment(CPPPATH=include) The directory list will be added to command lines through the automatically-generated $_CPPINCFLAGS construction variable, which is constructed by appending the values of the $INCPREFIX and $INCSUFFIX construction variables to the beginning and end of each directory in $CPPPATH. Any command lines you define that need the CPPPATH directory list should include $_CPPINCFLAGS: env = Environment(CCCOM="my_compiler $_CPPINCFLAGS -c -o $TARGET $SOURCE") CPPSUFFIXES The list of suffixes of files that will be scanned for C preprocessor implicit dependencies (#include lines). The default list is: [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", ".h", ".H", ".hxx", ".hpp", ".hh", ".F", ".fpp", ".FPP", ".m", ".mm", ".S", ".spp", ".SPP"] CXX The C++ compiler. CXXCOM The command line used to compile a C++ source file to an object file. Any options specified in the $CXXFLAGS and $CPPFLAGS construction variables are included on this command line. CXXCOMSTR The string displayed when a C++ source file is compiled to a (static) object file. If this is not set, then $CXXCOM (the command line) is displayed. env = Environment(CXXCOMSTR = "Compiling static object $TARGET") CXXFILESUFFIX The suffix for C++ source files. This is used by the internal CXXFile builder when generating C++ files from Lex (.ll) or YACC (.yy) input files. The default suffix is .cc. SCons also treats files with the suffixes .cpp, .cxx, .c++, and .C++ as C++ files, and files with .mm suffixes as Objective C++ files. On case-sensitive systems (Linux, UNIX, and other POSIX-alikes), SCons also treats .C (upper case) files as C++ files. CXXFLAGS General options that are passed to the C++ compiler. By default, this includes the value of $CCFLAGS, so that setting $CCFLAGS affects both C and C++ compilation. If you want to add C++-specific flags, you must set or override the value of $CXXFLAGS. CXXVERSION The version number of the C++ compiler. This may or may not be set, depending on the specific C++ compiler being used. DC The D compiler to use. The D compiler to use. The D compiler to use. DCOM The command line used to compile a D file to an object file. Any options specified in the $DFLAGS construction variable is included on this command line. The command line used to compile a D file to an object file. Any options specified in the $DFLAGS construction variable is included on this command line. The command line used to compile a D file to an object file. Any options specified in the $DFLAGS construction variable is included on this command line. DDEBUG List of debug tags to enable when compiling. List of debug tags to enable when compiling. List of debug tags to enable when compiling. DDEBUGPREFIX DDEBUGPREFIX. DDEBUGPREFIX. DDEBUGPREFIX. DDEBUGSUFFIX DDEBUGSUFFIX. DDEBUGSUFFIX. DDEBUGSUFFIX. DESCRIPTION A long description of the project being packaged. This is included in the relevant section of the file that controls the packaging build. DESCRIPTION_lang A language-specific long description for the specified lang. This is used to populate a %description -l section of an RPM .spec file. DFILESUFFIX DFILESUFFIX. DFILESUFFIX. DFILESUFFIX. DFLAGPREFIX DFLAGPREFIX. DFLAGPREFIX. DFLAGPREFIX. DFLAGS General options that are passed to the D compiler. General options that are passed to the D compiler. General options that are passed to the D compiler. DFLAGSUFFIX DFLAGSUFFIX. DFLAGSUFFIX. DFLAGSUFFIX. DINCPREFIX DINCPREFIX. DINCPREFIX. DINCPREFIX. DINCSUFFIX DLIBFLAGSUFFIX. DLIBFLAGSUFFIX. DLIBFLAGSUFFIX. Dir A function that converts a string into a Dir instance relative to the target being built. A function that converts a string into a Dir instance relative to the target being built. Dirs A function that converts a list of strings into a list of Dir instances relative to the target being built. DLIB Name of the lib tool to use for D codes. Name of the lib tool to use for D codes. Name of the lib tool to use for D codes. DLIBCOM The command line to use when creating libraries. The command line to use when creating libraries. The command line to use when creating libraries. DLIBDIRPREFIX DLIBLINKPREFIX. DLIBLINKPREFIX. DLIBLINKPREFIX. DLIBDIRSUFFIX DLIBLINKSUFFIX. DLIBLINKSUFFIX. DLIBLINKSUFFIX. DLIBFLAGPREFIX DLIBFLAGPREFIX. DLIBFLAGPREFIX. DLIBFLAGPREFIX. DLIBFLAGSUFFIX DLIBFLAGSUFFIX. DLIBFLAGSUFFIX. DLIBFLAGSUFFIX. DLIBLINKPREFIX DLIBLINKPREFIX. DLIBLINKPREFIX. DLIBLINKPREFIX. DLIBLINKSUFFIX DLIBLINKSUFFIX. DLIBLINKSUFFIX. DLIBLINKSUFFIX. DLINK Name of the linker to use for linking systems including D sources. Name of the linker to use for linking systems including D sources. Name of the linker to use for linking systems including D sources. DLINKCOM The command line to use when linking systems including D sources. The command line to use when linking systems including D sources. The command line to use when linking systems including D sources. DLINKFLAGPREFIX DLINKFLAGPREFIX. DLINKFLAGPREFIX. DLINKFLAGPREFIX. DLINKFLAGS List of linker flags. List of linker flags. List of linker flags. DLINKFLAGSUFFIX DLINKFLAGSUFFIX. DLINKFLAGSUFFIX. DLINKFLAGSUFFIX. DOCBOOK_DEFAULT_XSL_EPUB The default XSLT file for the DocbookEpub builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_HTML The default XSLT file for the DocbookHtml builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_HTMLCHUNKED The default XSLT file for the DocbookHtmlChunked builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_HTMLHELP The default XSLT file for the DocbookHtmlhelp builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_MAN The default XSLT file for the DocbookMan builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_PDF The default XSLT file for the DocbookPdf builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_SLIDESHTML The default XSLT file for the DocbookSlidesHtml builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_SLIDESPDF The default XSLT file for the DocbookSlidesPdf builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_FOP The path to the PDF renderer fop or xep, if one of them is installed (fop gets checked first). DOCBOOK_FOPCOM The full command-line for the PDF renderer fop or xep. DOCBOOK_FOPCOMSTR The string displayed when a renderer like fop or xep is used to create PDF output from an XML file. DOCBOOK_FOPFLAGS Additonal command-line flags for the PDF renderer fop or xep. DOCBOOK_XMLLINT The path to the external executable xmllint, if it's installed. Note, that this is only used as last fallback for resolving XIncludes, if no libxml2 or lxml Python binding can be imported in the current system. DOCBOOK_XMLLINTCOM The full command-line for the external executable xmllint. DOCBOOK_XMLLINTCOMSTR The string displayed when xmllint is used to resolve XIncludes for a given XML file. DOCBOOK_XMLLINTFLAGS Additonal command-line flags for the external executable xmllint. DOCBOOK_XSLTPROC The path to the external executable xsltproc (or saxon, xalan), if one of them is installed. Note, that this is only used as last fallback for XSL transformations, if no libxml2 or lxml Python binding can be imported in the current system. DOCBOOK_XSLTPROCCOM The full command-line for the external executable xsltproc (or saxon, xalan). DOCBOOK_XSLTPROCCOMSTR The string displayed when xsltproc is used to transform an XML file via a given XSLT stylesheet. DOCBOOK_XSLTPROCFLAGS Additonal command-line flags for the external executable xsltproc (or saxon, xalan). DOCBOOK_XSLTPROCPARAMS Additonal parameters that are not intended for the XSLT processor executable, but the XSL processing itself. By default, they get appended at the end of the command line for saxon and saxon-xslt, respectively. DPATH List of paths to search for import modules. List of paths to search for import modules. List of paths to search for import modules. DRPATHPREFIX DRPATHPREFIX. DRPATHSUFFIX DRPATHSUFFIX. DShLibSonameGenerator DShLibSonameGenerator. DSUFFIXES The list of suffixes of files that will be scanned for imported D package files. The default list is: ['.d'] DVERPREFIX DVERPREFIX. DVERPREFIX. DVERPREFIX. DVERSIONS List of version tags to enable when compiling. List of version tags to enable when compiling. List of version tags to enable when compiling. DVERSUFFIX DVERSUFFIX. DVERSUFFIX. DVERSUFFIX. DVIPDF The TeX DVI file to PDF file converter. DVIPDFCOM The command line used to convert TeX DVI files into a PDF file. DVIPDFCOMSTR The string displayed when a TeX DVI file is converted into a PDF file. If this is not set, then $DVIPDFCOM (the command line) is displayed. DVIPDFFLAGS General options passed to the TeX DVI file to PDF file converter. DVIPS The TeX DVI file to PostScript converter. DVIPSFLAGS General options passed to the TeX DVI file to PostScript converter. ENV A dictionary of environment variables to use when invoking commands. When $ENV is used in a command all list values will be joined using the path separator and any other non-string values will simply be coerced to a string. Note that, by default, scons does not propagate the environment in force when you execute scons to the commands used to build target files. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time scons is invoked. If you want to propagate your environment variables to the commands executed to build target files, you must do so explicitly: import os env = Environment(ENV = os.environ) Note that you can choose only to propagate certain environment variables. A common example is the system PATH environment variable, so that scons uses the same utilities as the invoking shell (or other process): import os env = Environment(ENV = {'PATH' : os.environ['PATH']}) ESCAPE A function that will be called to escape shell special characters in command lines. The function should take one argument: the command line string to escape; and should return the escaped command line. F03 The Fortran 03 compiler. You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set $F03 if you need to use a specific compiler or compiler version for Fortran 03 files. F03COM The command line used to compile a Fortran 03 source file to an object file. You only need to set $F03COM if you need to use a specific command line for Fortran 03 files. You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. F03COMSTR The string displayed when a Fortran 03 source file is compiled to an object file. If this is not set, then $F03COM or $FORTRANCOM (the command line) is displayed. F03FILESUFFIXES The list of file extensions for which the F03 dialect will be used. By default, this is ['.f03'] F03FLAGS General user-specified options that are passed to the Fortran 03 compiler. Note that this variable does not contain (or similar) include search path options that scons generates automatically from $F03PATH. See $_F03INCFLAGS below, for the variable that expands to those options. You only need to set $F03FLAGS if you need to define specific user options for Fortran 03 files. You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. _F03INCFLAGS An automatically-generated construction variable containing the Fortran 03 compiler command-line options for specifying directories to be searched for include files. The value of $_F03INCFLAGS is created by appending $INCPREFIX and $INCSUFFIX to the beginning and end of each directory in $F03PATH. F03PATH The list of directories that the Fortran 03 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in $F03FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in $F03PATH will be looked-up relative to the SConscript directory when they are used in a command. To force scons to look-up a directory relative to the root of the source tree use #: You only need to set $F03PATH if you need to define a specific include path for Fortran 03 files. You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. env = Environment(F03PATH='#/include') The directory look-up can also be forced using the Dir() function: include = Dir('include') env = Environment(F03PATH=include) The directory list will be added to command lines through the automatically-generated $_F03INCFLAGS construction variable, which is constructed by appending the values of the $INCPREFIX and $INCSUFFIX construction variables to the beginning and end of each directory in $F03PATH. Any command lines you define that need the F03PATH directory list should include $_F03INCFLAGS: env = Environment(F03COM="my_compiler $_F03INCFLAGS -c -o $TARGET $SOURCE") F03PPCOM The command line used to compile a Fortran 03 source file to an object file after first running the file through the C preprocessor. Any options specified in the $F03FLAGS and $CPPFLAGS construction variables are included on this command line. You only need to set $F03PPCOM if you need to use a specific C-preprocessor command line for Fortran 03 files. You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. F03PPCOMSTR The string displayed when a Fortran 03 source file is compiled to an object file after first running the file through the C preprocessor. If this is not set, then $F03PPCOM or $FORTRANPPCOM (the command line) is displayed. F03PPFILESUFFIXES The list of file extensions for which the compilation + preprocessor pass for F03 dialect will be used. By default, this is empty F08 The Fortran 08 compiler. You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set $F08 if you need to use a specific compiler or compiler version for Fortran 08 files. F08COM The command line used to compile a Fortran 08 source file to an object file. You only need to set $F08COM if you need to use a specific command line for Fortran 08 files. You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. F08COMSTR The string displayed when a Fortran 08 source file is compiled to an object file. If this is not set, then $F08COM or $FORTRANCOM (the command line) is displayed. F08FILESUFFIXES The list of file extensions for which the F08 dialect will be used. By default, this is ['.f08'] F08FLAGS General user-specified options that are passed to the Fortran 08 compiler. Note that this variable does not contain (or similar) include search path options that scons generates automatically from $F08PATH. See $_F08INCFLAGS below, for the variable that expands to those options. You only need to set $F08FLAGS if you need to define specific user options for Fortran 08 files. You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. _F08INCFLAGS An automatically-generated construction variable containing the Fortran 08 compiler command-line options for specifying directories to be searched for include files. The value of $_F08INCFLAGS is created by appending $INCPREFIX and $INCSUFFIX to the beginning and end of each directory in $F08PATH. F08PATH The list of directories that the Fortran 08 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in $F08FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in $F08PATH will be looked-up relative to the SConscript directory when they are used in a command. To force scons to look-up a directory relative to the root of the source tree use #: You only need to set $F08PATH if you need to define a specific include path for Fortran 08 files. You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. env = Environment(F08PATH='#/include') The directory look-up can also be forced using the Dir() function: include = Dir('include') env = Environment(F08PATH=include) The directory list will be added to command lines through the automatically-generated $_F08INCFLAGS construction variable, which is constructed by appending the values of the $INCPREFIX and $INCSUFFIX construction variables to the beginning and end of each directory in $F08PATH. Any command lines you define that need the F08PATH directory list should include $_F08INCFLAGS: env = Environment(F08COM="my_compiler $_F08INCFLAGS -c -o $TARGET $SOURCE") F08PPCOM The command line used to compile a Fortran 08 source file to an object file after first running the file through the C preprocessor. Any options specified in the $F08FLAGS and $CPPFLAGS construction variables are included on this command line. You only need to set $F08PPCOM if you need to use a specific C-preprocessor command line for Fortran 08 files. You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. F08PPCOMSTR The string displayed when a Fortran 08 source file is compiled to an object file after first running the file through the C preprocessor. If this is not set, then $F08PPCOM or $FORTRANPPCOM (the command line) is displayed. F08PPFILESUFFIXES The list of file extensions for which the compilation + preprocessor pass for F08 dialect will be used. By default, this is empty F77 The Fortran 77 compiler. You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set $F77 if you need to use a specific compiler or compiler version for Fortran 77 files. F77COM The command line used to compile a Fortran 77 source file to an object file. You only need to set $F77COM if you need to use a specific command line for Fortran 77 files. You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. F77COMSTR The string displayed when a Fortran 77 source file is compiled to an object file. If this is not set, then $F77COM or $FORTRANCOM (the command line) is displayed. F77FILESUFFIXES The list of file extensions for which the F77 dialect will be used. By default, this is ['.f77'] F77FLAGS General user-specified options that are passed to the Fortran 77 compiler. Note that this variable does not contain (or similar) include search path options that scons generates automatically from $F77PATH. See $_F77INCFLAGS below, for the variable that expands to those options. You only need to set $F77FLAGS if you need to define specific user options for Fortran 77 files. You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. _F77INCFLAGS An automatically-generated construction variable containing the Fortran 77 compiler command-line options for specifying directories to be searched for include files. The value of $_F77INCFLAGS is created by appending $INCPREFIX and $INCSUFFIX to the beginning and end of each directory in $F77PATH. F77PATH The list of directories that the Fortran 77 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in $F77FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in $F77PATH will be looked-up relative to the SConscript directory when they are used in a command. To force scons to look-up a directory relative to the root of the source tree use #: You only need to set $F77PATH if you need to define a specific include path for Fortran 77 files. You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. env = Environment(F77PATH='#/include') The directory look-up can also be forced using the Dir() function: include = Dir('include') env = Environment(F77PATH=include) The directory list will be added to command lines through the automatically-generated $_F77INCFLAGS construction variable, which is constructed by appending the values of the $INCPREFIX and $INCSUFFIX construction variables to the beginning and end of each directory in $F77PATH. Any command lines you define that need the F77PATH directory list should include $_F77INCFLAGS: env = Environment(F77COM="my_compiler $_F77INCFLAGS -c -o $TARGET $SOURCE") F77PPCOM The command line used to compile a Fortran 77 source file to an object file after first running the file through the C preprocessor. Any options specified in the $F77FLAGS and $CPPFLAGS construction variables are included on this command line. You only need to set $F77PPCOM if you need to use a specific C-preprocessor command line for Fortran 77 files. You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. F77PPCOMSTR The string displayed when a Fortran 77 source file is compiled to an object file after first running the file through the C preprocessor. If this is not set, then $F77PPCOM or $FORTRANPPCOM (the command line) is displayed. F77PPFILESUFFIXES The list of file extensions for which the compilation + preprocessor pass for F77 dialect will be used. By default, this is empty F90 The Fortran 90 compiler. You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set $F90 if you need to use a specific compiler or compiler version for Fortran 90 files. F90COM The command line used to compile a Fortran 90 source file to an object file. You only need to set $F90COM if you need to use a specific command line for Fortran 90 files. You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. F90COMSTR The string displayed when a Fortran 90 source file is compiled to an object file. If this is not set, then $F90COM or $FORTRANCOM (the command line) is displayed. F90FILESUFFIXES The list of file extensions for which the F90 dialect will be used. By default, this is ['.f90'] F90FLAGS General user-specified options that are passed to the Fortran 90 compiler. Note that this variable does not contain (or similar) include search path options that scons generates automatically from $F90PATH. See $_F90INCFLAGS below, for the variable that expands to those options. You only need to set $F90FLAGS if you need to define specific user options for Fortran 90 files. You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. _F90INCFLAGS An automatically-generated construction variable containing the Fortran 90 compiler command-line options for specifying directories to be searched for include files. The value of $_F90INCFLAGS is created by appending $INCPREFIX and $INCSUFFIX to the beginning and end of each directory in $F90PATH. F90PATH The list of directories that the Fortran 90 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in $F90FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in $F90PATH will be looked-up relative to the SConscript directory when they are used in a command. To force scons to look-up a directory relative to the root of the source tree use #: You only need to set $F90PATH if you need to define a specific include path for Fortran 90 files. You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. env = Environment(F90PATH='#/include') The directory look-up can also be forced using the Dir() function: include = Dir('include') env = Environment(F90PATH=include) The directory list will be added to command lines through the automatically-generated $_F90INCFLAGS construction variable, which is constructed by appending the values of the $INCPREFIX and $INCSUFFIX construction variables to the beginning and end of each directory in $F90PATH. Any command lines you define that need the F90PATH directory list should include $_F90INCFLAGS: env = Environment(F90COM="my_compiler $_F90INCFLAGS -c -o $TARGET $SOURCE") F90PPCOM The command line used to compile a Fortran 90 source file to an object file after first running the file through the C preprocessor. Any options specified in the $F90FLAGS and $CPPFLAGS construction variables are included on this command line. You only need to set $F90PPCOM if you need to use a specific C-preprocessor command line for Fortran 90 files. You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. F90PPCOMSTR The string displayed when a Fortran 90 source file is compiled after first running the file through the C preprocessor. If this is not set, then $F90PPCOM or $FORTRANPPCOM (the command line) is displayed. F90PPFILESUFFIXES The list of file extensions for which the compilation + preprocessor pass for F90 dialect will be used. By default, this is empty F95 The Fortran 95 compiler. You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set $F95 if you need to use a specific compiler or compiler version for Fortran 95 files. F95COM The command line used to compile a Fortran 95 source file to an object file. You only need to set $F95COM if you need to use a specific command line for Fortran 95 files. You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. F95COMSTR The string displayed when a Fortran 95 source file is compiled to an object file. If this is not set, then $F95COM or $FORTRANCOM (the command line) is displayed. F95FILESUFFIXES The list of file extensions for which the F95 dialect will be used. By default, this is ['.f95'] F95FLAGS General user-specified options that are passed to the Fortran 95 compiler. Note that this variable does not contain (or similar) include search path options that scons generates automatically from $F95PATH. See $_F95INCFLAGS below, for the variable that expands to those options. You only need to set $F95FLAGS if you need to define specific user options for Fortran 95 files. You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. _F95INCFLAGS An automatically-generated construction variable containing the Fortran 95 compiler command-line options for specifying directories to be searched for include files. The value of $_F95INCFLAGS is created by appending $INCPREFIX and $INCSUFFIX to the beginning and end of each directory in $F95PATH. F95PATH The list of directories that the Fortran 95 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in $F95FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in $F95PATH will be looked-up relative to the SConscript directory when they are used in a command. To force scons to look-up a directory relative to the root of the source tree use #: You only need to set $F95PATH if you need to define a specific include path for Fortran 95 files. You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. env = Environment(F95PATH='#/include') The directory look-up can also be forced using the Dir() function: include = Dir('include') env = Environment(F95PATH=include) The directory list will be added to command lines through the automatically-generated $_F95INCFLAGS construction variable, which is constructed by appending the values of the $INCPREFIX and $INCSUFFIX construction variables to the beginning and end of each directory in $F95PATH. Any command lines you define that need the F95PATH directory list should include $_F95INCFLAGS: env = Environment(F95COM="my_compiler $_F95INCFLAGS -c -o $TARGET $SOURCE") F95PPCOM The command line used to compile a Fortran 95 source file to an object file after first running the file through the C preprocessor. Any options specified in the $F95FLAGS and $CPPFLAGS construction variables are included on this command line. You only need to set $F95PPCOM if you need to use a specific C-preprocessor command line for Fortran 95 files. You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. F95PPCOMSTR The string displayed when a Fortran 95 source file is compiled to an object file after first running the file through the C preprocessor. If this is not set, then $F95PPCOM or $FORTRANPPCOM (the command line) is displayed. F95PPFILESUFFIXES The list of file extensions for which the compilation + preprocessor pass for F95 dialect will be used. By default, this is empty File A function that converts a string into a File instance relative to the target being built. A function that converts a string into a File instance relative to the target being built. FORTRAN The default Fortran compiler for all versions of Fortran. FORTRANCOM The command line used to compile a Fortran source file to an object file. By default, any options specified in the $FORTRANFLAGS, $CPPFLAGS, $_CPPDEFFLAGS, $_FORTRANMODFLAG, and $_FORTRANINCFLAGS construction variables are included on this command line. FORTRANCOMSTR The string displayed when a Fortran source file is compiled to an object file. If this is not set, then $FORTRANCOM (the command line) is displayed. FORTRANFILESUFFIXES The list of file extensions for which the FORTRAN dialect will be used. By default, this is ['.f', '.for', '.ftn'] FORTRANFLAGS General user-specified options that are passed to the Fortran compiler. Note that this variable does not contain (or similar) include or module search path options that scons generates automatically from $FORTRANPATH. See $_FORTRANINCFLAGS and $_FORTRANMODFLAG, below, for the variables that expand those options. _FORTRANINCFLAGS An automatically-generated construction variable containing the Fortran compiler command-line options for specifying directories to be searched for include files and module files. The value of $_FORTRANINCFLAGS is created by prepending/appending $INCPREFIX and $INCSUFFIX to the beginning and end of each directory in $FORTRANPATH. FORTRANMODDIR Directory location where the Fortran compiler should place any module files it generates. This variable is empty, by default. Some Fortran compilers will internally append this directory in the search path for module files, as well. FORTRANMODDIRPREFIX The prefix used to specify a module directory on the Fortran compiler command line. This will be appended to the beginning of the directory in the $FORTRANMODDIR construction variables when the $_FORTRANMODFLAG variables is automatically generated. FORTRANMODDIRSUFFIX The suffix used to specify a module directory on the Fortran compiler command line. This will be appended to the beginning of the directory in the $FORTRANMODDIR construction variables when the $_FORTRANMODFLAG variables is automatically generated. _FORTRANMODFLAG An automatically-generated construction variable containing the Fortran compiler command-line option for specifying the directory location where the Fortran compiler should place any module files that happen to get generated during compilation. The value of $_FORTRANMODFLAG is created by prepending/appending $FORTRANMODDIRPREFIX and $FORTRANMODDIRSUFFIX to the beginning and end of the directory in $FORTRANMODDIR. FORTRANMODPREFIX The module file prefix used by the Fortran compiler. SCons assumes that the Fortran compiler follows the quasi-standard naming convention for module files of module_name.mod. As a result, this variable is left empty, by default. For situations in which the compiler does not necessarily follow the normal convention, the user may use this variable. Its value will be appended to every module file name as scons attempts to resolve dependencies. FORTRANMODSUFFIX The module file suffix used by the Fortran compiler. SCons assumes that the Fortran compiler follows the quasi-standard naming convention for module files of module_name.mod. As a result, this variable is set to ".mod", by default. For situations in which the compiler does not necessarily follow the normal convention, the user may use this variable. Its value will be appended to every module file name as scons attempts to resolve dependencies. FORTRANPATH The list of directories that the Fortran compiler will search for include files and (for some compilers) module files. The Fortran implicit dependency scanner will search these directories for include files (but not module files since they are autogenerated and, as such, may not actually exist at the time the scan takes place). Don't explicitly put include directory arguments in FORTRANFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in FORTRANPATH will be looked-up relative to the SConscript directory when they are used in a command. To force scons to look-up a directory relative to the root of the source tree use #: env = Environment(FORTRANPATH='#/include') The directory look-up can also be forced using the Dir() function: include = Dir('include') env = Environment(FORTRANPATH=include) The directory list will be added to command lines through the automatically-generated $_FORTRANINCFLAGS construction variable, which is constructed by appending the values of the $INCPREFIX and $INCSUFFIX construction variables to the beginning and end of each directory in $FORTRANPATH. Any command lines you define that need the FORTRANPATH directory list should include $_FORTRANINCFLAGS: env = Environment(FORTRANCOM="my_compiler $_FORTRANINCFLAGS -c -o $TARGET $SOURCE") FORTRANPPCOM The command line used to compile a Fortran source file to an object file after first running the file through the C preprocessor. By default, any options specified in the $FORTRANFLAGS, $CPPFLAGS, $_CPPDEFFLAGS, $_FORTRANMODFLAG, and $_FORTRANINCFLAGS construction variables are included on this command line. FORTRANPPCOMSTR The string displayed when a Fortran source file is compiled to an object file after first running the file through the C preprocessor. If this is not set, then $FORTRANPPCOM (the command line) is displayed. FORTRANPPFILESUFFIXES The list of file extensions for which the compilation + preprocessor pass for FORTRAN dialect will be used. By default, this is ['.fpp', '.FPP'] FORTRANSUFFIXES The list of suffixes of files that will be scanned for Fortran implicit dependencies (INCLUDE lines and USE statements). The default list is: [".f", ".F", ".for", ".FOR", ".ftn", ".FTN", ".fpp", ".FPP", ".f77", ".F77", ".f90", ".F90", ".f95", ".F95"] FRAMEWORKPATH On Mac OS X with gcc, a list containing the paths to search for frameworks. Used by the compiler to find framework-style includes like #include <Fmwk/Header.h>. Used by the linker to find user-specified frameworks when linking (see $FRAMEWORKS). For example: env.AppendUnique(FRAMEWORKPATH='#myframeworkdir') will add ... -Fmyframeworkdir to the compiler and linker command lines. _FRAMEWORKPATH On Mac OS X with gcc, an automatically-generated construction variable containing the linker command-line options corresponding to $FRAMEWORKPATH. FRAMEWORKPATHPREFIX On Mac OS X with gcc, the prefix to be used for the FRAMEWORKPATH entries. (see $FRAMEWORKPATH). The default value is . FRAMEWORKPREFIX On Mac OS X with gcc, the prefix to be used for linking in frameworks (see $FRAMEWORKS). The default value is . _FRAMEWORKS On Mac OS X with gcc, an automatically-generated construction variable containing the linker command-line options for linking with FRAMEWORKS. FRAMEWORKS On Mac OS X with gcc, a list of the framework names to be linked into a program or shared library or bundle. The default value is the empty list. For example: env.AppendUnique(FRAMEWORKS=Split('System Cocoa SystemConfiguration')) FRAMEWORKSFLAGS On Mac OS X with gcc, general user-supplied frameworks options to be added at the end of a command line building a loadable module. (This has been largely superseded by the $FRAMEWORKPATH, $FRAMEWORKPATHPREFIX, $FRAMEWORKPREFIX and $FRAMEWORKS variables described above.) GS The Ghostscript program used, e.g. to convert PostScript to PDF files. GSCOM The full Ghostscript command line used for the conversion process. Its default value is $GS $GSFLAGS -sOutputFile=$TARGET $SOURCES. GSCOMSTR The string displayed when Ghostscript is called for the conversion process. If this is not set (the default), then $GSCOM (the command line) is displayed. GSFLAGS General options passed to the Ghostscript program, when converting PostScript to PDF files for example. Its default value is -dNOPAUSE -dBATCH -sDEVICE=pdfwrite HOST_ARCH Sets the host architecture for Visual Studio compiler. If not set, default to the detected host architecture: note that this may depend on the python you are using. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. Valid values are the same as for $TARGET_ARCH. This is currently only used on Windows, but in the future it will be used on other OSes as well. The name of the host hardware architecture used to create the Environment. If a platform is specified when creating the Environment, then that Platform's logic will handle setting this value. This value is immutable, and should not be changed by the user after the Environment is initialized. Currently only set for Win32. HOST_OS The name of the host operating system used to create the Environment. If a platform is specified when creating the Environment, then that Platform's logic will handle setting this value. This value is immutable, and should not be changed by the user after the Environment is initialized. Currently only set for Win32. IDLSUFFIXES The list of suffixes of files that will be scanned for IDL implicit dependencies (#include or import lines). The default list is: [".idl", ".IDL"] IMPLIBNOVERSIONSYMLINKS Used to override $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS when creating versioned import library for a shared library/loadable module. If not defined, then $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS is used to determine whether to disable symlink generation or not. IMPLIBPREFIX The prefix used for import library names. For example, cygwin uses import libraries (libfoo.dll.a) in pair with dynamic libraries (cygfoo.dll). The cyglink linker sets $IMPLIBPREFIX to 'lib' and $SHLIBPREFIX to 'cyg'. IMPLIBSUFFIX The suffix used for import library names. For example, cygwin uses import libraries (libfoo.dll.a) in pair with dynamic libraries (cygfoo.dll). The cyglink linker sets $IMPLIBSUFFIX to '.dll.a' and $SHLIBSUFFIX to '.dll'. IMPLIBVERSION Used to override $SHLIBVERSION/$LDMODULEVERSION when generating versioned import library for a shared library/loadable module. If undefined, the $SHLIBVERSION/$LDMODULEVERSION is used to determine the version of versioned import library. IMPLICIT_COMMAND_DEPENDENCIES Controls whether or not SCons will add implicit dependencies for the commands executed to build targets. By default, SCons will add to each target an implicit dependency on the command represented by the first argument on any command line it executes. The specific file for the dependency is found by searching the PATH variable in the ENV environment used to execute the command. If the construction variable $IMPLICIT_COMMAND_DEPENDENCIES is set to a false value (None, False, 0, etc.), then the implicit dependency will not be added to the targets built with that construction environment. env = Environment(IMPLICIT_COMMAND_DEPENDENCIES = 0) INCPREFIX The prefix used to specify an include directory on the C compiler command line. This will be appended to the beginning of each directory in the $CPPPATH and $FORTRANPATH construction variables when the $_CPPINCFLAGS and $_FORTRANINCFLAGS variables are automatically generated. INCSUFFIX The suffix used to specify an include directory on the C compiler command line. This will be appended to the end of each directory in the $CPPPATH and $FORTRANPATH construction variables when the $_CPPINCFLAGS and $_FORTRANINCFLAGS variables are automatically generated. INSTALL A function to be called to install a file into a destination file name. The default function copies the file into the destination (and sets the destination file's mode and permission bits to match the source file's). The function takes the following arguments: def install(dest, source, env): dest is the path name of the destination file. source is the path name of the source file. env is the construction environment (a dictionary of construction values) in force for this file installation. INSTALLSTR The string displayed when a file is installed into a destination file name. The default is: Install file: "$SOURCE" as "$TARGET" INTEL_C_COMPILER_VERSION Set by the "intelc" Tool to the major version number of the Intel C compiler selected for use. JAR The Java archive tool. The Java archive tool. JARCHDIR The directory to which the Java archive tool should change (using the option). The directory to which the Java archive tool should change (using the option). JARCOM The command line used to call the Java archive tool. The command line used to call the Java archive tool. JARCOMSTR The string displayed when the Java archive tool is called If this is not set, then $JARCOM (the command line) is displayed. env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") The string displayed when the Java archive tool is called If this is not set, then $JARCOM (the command line) is displayed. env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") JARFLAGS General options passed to the Java archive tool. By default this is set to to create the necessary jar file. General options passed to the Java archive tool. By default this is set to to create the necessary jar file. JARSUFFIX The suffix for Java archives: .jar by default. The suffix for Java archives: .jar by default. JAVABOOTCLASSPATH Specifies the list of directories that will be added to the javac command line via the option. The individual directory names will be separated by the operating system's path separate character (: on UNIX/Linux/POSIX, ; on Windows). JAVAC The Java compiler. JAVACCOM The command line used to compile a directory tree containing Java source files to corresponding Java class files. Any options specified in the $JAVACFLAGS construction variable are included on this command line. JAVACCOMSTR The string displayed when compiling a directory tree of Java source files to corresponding Java class files. If this is not set, then $JAVACCOM (the command line) is displayed. env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES") JAVACFLAGS General options that are passed to the Java compiler. JAVACLASSDIR The directory in which Java class files may be found. This is stripped from the beginning of any Java .class file names supplied to the JavaH builder. JAVACLASSPATH Specifies the list of directories that will be searched for Java .class file. The directories in this list will be added to the javac and javah command lines via the option. The individual directory names will be separated by the operating system's path separate character (: on UNIX/Linux/POSIX, ; on Windows). Note that this currently just adds the specified directory via the option. SCons does not currently search the $JAVACLASSPATH directories for dependency .class files. JAVACLASSSUFFIX The suffix for Java class files; .class by default. JAVAH The Java generator for C header and stub files. JAVAHCOM The command line used to generate C header and stub files from Java classes. Any options specified in the $JAVAHFLAGS construction variable are included on this command line. JAVAHCOMSTR The string displayed when C header and stub files are generated from Java classes. If this is not set, then $JAVAHCOM (the command line) is displayed. env = Environment(JAVAHCOMSTR = "Generating header/stub file(s) $TARGETS from $SOURCES") JAVAHFLAGS General options passed to the C header and stub file generator for Java classes. JAVASOURCEPATH Specifies the list of directories that will be searched for input .java file. The directories in this list will be added to the javac command line via the option. The individual directory names will be separated by the operating system's path separate character (: on UNIX/Linux/POSIX, ; on Windows). Note that this currently just adds the specified directory via the option. SCons does not currently search the $JAVASOURCEPATH directories for dependency .java files. JAVASUFFIX The suffix for Java files; .java by default. JAVAVERSION Specifies the Java version being used by the Java builder. This is not currently used to select one version of the Java compiler vs. another. Instead, you should set this to specify the version of Java supported by your javac compiler. The default is 1.4. This is sometimes necessary because Java 1.5 changed the file names that are created for nested anonymous inner classes, which can cause a mismatch with the files that SCons expects will be generated by the javac compiler. Setting $JAVAVERSION to 1.5 (or 1.6, as appropriate) can make SCons realize that a Java 1.5 or 1.6 build is actually up to date. LATEX The LaTeX structured formatter and typesetter. LATEXCOM The command line used to call the LaTeX structured formatter and typesetter. LATEXCOMSTR The string displayed when calling the LaTeX structured formatter and typesetter. If this is not set, then $LATEXCOM (the command line) is displayed. env = Environment(LATEXCOMSTR = "Building $TARGET from LaTeX input $SOURCES") LATEXFLAGS General options passed to the LaTeX structured formatter and typesetter. LATEXRETRIES The maximum number of times that LaTeX will be re-run if the .log generated by the $LATEXCOM command indicates that there are undefined references. The default is to try to resolve undefined references by re-running LaTeX up to three times. LATEXSUFFIXES The list of suffixes of files that will be scanned for LaTeX implicit dependencies (\include or \import files). The default list is: [".tex", ".ltx", ".latex"] LDMODULE The linker for building loadable modules. By default, this is the same as $SHLINK. LDMODULECOM The command line for building loadable modules. On Mac OS X, this uses the $LDMODULE, $LDMODULEFLAGS and $FRAMEWORKSFLAGS variables. On other systems, this is the same as $SHLINK. LDMODULECOMSTR The string displayed when building loadable modules. If this is not set, then $LDMODULECOM (the command line) is displayed. LDMODULEFLAGS General user options passed to the linker for building loadable modules. LDMODULENOVERSIONSYMLINKS Instructs the LoadableModule builder to not automatically create symlinks for versioned modules. Defaults to $SHLIBNOVERSIONSYMLINKS LDMODULEPREFIX The prefix used for loadable module file names. On Mac OS X, this is null; on other systems, this is the same as $SHLIBPREFIX. _LDMODULESONAME A macro that automatically generates loadable module's SONAME based on $TARGET, $LDMODULEVERSION and $LDMODULESUFFIX. Used by LoadableModule builder when the linker tool supports SONAME (e.g. gnulink). LDMODULESUFFIX The suffix used for loadable module file names. On Mac OS X, this is null; on other systems, this is the same as $SHLIBSUFFIX. LDMODULEVERSION When this construction variable is defined, a versioned loadable module is created by LoadableModule builder. This activates the $_LDMODULEVERSIONFLAGS and thus modifies the $LDMODULECOM as required, adds the version number to the library name, and creates the symlinks that are needed. $LDMODULEVERSION versions should exist in the same format as $SHLIBVERSION. LDMODULEVERSIONFLAGS Extra flags added to $LDMODULECOM when building versioned LoadableModule. These flags are only used when $LDMODULEVERSION is set. _LDMODULEVERSIONFLAGS This macro automatically introduces extra flags to $LDMODULECOM when building versioned LoadableModule (that is when $LDMODULEVERSION is set). _LDMODULEVERSIONFLAGS usually adds $SHLIBVERSIONFLAGS and some extra dynamically generated options (such as -Wl,-soname=$_LDMODULESONAME). It is unused by plain (unversioned) loadable modules. LEX The lexical analyzer generator. LEXCOM The command line used to call the lexical analyzer generator to generate a source file. LEXCOMSTR The string displayed when generating a source file using the lexical analyzer generator. If this is not set, then $LEXCOM (the command line) is displayed. env = Environment(LEXCOMSTR = "Lex'ing $TARGET from $SOURCES") LEXFLAGS General options passed to the lexical analyzer generator. _LIBDIRFLAGS An automatically-generated construction variable containing the linker command-line options for specifying directories to be searched for library. The value of $_LIBDIRFLAGS is created by appending $LIBDIRPREFIX and $LIBDIRSUFFIX to the beginning and end of each directory in $LIBPATH. LIBDIRPREFIX The prefix used to specify a library directory on the linker command line. This will be appended to the beginning of each directory in the $LIBPATH construction variable when the $_LIBDIRFLAGS variable is automatically generated. LIBDIRSUFFIX The suffix used to specify a library directory on the linker command line. This will be appended to the end of each directory in the $LIBPATH construction variable when the $_LIBDIRFLAGS variable is automatically generated. LIBEMITTER TODO _LIBFLAGS An automatically-generated construction variable containing the linker command-line options for specifying libraries to be linked with the resulting target. The value of $_LIBFLAGS is created by appending $LIBLINKPREFIX and $LIBLINKSUFFIX to the beginning and end of each filename in $LIBS. LIBLINKPREFIX The prefix used to specify a library to link on the linker command line. This will be appended to the beginning of each library in the $LIBS construction variable when the $_LIBFLAGS variable is automatically generated. LIBLINKSUFFIX The suffix used to specify a library to link on the linker command line. This will be appended to the end of each library in the $LIBS construction variable when the $_LIBFLAGS variable is automatically generated. LIBPATH The list of directories that will be searched for libraries. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory arguments in $LINKFLAGS or $SHLINKFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in LIBPATH will be looked-up relative to the SConscript directory when they are used in a command. To force scons to look-up a directory relative to the root of the source tree use #: env = Environment(LIBPATH='#/libs') The directory look-up can also be forced using the Dir() function: libs = Dir('libs') env = Environment(LIBPATH=libs) The directory list will be added to command lines through the automatically-generated $_LIBDIRFLAGS construction variable, which is constructed by appending the values of the $LIBDIRPREFIX and $LIBDIRSUFFIX construction variables to the beginning and end of each directory in $LIBPATH. Any command lines you define that need the LIBPATH directory list should include $_LIBDIRFLAGS: env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE") LIBPREFIX The prefix used for (static) library file names. A default value is set for each platform (posix, win32, os2, etc.), but the value is overridden by individual tools (ar, mslib, sgiar, sunar, tlib, etc.) to reflect the names of the libraries they create. LIBPREFIXES A list of all legal prefixes for library file names. When searching for library dependencies, SCons will look for files with these prefixes, the base library name, and suffixes in the $LIBSUFFIXES list. LIBS A list of one or more libraries that will be linked with any executable programs created by this environment. The library list will be added to command lines through the automatically-generated $_LIBFLAGS construction variable, which is constructed by appending the values of the $LIBLINKPREFIX and $LIBLINKSUFFIX construction variables to the beginning and end of each filename in $LIBS. Any command lines you define that need the LIBS library list should include $_LIBFLAGS: env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE") If you add a File object to the $LIBS list, the name of that file will be added to $_LIBFLAGS, and thus the link line, as is, without $LIBLINKPREFIX or $LIBLINKSUFFIX. For example: env.Append(LIBS=File('/tmp/mylib.so')) In all cases, scons will add dependencies from the executable program to all the libraries in this list. LIBSUFFIX The suffix used for (static) library file names. A default value is set for each platform (posix, win32, os2, etc.), but the value is overridden by individual tools (ar, mslib, sgiar, sunar, tlib, etc.) to reflect the names of the libraries they create. LIBSUFFIXES A list of all legal suffixes for library file names. When searching for library dependencies, SCons will look for files with prefixes, in the $LIBPREFIXES list, the base library name, and these suffixes. LICENSE The abbreviated name of the license under which this project is released (gpl, lpgl, bsd etc.). See http://www.opensource.org/licenses/alphabetical for a list of license names. LINESEPARATOR The separator used by the Substfile and Textfile builders. This value is used between sources when constructing the target. It defaults to the current system line separator. LINGUAS_FILE The $LINGUAS_FILE defines file(s) containing list of additional linguas to be processed by POInit, POUpdate or MOFiles builders. It also affects Translate builder. If the variable contains a string, it defines name of the list file. The $LINGUAS_FILE may be a list of file names as well. If $LINGUAS_FILE is set to True (or non-zero numeric value), the list will be read from default file named LINGUAS. LINK The linker. LINKCOM The command line used to link object files into an executable. LINKCOMSTR The string displayed when object files are linked into an executable. If this is not set, then $LINKCOM (the command line) is displayed. env = Environment(LINKCOMSTR = "Linking $TARGET") LINKFLAGS General user options passed to the linker. Note that this variable should not contain (or similar) options for linking with the libraries listed in $LIBS, nor (or similar) library search path options that scons generates automatically from $LIBPATH. See $_LIBFLAGS above, for the variable that expands to library-link options, and $_LIBDIRFLAGS above, for the variable that expands to library search path options. M4 The M4 macro preprocessor. M4COM The command line used to pass files through the M4 macro preprocessor. M4COMSTR The string displayed when a file is passed through the M4 macro preprocessor. If this is not set, then $M4COM (the command line) is displayed. M4FLAGS General options passed to the M4 macro preprocessor. MAKEINDEX The makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. MAKEINDEXCOM The command line used to call the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. MAKEINDEXCOMSTR The string displayed when calling the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. If this is not set, then $MAKEINDEXCOM (the command line) is displayed. MAKEINDEXFLAGS General options passed to the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. MAXLINELENGTH The maximum number of characters allowed on an external command line. On Win32 systems, link lines longer than this many characters are linked via a temporary file name. MIDL The Microsoft IDL compiler. MIDLCOM The command line used to pass files to the Microsoft IDL compiler. MIDLCOMSTR The string displayed when the Microsoft IDL copmiler is called. If this is not set, then $MIDLCOM (the command line) is displayed. MIDLFLAGS General options passed to the Microsoft IDL compiler. MOSUFFIX Suffix used for MO files (default: '.mo'). See msgfmt tool and MOFiles builder. MSGFMT Absolute path to msgfmt(1) binary, found by Detect(). See msgfmt tool and MOFiles builder. MSGFMTCOM Complete command line to run msgfmt(1) program. See msgfmt tool and MOFiles builder. MSGFMTCOMSTR String to display when msgfmt(1) is invoked (default: '', which means ``print $MSGFMTCOM''). See msgfmt tool and MOFiles builder. MSGFMTFLAGS Additional flags to msgfmt(1). See msgfmt tool and MOFiles builder. MSGINIT Path to msginit(1) program (found via Detect()). See msginit tool and POInit builder. MSGINITCOM Complete command line to run msginit(1) program. See msginit tool and POInit builder. MSGINITCOMSTR String to display when msginit(1) is invoked (default: '', which means ``print $MSGINITCOM''). See msginit tool and POInit builder. MSGINITFLAGS List of additional flags to msginit(1) (default: []). See msginit tool and POInit builder. _MSGINITLOCALE Internal ``macro''. Computes locale (language) name based on target filename (default: '${TARGET.filebase}' ). See msginit tool and POInit builder. MSGMERGE Absolute path to msgmerge(1) binary as found by Detect(). See msgmerge tool and POUpdate builder. MSGMERGECOM Complete command line to run msgmerge(1) command. See msgmerge tool and POUpdate builder. MSGMERGECOMSTR String to be displayed when msgmerge(1) is invoked (default: '', which means ``print $MSGMERGECOM''). See msgmerge tool and POUpdate builder. MSGMERGEFLAGS Additional flags to msgmerge(1) command. See msgmerge tool and POUpdate builder. MSSDK_DIR The directory containing the Microsoft SDK (either Platform SDK or Windows SDK) to be used for compilation. MSSDK_VERSION The version string of the Microsoft SDK (either Platform SDK or Windows SDK) to be used for compilation. Supported versions include 6.1, 6.0A, 6.0, 2003R2 and 2003R1. MSVC_BATCH When set to any true value, specifies that SCons should batch compilation of object files when calling the Microsoft Visual C/C++ compiler. All compilations of source files from the same source directory that generate target files in a same output directory and were configured in SCons using the same construction environment will be built in a single call to the compiler. Only source files that have changed since their object files were built will be passed to each compiler invocation (via the $CHANGED_SOURCES construction variable). Any compilations where the object (target) file base name (minus the .obj) does not match the source file base name will be compiled separately. MSVC_USE_SCRIPT Use a batch script to set up Microsoft Visual Studio compiler $MSVC_USE_SCRIPT overrides $MSVC_VERSION and $TARGET_ARCH. If set to the name of a Visual Studio .bat file (e.g. vcvars.bat), SCons will run that bat file and extract the relevant variables from the result (typically %INCLUDE%, %LIB%, and %PATH%). Setting MSVC_USE_SCRIPT to None bypasses the Visual Studio autodetection entirely; use this if you are running SCons in a Visual Studio cmd window and importing the shell's environment variables. MSVC_UWP_APP Build libraries for a Universal Windows Platform (UWP) Application. If $MSVC_UWP_APP is set, the Visual Studio environment will be set up to point to the Windows Store compatible libraries and Visual Studio runtimes. In doing so, any libraries that are built will be able to be used in a UWP App and published to the Windows Store. This flag will only have an effect with Visual Studio 2015+. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. Valid values are '1' or '0' MSVC_VERSION Sets the preferred version of Microsoft Visual C/C++ to use. If $MSVC_VERSION is not set, SCons will (by default) select the latest version of Visual C/C++ installed on your system. If the specified version isn't installed, tool initialization will fail. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. Valid values for Windows are 14.0, 14.0Exp, 12.0, 12.0Exp, 11.0, 11.0Exp, 10.0, 10.0Exp, 9.0, 9.0Exp, 8.0, 8.0Exp, 7.1, 7.0, and 6.0. Versions ending in Exp refer to "Express" or "Express for Desktop" editions. MSVS When the Microsoft Visual Studio tools are initialized, they set up this dictionary with the following keys: VERSION the version of MSVS being used (can be set via $MSVS_VERSION) VERSIONS the available versions of MSVS installed VCINSTALLDIR installed directory of Visual C++ VSINSTALLDIR installed directory of Visual Studio FRAMEWORKDIR installed directory of the .NET framework FRAMEWORKVERSIONS list of installed versions of the .NET framework, sorted latest to oldest. FRAMEWORKVERSION latest installed version of the .NET framework FRAMEWORKSDKDIR installed location of the .NET SDK. PLATFORMSDKDIR installed location of the Platform SDK. PLATFORMSDK_MODULES dictionary of installed Platform SDK modules, where the dictionary keys are keywords for the various modules, and the values are 2-tuples where the first is the release date, and the second is the version number. If a value isn't set, it wasn't available in the registry. MSVS_ARCH Sets the architecture for which the generated project(s) should build. The default value is x86. amd64 is also supported by SCons for some Visual Studio versions. Trying to set $MSVS_ARCH to an architecture that's not supported for a given Visual Studio version will generate an error. MSVS_PROJECT_GUID The string placed in a generated Microsoft Visual Studio project file as the value of the ProjectGUID attribute. There is no default value. If not defined, a new GUID is generated. MSVS_SCC_AUX_PATH The path name placed in a generated Microsoft Visual Studio project file as the value of the SccAuxPath attribute if the MSVS_SCC_PROVIDER construction variable is also set. There is no default value. MSVS_SCC_CONNECTION_ROOT The root path of projects in your SCC workspace, i.e the path under which all project and solution files will be generated. It is used as a reference path from which the relative paths of the generated Microsoft Visual Studio project and solution files are computed. The relative project file path is placed as the value of the SccLocalPath attribute of the project file and as the values of the SccProjectFilePathRelativizedFromConnection[i] (where [i] ranges from 0 to the number of projects in the solution) attributes of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file. Similarly the relative solution file path is placed as the values of the SccLocalPath[i] (where [i] ranges from 0 to the number of projects in the solution) attributes of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file. This is used only if the MSVS_SCC_PROVIDER construction variable is also set. The default value is the current working directory. MSVS_SCC_PROJECT_NAME The project name placed in a generated Microsoft Visual Studio project file as the value of the SccProjectName attribute if the MSVS_SCC_PROVIDER construction variable is also set. In this case the string is also placed in the SccProjectName0 attribute of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file. There is no default value. MSVS_SCC_PROVIDER The string placed in a generated Microsoft Visual Studio project file as the value of the SccProvider attribute. The string is also placed in the SccProvider0 attribute of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file. There is no default value. MSVS_VERSION Sets the preferred version of Microsoft Visual Studio to use. If $MSVS_VERSION is not set, SCons will (by default) select the latest version of Visual Studio installed on your system. So, if you have version 6 and version 7 (MSVS .NET) installed, it will prefer version 7. You can override this by specifying the MSVS_VERSION variable in the Environment initialization, setting it to the appropriate version ('6.0' or '7.0', for example). If the specified version isn't installed, tool initialization will fail. This is obsolete: use $MSVC_VERSION instead. If $MSVS_VERSION is set and $MSVC_VERSION is not, $MSVC_VERSION will be set automatically to $MSVS_VERSION. If both are set to different values, scons will raise an error. MSVSBUILDCOM The build command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with any specified build targets. MSVSCLEANCOM The clean command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with the -c option to remove any specified targets. MSVSENCODING The encoding string placed in a generated Microsoft Visual Studio project file. The default is encoding Windows-1252. MSVSPROJECTCOM The action used to generate Microsoft Visual Studio project files. MSVSPROJECTSUFFIX The suffix used for Microsoft Visual Studio project (DSP) files. The default value is .vcproj when using Visual Studio version 7.x (.NET) or later version, and .dsp when using earlier versions of Visual Studio. MSVSREBUILDCOM The rebuild command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with any specified rebuild targets. MSVSSCONS The SCons used in generated Microsoft Visual Studio project files. The default is the version of SCons being used to generate the project file. MSVSSCONSCOM The default SCons command used in generated Microsoft Visual Studio project files. MSVSSCONSCRIPT The sconscript file (that is, SConstruct or SConscript file) that will be invoked by Visual Studio project files (through the $MSVSSCONSCOM variable). The default is the same sconscript file that contains the call to MSVSProject to build the project file. MSVSSCONSFLAGS The SCons flags used in generated Microsoft Visual Studio project files. MSVSSOLUTIONCOM The action used to generate Microsoft Visual Studio solution files. MSVSSOLUTIONSUFFIX The suffix used for Microsoft Visual Studio solution (DSW) files. The default value is .sln when using Visual Studio version 7.x (.NET), and .dsw when using earlier versions of Visual Studio. MT The program used on Windows systems to embed manifests into DLLs and EXEs. See also $WINDOWS_EMBED_MANIFEST. MTEXECOM The Windows command line used to embed manifests into executables. See also $MTSHLIBCOM. MTFLAGS Flags passed to the $MT manifest embedding program (Windows only). MTSHLIBCOM The Windows command line used to embed manifests into shared libraries (DLLs). See also $MTEXECOM. MWCW_VERSION The version number of the MetroWerks CodeWarrior C compiler to be used. MWCW_VERSIONS A list of installed versions of the MetroWerks CodeWarrior C compiler on this system. NAME Specfies the name of the project to package. no_import_lib When set to non-zero, suppresses creation of a corresponding Windows static import lib by the SharedLibrary builder when used with MinGW, Microsoft Visual Studio or Metrowerks. This also suppresses creation of an export (.exp) file when using Microsoft Visual Studio. OBJPREFIX The prefix used for (static) object file names. OBJSUFFIX The suffix used for (static) object file names. PACKAGEROOT Specifies the directory where all files in resulting archive will be placed if applicable. The default value is "$NAME-$VERSION". PACKAGETYPE Selects the package type to build. Currently these are available: * msi - Microsoft Installer * rpm - Redhat Package Manger * ipkg - Itsy Package Management System * tarbz2 - compressed tar * targz - compressed tar * zip - zip file * src_tarbz2 - compressed tar source * src_targz - compressed tar source * src_zip - zip file source This may be overridden with the "package_type" command line option. PACKAGEVERSION The version of the package (not the underlying project). This is currently only used by the rpm packager and should reflect changes in the packaging, not the underlying project code itself. PCH The Microsoft Visual C++ precompiled header that will be used when compiling object files. This variable is ignored by tools other than Microsoft Visual C++. When this variable is defined SCons will add options to the compiler command line to cause it to use the precompiled header, and will also set up the dependencies for the PCH file. Example: env['PCH'] = 'StdAfx.pch' PCHCOM The command line used by the PCH builder to generated a precompiled header. PCHCOMSTR The string displayed when generating a precompiled header. If this is not set, then $PCHCOM (the command line) is displayed. PCHPDBFLAGS A construction variable that, when expanded, adds the /yD flag to the command line only if the $PDB construction variable is set. PCHSTOP This variable specifies how much of a source file is precompiled. This variable is ignored by tools other than Microsoft Visual C++, or when the PCH variable is not being used. When this variable is define it must be a string that is the name of the header that is included at the end of the precompiled portion of the source files, or the empty string if the "#pragma hrdstop" construct is being used: env['PCHSTOP'] = 'StdAfx.h' PDB The Microsoft Visual C++ PDB file that will store debugging information for object files, shared libraries, and programs. This variable is ignored by tools other than Microsoft Visual C++. When this variable is defined SCons will add options to the compiler and linker command line to cause them to generate external debugging information, and will also set up the dependencies for the PDB file. Example: env['PDB'] = 'hello.pdb' The Visual C++ compiler switch that SCons uses by default to generate PDB information is . This works correctly with parallel () builds because it embeds the debug information in the intermediate object files, as opposed to sharing a single PDB file between multiple object files. This is also the only way to get debug information embedded into a static library. Using the instead may yield improved link-time performance, although parallel builds will no longer work. You can generate PDB files with the switch by overriding the default $CCPDBFLAGS variable; see the entry for that variable for specific examples. PDFCOM A deprecated synonym for $DVIPDFCOM. PDFLATEX The pdflatex utility. PDFLATEXCOM The command line used to call the pdflatex utility. PDFLATEXCOMSTR The string displayed when calling the pdflatex utility. If this is not set, then $PDFLATEXCOM (the command line) is displayed. env = Environment(PDFLATEX;COMSTR = "Building $TARGET from LaTeX input $SOURCES") PDFLATEXFLAGS General options passed to the pdflatex utility. PDFPREFIX The prefix used for PDF file names. PDFSUFFIX The suffix used for PDF file names. PDFTEX The pdftex utility. PDFTEXCOM The command line used to call the pdftex utility. PDFTEXCOMSTR The string displayed when calling the pdftex utility. If this is not set, then $PDFTEXCOM (the command line) is displayed. env = Environment(PDFTEXCOMSTR = "Building $TARGET from TeX input $SOURCES") PDFTEXFLAGS General options passed to the pdftex utility. PKGCHK On Solaris systems, the package-checking program that will be used (along with $PKGINFO) to look for installed versions of the Sun PRO C++ compiler. The default is /usr/sbin/pgkchk. PKGINFO On Solaris systems, the package information program that will be used (along with $PKGCHK) to look for installed versions of the Sun PRO C++ compiler. The default is pkginfo. PLATFORM The name of the platform used to create the Environment. If no platform is specified when the Environment is created, scons autodetects the platform. env = Environment(tools = []) if env['PLATFORM'] == 'cygwin': Tool('mingw')(env) else: Tool('msvc')(env) POAUTOINIT The $POAUTOINIT variable, if set to True (on non-zero numeric value), let the msginit tool to automatically initialize missing PO files with msginit(1). This applies to both, POInit and POUpdate builders (and others that use any of them). POCREATE_ALIAS Common alias for all PO files created with POInit builder (default: 'po-create'). See msginit tool and POInit builder. POSUFFIX Suffix used for PO files (default: '.po') See msginit tool and POInit builder. POTDOMAIN The $POTDOMAIN defines default domain, used to generate POT filename as $POTDOMAIN.pot when no POT file name is provided by the user. This applies to POTUpdate, POInit and POUpdate builders (and builders, that use them, e.g. Translate). Normally (if $POTDOMAIN is not defined), the builders use messages.pot as default POT file name. POTSUFFIX Suffix used for PO Template files (default: '.pot'). See xgettext tool and POTUpdate builder. POTUPDATE_ALIAS Name of the common phony target for all PO Templates created with POUpdate (default: 'pot-update'). See xgettext tool and POTUpdate builder. POUPDATE_ALIAS Common alias for all PO files being defined with POUpdate builder (default: 'po-update'). See msgmerge tool and POUpdate builder. PRINT_CMD_LINE_FUNC A Python function used to print the command lines as they are executed (assuming command printing is not disabled by the or options or their equivalents). The function should take four arguments: s, the command being executed (a string), target, the target being built (file node, list, or string name(s)), source, the source(s) used (file node, list, or string name(s)), and env, the environment being used. The function must do the printing itself. The default implementation, used if this variable is not set or is None, is: def print_cmd_line(s, target, source, env): sys.stdout.write(s + "\n") Here's an example of a more interesting function: def print_cmd_line(s, target, source, env): sys.stdout.write("Building %s -> %s...\n" % (' and '.join([str(x) for x in source]), ' and '.join([str(x) for x in target]))) env=Environment(PRINT_CMD_LINE_FUNC=print_cmd_line) env.Program('foo', 'foo.c') This just prints "Building targetname from sourcename..." instead of the actual commands. Such a function could also log the actual commands to a log file, for example. PROGEMITTER TODO PROGPREFIX The prefix used for executable file names. PROGSUFFIX The suffix used for executable file names. PSCOM The command line used to convert TeX DVI files into a PostScript file. PSCOMSTR The string displayed when a TeX DVI file is converted into a PostScript file. If this is not set, then $PSCOM (the command line) is displayed. PSPREFIX The prefix used for PostScript file names. PSSUFFIX The prefix used for PostScript file names. QT_AUTOSCAN Turn off scanning for mocable files. Use the Moc Builder to explicitly specify files to run moc on. QT_BINPATH The path where the qt binaries are installed. The default value is '$QTDIR/bin'. QT_CPPPATH The path where the qt header files are installed. The default value is '$QTDIR/include'. Note: If you set this variable to None, the tool won't change the $CPPPATH construction variable. QT_DEBUG Prints lots of debugging information while scanning for moc files. QT_LIB Default value is 'qt'. You may want to set this to 'qt-mt'. Note: If you set this variable to None, the tool won't change the $LIBS variable. QT_LIBPATH The path where the qt libraries are installed. The default value is '$QTDIR/lib'. Note: If you set this variable to None, the tool won't change the $LIBPATH construction variable. QT_MOC Default value is '$QT_BINPATH/moc'. QT_MOCCXXPREFIX Default value is ''. Prefix for moc output files, when source is a cxx file. QT_MOCCXXSUFFIX Default value is '.moc'. Suffix for moc output files, when source is a cxx file. QT_MOCFROMCXXCOM Command to generate a moc file from a cpp file. QT_MOCFROMCXXCOMSTR The string displayed when generating a moc file from a cpp file. If this is not set, then $QT_MOCFROMCXXCOM (the command line) is displayed. QT_MOCFROMCXXFLAGS Default value is '-i'. These flags are passed to moc, when moccing a C++ file. QT_MOCFROMHCOM Command to generate a moc file from a header. QT_MOCFROMHCOMSTR The string displayed when generating a moc file from a cpp file. If this is not set, then $QT_MOCFROMHCOM (the command line) is displayed. QT_MOCFROMHFLAGS Default value is ''. These flags are passed to moc, when moccing a header file. QT_MOCHPREFIX Default value is 'moc_'. Prefix for moc output files, when source is a header. QT_MOCHSUFFIX Default value is '$CXXFILESUFFIX'. Suffix for moc output files, when source is a header. QT_UIC Default value is '$QT_BINPATH/uic'. QT_UICCOM Command to generate header files from .ui files. QT_UICCOMSTR The string displayed when generating header files from .ui files. If this is not set, then $QT_UICCOM (the command line) is displayed. QT_UICDECLFLAGS Default value is ''. These flags are passed to uic, when creating a a h file from a .ui file. QT_UICDECLPREFIX Default value is ''. Prefix for uic generated header files. QT_UICDECLSUFFIX Default value is '.h'. Suffix for uic generated header files. QT_UICIMPLFLAGS Default value is ''. These flags are passed to uic, when creating a cxx file from a .ui file. QT_UICIMPLPREFIX Default value is 'uic_'. Prefix for uic generated implementation files. QT_UICIMPLSUFFIX Default value is '$CXXFILESUFFIX'. Suffix for uic generated implementation files. QT_UISUFFIX Default value is '.ui'. Suffix of designer input files. QTDIR The qt tool tries to take this from os.environ. It also initializes all QT_* construction variables listed below. (Note that all paths are constructed with python's os.path.join() method, but are listed here with the '/' separator for easier reading.) In addition, the construction environment variables $CPPPATH, $LIBPATH and $LIBS may be modified and the variables $PROGEMITTER, $SHLIBEMITTER and $LIBEMITTER are modified. Because the build-performance is affected when using this tool, you have to explicitly specify it at Environment creation: Environment(tools=['default','qt']) The qt tool supports the following operations: Automatic moc file generation from header files. You do not have to specify moc files explicitly, the tool does it for you. However, there are a few preconditions to do so: Your header file must have the same filebase as your implementation file and must stay in the same directory. It must have one of the suffixes .h, .hpp, .H, .hxx, .hh. You can turn off automatic moc file generation by setting QT_AUTOSCAN to 0. See also the corresponding Moc() builder method. Automatic moc file generation from cxx files. As stated in the qt documentation, include the moc file at the end of the cxx file. Note that you have to include the file, which is generated by the transformation ${QT_MOCCXXPREFIX}<basename>${QT_MOCCXXSUFFIX}, by default <basename>.moc. A warning is generated after building the moc file, if you do not include the correct file. If you are using VariantDir, you may need to specify duplicate=1. You can turn off automatic moc file generation by setting QT_AUTOSCAN to 0. See also the corresponding Moc builder method. Automatic handling of .ui files. The implementation files generated from .ui files are handled much the same as yacc or lex files. Each .ui file given as a source of Program, Library or SharedLibrary will generate three files, the declaration file, the implementation file and a moc file. Because there are also generated headers, you may need to specify duplicate=1 in calls to VariantDir. See also the corresponding Uic builder method. RANLIB The archive indexer. RANLIBCOM The command line used to index a static library archive. RANLIBCOMSTR The string displayed when a static library archive is indexed. If this is not set, then $RANLIBCOM (the command line) is displayed. env = Environment(RANLIBCOMSTR = "Indexing $TARGET") RANLIBFLAGS General options passed to the archive indexer. RC The resource compiler used to build a Microsoft Visual C++ resource file. RCCOM The command line used to build a Microsoft Visual C++ resource file. RCCOMSTR The string displayed when invoking the resource compiler to build a Microsoft Visual C++ resource file. If this is not set, then $RCCOM (the command line) is displayed. RCFLAGS The flags passed to the resource compiler by the RES builder. RCINCFLAGS An automatically-generated construction variable containing the command-line options for specifying directories to be searched by the resource compiler. The value of $RCINCFLAGS is created by appending $RCINCPREFIX and $RCINCSUFFIX to the beginning and end of each directory in $CPPPATH. RCINCPREFIX The prefix (flag) used to specify an include directory on the resource compiler command line. This will be appended to the beginning of each directory in the $CPPPATH construction variable when the $RCINCFLAGS variable is expanded. RCINCSUFFIX The suffix used to specify an include directory on the resource compiler command line. This will be appended to the end of each directory in the $CPPPATH construction variable when the $RCINCFLAGS variable is expanded. RDirs A function that converts a string into a list of Dir instances by searching the repositories. REGSVR The program used on Windows systems to register a newly-built DLL library whenever the SharedLibrary builder is passed a keyword argument of register=1. REGSVRCOM The command line used on Windows systems to register a newly-built DLL library whenever the SharedLibrary builder is passed a keyword argument of register=1. REGSVRCOMSTR The string displayed when registering a newly-built DLL file. If this is not set, then $REGSVRCOM (the command line) is displayed. REGSVRFLAGS Flags passed to the DLL registration program on Windows systems when a newly-built DLL library is registered. By default, this includes the that prevents dialog boxes from popping up and requiring user attention. RMIC The Java RMI stub compiler. RMICCOM The command line used to compile stub and skeleton class files from Java classes that contain RMI implementations. Any options specified in the $RMICFLAGS construction variable are included on this command line. RMICCOMSTR The string displayed when compiling stub and skeleton class files from Java classes that contain RMI implementations. If this is not set, then $RMICCOM (the command line) is displayed. env = Environment(RMICCOMSTR = "Generating stub/skeleton class files $TARGETS from $SOURCES") RMICFLAGS General options passed to the Java RMI stub compiler. _RPATH An automatically-generated construction variable containing the rpath flags to be used when linking a program with shared libraries. The value of $_RPATH is created by appending $RPATHPREFIX and $RPATHSUFFIX to the beginning and end of each directory in $RPATH. RPATH A list of paths to search for shared libraries when running programs. Currently only used in the GNU (gnulink), IRIX (sgilink) and Sun (sunlink) linkers. Ignored on platforms and toolchains that don't support it. Note that the paths added to RPATH are not transformed by scons in any way: if you want an absolute path, you must make it absolute yourself. RPATHPREFIX The prefix used to specify a directory to be searched for shared libraries when running programs. This will be appended to the beginning of each directory in the $RPATH construction variable when the $_RPATH variable is automatically generated. RPATHSUFFIX The suffix used to specify a directory to be searched for shared libraries when running programs. This will be appended to the end of each directory in the $RPATH construction variable when the $_RPATH variable is automatically generated. RPCGEN The RPC protocol compiler. RPCGENCLIENTFLAGS Options passed to the RPC protocol compiler when generating client side stubs. These are in addition to any flags specified in the $RPCGENFLAGS construction variable. RPCGENFLAGS General options passed to the RPC protocol compiler. RPCGENHEADERFLAGS Options passed to the RPC protocol compiler when generating a header file. These are in addition to any flags specified in the $RPCGENFLAGS construction variable. RPCGENSERVICEFLAGS Options passed to the RPC protocol compiler when generating server side stubs. These are in addition to any flags specified in the $RPCGENFLAGS construction variable. RPCGENXDRFLAGS Options passed to the RPC protocol compiler when generating XDR routines. These are in addition to any flags specified in the $RPCGENFLAGS construction variable. SCANNERS A list of the available implicit dependency scanners. New file scanners may be added by appending to this list, although the more flexible approach is to associate scanners with a specific Builder. See the sections "Builder Objects" and "Scanner Objects," below, for more information. SCONS_HOME The (optional) path to the SCons library directory, initialized from the external environment. If set, this is used to construct a shorter and more efficient search path in the $MSVSSCONS command line executed from Microsoft Visual Studio project files. SHCC The C compiler used for generating shared-library objects. SHCCCOM The command line used to compile a C source file to a shared-library object file. Any options specified in the $SHCFLAGS, $SHCCFLAGS and $CPPFLAGS construction variables are included on this command line. SHCCCOMSTR The string displayed when a C source file is compiled to a shared object file. If this is not set, then $SHCCCOM (the command line) is displayed. env = Environment(SHCCCOMSTR = "Compiling shared object $TARGET") SHCCFLAGS Options that are passed to the C and C++ compilers to generate shared-library objects. SHCFLAGS Options that are passed to the C compiler (only; not C++) to generate shared-library objects. SHCXX The C++ compiler used for generating shared-library objects. SHCXXCOM The command line used to compile a C++ source file to a shared-library object file. Any options specified in the $SHCXXFLAGS and $CPPFLAGS construction variables are included on this command line. SHCXXCOMSTR The string displayed when a C++ source file is compiled to a shared object file. If this is not set, then $SHCXXCOM (the command line) is displayed. env = Environment(SHCXXCOMSTR = "Compiling shared object $TARGET") SHCXXFLAGS Options that are passed to the C++ compiler to generate shared-library objects. SHDC The name of the compiler to use when compiling D source destined to be in a shared objects. The name of the compiler to use when compiling D source destined to be in a shared objects. The name of the compiler to use when compiling D source destined to be in a shared objects. SHDCOM The command line to use when compiling code to be part of shared objects. The command line to use when compiling code to be part of shared objects. The command line to use when compiling code to be part of shared objects. SHDLIBVERSION SHDLIBVERSION. SHDLIBVERSIONFLAGS SHDLIBVERSIONFLAGS. SHDLINK The linker to use when creating shared objects for code bases include D sources. The linker to use when creating shared objects for code bases include D sources. The linker to use when creating shared objects for code bases include D sources. SHDLINKCOM The command line to use when generating shared objects. The command line to use when generating shared objects. The command line to use when generating shared objects. SHDLINKFLAGS The list of flags to use when generating a shared object. The list of flags to use when generating a shared object. The list of flags to use when generating a shared object. SHELL A string naming the shell program that will be passed to the $SPAWN function. See the $SPAWN construction variable for more information. SHF03 The Fortran 03 compiler used for generating shared-library objects. You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set $SHF03 if you need to use a specific compiler or compiler version for Fortran 03 files. SHF03COM The command line used to compile a Fortran 03 source file to a shared-library object file. You only need to set $SHF03COM if you need to use a specific command line for Fortran 03 files. You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. SHF03COMSTR The string displayed when a Fortran 03 source file is compiled to a shared-library object file. If this is not set, then $SHF03COM or $SHFORTRANCOM (the command line) is displayed. SHF03FLAGS Options that are passed to the Fortran 03 compiler to generated shared-library objects. You only need to set $SHF03FLAGS if you need to define specific user options for Fortran 03 files. You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. SHF03PPCOM The command line used to compile a Fortran 03 source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the $SHF03FLAGS and $CPPFLAGS construction variables are included on this command line. You only need to set $SHF03PPCOM if you need to use a specific C-preprocessor command line for Fortran 03 files. You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. SHF03PPCOMSTR The string displayed when a Fortran 03 source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then $SHF03PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF08 The Fortran 08 compiler used for generating shared-library objects. You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set $SHF08 if you need to use a specific compiler or compiler version for Fortran 08 files. SHF08COM The command line used to compile a Fortran 08 source file to a shared-library object file. You only need to set $SHF08COM if you need to use a specific command line for Fortran 08 files. You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. SHF08COMSTR The string displayed when a Fortran 08 source file is compiled to a shared-library object file. If this is not set, then $SHF08COM or $SHFORTRANCOM (the command line) is displayed. SHF08FLAGS Options that are passed to the Fortran 08 compiler to generated shared-library objects. You only need to set $SHF08FLAGS if you need to define specific user options for Fortran 08 files. You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. SHF08PPCOM The command line used to compile a Fortran 08 source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the $SHF08FLAGS and $CPPFLAGS construction variables are included on this command line. You only need to set $SHF08PPCOM if you need to use a specific C-preprocessor command line for Fortran 08 files. You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. SHF08PPCOMSTR The string displayed when a Fortran 08 source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then $SHF08PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF77 The Fortran 77 compiler used for generating shared-library objects. You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set $SHF77 if you need to use a specific compiler or compiler version for Fortran 77 files. SHF77COM The command line used to compile a Fortran 77 source file to a shared-library object file. You only need to set $SHF77COM if you need to use a specific command line for Fortran 77 files. You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. SHF77COMSTR The string displayed when a Fortran 77 source file is compiled to a shared-library object file. If this is not set, then $SHF77COM or $SHFORTRANCOM (the command line) is displayed. SHF77FLAGS Options that are passed to the Fortran 77 compiler to generated shared-library objects. You only need to set $SHF77FLAGS if you need to define specific user options for Fortran 77 files. You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. SHF77PPCOM The command line used to compile a Fortran 77 source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the $SHF77FLAGS and $CPPFLAGS construction variables are included on this command line. You only need to set $SHF77PPCOM if you need to use a specific C-preprocessor command line for Fortran 77 files. You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. SHF77PPCOMSTR The string displayed when a Fortran 77 source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then $SHF77PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF90 The Fortran 90 compiler used for generating shared-library objects. You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set $SHF90 if you need to use a specific compiler or compiler version for Fortran 90 files. SHF90COM The command line used to compile a Fortran 90 source file to a shared-library object file. You only need to set $SHF90COM if you need to use a specific command line for Fortran 90 files. You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. SHF90COMSTR The string displayed when a Fortran 90 source file is compiled to a shared-library object file. If this is not set, then $SHF90COM or $SHFORTRANCOM (the command line) is displayed. SHF90FLAGS Options that are passed to the Fortran 90 compiler to generated shared-library objects. You only need to set $SHF90FLAGS if you need to define specific user options for Fortran 90 files. You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. SHF90PPCOM The command line used to compile a Fortran 90 source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the $SHF90FLAGS and $CPPFLAGS construction variables are included on this command line. You only need to set $SHF90PPCOM if you need to use a specific C-preprocessor command line for Fortran 90 files. You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. SHF90PPCOMSTR The string displayed when a Fortran 90 source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then $SHF90PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF95 The Fortran 95 compiler used for generating shared-library objects. You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. You only need to set $SHF95 if you need to use a specific compiler or compiler version for Fortran 95 files. SHF95COM The command line used to compile a Fortran 95 source file to a shared-library object file. You only need to set $SHF95COM if you need to use a specific command line for Fortran 95 files. You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. SHF95COMSTR The string displayed when a Fortran 95 source file is compiled to a shared-library object file. If this is not set, then $SHF95COM or $SHFORTRANCOM (the command line) is displayed. SHF95FLAGS Options that are passed to the Fortran 95 compiler to generated shared-library objects. You only need to set $SHF95FLAGS if you need to define specific user options for Fortran 95 files. You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. SHF95PPCOM The command line used to compile a Fortran 95 source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the $SHF95FLAGS and $CPPFLAGS construction variables are included on this command line. You only need to set $SHF95PPCOM if you need to use a specific C-preprocessor command line for Fortran 95 files. You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. SHF95PPCOMSTR The string displayed when a Fortran 95 source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then $SHF95PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHFORTRAN The default Fortran compiler used for generating shared-library objects. SHFORTRANCOM The command line used to compile a Fortran source file to a shared-library object file. SHFORTRANCOMSTR The string displayed when a Fortran source file is compiled to a shared-library object file. If this is not set, then $SHFORTRANCOM (the command line) is displayed. SHFORTRANFLAGS Options that are passed to the Fortran compiler to generate shared-library objects. SHFORTRANPPCOM The command line used to compile a Fortran source file to a shared-library object file after first running the file through the C preprocessor. Any options specified in the $SHFORTRANFLAGS and $CPPFLAGS construction variables are included on this command line. SHFORTRANPPCOMSTR The string displayed when a Fortran source file is compiled to a shared-library object file after first running the file through the C preprocessor. If this is not set, then $SHFORTRANPPCOM (the command line) is displayed. SHLIBEMITTER TODO SHLIBNOVERSIONSYMLINKS Instructs the SharedLibrary builder to not create symlinks for versioned shared libraries. SHLIBPREFIX The prefix used for shared library file names. _SHLIBSONAME A macro that automatically generates shared library's SONAME based on $TARGET, $SHLIBVERSION and $SHLIBSUFFIX. Used by SharedLibrary builder when the linker tool supports SONAME (e.g. gnulink). SHLIBSUFFIX The suffix used for shared library file names. SHLIBVERSION When this construction variable is defined, a versioned shared library is created by SharedLibrary builder. This activates the $_SHLIBVERSIONFLAGS and thus modifies the $SHLINKCOM as required, adds the version number to the library name, and creates the symlinks that are needed. $SHLIBVERSION versions should exist as alpha-numeric, decimal-delimited values as defined by the regular expression "\w+[\.\w+]*". Example $SHLIBVERSION values include '1', '1.2.3', and '1.2.gitaa412c8b'. SHLIBVERSIONFLAGS Extra flags added to $SHLINKCOM when building versioned SharedLibrary. These flags are only used when $SHLIBVERSION is set. _SHLIBVERSIONFLAGS This macro automatically introduces extra flags to $SHLINKCOM when building versioned SharedLibrary (that is when $SHLIBVERSION is set). _SHLIBVERSIONFLAGS usually adds $SHLIBVERSIONFLAGS and some extra dynamically generated options (such as -Wl,-soname=$_SHLIBSONAME. It is unused by "plain" (unversioned) shared libraries. SHLINK The linker for programs that use shared libraries. SHLINKCOM The command line used to link programs using shared libraries. SHLINKCOMSTR The string displayed when programs using shared libraries are linked. If this is not set, then $SHLINKCOM (the command line) is displayed. env = Environment(SHLINKCOMSTR = "Linking shared $TARGET") SHLINKFLAGS General user options passed to the linker for programs using shared libraries. Note that this variable should not contain (or similar) options for linking with the libraries listed in $LIBS, nor (or similar) include search path options that scons generates automatically from $LIBPATH. See $_LIBFLAGS above, for the variable that expands to library-link options, and $_LIBDIRFLAGS above, for the variable that expands to library search path options. SHOBJPREFIX The prefix used for shared object file names. SHOBJSUFFIX The suffix used for shared object file names. SONAME Variable used to hard-code SONAME for versioned shared library/loadable module. env.SharedLibrary('test', 'test.c', SHLIBVERSION='0.1.2', SONAME='libtest.so.2') The variable is used, for example, by gnulink linker tool. SOURCE A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) SOURCE_URL The URL (web address) of the location from which the project was retrieved. This is used to fill in the Source: field in the controlling information for Ipkg and RPM packages. SOURCES A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) SPAWN A command interpreter function that will be called to execute command line strings. The function must expect the following arguments: def spawn(shell, escape, cmd, args, env): sh is a string naming the shell program to use. escape is a function that can be called to escape shell special characters in the command line. cmd is the path to the command to be executed. args is the arguments to the command. env is a dictionary of the environment variables in which the command should be executed. STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME When this variable is true, static objects and shared objects are assumed to be the same; that is, SCons does not check for linking static objects into a shared library. SUBST_DICT The dictionary used by the Substfile or Textfile builders for substitution values. It can be anything acceptable to the dict() constructor, so in addition to a dictionary, lists of tuples are also acceptable. SUBSTFILEPREFIX The prefix used for Substfile file names, the null string by default. SUBSTFILESUFFIX The suffix used for Substfile file names, the null string by default. SUMMARY A short summary of what the project is about. This is used to fill in the Summary: field in the controlling information for Ipkg and RPM packages, and as the Description: field in MSI packages. SWIG The scripting language wrapper and interface generator. SWIGCFILESUFFIX The suffix that will be used for intermediate C source files generated by the scripting language wrapper and interface generator. The default value is _wrap$CFILESUFFIX. By default, this value is used whenever the option is not specified as part of the $SWIGFLAGS construction variable. SWIGCOM The command line used to call the scripting language wrapper and interface generator. SWIGCOMSTR The string displayed when calling the scripting language wrapper and interface generator. If this is not set, then $SWIGCOM (the command line) is displayed. SWIGCXXFILESUFFIX The suffix that will be used for intermediate C++ source files generated by the scripting language wrapper and interface generator. The default value is _wrap$CFILESUFFIX. By default, this value is used whenever the -c++ option is specified as part of the $SWIGFLAGS construction variable. SWIGDIRECTORSUFFIX The suffix that will be used for intermediate C++ header files generated by the scripting language wrapper and interface generator. These are only generated for C++ code when the SWIG 'directors' feature is turned on. The default value is _wrap.h. SWIGFLAGS General options passed to the scripting language wrapper and interface generator. This is where you should set , , , or whatever other options you want to specify to SWIG. If you set the option in this variable, scons will, by default, generate a C++ intermediate source file with the extension that is specified as the $CXXFILESUFFIX variable. _SWIGINCFLAGS An automatically-generated construction variable containing the SWIG command-line options for specifying directories to be searched for included files. The value of $_SWIGINCFLAGS is created by appending $SWIGINCPREFIX and $SWIGINCSUFFIX to the beginning and end of each directory in $SWIGPATH. SWIGINCPREFIX The prefix used to specify an include directory on the SWIG command line. This will be appended to the beginning of each directory in the $SWIGPATH construction variable when the $_SWIGINCFLAGS variable is automatically generated. SWIGINCSUFFIX The suffix used to specify an include directory on the SWIG command line. This will be appended to the end of each directory in the $SWIGPATH construction variable when the $_SWIGINCFLAGS variable is automatically generated. SWIGOUTDIR Specifies the output directory in which the scripting language wrapper and interface generator should place generated language-specific files. This will be used by SCons to identify the files that will be generated by the swig call, and translated into the swig -outdir option on the command line. SWIGPATH The list of directories that the scripting language wrapper and interface generate will search for included files. The SWIG implicit dependency scanner will search these directories for include files. The default value is an empty list. Don't explicitly put include directory arguments in SWIGFLAGS; the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in SWIGPATH will be looked-up relative to the SConscript directory when they are used in a command. To force scons to look-up a directory relative to the root of the source tree use #: env = Environment(SWIGPATH='#/include') The directory look-up can also be forced using the Dir() function: include = Dir('include') env = Environment(SWIGPATH=include) The directory list will be added to command lines through the automatically-generated $_SWIGINCFLAGS construction variable, which is constructed by appending the values of the $SWIGINCPREFIX and $SWIGINCSUFFIX construction variables to the beginning and end of each directory in $SWIGPATH. Any command lines you define that need the SWIGPATH directory list should include $_SWIGINCFLAGS: env = Environment(SWIGCOM="my_swig -o $TARGET $_SWIGINCFLAGS $SOURCES") SWIGVERSION The version number of the SWIG tool. TAR The tar archiver. TARCOM The command line used to call the tar archiver. TARCOMSTR The string displayed when archiving files using the tar archiver. If this is not set, then $TARCOM (the command line) is displayed. env = Environment(TARCOMSTR = "Archiving $TARGET") TARFLAGS General options passed to the tar archiver. TARGET A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) TARGET_ARCH Sets the target architecture for Visual Studio compiler (i.e. the arch of the binaries generated by the compiler). If not set, default to $HOST_ARCH, or, if that is unset, to the architecture of the running machine's OS (note that the python build or architecture has no effect). This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. This is currently only used on Windows, but in the future it will be used on other OSes as well. Valid values for Windows are x86, i386 (for 32 bits); amd64, emt64, x86_64 (for 64 bits); and ia64 (Itanium). For example, if you want to compile 64-bit binaries, you would set TARGET_ARCH='x86_64' in your SCons environment. The name of the target hardware architecture for the compiled objects created by this Environment. This defaults to the value of HOST_ARCH, and the user can override it. Currently only set for Win32. TARGET_OS The name of the target operating system for the compiled objects created by this Environment. This defaults to the value of HOST_OS, and the user can override it. Currently only set for Win32. TARGETS A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) TARSUFFIX The suffix used for tar file names. TEMPFILEPREFIX The prefix for a temporary file used to execute lines longer than $MAXLINELENGTH. The default is '@'. This may be set for toolchains that use other values, such as '-@' for the diab compiler or '-via' for ARM toolchain. TEX The TeX formatter and typesetter. TEXCOM The command line used to call the TeX formatter and typesetter. TEXCOMSTR The string displayed when calling the TeX formatter and typesetter. If this is not set, then $TEXCOM (the command line) is displayed. env = Environment(TEXCOMSTR = "Building $TARGET from TeX input $SOURCES") TEXFLAGS General options passed to the TeX formatter and typesetter. TEXINPUTS List of directories that the LaTeX program will search for include directories. The LaTeX implicit dependency scanner will search these directories for \include and \import files. TEXTFILEPREFIX The prefix used for Textfile file names, the null string by default. TEXTFILESUFFIX The suffix used for Textfile file names; .txt by default. TOOLS A list of the names of the Tool specifications that are part of this construction environment. UNCHANGED_SOURCES A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) UNCHANGED_TARGETS A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) VENDOR The person or organization who supply the packaged software. This is used to fill in the Vendor: field in the controlling information for RPM packages, and the Manufacturer: field in the controlling information for MSI packages. VERSION The version of the project, specified as a string. WIN32_INSERT_DEF A deprecated synonym for $WINDOWS_INSERT_DEF. WIN32DEFPREFIX A deprecated synonym for $WINDOWSDEFPREFIX. WIN32DEFSUFFIX A deprecated synonym for $WINDOWSDEFSUFFIX. WIN32EXPPREFIX A deprecated synonym for $WINDOWSEXPSUFFIX. WIN32EXPSUFFIX A deprecated synonym for $WINDOWSEXPSUFFIX. WINDOWS_EMBED_MANIFEST Set this variable to True or 1 to embed the compiler-generated manifest (normally ${TARGET}.manifest) into all Windows exes and DLLs built with this environment, as a resource during their link step. This is done using $MT and $MTEXECOM and $MTSHLIBCOM. WINDOWS_INSERT_DEF When this is set to true, a library build of a Windows shared library (.dll file) will also build a corresponding .def file at the same time, if a .def file is not already listed as a build target. The default is 0 (do not build a .def file). WINDOWS_INSERT_MANIFEST When this is set to true, scons will be aware of the .manifest files generated by Microsoft Visua C/C++ 8. WINDOWSDEFPREFIX The prefix used for Windows .def file names. WINDOWSDEFSUFFIX The suffix used for Windows .def file names. WINDOWSEXPPREFIX The prefix used for Windows .exp file names. WINDOWSEXPSUFFIX The suffix used for Windows .exp file names. WINDOWSPROGMANIFESTPREFIX The prefix used for executable program .manifest files generated by Microsoft Visual C/C++. WINDOWSPROGMANIFESTSUFFIX The suffix used for executable program .manifest files generated by Microsoft Visual C/C++. WINDOWSSHLIBMANIFESTPREFIX The prefix used for shared library .manifest files generated by Microsoft Visual C/C++. WINDOWSSHLIBMANIFESTSUFFIX The suffix used for shared library .manifest files generated by Microsoft Visual C/C++. X_IPK_DEPENDS This is used to fill in the Depends: field in the controlling information for Ipkg packages. X_IPK_DESCRIPTION This is used to fill in the Description: field in the controlling information for Ipkg packages. The default value is $SUMMARY\n$DESCRIPTION X_IPK_MAINTAINER This is used to fill in the Maintainer: field in the controlling information for Ipkg packages. X_IPK_PRIORITY This is used to fill in the Priority: field in the controlling information for Ipkg packages. X_IPK_SECTION This is used to fill in the Section: field in the controlling information for Ipkg packages. X_MSI_LANGUAGE This is used to fill in the Language: attribute in the controlling information for MSI packages. X_MSI_LICENSE_TEXT The text of the software license in RTF format. Carriage return characters will be replaced with the RTF equivalent \\par. X_MSI_UPGRADE_CODE TODO X_RPM_AUTOREQPROV This is used to fill in the AutoReqProv: field in the RPM .spec file. X_RPM_BUILD internal, but overridable X_RPM_BUILDREQUIRES This is used to fill in the BuildRequires: field in the RPM .spec file. X_RPM_BUILDROOT internal, but overridable X_RPM_CLEAN internal, but overridable X_RPM_CONFLICTS This is used to fill in the Conflicts: field in the RPM .spec file. X_RPM_DEFATTR This value is used as the default attributes for the files in the RPM package. The default value is (-,root,root). X_RPM_DISTRIBUTION This is used to fill in the Distribution: field in the RPM .spec file. X_RPM_EPOCH This is used to fill in the Epoch: field in the controlling information for RPM packages. X_RPM_EXCLUDEARCH This is used to fill in the ExcludeArch: field in the RPM .spec file. X_RPM_EXLUSIVEARCH This is used to fill in the ExclusiveArch: field in the RPM .spec file. X_RPM_GROUP This is used to fill in the Group: field in the RPM .spec file. X_RPM_GROUP_lang This is used to fill in the Group(lang): field in the RPM .spec file. Note that lang is not literal and should be replaced by the appropriate language code. X_RPM_ICON This is used to fill in the Icon: field in the RPM .spec file. X_RPM_INSTALL internal, but overridable X_RPM_PACKAGER This is used to fill in the Packager: field in the RPM .spec file. X_RPM_POSTINSTALL This is used to fill in the %post: section in the RPM .spec file. X_RPM_POSTUNINSTALL This is used to fill in the %postun: section in the RPM .spec file. X_RPM_PREFIX This is used to fill in the Prefix: field in the RPM .spec file. X_RPM_PREINSTALL This is used to fill in the %pre: section in the RPM .spec file. X_RPM_PREP internal, but overridable X_RPM_PREUNINSTALL This is used to fill in the %preun: section in the RPM .spec file. X_RPM_PROVIDES This is used to fill in the Provides: field in the RPM .spec file. X_RPM_REQUIRES This is used to fill in the Requires: field in the RPM .spec file. X_RPM_SERIAL This is used to fill in the Serial: field in the RPM .spec file. X_RPM_URL This is used to fill in the Url: field in the RPM .spec file. XGETTEXT Path to xgettext(1) program (found via Detect()). See xgettext tool and POTUpdate builder. XGETTEXTCOM Complete xgettext command line. See xgettext tool and POTUpdate builder. XGETTEXTCOMSTR A string that is shown when xgettext(1) command is invoked (default: '', which means "print $XGETTEXTCOM"). See xgettext tool and POTUpdate builder. _XGETTEXTDOMAIN Internal "macro". Generates xgettext domain name form source and target (default: '${TARGET.filebase}'). XGETTEXTFLAGS Additional flags to xgettext(1). See xgettext tool and POTUpdate builder. XGETTEXTFROM Name of file containing list of xgettext(1)'s source files. Autotools' users know this as POTFILES.in so they will in most cases set XGETTEXTFROM="POTFILES.in" here. The $XGETTEXTFROM files have same syntax and semantics as the well known GNU POTFILES.in. See xgettext tool and POTUpdate builder. _XGETTEXTFROMFLAGS Internal "macro". Genrates list of -D<dir> flags from the $XGETTEXTPATH list. XGETTEXTFROMPREFIX This flag is used to add single $XGETTEXTFROM file to xgettext(1)'s commandline (default: '-f'). XGETTEXTFROMSUFFIX (default: '') XGETTEXTPATH List of directories, there xgettext(1) will look for source files (default: []). This variable works only together with $XGETTEXTFROM See also xgettext tool and POTUpdate builder. _XGETTEXTPATHFLAGS Internal "macro". Generates list of -f<file> flags from $XGETTEXTFROM. XGETTEXTPATHPREFIX This flag is used to add single search path to xgettext(1)'s commandline (default: '-D'). XGETTEXTPATHSUFFIX (default: '') YACC The parser generator. YACCCOM The command line used to call the parser generator to generate a source file. YACCCOMSTR The string displayed when generating a source file using the parser generator. If this is not set, then $YACCCOM (the command line) is displayed. env = Environment(YACCCOMSTR = "Yacc'ing $TARGET from $SOURCES") YACCFLAGS General options passed to the parser generator. If $YACCFLAGS contains a option, SCons assumes that the call will also create a .h file (if the yacc source file ends in a .y suffix) or a .hpp file (if the yacc source file ends in a .yy suffix) YACCHFILESUFFIX The suffix of the C header file generated by the parser generator when the option is used. Note that setting this variable does not cause the parser generator to generate a header file with the specified suffix, it exists to allow you to specify what suffix the parser generator will use of its own accord. The default value is .h. YACCHXXFILESUFFIX The suffix of the C++ header file generated by the parser generator when the option is used. Note that setting this variable does not cause the parser generator to generate a header file with the specified suffix, it exists to allow you to specify what suffix the parser generator will use of its own accord. The default value is .hpp, except on Mac OS X, where the default is ${TARGET.suffix}.h. because the default bison parser generator just appends .h to the name of the generated C++ file. YACCVCGFILESUFFIX The suffix of the file containing the VCG grammar automaton definition when the option is used. Note that setting this variable does not cause the parser generator to generate a VCG file with the specified suffix, it exists to allow you to specify what suffix the parser generator will use of its own accord. The default value is .vcg. ZIP The zip compression and file packaging utility. ZIPCOM The command line used to call the zip utility, or the internal Python function used to create a zip archive. ZIPCOMPRESSION The compression flag from the Python zipfile module used by the internal Python function to control whether the zip archive is compressed or not. The default value is zipfile.ZIP_DEFLATED, which creates a compressed zip archive. This value has no effect if the zipfile module is unavailable. ZIPCOMSTR The string displayed when archiving files using the zip utility. If this is not set, then $ZIPCOM (the command line or internal Python function) is displayed. env = Environment(ZIPCOMSTR = "Zipping $TARGET") ZIPFLAGS General options passed to the zip utility. ZIPROOT An optional zip root directory (default empty). The filenames stored in the zip file will be relative to this directory, if given. Otherwise the filenames are relative to the current directory of the command. For instance: env = Environment() env.Zip('foo.zip', 'subdir1/subdir2/file1', ZIPROOT='subdir1') will produce a zip file foo.zip containing a file with the name subdir2/file1 rather than subdir1/subdir2/file1. ZIPSUFFIX The suffix used for zip file names. scons-src-3.0.0/doc/generated/variables.mod0000664000175000017500000043366313160023040020644 0ustar bdbaddogbdbaddog $__LDMODULEVERSIONFLAGS"> $__SHLIBVERSIONFLAGS"> $AR"> $ARCHITECTURE"> $ARCOM"> $ARCOMSTR"> $ARFLAGS"> $AS"> $ASCOM"> $ASCOMSTR"> $ASFLAGS"> $ASPPCOM"> $ASPPCOMSTR"> $ASPPFLAGS"> $BIBTEX"> $BIBTEXCOM"> $BIBTEXCOMSTR"> $BIBTEXFLAGS"> $BUILDERS"> $CC"> $CCCOM"> $CCCOMSTR"> $CCFLAGS"> $CCPCHFLAGS"> $CCPDBFLAGS"> $CCVERSION"> $CFILESUFFIX"> $CFLAGS"> $CHANGE_SPECFILE"> $CHANGED_SOURCES"> $CHANGED_TARGETS"> $CHANGELOG"> $_concat"> $CONFIGUREDIR"> $CONFIGURELOG"> $_CPPDEFFLAGS"> $CPPDEFINES"> $CPPDEFPREFIX"> $CPPDEFSUFFIX"> $CPPFLAGS"> $_CPPINCFLAGS"> $CPPPATH"> $CPPSUFFIXES"> $CXX"> $CXXCOM"> $CXXCOMSTR"> $CXXFILESUFFIX"> $CXXFLAGS"> $CXXVERSION"> $DC"> $DCOM"> $DDEBUG"> $DDEBUGPREFIX"> $DDEBUGSUFFIX"> $DESCRIPTION"> $DESCRIPTION_lang"> $DFILESUFFIX"> $DFLAGPREFIX"> $DFLAGS"> $DFLAGSUFFIX"> $DINCPREFIX"> $DINCSUFFIX"> $Dir"> $Dirs"> $DLIB"> $DLIBCOM"> $DLIBDIRPREFIX"> $DLIBDIRSUFFIX"> $DLIBFLAGPREFIX"> $DLIBFLAGSUFFIX"> $DLIBLINKPREFIX"> $DLIBLINKSUFFIX"> $DLINK"> $DLINKCOM"> $DLINKFLAGPREFIX"> $DLINKFLAGS"> $DLINKFLAGSUFFIX"> $DOCBOOK_DEFAULT_XSL_EPUB"> $DOCBOOK_DEFAULT_XSL_HTML"> $DOCBOOK_DEFAULT_XSL_HTMLCHUNKED"> $DOCBOOK_DEFAULT_XSL_HTMLHELP"> $DOCBOOK_DEFAULT_XSL_MAN"> $DOCBOOK_DEFAULT_XSL_PDF"> $DOCBOOK_DEFAULT_XSL_SLIDESHTML"> $DOCBOOK_DEFAULT_XSL_SLIDESPDF"> $DOCBOOK_FOP"> $DOCBOOK_FOPCOM"> $DOCBOOK_FOPCOMSTR"> $DOCBOOK_FOPFLAGS"> $DOCBOOK_XMLLINT"> $DOCBOOK_XMLLINTCOM"> $DOCBOOK_XMLLINTCOMSTR"> $DOCBOOK_XMLLINTFLAGS"> $DOCBOOK_XSLTPROC"> $DOCBOOK_XSLTPROCCOM"> $DOCBOOK_XSLTPROCCOMSTR"> $DOCBOOK_XSLTPROCFLAGS"> $DOCBOOK_XSLTPROCPARAMS"> $DPATH"> $DRPATHPREFIX"> $DRPATHSUFFIX"> $DShLibSonameGenerator"> $DSUFFIXES"> $DVERPREFIX"> $DVERSIONS"> $DVERSUFFIX"> $DVIPDF"> $DVIPDFCOM"> $DVIPDFCOMSTR"> $DVIPDFFLAGS"> $DVIPS"> $DVIPSFLAGS"> $ENV"> $ESCAPE"> $F03"> $F03COM"> $F03COMSTR"> $F03FILESUFFIXES"> $F03FLAGS"> $_F03INCFLAGS"> $F03PATH"> $F03PPCOM"> $F03PPCOMSTR"> $F03PPFILESUFFIXES"> $F08"> $F08COM"> $F08COMSTR"> $F08FILESUFFIXES"> $F08FLAGS"> $_F08INCFLAGS"> $F08PATH"> $F08PPCOM"> $F08PPCOMSTR"> $F08PPFILESUFFIXES"> $F77"> $F77COM"> $F77COMSTR"> $F77FILESUFFIXES"> $F77FLAGS"> $_F77INCFLAGS"> $F77PATH"> $F77PPCOM"> $F77PPCOMSTR"> $F77PPFILESUFFIXES"> $F90"> $F90COM"> $F90COMSTR"> $F90FILESUFFIXES"> $F90FLAGS"> $_F90INCFLAGS"> $F90PATH"> $F90PPCOM"> $F90PPCOMSTR"> $F90PPFILESUFFIXES"> $F95"> $F95COM"> $F95COMSTR"> $F95FILESUFFIXES"> $F95FLAGS"> $_F95INCFLAGS"> $F95PATH"> $F95PPCOM"> $F95PPCOMSTR"> $F95PPFILESUFFIXES"> $File"> $FORTRAN"> $FORTRANCOM"> $FORTRANCOMSTR"> $FORTRANFILESUFFIXES"> $FORTRANFLAGS"> $_FORTRANINCFLAGS"> $FORTRANMODDIR"> $FORTRANMODDIRPREFIX"> $FORTRANMODDIRSUFFIX"> $_FORTRANMODFLAG"> $FORTRANMODPREFIX"> $FORTRANMODSUFFIX"> $FORTRANPATH"> $FORTRANPPCOM"> $FORTRANPPCOMSTR"> $FORTRANPPFILESUFFIXES"> $FORTRANSUFFIXES"> $FRAMEWORKPATH"> $_FRAMEWORKPATH"> $FRAMEWORKPATHPREFIX"> $FRAMEWORKPREFIX"> $_FRAMEWORKS"> $FRAMEWORKS"> $FRAMEWORKSFLAGS"> $GS"> $GSCOM"> $GSCOMSTR"> $GSFLAGS"> $HOST_ARCH"> $HOST_OS"> $IDLSUFFIXES"> $IMPLIBNOVERSIONSYMLINKS"> $IMPLIBPREFIX"> $IMPLIBSUFFIX"> $IMPLIBVERSION"> $IMPLICIT_COMMAND_DEPENDENCIES"> $INCPREFIX"> $INCSUFFIX"> $INSTALL"> $INSTALLSTR"> $INTEL_C_COMPILER_VERSION"> $JAR"> $JARCHDIR"> $JARCOM"> $JARCOMSTR"> $JARFLAGS"> $JARSUFFIX"> $JAVABOOTCLASSPATH"> $JAVAC"> $JAVACCOM"> $JAVACCOMSTR"> $JAVACFLAGS"> $JAVACLASSDIR"> $JAVACLASSPATH"> $JAVACLASSSUFFIX"> $JAVAH"> $JAVAHCOM"> $JAVAHCOMSTR"> $JAVAHFLAGS"> $JAVASOURCEPATH"> $JAVASUFFIX"> $JAVAVERSION"> $LATEX"> $LATEXCOM"> $LATEXCOMSTR"> $LATEXFLAGS"> $LATEXRETRIES"> $LATEXSUFFIXES"> $LDMODULE"> $LDMODULECOM"> $LDMODULECOMSTR"> $LDMODULEFLAGS"> $LDMODULENOVERSIONSYMLINKS"> $LDMODULEPREFIX"> $_LDMODULESONAME"> $LDMODULESUFFIX"> $LDMODULEVERSION"> $LDMODULEVERSIONFLAGS"> $_LDMODULEVERSIONFLAGS"> $LEX"> $LEXCOM"> $LEXCOMSTR"> $LEXFLAGS"> $_LIBDIRFLAGS"> $LIBDIRPREFIX"> $LIBDIRSUFFIX"> $LIBEMITTER"> $_LIBFLAGS"> $LIBLINKPREFIX"> $LIBLINKSUFFIX"> $LIBPATH"> $LIBPREFIX"> $LIBPREFIXES"> $LIBS"> $LIBSUFFIX"> $LIBSUFFIXES"> $LICENSE"> $LINESEPARATOR"> $LINGUAS_FILE"> $LINK"> $LINKCOM"> $LINKCOMSTR"> $LINKFLAGS"> $M4"> $M4COM"> $M4COMSTR"> $M4FLAGS"> $MAKEINDEX"> $MAKEINDEXCOM"> $MAKEINDEXCOMSTR"> $MAKEINDEXFLAGS"> $MAXLINELENGTH"> $MIDL"> $MIDLCOM"> $MIDLCOMSTR"> $MIDLFLAGS"> $MOSUFFIX"> $MSGFMT"> $MSGFMTCOM"> $MSGFMTCOMSTR"> $MSGFMTFLAGS"> $MSGINIT"> $MSGINITCOM"> $MSGINITCOMSTR"> $MSGINITFLAGS"> $_MSGINITLOCALE"> $MSGMERGE"> $MSGMERGECOM"> $MSGMERGECOMSTR"> $MSGMERGEFLAGS"> $MSSDK_DIR"> $MSSDK_VERSION"> $MSVC_BATCH"> $MSVC_USE_SCRIPT"> $MSVC_UWP_APP"> $MSVC_VERSION"> $MSVS"> $MSVS_ARCH"> $MSVS_PROJECT_GUID"> $MSVS_SCC_AUX_PATH"> $MSVS_SCC_CONNECTION_ROOT"> $MSVS_SCC_PROJECT_NAME"> $MSVS_SCC_PROVIDER"> $MSVS_VERSION"> $MSVSBUILDCOM"> $MSVSCLEANCOM"> $MSVSENCODING"> $MSVSPROJECTCOM"> $MSVSPROJECTSUFFIX"> $MSVSREBUILDCOM"> $MSVSSCONS"> $MSVSSCONSCOM"> $MSVSSCONSCRIPT"> $MSVSSCONSFLAGS"> $MSVSSOLUTIONCOM"> $MSVSSOLUTIONSUFFIX"> $MT"> $MTEXECOM"> $MTFLAGS"> $MTSHLIBCOM"> $MWCW_VERSION"> $MWCW_VERSIONS"> $NAME"> $no_import_lib"> $OBJPREFIX"> $OBJSUFFIX"> $PACKAGEROOT"> $PACKAGETYPE"> $PACKAGEVERSION"> $PCH"> $PCHCOM"> $PCHCOMSTR"> $PCHPDBFLAGS"> $PCHSTOP"> $PDB"> $PDFCOM"> $PDFLATEX"> $PDFLATEXCOM"> $PDFLATEXCOMSTR"> $PDFLATEXFLAGS"> $PDFPREFIX"> $PDFSUFFIX"> $PDFTEX"> $PDFTEXCOM"> $PDFTEXCOMSTR"> $PDFTEXFLAGS"> $PKGCHK"> $PKGINFO"> $PLATFORM"> $POAUTOINIT"> $POCREATE_ALIAS"> $POSUFFIX"> $POTDOMAIN"> $POTSUFFIX"> $POTUPDATE_ALIAS"> $POUPDATE_ALIAS"> $PRINT_CMD_LINE_FUNC"> $PROGEMITTER"> $PROGPREFIX"> $PROGSUFFIX"> $PSCOM"> $PSCOMSTR"> $PSPREFIX"> $PSSUFFIX"> $QT_AUTOSCAN"> $QT_BINPATH"> $QT_CPPPATH"> $QT_DEBUG"> $QT_LIB"> $QT_LIBPATH"> $QT_MOC"> $QT_MOCCXXPREFIX"> $QT_MOCCXXSUFFIX"> $QT_MOCFROMCXXCOM"> $QT_MOCFROMCXXCOMSTR"> $QT_MOCFROMCXXFLAGS"> $QT_MOCFROMHCOM"> $QT_MOCFROMHCOMSTR"> $QT_MOCFROMHFLAGS"> $QT_MOCHPREFIX"> $QT_MOCHSUFFIX"> $QT_UIC"> $QT_UICCOM"> $QT_UICCOMSTR"> $QT_UICDECLFLAGS"> $QT_UICDECLPREFIX"> $QT_UICDECLSUFFIX"> $QT_UICIMPLFLAGS"> $QT_UICIMPLPREFIX"> $QT_UICIMPLSUFFIX"> $QT_UISUFFIX"> $QTDIR"> $RANLIB"> $RANLIBCOM"> $RANLIBCOMSTR"> $RANLIBFLAGS"> $RC"> $RCCOM"> $RCCOMSTR"> $RCFLAGS"> $RCINCFLAGS"> $RCINCPREFIX"> $RCINCSUFFIX"> $RDirs"> $REGSVR"> $REGSVRCOM"> $REGSVRCOMSTR"> $REGSVRFLAGS"> $RMIC"> $RMICCOM"> $RMICCOMSTR"> $RMICFLAGS"> $_RPATH"> $RPATH"> $RPATHPREFIX"> $RPATHSUFFIX"> $RPCGEN"> $RPCGENCLIENTFLAGS"> $RPCGENFLAGS"> $RPCGENHEADERFLAGS"> $RPCGENSERVICEFLAGS"> $RPCGENXDRFLAGS"> $SCANNERS"> $SCONS_HOME"> $SHCC"> $SHCCCOM"> $SHCCCOMSTR"> $SHCCFLAGS"> $SHCFLAGS"> $SHCXX"> $SHCXXCOM"> $SHCXXCOMSTR"> $SHCXXFLAGS"> $SHDC"> $SHDCOM"> $SHDLIBVERSION"> $SHDLIBVERSIONFLAGS"> $SHDLINK"> $SHDLINKCOM"> $SHDLINKFLAGS"> $SHELL"> $SHF03"> $SHF03COM"> $SHF03COMSTR"> $SHF03FLAGS"> $SHF03PPCOM"> $SHF03PPCOMSTR"> $SHF08"> $SHF08COM"> $SHF08COMSTR"> $SHF08FLAGS"> $SHF08PPCOM"> $SHF08PPCOMSTR"> $SHF77"> $SHF77COM"> $SHF77COMSTR"> $SHF77FLAGS"> $SHF77PPCOM"> $SHF77PPCOMSTR"> $SHF90"> $SHF90COM"> $SHF90COMSTR"> $SHF90FLAGS"> $SHF90PPCOM"> $SHF90PPCOMSTR"> $SHF95"> $SHF95COM"> $SHF95COMSTR"> $SHF95FLAGS"> $SHF95PPCOM"> $SHF95PPCOMSTR"> $SHFORTRAN"> $SHFORTRANCOM"> $SHFORTRANCOMSTR"> $SHFORTRANFLAGS"> $SHFORTRANPPCOM"> $SHFORTRANPPCOMSTR"> $SHLIBEMITTER"> $SHLIBNOVERSIONSYMLINKS"> $SHLIBPREFIX"> $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> $SHLIBVERSIONFLAGS"> $_SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> $SHLINKFLAGS"> $SHOBJPREFIX"> $SHOBJSUFFIX"> $SONAME"> $SOURCE"> $SOURCE_URL"> $SOURCES"> $SPAWN"> $STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME"> $SUBST_DICT"> $SUBSTFILEPREFIX"> $SUBSTFILESUFFIX"> $SUMMARY"> $SWIG"> $SWIGCFILESUFFIX"> $SWIGCOM"> $SWIGCOMSTR"> $SWIGCXXFILESUFFIX"> $SWIGDIRECTORSUFFIX"> $SWIGFLAGS"> $_SWIGINCFLAGS"> $SWIGINCPREFIX"> $SWIGINCSUFFIX"> $SWIGOUTDIR"> $SWIGPATH"> $SWIGVERSION"> $TAR"> $TARCOM"> $TARCOMSTR"> $TARFLAGS"> $TARGET"> $TARGET_ARCH"> $TARGET_OS"> $TARGETS"> $TARSUFFIX"> $TEMPFILEPREFIX"> $TEX"> $TEXCOM"> $TEXCOMSTR"> $TEXFLAGS"> $TEXINPUTS"> $TEXTFILEPREFIX"> $TEXTFILESUFFIX"> $TOOLS"> $UNCHANGED_SOURCES"> $UNCHANGED_TARGETS"> $VENDOR"> $VERSION"> $WIN32_INSERT_DEF"> $WIN32DEFPREFIX"> $WIN32DEFSUFFIX"> $WIN32EXPPREFIX"> $WIN32EXPSUFFIX"> $WINDOWS_EMBED_MANIFEST"> $WINDOWS_INSERT_DEF"> $WINDOWS_INSERT_MANIFEST"> $WINDOWSDEFPREFIX"> $WINDOWSDEFSUFFIX"> $WINDOWSEXPPREFIX"> $WINDOWSEXPSUFFIX"> $WINDOWSPROGMANIFESTPREFIX"> $WINDOWSPROGMANIFESTSUFFIX"> $WINDOWSSHLIBMANIFESTPREFIX"> $WINDOWSSHLIBMANIFESTSUFFIX"> $X_IPK_DEPENDS"> $X_IPK_DESCRIPTION"> $X_IPK_MAINTAINER"> $X_IPK_PRIORITY"> $X_IPK_SECTION"> $X_MSI_LANGUAGE"> $X_MSI_LICENSE_TEXT"> $X_MSI_UPGRADE_CODE"> $X_RPM_AUTOREQPROV"> $X_RPM_BUILD"> $X_RPM_BUILDREQUIRES"> $X_RPM_BUILDROOT"> $X_RPM_CLEAN"> $X_RPM_CONFLICTS"> $X_RPM_DEFATTR"> $X_RPM_DISTRIBUTION"> $X_RPM_EPOCH"> $X_RPM_EXCLUDEARCH"> $X_RPM_EXLUSIVEARCH"> $X_RPM_GROUP"> $X_RPM_GROUP_lang"> $X_RPM_ICON"> $X_RPM_INSTALL"> $X_RPM_PACKAGER"> $X_RPM_POSTINSTALL"> $X_RPM_POSTUNINSTALL"> $X_RPM_PREFIX"> $X_RPM_PREINSTALL"> $X_RPM_PREP"> $X_RPM_PREUNINSTALL"> $X_RPM_PROVIDES"> $X_RPM_REQUIRES"> $X_RPM_SERIAL"> $X_RPM_URL"> $XGETTEXT"> $XGETTEXTCOM"> $XGETTEXTCOMSTR"> $_XGETTEXTDOMAIN"> $XGETTEXTFLAGS"> $XGETTEXTFROM"> $_XGETTEXTFROMFLAGS"> $XGETTEXTFROMPREFIX"> $XGETTEXTFROMSUFFIX"> $XGETTEXTPATH"> $_XGETTEXTPATHFLAGS"> $XGETTEXTPATHPREFIX"> $XGETTEXTPATHSUFFIX"> $YACC"> $YACCCOM"> $YACCCOMSTR"> $YACCFLAGS"> $YACCHFILESUFFIX"> $YACCHXXFILESUFFIX"> $YACCVCGFILESUFFIX"> $ZIP"> $ZIPCOM"> $ZIPCOMPRESSION"> $ZIPCOMSTR"> $ZIPFLAGS"> $ZIPROOT"> $ZIPSUFFIX"> $__LDMODULEVERSIONFLAGS"> $__SHLIBVERSIONFLAGS"> $AR"> $ARCHITECTURE"> $ARCOM"> $ARCOMSTR"> $ARFLAGS"> $AS"> $ASCOM"> $ASCOMSTR"> $ASFLAGS"> $ASPPCOM"> $ASPPCOMSTR"> $ASPPFLAGS"> $BIBTEX"> $BIBTEXCOM"> $BIBTEXCOMSTR"> $BIBTEXFLAGS"> $BUILDERS"> $CC"> $CCCOM"> $CCCOMSTR"> $CCFLAGS"> $CCPCHFLAGS"> $CCPDBFLAGS"> $CCVERSION"> $CFILESUFFIX"> $CFLAGS"> $CHANGE_SPECFILE"> $CHANGED_SOURCES"> $CHANGED_TARGETS"> $CHANGELOG"> $_concat"> $CONFIGUREDIR"> $CONFIGURELOG"> $_CPPDEFFLAGS"> $CPPDEFINES"> $CPPDEFPREFIX"> $CPPDEFSUFFIX"> $CPPFLAGS"> $_CPPINCFLAGS"> $CPPPATH"> $CPPSUFFIXES"> $CXX"> $CXXCOM"> $CXXCOMSTR"> $CXXFILESUFFIX"> $CXXFLAGS"> $CXXVERSION"> $DC"> $DCOM"> $DDEBUG"> $DDEBUGPREFIX"> $DDEBUGSUFFIX"> $DESCRIPTION"> $DESCRIPTION_lang"> $DFILESUFFIX"> $DFLAGPREFIX"> $DFLAGS"> $DFLAGSUFFIX"> $DINCPREFIX"> $DINCSUFFIX"> $Dir"> $Dirs"> $DLIB"> $DLIBCOM"> $DLIBDIRPREFIX"> $DLIBDIRSUFFIX"> $DLIBFLAGPREFIX"> $DLIBFLAGSUFFIX"> $DLIBLINKPREFIX"> $DLIBLINKSUFFIX"> $DLINK"> $DLINKCOM"> $DLINKFLAGPREFIX"> $DLINKFLAGS"> $DLINKFLAGSUFFIX"> $DOCBOOK_DEFAULT_XSL_EPUB"> $DOCBOOK_DEFAULT_XSL_HTML"> $DOCBOOK_DEFAULT_XSL_HTMLCHUNKED"> $DOCBOOK_DEFAULT_XSL_HTMLHELP"> $DOCBOOK_DEFAULT_XSL_MAN"> $DOCBOOK_DEFAULT_XSL_PDF"> $DOCBOOK_DEFAULT_XSL_SLIDESHTML"> $DOCBOOK_DEFAULT_XSL_SLIDESPDF"> $DOCBOOK_FOP"> $DOCBOOK_FOPCOM"> $DOCBOOK_FOPCOMSTR"> $DOCBOOK_FOPFLAGS"> $DOCBOOK_XMLLINT"> $DOCBOOK_XMLLINTCOM"> $DOCBOOK_XMLLINTCOMSTR"> $DOCBOOK_XMLLINTFLAGS"> $DOCBOOK_XSLTPROC"> $DOCBOOK_XSLTPROCCOM"> $DOCBOOK_XSLTPROCCOMSTR"> $DOCBOOK_XSLTPROCFLAGS"> $DOCBOOK_XSLTPROCPARAMS"> $DPATH"> $DRPATHPREFIX"> $DRPATHSUFFIX"> $DShLibSonameGenerator"> $DSUFFIXES"> $DVERPREFIX"> $DVERSIONS"> $DVERSUFFIX"> $DVIPDF"> $DVIPDFCOM"> $DVIPDFCOMSTR"> $DVIPDFFLAGS"> $DVIPS"> $DVIPSFLAGS"> $ENV"> $ESCAPE"> $F03"> $F03COM"> $F03COMSTR"> $F03FILESUFFIXES"> $F03FLAGS"> $_F03INCFLAGS"> $F03PATH"> $F03PPCOM"> $F03PPCOMSTR"> $F03PPFILESUFFIXES"> $F08"> $F08COM"> $F08COMSTR"> $F08FILESUFFIXES"> $F08FLAGS"> $_F08INCFLAGS"> $F08PATH"> $F08PPCOM"> $F08PPCOMSTR"> $F08PPFILESUFFIXES"> $F77"> $F77COM"> $F77COMSTR"> $F77FILESUFFIXES"> $F77FLAGS"> $_F77INCFLAGS"> $F77PATH"> $F77PPCOM"> $F77PPCOMSTR"> $F77PPFILESUFFIXES"> $F90"> $F90COM"> $F90COMSTR"> $F90FILESUFFIXES"> $F90FLAGS"> $_F90INCFLAGS"> $F90PATH"> $F90PPCOM"> $F90PPCOMSTR"> $F90PPFILESUFFIXES"> $F95"> $F95COM"> $F95COMSTR"> $F95FILESUFFIXES"> $F95FLAGS"> $_F95INCFLAGS"> $F95PATH"> $F95PPCOM"> $F95PPCOMSTR"> $F95PPFILESUFFIXES"> $File"> $FORTRAN"> $FORTRANCOM"> $FORTRANCOMSTR"> $FORTRANFILESUFFIXES"> $FORTRANFLAGS"> $_FORTRANINCFLAGS"> $FORTRANMODDIR"> $FORTRANMODDIRPREFIX"> $FORTRANMODDIRSUFFIX"> $_FORTRANMODFLAG"> $FORTRANMODPREFIX"> $FORTRANMODSUFFIX"> $FORTRANPATH"> $FORTRANPPCOM"> $FORTRANPPCOMSTR"> $FORTRANPPFILESUFFIXES"> $FORTRANSUFFIXES"> $FRAMEWORKPATH"> $_FRAMEWORKPATH"> $FRAMEWORKPATHPREFIX"> $FRAMEWORKPREFIX"> $_FRAMEWORKS"> $FRAMEWORKS"> $FRAMEWORKSFLAGS"> $GS"> $GSCOM"> $GSCOMSTR"> $GSFLAGS"> $HOST_ARCH"> $HOST_OS"> $IDLSUFFIXES"> $IMPLIBNOVERSIONSYMLINKS"> $IMPLIBPREFIX"> $IMPLIBSUFFIX"> $IMPLIBVERSION"> $IMPLICIT_COMMAND_DEPENDENCIES"> $INCPREFIX"> $INCSUFFIX"> $INSTALL"> $INSTALLSTR"> $INTEL_C_COMPILER_VERSION"> $JAR"> $JARCHDIR"> $JARCOM"> $JARCOMSTR"> $JARFLAGS"> $JARSUFFIX"> $JAVABOOTCLASSPATH"> $JAVAC"> $JAVACCOM"> $JAVACCOMSTR"> $JAVACFLAGS"> $JAVACLASSDIR"> $JAVACLASSPATH"> $JAVACLASSSUFFIX"> $JAVAH"> $JAVAHCOM"> $JAVAHCOMSTR"> $JAVAHFLAGS"> $JAVASOURCEPATH"> $JAVASUFFIX"> $JAVAVERSION"> $LATEX"> $LATEXCOM"> $LATEXCOMSTR"> $LATEXFLAGS"> $LATEXRETRIES"> $LATEXSUFFIXES"> $LDMODULE"> $LDMODULECOM"> $LDMODULECOMSTR"> $LDMODULEFLAGS"> $LDMODULENOVERSIONSYMLINKS"> $LDMODULEPREFIX"> $_LDMODULESONAME"> $LDMODULESUFFIX"> $LDMODULEVERSION"> $LDMODULEVERSIONFLAGS"> $_LDMODULEVERSIONFLAGS"> $LEX"> $LEXCOM"> $LEXCOMSTR"> $LEXFLAGS"> $_LIBDIRFLAGS"> $LIBDIRPREFIX"> $LIBDIRSUFFIX"> $LIBEMITTER"> $_LIBFLAGS"> $LIBLINKPREFIX"> $LIBLINKSUFFIX"> $LIBPATH"> $LIBPREFIX"> $LIBPREFIXES"> $LIBS"> $LIBSUFFIX"> $LIBSUFFIXES"> $LICENSE"> $LINESEPARATOR"> $LINGUAS_FILE"> $LINK"> $LINKCOM"> $LINKCOMSTR"> $LINKFLAGS"> $M4"> $M4COM"> $M4COMSTR"> $M4FLAGS"> $MAKEINDEX"> $MAKEINDEXCOM"> $MAKEINDEXCOMSTR"> $MAKEINDEXFLAGS"> $MAXLINELENGTH"> $MIDL"> $MIDLCOM"> $MIDLCOMSTR"> $MIDLFLAGS"> $MOSUFFIX"> $MSGFMT"> $MSGFMTCOM"> $MSGFMTCOMSTR"> $MSGFMTFLAGS"> $MSGINIT"> $MSGINITCOM"> $MSGINITCOMSTR"> $MSGINITFLAGS"> $_MSGINITLOCALE"> $MSGMERGE"> $MSGMERGECOM"> $MSGMERGECOMSTR"> $MSGMERGEFLAGS"> $MSSDK_DIR"> $MSSDK_VERSION"> $MSVC_BATCH"> $MSVC_USE_SCRIPT"> $MSVC_UWP_APP"> $MSVC_VERSION"> $MSVS"> $MSVS_ARCH"> $MSVS_PROJECT_GUID"> $MSVS_SCC_AUX_PATH"> $MSVS_SCC_CONNECTION_ROOT"> $MSVS_SCC_PROJECT_NAME"> $MSVS_SCC_PROVIDER"> $MSVS_VERSION"> $MSVSBUILDCOM"> $MSVSCLEANCOM"> $MSVSENCODING"> $MSVSPROJECTCOM"> $MSVSPROJECTSUFFIX"> $MSVSREBUILDCOM"> $MSVSSCONS"> $MSVSSCONSCOM"> $MSVSSCONSCRIPT"> $MSVSSCONSFLAGS"> $MSVSSOLUTIONCOM"> $MSVSSOLUTIONSUFFIX"> $MT"> $MTEXECOM"> $MTFLAGS"> $MTSHLIBCOM"> $MWCW_VERSION"> $MWCW_VERSIONS"> $NAME"> $no_import_lib"> $OBJPREFIX"> $OBJSUFFIX"> $PACKAGEROOT"> $PACKAGETYPE"> $PACKAGEVERSION"> $PCH"> $PCHCOM"> $PCHCOMSTR"> $PCHPDBFLAGS"> $PCHSTOP"> $PDB"> $PDFCOM"> $PDFLATEX"> $PDFLATEXCOM"> $PDFLATEXCOMSTR"> $PDFLATEXFLAGS"> $PDFPREFIX"> $PDFSUFFIX"> $PDFTEX"> $PDFTEXCOM"> $PDFTEXCOMSTR"> $PDFTEXFLAGS"> $PKGCHK"> $PKGINFO"> $PLATFORM"> $POAUTOINIT"> $POCREATE_ALIAS"> $POSUFFIX"> $POTDOMAIN"> $POTSUFFIX"> $POTUPDATE_ALIAS"> $POUPDATE_ALIAS"> $PRINT_CMD_LINE_FUNC"> $PROGEMITTER"> $PROGPREFIX"> $PROGSUFFIX"> $PSCOM"> $PSCOMSTR"> $PSPREFIX"> $PSSUFFIX"> $QT_AUTOSCAN"> $QT_BINPATH"> $QT_CPPPATH"> $QT_DEBUG"> $QT_LIB"> $QT_LIBPATH"> $QT_MOC"> $QT_MOCCXXPREFIX"> $QT_MOCCXXSUFFIX"> $QT_MOCFROMCXXCOM"> $QT_MOCFROMCXXCOMSTR"> $QT_MOCFROMCXXFLAGS"> $QT_MOCFROMHCOM"> $QT_MOCFROMHCOMSTR"> $QT_MOCFROMHFLAGS"> $QT_MOCHPREFIX"> $QT_MOCHSUFFIX"> $QT_UIC"> $QT_UICCOM"> $QT_UICCOMSTR"> $QT_UICDECLFLAGS"> $QT_UICDECLPREFIX"> $QT_UICDECLSUFFIX"> $QT_UICIMPLFLAGS"> $QT_UICIMPLPREFIX"> $QT_UICIMPLSUFFIX"> $QT_UISUFFIX"> $QTDIR"> $RANLIB"> $RANLIBCOM"> $RANLIBCOMSTR"> $RANLIBFLAGS"> $RC"> $RCCOM"> $RCCOMSTR"> $RCFLAGS"> $RCINCFLAGS"> $RCINCPREFIX"> $RCINCSUFFIX"> $RDirs"> $REGSVR"> $REGSVRCOM"> $REGSVRCOMSTR"> $REGSVRFLAGS"> $RMIC"> $RMICCOM"> $RMICCOMSTR"> $RMICFLAGS"> $_RPATH"> $RPATH"> $RPATHPREFIX"> $RPATHSUFFIX"> $RPCGEN"> $RPCGENCLIENTFLAGS"> $RPCGENFLAGS"> $RPCGENHEADERFLAGS"> $RPCGENSERVICEFLAGS"> $RPCGENXDRFLAGS"> $SCANNERS"> $SCONS_HOME"> $SHCC"> $SHCCCOM"> $SHCCCOMSTR"> $SHCCFLAGS"> $SHCFLAGS"> $SHCXX"> $SHCXXCOM"> $SHCXXCOMSTR"> $SHCXXFLAGS"> $SHDC"> $SHDCOM"> $SHDLIBVERSION"> $SHDLIBVERSIONFLAGS"> $SHDLINK"> $SHDLINKCOM"> $SHDLINKFLAGS"> $SHELL"> $SHF03"> $SHF03COM"> $SHF03COMSTR"> $SHF03FLAGS"> $SHF03PPCOM"> $SHF03PPCOMSTR"> $SHF08"> $SHF08COM"> $SHF08COMSTR"> $SHF08FLAGS"> $SHF08PPCOM"> $SHF08PPCOMSTR"> $SHF77"> $SHF77COM"> $SHF77COMSTR"> $SHF77FLAGS"> $SHF77PPCOM"> $SHF77PPCOMSTR"> $SHF90"> $SHF90COM"> $SHF90COMSTR"> $SHF90FLAGS"> $SHF90PPCOM"> $SHF90PPCOMSTR"> $SHF95"> $SHF95COM"> $SHF95COMSTR"> $SHF95FLAGS"> $SHF95PPCOM"> $SHF95PPCOMSTR"> $SHFORTRAN"> $SHFORTRANCOM"> $SHFORTRANCOMSTR"> $SHFORTRANFLAGS"> $SHFORTRANPPCOM"> $SHFORTRANPPCOMSTR"> $SHLIBEMITTER"> $SHLIBNOVERSIONSYMLINKS"> $SHLIBPREFIX"> $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> $SHLIBVERSIONFLAGS"> $_SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> $SHLINKFLAGS"> $SHOBJPREFIX"> $SHOBJSUFFIX"> $SONAME"> $SOURCE"> $SOURCE_URL"> $SOURCES"> $SPAWN"> $STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME"> $SUBST_DICT"> $SUBSTFILEPREFIX"> $SUBSTFILESUFFIX"> $SUMMARY"> $SWIG"> $SWIGCFILESUFFIX"> $SWIGCOM"> $SWIGCOMSTR"> $SWIGCXXFILESUFFIX"> $SWIGDIRECTORSUFFIX"> $SWIGFLAGS"> $_SWIGINCFLAGS"> $SWIGINCPREFIX"> $SWIGINCSUFFIX"> $SWIGOUTDIR"> $SWIGPATH"> $SWIGVERSION"> $TAR"> $TARCOM"> $TARCOMSTR"> $TARFLAGS"> $TARGET"> $TARGET_ARCH"> $TARGET_OS"> $TARGETS"> $TARSUFFIX"> $TEMPFILEPREFIX"> $TEX"> $TEXCOM"> $TEXCOMSTR"> $TEXFLAGS"> $TEXINPUTS"> $TEXTFILEPREFIX"> $TEXTFILESUFFIX"> $TOOLS"> $UNCHANGED_SOURCES"> $UNCHANGED_TARGETS"> $VENDOR"> $VERSION"> $WIN32_INSERT_DEF"> $WIN32DEFPREFIX"> $WIN32DEFSUFFIX"> $WIN32EXPPREFIX"> $WIN32EXPSUFFIX"> $WINDOWS_EMBED_MANIFEST"> $WINDOWS_INSERT_DEF"> $WINDOWS_INSERT_MANIFEST"> $WINDOWSDEFPREFIX"> $WINDOWSDEFSUFFIX"> $WINDOWSEXPPREFIX"> $WINDOWSEXPSUFFIX"> $WINDOWSPROGMANIFESTPREFIX"> $WINDOWSPROGMANIFESTSUFFIX"> $WINDOWSSHLIBMANIFESTPREFIX"> $WINDOWSSHLIBMANIFESTSUFFIX"> $X_IPK_DEPENDS"> $X_IPK_DESCRIPTION"> $X_IPK_MAINTAINER"> $X_IPK_PRIORITY"> $X_IPK_SECTION"> $X_MSI_LANGUAGE"> $X_MSI_LICENSE_TEXT"> $X_MSI_UPGRADE_CODE"> $X_RPM_AUTOREQPROV"> $X_RPM_BUILD"> $X_RPM_BUILDREQUIRES"> $X_RPM_BUILDROOT"> $X_RPM_CLEAN"> $X_RPM_CONFLICTS"> $X_RPM_DEFATTR"> $X_RPM_DISTRIBUTION"> $X_RPM_EPOCH"> $X_RPM_EXCLUDEARCH"> $X_RPM_EXLUSIVEARCH"> $X_RPM_GROUP"> $X_RPM_GROUP_lang"> $X_RPM_ICON"> $X_RPM_INSTALL"> $X_RPM_PACKAGER"> $X_RPM_POSTINSTALL"> $X_RPM_POSTUNINSTALL"> $X_RPM_PREFIX"> $X_RPM_PREINSTALL"> $X_RPM_PREP"> $X_RPM_PREUNINSTALL"> $X_RPM_PROVIDES"> $X_RPM_REQUIRES"> $X_RPM_SERIAL"> $X_RPM_URL"> $XGETTEXT"> $XGETTEXTCOM"> $XGETTEXTCOMSTR"> $_XGETTEXTDOMAIN"> $XGETTEXTFLAGS"> $XGETTEXTFROM"> $_XGETTEXTFROMFLAGS"> $XGETTEXTFROMPREFIX"> $XGETTEXTFROMSUFFIX"> $XGETTEXTPATH"> $_XGETTEXTPATHFLAGS"> $XGETTEXTPATHPREFIX"> $XGETTEXTPATHSUFFIX"> $YACC"> $YACCCOM"> $YACCCOMSTR"> $YACCFLAGS"> $YACCHFILESUFFIX"> $YACCHXXFILESUFFIX"> $YACCVCGFILESUFFIX"> $ZIP"> $ZIPCOM"> $ZIPCOMPRESSION"> $ZIPCOMSTR"> $ZIPFLAGS"> $ZIPROOT"> $ZIPSUFFIX"> scons-src-3.0.0/doc/xslt/0000775000175000017500000000000013160023040015210 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/xslt/xinclude_examples.xslt0000664000175000017500000000316213160023040021637 0ustar bdbaddogbdbaddog text scons-src-3.0.0/doc/xslt/to_docbook.xslt0000664000175000017500000000661213160023040020253 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/developer/0000775000175000017500000000000013160023037016211 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/developer/MANIFEST0000664000175000017500000000016413160023037017343 0ustar bdbaddogbdbaddogarchitecture.xml branches.xml copyright.xml cycle.xml main.xml packaging.xml preface.xml sourcetree.xml testing.xml scons-src-3.0.0/doc/developer/sourcetree.xml0000664000175000017500000000313013160023037021110 0ustar bdbaddogbdbaddog %scons; ]> Source Tree XXX
        Source Tree XXX
        scons-src-3.0.0/doc/developer/cycle.xml0000664000175000017500000000315213160023037020033 0ustar bdbaddogbdbaddog %scons; ]> Development Cycle XXX
        Development Cycle XXX
        scons-src-3.0.0/doc/developer/main.xml0000664000175000017500000000501413160023037017657 0ustar bdbaddogbdbaddog %version; %scons; ]> SCons Developer's Guide &buildversion; Steven Knight Revision &buildrevision; (&builddate;) 2007 2007 Steven Knight version &buildversion; scons-src-3.0.0/doc/developer/SConstruct0000664000175000017500000000325413160023037020247 0ustar bdbaddogbdbaddog# # SConstruct file for building SCons documentation. # # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import os env = Environment(ENV={'PATH' : os.environ['PATH']}, tools=['docbook'], toolpath=['../../src/engine/SCons/Tool']) has_pdf = False if (env.WhereIs('fop') or env.WhereIs('xep')): has_pdf = True # # Create document # env.DocbookXInclude('developer_xi.xml', 'main.xml') env.DocbookXslt('developer.xml', 'developer_xi.xml', xsl='../xslt/to_docbook.xslt') env.DocbookHtml('developer.html','developer.xml') if has_pdf: env.DocbookPdf('developer.pdf','developer.xml') scons-src-3.0.0/doc/developer/testing.xml0000664000175000017500000000311413160023037020407 0ustar bdbaddogbdbaddog %scons; ]> Testing XXX
        Testing XXX
        scons-src-3.0.0/doc/developer/packaging.xml0000664000175000017500000000312213160023037020655 0ustar bdbaddogbdbaddog %scons; ]> Packaging XXX
        Packaging XXX
        scons-src-3.0.0/doc/developer/architecture.xml0000664000175000017500000000313313160023037021415 0ustar bdbaddogbdbaddog %scons; ]> Architecture XXX
        Architecture XXX
        scons-src-3.0.0/doc/developer/copyright.xml0000664000175000017500000000304313160023037020743 0ustar bdbaddogbdbaddog %scons; ]>
        SCons Developer's Guide Copyright (c) 2007 Steven Knight
        scons-src-3.0.0/doc/developer/branches.xml0000664000175000017500000000312713160023037020523 0ustar bdbaddogbdbaddog %scons; ]> Branches XXX
        &SCons; Branches XXX
        scons-src-3.0.0/doc/developer/preface.xml0000664000175000017500000001234613160023037020346 0ustar bdbaddogbdbaddog %scons; ]> Preface This document assumes that you already know how &SCons; and that you want to learn how to work on the code.
        &SCons; Principles There are a few overriding principles we try to live up to in designing and implementing &SCons;: Correctness First and foremost, by default, &SCons; guarantees a correct build even if it means sacrificing performance a little. We strive to guarantee the build is correct regardless of how the software being built is structured, how it may have been written, or how unusual the tools are that build it. Performance Given that the build is correct, we try to make &SCons; build software as quickly as possible. In particular, wherever we may have needed to slow down the default &SCons; behavior to guarantee a correct build, we also try to make it easy to speed up &SCons; through optimization options that let you trade off guaranteed correctness in all end cases for a speedier build in the usual cases. Convenience &SCons; tries to do as much for you out of the box as reasonable, including detecting the right tools on your system and using them correctly to build the software. In a nutshell, we try hard to make &SCons; just "do the right thing" and build software correctly, with a minimum of hassles.
        Acknowledgements &SCons; would not exist without a lot of help from a lot of people, many of whom may not even be aware that they helped or served as inspiration. So in no particular order, and at the risk of leaving out someone: First and foremost, &SCons; owes a tremendous debt to Bob Sidebotham, the original author of the classic Perl-based &Cons; tool which Bob first released to the world back around 1996. Bob's work on Cons classic provided the underlying architecture and model of specifying a build configuration using a real scripting language. My real-world experience working on Cons informed many of the design decisions in SCons, including the improved parallel build support, making Builder objects easily definable by users, and separating the build engine from the wrapping interface. Greg Wilson was instrumental in getting &SCons; started as a real project when he initiated the Software Carpentry design competition in February 2000. Without that nudge, marrying the advantages of the Cons classic architecture with the readability of Python might have just stayed no more than a nice idea. Thanks to Peter Miller for his splendid change management system, &Aegis;, which has provided the &SCons; project with a robust development methodology from day one, and which showed me how you could integrate incremental regression tests into a practical development cycle (years before eXtreme Programming arrived on the scene). And last, thanks to Guido van Rossum for his elegant scripting language, which is the basis not only for the &SCons; implementation, but for the interface itself.
        scons-src-3.0.0/doc/version.xml0000664000175000017500000000023513160023040016425 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/0000775000175000017500000000000013160023037017222 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/editor_configs/xmlmind5/0000775000175000017500000000000013160023037020757 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/editor_configs/xmlmind5/addon/0000775000175000017500000000000013160023037022044 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/0000775000175000017500000000000013160023037023311 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/0000775000175000017500000000000013160023037024436 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/xslMenu.incl0000664000175000017500000005723013160023037026747 0ustar bdbaddogbdbaddog 1 0 %W%S 1 1 3 1 1 html.css 1 0 %0 3 %1 1 html.css 1 0 %W%S 1 1 1 3 1 1 htmlhelp.css 1 0 %W%S 1 2 1 javahelp.css 1 0 %W%S 1 1 3 3 1 1 eclipsehelp.css REDEFINE THIS: title of this help REDEFINE THIS: unique.id.of.this.plugin REDEFINE THIS: author, company or organization 1 0 %W%S 1 3 1 epub.css 1 0 A4 %2 3 %3 1 1 0 %0 %1 120 false 1 0 A4 %2 3 %3 1 1 0 %0 2 %0 false com.xmlmind.xmleditext.docbook.ConversionPreferences scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_xsd/0000775000175000017500000000000013160023037026441 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_xsd/dbpoolx.xsd0000664000175000017500000123042313160023037030635 0ustar bdbaddogbdbaddog TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_xsd/calstblx.xsd0000664000175000017500000003434313160023037031004 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_xsd/xml.xsd0000664000175000017500000000102413160023037027756 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_xsd/dbhierx.xsd0000664000175000017500000025203513160023037030615 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_xsd/dbnotnx.xsd0000664000175000017500000001060513160023037030637 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_xsd/htmltblx.xsd0000664000175000017500000004013413160023037031021 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_xsd/scons.xsd0000664000175000017500000001132613160023037030311 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/0000775000175000017500000000000013160023037025226 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/refentry.imp0000664000175000017500000002142213160023037027574 0ustar bdbaddogbdbaddog/* * Copyright (c) 2003 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * Styles for refentry elements. */ /* ===================================== Refentry structure ===================================== */ refentry { display: block; border-width: 1px; border-style: solid; border-color: silver transparent silver transparent; margin: 3ex 0; } refnamediv, refsynopsisdiv { display: block; margin: 1ex 0; } refnamediv:before, refsynopsisdiv:before { display: block; font-size: 1.3em; font-weight: bold; color: #004080; margin: 1ex 0; } refnamediv:before { content: "Name"; } refnamediv > *:before { content: " "; } refnamediv > *:first-child:before { content: ""; } refdescriptor, refname, refpurpose, refclass { display: inline; } refpurpose:before, refclass:before { content: " -- "; color: gray; } refsynopsisdiv:before { content: "Synopsis"; } refsynopsisdiv:contains-element(title):before, refsynopsisdiv:contains-element(info):before { content: ""; } refsynopsisdiv > title { font-size: 1.3em; margin-top: 0; margin-bottom: 1ex; } refsection, refsect1, refsect2, refsect3 { display: block; } refsection > title, refsect1 > title { font-size: 1.3em; margin: 1ex 0; } refsection refsection > title { font-size: 1em; margin: 1.33ex 0; } /* ===================================== Synopsis environments ===================================== */ /* ------------------------------------- cmdsynopsis ------------------------------------- */ cmdsynopsis { display: block; font-family: monospace; margin: 1.33ex 0; } synopfragment { display: block; font-family: monospace; margin-left: 4ex; } arg, group { display: inline; } arg:before, group:before { /* also works for choice=opt */ content: " ["; color: gray; } group > arg:before, group > group:before { content: " | ["; } arg:first-child:before, group:first-child:before { content: "["; } arg:after, group:after { content: "]"; color: gray; } arg[rep=repeat]:after, group[rep=repeat]:after { content: "]..."; color: gray; } arg[choice=req]:before, group[choice=req]:before { content: " {"; } group > arg[choice=req]:before, group > group[choice=req]:before { content: " | {"; } arg[choice=req]:first-child:before, group[choice=req]:first-child:before { content: "{"; } arg[choice=req]:after, group[choice=req]:after { content: "}"; } arg[choice=req][rep=repeat]:after, group[choice=req][rep=repeat]:after { content: "}..."; } arg[choice=plain]:before, group[choice=plain]:before { content: " "; } group > arg[choice=plain]:before, group > group[choice=plain]:before { content: " | "; } arg[choice=plain]:first-child:before, group[choice=plain]:first-child:before { content: ""; } arg[choice=plain]:after, group[choice=plain]:after { content: ""; } arg[choice=plain][rep=repeat]:after, group[choice=plain][rep=repeat]:after { content: "..."; } synopfragmentref { display: inline; color: navy; text-decoration: underline; } synopfragmentref:after { content: icon(left-link) attr(linkend); vertical-align: text-top; /* for the icon */ } /* ------------------------------------- funcsynopsis ------------------------------------- */ funcsynopsis { display: block; font-family: monospace; margin: 1.33ex 0; } funcsynopsisinfo { display: block; white-space: pre; margin: 1.33ex 0; } funcprototype { display: block; } funcprototype > *:before { content: " "; } funcprototype > *:first-child:before { content: ""; } funcprototype:after { content: ";"; color: gray; } funcdef { display: inline; } void { display: inline; content: "void"; color: gray; } funcprototype > void { content: "(void)"; } varargs { display: inline; content: "(...)"; color: gray; } paramdef + varargs { content: ", ...)"; } paramdef { display: inline; } paramdef > parameter { font-style: italic; } paramdef:before { content: ", "; color: gray; } paramdef:first-of-type:before { content: " ("; } paramdef:last-of-type:after { content: ")"; color: gray; } funcparams { display: inline; } paramdef > funcparams:before { content: "("; color: gray; } paramdef > funcparams:after { content: ")"; color: gray; } /* ------------------------------------- classsynopsis ------------------------------------- */ classsynopsis { display: block; font-family: monospace; margin-top: 1.33ex; } ooclass + classsynopsisinfo:before, oointerface + classsynopsisinfo:before, ooexception + classsynopsisinfo:before, ooclass + fieldsynopsis:before, oointerface + fieldsynopsis:before, ooexception + fieldsynopsis:before, ooclass + constructorsynopsis:before, oointerface + constructorsynopsis:before, ooexception + constructorsynopsis:before, ooclass + destructorsynopsis:before, oointerface + destructorsynopsis:before, ooexception + destructorsynopsis:before, ooclass + methodsynopsis:before, oointerface + methodsynopsis:before, ooexception + methodsynopsis:before { display: block; content: "{"; color: gray; } classsynopsis:after { display: block; content: "}"; color: gray; margin-bottom: 1.33ex; } classsynopsisinfo { display: block; white-space: pre; margin-left: 4ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } ooclass, oointerface, ooexception { display: inline; font-family: monospace; } classsynopsis > ooclass:after, classsynopsis > oointerface:after, classsynopsis > ooexception:after { content: " "; } ooclass > *:before, oointerface > *:before, ooexception > *:before { content: " "; } ooclass > classname:before { content: " class "; color: gray; } oointerface > interfacename:before { content: " interface "; color: gray; } ooexception > exceptionname:before { content: " exception "; color: gray; } ooclass > *:first-child:before, oointerface > *:first-child:before, ooexception > *:first-child:before { content: ""; } ooclass > classname:first-child:before { content: "class "; color: gray; } oointerface > interfacename:first-child:before { content: "interface "; color: gray; } ooexception > exceptionname:first-child:before { content: "exception "; color: gray; } fieldsynopsis, constructorsynopsis, destructorsynopsis, methodsynopsis { display: block; font-family: monospace; margin: 1.33ex 0; } classsynopsis > fieldsynopsis, classsynopsis > constructorsynopsis, classsynopsis > destructorsynopsis, classsynopsis > methodsynopsis { margin-left: 4ex; margin-top: 0; margin-bottom: 0; } fieldsynopsis:after, constructorsynopsis:after, destructorsynopsis:after, methodsynopsis:after { content: ";"; color: gray; } fieldsynopsis > *:before, constructorsynopsis > *:before, destructorsynopsis > *:before, methodsynopsis > *:before { content: " "; } fieldsynopsis > *:first-child:before, constructorsynopsis > *:first-child:before, destructorsynopsis > *:first-child:before, methodsynopsis > *:first-child:before { content: ""; } constructorsynopsis > exceptionname:before, destructorsynopsis > exceptionname:before, methodsynopsis > exceptionname:before { /*In practice, cannot be first child*/ content: " throws "; color: gray; } methodname + void { content: "(void)"; } methodparam { display: inline; /* rep and choice attributes not visualized */ } methodparam:before { content: ", "; color: gray; } methodparam:first-of-type:before { content: " ("; } methodparam:last-of-type:after{ content: ")"; color: gray; } methodparam > parameter { font-style: italic; } methodparam > *:before { content: " "; } methodparam > *:first-child:before { content: ""; } modifier { display: inline; font-family: monospace; } initializer { display: inline; font-family: monospace; } initializer:before { /* Cannot be first child */ content: " = "; color: gray; } /* --------------------------------------------------------------------------- Inlined elements other than those belonging to modules Note that default display is inline, so there is no need to specify it. --------------------------------------------------------------------------- */ /* ------------------------------------- General ------------------------------------- */ citerefentry { display: inline; font-style: italic; } citerefentry > manvolnum:before { content: "("; color: gray; } citerefentry > manvolnum:after { content: ")"; color: gray; } refentrytitle, manvolnum, refmiscinfo { /* also found in refmeta */ display: inline; } scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/print.imp0000664000175000017500000000052113160023037027067 0ustar bdbaddogbdbaddog/* * Copyright (c) 2003-2005 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * Customizes DocBook CSS style sheet for printing. */ @media print { * { background-color: transparent; line-height: 1.2; } } scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/docbook1.imp0000664000175000017500000004374513160023037027453 0ustar bdbaddogbdbaddog/* * Copyright (c) 2003-2010 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * Styles for elements other than those found in Simplified DocBook. */ /* ===================================== Book structure ===================================== */ set { display: block; } set > title { font-size: 2.5em; margin: 0.25ex 0; border-width: 4px; border-style: solid; border-color: transparent transparent #004080 transparent; } book { display: block; } book > title { font-size: 2.5em; margin: 0.25ex 0; border-width: 3px; border-style: solid; border-color: transparent transparent #004080 transparent; } dedication, colophon { display: block; /* content of dedication has a margin */ } part, reference { display: block; } part > title, reference > title { font-size: 2em; margin: 0.5ex 0; border-width: 2px; border-style: solid; border-color: transparent transparent #004080 transparent; } part > title:before { content: "Part " simple-counter(n-, upper-roman) ": "; } partintro { display: block; /* content of partintro has a margin */ } chapter, preface { display: block; } chapter > title, preface > title { font-size: 2em; margin: 0.5ex 0; border-width: 1px; border-style: solid; border-color: transparent transparent #004080 transparent; } chapter > title:before { content: "Chapter " simple-counter(n-, decimal) ": "; } /* ------------------------------------- TOC ------------------------------------- */ toc { display: block; /* content of toc has a margin */ } tocchap, tocpart { display: block; margin: 1.33ex 0; } tocfront, tocback, tocentry { display: block; /* no vertical margins to make it more compact */ } toclevel1, toclevel2, toclevel3, toclevel4, toclevel5 { display: block; /* no vertical margins to make it more compact */ } toclevel2, toclevel3, toclevel4, toclevel5 { margin-left: 4ex; } /* ------------------------------------- LOT ------------------------------------- */ lot { display: block; /* content of lot has a margin */ } lotentry { display: block; /* no vertical margins to make it more compact */ } /* ------------------------------------- Glossary ------------------------------------- */ glossary, glossdiv { display: block; /* content of glossary has a margin */ } glosslist { display: block; margin-left: 2ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } glossentry { display: block; /* no vertical margins to make it more compact */ } glossterm { display: inline; font-style: italic; } glossentry > acronym, glossentry > abbrev, glossentry > indexterm, glossentry > revhistory { display: block; margin-left: 4ex; margin-top: 0; margin-bottom: 1.33ex; } glossdef, glosssee { display: block; margin-left: 4ex; margin-bottom: 1.33ex; } glossdef > *:first-child { margin-top: 0; margin-bottom: 0; } glossseealso { display: block; margin: 1.33ex 0; } glosssee:before, glossseealso:before { display: inline; font-size: small; color: #004080; } glosssee:before { content: "See "; } glossseealso:before { content: "See also "; } /* ------------------------------------- Index ------------------------------------- */ index, setindex, indexdiv { display: block; /* content of index has a margin */ } indexentry { display: block; /* no vertical margins to make it more compact */ } primaryie, secondaryie, tertiaryie, seeie, seealsoie { display: block; /* no vertical margins to make it more compact */ } secondaryie { margin-left: 2ex; } tertiaryie { margin-left: 4ex; } seeie, seealsoie { margin-left: 6ex; } seeie:before, seealsoie:before { display: inline; font-size: small; color: #004080; } seeie:before { content: "See "; } seealsoie:before { content: "See also "; } /* ===================================== Paragraphs ===================================== */ ackno { display: block; margin: 1.33ex 0; } address { display: block; white-space: pre; margin: 1.33ex 0; } street, pob, postcode, city, state, country, phone, fax, otheraddr { display: inline; } formalpara { display: block; /* content of formalpara has a margin */ } /* ===================================== Lists ===================================== */ procedure { display: block; margin-left: 2ex; /* all lists are slightly indented */ margin-top: 1.33ex; margin-bottom: 1.33ex; } stepalternatives, substeps { display: block; } stepalternatives > *:first-child, substeps > *:first-child { margin-top: 0; margin-bottom: 0; } step { display: block; margin-left: 6ex; } step > *:first-child { margin-top: 0; margin-bottom: 0; } step:before { display: marker; content: simple-counter(n, decimal) "."; font-weight: bold; color: #004080; } step step:before { content: simple-counter(n, lower-alpha) "."; } step step step:before { content: simple-counter(n, decimal) "."; } step step step step:before { content: simple-counter(n, lower-alpha) "."; } step step step step step:before { content: simple-counter(n, decimal) "."; } segmentedlist { display: block; margin-left: 2ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } segmentedlist > title { margin-top: 0; } segtitle { display: inline; font-weight: bold; color: #004080; } seglistitem { display: block; margin: 1.33ex 0; } seg { display: inline; } segtitle:before, seg:before { content: " "; } segtitle:first-child:before, title + segtitle:before, seg:first-child:before { content: ""; } simplelist { /* also works for type=vert */ display: block; margin-left: 2ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } member { display: block; } simplelist[type=inline] > member, simplelist[type=horiz] > member { display: inline; } simplelist[type=inline] > member:before { content: ", "; color: gray; } simplelist[type=horiz] > member:before { content: " "; } simplelist[type=inline] > member:first-child:before, simplelist[type=horiz] > member:first-child:before { content: ""; } /* ===================================== Figures ===================================== */ graphic { display: block; margin: 1.33ex auto; } inlinegraphic { display: inline; } /* * Replaced content of graphic and inlinegraphic * is defined in image.imp. */ equation, informalequation { display: block; margin: 1.33ex auto; } equation > title { font-style: italic; font-weight: normal; text-align: center; margin: 0; /* content of equation generally already has a margin */ } mathphrase, alt { display: block; text-align: center; margin: 1.33ex 0; } mathphrase { font-style: italic; } alt { font-size: small; background-color: #EEEEFF; } inlineequation { display: inline; } inlineequation > mathphrase, inlineequation > alt, inlineequation > graphic { /* inlineequation > graphic is a DTD bug */ display: inline; } screenshot { display: block; /* content of screenshot has a margin */ } screeninfo { display: block; margin: 1.33ex 0; font-size: small; background-color: #EEEEFF; text-align: center; } /* ------------------------------------- Callouts ------------------------------------- */ mediaobjectco { display: block; /* content of mediaobjectco has a margin */ } graphicco, imageobjectco, programlistingco, screenco { display: block; /* content of graphicco has a margin */ } areaspec, areaset, area { display: tree; } co { display: inline; content: icon(left-half-disc) simple-counter(n) icon(right-half-disc); color: #004080; } coref { display: inline; content: icon(left-half-disc) attr(linkend) icon(right-half-disc); color: #004080; } calloutlist { display: block; margin-left: 2ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } callout { display: block; margin-left: 6ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } callout > *:first-child { margin-top: 0; margin-bottom: 0; } calloutlist > callout:before { display: marker; content: icon(left-half-disc) simple-counter(n) icon(right-half-disc); color: #004080; } /* ===================================== Divisions ===================================== */ highlights { display: block; margin-bottom: 1.33ex; background-color: #F8E0F8; border: thin solid #F880F8; padding: 2px; } highlights:before { display: block; content: element-label(); font-weight: bold; color: #E840E8; margin-top: 1.33ex; } /* ===================================== Special sections ===================================== */ /* ------------------------------------- Task ------------------------------------- */ task { display: block; /* content of task has a margin */ } tasksummary, taskprerequisites, taskrelated, task > procedure { display: block; margin-left: 2ex; /* content of taskxxx has a margin */ margin-top: 0; margin-bottom: 0; } /* ------------------------------------- Question-and-answer set ------------------------------------- */ qandaset, qandadiv { display: block; /* content of qandaset has a margin */ } qandaentry { display: block; margin: 1.33ex 0; } question, answer { display: block; margin-left: 4ex; /* content of question has a margin */ } question > *:first-child, answer > *:first-child { margin-top: 0; margin-bottom: 0; } question:before, answer:before { display: marker; color: #004080; font-weight: bold; } question:before { content: "Q:"; } answer:before { content: "A:"; } label { display: block; margin: 1.33ex 0; color: #004080; font-weight: bold; } /* ------------------------------------- Set of messages ------------------------------------- */ msgset { display: block; /* content of msgset has a margin */ } msgentry, simplemsgentry { display: block; margin: 1.33ex 0; border: thin solid gray; padding: 2px; } msg, msgmain, msgsub, msgrel, msgtext, msgexplan, msginfo { display: block; margin-left: 10ex; /* content of msg has a margin */ } msg > *:first-child, msgmain > *:first-child, msgsub > *:first-child, msgrel > *:first-child, msgtext > *:first-child, msgexplan > *:first-child, msginfo > *:first-child { margin-top: 0; margin-bottom: 0; } msg:before, msgmain:before, msgsub:before, msgrel:before, simplemsgentry > msgtext:before, msgexplan:before, msginfo:before { display: marker; content: element-label(); font-size: small; color: #004080; } msglevel, msgorig, msgaud { display: inline; } msglevel:before, msgorig:before, msgaud:before { content: icon(left-half-disc) element-local-name() " "; font-size: small; color: gray; } msglevel:after, msgorig:after, msgaud:after { content: icon(right-half-disc); color: gray; } /* ------------------------------------- Bibliography (complements docbook2.imp) ------------------------------------- */ bibliocoverage, bibliorelation, bibliosource { display: inline; } biblioid, isbn, issn, pubsnumber { display: inline; } citebiblioid { display: inline; } biblioref { content: attr(linkend) icon(right-link); vertical-align: text-top; /* for the icon */ color: navy; } /* ------------------------------------- Meta-information (complements docbook2.imp) ------------------------------------- */ artpagenums, pagenums, seriesvolnums, invpartnumber { display: inline; } itermset { /* Could be block but inline is safer when used in strange places and when used in meta-info, display is forced to be block. */ display: inline; } collab { display: block; /* can contain affiliation */ margin: 1.33ex 0; } collabname { display: inline; } confgroup { display: block; /* can contain address */ margin: 1.33ex 0; } confdates, conftitle, confnum, confsponsor { display: inline; } confdates:after, conftitle:after, confnum:after, confsponsor:after { content: " "; } contractnum, contractsponsor { display: inline; } publisher { display: block; /* can contain address */ margin: 1.33ex 0; } printhistory { display: block; /* content of printhistory has a margin */ } /* ===================================== Other elements ===================================== */ bridgehead { display: block; font-weight: bold; color: #004080; margin: 1.33ex 0; } bridgehead[renderas=sect1] { font-size: 1.5em; margin: .83ex 0; } bridgehead[renderas=sect2] { font-size: 1.3em; margin: 1ex 0; } /* --------------------------------------------------------------------------- Inlined elements other than those belonging to modules Note that default display is inline, so there is no need to specify it. --------------------------------------------------------------------------- */ /* ------------------------------------- Technical ------------------------------------- */ keycombo { display: inline; } keycombo > *:before { content: icon(plus); color: gray; } keycombo[action] > *:before { content: " "; } keycombo[action=simul] > *:before { content: icon(plus); } keycombo > *:first-child:before { content: ""; } keycap, keysym, mousebutton { font-weight: bold; } keycode { font-family: monospace; } menuchoice { display: inline; } menuchoice > *:before { content: icon(pop-right); color: gray; } menuchoice > *:first-child:before, menuchoice > shortcut + *:before { content: ""; } shortcut { display: inline; } /* shortcut:before should be enough but this selector makes this rule more specific than the above one */ menuchoice > shortcut:first-child:before { content: "("; color: gray; } shortcut:after { content: ") "; color: gray; } shortcut > *:before { content: " "; } shortcut > *:first-child:before { content: ""; } guimenu, guisubmenu, guimenuitem, guibutton, guilabel, guiicon, accel, interface { font-weight: bold; } accel { text-decoration: underline; } action { display: inline; } application, hardware, database, productnumber { display: inline; } medialabel { font-weight: bold; } package, uri, code, constant, envar, markup, prompt, property, sgmltag, token, type, function, parameter, varname, returnvalue, errorcode, errorname, errortext, errortype, exceptionname, classname, methodname, interfacename, structfield, structname, symbol { font-family: monospace; } optional { display: inline; } synopsis > optional:before { content: "["; color: gray; } synopsis > optional:after { content: "]"; color: gray; } sgmltag:before, sgmltag:after { color: gray; } sgmltag[class=attvalue]:before { content: '"'; } sgmltag[class=attvalue]:after { content: '"'; } sgmltag[class=starttag]:before, sgmltag[class=emptytag]:before { content: "<"; } sgmltag[class=endtag]:before { content: ""; } sgmltag[class=emptytag]:after { content: "/>"; } sgmltag[class=pi]:before, sgmltag[class=xmlpi]:before { content: ""; } sgmltag[class=sgmlcomment]:before { content: ""; } sgmltag[class=paramentity]:before { content: "%"; } sgmltag[class=genentity]:before { content: "&"; } sgmltag[class=numcharref]:before { content: "&#"; } sgmltag[class=paramentity]:after, sgmltag[class=genentity]:after, sgmltag[class=numcharref]:after { content: ";"; } /* ------------------------------------- General ------------------------------------- */ remark { font-style: italic; color: #880000; } firstterm, foreignphrase { font-style: italic; } citation:before { content: "["; color: gray; } citation:after { content: "]"; color: gray; } wordasword { font-family: sans-serif; font-size: medium; font-style: normal; font-weight: normal; color: black; } olink { color: navy; text-decoration: underline; } olink:after { vertical-align: text-top; /* for the icon */ } olink[targetdoc]:after { content: icon(left-link) attr(targetdoc); } olink[targetdoc][targetptr]:after { content: icon(left-link) attr(targetdoc) ":" attr(targetptr); } modespec { display: inline; } indexterm, primary, secondary, tertiary, see, seealso { display: inline; font-size: small; } indexterm:before { content: icon(left-half-disc); color: gray; } indexterm:after { content: icon(right-half-disc); color: gray; } indexterm[class=startofrange][id]:before { content: icon(left-half-disc) attr(id) icon(half-disc-separator); } indexterm[class=startofrange][xml|id]:before { content: icon(left-half-disc) attr(xml|id) icon(half-disc-separator); } indexterm[class=endofrange]:after { content: icon(half-disc-separator) attr(startref) icon(right-half-disc); } indexterm > *:before { content: "; "; color: gray; font-weight: bold; } indexterm > see:before { content: " see "; } indexterm > seealso:before { content: " see also "; } indexterm > *:first-child:before { content: ""; } termdef { display: inline; } termdef:before { content: icon(right) element-local-name() " "; color: gray; } termdef:after { content: icon(left); color: gray; } /* ------------------------------------- Other ------------------------------------- */ beginpage { display: inline; content: url(icons/beginpage.png); } sbr { display: inline; content: "\A"; color: gray; } scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/html_cals_table.imp0000664000175000017500000000462313160023037031057 0ustar bdbaddogbdbaddog/* * Copyright (c) 2005-2009 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * Styles for both HTML and CALS tables (DocBook 4.3+). */ @import "table.imp"; /* * "black" is the color used to draw a border around the table and its cells * based on values of attributes such as frame, rowsep and colsep. * * "rgb(238,238,224)" (a very light gray) is the color used to draw * a border around each cell whether the cell actually has borders or not. * Remove this parameter if this ``cell footprint'' disturbs you. * * For more information about table support for DocBook, see * XMLmind XML Editor - Configuration and Deployment. */ @extension "com.xmlmind.xmleditext.docbook.TableSupport black rgb(238,238,224)"; /* * Real DocBook tables (CALS) contain (graphic+|mediaobject+|tgroup+) * not (tbody+|tr+). */ table:contains-element(tr), table:contains-element(tbody), informaltable:contains-element(tr), informaltable:contains-element(tbody) { display: table; border-style: solid; border-width: 1; margin-top: 1.33ex; margin-bottom: 1.33ex; } table:contains-element(tr) > caption, table:contains-element(tbody) > caption, informaltable:contains-element(tr) > caption, informaltable:contains-element(tbody) > caption { display: table-caption; color: #004080; font-style: italic; font-weight: normal; text-align: center; margin: 2px 2ex 2px 2ex; } colgroup { display: table-column-group; collapsed: yes; } col { display: table-column; collapsed: yes; } /* * thead, tbody, tfoot, already properly styled in table.imp. */ table:contains-element(tbody) > thead, table:contains-element(tbody) > tfoot { /* * In CALS tables, header and footer rows are often presented * in an alternate typographic style, such as boldface. * There is no such processing expectation for HTML tables. * Explicitly use th instead of td when boldface is needed. */ font-weight: normal; } tr { display: table-row; background-color: inherit; /*e.g. from read-only tbody*/ } td, th { display: table-cell; background-color: inherit; /*e.g. from read-only row*/ border-style: solid; border-width: 1; padding: 2; } th { font-weight: bold; } @media print { colgroup, col { display: none; } } scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/table.imp0000664000175000017500000000304313160023037027024 0ustar bdbaddogbdbaddog/* * Copyright (c) 2005-2009 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * Partial styles for DocBook tables. Requires an @extension. * DO NOT IMPORT THIS FILE: INSTEAD @import cals_table.imp OR * @import html_cals_table.imp. */ table, informaltable { display: block; margin: 1.33ex 0; } table > title { display: block; font-style: italic; font-weight: normal; text-align: center; /* keep margin because tgroup has no margin */ } colspec, spanspec { display: table-column; collapsed: yes; } tgroup { display: table; border-style: solid; border-width: 1; } thead, tfoot { display: table-row-group; font-weight: bold; } thead { background-color: #F0F0F0; } tfoot { background-color: #E0E0E0; } tbody { display: table-row-group; background-color: inherit; /*e.g. from read-only tgroup*/ } row { display: table-row; background-color: inherit; /*e.g. from read-only tbody*/ } entry { display: table-cell; background-color: inherit; /*e.g. from read-only row*/ border-style: solid; border-width: 1; padding: 2; } entry > *:first-child { margin-top: 0; margin-bottom: 0; } entrytbl { display: subtable; background-color: inherit; /*e.g. from read-only row*/ border-style: solid; border-width: 1; } @media print { colspec, spanspec { display: none; } } scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/docbook2.imp0000664000175000017500000005571313160023037027452 0ustar bdbaddogbdbaddog/* * Copyright (c) 2003-2010 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * Styles for elements found in Simplified DocBook * (and closely related elements even if not found in Simplified DocBook). */ /* ===================================== Article structure ===================================== */ sconsdoc, article { display: block; } article > title { font-size: 2em; margin: 0.5ex 0; border-width: 1px; border-style: solid; border-color: transparent transparent #004080 transparent; } title, subtitle, titleabbrev { display: block; color: #004080; margin: 1.33ex 0; } title, subtitle { font-weight: bold; } /* ------------------------------------- Sections ------------------------------------- */ section, sect1, sect2, sect3, sect4, sect5, simplesect { display: block; } tool, builder, scons_function, cvar { display: block; } sconsdoc > tool:before { color: #004080; font-size: 1.5em; margin: .83ex 0; display: block; content: "Tool '" attr(name) "'"; } sconsdoc > builder:before { color: #004080; font-size: 1.5em; margin: .83ex 0; display: block; content: "Builder '" attr(name) "'"; } sconsdoc > scons_function:before { color: #004080; font-size: 1.5em; margin: .83ex 0; display: block; content: "Function '" attr(name) "'"; } sconsdoc > cvar:before { color: #004080; font-size: 1.5em; margin: .83ex 0; display: block; content: "CVar '" attr(name) "'"; } cvar > summary:before, scons_function > summary:before, builder > summary:before, tool > summary:before { font-size: 1.3em; font-weight: bold; margin: .83ex 0; display: block; content: "Summary: "; } scons_function > arguments:before { font-size: 1.2em; margin: .83ex 0; display: block; content: "Arguments"; } section > title, sect1 > title { font-size: 1.5em; margin: .83ex 0; } section > title:before, sect1 > title:before { content: simple-counter(n-) " "; } section section > title, sect2 > title { font-size: 1.3em; margin: 1ex 0; } section * section > title { font-size: 1em; margin: 1.33ex 0; } section section > title:before, sect2 > title:before { content: simple-counter(nn-) " "; } section section section > title:before, sect3 > title:before { content: simple-counter(nnn-) " "; } section section section section > title:before, sect4 > title:before { content: simple-counter(nnnn-) " "; } section section section * section > title:before { content: ""; } /* ------------------------------------- Appendix ------------------------------------- */ appendix { display: block; } appendix > title { /* in a book or in a part */ font-size: 2em; margin: 0.5ex 0; border-width: 1px; border-style: solid; border-color: transparent transparent #004080 transparent; } article > appendix > title { font-size: 1.5em; margin: 0.83ex 0; border-width: 0; border-style: none; } appendix > title:before { content: "Appendix " simple-counter(n-, upper-alpha) ": "; } /* ===================================== Paragraphs ===================================== */ para, simpara { display: block; margin: 1.33ex 0; } /* ===================================== Lists ===================================== */ /* ------------------------------------- itemizedlist ------------------------------------- */ uses, sets, itemizedlist { display: block; margin-left: 2ex; /* all lists are slightly indented */ margin-top: 1.33ex; margin-bottom: 1.33ex; } listitem { display: block; margin-top: 1.33ex; margin-bottom: 1.33ex; } uses[spacing=compact] > listitem, sets[spacing=compact] > listitem, itemizedlist[spacing=compact] > listitem, orderedlist[spacing=compact] > listitem { margin-top: 0; margin-bottom: 0; } listitem > *:first-child { margin-top: 0; margin-bottom: 0; } uses > listitem, sets > listitem, itemizedlist > listitem { margin-left: 2.5ex; } uses > listitem:before, sets > listitem:before, itemizedlist > listitem:before { display: marker; content: disc; color: #004080; } itemizedlist > listitem itemizedlist > listitem:before { content: square; } itemizedlist > listitem itemizedlist > listitem itemizedlist > listitem:before { content: icon(diamond); } itemizedlist > listitem itemizedlist > listitem itemizedlist > listitem itemizedlist > listitem:before { content: circle; } /* ------------------------------------- orderedlist ------------------------------------- */ orderedlist { display: block; margin-left: 2ex; margin-top: 1.33ex; margin-bottom: 1.33ex; counter-reset: item; } orderedlist[continuation=continues] { counter-reset: none; } orderedlist > listitem { margin-left: 6ex; counter-increment: item; } orderedlist > listitem:before { display: marker; content: counter(item, decimal) "."; font-weight: bold; color: #004080; } orderedlist[numeration=loweralpha] > listitem:before { content: counter(item, lower-alpha) "."; } orderedlist[numeration=upperalpha] > listitem:before { content: counter(item, upper-alpha) "."; } orderedlist[numeration=lowerroman] > listitem:before { content: counter(item, lower-roman) "."; } orderedlist[numeration=upperroman] > listitem:before { content: counter(item, upper-roman) "."; } orderedlist[inheritnum=inherit] > listitem:before, orderedlist[inheritnum=inherit][numeration=arabic] > listitem:before { content: counters(item, ".", decimal) "."; } orderedlist[inheritnum=inherit][numeration=loweralpha] > listitem:before { content: counters(item, ".", lower-alpha) "."; } orderedlist[inheritnum=inherit][numeration=upperalpha] > listitem:before { content: counters(item, ".", upper-alpha) "."; } orderedlist[inheritnum=inherit][numeration=lowerroman] > listitem:before { content: counters(item, ".", lower-roman) "."; } orderedlist[inheritnum=inherit][numeration=upperroman] > listitem:before { content: counters(item, ".", upper-roman) "."; } /* ------------------------------------- variablelist ------------------------------------- */ variablelist { display: block; margin-left: 2ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } varlistentry { display: block; margin-top: 1.33ex; margin-bottom: 1.33ex; } variablelist[spacing=compact] > varlistentry { margin-top: 0; margin-bottom: 0; } term { display: block; font-weight: bold; } varlistentry > listitem { margin-left: 4ex; margin-top: 0; margin-bottom: 0; } /* ===================================== Figures ===================================== */ programlisting, screen, scons_example, scons_example_file, example_commands, sconstruct, scons_output, scons_output_command, file, directory, literallayout, synopsis { display: block; white-space: pre; font-family: monospace; margin: 1.33ex 0; } example_commands, programlisting { background-color: #EEEEEE; border: thin solid gray; padding: 2px; } scons_example, sconstruct, scons_output { background-color: #94CAEE; border: thin solid gray; padding: 2px; } file, directory, scons_example_file { background-color: #EED27B; } screen { background-color: #EEEEFF; border: thin solid #8888FF; padding: 2px; } figure, informalfigure, example, informalexample { display: block; margin: 1.33ex auto; } figure > title, example > title { font-style: italic; font-weight: normal; text-align: center; margin: 0; /* content of figure generally already has a margin */ } mediaobject { display: table; border-spacing: 2px; margin: 1.33ex auto; } inlinemediaobject { display: inline-table; border-spacing: 2px; } caption { display: table-caption; color: #004080; font-style: italic; font-weight: normal; text-align: center; /* content of caption already has a margin */ } audioobject, videoobject, imageobject, textobject { display: table-cell; /* this will create one row per cell */ text-align: center; } objectinfo { text-align: left; } mediaobject > objectinfo { display: table-cell; } audiodata { display: inline; content: url(icons/audio.png); } videodata { display: inline; content: url(icons/video.png); } /* * imagedata is defined in image.imp. */ textdata { display: inline; content: url(icons/text.png); } /* ===================================== Divisions ===================================== */ abstract { display: block; margin-left: 18ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } abstract > *:first-child { margin-top: 0; margin-bottom: 0; } abstract:before { display: marker; content: element-label(); font-weight: bold; color: #004080; } blockquote, epigraph { display: block; margin: 1.33ex 10ex; } blockquote > title { font-style: italic; font-weight: normal; text-align: center; margin: 0; /* content of blockquote already has a margin */ } attribution { display: block; text-align: right; } attribution:before { content: " -- "; } footnote { display: block; margin-left: 18ex; margin-top: 1.33ex; margin-bottom: 1.33ex; margin-right: 10ex; font-size: small; padding: 2px; background-color: #F0F0FF; } footnote > *:first-child { margin-top: 0; margin-bottom: 0; } footnote:before { display: marker; content: element-label(); color: #004080; } footnote[label]:before { content: "[" attr(label) "]"; } note, caution, important, tip, warning { display: block; margin-left: 18ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } note > *:first-child, caution > *:first-child, important > *:first-child, tip > *:first-child, warning > *:first-child { margin-top: 0; margin-bottom: 0; } note:before, caution:before, important:before, tip:before, warning:before { display: marker; content: element-label(); font-weight: bold; color: #004080; } sidebar { display: block; margin: 1.33ex 0; border: thin solid #80F880; background-color: #E0F8E0; padding: 2px; } sidebar > title { margin: 0; /* content of sidebar already has a margin */ } /* ===================================== Special sections ===================================== */ /* ------------------------------------- Bibliography (complemented in docbook1.imp) ------------------------------------- */ bibliography, bibliodiv, bibliolist { display: block; /* content of bibliography has a margin */ } bibliomixed, bibliomset, biblioentry, biblioset { display: block; margin: 1.33ex 0; } bibliomixed, biblioentry { border: thin solid gray; padding: 2px; } bibliomixed > title, bibliomixed > subtitle, bibliomixed > titleabbrev, bibliomset > title, bibliomset > subtitle, bibliomset > titleabbrev, biblioentry > title, biblioentry > subtitle, biblioentry > titleabbrev, biblioset > title, biblioset > subtitle, biblioset > titleabbrev { /* title of a bibliography entry, not ``caption'' of a formal block */ font-weight: normal; font-size: 1em; color: black; } bibliomixed > title, bibliomixed > subtitle, bibliomixed > titleabbrev, bibliomset > title, bibliomset > subtitle, bibliomset > titleabbrev { display: inline; } bibliomixed > title, bibliomixed > subtitle, bibliomset > title, bibliomset > subtitle { font-style: italic; } bibliomisc { display: inline; } /* ------------------------------------- Meta-information (complemented in docbook1.imp) ------------------------------------- */ appendixinfo, articleinfo, bibliographyinfo, blockinfo, bookinfo, chapterinfo, glossaryinfo, indexinfo, objectinfo, partinfo, prefaceinfo, refentryinfo, refmeta, referenceinfo, refsect1info, refsect2info, refsect3info, refsectioninfo, refsynopsisdivinfo, sect1info, sect2info, sect3info, sect4info, sect5info, sectioninfo, setindexinfo, setinfo, sidebarinfo { display: block; margin: 1.33ex 0; border: thin solid #C0F8F8; background-color: #E0F8F8; padding: 2px; } authorgroup { display: block; /* content of authorgroup has a margin */ } author, editor, othercredit { display: block; /* can contain authorblurb, address */ margin: 1.33ex 0; } personname { display: inline; } honorific, firstname, surname, lineage, othername { display: inline; } honorific:after, firstname:after, surname:after, lineage:after, othername:after { content: " "; } contrib { display: inline; } authorblurb, personblurb { display: block; /* content of authorblurb has a margin */ } corpauthor, corpname { /* Could be block but inline is safer when used in strange places and when used in meta-info, display is forced to be block. */ display: inline; } affiliation { display: block; /* can contain address */ margin: 1.33ex 0; } shortaffil, jobtitle, orgname, orgdiv { display: inline; } shortaffil:after, affiliation > jobtitle:after, affiliation > orgname:after, orgdiv:after { content: " "; } copyright { display: inline; } year, holder { display: inline; } year:after, holder:after { content: " "; } date, pubdate { display: inline; } edition { display: inline; } issuenum { display: inline; } keywordset, subjectset { display: inline; } keyword, subject, subjectterm { display: inline; } keyword:after, subjectterm:after { content: " "; } legalnotice { display: block; /* content of legalnotice has a margin */ } publishername { display: inline; } releaseinfo { display: inline; } revhistory { display: block; margin: 1.33ex 0; } revision { display: block; margin-left: 2.5ex; } revision:before { display: marker; content: icon(right); color: #004080; } revision > author, authorinitials { display: inline; font-weight: bold; } revnumber, revremark { display: inline; } revnumber:after, revision > date:after, revision > author:after, revision > authorinitials:after { content: " "; } revdescription { display: block; /* content of revdescription has a margin */ } volumenum { display: inline; } /* --------------------------------------------------------------------------- Inlined elements other than those belonging to modules Note that default display is inline, so there is no need to specify it. --------------------------------------------------------------------------- */ emphasis { font-style: italic; } emphasis[role=bold] { font-style: normal; font-weight: bold; } emphasis[role=underline] { font-style: normal; text-decoration: underline; } emphasis[role=strikethrough] { font-style: normal; text-decoration: line-through; } emphasis > emphasis { font-style: normal; font-weight: normal; text-decoration: none; } directory, literal { font-family: monospace; } link, ulink, email { color: navy; text-decoration: underline; } /* ------------------------------------- Technical ------------------------------------- */ command, computeroutput, filename, option, systemitem, userinput { font-family: monospace; } computeroutput, userinput { background-color: #EEEEEE; } command, option { font-weight: bold; } lineannotation { font-style: italic; font-size: medium; /* occurs in verbatim, fixed font, blocks */ } replaceable { font-style: italic; } /* ------------------------------------- General ------------------------------------- */ anchor { content: icon(right-target); color: gray; } subscript, superscript { display: inline-block; white-space: nowrap; font-size: small; } subscript { vertical-align: sub; } superscript { vertical-align: super; } abbrev, acronym { font-weight: bold; } citetitle { font-style: italic; } footnoteref { content: "[" attr(linkend) "]"; font-size: small; vertical-align: super; color: navy; } footnoteref[label] { content: "[" attr(label) "]"; } phrase[revisionflag=deleted] { text-decoration: line-through; } phrase[revisionflag=added] { text-decoration: underline; } quote:before { content: open-quote; font-weight: bold; color: gray; } quote:after { content: close-quote; font-weight: bold; color: gray; } trademark, productname { color: #004080; } trademark:after, productname:after { font-size: small; color: gray; } trademark:after, /* also works for class=trade */ productname[class=trade]:after { content: "[tm]"; } trademark[class=copyright]:after, productname[class=copyright]:after { content: "\A9"; font-size: medium; } trademark[class=registered]:after, productname[class=registered]:after { content: "\AE"; font-size: medium; } trademark[class=service]:after, productname[class=service]:after { content: "[sm]"; } xref { content: icon(left-link) xpath("if(id(@linkend)/@xreflabel, id(@linkend)/@xreflabel, @linkend)"); vertical-align: text-top; /* for the icon */ color: navy; } xref[endterm] { content: icon(left-link) xpath("if(id(@endterm), id(@endterm), @endterm)"); } /* --------------------------------------------------------------------------- Overrides natural display of elements in special sections (must be at the very end of the style sheet) --------------------------------------------------------------------------- */ /* ------------------------------------- Bibliography ------------------------------------- */ biblioentry > *, biblioset > * { display: block; text-align: left; /* Reset paragraph styles */ font: normal normal 1em sans-serif; color: black; margin-left: 18ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } biblioentry > *:first-child, biblioset > *:first-child { /* nicer */ margin-top: 0; margin-bottom: 0; } biblioentry > *:before, biblioset > *:before { display: marker; content: element-label(); font: normal normal small sans-serif; color: #004080; } biblioentry > *:after, biblioset > *:after { content: ""; } biblioentry > biblioset, biblioset > biblioset { margin-left: 0; } biblioentry > biblioset:before, biblioset > biblioset:before { content: ""; } /* ------------------------------------- Meta-information ------------------------------------- */ appendixinfo > *, articleinfo > *, bibliographyinfo > *, blockinfo > *, bookinfo > *, chapterinfo > *, glossaryinfo > *, indexinfo > *, objectinfo > *, partinfo > *, prefaceinfo > *, refentryinfo > *, refmeta > *, referenceinfo > *, refsect1info > *, refsect2info > *, refsect3info > *, refsectioninfo > *, refsynopsisdivinfo > *, sect1info > *, sect2info > *, sect3info > *, sect4info > *, sect5info > *, sectioninfo > *, setindexinfo > *, setinfo > *, sidebarinfo > * { display: block; text-align: left; /* Reset paragraph styles */ font: normal normal 1em sans-serif; color: black; margin-left: 18ex; margin-right: 0; margin-top: 1.33ex; margin-bottom: 1.33ex; } appendixinfo > *:first-child, articleinfo > *:first-child, bibliographyinfo > *:first-child, blockinfo > *:first-child, bookinfo > *:first-child, chapterinfo > *:first-child, glossaryinfo > *:first-child, indexinfo > *:first-child, objectinfo > *:first-child, partinfo > *:first-child, prefaceinfo > *:first-child, refentryinfo > *:first-child, refmeta > *:first-child, referenceinfo > *:first-child, refsect1info > *:first-child, refsect2info > *:first-child, refsect3info > *:first-child, refsectioninfo > *:first-child, refsynopsisdivinfo > *:first-child, sect1info > *:first-child, sect2info > *:first-child, sect3info > *:first-child, sect4info > *:first-child, sect5info > *:first-child, sectioninfo > *:first-child, setindexinfo > *:first-child, setinfo > *:first-child, sidebarinfo > *:first-child { /* nicer */ margin-top: 0; margin-bottom: 0; } appendixinfo > *:before, articleinfo > *:before, bibliographyinfo > *:before, blockinfo > *:before, bookinfo > *:before, chapterinfo > *:before, glossaryinfo > *:before, indexinfo > *:before, objectinfo > *:before, partinfo > *:before, prefaceinfo > *:before, refentryinfo > *:before, refmeta > *:before, referenceinfo > *:before, refsect1info > *:before, refsect2info > *:before, refsect3info > *:before, refsectioninfo > *:before, refsynopsisdivinfo > *:before, sect1info > *:before, sect2info > *:before, sect3info > *:before, sect4info > *:before, sect5info > *:before, sectioninfo > *:before, setindexinfo > *:before, setinfo > *:before, sidebarinfo > *:before { display: marker; content: element-label(); font: normal normal small sans-serif; color: #004080; } appendixinfo > *:after, articleinfo > *:after, bibliographyinfo > *:after, blockinfo > *:after, bookinfo > *:after, chapterinfo > *:after, glossaryinfo > *:after, indexinfo > *:after, objectinfo > *:after, partinfo > *:after, prefaceinfo > *:after, refentryinfo > *:after, refmeta > *:after, referenceinfo > *:after, refsect1info > *:after, refsect2info > *:after, refsect3info > *:after, refsectioninfo > *:after, refsynopsisdivinfo > *:after, sect1info > *:after, sect2info > *:after, sect3info > *:after, sect4info > *:after, sect5info > *:after, sectioninfo > *:after, setindexinfo > *:after, setinfo > *:after, sidebarinfo > *:after { content: ""; } appendixinfo > title, articleinfo > title, bibliographyinfo > title, blockinfo > title, bookinfo > title, chapterinfo > title, glossaryinfo > title, indexinfo > title, objectinfo > title, partinfo > title, prefaceinfo > title, refentryinfo > title, /* refmeta has no title */ referenceinfo > title, refsect1info > title, refsect2info > title, refsect3info > title, refsectioninfo > title, refsynopsisdivinfo > title, sect1info > title, sect2info > title, sect3info > title, sect4info > title, sect5info > title, sectioninfo > title, setindexinfo > title, setinfo > title, sidebarinfo > title { font-size: 1.3em; font-weight: bold; color: #004080; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 1ex; } appendixinfo > title:before, articleinfo > title:before, bibliographyinfo > title:before, blockinfo > title:before, bookinfo > title:before, chapterinfo > title:before, glossaryinfo > title:before, indexinfo > title:before, objectinfo > title:before, partinfo > title:before, prefaceinfo > title:before, refentryinfo > title:before, referenceinfo > title:before, refsect1info > title:before, refsect2info > title:before, refsect3info > title:before, refsectioninfo > title:before, refsynopsisdivinfo > title:before, sect1info > title:before, sect2info > title:before, sect3info > title:before, sect4info > title:before, sect5info > title:before, sectioninfo > title:before, setindexinfo > title:before, setinfo > title:before, sidebarinfo > title:before { content: ""; } scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/image.imp0000664000175000017500000000075313160023037027024 0ustar bdbaddogbdbaddog/* * Copyright (c) 2004-2009 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * Display of images. */ mediaobject imagedata { display: block; /* without this, a viewport specified as % will not work */ margin: 0 auto; } inlinemediaobject imagedata { display: inline; } graphic, inlinegraphic, imagedata { content: gadget("com.xmlmind.xmleditext.docbook.Graphic"); } scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/collapsible.imp0000664000175000017500000000575513160023037030242 0ustar bdbaddogbdbaddog/* * Copyright (c) 2003-2007 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * Styles for making sections and blocks with titles collapsible. */ set, book, part, reference, chapter, preface, article, sect1, sect2, sect3, sect4, section, appendix, figure, example, table { collapsible: yes; not-collapsible-head: 1; /* title or metainfo */ } figure { collapsed-content: url(icons/figure.png); collapsed-content-align: center; } example { collapsed-content: url(icons/para.png); collapsed-content-align: center; } table { collapsed-content: url(icons/table.png); collapsed-content-align: center; } set > title:first-child:before, book > title:first-child:before, reference > title:first-child:before, preface > title:first-child:before, article > title:first-child:before, figure > title:before, example > title:before, table > title:before { content: collapser() " "; } part > title:first-child:before { content: collapser() " Part " simple-counter(n-, upper-roman) ": "; } chapter > title:first-child:before { content: collapser() " Chapter " simple-counter(n-, decimal) ": "; } sect1 > title:first-child:before { content: collapser() " " simple-counter(n-) " "; } sect2 > title:first-child:before { content: collapser() " " simple-counter(nn-) " "; } sect3 > title:first-child:before { content: collapser() " " simple-counter(nnn-) " "; } sect4 > title:first-child:before { content: collapser() " " simple-counter(nnnn-) " "; } section > title:first-child:before { content: collapser() " " simple-counter(n-) " "; } section section > title:first-child:before { content: collapser() " " simple-counter(nn-) " "; } section section section > title:first-child:before { content: collapser() " " simple-counter(nnn-) " "; } section section section section > title:first-child:before { content: collapser() " " simple-counter(nnnn-) " "; } section section section * section > title:first-child:before { content: ""; } appendix > title:first-child:before { content: collapser() " Appendix " simple-counter(n-, upper-alpha) ": "; } appendixinfo:first-child, articleinfo:first-child, bookinfo:first-child, chapterinfo:first-child, partinfo:first-child, prefaceinfo:first-child, referenceinfo:first-child, sect1info:first-child, sect2info:first-child, sect3info:first-child, sect4info:first-child, sectioninfo:first-child, setinfo:first-child { margin-left: 20px; } appendixinfo:first-child:before, articleinfo:first-child:before, bookinfo:first-child:before, chapterinfo:first-child:before, partinfo:first-child:before, prefaceinfo:first-child:before, referenceinfo:first-child:before, sect1info:first-child:before, sect2info:first-child:before, sect3info:first-child:before, sect4info:first-child:before, sectioninfo:first-child:before, setinfo:first-child:before { content: collapser(); display: marker; } scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/cals_table.imp0000664000175000017500000000147313160023037030033 0ustar bdbaddogbdbaddog/* * Copyright (c) 2005-2009 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * Styles for CALS tables (up to DocBook 4.2). */ @import "table.imp"; /* * "black" is the color used to draw a border around the table and its cells * based on values of attributes such as frame, rowsep and colsep. * * "rgb(238,238,224)" (a very light gray) is the color used to draw * a border around each cell whether the cell actually has borders or not. * Remove this parameter if this ``cell footprint'' disturbs you. * * For more information about table support for DocBook, see * XMLmind XML Editor - Configuration and Deployment. */ @extension "com.xmlmind.xmleditext.docbook.table.TableSupport black rgb(238,238,224)"; scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/example1.css0000664000175000017500000000053613160023037027460 0ustar bdbaddogbdbaddog/* * Copyright (c) 2003-2008 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * A CSS style sheet for DocBook V4.5. */ doc, para { display: block; } para { margin: 1ex 0; } para[align] { text-align: concatenate(attr(align)); } scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/visible_inclusions.css0000664000175000017500000000040113160023037031636 0ustar bdbaddogbdbaddog/* * Copyright (c) 2003-2004 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. */ @import "docbook.css"; @import "../../common/css/visible_inclusions.imp";scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/scons.css0000664000175000017500000000061713160023037027071 0ustar bdbaddogbdbaddog/* * Copyright (c) 2003-2008 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * A CSS style sheet for DocBook V4.5. */ @import "docbook1.imp"; @import "refentry.imp"; @import "docbook2.imp"; @import "html_cals_table.imp"; @import "image.imp"; @import "collapsible.imp"; @import "print.imp"; scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/css/structure.css0000664000175000017500000000430613160023037030003 0ustar bdbaddogbdbaddog/* * Copyright (c) 2005-2008 Pixware. * * This file is part of the XMLmind XML Editor project. * For conditions of distribution and use, see the accompanying legal.txt file. * * Displays the structure (a little more than a TOC) of a DocBook document. * Titles inside *info (e.g. sectioninfo) elements are not displayed. */ *, *:comment, *:processing-instruction { display: none; } title { display: block; } title > * { display: inline; } set, book, part, reference, refentry, preface, chapter, article, appendix, section, sect1, sect2, sect3, sect4, sect5 { display: block; margin-left: 9ex; } set:before, book:before, part:before, reference:before, refentry:before, preface:before, chapter:before, article:before, appendix:before, section:before, sect1:before, sect2:before, sect3:before, sect4:before, sect5:before { display: marker; marker-offset: fill; content: element-name(); font-size: small; color: gray; } part > title:before { content: simple-counter(n-, upper-roman) " "; } chapter > title:before { content: simple-counter(n-, decimal) " "; } appendix > title:before { content: simple-counter(n-, upper-alpha) " "; } refentry { content: xpath("join(.//refname, ', ')"); color: gray; } section > title:before, sect1 > title:before { content: simple-counter(n-) " "; } section section > title:before, sect2 > title:before { content: simple-counter(nn-) " "; } section section section > title:before, sect3 > title:before { content: simple-counter(nnn-) " "; } section section section section > title:before, sect4 > title:before { content: simple-counter(nnnn-) " "; } section section section section section > title:before, sect5 > title:before { content: simple-counter(nnnnn-) " "; } section section section section * section > title:before { content: ""; } setinfo, setindex, bookinfo, dedication, toc, lot, glossary, bibliography, index, colophon, partinfo, partintro, referenceinfo, prefaceinfo, chapterinfo, tocchap, articleinfo, appendixinfo, sectioninfo, sect1info, sect2info, sect3info, sect4info, sect5info { display: block; content: element-name(); font-size: small; color: gray; } scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_catalog.xml0000664000175000017500000000043313160023037027777 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/toolBar.incl0000664000175000017500000001730213160023037026712 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/htmlTable.incl0000664000175000017500000001044613160023037027226 0ustar bdbaddogbdbaddog
        scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_templates/0000775000175000017500000000000013160023037027641 5ustar bdbaddogbdbaddogscons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_templates/glossary.xml0000664000175000017500000000066313160023037032233 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_templates/sconsdoc.xml0000664000175000017500000000065613160023037032205 0ustar bdbaddogbdbaddog scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_templates/article.xml0000664000175000017500000000106013160023037032003 0ustar bdbaddogbdbaddog
        scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_templates/refentry.xml0000664000175000017500000000116713160023037032226 0ustar bdbaddogbdbaddog Description scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_templates/chapter.xml0000664000175000017500000000053513160023037032014 0ustar bdbaddogbdbaddog
        scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_templates/part.xml0000664000175000017500000000060613160023037031333 0ustar bdbaddogbdbaddog
        scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_templates/appendix.xml0000664000175000017500000000054113160023037032173 0ustar bdbaddogbdbaddog
        scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_templates/section.xml0000664000175000017500000000045613160023037032034 0ustar bdbaddogbdbaddog
        scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons_templates/book.xml0000664000175000017500000000112313160023037031312 0ustar bdbaddogbdbaddog
        scons-src-3.0.0/doc/editor_configs/xmlmind5/addon/config/scons/scons.xxe0000664000175000017500000000317613160023037026320 0ustar bdbaddogbdbaddog http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd scons.xsd