diff options
author | Vadim Kochan <vadim4j@gmail.com> | 2016-08-04 19:30:18 +0300 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-08-05 10:54:52 +0200 |
commit | c831bcda3e2638c55b286bd538415ea79f510cdb (patch) | |
tree | c1ef44e3beb40e51f30487faf81c6127ea6c77b9 /trafgen/Makefile | |
parent | e6b7339a68ce57244117e2470f87ff581520cfc7 (diff) |
trafgen: Allow to compile without libnl
trafgen uses libnl only to inject mac80211 frames but
it might be not needed in some embedded or switch environments.
Let's make it possible to disable this feature.
In case the `--rfraw' option is used, the user will get a panic
message.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen/Makefile')
-rw-r--r-- | trafgen/Makefile | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/trafgen/Makefile b/trafgen/Makefile index 3f78f07..876ed93 100644 --- a/trafgen/Makefile +++ b/trafgen/Makefile @@ -1,6 +1,9 @@ -trafgen-libs = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs libnl-3.0) \ - $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs libnl-genl-3.0) \ - -lm +trafgen-libs = -lm + +ifeq ($(CONFIG_LIBNL), 1) +trafgen-libs += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs libnl-3.0) \ + $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs libnl-genl-3.0) +endif trafgen-objs = xmalloc.o \ die.o \ @@ -13,7 +16,6 @@ trafgen-objs = xmalloc.o \ str.o \ sig.o \ sock.o \ - mac80211.o \ ring_tx.o \ ring.o \ timer.o \ @@ -27,13 +29,20 @@ trafgen-objs = xmalloc.o \ trafgen_parser.tab.o \ trafgen.o +ifeq ($(CONFIG_LIBNL), 1) +trafgen-objs += mac80211.o +endif + trafgen-lex = trafgen_lexer.yy.o trafgen-yaac = trafgen_parser.tab.o +trafgen-eflags = -I.. + +ifeq ($(CONFIG_LIBNL), 1) trafgen-eflags = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --cflags libnl-3.0) \ - $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --cflags libnl-genl-3.0) \ - -I.. + $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --cflags libnl-genl-3.0) +endif trafgen-confs = trafgen_stddef.h |