diff options
| author | Prashanth Bhatta <bhattap@qca.qualcomm.com> | 2014-01-28 14:16:54 -0800 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-02-07 17:38:19 -0800 |
| commit | 61cd4b514283a70f85641ea54a089b3c9b71607e (patch) | |
| tree | 0a77648b920e7feac49b8bd3e9af6ae357c42cdb | |
| parent | ca220fab78f3c75cb3f2d8e85daccb7c173dfadb (diff) | |
qcacld: Define open source flag based on license
Kbuild file enables WLAN_OPEN_SOURCE flag based on the directory
path but this doesn't work for all the platform as path may be
different. This change passes the WLAN_OPEN_SOURCE flag from
Android.mk or Makefile. Makefile determines whether the driver
is open source or proprietary and accordingly WLAN_OPEN_SOURCE is
set to 1 or 0.
Change-Id: Id0149f71ceb3e94bd1a67868565cd3b8151bdd7d
| -rw-r--r-- | Android.mk | 3 | ||||
| -rw-r--r-- | Kbuild | 15 | ||||
| -rw-r--r-- | Makefile | 10 |
3 files changed, 18 insertions, 10 deletions
diff --git a/Android.mk b/Android.mk index de83532a4213..d3dfafce1fe0 100644 --- a/Android.mk +++ b/Android.mk @@ -22,8 +22,10 @@ ifneq ($(findstring vendor,$(LOCAL_PATH)),) # Determine if we are Proprietary or Open Source ifneq ($(findstring opensource,$(LOCAL_PATH)),) WLAN_PROPRIETARY := 0 + WLAN_OPEN_SOURCE := 1 else WLAN_PROPRIETARY := 1 + WLAN_OPEN_SOURCE := 0 endif ifeq ($(WLAN_PROPRIETARY),1) @@ -52,6 +54,7 @@ KBUILD_OPTIONS += MODNAME=wlan KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) KBUILD_OPTIONS += $(WLAN_SELECT) KBUILD_OPTIONS += $(WLAN_ISOC_SELECT) +KBUILD_OPTIONS += WLAN_OPEN_SOURCE=$(WLAN_OPEN_SOURCE) include $(CLEAR_VARS) LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko @@ -1,5 +1,5 @@ -# We can build either as part of a standalone Kernel build or part -# of an Android build. Determine which mechanism is being used +# We can build either as part of a standalone Kernel build or as +# an external module. Determine which mechanism is being used ifeq ($(MODNAME),) KERNEL_BUILD := 1 else @@ -7,10 +7,11 @@ else endif ifeq ($(KERNEL_BUILD),1) - # These are provided in Android-based builds + # These are provided in external module based builds # Need to explicitly define for Kernel-based builds MODNAME := wlan - WLAN_ROOT := drivers/staging/prima + WLAN_ROOT := drivers/staging/qcacld-2.0 + WLAN_OPEN_SOURCE := 1 endif ifeq ($(KERNEL_BUILD), 0) @@ -972,11 +973,7 @@ ifeq ($(RE_ENABLE_WIFI_ON_WDI_TIMEOUT),1) CDEFINES += -DWDI_RE_ENABLE_WIFI_ON_WDI_TIMEOUT endif -ifeq ($(KERNEL_BUILD),1) -CDEFINES += -DWLAN_OPEN_SOURCE -endif - -ifeq ($(findstring opensource, $(WLAN_ROOT)), opensource) +ifeq ($(WLAN_OPEN_SOURCE), 1) CDEFINES += -DWLAN_OPEN_SOURCE endif @@ -1,13 +1,21 @@ KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build -KBUILD_OPTIONS := WLAN_ROOT=$(shell pwd) +KBUILD_OPTIONS := WLAN_ROOT=$(PWD) KBUILD_OPTIONS += MODNAME=wlan +# Determine if the driver license is Open source or proprietary +# This is determined under the assumption that LICENSE doesn't change. +# Please change here if driver license text changes. +LICENSE_FILE ?= $(PWD)/$(WLAN_ROOT)/CORE/HDD/src/wlan_hdd_main.c +WLAN_OPEN_SOURCE = $(shell if grep -q "MODULE_LICENSE(\"Dual BSD/GPL\")" \ + $(LICENSE_FILE); then echo 1; else echo 0; fi) + #By default build for CLD WLAN_SELECT := CONFIG_QCA_CLD_WLAN=m KBUILD_OPTIONS += CONFIG_QCA_WIFI_ISOC=0 KBUILD_OPTIONS += CONFIG_QCA_WIFI_2_0=1 KBUILD_OPTIONS += $(WLAN_SELECT) +KBUILD_OPTIONS += WLAN_OPEN_SOURCE=$(WLAN_OPEN_SOURCE) KBUILD_OPTIONS += $(KBUILD_EXTRA) # Extra config if any all: |
