parameters: (self, dist = None)
docstring: Customize Fortran compiler.
  
          This method gets Fortran compiler specific information from
          (i) class definition, (ii) environment, (iii) distutils config
          files, and (iv) command line (later overrides earlier).
  
          This method should be always called after constructing a
          compiler instance. But not in __init__ because Distribution
          instance is needed for (iii) and (iv).
docstring_summary: Customize Fortran compiler.
docstring_tokens: Customize Fortran compiler .
function: def customize(self, dist = None):
          """Customize Fortran compiler.
  
          This method gets Fortran compiler specific information from
          (i) class definition, (ii) environment, (iii) distutils config
          files, and (iv) command line (later overrides earlier).
  
          This method should be always called after constructing a
          compiler instance. But not in __init__ because Distribution
          instance is needed for (iii) and (iv).
          """
          log.info('customize %s' % (self.__class__.__name__))
  
          self._is_customised = True
  
          self.distutils_vars.use_distribution(dist)
          self.command_vars.use_distribution(dist)
          self.flag_vars.use_distribution(dist)
  
          self.update_executables()
  
          # find_executables takes care of setting the compiler commands,
          # version_cmd, linker_so, linker_exe, ar, and ranlib
          self.find_executables()
  
          noopt = self.distutils_vars.get('noopt', False)
          noarch = self.distutils_vars.get('noarch', noopt)
          debug = self.distutils_vars.get('debug', False)
  
          f77 = self.command_vars.compiler_f77
          f90 = self.command_vars.compiler_f90
  
          f77flags = []
          f90flags = []
          freeflags = []
          fixflags = []
  
          if f77:
              f77flags = self.flag_vars.f77
          if f90:
              f90flags = self.flag_vars.f90
              freeflags = self.flag_vars.free
          # XXX Assuming that free format is default for f90 compiler.
          fix = self.command_vars.compiler_fix
          if fix:
              fixflags = self.flag_vars.fix + f90flags
  
          oflags, aflags, dflags = [], [], []
          # examine get_flags_<tag>_<compiler> for extra flags
          # only add them if the method is different from get_flags_<tag>
          def get_flags(tag, flags):
              # note that self.flag_vars.<tag> calls self.get_flags_<tag>()
              flags.extend(getattr(self.flag_vars, tag))
              this_get = getattr(self, 'get_flags_' + tag)
              for name, c, flagvar in [('f77', f77, f77flags),
                                       ('f90', f90, f90flags),
                                       ('f90', fix, fixflags)]:
                  t = '%s_%s' % (tag, name)
                  if c and this_get is not getattr(self, 'get_flags_' + t):
                      flagvar.extend(getattr(self.flag_vars, t))
          if not noopt:
              get_flags('opt', oflags)
              if not noarch:
                  get_flags('arch', aflags)
          if debug:
              get_flags('debug', dflags)
  
          fflags = self.flag_vars.flags + dflags + oflags + aflags
  
          if f77:
              self.set_commands(compiler_f77=[f77]+f77flags+fflags)
          if f90:
              self.set_commands(compiler_f90=[f90]+freeflags+f90flags+fflags)
          if fix:
              self.set_commands(compiler_fix=[fix]+fixflags+fflags)
  
  
          #XXX: Do we need LDSHARED->SOSHARED, LDFLAGS->SOFLAGS
          linker_so = self.linker_so
          if linker_so:
              linker_so_flags = self.flag_vars.linker_so
              if sys.platform.startswith('aix'):
                  python_lib = get_python_lib(standard_lib=1)
                  ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix')
                  python_exp = os.path.join(python_lib, 'config', 'python.exp')
                  linker_so = [ld_so_aix] + linker_so + ['-bI:'+python_exp]
              self.set_commands(linker_so=linker_so+linker_so_flags)
  
          linker_exe = self.linker_exe
          if linker_exe:
              linker_exe_flags = self.flag_vars.linker_exe
              self.set_commands(linker_exe=linker_exe+linker_exe_flags)
  
          ar = self.command_vars.archiver
          if ar:
              arflags = self.flag_vars.ar
              self.set_commands(archiver=[ar]+arflags)
  
          self.set_library_dirs(self.get_library_dirs())
          self.set_libraries(self.get_libraries())
function_tokens: def customize ( self , dist = None ) : log . info ( 'customize %s' % ( self . __class__ . __name__ ) ) self . _is_customised = True self . distutils_vars . use_distribution ( dist ) self . command_vars . use_distribution ( dist ) self . flag_vars . use_distribution ( dist ) self . update_executables ( ) # find_executables takes care of setting the compiler commands, # version_cmd, linker_so, linker_exe, ar, and ranlib self . find_executables ( ) noopt = self . distutils_vars . get ( 'noopt' , False ) noarch = self . distutils_vars . get ( 'noarch' , noopt ) debug = self . distutils_vars . get ( 'debug' , False ) f77 = self . command_vars . compiler_f77 f90 = self . command_vars . compiler_f90 f77flags = [ ] f90flags = [ ] freeflags = [ ] fixflags = [ ] if f77 : f77flags = self . flag_vars . f77 if f90 : f90flags = self . flag_vars . f90 freeflags = self . flag_vars . free # XXX Assuming that free format is default for f90 compiler. fix = self . command_vars . compiler_fix if fix : fixflags = self . flag_vars . fix + f90flags oflags , aflags , dflags = [ ] , [ ] , [ ] # examine get_flags_<tag>_<compiler> for extra flags # only add them if the method is different from get_flags_<tag> def get_flags ( tag , flags ) : # note that self.flag_vars.<tag> calls self.get_flags_<tag>() flags . extend ( getattr ( self . flag_vars , tag ) ) this_get = getattr ( self , 'get_flags_' + tag ) for name , c , flagvar in [ ( 'f77' , f77 , f77flags ) , ( 'f90' , f90 , f90flags ) , ( 'f90' , fix , fixflags ) ] : t = '%s_%s' % ( tag , name ) if c and this_get is not getattr ( self , 'get_flags_' + t ) : flagvar . extend ( getattr ( self . flag_vars , t ) ) if not noopt : get_flags ( 'opt' , oflags ) if not noarch : get_flags ( 'arch' , aflags ) if debug : get_flags ( 'debug' , dflags ) fflags = self . flag_vars . flags + dflags + oflags + aflags if f77 : self . set_commands ( compiler_f77 = [ f77 ] + f77flags + fflags ) if f90 : self . set_commands ( compiler_f90 = [ f90 ] + freeflags + f90flags + fflags ) if fix : self . set_commands ( compiler_fix = [ fix ] + fixflags + fflags ) #XXX: Do we need LDSHARED->SOSHARED, LDFLAGS->SOFLAGS linker_so = self . linker_so if linker_so : linker_so_flags = self . flag_vars . linker_so if sys . platform . startswith ( 'aix' ) : python_lib = get_python_lib ( standard_lib = 1 ) ld_so_aix = os . path . join ( python_lib , 'config' , 'ld_so_aix' ) python_exp = os . path . join ( python_lib , 'config' , 'python.exp' ) linker_so = [ ld_so_aix ] + linker_so + [ '-bI:' + python_exp ] self . set_commands ( linker_so = linker_so + linker_so_flags ) linker_exe = self . linker_exe if linker_exe : linker_exe_flags = self . flag_vars . linker_exe self . set_commands ( linker_exe = linker_exe + linker_exe_flags ) ar = self . command_vars . archiver if ar : arflags = self . flag_vars . ar self . set_commands ( archiver = [ ar ] + arflags ) self . set_library_dirs ( self . get_library_dirs ( ) ) self . set_libraries ( self . get_libraries ( ) )