diff --git extra_tests/ctypes_tests/conftest.py extra_tests/ctypes_tests/conftest.py
--- extra_tests/ctypes_tests/conftest.py
+++ extra_tests/ctypes_tests/conftest.py
@@ -58,7 +58,7 @@ def c_compile(cfilenames, outputfilename
         link_extra = link_extra + ['/DEBUG']  # generate .pdb file
     if sys.platform == 'darwin':
         # support Fink & Darwinports
-        for s in ('/sw/', '/opt/local/'):
+        for s in ('__PREFIX__',):
             if (s + 'include' not in include_dirs
                     and os.path.exists(s + 'include')):
                 include_dirs.append(s + 'include')
diff --git lib_pypy/_tkinter/tklib_build.py lib_pypy/_tkinter/tklib_build.py
--- lib_pypy/_tkinter/tklib_build.py
+++ lib_pypy/_tkinter/tklib_build.py
@@ -18,10 +18,9 @@ elif sys.platform == 'win32':
     linklibs = ['tcl85', 'tk85']
     libdirs = []
 elif sys.platform == 'darwin':
-    # homebrew
-    incdirs = ['/usr/local/opt/tcl-tk/include']
-    linklibs = ['tcl8.6', 'tk8.6']
-    libdirs = ['/usr/local/opt/tcl-tk/lib']
+    incdirs = ['__PREFIX__/include']
+    linklibs = ['tcl', 'tk']
+    libdirs = []
 else:
     # On some Linux distributions, the tcl and tk libraries are
     # stored in /usr/include, so we must check this case also
diff --git pypy/tool/cpyext/extbuild.py pypy/tool/cpyext/extbuild.py
--- pypy/tool/cpyext/extbuild.py
+++ pypy/tool/cpyext/extbuild.py
@@ -175,7 +175,7 @@ def c_compile(cfilenames, outputfilename
         link_extra = link_extra + ['/DEBUG']  # generate .pdb file
     if sys.platform == 'darwin':
         # support Fink & Darwinports
-        for s in ('/sw/', '/opt/local/'):
+        for s in ('__PREFIX__',):
             if (s + 'include' not in include_dirs
                     and os.path.exists(s + 'include')):
                 include_dirs.append(s + 'include')
