From 41b747522ed034704823a941575493f7759eea20 Mon Sep 17 00:00:00 2001 From: Andrey Kartashev Date: Fri, 14 Sep 2018 11:17:29 +0200 Subject: [PATCH] drivers: Move libnl related build flags to separate ifdef block Fix compilation issue if we want to build wpa_supplicant without any wireless connectivity but only with MACSec support via Linux kernel driver. Signed-off-by: Andrey Kartashev --- src/drivers/drivers.mak | 60 +++++++++++++++++------------------------ src/drivers/drivers.mk | 42 +++++++++++------------------ 2 files changed, 39 insertions(+), 63 deletions(-) diff --git a/src/drivers/drivers.mak b/src/drivers/drivers.mak index 1496b47d0..56af048d1 100644 --- a/src/drivers/drivers.mak +++ b/src/drivers/drivers.mak @@ -22,6 +22,7 @@ ifdef CONFIG_DRIVER_MACSEC_LINUX DRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_LINUX DRV_OBJS += ../src/drivers/driver_macsec_linux.o NEED_DRV_WIRED_COMMON=1 +NEED_LIBNL=y CONFIG_LIBNL3_ROUTE=y endif @@ -51,37 +52,7 @@ NEED_NETLINK=y NEED_LINUX_IOCTL=y NEED_RFKILL=y NEED_RADIOTAP=y - -ifdef CONFIG_LIBNL32 - DRV_LIBS += -lnl-3 - DRV_LIBS += -lnl-genl-3 - DRV_CFLAGS += -DCONFIG_LIBNL20 - ifdef LIBNL_INC - DRV_CFLAGS += -I$(LIBNL_INC) - else - PKG_CONFIG ?= pkg-config - DRV_CFLAGS += $(shell $(PKG_CONFIG) --cflags libnl-3.0) - endif -ifdef CONFIG_LIBNL3_ROUTE - DRV_LIBS += -lnl-route-3 - DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE -endif -else - ifdef CONFIG_LIBNL_TINY - DRV_LIBS += -lnl-tiny - else - ifndef CONFIG_OSX - DRV_LIBS += -lnl - endif - endif - - ifdef CONFIG_LIBNL20 - ifndef CONFIG_LIBNL_TINY - DRV_LIBS += -lnl-genl - endif - DRV_CFLAGS += -DCONFIG_LIBNL20 - endif -endif +NEED_LIBNL=y endif ifdef CONFIG_DRIVER_BSD @@ -183,26 +154,43 @@ endif ifdef CONFIG_VLAN_NETLINK ifdef CONFIG_FULL_DYNAMIC_VLAN +NEED_LIBNL=y +CONFIG_LIBNL3_ROUTE=y +endif +endif + +ifdef NEED_LIBNL ifdef CONFIG_LIBNL32 DRV_LIBS += -lnl-3 DRV_LIBS += -lnl-genl-3 - DRV_LIBS += -lnl-route-3 DRV_CFLAGS += -DCONFIG_LIBNL20 + ifdef LIBNL_INC + DRV_CFLAGS += -I$(LIBNL_INC) + else + PKG_CONFIG ?= pkg-config + DRV_CFLAGS += $(shell $(PKG_CONFIG) --cflags libnl-3.0) + endif + ifdef CONFIG_LIBNL3_ROUTE + DRV_LIBS += -lnl-route-3 + DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE + endif else ifdef CONFIG_LIBNL_TINY DRV_LIBS += -lnl-tiny else - DRV_LIBS += -lnl + ifndef CONFIG_OSX + DRV_LIBS += -lnl + endif endif ifdef CONFIG_LIBNL20 - DRV_LIBS += -lnl-genl - DRV_LIBS += -lnl-route + ifndef CONFIG_LIBNL_TINY + DRV_LIBS += -lnl-genl + endif DRV_CFLAGS += -DCONFIG_LIBNL20 endif endif endif -endif ##### COMMON VARS DRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS) diff --git a/src/drivers/drivers.mk b/src/drivers/drivers.mk index cd25133af..599a0b579 100644 --- a/src/drivers/drivers.mk +++ b/src/drivers/drivers.mk @@ -23,6 +23,7 @@ DRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_LINUX DRV_OBJS += src/drivers/driver_macsec_linux.c NEED_DRV_WIRED_COMMON=1 CONFIG_LIBNL3_ROUTE=y +NEED_LIBNL=y endif ifdef NEED_DRV_WIRED_COMMON @@ -46,29 +47,7 @@ NEED_NETLINK=y NEED_LINUX_IOCTL=y NEED_RFKILL=y NEED_RADIOTAP=y - -ifdef CONFIG_LIBNL32 - DRV_LIBS += -lnl-3 - DRV_LIBS += -lnl-genl-3 - DRV_CFLAGS += -DCONFIG_LIBNL20 -I/usr/include/libnl3 -ifdef CONFIG_LIBNL3_ROUTE - DRV_LIBS += -lnl-route-3 - DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE -endif -else - ifdef CONFIG_LIBNL_TINY - DRV_LIBS += -lnl-tiny - else - DRV_LIBS += -lnl - endif - - ifdef CONFIG_LIBNL20 - ifndef CONFIG_LIBNL_TINY - DRV_LIBS += -lnl-genl - endif - DRV_CFLAGS += -DCONFIG_LIBNL20 - endif -endif +NEED_LIBNL=y endif ifdef CONFIG_DRIVER_BSD @@ -171,11 +150,20 @@ endif ifdef CONFIG_VLAN_NETLINK ifdef CONFIG_FULL_DYNAMIC_VLAN +NEED_LIBNL=y +CONFIG_LIBNL3_ROUTE=y +endif +endif + +ifdef NEED_LIBNL ifdef CONFIG_LIBNL32 DRV_LIBS += -lnl-3 DRV_LIBS += -lnl-genl-3 + DRV_CFLAGS += -DCONFIG_LIBNL20 -I/usr/include/libnl3 +ifdef CONFIG_LIBNL3_ROUTE DRV_LIBS += -lnl-route-3 - DRV_CFLAGS += -DCONFIG_LIBNL20 + DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE +endif else ifdef CONFIG_LIBNL_TINY DRV_LIBS += -lnl-tiny @@ -184,13 +172,13 @@ else endif ifdef CONFIG_LIBNL20 - DRV_LIBS += -lnl-genl - DRV_LIBS += -lnl-route + ifndef CONFIG_LIBNL_TINY + DRV_LIBS += -lnl-genl + endif DRV_CFLAGS += -DCONFIG_LIBNL20 endif endif endif -endif ##### COMMON VARS DRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS)