forked from msys2/MSYS2-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0004-LLVM-Flang.patch
60 lines (57 loc) · 1.97 KB
/
0004-LLVM-Flang.patch
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Treat LLVM Flang as GNU-compatible compiler for GNU targets.
--- autoconf-2.71/lib/autoconf/fortran.m4.orig 2021-01-28 21:46:48.000000000 +0100
+++ autoconf-2.71/lib/autoconf/fortran.m4 2024-10-30 13:24:17.360461800 +0100
@@ -286,6 +286,46 @@
[m4_fatal([unknown Fortran dialect])])])
+# _AC_FC_COMPILER_GNU
+# ---------------------
+# Check whether the compiler for the current language is GNU.
+#
+# This is similar to _AC_LANG_COMPILER_GNU. But also considers LLVM Flang
+# a GNU-compatible compiler. Pay attention to the fact that the position
+# of 'choke me' on the seventh column is intentional: otherwise
+# some Fortran compilers (e.g., SGI) might consider it's a
+# continuation line, and warn instead of reporting an error.
+m4_define([_AC_FC_COMPILER_GNU],
+[AC_CACHE_CHECK([whether the compiler supports GNU _AC_LANG],
+ [ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu],
+ [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __GNUC__
+ choke me
+#endif
+]])],
+ [ac_compiler_gnu=yes],
+ [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __flang__
+ choke me
+#endif
+]])],
+ [case `$[]_AC_FC[] $[]_AC_LANG_PREFIX[]FLAGS --print-target-triple < /dev/null 2>&1` in
+ *mingw*|*-gnu)
+ ac_compiler_gnu=yes
+ ;;
+ *-msvc)
+ ac_compiler_gnu=no
+ ;;
+ *)
+ ## assume Flang is GNU-compatible by default
+ ac_compiler_gnu=yes
+ ;;
+ esac],
+ [ac_compiler_gnu=no])])
+ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu=$ac_compiler_gnu
+])
+ac_compiler_gnu=$ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu
+])# _AC_FC_COMPILER_GNU
+
+
# _AC_PROG_FC([DIALECT], [COMPILERS...])
# --------------------------------------
# DIALECT is a Fortran dialect, given by Fortran [YY]YY or simply [YY]YY,
@@ -346,7 +386,7 @@
# input file. (Note that this only needs to work for GNU compilers.)
ac_save_ext=$ac_ext
ac_ext=F
-_AC_LANG_COMPILER_GNU
+_AC_FC_COMPILER_GNU
ac_ext=$ac_save_ext
_AC_PROG_FC_G
])# _AC_PROG_FC