startup_init/ueventd/BUILD.gn
zhangyafei.echo fe94b0a7fd IssueNo:#I68M3C
Description:Fix wrong dependency of init.
Sig:SIG_ApplicationFramework
Feature or BugFix: Feature
Binary Source: No

Signed-off-by: zhangyafei.echo <zhangyafei12@huawei.com>
Change-Id: I233df8954c9e1a3cb60d93885c6210dad9fb4a05
2023-01-04 14:32:45 +08:00

161 lines
5.0 KiB
Plaintext

# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//base/startup/init/begetd.gni")
if (defined(ohos_lite)) {
if (ohos_kernel_type == "linux") {
service_ueventd_deps = [
"//base/startup/init/interfaces/innerkits/socket:libsocket",
"//base/startup/init/services/log:init_log",
"//base/startup/init/services/param/base:param_base",
"//base/startup/init/services/utils:libinit_utils",
"//third_party/bounds_checking_function:libsec_static",
]
executable("ueventd_linux") {
sources = [
"//base/startup/init/services/utils/init_utils.c",
"//base/startup/init/ueventd/lite/ueventd_parameter.c",
"//base/startup/init/ueventd/ueventd.c",
"//base/startup/init/ueventd/ueventd_device_handler.c",
"//base/startup/init/ueventd/ueventd_firmware_handler.c",
"//base/startup/init/ueventd/ueventd_main.c",
"//base/startup/init/ueventd/ueventd_read_cfg.c",
"//base/startup/init/ueventd/ueventd_socket.c",
]
defines = [ "__MUSL__" ]
defines += [ "_GNU_SOURCE" ]
include_dirs = [
"//base/startup/init/services/log",
"//base/startup/init/services/include",
"//base/startup/init/services/include/param",
"//base/startup/init/services/utils",
"//base/startup/init/ueventd/include",
]
deps = service_ueventd_deps
deps += [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ]
}
copy("ueventd.config") {
sources = [ "etc/ueventd_l1.config" ]
outputs = [ "$root_out_dir/etc/ueventd.config" ]
}
}
} else {
import("//build/ohos.gni")
service_ueventd_sources = [
"//base/startup/init/ueventd/ueventd.c",
"//base/startup/init/ueventd/ueventd_device_handler.c",
"//base/startup/init/ueventd/ueventd_firmware_handler.c",
"//base/startup/init/ueventd/ueventd_read_cfg.c",
"//base/startup/init/ueventd/ueventd_socket.c",
]
service_ueventd_include = [
"//third_party/bounds_checking_function/include",
"//base/startup/init/services/log",
"//base/startup/init/services/include",
"//base/startup/init/services/utils",
"//base/startup/init/ueventd/include",
]
service_ueventd_deps = [
"//base/startup/init/interfaces/innerkits/socket:libsocket",
"//base/startup/init/services/log:init_log",
"//base/startup/init/services/utils:libinit_utils",
"//third_party/bounds_checking_function:libsec_static",
]
#
# exported include directories
#
config("libueventd_exported_config") {
visibility = [ ":*" ]
include_dirs = [ "./include" ]
}
ohos_static_library("libueventd_ramdisk_static") {
sources = service_ueventd_sources
include_dirs = service_ueventd_include
deps = service_ueventd_deps
defines = [ "__RAMDISK__" ]
cflags = []
if (build_selinux) {
external_deps = [ "selinux:librestorecon" ]
cflags += [ "-DWITH_SELINUX" ]
}
public_configs = [ ":libueventd_exported_config" ]
part_name = "init"
subsystem_name = "startup"
}
ohos_executable("ueventd") {
sources = service_ueventd_sources
sources += [
"//base/startup/init/ueventd/standard/ueventd_parameter.c",
"//base/startup/init/ueventd/ueventd_main.c",
]
include_dirs = service_ueventd_include
include_dirs += [
"//base/startup/init/services/include/param",
"//base/startup/init/interfaces/innerkits/include",
]
deps = service_ueventd_deps
deps += [ "//base/startup/init/services/param/linux:param_client" ]
cflags = []
deps += [ "//base/startup/init/services/param/base:param_base" ]
if (build_selinux) {
external_deps = [ "selinux:librestorecon" ]
cflags += [ "-DWITH_SELINUX" ]
}
install_images = [
"system",
"updater",
]
install_enable = true
part_name = "init"
subsystem_name = "startup"
}
ohos_prebuilt_etc("ueventd.config") {
source = "//base/startup/init/ueventd/etc/ueventd.config"
part_name = "init"
subsystem_name = "startup"
install_images = [
"system",
"updater",
]
}
}
group("startup_ueventd") {
if (defined(ohos_lite)) {
if (ohos_kernel_type == "linux") {
deps = [
":ueventd.config",
":ueventd_linux",
]
} else {
deps = []
}
} else {
deps = [
"//base/startup/init/ueventd:libueventd_ramdisk_static",
"//base/startup/init/ueventd:ueventd",
"//base/startup/init/ueventd:ueventd.config",
]
}
}