1570af302Sopenharmony_ci# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
2570af302Sopenharmony_ci#
3570af302Sopenharmony_ci# Redistribution and use in source and binary forms, with or without modification,
4570af302Sopenharmony_ci# are permitted provided that the following conditions are met:
5570af302Sopenharmony_ci#
6570af302Sopenharmony_ci# 1. Redistributions of source code must retain the above copyright notice, this list of
7570af302Sopenharmony_ci#    conditions and the following disclaimer.
8570af302Sopenharmony_ci#
9570af302Sopenharmony_ci# 2. Redistributions in binary form must reproduce the above copyright notice, this list
10570af302Sopenharmony_ci#    of conditions and the following disclaimer in the documentation and/or other materials
11570af302Sopenharmony_ci#    provided with the distribution.
12570af302Sopenharmony_ci#
13570af302Sopenharmony_ci# 3. Neither the name of the copyright holder nor the names of its contributors may be used
14570af302Sopenharmony_ci#    to endorse or promote products derived from this software without specific prior written
15570af302Sopenharmony_ci#    permission.
16570af302Sopenharmony_ci#
17570af302Sopenharmony_ci# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18570af302Sopenharmony_ci# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19570af302Sopenharmony_ci# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20570af302Sopenharmony_ci# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21570af302Sopenharmony_ci# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22570af302Sopenharmony_ci# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23570af302Sopenharmony_ci# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24570af302Sopenharmony_ci# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25570af302Sopenharmony_ci# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26570af302Sopenharmony_ci# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27570af302Sopenharmony_ci# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28570af302Sopenharmony_ci
29570af302Sopenharmony_cilibc = "user_libc"
30570af302Sopenharmony_ci
31570af302Sopenharmony_ciLITEOS_MENUCONFIG_H = rebase_path("$root_out_dir/config.h")
32570af302Sopenharmony_ci
33570af302Sopenharmony_ciconfig("include") {
34570af302Sopenharmony_ci  include_dirs = [
35570af302Sopenharmony_ci    "include",
36570af302Sopenharmony_ci    "internal",
37570af302Sopenharmony_ci    "../arch/arm",
38570af302Sopenharmony_ci    "../include",
39570af302Sopenharmony_ci  ]
40570af302Sopenharmony_ci}
41570af302Sopenharmony_ci
42570af302Sopenharmony_cistatic_library(libc) {
43570af302Sopenharmony_ci  sources = [
44570af302Sopenharmony_ci    "libc_init.c",
45570af302Sopenharmony_ci    "libc_start.c",
46570af302Sopenharmony_ci    "string/memcmp.c",
47570af302Sopenharmony_ci    "string/memcpy.c",
48570af302Sopenharmony_ci    "string/memset.c",
49570af302Sopenharmony_ci    "string/strcmp.c",
50570af302Sopenharmony_ci    "string/strlen.c",
51570af302Sopenharmony_ci    "thread/__lock.c",
52570af302Sopenharmony_ci    "thread/pthread_attr_destroy.c",
53570af302Sopenharmony_ci    "thread/pthread_attr_get.c",
54570af302Sopenharmony_ci    "thread/pthread_attr_init.c",
55570af302Sopenharmony_ci    "thread/pthread_attr_setdetachstate.c",
56570af302Sopenharmony_ci    "thread/pthread_attr_setguardsize.c",
57570af302Sopenharmony_ci    "thread/pthread_attr_setinheritsched.c",
58570af302Sopenharmony_ci    "thread/pthread_attr_setschedparam.c",
59570af302Sopenharmony_ci    "thread/pthread_attr_setschedpolicy.c",
60570af302Sopenharmony_ci    "thread/pthread_attr_setscope.c",
61570af302Sopenharmony_ci    "thread/pthread_attr_setstack.c",
62570af302Sopenharmony_ci    "thread/pthread_attr_setstacksize.c",
63570af302Sopenharmony_ci    "thread/pthread_cancel.c",
64570af302Sopenharmony_ci    "thread/pthread_create.c",
65570af302Sopenharmony_ci    "thread/pthread_detach.c",
66570af302Sopenharmony_ci    "thread/pthread_getschedparam.c",
67570af302Sopenharmony_ci    "thread/pthread_join.c",
68570af302Sopenharmony_ci    "thread/pthread_self.c",
69570af302Sopenharmony_ci    "thread/pthread_setschedparam.c",
70570af302Sopenharmony_ci  ]
71570af302Sopenharmony_ci
72570af302Sopenharmony_ci  include_dirs = [
73570af302Sopenharmony_ci    "include",
74570af302Sopenharmony_ci    "internal",
75570af302Sopenharmony_ci    "../arch/arm",
76570af302Sopenharmony_ci    "../include",
77570af302Sopenharmony_ci  ]
78570af302Sopenharmony_ci
79570af302Sopenharmony_ci  cflags = [
80570af302Sopenharmony_ci    "-imacros",
81570af302Sopenharmony_ci    "$LITEOS_MENUCONFIG_H",
82570af302Sopenharmony_ci  ]
83570af302Sopenharmony_ci
84570af302Sopenharmony_ci  public_configs = [ ":include" ]
85570af302Sopenharmony_ci}
86