env['PCH'] = 'StdAfx.pch'
.EE
+.IP PCHCOM
+The command line used by the
+.B PCH
+builder to generated a precompiled header.
+
+.IP PCHCOMSTR
+The string displayed when generating a precompiled header.
+If this is not set, then $PCHCOM (the command line) is displayed.
+
.IP 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
.IP QT_MOCFROMCXXCOM
Command to generate a moc file from a cpp file.
+.IP 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.
+
.IP QT_MOCFROMHCOM
Command to generate a moc file from a header.
+.IP 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.
+
.IP QT_MOCFROMHFLAGS
Default value is ''. These flags are passed to moc, when moccing a header
file.
.IP QT_UIC
Default value is '$QT_BINPATH/uic'.
-.IP QT_UICDECLCOM
+.IP QT_UICCOM
Command to generate header files from .ui files.
+.IP 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.
+
.IP QT_UICDECLFLAGS
Default value is ''. These flags are passed to uic, when creating a a h
file from a .ui file.
.IP QT_UICDECLSUFFIX
Default value is '.h'. Suffix for uic generated header files.
-.IP QT_UICIMPLCOM
-Command to generate cxx files from .ui files.
-
.IP QT_UICIMPLFLAGS
Default value is ''. These flags are passed to uic, when creating a cxx
file from a .ui file.
.IP RCCOM
The command line used by the RES builder.
+.IP RCCOMSTR
+The string displayed when invoking the resource compiler.
+If this is not set, then $RCCOM (the command line) is displayed.
+
.IP RCFLAGS
The flags passed to the resource compiler by the RES builder.
.IP RCS_COFLAGS
Options that are passed to the $RCS_CO command.
+.IP REGSVR
+The program used to register DLLs on Windows systems.
+
+.IP REGSVRCOM
+The command line used to register a newly-built DLL file
+on Windows systems.
+Invoked when the "register=1"
+keyword argument is passed to the
+.B SharedLibrary
+Builder.
+
+.IP REGSVRCOMSTR
+The string displayed when registering a newly-built DLL file.
+If this is not set, then $REGSVRCOM (the command line) is displayed.
+
.IP RDirs
A function that converts a file name into a list of Dir instances by
searching the repositories.
$CVSCOMSTR, $CXXCOMSTR, $DCOMSTR, $DVIPDFCOMSTR, $F77COMSTR,
$F90COMSTR, $F95COMSTR, $FORTRANCOMSTR, $GSCOMSTR, $JARCOMSTR,
$JAVACCOMSTR, $JAVAHCOMSTR, $LATEXCOMSTR, $LEXCOMSTR, $LINKCOMSTR,
- $M4COMSTR, $P4COMSTR, $PDFLATEXCOMSTR, $PDFTEXCOMSTR, $PSCOMSTR,
- $RCSCOMSTR, $RMICCOMSTR, $SCCSCOMSTR, $SHCCCOMSTR, $SHCXXCOMSTR,
- $SHF77COMSTR, $SHF90COMSTR, $SHF95COMSTR, $SHFORTRANCOMSTR,
- $SHLINKCOMSTR, $SWIGCOMSTR, $TARCOMSTR, $TEXCOMSTR, $YACCCOMSTR
- and $ZIPCOMSTR.
+ $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
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import SCons.Action
+import SCons.Builder
import SCons.Defaults
import SCons.Scanner.IDL
import SCons.Util
idl_scanner = SCons.Scanner.IDL.IDLScan()
-midl_builder = SCons.Builder.Builder(action='$MIDLCOM',
+midl_action = SCons.Action.Action('$MIDLCOM', '$MIDLCOMSTR')
+
+midl_builder = SCons.Builder.Builder(action = midl_action,
src_suffix = '.idl',
suffix='.tlb',
emitter = midl_emitter,
return 1
else:
return env.Detect('midl')
-
-
import os.path
import string
+import SCons.Action
+import SCons.Builder
import SCons.Tool
import SCons.Util
shlib_action = SCons.Action.CommandGenerator(shlib_generator)
-res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.o',
+res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
+
+res_builder = SCons.Builder.Builder(action=res_action, suffix='.o',
source_scanner=SCons.Defaults.ObjSourceScan)
SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan)
return ret
return 0
-regServerAction = SCons.Action.Action("$REGSVRCOM")
+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")}')
compositeLinkAction = shlibLinkAction + regServerCheck
return object_emitter(target, source, env,
SCons.Defaults.SharedObjectEmitter)
-pch_builder = SCons.Builder.Builder(action='$PCHCOM', suffix='.pch', emitter=pch_emitter,
+pch_action = SCons.Action.Action('$PCHCOM', '$PCHCOMSTR')
+pch_builder = SCons.Builder.Builder(action=pch_action, suffix='.pch',
+ emitter=pch_emitter,
source_scanner=SCons.Defaults.ObjSourceScan)
-res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.res',
+res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
+res_builder = SCons.Builder.Builder(action=res_action, suffix='.res',
source_scanner=SCons.Defaults.ObjSourceScan)
SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan)
"""SCons.Tool.qt
-Tool-specific initialization for 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()
import os.path
import re
+import SCons.Action
+import SCons.Builder
import SCons.Defaults
import SCons.Scanner
import SCons.Tool
Action(checkMocIncluded,None)])
# ... and the corresponding builders
- uicBld = Builder(action='$QT_UICCOM',
+ uicBld = Builder(action=SCons.Action.Action('$QT_UICCOM', '$QT_UICCOMSTR'),
emitter=uicEmitter,
src_suffix='$QT_UISUFFIX',
suffix='$QT_UICDECLSUFFIX',
source_scanner=uicScanner)
mocBld = Builder(action={}, prefix={}, suffix={})
for h in header_extensions:
- mocBld.add_action(h, '$QT_MOCFROMHCOM')
+ 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:
- mocBld.add_action(cxx, '$QT_MOCFROMCXXCOM')
+ act = SCons.Action.Action('$QT_MOCFROMCXXCOM', '$QT_MOCFROMCXXCOMSTR')
+ mocBld.add_action(cxx, act)
mocBld.prefix[cxx] = '$QT_MOCCXXPREFIX'
mocBld.suffix[cxx] = '$QT_MOCCXXSUFFIX'
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $MIDLCOM construction variable.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mymidl.py', """
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*midl*/\\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(tools=['default', 'midl'],
+ MIDLCOM = r'%s mymidl.py $TARGET $SOURCES')
+env.TypeLibrary(target = 'aaa', source = 'aaa.idl')
+""" % python)
+
+test.write('aaa.idl', "aaa.idl\n/*midl*/\n")
+
+test.run(arguments = '.')
+
+test.must_match('aaa.tlb', "aaa.idl\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $MIDLCOMSTR construction variable allows you to customize
+the displayed string when midl is called.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mymidl.py', """
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*midl*/\\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(tools=['default', 'midl'],
+ MIDLCOM = r'%s mymidl.py $TARGET $SOURCES',
+ MIDLCOMSTR = 'MIDLing $TARGET from $SOURCE')
+env.TypeLibrary(target = 'aaa', source = 'aaa.idl')
+""" % python)
+
+test.write('aaa.idl', "aaa.idl\n/*midl*/\n")
+
+test.run(stdout = test.wrap_stdout("""\
+MIDLing aaa.tlb from aaa.idl
+"""))
+
+test.must_match('aaa.tlb', "aaa.idl\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $MIDLCOM construction variable.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mypch.py', """
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*pch*/\\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(tools=['default', 'msvc'],
+ PCHCOM = r'%s mypch.py $TARGET $SOURCES')
+env.PCH(target = 'aaa', source = 'aaa.h')
+""" % python)
+
+test.write('aaa.h', "aaa.h\n/*pch*/\n")
+
+test.run(arguments = ".")
+
+test.must_match('aaa.pch', "aaa.h\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $PCHCOMSTR construction variable allows you to customize
+the displayed string when pch is called.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mypch.py', """
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*pch*/\\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(tools=['default', 'msvc'],
+ PCHCOM = r'%s mypch.py $TARGET $SOURCES',
+ PCHCOMSTR = 'PCHing $TARGET from $SOURCE')
+env.PCH(target = 'aaa', source = 'aaa.h')
+""" % python)
+
+test.write('aaa.h', "aaa.h\n/*pch*/\n")
+
+test.run(stdout = test.wrap_stdout("""\
+PCHing aaa.pch from aaa.h
+"""))
+
+test.must_match('aaa.pch', "aaa.h\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $RCCOM construction variable
+when using MSVC.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('myrc.py', """
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*rc*/\\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(tools=['default', 'msvc'],
+ RCCOM = r'%(python)s myrc.py $TARGET $SOURCES')
+env.RES(target = 'aaa', source = 'aaa.rc')
+""" % locals())
+
+test.write('aaa.rc', "aaa.rc\n/*rc*/\n")
+
+test.run(arguments = ".")
+
+test.must_match('aaa.res', "aaa.rc\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $RCCOMSTR construction variable allows you to customize
+the displayed string when rc is called.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('myrc.py', """
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*rc*/\\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(tools=['default', 'msvc'],
+ RCCOM = r'%(python)s myrc.py $TARGET $SOURCES',
+ RCCOMSTR = 'RCing $TARGET from $SOURCE')
+env.RES(target = 'aaa', source = 'aaa.rc')
+""" % locals())
+
+test.write('aaa.rc', "aaa.rc\n/*rc*/\n")
+
+test.run(stdout = test.wrap_stdout("""\
+RCing aaa.res from aaa.rc
+"""))
+
+test.must_match('aaa.res', "aaa.rc\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $RCCOM construction variable
+when using MinGW.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('myrc.py', """
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*rc*/\\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(tools=['default', 'mingw'],
+ RCCOM = r'%(python)s myrc.py $TARGET $SOURCES')
+env.RES(target = 'aaa', source = 'aaa.rc')
+""" % locals())
+
+test.write('aaa.rc', "aaa.rc\n/*rc*/\n")
+
+test.run(arguments = ".")
+
+test.must_match('aaa.o', "aaa.rc\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $RCCOMSTR construction variable allows you to customize
+the displayed string when rc is called.
+"""
+
+import TestSCons
+
+python = TestSCons.python
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('myrc.py', """
+import sys
+outfile = open(sys.argv[1], 'wb')
+for f in sys.argv[2:]:
+ infile = open(f, 'rb')
+ for l in filter(lambda l: l != '/*rc*/\\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(tools=['default', 'mingw'],
+ RCCOM = r'%(python)s myrc.py $TARGET $SOURCES',
+ RCCOMSTR = 'RCing $TARGET from $SOURCE')
+env.RES(target = 'aaa', source = 'aaa.rc')
+""" % locals())
+
+test.write('aaa.rc', "aaa.rc\n/*rc*/\n")
+
+test.run(stdout = test.wrap_stdout("""\
+RCing aaa.o from aaa.rc
+"""))
+
+test.must_match('aaa.o', "aaa.rc\n")
+
+
+
+test.pass_test()
+++ /dev/null
-#!/usr/bin/env python
-#
-# __COPYRIGHT__
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-
-import os
-import string
-import sys
-import TestSCons
-
-_exe = TestSCons._exe
-test = TestSCons.TestSCons()
-
-rpcgen = test.where_is('rpcgen')
-if not rpcgen:
- print "rpcgen not found, skipping test"
- test.pass_test(1)
-
-test.subdir('do_rpcgen')
-
-test.write('SConstruct', """\
-import os
-env = Environment(ENV=os.environ)
-env.Program('rpcclnt', ['rpcclnt.c', 'do_rpcgen/rpcif_clnt.c'])
-env.RPCGenHeader('do_rpcgen/rpcif')
-env.RPCGenClient('do_rpcgen/rpcif')
-env.RPCGenService('do_rpcgen/rpcif')
-env.RPCGenXDR('do_rpcgen/rpcif')
-""")
-
-test.write(['do_rpcgen', 'rpcif.x'], """\
-program RPCTEST_IF
-{
- version RPCTEST_IF_VERSION
- {
- int START(unsigned long) = 1;
- int STOP(unsigned long) = 2;
- int STATUS(unsigned long) = 3;
- } = 1; /* version */
-} = 0xfeedf00d; /* portmap program ID */
-""")
-
-# Following test tries to make sure it can compile and link, but when
-# it's run it doesn't actually invoke any rpc operations because that
-# would have significant dependencies on network configuration,
-# portmapper, etc. that aren't necessarily appropriate for an scons
-# test.
-
-test.write('rpcclnt.c', """\
-#include <rpc/rpc.h>
-#include <rpc/pmap_clnt.h>
-#include "do_rpcgen/rpcif.h"
-
-int main(int argc, char **args) {
- const char* const SERVER = "localhost";
- CLIENT *cl;
- int *rslt;
- unsigned long arg = 0;
- if (argc > 2) {
- cl = clnt_create( SERVER, RPCTEST_IF, RPCTEST_IF_VERSION, "udp" );
- if (cl == 0 ) { return 1; }
- rslt = start_1(&arg, cl);
- if (*rslt == 0) { clnt_perror( cl, SERVER ); return 1; }
- clnt_destroy(cl);
- } else
- printf("Hello!\\n");
- return 0;
-}
-""")
-
-
-test.run()
-
-test.run(program=test.workpath('rpcclnt'+_exe))
-
-test.fail_test(not test.stdout() in ["Hello!\n", "Hello!\r\n"])
-
-test.pass_test()