autoconf: log_environment: add #CPUs probe for FreeBSD

https://github.com/libsdl-org/autoconf/commit/cedbfd9a8c184e841a8fa396e4f2841143f64c19

From cedbfd9a8c184e841a8fa396e4f2841143f64c19 Mon Sep 17 00:00:00 2001
From: Zack Weinberg <[EMAIL REDACTED]>
Date: Sun, 26 Sep 2021 12:28:07 -0400
Subject: [PATCH] log_environment: add #CPUs probe for FreeBSD

---
 log_environment | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/log_environment b/log_environment
index 724b9750..ee072043 100755
--- a/log_environment
+++ b/log_environment
@@ -109,19 +109,17 @@ sub report_machine {
 
     if ($sysname eq 'Linux') {
         report_linux_libc();
-    }
 
-    my ($npstat, @npout) = get_status_and_output('nproc');
-    if ($npstat == 0) {
-        chomp @npout;
-        print '$(nproc) = ', $npout[0], "\n";
-    } elsif ($npstat == -1) {
-        print "nproc: command not found\n";
-    } else {
-        print "nproc: exit $npstat\n";
-        for my $line (@npout) {
-            print '> ', $line;
+        my $npstat = get_status('nproc');
+        if ($npstat != 0) {
+            print "nproc: exit $npstat\n";
         }
+
+    } elsif ($sysname eq 'FreeBSD') {
+        run('sysctl', 'kern.sched.topology_spec');
+
+    } else {
+        print "WARNING: don't know how to probe #CPUs on this OS\n";
     }
 
     print "\n";