--- wscript	2025-10-29 07:38:50
+++ wscript	2025-11-24 16:59:54
@@ -282,7 +282,7 @@
         # above) and not darwin then we must be using the GTK2 or GTK3 port of
         # wxWidgets.  If we ever support other ports then this code will need
         # to be adjusted.
-        if not isDarwin:
+        if cfg.WXPORT in ('gtk', 'gtk2', 'gtk3'):
             if conf.options.gtk2:
                 conf.options.gtk3 = False
             if conf.options.gtk2:
@@ -303,6 +291,10 @@
         conf.env.CFLAGS_WXPY.append('-g')
         conf.env.CXXFLAGS_WXPY.append('-g')
 
+        # Otherwise these get dropped for some sources where needed:
+        conf.env.CFLAGS_WXPY.append('-I@PREFIX@/include')
+        conf.env.CXXFLAGS_WXPY.append('-I@PREFIX@/include')
+
         # And if --debug is set turn on more detailed debug info and turn off optimization
         if conf.env.debug:
             for flags in [conf.env.CFLAGS_PYEXT, conf.env.CXXFLAGS_PYEXT]:

--- buildtools/config.py	2025-10-29 07:38:50
+++ buildtools/config.py	2025-11-24 19:27:57
@@ -99,10 +99,6 @@
 
         self.resetVersion()
 
-        # change the PORT default for wxMac
-        if sys.platform[:6] == "darwin":
-            self.WXPORT = 'osx_cocoa'
-
         # and do the same for wxMSW, just for consistency
         if os.name == 'nt':
             self.WXPORT = 'msw'
@@ -295,41 +292,10 @@
                 LDSHARED = self.getWxConfigValue('--ld').replace(' -o', '') + ' ' + LDSHARED
                 self.LDSHARED = os.environ["LDSHARED"]  = LDSHARED
 
-
-            # Other wxMac-only settings
             if sys.platform[:6] == "darwin":
-                self.WXPLAT = '__WXMAC__'
-
-                if self.WXPORT == 'osx_carbon':
-                # Flags and such for a Darwin (Max OS X) build of Python
-                    self.WXPLAT2 = '__WXOSX_CARBON__'
-                else:
-                    self.WXPLAT2 = '__WXOSX_COCOA__'
-
-                if not self.ARCH == "":
-
-                    for arch in self.ARCH.split(','):
-                        for lst in [self.cflags, self.cxxflags]:
-                            lst.append("-arch")
-                            lst.append(arch)
-                        self.lflags.append("-arch")
-                        self.lflags.append(arch)
-
-
-            # wxGTK-only settings
-            else:
-                # Set flags for other Unix type platforms
-                if self.WXPORT == 'gtk':
-                    msg("WARNING: The GTK 1.x port is not supported")
+                if self.WXPORT == 'gtk3':
                     self.WXPLAT = '__WXGTK__'
-                    portcfg = os.popen('gtk-config --cflags', 'r').read()[:-1]
-                    self.BUILD_BASE = self.BUILD_BASE + '-' + self.WXPORT
-                elif self.WXPORT == 'gtk2':
-                    self.WXPLAT = '__WXGTK__'
-                    portcfg = os.popen('pkg-config gtk+-2.0 --cflags', 'r').read()[:-1]
-                elif self.WXPORT == 'gtk3':
-                    self.WXPLAT = '__WXGTK__'
-                    portcfg = os.popen('pkg-config gtk+-3.0 --cflags', 'r').read()[:-1]
+                    portcfg = subprocess.getoutput('pkg-config gtk+-3.0 --cflags')
                 elif self.WXPORT == 'x11':
                     msg("WARNING: The wxX11 port is not supported")
                     self.WXPLAT = '__WXX11__'
@@ -341,15 +307,18 @@
                 else:
                     raise SystemExit("Unknown WXPORT value: " + self.WXPORT)
 
+                print("GTK Flags:", portcfg)
                 self.cflags += portcfg.split()
                 self.cxxflags += portcfg.split()
 
-                # Some distros (e.g. Mandrake) put libGLU in /usr/X11R6/lib, but
-                # wx-config doesn't output that for some reason.  For now, just
-                # add it unconditionally but we should really check if the lib is
-                # really found there or wx-config should be fixed.
-                if self.WXPORT != 'msw':
-                    self.libdirs.append("/usr/X11R6/lib")
+                if not self.ARCH == "":
+
+                    for arch in self.ARCH.split(','):
+                        for lst in [self.cflags, self.cxxflags]:
+                            lst.append("-arch")
+                            lst.append(arch)
+                        self.lflags.append("-arch")
+                        self.lflags.append(arch)
 
             # Move the various -I, -D, etc. flags we got from the config scripts
             # into the distutils lists.
