From 75acc7bf81d43850694d39d2c45a20ca81d99379 Mon Sep 17 00:00:00 2001 From: Vijay Venkatraman Date: Thu, 5 Jan 2017 10:39:38 -0800 Subject: [PATCH] Exporting C++ headers from system/core Moved headers from include/libutils and include/libsysutils to libutils/include and libsysutils/include respectively, so they can be exported via these libs. They needed to be moved since Soong does not allow export from external folder. Added symlink from old locations. They are needed since Soong includes system/core/include by default. Once all modules are cleaned up to explicitly add the required libs, the symlinks will be removed. Moved headers of libutils to libutils_headers. They should be used by modules for header-only inlines. Added libutils_headers as dependency of libutils. Split of C++ headers into those that have no dependency and those that have dependency on libutils.so will be handled in a later CL. Test: Add above libs to shared lib of local module Change-Id: I122db72056b26b1f39bad1d9a0c2a1c5efda3550 --- include/sysutils | 1 + include/utils | 1 + libsysutils/Android.mk | 2 ++ .../include}/sysutils/FrameworkClient.h | 0 .../include}/sysutils/FrameworkCommand.h | 0 .../include}/sysutils/FrameworkListener.h | 0 {include => libsysutils/include}/sysutils/List.h | 0 .../include}/sysutils/NetlinkEvent.h | 0 .../include}/sysutils/NetlinkListener.h | 0 .../include}/sysutils/ServiceManager.h | 0 .../include}/sysutils/SocketClient.h | 0 .../include}/sysutils/SocketClientCommand.h | 0 .../include}/sysutils/SocketListener.h | 0 libutils/Android.bp | 13 +++++++++++++ .../include}/utils/AndroidThreads.h | 0 {include => libutils/include}/utils/Atomic.h | 0 {include => libutils/include}/utils/BitSet.h | 0 {include => libutils/include}/utils/BlobCache.h | 0 {include => libutils/include}/utils/ByteOrder.h | 0 {include => libutils/include}/utils/CallStack.h | 0 {include => libutils/include}/utils/Compat.h | 0 {include => libutils/include}/utils/Condition.h | 0 {include => libutils/include}/utils/Debug.h | 0 {include => libutils/include}/utils/Endian.h | 0 {include => libutils/include}/utils/Errors.h | 0 {include => libutils/include}/utils/FastStrcmp.h | 0 {include => libutils/include}/utils/FileMap.h | 0 {include => libutils/include}/utils/Flattenable.h | 0 {include => libutils/include}/utils/Functor.h | 0 {include => libutils/include}/utils/JenkinsHash.h | 0 {include => libutils/include}/utils/KeyedVector.h | 0 .../include}/utils/LinearTransform.h | 0 {include => libutils/include}/utils/List.h | 0 {include => libutils/include}/utils/Log.h | 0 {include => libutils/include}/utils/Looper.h | 0 {include => libutils/include}/utils/LruCache.h | 0 {include => libutils/include}/utils/Mutex.h | 0 {include => libutils/include}/utils/NativeHandle.h | 0 {include => libutils/include}/utils/Printer.h | 0 .../include}/utils/ProcessCallStack.h | 0 {include => libutils/include}/utils/PropertyMap.h | 0 {include => libutils/include}/utils/RWLock.h | 0 {include => libutils/include}/utils/RefBase.h | 0 {include => libutils/include}/utils/Singleton.h | 0 {include => libutils/include}/utils/SortedVector.h | 0 {include => libutils/include}/utils/StopWatch.h | 0 {include => libutils/include}/utils/String16.h | 0 {include => libutils/include}/utils/String8.h | 0 {include => libutils/include}/utils/StrongPointer.h | 0 {include => libutils/include}/utils/SystemClock.h | 0 {include => libutils/include}/utils/Thread.h | 0 {include => libutils/include}/utils/ThreadDefs.h | 0 {include => libutils/include}/utils/Timers.h | 0 {include => libutils/include}/utils/Tokenizer.h | 0 {include => libutils/include}/utils/Trace.h | 0 {include => libutils/include}/utils/TypeHelpers.h | 0 {include => libutils/include}/utils/Unicode.h | 0 {include => libutils/include}/utils/Vector.h | 0 {include => libutils/include}/utils/VectorImpl.h | 0 {include => libutils/include}/utils/misc.h | 0 {include => libutils/include}/utils/threads.h | 0 61 files changed, 17 insertions(+) create mode 120000 include/sysutils create mode 120000 include/utils rename {include => libsysutils/include}/sysutils/FrameworkClient.h (100%) rename {include => libsysutils/include}/sysutils/FrameworkCommand.h (100%) rename {include => libsysutils/include}/sysutils/FrameworkListener.h (100%) rename {include => libsysutils/include}/sysutils/List.h (100%) rename {include => libsysutils/include}/sysutils/NetlinkEvent.h (100%) rename {include => libsysutils/include}/sysutils/NetlinkListener.h (100%) rename {include => libsysutils/include}/sysutils/ServiceManager.h (100%) rename {include => libsysutils/include}/sysutils/SocketClient.h (100%) rename {include => libsysutils/include}/sysutils/SocketClientCommand.h (100%) rename {include => libsysutils/include}/sysutils/SocketListener.h (100%) rename {include => libutils/include}/utils/AndroidThreads.h (100%) rename {include => libutils/include}/utils/Atomic.h (100%) rename {include => libutils/include}/utils/BitSet.h (100%) rename {include => libutils/include}/utils/BlobCache.h (100%) rename {include => libutils/include}/utils/ByteOrder.h (100%) rename {include => libutils/include}/utils/CallStack.h (100%) rename {include => libutils/include}/utils/Compat.h (100%) rename {include => libutils/include}/utils/Condition.h (100%) rename {include => libutils/include}/utils/Debug.h (100%) rename {include => libutils/include}/utils/Endian.h (100%) rename {include => libutils/include}/utils/Errors.h (100%) rename {include => libutils/include}/utils/FastStrcmp.h (100%) rename {include => libutils/include}/utils/FileMap.h (100%) rename {include => libutils/include}/utils/Flattenable.h (100%) rename {include => libutils/include}/utils/Functor.h (100%) rename {include => libutils/include}/utils/JenkinsHash.h (100%) rename {include => libutils/include}/utils/KeyedVector.h (100%) rename {include => libutils/include}/utils/LinearTransform.h (100%) rename {include => libutils/include}/utils/List.h (100%) rename {include => libutils/include}/utils/Log.h (100%) rename {include => libutils/include}/utils/Looper.h (100%) rename {include => libutils/include}/utils/LruCache.h (100%) rename {include => libutils/include}/utils/Mutex.h (100%) rename {include => libutils/include}/utils/NativeHandle.h (100%) rename {include => libutils/include}/utils/Printer.h (100%) rename {include => libutils/include}/utils/ProcessCallStack.h (100%) rename {include => libutils/include}/utils/PropertyMap.h (100%) rename {include => libutils/include}/utils/RWLock.h (100%) rename {include => libutils/include}/utils/RefBase.h (100%) rename {include => libutils/include}/utils/Singleton.h (100%) rename {include => libutils/include}/utils/SortedVector.h (100%) rename {include => libutils/include}/utils/StopWatch.h (100%) rename {include => libutils/include}/utils/String16.h (100%) rename {include => libutils/include}/utils/String8.h (100%) rename {include => libutils/include}/utils/StrongPointer.h (100%) rename {include => libutils/include}/utils/SystemClock.h (100%) rename {include => libutils/include}/utils/Thread.h (100%) rename {include => libutils/include}/utils/ThreadDefs.h (100%) rename {include => libutils/include}/utils/Timers.h (100%) rename {include => libutils/include}/utils/Tokenizer.h (100%) rename {include => libutils/include}/utils/Trace.h (100%) rename {include => libutils/include}/utils/TypeHelpers.h (100%) rename {include => libutils/include}/utils/Unicode.h (100%) rename {include => libutils/include}/utils/Vector.h (100%) rename {include => libutils/include}/utils/VectorImpl.h (100%) rename {include => libutils/include}/utils/misc.h (100%) rename {include => libutils/include}/utils/threads.h (100%) diff --git a/include/sysutils b/include/sysutils new file mode 120000 index 000000000..1c8e85bd1 --- /dev/null +++ b/include/sysutils @@ -0,0 +1 @@ +../libsysutils/include/sysutils/ \ No newline at end of file diff --git a/include/utils b/include/utils new file mode 120000 index 000000000..e8476fd19 --- /dev/null +++ b/include/utils @@ -0,0 +1 @@ +../libutils/include/utils/ \ No newline at end of file diff --git a/libsysutils/Android.mk b/libsysutils/Android.mk index 7bf53e391..330d6cbf1 100644 --- a/libsysutils/Android.mk +++ b/libsysutils/Android.mk @@ -21,5 +21,7 @@ LOCAL_SHARED_LIBRARIES := \ liblog \ libnl +LOCAL_EXPORT_C_INCLUDE_DIRS := system/core/libsysutils/include + include $(BUILD_SHARED_LIBRARY) diff --git a/include/sysutils/FrameworkClient.h b/libsysutils/include/sysutils/FrameworkClient.h similarity index 100% rename from include/sysutils/FrameworkClient.h rename to libsysutils/include/sysutils/FrameworkClient.h diff --git a/include/sysutils/FrameworkCommand.h b/libsysutils/include/sysutils/FrameworkCommand.h similarity index 100% rename from include/sysutils/FrameworkCommand.h rename to libsysutils/include/sysutils/FrameworkCommand.h diff --git a/include/sysutils/FrameworkListener.h b/libsysutils/include/sysutils/FrameworkListener.h similarity index 100% rename from include/sysutils/FrameworkListener.h rename to libsysutils/include/sysutils/FrameworkListener.h diff --git a/include/sysutils/List.h b/libsysutils/include/sysutils/List.h similarity index 100% rename from include/sysutils/List.h rename to libsysutils/include/sysutils/List.h diff --git a/include/sysutils/NetlinkEvent.h b/libsysutils/include/sysutils/NetlinkEvent.h similarity index 100% rename from include/sysutils/NetlinkEvent.h rename to libsysutils/include/sysutils/NetlinkEvent.h diff --git a/include/sysutils/NetlinkListener.h b/libsysutils/include/sysutils/NetlinkListener.h similarity index 100% rename from include/sysutils/NetlinkListener.h rename to libsysutils/include/sysutils/NetlinkListener.h diff --git a/include/sysutils/ServiceManager.h b/libsysutils/include/sysutils/ServiceManager.h similarity index 100% rename from include/sysutils/ServiceManager.h rename to libsysutils/include/sysutils/ServiceManager.h diff --git a/include/sysutils/SocketClient.h b/libsysutils/include/sysutils/SocketClient.h similarity index 100% rename from include/sysutils/SocketClient.h rename to libsysutils/include/sysutils/SocketClient.h diff --git a/include/sysutils/SocketClientCommand.h b/libsysutils/include/sysutils/SocketClientCommand.h similarity index 100% rename from include/sysutils/SocketClientCommand.h rename to libsysutils/include/sysutils/SocketClientCommand.h diff --git a/include/sysutils/SocketListener.h b/libsysutils/include/sysutils/SocketListener.h similarity index 100% rename from include/sysutils/SocketListener.h rename to libsysutils/include/sysutils/SocketListener.h diff --git a/libutils/Android.bp b/libutils/Android.bp index 217b8c378..0c777b103 100644 --- a/libutils/Android.bp +++ b/libutils/Android.bp @@ -12,6 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. +cc_library_headers { + name: "libutils_headers", + host_supported: true, + export_include_dirs: ["include"], + target: { + windows: { + enabled: true, + }, + }, +} + cc_library { name: "libutils", host_supported: true, @@ -42,6 +53,8 @@ cc_library { cflags: ["-Werror"], include_dirs: ["external/safe-iop/include"], + header_libs: ["libutils_headers"], + export_header_lib_headers: ["libutils_headers"], arch: { mips: { diff --git a/include/utils/AndroidThreads.h b/libutils/include/utils/AndroidThreads.h similarity index 100% rename from include/utils/AndroidThreads.h rename to libutils/include/utils/AndroidThreads.h diff --git a/include/utils/Atomic.h b/libutils/include/utils/Atomic.h similarity index 100% rename from include/utils/Atomic.h rename to libutils/include/utils/Atomic.h diff --git a/include/utils/BitSet.h b/libutils/include/utils/BitSet.h similarity index 100% rename from include/utils/BitSet.h rename to libutils/include/utils/BitSet.h diff --git a/include/utils/BlobCache.h b/libutils/include/utils/BlobCache.h similarity index 100% rename from include/utils/BlobCache.h rename to libutils/include/utils/BlobCache.h diff --git a/include/utils/ByteOrder.h b/libutils/include/utils/ByteOrder.h similarity index 100% rename from include/utils/ByteOrder.h rename to libutils/include/utils/ByteOrder.h diff --git a/include/utils/CallStack.h b/libutils/include/utils/CallStack.h similarity index 100% rename from include/utils/CallStack.h rename to libutils/include/utils/CallStack.h diff --git a/include/utils/Compat.h b/libutils/include/utils/Compat.h similarity index 100% rename from include/utils/Compat.h rename to libutils/include/utils/Compat.h diff --git a/include/utils/Condition.h b/libutils/include/utils/Condition.h similarity index 100% rename from include/utils/Condition.h rename to libutils/include/utils/Condition.h diff --git a/include/utils/Debug.h b/libutils/include/utils/Debug.h similarity index 100% rename from include/utils/Debug.h rename to libutils/include/utils/Debug.h diff --git a/include/utils/Endian.h b/libutils/include/utils/Endian.h similarity index 100% rename from include/utils/Endian.h rename to libutils/include/utils/Endian.h diff --git a/include/utils/Errors.h b/libutils/include/utils/Errors.h similarity index 100% rename from include/utils/Errors.h rename to libutils/include/utils/Errors.h diff --git a/include/utils/FastStrcmp.h b/libutils/include/utils/FastStrcmp.h similarity index 100% rename from include/utils/FastStrcmp.h rename to libutils/include/utils/FastStrcmp.h diff --git a/include/utils/FileMap.h b/libutils/include/utils/FileMap.h similarity index 100% rename from include/utils/FileMap.h rename to libutils/include/utils/FileMap.h diff --git a/include/utils/Flattenable.h b/libutils/include/utils/Flattenable.h similarity index 100% rename from include/utils/Flattenable.h rename to libutils/include/utils/Flattenable.h diff --git a/include/utils/Functor.h b/libutils/include/utils/Functor.h similarity index 100% rename from include/utils/Functor.h rename to libutils/include/utils/Functor.h diff --git a/include/utils/JenkinsHash.h b/libutils/include/utils/JenkinsHash.h similarity index 100% rename from include/utils/JenkinsHash.h rename to libutils/include/utils/JenkinsHash.h diff --git a/include/utils/KeyedVector.h b/libutils/include/utils/KeyedVector.h similarity index 100% rename from include/utils/KeyedVector.h rename to libutils/include/utils/KeyedVector.h diff --git a/include/utils/LinearTransform.h b/libutils/include/utils/LinearTransform.h similarity index 100% rename from include/utils/LinearTransform.h rename to libutils/include/utils/LinearTransform.h diff --git a/include/utils/List.h b/libutils/include/utils/List.h similarity index 100% rename from include/utils/List.h rename to libutils/include/utils/List.h diff --git a/include/utils/Log.h b/libutils/include/utils/Log.h similarity index 100% rename from include/utils/Log.h rename to libutils/include/utils/Log.h diff --git a/include/utils/Looper.h b/libutils/include/utils/Looper.h similarity index 100% rename from include/utils/Looper.h rename to libutils/include/utils/Looper.h diff --git a/include/utils/LruCache.h b/libutils/include/utils/LruCache.h similarity index 100% rename from include/utils/LruCache.h rename to libutils/include/utils/LruCache.h diff --git a/include/utils/Mutex.h b/libutils/include/utils/Mutex.h similarity index 100% rename from include/utils/Mutex.h rename to libutils/include/utils/Mutex.h diff --git a/include/utils/NativeHandle.h b/libutils/include/utils/NativeHandle.h similarity index 100% rename from include/utils/NativeHandle.h rename to libutils/include/utils/NativeHandle.h diff --git a/include/utils/Printer.h b/libutils/include/utils/Printer.h similarity index 100% rename from include/utils/Printer.h rename to libutils/include/utils/Printer.h diff --git a/include/utils/ProcessCallStack.h b/libutils/include/utils/ProcessCallStack.h similarity index 100% rename from include/utils/ProcessCallStack.h rename to libutils/include/utils/ProcessCallStack.h diff --git a/include/utils/PropertyMap.h b/libutils/include/utils/PropertyMap.h similarity index 100% rename from include/utils/PropertyMap.h rename to libutils/include/utils/PropertyMap.h diff --git a/include/utils/RWLock.h b/libutils/include/utils/RWLock.h similarity index 100% rename from include/utils/RWLock.h rename to libutils/include/utils/RWLock.h diff --git a/include/utils/RefBase.h b/libutils/include/utils/RefBase.h similarity index 100% rename from include/utils/RefBase.h rename to libutils/include/utils/RefBase.h diff --git a/include/utils/Singleton.h b/libutils/include/utils/Singleton.h similarity index 100% rename from include/utils/Singleton.h rename to libutils/include/utils/Singleton.h diff --git a/include/utils/SortedVector.h b/libutils/include/utils/SortedVector.h similarity index 100% rename from include/utils/SortedVector.h rename to libutils/include/utils/SortedVector.h diff --git a/include/utils/StopWatch.h b/libutils/include/utils/StopWatch.h similarity index 100% rename from include/utils/StopWatch.h rename to libutils/include/utils/StopWatch.h diff --git a/include/utils/String16.h b/libutils/include/utils/String16.h similarity index 100% rename from include/utils/String16.h rename to libutils/include/utils/String16.h diff --git a/include/utils/String8.h b/libutils/include/utils/String8.h similarity index 100% rename from include/utils/String8.h rename to libutils/include/utils/String8.h diff --git a/include/utils/StrongPointer.h b/libutils/include/utils/StrongPointer.h similarity index 100% rename from include/utils/StrongPointer.h rename to libutils/include/utils/StrongPointer.h diff --git a/include/utils/SystemClock.h b/libutils/include/utils/SystemClock.h similarity index 100% rename from include/utils/SystemClock.h rename to libutils/include/utils/SystemClock.h diff --git a/include/utils/Thread.h b/libutils/include/utils/Thread.h similarity index 100% rename from include/utils/Thread.h rename to libutils/include/utils/Thread.h diff --git a/include/utils/ThreadDefs.h b/libutils/include/utils/ThreadDefs.h similarity index 100% rename from include/utils/ThreadDefs.h rename to libutils/include/utils/ThreadDefs.h diff --git a/include/utils/Timers.h b/libutils/include/utils/Timers.h similarity index 100% rename from include/utils/Timers.h rename to libutils/include/utils/Timers.h diff --git a/include/utils/Tokenizer.h b/libutils/include/utils/Tokenizer.h similarity index 100% rename from include/utils/Tokenizer.h rename to libutils/include/utils/Tokenizer.h diff --git a/include/utils/Trace.h b/libutils/include/utils/Trace.h similarity index 100% rename from include/utils/Trace.h rename to libutils/include/utils/Trace.h diff --git a/include/utils/TypeHelpers.h b/libutils/include/utils/TypeHelpers.h similarity index 100% rename from include/utils/TypeHelpers.h rename to libutils/include/utils/TypeHelpers.h diff --git a/include/utils/Unicode.h b/libutils/include/utils/Unicode.h similarity index 100% rename from include/utils/Unicode.h rename to libutils/include/utils/Unicode.h diff --git a/include/utils/Vector.h b/libutils/include/utils/Vector.h similarity index 100% rename from include/utils/Vector.h rename to libutils/include/utils/Vector.h diff --git a/include/utils/VectorImpl.h b/libutils/include/utils/VectorImpl.h similarity index 100% rename from include/utils/VectorImpl.h rename to libutils/include/utils/VectorImpl.h diff --git a/include/utils/misc.h b/libutils/include/utils/misc.h similarity index 100% rename from include/utils/misc.h rename to libutils/include/utils/misc.h diff --git a/include/utils/threads.h b/libutils/include/utils/threads.h similarity index 100% rename from include/utils/threads.h rename to libutils/include/utils/threads.h