summaryrefslogtreecommitdiffstats
path: root/fastboot/Android.mk
diff options
context:
space:
mode:
authorDavid Pursell <dpursell@google.com>2015-12-09 17:09:54 -0800
committerDavid Pursell <dpursell@google.com>2015-12-16 16:16:08 -0800
commit815c7beae73bc0d13f14a94972175756aec1d4de (patch)
treed6250a135a988579bbf7dc85ad889912e1968418 /fastboot/Android.mk
parent56d7d4e85f41ddeea5ca256e5a9c05f73b2f40f0 (diff)
downloadcore-815c7beae73bc0d13f14a94972175756aec1d4de.tar.gz
core-815c7beae73bc0d13f14a94972175756aec1d4de.tar.bz2
core-815c7beae73bc0d13f14a94972175756aec1d4de.zip
fastboot: implement UDP networking interface.
This CL creates a UdpSocket class that provides a simple unified interface to send and receive UDP packets for all platforms. Nothing uses this interface yet except for tests. The eventual goal is to implement a UDP protocol for fastboot, but it makes the code much simpler and more modular if we handle the low-level networking here independently of our custom fastboot protocol. Some of the Windows code is similar to adb. I'd like to create a library to hold the common functionality, but it is going to be a little delicate to separate out the features unique to adb (e.g. the custom file descriptor system), and I don't want to risk breaking something in adb before the holiday break, so I'm hoping to get this in for now and merge them early next year. Tests are included in this CL to exercise this functionality using a loopback connection. Bug: http://b/26154763. Tests: `fastboot_test` loopback tests on Linux, Mac, and Windows 7. Change-Id: I81d1b7ace8d864246b99f6c80b8e29f64b8aa375
Diffstat (limited to 'fastboot/Android.mk')
-rw-r--r--fastboot/Android.mk35
1 files changed, 30 insertions, 5 deletions
diff --git a/fastboot/Android.mk b/fastboot/Android.mk
index c293b578a..8cbc79bb7 100644
--- a/fastboot/Android.mk
+++ b/fastboot/Android.mk
@@ -33,15 +33,15 @@ LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code
LOCAL_CFLAGS += -DFASTBOOT_REVISION='"$(fastboot_version)"'
-LOCAL_SRC_FILES_linux := usb_linux.cpp util_linux.cpp
-LOCAL_STATIC_LIBRARIES_linux := libselinux
+LOCAL_SRC_FILES_linux := socket_unix.cpp usb_linux.cpp util_linux.cpp
+LOCAL_STATIC_LIBRARIES_linux := libcutils libselinux
-LOCAL_SRC_FILES_darwin := usb_osx.cpp util_osx.cpp
-LOCAL_STATIC_LIBRARIES_darwin := libselinux
+LOCAL_SRC_FILES_darwin := socket_unix.cpp usb_osx.cpp util_osx.cpp
+LOCAL_STATIC_LIBRARIES_darwin := libcutils libselinux
LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
LOCAL_CFLAGS_darwin := -Wno-unused-parameter
-LOCAL_SRC_FILES_windows := usb_windows.cpp util_windows.cpp
+LOCAL_SRC_FILES_windows := socket_windows.cpp usb_windows.cpp util_windows.cpp
LOCAL_STATIC_LIBRARIES_windows := AdbWinApi
LOCAL_REQUIRED_MODULES_windows := AdbWinApi
LOCAL_LDLIBS_windows := -lws2_32
@@ -89,3 +89,28 @@ LOCAL_CFLAGS := -Werror
LOCAL_STATIC_LIBRARIES := libbase
include $(BUILD_HOST_EXECUTABLE)
endif
+
+# fastboot_test
+# =========================================================
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := fastboot_test
+LOCAL_MODULE_HOST_OS := darwin linux windows
+
+LOCAL_SRC_FILES := socket_test.cpp
+LOCAL_STATIC_LIBRARIES := libbase
+
+LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code
+
+LOCAL_SRC_FILES_linux := socket_unix.cpp
+LOCAL_STATIC_LIBRARIES_linux := libcutils
+
+LOCAL_SRC_FILES_darwin := socket_unix.cpp
+LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
+LOCAL_CFLAGS_darwin := -Wno-unused-parameter
+LOCAL_STATIC_LIBRARIES_darwin := libcutils
+
+LOCAL_SRC_FILES_windows := socket_windows.cpp
+LOCAL_LDLIBS_windows := -lws2_32
+
+include $(BUILD_HOST_NATIVE_TEST)