diff src/build-msvctools/cc-msvc.cc @ 3087:3663f6300abf

[MSVC] enable FFTW compilation - fix cc-msvc when all input files are pushed into @-files by libtool - make libtool think clgfortran is not the GNU Fortran compiler - don't bother compiling long-double version of FFTW, MSVC does not support long double type, it's typedef'ed to double
author Michael Goffioul <michael.goffioul@gmail.com>
date Mon, 24 Jun 2013 22:10:13 -0400
parents c0222ce8760d
children 31edb6eea0eb
line wrap: on
line diff
--- a/src/build-msvctools/cc-msvc.cc	Mon Jun 24 13:28:33 2013 -0400
+++ b/src/build-msvctools/cc-msvc.cc	Mon Jun 24 22:10:13 2013 -0400
@@ -769,6 +769,16 @@
 		clopt += (" " + sourcefile);
 	}
 
+	if (exeoutput && sourcefile.empty())
+	{
+		// It's possible all object files and libraries have been
+		// pushed into @-files, so "prog" would still be set to "cl".
+		// If there's no source file specified on the command line,
+		// it's probably safe to assume we're calling the linker.
+
+		prog = "link";
+	}
+
 	if (!exeoutput && !sourcefile.empty() && objectfile.empty())
 	{
 		// use .o suffix by default
@@ -793,6 +803,17 @@
                 linkopt += " -out:" + exefile;
         }
 
+	if (exeoutput &&
+            (ends_with(exefile, ".dll") || ends_with(exefile, ".DLL"))
+            && ! doshared)
+	{
+		// Maybe "-shared" was missing on the command line.
+		// Compensate for it!
+
+		clopt += " -LD";
+		linkopt += " -DLL";
+	}
+
 	if (exeoutput && default_libs)
 	{
 		cllinkopt += " dirent.lib msvcmath.lib shell32.lib advapi32.lib user32.lib kernel32.lib";