def build(bld):
    
    toolchain = bld.env["UsedToolchain"]
    if not toolchain:
        bld.fatal('Environment parameter "UsedToolchain" is not available! Make sure to provide the environment parameter "UsedToolchain" in the root wscript file of your project. e.g.: conf.env["UsedToolchain"] = "gccarmemb"')
    
    platform  = bld.env["UsedPlatform"]
    if not platform:
        bld.fatal('Environment parameter "UsedPlatform" is not available! Make sure to provide the environment parameter "UsedPlatform" in the root wscript file of your project. e.g.: conf.env["UsedPlatform"]  = "netx90"')
    
    comp_prefix = bld.get_name_prefix(
        toolchain = toolchain,
        platform  = platform)
    
# Component libc_support ---------------------------------------------------------
    netx_studio_sources = [
        "Source/libc_file_support.c", 
        "Source/libc_mem_support.c", 
        "Source/libc_support.c", 
        ]

    includes = [
        "Include",
        ]

    bld.stlib( 
        target          = "libc_support",
        name            = comp_prefix + "libc_support",
        description     = "libc_support",
        displaygroup    = "Libraries",
        platform        = platform,
        toolchain       = toolchain, 
        use             = [
                           "CMSIS_sdk",
                           "netx_drv_sdk",
                          ],
        source          = netx_studio_sources,
        includes        = includes,
        export_includes = includes,
        )
    
    bld.sdkcomponent(
        name            = "libc_support_sdk",
        export_includes = includes,
        )
    