2 dnl Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program; if not, write to the Free Software
15 dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 AC_DEFUN([GNASH_PATH_LIRC],
19 dnl Look for the header
20 AC_ARG_WITH(lirc_incl, AC_HELP_STRING([--with-lirc-incl], [directory where Lirc header is (w/out the lirc/ prefix)]), with_lirc_incl=${withval})
21 AC_CACHE_VAL(ac_cv_path_lirc_incl,[
22 if test x"${with_lirc_incl}" != x ; then
23 if test -f ${with_lirc_incl}/lirc_client.h ; then
24 ac_cv_path_lirc_incl="-I`(cd ${with_lirc_incl}; pwd)`"
26 AC_MSG_ERROR([${with_lirc_incl} directory doesn't contain lirc/lirc.h])
31 AC_ARG_WITH(lirc_lib, AC_HELP_STRING([--with-lirc-lib], [directory where lirc library is]), with_lirc_lib=${withval})
32 AC_CACHE_VAL(ac_cv_path_lirc_lib,[
33 if test x"${with_lirc_lib}" != x ; then
34 if test -f ${with_lirc_lib}/liblirc_client.a -o -f ${with_lirc_lib}/liblirc_client.${shlibext}; then
35 ac_cv_path_lirc_lib="-L`(cd ${with_lirc_lib}; pwd)` -llirc_client"
37 AC_MSG_ERROR([${with_lirc_lib} directory doesn't contain liblirc.])
42 if test x"${ext_lirc}" = x"yes"; then
43 dnl If the path hasn't been specified, go look for it.
44 if test x"${ac_cv_path_lirc_incl}" = x; then
45 for i in $incllist; do
46 if test -f $i/lirc/lirc_client.h; then
47 ac_cv_path_lirc_incl="-I$i"
52 if test x"${ac_cv_path_lirc_incl}" = x ; then
53 AC_CHECK_HEADERS(lirc/lirc_client.h)
56 AC_MSG_CHECKING([for Lirc header])
57 if test x"${ac_cv_path_lirc_incl}" != x ; then
64 dnl If the path hasn't been specified, go look for it.
65 if test x"${ac_cv_path_lirc_lib}" = x; then
66 dnl lirc-config gives us way to many libraries, which create nasty linking
67 dnl dependancy issue, so we strip them off here. The real dependencies are
68 dnl are taken care of by other config tests.
69 AC_MSG_CHECKING([for lirc_client library])
70 for i in $libslist; do
71 if test -f $i/liblirc_client.a -o -f $i/liblirc_client.${shlibext}; then
72 if test x"$i" != x"/usr/lib" -o x"$i" != x"/usr/lib64"; then
73 ac_cv_path_lirc_lib="-L$i -llirc_client"
74 AC_MSG_RESULT(${ac_cv_path_lirc_lib})
77 ac_cv_path_lirc_lib="-llirc_client"
85 if test x"${ac_cv_path_lirc_incl}" != x ; then
86 if test x"${ac_cv_path_lirc_incl}" != x"/usr/include"; then
87 LIRC_CFLAGS="${ac_cv_path_lirc_incl}"
93 if test x"${ac_cv_path_lirc_lib}" != x ; then
94 if test ! x"${ac_cv_path_lirc_lib}" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
95 LIRC_LIBS="${ac_cv_path_lirc_lib}"
96 AC_DEFINE(HAVE_LIRC, [1], [Has Lirc])
103 AC_SUBST(LIRC_CFLAGS)
110 # indent-tabs-mode: nil