summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2015-01-11 11:15:26 +0100
committerDirk Baechle <dl9obn@darc.de>2015-01-11 11:15:26 +0100
commitf32e4d09f7807c2139d342a26d4c622b98d34aaa (patch)
tree566ee0b709247c106d94312060d5c05c805ed7c2
parent3db712d8466b2798e303ce358aa049a9571d236e (diff)
parent83359b2e140ef89aae16a3d146cf851ac7a2ea17 (diff)
downloadscons-f32e4d09f7807c2139d342a26d4c622b98d34aaa.tar.gz
Merged in dirkbaechle/scons (pull request #193), new method rentry_exists_on_disk
-rw-r--r--doc/generated/tools.gen20
-rw-r--r--doc/generated/tools.mod6
-rw-r--r--doc/generated/variables.gen312
-rw-r--r--doc/generated/variables.mod36
-rw-r--r--src/CHANGES.txt12
-rw-r--r--src/engine/SCons/Platform/PlatformTests.py31
-rw-r--r--src/engine/SCons/Platform/__init__.py32
-rw-r--r--src/engine/SCons/Script/SConsOptions.py16
-rw-r--r--src/engine/SCons/Tool/FortranCommon.py16
-rw-r--r--src/engine/SCons/Tool/__init__.py17
-rw-r--r--src/engine/SCons/Tool/f08.py63
-rw-r--r--src/engine/SCons/Tool/f08.xml311
-rw-r--r--src/engine/SCons/Tool/gfortran.py2
-rw-r--r--src/engine/SCons/Tool/install.py24
-rw-r--r--src/engine/SCons/Tool/jar.py2
-rw-r--r--src/engine/SCons/Tool/javac.py2
-rw-r--r--src/engine/SCons/Tool/ldc.py5
-rw-r--r--src/engine/SCons/Tool/link.py34
-rw-r--r--src/engine/SCons/Tool/mslib.py2
-rw-r--r--src/engine/SCons/Tool/mslink.py6
-rw-r--r--src/engine/SCons/Tool/msvc.py8
-rw-r--r--src/engine/SCons/Tool/msvs.py16
-rw-r--r--src/engine/SCons/Tool/msvsTests.py79
-rw-r--r--test/D/DMD2.py1
-rw-r--r--test/D/DMD2_Alt.py1
-rw-r--r--test/D/HSTeoh/ArLibIssue/SConstruct_template3
-rw-r--r--test/D/HSTeoh/Common/linkingProblem.py5
-rw-r--r--test/D/HSTeoh/Common/singleStringCannotBeMultipleOptions.py4
-rw-r--r--test/D/HSTeoh/LibCompileOptions/SConstruct_template3
-rw-r--r--test/D/HSTeoh/LinkingProblem/SConstruct_template2
-rw-r--r--test/D/Issues/2939_Ariovistus/Project/SConstruct_template3
-rw-r--r--test/D/Issues/2940_Ariovistus/Project/SConstruct_template3
-rw-r--r--test/D/MixedDAndC/Common/common.py4
-rw-r--r--test/D/SharedObjects/Common/common.py3
-rw-r--r--test/D/SharedObjects/Image/SConstruct_template2
-rw-r--r--test/Fortran/F08.py151
-rw-r--r--test/Fortran/F08COM.py98
-rw-r--r--test/Fortran/F08COMSTR.py78
-rw-r--r--test/Fortran/F08FILESUFFIXES.py101
-rw-r--r--test/Fortran/F08FILESUFFIXES2.py91
-rw-r--r--test/Fortran/F08FLAGS.py158
-rw-r--r--test/Fortran/SHF08.py144
-rw-r--r--test/Interactive/configure.py55
43 files changed, 1856 insertions, 106 deletions
diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen
index 539c5e60..aea2aa62 100644
--- a/doc/generated/tools.gen
+++ b/doc/generated/tools.gen
@@ -307,6 +307,14 @@ Set construction variables for generic POSIX Fortran 03 compilers.
</para>
<para>Sets: &cv-link-F03;, &cv-link-F03COM;, &cv-link-F03FLAGS;, &cv-link-F03PPCOM;, &cv-link-SHF03;, &cv-link-SHF03COM;, &cv-link-SHF03FLAGS;, &cv-link-SHF03PPCOM;, &cv-link-_F03INCFLAGS;.</para><para>Uses: &cv-link-F03COMSTR;, &cv-link-F03PPCOMSTR;, &cv-link-SHF03COMSTR;, &cv-link-SHF03PPCOMSTR;.</para></listitem>
</varlistentry>
+ <varlistentry id="t-f08">
+ <term>f08</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+Set construction variables for generic POSIX Fortran 08 compilers.
+</para>
+<para>Sets: &cv-link-F08;, &cv-link-F08COM;, &cv-link-F08FLAGS;, &cv-link-F08PPCOM;, &cv-link-SHF08;, &cv-link-SHF08COM;, &cv-link-SHF08FLAGS;, &cv-link-SHF08PPCOM;, &cv-link-_F08INCFLAGS;.</para><para>Uses: &cv-link-F08COMSTR;, &cv-link-F08PPCOMSTR;, &cv-link-SHF08COMSTR;, &cv-link-SHF08PPCOMSTR;.</para></listitem>
+ </varlistentry>
<varlistentry id="t-f77">
<term>f77</term>
<listitem>
@@ -767,19 +775,19 @@ Sets construction variables for the
</para>
<para>Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.</para><para>Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;.</para></listitem>
</varlistentry>
- <varlistentry id="t-Packaging">
- <term>Packaging</term>
+ <varlistentry id="t-packaging">
+ <term>packaging</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Sets construction variables for the <function xmlns="http://www.scons.org/dbxsd/v1.0">Package</function> Builder.
+A framework for building binary and source packages.
</para>
</listitem>
</varlistentry>
- <varlistentry id="t-packaging">
- <term>packaging</term>
+ <varlistentry id="t-Packaging">
+ <term>Packaging</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-A framework for building binary and source packages.
+Sets construction variables for the <function xmlns="http://www.scons.org/dbxsd/v1.0">Package</function> Builder.
</para>
</listitem>
</varlistentry>
diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod
index 13072bf6..5a5795ad 100644
--- a/doc/generated/tools.mod
+++ b/doc/generated/tools.mod
@@ -29,6 +29,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-dvipdf "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>dvipdf</literal>">
<!ENTITY t-dvips "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>dvips</literal>">
<!ENTITY t-f03 "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>f03</literal>">
+<!ENTITY t-f08 "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>f08</literal>">
<!ENTITY t-f77 "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>f77</literal>">
<!ENTITY t-f90 "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>f90</literal>">
<!ENTITY t-f95 "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>f95</literal>">
@@ -76,8 +77,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-mwcc "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>mwcc</literal>">
<!ENTITY t-mwld "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>mwld</literal>">
<!ENTITY t-nasm "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>nasm</literal>">
-<!ENTITY t-Packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>Packaging</literal>">
<!ENTITY t-packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>packaging</literal>">
+<!ENTITY t-Packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>Packaging</literal>">
<!ENTITY t-pdf "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdf</literal>">
<!ENTITY t-pdflatex "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdflatex</literal>">
<!ENTITY t-pdftex "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdftex</literal>">
@@ -138,6 +139,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-link-dvipdf "<link linkend='t-dvipdf' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>dvipdf</literal></link>">
<!ENTITY t-link-dvips "<link linkend='t-dvips' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>dvips</literal></link>">
<!ENTITY t-link-f03 "<link linkend='t-f03' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>f03</literal></link>">
+<!ENTITY t-link-f08 "<link linkend='t-f08' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>f08</literal></link>">
<!ENTITY t-link-f77 "<link linkend='t-f77' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>f77</literal></link>">
<!ENTITY t-link-f90 "<link linkend='t-f90' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>f90</literal></link>">
<!ENTITY t-link-f95 "<link linkend='t-f95' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>f95</literal></link>">
@@ -185,8 +187,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-link-mwcc "<link linkend='t-mwcc' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>mwcc</literal></link>">
<!ENTITY t-link-mwld "<link linkend='t-mwld' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>mwld</literal></link>">
<!ENTITY t-link-nasm "<link linkend='t-nasm' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>nasm</literal></link>">
-<!ENTITY t-link-Packaging "<link linkend='t-Packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>Packaging</literal></link>">
<!ENTITY t-link-packaging "<link linkend='t-packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>packaging</literal></link>">
+<!ENTITY t-link-Packaging "<link linkend='t-Packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>Packaging</literal></link>">
<!ENTITY t-link-pdf "<link linkend='t-pdf' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdf</literal></link>">
<!ENTITY t-link-pdflatex "<link linkend='t-pdflatex' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdflatex</literal></link>">
<!ENTITY t-link-pdftex "<link linkend='t-pdftex' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdftex</literal></link>">
diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen
index 34b90177..d0077582 100644
--- a/doc/generated/variables.gen
+++ b/doc/generated/variables.gen
@@ -950,19 +950,19 @@ DFLAGPREFIX.
</para>
</listitem>
</varlistentry>
- <varlistentry id="cv-_DFLAGS">
- <term>_DFLAGS</term>
+ <varlistentry id="cv-DFLAGS">
+ <term>DFLAGS</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-_DFLAGS.
+DFLAGS.
</para>
</listitem>
</varlistentry>
- <varlistentry id="cv-DFLAGS">
- <term>DFLAGS</term>
+ <varlistentry id="cv-_DFLAGS">
+ <term>_DFLAGS</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-DFLAGS.
+_DFLAGS.
</para>
</listitem>
</varlistentry>
@@ -1686,6 +1686,184 @@ F03 dialect will be used. By default, this is empty
</para>
</listitem>
</varlistentry>
+ <varlistentry id="cv-F08">
+ <term>F08</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The Fortran 08 compiler.
+You should normally set the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-FORTRAN"><envar>$FORTRAN</envar></link> variable,
+which specifies the default Fortran compiler
+for all Fortran versions.
+You only need to set <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08"><envar>$F08</envar></link> if you need to use a specific compiler
+or compiler version for Fortran 08 files.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-F08COM">
+ <term>F08COM</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The command line used to compile a Fortran 08 source file to an object file.
+You only need to set <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08COM"><envar>$F08COM</envar></link> if you need to use a specific
+command line for Fortran 08 files.
+You should normally set the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-FORTRANCOM"><envar>$FORTRANCOM</envar></link> variable,
+which specifies the default command line
+for all Fortran versions.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-F08COMSTR">
+ <term>F08COMSTR</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The string displayed when a Fortran 08 source file
+is compiled to an object file.
+If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08COM"><envar>$F08COM</envar></link> or <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-FORTRANCOM"><envar>$FORTRANCOM</envar></link>
+(the command line) is displayed.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-F08FILESUFFIXES">
+ <term>F08FILESUFFIXES</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The list of file extensions for which the F08 dialect will be used. By
+default, this is ['.f08']
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-F08FLAGS">
+ <term>F08FLAGS</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+General user-specified options that are passed to the Fortran 08 compiler.
+Note that this variable does
+<emphasis>not</emphasis>
+contain
+<option>-I</option>
+(or similar) include search path options
+that scons generates automatically from <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08PATH"><envar>$F08PATH</envar></link>.
+See
+<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-_F08INCFLAGS"><envar>$_F08INCFLAGS</envar></link>
+below,
+for the variable that expands to those options.
+You only need to set <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08FLAGS"><envar>$F08FLAGS</envar></link> if you need to define specific
+user options for Fortran 08 files.
+You should normally set the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-FORTRANFLAGS"><envar>$FORTRANFLAGS</envar></link> variable,
+which specifies the user-specified options
+passed to the default Fortran compiler
+for all Fortran versions.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-_F08INCFLAGS">
+ <term>_F08INCFLAGS</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+An automatically-generated construction variable
+containing the Fortran 08 compiler command-line options
+for specifying directories to be searched for include files.
+The value of <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-_F08INCFLAGS"><envar>$_F08INCFLAGS</envar></link> is created
+by appending <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-INCPREFIX"><envar>$INCPREFIX</envar></link> and <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-INCSUFFIX"><envar>$INCSUFFIX</envar></link>
+to the beginning and end
+of each directory in <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08PATH"><envar>$F08PATH</envar></link>.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-F08PATH">
+ <term>F08PATH</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The list of directories that the Fortran 08 compiler will search for include
+directories. The implicit dependency scanner will search these
+directories for include files. Don't explicitly put include directory
+arguments in <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08FLAGS"><envar>$F08FLAGS</envar></link> because the result will be non-portable
+and the directories will not be searched by the dependency scanner. Note:
+directory names in <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08PATH"><envar>$F08PATH</envar></link> will be looked-up relative to the SConscript
+directory when they are used in a command. To force
+<filename xmlns="http://www.scons.org/dbxsd/v1.0">scons</filename>
+to look-up a directory relative to the root of the source tree use #:
+You only need to set <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08PATH"><envar>$F08PATH</envar></link> if you need to define a specific
+include path for Fortran 08 files.
+You should normally set the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-FORTRANPATH"><envar>$FORTRANPATH</envar></link> variable,
+which specifies the include path
+for the default Fortran compiler
+for all Fortran versions.
+</para>
+
+<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
+env = Environment(F08PATH='#/include')
+</example_commands>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The directory look-up can also be forced using the
+<function xmlns="http://www.scons.org/dbxsd/v1.0">Dir</function>()
+function:
+</para>
+
+<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
+include = Dir('include')
+env = Environment(F08PATH=include)
+</example_commands>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The directory list will be added to command lines
+through the automatically-generated
+<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-_F08INCFLAGS"><envar>$_F08INCFLAGS</envar></link>
+construction variable,
+which is constructed by
+appending the values of the
+<link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-INCPREFIX"><envar>$INCPREFIX</envar></link> and <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-INCSUFFIX"><envar>$INCSUFFIX</envar></link>
+construction variables
+to the beginning and end
+of each directory in <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08PATH"><envar>$F08PATH</envar></link>.
+Any command lines you define that need
+the F08PATH directory list should
+include <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-_F08INCFLAGS"><envar>$_F08INCFLAGS</envar></link>:
+</para>
+
+<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
+env = Environment(F08COM="my_compiler $_F08INCFLAGS -c -o $TARGET $SOURCE")
+</example_commands>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-F08PPCOM">
+ <term>F08PPCOM</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The command line used to compile a Fortran 08 source file to an object file
+after first running the file through the C preprocessor.
+Any options specified in the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08FLAGS"><envar>$F08FLAGS</envar></link> and <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-CPPFLAGS"><envar>$CPPFLAGS</envar></link> construction variables
+are included on this command line.
+You only need to set <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08PPCOM"><envar>$F08PPCOM</envar></link> if you need to use a specific
+C-preprocessor command line for Fortran 08 files.
+You should normally set the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-FORTRANPPCOM"><envar>$FORTRANPPCOM</envar></link> variable,
+which specifies the default C-preprocessor command line
+for all Fortran versions.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-F08PPCOMSTR">
+ <term>F08PPCOMSTR</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The string displayed when a Fortran 08 source file
+is compiled to an object file
+after first running the file through the C preprocessor.
+If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-F08PPCOM"><envar>$F08PPCOM</envar></link> or <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-FORTRANPPCOM"><envar>$FORTRANPPCOM</envar></link>
+(the command line) is displayed.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-F08PPFILESUFFIXES">
+ <term>F08PPFILESUFFIXES</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The list of file extensions for which the compilation + preprocessor pass for
+F08 dialect will be used. By default, this is empty
+</para>
+</listitem>
+ </varlistentry>
<varlistentry id="cv-F77">
<term>F77</term>
<listitem>
@@ -2642,15 +2820,6 @@ is <quote><literal>-dNOPAUSE -dBATCH -sDEVICE=pdfwrite</literal></quote>
<term>HOST_ARCH</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
- The name of the host hardware architecture used to create the Environment.
- If a platform is specified when creating the Environment, then
- that Platform's logic will handle setting this value.
- This value is immutable, and should not be changed by the user after
- the Environment is initialized.
- Currently only set for Win32.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
Sets the host architecture for Visual Studio compiler. If not set,
default to the detected host architecture: note that this may depend
on the python you are using.
@@ -2666,7 +2835,16 @@ Valid values are the same as for <envar xmlns="http://www.scons.org/dbxsd/v1.0">
This is currently only used on Windows, but in the future it will be
used on other OSes as well.
</para>
-</listitem>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The name of the host hardware architecture used to create the Environment.
+ If a platform is specified when creating the Environment, then
+ that Platform's logic will handle setting this value.
+ This value is immutable, and should not be changed by the user after
+ the Environment is initialized.
+ Currently only set for Win32.
+</para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-HOST_OS">
<term>HOST_OS</term>
@@ -2862,7 +3040,7 @@ The command line used to call the Java archive tool.
<para xmlns="http://www.scons.org/dbxsd/v1.0">
The string displayed when the Java archive tool
is called
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-JARCOM"><envar>$JARCOM</envar></link> (the command line) is displayed.
+If this is not set, then <envar xmlns="http://www.scons.org/dbxsd/v1.0">$JARCOM</envar> (the command line) is displayed.
</para>
<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
@@ -2872,7 +3050,7 @@ env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET")
<para xmlns="http://www.scons.org/dbxsd/v1.0">
The string displayed when the Java archive tool
is called
-If this is not set, then <envar xmlns="http://www.scons.org/dbxsd/v1.0">$JARCOM</envar> (the command line) is displayed.
+If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-JARCOM"><envar>$JARCOM</envar></link> (the command line) is displayed.
</para>
<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
@@ -5915,6 +6093,88 @@ If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="
</para>
</listitem>
</varlistentry>
+ <varlistentry id="cv-SHF08">
+ <term>SHF08</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The Fortran 08 compiler used for generating shared-library objects.
+You should normally set the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHFORTRAN"><envar>$SHFORTRAN</envar></link> variable,
+which specifies the default Fortran compiler
+for all Fortran versions.
+You only need to set <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHF08"><envar>$SHF08</envar></link> if you need to use a specific compiler
+or compiler version for Fortran 08 files.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-SHF08COM">
+ <term>SHF08COM</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The command line used to compile a Fortran 08 source file
+to a shared-library object file.
+You only need to set <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHF08COM"><envar>$SHF08COM</envar></link> if you need to use a specific
+command line for Fortran 08 files.
+You should normally set the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHFORTRANCOM"><envar>$SHFORTRANCOM</envar></link> variable,
+which specifies the default command line
+for all Fortran versions.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-SHF08COMSTR">
+ <term>SHF08COMSTR</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The string displayed when a Fortran 08 source file
+is compiled to a shared-library object file.
+If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHF08COM"><envar>$SHF08COM</envar></link> or <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHFORTRANCOM"><envar>$SHFORTRANCOM</envar></link>
+(the command line) is displayed.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-SHF08FLAGS">
+ <term>SHF08FLAGS</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+Options that are passed to the Fortran 08 compiler
+to generated shared-library objects.
+You only need to set <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHF08FLAGS"><envar>$SHF08FLAGS</envar></link> if you need to define specific
+user options for Fortran 08 files.
+You should normally set the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHFORTRANFLAGS"><envar>$SHFORTRANFLAGS</envar></link> variable,
+which specifies the user-specified options
+passed to the default Fortran compiler
+for all Fortran versions.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-SHF08PPCOM">
+ <term>SHF08PPCOM</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The command line used to compile a Fortran 08 source file to a
+shared-library object file
+after first running the file through the C preprocessor.
+Any options specified in the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHF08FLAGS"><envar>$SHF08FLAGS</envar></link> and <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-CPPFLAGS"><envar>$CPPFLAGS</envar></link> construction variables
+are included on this command line.
+You only need to set <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHF08PPCOM"><envar>$SHF08PPCOM</envar></link> if you need to use a specific
+C-preprocessor command line for Fortran 08 files.
+You should normally set the <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHFORTRANPPCOM"><envar>$SHFORTRANPPCOM</envar></link> variable,
+which specifies the default C-preprocessor command line
+for all Fortran versions.
+</para>
+</listitem>
+ </varlistentry>
+ <varlistentry id="cv-SHF08PPCOMSTR">
+ <term>SHF08PPCOMSTR</term>
+ <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+The string displayed when a Fortran 08 source file
+is compiled to a shared-library object file
+after first running the file through the C preprocessor.
+If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHF08PPCOM"><envar>$SHF08PPCOM</envar></link> or <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-SHFORTRANPPCOM"><envar>$SHFORTRANPPCOM</envar></link>
+(the command line) is displayed.
+</para>
+</listitem>
+ </varlistentry>
<varlistentry id="cv-SHF77">
<term>SHF77</term>
<listitem>
@@ -6713,13 +6973,6 @@ that may not be set or used in a construction environment.
<term>TARGET_ARCH</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
- The name of the target hardware architecture for the compiled objects
- created by this Environment.
- This defaults to the value of HOST_ARCH, and the user can override it.
- Currently only set for Win32.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
Sets the target architecture for Visual Studio compiler (i.e. the arch
of the binaries generated by the compiler). If not set, default to
<envar xmlns="http://www.scons.org/dbxsd/v1.0">$HOST_ARCH</envar>, or, if that is unset, to the architecture of the
@@ -6744,7 +6997,14 @@ and <literal>ia64</literal> (Itanium).
For example, if you want to compile 64-bit binaries, you would set
<literal>TARGET_ARCH='x86_64'</literal> in your SCons environment.
</para>
-</listitem>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The name of the target hardware architecture for the compiled objects
+ created by this Environment.
+ This defaults to the value of HOST_ARCH, and the user can override it.
+ Currently only set for Win32.
+</para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-TARGET_OS">
<term>TARGET_OS</term>
diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod
index 473c8a26..3f254a59 100644
--- a/doc/generated/variables.mod
+++ b/doc/generated/variables.mod
@@ -76,8 +76,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-DESCRIPTION_lang "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DESCRIPTION_lang</envar>">
<!ENTITY cv-DFILESUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DFILESUFFIX</envar>">
<!ENTITY cv-DFLAGPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DFLAGPREFIX</envar>">
-<!ENTITY cv-_DFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_DFLAGS</envar>">
<!ENTITY cv-DFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DFLAGS</envar>">
+<!ENTITY cv-_DFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_DFLAGS</envar>">
<!ENTITY cv-DFLAGSUFFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DFLAGSUFFIX</envar>">
<!ENTITY cv-_DINCFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_DINCFLAGS</envar>">
<!ENTITY cv-DINCPREFIX "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$DINCPREFIX</envar>">
@@ -144,6 +144,16 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-F03PPCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F03PPCOM</envar>">
<!ENTITY cv-F03PPCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F03PPCOMSTR</envar>">
<!ENTITY cv-F03PPFILESUFFIXES "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F03PPFILESUFFIXES</envar>">
+<!ENTITY cv-F08 "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F08</envar>">
+<!ENTITY cv-F08COM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F08COM</envar>">
+<!ENTITY cv-F08COMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F08COMSTR</envar>">
+<!ENTITY cv-F08FILESUFFIXES "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F08FILESUFFIXES</envar>">
+<!ENTITY cv-F08FLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F08FLAGS</envar>">
+<!ENTITY cv-_F08INCFLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$_F08INCFLAGS</envar>">
+<!ENTITY cv-F08PATH "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F08PATH</envar>">
+<!ENTITY cv-F08PPCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F08PPCOM</envar>">
+<!ENTITY cv-F08PPCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F08PPCOMSTR</envar>">
+<!ENTITY cv-F08PPFILESUFFIXES "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F08PPFILESUFFIXES</envar>">
<!ENTITY cv-F77 "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F77</envar>">
<!ENTITY cv-F77COM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F77COM</envar>">
<!ENTITY cv-F77COMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$F77COMSTR</envar>">
@@ -464,6 +474,12 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-SHF03FLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF03FLAGS</envar>">
<!ENTITY cv-SHF03PPCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF03PPCOM</envar>">
<!ENTITY cv-SHF03PPCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF03PPCOMSTR</envar>">
+<!ENTITY cv-SHF08 "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF08</envar>">
+<!ENTITY cv-SHF08COM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF08COM</envar>">
+<!ENTITY cv-SHF08COMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF08COMSTR</envar>">
+<!ENTITY cv-SHF08FLAGS "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF08FLAGS</envar>">
+<!ENTITY cv-SHF08PPCOM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF08PPCOM</envar>">
+<!ENTITY cv-SHF08PPCOMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF08PPCOMSTR</envar>">
<!ENTITY cv-SHF77 "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF77</envar>">
<!ENTITY cv-SHF77COM "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF77COM</envar>">
<!ENTITY cv-SHF77COMSTR "<envar xmlns='http://www.scons.org/dbxsd/v1.0'>$SHF77COMSTR</envar>">
@@ -698,8 +714,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-DESCRIPTION_lang "<link linkend='cv-DESCRIPTION_lang' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DESCRIPTION_lang</envar></link>">
<!ENTITY cv-link-DFILESUFFIX "<link linkend='cv-DFILESUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DFILESUFFIX</envar></link>">
<!ENTITY cv-link-DFLAGPREFIX "<link linkend='cv-DFLAGPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DFLAGPREFIX</envar></link>">
-<!ENTITY cv-link-_DFLAGS "<link linkend='cv-_DFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_DFLAGS</envar></link>">
<!ENTITY cv-link-DFLAGS "<link linkend='cv-DFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DFLAGS</envar></link>">
+<!ENTITY cv-link-_DFLAGS "<link linkend='cv-_DFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_DFLAGS</envar></link>">
<!ENTITY cv-link-DFLAGSUFFIX "<link linkend='cv-DFLAGSUFFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DFLAGSUFFIX</envar></link>">
<!ENTITY cv-link-_DINCFLAGS "<link linkend='cv-_DINCFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_DINCFLAGS</envar></link>">
<!ENTITY cv-link-DINCPREFIX "<link linkend='cv-DINCPREFIX' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$DINCPREFIX</envar></link>">
@@ -766,6 +782,16 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-F03PPCOM "<link linkend='cv-F03PPCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F03PPCOM</envar></link>">
<!ENTITY cv-link-F03PPCOMSTR "<link linkend='cv-F03PPCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F03PPCOMSTR</envar></link>">
<!ENTITY cv-link-F03PPFILESUFFIXES "<link linkend='cv-F03PPFILESUFFIXES' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F03PPFILESUFFIXES</envar></link>">
+<!ENTITY cv-link-F08 "<link linkend='cv-F08' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F08</envar></link>">
+<!ENTITY cv-link-F08COM "<link linkend='cv-F08COM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F08COM</envar></link>">
+<!ENTITY cv-link-F08COMSTR "<link linkend='cv-F08COMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F08COMSTR</envar></link>">
+<!ENTITY cv-link-F08FILESUFFIXES "<link linkend='cv-F08FILESUFFIXES' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F08FILESUFFIXES</envar></link>">
+<!ENTITY cv-link-F08FLAGS "<link linkend='cv-F08FLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F08FLAGS</envar></link>">
+<!ENTITY cv-link-_F08INCFLAGS "<link linkend='cv-_F08INCFLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$_F08INCFLAGS</envar></link>">
+<!ENTITY cv-link-F08PATH "<link linkend='cv-F08PATH' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F08PATH</envar></link>">
+<!ENTITY cv-link-F08PPCOM "<link linkend='cv-F08PPCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F08PPCOM</envar></link>">
+<!ENTITY cv-link-F08PPCOMSTR "<link linkend='cv-F08PPCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F08PPCOMSTR</envar></link>">
+<!ENTITY cv-link-F08PPFILESUFFIXES "<link linkend='cv-F08PPFILESUFFIXES' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F08PPFILESUFFIXES</envar></link>">
<!ENTITY cv-link-F77 "<link linkend='cv-F77' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F77</envar></link>">
<!ENTITY cv-link-F77COM "<link linkend='cv-F77COM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F77COM</envar></link>">
<!ENTITY cv-link-F77COMSTR "<link linkend='cv-F77COMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$F77COMSTR</envar></link>">
@@ -1086,6 +1112,12 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY cv-link-SHF03FLAGS "<link linkend='cv-SHF03FLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF03FLAGS</envar></link>">
<!ENTITY cv-link-SHF03PPCOM "<link linkend='cv-SHF03PPCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF03PPCOM</envar></link>">
<!ENTITY cv-link-SHF03PPCOMSTR "<link linkend='cv-SHF03PPCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF03PPCOMSTR</envar></link>">
+<!ENTITY cv-link-SHF08 "<link linkend='cv-SHF08' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF08</envar></link>">
+<!ENTITY cv-link-SHF08COM "<link linkend='cv-SHF08COM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF08COM</envar></link>">
+<!ENTITY cv-link-SHF08COMSTR "<link linkend='cv-SHF08COMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF08COMSTR</envar></link>">
+<!ENTITY cv-link-SHF08FLAGS "<link linkend='cv-SHF08FLAGS' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF08FLAGS</envar></link>">
+<!ENTITY cv-link-SHF08PPCOM "<link linkend='cv-SHF08PPCOM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF08PPCOM</envar></link>">
+<!ENTITY cv-link-SHF08PPCOMSTR "<link linkend='cv-SHF08PPCOMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF08PPCOMSTR</envar></link>">
<!ENTITY cv-link-SHF77 "<link linkend='cv-SHF77' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF77</envar></link>">
<!ENTITY cv-link-SHF77COM "<link linkend='cv-SHF77COM' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF77COM</envar></link>">
<!ENTITY cv-link-SHF77COMSTR "<link linkend='cv-SHF77COMSTR' xmlns='http://www.scons.org/dbxsd/v1.0'><envar>$SHF77COMSTR</envar></link>">
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 1372baf8..55b48a55 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -6,6 +6,18 @@
RELEASE VERSION/DATE TO BE FILLED IN LATER
+ From Russel Winder:
+ - Add support for f08 file extensions for Fortran 2008 code.
+
+ From Anatoly Techtonik:
+ - Show --config choices if no argument is specified (PR #202).
+
+ From Alexandre Feblot:
+ - Fix for VersionedSharedLibrary under 'sunos' platform.
+
+ From Laurent Marchelli:
+ - Support for multiple cmdargs (one per variant) in VS project files.
+
From Dan Pidcock:
- Added support for the 'PlatformToolset' tag in VS project files (#2978).
diff --git a/src/engine/SCons/Platform/PlatformTests.py b/src/engine/SCons/Platform/PlatformTests.py
index ca3080e0..38ea55a3 100644
--- a/src/engine/SCons/Platform/PlatformTests.py
+++ b/src/engine/SCons/Platform/PlatformTests.py
@@ -156,6 +156,37 @@ class TempFileMungeTestCase(unittest.TestCase):
SCons.Action.print_actions = old_actions
assert cmd != defined_cmd, cmd
+ def test_tempfilecreation_once(self):
+ # Init class with cmd, such that the fully expanded
+ # string reads "a test command line".
+ # Note, how we're using a command string here that is
+ # actually longer than the substituted one. This is to ensure
+ # that the TempFileMunge class internally really takes the
+ # length of the expanded string into account.
+ defined_cmd = "a $VERY $OVERSIMPLIFIED line"
+ t = SCons.Platform.TempFileMunge(defined_cmd)
+ env = SCons.Environment.SubstitutionEnvironment(tools=[])
+ # Setting the line length high enough...
+ env['VERY'] = 'test'
+ env['OVERSIMPLIFIED'] = 'command'
+ expanded_cmd = env.subst(defined_cmd)
+ env['MAXLINELENGTH'] = len(expanded_cmd)-1
+ # Disable printing of actions...
+ old_actions = SCons.Action.print_actions
+ SCons.Action.print_actions = 0
+ # Create an instance of object derived class to allow setattrb
+ class Node(object) :
+ class Attrs(object):
+ pass
+ def __init__(self):
+ self.attributes = self.Attrs()
+ target = [Node()]
+ cmd = t(target, None, env, 0)
+ # ...and restoring its setting.
+ SCons.Action.print_actions = old_actions
+ assert cmd != defined_cmd, cmd
+ assert cmd == getattr(target[0].attributes, 'tempfile_cmdlist', None)
+
if __name__ == "__main__":
suite = unittest.TestSuite()
diff --git a/src/engine/SCons/Platform/__init__.py b/src/engine/SCons/Platform/__init__.py
index fa6df61c..653f7224 100644
--- a/src/engine/SCons/Platform/__init__.py
+++ b/src/engine/SCons/Platform/__init__.py
@@ -139,7 +139,7 @@ class TempFileMunge(object):
Example usage:
env["TEMPFILE"] = TempFileMunge
- env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES')}"
+ env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}"
By default, the name of the temporary file used begins with a
prefix of '@'. This may be configred for other tool chains by
@@ -148,8 +148,9 @@ class TempFileMunge(object):
env["TEMPFILEPREFIX"] = '-@' # diab compiler
env["TEMPFILEPREFIX"] = '-via' # arm tool chain
"""
- def __init__(self, cmd):
+ def __init__(self, cmd, cmdstr = None):
self.cmd = cmd
+ self.cmdstr = cmdstr
def __call__(self, target, source, env, for_signature):
if for_signature:
@@ -177,6 +178,14 @@ class TempFileMunge(object):
if length <= maxline:
return self.cmd
+ # Check if we already created the temporary file for this target
+ # It should have been previously done by Action.strfunction() call
+ node = target[0] if SCons.Util.is_List(target) else target
+ cmdlist = getattr(node.attributes, 'tempfile_cmdlist', None) \
+ if node is not None else None
+ if cmdlist is not None :
+ return cmdlist
+
# We do a normpath because mktemp() has what appears to be
# a bug in Windows that will use a forward slash as a path
# delimiter. Windows's link mistakes that for a command line
@@ -224,9 +233,22 @@ class TempFileMunge(object):
# purity get in the way of just being helpful, so we'll
# reach into SCons.Action directly.
if SCons.Action.print_actions:
- print("Using tempfile "+native_tmp+" for command line:\n"+
- str(cmd[0]) + " " + " ".join(args))
- return [ cmd[0], prefix + native_tmp + '\n' + rm, native_tmp ]
+ cmdstr = env.subst(self.cmdstr, SCons.Subst.SUBST_RAW, target,
+ source) if self.cmdstr is not None else ''
+ # Print our message only if XXXCOMSTR returns an empty string
+ if len(cmdstr) == 0 :
+ print("Using tempfile "+native_tmp+" for command line:\n"+
+ str(cmd[0]) + " " + " ".join(args))
+
+ # Store the temporary file command list into the target Node.attributes
+ # to avoid creating two temporary files one for print and one for execute.
+ cmdlist = [ cmd[0], prefix + native_tmp + '\n' + rm, native_tmp ]
+ if node is not None:
+ try :
+ setattr(node.attributes, 'tempfile_cmdlist', cmdlist)
+ except AttributeError:
+ pass
+ return cmdlist
def Platform(name = platform_default()):
"""Select a canned Platform specification.
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py
index d7262a9d..8ecc093e 100644
--- a/src/engine/SCons/Script/SConsOptions.py
+++ b/src/engine/SCons/Script/SConsOptions.py
@@ -319,7 +319,13 @@ class SConsOptionParser(optparse.OptionParser):
value = option.const
elif len(rargs) < nargs:
if nargs == 1:
- self.error(_("%s option requires an argument") % opt)
+ if not option.choices:
+ self.error(_("%s option requires an argument") % opt)
+ else:
+ msg = _("%s option requires an argument " % opt)
+ msg += _("(choose from %s)"
+ % ', '.join(option.choices))
+ self.error(msg)
else:
self.error(_("%s option requires %d arguments")
% (opt, nargs))
@@ -645,18 +651,12 @@ def Parser(version):
config_options = ["auto", "force" ,"cache"]
- def opt_config(option, opt, value, parser, c_options=config_options):
- if not value in c_options:
- raise OptionValueError(opt_invalid('config', value, c_options))
- setattr(parser.values, option.dest, value)
-
opt_config_help = "Controls Configure subsystem: %s." \
% ", ".join(config_options)
op.add_option('--config',
- nargs=1, type="string",
+ nargs=1, choices=config_options,
dest="config", default="auto",
- action="callback", callback=opt_config,
help = opt_config_help,
metavar="MODE")
diff --git a/src/engine/SCons/Tool/FortranCommon.py b/src/engine/SCons/Tool/FortranCommon.py
index 4c5730cf..2df2a323 100644
--- a/src/engine/SCons/Tool/FortranCommon.py
+++ b/src/engine/SCons/Tool/FortranCommon.py
@@ -247,6 +247,21 @@ def add_f03_to_env(env):
DialectAddToEnv(env, "F03", F03Suffixes, F03PPSuffixes,
support_module = 1)
+def add_f08_to_env(env):
+ """Add Builders and construction variables for f08 to an Environment."""
+ try:
+ F08Suffixes = env['F08FILESUFFIXES']
+ except KeyError:
+ F08Suffixes = ['.f08']
+
+ try:
+ F08PPSuffixes = env['F08PPFILESUFFIXES']
+ except KeyError:
+ F08PPSuffixes = []
+
+ DialectAddToEnv(env, "F08", F08Suffixes, F08PPSuffixes,
+ support_module = 1)
+
def add_all_to_env(env):
"""Add builders and construction variables for all supported fortran
dialects."""
@@ -255,6 +270,7 @@ def add_all_to_env(env):
add_f90_to_env(env)
add_f95_to_env(env)
add_f03_to_env(env)
+ add_f08_to_env(env)
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index 55eb1d31..2621cf90 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -256,7 +256,7 @@ def VersionShLibLinkNames(version, libname, env):
if Verbose:
print "VersionShLibLinkNames: linkname = ",linkname
linknames.append(linkname)
- elif platform == 'posix':
+ elif platform == 'posix' or platform == 'sunos':
if sys.platform.startswith('openbsd'):
# OpenBSD uses x.y shared library versioning numbering convention
# and doesn't use symlinks to backwards-compatible libraries
@@ -293,7 +293,7 @@ symlinks for the platform we are on"""
version = None
# libname includes the version number if one was given
- libname = target[0].name
+ libname = getattr(target[0].attributes, 'shlibname', target[0].name)
platform = env.subst('$PLATFORM')
shlib_suffix = env.subst('$SHLIBSUFFIX')
shlink_flags = SCons.Util.CLVar(env.subst('$SHLINKFLAGS'))
@@ -317,6 +317,11 @@ symlinks for the platform we are on"""
shlink_flags += [ '-Wl,-soname=%s' % soname ]
if Verbose:
print " soname ",soname,", shlink_flags ",shlink_flags
+ elif platform == 'sunos':
+ suffix_re = re.escape(shlib_suffix + '.' + version)
+ (major, age, revision) = version.split(".")
+ soname = re.sub(suffix_re, shlib_suffix, libname) + '.' + major
+ shlink_flags += [ '-h', soname ]
elif platform == 'cygwin':
shlink_flags += [ '-Wl,-Bsymbolic',
'-Wl,--out-implib,${TARGET.base}.a' ]
@@ -335,12 +340,16 @@ symlinks for the platform we are on"""
if version:
# here we need the full pathname so the links end up in the right directory
- libname = target[0].path
+ libname = getattr(target[0].attributes, 'shlibpath', target[0].path)
+ if Verbose:
+ print "VerShLib: target lib is = ", libname
+ print "VerShLib: name is = ", target[0].name
+ print "VerShLib: dir is = ", target[0].dir.path
linknames = VersionShLibLinkNames(version, libname, env)
if Verbose:
print "VerShLib: linknames ",linknames
# Here we just need the file name w/o path as the target of the link
- lib_ver = target[0].name
+ lib_ver = getattr(target[0].attributes, 'shlibname', target[0].name)
# make symlink of adjacent names in linknames
for count in range(len(linknames)):
linkname = linknames[count]
diff --git a/src/engine/SCons/Tool/f08.py b/src/engine/SCons/Tool/f08.py
new file mode 100644
index 00000000..a45a61d8
--- /dev/null
+++ b/src/engine/SCons/Tool/f08.py
@@ -0,0 +1,63 @@
+"""engine.SCons.Tool.f08
+
+Tool-specific initialization for the generic Posix f08 Fortran compiler.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+#
+# __COPYRIGHT__
+#
+# 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.Defaults
+import SCons.Tool
+import SCons.Util
+import fortran
+from SCons.Tool.FortranCommon import add_all_to_env, add_f08_to_env
+
+compilers = ['f08']
+
+def generate(env):
+ add_all_to_env(env)
+ add_f08_to_env(env)
+
+ fcomp = env.Detect(compilers) or 'f08'
+ env['F08'] = fcomp
+ env['SHF08'] = fcomp
+
+ env['FORTRAN'] = fcomp
+ env['SHFORTRAN'] = fcomp
+
+
+def exists(env):
+ return env.Detect(compilers)
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/Tool/f08.xml b/src/engine/SCons/Tool/f08.xml
new file mode 100644
index 00000000..6a49c751
--- /dev/null
+++ b/src/engine/SCons/Tool/f08.xml
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+__COPYRIGHT__
+
+This file is processed by the bin/SConsDoc.py module.
+See its __doc__ string for a discussion of the format.
+-->
+
+<!DOCTYPE sconsdoc [
+<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
+%scons;
+<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
+%builders-mod;
+<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
+%functions-mod;
+<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
+%tools-mod;
+<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
+%variables-mod;
+]>
+
+<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
+
+<tool name="f08">
+<summary>
+<para>
+Set construction variables for generic POSIX Fortran 08 compilers.
+</para>
+</summary>
+<sets>
+<item>F08</item>
+<item>F08FLAGS</item>
+<item>F08COM</item>
+<item>F08PPCOM</item>
+<item>SHF08</item>
+<item>SHF08FLAGS</item>
+<item>SHF08COM</item>
+<item>SHF08PPCOM</item>
+<item>_F08INCFLAGS</item>
+</sets>
+<uses>
+<item>F08COMSTR</item>
+<item>F08PPCOMSTR</item>
+<item>SHF08COMSTR</item>
+<item>SHF08PPCOMSTR</item>
+</uses>
+</tool>
+
+<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.
+</para>
+</summary>
+</cvar>
+
+<cvar name="F08COM">
+<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.
+</para>
+</summary>
+</cvar>
+
+<cvar name="F08COMSTR">
+<summary>
+<para>
+The string displayed when a Fortran 08 source file
+is compiled to an object file.
+If this is not set, then &cv-link-F08COM; or &cv-link-FORTRANCOM;
+(the command line) 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 ['.f08']
+</para>
+</summary>
+</cvar>
+
+<cvar name="F08PPFILESUFFIXES">
+<summary>
+<para>
+The list of file extensions for which the compilation + preprocessor pass for
+F08 dialect will be used. By default, this is empty
+</para>
+</summary>
+</cvar>
+
+<cvar name="F08FLAGS">
+<summary>
+<para>
+General user-specified options that are passed to the Fortran 08 compiler.
+Note that this variable does
+<emphasis>not</emphasis>
+contain
+<option>-I</option>
+(or similar) include search path options
+that scons generates automatically from &cv-link-F08PATH;.
+See
+&cv-link-_F08INCFLAGS;
+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.
+</para>
+</summary>
+</cvar>
+
+<cvar name="_F08INCFLAGS">
+<summary>
+<para>
+An automatically-generated construction variable
+containing the Fortran 08 compiler command-line options
+for specifying directories to be searched for include files.
+The value of &cv-link-_F08INCFLAGS; is created
+by appending &cv-link-INCPREFIX; and &cv-link-INCSUFFIX;
+to the beginning and end
+of each directory in &cv-link-F08PATH;.
+</para>
+</summary>
+</cvar>
+
+<cvar name="F08PATH">
+<summary>
+<para>
+The list of directories that the Fortran 08 compiler will search for include
+directories. The implicit dependency scanner will search these
+directories for include files. Don't explicitly put include directory
+arguments in &cv-link-F08FLAGS; because the result will be non-portable
+and the directories will not be searched by the dependency scanner. Note:
+directory names in &cv-link-F08PATH; will be looked-up relative to the SConscript
+directory when they are used in a command. To force
+&scons;
+to look-up a directory relative to the root of the source tree use #:
+You only need to set &cv-link-F08PATH; if you need to define a specific
+include path for Fortran 08 files.
+You should normally set the &cv-link-FORTRANPATH; variable,
+which specifies the include path
+for the default Fortran compiler
+for all Fortran versions.
+</para>
+
+<example_commands>
+env = Environment(F08PATH='#/include')
+</example_commands>
+
+<para>
+The directory look-up can also be forced using the
+&Dir;()
+function:
+</para>
+
+<example_commands>
+include = Dir('include')
+env = Environment(F08PATH=include)
+</example_commands>
+
+<para>
+The directory list will be added to command lines
+through the automatically-generated
+&cv-link-_F08INCFLAGS;
+construction variable,
+which is constructed by
+appending the values of the
+&cv-link-INCPREFIX; and &cv-link-INCSUFFIX;
+construction variables
+to the beginning and end
+of each directory in &cv-link-F08PATH;.
+Any command lines you define that need
+the F08PATH directory list should
+include &cv-link-_F08INCFLAGS;:
+</para>
+
+<example_commands>
+env = Environment(F08COM="my_compiler $_F08INCFLAGS -c -o $TARGET $SOURCE")
+</example_commands>
+</summary>
+</cvar>
+
+<cvar name="F08PPCOM">
+<summary>
+<para>
+The command line used to compile a Fortran 08 source file to an object file
+after first running the file through the C preprocessor.
+Any options specified in the &cv-link-F08FLAGS; and &cv-link-CPPFLAGS; construction variables
+are included on this command line.
+You only need to set &cv-link-F08PPCOM; if you need to use a specific
+C-preprocessor command line for Fortran 08 files.
+You should normally set the &cv-link-FORTRANPPCOM; variable,
+which specifies the default C-preprocessor command line
+for all Fortran versions.
+</para>
+</summary>
+</cvar>
+
+<cvar name="F08PPCOMSTR">
+<summary>
+<para>
+The string displayed when a Fortran 08 source file
+is compiled to an object file
+after first running the file through the C preprocessor.
+If this is not set, then &cv-link-F08PPCOM; or &cv-link-FORTRANPPCOM;
+(the command line) is displayed.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHF08">
+<summary>
+<para>
+The Fortran 08 compiler used for generating shared-library objects.
+You should normally set the &cv-link-SHFORTRAN; variable,
+which specifies the default Fortran compiler
+for all Fortran versions.
+You only need to set &cv-link-SHF08; if you need to use a specific compiler
+or compiler version for Fortran 08 files.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHF08COM">
+<summary>
+<para>
+The command line used to compile a Fortran 08 source file
+to a shared-library object file.
+You only need to set &cv-link-SHF08COM; if you need to use a specific
+command line for Fortran 08 files.
+You should normally set the &cv-link-SHFORTRANCOM; variable,
+which specifies the default command line
+for all Fortran versions.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHF08COMSTR">
+<summary>
+<para>
+The string displayed when a Fortran 08 source file
+is compiled to a shared-library object file.
+If this is not set, then &cv-link-SHF08COM; or &cv-link-SHFORTRANCOM;
+(the command line) is displayed.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHF08FLAGS">
+<summary>
+<para>
+Options that are passed to the Fortran 08 compiler
+to generated shared-library objects.
+You only need to set &cv-link-SHF08FLAGS; if you need to define specific
+user options for Fortran 08 files.
+You should normally set the &cv-link-SHFORTRANFLAGS; variable,
+which specifies the user-specified options
+passed to the default Fortran compiler
+for all Fortran versions.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHF08PPCOM">
+<summary>
+<para>
+The command line used to compile a Fortran 08 source file to a
+shared-library object file
+after first running the file through the C preprocessor.
+Any options specified in the &cv-link-SHF08FLAGS; and &cv-link-CPPFLAGS; construction variables
+are included on this command line.
+You only need to set &cv-link-SHF08PPCOM; if you need to use a specific
+C-preprocessor command line for Fortran 08 files.
+You should normally set the &cv-link-SHFORTRANPPCOM; variable,
+which specifies the default C-preprocessor command line
+for all Fortran versions.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHF08PPCOMSTR">
+<summary>
+<para>
+The string displayed when a Fortran 08 source file
+is compiled to a shared-library object file
+after first running the file through the C preprocessor.
+If this is not set, then &cv-link-SHF08PPCOM; or &cv-link-SHFORTRANPPCOM;
+(the command line) is displayed.
+</para>
+</summary>
+</cvar>
+
+</sconsdoc>
diff --git a/src/engine/SCons/Tool/gfortran.py b/src/engine/SCons/Tool/gfortran.py
index 4f3e7e46..392a92e3 100644
--- a/src/engine/SCons/Tool/gfortran.py
+++ b/src/engine/SCons/Tool/gfortran.py
@@ -43,7 +43,7 @@ def generate(env):
Environment."""
fortran.generate(env)
- for dialect in ['F77', 'F90', 'FORTRAN', 'F95', 'F03']:
+ for dialect in ['F77', 'F90', 'FORTRAN', 'F95', 'F03', 'F08']:
env['%s' % dialect] = 'gfortran'
env['SH%s' % dialect] = '$%s' % dialect
if env['PLATFORM'] in ['cygwin', 'win32']:
diff --git a/src/engine/SCons/Tool/install.py b/src/engine/SCons/Tool/install.py
index 0c81d05d..9f2e937b 100644
--- a/src/engine/SCons/Tool/install.py
+++ b/src/engine/SCons/Tool/install.py
@@ -145,22 +145,26 @@ def copyFuncVersionedLib(dest, source, env):
return 0
-def versionedLibVersion(dest, env):
+def versionedLibVersion(dest, source, env):
"""Check if dest is a version shared library name. Return version, libname, & install_dir if it is."""
Verbose = False
platform = env.subst('$PLATFORM')
- if not (platform == 'posix' or platform == 'darwin'):
+ if not (platform == 'posix' or platform == 'darwin' or platform == 'sunos'):
return (None, None, None)
- libname = os.path.basename(dest)
- install_dir = os.path.dirname(dest)
+ if (hasattr(source[0], 'attributes') and
+ hasattr(source[0].attributes, 'shlibname')):
+ libname = source[0].attributes.shlibname
+ else:
+ libname = os.path.basename(str(dest))
+ install_dir = os.path.dirname(str(dest))
shlib_suffix = env.subst('$SHLIBSUFFIX')
# See if the source name is a versioned shared library, get the version number
result = False
version_re = re.compile("[0-9]+\\.[0-9]+\\.[0-9a-zA-Z]+")
version_File = None
- if platform == 'posix':
+ if platform == 'posix' or platform == 'sunos':
# handle unix names
versioned_re = re.compile(re.escape(shlib_suffix + '.') + "[0-9]+\\.[0-9]+\\.[0-9a-zA-Z]+")
result = versioned_re.findall(libname)
@@ -196,7 +200,7 @@ def versionedLibLinks(dest, source, env):
"""If we are installing a versioned shared library create the required links."""
Verbose = False
linknames = []
- version, libname, install_dir = versionedLibVersion(dest, env)
+ version, libname, install_dir = versionedLibVersion(dest, source, env)
if version != None:
# libname includes the version number if one was given
@@ -258,7 +262,11 @@ def installFuncVersionedLib(target, source, env):
assert len(target)==len(source), \
"Installing source %s into target %s: target and source lists must have same length."%(list(map(str, source)), list(map(str, target)))
for t,s in zip(target,source):
- if install(t.get_path(),s.get_path(),env):
+ if hasattr(t.attributes, 'shlibname'):
+ tpath = os.path.join(t.get_dir(), t.attributes.shlibname)
+ else:
+ tpath = t.get_path()
+ if install(tpath,s.get_path(),env):
return 1
return 0
@@ -301,7 +309,7 @@ def add_versioned_targets_to_INSTALLED_FILES(target, source, env):
print "ver lib emitter ",repr(target)
# see if we have a versioned shared library, if so generate side effects
- version, libname, install_dir = versionedLibVersion(target[0].path, env)
+ version, libname, install_dir = versionedLibVersion(target[0], source, env)
if version != None:
# generate list of link names
linknames = SCons.Tool.VersionShLibLinkNames(version,libname,env)
diff --git a/src/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py
index 9bae729e..83089270 100644
--- a/src/engine/SCons/Tool/jar.py
+++ b/src/engine/SCons/Tool/jar.py
@@ -97,7 +97,7 @@ def generate(env):
env['_JARMANIFEST'] = jarManifest
env['_JARSOURCES'] = jarSources
env['_JARCOM'] = '$JAR $_JARFLAGS $TARGET $_JARMANIFEST $_JARSOURCES'
- env['JARCOM'] = "${TEMPFILE('$_JARCOM')}"
+ env['JARCOM'] = "${TEMPFILE('$_JARCOM','$JARCOMSTR')}"
env['JARSUFFIX'] = '.jar'
def exists(env):
diff --git a/src/engine/SCons/Tool/javac.py b/src/engine/SCons/Tool/javac.py
index 5d0e32af..b26c0b30 100644
--- a/src/engine/SCons/Tool/javac.py
+++ b/src/engine/SCons/Tool/javac.py
@@ -218,7 +218,7 @@ def generate(env):
env['_JAVASOURCEPATH'] = '${_javapathopt("-sourcepath", "JAVASOURCEPATH", "_JAVASOURCEPATHDEFAULT")} '
env['_JAVASOURCEPATHDEFAULT'] = '${TARGET.attributes.java_sourcedir}'
env['_JAVACCOM'] = '$JAVAC $JAVACFLAGS $_JAVABOOTCLASSPATH $_JAVACLASSPATH -d ${TARGET.attributes.java_classdir} $_JAVASOURCEPATH $SOURCES'
- env['JAVACCOM'] = "${TEMPFILE('$_JAVACCOM')}"
+ env['JAVACCOM'] = "${TEMPFILE('$_JAVACCOM','$JAVACCOMSTR')}"
env['JAVACLASSSUFFIX'] = '.class'
env['JAVASUFFIX'] = '.java'
diff --git a/src/engine/SCons/Tool/ldc.py b/src/engine/SCons/Tool/ldc.py
index d74464ff..ebef55d1 100644
--- a/src/engine/SCons/Tool/ldc.py
+++ b/src/engine/SCons/Tool/ldc.py
@@ -101,7 +101,10 @@ def generate(env):
env['DLINKCOM'] = '$DLINK -of=$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
env['DSHLINK'] = '$DC'
- env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=phobos2')
+ env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=phobos2-ldc')
+ # Hack for Fedora the packages of which use the wrong name :-(
+ if os.path.exists('/usr/lib64/libphobos-ldc.so') or os.path.exists('/usr/lib32/libphobos-ldc.so') or os.path.exists('/usr/lib/libphobos-ldc.so') :
+ env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=phobos-ldc')
env['SHDLINKCOM'] = '$DLINK -of=$TARGET $DSHLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'
env['DLIBLINKPREFIX'] = '' if env['PLATFORM'] == 'win32' else '-L-l'
diff --git a/src/engine/SCons/Tool/link.py b/src/engine/SCons/Tool/link.py
index baa74079..26249460 100644
--- a/src/engine/SCons/Tool/link.py
+++ b/src/engine/SCons/Tool/link.py
@@ -82,13 +82,18 @@ def shlib_emitter(target, source, env):
version = env.subst('$SHLIBVERSION')
if version:
version_names = shlib_emitter_names(target, source, env)
- # change the name of the target to include the version number
- target[0].name = version_names[0]
- for name in version_names:
- env.SideEffect(name, target[0])
- env.Clean(target[0], name)
+ # mark the target with the shared libraries name, including
+ # the version number
+ target[0].attributes.shlibname = version_names[0]
+ shlib = env.File(version_names[0], directory=target[0].get_dir())
+ target[0].attributes.shlibpath = shlib.path
+ for name in version_names[1:]:
+ env.SideEffect(name, shlib)
+ env.Clean(shlib, name)
if Verbose:
print "shlib_emitter: add side effect - ",name
+ env.Clean(shlib, target[0])
+ return ([shlib], source)
except KeyError:
version = None
return (target, source)
@@ -105,11 +110,14 @@ def shlib_emitter_names(target, source, env):
# We need a version of the form x.y.z to proceed
raise ValueError
if version:
- if platform == 'posix':
+ if platform == 'posix' or platform == 'sunos':
versionparts = version.split('.')
- name = target[0].name
+ if hasattr(target[0].attributes, 'shlibname'):
+ name = target[0].attributes.shlibname
+ else:
+ name = target[0].name
# generate library name with the version number
- version_name = target[0].name + '.' + version
+ version_name = name + '.' + version
if Verbose:
print "shlib_emitter_names: target is ", version_name
print "shlib_emitter_names: side effect: ", name
@@ -125,7 +133,10 @@ def shlib_emitter_names(target, source, env):
version_names.append(name)
elif platform == 'darwin':
shlib_suffix = env.subst('$SHLIBSUFFIX')
- name = target[0].name
+ if hasattr(target[0].attributes, 'shlibname'):
+ name = target[0].attributes.shlibname
+ else:
+ name = target[0].name
# generate library name with the version number
suffix_re = re.escape(shlib_suffix)
version_name = re.sub(suffix_re, '.' + version + shlib_suffix, name)
@@ -136,7 +147,10 @@ def shlib_emitter_names(target, source, env):
version_names.append(version_name)
elif platform == 'cygwin':
shlib_suffix = env.subst('$SHLIBSUFFIX')
- name = target[0].name
+ if hasattr(target[0].attributes, 'shlibname'):
+ name = target[0].attributes.shlibname
+ else:
+ name = target[0].name
# generate library name with the version number
suffix_re = re.escape(shlib_suffix)
version_name = re.sub(suffix_re, '-' + re.sub('\.', '-', version) + shlib_suffix, name)
diff --git a/src/engine/SCons/Tool/mslib.py b/src/engine/SCons/Tool/mslib.py
index 8a4af57d..2453979b 100644
--- a/src/engine/SCons/Tool/mslib.py
+++ b/src/engine/SCons/Tool/mslib.py
@@ -50,7 +50,7 @@ def generate(env):
env['AR'] = 'lib'
env['ARFLAGS'] = SCons.Util.CLVar('/nologo')
- env['ARCOM'] = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}"
+ env['ARCOM'] = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES','$ARCOMSTR')}"
env['LIBPREFIX'] = ''
env['LIBSUFFIX'] = '.lib'
diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py
index 40f112b6..37af34e7 100644
--- a/src/engine/SCons/Tool/mslink.py
+++ b/src/engine/SCons/Tool/mslink.py
@@ -237,11 +237,11 @@ embedManifestExeCheckAction = SCons.Action.Action(embedManifestExeCheck, None)
regServerAction = SCons.Action.Action("$REGSVRCOM", "$REGSVRCOMSTR")
regServerCheck = SCons.Action.Action(RegServerFunc, None)
-shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}', '$SHLINKCOMSTR')
+shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES", "$SHLINKCOMSTR")}', '$SHLINKCOMSTR')
compositeShLinkAction = shlibLinkAction + regServerCheck + embedManifestDllCheckAction
-ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES")}', '$LDMODULECOMSTR')
+ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES", "$LDMODULECOMSTR")}', '$LDMODULECOMSTR')
compositeLdmodAction = ldmodLinkAction + regServerCheck + embedManifestDllCheckAction
-exeLinkAction = SCons.Action.Action('${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows")}', '$LINKCOMSTR')
+exeLinkAction = SCons.Action.Action('${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows", "$LINKCOMSTR")}', '$LINKCOMSTR')
compositeLinkAction = exeLinkAction + embedManifestExeCheckAction
def generate(env):
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py
index d42c2570..878ec6e5 100644
--- a/src/engine/SCons/Tool/msvc.py
+++ b/src/engine/SCons/Tool/msvc.py
@@ -224,17 +224,17 @@ def generate(env):
env['CC'] = 'cl'
env['CCFLAGS'] = SCons.Util.CLVar('/nologo')
env['CFLAGS'] = SCons.Util.CLVar('')
- env['CCCOM'] = '${TEMPFILE("$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM")}'
+ env['CCCOM'] = '${TEMPFILE("$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM","$CCCOMSTR")}'
env['SHCC'] = '$CC'
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')
- env['SHCCCOM'] = '${TEMPFILE("$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM")}'
+ env['SHCCCOM'] = '${TEMPFILE("$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCCCOMSTR")}'
env['CXX'] = '$CC'
env['CXXFLAGS'] = SCons.Util.CLVar('$( /TP $)')
- env['CXXCOM'] = '${TEMPFILE("$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM")}'
+ env['CXXCOM'] = '${TEMPFILE("$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM","$CXXCOMSTR")}'
env['SHCXX'] = '$CXX'
env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
- env['SHCXXCOM'] = '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM")}'
+ env['SHCXXCOM'] = '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCXXCOMSTR")}'
env['CPPDEFPREFIX'] = '/D'
env['CPPDEFSUFFIX'] = ''
env['INCPREFIX'] = '/I'
diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py
index c9f1f2aa..cb4ca554 100644
--- a/src/engine/SCons/Tool/msvs.py
+++ b/src/engine/SCons/Tool/msvs.py
@@ -289,9 +289,17 @@ class _DSPGenerator(object):
runfile.append(s)
self.sconscript = env['MSVSSCONSCRIPT']
-
- cmdargs = env.get('cmdargs', '')
-
+
+ if 'cmdargs' not in env or env['cmdargs'] == None:
+ cmdargs = [''] * len(variants)
+ elif SCons.Util.is_String(env['cmdargs']):
+ cmdargs = [env['cmdargs']] * len(variants)
+ elif SCons.Util.is_List(env['cmdargs']):
+ if len(env['cmdargs']) != len(variants):
+ raise SCons.Errors.InternalError("Sizes of 'cmdargs' and 'variant' lists must be the same.")
+ else:
+ cmdargs = env['cmdargs']
+
self.env = env
if 'name' in self.env:
@@ -354,7 +362,7 @@ class _DSPGenerator(object):
print "Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dspfile) + "'"
for i in range(len(variants)):
- AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs)
+ AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i])
self.platforms = []
for key in self.configs.keys():
diff --git a/src/engine/SCons/Tool/msvsTests.py b/src/engine/SCons/Tool/msvsTests.py
index 2f4f302a..261dbccc 100644
--- a/src/engine/SCons/Tool/msvsTests.py
+++ b/src/engine/SCons/Tool/msvsTests.py
@@ -40,6 +40,7 @@ from SCons.Tool.MSCommon.common import debug
from SCons.Tool.MSCommon import get_default_version, \
query_versions
+from SCons.Tool.msvs import _GenerateV6DSP, _GenerateV7DSP, _GenerateV10DSP
regdata_6a = r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio]
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0]
@@ -591,6 +592,84 @@ class msvsTestCase(unittest.TestCase):
assert not v1 or str(v1[0]) == self.highest_version, \
(v1, self.highest_version)
assert len(v1) == self.number_of_versions, v1
+
+ def test_config_generation(self):
+ """Test _DSPGenerator.__init__(...)"""
+ if not self.highest_version :
+ return
+
+ # Initialize 'static' variables
+ version_num, suite = msvs_parse_version(self.highest_version)
+ if version_num >= 10.0:
+ function_test = _GenerateV10DSP
+ elif version_num >= 7.0:
+ function_test = _GenerateV7DSP
+ else:
+ function_test = _GenerateV6DSP
+
+ str_function_test = str(function_test.__init__)
+ dspfile = 'test.dsp'
+ source = 'test.cpp'
+
+ # Create the cmdargs test list
+ list_variant = ['Debug|Win32','Release|Win32',
+ 'Debug|x64', 'Release|x64']
+ list_cmdargs = ['debug=True target_arch=32',
+ 'debug=False target_arch=32',
+ 'debug=True target_arch=x64',
+ 'debug=False target_arch=x64']
+
+ # Tuple list : (parameter, dictionary of expected result per variant)
+ tests_cmdargs = [(None, dict.fromkeys(list_variant, '')),
+ ('', dict.fromkeys(list_variant, '')),
+ (list_cmdargs[0], dict.fromkeys(list_variant, list_cmdargs[0])),
+ (list_cmdargs, dict(zip(list_variant, list_cmdargs)))]
+
+ # Run the test for each test case
+ for param_cmdargs, expected_cmdargs in tests_cmdargs:
+ debug('Testing %s. with :\n variant = %s \n cmdargs = "%s"' % \
+ (str_function_test, list_variant, param_cmdargs))
+ param_configs = []
+ expected_configs = {}
+ for platform in ['Win32', 'x64']:
+ for variant in ['Debug', 'Release']:
+ variant_platform = '%s|%s' % (variant, platform)
+ runfile = '%s\\%s\\test.exe' % (platform, variant)
+ buildtarget = '%s\\%s\\test.exe' % (platform, variant)
+ outdir = '%s\\%s' % (platform, variant)
+
+ # Create parameter list for this variant_platform
+ param_configs.append([variant_platform, runfile, buildtarget, outdir])
+
+ # Create expected dictionary result for this variant_platform
+ expected_configs[variant_platform] = \
+ {'variant': variant, 'platform': platform,
+ 'runfile': runfile,
+ 'buildtarget': buildtarget,
+ 'outdir': outdir,
+ 'cmdargs': expected_cmdargs[variant_platform]}
+
+ # Create parameter environment with final parameter dictionary
+ param_dict = dict(zip(('variant', 'runfile', 'buildtarget', 'outdir'),
+ [list(l) for l in zip(*param_configs)]))
+ param_dict['cmdargs'] = param_cmdargs
+
+ # Hack to be able to run the test with a 'DummyEnv'
+ class _DummyEnv(DummyEnv):
+ def subst(self, string) :
+ return string
+
+ env = _DummyEnv(param_dict)
+ env['MSVSSCONSCRIPT'] = ''
+ env['MSVS_VERSION'] = self.highest_version
+
+ # Call function to test
+ genDSP = function_test(dspfile, source, env)
+
+ # Check expected result
+ self.assertListEqual(genDSP.configs.keys(), expected_configs.keys())
+ for key in genDSP.configs.keys():
+ self.assertDictEqual(genDSP.configs[key].__dict__, expected_configs[key])
class msvs6aTestCase(msvsTestCase):
"""Test MSVS 6 Registry"""
diff --git a/test/D/DMD2.py b/test/D/DMD2.py
index fc5f79f7..84ceb513 100644
--- a/test/D/DMD2.py
+++ b/test/D/DMD2.py
@@ -42,6 +42,7 @@ if not isExecutableOfToolAvailable(test, 'dmd'):
test.write('SConstruct', """\
import os
env = Environment(tools=['link', 'dmd'])
+env['ENV']['HOME'] = os.environ['HOME'] # Hack for gdmd
if env['PLATFORM'] == 'cygwin': env['OBJSUFFIX'] = '.obj' # trick DMD
env.Program('foo', 'foo.d')
""")
diff --git a/test/D/DMD2_Alt.py b/test/D/DMD2_Alt.py
index 11c061d5..3bd58b43 100644
--- a/test/D/DMD2_Alt.py
+++ b/test/D/DMD2_Alt.py
@@ -42,6 +42,7 @@ if not isExecutableOfToolAvailable(test, 'dmd'):
test.write('SConstruct', """\
import os
env = Environment(tools=['dmd', 'link'])
+env['ENV']['HOME'] = os.environ['HOME'] # Hack for gdmd
if env['PLATFORM'] == 'cygwin': env['OBJSUFFIX'] = '.obj' # trick DMD
env.Program('foo', 'foo.d')
""")
diff --git a/test/D/HSTeoh/ArLibIssue/SConstruct_template b/test/D/HSTeoh/ArLibIssue/SConstruct_template
index 81f81f55..b17847a0 100644
--- a/test/D/HSTeoh/ArLibIssue/SConstruct_template
+++ b/test/D/HSTeoh/ArLibIssue/SConstruct_template
@@ -1,3 +1,6 @@
env = Environment({})
+import os
+env['ENV']['HOME'] = os.environ['HOME'] # Hack for gdmd
+
env.StaticLibrary('mylib', ['a.d', 'b.d'])
diff --git a/test/D/HSTeoh/Common/linkingProblem.py b/test/D/HSTeoh/Common/linkingProblem.py
index 46351b35..b526ad70 100644
--- a/test/D/HSTeoh/Common/linkingProblem.py
+++ b/test/D/HSTeoh/Common/linkingProblem.py
@@ -29,7 +29,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
-from os.path import abspath, dirname
+from os.path import abspath, dirname, exists
import sys
sys.path.insert(1, abspath(dirname(__file__) + '/../../Support'))
@@ -43,6 +43,9 @@ def testForTool(tool):
if not isExecutableOfToolAvailable(test, tool) :
test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool))
+ if not exists('/usr/include/ncurses.h'):
+ test.skip_test("ncurses not apparently installed, skip this test.")
+
test.dir_fixture('LinkingProblem')
test.write('SConstruct', open('SConstruct_template', 'r').read().format(tool))
diff --git a/test/D/HSTeoh/Common/singleStringCannotBeMultipleOptions.py b/test/D/HSTeoh/Common/singleStringCannotBeMultipleOptions.py
index 26b477b6..4716f1c3 100644
--- a/test/D/HSTeoh/Common/singleStringCannotBeMultipleOptions.py
+++ b/test/D/HSTeoh/Common/singleStringCannotBeMultipleOptions.py
@@ -55,6 +55,10 @@ def testForTool(tool):
'ldc': ".*Unknown command line argument '-m64 -O'.*",
}[tool]
+ from SCons.Environment import Base
+ if tool == 'dmd' and Base()['DC'] == 'gdmd':
+ result = ".*unrecognized command line option '-m64 -O'.*"
+
test.fail_test(not test.match_re_dotall(test.stderr(), result))
test.pass_test()
diff --git a/test/D/HSTeoh/LibCompileOptions/SConstruct_template b/test/D/HSTeoh/LibCompileOptions/SConstruct_template
index 7031f5c4..1489624f 100644
--- a/test/D/HSTeoh/LibCompileOptions/SConstruct_template
+++ b/test/D/HSTeoh/LibCompileOptions/SConstruct_template
@@ -1,5 +1,8 @@
env = Environment({})
+import os
+env['ENV']['HOME'] = os.environ['HOME'] # Hack for gdmd
+
env.Library('mylib', 'mylib.d')
prog_env = env.Clone(
diff --git a/test/D/HSTeoh/LinkingProblem/SConstruct_template b/test/D/HSTeoh/LinkingProblem/SConstruct_template
index a4aa7956..2c53b54b 100644
--- a/test/D/HSTeoh/LinkingProblem/SConstruct_template
+++ b/test/D/HSTeoh/LinkingProblem/SConstruct_template
@@ -6,6 +6,8 @@ environment = Environment(
tools = ['cc', '{}', 'link'],
LIBS = ['ncurses'])
+environment['ENV']['HOME'] = os.environ['HOME'] # Hack for gdmd
+
environment.Object('ncurs_impl.o', 'ncurs_impl.c')
environment.Program('prog', Split("""
diff --git a/test/D/Issues/2939_Ariovistus/Project/SConstruct_template b/test/D/Issues/2939_Ariovistus/Project/SConstruct_template
index 55f02aa0..c78ba968 100644
--- a/test/D/Issues/2939_Ariovistus/Project/SConstruct_template
+++ b/test/D/Issues/2939_Ariovistus/Project/SConstruct_template
@@ -2,6 +2,9 @@ from os.path import join
environment = Environment({})
+import os
+environment['ENV']['HOME'] = os.environ['HOME'] # Hack for gdmd
+
Export('environment')
environment.SConscript([
diff --git a/test/D/Issues/2940_Ariovistus/Project/SConstruct_template b/test/D/Issues/2940_Ariovistus/Project/SConstruct_template
index 55f02aa0..c78ba968 100644
--- a/test/D/Issues/2940_Ariovistus/Project/SConstruct_template
+++ b/test/D/Issues/2940_Ariovistus/Project/SConstruct_template
@@ -2,6 +2,9 @@ from os.path import join
environment = Environment({})
+import os
+environment['ENV']['HOME'] = os.environ['HOME'] # Hack for gdmd
+
Export('environment')
environment.SConscript([
diff --git a/test/D/MixedDAndC/Common/common.py b/test/D/MixedDAndC/Common/common.py
index c9ecb6a6..b356411d 100644
--- a/test/D/MixedDAndC/Common/common.py
+++ b/test/D/MixedDAndC/Common/common.py
@@ -30,6 +30,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
from os.path import abspath, dirname
+from platform import machine
import sys
sys.path.insert(1, abspath(dirname(__file__) + '/../../Support'))
@@ -47,6 +48,9 @@ def testForTool(tool):
test.run()
+ if machine() in ('i386',):
+ test.fail_test('64-bit mode not compiled in' not in test.stdout())
+
test.pass_test()
# Local Variables:
diff --git a/test/D/SharedObjects/Common/common.py b/test/D/SharedObjects/Common/common.py
index cb1e71bd..e81cf5b3 100644
--- a/test/D/SharedObjects/Common/common.py
+++ b/test/D/SharedObjects/Common/common.py
@@ -45,10 +45,11 @@ def testForTool(tool):
if not isExecutableOfToolAvailable(test, tool) :
test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool))
-
if tool == 'gdc':
test.skip_test('gdc does not, as at version 4.9.1, support shared libraries.\n')
+ if tool == 'dmd' and Base()['DC'] == 'gdmd':
+ test.skip_test('gdmd does not recognize the -shared option so cannot support linking of shared objects.\n')
platform = Base()['PLATFORM']
if platform == 'posix':
diff --git a/test/D/SharedObjects/Image/SConstruct_template b/test/D/SharedObjects/Image/SConstruct_template
index 213de7e9..cae87139 100644
--- a/test/D/SharedObjects/Image/SConstruct_template
+++ b/test/D/SharedObjects/Image/SConstruct_template
@@ -5,4 +5,6 @@ import os
environment = Environment(
tools=['{}', 'link'])
+environment['ENV']['HOME'] = os.environ['HOME'] # Hack for gdmd
+
environment.SharedLibrary('answer', 'code.d')
diff --git a/test/Fortran/F08.py b/test/Fortran/F08.py
new file mode 100644
index 00000000..35df37c3
--- /dev/null
+++ b/test/Fortran/F08.py
@@ -0,0 +1,151 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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 TestSCons
+
+from common import write_fake_link
+
+_python_ = TestSCons._python_
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+write_fake_link(test)
+
+test.write('myfortran.py', r"""
+import getopt
+import sys
+comment = '#' + sys.argv[1]
+length = len(comment)
+opts, args = getopt.getopt(sys.argv[2:], 'co:')
+for opt, arg in opts:
+ if opt == '-o': out = arg
+infile = open(args[0], 'rb')
+outfile = open(out, 'wb')
+for l in infile.readlines():
+ if l[:length] != comment:
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(LINK = r'%(_python_)s mylink.py',
+ LINKFLAGS = [],
+ F08 = r'%(_python_)s myfortran.py f08',
+ FORTRAN = r'%(_python_)s myfortran.py fortran')
+env.Program(target = 'test01', source = 'test01.f')
+env.Program(target = 'test02', source = 'test02.F')
+env.Program(target = 'test03', source = 'test03.for')
+env.Program(target = 'test04', source = 'test04.FOR')
+env.Program(target = 'test05', source = 'test05.ftn')
+env.Program(target = 'test06', source = 'test06.FTN')
+env.Program(target = 'test07', source = 'test07.fpp')
+env.Program(target = 'test08', source = 'test08.FPP')
+env.Program(target = 'test09', source = 'test09.f08')
+env.Program(target = 'test10', source = 'test10.F08')
+""" % locals())
+
+test.write('test01.f', "This is a .f file.\n#link\n#fortran\n")
+test.write('test02.F', "This is a .F file.\n#link\n#fortran\n")
+test.write('test03.for', "This is a .for file.\n#link\n#fortran\n")
+test.write('test04.FOR', "This is a .FOR file.\n#link\n#fortran\n")
+test.write('test05.ftn', "This is a .ftn file.\n#link\n#fortran\n")
+test.write('test06.FTN', "This is a .FTN file.\n#link\n#fortran\n")
+test.write('test07.fpp', "This is a .fpp file.\n#link\n#fortran\n")
+test.write('test08.FPP', "This is a .FPP file.\n#link\n#fortran\n")
+test.write('test09.f08', "This is a .f08 file.\n#link\n#f08\n")
+test.write('test10.F08', "This is a .F08 file.\n#link\n#f08\n")
+
+test.run(arguments = '.', stderr = None)
+
+test.must_match('test01' + _exe, "This is a .f file.\n")
+test.must_match('test02' + _exe, "This is a .F file.\n")
+test.must_match('test03' + _exe, "This is a .for file.\n")
+test.must_match('test04' + _exe, "This is a .FOR file.\n")
+test.must_match('test05' + _exe, "This is a .ftn file.\n")
+test.must_match('test06' + _exe, "This is a .FTN file.\n")
+test.must_match('test07' + _exe, "This is a .fpp file.\n")
+test.must_match('test08' + _exe, "This is a .FPP file.\n")
+test.must_match('test09' + _exe, "This is a .f08 file.\n")
+test.must_match('test10' + _exe, "This is a .F08 file.\n")
+
+
+fc = 'f08'
+g08 = test.detect_tool(fc)
+
+if g08:
+
+ test.write("wrapper.py",
+"""import os
+import sys
+open('%s', 'wb').write("wrapper.py\\n")
+os.system(" ".join(sys.argv[1:]))
+""" % test.workpath('wrapper.out').replace('\\', '\\\\'))
+
+ test.write('SConstruct', """
+foo = Environment(F08 = '%(fc)s')
+f08 = foo.Dictionary('F08')
+bar = foo.Clone(F08 = r'%(_python_)s wrapper.py ' + f08)
+foo.Program(target = 'foo', source = 'foo.f08')
+bar.Program(target = 'bar', source = 'bar.f08')
+""" % locals())
+
+ test.write('foo.f08', r"""
+ PROGRAM FOO
+ PRINT *,'foo.f08'
+ ENDPROGRAM FOO
+""")
+
+ test.write('bar.f08', r"""
+ PROGRAM BAR
+ PRINT *,'bar.f08'
+ ENDPROGRAM BAR
+""")
+
+
+ test.run(arguments = 'foo' + _exe, stderr = None)
+
+ test.run(program = test.workpath('foo'), stdout = " foo.f08\n")
+
+ test.must_not_exist('wrapper.out')
+
+ import sys
+ if sys.platform[:5] == 'sunos':
+ test.run(arguments = 'bar' + _exe, stderr = None)
+ else:
+ test.run(arguments = 'bar' + _exe)
+
+ test.run(program = test.workpath('bar'), stdout = " bar.f08\n")
+
+ test.must_match('wrapper.out', "wrapper.py\n")
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Fortran/F08COM.py b/test/Fortran/F08COM.py
new file mode 100644
index 00000000..783a1635
--- /dev/null
+++ b/test/Fortran/F08COM.py
@@ -0,0 +1,98 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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 TestSCons
+
+from common import write_fake_link
+
+_python_ = TestSCons._python_
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+write_fake_link(test)
+
+test.write('myfortran.py', r"""
+import sys
+comment = '#' + sys.argv[1]
+outfile = open(sys.argv[2], 'wb')
+infile = open(sys.argv[3], 'rb')
+for l in infile.readlines():
+ if l[:len(comment)] != comment:
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(LINK = r'%(_python_)s mylink.py',
+ LINKFLAGS = [],
+ F08COM = r'%(_python_)s myfortran.py f08 $TARGET $SOURCES',
+ F08PPCOM = r'%(_python_)s myfortran.py f08pp $TARGET $SOURCES',
+ FORTRANCOM = r'%(_python_)s myfortran.py fortran $TARGET $SOURCES',
+ FORTRANPPCOM = r'%(_python_)s myfortran.py fortranpp $TARGET $SOURCES')
+env.Program(target = 'test01', source = 'test01.f')
+env.Program(target = 'test02', source = 'test02.F')
+env.Program(target = 'test03', source = 'test03.for')
+env.Program(target = 'test04', source = 'test04.FOR')
+env.Program(target = 'test05', source = 'test05.ftn')
+env.Program(target = 'test06', source = 'test06.FTN')
+env.Program(target = 'test07', source = 'test07.fpp')
+env.Program(target = 'test08', source = 'test08.FPP')
+env.Program(target = 'test09', source = 'test09.f08')
+env.Program(target = 'test10', source = 'test10.F08')
+""" % locals())
+
+test.write('test01.f', "This is a .f file.\n#link\n#fortran\n")
+test.write('test02.F', "This is a .F file.\n#link\n#fortranpp\n")
+test.write('test03.for', "This is a .for file.\n#link\n#fortran\n")
+test.write('test04.FOR', "This is a .FOR file.\n#link\n#fortranpp\n")
+test.write('test05.ftn', "This is a .ftn file.\n#link\n#fortran\n")
+test.write('test06.FTN', "This is a .FTN file.\n#link\n#fortranpp\n")
+test.write('test07.fpp', "This is a .fpp file.\n#link\n#fortranpp\n")
+test.write('test08.FPP', "This is a .FPP file.\n#link\n#fortranpp\n")
+test.write('test09.f08', "This is a .f08 file.\n#link\n#f08\n")
+test.write('test10.F08', "This is a .F08 file.\n#link\n#f08pp\n")
+
+test.run(arguments = '.', stderr = None)
+
+test.must_match('test01' + _exe, "This is a .f file.\n")
+test.must_match('test02' + _exe, "This is a .F file.\n")
+test.must_match('test03' + _exe, "This is a .for file.\n")
+test.must_match('test04' + _exe, "This is a .FOR file.\n")
+test.must_match('test05' + _exe, "This is a .ftn file.\n")
+test.must_match('test06' + _exe, "This is a .FTN file.\n")
+test.must_match('test07' + _exe, "This is a .fpp file.\n")
+test.must_match('test08' + _exe, "This is a .FPP file.\n")
+test.must_match('test09' + _exe, "This is a .f08 file.\n")
+test.must_match('test10' + _exe, "This is a .F08 file.\n")
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Fortran/F08COMSTR.py b/test/Fortran/F08COMSTR.py
new file mode 100644
index 00000000..65bf32c5
--- /dev/null
+++ b/test/Fortran/F08COMSTR.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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 TestSCons
+
+_python_ = TestSCons._python_
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('myfc.py', r"""
+import sys
+fline = '#'+sys.argv[1]+'\n'
+outfile = open(sys.argv[2], 'wb')
+infile = open(sys.argv[3], 'rb')
+for l in [l for l in infile.readlines() if l != fline]:
+ outfile.write(l)
+sys.exit(0)
+""")
+
+if not TestSCons.case_sensitive_suffixes('.f','.F'):
+ f08pp = 'f08'
+else:
+ f08pp = 'f08pp'
+
+
+test.write('SConstruct', """
+env = Environment(F08COM = r'%(_python_)s myfc.py f08 $TARGET $SOURCES',
+ F08COMSTR = 'Building f08 $TARGET from $SOURCES',
+ F08PPCOM = r'%(_python_)s myfc.py f08pp $TARGET $SOURCES',
+ F08PPCOMSTR = 'Building f08pp $TARGET from $SOURCES',
+ OBJSUFFIX='.obj')
+env.Object(source = 'test01.f08')
+env.Object(source = 'test02.F08')
+""" % locals())
+
+test.write('test01.f08', "A .f08 file.\n#f08\n")
+test.write('test02.F08', "A .F08 file.\n#%s\n" % f08pp)
+
+test.run(stdout = test.wrap_stdout("""\
+Building f08 test01.obj from test01.f08
+Building %(f08pp)s test02.obj from test02.F08
+""" % locals()))
+
+test.must_match('test01.obj', "A .f08 file.\n")
+test.must_match('test02.obj', "A .F08 file.\n")
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Fortran/F08FILESUFFIXES.py b/test/Fortran/F08FILESUFFIXES.py
new file mode 100644
index 00000000..84634030
--- /dev/null
+++ b/test/Fortran/F08FILESUFFIXES.py
@@ -0,0 +1,101 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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 TestSCons
+
+from common import write_fake_link
+
+_python_ = TestSCons._python_
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+write_fake_link(test)
+
+test.write('myfortran.py', r"""
+import getopt
+import sys
+comment = '#' + sys.argv[1]
+opts, args = getopt.getopt(sys.argv[2:], 'co:')
+for opt, arg in opts:
+ if opt == '-o': out = arg
+infile = open(args[0], 'rb')
+outfile = open(out, 'wb')
+for l in infile.readlines():
+ if l[:len(comment)] != comment:
+ outfile.write(l)
+sys.exit(0)
+""")
+
+# Test default file suffix: .f90/.F90 for F90
+test.write('SConstruct', """
+env = Environment(LINK = r'%(_python_)s mylink.py',
+ LINKFLAGS = [],
+ F08 = r'%(_python_)s myfortran.py f08',
+ FORTRAN = r'%(_python_)s myfortran.py fortran')
+env.Program(target = 'test01', source = 'test01.f')
+env.Program(target = 'test02', source = 'test02.F')
+env.Program(target = 'test03', source = 'test03.for')
+env.Program(target = 'test04', source = 'test04.FOR')
+env.Program(target = 'test05', source = 'test05.ftn')
+env.Program(target = 'test06', source = 'test06.FTN')
+env.Program(target = 'test07', source = 'test07.fpp')
+env.Program(target = 'test08', source = 'test08.FPP')
+env.Program(target = 'test09', source = 'test09.f08')
+env.Program(target = 'test10', source = 'test10.F08')
+""" % locals())
+
+test.write('test01.f', "This is a .f file.\n#link\n#fortran\n")
+test.write('test02.F', "This is a .F file.\n#link\n#fortranpp\n")
+test.write('test03.for', "This is a .for file.\n#link\n#fortran\n")
+test.write('test04.FOR', "This is a .FOR file.\n#link\n#fortranpp\n")
+test.write('test05.ftn', "This is a .ftn file.\n#link\n#fortranpp\n")
+test.write('test06.FTN', "This is a .FTN file.\n#link\n#fortranpp\n")
+test.write('test07.fpp', "This is a .fpp file.\n#link\n#fortranpp\n")
+test.write('test08.FPP', "This is a .FPP file.\n#link\n#fortranpp\n")
+test.write('test09.f08', "This is a .f08 file.\n#link\n#f08\n")
+test.write('test10.F08', "This is a .F08 file.\n#link\n#f08pp\n")
+
+test.run(arguments = '.', stderr = None)
+
+test.must_match('test01' + _exe, "This is a .f file.\n")
+test.must_match('test02' + _exe, "This is a .F file.\n")
+test.must_match('test03' + _exe, "This is a .for file.\n")
+test.must_match('test04' + _exe, "This is a .FOR file.\n")
+test.must_match('test05' + _exe, "This is a .ftn file.\n")
+test.must_match('test06' + _exe, "This is a .FTN file.\n")
+test.must_match('test07' + _exe, "This is a .fpp file.\n")
+test.must_match('test08' + _exe, "This is a .FPP file.\n")
+test.must_match('test09' + _exe, "This is a .f08 file.\n")
+test.must_match('test10' + _exe, "This is a .F08 file.\n")
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Fortran/F08FILESUFFIXES2.py b/test/Fortran/F08FILESUFFIXES2.py
new file mode 100644
index 00000000..39bba44e
--- /dev/null
+++ b/test/Fortran/F08FILESUFFIXES2.py
@@ -0,0 +1,91 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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 TestSCons
+
+from common import write_fake_link
+
+_python_ = TestSCons._python_
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+write_fake_link(test)
+
+test.write('myfortran.py', r"""
+import getopt
+import sys
+comment = '#' + sys.argv[1]
+opts, args = getopt.getopt(sys.argv[2:], 'co:')
+for opt, arg in opts:
+ if opt == '-o': out = arg
+infile = open(args[0], 'rb')
+outfile = open(out, 'wb')
+for l in infile.readlines():
+ if l[:len(comment)] != comment:
+ outfile.write(l)
+sys.exit(0)
+""")
+
+# Test non-default file suffix: .f/.F for F08
+test.write('SConstruct', """
+env = Environment(LINK = r'%(_python_)s mylink.py',
+ LINKFLAGS = [],
+ F77 = r'%(_python_)s myfortran.py f77',
+ F08 = r'%(_python_)s myfortran.py f08',
+ F08FILESUFFIXES = ['.f', '.F', '.f08', '.F08'],
+ tools = ['default', 'f08'])
+env.Program(target = 'test01', source = 'test01.f')
+env.Program(target = 'test02', source = 'test02.F')
+env.Program(target = 'test03', source = 'test03.f08')
+env.Program(target = 'test04', source = 'test04.F08')
+env.Program(target = 'test05', source = 'test05.f77')
+env.Program(target = 'test06', source = 'test06.F77')
+""" % locals())
+
+test.write('test01.f', "This is a .f file.\n#link\n#f08\n")
+test.write('test02.F', "This is a .F file.\n#link\n#f08\n")
+test.write('test03.f08', "This is a .f08 file.\n#link\n#f08\n")
+test.write('test04.F08', "This is a .F08 file.\n#link\n#f08\n")
+test.write('test05.f77', "This is a .f77 file.\n#link\n#f77\n")
+test.write('test06.F77', "This is a .F77 file.\n#link\n#f77\n")
+
+test.run(arguments = '.', stderr = None)
+
+test.must_match('test01' + _exe, "This is a .f file.\n")
+test.must_match('test02' + _exe, "This is a .F file.\n")
+test.must_match('test03' + _exe, "This is a .f08 file.\n")
+test.must_match('test04' + _exe, "This is a .F08 file.\n")
+test.must_match('test05' + _exe, "This is a .f77 file.\n")
+test.must_match('test06' + _exe, "This is a .F77 file.\n")
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Fortran/F08FLAGS.py b/test/Fortran/F08FLAGS.py
new file mode 100644
index 00000000..866ea2cf
--- /dev/null
+++ b/test/Fortran/F08FLAGS.py
@@ -0,0 +1,158 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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 TestSCons
+
+from common import write_fake_link
+
+_python_ = TestSCons._python_
+
+test = TestSCons.TestSCons()
+_exe = TestSCons._exe
+
+write_fake_link(test)
+
+test.write('myfortran.py', r"""
+import getopt
+import sys
+comment = '#' + sys.argv[1]
+opts, args = getopt.getopt(sys.argv[2:], 'co:xy')
+optstring = ''
+for opt, arg in opts:
+ if opt == '-o': out = arg
+ else: optstring = optstring + ' ' + opt
+infile = open(args[0], 'rb')
+outfile = open(out, 'wb')
+outfile.write(optstring + "\n")
+for l in infile.readlines():
+ if l[:len(comment)] != comment:
+ outfile.write(l)
+sys.exit(0)
+""")
+
+
+
+test.write('SConstruct', """
+env = Environment(LINK = r'%(_python_)s mylink.py',
+ LINKFLAGS = [],
+ F08 = r'%(_python_)s myfortran.py g08',
+ F08FLAGS = '-x',
+ FORTRAN = r'%(_python_)s myfortran.py fortran',
+ FORTRANFLAGS = '-y')
+env.Program(target = 'test01', source = 'test01.f')
+env.Program(target = 'test02', source = 'test02.F')
+env.Program(target = 'test03', source = 'test03.for')
+env.Program(target = 'test04', source = 'test04.FOR')
+env.Program(target = 'test05', source = 'test05.ftn')
+env.Program(target = 'test06', source = 'test06.FTN')
+env.Program(target = 'test07', source = 'test07.fpp')
+env.Program(target = 'test08', source = 'test08.FPP')
+env.Program(target = 'test09', source = 'test09.f08')
+env.Program(target = 'test10', source = 'test10.F08')
+""" % locals())
+
+test.write('test01.f', "This is a .f file.\n#link\n#fortran\n")
+test.write('test02.F', "This is a .F file.\n#link\n#fortran\n")
+test.write('test03.for', "This is a .for file.\n#link\n#fortran\n")
+test.write('test04.FOR', "This is a .FOR file.\n#link\n#fortran\n")
+test.write('test05.ftn', "This is a .ftn file.\n#link\n#fortran\n")
+test.write('test06.FTN', "This is a .FTN file.\n#link\n#fortran\n")
+test.write('test07.fpp', "This is a .fpp file.\n#link\n#fortran\n")
+test.write('test08.FPP', "This is a .FPP file.\n#link\n#fortran\n")
+test.write('test09.f08', "This is a .f08 file.\n#link\n#g08\n")
+test.write('test10.F08', "This is a .F08 file.\n#link\n#g08\n")
+
+test.run(arguments = '.', stderr = None)
+
+test.must_match('test01' + _exe, " -c -y\nThis is a .f file.\n")
+test.must_match('test02' + _exe, " -c -y\nThis is a .F file.\n")
+test.must_match('test03' + _exe, " -c -y\nThis is a .for file.\n")
+test.must_match('test04' + _exe, " -c -y\nThis is a .FOR file.\n")
+test.must_match('test05' + _exe, " -c -y\nThis is a .ftn file.\n")
+test.must_match('test06' + _exe, " -c -y\nThis is a .FTN file.\n")
+test.must_match('test07' + _exe, " -c -y\nThis is a .fpp file.\n")
+test.must_match('test08' + _exe, " -c -y\nThis is a .FPP file.\n")
+test.must_match('test09' + _exe, " -c -x\nThis is a .f08 file.\n")
+test.must_match('test10' + _exe, " -c -x\nThis is a .F08 file.\n")
+
+
+fc = 'f08'
+g08 = test.detect_tool(fc)
+
+
+if g08:
+
+ test.write("wrapper.py",
+"""import os
+import sys
+open('%s', 'wb').write("wrapper.py\\n")
+os.system(" ".join(sys.argv[1:]))
+""" % test.workpath('wrapper.out').replace('\\', '\\\\'))
+
+ test.write('SConstruct', """
+foo = Environment(F08 = '%(fc)s')
+f08 = foo.Dictionary('F08')
+bar = foo.Clone(F08 = r'%(_python_)s wrapper.py ' + f08, F08FLAGS = '-Ix')
+foo.Program(target = 'foo', source = 'foo.f08')
+bar.Program(target = 'bar', source = 'bar.f08')
+""" % locals())
+
+ test.write('foo.f08', r"""
+ PROGRAM FOO
+ PRINT *,'foo.f08'
+ ENDPROGRAM FOO
+""")
+
+ test.write('bar.f08', r"""
+ PROGRAM BAR
+ PRINT *,'bar.f08'
+ ENDPROGRAM FOO
+""")
+
+
+ test.run(arguments = 'foo' + _exe, stderr = None)
+
+ test.run(program = test.workpath('foo'), stdout = " foo.f08\n")
+
+ test.must_not_exist('wrapper.out')
+
+ import sys
+ if sys.platform[:5] == 'sunos':
+ test.run(arguments = 'bar' + _exe, stderr = None)
+ else:
+ test.run(arguments = 'bar' + _exe)
+
+ test.run(program = test.workpath('bar'), stdout = " bar.f08\n")
+
+ test.must_match('wrapper.out', "wrapper.py\n")
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Fortran/SHF08.py b/test/Fortran/SHF08.py
new file mode 100644
index 00000000..85f2bcd3
--- /dev/null
+++ b/test/Fortran/SHF08.py
@@ -0,0 +1,144 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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 TestSCons
+
+_python_ = TestSCons._python_
+_obj = TestSCons._shobj
+obj_ = TestSCons.shobj_
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('myfortran.py', r"""
+import getopt
+import sys
+comment = '#' + sys.argv[1]
+opts, args = getopt.getopt(sys.argv[2:], 'cf:o:K:')
+for opt, arg in opts:
+ if opt == '-o': out = arg
+infile = open(args[0], 'rb')
+outfile = open(out, 'wb')
+for l in infile.readlines():
+ if l[:len(comment)] != comment:
+ outfile.write(l)
+sys.exit(0)
+""")
+
+
+
+test.write('SConstruct', """
+env = Environment(SHF08 = r'%(_python_)s myfortran.py g08',
+ SHFORTRAN = r'%(_python_)s myfortran.py fortran')
+env.SharedObject(target = 'test01', source = 'test01.f')
+env.SharedObject(target = 'test02', source = 'test02.F')
+env.SharedObject(target = 'test03', source = 'test03.for')
+env.SharedObject(target = 'test04', source = 'test04.FOR')
+env.SharedObject(target = 'test05', source = 'test05.ftn')
+env.SharedObject(target = 'test06', source = 'test06.FTN')
+env.SharedObject(target = 'test07', source = 'test07.fpp')
+env.SharedObject(target = 'test08', source = 'test08.FPP')
+env.SharedObject(target = 'test09', source = 'test09.f08')
+env.SharedObject(target = 'test10', source = 'test10.F08')
+""" % locals())
+
+test.write('test01.f', "This is a .f file.\n#fortran\n")
+test.write('test02.F', "This is a .F file.\n#fortran\n")
+test.write('test03.for', "This is a .for file.\n#fortran\n")
+test.write('test04.FOR', "This is a .FOR file.\n#fortran\n")
+test.write('test05.ftn', "This is a .ftn file.\n#fortran\n")
+test.write('test06.FTN', "This is a .FTN file.\n#fortran\n")
+test.write('test07.fpp', "This is a .fpp file.\n#fortran\n")
+test.write('test08.FPP', "This is a .FPP file.\n#fortran\n")
+test.write('test09.f08', "This is a .f08 file.\n#g08\n")
+test.write('test10.F08', "This is a .F08 file.\n#g08\n")
+
+test.run(arguments = '.', stderr = None)
+
+test.must_match(obj_ + 'test01' + _obj, "This is a .f file.\n")
+test.must_match(obj_ + 'test02' + _obj, "This is a .F file.\n")
+test.must_match(obj_ + 'test03' + _obj, "This is a .for file.\n")
+test.must_match(obj_ + 'test04' + _obj, "This is a .FOR file.\n")
+test.must_match(obj_ + 'test05' + _obj, "This is a .ftn file.\n")
+test.must_match(obj_ + 'test06' + _obj, "This is a .FTN file.\n")
+test.must_match(obj_ + 'test07' + _obj, "This is a .fpp file.\n")
+test.must_match(obj_ + 'test08' + _obj, "This is a .FPP file.\n")
+test.must_match(obj_ + 'test09' + _obj, "This is a .f08 file.\n")
+test.must_match(obj_ + 'test10' + _obj, "This is a .F08 file.\n")
+
+fc = 'f08'
+g08 = test.detect_tool(fc)
+
+if g08:
+
+ test.write("wrapper.py",
+"""import os
+import sys
+open('%s', 'wb').write("wrapper.py\\n")
+os.system(" ".join(sys.argv[1:]))
+""" % test.workpath('wrapper.out').replace('\\', '\\\\'))
+
+ test.write('SConstruct', """
+foo = Environment(SHF08 = '%(fc)s')
+shf08 = foo.Dictionary('SHF08')
+bar = foo.Clone(SHF08 = r'%(_python_)s wrapper.py ' + shf08)
+foo.SharedObject(target = 'foo/foo', source = 'foo.f08')
+bar.SharedObject(target = 'bar/bar', source = 'bar.f08')
+""" % locals())
+
+ test.write('foo.f08', r"""
+ PROGRAM FOO
+ PRINT *,'foo.f08'
+ ENDPROGRAM FOO
+""")
+
+ test.write('bar.f08', r"""
+ PROGRAM BAR
+ PRINT *,'bar.f08'
+ ENDPROGRAM BAR
+""")
+
+
+ test.run(arguments = 'foo', stderr = None)
+
+ test.must_not_exist('wrapper.out')
+
+ import sys
+ if sys.platform[:5] == 'sunos':
+ test.run(arguments = 'bar', stderr = None)
+ else:
+ test.run(arguments = 'bar')
+
+ test.must_match('wrapper.out', "wrapper.py\n")
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/test/Interactive/configure.py b/test/Interactive/configure.py
index ceb1aea2..1a92f6c4 100644
--- a/test/Interactive/configure.py
+++ b/test/Interactive/configure.py
@@ -32,20 +32,43 @@ Also tests that "b" can be used as a synonym for "build".
import TestSCons
+_python_ = TestSCons._python_
+
test = TestSCons.TestSCons()
-test.write('SConstruct', """\
+test.write('mycc.py', r"""
import sys
+outfile = open(sys.argv[1], 'wb')
+infile = open(sys.argv[2], 'rb')
+for l in [l for l in infile.readlines() if l[:7] != '/*c++*/']:
+ outfile.write(l)
+sys.exit(0)
+""")
-env = Environment()
-
-conf = Configure(env)
-if not conf.CheckCXX():
- sys.exit(1)
+test.write('SConstruct', """\
+env = Environment(CXXCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+ OBJSUFFIX='.obj')
+
+# Ensure that our 'compiler' works...
+def CheckMyCC(context):
+ context.Message('Checking for MyCC compiler...')
+ result = context.TryBuild(context.env.Object,
+ 'int main(void) {return 0;}',
+ '.cpp')
+ context.Result(result)
+ return result
+
+conf = Configure(env,
+ custom_tests = {'CheckMyCC' : CheckMyCC})
+
+if conf.CheckMyCC():
+ pass # build succeeded
+else:
+ Exit(1)
conf.Finish()
-env.Program('foo','foo.cpp')
-""")
+env.Object('foo.obj','foo.cpp')
+""" % locals())
test.write('foo.cpp', """\
#include <stdio.h>
@@ -60,11 +83,11 @@ int main (int argc, char *argv[])
scons = test.start(arguments = '-Q --interactive')
# Initial build
-scons.send("build foo\n")
+scons.send("build foo.obj\n")
-test.wait_for(test.workpath('foo'))
+test.wait_for(test.workpath('foo.obj'))
# Update without any changes -> no action
-scons.send("build foo\n")
+scons.send("build foo.obj\n")
# Changing the source file
test.write('foo.cpp', """\
#include <stdio.h>
@@ -82,16 +105,14 @@ int main (int argc, char *argv[])
""")
# Verify that "b" can be used as a synonym for the "build" command.
-scons.send("b foo\n")
+scons.send("b foo.obj\n")
-scons.send("build foo\n")
+scons.send("build foo.obj\n")
expect_stdout = r"""scons>>> .*foo\.cpp.*
-.*foo.*
scons>>> .*foo\.cpp.*
-.*foo.*
-scons>>> scons: `foo' is up to date.
-scons>>> scons: `foo' is up to date.
+scons>>> scons: `foo.obj' is up to date.
+scons>>> scons: `foo.obj' is up to date.
scons>>>\s*
"""