Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
is renamed to "legacy_sched_deprecated".
- Java tool recognizes all released versions, and no longer needs manual
updating as new releases are made. Default is now latest LTS - v25.
- Fortran dialect *PATH and *FLAGS settings fall back to generic
dialect's settings if not explicitly set, bringing the behavior in line
with long-standing documentation claims.
- Reference manual improvements:
* More clarifications in Builder Methods section.
* Clarify VariantDir behavior when switching from duplicate=True (the
Expand Down
11 changes: 3 additions & 8 deletions SCons/Defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,22 +407,17 @@ def _concat(prefix, items_iter, suffix, env, f=lambda x: x, target=None, source=
list, and finally calling _concat_ixes to concatenate 'prefix' and
'suffix' onto each element of the list.
"""

if not items_iter:
return items_iter

l = f(SCons.PathList.PathList(items_iter).subst_path(env, target, source))
if l is not None:
items_iter = l

value = [] if affect_signature else ['$(']
value.extend(_concat_ixes(prefix, items_iter, suffix, env))
if not affect_signature:
value = ['$(']
else:
value = []
value += _concat_ixes(prefix, items_iter, suffix, env)

if not affect_signature:
value += ["$)"]
value.append("$)")

return value
# pylint: enable-msg=too-many-arguments
Expand Down
5 changes: 4 additions & 1 deletion SCons/Tool/FortranCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,14 @@ def DialectAddToEnv(
Args:
dialect: dialect name
suffixes: suffixes associated with this dialect
ppsuffixes: suffixes using cpp associated with this dialect
ppsuffixes: suffixes for preprocessing associated with this dialect
support_mods: whether this dialect supports modules
"""
ComputeFortranSuffixes(suffixes, ppsuffixes)

if dialect != "FORTRAN":
env.AppendUnique(**{f'{dialect}PATH': ['$FORTRANPATH']})

fscan = SCons.Scanner.Fortran.FortranScan(f"{dialect}PATH")
for suffix in suffixes + ppsuffixes:
SCons.Tool.SourceFileScanner.add_scanner(suffix, fscan)
Expand Down
55 changes: 33 additions & 22 deletions SCons/Tool/f03.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ This file is processed by the bin/SConsDoc.py module.
<tool name="f03">
<summary>
<para>
Set construction variables for generic POSIX Fortran 03 compilers.
Set construction variables for the Fortran 03 dialect.
A Fortran dialect lets you customize the
compilation environment for certain files,
as selected by the dialect's <literal>FILESUFFIXES</literal> variable.
By default, the Fortran 03 dialect behaves the same
as the Fortran 90, 95 and 08 dialects.
</para>
</summary>
<sets>
Expand All @@ -53,25 +58,25 @@ Set construction variables for generic POSIX Fortran 03 compilers.
<cvar name="F03">
<summary>
<para>
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 compiler for the Fortran 03 dialect.
This dialect is selected when a source file has a suffix
specified in &cv-link-F03FILESUFFIXES; or
&cv-link-F03PPFILESUFFIXES;.
You only need to set &cv-F03; if you need to specify
a compiler different than the one auto-detected for this dialect.
</para>
</summary>
</cvar>

<cvar name="F03COM">
<summary>
<para>
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 command line used to compile source files in the Fortran 03 dialect.
You only need to set &cv-F03COM; if you need to use a customized
command line for this dialect.
The default setting will be equivalent to
&cv-link-FORTRANCOM;,
but using the dialect-specific &consvars; for substitution.
</para>
</summary>
</cvar>
Expand All @@ -81,17 +86,17 @@ for all Fortran versions.
<para>
If set, the string displayed when a Fortran 03 source file
is compiled to an object file.
If not set, then &cv-link-F03COM; or &cv-link-FORTRANCOM;
(the command line) is displayed.
If not set, then the actual command line,
as generated from &cv-link-F03COM;, is displayed.
</para>
</summary>
</cvar>

<cvar name="F03FILESUFFIXES">
<summary>
<para>
The list of file extensions for which the F03 dialect will be used. By
default, this is <literal>['.f03']</literal>
The list of file extensions for which the Fortran 03 dialect will be used.
By default, this is <literal>['.f03']</literal>
</para>
</summary>
</cvar>
Expand All @@ -100,7 +105,7 @@ default, this is <literal>['.f03']</literal>
<summary>
<para>
The list of file extensions for which the compilation + preprocessor pass for
F03 dialect will be used. By default, this is empty.
the Fortran 03 dialect will be used. By default, this is empty.
</para>
</summary>
</cvar>
Expand All @@ -121,11 +126,15 @@ 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,
You should normally set the &cv-link-FORTRANCOMMONFLAGS; variable,
which specifies the user-specified options
passed to the default Fortran compiler
for all Fortran versions.
</para>
<para><emphasis>Changed in version 4.4</emphasis>:
&cv-link-FORTRANCOMMONFLAGS; is included by default
when commands for this dialect are expanded.
</para>
</summary>
</cvar>

Expand Down Expand Up @@ -274,9 +283,11 @@ 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-FORTRANCOMMONFLAGS; variable,
which specifies the user-specified options
passed to the default Fortran compiler
for all Fortran versions.
which holds user-specified options passed to all Fortran builds.
</para>
<para><emphasis>Changed in version 4.4</emphasis>:
&cv-link-FORTRANCOMMONFLAGS; is included by default
when commands for this dialect are expanded.
</para>
</summary>
</cvar>
Expand Down
45 changes: 24 additions & 21 deletions SCons/Tool/f08.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ This file is processed by the bin/SConsDoc.py module.
<tool name="f08">
<summary>
<para>
Set construction variables for generic POSIX Fortran 08 compilers.
Set construction variables for the Fortran 08 dialect.
A Fortran dialect lets you customize the
compilation environment for certain files,
as selected by the dialect's <literal>FILESUFFIXES</literal> variable.
By default, the Fortran 08 dialect behaves the same
as the Fortran 90, 95 and 03 dialects.
</para>
</summary>
<sets>
Expand All @@ -53,12 +58,12 @@ Set construction variables for generic POSIX Fortran 08 compilers.
<cvar name="F08">
<summary>
<para>
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 compiler for the Fortran 08 dialect.
This dialect is selected when a source file has a suffix
specified in &cv-link-F08FILESUFFIXES; or
&cv-link-F08PPFILESUFFIXES;.
You only need to set &cv-F08; if you need to specify
a compiler different than the one auto-detected for this dialect.
</para>
</summary>
</cvar>
Expand All @@ -67,11 +72,11 @@ or compiler version for Fortran 08 files.
<summary>
<para>
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.
You only need to set &cv-F08COM; if you need to use a customized
command line for this dialect.
The default setting will be equivalent to
&cv-link-FORTRANCOM;,
but using the dialect-specific &consvars; for substitution.
</para>
</summary>
</cvar>
Expand All @@ -81,17 +86,17 @@ for all Fortran versions.
<para>
If set, the string displayed when a Fortran 08 source file
is compiled to an object file.
If not set, then &cv-link-F08COM; or &cv-link-FORTRANCOM;
(the command line) is displayed.
If not set, then the actual command line,
as generated from &cv-link-F08COM;, is displayed.
</para>
</summary>
</cvar>

<cvar name="F08FILESUFFIXES">
<summary>
<para>
The list of file extensions for which the F08 dialect will be used. By
default, this is <literal>['.f08']</literal>
The list of file extensions for which the Fortran 08 dialect will be used.
By default, this is <literal>['.f08']</literal>
</para>
</summary>
</cvar>
Expand All @@ -100,7 +105,7 @@ default, this is <literal>['.f08']</literal>
<summary>
<para>
The list of file extensions for which the compilation + preprocessor pass for
F08 dialect will be used. By default, this is empty.
the Fortran 08 dialect will be used. By default, this is empty.
</para>
</summary>
</cvar>
Expand All @@ -121,10 +126,8 @@ 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.
You should normally set the &cv-link-FORTRANCOMMONFLAGS; variable,
which holds user-specified options passed to all Fortran builds.
</para>
</summary>
</cvar>
Expand Down
45 changes: 25 additions & 20 deletions SCons/Tool/f77.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ This file is processed by the bin/SConsDoc.py module.
<tool name="f77">
<summary>
<para>
Set construction variables for generic POSIX Fortran 77 compilers.
Set construction variables for the Fortran 77 dialect.
A Fortran dialect lets you customize the
compilation environment for certain files,
as selected by the dialect's <literal>FILESUFFIXES</literal> variable.
By default, the Fortran 77 dialect is distinguished from the
the Fortran 90, 95, 03 and 08 dialects by the assumption
that the source files are fixed-form Fortran, rather than free.
</para>
</summary>
<sets>
Expand Down Expand Up @@ -68,12 +74,12 @@ Set construction variables for generic POSIX Fortran 77 compilers.
<cvar name="F77">
<summary>
<para>
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 compiler for the Fortran 77 dialect.
This dialect is selected when a source file has a suffix
specified in &cv-link-F77FILESUFFIXES;
&cv-link-F77PPFILESUFFIXES;.
You only need to set &cv-F77; if you need to specify
a compiler different than the one auto-detected for this dialect.
</para>
</summary>
</cvar>
Expand All @@ -82,20 +88,21 @@ or compiler version for Fortran 77 files.
<summary>
<para>
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.
You only need to set &cv-F77COM; if you need to use a customized
command line for this dialect.
The default setting will be equivalent to
&cv-link-FORTRANCOM;,
but using the dialect-specific &consvars; for substitution,
excepting that Fortran module-related variables are omitted.
</para>
</summary>
</cvar>

<cvar name="F77FILESUFFIXES">
<summary>
<para>
The list of file extensions for which the F77 dialect will be used. By
default, this is <literal>['.f77']</literal>
The list of file extensions for which the Fortran 77 dialect will be used.
By default, this is <literal>['.f77']</literal>
</para>
</summary>
</cvar>
Expand All @@ -104,7 +111,7 @@ default, this is <literal>['.f77']</literal>
<summary>
<para>
The list of file extensions for which the compilation + preprocessor pass for
F77 dialect will be used. By default, this is empty.
the Fortran 77 dialect will be used. By default, this is empty.
</para>
</summary>
</cvar>
Expand All @@ -114,8 +121,8 @@ F77 dialect will be used. By default, this is empty.
<para>
If set, the string displayed when a Fortran 77 source file
is compiled to an object file.
If not set, then &cv-link-F77COM; or &cv-link-FORTRANCOM;
(the command line) is displayed.
If not set, then the actual command line,
as generated from &cv-link-F77COM;, is displayed.
</para>
</summary>
</cvar>
Expand All @@ -137,9 +144,7 @@ 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.
which holds user-specified options passed to all Fortran builds.
</para>
</summary>
</cvar>
Expand Down
Loading
Loading