diff --git a/doc/macports.conf.5 b/doc/macports.conf.5 index ec5fcac4f0..092405648a 100644 --- a/doc/macports.conf.5 +++ b/doc/macports.conf.5 @@ -343,7 +343,7 @@ lt lt. T{ \fBRegular architectures include:\fR T}:T{ -ppc, i386, ppc64, x86_64, arm64 +ppc, ppc7400, ppc64, i386, x86_64, arm64 T} T{ \fBDefault (11 and later):\fR @@ -376,7 +376,7 @@ lt lt. T{ \fBRegular architectures include:\fR T}:T{ -ppc, i386, ppc64, x86_64, arm64 +ppc, ppc7400, ppc64, i386, x86_64, arm64 T} T{ \fBDefault (11 and later):\fR diff --git a/doc/macports.conf.5.txt b/doc/macports.conf.5.txt index a00e351ab9..3404f85a57 100644 --- a/doc/macports.conf.5.txt +++ b/doc/macports.conf.5.txt @@ -124,7 +124,7 @@ keeplogs:: build_arch:: The machine architecture to try to build for in normal use. - *Regular architectures include:*;; ppc, i386, ppc64, x86_64, arm64 + *Regular architectures include:*;; ppc, ppc7400, ppc64, i386, x86_64, arm64 *Default (11 and later):*;; arm64 or x86_64 depending on hardware *Default (10.6-10.15):*;; x86_64 or i386 depending on hardware *Default (10.5 and earlier):*;; i386 or ppc depending on hardware @@ -133,7 +133,7 @@ universal_archs:: The machine architectures to use for +universal variant (multiple architecture entries should be space separated). Should contain at least two entries, or be empty to disable universal building. - *Regular architectures include:*;; ppc, i386, ppc64, x86_64, arm64 + *Regular architectures include:*;; ppc, ppc7400, ppc64, i386, x86_64, arm64 *Default (11 and later):*;; arm64 x86_64 *Default (10.6-10.13):*;; x86_64 i386 *Default (10.5 and earlier):*;; i386 ppc diff --git a/doc/portfile.7 b/doc/portfile.7 index 2fb68ae160..49e3efc3c9 100644 --- a/doc/portfile.7 +++ b/doc/portfile.7 @@ -230,6 +230,7 @@ Archs currently supported by macOS are: .Em i386 , .Em ppc , .Em ppc64 , +.Em ppc7400 , and .Em x86_64 . If this option is not set, it is assumed that the port can build for all @@ -255,10 +256,10 @@ In this case, the port will be built in 32-bit mode. .Em optional .br .Sy Values: -.Em i386 x86_64 ppc ppc64 noarch +.Em arm64 i386 x86_64 ppc ppc7400 ppc64 noarch .br .Sy Default: -.Em i386 x86_64 ppc ppc64 +.Em arm64 i386 x86_64 ppc ppc64 .br .Sy Examples: .Dl supported_archs i386 x86_64 diff --git a/src/macports1.0/macports.tcl b/src/macports1.0/macports.tcl index 18109018d7..9e33d98370 100644 --- a/src/macports1.0/macports.tcl +++ b/src/macports1.0/macports.tcl @@ -1142,7 +1142,11 @@ match macports.conf.default." } } else { if {$os_arch eq "powerpc"} { - set macports::build_arch ppc + if {[sysctl hw.vectorunit] == 1} { + set macports::build_arch ppc7400 + } else { + set macports::build_arch ppc + } } else { set macports::build_arch i386 } diff --git a/src/port1.0/portconfigure.tcl b/src/port1.0/portconfigure.tcl index 8d034b5500..50359f81e6 100644 --- a/src/port1.0/portconfigure.tcl +++ b/src/port1.0/portconfigure.tcl @@ -420,10 +420,10 @@ proc portconfigure::choose_supported_archs {archs} { } elseif {[vercmp ${configure.sdk_version} 10.6] >= 0} { set sdk_archs [list x86_64 i386 ppc] } elseif {[vercmp ${configure.sdk_version} 10.5] >= 0} { - set sdk_archs [list x86_64 i386 ppc ppc64] + set sdk_archs [list x86_64 i386 ppc ppc7400 ppc64] } else { # 10.4u - set sdk_archs [list i386 ppc ppc64] + set sdk_archs [list i386 ppc ppc7400 ppc64] } # Set intersection_archs to the intersection of what's supported by @@ -456,20 +456,25 @@ proc portconfigure::choose_supported_archs {archs} { # e.g. if build_arch is x86_64 it's still possible to build a port # that sets supported_archs to "i386 ppc" if the SDK allows it. array set arch_demotions [list \ - arm64 x86_64 \ - x86_64 i386 \ - ppc64 ppc \ - i386 ppc] + arm64 {x86_64} \ + x86_64 {i386} \ + ppc64 {ppc7400 ppc} \ + ppc7400 {ppc} \ + i386 {ppc}] foreach arch $archs { if {$arch in $intersection_archs} { - set add_arch $arch - } elseif {[info exists arch_demotions($arch)] && $arch_demotions($arch) in $intersection_archs} { - set add_arch $arch_demotions($arch) - } else { - continue - } - if {$add_arch ni $ret} { - lappend ret $add_arch + if {$arch ni $ret} { + lappend ret $arch + } + } elseif {[info exists arch_demotions($arch)]} { + foreach demoted_arch $arch_demotions($arch) { + if {$demoted_arch in $intersection_archs} { + if {$demoted_arch ni $ret} { + lappend ret $demoted_arch + } + break + } + } } } return $ret @@ -487,7 +492,16 @@ proc portconfigure::configure_get_archflags {tool} { if {[arch_flag_supported ${configure.compiler}] && $tool in {cc cxx objc objcxx} } then { - set flags "-arch ${configure.build_arch}" + # ppc7400 is PPC + Altivec; it's up to the ports to declare support + # for the ppc7400 architecture and to enable/disable Altivec. At the + # compiler level, this is done with -maltivec/-mno-altivec, but + # projects often have separate compilation paths for Altivec, so + # leave these top-level flags alone. + if {${configure.build_arch} eq "ppc7400"} { + set flags "-arch ppc" + } else { + set flags "-arch ${configure.build_arch}" + } } elseif {${configure.build_arch} in [list arm64 ppc64 x86_64]} { set flags "-m64" } elseif {${configure.compiler} ne "gcc-3.3"} { @@ -1290,7 +1304,9 @@ proc portconfigure::get_compiler_fallback {} { set compilers "" lappend compilers {*}${system_compilers} # when building for PowerPC architectures, prefer GCC to Clang - if {[option configure.build_arch] eq "ppc" || [option configure.build_arch] eq "ppc64"} { + if {[option configure.build_arch] eq "ppc" || + [option configure.build_arch] eq "ppc7400" || + [option configure.build_arch] eq "ppc64"} { lappend compilers {*}${gcc_compilers} lappend compilers {*}${clang_compilers} } else { diff --git a/src/port1.0/portlint.tcl b/src/port1.0/portlint.tcl index 468cef3d82..1c53b9b1ad 100644 --- a/src/port1.0/portlint.tcl +++ b/src/port1.0/portlint.tcl @@ -412,6 +412,7 @@ proc portlint::lint_main {args} { arm64 arm intel i386 ppc powerpc + ppc7400 powerpc ppc64 powerpc x86_64 i386 } { diff --git a/src/port1.0/portmain.tcl b/src/port1.0/portmain.tcl index 23bb4ef6ca..e63b8ec015 100644 --- a/src/port1.0/portmain.tcl +++ b/src/port1.0/portmain.tcl @@ -118,8 +118,8 @@ default distname {${name}-${version}} default worksrcdir {$distname} default filespath {[file join $portpath [join $filesdir]]} default worksrcpath {[file join $workpath [join $worksrcdir]]} -# empty list means all archs are supported -default supported_archs {} +# Exclude ppc7400, which is an opt-in architecture +default supported_archs {ppc ppc64 i386 x86_64 arm64} default depends_skip_archcheck {} default add_users {}