From ef577093c3ea051fb6ae931aeade1c05bfb684a2 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Mon, 10 Oct 2005 13:41:24 +0000 Subject: [PATCH] On Windows, the Intel Fortran compiler (ifort) uses -object: instead of -o as the command-line option for output object files. Massage command lines appropriately. git-svn-id: http://scons.tigris.org/svn/scons/trunk@1371 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 4 ++++ src/engine/SCons/Tool/ifort.py | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 97a4bcd8..39c0c8a2 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -359,6 +359,10 @@ RELEASE 0.97 - XXX - In Visual Studio project files, put quotes around the -C directory so everything works even if the path has spaces in it. + - The Intel Fortran compiler uses -object:$TARGET, not "-o $TARGET", + when building object files on Windows. Have the the ifort Tool + modify the default command lines appropriately. + From Chen Lee: - Handle Visual Studio project and solution files in Unicode. diff --git a/src/engine/SCons/Tool/ifort.py b/src/engine/SCons/Tool/ifort.py index 181078af..7681f385 100644 --- a/src/engine/SCons/Tool/ifort.py +++ b/src/engine/SCons/Tool/ifort.py @@ -34,6 +34,8 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import string + import SCons.Defaults import fortran @@ -58,5 +60,14 @@ def generate(env): # be in shared libraries. env['SHLINKFLAGS'] = '-shared -no_archive' + # + if env['PLATFORM'] == 'win32': + # On Windows, the ifort compiler specifies the object on the + # command line with -object:, not -o. Massage the necessary + # command-line construction variables. + for var in ['_FORTRANCOMD', '_FORTRANPPCOMD', + '_SHFORTRANCOMD', '_SHFORTRANPPCOMD']: + env[var] = string.replace(env[var], '-o $TARGET', '-object:$TARGET') + def exists(env): return env.Detect('ifort') -- 2.26.2