You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lirc/0005-configure.ac-Use-pkg-c...

54 lines
1.4 KiB

From 192e627fa81c3e8df086801dea228cb2fdcbb8bb Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas.alec@gmail.com>
Date: Thu, 11 Dec 2014 11:24:27 +0100
Subject: [PATCH] configure.ac: Use pkg-config to locate ftdi.
This picks up changed locations e. g., in fedora-22.
---
configure.ac | 13 ++++++++++---
plugins/Makefile.am | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index aaba636..b32b1e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,11 +183,18 @@ AC_CHECK_HEADER(usb.h,[
],[
AM_CONDITIONAL([BUILD_USB],[false])]
)
-AC_CHECK_HEADER(ftdi.h,[
+PKG_CHECK_MODULES([FTDI],[libftdi],,[true])
+test -z "$FTDI_LIBS" && PKG_CHECK_MODULES([FTDI], [libftdi1],,[true])
+
+if test -n "$FTDI_LIBS"; then
+ CFLAGS="$CFLAGS $SYSTEMD_CFLAGS"
+ LDFLAGS="$LDFLAGS $FTDI_LIBS"
+ AC_DEFINE(HAVE_FTDI)
AM_CONDITIONAL([BUILD_FTDI],[true])
- ],[
+ AC_SUBST(FTDI_LIBS)
+else
AM_CONDITIONAL([BUILD_FTDI],[false])]
-)
+fi
AC_CHECK_HEADER(iguanaIR.h,[
AM_CONDITIONAL([BUILD_IGUANAIR],[true])
],[
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 175b025..07cf187 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -47,7 +47,7 @@ endif
if BUILD_FTDI
plugin_LTLIBRARIES += ftdi.la
ftdi_la_SOURCES = ftdi.c
-ftdi_la_LDFLAGS = $(AM_LDFLAGS) -lftdi
+ftdi_la_LDFLAGS = $(AM_LDFLAGS) @FTDI_LIBS@
endif
if BUILD_IGUANAIR
--
1.9.3