ó
Ý™xTc           @   s°  d  d l  m Z d  d l Z d  d l m Z m Z d  d l m Z d  d l m	 Z	 d  d l m
 Z
 d  d l Z d  d l Z d  d l Z d  d l m Z d  d l Z d  d l Z d  d l Z e j Z e j j d ƒ rä d  d l Z n  d	 Z e d
 k oe j d	  d	 d f k  rd Z n  d d d g e Z e j d k rCd Z n d Z d „  Z e j j d ƒ Z d d g e e j d k ƒ Z  e! Z" e# Z$ e# Z% e# Z& e# Z' d „  Z( d „  Z) d „  Z* d d „ Z+ d d „ Z, d d „ Z- d „  Z. e/ d „ Z0 d „  Z1 d  „  Z2 e! d! „ Z3 d" „  Z4 d# „  Z5 d$ „  Z6 d% „  Z7 e# d& „ Z8 d' d( d) „ Z9 d* e: f d+ „  ƒ  YZ; d, e; f d- „  ƒ  YZ< d. e; f d/ „  ƒ  YZ= d0 „  Z> e j d k r¸e> ƒ  Z? n  d1 „  Z@ d2 ZA d3 f  d4 „  ƒ  YZB d5 f  d6 „  ƒ  YZC d7 f  d8 „  ƒ  YZD d9 f  d: „  ƒ  YZE d; f  d< „  ƒ  YZF d= „  ZG d> „  ZH d? „  ZI d@ „  ZJ dA „  ZK eL dB k r¬eM e jN ƒ d	 k o„e jN d
 dC k r—eJ ƒ  jO ƒ  n eK e jN ƒ dD GHn  d S(E   iÿÿÿÿ(   t   divisionN(   t   relocatable_patht   absolute_path(   t   show_string(   t   detect_binary_file(   t   adopt_init_args(   t   StringIOt   LIBTBX_WINGIDE_DEBUGi   i   i   i    t    s    -Qwarns    -Qnewt   nts   .exec         C   s   |  r
 d Sd S(   Nt   Truet   False(    (   t   b(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   bool_literal   s     t   irixt   Nonet   SSE2c          C   s)   d d  l  }  d |  j d ƒ } | d k S(   Niÿÿÿÿi   t   Pi@   (   t   structt   calcsize(   R   t   nbits(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   is_64bit_architecture(   s    c         C   s‰   t  ƒ  } g  } xs |  D]k } y t | j ƒ  ƒ } Wn  t k
 rT t j | ƒ } n X| | k rg q n  | j | ƒ | j | ƒ q W| S(   N(   t   sett   abst   normcaset   AttributeErrort   opt   addt   append(   t   pathst   hasht   resultt   patht   path_normcase(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   unique_paths/   s    	   c         C   s  |  j  d k s |  j  d k r° d j |  j ƒ } |  j d  k	 rW |  j d k rW d } n d } d | | f d | | | f g } |  j r� | j d	 | ƒ n  | j d
 | ƒ nË |  j  j d ƒ r{|  j	 d k sà |  j  d k ré d } n d j |  j ƒ } |  j d  k	 r"|  j d k r"d } n d } d | | f d | | | f g } |  j rh| j d	 | ƒ n  | j d
 | ƒ n  d  S(   Nt
   darwin_icct   darwin_icpct    i	�  R   s    -ms0   ld -dynamic%s -r -d -bind_at_load -o %s $SOURCESsG   $SHLINK -nostartfiles -undefined dynamic_lookup -dynamiclib %s -o %s %ss   dsymutil "%s"t	   SHLINKCOMt   darwin_t   powerpct
   darwin_gccs
   -ldylib1.osF   $SHLINK -nostartfiles -undefined dynamic_lookup -Wl,-dylib %s -o %s %s(
   t   compilert   joint   shlinkflagst   gcc_versionR   t   mac_os_use_dsymutilR   t   Replacet
   startswitht   mac_cpu(   t   env_etct   envt   lot   dylibt   dylib1t   opt_mt	   shlinkcom(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   darwin_shlinkcom:   s4    					t   gccc         C   s‹   d d l  m } | j d d |  ƒ j ƒ  j d j ƒ  } t j d | ƒ } | d  k r[ d  Sy t	 | j
 d ƒ ƒ SWn t k
 r† d  SXd  S(   Niÿÿÿÿ(   t   easy_runt   commands   %s --versioni    s   Apple Inc. build (\d+)\)i   (   t   libtbxR;   t   fully_bufferedt   raise_if_errorst   stdout_linest   stript   ret   searchR   t   intt   groupt
   ValueError(   R:   R;   R-   t   m(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   get_darwin_gcc_build_number[   s     c         C   sb   d d l  m } y7 | j d d |  ƒ j ƒ  j d j ƒ  } d | k SWn t k
 r] } t SXd  S(   Niÿÿÿÿ(   R;   R<   s   %s --versioni    t   llvm(   R=   R;   R>   R?   R@   RA   t	   ExceptionR   (   R:   R;   R-   t   e(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   is_llvm_compilerg   s    c         C   s  d d l  m } | j d d |  ƒ } t | j ƒ d k r? d  St | j ƒ d k rX d  S| j d j d ƒ } t | ƒ d k r„ d  Sg  } x@ | D]8 } y t | ƒ } Wn t	 k
 r» d  SX| j
 | ƒ q‘ Wt | ƒ d k rï | j
 d ƒ n  | d d
 | d d
 | d S(   Niÿÿÿÿ(   R;   R<   s   %s -dumpversioni    i   t   .i   i   id   (   i   i   (   R=   R;   R>   t   lent   stderr_linesR   R@   t   splitRD   RF   R   (   t   command_nameR;   t   buffert   major_minor_patchlevelt   numt   fldt   i(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   get_gcc_versionq   s(    	  c          C   sr   y d d  l  }  Wn% t k
 r& ‚  n t k
 r7 d  SXy |  j ƒ  SWn% t k
 r\ ‚  n t k
 rm d  SXd  S(   Niÿÿÿÿ(   t   sockett   KeyboardInterruptRJ   R   t   gethostname(   RX   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   get_hostname…   s          c         C   s?   |  d  k r t j }  n  d d l m } | j d d |  ƒ j S(   Niÿÿÿÿ(   R;   R<   s   ldd '%s'(   R   t   syst
   executableR=   R;   t   goR@   (   t   targetR;   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   get_ldd_output�   s     c          C   s£   d d l  m }  |  j d d ƒ j } | } t | ƒ d k rV | d j ƒ  j ƒ  } n  t | ƒ d k rƒ | d j d ƒ rƒ | d St d	 j	 d
 g | ƒ ƒ ‚ d  S(   Niÿÿÿÿ(   R;   R<   s   aCC -Vi    i   i   s   A.s   
  s   Unknown C++ compiler (aCC -V):(
   R=   R;   R^   R@   RN   RA   RP   R0   t   RuntimeErrorR+   (   R;   t   run_outt   version(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   get_hp_ux_acc_version’   s    %c          C   s½   d d l  m }  |  j d d ƒ j } | } t | ƒ d k rV | d j ƒ  j ƒ  } n  | d  d j ƒ  k r� | d j d ƒ rƒ d	 S| d j d
 ƒ r� d Sn  t d j	 d g | ƒ ƒ ‚ d  S(   Niÿÿÿÿ(   R;   R<   s   CC -versioni    i   s   MIPSpro Compilers: Version s   7.3t   73s   7.4t   74s   
  s'   Unknown MIPSpro compiler (CC -version):(
   R=   R;   R^   R@   RN   RA   RP   R0   Ra   R+   (   R;   Rb   Rc   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   get_mipspro_versionž   s    c         C   sv   t  j d k r t  j d } n t  j d t  j d  } t j j | ƒ } |  rr t j | ƒ rr t	 d | ƒ ‚ n  | S(   Nt   win32s   \includes   /include/python%d.%di   s,   Cannot locate Python's include directory: %s(
   R\   t   platformt   prefixt   version_infoR=   R    t	   norm_joinR   t   isdirRa   (   t
   must_existt   include_path(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   python_include_path¬   s    c           C   s1   t  j d k r d St j j d ƒ r) d Sd Sd  S(   NR	   t   PATHt   darwint   DYLD_LIBRARY_PATHt   LD_LIBRARY_PATH(   t   ost   nameR\   Ri   R0   (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   ld_library_path_var_name·   s
    c         C   s„   t  g  |  D] } t | ƒ ^ q
 ƒ } t j d k rS |  j d d d | d ƒ n |  j d d d | d ƒ |  j |  d ƒ d  S(   NR	   i    s   @REM t   -i   s   # i   (   t   maxRN   Ru   Rv   t   insertR   (   t   linest   lineRG   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt"   highlight_dispatcher_include_lines¿   s
    %c         C   sð   y | j  ƒ  j ƒ  j ƒ  } Wn t k
 r0 g  SXt j d k rP d |  g } n d |  g } x‚ | D]z } | j |  ƒ } | d k rd | t |  ƒ } | | } | d  j ƒ  sÞ | j	 d ƒ rË | d } n  | j
 | ƒ qÞ qd qd Wt | ƒ | S(   NR	   s   @REM lines marked s   # lines marked i    i   R%   (   t   opent   readt
   splitlinest   IOErrorRu   Rv   t   findRN   t   isalnumR0   R   R}   (   t   patternt   source_filet   source_linesR{   R|   t   pattern_begint   pattern_endt
   to_include(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt"   source_specific_dispatcher_includeÇ   s$      

c         C   sˆ   | j  | ƒ } | d k  r4 t d | |  f ƒ ‚ n  | j  d | ƒ } t | ƒ | | k sb t ‚ | |  | d | | t | ƒ d S(   Ni    s&   Place holder "%s" not found in file %st    i   (   R‚   Ra   RN   t   AssertionError(   t   dispatcher_exe_file_namet   binary_stringt   place_holdert   actual_valuet   place_holder_startt   place_holder_end(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   patch_windows_dispatcherÚ   s    c         C   s5   | r d } n d } |  | d IJ|  | d IJd  S(   Ns   @remt   #s)    THIS IS AN AUTOMATICALLY GENERATED FILE.s#    DO NOT EDIT! CHANGES WILL BE LOST.(    (   t   ft   win_batt   s(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_do_not_edité   s
     	t   ws      c         C   sL   | G|  j  ƒ  GHy |  j | ƒ SWn% t k
 rG } t t | ƒ ƒ ‚ n Xd  S(   N(   t   basenameR~   R�   Ra   t   str(   R    t   modet   infoRK   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt	   open_infoï   s
     t   common_setpathsc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s„   | |  _  | |  _ | |  _ t | j d | | f d t ƒƒ |  _ | d k rt t | j d | d t ƒƒ |  _ n t ƒ  |  _ d  S(   Ns   setpaths%s.%st   return_relocatable_patht   _debugs   unsetpaths.%s(	   R3   t   shellt   suffixRž   t   under_buildR
   R—   t   uR   (   t   selfR3   R¢   R£   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   __init__÷   s    			c         C   s˜   |  j  d k r” |  j d t j j g  |  j j D] } |  j | ƒ ^ q. ƒ ƒ |  j t ƒ  t j j g  |  j j	 ƒ  D] } |  j | ƒ ^ qr ƒ ƒ n  d  S(   NR¡   t
   PYTHONPATH(
   R£   t   update_pathRu   t   pathsepR+   R3   t
   pythonpatht   path_script_valueRw   t   ld_library_path_additions(   R¦   t   _(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   all_and_debug  s    		,c         C   sg   |  j  d k rc xQ |  j j ƒ  D]= \ } } | d k r= q n  |  j d | d |  j | ƒ ƒ q Wn  d  S(   NR   t   LIBTBX_BUILDt   var_namet   val(   R£   R3   t%   var_name_and_build_or_dist_path_pairst   setenvR¬   (   R¦   R±   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   set_unset_vars  s
     (   t   __name__t
   __module__R§   R¯   Rµ   (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRŸ   õ   s   		
t   unix_setpathsc           B   s/   e  Z d  „  Z d „  Z d „  Z d d „ Z RS(   c         C   sP   | d k s t  ‚ t j |  | | | ƒ |  j d k rC d |  _ n	 d |  _ d  S(   Nt   sht   cshs   %s=s
   setenv %s (   R¹   Rº   (   RŒ   RŸ   R§   R¢   t   _setenv(   R¦   R3   R¢   R£   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR§     s
    c         C   s
   | j  ƒ  S(   N(   t   sh_value(   R¦   t   path_obj(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR¬     s    c         C   sw   |  j  d k rK |  j d | | f IJ|  j d | IJ|  j d | IJn( |  j d | | f IJ|  j d | IJd  S(   NR¹   s   %s="%s"s	   export %ss   unset %ss   setenv %s "%s"s   unsetenv %s(   R¢   R—   R¥   (   R¦   R±   R²   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR´      s    c         C   s\  | d  k r | } n  x@|  j d f |  j d f g D] \ } } |  j d k rœ | d | IJ| d | IJ| d IJ| d IJ| d IJ| d	 IJd
 } n@ | d | IJ| d | IJ| d IJ| d IJ| d IJd } | | |  j | | | f IJ|  j d k r@| |  j k r)| d | IJn  | d | | f IJq4 | d | | f IJq4 Wd  S(   Nt   prependt   deleteR¹   s   if [ -n "$%s" ]; thens     LIBTBX_TMPVAL="$%s"t   elses     LIBTBX_TMPVAL=t   fis   export LIBTBX_TMPVALs9   %s`libtbx.path_utility %s LIBTBX_TMPVAL "%s" < /dev/null`s   if ($?%s) thens     setenv LIBTBX_TMPVAL "$%s"s     unsetenv LIBTBX_TMPVALt   endifs;   %s"`libtbx.path_utility %s LIBTBX_TMPVAL '%s' < /dev/null`"s	   export %ss9   if [ "$%s" = "L_I_B_T_B_X_E_M_P_T_Y" ]; then unset %s; fis1   if ("$%s" == "L_I_B_T_B_X_E_M_P_T_Y") unsetenv %s(   R   R—   R¥   R¢   R»   (   R¦   R±   R²   t   var_name_inR•   t   actiont   fmt(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR©   )  s4     	+



	


N(   R¶   R·   R§   R¬   R´   R   R©   (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR¸     s   				t   windows_setpathsc           B   s/   e  Z d  „  Z d „  Z d „  Z d d „ Z RS(   c         C   s   t  j |  | d | ƒ d  S(   Nt   bat(   RŸ   R§   (   R¦   R3   R£   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR§   J  s    c         C   s
   | j  ƒ  S(   N(   t	   bat_value(   R¦   R½   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR¬   M  s    c         C   s,   |  j  d | | f IJ|  j d | IJd  S(   Ns
   @set %s=%ss   @set %s=(   R—   R¥   (   R¦   R±   R²   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR´   P  s    c         C   s|   | d  k r | } n  d } xZ |  j d f |  j d f g D]: \ } } | | | | | | f IJ| d | | f IJq: Wd  S(   NsN   @for /F "delims=" %%%%i in ('libtbx.path_utility %s %s "%s"') do @set %s=%%%%iR¾   R¿   s0   @if "%%%s%%" == "L_I_B_T_B_X_E_M_P_T_Y" @set %s=(   R   R—   R¥   (   R¦   R±   R²   RÃ   RÅ   R•   RÄ   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR©   T  s     	+
N(   R¶   R·   R§   R¬   R´   R   R©   (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÆ   H  s   			c          C   sd   t  j j d d ƒ j ƒ  j t  j ƒ }  x6 d d d g D]% } | |  k r7 |  j d | ƒ q7 q7 W|  S(   Nt   PATHEXTR   s   .pys   .exes   .bati    (   Ru   t   environt   gett   lowerRP   Rª   Rz   (   R   t   ext(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   _windows_pathexta  s
    'c         C   sÀ   |  d  k	 s t ‚ t |  t ƒ s0 t |  ƒ }  n  t j |  ƒ r¼ y t j |  ƒ Wq¼ t	 k
 r¸ y t j |  d ƒ Wn t	 k
 rˆ n Xy t j
 |  |  d ƒ Wq¹ t	 k
 r´ q¹ Xq¼ Xn  d  S(   Ns   .old(   R   RŒ   t
   isinstanceR›   R   R   t   isfileRu   t   removet   OSErrort   rename(   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   remove_or_renamek  s         sö  
# ----------------------------------------------------------------------------
# The shellrealpath function resolves an absolute physical path of its
# first argument and stores it in a global shell variable RESULT.
# The function returns nonzero for unreadable or invalid symlinks
# and resets the RESULT to an empty string.

shellrealpath() {
    local ORGDIR="$PWD"
    local TARGET="$1"
    RESULT=""
    # This test fails for a symlink loop.  We can do without resolution
    # of symlinks that point to existing unreadable files.
    [ -r "$TARGET" ] || return $?
    # Check if the readlink command exists.
    type readlink >/dev/null || return $?
    while true; do
        cd "$(dirname "$TARGET")"
        TARGET="$(basename "$TARGET")"
        if [ -L "$TARGET" ]; then
            TARGET="$(readlink "$TARGET")"
            continue
        fi
        RESULT="$(pwd -P)/$TARGET"
        break
    done
    cd "$ORGDIR"
}
# ----------------------------------------------------------------------------
t   environmentc           B   su  e  Z d  „  Z d= d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 e d „ Z e d	 „ Z e d= e d
 „ Z e e d „ Z d „  Z e d „ Z e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d= d „ Z e j e e d „ Z  e j e e d „ Z! e e d „ Z" d „  Z# d „  Z$ d „  Z% d „  Z& d „  Z' d „  Z( d  „  Z) d! „  Z* d" „  Z+ e d# „ Z, e d$ „ Z- e d% „ Z. e d& „ Z/ d' „  Z0 d( d) „ Z1 d* „  Z2 d+ „  Z3 d, „  Z4 d- „  Z5 d. „  Z6 d/ „  Z7 d0 „  Z8 d1 „  Z9 d2 „  Z: d3 „  Z; d4 „  Z< d5 „  Z= d6 „  Z> d7 „  Z? d8 „  Z@ d9 „  ZA d: „  ZB d; „  ZC e d< „ ZD RS(>   c         C   sÐ   t  j d  |  _ t | ƒ |  _ |  j ƒ  |  j ƒ  |  j ƒ  |  j t  j	 ƒ |  _
 |  j
 j ƒ  sg t ‚ |  j
 j t j ƒ s‚ t ‚ |  j ƒ  d  |  _ g  |  _ i  |  _ |  j ƒ  d  |  _ g  |  _ t |  _ d  S(   Ni   (   R\   Rk   t   python_version_major_minorR   t
   build_patht!   manage_python_version_major_minort   reset_dispatcher_supportt   set_derived_pathst   as_relocatable_pathR]   t
   python_exeRÐ   RŒ   t   accessRu   t   X_OKt   read_command_version_suffixR   t   build_optionst   repository_pathst   command_line_redirectionst   reset_module_registryt   scons_dist_pathR«   R
   t   relocatable(   R¦   R×   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR§   œ  s     



			
		c         C   sZ   | d  k r d |  j } n  t d d t t |  j ƒ ƒ d | d t j d  ƒ ‚ d  S(   Ns   %d.%ds-   Python version incompatible with this build:
s     Build directory: %s
s$     Python version used initially: %s
s&     Python version in use now:     %d.%di   (   R   RÖ   Ra   R   R   R×   R\   Rk   (   R¦   t	   prev_pvmm(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt!   raise_python_version_incompatible°  s    c         C   sÌ   |  j  d } | j ƒ  s& | j ƒ  n  | d } d |  j } | j ƒ  sf | j d ƒ j d | ƒ nb | j ƒ  j ƒ  j ƒ  } t	 | ƒ d k r™ d  } n | d j ƒ  } | | k rÈ |  j d | ƒ n  d  S(	   Nt   libt   PYTHON_VERSION_MAJOR_MINORs   %d.%dR™   s*  # DO NOT EDIT THIS FILE UNDER ANY CIRCUMSTANCE!
# The version number below is purely to insure against accidental use
# of another Python version when re-configuring an existing build.
# To use a different Python version, initialize a new build directory
# with the libtbx/configure.py command.
%s
i    iÿÿÿÿRæ   (   R×   Rm   t   makedirsRÖ   RÐ   R~   t   writeR   R€   RN   R   RA   Rç   (   R¦   R    t   pvmmRæ   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRØ   ¸  s    
	c         C   s   d  |  _ d  S(   N(   R   t   _dispatcher_precall_commands(   R¦   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÙ   Ð  s    c         C   sC   g  |  _  i  |  _ i  |  _ t ƒ  |  _ t ƒ  |  _ t ƒ  |  _ d  S(   N(   t   module_listt   module_dictt   module_dist_pathsR   t   missing_for_buildt   missing_for_uset   missing_optional(   R¦   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRã   Ó  s    			c         C   s   t  |  j ƒ d k S(   Ni    (   RN   Rñ   (   R¦   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   is_ready_for_buildÛ  s    c         C   s)   t  | t j j ƒ r | St |  j | ƒ S(   N(   RÏ   R=   R    t
   path_mixinR   R×   (   R¦   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÛ   Þ  s     c         C   sI   |  j  } | d ƒ |  _ | d ƒ |  _ | d ƒ |  _ | d ƒ |  _ d  S(   Nt   bint   exeRè   t   include(   RÛ   t   bin_patht   exe_patht   lib_pathRo   (   R¦   t   r(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÚ   â  s
    	c         C   s   t  |  j d d | ƒ S(   Ns   ..t   base(   R   R×   (   R¦   R    R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt
   under_baseé  s    c         C   s'   |  j  | ƒ } | r | St | ƒ Sd  S(   N(   RÛ   R   (   R¦   R    R    R   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR¤   í  s    c         C   s…   | t  k r  |  j | | } n, |  j j | ƒ } | d  k rB | S| | } | d  k sj | t | ƒ ƒ r� | rt | St | ƒ Sn  d  S(   N(   t   KeyErrorRð   RË   R   R   (   R¦   t   module_nameR    t   defaultt   testR    R   t   mdp(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt
   under_distô  s     
c         C   sZ   | t  k r |  j | } n |  j j | | ƒ } t | t ƒ rV | rV t | ƒ } n  | S(   N(   Rÿ   Rð   RË   RÏ   R   R   (   R¦   R   R  R    R   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt	   dist_path  s    c         C   s   |  j  j | ƒ S(   N(   Rð   t   has_key(   R¦   Rv   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt
   has_module  s    c         C   sN   |  j  | ƒ sJ |  j } d d l m } | j ƒ  } | d t ƒ  ƒ ‚ n  d  S(   Niÿÿÿÿ(   t   introspections²   The %(name)s module is needed but not configured.
Run:
  cd %(build_path)s
  libtbx.configure %(name)s
  libtbx.scons -j %(nproc)d
Wait for the command to finish, then try again.(   R  R×   R=   R  t   number_of_processorst   vars(   R¦   Rv   t   errorR×   R  t   nproc(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   require_module  s    	c         c   sH   xA |  j  D]6 } x- | j ƒ  D] } | r1 | Vq t | ƒ Vq Wq
 Wd  S(   N(   Rî   t   dist_paths_activeR   (   R¦   R    t   moduleR  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt
   dist_paths  s
    c         c   sX   d |  j  f VxC |  j D]8 } x/ | j ƒ  D]! \ } } | j ƒ  d | f Vq+ Wq Wd  S(   NR°   t   _DIST(   R×   Rî   t   name_and_dist_path_pairst   upper(   R¦   R  Rv   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR³   %  s    c         C   sR   xK |  j  D]@ } x7 | j ƒ  D]) \ } } t | ƒ t j | j ƒ  d <q Wq
 Wd  S(   NR  (   Rî   R  R   Ru   RÊ   R  (   R¦   R  Rv   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   set_os_environ_all_dist+  s    c         C   sÐ   |  j  j ƒ  s d  Sg  } t } xe |  j  j ƒ  D]T } | rZ | j ƒ  j d ƒ rZ t } n  |  j  | } | j ƒ  r/ | j | ƒ q/ q/ Wt	 | ƒ d k rÌ | s® t
 d ƒ ‚ n  x | D] } t | ƒ qµ Wn  d  S(   Ns   libtbx.i    sØ  Existing "bin" sub-directory safety-guard:
  A "bin" sub-directory exists already in the current working directory,
  but it does not contain any "libtbx." commands. Therefore the current
  working directory does not appear to be an existing libtbx-managed
  build directory. To resolve this problem:
    - If this command was accidentally run in the wrong directory,
      change to the correct directory.
    - Remove the "bin" subdirectory, then run this command again.(   Rù   Rm   R   t   listdirRÌ   R0   R
   RÐ   R   RN   Ra   RÔ   (   R¦   RR   t   have_libtbx_commandt	   file_nameR    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   clear_bin_directory0  s"     	c         C   sl   |  j  d  k	 s t ‚ |  j d ƒ } y t | d ƒ } Wn! t k
 rZ t d | ƒ ‚ n X| |  j  IJd  S(   Nt   command_version_suffixR™   s.   Cannot write command_version_suffix file: "%s"(   R  R   RŒ   R¤   R~   R�   Ra   (   R¦   R    R•   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_command_version_suffixI  s     c         C   sl   |  j  d } | j ƒ  s% d  |  _ nC y | j ƒ  j ƒ  j ƒ  |  _ Wn! t k
 rg t d | ƒ ‚ n Xd  S(   NR  s-   Cannot read command_version_suffix file: "%s"(	   R×   RÐ   R   R  R~   R   RA   R�   Ra   (   R¦   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRß   R  s    c         C   s¬   | d  k r |  j j | ƒ nO x9 t |  j ƒ D] \ } } | | k r/ Pq/ q/ Wt d ƒ ‚ |  j j | | ƒ | |  j | j <x' | j ƒ  D] \ } } | |  j	 | <q‹ Wd  S(   Ns4   Internal error: dependent_module not in module_list.(
   R   Rî   R   t	   enumerateRa   Rz   Rï   Rv   R  Rð   (   R¦   t   dependent_moduleR  t   dependent_indext   registered_moduleRv   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   register_module]  s     	c         C   s~   t  | t ƒ r | g } n t | ƒ } | j d ƒ x. |  j D]# } | j d t t | ƒ ƒ ƒ q> Wt d j | ƒ ƒ ‚ d  S(   Ns"     Repository directories searched:s       %ss   
(	   RÏ   R›   t   listR   Rá   R   R   Ra   R+   (   R¦   t   messageR    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   raise_not_found_in_repositoriesj  s     !c         c   s_   xX |  j  D]M } xD | j ƒ  D]6 } | d  k sE | t | | ƒ ƒ r | | f Vq q Wq
 Wd  S(   N(   Rá   R  R   R   (   R¦   R  R    Rv   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   listdir_in_repositoriesr  s    "c   
      C   sw  t  j | ƒ } g  } xu |  j d | ƒ D]a \ } } | j | ƒ d  k	 r( t | ƒ d k rs | d d | k rs Pn  | j | | f ƒ q( q( Wt | ƒ d k rÆ | sÂ |  j d d t | ƒ ƒ n  d  S| j	 ƒ  t | ƒ d k rc| rcd t | ƒ g }	 |	 j d t | d d ƒ ƒ x+ | D]# \ } } |	 j d	 t | ƒ ƒ q!Wt
 d
 j |	 ƒ ƒ ‚ qcn  t j j | d Œ  S(   NR  i    iÿÿÿÿR!  s   Cannot locate: %si   s'   Multiple matches for search pattern %s:s     Repository directory: %ss       %ss   
(   RB   t   compileR#  t   matchR   RN   R   R"  R   t   sortRa   R+   R=   R    Rl   (
   R¦   t   relative_path_patternR  t   optionalt   must_be_uniquet   compiled_patternt   all_matchesR    Rv   R!  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   match_in_repositoriesx  s.    &	
	c         C   s’   t  | ƒ d k s t ‚ xP |  j D]E } | | } | d  k sP | t | ƒ ƒ r" | rZ | St | ƒ Sq" q" W| sŽ |  j d d t | ƒ ƒ n  d  S(   Ni    R!  s   Cannot locate: %s(   RN   RŒ   Rá   R   R   R"  R   (   R¦   t   relative_pathR  R(  R    R    R   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   find_in_repositories•  s    
	c         C   s
  |  j  j | d  ƒ } | d  k	 r. | j | ƒ S|  j d | d t ƒ } | d  k	 r_ | j | ƒ St d |  d | ƒ } | j d } | | k ré |  j d | d t ƒ d  k	 ré |  j d d | | j	 f ƒ } | d  k	 ræ | j | ƒ Sqé n  | s|  j
 d d	 | ƒ n  d  S(
   NR-  R    R3   Rv   i   R'  s	   %s(?!_%s)R!  s   Module not found: %s(   Râ   RË   R   t   self_or_abs_ifR.  R
   R  t   namesR,  t   mate_suffixR"  (   R¦   R   R(  R    R  t   trial_modulet	   mate_name(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   find_dist_path§  s*    			c         C   s·   |  j  | d | ƒ} | d  k r% t St d |  d | d | ƒ } t j | j ƒ } x* |  j D] } t j | ƒ | k r\ t Sq\ W| j	 ƒ  | j
 ƒ  |  j d | d | ƒ | j ƒ  t S(   NR(  R3   Rv   R  R  R  (   R4  R   R   R  R   R   Rv   Rï   R
   t	   find_matet   process_libtbx_configR  t   process_dependencies(   R¦   R  R   R(  R  t
   new_modulet   new_name_normcaseRv   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   process_module¿  s      


c         C   s5   |  j  | ƒ } | |  j k r1 |  j j | ƒ n  d  S(   N(   RÛ   Rá   R   (   R¦   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   add_repositoryÌ  s    c   
   '   C   së  | j  } | j j |  _ xF | j D]; } t j | ƒ sM t |  j | ƒ } n  |  j d | ƒ q" Wg  } x| j	 D]} t
 | ƒ d k r� qq n  | d k rª t d ƒ ‚ n  | d k r¿ d } n  | |  j k rÛ |  j | =n˜ | j d ƒ d k rs|  j | d	 t ƒd  k rs| j d ƒ \ } } t |  j t j | ƒ ƒ } | j ƒ  sct d
 | | | f ƒ ‚ n  | |  j | <n  | j | ƒ qq W| j rÿ| j j s*g  } | j j rÃ| j j j d ƒ } n  x6 |  j D]( }	 |	 j | k rÍ| j |	 j ƒ qÍqÍWq*n+t d | j j d | j j d | j j d | j j d | j j  d | j j! d | j j" d | j j# d | j j$ d | j j% d | j j& d | j j' d | j j( d | j j) d | j j* d | j j+ d | j j, d | j j- d | j j. ƒ |  _ |  j j/ ƒ  | j j0 d  k	 r*| j j0 |  _0 |  j1 ƒ  n  | j j2 d  k	 rQ| j j2 |  j _2 n  |  j3 ƒ  | j d ƒ | j4 ƒ  x* | D]" } |  j5 d d  d  | d	 t6 ƒ qyW|  j d! d	 t ƒ|  _7 |  j8 d d" d# t ƒ|  _9 |  j9 j: ƒ  sçt; ‚ d  S($   NR    i    s   ..s   Invalid module name: ".."RM   R=   t   =i   R(  se   Invalid command line redirection:
  module name = "%s"
  redirection = "%s"
  resulting target = "%s"t   ,R*   Rœ   t   warning_levelt   precompile_headerst   static_librariest
   static_exet   use_system_libst
   scan_boostt   write_full_flex_fwd_ht   boost_python_no_py_signaturest   boost_python_bool_int_strictt   enable_openmp_if_possiblet   enable_cudat   opt_resourcest   use_environment_flagst   force_32bitt   msvc_arch_flagt   enable_cxx11t   old_divisionR  R   t   sconss   command_line/path_utility.pyR    (<   t   command_linet   optionst   no_bin_pythonRá   R   t   isabsR   R×   R;  t   argsRN   Ra   Râ   t   countR4  R
   R   RP   R   t
   expandvarsRm   R   t
   warm_startt   onlyt   excludeRî   Rv   Rà   R*   t   buildR>  R?  R@  RA  RB  RC  RD  RE  RF  RG  RH  RI  RJ  RK  RL  RM  RN  t   get_flags_from_environmentR  R  t   build_boost_python_extensionsRã   t   reverseR:  R   Rä   R  t   path_utilityRÐ   RŒ   (
   R¦   t   pre_processed_argsRP  R    t   module_namesR   t   redirectionR  t   excludesR  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   process_argsÑ  s�    	  		

		c         C   sÙ   |  j  d  k rÒ g  } |  j d k rÆ t j j d ƒ rÆ t j d ƒ rÆ y t d ƒ j	 ƒ  } Wn$ t
 k
 rq ‚  qÆ t k
 r� qÆ X| j d ƒ rÆ | j ƒ  d d k rÆ | j d d d	 d
 g ƒ qÆ n  | |  _  n  |  j  S(   Ni   t   linuxs   /etc/redhat-releases   Red Hat Linux releasei   t   9s%   if [ ! -n "$LD_ASSUME_KERNEL" ]; thens     LD_ASSUME_KERNEL=2.4.1s     export LD_ASSUME_KERNELRÁ   (   i   i   (   Rí   R   RÖ   R\   Ri   R0   R   RÐ   R~   t   readlineRY   RJ   RP   t   extend(   R¦   R{   t   red_hat_linux_release(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   dispatcher_precall_commands"  s(       c         C   s  t  j d k r; d GH|  j d d t ƒj d ƒ } d } n) d GH|  j d d t ƒj d ƒ } d	 } | | d
 IJ| | d IJ| | d IJ| | d IJ| | d IJ| | d IJ| | d IJ| | d IJ| | d IJ| | d t |  j d ƒ ƒ IJ| | d IJ| j ƒ  d  S(   NR	   s#       dispatcher_include_template.bats   dispatcher_include_template.batR    R™   s   @REMs"       dispatcher_include_template.shs   dispatcher_include_template.shR”   s    include at starts.      Commands to be executed at the start of thes%      auto-generated dispatchers in bin.R   s    include before commands4      Commands to be executed before the target commands6      is called by the auto-generated dispatchers in bin.s5    To see how the dispatchers work, look at an example:s      %ss   bin/libtbx.help(   Ru   Rv   R¤   R
   R~   R   t   close(   R¦   R•   t   cp(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt!   write_dispatcher_include_template6  s*    	!c         C   s]  i  |  _  g  |  _ g  |  _ g  } x¥ |  j j ƒ  D]” } |  j | d t ƒ} | j ƒ  s^ q1 n  | j d ƒ r1 | j	 d ƒ r‹ t
 j d k s© | j	 d ƒ r1 t
 j d k r1 | d k r1 | j | ƒ q1 q1 W| j ƒ  xƒ| D]{} d t t | ƒ ƒ GH| j ƒ  j ƒ  j ƒ  } g  } g  } | } x� | D]‡ } d	 j | j ƒ  ƒ j ƒ  }	 |	 j d
 ƒ se|	 j d ƒ rvd |	 d }	 n  |	 d k r‹| } q&|	 d k r | } q&| j | ƒ q&Wx¡ | |  j f | |  j f g D]� \ } }
 t | ƒ d k rôqÐn  t
 j d k r | j d d t | ƒ ƒ n | j d d t | ƒ ƒ t | ƒ |
 j | ƒ qÐWqÚ Wd  S(   NR    t   dispatcher_includes   .shR	   s   .bats   dispatcher_include_template.shs   dispatcher_include_template.bats   Processing: %sR%   s	   #include s   REM includes   # i   s   # include at starts   REM include at starts   # include before commands   REM include before commandi    s   @REM included from %ss   # included from %s(   s   dispatcher_include_template.shs   dispatcher_include_template.bat(   s   # include at starts   REM include at start(   s   # include before commands   REM include before command(   t   _dispatcher_registryt   _dispatcher_include_at_startt"   _dispatcher_include_before_commandR×   R  R¤   R
   RÐ   R0   t   endswithRu   Rv   R   R&  R   R   R~   R   R€   R+   RP   RÌ   RN   Rz   R}   Rg  (   R¦   t   include_filesR  R    R{   t   lines_at_startt   lines_before_commandRR   R|   t   lR_   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   reset_dispatcher_bookkeepingN  sR    			 	
			 
c         C   sA   | d k s t  ‚ t |  d ƒ s' t  ‚ | d k r: |  j S|  j S(   Nt   at_startt   before_commandRo  (   Rw  Rx  (   RŒ   t   hasattrRo  Rp  (   R¦   t   where(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRm  y  s
    c         C   s  |  j  j d k r! t d ƒ ‚ n  d „  } | ƒ  \ } } | d  k rI d  S|  j d t j d | ƒ d t ƒ } g  } x„ | D]| } | | } | j ƒ  sµ t d t	 t
 | ƒ ƒ ƒ ‚ n  | j d	 ƒ d
 k ré t d t	 t
 | ƒ ƒ ƒ ‚ n  | j | ƒ qz Wd	 j | ƒ S(   Nt   icct   icpcs@   --opt-resources not supported in combination with --compiler=iccc          S   s¦   t  j j d ƒ r; d d g }  t ƒ  r1 d |  f Sd |  f St  j d k r¢ d d g }  t ƒ  ri d	 |  f St j ƒ  d
 j d ƒ r˜ t j ƒ  d k r˜ d Sd |  f Sd S(   NRd  s	   libimf.sos	   libirc.sot   linux64t   linux32Rr   s   libimf.dylibs   libirc.dylibt   darwin64i    s   10.6s   Power Macintosht   darwin32(   NN(   NN(   R\   Ri   R0   R   t   mac_vert   machineR   (   t   libs(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   get_libs_dir„  s    	

	

R-  RI  R(  s   Missing file: %st   :i    s/   File name with embedded colon not supported: %s(   R{  R|  (   Rà   R*   Ra   R   R.  R   R+   R   RÐ   R   R   R‚   R   (   R¦   R„  t   libs_dirRƒ  t   dR   Ru  t   p(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   opt_resources_ld_preload€  s,    			
c         C   sŠ   |  j  g } g  } t ƒ  r+ | j d ƒ n  | j d ƒ xK | D]C } t j t j | ƒ } t j | ƒ r? | j |  j | ƒ ƒ q? q? W| S(   Nt   lib64Rè   (	   Rû   R   R   R   R+   R\   Rj   Rm   RÛ   (   R¦   R   t   dirsR‡  Rˆ  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR­   ¦  s    	c            s  | j  d ƒ } | d  k	 r2 | d IJ| d IJn< | d IJ| d IJ| d IJ| d IJ| d IJ| d	 IJ| d IJt d
 | ƒ | d IJ| d IJ| d IJ| d IJ| d t t ˆ  j ƒ ƒ IJ| d IJ| d IJ| d IJ| d IJ| d IJ| d IJ| d IJ| d t ˆ  j d ƒ ƒ IJ| d IJ| t IJ| d IJ| d IJ| d IJ| d IJ| d IJ| d ˆ  j j	 ƒ  IJ| d IJt
 } | d  k	 r$| j	 ƒ  } | j d ƒ d k rât d | d | ƒ ‚ n  | d | j	 ƒ  IJ| d  IJ| j ƒ  j ƒ  d! k r$t } q$n  x$ ˆ  j d" d# ƒ D] } | | IJq7Wd$ ˆ  j f g } | j t ƒ  ˆ  j ƒ  f ƒ | j d% ˆ  j g f ƒ x½ | D]µ \ }	 }
 t |
 ƒ d k r½q™n  d& j g  |
 D] } | j ƒ  ^ qÊƒ }
 | d' |	 IJ| d( |	 |
 |	 f IJ| d) |	 IJ| d* IJ| d+ |	 |
 f IJ| d) |	 IJ| d, IJq™Wˆ  j ƒ  } | d  k	 rˆx | D] } | | IJqqWn  | r—t } n; | d  k s°| j ƒ  r¹t
 } n t j d- t | ƒ ƒ } | rx* t d. d/ d0 | ƒ D] } | | IJqîWn  x$ ˆ  j d" d1 ƒ D] } | | IJqW| r_x* t d. d2 d0 | ƒ D] } | | IJqHWn  ˆ  j j rµˆ  j  ƒ  } | d  k	 rµ| d3 IJ| d4 | IJ| d5 IJ| d, IJqµn  | d6 ˆ  j j! ƒ  d7 j ƒ  IJ| d8 IJ| d  k	 r‡  f d9 †  } d: } | s| rBt" } ˆ  j j# r(d: } n  | d; | ƒ  | f 7} n  t
 } | r{t t d. d< d0 | ƒ ƒ d= k r{t } q{n  | r | r | d> | j ƒ  7} n  | d? IJ| d@ | IdA IJ| dB IJ| dC | IJ| d* IJ| dC | IdA IJ| d, IJn  | j$ ƒ  | j% dD ƒ d  S(E   NR™   s
   #! /bin/shs   # LIBTBX_DISPATCHER DO NOT EDITs$   # LIBTBX_DISPATCHER_HEAD DO NOT EDITR”   s9   # This file is intended to be sourced from other scripts.s9   # It is like the dispatcher scripts in the bin directory,s4   # but only sets up the environment without calling as   # command at the end.R•   s0   # To customize this auto-generated script creates   #   dispatcher_include*.shs   # files in %s and runs   #   libtbx.refreshs<   # to re-generate the dispatchers (libtbx.refresh is a subsets;   # of the functionality of the libtbx/configure.py command).s   # See also:s   #   %ss   dispatcher_include_template.shs   unset PYTHONHOMEs   LC_ALL=Cs   export LC_ALLsK   LIBTBX_BUILD="$(shellrealpath "$0" && cd "$(dirname "$RESULT")/.." && pwd)"s   export LIBTBX_BUILDs   LIBTBX_PYEXE_BASENAME="%s"s   export LIBTBX_PYEXE_BASENAMEt   "i    s6   Dispatcher target file name contains double-quote: %s
s     source file: %ss   LIBTBX_DISPATCHER_NAME="%s"s   export LIBTBX_DISPATCHER_NAMEs   .pyRz  Rw  R¨   Rq   R…  s   if [ -n "$%s" ]; thens     %s="%s:$%s"s     export %sRÀ   s	     %s="%s"RÁ   R  R„   t    LIBTBX_PRE_DISPATCHER_INCLUDE_SHR…   Rx  t!   LIBTBX_POST_DISPATCHER_INCLUDE_SHs5   if [ "${LIBTBX_NO_LD_PRELOAD-UNSET}" == UNSET ]; thens     LD_PRELOAD="%s"s     export LD_PRELOADs   LIBTBX_PYEXE="%s"s   $LIBTBX_PYEXE_BASENAMEs   export LIBTBX_PYEXEc              s   d d g ˆ  j  j S(   NR   s   /usr/bin/arch -i386 (   Rà   RK  (    (   R¦   (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   pre_cmd  s    R   s    %s"$LIBTBX_PYEXE"%st   LIBTBX_START_PYTHONi   s    "%s"s*   if [ -n "$LIBTBX__VALGRIND_FLAG__" ]; thens     exec $LIBTBX_VALGRINDs   "$@"s   elif [ $# -eq 0 ]; thens     execií  (&   R~   R   R˜   R   R   R×   R¤   t   _SHELLREALPATH_CODERÜ   Rš   R   R‚   Ra   RÍ   RÌ   R
   Rm  R«   R   Rw   R­   Rù   RN   R+   R¼   Ri  RÐ   R   t   from_initial_blockRŠ   Rà   RI  R‰  t   dirnamet   qnewRN  Rj  t   chmod(   R¦   R…   t   target_filet   source_is_python_exeR•   t   source_is_pyt   dispatcher_nameR|   t
   essentialst   nt   vRˆ  t   precall_commandst   scan_for_dispatcher_includest   ldplR�  t   cmdt   qnew_tmpt   start_python(    (   R¦   s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_bin_sh_dispatcher²  sô    



























 (
					


		



c   
         sç  | j  d ƒ ‰  ˆ  d IJˆ  d IJˆ  d IJˆ  d IJˆ  d IJˆ  d IJ‡  ‡ f d †  } | d d	 ƒ d
 ˆ j f g } | j t ƒ  ˆ j g f ƒ | j d ˆ j g f ƒ xt | D]l \ } } t | ƒ d k rÜ q¸ n  d j g  | D] } t j d | j	 ƒ ^ qé ƒ } ˆ  d | | | f IJq¸ Wˆ  d ˆ j
 j ƒ  IJ| d d ƒ t }	 ˆ j j rgd }	 n  | j ƒ  j ƒ  d k rœˆ  d |	 | j ƒ  f IJn= | j ƒ  j ƒ  d k rÅˆ  d |	 IJn ˆ  d | j ƒ  IJˆ  j ƒ  d  S(   NR™   s	   @setlocals   @set LIBTBX_BUILD=%~dp0s&   @set LIBTBX_BUILD=%LIBTBX_BUILD:~0,-1%s:   @for %%F in ("%LIBTBX_BUILD%") do @set LIBTBX_BUILD=%%~dpFs!   @set LIBTBX_DISPATCHER_NAME=%~nx0c            sK   xD ˆ j  d |  ƒ D]0 } | j d ƒ r5 ˆ  | IJq ˆ  d | IJq Wd  S(   NRz  t   @(   Rm  R0   (   Rz  R|   (   R•   R¦   (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_dispatcher_include?  s    Rz  Rw  R¨   Rq   i    t   ;s   %LIBTBX_BUILD%s   @set %s=%s;%%%s%%s   @set LIBTBX_PYEXE=%sRx  R   s   .pys   @"%%LIBTBX_PYEXE%%"%s "%s" %%*s
   python.exes   @"%%LIBTBX_PYEXE%%"%s %%*s	   @"%s" %%*(   R~   R«   R   Rw   Rû   Rù   RN   R+   R   Rå   RÜ   RÈ   R”  Rà   RN  RÍ   RÌ   Rš   Rj  (
   R¦   R…   R–  R—  R¥  Rš  R›  Rœ  Rˆ  R¡  (    (   R•   R¦   s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_win32_dispatcher1  s:    





 1	c         C   ss  |  j  | ƒ } |  j  | ƒ } |  j j | | ƒ } | | k rì | j ƒ  s[ | |  j | <qì | j ƒ  rì t t j d ƒ sŠ | j | ƒ rì | | k rì t d d d t	 t
 | ƒ ƒ d d t	 t
 | ƒ ƒ d t	 t
 | ƒ ƒ ƒ ‚ qì n  t j d k r|  j } n	 |  j } | } t j d k r2| d 7} n  t | ƒ y | | | | ƒ Wn t k
 rn} d	 G| GHn Xd  S(
   Nt   samefiles!   Multiple sources for dispatcher:
s     target file:
s       %s
s     source files:
s       %sR	   s   .bats
     Ignored:(   RÛ   Rn  t
   setdefaultRÐ   Ry  Ru   R    R¨  Ra   R   R   Rv   R§  R£  RÔ   R�   (   R¦   R…   R–  R—  t   regRÄ   t   target_file_extRK   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_dispatcher[  s.    S	
  c         C   s3   |  j  d | d |  j d | d t ƒd | ƒ d  S(   NR…   R–  s   bin/R    R—  (   R¬  R¤   R
   (   R¦   R…   R–  R—  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   _write_dispatcher_in_binx  s
    		c         C   s   |  j  d | d | ƒ d  S(   NR…   R–  (   R­  (   R¦   R…   R–  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_dispatcher_in_bin€  s    	s   dispatcher_head.shc         C   sE   t  j d k r d  Sd G| GH|  j d d  d |  j | d t ƒƒ d  S(   NR	   s      R…   R–  R    (   Ru   Rv   R£  R   R¤   R
   (   R¦   R–  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_lib_dispatcher_head…  s     		c         C   s  t  |  d | ƒ } | j | j } } x; | | f D]- } t d | ƒ | j d t |  j ƒ ƒ q2 W| j d ƒ | d IJ|  j ƒ  r� | d IJ| d IJn  | j ƒ  | j	 ƒ  | j
 d d	 d
 |  j j ƒ  d d ƒ xA | | f D]3 } | d IJ| d IJ| d k rã | d IJqã qã Wd  S(   NR¹   R•   sª  ocwd="`pwd`"
if [ -n "$LIBTBX_BUILD_RELOCATION_HINT" ]; then
  cd "$LIBTBX_BUILD_RELOCATION_HINT"
  LIBTBX_BUILD_RELOCATION_HINT=
  export LIBTBX_BUILD_RELOCATION_HINT
elif [ -n "$BASH_SOURCE" ]; then
  LIBTBX_BUILD=`dirname "$BASH_SOURCE[0]"`
  cd "$LIBTBX_BUILD"
else
  cd "%s"
fi
LIBTBX_BUILD=`pwd -P`
export LIBTBX_BUILD
LIBTBX_OPATH="$PATH"
export LIBTBX_OPATH
PATH="$LIBTBX_BUILD/bin:$PATH"
export PATH
cd "$ocwd"
ocwd=
s|   alias libtbx.setpaths_all=". \"$LIBTBX_BUILD/setpaths_all.sh\""
alias libtbx.unsetpaths=". \"$LIBTBX_BUILD/unsetpaths.sh\""
s*   unalias libtbx.unsetpaths > /dev/null 2>&1s*   alias cdlibtbxbuild="cd \"$LIBTBX_BUILD\""s&   unalias cdlibtbxbuild > /dev/null 2>&1R±   Rq   R²   RÃ   t   LIBTBX_OPATHs   LIBTBX_TMPVAL=s   LIBTBX_OPATH=R   s   LIBTBX_BUILD=(   R¸   R—   R¥   R˜   Rë   R   R×   t   is_development_environmentR¯   Rµ   R©   Rù   R¼   (   R¦   R£   t   setpathsR—   R¥   R•   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_setpaths_shŒ  s.    



	

c         C   s  t  |  d | ƒ } | j | j } } x; | | f D]- } t d | ƒ | j d t |  j ƒ ƒ q2 W| j d ƒ | d IJ|  j ƒ  r� | d IJ| d IJn  | j ƒ  | j	 ƒ  | j
 d d	 d
 |  j j ƒ  d d ƒ xA | | f D]3 } | d IJ| d IJ| d k rã | d IJqã qã Wd  S(   NRº   R•   s  set ocwd="$cwd"
if ($?LIBTBX_BUILD_RELOCATION_HINT) then
  cd "$LIBTBX_BUILD_RELOCATION_HINT"
  unsetenv LIBTBX_BUILD_RELOCATION_HINT
else
  cd "%s"
endif
setenv LIBTBX_BUILD "`/bin/sh -c 'pwd -P'`"
setenv LIBTBX_OPATH "$PATH"
setenv PATH "$LIBTBX_BUILD/bin:$PATH"
cd "$ocwd"
unset ocwd
s„   alias libtbx.setpaths_all "source '$LIBTBX_BUILD/setpaths_all.csh'"
alias libtbx.unsetpaths "source '$LIBTBX_BUILD/unsetpaths.csh'"
s   unalias libtbx.unsetpathss(   alias cdlibtbxbuild "cd '$LIBTBX_BUILD'"s   unalias cdlibtbxbuildR±   Rq   R²   RÃ   R°  s   unsetenv LIBTBX_TMPVALs   unsetenv LIBTBX_OPATHR   s   unsetenv LIBTBX_BUILD(   R¸   R—   R¥   R˜   Rë   R   R×   R±  R¯   Rµ   R©   Rù   R¼   (   R¦   R£   R²  R—   R¥   R•   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_setpaths_cshº  s.    



	

c         C   sX  t  |  | ƒ } | j | j } } xH | | f D]: } t d | d t ƒ | d IJ| d |  j j ƒ  IJq/ W| j ƒ  | j d d d |  j j ƒ  d d	 ƒ x+ d
 d g D] } | d | d | f IJq© W| d IJ|  j	 ƒ  r÷ | d IJ| d IJn  | d k r| d IJn  | j
 ƒ  x7 | | f D]) } | d IJ| d k r'| d IJq'q'Wd  S(   NR•   R–   sW   @set LIBTBX_BUILD=%~dp0
@set LIBTBX_BUILD=%LIBTBX_BUILD:~0,-1%
@set LIBTBX_OPATH=%PATH%s   @set PATH=%s;%%PATH%%R±   Rq   R²   RÃ   R°  t   setpaths_allt
   unsetpathss   @doskey libtbx.%s="%s\%s.bat"s   %LIBTBX_BUILD%s   @doskey libtbx.unsetpaths=s)   @doskey cdlibtbxbuild=cd "%LIBTBX_BUILD%"s   @doskey cdlibtbxbuild=R¡   s   @set PYTHONCASEOK=1s   @set LIBTBX_OPATH=R   s   @set LIBTBX_BUILD=(   RÆ   R—   R¥   R˜   R
   Rù   RÈ   R¯   R©   R±  Rµ   (   R¦   R£   R²  R—   R¥   R•   R<   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_setpaths_batá  s4    
	



c         C   s×   t  |  j d d t ƒƒ } t d | ƒ | d IJx% |  j D] } | d t | ƒ IJq< Wxl |  j D]a } t | j ƒ  ƒ d \ } } x< d d g D]. } | | j	 ƒ  r“ | d	 | | f IJPq“ q“ Wqd W| j
 ƒ  d  S(
   Nt
   SConstructR    R•   s   SConsignFile()s   Repository(r"%s")iÿÿÿÿt   libtbx_SConscriptt
   SConscripts   SConscript("%s/%s")(   Rž   R¤   R
   R˜   Rá   R   Rî   R   R  RÐ   Rj  (   R¦   R•   R    R  Rv   t   script_name(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_SConstructþ  s    
c         C   se   t  j d ƒ r" t j d d ƒ n  t |  j d d t ƒƒ } d } | j d t ƒ  ƒ | j	 ƒ  d  S(   Nt   Makefiles   Makefile.oldR    s@   ./bin/libtbx.scons -j "`./bin/libtbx.show_number_of_processors`"s@  # DO NOT EDIT THIS FILE!
# This file will be overwritten by the next libtbx/configure.py,
# libtbx.configure, or libtbx.refresh.

default:
	%(lsj)s

nostop:
	%(lsj)s -k

bp:
	%(lsj)s -k boost_python_tests=1

reconf:
	./bin/libtbx.configure .
	%(lsj)s

redo:
	./bin/libtbx.configure . --clear-scons-memory
	%(lsj)s

clean:
	%(lsj)s -c

# example
selfx:
	rm -rf selfx_tmp
	mkdir selfx_tmp
	cd selfx_tmp ; \
		libtbx.start_binary_bundle example boost ; \
		libtbx.bundle_as_selfx example build_id ; \
		mv example_build_id.selfx .. ; \
		cd .. ; \
		ls -l example_build_id.selfx
(
   R   RÐ   Ru   RÓ   Rž   R¤   R
   Rë   R
  Rj  (   R¦   R•   t   lsj(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_Makefile  s    #c         C   s1   g  } x$ |  j  D] } | j | j ƒ  ƒ q W| S(   N(   Rî   Rg  t   collect_test_scripts(   R¦   R   R  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÀ  :  s    c         C   s    |  j  ƒ  } t | ƒ d k rœ |  j d d t ƒ} t | ƒ } | d IJ| d IJ| d IJx" | D] } | d t | ƒ IJqd W| j ƒ  | j d ƒ n  d  S(	   Ni    s   run_tests.cshR    s   #! /bin/csh -fs
   set noglobs   set verboses   libtbx.python "%s" $*ií  (   RÀ  RN   R¤   R
   Rž   R   Rj  R•  (   R¦   t   test_scriptsR    R•   R  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_run_tests_csh@  s    



c         C   s7   |  j  ƒ  |  j d } t j |  | j d ƒ d ƒ d  S(   Nt
   libtbx_envt   wbi    (   RÙ   R×   t   picklet   dumpR~   (   R¦   R  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÅ  M  s    
c         C   sê   d t  |  j ƒ GHd GHt |  j ƒ } | j ƒ  g  | D] } | j ƒ  ^ q7 } t | ƒ d k re d  Sd t g  | D] } t | ƒ ^ qr ƒ } xU t | | ƒ D]D \ } } x5 | j	 ƒ  D]' } | | t
 t  | ƒ ƒ f GHd } q· Wqž Wd  S(   Ns!   Relocatable paths anchored at: %ss&   Top-down list of all modules involved:i    s     %%-%ds  %%sR   (   R   R×   R   Rî   R]  t   names_for_module_listingRN   Ry   t   zipR  R   (   R¦   t   top_down_module_listR  t   labelst   labelRÅ   R  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   show_module_listingR  s    
 )c         C   sû   d t  j j ƒ  d t t  j ƒ f GH|  j ƒ  rA |  j j ƒ  n  d G|  j GH|  j	 ƒ  t
 |  j ƒ d k r‘ t d d j t |  j ƒ ƒ ƒ ‚ n  |  j ƒ  s÷ |  j d  k	 rá d GHd GHx  t |  j ƒ D] } d G| GHqÆ Wd GHn  t |  j d ƒ ƒ n  d  S(	   Ns   Python: %s %si    s   command_version_suffix:s   Missing modules: R%   s#   ***********************************s#   Warning: modules missing for build:R¸  (   R\   Rc   RP   R   R]   Rô   Rà   t   reportR  RÌ  RN   Rò   Ra   R+   t   sortedRä   R   Rñ   RÔ   R¤   (   R¦   R   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt%   show_build_options_and_module_listing`  s"    "
c         C   sW   xP d d d g D]? } t  t d ƒ rB |  j | ƒ |  j | ƒ q |  j | ƒ q Wd  S(   NR   t   _allR¡   t   symlink(   Ry  Ru   R³  R´  R·  (   R¦   R£   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   write_setpath_filess  s
    c         C   sì   xå |  j  |  j d d t ƒg D]Å } | j ƒ  r d t t | ƒ ƒ GHx› | j ƒ  D]Š } | j d ƒ rn qS n  | } t j	 d k rÃ | j
 ƒ  } | j d ƒ r¤ qS n  | j d ƒ rÃ | d  } qÃ n  |  j d	 | | d
 | ƒ qS Wq q Wd  S(   Nt   exe_devR    s   Processing: %sRM   R	   s   .exe.manifests   .exeiüÿÿÿR…   R–  (   Rú   R¤   R
   Rm   R   R   R  R0   Ru   Rv   RÌ   Rq  R­  (   R¦   R    R  R–  t   fnl(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   process_exe{  s     	   c            s”  g  } xZ ˆ  j  D]O } t | j ƒ  ƒ d k sF t | j ƒ  ƒ d k r | j | j j ƒ  ƒ q q Wx1 | D]) } ˆ  j d ˆ  j d | d d t	 ƒ qj Wˆ  j j
 ƒ  \ } } | | j d d ƒ } | j ƒ  rx1 | D]& } ˆ  j d | d | d d t	 ƒ qÕ Wn  ‡  f d	 †  } d
 d g } | ƒ  r6| j d ƒ n  xW | D]O }	 ˆ  j d d |	 d ƒ }
 x, | D]$ } ˆ  j d |
 d | d |	 ƒ qdWq=Wd  S(   Ni    R…   R–  s   .pythonR—  t   pythont   pythonws   .pythonwc             s[   xT ˆ  j  j ƒ  D]C }  |  j ƒ  } | j d ƒ r | d k sL | j d ƒ rS d  Sq q Wd  S(   Ns   libtbx.s   libtbx.ipythons   libtbx.ipython.(   Rù   R  RÌ   R0   (   R  t   file_name_lower(   R¦   (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   have_ipython�  s    t   show_build_patht   show_dist_pathst   ipythonR=   s   command_line/s   .pyRM   (   Rî   RN   t   command_line_directory_pathst   assemble_pythonpathR   Rv   RÌ   R­  RÜ   R
   RP   t   replaceRÐ   R  (   R¦   R`  R  R   R‡  R   t   pythonw_exeRÙ  t   commandsR<   R…   (    (   R¦   s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt%   write_python_and_show_path_duplicatesŠ  s:    		
	
	 	c         C   sß   |  j  d  k r d  Sd |  j  } x¸ |  j j ƒ  D]§ } | j d ƒ rK q0 n  t |  j | ƒ } t j d k r› | j ƒ  j	 d ƒ r› | d  | | d } n
 | | } t
 | ƒ y t j | | ƒ Wq0 t k
 rÖ q0 Xq0 Wd  S(   NR®   RM   R	   s   .exeiüÿÿÿ(   R  R   Rù   R  R0   R   Ru   Rv   RÌ   Rq  RÔ   t   shutilt   copyR�   (   R¦   R£   R  R…   R–  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt    write_command_version_duplicates®  s      $

  c         C   sS   |  j  g } x$ |  j D] } | j | j ƒ  ƒ q W| j ƒ  t d | ƒ |  _ d  S(   NR   (   Rû   Rî   Rg  RÞ  R]  R"   R«   (   R¦   R«   R  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÞ  ¼  s
    
c         C   s˜   |  j  d d d t ƒ} | j ƒ  rp y t | ƒ j ƒ  } Wn t k
 rM qp X| j ƒ  j d ƒ d k rp t Sn  x! |  j	 D] } | j
 ƒ  rz t Sqz Wt S(   NR=   s   CVS/RootR    t   ccpi    (   R  R
   RÐ   R~   R   R�   RÌ   R‚   R   Rî   t   is_version_controlled(   R¦   t   libtbx_cvs_rootR  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR±  Ã  s    	   c         C   s&   |  j  d j ƒ  |  j  d j ƒ  d  S(   Ns   .sconsign.dblites   .sconf_temp(   R×   RÑ   t   remove_tree(   R¦   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   clear_scons_memoryÐ  s    c         C   s  |  j  d } | j ƒ  |  j ƒ  |  j ƒ  |  j ƒ  d t t |  j  ƒ ƒ GH|  j ƒ  |  j ƒ  |  j	 ƒ  |  j
 ƒ  |  t _ t |  j  ƒ t j d <|  j ƒ  rÉ |  j ƒ  t j d k rÉ |  j ƒ  qÉ n  t j d k rå |  j ƒ  n  |  j ƒ  |  j j ƒ  s|  j j ƒ  n  d g } |  j ƒ  r=|  j r=| j d ƒ n  x- | D]% } |  j d |  j d | d	 t ƒ qDWx |  j D] } | j ƒ  qwWx* |  j  D] } t! j" j# d
 t | ƒ ƒ q•Wx |  j D] } | j$ ƒ  qÂW|  j% ƒ  |  j& ƒ  |  j' ƒ  |  j
 ƒ  | j( d ƒ d IJd  S(   Nt   libtbx_refresh_is_completeds%   Creating files in build directory: %sR°   R	   s   libtbx.pythonRÖ  R…   R–  R—  i    R™   ()   R×   RÑ   RÞ  RÏ  Rv  R   R   Rl  R¯  RÒ  RÅ  R=   R3   Ru   RÊ   Rô   R¼  Rv   R¿  RÂ  R  Rù   Rm   Rê   R±  RR  R   R­  RÜ   R
   Rî   t    process_command_line_directoriesR«   R\   R    Rz   t   process_libtbx_refresh_pyRâ  RÕ  Rå  R~   (   R¦   t   completed_file_namet   python_dispatchersR  R  R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   refreshÔ  sR    







	

			



c         C   sD   |  j  j | d  ƒ } | d  k r@ | r@ t d t | ƒ ƒ ‚ n  | S(   Ns.   libtbx.env.get_module(name=%s): unknown module(   Rï   RË   R   Ra   R   (   R¦   Rv   Rn   R   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt
   get_moduleÿ  s
    N(E   R¶   R·   R§   R   Rç   RØ   RÙ   Rã   Rô   RÛ   RÚ   R   Rþ   R¤   Rÿ   R  R  R  Ra   R  R  R³   R  R  R  Rß   R  R"  R#  R   Rm   R
   R,  R.  R4  R:  R;  Rc  Ri  Rl  Rv  Rm  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ñ  (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÕ   š  s†   																				Q			+		&	*		.	'			-								$					+R  c           B   sË   e  Z d d  d „ Z d „  Z d „  Z d „  Z e d „ Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z d „  Z d e d „ Z d „  Z d „  Z d d e d „ Z d „  Z d d g d „ Z d „  Z RS(   t   adaptbxc         C   sÂ   | |  _  | |  _ d | } t j | ƒ j t j | ƒ ƒ r„ | t | ƒ  |  _ |  j | g |  _ | d  k	 r¾ d  | g |  _	 q¾ n: | |  _ | | | g |  _ | d  k	 r¾ | d  g |  _	 n  d  S(   NR®   (
   R3   R1  R   R   Rq  RN   Rv   R0  R   R  (   R¦   R3   Rv   R  R1  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR§     s    		
!	c         c   s>   x7 t  |  j |  j ƒ D]  \ } } | d  k	 r | Vq q Wd  S(   N(   RÈ  R0  R  R   (   R¦   Rv   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   names_active  s    " c         C   sE   t  |  j ƒ  ƒ } t | ƒ d k r, | d Sd j |  j |  j g ƒ S(   Ni   i    t   +(   R   Ró  RN   R+   Rv   R1  (   R¦   Ró  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÇ    s     c         c   s,   x% |  j  D] } | d  k	 r
 | Vq
 q
 Wd  S(   N(   R  R   (   R¦   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR     s     c         c   sJ   xC t  |  j |  j ƒ D], \ } } | s4 | d  k	 r | | f Vq q Wd  S(   N(   RÈ  R0  R  R   (   R¦   t   allRv   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR  $  s    " c         C   sm   g  } xW |  j  d t ƒ D]C \ } } | d  k rO |  j j d | d t ƒ } n  | j | ƒ q W| |  _ d  S(   NRõ  R   R(  (   R  R
   R   R3   R4  R   R  (   R¦   t   new_dist_pathsRv   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR5  (  s    c   
      C   s¬  g  |  _  g  |  _ g  |  _ g  |  _ g  |  _ g  } xi|  j D]^} | d  k	 rŽx{t rÌ| d } | j ƒ  sx d  } Pn  y | j	 ƒ  } Wn' t
 k
 r± t d t | ƒ ƒ ‚ n Xy% t d j | j ƒ  ƒ i  i  ƒ } Wn: t k
 rí ‚  n' t k
 rt d t | ƒ ƒ ‚ n X| j ƒ  | j d d  ƒ } | d  k r@Pn  t | t ƒ sbt d | ƒ ‚ n  t j | ƒ } t j | ƒ s˜t j j | | ƒ } n  t j | ƒ sÃt d | | | f ƒ ‚ n  | } qR W| d  k	 rŽ|  j j | j d g  ƒ ƒ |  j j | j d	 g  ƒ ƒ |  j j | j d
 g  ƒ ƒ t j } xR | j d g  ƒ D]; }	 | d k rt|	 j  d d | ƒ }	 n  |  j j! |	 ƒ qIWqŽn  | j! | ƒ q= W| |  _ d  S(   Nt   libtbx_configs$   Cannot open configuration file: "%s"R%   s    Corrupt configuration file: "%s"Ra  sO   Corrupt configuration file:
  file = "%s"
  redirection must be a Python stringsQ   Invalid redirection:
  file = "%s"
  redirection = "%s"
  resulting target = "%s"t   modules_required_for_buildt   modules_required_for_uset   optional_modulest   exclude_from_binary_bundlet   /s   \("   t   python_pathst   required_for_buildt   required_for_useR(  Rû  R  R   R
   RÐ   R~   R�   Ra   R   t   evalR+   t	   readlinesRY   RJ   Rj  RË   RÏ   R›   R   RV  RS  R=   R    Rl   Rm   Rg  Ru   t   sepRß  R   (
   R¦   R  R  R    t   configR•   Ra  t   new_dist_pathR  t
   re_pattern(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR6  0  sn    						
   %  

	c         C   så   xH |  j  D]= } |  j j d |  d | d t ƒ s
 |  j j j | ƒ q
 q
 WxH |  j D]= } |  j j d |  d | d t ƒ sU |  j j j | ƒ qU qU WxH |  j D]= } |  j j d |  d | d t ƒ s  |  j j	 j | ƒ q  q  Wd  S(   NR  R   R(  (
   Rþ  R3   R:  R
   Rñ   R   Rÿ  Rò   R(  Ró   (   R¦   R   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR7  g  s    c         C   s—   g  } xŠ |  j  ƒ  D]| } | d } | j ƒ  r? | j | ƒ n  xM d |  j g D]< } | | d } | j ƒ  rO | j | j ƒ  j ƒ  ƒ qO qO Wq W| S(   NR«   R   s   __init__.py(   R  Rm   R   Rv   RÐ   R“  (   R¦   R   R  R    t   sub_dir(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÞ  u  s    
$c         C   s/   x( |  j  ƒ  D] } | | j ƒ  r t Sq Wt S(   N(   R  Rm   R
   R   (   R¦   t   directory_nameR  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   has_top_level_directory�  s    c         C   s4   x- d d d g D] } |  j  d | ƒ r t Sq Wt S(   Nt   CVSs   .svns   .gitR  (   R  R
   R   (   R¦   R  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRç  ‡  s    R   c         C   sÂ  | d k s | s t  ‚ |  j j | ƒ } t | ƒ d k rA d  S| | } | j ƒ  s[ d  S| j ƒ  } | j d ƒ rz d  S| j d ƒ r� d  S| j d ƒ r  d  S| j d ƒ r³ d  S| j d ƒ rÆ d  S| d k r	|  j d	 k r	y d
 d  l	 } Wq	t
 k
 rd  SXn  t j | ƒ d }	 | r+d }
 n d }
 t } |	 d k rX|
 d k s®t  ‚ nV t j d k rz|	 t k r®d  Sn4 |	 d k rŠd  S|	 d k r®t d |
 ƒ }
 t } n  g  } |
 d k ry | j ƒ  j |
 ƒ } Wn! t k
 rüt d | ƒ ‚ n X| rM| j d ƒ rM| sId | } d t | ƒ GH| GHd t | ƒ GHn  d  SxÌ | j ƒ  D]» } | j ƒ  } y | j d ƒ } Wn t k
 r’n/ X| d t | ƒ k  rÁ| j | | d ƒ n  |	 d k rZd | k rZ|  j j t j |  j d | t |	 ƒ  t ƒ d t ƒ} qZqZWn  t | ƒ d k r”|  j j ƒ  | } | j d ƒ sf| j d ƒ d k r„| d t j | ƒ d 7} n  | j | ƒ n  x' | D] } |  j j d | d | ƒ q›Wd  S(   NR   i    s   __init__.pys   .pycs   .pyoRM   t   ~s   ipython_shell_start.pyR=   iÿÿÿÿi   iè  s   .launchR	   s   .bats   .shs   .pyi   s   Cannot read file: "%s"s   #!s/   WARNING: Ignoring file "%s" due to missing "#!"t   *t   LIBTBX_SET_DISPATCHER_NAMEt   LIBTBX_LAUNCH_EXER÷   R    s   main.R…   R–  (   s   .shs   .py(    RŒ   R3   RÛ   RN   RÐ   RÌ   R0   Rq  Rv   t   IPythont   ImportErrorR   t   splitextR   Ru   t   windows_pathextRy   R
   R~   R   R�   Ra   R€   RP   t   indexRF   R   R¤   R+   t
   exe_suffixRU  R­  (   R¦   t
   source_dirR  t   suppress_warningt   target_file_name_infixt#   scan_for_libtbx_set_dispatcher_nameR…   RØ  R  RÍ   t	   read_sizet   check_for_hash_bangt   target_filest   source_textt   msgR|   t   fldsRV   R–  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR¬  �  s”     
        	 	 	'c         C   se   g  } xX |  j  ƒ  D]J } xA d |  j d g D], } | | } | j ƒ  r- | j | ƒ q- q- Wq W| S(   NRP  s   /command_line(   R  Rv   Rm   R   (   R¦   R   R  R  R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÝ  Õ  s    
c         C   s  x|  j  ƒ  D]} d t t | ƒ ƒ GHd „  } | j ƒ  } i  } x> | D]6 } | | ƒ rJ | j | d  g  ƒ j | d ƒ qJ qJ WxŒ | D]„ } | | ƒ rí t | | d  ƒ d k rí t j d k rÏ d } n d } | j	 | ƒ rí q‹ qí n  |  j
 d	 | d
 | d t d t ƒ q‹ Wq Wd  S(   Ns   Processing: %sc         S   s   |  j  d ƒ p |  j  d ƒ S(   Ns   .shs   .py(   Rq  (   R  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   is_py_shá  s    iýÿÿÿiþÿÿÿi   R	   s   .shs   .pyR  R  R  R  (   RÝ  R   R   R  R©  R   RN   Ru   Rv   Rq  R¬  R   R
   (   R¦   R  R  t   nodest
   py_sh_dictR  t   skip(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRì  Þ  s*    	( 			s     c         C   sƒ   |  j  j | ƒ } | d t t | ƒ ƒ GHxQ | j ƒ  D]C } | j d ƒ sS q8 n  |  j d | d | d t d | d | ƒ q8 Wd  S(   Ns   Processing: %ss   .pyR  R  R  R  R  (   R3   RÛ   R   R   R  Rq  R¬  R   (   R¦   R  t   print_prefixR  R  R  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt#   process_python_command_line_scriptsö  s     	c         C   sf   x_ |  j  ƒ  D]Q } | d } | j ƒ  r d t t | ƒ ƒ GHt t | ƒ i  i |  d 6ƒ q q Wd  S(   Ns   libtbx_refresh.pys   Processing: %sR¦   (   R  RÐ   R   R   t   execfile(   R¦   R  t   custom_refresh(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRí    s
    
s   run_tests.pys   run_examples.pyc         C   sX   g  } xK |  j  ƒ  D]= } x4 | D], } | | } | j ƒ  r  | j | ƒ q  q  Wq W| S(   N(   R  RÐ   R   (   R¦   t
   file_namesR   R  R  R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÀ    s    
 c         C   sO   xH | D]@ } x7 |  j  ƒ  D]) } | | } | j ƒ  r | j ƒ  q q Wq Wd  S(   N(   R  RÐ   RÑ   (   R¦   t   pyc_file_namesR  R  R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   remove_obsolete_pyc_if_possible  s
    
 N(   R¶   R·   R   R§   Ró  RÇ  R  R   R  R5  R6  R7  RÞ  R  Rç  R¬  RÝ  Rì  R#  Rí  RÀ  R(  (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR    s*   					7				
C				Rà   c           B   se   e  Z d  d d d d d g Z e e e e e e e	 e e e e
 e e d „ Z d „  Z d	 d „ Z RS(
   t   releaset   max_optimizedt   quickt   debugt   debug_optimizedt   profilec         C   s§   t  |  t ƒ  ƒ |  j t j k s( t ‚ |  j d k s= t ‚ |  j d k |  _ |  j d	 k |  _ |  j d
 k |  _	 |  j
 rˆ t |  _ n  |  j d k r£ d  |  _ n  d  S(   Ni    R)  R*  R-  R.  R,  R   (   s   releases   max_optimizedR-  R.  (   s   max_optimizedR-  R.  (   s   debugR-  R.  (   R   t   localsRœ   Rà   t   supported_modesRŒ   R>  t   optimizationR*  t   debug_symbolsRA  R
   R@  RL  R   (   R¦   R*   Rœ   R>  R@  RA  RB  RC  RD  R\  RE  RF  RG  RH  RI  R?  RJ  RK  RL  RM  RN  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR§   '  s    	 c         C   s©   |  j  r¥ d |  _ d |  _ d |  _ t j j d ƒ } | d  k	 rN | |  _ n  t j j d ƒ } | d  k	 rx | |  _ n  t j j d ƒ } | d  k	 r¥ | |  _ q¥ n  d  S(   NR   t   CXXFLAGSt   CFLAGSt   CPPFLAGS(   RJ  t   env_cxxflagst
   env_cflagst   env_cppflagsRu   RÊ   RË   R   (   R¦   t   flg(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR[  I  s    				c         C   s¸  | d  k r t j } n  | d I|  j IJ| d I|  j IJ| d I|  j IJ| d I|  j IJ| d I|  j IJ| d I|  j IJ| d I|  j	 IJ| d I|  j
 IJ| d	 I|  j IJ| d
 I|  j IJ| d I|  j IJ| d I|  j IJ| d I|  j IJ| d I|  j IJ| d I|  j IJ| d I|  j IJ| d I|  j IJ| d I|  j IJ|  j r´| d I|  j IJ| d I|  j IJ| d I|  j IJn  d  S(   Ns	   Compiler:s   Build mode:s   Warning level:s   Precompiled Headers:s   Static libraries:s   Static exe:s   Scan Boost headers:s   Write full flex_fwd.h files:s   Build Boost.Python extensions:s%   Define BOOST_PYTHON_NO_PY_SIGNATURES:s$   Define BOOST_PYTHON_BOOL_INT_STRICT:s   Enable OpenMP if possible:s   Enable CUDA:s   Use system libraries:s   Use opt_resources if available:s   Use environment flags:s   Enable C++11:s   Force true division:s     CXXFLAGS = s     CFLAGS = s     CPPFLAGS = (   R   R\   t   stdoutR*   Rœ   R>  R?  R@  RA  RC  RD  R\  RE  RF  RG  RH  RB  RI  RJ  RM  RN  R6  R7  R8  (   R¦   R•   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRÍ  [  s6     
	
	
		N(   R¶   R·   R0  t   default_write_full_flex_fwd_ht%   default_build_boost_python_extensionsR   R
   t!   default_enable_openmp_if_possiblet   default_enable_cudat   default_opt_resourcest   default_msvc_arch_flagt   default_enable_cxx11R§   R[  R   RÍ  (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRà     s*   	
	t   include_registryc           B   sJ   e  Z d  „  Z e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   c         C   s    d |  _  i  |  _ |  j ƒ  d  S(   Nt   boost(   t   _boost_dir_namet   _had_messageRC  (   R¦   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR§   y  s    		c         C   s   | |  _  |  S(   N(   t   _scan_boost(   R¦   t   flag(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRC  ~  s    	c         C   s   t  j | ƒ j ƒ  |  _ d  S(   N(   R   Rš   RÌ   RD  (   R¦   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   set_boost_dir_name‚  s    c         C   sX   |  j  rT t j | ƒ j ƒ  |  j k rT | |  j k rP d G| GHd |  j | <n  t St S(   Ns=   libtbx.scons: implicit dependency scan disabled for directoryi   (   RF  R   Rš   RÌ   RD  RE  R   R
   (   R¦   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt	   scan_flag…  s    
c         C   s!   t  | t ƒ s t ‚ | d | S(   Nt	   INCPREFIX(   RÏ   R›   RŒ   (   R¦   R3   R    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   prepend_include_switch�  s    c         C   s–   t  | t ƒ s t ‚ t d | ƒ } xk | D]c } |  j | ƒ rV | j d | g ƒ q+ |  j | | ƒ } | j d | g ƒ | j d | g ƒ q+ Wd  S(   NR   t   CPPPATHR3  t
   SHCXXFLAGS(   RÏ   R   RŒ   R"   RI  t   AppendRK  (   R¦   R3   R   R    t   ipath(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR   “  s    c         C   s    t  | t ƒ s t ‚ t d | ƒ } | j ƒ  xk | D]c } |  j | ƒ r` | j d | g ƒ q5 |  j | | ƒ } | j d | g ƒ | j d | g ƒ q5 Wd  S(   NR   RL  R3  RM  (   RÏ   R   RŒ   R"   R]  RI  t   PrependRK  (   R¦   R3   R   R    RO  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR¾   ž  s    
(
   R¶   R·   R§   R   RC  RH  RI  RK  R   R¾   (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRB  w  s   			
		t   pre_process_argsc           B   s   e  Z d d  „ Z d „  Z RS(   c   	      C   s\  g  |  _  t | ƒ d k r' d g } n  | d  k rE d } t |  _ n d } t |  _ d d l m } | d d | ƒ } |  j rÍ | j d  d	 d
 d d t d d ƒ| j d  d d
 d d d d d  d d ƒn`| j d d d
 d d d d |  j	 d d d d ƒt
 t j d ƒ rA| j d  d d
 d d d d d  d d d d ƒn  | j d  d d t j d d d d  d d! j t j ƒ ƒ| j d  d" d
 d d d d d d d# d d$ ƒ| j d  d% d
 d d d& d d d d' ƒ| j d  d( d
 d d t d d) ƒ| j d  d* d
 d d t d d+ ƒ| j d  d, d
 d- d d. d d/ d dh d d1 ƒ| j d  d2 d
 d d t d d3 ƒ| j d  d4 d
 d d t d d5 ƒ| j d  d6 d
 d d d d d  d d7 d d$ ƒ| j d  d8 d
 d d t d d9 ƒ| j d  d: d
 d d t d d; ƒdi } | j d  d? d | d t d d@ d d! j | ƒ ƒ| j d  dA d
 d d dB d t d dC t t ƒ d dD ƒ| j d  dE d
 d d dB d t d dF t t ƒ d dD ƒ| j d  dG d
 d d t d dH ƒ| j d  dI d
 d d dB d t d dJ t t ƒ d dD ƒ| j d  dK d
 d d t d dL ƒ|  j si| j d  dM d
 d d t d dN ƒ| j d  dO d
 dP d t d dQ ƒn  | j d  dR d
 d d t d dS ƒ| j d  dT d
 d d t d dU ƒ| j d  dV d
 d d t d dW ƒ| j d  dX d
 d d t d dY ƒ| j dZ | ƒ |  _ t |  j j ƒ d k r-t d[ ƒ ‚ n  t
 t j d ƒ sQd  |  j j _ n  | d  k	 rp|  j  j | ƒ n  |  j sX|  j j j r"t  j! d\ k r¦t d] ƒ ‚ n  t  j" dk k rÄt da ƒ ‚ n  d db l# m$ } | j% dc dd ƒ } t | j& ƒ d k st | j' ƒ d k r"t de ƒ ‚ q"n  |  j j j( d< k rXt j) df k rXt dg ƒ ‚ qXn  d  S(l   Ni    s   --helps   libtbx.configures   libtbx/configure.pyiÿÿÿÿ(   t   option_parsert   usages/   %s [options] module_name[=redirection_path] ...s   --onlyRÄ   t
   store_trueR  t   helps%   disable previously configured moduless	   --excludet   storet   typet   strings'   Modules to leave out from configurations   -rs   --repositoryt   callbacksg   path to source code repository (may be specified multiple times; paths are searched in the order given)t   metavart	   DIRECTORYR¨  s   --current_working_directorysZ   preferred spelling of current working directory (to resolve ambiguities due to soft links)s   --buildt   choicesR)  s   build mode (default: release)t   |s
   --compilers1   select non-standard compiler (platform dependent)t   STRINGs   --warning_levelRD   s/   manipulate warning options (platform dependent)s   --static_librariess   build all libraries staticallys   --static_exes<   link all executables statically (implies --static_libraries)s   --use_system_libsR   t   choicet   LIBRC  s<   Use selected library from the system. Possible values: boosts   --scan_boosts   enable implicit dependency scans   --write_full_flex_fwd_hs{   create full flex_fwd.h files to work around platform-specific problems (see comments in cctbx.source_generators.flex_fwd_h)s   --command_version_suffixs,   version suffix for commands in bin directorys   --use_environment_flagssI   add compiler flags from environment variables: CXXFLAGS, CFLAGS, CPPFLAGSs   --force_32bits¹   Force 32-bit compilation on Mac OS 10.6 (Snow Leopard)
Not compatible with /usr/bin/python: please run configure
with /System/Library/Frameworks/Python.framework/Versions/2.x/bin/pythonR   t   SSER   s   --msvc_arch_flagsA   choose MSVC CPU architecture instruction set for optimized buildss   --build_boost_python_extensionst   bools2   build Boost.Python extension modules (default: %s)s
   True|Falses   --enable_openmp_if_possibles7   use OpenMP if available and known to work (default: %s)s   --enable_cudas±   Use optimized CUDA routines for certain calculations.  Requires at least one NVIDIA GPU with compute capability of 2.0 or higher, and CUDA Toolkit 4.0 or higher (default: don't)s   --opt_resourcess,   use opt_resources if available (default: %s)s   --precompile_headerssA   Precompile headers, especially Boost Python ones (default: don't)s   --boost_python_no_py_signaturess0   disable Boost.Python docstring Python signaturess   --boost_python_bool_int_strictt   store_falses4   disable Boost.Python implicit bool<->int conversionss   --clear_scons_memorys.   remove scons build signatures and config caches   --no_bin_pythonsL   do not create <build directory>/bin/python even in a development environments   --enable_cxx11s   use C++11 standards   --old_divisions3   Don't force 'true division' behavior in dispatchersRT  sM   At least one module name is required (use --help to obtain more information).Rr   s9   The --force_32bit option is only valid on Mac OS systems.i   i   i   sV   The --force_32bit option can only be used with 32-bit Python.
  See also: "man python"(   R;   R<   s   /usr/bin/arch -i386 /bin/ls /s8   The --force_32bit option is not valid for this platform.R	   s;   The --msvc_arch_flag option is not valid for this platform.(   s   boost(   s   NoneRa  R   l        l   ÿÿ (*   Rá   RN   R   R
   RW  R   t   libtbx.option_parserRR  t   optiont   option_repositoryRy  Ru   R    Rà   R0  R+   R;  R@  R<  R   R=  R>  R?  RA  t   processRP  RT  Ra   RQ  t   current_working_directoryRg  RK  R\   Ri   t   maxintR=   R;   R>   RO   R@   RL  Rv   (	   R¦   RT  t   default_repositoriesRQ   RR  t   parsert   msvc_arch_flag_choicesR;   t   buffers(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyR§   ¬  sZ   	 		
	
		
			c         C   s<   t  j | ƒ s( t d t | ƒ ƒ ‚ n  |  j j | ƒ d  S(   Ns    Not a directory: --repository %s(   R   Rm   Ra   R   Rá   R   (   R¦   Re  t   optt   valueRk  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRf  h  s    N(   R¶   R·   R   R§   Rf  (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRQ  ª  s   ¼c         C   s  t  t j d ƒ s d  St j t j ƒ \ } } t j |  | ƒ rt j |  | ƒ } t j | t j ƒ rt j	 t j
 t j ƒ ƒ } t j | k r� | t _ n  t j	 t j
 t j ƒ ƒ } | j | ƒ rt j | t | ƒ } t j | t j ƒ rt j | k r| t _ qqqqn  d  S(   NR¨  (   Ry  Ru   R    R   RP   R\   Rj   R¨  R+   t   normpathR   R]   R0   RN   (   R×   R“  Rš   t
   new_prefixRˆ  RK   t   new_executable(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt+   set_preferred_sys_prefix_and_sys_executablen  s     c          C   si  g  }  x“ t  j d ƒ D]‚ } t j | ƒ s1 q n  | d k rM |  j | ƒ q xH d d d g D]7 } t j | | ƒ } t j | ƒ r] |  j | ƒ q] q] Wq Wt |  ƒ d k ret t	 |  ƒ ƒ }  t |  ƒ d k rá d } d	 } n d
 } d } d d d | | f g } | j
 g  |  D] } d t | ƒ ^ qƒ | j
 d d d d | g ƒ t d j | ƒ ƒ ‚ n  d  S(   NRM   t   cctbx_projectR÷  s   libtbx_refresh.pyR¹  i    i   t   thist   yt   theset   iess   Safety guard:s@     The current working directory appears to be a source directorys5     as determined by the presence of %s sub-director%s:s       %ss     To resolve this problem:s@     - If this command was accidentally run in the wrong directory,s*       change to the correct build directory.s1     - Remove or rename the director%s listed above.s   
(   Ru   R  R   Rm   R   R+   RÐ   RN   RÎ  R   Rg  R   Ra   (   t   likely_sourcest   level1R  t   level2t   tR—   R  R‡  (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt#   raise_if_source_directory_suspected~  s<       	 *c   
      C   s  t  ƒ  t } x0 t j d ƒ D] } | j d ƒ s t } Pq q Wg  } t j t j |  d ƒ ƒ } t j | ƒ } | j	 ƒ  j d ƒ rŸ | j
 t j | ƒ ƒ n  | j
 | ƒ t d |  d d | ƒ } | j j j } | d  k rï t j ƒ  } nÆ t j | ƒ st d t | ƒ ƒ ‚ n  t j | ƒ s?t d t | ƒ ƒ ‚ n  t j | t j ƒ  ƒ spt d	 t | ƒ ƒ ‚ n  t t j ƒ } x3 t | ƒ | k r´| j t j ƒ r´| |  } q‚Wt d
 | ƒ t d
 | ƒ }	 |	 j d | ƒ | j j j sö| r|	 j ƒ  n  |	 j ƒ  d  S(   NRM   i    Rt  RT  i   Rj  s9   Not an absolute path name: --current_working_directory %ss/   Not a directory: --current_working_directory %ssO   Not equivalent to the current working directory: --current_working_directory %sR×   R_  (   R}  R
   Ru   R  R0   R   R   R“  Rš   RÌ   R   RQ  RP  RQ  Rh  R   t   getcwdRS  Ra   R   Rm   R¨  RN   R  Rq  Rs  RÕ   Rc  Rê  Rð  (
   RT  t   cwd_was_empty_at_startR  Rj  Rü   R   R_  R×   R›  R3   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt
   cold_start›  sJ    
	'c          C   sd  t  j d }  t d |  ƒ t t j |  d ƒ d ƒ } t j | ƒ } | j t	 j
 d  k rg | j ƒ  n  t | j d ƒ sˆ t | j _ n  t | j d ƒ sÍ t | j _ d | j _ d | j _ d | j _ n  t | j d	 ƒ sî t | j _ n  t | j d
 ƒ st | j _ n  t | j d ƒ s0t | j _ n  t | j d ƒ sQt | j _ n  t | j d ƒ srt | j _ n  t | j d ƒ s“t | j _ n  t | d ƒ s·d GHt	 j d ƒ n  t | j d ƒ rt j |  ƒ t j t | j ƒ ƒ k r| j j  |  ƒ qn  t | d ƒ s!t | _! n  y
 | `" Wn t# k
 r>n Xt | j d ƒ s`t | j _$ n  | S(   NR°   R×   RÃ  t   rbi   RF  RJ  R   RK  RL  R?  RI  RH  RN  Rå   s�   Please re-configure from scratch your cctbx_build:cd cctbx_build; /your/path/to/python ../cctbx_project/libtbx/configure.py [options] [modules]i   t   resetRR  RM  (%   Ru   RÊ   Rs  R~   R   R+   RÅ  t   loadRÖ   R\   Rk   Rç   Ry  Rà   R
   RF  R   RJ  R6  R7  R8  RK  R@  RL  R?  RI  RH  RN  t   exitR×   t   realpathR   R‚  RR  t   enable_boost_threadsR   RM  (   R×   RÃ  R3   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   unpickleÃ  sP    '
c         C   sV   t  d |  d ƒ } t ƒ  } | j d | ƒ | j j j rH | j ƒ  n  | j ƒ  d  S(   NRT  i   R_  (   RQ  R‡  Rc  RP  RQ  Rê  Rð  (   RT  R_  R3   (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyRW  û  s    	t   __main__t   __libtbx_refresh__s   Done.(P   t
   __future__R    t   libtbx.pathR=   R   R   t   libtbx.str_utilsR   t   libtbx.utilsR   R   Ri   Rã  RÅ  t	   cStringIOR   RB   R\   Ru   R    R   RÊ   RË   t
   wingdbstubR”  Rk   Rv   R  R   R0   R;  RD   R@  R
   R<  R   R=  R>  R?  RA  R   R"   R9   RH   RL   RW   R[   R   R`   Rd   Rg   Rp   Rw   R}   RŠ   R“   R˜   Rž   t   objectRŸ   R¸   RÆ   RÎ   R  RÔ   R‘  RÕ   R  Rà   RB  RQ  Rs  R}  R€  R‡  RW  R¶   RN   t   argvRð  (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/env_config.pyt   <module>   s”   	% 						!
							5		+ÿ ÿ ÿ ÿ pÿ Z3Ä			(	8	(