| 57 | # Note: gcc cannot be used for the C compiler. It will give: |
| 58 | #:info:build In file included from /usr/include/dispatch/dispatch.h:51:0, |
| 59 | #:info:build from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15, |
| 60 | #:info:build from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13, |
| 61 | #:info:build from langprefs.c:30: |
| 62 | #:info:build /usr/include/dispatch/object.h:143:15: error: expected identifier or '(' before '^' token |
| 63 | #:info:build typedef void (^dispatch_block_t)(void); |
| 64 | #:info:build ^ |
| 65 | #:info:build /usr/include/dispatch/object.h:362:3: error: unknown type name 'dispatch_block_t' |
| 66 | #:info:build dispatch_block_t notification_block); |
| 67 | #:info:build ^ |
| 68 | # However, use of compiler.blacklist *gcc* would remove the GCC Fortran compilers too. |
| 69 | |
107 | | set gcc_versions {4.5 4.6 4.7 4.8 4.9} |
108 | | set default_fortran_variant +gfortran48 |
109 | | |
110 | | foreach ver ${gcc_versions} { |
111 | | set ver_no_dot [join [split ${ver} "."] ""] |
112 | | |
113 | | set variant_line {variant gfortran${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}"} |
114 | | |
115 | | foreach over ${gcc_versions} { |
116 | | if {${ver} == ${over}} { |
117 | | continue |
118 | | } |
119 | | |
120 | | set over_no_dot [join [split ${over} "."] ""] |
121 | | append variant_line " conflicts gfortran${over_no_dot}" |
122 | | } |
123 | | append variant_line { {}} |
124 | | |
125 | | eval $variant_line |
126 | | |
127 | | if {[variant_isset gfortran${ver_no_dot}]} { |
128 | | if {${default_fortran_variant} != "+gfortran${ver_no_dot}"} { |
129 | | set default_fortran_variant "" |
130 | | } |
131 | | } |
132 | | } |
133 | | |
134 | | if {${default_fortran_variant} != ""} { |
135 | | default_variants-append "${default_fortran_variant}" |
136 | | } |
137 | | |
138 | | foreach ver ${gcc_versions} { |
139 | | set ver_no_dot [join [split ${ver} "."] ""] |
140 | | |
141 | | if {[variant_isset gfortran${ver_no_dot}]} { |
142 | | depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc |
143 | | depends_build-append port:gcc${ver_no_dot} |
144 | | |
145 | | configure.fc ${prefix}/bin/gfortran-mp-${ver} |
146 | | configure.f77 ${prefix}/bin/gfortran-mp-${ver} |
147 | | configure.f90 ${prefix}/bin/gfortran-mp-${ver} |
148 | | } |
149 | | } |
150 | | |