Use the compiler to find libftdi
The libfdti detection, using ldconfig, only searches for the build architecture libftdi, which means infnoise can't be cross-compiled. By checking whether the compiler knows about the library we can check for the host architecture's library and support build scenarios which ldconfig doesn't know about, in particular cross-building.
This commit is contained in:
committed by
Stephen Kitt
parent
91758038cb
commit
4a9cc66d1e
@@ -10,7 +10,7 @@ CFLAGS = -Wall -Wextra -Werror -std=c99 -O3 -fPIC -I Keccak -I /usr/include/libf
|
||||
-DGIT_DATE=\"$(GIT_DATE)\"\
|
||||
-DLINUX
|
||||
|
||||
FOUND = $(shell /sbin/ldconfig -p | grep --silent libftdi.so && echo found)
|
||||
FOUND = $(shell $(CC) -o /dev/null -x c /dev/null -shared -lftdi 2>/dev/null && echo found)
|
||||
ifeq ($(FOUND), found)
|
||||
FTDI= -lftdi
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user