- if ($os =~ /\ball\b/i) {
- $skip = 1;
- # >comment skip: VMS hpux:10.20<
- } elsif ($os =~ /\b$^O(?::(\S+))?\b/i) {
- my $vsn = defined $1 ? $1 : "0";
- # Only compare on the the first pair of digits, as numeric
- # compares do not like 2.6.10-3mdksmp or 2.6.8-24.10-default
- s/^(\d+(\.\d+)?).*/$1/ for $osv, $vsn;
- $skip = $vsn ? ($osv <= $vsn ? 1 : 0) : 1;
+ # >comment skip: solaris<
+ # >comment skip: x86_64-linux-ld<
+ if ($os =~ /\b(?:all|\Q$^O\E|\Q$archname\E)\b/i) {
+ $skip = 1;
+ } elsif ($os =~ /\b\Q$^O\E(?::(\S+))\b/i) {
+ # We can have the $^O followed by an optional condition.
+ # The condition, if present, can be one of:
+ # (1) starts with a digit...
+ # the first pair of dot-separated digits is
+ # tested numerically against $Config{osvers}
+ # (2) otherwise...
+ # tested as a \b/i regex against $Config{archname}
+ my $cond = $1;
+ if ($cond =~ /^\d/) {
+ # >comment skip: hpux:10.20<
+ my $vsn = $cond;
+ # Only compare on the the first pair of digits, as numeric
+ # compares do not like 2.6.10-3mdksmp or 2.6.8-24.10-default
+ s/^(\d+(\.\d+)?).*/$1/ for $osv, $vsn;
+ $skip = $vsn ? ($osv <= $vsn ? 1 : 0) : 1;
+ } else {
+ # >comment skip: netbsd:vax-netbsd<
+ $skip = $archname =~ /\b\Q$cond\E\b/i;
+ }