• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//third_party/elfutils/elfutils_config.gni")
16
17config("elfutils_defaults") {
18  defines = [
19    "HAVE_CONFIG_H",
20    "_GNU_SOURCE",
21    "NMNES=1000",
22  ]
23
24  cflags = [ "-std=gnu99" ]
25}
26
27config("elfutils_public_config") {
28  include_dirs = [ "include" ]
29}
30
31# Build libelf
32ohos_static_library("libelf_static") {
33  configs = [ ":elfutils_defaults" ]
34
35  sources = sources_libelf
36
37  include_dirs = [
38    "//third_party/elfutils",
39    "//third_party/elfutils/lib",
40    "//third_party/elfutils/libelf",
41  ]
42
43  deps = [ "//third_party/zlib:libz" ]
44
45  license_file = "COPYING-LGPLV3"
46  subsystem_name = "thirdparty"
47  part_name = "elfutils"
48}
49
50# Build libdw
51ohos_static_library("libdw_static") {
52  configs = [ ":elfutils_defaults" ]
53
54  sources = sources_backends
55  sources += sources_libcpu
56  sources += sources_libdw
57  sources += sources_libdwelf
58  sources += sources_libdwfl
59  sources += sources_libebl
60
61  include_dirs = [
62    "//third_party/elfutils",
63    "//third_party/elfutils/lib",
64    "//third_party/elfutils/libasm",
65    "//third_party/elfutils/libelf",
66    "//third_party/elfutils/libcpu",
67    "//third_party/elfutils/libdw",
68    "//third_party/elfutils/libdwelf",
69    "//third_party/elfutils/libdwfl",
70    "//third_party/elfutils/libebl",
71  ]
72
73  public_configs = [ ":elfutils_public_config" ]
74
75  deps = [ ":libelf_static" ]
76
77  license_file = "COPYING-LGPLV3"
78  subsystem_name = "thirdparty"
79  part_name = "elfutils"
80}
81