summaryrefslogtreecommitdiff
blob: 7e476e5d46d823f939ead5ca443ce904f1ff49d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- a/configure.ac
+++ b/configure.ac
@@ -284,14 +284,30 @@
     [AS_HELP_STRING([--without-liblircclient], [Disable remote control support via liblircclient (enabled by default)])],
     [if test "$withval" = "yes"; then lirc="yes"; else lirc="no"; fi], [lirc="yes"])
 if test "$lirc" = "yes"; then
-    PKG_CHECK_MODULES([liblircclient], [liblircclient0 >= 0.0], [HAVE_LIBLIRCCLIENT=1], [HAVE_LIBLIRCCLIENT=0])
+    CPPFLAGS_BAK="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS $xliblircclient_CFLAGS"
+    AC_SUBST([liblircclient_CFLAGS])
+    AC_CHECK_HEADERS([lirc_client.h],
+                     [HAVE_LIBLIRCCLIENT=1],
+                     [HAVE_LIBLIRCCLIENT=0])
+    if test "HAVE_LIBLIRCCLIENT" = "1"; then
+        LDFLAGS_BAK="$LDFLAGS"
+        LDFLAGS="$LDFLAGS $xliblircclient_LDFLAGS"
+        AC_SUBST([liblircclient_LDFLAGS])
+        AC_CHECK_LIB([lirc_client],
+                     [lirc_deinit],
+                     [HAVE_LIBLIRCCLIENT=1],
+                     [HAVE_LIBLIRCCLIENT=0])
+        LDFLAGS="$LDFLAGS_BAK"
+    fi
+    CPPFLAGS="$CPPFLAGS_BAK"
     if test "$HAVE_LIBLIRCCLIENT" != "1"; then
         AC_MSG_WARN([optional library liblircclient not found:])
         AC_MSG_WARN([$liblircclient_PKG_ERRORS])
         AC_MSG_WARN([liblircclient is provided by LIRC; Debian package: liblircclient-dev])
 	lirc="no"
     else
-        LIBLIRCCLIENT_PKGCONFIG_VERSION="\"`$PKG_CONFIG --modversion liblircclient0`\""
+        LIBLIRCCLIENT_PKGCONFIG_VERSION="\"system\""
     fi
 else
     HAVE_LIBLIRCCLIENT=0