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 <a.s.kartashev@gmail.com>
This commit is contained in:
Andrey Kartashev 2018-09-14 11:17:29 +02:00 committed by Jouni Malinen
parent a07b8a70b5
commit 41b747522e
2 changed files with 39 additions and 63 deletions

View file

@ -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)

View file

@ -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)