3 \)@s*ddlZddlZGdddZddZdS)Nc@seZdZdddZddZdS) ExtensionNcKst|tstdt|to,tdd|Ds6td||_||_|pHg|_|pRg|_|p\g|_ |pfg|_ |ppg|_ |pzg|_ | pg|_ | pg|_| pg|_| pg|_| pg|_|pg|_||_||_t|dkrdd|D}djt|}d |}tj|dS) Nz'name' must be a stringcss|]}t|tVqdS)N) isinstancestr).0vr+/usr/lib64/python3.6/distutils/extension.py jsz%Extension.__init__..z#'sources' must be a list of stringsrcSsg|] }t|qSr)repr)rZoptionrrr sz&Extension.__init__..z, zUnknown Extension options: %s)rrAssertionErrorlistallnamesources include_dirs define_macros undef_macros library_dirs librariesruntime_library_dirs extra_objectsextra_compile_argsextra_link_argsexport_symbols swig_optsdependslanguageoptionallenjoinsortedwarningswarn)selfrrrrrrrrrrrrrrrrkwZoptionsmsgrrr__init__Vs4              zExtension.__init__cCsd|jj|jj|jt|fS)Nz<%s.%s(%r) at %#x>) __class__ __module__ __qualname__rid)r$rrr__repr__s zExtension.__repr__)NNNNNNNNNNNNNN)__name__r)r*r'r,rrrrrsD !rcCsddlm}m}m}ddlm}ddlm}||}||dddddd}zhg}x\|j} | dkrfP|j | rrqT| d| d#kodknr|j d| qT|| |} || } | d} t | g} d} x| ddD]}| dk r| j |d} qt jj|d}|dd }|d d}|d$kr8| jj |q|dkrP| jj |q|dkr|jd}|d%kr| jj |dfn$| jj |d|||d dfq|dkr| jj |q|dkr| jj |q|dkr| jj |q|dkr| jj |q|dkr| jj |q|dkr0| j} q|dkrB| j} q|dkrT| j} q|dkrx| jj ||s| j} q|d&kr| jj |q|j d"|qW|j | qTWWd|jX|S)'Nr)parse_makefileexpand_makefile_vars _variable_rx)TextFile) split_quoted)Zstrip_commentsZ skip_blanksZ join_linesZ lstrip_wsZ rstrip_ws*z'%s' lines not handled yet.c.cc.cpp.cxx.c++.m.mmz-Iz-D=z-Uz-Cz-lz-Lz-Rz-rpathz-Xlinkerz -Xcompilerz-u.a.so.sl.o.dylibzunrecognized argument '%s')r6r7r8r9r:r;r<rC)r>r?r@rArB)Zdistutils.sysconfigr.r/r0Zdistutils.text_filer1Zdistutils.utilr2readlinematchr#rappendospathsplitextrrfindrrrrrrrrclose)filenamer.r/r0r1r2varsfile extensionslineZwordsmoduleZextZappend_next_wordZwordsuffixZswitchvalueZequalsrrrread_setup_files                          rT)rGr"rrTrrrrs z