--- lib/critcl/Config.orig	2025-02-03 21:23:53
+++ lib/critcl/Config	2025-02-05 01:31:39
@@ -50,13 +50,13 @@
 # the "copy" option and then specifically setting the config bits that
 # you want to change. See win32-x86_64-cl for an example.
 
-compile         gcc -c -fPIC
-version         gcc -v
-link            gcc -shared
+compile         @CC@ -c -fPIC
+version         @CC@ -v
+link            @CC@ -shared
 include         -I
 libinclude      -L
-preproc_define  gcc -E -dM
-preproc_enum    gcc -E
+preproc_define  @CC@ -E -dM
+preproc_enum    @CC@ -E
 tclstubs        -DUSE_TCL_STUBS
 tkstubs         -DUSE_TK_STUBS
 debug_memory    -DTCL_MEM_DEBUG
@@ -70,7 +70,7 @@
 link_preload    --unresolved-symbols=ignore-in-shared-libs
 link_rpath      -Wl,-rpath,@
 strip           -Wl,-s
-optimize        -O2
+optimize        -Os
 noassert        -DNDEBUG
 threadflags     -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1    \
                 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1   \
@@ -161,6 +173,21 @@
 
 # Note 2: The platform declarations are required to set up a proper
 # mapping in pkgIndex.tcl of a -pkg.
+
+# macports configured build
+macosx-macports when            {@CRITCL_PLATFORMS@} ne {}
+macosx-macports compile         @CC@ -c \
+    -isysroot $SDKROOT \
+    -mmacosx-version-min=$osxmin \
+    @CFLAGS@
+macosx-macports link            @CC@ -bundle \
+    -isysroot $SDKROOT \
+    -mmacosx-version-min=$osxmin \
+    @CFLAGS@
+macosx-macports link_preload    -undefined dynamic_lookup
+macosx-macports strip
+macosx-macports platform        macosx-macports $osxmin \
+	    @CRITCL_PLATFORMS@
 
 # default on OSX ppc is universal containing ppc and x86 32 bit
 macosx-powerpc when         $ppc
