code: def generate(env):
      
      SCons.Tool.cc.generate(env)
  
      env['CC'] = env.Detect(compilers) or 'clang'
      if env['PLATFORM'] in ['cygwin', 'win32']:
          env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
      else:
          env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')
      # determine compiler version
      if env['CC']:
          #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'],
          pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
                                       stdin='devnull',
                                       stderr='devnull',
                                       stdout=subprocess.PIPE)
          if pipe.wait() != 0: return
          # clang -dumpversion is of no use
          line = pipe.stdout.readline()
          if sys.version_info[0] > 2:
              line = line.decode()
          match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line)
          if match:
              env['CCVERSION'] = match.group(1)
docs: Add Builders and construction variables for clang to an Environment.