Add automated test on delayed return value handling in ExternalInterface.call().
[gnash.git] / macros / lirc.m4
blobbf1cdf0dd76089be95466a1653ee7638a1d918ee
1 dnl  
2 dnl  Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3 dnl  2011 Free Software Foundation, Inc.
4 dnl  
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.
9 dnl  
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)`"
26       else
27               AC_MSG_ERROR([${with_lirc_incl} directory doesn't contain lirc/lirc.h])
28       fi
29     fi
30   ])
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"
37       else
38         AC_MSG_ERROR([${with_lirc_lib} directory doesn't contain liblirc.])
39       fi
40     fi
41   ])
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"
49                 break
50         fi
51       done
53       if test x"${ac_cv_path_lirc_incl}" = x ; then
54         AC_CHECK_HEADERS(lirc/lirc_client.h)
55       fi
57       AC_MSG_CHECKING([for Lirc header])
58       if test x"${ac_cv_path_lirc_incl}" != x ; then
59         AC_MSG_RESULT(yes)
60       else
61         AC_MSG_RESULT(no)
62       fi
63     fi
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})
76             break
77           else
78             ac_cv_path_lirc_lib="-llirc_client"
79             AC_MSG_RESULT(yes)
80             break
81           fi
82         fi
83       done
84     fi
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}"
89       fi
90     else
91       LIRC_CFLAGS=""
92     fi
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])
98       fi
99     else
100       LIRC_LIBS=""
101     fi
102   fi
104   AC_SUBST(LIRC_CFLAGS)
105   AC_SUBST(LIRC_LIBS)
108 # Local Variables:
109 # c-basic-offset: 2
110 # tab-width: 2
111 # indent-tabs-mode: nil
112 # End: