libtool.m4.nag_wrapper.patch 1.09 KB
Newer Older
Sergey Kosukhin's avatar
Sergey Kosukhin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -8903,7 +8903,8 @@ func_mode_link ()
 	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
           # On Darwin other compilers
-          case $CC in
+          func_cc_basename $CC
+          case $func_cc_basename_result in
               nagfor*)
                   verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
                   ;;
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -118,6 +118,12 @@ func_cc_basename ()
       esac
     done
     func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+    # Set result to 'nagfor-wrapper' when NAG compiler is called via a wrapper (e.g. mpif90).
+    case $func_cc_basename_result in
+      nagfor*) ;;
+      *) $cc_temp -V 2>&1 | $GREP '^NAG Fortran Compiler Release' >/dev/null 2>&1 && func_cc_basename_result='nagfor-wrapper' ;;
+    esac
 }
 ])# _LT_PREPARE_CC_BASENAME