Commit 404e6ad2 authored by Vasco Guita's avatar Vasco Guita Committed by Federico Vaga

Include libftdi from SDK if libftdi-config is not installed

parent c84f4850
...@@ -47,11 +47,16 @@ LIBFTDI_CONFIG = $(shell command -v libftdi1-config) ...@@ -47,11 +47,16 @@ LIBFTDI_CONFIG = $(shell command -v libftdi1-config)
ifeq ($(LIBFTDI_CONFIG),) ifeq ($(LIBFTDI_CONFIG),)
LIBFTDI_CONFIG = $(shell command -v libftdi-config) LIBFTDI_CONFIG = $(shell command -v libftdi-config)
endif endif
LIBFTDI_INC := $(shell $(LIBFTDI_CONFIG) --cflags) ifeq ($(LIBFTDI_CONFIG),)
LIBFTDI_LIBS := $(shell $(LIBFTDI_CONFIG) --libs) CFLAGS += -DLIBFTDI1
LDLIBS += -lftdi1
else
LIBFTDI_INC := $(shell $(LIBFTDI_CONFIG) --cflags)
LIBFTDI_LIBS := $(shell $(LIBFTDI_CONFIG) --libs)
CFLAGS += $(LIBFTDI_INC)
LDLIBS += $(LIBFTDI_LIBS)
endif
CFLAGS += $(LIBFTDI_INC)
LDLIBS += $(LIBFTDI_LIBS)
LDLIBS += -ludev LDLIBS += -ludev
CPPCHECK ?= cppcheck CPPCHECK ?= cppcheck
......
...@@ -20,7 +20,11 @@ ...@@ -20,7 +20,11 @@
#include <sys/time.h> #include <sys/time.h>
#include <libusb-1.0/libusb.h> #include <libusb-1.0/libusb.h>
#ifdef LIBFTDI1
#include <libftdi1/ftdi.h>
#else
#include <ftdi.h> #include <ftdi.h>
#endif
#include "liboattnusb.h" #include "liboattnusb.h"
#include "liboattnusb-i.h" #include "liboattnusb-i.h"
......
...@@ -15,7 +15,11 @@ ...@@ -15,7 +15,11 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <libusb-1.0/libusb.h> #include <libusb-1.0/libusb.h>
#ifdef LIBFTDI1
#include <libftdi1/ftdi.h>
#else
#include <ftdi.h> #include <ftdi.h>
#endif
#include "liboattnusb.h" #include "liboattnusb.h"
#include "liboattnusb-i.h" #include "liboattnusb-i.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment