Fix adb, fastboot to compile in Windows SDK under Linux.
Change-Id: I3d0e4cabd65d9de17036901a22ec3277a6d58e64
diff --git a/adb/Android.mk b/adb/Android.mk
index 6325e53..0c93c1e 100644
--- a/adb/Android.mk
+++ b/adb/Android.mk
@@ -35,13 +35,18 @@
USB_SRCS := usb_windows.c
EXTRA_SRCS := get_my_path_windows.c
EXTRA_STATIC_LIBS := AdbWinApi
- LOCAL_C_INCLUDES += /usr/include/w32api/ddk development/host/windows/usb/api/
ifneq ($(strip $(USE_CYGWIN)),)
+ # Pure cygwin case
LOCAL_LDLIBS += -lpthread
- else
+ LOCAL_C_INCLUDES += /usr/include/w32api/ddk
+ endif
+ ifneq ($(strip $(USE_MINGW)),)
+ # MinGW under Linux case
LOCAL_LDLIBS += -lws2_32
USE_SYSDEPS_WIN32 := 1
+ LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk
endif
+ LOCAL_C_INCLUDES += development/host/windows/usb/api/
endif
LOCAL_SRC_FILES := \
diff --git a/fastboot/Android.mk b/fastboot/Android.mk
index 7a9d35f..34380ec 100644
--- a/fastboot/Android.mk
+++ b/fastboot/Android.mk
@@ -33,11 +33,18 @@
ifeq ($(HOST_OS),windows)
LOCAL_SRC_FILES += usb_windows.c util_windows.c
EXTRA_STATIC_LIBS := AdbWinApi
- LOCAL_C_INCLUDES += /usr/include/w32api/ddk development/host/windows/usb/api
- ifeq ($(strip $(USE_CYGWIN)),)
+ ifneq ($(strip $(USE_CYGWIN)),)
+ # Pure cygwin case
+ LOCAL_LDLIBS += -lpthread
+ LOCAL_C_INCLUDES += /usr/include/w32api/ddk
+ endif
+ ifneq ($(strip $(USE_MINGW)),)
+ # MinGW under Linux case
LOCAL_LDLIBS += -lws2_32
USE_SYSDEPS_WIN32 := 1
+ LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk
endif
+ LOCAL_C_INCLUDES += development/host/windows/usb/api
endif
LOCAL_STATIC_LIBRARIES := $(EXTRA_STATIC_LIBS) libzipfile libunz
diff --git a/include/arch/windows/AndroidConfig.h b/include/arch/windows/AndroidConfig.h
index 1b6ece1..806887b 100644
--- a/include/arch/windows/AndroidConfig.h
+++ b/include/arch/windows/AndroidConfig.h
@@ -296,7 +296,6 @@
*/
#ifdef USE_MINGW
#define S_IRGRP 0
-#define sleep _sleep
#endif
/*