summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/design/native.sgml8
-rw-r--r--doc/man/desc.sgml13
-rw-r--r--doc/man/options.sgml12
-rw-r--r--doc/scons.mod2
-rw-r--r--src/scons.py7
-rw-r--r--test/SConstruct.py40
6 files changed, 66 insertions, 16 deletions
diff --git a/doc/design/native.sgml b/doc/design/native.sgml
index c9fd4bf..e2a756c 100644
--- a/doc/design/native.sgml
+++ b/doc/design/native.sgml
@@ -32,9 +32,11 @@
<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>
diff --git a/doc/man/desc.sgml b/doc/man/desc.sgml
index da2961e..75ac82a 100644
--- a/doc/man/desc.sgml
+++ b/doc/man/desc.sgml
@@ -14,12 +14,13 @@
<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>
diff --git a/doc/man/options.sgml b/doc/man/options.sgml
index a231908..b24c18f 100644
--- a/doc/man/options.sgml
+++ b/doc/man/options.sgml
@@ -107,11 +107,13 @@
<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.)
diff --git a/doc/scons.mod b/doc/scons.mod
index b8a231a..7e5470e 100644
--- a/doc/scons.mod
+++ b/doc/scons.mod
@@ -49,6 +49,8 @@
<!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>">
diff --git a/src/scons.py b/src/scons.py
index 7f86d15..f624fba 100644
--- a/src/scons.py
+++ b/src/scons.py
@@ -448,9 +448,12 @@ def main():
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()
diff --git a/test/SConstruct.py b/test/SConstruct.py
new file mode 100644
index 0000000..b68bed4
--- /dev/null
+++ b/test/SConstruct.py
@@ -0,0 +1,40 @@
+#!/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()