Hello ANT-Contrib developers,
you will find as attachment a CppTasks patch, which fixes a bug inside gcc
linker configuration resulting in repeated unnecessary linking of Windows
executables. The linking history of gcc generated executables is never
written into history.xml files without this patch, because method
getOutput() of class TargetInfo returns a wrong file object without ".exe"
extension. This causes the check inside method update(TargetInfo
linkTarget) of TargetHistoryTable whether the output file exists and is
up-to-date to fail allways. The missing file suffix is no problem for gcc,
because gcc appends it, if it's missing.
The patch introduce a new class PlatformConfiguration to encapsulate
platform specific configurations for compilers running on several
platforms (like gcc). This class is called from GccLinker and GppLinker
initialization code to get the right file suffix.
If you don't like the additional class, you could put the one line
System.getProperty("os.name").startsWith("Windows") ? ".exe" : ""
into GccLinker and GppLinker initialization.
CppTasks users can workaround this problem by appending ".exe" to every
output file name inside their build files, if they compile executables
with gcc on Windows. But this workaround is very inconsistent to the
existing library handling, where CppTasks pre-/appends "lib"/".a" itself.
Helge Schulz http://www.openshore.org