1import("//build/ohos.gni") 2 3## Build libudev.so {{{ 4config("libudev_config") { 5 visibility = [ ":*" ] 6 7 include_dirs = [ 8 "src/shared", 9 "src/libudev", 10 "hm_src", 11 ] 12 13 cflags = [ 14 "-DSIZEOF_PID_T=4", 15 "-DSIZEOF_UID_T=4", 16 "-DSIZEOF_GID_T=4", 17 "-DSIZEOF_TIME_T=8", 18 "-DSIZEOF_RLIM_T=8", 19 "-DSIZEOF_DEV_T=8", 20 "-Wno-macro-redefined", 21 "-Wno-unused-parameter", 22 "-Wno-unused-variable", 23 "-Wno-extern-initializer", 24 "-Wno-unused-function", 25 "-Wno-implicit-function-declaration", 26 "-Wno-int-conversion", 27 "-Wno-int-to-pointer-cast", 28 ] 29} 30 31config("libudev_public_config") { 32 include_dirs = [ 33 "export_include", 34 ] 35 36 cflags = [ 37 ] 38} 39 40ohos_shared_library("libudev") { 41 sources = [ 42 "src/libudev/libudev.c", 43 "src/libudev/libudev-device.c", 44 "src/libudev/libudev-device-private.c", 45 "src/libudev/libudev-enumerate.c", 46 "src/libudev/libudev-hwdb.c", 47 "src/libudev/libudev-list.c", 48 "src/libudev/libudev-monitor.c", 49 "src/libudev/libudev-queue.c", 50 "src/libudev/libudev-util.c", 51 "src/shared/conf-files.c", 52 "src/shared/device-nodes.c", 53 "src/shared/dev-setup.c", 54 "src/shared/fileio.c", 55 "src/shared/hashmap.c", 56 "src/shared/label.c", 57 "src/shared/mempool.c", 58 "src/shared/mkdir.c", 59 "src/shared/mkdir-label.c", 60 "src/shared/MurmurHash2.c", 61 "src/shared/path-util.c", 62 "src/shared/process-util.c", 63 "src/shared/siphash24.c", 64 "src/shared/smack-util.c", 65 "src/shared/strbuf.c", 66 "src/shared/strv.c", 67 "src/shared/strxcpyx.c" , 68 "src/shared/sysctl-util.c", 69 "src/shared/terminal-util.c", 70 "src/shared/time-util.c", 71 "src/shared/util.c", 72 "src/shared/utf8.c", 73 "src/shared/virt.c", 74 "src/shared/selinux-util.c", 75 "hm_src/log.c", 76 "src/shared/random-util.c", 77 # "src/shared/log.c", 78 ] 79 80 configs = [ 81 ":libudev_config", 82 ] 83 84 public_configs = [ 85 ":libudev_public_config", 86 ] 87 88 deps = [ 89 ] 90 91 public_deps = [ 92 ] 93 94 part_name = "multimodalinput_base" 95} 96## Build libudev.so }}} 97 98## Build udevd {{{ 99config("udevd_config") { 100 visibility = [ ":*" ] 101 102 include_dirs = [ 103 "./src/shared", 104 "./src/libudev", 105 "./src/udev", 106 "./hm_src", 107 ] 108 109 cflags = [ 110 "-DSIZEOF_PID_T=4", 111 "-DSIZEOF_UID_T=4", 112 "-DSIZEOF_GID_T=4", 113 "-DSIZEOF_TIME_T=8", 114 "-DSIZEOF_RLIM_T=8", 115 "-DSIZEOF_DEV_T=8", 116 "-Wno-unused-parameter", 117 "-Wno-missing-field-initializers", 118 "-Wno-implicit-function-declaration", 119 "-Wno-macro-redefined", 120 ] 121} 122 123config("udevd_public_config") { 124 include_dirs = [ 125 ] 126 127 cflags = [ 128 ] 129} 130 131ohos_executable("udevd") { 132 install_enable = true 133 134 sources = [ 135 "src/udev/udevd.c", 136 "src/udev/udev-event.c", 137 "src/udev/udev-watch.c", 138 "src/udev/udev-node.c", 139 "src/udev/udev-rules.c", 140 "src/udev/udev-ctrl.c", 141 "src/udev/udev-builtin.c", 142 "src/udev/udev-builtin-btrfs.c", 143 "src/udev/udev-builtin-hwdb.c", 144 "src/udev/udev-builtin-input_id.c", 145 "src/udev/udev-builtin-net_id.c", 146 "src/udev/udev-builtin-path_id.c", 147 "src/udev/udev-builtin-usb_id.c", 148 "src/udev/udev-builtin-keyboard.c", 149 ] 150 151 configs = [ 152 ":udevd_config", 153 ] 154 155 public_configs = [ 156 ":udevd_public_config", 157 ] 158 159 deps = [ 160 ":libudev", 161 ] 162 163 public_deps = [ 164 ] 165 part_name = "multimodalinput_base" 166} 167## Build udevd }}} 168 169ohos_executable("udevadm") { 170 install_enable = true 171 172 sources = [ 173 "src/udev/udev-event.c", 174 "src/udev/udev-watch.c", 175 "src/udev/udev-node.c", 176 "src/udev/udev-rules.c", 177 "src/udev/udev-ctrl.c", 178 "src/udev/udev-builtin.c", 179 "src/udev/udev-builtin-btrfs.c", 180 "src/udev/udev-builtin-hwdb.c", 181 "src/udev/udev-builtin-input_id.c", 182 "src/udev/udev-builtin-net_id.c", 183 "src/udev/udev-builtin-path_id.c", 184 "src/udev/udev-builtin-usb_id.c", 185 "src/udev/udev-builtin-keyboard.c", 186 "src/udev/udevadm.c", 187 "src/udev/udevadm-info.c", 188 "src/udev/udevadm-control.c", 189 "src/udev/udevadm-monitor.c", 190 "src/udev/udevadm-hwdb.c", 191 "src/udev/udevadm-settle.c", 192 "src/udev/udevadm-trigger.c", 193 "src/udev/udevadm-test.c", 194 "src/udev/udevadm-test-builtin.c", 195 "src/udev/udevadm-util.c", 196 "src/udev/udevadm-util.h" 197 ] 198 199 configs = [ 200 ":udevd_config", 201 ] 202 203 public_configs = [ 204 ":udevd_public_config", 205 ] 206 207 deps = [ 208 ":libudev", 209 ] 210 211 public_deps = [ 212 ] 213 part_name = "multimodalinput_base" 214} 215## Build udevd }}} 216 217ohos_prebuilt_etc("udev_conf") { 218 source = "src/udev/udev.conf" 219 relative_install_dir = "udev" 220 part_name = "multimodalinput_base" 221} 222 223ohos_prebuilt_etc("udev_touchscreen_rule") { 224 source = "rules.d/touchscreen.rules" 225 relative_install_dir = "udev/rules.d" 226 part_name = "multimodalinput_base" 227} 228 229ohos_prebuilt_etc("udev_vk_rule") { 230 source = "rules.d/vk.rules" 231 relative_install_dir = "udev/rules.d" 232 part_name = "multimodalinput_base" 233} 234 235## Install udevd.rc to /system/etc/init/udevd.rc {{{ 236ohos_prebuilt_etc("udevd.rc") { 237 source = "udevd.rc" 238 relative_install_dir = "init" 239 part_name = "multimodalinput_base" 240} 241## Install udevd.rc to /system/etc/init/udevd.rc }}} 242