From f3b7411060d5679515786b8792c2e0b518571b97 Mon Sep 17 00:00:00 2001 From: Alex Deymo Date: Fri, 11 Nov 2016 20:37:14 -0800 Subject: [PATCH] Compile native network functionis into libandroid_net. libandroid includes some local implementations, but depends on many other libraries to provide those (counting transitive dependencies, a total of 65). This patch copies the native network functions provided by android/multinetwork.h header to its own new libandroid_net shared library. This new library has only one other shared library dependency. Bug: 32842753 Test: `make` on aosp_arm-eng Change-Id: Ifbd529d9bf74a8d4f754733cff345729de6b1521 --- native/android/Android.mk | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/native/android/Android.mk b/native/android/Android.mk index da4e4bac6dbc8..1f69df1ae21d3 100644 --- a/native/android/Android.mk +++ b/native/android/Android.mk @@ -1,6 +1,8 @@ BASE_PATH := $(call my-dir) LOCAL_PATH:= $(call my-dir) +common_cflags := -Wall -Werror -Wunused -Wunreachable-code + include $(CLEAR_VARS) # our source files @@ -42,6 +44,23 @@ LOCAL_C_INCLUDES += \ LOCAL_MODULE := libandroid -LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code +LOCAL_CFLAGS += $(common_cflags) + +include $(BUILD_SHARED_LIBRARY) + +# Network library. +include $(CLEAR_VARS) +LOCAL_MODULE := libandroid_net +LOCAL_CFLAGS := $(common_cflags) +LOCAL_SRC_FILES:= \ + net.c \ + +LOCAL_SHARED_LIBRARIES := \ + libnetd_client \ + +LOCAL_C_INCLUDES += \ + frameworks/base/native/include \ + bionic/libc/dns/include \ + system/netd/include \ include $(BUILD_SHARED_LIBRARY)