diff options
author | Dan Willemsen | 2016-06-07 00:31:58 -0500 |
---|---|---|
committer | Dan Willemsen | 2016-07-12 18:37:08 -0500 |
commit | eee8e7face19244897f533d5a5f7f95b30809494 (patch) | |
tree | 4f15b2b6170b4d8f528af08722b27c947812e315 /libcutils | |
parent | b07df4dd3f27b6ec1ad4b377f8daa1df49cc72f2 (diff) | |
download | platform-system-core-eee8e7face19244897f533d5a5f7f95b30809494.tar.gz platform-system-core-eee8e7face19244897f533d5a5f7f95b30809494.tar.xz platform-system-core-eee8e7face19244897f533d5a5f7f95b30809494.zip |
libcutils: Switch to Android.bp
Change-Id: If36cb30e8e4432f1a5c7f9a6d30a75c012a4c67c
Diffstat (limited to 'libcutils')
-rw-r--r-- | libcutils/Android.bp | 155 | ||||
-rw-r--r-- | libcutils/Android.mk | 153 | ||||
-rw-r--r-- | libcutils/tests/Android.bp | 72 | ||||
-rw-r--r-- | libcutils/tests/Android.mk | 81 |
4 files changed, 227 insertions, 234 deletions
diff --git a/libcutils/Android.bp b/libcutils/Android.bp new file mode 100644 index 000000000..4f26034c3 --- /dev/null +++ b/libcutils/Android.bp | |||
@@ -0,0 +1,155 @@ | |||
1 | // | ||
2 | // Copyright (C) 2008 The Android Open Source Project | ||
3 | // | ||
4 | // Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | // you may not use this file except in compliance with the License. | ||
6 | // You may obtain a copy of the License at | ||
7 | // | ||
8 | // http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | // | ||
10 | // Unless required by applicable law or agreed to in writing, software | ||
11 | // distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | // See the License for the specific language governing permissions and | ||
14 | // limitations under the License. | ||
15 | // | ||
16 | |||
17 | // some files must not be compiled when building against Mingw | ||
18 | // they correspond to features not used by our host development tools | ||
19 | // which are also hard or even impossible to port to native Win32 | ||
20 | libcutils_nonwindows_sources = [ | ||
21 | "fs.c", | ||
22 | "multiuser.c", | ||
23 | "socket_inaddr_any_server_unix.c", | ||
24 | "socket_local_client_unix.c", | ||
25 | "socket_local_server_unix.c", | ||
26 | "socket_loopback_client_unix.c", | ||
27 | "socket_loopback_server_unix.c", | ||
28 | "socket_network_client_unix.c", | ||
29 | "sockets_unix.cpp", | ||
30 | "str_parms.c", | ||
31 | ] | ||
32 | |||
33 | cc_library { | ||
34 | name: "libcutils", | ||
35 | host_supported: true, | ||
36 | srcs: [ | ||
37 | "config_utils.c", | ||
38 | "fs_config.c", | ||
39 | "canned_fs_config.c", | ||
40 | "hashmap.c", | ||
41 | "iosched_policy.c", | ||
42 | "load_file.c", | ||
43 | "native_handle.c", | ||
44 | "open_memstream.c", | ||
45 | "process_name.c", | ||
46 | "record_stream.c", | ||
47 | "sched_policy.c", | ||
48 | "sockets.cpp", | ||
49 | "strdup16to8.c", | ||
50 | "strdup8to16.c", | ||
51 | "strlcpy.c", | ||
52 | "threads.c", | ||
53 | ], | ||
54 | |||
55 | target: { | ||
56 | host: { | ||
57 | srcs: ["dlmalloc_stubs.c"], | ||
58 | }, | ||
59 | not_windows: { | ||
60 | srcs: libcutils_nonwindows_sources + [ | ||
61 | "ashmem-host.c", | ||
62 | "trace-host.c", | ||
63 | ], | ||
64 | }, | ||
65 | windows: { | ||
66 | srcs: [ | ||
67 | "socket_inaddr_any_server_windows.c", | ||
68 | "socket_network_client_windows.c", | ||
69 | "sockets_windows.cpp", | ||
70 | ], | ||
71 | |||
72 | enabled: true, | ||
73 | shared: { | ||
74 | enabled: false, | ||
75 | }, | ||
76 | }, | ||
77 | |||
78 | android: { | ||
79 | srcs: libcutils_nonwindows_sources + [ | ||
80 | "android_reboot.c", | ||
81 | "ashmem-dev.c", | ||
82 | "debugger.c", | ||
83 | "klog.cpp", | ||
84 | "partition_utils.c", | ||
85 | "properties.c", | ||
86 | "qtaguid.c", | ||
87 | "trace-dev.c", | ||
88 | "uevent.c", | ||
89 | ], | ||
90 | |||
91 | // TODO: remove liblog as whole static library, once we don't have prebuilt that requires | ||
92 | // liblog symbols present in libcutils. | ||
93 | whole_static_libs: [ | ||
94 | "liblog", | ||
95 | ], | ||
96 | |||
97 | static_libs: ["libdebuggerd_client"], | ||
98 | export_static_lib_headers: ["libdebuggerd_client"], | ||
99 | |||
100 | cflags: [ | ||
101 | "-std=gnu90", | ||
102 | ], | ||
103 | }, | ||
104 | |||
105 | android_arm: { | ||
106 | srcs: ["arch-arm/memset32.S"], | ||
107 | }, | ||
108 | android_arm64: { | ||
109 | srcs: ["arch-arm64/android_memset.S"], | ||
110 | }, | ||
111 | |||
112 | android_mips: { | ||
113 | srcs: ["arch-mips/android_memset.c"], | ||
114 | }, | ||
115 | android_mips64: { | ||
116 | srcs: ["arch-mips/android_memset.c"], | ||
117 | }, | ||
118 | |||
119 | android_x86: { | ||
120 | srcs: [ | ||
121 | "arch-x86/android_memset16.S", | ||
122 | "arch-x86/android_memset32.S", | ||
123 | ], | ||
124 | }, | ||
125 | |||
126 | android_x86_64: { | ||
127 | srcs: [ | ||
128 | "arch-x86_64/android_memset16.S", | ||
129 | "arch-x86_64/android_memset32.S", | ||
130 | ], | ||
131 | }, | ||
132 | }, | ||
133 | |||
134 | shared_libs: ["liblog"], | ||
135 | product_variables: { | ||
136 | cpusets: { | ||
137 | cflags: ["-DUSE_CPUSETS"], | ||
138 | }, | ||
139 | schedboost: { | ||
140 | cflags: ["-DUSE_SCHEDBOOST"], | ||
141 | }, | ||
142 | }, | ||
143 | cflags: [ | ||
144 | "-Werror", | ||
145 | "-Wall", | ||
146 | "-Wextra", | ||
147 | ], | ||
148 | |||
149 | clang: true, | ||
150 | sanitize: { | ||
151 | misc_undefined: ["integer"], | ||
152 | }, | ||
153 | } | ||
154 | |||
155 | subdirs = ["tests"] | ||
diff --git a/libcutils/Android.mk b/libcutils/Android.mk deleted file mode 100644 index c830182f9..000000000 --- a/libcutils/Android.mk +++ /dev/null | |||
@@ -1,153 +0,0 @@ | |||
1 | # | ||
2 | # Copyright (C) 2008 The Android Open Source Project | ||
3 | # | ||
4 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | # you may not use this file except in compliance with the License. | ||
6 | # You may obtain a copy of the License at | ||
7 | # | ||
8 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | # | ||
10 | # Unless required by applicable law or agreed to in writing, software | ||
11 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | # See the License for the specific language governing permissions and | ||
14 | # limitations under the License. | ||
15 | # | ||
16 | LOCAL_PATH := $(my-dir) | ||
17 | include $(CLEAR_VARS) | ||
18 | |||
19 | libcutils_common_sources := \ | ||
20 | config_utils.c \ | ||
21 | fs_config.c \ | ||
22 | canned_fs_config.c \ | ||
23 | hashmap.c \ | ||
24 | iosched_policy.c \ | ||
25 | load_file.c \ | ||
26 | native_handle.c \ | ||
27 | open_memstream.c \ | ||
28 | process_name.c \ | ||
29 | record_stream.c \ | ||
30 | sched_policy.c \ | ||
31 | sockets.cpp \ | ||
32 | strdup16to8.c \ | ||
33 | strdup8to16.c \ | ||
34 | strlcpy.c \ | ||
35 | threads.c \ | ||
36 | |||
37 | # some files must not be compiled when building against Mingw | ||
38 | # they correspond to features not used by our host development tools | ||
39 | # which are also hard or even impossible to port to native Win32 | ||
40 | libcutils_nonwindows_sources := \ | ||
41 | fs.c \ | ||
42 | multiuser.c \ | ||
43 | socket_inaddr_any_server_unix.c \ | ||
44 | socket_local_client_unix.c \ | ||
45 | socket_local_server_unix.c \ | ||
46 | socket_loopback_client_unix.c \ | ||
47 | socket_loopback_server_unix.c \ | ||
48 | socket_network_client_unix.c \ | ||
49 | sockets_unix.cpp \ | ||
50 | str_parms.c \ | ||
51 | |||
52 | libcutils_nonwindows_host_sources := \ | ||
53 | ashmem-host.c \ | ||
54 | trace-host.c \ | ||
55 | |||
56 | libcutils_windows_host_sources := \ | ||
57 | socket_inaddr_any_server_windows.c \ | ||
58 | socket_network_client_windows.c \ | ||
59 | sockets_windows.cpp \ | ||
60 | |||
61 | # Shared and static library for host | ||
62 | # Note: when linking this library on Windows, you must also link to Winsock2 | ||
63 | # using "LOCAL_LDLIBS_windows := -lws2_32". | ||
64 | # ======================================================== | ||
65 | LOCAL_MODULE := libcutils | ||
66 | LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c | ||
67 | LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) | ||
68 | LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) | ||
69 | LOCAL_SRC_FILES_windows := $(libcutils_windows_host_sources) | ||
70 | LOCAL_STATIC_LIBRARIES := liblog | ||
71 | LOCAL_CFLAGS := -Werror -Wall -Wextra | ||
72 | LOCAL_MULTILIB := both | ||
73 | LOCAL_MODULE_HOST_OS := darwin linux windows | ||
74 | include $(BUILD_HOST_STATIC_LIBRARY) | ||
75 | |||
76 | include $(CLEAR_VARS) | ||
77 | LOCAL_MODULE := libcutils | ||
78 | LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c | ||
79 | LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) | ||
80 | LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) | ||
81 | LOCAL_SHARED_LIBRARIES := liblog | ||
82 | LOCAL_CFLAGS := -Werror -Wall -Wextra | ||
83 | LOCAL_MULTILIB := both | ||
84 | include $(BUILD_HOST_SHARED_LIBRARY) | ||
85 | |||
86 | |||
87 | |||
88 | # Shared and static library for target | ||
89 | # ======================================================== | ||
90 | |||
91 | include $(CLEAR_VARS) | ||
92 | LOCAL_MODULE := libcutils | ||
93 | LOCAL_SRC_FILES := $(libcutils_common_sources) \ | ||
94 | $(libcutils_nonwindows_sources) \ | ||
95 | android_reboot.c \ | ||
96 | ashmem-dev.c \ | ||
97 | debugger.c \ | ||
98 | klog.cpp \ | ||
99 | partition_utils.c \ | ||
100 | properties.c \ | ||
101 | qtaguid.c \ | ||
102 | trace-dev.c \ | ||
103 | uevent.c \ | ||
104 | |||
105 | LOCAL_SRC_FILES_arm += arch-arm/memset32.S | ||
106 | LOCAL_SRC_FILES_arm64 += arch-arm64/android_memset.S | ||
107 | |||
108 | LOCAL_SRC_FILES_mips += arch-mips/android_memset.c | ||
109 | LOCAL_SRC_FILES_mips64 += arch-mips/android_memset.c | ||
110 | |||
111 | LOCAL_SRC_FILES_x86 += \ | ||
112 | arch-x86/android_memset16.S \ | ||
113 | arch-x86/android_memset32.S \ | ||
114 | |||
115 | LOCAL_SRC_FILES_x86_64 += \ | ||
116 | arch-x86_64/android_memset16.S \ | ||
117 | arch-x86_64/android_memset32.S \ | ||
118 | |||
119 | LOCAL_C_INCLUDES := $(libcutils_c_includes) | ||
120 | LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := libdebuggerd_client | ||
121 | LOCAL_STATIC_LIBRARIES := liblog libdebuggerd_client | ||
122 | ifneq ($(ENABLE_CPUSETS),) | ||
123 | LOCAL_CFLAGS += -DUSE_CPUSETS | ||
124 | endif | ||
125 | ifneq ($(ENABLE_SCHEDBOOST),) | ||
126 | LOCAL_CFLAGS += -DUSE_SCHEDBOOST | ||
127 | endif | ||
128 | LOCAL_CFLAGS += -Werror -Wall -Wextra -std=gnu90 | ||
129 | LOCAL_CLANG := true | ||
130 | LOCAL_SANITIZE := integer | ||
131 | include $(BUILD_STATIC_LIBRARY) | ||
132 | |||
133 | include $(CLEAR_VARS) | ||
134 | LOCAL_MODULE := libcutils | ||
135 | # TODO: remove liblog as whole static library, once we don't have prebuilt that requires | ||
136 | # liblog symbols present in libcutils. | ||
137 | LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog | ||
138 | LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := libdebuggerd_client | ||
139 | LOCAL_STATIC_LIBRARIES := libdebuggerd_client | ||
140 | LOCAL_SHARED_LIBRARIES := liblog | ||
141 | ifneq ($(ENABLE_CPUSETS),) | ||
142 | LOCAL_CFLAGS += -DUSE_CPUSETS | ||
143 | endif | ||
144 | ifneq ($(ENABLE_SCHEDBOOST),) | ||
145 | LOCAL_CFLAGS += -DUSE_SCHEDBOOST | ||
146 | endif | ||
147 | LOCAL_CFLAGS += -Werror -Wall -Wextra | ||
148 | LOCAL_C_INCLUDES := $(libcutils_c_includes) | ||
149 | LOCAL_CLANG := true | ||
150 | LOCAL_SANITIZE := integer | ||
151 | include $(BUILD_SHARED_LIBRARY) | ||
152 | |||
153 | include $(call all-makefiles-under,$(LOCAL_PATH)) | ||
diff --git a/libcutils/tests/Android.bp b/libcutils/tests/Android.bp new file mode 100644 index 000000000..530c74716 --- /dev/null +++ b/libcutils/tests/Android.bp | |||
@@ -0,0 +1,72 @@ | |||
1 | // Copyright (C) 2014 The Android Open Source Project | ||
2 | // | ||
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | ||
4 | // you may not use this file except in compliance with the License. | ||
5 | // You may obtain a copy of the License at | ||
6 | // | ||
7 | // http://www.apache.org/licenses/LICENSE-2.0 | ||
8 | // | ||
9 | // Unless required by applicable law or agreed to in writing, software | ||
10 | // distributed under the License is distributed on an "AS IS" BASIS, | ||
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
12 | // See the License for the specific language governing permissions and | ||
13 | // limitations under the License. | ||
14 | |||
15 | cc_defaults { | ||
16 | name: "libcutils_test_default", | ||
17 | srcs: ["sockets_test.cpp"], | ||
18 | |||
19 | target: { | ||
20 | android: { | ||
21 | srcs: [ | ||
22 | "MemsetTest.cpp", | ||
23 | "PropertiesTest.cpp", | ||
24 | "trace-dev_test.cpp", | ||
25 | ], | ||
26 | }, | ||
27 | |||
28 | not_windows: { | ||
29 | srcs: ["test_str_parms.cpp"], | ||
30 | }, | ||
31 | }, | ||
32 | |||
33 | multilib: { | ||
34 | lib32: { | ||
35 | suffix: "32", | ||
36 | }, | ||
37 | lib64: { | ||
38 | suffix: "64", | ||
39 | }, | ||
40 | }, | ||
41 | } | ||
42 | |||
43 | test_libraries = [ | ||
44 | "libcutils", | ||
45 | "liblog", | ||
46 | "libbase", | ||
47 | ] | ||
48 | |||
49 | cc_test { | ||
50 | name: "libcutils_test", | ||
51 | defaults: ["libcutils_test_default"], | ||
52 | host_supported: true, | ||
53 | shared_libs: test_libraries, | ||
54 | } | ||
55 | |||
56 | cc_test { | ||
57 | name: "libcutils_test_static", | ||
58 | defaults: ["libcutils_test_default"], | ||
59 | static_libs: ["libc"] + test_libraries, | ||
60 | stl: "libc++_static", | ||
61 | |||
62 | target: { | ||
63 | android: { | ||
64 | static_executable: true, | ||
65 | }, | ||
66 | windows: { | ||
67 | host_ldlibs: ["-lws2_32"], | ||
68 | |||
69 | enabled: true, | ||
70 | }, | ||
71 | }, | ||
72 | } | ||
diff --git a/libcutils/tests/Android.mk b/libcutils/tests/Android.mk deleted file mode 100644 index 52cf5f407..000000000 --- a/libcutils/tests/Android.mk +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | # Copyright (C) 2014 The Android Open Source Project | ||
2 | # | ||
3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4 | # you may not use this file except in compliance with the License. | ||
5 | # You may obtain a copy of the License at | ||
6 | # | ||
7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
8 | # | ||
9 | # Unless required by applicable law or agreed to in writing, software | ||
10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
12 | # See the License for the specific language governing permissions and | ||
13 | # limitations under the License. | ||
14 | |||
15 | LOCAL_PATH := $(call my-dir) | ||
16 | |||
17 | test_src_files := \ | ||
18 | sockets_test.cpp \ | ||
19 | |||
20 | test_src_files_nonwindows := \ | ||
21 | test_str_parms.cpp \ | ||
22 | |||
23 | test_target_only_src_files := \ | ||
24 | MemsetTest.cpp \ | ||
25 | PropertiesTest.cpp \ | ||
26 | trace-dev_test.cpp \ | ||
27 | |||
28 | test_libraries := libcutils liblog libbase | ||
29 | |||
30 | |||
31 | # | ||
32 | # Target. | ||
33 | # | ||
34 | |||
35 | include $(CLEAR_VARS) | ||
36 | LOCAL_MODULE := libcutils_test | ||
37 | LOCAL_SRC_FILES := $(test_src_files) $(test_target_only_src_files) | ||
38 | LOCAL_SHARED_LIBRARIES := $(test_libraries) | ||
39 | LOCAL_MULTILIB := both | ||
40 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 | ||
41 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 | ||
42 | include $(BUILD_NATIVE_TEST) | ||
43 | |||
44 | include $(CLEAR_VARS) | ||
45 | LOCAL_MODULE := libcutils_test_static | ||
46 | LOCAL_FORCE_STATIC_EXECUTABLE := true | ||
47 | LOCAL_SRC_FILES := $(test_src_files) $(test_target_only_src_files) | ||
48 | LOCAL_STATIC_LIBRARIES := libc $(test_libraries) | ||
49 | LOCAL_CXX_STL := libc++_static | ||
50 | LOCAL_MULTILIB := both | ||
51 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 | ||
52 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 | ||
53 | include $(BUILD_NATIVE_TEST) | ||
54 | |||
55 | |||
56 | # | ||
57 | # Host. | ||
58 | # | ||
59 | |||
60 | include $(CLEAR_VARS) | ||
61 | LOCAL_MODULE := libcutils_test | ||
62 | LOCAL_SRC_FILES := $(test_src_files) $(test_src_files_nonwindows) | ||
63 | LOCAL_SHARED_LIBRARIES := $(test_libraries) | ||
64 | LOCAL_MULTILIB := both | ||
65 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 | ||
66 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 | ||
67 | include $(BUILD_HOST_NATIVE_TEST) | ||
68 | |||
69 | include $(CLEAR_VARS) | ||
70 | LOCAL_MODULE := libcutils_test_static | ||
71 | LOCAL_SRC_FILES := $(test_src_files) | ||
72 | LOCAL_SRC_FILES_darwin := $(test_src_files_nonwindows) | ||
73 | LOCAL_SRC_FILES_linux := $(test_src_files_nonwindows) | ||
74 | LOCAL_STATIC_LIBRARIES := $(test_libraries) | ||
75 | LOCAL_LDLIBS_windows := -lws2_32 | ||
76 | LOCAL_CXX_STL := libc++_static | ||
77 | LOCAL_MULTILIB := both | ||
78 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 | ||
79 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 | ||
80 | LOCAL_MODULE_HOST_OS := darwin linux windows | ||
81 | include $(BUILD_HOST_NATIVE_TEST) | ||