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 = [] 44 45 external_deps = [ "zlib:libz" ] 46 47 license_file = "COPYING-LGPLV3" 48 subsystem_name = "thirdparty" 49 part_name = "elfutils" 50} 51 52# Build libdw 53ohos_static_library("libdw_static") { 54 configs = [ ":elfutils_defaults" ] 55 56 sources = sources_backends 57 sources += sources_libcpu 58 sources += sources_libdw 59 sources += sources_libdwelf 60 sources += sources_libdwfl 61 sources += sources_libebl 62 63 include_dirs = [ 64 "//third_party/elfutils", 65 "//third_party/elfutils/lib", 66 "//third_party/elfutils/libasm", 67 "//third_party/elfutils/libelf", 68 "//third_party/elfutils/libcpu", 69 "//third_party/elfutils/libdw", 70 "//third_party/elfutils/libdwelf", 71 "//third_party/elfutils/libdwfl", 72 "//third_party/elfutils/libebl", 73 ] 74 75 public_configs = [ ":elfutils_public_config" ] 76 77 deps = [ ":libelf_static" ] 78 79 license_file = "COPYING-LGPLV3" 80 subsystem_name = "thirdparty" 81 part_name = "elfutils" 82} 83