--- /dev/null
+Adding a new Platform to the SCons distribution:
+
+ -- Add the following files (aenf):
+
+ src/engine/SCons/Platform/xxx.py
+
+ Use one of the other Platform files as a template.
+
+ The tool_list() function should return the list of tools
+ that will be available through the default construction
+ Environment.
+
+ The generate() function should set construction variables:
+
+ ENV
+ OBJPREFIX
+ OBJSUFFIX
+ PROGPREFIX
+ PROGSUFFIX
+ LIBPREFIX
+ LIBSUFFIX
+ SHLIBPREFIX
+ SHLIBSUFFIX
+ LIBPREFIXES
+ LIBSUFFIXES
+
+ -- Modify the following files (aecp):
+
+ doc/man/scons.1
+
+ Add the new platform to the example of the platform
+ keyword when instantiating an Environment.
+
+ Add the list of default tools returned by tool_list()
+ for this platform.
+
+ rpm/scons.spec
+
+ Add to the list at the bottom of the file:
+
+ /usr/lib/scons/SCons/Platform/xxx.py
+ /usr/lib/scons/SCons/Platform/xxx.pyc
+
+ [THIS LIST SHOULD BE GENERATED FROM MANIFEST.in,
+ AND WILL BE SOME DAY.]
+
+ src/CHANGES.txt
+
+ Add mention of the new Platform specification.
+
+ src/engine/MANIFEST.in
+
+ Add to the list:
+
+ SCons/Platform/xxx.py
+
+ src/engine/SCons/Platform/Platform/PlatformTests.py
+
+ Copy and paste one of the other platform tests to verify
+ the ability to initialize an environment through a call
+ to the object returned by Platform('xxx')
+
+ src/engine/SCons/Platform/__init__.py
+
+ Add logic to platform_default() (if necessary) to return
+ the appropriate platform string.
+
+ test/Platform.py
+
+ Add the new platform to the SConstruct and SConscript
+ files. Add the expected output to the "expect"
+ variable.
.ES
env = Environment(platform = 'cygwin')
+env = Environment(platform = 'os2')
env = Environment(platform = 'posix')
env = Environment(platform = 'win32')
.EE
yacc
.EE
-and supports the following tool specifications out of the box on
+SCons supports the following tool specifications out of the box on
+.B os2
+platforms:
+
+.ES
+dvipdf
+dvips
+g77
+latex
+lex
+nasm
+pdflatex
+pdftex
+tex
+yacc
+.EE
+
+SCons supports the following tool specifications out of the box on
.B win32
platforms:
.IP TARFLAGS
General options passed to the tar archiver.
+.IP TARSUFFIX
+The suffix used for tar file names.
+
.IP TEX
The TeX formatter and typesetter.
/usr/lib/scons/SCons/Node/__init__.pyc
/usr/lib/scons/SCons/Platform/cygwin.py
/usr/lib/scons/SCons/Platform/cygwin.pyc
+/usr/lib/scons/SCons/Platform/os2.py
+/usr/lib/scons/SCons/Platform/os2.pyc
/usr/lib/scons/SCons/Platform/posix.py
/usr/lib/scons/SCons/Platform/posix.pyc
/usr/lib/scons/SCons/Platform/win32.py
- Add a tar archive builder.
+ - Add preliminary support for OS/2.
+
From Jeff Petkau:
- Fix --implicit-cache if the scanner returns an empty list.
SCons/Node/FS.py
SCons/Platform/__init__.py
SCons/Platform/cygwin.py
+SCons/Platform/os2.py
SCons/Platform/posix.py
SCons/Platform/win32.py
SCons/Scanner/__init__.py
assert env['PROGSUFFIX'] == '.exe', env
assert env['LIBSUFFIX'] == '.a', env
+ p = SCons.Platform.Platform('os2')
+ assert str(p) == 'os2', p
+ env = {}
+ p(env)
+ assert env['PROGSUFFIX'] == '.exe', env
+ assert env['LIBSUFFIX'] == '.lib', env
+
p = SCons.Platform.Platform('posix')
assert str(p) == 'posix', p
env = {}
if os.name == 'posix':
if sys.platform == 'cygwin':
return 'cygwin'
- return 'posix'
+ return 'posix'
+ elif os.name == 'os2':
+ return 'os2'
else:
return sys.platform
--- /dev/null
+"""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, 2002 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.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import SCons.Util
+
+def tool_list():
+ list = ['dvipdf', 'dvips', 'g77',
+ 'latex', 'lex',
+ 'pdflatex', 'pdftex', 'tex', 'yacc']
+ if SCons.Util.WhereIs('nasm'):
+ list.append('nasm')
+ return list
+
+def generate(env):
+ if not env.has_key('ENV'):
+ env['ENV'] = {}
+ #env['ENV']['PATHEXT'] = '.COM;.EXE;.BAT;.CMD'
+ env['OBJPREFIX'] = ''
+ env['OBJSUFFIX'] = '.obj'
+ env['PROGPREFIX'] = ''
+ env['PROGSUFFIX'] = '.exe'
+ env['LIBPREFIX'] = ''
+ env['LIBSUFFIX'] = '.lib'
+ env['SHLIBPREFIX'] = ''
+ env['SHLIBSUFFIX'] = '.dll'
+ env['LIBPREFIXES'] = '$LIBPREFIX'
+ env['LIBSUFFIXES'] = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]
env = {}
Platform('cygwin')(env)
print "'%s'" % env['PROGSUFFIX']
+Platform('os2')(env)
+print "'%s'" % env['PROGSUFFIX']
Platform('posix')(env)
print "'%s'" % env['PROGSUFFIX']
Platform('win32')(env)
env = {}
Platform('cygwin')(env)
print "'%s'" % env['LIBSUFFIX']
+Platform('os2')(env)
+print "'%s'" % env['LIBSUFFIX']
Platform('posix')(env)
print "'%s'" % env['LIBSUFFIX']
Platform('win32')(env)
""")
expect = """'.exe'
+'.exe'
''
'.exe'
'.a'
+'.lib'
'.a'
'.lib'
"""