diff mbox

tests : Makefile change avoiding compiler error for module test

Message ID 15828026.131311401257228625.JavaMail.weblogic@epml10
State Accepted
Headers show

Commit Message

Amit Khatri May 28, 2014, 6:07 a.m. UTC
Hi 
Please find the below patch.

From 46ae6a00850665cc6c05d5b99d7c2ebcee6d3f55 Mon Sep 17 00:00:00 2001
From: Amit Khatri <amit.khatri@samsung.com>
Date: Wed, 28 May 2014 11:26:27 +0530
Subject: [PATCH] tests : Makefile change avoiding compiler error for
 module test

WPA Supplicant is giving below error when  "CONFIG_MODULE_TESTS=y" and "CONFIG_P2P=y" in .config file
"wpas_module_tests.c:84: undefined reference to `wps_module_tests'"
This error is coming because "CONFIG_WPS=y" is commented out in .config file but CONFIG_WPS is getting enabled by CONFIG_P2P in Makefile.

Signed-off-by: Amit Khatri <amit.khatri@samsung.com>
---
 wpa_supplicant/Makefile |    3 +++
 1 file changed, 3 insertions(+)

Comments

Jouni Malinen May 31, 2014, 3:44 p.m. UTC | #1
On Wed, May 28, 2014 at 06:07:08AM +0000, Amit Khatri wrote:
> WPA Supplicant is giving below error when  "CONFIG_MODULE_TESTS=y" and "CONFIG_P2P=y" in .config file
> "wpas_module_tests.c:84: undefined reference to `wps_module_tests'"
> This error is coming because "CONFIG_WPS=y" is commented out in .config file but CONFIG_WPS is getting enabled by CONFIG_P2P in Makefile.

Thanks. I applied this with a bit different design to avoid need for
duplicate addition of wps_module_tests.o, i.e., by moving the main ifdef
CONFIG_MODULE_TESTS further down in the Makefile to get the CONFIG_WPS=y
addition from CONFIG_P2P.
diff mbox

Patch

diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index c0913e0..e920cdf 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -639,6 +639,9 @@  OBJS += ../src/wps/wps_attr_process.o
 OBJS += ../src/wps/wps_dev_attr.o
 OBJS += ../src/wps/wps_enrollee.o
 OBJS += ../src/wps/wps_registrar.o
+ifdef CONFIG_MODULE_TESTS
+OBJS += ../src/wps/wps_module_tests.o
+endif
 OBJS_h += ../src/eap_server/eap_server_wsc.o
 CONFIG_IEEE8021X_EAPOL=y
 NEED_DH_GROUPS=y