def clang_common_flags(conf):
    """
    Common flags for clang on nearly all platforms
    """
    v = conf.env

    v['CC_SRC_F']            = []
    v['CC_TGT_F']            = ['-c', '-o']

    # linker
    if not v['LINK_CC']: v['LINK_CC'] = v['CC']
    v['CCLNK_SRC_F']         = []
    v['CCLNK_TGT_F']         = ['-o']
    v['CPPPATH_ST']          = '-I%s'
    v['DEFINES_ST']          = '-D%s'

    v['LIB_ST']              = '-l%s' # template for adding libs
    v['LIBPATH_ST']          = '-L%s' # template for adding libpaths
    v['STLIB_ST']            = '-l%s'
    v['STLIBPATH_ST']        = '-L%s'
    v['RPATH_ST']            = '-Wl,-rpath,%s'

    v['SONAME_ST']           = '-Wl,-h,%s'
    v['SHLIB_MARKER']        = '-Wl,-Bdynamic'
    v['STLIB_MARKER']        = '-Wl,-Bstatic'

    # program
    v['cprogram_PATTERN']    = '%s'

    # shared librar
    v['CFLAGS_cshlib']       = ['-fPIC']
    v['LINKFLAGS_cshlib']    = ['-shared']
    v['cshlib_PATTERN']      = 'lib%s.so'

    # static lib
    v['LINKFLAGS_cstlib']    = ['-Wl,-Bstatic']
    v['cstlib_PATTERN']      = 'lib%s.a'

    # osx stuff
    v['LINKFLAGS_MACBUNDLE'] = ['-bundle', '-undefined', 'dynamic_lookup']
    v['CFLAGS_MACBUNDLE']    = ['-fPIC']
    v['macbundle_PATTERN']   = '%s.bundle'