wlan: Remove deprecated ANDROID_BUILD_TOP for new SP

ANDROID_BUILD_TOP variable is being deprecated and thus all paths are
assumed to be relative to the top directory.
However, this is causing problem when some of the paths are constructed
in the Android build system and used in the non-Android makefiles that
are usually executed NOT at the top directory but at a sub directory
using -C option. As a result, the relative path from the Android build
system become invalid in the non-Android makefiles.
In order to overcome the restriction, ANDROID_BUILD_TOP is manually
constructed when invoking the non-Android makefiles by using $$(pwd).
The non-Android makefiles are expected to construct the absolute path
by prepending ANDROID_BUILD_TOP to any path that came from the Android
build system.
Specifically, Kbuild is modified so that ANDROID_BUILD_TOP is prepended
to WLAN_ROOT and WLAN_COMMON_INC to make them absolute paths.

Change-Id: Ic34de7a2bc407153085eb3eb154d6dd71f04eedb
diff --git a/Kbuild b/Kbuild
index d584ae8..d822f0f 100644
--- a/Kbuild
+++ b/Kbuild
@@ -88,6 +88,31 @@
 endif
 endif
 
+ifeq ($(KERNEL_BUILD), 0)
+ifeq ($(WLAN_PROPRIETARY),1)
+    WLAN_BLD_DIR := vendor/qcom/proprietary/wlan
+else
+ifneq ($(TARGET_SUPPORTS_WEARABLES),true)
+ifneq ($(ANDROID_BUILD_TOP),)
+    WLAN_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/wlan
+else
+    WLAN_BLD_DIR := vendor/qcom/opensource/wlan
+endif # ANDROID_BUILD_TOP
+else
+ifneq ($(ANDROID_BUILD_TOP),)
+    WLAN_BLD_DIR := $(ANDROID_BUILD_TOP)/device/qcom/msm8909w/opensource/wlan
+else
+    WLAN_BLD_DIR := device/qcom/msm8909w/opensource/wlan
+endif # ANDROID_BUILD_TOP
+endif # TARGET_SUPPORTS_WEARABLES
+endif # WLAN_PROPRIETARY
+
+ifneq ($(ANDROID_BUILD_TOP),)
+WLAN_ROOT=$(WLAN_BLD_DIR)/prima
+else
+WLAN_ROOT=$(KERNEL_TO_BUILD_ROOT_OFFSET)$(WLAN_BLD_DIR)/prima
+endif # ANDROID_BUILD_TOP
+endif # KERNEL_BUILD
 
 ifeq ($(CONFIG_PRIMA_WLAN_BTAMP),y)
 ############ BAP ############