--- build.tcl
+++ build.tcl
@@ -41,7 +41,7 @@ proc usage {{status 1}} {
 	![string match {invalid command name "_*"*} $errorInfo]
     } {
 	puts stderr $::errorInfo
-	exit
+	exit $status
     }
 
     global argv0
--- lib/app-critcl/runtime.tcl
+++ lib/app-critcl/runtime.tcl
@@ -112,7 +112,7 @@ proc ::critcl::runtime::MapPlatform {{mapping {}}} {
 
     set platform [::platform::generic]
     set version $::tcl_platform(osVersion)
-    if {[string match "macosx-*" $platform]} {
+    if {[string match "macos*-*" $platform]} {
 	# "normalize" the osVersion to match OSX release numbers
 	set v [split $version .]
 	set v1 [lindex $v 0]
--- lib/critcl-platform/platform.tcl
+++ lib/critcl-platform/platform.tcl
@@ -180,6 +180,7 @@ proc ::platform::identify {} {
 	    append plat $text
 	    return "${plat}-${cpu}"
 	}
+	macos -
 	macosx {
 	    set major [lindex [split $tcl_platform(osVersion) .] 0]
 	    if {$major > 8} {
@@ -195,7 +196,7 @@ proc ::platform::identify {} {
 	            incr major -4
 		        append plat 10.$major
 	        }
-		    return "${plat}-${cpu}"
+		    return "macosx-${cpu}"
 	    }
 	}
 	linux {
@@ -337,27 +338,50 @@ proc ::platform::patterns {id} {
 		}
 	    }
 	}
-	macosx-aarch64 {
-	    lappend res macosx-arm macosx-arm64 macosx-universal2
+	macos*-aarch64 {
+	    foreach m {macosx macos} {
+	        if {${m}-aarch64 ni $res} {
+	            lappend res ${m}-aarch64
+	        }
+	        lappend res ${m}-arm ${m}-arm64
+	    }
+	    lappend res macosx-universal2
 	}
-	macosx-arm {
-	    lappend res macosx-arm64 macosx-aarch64 macosx-universal2
+	macos*-arm {
+	    foreach m {macosx macos} {
+	        if {${m}-aarch64 ni $res} {
+	            lappend res ${m}-arm
+	        }
+	        lappend res ${m}-aarch64 ${m}-arm64
+	    }
+	    lappend res macosx-universal2
 	}
-	macosx-arm64 {
-	    lappend res macosx-arm macosx-aarch64 macosx-universal2
+	macos*-arm64 {
+	    foreach m {macosx macos} {
+	        if {${m}-aarch64 ni $res} {
+	            lappend res ${m}-arm64
+	        }
+	        lappend res ${m}-arm ${m}-aarch64
+	    }
+	    lappend res macosx-universal2
 	}
 	macosx-powerpc {
 	    lappend res macosx-universal
 	}
-	macosx-x86_64 {
+	macos*-x86_64 {
+	    foreach m {macosx macos} {
+	        if {${m}-x86_64 ni $res} {
+	            lappend res ${m}-x86_64
+	        }
+	    }
 	    lappend res macosx-i386-x86_64 macosx-universal2
 	}
-	macosx-ix86 {
+	macos*-ix86 {
 	    lappend res macosx-universal macosx-i386-x86_64
 	}
-	macosx*-*    {
+	macos*-*    {
 	    # 10.5+
-	    if {[regexp {macosx([^-]*)-(.*)} $id -> v cpu]} {
+	    if {[regexp {macosx?([^-]*)-(.*)} $id -> v cpu]} {
 
 		switch -exact -- $cpu {
 		    aarch64 {
--- lib/critcl/Config.orig
+++ lib/critcl/Config
@@ -80,7 +80,7 @@ threadflags     -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1    \
 
 # OSX - check if universal binaries supported by the installed toolchain
 
-if {[string match macosx-* $platform]} {
+if {[regexp macosx?- $platform]} {
     if {[info exists ::env(osxmin)] && $::env(osxmin) ne ""} {
         set osxmin $::env(osxmin)
     } elseif {[info exists ::env(MACOSX_DEPLOYMENT_TARGET)] && $::env(MACOSX_DEPLOYMENT_TARGET) ne ""} {
@@ -189,7 +189,9 @@ macosx-universal2 link_preload    -undefined dynamic_lookup
 macosx-universal2 strip
 macosx-universal2 platform        macosx-universal2 $osxmin \
 	    macosx-arm64 \
-	    macosx-x86_64
+	    macosx-x86_64 \
+	    macos-arm64 \
+	    macos-x86_64
 
 # default on older OSX intel is universal containing x86 32 and 64 bit
 macosx-ix86 when            $i386 && $x86_64
@@ -203,7 +205,8 @@ macosx-ix86 link_preload    -undefined dynamic_lookup -mmacosx-version-min=10.3
 macosx-ix86 strip
 macosx-ix86 platform        macosx-ix86 $osxmin \
 	    macosx-ix86 \
-	    macosx-x86_64
+	    macosx-x86_64 \
+	    macos-x86_64
 
 # target for most common architectures
 macosx-most when            $ppc && $i386 && $x86_64
@@ -218,7 +221,8 @@ macosx-most strip
 macosx-most platform        macosx-most $osxmin \
 	    macosx-powerpc \
 	    macosx-ix86 \
-	    macosx-x86_64
+	    macosx-x86_64 \
+	    macos-x86_64
 
 # target for old universal, ppc and x86 32.
 macosx-universal when            $ppc && $i386
@@ -248,7 +252,8 @@ macosx-all platform        macosx-all $osxmin \
 	    macosx-powerpc \
 	    macosx-powerpc64 \
 	    macosx-ix86 \
-	    macosx-x86_64
+	    macosx-x86_64 \
+	    macos-x86_64
 
 # OSX ppc 32 bit
 macosx-ppc32 when           $ppc
@@ -282,6 +287,10 @@ macosx-x86_64 link_preload  -undefined dynamic_lookup
 macosx-x86_64 strip
 macosx-x86_64 platform      macosx-x86_64
 
+macos-x86_64 when           $x86_64
+macos-x86_64 copy           macosx-x86_64
+macos-x86_64 platform       macos-x86_64
+
 # OSX arm 64 bit
 macosx-arm64 when           $arm64
 macosx-arm64 compile        clang -c -arch arm64
@@ -298,6 +307,18 @@ macosx-arm when             $arm64
 macosx-arm copy             macosx-arm64
 macosx-arm platform         macosx-arm
 
+macos-arm64 when            $arm64
+macos-arm64 copy            macosx-arm64
+macos-arm64 platform        macos-arm64
+
+macos-arm when              $arm64
+macos-arm copy              macosx-arm64
+macos-arm platform          macos-arm
+
+macos-aarch64 when          $arm64
+macos-aarch64 copy          macosx-arm64
+macos-aarch64 platform      macos-aarch64
+
 # Linux - 32 bit or 64 bit build - select using "-target" if you don't
 #         want the platform default (32 on 32, 64 on 64). This requires
 #         some work to detect the cpu class in use and then set a platform
--- lib/critcl/critcl.tcl
+++ lib/critcl/critcl.tcl
@@ -1977,7 +1977,7 @@ proc ::critcl::framework {args} {
     # Check if we are building for OSX and ignore the command if we
     # are not. Our usage of "actualtarget" means that we allow for a
     # cross-compilation environment to OS X as well.
-    if {![string match "macosx*" [actualtarget]]} return
+    if {![string match "macos*" [actualtarget]]} return
 
     foreach arg $args {
 	# if an arg contains a slash it must be a framework path
