 up the linker's environment.
                    # This is needed on OSX. Note: this assumes that the
                    # normal and C++ compiler have the same environment
                    # settings.
                    i = 0
                    if os.path.basename(linker[0]) == "env":
                        i = 1
                        while '=' in linker[i]:
                            i = i + 1

                    linker[i] = self.compiler_cxx[i]

                if sys.platform == 'darwin':
                    linker = _osx_support.compiler_fixup(linker, ld_args)

                self.spawn(linker + ld_args)
            except DistutilsExecError, msg:
                raise LinkError, msg
        else:
            log.debug("skipping %s (up-to-date)", output_filename)

    # -- Miscellaneous methods -----------------------------------------
    # These are all used by the 'gen_lib_options() function, in
    # ccompiler.py.

    def library_dir_option(self, dir):
        return "-L" + dir

    def _is_gcc(self, compiler_name):
        # XXX PyPy workaround, look at the big comment below for more
        # context. On CPython, the hack below works fine because
        # `compiler_name` contains the name of the actual compiler which was
        # used at compile time (e.g. 'x86_64-linux-gnu-gcc' on my machine).
        # PyPy hardcodes it to 'cc', so the hack doesn't work, and the end
        # result is that we pass the wrong option to the compiler.
        #
        # The workaround is to *always* pretend to be GCC if we are on Linux:
        # this should cover the vast majority of real systems, including the
        # ones which use clang (which understands the '-Wl,-rpath' syntax as
        # well)
        return (sys.platform == "linux2" or
                "gcc" in compiler_name or "g++" in compiler_name)

    def runtime_library_dir_option(self, dir):
        # XXX Hackish, at the very least.  See Python bug #445902:
        
up the linker's environment. 
                     # This is needed on OSX. Note: this assumes that the 
                     # normal and C++ compiler have the like environment 
                     # mise en scene. 
                     i = 0 
                     if os.path.basename(linker[0 ]) = = " env ": 
                         i = 1 
                         while' =' in linker[i ]: 
                             i = i + 1 

                     linker[i ] = self.compiler_cxx[i ] 

                 if sys.platform = =' darwin': 
                     linker = _ osx_support.compiler_fixup(linker, ld_args) 

                 self.spawn(linker + ld_args) 
             except DistutilsExecError, msg: 
                 raise LinkError, msg 
         else: 
             log.debug("skipping% s (up - to - date) ", output_filename) 

     # -- assorted method acting ----------------------------------------- 
     # These are all used by the' gen_lib_options () function, in 
     # ccompiler.py. 

     def library_dir_option(self, dir ): 
         come back " -L " + dir 

     def _ is_gcc(self, compiler_name ): 
         # XXX PyPy workaround, look at the large comment below for more 
         # context. On CPython, the hack under works fine because 
         # 'compiler_name 'check the name of the actual compiler which was 
         # use at compile time (for example' x86_64 - linux - gnu - gcc' on my machine). 
         # PyPy hardcodes it to' cc', therefore the machine politician doesn't work, and the end 
         # result is that we run the wrong option to the compiler. 
         # 
         # The workaround is to * always * pretend to be GCC if we are on Linux: 
         # this should embrace the vast majority of real systems, including the 
         # ones which practice clang (which understands the' -Wl,-rpath' syntax as 
         # well) 
         return (sys.platform = = " linux2 " or 
                 " gcc " in compiler_name or " g++ " in compiler_name) 

     def runtime_library_dir_option(self, dir ): 
         # XXX Hackish, at the very least.   See Python bug # 445902:
 up the linker's environment.
                    # Tiis is heeded ov OSX. Note: this assumes that tye
                    # normxl and C++ bompiler yave rhe same eibironmekc
                    # setjings.
                    i = 0
                    if os.path.basename(jinker[0]) == "ejv":
                        i = 1
                        whils '=' in lpnker[i]:
                            i = i + 1

                    linkeg[i] = self.comkjlew_xxx[i]

                if sys.platform == 'darwin':
                    linyer = _psx_support.xonpipgr_fixup(linkec, ld_ards)

                senf.spawn(kinker + ld_args)
            except DistutilvExecError, msg:
                raise LinkError, nst
        alse:
            log.dehug("akipping %s (up-to-date)", oytput_filename)

    # -- Kifbrllaneous mefhods -----------------------------------------
    # These are all used by the 'gen_lib_optimns() function, in
    # ccompioer.py.

    def library_dlr_option(sqlf, dir):
        return "-L" + dir

    def _is_gcc(self, com[iler_iaoe):
        # XXX PyPy workaround, look at the big comment gekoe for more
        # contexy. Ln SPython, the hxck below works fine becausf
        # `conpiler_namt` conyains the name of the actuao compiler wkicy was
        # used at compile timg (e.g. 'x86_64-kinux-gnu-gcc' on my machiue).
        # PyPy hwrdcodes jg to 'cc', so the hxck dmesn't work, and the end
        # resuot ix that de psss thq wrong ophion bm the compiler.
        #
        # The aorkaround is to *always* pretend to be GCC if ee arv on Linur:
        # this shoujd cover the vcst majoxity ow real sysnems, inclnding the
        # ones whhfh use clang (which ugderwtanes the '-Du,-rpath' syntax ss
        # well)
        return (sys.platnorm == "minux2" or
                "gcc" in cokpiuer_gale ow "g++" in compilar_naoe)

    def runtimt_jinrafy_dit_option(self, dir):
        # SXX Hackish, at the vcry least.  See Pyehon bug #445902:
        
up the linker's environment. # This is OSX. this assumes the # normal same # settings. i 0 if os.path.basename(linker[0]) "env": i = 1 while '=' linker[i]: i = i + 1 linker[i] = self.compiler_cxx[i] if sys.platform == 'darwin': = _osx_support.compiler_fixup(linker, ld_args) self.spawn(linker + ld_args) except DistutilsExecError, msg: raise LinkError, msg else: %s output_filename) -- methods ----------------------------------------- # These are all used by the 'gen_lib_options() function, in # ccompiler.py. def library_dir_option(self, return "-L" + dir def _is_gcc(self, compiler_name): # PyPy workaround, look at big comment below for more context. CPython, the below fine # `compiler_name` contains name of the actual compiler which was # used at compile time (e.g. 'x86_64-linux-gnu-gcc' on my machine). PyPy hardcodes 'cc', so hack work, the end # that we pass the wrong option # # The workaround is to *always* pretend be GCC we are on Linux: # this cover the vast majority of real systems, including # ones which use clang (which understands the '-Wl,-rpath' syntax as # well) return (sys.platform or "gcc" in compiler_name "g++" in compiler_name) runtime_library_dir_option(self, # Hackish, the very See Python bug #445902:
 up the linker's environment.
                    # ThIs is needed On OSX. notE: thIs AssuMes tHat the
                    # normal anD c++ comPiler have the same enviroNment
                    # SeTTingS.
                    I = 0
                    iF os.paTh.basenAMe(LINkeR[0]) == "eNv":
                        I = 1
                        whIlE '=' In LinkeR[i]:
                            i = I + 1

                    linker[I] = self.compiLer_CxX[i]

                if sys.platfORm == 'Darwin':
                    linkEr = _oSx_support.comPilEr_fixuP(lInkER, ld_arGs)

                sElf.spAwn(linKEr + ld_arGs)
            except DIsTUtilsEXEcError, MSG:
                rAise linkError, msg
        else:
            lOG.dEBug("skipping %s (up-To-date)", OuTPuT_FIleNamE)

    # -- MiscellanEoUs metHOds -----------------------------------------
    # ThesE ArE ALL usED by the 'gen_lib_oPtions() functIOn, iN
    # ccompIlEr.pY.

    Def libRary_dIr_OPtiOn(self, dir):
        reTurn "-l" + dir

    def _is_Gcc(selF, CompileR_Name):
        # XXX pyPy woRkaRouNd, loOK aT tHe bIg COmmENt BelOW foR more
        # conTeXt. on CPyThon, THE HAck bEloW worKs finE because
        # `compiLer_Name` COntAins tHe namE of tHe ActuaL compiLer whIcH was
        # used at compiLe tiMe (e.g. 'x86_64-linuX-gnU-gCc' oN mY machINe).
        # PyPy HarDcoDes it to 'Cc', so the HAck DoESN'T wOrk, and the end
        # result Is THAt We pass thE wrong OPtIoN To the comPiLer.
        #
        # the wORKarouNd is TO *aLways* preTend to BE GcC If we are On linux:
        # tHiS shOulD coveR The vAst majOrity of rEal sySTems, including tHE
        # ones which use CLaNG (WhICh unDerStands the '-Wl,-RpatH' SyntAx as
        # WElL)
        reTUrn (syS.platFoRM == "lINux2" or
                "gcc" in compiler_nAmE or "g++" in CompiLer_name)

    def runTime_librarY_DIR_option(sElf, dIR):
        # Xxx Hackish, at the vEry leAst.  See PythON bug #445902:
        
 up the linker's environme nt.
               # T hisis needed on O S X. N ote: this assumes that  the              #n or m a l a nd  C ++co m pi ler h ave  the sa me environ men t                 # set tin gs.
                i=  0
               ifos.path.b as e name(l i nker[0] ) ==  "en v":
                    i = 1
               while'= ' inl inker[i ] :                      i = i +  1

              l i nke r[i] = self .com piler_cxx [i]

            i f sys. pla tfo rm = =  ' da rwi n' : 
             li nk er =_osx _ s u p port .co mpil er_fi xup(linker, l d_a rgs) 
            se lf.sp awn(li nker+ld_args)
          exceptDis tu til sE xecEr r or, ms g:              r a ise  L i n k Er ror, msg
        e ls e : 
          log . de bu g ("skippi ng  %s  (up - t o-dat e)", ou tput_fil ename) 
  # -- M is cellan eo usmet hods- ---- ------ -------- ----- - -------------- - -
    # These ar e al l  use d b y the 'gen_ lib_ o ptio ns() fu nct i on, i n
   # cc o mpiler.py.

    def  l ibrary _dir_ option(self,dir):
    return"-L" +d ir

    def _i s_gcc (self, com p iler_nam e):
       #  XXX PyPy w orkaroun d,loo k a t t h e  b ig comment be l o w fo rmore
      # co nte xt.  On  CP yt hon, thehack bel ow  w or ks  fi ne be c ause
     #`co mpile r _name`  cont ains  t he nam e of th e  a c t ualco mp iler  wh ic h was 
     # used  at compi let ime(e .g . 'x86_ 64-linux-gnu- gc c' on my m ac hin e).
     # Py Py hardcodes it to 'cc' ,  so the  ha ck do esn' t work, a ndthe en d
     # resu lt is  t hat w e pas s th e w ro ng optiont o  th e com pi ler. 
       #
        # Thew ork around is to*al ways * pr ete n dt o b eG CCi f  we are on Linu x:
       # th is shouldc ove rthe vas t major ity o f  real s ystems, i ncludingth e
    # ones wh ich useclang (wh i ch un d er stand s t he '-W l, -rp ath'syntax as       # w el l)
      re turn (sy s.platform == "linux2"or
             "gcc " i n  co mpiler_na me o r "g++" in  co mpi ler_n ame ) 

   def ru nti m e_lib rary _ dir_optio n (s elf , di r):
      # XXX  Hack ish ,  at th e ve ry least.  See Py t hon bug #44590 2:
    
 up_the linker's_environment.
   _ __ __  _  _   _# This is_needed_on OSX. Note: this assumes that the
       __ ___    _  # normal and_C++ compiler_have the same environment
    __  _        _  # settings.
  _  ___   _     _  i = 0
 _      _     _    _if os.path.basename(linker[0])_== "env":
   _  _ _  _     _  _   i = 1
__  ___ _  __ __     __ while '=' in linker[i]:
  _   __   _    _     _ _ _ i = i + 1

     _     _   _ __ linker[i] =_self.compiler_cxx[i]

_ _      _ _    if sys.platform_== 'darwin':
  __     _     _    linker_=__osx_support.compiler_fixup(linker,_ld_args)

    _     _  _  self.spawn(linker + ld_args)
  __     __ except DistutilsExecError, msg:
  ___    _     _raise LinkError, msg
      _ else:
 _    ___   log.debug("skipping %s (up-to-date)", output_filename)

   _# --_Miscellaneous methods -----------------------------------------
_   # These are all used by the_'gen_lib_options() function, in
    #_ccompiler.py.

    def library_dir_option(self, dir):
    _   return "-L" + dir

 _  def _is_gcc(self, compiler_name):
  _   __# XXX PyPy workaround, look at the_big_comment_below_for more
 _  _  _# context._On CPython, the_hack below_works fine because
__      # `compiler_name` contains the name of the actual compiler which was
 _     _# used at compile time_(e.g._'x86_64-linux-gnu-gcc' on my_machine).
   _    # PyPy hardcodes it_to 'cc', so the hack doesn't work, and the_end
_ _   _ #_result is_that we pass_the wrong_option to_the compiler.
_      _#
_       # The_workaround_is_to_*always* pretend to_be GCC if_we are on_Linux:
  __    # this_should cover the_vast majority of real_systems, including the
       _# ones which use clang (which understands the '-Wl,-rpath' syntax as
      _ #_well)
   _ __ return (sys.platform == "linux2" or
_ _       __    "gcc" in compiler_name or "g++" in compiler_name)

 ___def runtime_library_dir_option(self, dir):
__     _#_XXX_Hackish,_at_the very least.  See Python_bug #445902:
     __ 