<para>
- By default, the &SCons; utility reads a configuration file named
- &SConstruct; in the current directory. A <option>-f</option>
- command-line option exists to read a different file name.
+ By default, the &SCons; utility 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. A <option>-f</option> command-line option exists to read a
+ different file name.
</para>
<para>
- By default, &scons; reads configuration information from the
- file named <filename>SConstruct</filename> in the current
- directory. An alternate file name may be specified via the
- <option>-f</option> option. If the alternate file is not in
- the local directory, &scons; will internally change its working
- directory (chdir) to the directory containing the file.
+ 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>-f</option> option. If
+ the specified file is not in the local directory, &scons; will
+ internally change its working directory (chdir) to the directory
+ containing the file.
</para>
<para>
Change to the specified <replaceable>directory</replaceable>
- before reading <filename>SConstruct</filename> or doing
- anything else. Multiple <option>-C</option> options are
- interpreted relative to the previous one. (This is nearly
- equivalent to <literal>-f directory/SConstruct</literal>,
- except that it will search for <filename>SConstruct</filename>,
+ before searching for the <filename>SConstruct</filename>,
+ <filename>Sconstruct</filename> or
+ <filename>sconstruct</filename> file, or doing anything
+ else. Multiple <option>-C</option> options are interpreted
+ relative to the previous one. (This is nearly equivalent
+ to <literal>-f directory/SConstruct</literal>, except
+ that it will search for <filename>SConstruct</filename>,
<filename>Sconstruct</filename>, or
<filename>sconstruct</filename> in the directory.)
<!ENTITY Makefile "<filename>Makefile</filename>">
<!ENTITY SConscript "<filename>SConscript</filename>">
<!ENTITY SConstruct "<filename>SConstruct</filename>">
+<!ENTITY Sconstruct "<filename>Sconstruct</filename>">
+<!ENTITY sconstruct "<filename>sconstruct</filename>">
<!ENTITY sconsign "<filename>.consign</filename>">
opt_func[opt](opt, arg)
if not Scripts:
- Scripts.append('SConstruct')
+ for file in ['SConstruct', 'Sconstruct', 'sconstruct']:
+ if os.path.isfile(file):
+ Scripts.append(file)
+ break
- if local_help and not os.path.isfile(Scripts[0]):
+ if local_help and not Scripts:
# They specified -h, but there's no SConstruct. Give them
# the options usage before we try to read it and fail.
PrintUsage()
--- /dev/null
+#!/usr/bin/env python
+
+__revision__ = "test/SConstruct.py __REVISION__ __DATE__ __DEVELOPER__"
+
+import TestCmd
+
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
+
+wpath = test.workpath()
+
+test.write('sconstruct', """
+import os
+print "sconstruct", os.getcwd()
+""")
+
+test.run(chdir = '.')
+
+test.fail_test(test.stdout() != ("sconstruct %s\n" % wpath))
+
+test.write('Sconstruct', """
+import os
+print "Sconstruct", os.getcwd()
+""")
+
+test.run(chdir = '.')
+
+test.fail_test(test.stdout() != ("Sconstruct %s\n" % wpath))
+
+test.write('SConstruct', """
+import os
+print "SConstruct", os.getcwd()
+""")
+
+test.run(chdir = '.')
+
+test.fail_test(test.stdout() != ("SConstruct %s\n" % wpath))
+
+test.pass_test()