Problem building 64-bit matplotlib for MacOS X 10.6

I was hoping to build a matplotlib binary installer for python.org's
64-bit Python (MacOS X 10.6 and later). But I've run into problems that
make me think python.org's python is not fully compatible with
ActiveState Tcl/Tk.

Here's what I have:
MacOS X 10.6.8
Python: python-2.7.2-macosx10.6.dmg
Tcl/TK: ActiveTcl8.5.10.1.295062-macosx10.5-i386-x86_64-threaded.dmg
XCode 3.2.6
matplotlib 1.1.0

I edited setupext.py in the matplotlib source directory to set darwin to:
���'darwin' : ['/usr', '/usr/X11'],
The idea was to use only Apple's own libraries for the dependencies.
I did not install wxPython because, as I understand it, there is no
64-bit version.

matplotlib seems to build OK (see appended log) though there are
disturbing messages such as these:
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done

I can import and run Tkinter, though I've not done anything beyond
putting up a root window.

But when I try to import pylab I get:
objc[1083]: Class TKApplication is implemented in both
/Library/Frameworks/Tk.framework/Versions/8.5/Tk and
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two
will be used. Which one is undefined.
objc[1083]: Class TKMenu is implemented in both
/Library/Frameworks/Tk.framework/Versions/8.5/Tk and
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two
will be used. Which one is undefined.
objc[1083]: Class TKContentView is implemented in both
/Library/Frameworks/Tk.framework/Versions/8.5/Tk and
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two
will be used. Which one is undefined.
objc[1083]: Class TKWindow is implemented in both
/Library/Frameworks/Tk.framework/Versions/8.5/Tk and
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two
will be used. Which one is undefined.

Any idea how to deal with this? I've never seen this before and google
was no help. Others have seen this problem but I saw no solution.

-- Russell

P.S. partial log of build (not install) of matplotlib:

BUILDING MATPLOTLIB
�����������matplotlib: 1.1.0
���������������python: 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
�����������������������[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
�������������platform: darwin

REQUIRED DEPENDENCIES
����������������numpy: 1.6.1
������������freetype2: found, but unknown version (no pkg-config)

OPTIONAL BACKEND DEPENDENCIES
���������������libpng: found, but unknown version (no pkg-config)
��������������Tkinter: Tkinter: version not identified, Tk: 8.5, Tcl: 8.5
�����������������Gtk+: no
�����������������������* Building for Gtk+ requires pygtk; you must be
able
�����������������������* to "import gtk" in your build/install
environment
������Mac OS X native: yes
�������������������Qt: no
������������������Qt4: no
����������������Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
�������������datetime: present, version unknown
�������������dateutil: matplotlib will provide
�����������������pytz: matplotlib will provide
adding pytz

OPTIONAL USETEX DEPENDENCIES
���������������dvipng: no
����������ghostscript: /bin/sh: gs: command not found
����������������latex: no

[Edit setup.cfg to suppress the above messages]

···

=========================================================================

pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends',
'matplotlib.backends.qt4_editor', 'matplotlib.projections',
'matplotlib.testing', 'matplotlib.testing.jpl_units',
'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d',
'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1',
'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.tri',
'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil.zoneinfo']
running build
running build_py
...
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot
/Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG
-g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1
-I/Library/Frameworks/Tcl.framework/Headers
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders
-I/Library/Frameworks/Tk.framework/Headers
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders
-I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -Isrc -Iagg24/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Tcl.framework/Headers/freetype2
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders/freet
ype2 -I/Library/Frameworks/Tk.framework/Headers/freetype2
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders/freety
pe2 -I/usr/include/freetype2 -I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -Isrc/freetype2
-Iagg24/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -I/usr/include/freetype2
-I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
src/agg_py_transforms.cpp -o
build/temp.macosx-10.6-intel-2.7/src/agg_py_transforms.o -framework Tcl
-framework Tk
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot
/Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG
-g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1
-I/Library/Frameworks/Tcl.framework/Headers
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders
-I/Library/Frameworks/Tk.framework/Headers
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders
-I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -Isrc -Iagg24/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Tcl.framework/Headers/freetype2
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders/freet
ype2 -I/Library/Frameworks/Tk.framework/Headers/freetype2
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders/freety
pe2 -I/usr/include/freetype2 -I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -Isrc/freetype2
-Iagg24/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -I/usr/include/freetype2
-I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
src/_tkagg.cpp -o build/temp.macosx-10.6-intel-2.7/src/_tkagg.o
-framework Tcl -framework Tk
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot
/Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG
-g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1
-I/Library/Frameworks/Tcl.framework/Headers
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders
-I/Library/Frameworks/Tk.framework/Headers
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders
-I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -Isrc -Iagg24/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Tcl.framework/Headers/freetype2
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders/freet
ype2 -I/Library/Frameworks/Tk.framework/Headers/freetype2
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders/freety
pe2 -I/usr/include/freetype2 -I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -Isrc/freetype2
-Iagg24/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -I/usr/include/freetype2
-I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
CXX/cxx_extensions.cxx -o
build/temp.macosx-10.6-intel-2.7/CXX/cxx_extensions.o -framework Tcl
-framework Tk
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot
/Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG
-g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1
-I/Library/Frameworks/Tcl.framework/Headers
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders
-I/Library/Frameworks/Tk.framework/Headers
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders
-I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -Isrc -Iagg24/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Tcl.framework/Headers/freetype2
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders/freet
ype2 -I/Library/Frameworks/Tk.framework/Headers/freetype2
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders/freety
pe2 -I/usr/include/freetype2 -I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -Isrc/freetype2
-Iagg24/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -I/usr/include/freetype2
-I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
CXX/cxxsupport.cxx -o build/temp.macosx-10.6-intel-2.7/CXX/cxxsupport.o
-framework Tcl -framework Tk
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot
/Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG
-g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1
-I/Library/Frameworks/Tcl.framework/Headers
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders
-I/Library/Frameworks/Tk.framework/Headers
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders
-I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -Isrc -Iagg24/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Tcl.framework/Headers/freetype2
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders/freet
ype2 -I/Library/Frameworks/Tk.framework/Headers/freetype2
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders/freety
pe2 -I/usr/include/freetype2 -I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -Isrc/freetype2
-Iagg24/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -I/usr/include/freetype2
-I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
CXX/IndirectPythonInterface.cxx -o
build/temp.macosx-10.6-intel-2.7/CXX/IndirectPythonInterface.o
-framework Tcl -framework Tk
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot
/Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG
-g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1
-I/Library/Frameworks/Tcl.framework/Headers
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders
-I/Library/Frameworks/Tk.framework/Headers
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders
-I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -Isrc -Iagg24/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Tcl.framework/Headers/freetype2
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders/freet
ype2 -I/Library/Frameworks/Tk.framework/Headers/freetype2
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders/freety
pe2 -I/usr/include/freetype2 -I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -Isrc/freetype2
-Iagg24/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include/freetype2 -I/usr/include/freetype2
-I/usr/X11/include/freetype2 -I./freetype2
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
CXX/cxxextensions.c -o
build/temp.macosx-10.6-intel-2.7/CXX/cxxextensions.o -framework Tcl
-framework Tk
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because
linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because
linking not done
c++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot
/Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk
-g build/temp.macosx-10.6-intel-2.7/src/agg_py_transforms.o
build/temp.macosx-10.6-intel-2.7/src/_tkagg.o
build/temp.macosx-10.6-intel-2.7/CXX/cxx_extensions.o
build/temp.macosx-10.6-intel-2.7/CXX/cxxsupport.o
build/temp.macosx-10.6-intel-2.7/CXX/IndirectPythonInterface.o
build/temp.macosx-10.6-intel-2.7/CXX/cxxextensions.o -L/usr/lib
-L/usr/X11/lib -L/usr/lib -L/usr/X11/lib -lstdc++ -lm -lfreetype -lz
-lstdc++ -lm -o
build/lib.macosx-10.6-intel-2.7/matplotlib/backends/_tkagg.so -framework
Tcl -framework Tk
building 'matplotlib.backends._macosx' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot
/Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG
-g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -I/usr/include -I/usr/X11/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -Isrc -Iagg24/include -I.
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
src/_macosx.m -o build/temp.macosx-10.6-intel-2.7/src/_macosx.o
src/_macosx.m: In function �FigureManager_init�:
src/_macosx.m:3755: warning: class 'View' does not implement the
'NSWindowDelegate' protocol
src/_macosx.m: In function �FigureManager_init�:
src/_macosx.m:3755: warning: class 'View' does not implement the
'NSWindowDelegate' protocol