U
    ôŠf†  ã                   @   s:   d dl mZ d dlmZ dd„ Zed
dd„ƒZdd	„ ZdS )é    N)Úconfc                 C   sB   |   d¡} | jdddd� | jddddd	� | jd
dddd	� d S )NzGLPK Optionsz--with-glpkÚstringzgive GLPK installation location)ÚtypeÚhelpz--with-glpk-includeÚ z'give GLPK include installation location)r   Údefaultr   z--with-glpk-libz#give GLPK lib installation location)Úadd_option_groupÚ
add_option)Úopt© r   ú./home/yuhw/wc/wire-cell/waf-tools/find_glpk.pyÚoptions   s    
ÿ
ÿ
ÿr   Fc                 C   sè   | j j}|d ks| ¡ dkr:|  d¡ | jddd|d� n^| ¡ dkrJd S |  d| ¡ | j jrp| j jg| j_nt 	|d	¡g| j_| j j
r˜| j j
g| j_| jd
d|d� | j jdg7  _t| jjƒrÚ|  | jjd ¡ n
|  d¡ d S )N)ÚyesÚtrueÚonz$Checking for GLPK in PKG_CONFIG_PATHZglpkZGLPKz--cflags --libs)ÚpackageÚuselib_storeÚargsÚ	mandatory)ÚnoÚoffÚfalsezChecking for GLPK in %sÚincludezglpk.h)Úheader_nameÚuser   r   zGLPK not found)r   Z	with_glpkÚlowerÚ	start_msgÚ	check_cfgZwith_glpk_includeÚenvZINCLUDES_GLPKÚospÚjoinZwith_glpk_libZLIBPATH_GLPKÚcheckZLIB_GLPKÚlenÚend_msg)Úctxr   Úinstdirr   r   r   Ú
check_glpk   s(    
 ÿr&   c                 C   s   |   ¡  d S )N)r&   )Úcfgr   r   r   Ú	configure-   s    r(   )F)Zos.pathÚpathr   Zwaflib.Configurer   r   r&   r(   r   r   r   r   Ú<module>   s
   
