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