Ticket #54198: gcc7+with_libgcc.diff
File gcc7+with_libgcc.diff, 4.1 KB (added by RJVB (René Bertin), 7 years ago) |
---|
-
lang/gcc7/Portfile
a b 3 3 PortSystem 1.0 4 4 PortGroup select 1.0 5 5 PortGroup compiler_blacklist_versions 1.0 6 PortGroup active_variants 1.1 6 7 7 8 name gcc7 8 9 subport libgcc {} … … 144 145 if {${subport} eq "libgcc"} { 145 146 conflicts libgcc-devel 146 147 long_description-append \ 147 This port installs the standard runtime libraries, including libstdc++. 148 This port installs the standard runtime libraries, including libstdc++. \ 149 Users building from source can install port:${name}+with_libgcc \ 150 and port:${subport}+stub to avoid building everything twice. 151 152 variant stub description "Use when the standard libraries are provided by the main port:${name}+with_libgcc" {} 148 153 149 154 # http://trac.macports.org/ticket/35770 150 155 # http://trac.macports.org/ticket/38814 … … 158 163 # version should continue to provide a subport for that and older gcc 159 164 # versions. 160 165 166 if {![catch {set result [active_variants ${name} with_libgcc {}]}]} { 167 if {${result}} { 168 default_variants-append +stub 169 } 170 } 171 if {[variant_isset stub]} { 172 # reset the depspecs to just port:${name} 173 depends_lib port:${name} 174 require_active_variants ${name} with_libgcc 175 176 use_configure no 177 fetch {} 178 extract {} 179 patch {} 180 build {} 181 destroot { 182 # install symlinks to the set of standardLibs that have in this case been 183 # installed by the main port. In other words, use the reverse logic to the 184 # comparable foreach loop in the main port's post-destroot, minus the deleting. 185 xinstall -m 755 -d ${destroot}${prefix}/lib/libgcc 186 foreach dylib ${standardLibs} { 187 # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs 188 # https://trac.macports.org/ticket/40098 189 # https://trac.macports.org/ticket/40100 190 if {[file exists ${prefix}/lib/${name}/${dylib}]} { 191 ln -s ${prefix}/lib/${name}/${dylib} ${destroot}${prefix}/lib/libgcc/${dylib} 192 } 193 194 if {[variant_isset universal]} { 195 foreach archdir [glob ${prefix}/lib/${name}/*/] { 196 if {[file exists ${archdir}/${dylib}]} { 197 ln -s ${archdir}/${dylib} ${destroot}${prefix}/lib/libgcc/${dylib} 198 } 199 } 200 } 201 } 202 } 203 } else { 204 ## default libgcc variant 161 205 depends_lib-delete path:lib/libgcc/libgcc_s.1.dylib:libgcc 206 require_active_variants ${name} "" with_libgcc 162 207 163 208 configure.args-delete --libdir=${prefix}/lib/${name} 164 209 configure.args-append --libdir=${prefix}/lib/libgcc … … 219 264 # For binary compatibility with binaries that linked against the old libstdcxx port 220 265 ln -s libgcc/libstdc++.6.dylib ${destroot}${prefix}/lib/libstdc++.6.dylib 221 266 } 267 ## end default libgcc variant 268 } 222 269 223 270 } else { 224 271 272 variant with_libgcc description "Include the standard libraries instead of getting them from port:libgcc. Speeds up building from source." {} 273 225 274 depends_run-append port:gcc_select 275 if {[variant_isset with_libgcc]} { 276 # we install libgcc's content ourselves 277 depends_lib-delete path:lib/libgcc/libgcc_s.1.dylib:libgcc 278 } 226 279 227 280 post-destroot { 228 281 file delete ${destroot}${prefix}/share/info/dir … … 234 287 file rename ${file} ${newfile} 235 288 } 236 289 290 if {![variant_isset with_libgcc]} { 291 ## default gcc7 variant 237 292 foreach dylib ${standardLibs} { 238 293 # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs 239 294 # https://trac.macports.org/ticket/40098 … … 252 307 } 253 308 } 254 309 } 310 ## end default gcc7 variant 311 } 255 312 } 256 313 257 314 select.group gcc