a
    iÝEbh
  ã                   @   sH   d Z ddlZddlZddlZddlmZmZ ddlZejj	dd„ ƒZ
dS )z$Tests for numpy.distutils.build_ext.é    N)ÚindentÚdedentc                 C   sÜ  ddl m} |ƒ st d¡ t| d dƒ�&}| ttdƒdd�¡ W d	  ƒ n1 sV0    Y  t| d
 dƒ�&}| ttdƒdd�¡ W d	  ƒ n1 sš0    Y  t| d dƒ�}| d¡ W d	  ƒ n1 sÒ0    Y  t| d dƒ�@}tj	 
tj	 t¡ddd¡}| td|› d�ƒ¡ W d	  ƒ n1 �s20    Y  | }tjtjddddt| d ƒdt| d ƒgt|ƒd� d	}t| d ƒ�4}|D ]}d|v �rŠ| ¡ } �qª�qŠW d	  ƒ n1 �sÀ0    Y  |d	u�sØJ ‚d	S )zY
    Ensures multiple "fake" static libraries are correctly linked.
    see gh-18295
    r   )Úhas_f77_compilerzNo F77 compiler foundz	_dummy1.fÚwzL            FUNCTION dummy_one()
            RETURN
            END FUNCTIONz      )ÚprefixNz	_dummy2.fzL            FUNCTION dummy_two()
            RETURN
            END FUNCTIONz_dummy.czint PyInit_dummyext;zsetup.pyz..a@              def configuration(parent_package="", top_path=None):
                from numpy.distutils.misc_util import Configuration
                config = Configuration("", parent_package, top_path)
                config.add_library("dummy1", sources=["_dummy1.f"])
                config.add_library("dummy2", sources=["_dummy2.f"])
                config.add_extension("dummyext", sources=["_dummy.c"], libraries=["dummy1", "dummy2"])
                return config


            if __name__ == "__main__":
                import sys
                sys.path.insert(0, r"zv")
                from numpy.distutils.core import setup
                setup(**configuration(top_path="").todict())ÚbuildÚinstallz--prefixZ
installdirz--recordztmp_install_log.txt)ÚcwdZdummyext)Znumpy.f2py.tests.utilr   ÚpytestÚskipÚopenÚwriter   r   ÚosÚpathÚjoinÚdirnameÚ__file__Ú
subprocessÚ
check_callÚsysÚ
executableÚstrÚstrip)Ztmp_pathr   ZfidZsrctreeÚ	build_dirÚsoÚline© r   úd/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/numpy/distutils/tests/test_build_ext.pyÚtest_multi_fortran_libs_link	   s@    

ý&ý&(ô,þü
*r   )Ú__doc__r   r   r   Útextwrapr   r   r
   ÚmarkZslowr   r   r   r   r   Ú<module>   s   