216 | | depends_run-append port:gcc_select |
| 217 | |
| 218 | foreach cdv {{} 3.9 4.0} { |
| 219 | set cv [join [split ${cdv} "."] ""] |
| 220 | if {${cdv} eq {}} { |
| 221 | variant libcxx description "Build to use libc++ and the corresponding headers from Xcode" {} |
| 222 | } else { |
| 223 | variant libcxx${cv} description "Build to use libc++ and the corresponding headers from port:clang-${cdv}" {} |
| 224 | } |
| 225 | if {[variant_isset libcxx${cv}]} { |
| 226 | if {${cdv} ne {}} { |
| 227 | depends_run-append port:clang-${cdv} |
| 228 | set libcxx_headers "${prefix}/libexec/llvm-${cdv}/include/c++/v1" |
| 229 | } else { |
| 230 | set libcxx_headers "[file dir [exec xcrun --find clang]]/../include/c++/v1" |
| 231 | } |
| 232 | patchfiles-append patch-use-libcxx.diff |
| 233 | post-patch { |
| 234 | reinplace "s|@LLVMHEADERPATH@|${libcxx_headers}|g" ${worksrcpath}/gcc/incpath.c |
| 235 | } |
| 236 | notes-append "G++ will search the libc++ headers in ${libcxx_headers} by default;\ |
| 237 | this can be overridden by setting LIBCPP_INCLUDE_PATH. The original libstdc++\ |
| 238 | headers are in ${prefix}/include/${name}-stdinc/c++ ." |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | # used when a +libcxx variant is selected; it causes g++ to add |
| 243 | build.env-append GCC_IS_BUILDING_ITSELF=1 |
| 244 | destroot.env-append GCC_IS_BUILDING_ITSELF=1 |
| 245 | |
| 246 | depends_run-append port:gcc_select |
| 276 | foreach cdv {{} 3.9 4.0} { |
| 277 | set cv [join [split ${cdv} "."] ""] |
| 278 | if {[variant_isset libcxx${cv}]} { |
| 279 | # move the stdc++ headers out of the way |
| 280 | xinstall -m 755 -d ${destroot}${prefix}/include/${name}-stdinc |
| 281 | file rename ${destroot}${prefix}/include/${name}/c++ ${destroot}${prefix}/include/${name}-stdinc/c++ |
| 282 | # replace with a symlink to the corresponding libc++ headers |
| 283 | ui_msg "ln -s ${libcxx_headers} ${destroot}${prefix}/include/${name}/c++" |
| 284 | # ln -s ${libcxx_headers} ${destroot}${prefix}/include/${name}/c++ |
| 285 | } |
| 286 | } |