# INPUTS:
#   ICC_ABI: x86, amd64

_ARG2ABI = {'x86': 'ia32', 'amd64': 'em64t', 'default': 'ia32'}

def get_abi(env):
    try:
        abi = env['ICC_ABI']
    except KeyError:
        abi = 'default'

    try:
        return _ARG2ABI[abi]
    except KeyError:
        ValueError("Unknown abi %s" % abi)

@@ -112,11 +112,62 @@
 (env
-):%0A
+, lang='C'):%0A    if lang == 'C' or lang == 'CXX':%0A    
     
@@ -175,24 +175,28 @@
 ry:%0A        
+   
+ 
 abi = env%5B'I
@@ -204,16 +204,20 @@
 C_ABI'%5D%0A
+    
     exce
@@ -221,32 +221,165 @@
 xcept KeyError:%0A
+            abi = 'default'%0A    elif lang == 'FORTRAN':%0A        try:%0A            abi = env%5B'IFORT_ABI'%5D%0A        except KeyError:%0A    
         abi = 'd

Add a language argument to get abi for intel tools.