diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index e21c782a31..ff3bb39e5a 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -1247,31 +1247,34 @@ env.MSVSSolution( Ninja() env.Ninja() - &b-Ninja; is a special builder which - adds a target to create a ninja build file. + A special builder which + adds a target to create a Ninja build file. The builder does not require any source files to be specified. This is an experimental feature. To enable it you must use one of the following methods - + - # On the command line - --experimental=ninja +# On the command line +--experimental=ninja - # Or in your SConstruct - SetOption('experimental', 'ninja') +# Or in your SConstruct +SetOption('experimental', 'ninja') This functionality is subject to change and/or removal without deprecation cycle. - - To use this tool you must install pypi's ninja - package. - This can be done via - pip install ninja + To use this tool you need to install the &Python; &ninja; package, + as the tool by default depends on being able to do an + import of the package + + This can be done via: + +python -m pip install ninja + diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen index c982b961dc..a2d9acd503 100644 --- a/doc/generated/functions.gen +++ b/doc/generated/functions.gen @@ -63,7 +63,7 @@ Added methods propagate through &f-env-Clone; calls. -Examples: +More examples: @@ -472,7 +472,7 @@ and/or suffix, so the contents are treated as a list of strings, that is, adding a string will result in a separate string entry, not a combined string. For &cv-CPPDEFINES; as well as -for &cv-link-LIBS;, and the various *PATH +for &cv-link-LIBS;, and the various *PATH; variables, &SCons; will supply the compiler-specific syntax (e.g. adding a -D or /D prefix for &cv-CPPDEFINES;), so this syntax should be omitted when @@ -550,7 +550,7 @@ do not make sense and a &Python; exception will be raised. When using &f-env-Append; to modify &consvars; which are path specifications (conventionally, -the names of such end in PATH), +the names of such end in PATH), it is recommended to add the values as a list of strings, even if there is only a single string to add. The same goes for adding library names to &cv-LIBS;. @@ -570,26 +570,26 @@ See also &f-link-env-AppendUnique;, env.AppendENVPath(name, newpath, [envname, sep, delete_existing=False]) -Append new path elements to the given path in the -specified external environment (&cv-link-ENV; by default). -This will only add -any particular path once (leaving the last one it encounters and -ignoring the rest, to preserve path order), -and to help assure this, -will normalize all paths (using -os.path.normpath +Append path elements specified by newpath +to the given search path string or list name +in mapping envname in the &consenv;. +Supplying envname is optional: +the default is the execution environment &cv-link-ENV;. +Optional sep is used as the search path separator, +the default is the platform's separator (os.pathsep). +A path element will only appear once. +Any duplicates in newpath are dropped, +keeping the last appearing (to preserve path order). +If delete_existing +is False (the default) +any addition duplicating an existing path element is ignored; +if delete_existing +is True the existing value will +be dropped and the path element will be added at the end. +To help maintain uniqueness all paths are normalized (using +os.path.normpath and -os.path.normcase). -This can also handle the -case where the given old path variable is a list instead of a -string, in which case a list will be returned instead of a string. - - - -If -delete_existing -is False, then adding a path that already exists -will not move it to the end; it will stay where it is in the list. +os.path.normcase). @@ -608,6 +608,11 @@ print('after:', env['ENV']['INCLUDE']) before: /foo:/biz after: /biz:/foo/bar:/foo + + +See also &f-link-env-PrependENVPath;. + + @@ -718,7 +723,7 @@ is being used and &scons; finds a derived file that needs to be rebuilt, it will first look in the cache to see if a -file with matching build signature exists +file with matching &buildsig; exists (indicating the input file(s) and build action(s) were identical to those for the current target), and if so, will retrieve the file from the cache. @@ -730,7 +735,7 @@ If the derived file is not present in the cache, &scons; will build it and then place a copy of the built file in the cache, -identified by its build signature, for future use. +identified by its &buildsig;, for future use. @@ -787,6 +792,13 @@ method can be used to disable caching of specific files. This can be useful if inputs and/or outputs of some tool are impossible to predict or prohibitively large. + + +Note that (at this time) &SCons; provides no facilities +for managing the derived-file cache. It is up to the developer +to arrange for cache pruning, expiry, etc. if needed. + + @@ -1194,7 +1206,7 @@ was built. This can be consulted to match various file characteristics such as the timestamp, -size, or content signature. +size, or &contentsig;. @@ -1390,10 +1402,11 @@ Find an executable from one or more choices: progs may be a string or a list of strings. Returns the first value from progs that was found, or None. -Executable is searched by checking the paths specified -by env['ENV']['PATH']. +Executable is searched by checking the paths in the execution environment +(env['ENV']['PATH']). On Windows systems, additionally applies the filename suffixes found in -env['ENV']['PATHEXT'] +the execution environment +(env['ENV']['PATHEXT']) but will not include any such extension in the return value. &f-env-Detect; is a wrapper around &f-link-env-WhereIs;. @@ -2640,12 +2653,8 @@ not as separate arguments to -By default, -duplicate values are eliminated; -you can, however, specify -unique=False -to allow duplicate -values to be added. +If unique is true (the default), +duplicate values are not stored. When eliminating duplicate values, any &consvars; that end with the string @@ -2653,6 +2662,8 @@ the string keep the left-most unique value. All other &consvars; keep the right-most unique value. +If unique is false, +values are added even if they are duplicates. @@ -2669,9 +2680,13 @@ env.MergeFlags(['!pkg-config gtk+-2.0 --cflags', '-O3']) # Combine an optimization flag with the flags returned from running pkg-config # twice and merge the result into the construction variables. -env.MergeFlags(['-O3', - '!pkg-config gtk+-2.0 --cflags --libs', - '!pkg-config libpng12 --cflags --libs']) +env.MergeFlags( + [ + '-O3', + '!pkg-config gtk+-2.0 --cflags --libs', + '!pkg-config libpng12 --cflags --libs', + ] +) @@ -2773,15 +2788,13 @@ NoClean(env.Program('hello', 'hello.c')) env.ParseConfig(command, [function, unique]) Updates the current &consenv; with the values extracted -from the output from running external command, -by calling a helper function function -which understands -the output of command. +from the output of running external command, +by passing it to a helper function. command may be a string or a list of strings representing the command and its arguments. If function -is not given, +is omitted or None, &f-link-env-MergeFlags; is used. By default, duplicate values are not @@ -2792,33 +2805,32 @@ to allow duplicate values to be added. -If &f-env-MergeFlags; is used, -it expects a response in the style of a -*-config -command typical of the POSIX programming environment -(for example, -gtk-config) -and adds the options -to the appropriate construction variables. -Interpreted options -and the construction variables they affect -are as specified for the -&f-link-env-ParseFlags; -method (which -&f-env-MergeFlags; calls). -See that method's description -for a table of options and corresponding construction variables. +command is executed using the +SCons execution environment (that is, the &consvar; +&cv-link-ENV; in the current &consenv;). +If command needs additional information +to operate properly, that needs to be set in the execution environment. +For example, pkg-config +may need a custom value set in the PKG_CONFIG_PATH +environment variable. -If &f-env-MergeFlags; cannot interpret the results of +&f-env-MergeFlags; needs to understand +the output produced by command +in order to distribute it to appropriate &consvars;. +&f-env-MergeFlags; uses a separate function to +do that processing - +see &f-link-env-ParseFlags; for the details, including a +a table of options and corresponding construction variables. +To provide alternative processing of the output of command, you can suppply a custom -function to do so. -function -must accept three arguments: -the &consenv; to modify, the string returned -by running command, +function, +which must accept three arguments: +the &consenv; to modify, +a string argument containing the output from running +command, and the optional unique flag. @@ -2828,8 +2840,7 @@ and the optional ParseDepends(filename, [must_exist, only_one]) env.ParseDepends(filename, [must_exist, only_one]) -Parses the contents of the specified -filename +Parses the contents of filename as a list of dependencies in the style of &Make; or @@ -2840,27 +2851,21 @@ and explicitly establishes all of the listed dependencies. By default, it is not an error -if the specified -filename +if filename does not exist. The optional must_exist -argument may be set to a non-zero -value to have -scons -throw an exception and -generate an error if the file does not exist, +argument may be set to True +to have &SCons; +raise an exception if the file does not exist, or is otherwise inaccessible. The optional only_one -argument may be set to a non-zero -value to have -scons -thrown an exception and -generate an error +argument may be set to True +to have &SCons; raise an exception if the file contains dependency information for more than one target. This can provide a small sanity check @@ -2876,7 +2881,6 @@ file. -The filename and all of the files listed therein will be interpreted relative to @@ -2892,10 +2896,10 @@ function. env.ParseFlags(flags, ...) Parses one or more strings containing -typical command-line flags for GCC tool chains +typical command-line flags for GCC-style tool chains and returns a dictionary with the flag values separated into the appropriate SCons construction variables. -This is intended as a companion to the +Intended as a companion to the &f-link-env-MergeFlags; method, but allows for the values in the returned dictionary to be modified, if necessary, @@ -2910,11 +2914,20 @@ directly unless you want to manipulate the values.) If the first character in any string is -an exclamation mark (!), +an exclamation mark (!), the rest of the string is executed as a command, and the output from the command is parsed as GCC tool chain command-line flags and added to the resulting dictionary. +This can be used to call a *-config +command typical of the POSIX programming environment +(for example, +pkg-config). +Note that such a comamnd is executed using the +SCons execution environment; +if the command needs additional information, +that information needs to be explcitly provided. +See &f-link-ParseConfig; for more details. @@ -3051,30 +3064,28 @@ and &f-link-env-PrependUnique;. - env.PrependENVPath(name, newpath, [envname, sep, delete_existing]) + env.PrependENVPath(name, newpath, [envname, sep, delete_existing=True]) -Prepend new path elements to the given path in the -specified external environment (&cv-link-ENV; by default). -This will only add -any particular path once (leaving the first one it encounters and -ignoring the rest, to preserve path order), -and to help assure this, -will normalize all paths (using +Prepend path elements specified by newpath +to the given search path string or list name +in mapping envname in the &consenv;. +Supplying envname is optional: +the default is the execution environment &cv-link-ENV;. +Optional sep is used as the search path separator, +the default is the platform's separator (os.pathsep). +A path element will only appear once. +Any duplicates in newpath are dropped, +keeping the first appearing (to preserve path order). +If delete_existing +is False +any addition duplicating an existing path element is ignored; +if delete_existing +is True (the default) the existing value will +be dropped and the path element will be inserted at the beginning. +To help maintain uniqueness all paths are normalized (using os.path.normpath and os.path.normcase). -This can also handle the -case where the given old path variable is a list instead of a -string, in which case a list will be returned instead of a string. - - - -If -delete_existing -is False, -then adding a path that already exists -will not move it to the beginning; -it will stay where it is in the list. @@ -3094,6 +3105,11 @@ print('after:', env['ENV']['INCLUDE']) before: /biz:/foo after: /foo/bar:/foo:/biz + + +See also &f-link-env-AppendENVPath;. + + @@ -3103,7 +3119,7 @@ Prepend values to &consvars; in the current &consenv;, maintaining uniqueness. Works like &f-link-env-Append; (see for details), except that values are added to the front, -rather than the end, of any existing value of the the &consvar;, +rather than the end, of any existing value of the &consvar;, and values already present in the &consvar; will not be added again. If delete_existing @@ -3461,40 +3477,36 @@ for a complete explanation of the arguments and behavior. SConscript(scripts, [exports, variant_dir, duplicate, must_exist]) env.SConscript(scripts, [exports, variant_dir, duplicate, must_exist]) - SConscript(dirs=subdirs, [name=script, exports, variant_dir, duplicate, must_exist]) - env.SConscript(dirs=subdirs, [name=script, exports, variant_dir, duplicate, must_exist]) + SConscript(dirs=subdirs, [name=scriptname, exports, variant_dir, duplicate, must_exist]) + env.SConscript(dirs=subdirs, [name=scriptname, exports, variant_dir, duplicate, must_exist]) -Execute one or more subsidiary SConscript (configuration) files. +Executes one or more subsidiary SConscript (configuration) files. There are two ways to call the &f-SConscript; function. -The first calling style -is to explicitly specify one or more -scripts -as the first argument. +The first calling style is to supply +one or more SConscript file names +as the first (positional) argument. A single script may be specified as a string; -multiple scripts must be specified as a list +multiple scripts must be specified as a list of strings (either explicitly or as created by a function like &f-link-Split;). Examples: -SConscript('SConscript') # run SConscript in the current directory +SConscript('SConscript') # run SConscript in the current directory SConscript('src/SConscript') # run SConscript in the src directory SConscript(['src/SConscript', 'doc/SConscript']) config = SConscript('MyConfig.py') -The second way to call -&f-SConscript; -is to specify a list of (sub)directory names -as a -dirs=subdirs -keyword argument. +The other calling style is to omit the positional argument naming +scripts and instead specify a list of directory names using the +dirs keyword argument. In this case, &scons; will @@ -3504,14 +3516,14 @@ in each of the specified directories. You may specify a name other than &SConscript; by supplying an optional -name=script +name=scriptname keyword argument. The first three examples below have the same effect as the first three examples above: -SConscript(dirs='.') # run SConscript in the current directory -SConscript(dirs='src') # run SConscript in the src directory +SConscript(dirs='.') # run SConscript in the current directory +SConscript(dirs='src') # run SConscript in the src directory SConscript(dirs=['src', 'doc']) SConscript(dirs=['sub1', 'sub2'], name='MySConscript') @@ -3519,8 +3531,12 @@ SConscript(dirs=['sub1', 'sub2'], name='MySConscript') The optional exports -argument provides a string or list of strings representing +keyword argument provides a string or list of strings representing variable names, or a dictionary of named values, to export. +For the first calling style only, a second positional argument +will be interpreted as exports; the +second calling style must use the keyword argument form +for exports. These variables are locally exported only to the called SConscript file(s) and do not affect the global pool of variables managed by the @@ -3544,38 +3560,24 @@ SConscript(dirs=['one', 'two', 'three'], exports='shared_info') If the optional variant_dir argument is present, it causes an effect equivalent to the -&f-link-VariantDir; function. +&f-link-VariantDir; function, +but in effect only within the scope of the &f-SConscript; call. The variant_dir -argument is interpreted relative to the directory of the calling -SConscript file. -The optional -duplicate argument is -interpreted as for &f-link-VariantDir;. -If variant_dir -is omitted, the duplicate argument is ignored. -See the description of -&f-link-VariantDir; -below for additional details and restrictions. - - - -If -variant_dir -is present, -the source directory is the directory in which the -SConscript -file resides and the -SConscript +argument is interpreted relative to the directory of the +calling SConscript file. +The source directory is the directory in which the +called SConscript +file resides and the SConscript file is evaluated as if it were in the variant_dir -directory: +directory. Thus: SConscript('src/SConscript', variant_dir='build') -is equivalent to +is equivalent to: @@ -3584,9 +3586,8 @@ SConscript('build/SConscript') -This later paradigm is often used when the sources are -in the same directory as the -&SConstruct;: +If the sources are in the same directory as the +&SConstruct;, @@ -3594,7 +3595,7 @@ SConscript('SConscript', variant_dir='build') -is equivalent to +is equivalent to: @@ -3602,6 +3603,17 @@ VariantDir('build', '.') SConscript('build/SConscript') + +The optional +duplicate argument is +interpreted as for &f-link-VariantDir;. +If the variant_dir argument +is omitted, the duplicate argument is ignored. +See the description of +&f-link-VariantDir; +for additional details and restrictions. + + $__LDMODULEVERSIONFLAGS"> -$__NINJA_NO"> $__SHLIBVERSIONFLAGS"> $APPLELINK_COMPATIBILITY_VERSION"> $_APPLELINK_COMPATIBILITY_VERSION"> @@ -38,6 +37,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $CC"> $CCCOM"> $CCCOMSTR"> +$CCDEPFLAGS"> $CCFLAGS"> $CCPCHFLAGS"> $CCPDBFLAGS"> @@ -320,7 +320,10 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $MSSDK_DIR"> $MSSDK_VERSION"> $MSVC_BATCH"> +$MSVC_NOTFOUND_POLICY"> $MSVC_USE_SCRIPT"> +$MSVC_USE_SCRIPT_ARGS"> +$MSVC_USE_SETTINGS"> $MSVC_UWP_APP"> $MSVC_VERSION"> $MSVS"> @@ -351,17 +354,22 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $MWCW_VERSIONS"> $NAME"> $NINJA_ALIAS_NAME"> +$NINJA_CMD_ARGS"> $NINJA_COMPDB_EXPAND"> +$NINJA_DEPFILE_PARSE_FORMAT"> $NINJA_DIR"> $NINJA_DISABLE_AUTO_RUN"> $NINJA_ENV_VAR_CACHE"> $NINJA_FILE_NAME"> $NINJA_FORCE_SCONS_BUILD"> +$NINJA_GENERATED_SOURCE_ALIAS_NAME"> $NINJA_GENERATED_SOURCE_SUFFIXES"> $NINJA_MSVC_DEPS_PREFIX"> $NINJA_POOL"> $NINJA_REGENERATE_DEPS"> $_NINJA_REGENERATE_DEPS_FUNC"> +$NINJA_SCONS_DAEMON_KEEP_ALIVE"> +$NINJA_SCONS_DAEMON_PORT"> $NINJA_SYNTAX"> $no_import_lib"> $OBJPREFIX"> @@ -480,6 +488,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $SHDLINKCOM"> $SHDLINKFLAGS"> $SHELL"> +$SHELL_ENV_GENERATORS"> $SHF03"> $SHF03COM"> $SHF03COMSTR"> @@ -664,7 +673,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. --> $__LDMODULEVERSIONFLAGS"> -$__NINJA_NO"> $__SHLIBVERSIONFLAGS"> $APPLELINK_COMPATIBILITY_VERSION"> $_APPLELINK_COMPATIBILITY_VERSION"> @@ -693,6 +701,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $CC"> $CCCOM"> $CCCOMSTR"> +$CCDEPFLAGS"> $CCFLAGS"> $CCPCHFLAGS"> $CCPDBFLAGS"> @@ -975,7 +984,10 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $MSSDK_DIR"> $MSSDK_VERSION"> $MSVC_BATCH"> +$MSVC_NOTFOUND_POLICY"> $MSVC_USE_SCRIPT"> +$MSVC_USE_SCRIPT_ARGS"> +$MSVC_USE_SETTINGS"> $MSVC_UWP_APP"> $MSVC_VERSION"> $MSVS"> @@ -1006,17 +1018,22 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $MWCW_VERSIONS"> $NAME"> $NINJA_ALIAS_NAME"> +$NINJA_CMD_ARGS"> $NINJA_COMPDB_EXPAND"> +$NINJA_DEPFILE_PARSE_FORMAT"> $NINJA_DIR"> $NINJA_DISABLE_AUTO_RUN"> $NINJA_ENV_VAR_CACHE"> $NINJA_FILE_NAME"> $NINJA_FORCE_SCONS_BUILD"> +$NINJA_GENERATED_SOURCE_ALIAS_NAME"> $NINJA_GENERATED_SOURCE_SUFFIXES"> $NINJA_MSVC_DEPS_PREFIX"> $NINJA_POOL"> $NINJA_REGENERATE_DEPS"> $_NINJA_REGENERATE_DEPS_FUNC"> +$NINJA_SCONS_DAEMON_KEEP_ALIVE"> +$NINJA_SCONS_DAEMON_PORT"> $NINJA_SYNTAX"> $no_import_lib"> $OBJPREFIX"> @@ -1135,6 +1152,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $SHDLINKCOM"> $SHDLINKFLAGS"> $SHELL"> +$SHELL_ENV_GENERATORS"> $SHF03"> $SHF03COM"> $SHF03COMSTR"> diff --git a/doc/man/scons.xml b/doc/man/scons.xml index a98f4e8771..4578d1ca61 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -5207,7 +5207,7 @@ the dependency graph related to their sources. An alias is checked for up to date by checking if its sources are up to date. An alias is built by making sure its sources have been built, -and if any building took place, +and if any building took place, applying any Actions that are defined as part of the alias. @@ -7470,7 +7470,7 @@ There are, however, a few portability issues waiting to trap the unwary. -.C file suffix +.C File Suffix &scons; handles the upper-case .C @@ -7490,50 +7490,125 @@ suffix as a C source file. -Fortran file suffixes +Fortran File Suffixes -&scons; handles upper-case -Fortran file suffixes differently -depending on the capabilities of -the underlying system. -On a case-sensitive system -such as Linux or UNIX, -&scons; treats a file with a -.F -as a Fortran source file -that is to be first run through -the standard C preprocessor, -while the lower-case version is not. -This matches the convention of gfortran, -which may also be followed by other Fortran compilers. -This also applies to other naming variants, + +There are several ways source file suffixes impact the +behavior of &SCons; when working with Fortran language code +(not all are system-specific, but they are included here +for completeness). + + + +As the Fortran language has evolved through multiple +standards editions, projects might have a need to handle +files from different language generations differently. +To this end, &SCons; dispatches to a different compiler +dialect setup (expressed as a set of &consvars;) +depending on the file suffix. +By default, all of these setups start out the same, +but individual &consvars; can be modified as needed to tune a given dialect. +Each of these dialacts has a tool specification module +whose documentation describes the &consvars; associated +with that dialect: .f +(as well as .for and .ftn) +in &t-link-fortran;; (&consvars; start with FORTRAN) +.f77 in &t-link-f77;; +(&consvars; start with F77) +.f90 in &t-link-f90;; +(&consvars; start with F90) +.f95 in &t-link-f95;; +(&consvars; start with F95) +.f03 in &t-link-f03;; +(&consvars; start with F03) +.f08 in &t-link-f08; +(&consvars; start with F08). + + + +While &SCons; recognizes multiple internal dialects +based on filename suffixes, +the convention of various available Fortran compilers is +to assign an actual meaning to only two of these suffixes: +.f +(as well as .for and .ftn) +refers to the fixed-format source +code that was the only available option in FORTRAN 77 and earlier, +and .f90 refers to free-format source code +which became available as of the Fortran 90 standard. +Some compilers recognize suffixes which correspond to Fortran +specifications later then F90 as equivalent to +.f90 for this purpose, +while some do not - check the documentation for your compiler. +An occasionally suggested policy suggestion is to use only +.f and .f90 +as Fortran filename suffixes. +The fixed/free form determination can usually be controlled +explicitly with compiler flags +(e.g. for gfortran), +overriding any assumption that may be made based on the source file suffix. + + + +The source file suffix does not imply conformance +with the similarly-named Fortran standard - a suffix of +.f08 does not mean you are compiling +specifically for Fortran 2008. Normally, compilers +provide command-line options for making this selection +(e.g. for gfortran). + + + +For dialects from F90 on (including the generic FORTRAN dialect), +a suffix of .mod is recognized for Fortran modules. +These files are a side effect of compiling a Fortran +source file containing module declarations, +and must be available when other code which declares +that it uses the module is processed. +&SCons; does not currently have integrated support for submodules, +introduced in the Fortran 2008 standard - +the invoked compiler will produce results, +but &SCons; will not recognize +.smod files as tracked objects. + + + +On a case-sensitive system such as Linux or UNIX, +a file with a an upper-cased suffix from the set +.F, .FOR, .FTN, .F90, .F95, .F03 and -.F08; -files suffixed with +.F08 +is treated as a Fortran source file +which shall first be run through +the standard C preprocessor. +The lower-cased versions of these suffixes do not +trigger this behavior. +On systems which do not distinguish between uppper +and lower case in filenames, +this behavior is not available, +but files suffixed with either .FPP -and .fpp -are both run through the preprocessor, -as indicated by the pp -part of the name. -On a case-insensitive system -such as Windows, -&scons; treats a file with a -.F -suffix as a Fortran source file that should -not -be run through the C preprocessor. +or .fpp +are always passed to the preprocessor first. +This matches the convention of gfortran +from the GNU Compiler Collection, +and also followed by certain other Fortran compilers. +For these two suffixes, +the generic FORTRAN dialect will be selected. + + -Run through the C preprocessor -here means that a different set of &consvars; will -be applied in constructed commands, for example +&SCons; itself does not invoke the preprocessor, +that is handled by the compiler, +but it adds &consvars; which are applicable to the preprocessor run. +You can see this difference by examining &cv-link-FORTRANPPCOM; and &cv-link-FORTRANPPCOMSTR; -instead of -&cv-link-FORTRANCOM; and &cv-link-FORTRANCOMSTR;. -See the Fortran-related &consvars; for more details. +which are used instead of +&cv-link-FORTRANCOM; and &cv-link-FORTRANCOMSTR; for that dialect. @@ -7542,10 +7617,10 @@ See the Fortran-related &consvars; for more details. Cygwin supplies a set of tools and utilities that let users work on a -Windows system using a more POSIX-like environment. -The Cygwin tools, including Cygwin Python, +Windows system using a POSIX-like environment. +The Cygwin tools, including Cygwin &Python;, do this, in part, -by sharing an ability to interpret UNIX-like path names. +by sharing an ability to interpret POSIX-style path names. For example, the Cygwin tools will internally translate a Cygwin path name like /cygdrive/c/mydir @@ -7553,11 +7628,11 @@ to an equivalent Windows pathname of C:/mydir (equivalent to C:\mydir). -Versions of Python +Versions of &Python; that are built for native Windows execution, such as the python.org and ActiveState versions, -do not have the Cygwin path name semantics. -This means that using a native Windows version of Python +do not understand the Cygwin path name semantics. +This means that using a native Windows version of &Python; to build compiled programs using Cygwin tools (such as &gcc;, &bison; and &flex;) may yield unpredictable results. @@ -7567,14 +7642,22 @@ but it requires careful attention to the use of path names in your SConscript files. In practice, users can sidestep -the issue by adopting the following rules: +the issue by adopting the following guidelines: When using Cygwin's &gcc; for compiling, -use the Cygwin-supplied Python interpreter +use the Cygwin-supplied &Python; interpreter to run &scons;; when using Microsoft Visual C/C++ -(or some other Windows compiler) -use the python.org or Microsoft Store or ActiveState version of Python -to run &scons;. +(or some other "native" Windows compiler) +use the python.org, Microsoft Store, ActiveState or other +native version of &Python; to run &scons;. + + + +This discussion largely applies to the msys2 environment +as well (with the use of the mingw compiler toolchain), +in particular the recommendation to use the msys2 version of +&Python; if running &scons; from inside an msys2 shell. + @@ -7584,7 +7667,7 @@ to run &scons;. scons.bat batch file, there are (at least) two ramifications. Note this is no longer the default - &scons; installed -via Python's pip installer +via &Python;''s pip installer will have an scons.exe which does not have these limitations: @@ -7624,7 +7707,7 @@ directory must be in your PATH environment variable or the ['ENV']['PATH'] &consvar; for &scons; to detect and use the MinGW tools. When running under the native Windows -Python interpreter, &scons; will prefer the MinGW tools over the Cygwin +Python; interpreter, &scons; will prefer the MinGW tools over the Cygwin tools, if they are both installed, regardless of the order of the bin directories in the PATH variable. If you have both MSVC and MinGW