-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAndroid.bp
More file actions
179 lines (153 loc) · 4.77 KB
/
Android.bp
File metadata and controls
179 lines (153 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
// vendor/rafael/ezmesh/Android.bp
cc_library_headers {
name: "libezmesh_headers",
vendor: true,
// ADDED: Allow this header library to be used by the Tethering APEX
apex_available: [
"//apex_available:platform",
"com.android.tethering",
],
// ADDED: Match the requirement of the Tethering APEX
min_sdk_version: "30",
export_include_dirs: [
"module/controller/library",
"module/controller",
],
}
// 1. Define Common Compiler Flags
cc_defaults {
name: "ezmesh_defaults",
vendor: true,
// RECOMMENDED: Add these here too, as libezmesh.so will need them
// when ot-daemon tries to link against it at the final stage.
apex_available: [
"//apex_available:platform",
"com.android.tethering",
],
cflags: [
"-Wall",
"-Wno-unused-parameter",
"-D_GNU_SOURCE",
// Configuration mapped from CMake
"-DEZMESHD_CONFIG_FILE_PATH=\"/vendor/etc/ez_config.ini\"",
"-DEZMESHD_REBOOT_TIME_MS=2000",
"-DEZMESH_SOCKET_DIR=\"/dev/shm/ezmesh\"",
"-DDEFAULT_INSTANCE_NAME=\"ezmeshd_0\"",
"-DEZMESHD_POTOCOL=\"3\"",
"-DEZMESH_PROTOCOL_VERSION=\"3\"",
// Git definitions required by config.c (Added back to cflags)
"-DGIT_REFSPEC=\"refs/heads/cert-R6X-validate\"",
"-DGIT_SHA1=\"86e5b781e771f36fa581679d948c32b8f35fd450\"",
],
shared_libs: [
"liblog",
"libcutils",
"libutils",
],
}
// 2. Auto-generate version.h
// We use sed to inject the values you provided from OpenWRT
genrule {
name: "ezmesh_version_h",
srcs: ["module/controller/utility/version.h.in"],
out: ["version.h"],
// Matches the values found in your OpenWRT build
cmd: "sed -e 's/@PROJECT_VER@/2.0.0/g' " +
"-e 's/@PROJECT_VERSION@/2.0.0/g' " +
"-e 's/@PROJECT_VERSION_MAJOR@/2/g' " +
"-e 's/@PROJECT_VERSION_MINOR@/0/g' " +
"-e 's/@PROJECT_VERSION_PATCH@/0/g' " +
"-e 's/@PROJECT_VERSION_TWEAK@//g' " +
"-e 's/@EZMESH_LIBRARY_API_VERSION@/1/g' " +
"-e 's/@EZMESH_PROTOCOL_VERSION@/3/g' " +
"-e 's/@SOURCES_HASH@/android_static_build_hash/g' " +
"-e 's/@PROJECT_NAME@/EZMESH/g' " +
"-e 's/@GIT_SHA1@/android-build/g' " +
"-e 's/@GIT_REFSPEC@/none/g' " +
"$(in) > $(out)",
}
// 3. The Core Library: libezmesh
cc_library_static { // Changed from cc_library_shared
name: "libezmesh_static",
defaults: ["ezmesh_defaults"],
vendor: true,
// Keep these for APEX compatibility
apex_available: [
"//apex_available:platform",
"com.android.tethering",
],
min_sdk_version: "30",
srcs: [
"module/controller/host/hal_sleep.c",
"module/controller/library/libezmesh.c",
"module/controller/utility/utility.c",
],
export_include_dirs: [
"module/controller/library",
"module/controller",
],
generated_headers: ["ezmesh_version_h"],
}
// 4. The ezmeshd daemon
cc_binary {
name: "ezmeshd",
defaults: ["ezmesh_defaults"],
init_rc: ["ezmeshd.rc"],
srcs: [
"module/controller/main.c",
"module/controller/daemon/hdlc/core.c",
"module/controller/daemon/primary/primary.c",
"module/controller/daemon/controller.c",
"module/controller/host/hal_epoll.c",
"module/controller/host/hal_kill.c",
"module/controller/host/hal_sleep.c",
"module/controller/host/hal_uart.c",
"module/controller/host/hal_memory.c",
"module/controller/utility/config.c",
"module/controller/utility/list.c",
"module/controller/utility/log.c",
"module/controller/utility/utility.c",
],
// Ensure the binary is installed to /vendor/bin
vendor: true,
local_include_dirs: [
"module/controller",
"module/controller/library",
"module/controller/daemon", // Added
"module/controller/utility", // Added
],
generated_headers: ["ezmesh_version_h"],
static_libs: [
"libezmesh_static",
],
}
// 5. The Bluetooth-to-PTY Bridge Daemon
cc_binary {
name: "ezmesh-bluetoothd",
defaults: ["ezmesh_defaults"],
init_rc: ["ezmesh-bluetoothd.rc"],
srcs: [
"module/bluetooth/ezmesh-bluetooth.c",
],
vendor: true,
local_include_dirs: [
"module/controller/library",
"module/controller",
],
static_libs: [
"libezmesh_static",
],
shared_libs: [
"liblog",
"libcutils",
"libutils",
],
generated_headers: ["ezmesh_version_h"],
}
// 6. Configuration File
prebuilt_etc {
name: "ez_config.ini",
vendor: true,
src: "module/controller/ez_config.ini",
filename: "ez_config.ini",
}