
$oGc        2   @   s  d  Z  d d k Z d d k Z h  d g d <d d g d <d d g d <d d g d	 <d
 d d d d d g d <d d g d <d d g d <d d g d <e i d  p d g d <d d g d <d d g d <d g d <Z d d k Z d d k Z d d k Z e i d j o d d k Z n d d k	 l
 Z
 d d k l Z d d k l Z d d k Z d d k Z e i \ Z Z Z Z Z e d j  p e d j o e d j  o d Z d Z n e Z e Z e a e a e a e a e a e a e a e a  e a! e a" e a# e a! e a$ d a& d Z' g  Z( h  e d <e d  <d! d" <d! d# <d! d$ <d! d% <e d& <d! d' <d! d( <d! d) <d! d* <e d+ <e d, <d d- <d d. <Z) e i* i+ d/  oe i,   Z- e- i. d/  y e- i/ d0 d1  e) d <Wn n Xy e- i/ d0 d   e) d  <Wn n Xy e- i/ d2 d3  e) d" <Wn d! e) d" <n Xy e- i/ d2 d4  e) d# <Wn d! e) d# <n Xy e- i/ d2 d5  e) d$ <Wn d! e) d$ <n Xy e- i/ d2 d6  e) d% <Wn d! e) d% <n Xy e- i/ d7 d8  e) d' <Wn d! e) d' <n Xy e- i/ d7 d9  e) d( <Wn d! e) d( <n Xy e- i/ d7 d:  e) d) <Wn d! e) d) <n Xy e- i/ d7 d;  e) d* <Wn d! e) d* <n Xy e- i0 d< d-  e) d- <Wn n Xy e- i0 d< d.  e) d. <WqqXn e) d o+ d= d>  Z1 d?   Z2 d@   Z3 dA   Z4 n dB   Z1 e1 Z2 Z3 Z4 dC d dD     YZ5 dE   Z6 dF   Z7 e7   Z8 e i d j o e8 dG j o
 g  Z9 n dH dI g Z9 dJ   Z: d e: _; dK dL dM  Z< dN   Z= dO   Z> dP   Z? dQ   Z@ dR   ZA dS   ZB dT   ZC dU   ZD dV   ZE dW   ZF dX   ZG dY   ZH e dZ  ZI e d[  ZJ d\   ZK d]   ZL d^   ZM d_   ZN d`   ZO da   ZP db   ZQ dc   ZR dd   ZS de   ZT df   ZU dg   ZV dh   ZW di   ZX dj   ZY dk   ZZ dl   Z[ dm   Z\ dn   Z] do   Z^ dp   Z_ dq   Z` dr   Za ds   Zb dt   Zc du   Zd dv   Ze dw   Zf dx   Zg dy   Zh dz   Zi d{   Zj d|   Zk d}   Zl d~   Zm d S(   sr  
Some helper functions for building the C extensions

you may need to edit basedir to point to the default location of your
required libs, eg, png, z, freetype

DARWIN

  I have installed all of the backends on OSX.

  Tk: If you want to install TkAgg, I recommend the "batteries included"
  binary build of Tcl/Tk at
  http://www.apple.com/downloads/macosx/unix_open_source/tcltkaqua.html

  GTK: I installed GTK from src as described at
  http://www.macgimp.org/index.php?topic=gtk.  There are several
  packages, but all configure/make/make install w/o problem.  In
  addition to the packages listed there, You will also need libpng,
  libjpeg, and libtiff if you want output to these formats from GTK.

WIN32 - MINGW

  If you are sufficiently masochistic that you want to build this
  yourself, download the win32_static dir from
  http://matplotlib.sourceforge.net/win32_static.tar.gz and
  see the README file in that dir

  > python setup.py build --compiler=mingw32 bdist_wininst  > build23.out

  NOTE, if you are building on python24 on win32, see
  http://mail.python.org/pipermail/python-list/2004-December/254826.html

WIN32 - VISUAL STUDIO 7.1 (2003)

  This build is similar to the mingw.  Download the visual studio static
  dependencies from
  http://matplotlib.sourceforge.net/win32_static_vs.tar.gz and
  see the README in that dir

  > python setup.py build bdist_wininst

iNt   win32_statict   win32s
   /usr/locals   /usrt   linux2t   linuxt   cygwins   /sw/lib/freetype2s   /sw/lib/freetype219s   /sws
   /usr/X11R6t   darwint   freebsd4t   freebsd5t   freebsd6t
   MPLIB_BASEt   sunos5t   gnukfreebsd5t   gnukfreebsd6t   aix5(   t   Set(   t   fill(   t	   Extensioni   i   i   i    t   agg23t   display_statust   verboset   autot   provide_pytzt   provide_dateutilt   provide_configobjt   provide_traitst	   build_aggt	   build_gtkt   build_gtkaggt   build_tkaggt   build_wxaggt   build_imaget   build_windowingt   backendt   numerixs	   setup.cfgt   statust   suppresst   provide_packagest   pytzt   dateutilt	   configobjs   enthought.traitst   gui_supportt   gtkt   gtkaggt   tkaggt   wxaggt
   rc_optionst   =c         C   s   |  d GHd  S(   NiL   (    (   t   char(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt
   print_line   s    c         C   s;   d |  } d d } t  t |  d d d | d | GHd  S(   Ns   %22s: t    i   t   widthiL   t   initial_indentt   subsequent_indent(   R   t   str(   t   packageR"   R3   t   indent(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   print_status   s
    

c         C   s5   d d d } t  t |   d d d | d | GHd  S(   NR1   i   s   * R2   iL   R3   R4   (   R   R5   (   t   messageR7   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   print_message   s    c         C   s	   |  GHd  S(   N(    (   t   section(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt	   print_raw   s    c          O   s   d  S(   N(    (   t   argst   kwargs(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR0      s    t   CleanUpFilec           B   s    e  Z d  Z d   Z d   Z RS(   sB   CleanUpFile deletes the specified filename when self is destroyed.c         C   s   | |  _  d  S(   N(   t   name(   t   selfR@   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   __init__   s    c         C   s   t  i |  i  d  S(   N(   t   ost   removeR@   (   RA   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   __del__   s    (   t   __name__t
   __module__t   __doc__RB   RE   (    (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR?      s   	c         C   sn   t  |   i   } t  | d  i |  t i |   } t i | | i | i f  t |  t	   d | <d S(   s   temp_copy copies a named file into a named temporary file.
    The temporary will be deleted when the setupext module is destructed.
    s   w+t	   _cleanup_N(
   t   opent   readt   writeRC   t   statt   utimet   st_atimet   st_mtimeR?   t   globals(   t   _fromt   _tot   st   stats(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt	   temp_copy   s
    c          C   s-   x& t  i D] }  d |  j o d Sq
 q
 Wd S(   Nt   mingw32t   msvc(   t   syst   argv(   t   v(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   get_win32_compiler   s
    
 RX   s   stdc++t   mc          C   sc   t  i d  j	 o t  i Sn t i d j o t t  _ n% t i d  \ }  } |  d j t  _ t  i S(   NR   s   pkg-config --helpi    (   t   has_pkgconfigt   cachet   NoneRY   t   platformt   Falset   commandst   getstatusoutput(   R"   t   output(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR^      s    s   --libs --cflagss
   pkg-configc         C   sn  t    p t Sn h  d d <d d <d d <d d <d	 d
 <} t i d | | | f  \ } } | d j o x | i   D] } | i | d  t  } | t j	 o | d  d j oD t | d i d   }	 t |	  d j o |	 d t f }	 q	n | d }	 t	 |  |  }
 |	 |
 j o |
 i
 |	  q^q | |  i j o |  i i
 |  q q Wt Sn t S(   sv   Loosely based on an article in the Python Cookbook:
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502261t   include_dirss   -It   library_dirss   -Lt	   librariess   -lt   define_macross   -Dt   undef_macross   -Us   %s %s %si    i   R.   i   (   R^   Rb   Rc   Rd   t   splitt   getR`   t   tuplet   lent   getattrt   appendt   extra_link_argst   True(   t   modulet   packagest   flagst   pkg_config_exect   _flagsR"   Re   t   tokent   attrt   valuet   set(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   get_pkgconfig   s4    
			 
c         C   sJ   d } t    p | Sn t i d |   \ } } | d j o | Sn | S(   Ns*   found, but unknown version (no pkg-config)s   pkg-config %s --modversioni    (   R^   Rc   Rd   (   R6   t   defaultR"   Re   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   get_pkgconfig_version  s    
c         C   s(   t  |  |  p |  i i |  n d  S(   N(   R|   Rh   Rp   (   Rs   R6   t   fallback(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   try_pkgconfig  s    c         C   s?   x8 |  D]0 } t  i i t  i i | |   o t Sq q Wt S(   N(   RC   t   patht   existst   joinRr   Rb   (   Rf   t   filenamet   d(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   find_include_file  s
     "c          C   s   t  d g   }  t |   t |  d  p> |  i } x1 | D]% } |  i i t i i | d   q: Wn t d t	 d   t
 |  i d  p= t d d i g  } |  i D] } | d | q ~   n t S(   Nt   testt	   freetype2s
   ft2build.hs9   WARNING: Could not find 'freetype2' headers in any of %s.s   , s   '%s'(   R   t   add_base_flagsR|   Rf   Rp   RC   R   R   R8   R~   R   R:   Rr   (   Rs   t   basedirsR   t   _[1]t   x(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_freetype%  s    

 '7c          C   s   t  d g   }  t |  d  t |   t d t d   t |  i d  p= t d d i g  } |  i D] } | d | qf ~   n t	 S(   NR   t   libpngs   png.hs,   Could not find 'libpng' headers in any of %ss   , s   '%s'(
   R   R|   R   R8   R~   R   Rf   R:   R   Rr   (   Rs   R   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_libpng5  s    
7c         C   s   t  t i i g  } t t i D] } | t i i | d  q ~  } t  t i i g  } t t i D] } | t i i | d  qd ~ g  } t t i D] } | t i i | d  q ~  } |  i i	 |  |  i i
 d  |  i i	 |  d  S(   Nt   includet   libt   lib64t   .(   t   filterRC   R   R   t   basedirRY   Ra   R   Rf   t   extendRp   Rg   (   Rs   R   t   pt   incdirst   _[2]t   _[3]t   libdirs(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR   B  s    :4;c         C   s   t  i |   i   i   } | S(   s"   get the output of a system command(   RC   t   popenRK   t   strip(   RT   t   ret(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt	   getoutputM  s    c         C   sl   d |  }  g  } xL t  |   d j o8 |  d  |  d }  } | i d t t | d    q Wd i |  S(   Ns   %xi    ii   R   (   Rn   t   insertR5   t   intR   (   t   versiont   tempt   chunk(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   convert_qt_versionS  s    
$c       	   C   sn   y d d  k  }  Wn$ t j
 o t d d  t Sn5 Xt d d t |  i   i  |  i   i f  t Sd  S(   Nit   Qtt   nos   Qt: %s, PyQt: %s(	   t
   pyqtconfigt   ImportErrorR8   Rb   R   t   Configurationt
   qt_versiont   pyqt_version_strRr   (   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_qt[  s    		c       	   C   sr   y d d k  l }  Wn$ t j
 o t d d  t Sn5 Xt d d t |  i   i  |  i   i f  t	 Sd  S(   Ni(   R   t   Qt4R   s   Qt: %s, PyQt4: %s(
   t   PyQt4R   R   R8   Rb   R   R   R   R   Rr   (   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_qt4g  s    		c          C   sO   y d d  k  }  Wn$ t j
 o t d d  t Sn Xt d |  i  t Sd  S(   Nit   CairoR   (   t   cairoR   R8   Rb   R   Rr   (   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_cairos  s    	c          C   sL   y d d  k  }  Wn$ t j
 o t d d  t Sn Xt d d  t Sd  S(   Nit   datetimeR   s   present, version unknown(   R   R   R8   Rb   Rr   (   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_datetime}  s    	c         C   s   |  o& t  d t j o t d d  t Sn y d d  k } WnK t j
 o? |  o  t  d o t d d  t Sq t d d  t Sn> X| i i d  o t d d  t Sn t d | i  t Sd  S(   NR   R%   s   matplotlib will provideiR   t   mpl(   t   optionsRr   R8   R%   R   Rb   t   __version__t   endswith(   t   hasdatetimeR%   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_provide_pytz  s     	c      
   C   s   |  o& t  d t j o t d d  t Sn y d d  k } WnK t j
 o? |  o  t  d o t d d  t Sq t d d  t Sni Xy@ | i i d  o t d d  t Sn t d | i  t SWn$ t j
 o t d d  t Sn Xd  S(   NR   R&   s   matplotlib will provideiR   R   s   present, version unknown(	   R   Rr   R8   R&   R   Rb   R   R   t   AttributeError(   R   R&   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_provide_dateutil  s(    	c          C   s   t  d t j o t d d  t Sn y d d  k }  WnD t j
 o8 t  d o t d d  t Sq t d d  t Sn> X|  i i d  o t d d  t Sn t d |  i  t Sd  S(   NR   R'   s   matplotlib will provideiR   R   (   R   Rr   R8   R'   R   Rb   R   R   (   R'   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_provide_configobj  s     	c          C   s  t  d t j o t d d  t Sn y d d k l }  y d d k l } Wn t d d  t Snc Xy | i } Wn t j
 o | i	 } n X| i
 d  o t d d  t Sn t d |  t SWnD t j
 o8 t  d o t d d  t Sqt d d	  t Sn Xd  S(
   NR   s   enthought.traitss   matplotlib will providei(   t   traits(   R   s'   unknown and incompatible version: < 2.0R   R   (   R   Rr   R8   t	   enthoughtR   t   enthought.traitsR   Rb   R   R   R   R   (   R   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_provide_traits  s2    c          C   so   y> t  i d  \ }  } t d | i   d i   d  t SWn* t t f j
 o t d d  t Sn Xd  S(   Ns   dvipng -versiont   dvipngi   iR   (	   RC   t   popen4R8   t	   readlinesRk   Rr   t
   IndexErrort
   ValueErrorRb   (   t   stdint   stdout(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_dvipng  s    !c          C   s   yT t  i d j o
 d }  n d }  t i |   \ } } t d | i   d   t SWn* t t f j
 o t d d  t	 Sn Xd  S(   NR   s   gswin32c --versions   gs --versiont   ghostscriptiR   (
   RY   Ra   RC   R   R8   RK   Rr   R   R   Rb   (   t   commandR   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_ghostscript  s    
c          C   s   y[ t  i d  \ }  } | i   d } d } t i | |  } t d | i d   t SWn- t t	 t
 f j
 o t d d  t Sn Xd  S(   Ns   latex -versioni    s   3\.1\d+t   latexR   (   RC   R   R   t   ret   searchR8   t   groupRr   R   R   R   Rb   (   R   R   t   linet   patternt   match(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_latex  s    c          C   s   y\ t  i d  \ }  } x@ | i   D]2 } d | j o t d | i   d  t Sq% q% WWn* t t f j
 o t d d  t Sn Xd  S(   Ns
   pdftops -vR   t   pdftopsiR   (	   RC   R   R   R8   Rk   Rr   R   R   Rb   (   R   R   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_pdftops  s     c       	   C   s   t  }  y d d  k } Wn. t j
 o" t d d  t d  t  Sn Xt d g   } t |  t |  t d | i  t	 | i
 t i i d d   p t d  n t S(   Nit   numpyR   s+   You must install numpy to build matplotlib.R   s   arrayobject.hsW   Could not find the headers for numpy.  You may need to install the development package.(   Rb   R   R   R8   R:   R   t   add_numpy_flagsR   R   R   Rf   RC   R   R   Rr   (   t   gotitR   Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_numpy  s    
	

"c         C   sV   d d k  } y |  i i | i    Wn) t j
 o |  i i | i    n Xd S(   s9   Add the modules flags to build extensions which use numpyiN(   R   Rf   Rp   t   get_includeR   t   get_numpy_include(   Rs   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR   '  s
    c         C   s^   t  |  d d  |  i i d  t |   |  i i d d d t d g  |  i i t  d S(	   s6   Add the module flags to build extensions which use aggR   t   pngt   zt   srct   swigs
   %s/includeR   N(   R   Rh   Rp   R   Rf   R   t   AGG_VERSIONt   std_libs(   Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   add_agg_flags0  s
    
 c         C   s  t  |  d  p-|  i i d d g  t |   |  i } x | D] } |  i i t i i | d   t i i | d  } t i i	 |  o |  i i |  n t i i | d  } t i i	 |  o |  i i |  qA qA W|  i
 } xX | D]B } t i i | d  } t i i	 |  o |  i
 i |  q q Wn t |   t i d j o! t d j o |  i i d	  n |  i i t  d
 S(   s)   Add the module flags to ft2font extensionR   t   freetypeR   s   lib/freetype2/includes   lib/freetype2/include/freetype2s   freetype2/libR   RW   t   gw32cN(   R|   Rh   R   R   Rf   Rp   RC   R   R   R   Rg   RY   Ra   t   win32_compilerR   (   Rs   R   R   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   add_ft2font_flags<  s(    

 '+
 /
c    
      C   s  t  }  d } y d d k } Wn1 t j
 o d } nK t j
 o d } n3 Xd } | i | j  o d | | i } n t }  |  ox t d g   } t |  t	 | i
 t i i d	 d
   p9 d d i g  } | i
 D] } | d | q ~  } q n d   } |  oq d d k } t | d  o | | i  }	 n d }	 t d d | | i  | | i  | | i  |	 f  n t d d  | d j	 o t |  n |  S(   s   check for the presence of pygtkiNsd   Building for Gtk+ requires pygtk; you must be able to "import gtk" in your build/install environments   pygtk present but import failedi   i    sM   Error: GTK backend requires PyGTK %d.%d.%d (or later), %d.%d.%d was detected.R   R)   s   gtk.hs(   Could not find Gtk+ headers in any of %ss   , s   '%s'c         S   s.   d i  g  } |  D] } | t |  q ~  S(   NR   (   R   R5   (   t   tupR   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   ver2strr  s    t   pygobject_versions   [pre-pygobject]s   Gtk+s,   gtk+: %s, glib: %s, pygtk: %s, pygobject: %sR   (   i   i   i    (   Rb   R`   R)   R   t   RuntimeErrort   pygtk_versionRr   R   t   add_pygtk_flagsR   Rf   RC   R   R   t   gobjectt   hasattrR   R8   t   gtk_versiont   glib_versionR:   (
   R   t   explanationR)   R   Rs   R   R   R   R   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_gtkW  s@    

":		c         C   s  t  i d j o|  i i d d g  |  i i d d d d d d	 d
 d d d d d g  t |   t i i d  p d t i d <n t	 d  i
   } t	 d  i
   } | | } |  i i g  } | D] } | | d q ~  t	 d  i
   } t	 d  i
   } | | } |  i i g  }	 | D]% }
 |
 i d  o |	 |
 d q'q'~	  |  i i g  } | D]% }
 |
 i d  o | |
 d qjqj~  |  i i g  } | D]1 }
 |
 i d  p |
 i d  p | |
 qq~  t  i d j o1 t d j o$ d |  i j o |  i i d  q-n t  i d j o t |   t |  d  n t  i d j o1 t d j o$ d |  i j o |  i i d  n d S(   s6   Add the module flags to build extensions which use gtkR   s
   C:/GTK/bins
   C:/GTK/libs   win32_static/include/pygtk-2.0s   C:/GTK/includes   C:/GTK/include/gobjects   C:/GTK/include/gmodules   C:/GTK/include/glibs   C:/GTK/include/pangos   C:/GTK/include/atks   C:/GTK/include/X11s   C:/GTK/include/cairos   C:/GTK/include/gdks   C:/GTK/include/gdk-pixbufs   C:/GTK/include/gtkt   PKG_CONFIG_PATHs   C:\GTK\lib\pkgconfigs$   pkg-config --cflags-only-I pygtk-2.0s#   pkg-config --cflags-only-I gtk+-2.0i   s   pkg-config --libs pygtk-2.0s   pkg-config --libs gtk+-2.0s   -ls   -LRX   R]   s   pygtk-2.0 gtk+-2.0N(   RY   Ra   Rg   R   Rf   R   RC   t   environt   has_keyR   Rk   Rh   t
   startswithRq   R   RD   R|   (   Rs   t   pygtkIncludest   gtkIncludest   includesR   R   t   pygtkLinkert	   gtkLinkert   linkerFlagsR   t   flagR   t   _[4](    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR     sP    		


/
	:	:	5-
-c          C   s  t  }  d  } y d d  k } Wn t j
 o d } n Xt | d d  d d !d j o t d | i  t Sne t i	 d	 j o t
 d
 j o
 d } n> t   } | d  j o
 d } n t |  p
 d } n t }  |  o~ t d g   } t | |  t | i t i i d d d   p9 d d i g  } | i D] } | d | q3~  } qYn |  o t d | i  n t d d  | d  j	 o t |  n |  S(   Nis   wxPython not foundR   s   0.0i    i   s   2.8t   wxPythonR   RW   s   The wxAgg extension can not be built using the mingw32 compiler on Windows, since the default wxPython binary is built using MS Visual Studios  
WXAgg's accelerator requires `wx-config'.

The `wx-config' executable could not be located in any directory of the
PATH environment variable. If you want to build WXAgg, and wx-config is
in some other location or has some other name, set the WX_CONFIG
environment variable to the full path of the executable like so:

export WX_CONFIG=/usr/lib/wxPython-2.6.1.0-gtk2-unicode/bin/wx-config
se   WXAgg's accelerator not building because a broken wxPython (installed by Apple's Mac OS X) was found.R   t   wxs
   wxPython.hs,   Could not find wxPython headers in any of %ss   , s   '%s'R   (   Rb   R`   R  R   Ro   R8   R   Rr   RY   Ra   R   t   find_wx_configt'   check_wxpython_broken_macosx104_versionR   t   add_wx_flagsR   Rf   RC   R   R   R:   (   R   R   R  t   wxconfigRs   R   R   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_wx  s>     
	


:c          C   s   t  i d  }  |  t j	 o |  Sn t  i d  p d } xG | i d  D]6 } t  i i | d  }  t  i i |   o |  SqJ qJ Wt S(   s   If the WX_CONFIG environment variable has been set, returns it value.
    Otherwise, search for `wx-config' in the PATH directories and return the
    first match found.  Failing that, return None.
    t	   WX_CONFIGt   PATHt    t   :s	   wx-config(   RC   t   getenvR`   Rk   R   R   R   (   R  R   t   dir(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR    s     c         C   sN   t  i d j o: |  d j o) t |  d  } | d j o t SqF qJ n t S(   sF   Determines if we're using a broken wxPython installed by Mac OS X 10.4R   s   /usr/bin/wx-configs    --version-fulls   2.5.3.1(   RY   Ra   R   Rb   Rr   (   R  t   version_full(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR    s    c         C   s   t  i d j oR d d d d d d d d	 d
 d d d g } |  i i |  |  i i |  d Sn t |  d d d d d d S(   sF   
    Add the module flags to build extensions which use wxPython.
    R   t   wxexpatht   wxjpeght	   wxmsw26uht   wxmsw26uh_animatet   wxmsw26uh_gizmost   wxmsw26uh_gizmos_xrct   wxmsw26uh_glt   wxmsw26uh_stct   wxpnght	   wxregexuht   wxtiffht   wxzlibhNR
  Ru   s   --cppflags --libsRv   s	   wx-config(   RY   Ra   Rh   R   R|   (   Rs   R  t   wxlibs(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR    s    		c          C   st  t  }  d  } y d d  k } Wn1 t j
 o d } n: t j
 o d } n" X| i d j  o
 d } n t }  |  o t d g   } y t |  } Wn' t j
 o } t	 |  } t  }  qXt
 | i d  p9 d d	 } | d  j	 o | d
 | 7} n | } t  }  qn |  o1 t d d | i i   d | i | i f  n t d d  | d  j	 o t |  n |  S(   Nis   TKAgg requires Tkinters!   Tkinter present but import failedg @s   Tcl/Tk v8.3 or later requiredR   s   tk.hs1   Tkinter present, but header files are not found. s-   You may need to install development packages.s   
t   Tkinters   Tkinter: %s, Tk: %s, Tcl: %siR   (   Rb   R`   R  R   R   t	   TkVersionRr   R   t   add_tk_flagsR5   R   Rf   R8   R   Rk   t
   TclVersionR:   (   R   R   R  Rs   t   eR9   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   check_for_tk"  s@    

	(c          C   s  t  d j	 o t  Sn d d k }  d } d } y |  i   } Wn |  i j
 ou y |  i   } Wn( t j
 o q |  i j
 o q Xt | i d   } | i	 d d  i	 d d  } n6 X| i
   t | i d   } t | i d	   } | | t |  i  d
  f a  t  S(   s@  Tries to open a Tk window in order to query the Tk object about its library paths.
       This should never be called more than once by the same process, as Tk intricacies
       may cause the Python interpreter to hang. The function also has a workaround if
       no X server is running (useful for autobuild systems).iNR
  t   tcl_libraryt   Tclt   Tkt   tclt   tkt
   tk_libraryi   (   t   TCL_TK_CACHER`   R  R$  t   TclErrorR#  R   R5   t   getvart   replacet   withdrawR  (   R  t   tcl_lib_dirt
   tk_lib_dirR&  R%  (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   query_tcltkK  s*    #
c         C   sb  t  } t i d j o t i \ } } } } } | d j o: | d+ j o- |  i i d g  |  i i d d g  nT | d j o: | d j o- |  i i d	 g  |  i i d
 d g  n t d   |  i i t	 i
 i t i d  g  nnt i d j od d k l } l } | t	 i d  d  d d g }	 d }
 xE |	 D]= } x4 d, D]% } | | | | d   p PqRqRWd }
 PqEW|
 o g  } d- D]* } d. D] } | | | | d |  qq~ } d d d d g } |  i i |  |  i i |  |  i i |  q^nJt   \ } } } | d j o| d j ot	 i
 i t	 i
 i | d   } t	 i
 i t	 i
 i | d   } t	 i
 i t	 i
 i | d |   } t	 i
 i |  p% t	 i
 i t	 i
 i | d   } n t	 i
 i t	 i
 i | d  |   } t	 i
 i |  p% t	 i
 i t	 i
 i | d   } n t	 i
 i t	 i
 i | d!   o, t	 i
 i t	 i
 i | d!   o
 | } n t	 i
 i |  pM t i i d"  o6 t	 i
 i d#  o# t	 i
 i d$  o d% } d% } qqn% d& } d' } d' } d( } d( } d } |  i i | | g  |  i i | | g  |  i i d) | d* | g  | S(/   s5   Add the module flags to build extensions which use tkR   i   i   i   i   s   win32_static/include/tcl8.4t   tk84t   tcl84s   win32_static/include/tcl8.3t   tk83t   tcl83s/   No tk/win32 support for this python version yett   dllsR   i(   R   R   t   HOMEs   /Library/Frameworkss   /System/Library/Frameworks/i    R#  R$  s
   .frameworki   t   Headerss   Versions/Current/PrivateHeaderss
   -frameworkR
  s   ../s   ../../include/tcls   ../../includes   ../../include/tks   tk.hR   s   /usr/include/tcl.hs   /usr/include/tk.hs   /usr/includes   Using default library and include directories for Tcl and Tk because a
Tk window failed to open.  You may need to define DISPLAY for Tk to work
so that setup can determine where your libraries are located.s   /usr/local/includes   /usr/local/libR&  R%  (   i   i   i   (   s   Tcls   Tk(   s   Tcls   Tk(   R6  s   Versions/Current/PrivateHeaders(   R`   RY   Ra   t   version_infoRf   R   Rh   R   Rg   RC   R   R   t   prefixt   os.pathR   R  Rq   t   extra_compile_argsR/  t   normpathR   (   Rs   R9   t   majort   minor1t   minor2RT   t   tmpR   R   t   framework_dirst   tk_framework_foundt   Ft   fwR   t   Ht   tk_include_dirst
   frameworksR-  R.  t   tk_vert   tcl_libt   tk_libt   tcl_inct   tk_inc(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR  s  s    )	  	
-!!#"
c         C   sM   |  i  i d g  |  i i d g  |  i i d g  |  i i d  d S(   s<   Add the module flags to build extensions using windowing apis
   C:/includet   user32s   C:/libs	   -mwindowsN(   Rf   R   Rh   Rg   Rq   Rp   (   Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   add_windowing_flags  s    c         C   sB   t  o d Sn t d d g  } t |  |  i |  t a  d S(   sr   windowing is optional and provides functions for managing
       windows better, .e.g.  maintaining focus on win32Ns   matplotlib._windowings   src/_windowing.cpp(   t   BUILT_WINDOWINGR   RM  Rp   Rr   (   t   ext_modulesRt   Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR     s    
c         C   sw   t  o d  Sn d d g } | i t i d   | i t i d   t d |  } t |  |  i |  t a  d  S(   Ns   src/ft2font.cpps   src/mplutils.cpps	   CXX/*.cxxs   CXX/*.cs   matplotlib.ft2font(   t   BUILT_FT2FONTR   t   globR   R   Rp   Rr   (   RO  Rt   t   depsRs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   build_ft2font  s    
c         C   sQ   t  o d  Sn d d d d g } t d |  } t |  |  i |  t a  d  S(   Ns   src/_ttconv.cpps   ttconv/pprdrv_tt.cpps   ttconv/pprdrv_tt2.cpps   ttconv/ttutil.cpps   matplotlib.ttconv(   t   BUILT_TTCONVR   R   Rp   Rr   (   RO  Rt   RR  Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   build_ttconv   s    	
c         C   s   t  o d  Sn d d g } | i t i d   | i t i d   t d |  } t |  t |  t |  |  i |  t a  d  S(   Ns   src/_gtkagg.cpps   src/mplutils.cpps	   CXX/*.cxxs   CXX/*.cs   matplotlib.backends._gtkagg(	   t   BUILT_GTKAGGR   RQ  R   R   R   R   Rp   Rr   (   RO  Rt   RR  Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR     s    	


c         C   s   t  o d  Sn d g } | i t i d   | i t i d   t d |  } t |  t |  t |  |  i |  t a  d  S(   Ns   src/_tkagg.cpps	   CXX/*.cxxs   CXX/*.cs   matplotlib.backends._tkagg(	   t   BUILT_TKAGGR   RQ  R   R  R   R   Rp   Rr   (   RO  Rt   RR  Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR   "  s    		


c         C   s   t  o d  Sn d d g } | i t i d   | i t i d   t d |  } t |  t |  t   } t | |  |  i |  t	 a  d  S(   Ns   src/_wxagg.cpps   src/mplutils.cpps	   CXX/*.cxxs   CXX/*.cs   matplotlib.backends._wxagg(
   t   BUILT_WXAGGR   RQ  R   R   R   R  R  Rp   Rr   (   RO  Rt   RR  Rs   R  (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR   5  s    

	c         C   s   t  o d  Sn d } g  } | D] } | d	 t | f q  ~ } | i d  | i t i d   | i t i d   t d d  | i d  t d | d t } t |  t	 |  t
 |  |  i |  t a  d  S(   Ns   agg_trans_affine.cpps   agg_path_storage.cpps   agg_bezier_arc.cpps   agg_curves.cpps   agg_vcgen_dash.cpps   agg_vcgen_stroke.cpps   agg_rasterizer_scanline_aa.cpps   agg_image_filters.cpps	   %s/src/%ss   src/_image.cpps   src/ft2font.cpps   src/mplutils.cpps	   CXX/*.cxxs   CXX/*.cs   src/_backend_agg.cpps   src/backend_agg.cpps    matplotlib.backends._backend_aggRf   (   s   agg_trans_affine.cpps   agg_path_storage.cpps   agg_bezier_arc.cpps   agg_curves.cpps   agg_vcgen_dash.cpps   agg_vcgen_stroke.cpps   agg_rasterizer_scanline_aa.cpps   agg_image_filters.cpp(   s   src/_image.cpps   src/ft2font.cpps   src/mplutils.cpp(   t	   BUILT_AGGR   R   RQ  RV   Rp   R   t   numpy_inc_dirsR   R   R   Rr   (   RO  Rt   t   aggR   R@   RR  Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR   I  s0           +	


c         C   s   t  o d  Sn d } t d d  d d g } | i g  } | D] } | d	 t | f q? ~  | i t i d
   | i t i d   t d | d t } t |  t |  |  i	 |  t
 a  d  S(   Ns   agg_trans_affine.cpps   agg_path_storage.cpps   agg_rasterizer_scanline_aa.cpps   agg_image_filters.cpps   agg_bezier_arc.cpps   src/_image.cpps   src/image.cpps   src/mplutils.cpps	   %s/src/%ss	   CXX/*.cxxs   CXX/*.cs   matplotlib._imageRf   (   s   agg_trans_affine.cpps   agg_path_storage.cpps   agg_rasterizer_scanline_aa.cpps   agg_image_filters.cpps   agg_bezier_arc.cpp(   t   BUILT_IMAGERV   R   R   RQ  R   RZ  R   R   Rp   Rr   (   RO  Rt   R[  RR  R   R@   Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyR   p  s&        2	

c      	   C   s   d g } | i  g  } d D] } | d	 t | f q ~  t d
 |  } | i i  d t d d g  | i i  t  |  i |  d  S(   Ns   src/agg.cxxs   agg_trans_affine.cpps   agg_path_storage.cpps   agg_bezier_arc.cpps   agg_vcgen_dash.cpps   agg_vcgen_stroke.cpps   agg_rasterizer_scanline_aa.cpps   agg_curves.cpps	   %s/src/%ss   matplotlib._aggs
   %s/includeR   R   (   s   agg_trans_affine.cpps   agg_path_storage.cpps   agg_bezier_arc.cpps   agg_vcgen_dash.cpps   agg_vcgen_stroke.cpps   agg_rasterizer_scanline_aa.cpps   agg_curves.cpp(   R   R   R   Rf   Rh   R   Rp   (   RO  Rt   RR  R   t   fnameR[  (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   build_swigagg  s    	      %	c         C   s   t  i  d  } | i t  i  d   t d d  t d d d g | d t d d	 d
 g t } t |  t |  |  i |  d  S(   Ns	   CXX/*.cxxs   CXX/*.cs   src/_transforms.cpps   src/transforms.cpps   matplotlib._transformss   src/mplutils.cppRh   Rf   R   R   (	   RQ  R   RV   R   R   RZ  R   R   Rp   (   RO  Rt   t   cxxRs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   build_transforms  s    

c         C   sZ   t  o d  Sn t d d g  } |  i |  | i d d d d d d d	 g  t a  d  S(
   Ns   enthought.traits.ctraitss   lib/enthought/traits/ctraits.cR   s   enthought/etsconfigs   enthought/traitss   enthought/traits/uis   enthought/traits/ui/extrass   enthought/traits/ui/nulls   enthought/traits/ui/tk(   t   BUILT_TRAITSR   Rp   R   Rr   (   RO  Rt   t   ctraits(    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   build_traits  s    	
c         C   sR   t  o d  Sn t d d g d t } t |  t |  |  i |  t a  d  S(   Ns   matplotlib._cntrs
   src/cntr.cRf   (   t   BUILT_CONTOURR   RZ  R   R   Rp   Rr   (   RO  Rt   Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   build_contour  s    		

c         C   sR   t  o d  Sn t d d g d t } t |  t |  |  i |  t a  d  S(   Ns   matplotlib.nxutilss   src/nxutils.cRf   (   t   BUILT_NXUTILSR   RZ  R   R   Rp   Rr   (   RO  Rt   Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   build_nxutils  s    		

c         C   so   t  o d  Sn t d d  t d d g d g  d t } t |  t |  t |  |  i |  t a  d  S(   Ns   src/_backend_gdk.cs   src/backend_gdk.cs    matplotlib.backends._backend_gdkRh   Rf   (	   t	   BUILT_GDKRV   R   RZ  R   R   R   Rp   Rr   (   RO  Rt   Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt	   build_gdk  s    		


c         C   s-   t  d d g  } t |  |  i |  d  S(   Ns   subprocess._subprocesss   src/_subprocess.c(   R   R   Rp   (   RO  Rt   Rs   (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pyt   build_subprocess  s
    
(    (n   RH   RC   R   R  R   RY   RM   Ra   Rc   t   setsR   t   textwrapR   t   distutils.coreR   RQ  t   ConfigParserR7  R<  R=  R>  RT   R?  Rr   Rb   RY  RP  RT  RV  R\  RW  RX  RN  Rd  Rf  Ra  Rh  R`   R(  R   RZ  R   R   R   t   SafeConfigParsert   configRK   t
   getbooleanRl   R0   R8   R:   R<   R?   RV   R\   R   R   R^   R_   R|   R~   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R  R  R  R!  R/  R  RM  R   RS  RU  R   R   R   R   R   R^  R`  Rc  Re  Rg  Ri  Rj  (    (    (    sG   /afs/athena.mit.edu/user/w/a/ward/Desktop/matplotlib-0.91.2/setupext.pys   <module>*   s<  	$'
																			
	
	$											
	
													/	>	0					)	(	m								'							