OLSR_LICENSE_FILES = license.txt lib/pud/nmealib/LICENSE
OLSR_DEPENDENCIES = host-flex host-bison
+OLSR_CFLAGS = $(TARGET_CFLAGS)
+
+# it needs -fPIC to link on lot of architectures
+OLSR_CFLAGS += -fPIC
+
define OLSR_BUILD_CMDS
- $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) -C $(@D) olsrd
+ $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) \
+ CFLAGS="$(OLSR_CFLAGS)" -C $(@D) olsrd
$(foreach p,$(OLSR_PLUGINS), \
- $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) -C $(@D)/lib/$(p)
+ $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) \
+ CFLAGS="$(OLSR_CFLAGS)" -C $(@D)/lib/$(p)
)
endef